国内外政策-列表修改

This commit is contained in:
zyn
2023-09-21 10:58:52 +08:00
parent 6ff1ae6e15
commit c4bc87705c
2 changed files with 64 additions and 29 deletions
@@ -347,7 +347,7 @@
v-model="sarLawsStandEO['TGDWLAWS']" v-model="sarLawsStandEO['TGDWLAWS']"
placeholder="选择投稿单位" placeholder="选择投稿单位"
readonly readonly
@click.native="choiceZRBM('dep', '选择投稿单位', sarLawsStandEO.TGDWLAWSId)"> @click.native="choiceZRBM('dep', '选择投稿单位', sarLawsStandEO.TGDWLAWSID)">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="field.attrField === 'ZRBMLAWS'" <el-form-item v-if="field.attrField === 'ZRBMLAWS'"
@@ -362,7 +362,7 @@
v-model="sarLawsStandEO['ZRBMLAWS']" v-model="sarLawsStandEO['ZRBMLAWS']"
placeholder="选择责任部门" placeholder="选择责任部门"
readonly readonly
@click.native="choiceZRBM('dep', '选择责任部门', sarLawsStandEO.ZRBMLAWSId)"> @click.native="choiceZRBM('dep', '选择责任部门', sarLawsStandEO.ZRBMLAWSID)">
</el-input> </el-input>
</el-form-item> </el-form-item>
</template> </template>
@@ -1066,14 +1066,27 @@ export default {
if(res.data){ if(res.data){
const item = res.data || {} const item = res.data || {}
this.sarLawsStandEO = JSON.parse(JSON.stringify(item)) 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['lawsSycx'] = this.filterObj(this.sarLawsStandEO['lawsSycx'])
// 标签
this.sarLawsStandEO['lawsLabel'] = this.filterObj(this.sarLawsStandEO['lawsLabel']) this.sarLawsStandEO['lawsLabel'] = this.filterObj(this.sarLawsStandEO['lawsLabel'])
this.sarLawsStandEO['YYRZLAWS'] = this.filterObj(this.sarLawsStandEO['YYRZLAWS']) // this.sarLawsStandEO['YYRZLAWS'] = this.filterObj(this.sarLawsStandEO['YYRZLAWS'])
this.sarLawsStandEO['NYLXLAWS'] = this.filterObj(this.sarLawsStandEO['NYLXLAWS']) // 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['TGRLAWS'] = this.filterObj(this.sarLawsStandEO['TGRLAWS'])
// 投稿单位
this.sarLawsStandEO['TGDWLAWS'] = this.filterObj(this.sarLawsStandEO['TGDWLAWS']) 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 = [] const dateArr = []
if(this.sarLawsStandEO.commentCycleStart && this.sarLawsStandEO.commentCycleEnd){ if(this.sarLawsStandEO.commentCycleStart && this.sarLawsStandEO.commentCycleEnd){
dateArr[0] = this.sarLawsStandEO.commentCycleStart dateArr[0] = this.sarLawsStandEO.commentCycleStart
@@ -1081,20 +1094,14 @@ export default {
this.commentCycleDate2 = dateArr this.commentCycleDate2 = dateArr
} }
this.sarLawsStandEO["XCSJBUSS"] = this.dateFormatter() this.sarLawsStandEO["XCSJBUSS"] = this.dateFormatter()
let subClass = item.standSubclass // let subClass = item.standSubclass
this.sarLawsStandEO.standSubclass = subClass // this.sarLawsStandEO.standSubclass = subClass
if (this.sarLawsStandEO.issueTime != null && this.sarLawsStandEO.issueTime !== '') { if (this.sarLawsStandEO.issueTime != null && this.sarLawsStandEO.issueTime !== '') {
this.sarLawsStandEO.issueTime = new Date(this.sarLawsStandEO.issueTime) this.sarLawsStandEO.issueTime = new Date(this.sarLawsStandEO.issueTime)
} }
if (this.sarLawsStandEO.putTime != null && this.sarLawsStandEO.putTime !== '') { if (this.sarLawsStandEO.putTime != null && this.sarLawsStandEO.putTime !== '') {
this.sarLawsStandEO.putTime = new Date(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.sarLawsStandEO['id'] = item.id
this.drawerTitle = '修改政策标准' this.drawerTitle = '修改政策标准'
this.modalshowflag = true this.modalshowflag = true
@@ -1488,6 +1495,7 @@ export default {
console.log("-----------------------------") console.log("-----------------------------")
console.log(attrField) console.log(attrField)
}, },
// 字符串转数组
filterObj(obj){ filterObj(obj){
if(obj && obj !== ''){ if(obj && obj !== ''){
if(obj instanceof Array){ if(obj instanceof Array){
@@ -1628,6 +1636,8 @@ export default {
}) })
}, },
choice(type, title, nameId) { choice(type, title, nameId) {
console.log(nameId)
// 管理员(admin),张兰英(zhanglanying) => ['admin', 'zhanglanying']
this.nodeList = [] this.nodeList = []
if (nameId) { if (nameId) {
let nameId1 = nameId.split(',') let nameId1 = nameId.split(',')
@@ -1674,7 +1684,7 @@ export default {
} }
this.$set(this.sarLawsStandEO, field, nameList) this.$set(this.sarLawsStandEO, field, nameList)
if (this.choiceTitle === '选择投稿人') { 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(",") this.sarLawsStandEO.TGDWLAWS = this.unique(data.map(item => item.topUnit)).join(",")
} }
}, },
@@ -1697,12 +1707,12 @@ export default {
let id = '' let id = ''
switch (this.choiceTitle) { switch (this.choiceTitle) {
case '选择投稿单位': case '选择投稿单位':
id = 'TGDWLAWSId' id = 'TGDWLAWSID'
field = 'TGDWLAWS' field = 'TGDWLAWS'
break break
case '选择责任部门': case '选择责任部门':
field = 'ZRBMLAWS' field = 'ZRBMLAWS'
id = 'ZRBMLAWSId' id = 'ZRBMLAWSID'
break break
} }
this.sarLawsStandEO[id] = idList; this.sarLawsStandEO[id] = idList;
@@ -64,9 +64,9 @@
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.issueTime }}</a> <a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ formatDate(scope.row.issueTime) }}</a>
<a v-else-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.issueTime }}</a> <a v-else-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ formatDate(scope.row.issueTime) }}</a>
<a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.issueTime }}</a> <a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ formatDate(scope.row.issueTime) }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@@ -77,9 +77,9 @@
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.SSRQLAWS }}</a> <a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ formatDate(scope.row.SSRQLAWS) }}</a>
<a v-else-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.SSRQLAWS }}</a> <a v-else-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ formatDate(scope.row.SSRQLAWS) }}</a>
<a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.SSRQLAWS }}</a> <a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ formatDate(scope.row.SSRQLAWS) }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@@ -89,9 +89,9 @@
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsSycx }}</a> <a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ convert(scope.row.lawsSycx, 'lawsSycxOptions') }}</a>
<a v-else-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsSycx }}</a> <a v-else-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ convert(scope.row.lawsSycx, 'lawsSycxOptions') }}</a>
<a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsSycx }}</a> <a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ convert(scope.row.lawsSycx, 'lawsSycxOptions') }}</a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@@ -238,7 +238,8 @@ export default {
total: 0, total: 0,
loading: false, loading: false,
selectedList: [], selectedList: [],
formFieldListData: [] formFieldListData: [],
dict: {}
} }
}, },
components: { components: {
@@ -254,7 +255,7 @@ export default {
selectSarMenu: { selectSarMenu: {
type: Object, type: Object,
required: true required: true
}, }
}, },
watch: { watch: {
selectedList: { selectedList: {
@@ -266,6 +267,7 @@ export default {
}, },
created() { created() {
this.getBussionStandTable() this.getBussionStandTable()
this.getDicTypeListCode()
}, },
mounted() { mounted() {
// 加载动态表单数据 // 加载动态表单数据
@@ -653,6 +655,29 @@ export default {
} }
}, e => {}) }, e => {})
}, },
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 => {
})
},
} }
} }
</script> </script>