From 39f8a9fda65fea40d36db8ff87bf2040cba18c8a Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 19 Dec 2023 17:18:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=8F=90=E4=BA=A4=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sys/dept.vue | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/views/sys/dept.vue b/src/views/sys/dept.vue index bedf3fb6..fea18360 100644 --- a/src/views/sys/dept.vue +++ b/src/views/sys/dept.vue @@ -238,21 +238,20 @@ export default { this.isSaveing = true; var res; if (this.type === "add") { - res = this.$API.system.dept.create.req(that.addForm); + this.$API.system.dept.create.req(that.addForm).then(res=>{ + this.isSaveing = false; + this.limitedVisible = false; + this.$refs.table.refresh(); + }).catch(res=>{this.isSaveing = false;}); } else { - res = this.$API.system.dept.update.req( + this.$API.system.dept.update.req( that.addForm.id, that.addForm - ); - } - console.log(res); - debugger; - if (res.err_msg) { - this.$message.error(res.err_msg); - } else { - this.isSaveing = false; - this.limitedVisible = false; - this.$refs.table.refresh(); + ).then(res=>{ + this.isSaveing = false; + this.limitedVisible = false; + this.$refs.table.refresh(); + }).catch(res=>{this.isSaveing = false;}); } } });