Browse Source

优化检验项目列的加载

添加删除检验项目列接口api
master
李磊 3 years ago
parent
commit
151a69239a
  1. 11
      src/api/template.js
  2. 41
      src/components/drawerDialog/index.vue

11
src/api/template.js

@ -29,5 +29,16 @@ export default {
return qs.stringify(params, { indices: false })
}
})
},
deleteTemplateJyxm: (params) => {
console.log(params)
return api({
url: '/templateJyxm',
method: 'delete',
params,
paramsSerializer: function(params) {
return qs.stringify(params, { indices: false })
}
})
}
}

41
src/components/drawerDialog/index.vue

@ -502,7 +502,7 @@
prop="writeMode"
label-width="150px"
>
<el-radio-group v-model="form.writeMode" @change="changeWriteMode">
<el-radio-group v-model="form.writeMode">
<el-radio v-for="(item, writeModeIndex) in writeModes" :key="writeModeIndex" :label="writeModeIndex" :disabled="(form.tableMode === 0 && writeModeIndex === 1) || (form.tableMode === 1 && writeModeIndex !== 1)">
{{ item }}
</el-radio>
@ -794,30 +794,6 @@ export default {
break
}
},
changeWriteMode() {
switch (this.form.writeMode) {
case 0:
case 2:
case 3:
this.form.tableMode = 0
this.form.tableIndex = 1
this.form.tableStartRow = 1
this.form.tableRowCount = this.form.tableRowFindMode ? 0 : 1
this.form.affiliatedTableStartRow = 0
this.form.affiliatedTableRowCount = 0
break
case 1:
this.form.tableMode = 1
this.form.tableIndex = 0
this.form.tableStartRow = 0
this.form.tableRowCount = 0
this.form.affiliatedTableStartRow = 0
this.form.affiliatedTableRowCount = 0
break
default:
break
}
},
changeTableRowFindMode() {
this.form.tableRowCount = 0
this.form.affiliatedTableRowCount = 0
@ -872,9 +848,10 @@ export default {
// })
this.list = data.list
this.totalCount = data.total * 1
this.gridData = []
if (data.list[0]) {
this.getDemoList(data.list[0].id)
this.templateSettingId = data.list[0].id
this.getDemoList()
}
})
},
@ -888,7 +865,7 @@ export default {
deleteFn(row, index) {
const arr = []
arr.push(row.id)
TemplateApi.deleteSettingFn({
TemplateApi.deleteTemplateJyxm({
ids: arr
}).then((data) => {
this.getDemoList()
@ -898,9 +875,13 @@ export default {
//
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1
},
getDemoList(id) {
getDemoList() {
if (!this.templateSettingId) {
this.$notify.error('未正确提供模板设置主键,无法加载检验项目列配置数据!')
return
}
//
this.jyxmParams.templateSettingId = id
this.jyxmParams.templateSettingId = this.templateSettingId
this.jyxmParams.templateId = this.id
this.api({
url: '/templateJyxm/list',
@ -1150,7 +1131,7 @@ export default {
}
this.templateSettingId = row.id
this.$refs.settingList.toggleRowSelection(row)
this.getDemoList(row.id)
this.getDemoList()
},
clearForm() {
this.formTemplate = {

Loading…
Cancel
Save