From 29a57c951a11551ea1a0805beec2df12d2ce0975 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Tue, 20 Feb 2024 15:53:15 +0800 Subject: [PATCH] =?UTF-8?q?2024-2-20=20=E8=AE=BE=E5=A4=87=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=88=97=E5=AE=BD=E8=B0=83=E6=95=B4+=E5=B7=A5?= =?UTF-8?q?=E8=89=BA=E6=A8=A1=E5=9D=97=E7=BA=BF=E4=BD=93=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sparePartsApplicationRecord/index.vue | 2 +- src/views/technology/process/single.vue | 112 ++++++++++-------- src/views/technology/recipe/single.vue | 112 ++++++++++-------- 3 files changed, 123 insertions(+), 103 deletions(-) diff --git a/src/views/device/sparePartsApplicationRecord/index.vue b/src/views/device/sparePartsApplicationRecord/index.vue index f0eb2d6..33492f5 100644 --- a/src/views/device/sparePartsApplicationRecord/index.vue +++ b/src/views/device/sparePartsApplicationRecord/index.vue @@ -173,7 +173,7 @@ label="申领单号" align="center" prop="applyCode" - width="200" + width="250" /> - - - 请选择设备类型: -
- -
-
+
+ +
+
+ +
@@ -96,7 +102,9 @@ export default { // components: { Treeselect }, data() { return { - treeData1:[], + //类型名称 + typeName: undefined, + treeData:[], showFlag:false, // 选中数组 selectedItemId: undefined, @@ -138,26 +146,33 @@ export default { this.getEquipmentType(); }, + watch: { + // 根据名称筛选部门树 + typeName(val) { + console.log(val); + this.$refs.tree.filter(val); + }, + }, + methods: { - // 表单重置 - reset() { - this.form = { - itemId: null, - itemCode: this.processId, - itemType: null, - }; - this.resetForm("form"); - }, + // 表单重置 + reset() { + this.form = { + itemId: null, + itemCode: this.processId, + itemType: null, + }; + this.resetForm("form"); + }, handleEquipmentSelectionChange (val) { this.itemList = val }, - // 生成表头序号 - indexMethod(index){ - return index+1 ; - }, - // + //生成表头序号 + indexMethod(index){ + return index+1 ; + }, /** 查询设备编码列表*/ getList() { @@ -173,17 +188,17 @@ export default { /** 查询分类下拉树结构 */ getEquipmentType() { getEquipmentTypeList().then(response => { - console.log(response.rows); - this.treeData1 = response.rows; - console.log(this.treeData1); + this.treeData = response.data; }); }, // 筛选节点 filterNode(value, data) { - console.log(value, data); + console.log("value:",value,"data:",data); if (!value) return true; - return data.label.indexOf(value) !== -1; + if(data.equipmentTypeName != null){ + return data.equipmentTypeName.indexOf(value) !== -1; + } }, // 节点单击事件 @@ -194,11 +209,11 @@ export default { this.handleQuery(); }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, /** 重置按钮操作 */ resetQuery() { @@ -253,10 +268,7 @@ export default { // submitEquipmentForm() { const data = this.ids; - console.log("数据",data); const equipmentCode = data.toString(); - console.log("拆分数据",equipmentCode); - console.log("原来的数据",this.queryParams.itemCodeGet); if(this.queryParams.itemCodeGet == ""){ this.queryParams.itemCodeGet = equipmentCode; }else{ @@ -264,17 +276,15 @@ export default { } this.selectedRows = this.queryParams.itemCodeGet; this.$emit('onSelected', this.selectedRows); - this.queryParams.equipmentTypeCode = null; - this.getList(); - console.log('111111',this.queryParams.equipmentTypeCode); - this.showFlag = false; + this.cancelEquipmentForm(); this.queryParams.itemCodeGet = ""; }, + cancelEquipmentForm(){ this.queryParams.equipmentTypeCode = null; - this.getList(); - console.log('111111',this.queryParams.equipmentTypeCode); - this.showFlag = false; + this.typeName = null; + this.getList(); + this.showFlag = false; } } }; diff --git a/src/views/technology/recipe/single.vue b/src/views/technology/recipe/single.vue index a8d54fb..41d477f 100644 --- a/src/views/technology/recipe/single.vue +++ b/src/views/technology/recipe/single.vue @@ -8,23 +8,29 @@ :before-close="cancelEquipmentForm" > - - - 请选择设备类型: -
- -
-
+
+ +
+
+ +
@@ -96,7 +102,9 @@ export default { // components: { Treeselect }, data() { return { - treeData1:[], + //类型名称 + typeName: undefined, + treeData:[], showFlag:false, // 选中数组 selectedItemId: undefined, @@ -138,26 +146,33 @@ export default { this.getEquipmentType(); }, + watch: { + // 根据名称筛选部门树 + typeName(val) { + console.log(val); + this.$refs.tree.filter(val); + }, + }, + methods: { - // 表单重置 - reset() { - this.form = { - itemId: null, - itemCode: this.processId, - itemType: null, - }; - this.resetForm("form"); - }, + // 表单重置 + reset() { + this.form = { + itemId: null, + itemCode: this.processId, + itemType: null, + }; + this.resetForm("form"); + }, handleEquipmentSelectionChange (val) { this.itemList = val }, - // 生成表头序号 - indexMethod(index){ - return index+1 ; - }, - // + //生成表头序号 + indexMethod(index){ + return index+1 ; + }, /** 查询设备编码列表*/ getList() { @@ -173,17 +188,17 @@ export default { /** 查询分类下拉树结构 */ getEquipmentType() { getEquipmentTypeList().then(response => { - console.log(response.rows); - this.treeData1 = response.rows; - console.log(this.treeData1); + this.treeData = response.data; }); }, // 筛选节点 filterNode(value, data) { - console.log(value, data); + console.log("value:",value,"data:",data); if (!value) return true; - return data.label.indexOf(value) !== -1; + if(data.equipmentTypeName != null){ + return data.equipmentTypeName.indexOf(value) !== -1; + } }, // 节点单击事件 @@ -194,11 +209,11 @@ export default { this.handleQuery(); }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, /** 重置按钮操作 */ resetQuery() { @@ -253,10 +268,7 @@ export default { // submitEquipmentForm() { const data = this.ids; - console.log("数据",data); const equipmentCode = data.toString(); - console.log("拆分数据",equipmentCode); - console.log("原来的数据",this.queryParams.itemCodeGet); if(this.queryParams.itemCodeGet == ""){ this.queryParams.itemCodeGet = equipmentCode; }else{ @@ -264,17 +276,15 @@ export default { } this.selectedRows = this.queryParams.itemCodeGet; this.$emit('onSelected', this.selectedRows); - this.queryParams.equipmentTypeCode = null; - this.getList(); - console.log('111111',this.queryParams.equipmentTypeCode); - this.showFlag = false; + this.cancelEquipmentForm(); this.queryParams.itemCodeGet = ""; }, + cancelEquipmentForm(){ this.queryParams.equipmentTypeCode = null; - this.getList(); - console.log('111111',this.queryParams.equipmentTypeCode); - this.showFlag = false; + this.typeName = null; + this.getList(); + this.showFlag = false; } } };