From 5f1ac9f159ea92e35277e211db15a5322bb4a436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Mon, 20 Feb 2023 14:41:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/classifyItem/index.vue | 3 ++- src/views/system/stationClassify/index.vue | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/views/system/classifyItem/index.vue b/src/views/system/classifyItem/index.vue index a812b8c..7b365b9 100644 --- a/src/views/system/classifyItem/index.vue +++ b/src/views/system/classifyItem/index.vue @@ -509,7 +509,7 @@ export default { console.log(this.form); this.$refs["form"].validate((valid) => { if (valid) { - this.form.nurseClassifyInfoList[0].classifySort = parseInt(this.form.nurseClassifyInfoList[0].classifySort); + if (this.form.id != null) { updateInfo(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); @@ -522,6 +522,7 @@ export default { this.getList(); }); } else { + this.form.nurseClassifyInfoList[0].classifySort = parseInt(this.form.nurseClassifyInfoList[0].classifySort); addInfo(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false; diff --git a/src/views/system/stationClassify/index.vue b/src/views/system/stationClassify/index.vue index 54cfa49..e2e4375 100644 --- a/src/views/system/stationClassify/index.vue +++ b/src/views/system/stationClassify/index.vue @@ -280,6 +280,7 @@ export default { // 选中数组 ids: [], // 非单个禁用 + imgone:"", single: true, // 非多个禁用 multiple: true, @@ -406,8 +407,8 @@ export default { cancel() { if (this.editopen) { var obj = { pictureUrlList: [] }; - if (this.form.classifyPictureUrl != this.classifyPictureUrl) { - obj.pictureUrlList.push(this.classifyPictureUrl); + if (this.form.classifyPictureUrl != this.imgone) { + obj.pictureUrlList.push(this.form.classifyPictureUrl); } updatePicture(obj).then((res) => { this.editopen = false; @@ -481,6 +482,7 @@ export default { const id = row.id || this.ids; getStationClassify(id).then((response) => { this.form = response.data; + this.imgone = this.form.classifyPictureUrl; this.classifyPictureUrl = response.data.classifyPictureUrl; this.editopen = true; this.title = "修改护理机构分类信息"; @@ -488,22 +490,24 @@ export default { }, /** 提交按钮 */ submitForm() { + console.log(this.form); this.$refs["form"].validate((valid) => { if (valid) { - this.form.nurseClassifyInfoList[0].classifySort=parseInt( this.form.nurseClassifyInfoList[0].classifySort) + if (this.form.id != null) { updateStationClassify(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); - if (this.form.classifyPictureUrl != this.classifyPictureUrl) { + if (this.form.classifyPictureUrl != this.imgone) { var obj = { pictureUrlList: [] }; - obj.pictureUrlList.push(this.classifyPictureUrl); + obj.pictureUrlList.push(this.imgone); updatePicture(obj).then((res) => {}); } this.editopen = false; this.getList(); }); } else { + this.form.nurseClassifyInfoList[0].classifySort=parseInt(this.form.nurseClassifyInfoList[0].classifySort) addStationClassify(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false;