From 2bcf6b50de72af679dcf7f4ea837bf1bdf8c4649 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Fri, 28 Jun 2024 10:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E7=89=A9=E6=96=99=E7=BB=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkTypeProject/MaterialGroupAdd.vue | 41 ++-- .../checkTypeProject/selectMaterial.vue | 224 ++++++++++++++++++ 2 files changed, 248 insertions(+), 17 deletions(-) create mode 100644 src/views/quality/checkTypeProject/selectMaterial.vue diff --git a/src/views/quality/checkTypeProject/MaterialGroupAdd.vue b/src/views/quality/checkTypeProject/MaterialGroupAdd.vue index 248d7573..c89a76ab 100644 --- a/src/views/quality/checkTypeProject/MaterialGroupAdd.vue +++ b/src/views/quality/checkTypeProject/MaterialGroupAdd.vue @@ -106,7 +106,7 @@ import { } from "@/api/quality/materialGroupDetail"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import ItemSelectMaterial from "../qcIncome/selectMaterial.vue"; +import ItemSelectMaterial from "./selectMaterial.vue"; export default { name: "MaterialGroupAdd", @@ -201,7 +201,7 @@ export default { //this.loading = false; }); }, - /** 查询部门下拉树结构 */ + /** 查询下拉树结构 */ getMaterialTree() { materialTreeSelect().then((response) => { this.materialOptions = response.data; @@ -304,6 +304,7 @@ export default { this.reset(); this.form.groupId = data.id; this.$refs.itemSelectMaterial.showFlag = true; + //this.$refs.itemSelectMaterial.headerToken = }, /**删除树节点 */ remove(node, data) { @@ -337,21 +338,27 @@ export default { }, //物料选择确认 onSelectMaterial(obj) { - this.form.materialCode = obj.code; - this.form.materialName = obj.name; - console.log(this.form.groupId); - if(this.form.materialCode != null) { - addMaterialGroupDetail(this.form).then((response) => { - let message = response.code - if(message == 200) { - this.$modal.msgSuccess("新增成功"); - }else { - this.$modal.msgError("新增失败"); - } - this.open = false; - this.getMaterialTree(); - }); - } + debugger + if(obj.length == 0){ + this.getMaterialTree(); + }else{ + this.form.materialCode = obj.code; + this.form.materialName = obj.name; + console.log(this.form.groupId); + if(this.form.materialCode != null) { + addMaterialGroupDetail(this.form).then((response) => { + let message = response.code + if(message == 200) { + this.$modal.msgSuccess("新增成功"); + }else { + this.$modal.msgError("新增失败"); + } + this.open = false; + this.getMaterialTree(); + }); + } + } + } }, }; diff --git a/src/views/quality/checkTypeProject/selectMaterial.vue b/src/views/quality/checkTypeProject/selectMaterial.vue new file mode 100644 index 00000000..78959190 --- /dev/null +++ b/src/views/quality/checkTypeProject/selectMaterial.vue @@ -0,0 +1,224 @@ + +