Merge pull request 'projects/mes-lb' (#119) from projects/mes-lb into projects/mes-test

Reviewed-on: #119
This commit is contained in:
g7hoo 2023-11-28 09:06:58 +08:00
commit c74269b282
3 changed files with 37 additions and 25 deletions

View File

@ -19,7 +19,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row style="border: 1px solid #ccc; display: flex"> <el-row v-if="filteredBomList.length" style="border: 1px solid #ccc; display: flex">
<el-col :span="8"> <el-col :span="8">
<div class="select-list"> <div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px"> <div class="sl__header" style="background: #f3f4fb; padding: 12px">
@ -78,6 +78,7 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div class="no-data-bg" v-else></div>
</div> </div>
</template> </template>
; ;

View File

@ -218,34 +218,45 @@ export default {
this.total = 0; this.total = 0;
} }
this.selectedBoms = [];
// bom // bom
this.http('/extend/process-flow-det/getEquipmentDetBySectionId', 'post', { this.http('/extend/process-flow-det/getEquipmentDetBySectionId', 'post', {
sectionId, sectionId,
flowDetId: detId, flowDetId: detId,
}).then(({ code, data }) => { })
if (code == 0) { .then(({ code, data }) => {
this.bomList = data.map((eq) => { if (code == 0) {
eq.materialsBom = eq.materialsBom || []; this.bomList = data.map((eq) => {
eq.valuesBom = eq.valuesBom || []; eq.materialsBom = eq.materialsBom || [];
// eq.valuesBom = eq.valuesBom || [];
eq.materialsBom.chosen = eq.materialsBomChoseId ?? null; //
eq.valuesBom.chosen = eq.valuesBomChoseId ?? null; eq.materialsBom.chosen = eq.materialsBomChoseId ?? null;
if (eq.equChose || eq.materialsBom.chosen || eq.valuesBom.chosen) { eq.valuesBom.chosen = eq.valuesBomChoseId ?? null;
this.selectedBoms.push({ if (
equipmentId: eq.id, eq.equChose ||
equMaterialBomId: eq.materialsBom.chosen, eq.materialsBom.chosen ||
equValueBomId: eq.valuesBom.chosen, eq.valuesBom.chosen
}); ) {
} this.selectedBoms.push({
// id equipmentId: eq.id,
eq.materialsBom.equipmentId = eq.id; equMaterialBomId: eq.materialsBom.chosen,
eq.valuesBom.equipmentId = eq.id; equValueBomId: eq.valuesBom.chosen,
return eq; });
}); }
} else { // 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.bomList.splice(0);
} this.selectedBoms = [];
}); });
}, },
async handleAddEquipment() { async handleAddEquipment() {
this.open = true; this.open = true;

View File

@ -34,7 +34,7 @@
class="btn-refresh" class="btn-refresh"
@click="handleUpdateLayout" @click="handleUpdateLayout"
icon="el-icon-refresh"> icon="el-icon-refresh">
刷新布局 保存布局
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"