|
|
@@ -8,7 +8,7 @@
|
|
|
class="dict-table"
|
|
|
tool-class="ele-toolbar-actions"
|
|
|
>
|
|
|
-
|
|
|
+
|
|
|
<template v-slot:toolbar>
|
|
|
<div class="toolbar_box">
|
|
|
<div v-if="attributeData.status != 1">
|
|
|
@@ -84,6 +84,30 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
|
|
|
+
|
|
|
+ <template v-slot:resourceBomVersion="{ row }">
|
|
|
+ <div>
|
|
|
+ {{ row.resourceBomVersionList }}
|
|
|
+ <el-select
|
|
|
+ v-model="row.resourceBomVersion"
|
|
|
+ filterable
|
|
|
+ class="ele-block"
|
|
|
+ size="mini"
|
|
|
+ @change="resourceBomVersionFn"
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-option
|
|
|
+ v-for="item in row.resourceBomVersionList"
|
|
|
+ :key="item.versions"
|
|
|
+ :value="item.versions"
|
|
|
+ :label="'V'+item.versions+'.0'"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </template>
|
|
|
+
|
|
|
<template v-slot:materielDesignation="{ row }">
|
|
|
<el-input
|
|
|
v-model="row.materielDesignation"
|
|
|
@@ -151,7 +175,8 @@
|
|
|
getBomPageCategoryId,
|
|
|
contactList,
|
|
|
deleteBomTreeList,
|
|
|
- updateBatchBOM
|
|
|
+ updateBatchBOM,
|
|
|
+ sourceBomVersion
|
|
|
} from '@/api/material/BOM';
|
|
|
import { getByCode } from '@/api/system/dictionary-data';
|
|
|
|
|
|
@@ -256,7 +281,12 @@
|
|
|
label: '生产厂家',
|
|
|
width: 180
|
|
|
},
|
|
|
-
|
|
|
+ {
|
|
|
+ prop: 'resourceBomVersion',
|
|
|
+ slot: 'resourceBomVersion',
|
|
|
+ label: '来源版本',
|
|
|
+ width: 180
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'versions',
|
|
|
slot: 'versions',
|
|
|
@@ -313,7 +343,8 @@
|
|
|
value: 4
|
|
|
}
|
|
|
],
|
|
|
-
|
|
|
+ list:[],//表格数据
|
|
|
+ newList: [],
|
|
|
gysList: [],
|
|
|
|
|
|
newTreeId: null,
|
|
|
@@ -362,7 +393,17 @@
|
|
|
},
|
|
|
deep: true,
|
|
|
immediate: true
|
|
|
- }
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ handler(val) {
|
|
|
+ console.log(val);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -423,26 +464,58 @@
|
|
|
},
|
|
|
|
|
|
// 勾选
|
|
|
- chooseStandardList(data) {
|
|
|
- console.log(this.attributeData,'2222222222');
|
|
|
-
|
|
|
- data.map((m) => {
|
|
|
+ async chooseStandardList(data) {
|
|
|
+ const that = this;
|
|
|
+ const arrays = []
|
|
|
+ data.map((m) => {
|
|
|
m.parentId = this.newTreeId;
|
|
|
- m.id = '';
|
|
|
m.createTime = '';
|
|
|
m.bomType = this.attributeData.bomType;
|
|
|
m.level =Number(this.attributeData.level)+1;
|
|
|
m.versions =this.attributeData.versions;
|
|
|
m.categoryId = this.attributeData.categoryId;
|
|
|
m.rootCategoryLevelId = this.attributeData.rootCategoryLevelId;
|
|
|
+ arrays.push(that.getResourceBomVersionListFn(m.id))
|
|
|
+ Promise.all(arrays).then(responses => {
|
|
|
+ // 默认选择第一个
|
|
|
+ console.log(responses,responses[0].length,66666666);
|
|
|
+
|
|
|
+ if(responses[0].length){
|
|
|
+ m.resourceBomVersionList=responses[0];
|
|
|
+ m.resourceBomVersion = responses[0][0].versions;
|
|
|
+ m.resourceBomId = responses[0][0].resourceBomId;
|
|
|
+ }else{
|
|
|
+ m.resourceBomVersionList=[];
|
|
|
+ m.resourceBomVersion = '';
|
|
|
+ m.resourceBomId = '';
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ })
|
|
|
+ m.id = '';
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.list = [...data, ...this.$refs.table.getData()];
|
|
|
+ console.log(this.list);
|
|
|
+ this.$refs.table.setData(this.list);
|
|
|
});
|
|
|
- console.log(
|
|
|
- data,
|
|
|
- 5555555555555555
|
|
|
- );
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ resourceBomVersionFn(e){
|
|
|
+ console.log(e);
|
|
|
+ },
|
|
|
|
|
|
- this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
|
|
|
+ async getResourceBomVersionListFn (id){
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ sourceBomVersion({
|
|
|
+ bomType: this.attributeData.bomType,
|
|
|
+ categoryId: id
|
|
|
+ }).then((res) => {
|
|
|
+ resolve(res.data);
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
bomClose() {
|