From 441592aeea14924b6d03b8af8b56214c206c093b Mon Sep 17 00:00:00 2001 From: mch <1332099529@qq.com> Date: Fri, 4 Aug 2023 11:36:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=84=A6=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/basic-dictionary/BirthPlace.vue | 23 ++++++++++++++----- src/views/basic-dictionary/GuideType.vue | 23 ++++++++++++++----- .../basic-dictionary/MedicalReportType.vue | 7 +++++- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/views/basic-dictionary/BirthPlace.vue b/src/views/basic-dictionary/BirthPlace.vue index e549964..54d3467 100644 --- a/src/views/basic-dictionary/BirthPlace.vue +++ b/src/views/basic-dictionary/BirthPlace.vue @@ -219,6 +219,7 @@ export default { tableData: [], isshow: true, initTableData: [], + curRow: {}, }; }, created() { @@ -248,8 +249,9 @@ export default { // console.log(res); // }); - this.form = row; - console.log(row); + this.curRow = { ...row }; + console.log(this.curRow); + // this.form = row; }, handleSizeChange(val) { this.pages.MaxResultCount = val; @@ -266,6 +268,7 @@ export default { }, //删除 delets(row) { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择删除的数据"); } else { @@ -339,6 +342,8 @@ export default { }); }, toppings() { + this.form = { ...this.curRow }; + if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { @@ -349,6 +354,7 @@ export default { } }, topping() { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { @@ -360,6 +366,7 @@ export default { }, //编辑弹框 edit(row) { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { @@ -378,10 +385,12 @@ export default { displayName: this.form.displayName, countryCode: this.form.countryCode, }).then((res) => { - this.$message.success("新增成功"); - this.form = {}; - this.getlist(); - this.dialogVisible = false; + if (res.code == 1) { + this.$message.success("新增成功"); + this.form = {}; + this.getlist(); + this.dialogVisible = false; + } }); } else if (this.form.displayName == "") { this.$message.warning("请输入名称"); @@ -408,8 +417,10 @@ export default { } }); }, + //新增弹框 add() { + this.form = { ...this.curRow }; this.dialogVisible = true; this.title = 1; this.form = {}; diff --git a/src/views/basic-dictionary/GuideType.vue b/src/views/basic-dictionary/GuideType.vue index 284ab9b..0af260c 100644 --- a/src/views/basic-dictionary/GuideType.vue +++ b/src/views/basic-dictionary/GuideType.vue @@ -165,7 +165,7 @@ :title="title == '1' ? '新增' : '修改'" :visible.sync="dialogVisible" width="75%" - :close-on-click-modal="false" + :close-on-click-modal="false" > @@ -235,7 +235,6 @@ { this.$refs.refinput.focus(); }); @@ -737,11 +748,11 @@ export default { }, //编辑弹框 editandmofin(row) { - if (this.form.id == undefined) { + if (this.curRow.id == undefined) { this.$message.warning("请选择编辑的数据"); } else { this.dialogVisible = true; - + this.form = { ...this.curRow }; console.log(row); this.title = 2; guideid(this.form.id).then((res) => { diff --git a/src/views/basic-dictionary/MedicalReportType.vue b/src/views/basic-dictionary/MedicalReportType.vue index 03f4031..301cf2c 100644 --- a/src/views/basic-dictionary/MedicalReportType.vue +++ b/src/views/basic-dictionary/MedicalReportType.vue @@ -255,6 +255,7 @@ export default { }, tableData: [], initTableData: [], + curRow:{}, }; }, created() { @@ -282,7 +283,7 @@ export default { rowick(row) { querids(row.id).then((res) => { console.log(res); - this.form = res.data; + this.curRow = { ...row }; }); console.log(row); }, @@ -354,6 +355,7 @@ export default { }, //置底 setlow(row) { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { @@ -366,6 +368,7 @@ export default { }, //置顶 topping() { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { @@ -377,6 +380,7 @@ export default { }, //删除 deleteid() { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else { @@ -400,6 +404,7 @@ export default { }, //编辑弹框 editreport() { + this.form = { ...this.curRow }; if (this.form.id == undefined) { this.$message.warning("请选择操作的数据"); } else {