diff --git a/src/views/sys/dict.vue b/src/views/sys/dict.vue index d0a8929a..1d4e8aad 100644 --- a/src/views/sys/dict.vue +++ b/src/views/sys/dict.vue @@ -350,21 +350,19 @@ //提交字典 dicSubmit(){ let that = this; - that.$refs.dicForm.validate(async (valid) => { + that.$refs.dicForm.validate((valid) => { if (valid) { that.dicForm.type = typeof that.dicForm.type==='string'?that.dicForm.type:that.dicForm.type[0]; - let res=null; if(that.mode === 'addItem'){ - res = that.$API.system.dict.create.req(this.dicForm) + that.$API.system.dict.create.req(this.dicForm).then(res=>{ + that.visibleDicItem = false; + that.$refs.table.refresh() + }) }else{ - res = that.$API.system.dict.update.req(this.editId,this.dicForm) - } - if(res.err_msg){ - that.$alert(res.message, "提示", {type: 'error'}) - }else{ - that.$message.success("操作成功"); - that.visibleDicItem = false; - that.$refs.table.refresh() + that.$API.system.dict.update.req(this.editId,this.dicForm).then(res=>{ + that.visibleDicItem = false; + that.$refs.table.refresh() + }) } } })