|
|
@@ -332,7 +332,10 @@
|
|
|
import { fieldModel } from '@/api/saleOrder';
|
|
|
import { debounce } from 'lodash';
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
- import { findBomCategoryByCategoryId } from '@/api/productionPlan/index';
|
|
|
+ import {
|
|
|
+ findBomCategoryByCategoryId,
|
|
|
+ listBomType
|
|
|
+ } from '@/api/productionPlan/index';
|
|
|
export default {
|
|
|
mixins: [tabMixins],
|
|
|
components: {
|
|
|
@@ -829,7 +832,7 @@
|
|
|
}
|
|
|
for (let i = 0; i < this.selection.length; i++) {
|
|
|
let el = this.selection[i];
|
|
|
- if(!el.bomCategoryId){
|
|
|
+ if (!el.bomCategoryId) {
|
|
|
return this.$message.warning('请选择有BOM版本的数据');
|
|
|
}
|
|
|
}
|
|
|
@@ -934,24 +937,40 @@
|
|
|
} else {
|
|
|
let categoryId = row.categoryId;
|
|
|
let produceType = '';
|
|
|
- const res = await findBomCategoryByCategoryId(categoryId);
|
|
|
+ let params = { categoryId: categoryId };
|
|
|
+ const res = await listBomType(params);
|
|
|
+ console.log(res,'res 000');
|
|
|
+ let bomMap = {
|
|
|
+ 1: { code: 1, name: 'PBOM' },
|
|
|
+ 2: { code: 2, name: 'MBOM' },
|
|
|
+ 3: { code: 3, name: 'ABOM' }
|
|
|
+ };
|
|
|
let arr = [];
|
|
|
- if (res.length > 0) {
|
|
|
- let obj = res.find((item) => item.id === row.bomCategoryId);
|
|
|
- produceType = obj ? obj.bomType : produceType;
|
|
|
- let listMap = {
|
|
|
- 1: { code: 1, name: 'PBOM' },
|
|
|
- 2: { code: 2, name: 'MBOM' },
|
|
|
- 3: { code: 3, name: 'ABOM' }
|
|
|
- };
|
|
|
- res.forEach((el) => {
|
|
|
- if (listMap[el.bomType]) {
|
|
|
- arr.push(listMap[el.bomType]);
|
|
|
- delete listMap[el.bomType];
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- console.log(row, 'row');
|
|
|
+ res.map((item) => {
|
|
|
+ if(bomMap[item.bomType]){
|
|
|
+ arr.push(bomMap[item.bomType]);
|
|
|
+ delete bomMap[item.bomType];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // const res = await findBomCategoryByCategoryId(categoryId);
|
|
|
+ // let arr = [];
|
|
|
+ // if (res.length > 0) {
|
|
|
+ // let obj = res.find((item) => item.id === row.bomCategoryId);
|
|
|
+ // produceType = obj ? obj.bomType : produceType;
|
|
|
+ // let listMap = {
|
|
|
+ // 1: { code: 1, name: 'PBOM' },
|
|
|
+ // 2: { code: 2, name: 'MBOM' },
|
|
|
+ // 3: { code: 3, name: 'ABOM' }
|
|
|
+ // };
|
|
|
+ // res.forEach((el) => {
|
|
|
+ // if (listMap[el.bomType]) {
|
|
|
+ // arr.push(listMap[el.bomType]);
|
|
|
+ // delete listMap[el.bomType];
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ console.log(arr, 'arr 222');
|
|
|
+
|
|
|
this.$router
|
|
|
.push({
|
|
|
path: '/saleOrder/salesToProduction',
|