From b829f91fc4e9d1861490156475f06e7e5d0e6c96 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Mon, 9 Dec 2024 18:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouseManage/machinery/type/index.vue | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue index 53b6ab4b..5f28936f 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/type/index.vue @@ -1289,6 +1289,43 @@ export default { this.addFormParams.typeName = data.label 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; + }, }, }