diff --git a/src/views/extend/processFlowView/components/BomSelector.vue b/src/views/extend/processFlowView/components/BomSelector.vue index a52be51c..136a06cb 100644 --- a/src/views/extend/processFlowView/components/BomSelector.vue +++ b/src/views/extend/processFlowView/components/BomSelector.vue @@ -19,7 +19,7 @@ - +
@@ -78,6 +78,7 @@
+
; diff --git a/src/views/extend/processFlowView/components/ProcessBomList.vue b/src/views/extend/processFlowView/components/ProcessBomList.vue index e98f32c6..d56eb442 100644 --- a/src/views/extend/processFlowView/components/ProcessBomList.vue +++ b/src/views/extend/processFlowView/components/ProcessBomList.vue @@ -218,34 +218,45 @@ export default { this.total = 0; } + this.selectedBoms = []; // 获取设备及bom列表 this.http('/extend/process-flow-det/getEquipmentDetBySectionId', 'post', { sectionId, flowDetId: detId, - }).then(({ code, data }) => { - if (code == 0) { - this.bomList = data.map((eq) => { - eq.materialsBom = eq.materialsBom || []; - eq.valuesBom = eq.valuesBom || []; - // 设置选中状态 - eq.materialsBom.chosen = eq.materialsBomChoseId ?? null; - eq.valuesBom.chosen = eq.valuesBomChoseId ?? null; - if (eq.equChose || eq.materialsBom.chosen || eq.valuesBom.chosen) { - this.selectedBoms.push({ - equipmentId: eq.id, - equMaterialBomId: eq.materialsBom.chosen, - equValueBomId: eq.valuesBom.chosen, - }); - } - // 设置设备id - eq.materialsBom.equipmentId = eq.id; - eq.valuesBom.equipmentId = eq.id; - return eq; - }); - } else { + }) + .then(({ code, data }) => { + if (code == 0) { + this.bomList = data.map((eq) => { + eq.materialsBom = eq.materialsBom || []; + eq.valuesBom = eq.valuesBom || []; + // 设置选中状态 + eq.materialsBom.chosen = eq.materialsBomChoseId ?? null; + eq.valuesBom.chosen = eq.valuesBomChoseId ?? null; + if ( + eq.equChose || + eq.materialsBom.chosen || + eq.valuesBom.chosen + ) { + this.selectedBoms.push({ + equipmentId: eq.id, + equMaterialBomId: eq.materialsBom.chosen, + equValueBomId: eq.valuesBom.chosen, + }); + } + // 设置设备id + eq.materialsBom.equipmentId = eq.id; + eq.valuesBom.equipmentId = eq.id; + return eq; + }); + } else { + this.bomList.splice(0); + this.selectedBoms = []; + } + }) + .catch((err) => { this.bomList.splice(0); - } - }); + this.selectedBoms = []; + }); }, async handleAddEquipment() { this.open = true; diff --git a/src/views/extend/processFlowView/components/ProcessDetail.vue b/src/views/extend/processFlowView/components/ProcessDetail.vue index 77368267..81d27ce9 100644 --- a/src/views/extend/processFlowView/components/ProcessDetail.vue +++ b/src/views/extend/processFlowView/components/ProcessDetail.vue @@ -34,7 +34,7 @@ class="btn-refresh" @click="handleUpdateLayout" icon="el-icon-refresh"> - 刷新布局 + 保存布局