From 151a69239a77dd04e31a419a9b70ea1bea307f19 Mon Sep 17 00:00:00 2001 From: zichen1019 <1510748736@qq.com> Date: Wed, 11 Aug 2021 09:26:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A3=80=E9=AA=8C=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=88=97=E7=9A=84=E5=8A=A0=E8=BD=BD=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=A0=E9=99=A4=E6=A3=80=E9=AA=8C=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E6=8E=A5=E5=8F=A3api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/template.js | 11 +++++++ src/components/drawerDialog/index.vue | 41 +++++++-------------------- 2 files changed, 22 insertions(+), 30 deletions(-) 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 = {