Browse Source

优化页面编辑

master
李磊 3 years ago
parent
commit
bfae974cd2
  1. 48
      src/components/drawerDialog/index.vue

48
src/components/drawerDialog/index.vue

@ -57,8 +57,8 @@
placeholder="报告类型"
style="width: 215px"
clearable
@change="getDicCodeList"
>
<!-- @change="getDicCodeList" -->
<el-option
v-for="item in bglxList"
:key="item.value"
@ -161,6 +161,7 @@
v-model="formTemplate.withDicCode"
placeholder="对应字典"
style="width: 420px"
filterable
clearable
>
<el-option
@ -176,6 +177,7 @@
v-model="formTemplate.parentId"
placeholder="父类模板"
style="width: 420px"
filterable
clearable
>
<el-option
@ -870,12 +872,12 @@ export default {
if (this.id) {
this.loadFormData(this.index)
this.getList()
} else {
this.$refs['formTemplate'].resetFields()
} else if (this.$refs.formTemplate) {
this.$refs.formTemplate.resetFields()
this.clearForm()
this.getBglxList()
}
this.getSbList(undefined, undefined, 1)
this.getBglxList()
this.getJylbList()
this.getTemplateIdentification()
},
@ -1023,10 +1025,6 @@ export default {
}
}
},
handleSettingChange(row) {
this.moduleArr = row
// this.getDemoList(row.id)
},
getTemplateIdentification() {
this.api({
url: '/dicData/getDicDataByTypeCode',
@ -1061,7 +1059,7 @@ export default {
)
},
getBglxList() {
this.api({
return this.api({
url: '/dicData/getDicDataByTypeCode',
method: 'get',
params: {
@ -1122,20 +1120,24 @@ export default {
}
})
},
getDicCodeList(val) {
for (let i = 0; i < this.bglxList.length; i++) {
if (val === 1) {
this.dicCodeList = []
break
} else if (val === this.bglxList[i].value) {
this.getDicDataByTypeCode(
this.bglxList[i].code,
'dicCode',
this.bglxList[i].id
)
break
}
getDicCodeList(val, resetWithDicCode) {
// 0.
if (resetWithDicCode) {
this.formTemplate.withDicCode = undefined
}
// 1.
if (val === 1) {
this.dicCodeList = []
return
}
// 2.
const bglxs = this.bglxList.filter(row => row.value === val)
if (!bglxs.length) {
return
}
// 3.
const bglx = bglxs[0]
this.getDicDataByTypeCode(bglx.code, 'dicCode', bglx.id)
},
getNeibuList(type, parentCode, species) {
this.api({
@ -1169,7 +1171,7 @@ export default {
this.formTemplate.shebeipinzhongdaima
)
this.neibuleibie = JSON.parse(this.formTemplate.neibuleibie)
this.getDicCodeList(this.formTemplate.bglx)
this.getBglxList().then(() => this.getDicCodeList(this.formTemplate.bglx, false))
this.getNeibuList(
'nblb',
this.formTemplate.jianyanleibie,

Loading…
Cancel
Save