diff --git a/src/pages/policyRegulation/policy/components/editDrawer.vue b/src/pages/policyRegulation/policy/components/editDrawer.vue index bec60e61d..efde50554 100644 --- a/src/pages/policyRegulation/policy/components/editDrawer.vue +++ b/src/pages/policyRegulation/policy/components/editDrawer.vue @@ -347,7 +347,7 @@ v-model="sarLawsStandEO['TGDWLAWS']" placeholder="选择投稿单位" readonly - @click.native="choiceZRBM('dep', '选择投稿单位', sarLawsStandEO.TGDWLAWSId)"> + @click.native="choiceZRBM('dep', '选择投稿单位', sarLawsStandEO.TGDWLAWSID)"> + @click.native="choiceZRBM('dep', '选择责任部门', sarLawsStandEO.ZRBMLAWSID)"> @@ -1066,14 +1066,27 @@ export default { if(res.data){ const item = res.data || {} this.sarLawsStandEO = JSON.parse(JSON.stringify(item)) - this.sarLawsStandEO['lawsSyqy'] = this.filterObj(this.sarLawsStandEO['lawsSyqy']) + Object.keys(item.attrInfoMap || {}).forEach((key) => { + if (item.attrInfoMap[key]) { + this.$set(this.sarLawsStandEO, key, item.attrInfoMap[key]) + } + }) + // 适用区域 + // this.sarLawsStandEO['lawsSyqy'] = this.filterObj(this.sarLawsStandEO['lawsSyqy']) + // 适用车型 this.sarLawsStandEO['lawsSycx'] = this.filterObj(this.sarLawsStandEO['lawsSycx']) + // 标签 this.sarLawsStandEO['lawsLabel'] = this.filterObj(this.sarLawsStandEO['lawsLabel']) - this.sarLawsStandEO['YYRZLAWS'] = this.filterObj(this.sarLawsStandEO['YYRZLAWS']) - this.sarLawsStandEO['NYLXLAWS'] = this.filterObj(this.sarLawsStandEO['NYLXLAWS']) - this.sarLawsStandEO['TGRLAWS'] = this.filterObj(this.sarLawsStandEO['TGRLAWS']) - this.sarLawsStandEO['ZRBMLAWS'] = this.filterObj(this.sarLawsStandEO['ZRBMLAWS']) + // this.sarLawsStandEO['YYRZLAWS'] = this.filterObj(this.sarLawsStandEO['YYRZLAWS']) + // this.sarLawsStandEO['NYLXLAWS'] = this.filterObj(this.sarLawsStandEO['NYLXLAWS']) + //投稿人 + // this.sarLawsStandEO['TGRLAWS'] = this.filterObj(this.sarLawsStandEO['TGRLAWS']) + // 投稿单位 this.sarLawsStandEO['TGDWLAWS'] = this.filterObj(this.sarLawsStandEO['TGDWLAWS']) + this.sarLawsStandEO['TGDWLAWSID'] = this.filterObj(this.sarLawsStandEO['TGDWLAWSID']) + // 责任部门 + this.sarLawsStandEO['ZRBMLAWS'] = this.filterObj(this.sarLawsStandEO['ZRBMLAWS']) + this.sarLawsStandEO['ZRBMLAWSID'] = this.filterObj(this.sarLawsStandEO['ZRBMLAWSID']) const dateArr = [] if(this.sarLawsStandEO.commentCycleStart && this.sarLawsStandEO.commentCycleEnd){ dateArr[0] = this.sarLawsStandEO.commentCycleStart @@ -1081,20 +1094,14 @@ export default { this.commentCycleDate2 = dateArr } this.sarLawsStandEO["XCSJBUSS"] = this.dateFormatter() - let subClass = item.standSubclass - this.sarLawsStandEO.standSubclass = subClass + // let subClass = item.standSubclass + // this.sarLawsStandEO.standSubclass = subClass if (this.sarLawsStandEO.issueTime != null && this.sarLawsStandEO.issueTime !== '') { this.sarLawsStandEO.issueTime = new Date(this.sarLawsStandEO.issueTime) } if (this.sarLawsStandEO.putTime != null && this.sarLawsStandEO.putTime !== '') { this.sarLawsStandEO.putTime = new Date(this.sarLawsStandEO.putTime) } - Object.keys(item.attrInfoMap || {}).forEach((key) => { - if (item.attrInfoMap[key]) { - // this.sarStandardsInfoEO[key] = item.attrInfoMap[key] - this.$set(this.sarLawsStandEO, key, item.attrInfoMap[key]) - } - }) this.sarLawsStandEO['id'] = item.id this.drawerTitle = '修改政策标准' this.modalshowflag = true @@ -1488,6 +1495,7 @@ export default { console.log("-----------------------------") console.log(attrField) }, + // 字符串转数组 filterObj(obj){ if(obj && obj !== ''){ if(obj instanceof Array){ @@ -1628,6 +1636,8 @@ export default { }) }, choice(type, title, nameId) { + console.log(nameId) + // 管理员(admin),张兰英(zhanglanying) => ['admin', 'zhanglanying'] this.nodeList = [] if (nameId) { let nameId1 = nameId.split(',') @@ -1674,7 +1684,7 @@ export default { } this.$set(this.sarLawsStandEO, field, nameList) if (this.choiceTitle === '选择投稿人') { - this.sarLawsStandEO.TGDWLAWSId = this.unique(data.map(item => item.topUnitId)).join(",") + this.sarLawsStandEO.TGDWLAWSID = this.unique(data.map(item => item.topUnitId)).join(",") this.sarLawsStandEO.TGDWLAWS = this.unique(data.map(item => item.topUnit)).join(",") } }, @@ -1697,12 +1707,12 @@ export default { let id = '' switch (this.choiceTitle) { case '选择投稿单位': - id = 'TGDWLAWSId' + id = 'TGDWLAWSID' field = 'TGDWLAWS' break case '选择责任部门': field = 'ZRBMLAWS' - id = 'ZRBMLAWSId' + id = 'ZRBMLAWSID' break } this.sarLawsStandEO[id] = idList; diff --git a/src/pages/policyRegulation/policy/components/mainTable.vue b/src/pages/policyRegulation/policy/components/mainTable.vue index cd32d1d28..e4e4a43c0 100644 --- a/src/pages/policyRegulation/policy/components/mainTable.vue +++ b/src/pages/policyRegulation/policy/components/mainTable.vue @@ -64,9 +64,9 @@ min-width="120" > {}) }, + convert(value, dict) { + if (this.dict[dict]) { + return this.dict[dict].find(item => item.value === value)?.label || value + } else { + return value + } + }, + formatDate (dateStr) { + if (dateStr && dateStr!== '') { + let dateArr = dateStr.split(',') + return dateArr.map(date => date.slice(0,10)).join(',') + } + return dateStr + }, + getDicTypeListCode () { + this.$http.get('sys/dictype/getDicTypeListCode', '', { + _this: this + }, res => { + // this.dict.lawsSycxOptions = res.data.lawsSycx// 政策_适用车型 + this.$set(this.dict, 'lawsSycxOptions', res.data.lawsSycx) + }, e => { + }) + }, } }