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;