projects/mes-test #132

Manually merged
gtz217 merged 281 commits from projects/mes-test into projects/mes 2023-11-30 09:11:34 +08:00
Showing only changes of commit 8ddef0de9d - Show all commits

View File

@ -18,7 +18,7 @@
</el-col>
</el-row>
<el-row style="border: 1px solid #ccc">
<el-row style="border: 1px solid #ccc; display: flex;">
<el-col :span="8">
<div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
@ -30,19 +30,19 @@
v-for="n in 10"
:key="n"
:label="'设备' + n"
:true-label="n"
@change="() => handleChange(n)"
class="sl__body-item"></el-checkbox>
</el-checkbox-group>
</div>
</el-col>
<el-col :span="8" style="border-left: 1px solid #ccc">
<el-col :span="8" style="border-left: 1px solid #ccc;">
<div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">物料BOM</span>
</div>
<el-checkbox-group v-model="selectedMBom" class="sl__body">
<el-checkbox
v-for="n in 10"
v-for="n in materialBomList"
:key="n"
class="sl__body-item"></el-checkbox>
</el-checkbox-group>
@ -55,7 +55,7 @@
</div>
<el-checkbox-group v-model="selectedPBom" class="sl__body">
<el-checkbox
v-for="n in 10"
v-for="n in paramBomList"
:key="n"
class="sl__body-item"></el-checkbox>
</el-checkbox-group>
@ -64,7 +64,7 @@
</el-row>
</div>
</template>
;
<script>
export default {
name: 'BomSelector',
@ -76,10 +76,13 @@ export default {
selectedEquipments: [],
selectedMBom: [],
selectedPBom: [],
selected: [],
materialBomList: [],
paramBomList: [],
};
},
watch: {
selectedEquipments: {
selected: {
handler(val) {
console.log(val);
},
@ -87,7 +90,26 @@ export default {
},
},
computed: {},
methods: {},
methods: {
handleChange(id) {
this.materialBomList = [];
this.paramBomList = [];
this.selected.push({
id: id,
});
},
handleBomChange(eqId, id, type) {
const record = this.selected.find((item) => item.id === eqId);
if (record) {
record[type == 'param' ? 'paramBomId' : 'materialBomId'] = id;
} else {
this.selected.push({
id: eqId,
[type == 'param' ? 'paramBomId' : 'materialBomId']: id,
});
}
},
},
};
</script>