类型管理
This commit is contained in:
parent
df0b11a8ce
commit
b829f91fc4
|
|
@ -1289,6 +1289,43 @@ export default {
|
||||||
this.addFormParams.typeName = data.label
|
this.addFormParams.typeName = data.label
|
||||||
this.addTitleVisible = true
|
this.addTitleVisible = true
|
||||||
},
|
},
|
||||||
|
/* 确定 */
|
||||||
|
onSubmit() {
|
||||||
|
const { id, typeName, parentId } = this.addFormParams;
|
||||||
|
const addParams = {
|
||||||
|
parentId: id,
|
||||||
|
typeName,
|
||||||
|
};
|
||||||
|
const editParams = {
|
||||||
|
typeId: id,
|
||||||
|
typeName,
|
||||||
|
parentId,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$refs["addFormParamsRef"].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.addTitle === "新增") {
|
||||||
|
const res = await addMaType(addParams);
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("新增成功!");
|
||||||
|
this.addTitleVisible = false;
|
||||||
|
this.getTreeData();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const res = await updateMaType(editParams);
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("修改成功!");
|
||||||
|
this.addTitleVisible = false;
|
||||||
|
this.getTreeData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/* 取消 */
|
||||||
|
onCancel() {
|
||||||
|
this.addTitleVisible = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue