|
@@ -215,15 +215,13 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:bomCategoryId="{ row, $index }">
|
|
<template v-slot:bomCategoryId="{ row, $index }">
|
|
|
- <el-select
|
|
|
|
|
- v-model="row.bomCategoryId"
|
|
|
|
|
- @change="changeBomId(row, $index)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-select v-model="row.bomCategoryId">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item of row.bomVersionList"
|
|
v-for="item of row.bomVersionList"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
:label="item.name + '(V' + item.versions + '.0)'"
|
|
:label="item.name + '(V' + item.versions + '.0)'"
|
|
|
:value="item.id"
|
|
:value="item.id"
|
|
|
|
|
+ @click.native="changeBomId(row, $index, item)"
|
|
|
></el-option>
|
|
></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
@@ -395,10 +393,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:set="{ row, $index }">
|
|
<template v-slot:set="{ row, $index }">
|
|
|
- <el-button
|
|
|
|
|
- type="text"
|
|
|
|
|
- @click="handleDeleteItem($index)"
|
|
|
|
|
- v-if="!row.id"
|
|
|
|
|
|
|
+ <el-button type="text" @click="handleDeleteItem($index)"
|
|
|
>删除</el-button
|
|
>删除</el-button
|
|
|
>
|
|
>
|
|
|
</template>
|
|
</template>
|
|
@@ -429,7 +424,6 @@
|
|
|
@choose="confirmChoose"
|
|
@choose="confirmChoose"
|
|
|
:selectList="[]"
|
|
:selectList="[]"
|
|
|
ref="equipmentRefs"
|
|
ref="equipmentRefs"
|
|
|
- isMultiple="0"
|
|
|
|
|
>
|
|
>
|
|
|
</EquipmentDialog>
|
|
</EquipmentDialog>
|
|
|
</div>
|
|
</div>
|
|
@@ -457,9 +451,11 @@
|
|
|
saveSaleToPlan,
|
|
saveSaleToPlan,
|
|
|
getFactoryList,
|
|
getFactoryList,
|
|
|
temporarilyUpdate,
|
|
temporarilyUpdate,
|
|
|
- temporaryPlanSave
|
|
|
|
|
|
|
+ temporaryPlanSave,
|
|
|
|
|
+ getUpdateInfoByCode
|
|
|
} from '@/api/saleOrder';
|
|
} from '@/api/saleOrder';
|
|
|
import contactDialog from '@/components/contactDialog/openContactDialog.vue';
|
|
import contactDialog from '@/components/contactDialog/openContactDialog.vue';
|
|
|
|
|
+ import awk from 'highlight.js/lib/languages/awk';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
@@ -891,6 +887,7 @@
|
|
|
},
|
|
},
|
|
|
async open(val) {
|
|
async open(val) {
|
|
|
await this.getFactoryList();
|
|
await this.getFactoryList();
|
|
|
|
|
+
|
|
|
this.clientEnvironmentId =
|
|
this.clientEnvironmentId =
|
|
|
this.$store.state.user.info.clientEnvironmentId;
|
|
this.$store.state.user.info.clientEnvironmentId;
|
|
|
this.factoriesId = this.$store.state.user.info.factoryId;
|
|
this.factoriesId = this.$store.state.user.info.factoryId;
|
|
@@ -901,7 +898,7 @@
|
|
|
}
|
|
}
|
|
|
this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
|
|
this.title = !val.id ? '新增临时生产计划' : '编辑临时生产计划';
|
|
|
val.planType = String(val.planType);
|
|
val.planType = String(val.planType);
|
|
|
- this.form = val;
|
|
|
|
|
|
|
+ this.form = await getUpdateInfoByCode(val.code);
|
|
|
// 修改
|
|
// 修改
|
|
|
if (val.id) {
|
|
if (val.id) {
|
|
|
if (
|
|
if (
|
|
@@ -926,43 +923,67 @@
|
|
|
this.$set(
|
|
this.$set(
|
|
|
this.form.productInfoList[index],
|
|
this.form.productInfoList[index],
|
|
|
'routingList',
|
|
'routingList',
|
|
|
- await this.changeBomIdFn(v.bomCategoryId)
|
|
|
|
|
|
|
+ await this.changeBomIdFn(
|
|
|
|
|
+ v.bomCategoryId,
|
|
|
|
|
+ this.form.productInfoList[index]
|
|
|
|
|
+ )
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- let categoryId = this.form.productInfoList[0].categoryId;
|
|
|
|
|
- const res = await findBomCategoryByCategoryId(categoryId);
|
|
|
|
|
- if (res && res.length > 0) {
|
|
|
|
|
- let list = [];
|
|
|
|
|
- let listMap = {};
|
|
|
|
|
- res.map((el) => {
|
|
|
|
|
- if (el.bomType == '2' || el.bomType == '3') {
|
|
|
|
|
- console.log(listMap, 'listMap');
|
|
|
|
|
- if (listMap[el.bomType]) {
|
|
|
|
|
- listMap[el.bomType].push(el);
|
|
|
|
|
- } else {
|
|
|
|
|
- listMap[el.bomType] = [el];
|
|
|
|
|
|
|
+ // let categoryId = this.form.productInfoList[0].categoryId;
|
|
|
|
|
+ // const res = await findBomCategoryByCategoryId(categoryId);
|
|
|
|
|
+ let promiseAll = [];
|
|
|
|
|
+ this.form.productInfoList.forEach(async (item) => {
|
|
|
|
|
+ let categoryId = item.categoryId;
|
|
|
|
|
+ promiseAll.push(findBomCategoryByCategoryId(categoryId));
|
|
|
|
|
+ });
|
|
|
|
|
+ const resAll = await Promise.all(promiseAll);
|
|
|
|
|
+ console.log(this.form.productInfoList);
|
|
|
|
|
+
|
|
|
|
|
+ this.form.productInfoList.forEach((item, index) => {
|
|
|
|
|
+ if (resAll[index]) {
|
|
|
|
|
+ let list = [];
|
|
|
|
|
+ let listMap = {};
|
|
|
|
|
+
|
|
|
|
|
+ resAll[index].map((el) => {
|
|
|
|
|
+ if (el.bomType == '2' || el.bomType == '3') {
|
|
|
|
|
+ console.log(listMap, 'listMap');
|
|
|
|
|
+ if (listMap[el.bomType]) {
|
|
|
|
|
+ listMap[el.bomType].push(el);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ listMap[el.bomType] = [el];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ });
|
|
|
|
|
+ if (listMap[2]) {
|
|
|
|
|
+ list.push({ code: 2, name: 'MBOM' });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (listMap[3]) {
|
|
|
|
|
+ list.push({ code: 3, name: 'ABOM' });
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- if (listMap[2]) {
|
|
|
|
|
- list.push({ code: 2, name: 'MBOM' });
|
|
|
|
|
- }
|
|
|
|
|
- if (listMap[3]) {
|
|
|
|
|
- list.push({ code: 3, name: 'ABOM' });
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- if (!this.form.productInfoList[0].factoriesId) {
|
|
|
|
|
- this.form.productInfoList[0].factoriesId = this.factoriesId;
|
|
|
|
|
- this.form.productInfoList[0].factoriesName =
|
|
|
|
|
- this.factoryList?.find(
|
|
|
|
|
- (factoryData) => factoryData.id === this.factoriesId
|
|
|
|
|
- )?.name;
|
|
|
|
|
|
|
+ if (!item.factoriesId) {
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.productInfoList[index],
|
|
|
|
|
+ 'factoriesId',
|
|
|
|
|
+ this.factoriesId
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.productInfoList[index],
|
|
|
|
|
+ 'factoriesName',
|
|
|
|
|
+ this.factoryList?.find(
|
|
|
|
|
+ (factoryData) => factoryData.id === this.factoriesId
|
|
|
|
|
+ )?.name
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.productInfoList[index],
|
|
|
|
|
+ 'producedList',
|
|
|
|
|
+ list
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- this.form.productInfoList[0].producedList = list;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
} else {
|
|
} else {
|
|
@@ -1004,120 +1025,139 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ let ids = this.form.productInfoList.map((item) => item.categoryId);
|
|
|
|
|
|
|
|
- list = list
|
|
|
|
|
- .filter(
|
|
|
|
|
- (i) =>
|
|
|
|
|
- !this.disabledList.find(
|
|
|
|
|
- (p) => p.productCode == i.code || p.productCode == i.productCode
|
|
|
|
|
- )
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ let result = list
|
|
|
|
|
+ .filter((i) => !ids.includes(i.id))
|
|
|
.map((item, index) => {
|
|
.map((item, index) => {
|
|
|
- if (item.productCode) {
|
|
|
|
|
- return item;
|
|
|
|
|
- } else {
|
|
|
|
|
- return {
|
|
|
|
|
- categoryId: item.id,
|
|
|
|
|
- productCode: item.code,
|
|
|
|
|
- productName: item.name,
|
|
|
|
|
- productUnitWeight: item.netWeight,
|
|
|
|
|
- weightUnit: item.weightUnit,
|
|
|
|
|
- model: item.modelType,
|
|
|
|
|
- specification: item.specification,
|
|
|
|
|
- brandNo: item.brandNum,
|
|
|
|
|
- measuringUnit: item.measuringUnit,
|
|
|
|
|
- produceRoutingId: item.produceRoutingId,
|
|
|
|
|
- produceRoutingName: item.produceRoutingName,
|
|
|
|
|
- produceVersionName: item.produceVersionName,
|
|
|
|
|
- factoriesId: this.factoriesId,
|
|
|
|
|
- factoriesName: this.factoryList?.find(
|
|
|
|
|
- (factoryData) => factoryData.id === this.factoriesId
|
|
|
|
|
- )?.name
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .concat(this.disabledList);
|
|
|
|
|
-
|
|
|
|
|
- this.form.productInfoList = [];
|
|
|
|
|
|
|
+ return {
|
|
|
|
|
+ categoryId: item.id,
|
|
|
|
|
+ productCode: item.code,
|
|
|
|
|
+ productName: item.name,
|
|
|
|
|
+ productUnitWeight: item.netWeight,
|
|
|
|
|
+ weightUnit: item.weightUnit,
|
|
|
|
|
+ model: item.modelType,
|
|
|
|
|
+ specification: item.specification,
|
|
|
|
|
+ brandNo: item.brandNum,
|
|
|
|
|
+ measuringUnit: item.measuringUnit,
|
|
|
|
|
+ produceRoutingId: item.produceRoutingId,
|
|
|
|
|
+ produceRoutingName: item.produceRoutingName,
|
|
|
|
|
+ produceVersionName: item.produceVersionName,
|
|
|
|
|
+ factoriesId: this.factoriesId,
|
|
|
|
|
+ factoriesName: this.factoryList?.find(
|
|
|
|
|
+ (factoryData) => factoryData.id === this.factoriesId
|
|
|
|
|
+ )?.name
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ // this.form.productInfoList = [];
|
|
|
|
|
|
|
|
// 取出在弹窗中选中并且不在表格中的数据
|
|
// 取出在弹窗中选中并且不在表格中的数据
|
|
|
- const result = list.filter(
|
|
|
|
|
- (i) =>
|
|
|
|
|
- this.form.productInfoList.findIndex(
|
|
|
|
|
- (p) => p.productCode === i.productCode
|
|
|
|
|
- ) === -1
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- // 取出在表格中并且不在弹窗中选中的数据 即取消选中的数据
|
|
|
|
|
- const del = this.form.productInfoList.filter(
|
|
|
|
|
- (i) => list.findIndex((p) => p.productCode === i.productCode) === -1
|
|
|
|
|
- );
|
|
|
|
|
-
|
|
|
|
|
- for (let i = this.form.productInfoList.length - 1; i >= 0; i--) {
|
|
|
|
|
- for (let j in del) {
|
|
|
|
|
- if (
|
|
|
|
|
- this.form.productInfoList[i].productCode === del[j].productCode
|
|
|
|
|
- ) {
|
|
|
|
|
- this.form.productInfoList.splice(i, 1);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // const result = list.filter(
|
|
|
|
|
+ // (i) =>
|
|
|
|
|
+ // this.form.productInfoList.findIndex(
|
|
|
|
|
+ // (p) => p.productCode === i.productCode
|
|
|
|
|
+ // ) === -1
|
|
|
|
|
+ // );
|
|
|
|
|
+
|
|
|
|
|
+ // // 取出在表格中并且不在弹窗中选中的数据 即取消选中的数据
|
|
|
|
|
+ // const del = this.form.productInfoList.filter(
|
|
|
|
|
+ // (i) => list.findIndex((p) => p.productCode === i.productCode) === -1
|
|
|
|
|
+ // );
|
|
|
|
|
+
|
|
|
|
|
+ // for (let i = this.form.productInfoList.length - 1; i >= 0; i--) {
|
|
|
|
|
+ // for (let j in del) {
|
|
|
|
|
+ // if (
|
|
|
|
|
+ // this.form.productInfoList[i].productCode === del[j].productCode
|
|
|
|
|
+ // ) {
|
|
|
|
|
+ // this.form.productInfoList.splice(i, 1);
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ let promiseAll = [];
|
|
|
|
|
+ result.forEach(async (item) => {
|
|
|
|
|
+ let categoryId = item.categoryId;
|
|
|
|
|
+ promiseAll.push(findBomCategoryByCategoryId(categoryId));
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const resAll = await Promise.all(promiseAll);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- let categoryId = result[0].categoryId;
|
|
|
|
|
- const res = await findBomCategoryByCategoryId(categoryId);
|
|
|
|
|
- if (res) {
|
|
|
|
|
- let listMap = {};
|
|
|
|
|
- let list = [];
|
|
|
|
|
- let arr = [];
|
|
|
|
|
- res.map((el) => {
|
|
|
|
|
- if (el.bomType == '2' || el.bomType == '3') {
|
|
|
|
|
- console.log(listMap, 'listMap');
|
|
|
|
|
- if (listMap[el.bomType]) {
|
|
|
|
|
- listMap[el.bomType].push(el);
|
|
|
|
|
- } else {
|
|
|
|
|
- listMap[el.bomType] = [el];
|
|
|
|
|
|
|
+ await result.forEach(async (item, index) => {
|
|
|
|
|
+ if (resAll[index]) {
|
|
|
|
|
+ let listMap = {};
|
|
|
|
|
+ let list = [];
|
|
|
|
|
+ let arr = [];
|
|
|
|
|
+ resAll[index].map((el) => {
|
|
|
|
|
+ if (el.bomType == '2' || el.bomType == '3') {
|
|
|
|
|
+ console.log(listMap, 'listMap');
|
|
|
|
|
+ if (listMap[el.bomType]) {
|
|
|
|
|
+ listMap[el.bomType].push(el);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ listMap[el.bomType] = [el];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if (listMap[2]) {
|
|
|
|
|
+ list.push({ code: 2, name: 'MBOM' });
|
|
|
|
|
+ arr = listMap[2];
|
|
|
|
|
+ item.productType = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (listMap[3]) {
|
|
|
|
|
+ list.push({ code: 3, name: 'ABOM' });
|
|
|
|
|
+ if (!listMap[2]) {
|
|
|
|
|
+ arr = listMap[3];
|
|
|
|
|
+ item.productType = 3;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- if (listMap[2]) {
|
|
|
|
|
- list.push({ code: 2, name: 'MBOM' });
|
|
|
|
|
- arr = listMap[2];
|
|
|
|
|
- result[0].productType = 2;
|
|
|
|
|
- }
|
|
|
|
|
- if (listMap[3]) {
|
|
|
|
|
- list.push({ code: 3, name: 'ABOM' });
|
|
|
|
|
- if (!listMap[2]) {
|
|
|
|
|
- arr = listMap[3];
|
|
|
|
|
- result[0].productType = 3;
|
|
|
|
|
|
|
+ if (arr.length > 0) {
|
|
|
|
|
+ arr.map((el) => (el.bomCategoryId = el.id));
|
|
|
|
|
+
|
|
|
|
|
+ item.bomCategoryId = arr[0].id;
|
|
|
|
|
+ await this.changeBomId(arr[0], 0);
|
|
|
|
|
+
|
|
|
|
|
+ this.$set(item, 'produceRoutingId', arr[0].produceRoutingId);
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ item,
|
|
|
|
|
+ 'produceVersionName',
|
|
|
|
|
+ arr[0].produceVersionName
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ item,
|
|
|
|
|
+ 'produceRoutingName',
|
|
|
|
|
+ arr[0].produceRoutingName
|
|
|
|
|
+ );
|
|
|
|
|
+ console.log(arr[0],'arr[0]')
|
|
|
|
|
+ this.$set(item, 'routingList', arr[0].routingList);
|
|
|
|
|
+ this.$set(item, 'bomCategoryName', arr[0].name);
|
|
|
|
|
+ this.$set(item, 'bomCategoryVersions', arr[0].versions);
|
|
|
}
|
|
}
|
|
|
|
|
+ item.producedList = list;
|
|
|
|
|
+ item.bomVersionList = arr;
|
|
|
|
|
+
|
|
|
|
|
+ return item;
|
|
|
}
|
|
}
|
|
|
- if (arr.length > 0) {
|
|
|
|
|
- arr.map((el) => (el.bomCategoryId = el.id));
|
|
|
|
|
- result[0].bomCategoryId = arr[0].id;
|
|
|
|
|
- this.changeBomId(arr[0], 0);
|
|
|
|
|
- }
|
|
|
|
|
- result[0].producedList = list;
|
|
|
|
|
- result[0].bomVersionList = arr;
|
|
|
|
|
- // bomVersionList
|
|
|
|
|
- this.form.productInfoList =
|
|
|
|
|
- this.form.productInfoList.concat(result);
|
|
|
|
|
- this.$refs.tableRef.setData(this.form.productInfoList);
|
|
|
|
|
- this.changeLineNumber();
|
|
|
|
|
- //重置
|
|
|
|
|
- this.$set(this.form, 'produceType', '');
|
|
|
|
|
- this.$set(this.form, 'bomCategoryId', '');
|
|
|
|
|
- this.$set(this.form, 'produceRoutingId', '');
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
} catch (err) {}
|
|
} catch (err) {}
|
|
|
-
|
|
|
|
|
- // this.bomListVersion();
|
|
|
|
|
|
|
+ this.form.productInfoList.push(...result);
|
|
|
|
|
+ this.changeLineNumber();
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs.tableRef.setData(this.form.productInfoList);
|
|
|
|
|
+ //重置
|
|
|
|
|
+ this.$set(this.form, 'produceType', '');
|
|
|
|
|
+ this.$set(this.form, 'bomCategoryId', '');
|
|
|
|
|
+ this.$set(this.form, 'produceRoutingId', '');
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
changeLineNumber() {
|
|
changeLineNumber() {
|
|
|
- this.form.productInfoList.map((item, index) => {
|
|
|
|
|
- item.lineNumber = 10 * (index + 1);
|
|
|
|
|
|
|
+ this.form.productInfoList.forEach((item, index) => {
|
|
|
|
|
+ let data = this.form.productInfoList[index - 1];
|
|
|
|
|
+
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.productInfoList[index],
|
|
|
|
|
+ 'lineNumber',
|
|
|
|
|
+ data ? data.lineNumber + 10 : 10
|
|
|
|
|
+ );
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
handleDeleteItem(index) {
|
|
handleDeleteItem(index) {
|
|
@@ -1163,7 +1203,7 @@
|
|
|
// console.log(this.$refs);
|
|
// console.log(this.$refs);
|
|
|
// this.$refs.tableRef.setData([]);
|
|
// this.$refs.tableRef.setData([]);
|
|
|
},
|
|
},
|
|
|
- changeBomIdFn(bomCategoryId) {
|
|
|
|
|
|
|
+ changeBomIdFn(bomCategoryId, row) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
bomRoutingList(bomCategoryId).then((res) => {
|
|
bomRoutingList(bomCategoryId).then((res) => {
|
|
|
let arr = res || [];
|
|
let arr = res || [];
|
|
@@ -1176,24 +1216,30 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 选择BOM
|
|
// 选择BOM
|
|
|
- changeBomId(row, index) {
|
|
|
|
|
|
|
+ async changeBomId(row, index, bomData) {
|
|
|
|
|
+ if (bomData) {
|
|
|
|
|
+ item.bomCategoryName = bomData.name;
|
|
|
|
|
+ item.bomCategoryVersions = bomData.versions;
|
|
|
|
|
+ }
|
|
|
// row.routingList = []
|
|
// row.routingList = []
|
|
|
- bomRoutingList(row.bomCategoryId).then((res) => {
|
|
|
|
|
|
|
+ return await bomRoutingList(row.bomCategoryId).then((res) => {
|
|
|
let arr = res || [];
|
|
let arr = res || [];
|
|
|
if (arr.length > 0) {
|
|
if (arr.length > 0) {
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- row.produceRoutingName = arr[0].name;
|
|
|
|
|
- row.produceVersionName = arr[0].version;
|
|
|
|
|
- row.routingList = arr;
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.form.productInfoList[index],
|
|
|
|
|
- 'produceRoutingId',
|
|
|
|
|
- arr[0].id
|
|
|
|
|
- );
|
|
|
|
|
- // this.selectionRowShow = false;
|
|
|
|
|
- row.selectionRowShow = false;
|
|
|
|
|
- this.$set(this.form.productInfoList[index], 'routingList', arr);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
|
+ row.produceRoutingName = arr[0].name;
|
|
|
|
|
+ row.produceVersionName = arr[0].version;
|
|
|
|
|
+ row.produceRoutingId = arr[0].id;
|
|
|
|
|
+ row.routingList = arr;
|
|
|
|
|
+ this.$set(row, 'produceRoutingId', arr[0].id);
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.productInfoList[index],
|
|
|
|
|
+ 'produceRoutingId',
|
|
|
|
|
+ arr[0].id
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ row.selectionRowShow = false;
|
|
|
|
|
+ this.$set(this.form.productInfoList[index], 'routingList', arr);
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
});
|
|
});
|
|
@@ -1234,7 +1280,7 @@
|
|
|
row.bomVersionList = arr;
|
|
row.bomVersionList = arr;
|
|
|
this.form.productInfoList[index].bomVersionList = arr;
|
|
this.form.productInfoList[index].bomVersionList = arr;
|
|
|
row.bomCategoryId = arr[0].id;
|
|
row.bomCategoryId = arr[0].id;
|
|
|
- this.changeBomId(row, index);
|
|
|
|
|
|
|
+ this.changeBomId(row, index,arr[0]);
|
|
|
let arrAll = JSON.parse(JSON.stringify(this.form));
|
|
let arrAll = JSON.parse(JSON.stringify(this.form));
|
|
|
this.$set(this, 'form', arrAll);
|
|
this.$set(this, 'form', arrAll);
|
|
|
}
|
|
}
|
|
@@ -1296,6 +1342,8 @@
|
|
|
let flag = this.parameterVerification();
|
|
let flag = this.parameterVerification();
|
|
|
// 必填参数校验
|
|
// 必填参数校验
|
|
|
if (!flag) return;
|
|
if (!flag) return;
|
|
|
|
|
+
|
|
|
|
|
+ // this.
|
|
|
if (!this.form.id) {
|
|
if (!this.form.id) {
|
|
|
if (this.form.productInfoList.length) {
|
|
if (this.form.productInfoList.length) {
|
|
|
this.form.productInfoList.map((item, index) => {
|
|
this.form.productInfoList.map((item, index) => {
|
|
@@ -1314,11 +1362,11 @@
|
|
|
item.newSumOrderWeight = item.requiredFormingNum;
|
|
item.newSumOrderWeight = item.requiredFormingNum;
|
|
|
}
|
|
}
|
|
|
delete item.selectionRowShow;
|
|
delete item.selectionRowShow;
|
|
|
- if (item.bomVersionList && item.bomVersionList.length) {
|
|
|
|
|
- item.bomCategoryName = item.bomVersionList[0].name;
|
|
|
|
|
- item.bomCategoryVersions = item.bomVersionList[0].versions;
|
|
|
|
|
- item.produceRoutingName = item.routingList[0].name;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (item.bomVersionList && item.bomVersionList.length) {
|
|
|
|
|
+ // item.bomCategoryName = item.bomVersionList[0].name;
|
|
|
|
|
+ // item.bomCategoryVersions = item.bomVersionList[0].versions;
|
|
|
|
|
+ // item.produceRoutingName = item.routingList[0].name;
|
|
|
|
|
+ // }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1340,6 +1388,8 @@
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
|
|
+ console.log(this.form.productInfoList, 'this.form.productInfoList');
|
|
|
|
|
+ // return
|
|
|
temporaryPlanSave(this.form)
|
|
temporaryPlanSave(this.form)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
this.$message.success('修改成功!');
|
|
this.$message.success('修改成功!');
|