fix: base systemdict提交时不刷新

This commit is contained in:
caoqianming 2024-08-01 09:03:45 +08:00
parent 1de0d342d5
commit bd04abe46e
1 changed files with 9 additions and 11 deletions

View File

@ -350,21 +350,19 @@
// //
dicSubmit(){ dicSubmit(){
let that = this; let that = this;
that.$refs.dicForm.validate(async (valid) => { that.$refs.dicForm.validate((valid) => {
if (valid) { if (valid) {
that.dicForm.type = typeof that.dicForm.type==='string'?that.dicForm.type:that.dicForm.type[0]; that.dicForm.type = typeof that.dicForm.type==='string'?that.dicForm.type:that.dicForm.type[0];
let res=null;
if(that.mode === 'addItem'){ 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{ }else{
res = that.$API.system.dict.update.req(this.editId,this.dicForm) that.$API.system.dict.update.req(this.editId,this.dicForm).then(res=>{
} that.visibleDicItem = false;
if(res.err_msg){ that.$refs.table.refresh()
that.$alert(res.message, "提示", {type: 'error'}) })
}else{
that.$message.success("操作成功");
that.visibleDicItem = false;
that.$refs.table.refresh()
} }
} }
}) })