diff --git a/src/api/template.js b/src/api/template.js index 9314a13..3a54495 100644 --- a/src/api/template.js +++ b/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 }) + } + }) } } diff --git a/src/components/drawerDialog/index.vue b/src/components/drawerDialog/index.vue index d7e2587..39deb17 100644 --- a/src/components/drawerDialog/index.vue +++ b/src/components/drawerDialog/index.vue @@ -502,7 +502,7 @@ prop="writeMode" label-width="150px" > - + {{ item }} @@ -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 = {