|
@@ -89,6 +89,61 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:bomId="{ row }">
|
|
<template v-slot:bomId="{ row }">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-if="row.bomType == '1'"
|
|
|
|
|
+ v-model="row.bomId"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :disabled="type == 'detail'"
|
|
|
|
|
+ @change="changeVersions(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- <el-option
|
|
|
|
|
+ v-for="item in row.bomCategoryList"
|
|
|
|
|
+ :key="item.bomType == row.bomType ? item.id : ''"
|
|
|
|
|
+ :label="
|
|
|
|
|
+ item.bomType == row.bomType ? 'V' + item.versions + '.0' : ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :value="item.bomType == row.bomType ? item.id : ''"
|
|
|
|
|
+ v-if="item.id !== ''"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option> -->
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in getPBOMData(row)"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="'V' + item.versions + '.0'"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-if="row.bomType == '2'"
|
|
|
|
|
+ v-model="row.bomId"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :disabled="type == 'detail'"
|
|
|
|
|
+ @change="changeVersions(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- <el-option
|
|
|
|
|
+ v-for="item in row.bomCategoryList"
|
|
|
|
|
+ :key="item.bomType == row.bomType ? item.id : ''"
|
|
|
|
|
+ :label="
|
|
|
|
|
+ item.bomType == row.bomType ? 'V' + item.versions + '.0' : ''
|
|
|
|
|
+ "
|
|
|
|
|
+ :value="item.bomType == row.bomType ? item.id : ''"
|
|
|
|
|
+ v-if="item.id !== ''"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option> -->
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in getMBOMData(row)"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="'V' + item.versions + '.0'"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <template v-slot:bomId="{ row }">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="row.bomId"
|
|
v-model="row.bomId"
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
@@ -104,6 +159,24 @@
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
+ </template> -->
|
|
|
|
|
+
|
|
|
|
|
+ <template v-slot:bomType="{ row }">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="row.bomType"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :disabled="type == 'detail'"
|
|
|
|
|
+ @change="changeType(row, row.bomType)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in bomTypeList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:action="{ row, $index }" v-if="type != 'detail'">
|
|
<template v-slot:action="{ row, $index }" v-if="type != 'detail'">
|
|
@@ -402,8 +475,8 @@
|
|
|
timeList: []
|
|
timeList: []
|
|
|
},
|
|
},
|
|
|
bomTypeList: [
|
|
bomTypeList: [
|
|
|
- { id: 1, label: 'PBOM' },
|
|
|
|
|
- { id: 2, label: 'MBOM' }
|
|
|
|
|
|
|
+ { id: '1', label: 'PBOM' },
|
|
|
|
|
+ { id: '2', label: 'MBOM' }
|
|
|
],
|
|
],
|
|
|
batchVisible: false,
|
|
batchVisible: false,
|
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
@@ -436,6 +509,8 @@
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
expandedRowKeys: [],
|
|
expandedRowKeys: [],
|
|
|
|
|
+ bomType: 1,
|
|
|
|
|
+
|
|
|
rules: {
|
|
rules: {
|
|
|
demandType: [
|
|
demandType: [
|
|
|
{
|
|
{
|
|
@@ -558,13 +633,12 @@
|
|
|
align: 'center'
|
|
align: 'center'
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // {
|
|
|
|
|
- // prop: 'bomId',
|
|
|
|
|
- // label: '选择BOM类型',
|
|
|
|
|
- // slot: 'bomType',
|
|
|
|
|
- // align: 'center',
|
|
|
|
|
- // minWidth: 110
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '选择BOM类型',
|
|
|
|
|
+ slot: 'bomType',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ minWidth: 110
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
prop: 'bomId',
|
|
prop: 'bomId',
|
|
|
label: '选择BOM版本',
|
|
label: '选择BOM版本',
|
|
@@ -876,6 +950,29 @@
|
|
|
this.$refs.table.setData([...tableList]);
|
|
this.$refs.table.setData([...tableList]);
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ changeType(row, value) {
|
|
|
|
|
+ // console.log(1121313123);
|
|
|
|
|
+ if (value == '1') {
|
|
|
|
|
+ this.getPBOMData(row);
|
|
|
|
|
+ // this.changeVersions(row)
|
|
|
|
|
+ } else if (value == '2') {
|
|
|
|
|
+ this.getMBOMData(row);
|
|
|
|
|
+ // this.changeVersions(row)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ getPBOMData(row) {
|
|
|
|
|
+ const data = row.bomCategoryList.filter((item) => item.bomType == '1');
|
|
|
|
|
+
|
|
|
|
|
+ return data;
|
|
|
|
|
+ // console.log('PBOM', row);
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getMBOMData(row) {
|
|
|
|
|
+ const data = row.bomCategoryList.filter((item) => item.bomType == '2');
|
|
|
|
|
+
|
|
|
|
|
+ return data;
|
|
|
|
|
+ },
|
|
|
remove2(row) {
|
|
remove2(row) {
|
|
|
const data = this.$refs.table.getData() ?? [];
|
|
const data = this.$refs.table.getData() ?? [];
|
|
|
this.formData.materialRemoveIds.push(row.categoryId);
|
|
this.formData.materialRemoveIds.push(row.categoryId);
|