From 847e34fcc615bae5eb9b688f9f18311c56f832a1 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 21 Nov 2023 11:48:17 +0800 Subject: [PATCH] update --- .../components/BomSelection.vue | 18 ++++++--- .../components/BomSelector.vue | 38 +++++++++++++++---- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/views/extend/processFlowView/components/BomSelection.vue b/src/views/extend/processFlowView/components/BomSelection.vue index f5c2f02b..d5c51f7e 100644 --- a/src/views/extend/processFlowView/components/BomSelection.vue +++ b/src/views/extend/processFlowView/components/BomSelection.vue @@ -27,10 +27,10 @@ export default { // event: 'update', // }, props: { - // selected: { - // type: String, - // default: '', - // }, + currentSelect: { + type: String, + default: null, + }, list: { type: Array, default: () => [], @@ -44,7 +44,7 @@ export default { return { list__inner: [], selected: null, - randomKey: Math.random() + randomKey: Math.random(), }; }, watch: { @@ -57,6 +57,12 @@ export default { deep: true, immediate: true, }, + currentSelect: { + handler(val) { + this.selected = val; + }, + immediate: true, + }, }, methods: { handleChange(bomItem, selected) { @@ -76,7 +82,7 @@ export default { clearSelected() { console.log('clearSelected'); this.selected = null; - this.randomKey = Math.random() + this.randomKey = Math.random(); // this.$emit('update', null); // this.$nextTick(() => { // this.$forceUpdate(); diff --git a/src/views/extend/processFlowView/components/BomSelector.vue b/src/views/extend/processFlowView/components/BomSelector.vue index f8b37b8a..1dffa4b0 100644 --- a/src/views/extend/processFlowView/components/BomSelector.vue +++ b/src/views/extend/processFlowView/components/BomSelector.vue @@ -29,13 +29,21 @@
- + :key="eq.id + refreshKey"> + + + {{ eq.name }} + +
@@ -47,9 +55,10 @@ @@ -61,9 +70,10 @@ @@ -98,6 +108,8 @@ export default { materialsBomList: [], valuesBomList: [], refreshKey: Math.random(), + currentSelectedMaterialBomId: null, + currentSelectedValueBomId: null, }; }, watch: { @@ -124,6 +136,14 @@ export default { commit() { this.$emit('update', this.selected); }, + + handleLoadDom(eq) { + // 只显示 dom 列表 + this.currentEquipment = eq.id; + this.materialsBomList = eq.materialsBom; + this.valuesBomList = eq.valuesBom; + }, + handleEquipmentChange(eq, selected) { this.currentEquipment = eq.id; this.materialsBomList = eq.materialsBom; @@ -169,6 +189,7 @@ export default { return; } selectedItem && (selectedItem.equMaterialBomId = selected ? bomId : null); + this.currentSelectedMaterialBomId = selected ? bomId : null; // this.$emit('update', this.selected); }, @@ -189,6 +210,7 @@ export default { return; } selectedItem && (selectedItem.equValueBomId = selected ? bomId : null); + this.currentSelectedValueBomId = selected ? bomId : null; // this.$emit('update', this.selected); }, },