|
|
@@ -431,7 +431,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { findBomCategoryByCategoryId } from '@/api/productionPlan/index';
|
|
|
+ import {
|
|
|
+ findBomCategoryByCategoryId,
|
|
|
+ listBomType
|
|
|
+ } from '@/api/productionPlan/index';
|
|
|
import ImportException from '../components/import-exception.vue';
|
|
|
import CreateOrder from '../components/create-order.vue';
|
|
|
import GroupOrder from '../components/group-order.vue';
|
|
|
@@ -634,23 +637,43 @@
|
|
|
}
|
|
|
console.log(this.selection, 'this.selection 3333');
|
|
|
let categoryId = this.selection[0].categoryId;
|
|
|
- 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 === 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];
|
|
|
- }
|
|
|
- });
|
|
|
+ res.map((item) => {
|
|
|
+ if (bomMap[item.bomType]) {
|
|
|
+ arr.push(bomMap[item.bomType]);
|
|
|
+ delete bomMap[item.bomType];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (arr.length > 0 && produceType) {
|
|
|
+ let obj = arr.find((el) => el.code == produceType);
|
|
|
+ produceType = obj ? produceType : arr[0].code;
|
|
|
}
|
|
|
+ console.log(arr, 'arr 222');
|
|
|
+ // const res = await findBomCategoryByCategoryId(categoryId);
|
|
|
+ // let arr = [];
|
|
|
+ // if (res.length > 0) {
|
|
|
+ // let obj = res.find((item) => item.id === 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];
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
this.$router
|
|
|
.push({
|
|
|
path: '/saleOrder/salesToProduction',
|
|
|
@@ -767,7 +790,7 @@
|
|
|
},
|
|
|
// payBudget() {},
|
|
|
homogeneityInspect(val) {
|
|
|
- console.log(val,'val')
|
|
|
+ console.log(val, 'val');
|
|
|
this.$emit('check', val);
|
|
|
}
|
|
|
}
|