|
|
@@ -8,6 +8,7 @@
|
|
|
custom-class="ele-dialog-form"
|
|
|
:title="'计划分解'"
|
|
|
:maxable="true"
|
|
|
+ @close="cancel"
|
|
|
>
|
|
|
<div class="form-wrapper">
|
|
|
<el-form :model="requestData" label-width="0" :show-message="false">
|
|
|
@@ -65,6 +66,8 @@
|
|
|
@update:selection="handleSelectionChange"
|
|
|
tool-class="ele-toolbar-actions"
|
|
|
max-height="360px"
|
|
|
+ @select-all="selectAll"
|
|
|
+ @select="select"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
<div class="toolbar_box">
|
|
|
@@ -129,7 +132,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { deepClone } from '@/utils';
|
|
|
- import { getBom , batchSave} from '@/api/productionPlan/index.js';
|
|
|
+ import { getBom, batchSave } from '@/api/productionPlan/index.js';
|
|
|
import { routeList } from '@/api/saleOrder';
|
|
|
import EquipmentDialog from './EquipmentDialog.vue';
|
|
|
|
|
|
@@ -140,24 +143,18 @@
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
-
|
|
|
formData: {},
|
|
|
requestData: {},
|
|
|
bomList: [],
|
|
|
baseCount: '',
|
|
|
unit: '',
|
|
|
-
|
|
|
selection: [],
|
|
|
-
|
|
|
jhList: [],
|
|
|
-
|
|
|
rules: {},
|
|
|
-
|
|
|
producedList: [
|
|
|
- { code: 2, name: '加工(MBOM)' },
|
|
|
- { code: 3, name: '装配(ABOM)' }
|
|
|
+ { code: 2, name: '加工(MBOM)' },
|
|
|
+ { code: 3, name: '装配(ABOM)' }
|
|
|
],
|
|
|
-
|
|
|
routingList: [],
|
|
|
columns: [
|
|
|
{
|
|
|
@@ -232,13 +229,11 @@
|
|
|
showOverflowTooltip: true
|
|
|
}
|
|
|
],
|
|
|
-
|
|
|
statusOpt: {
|
|
|
'': '全部',
|
|
|
0: '已停用',
|
|
|
1: '已发布'
|
|
|
},
|
|
|
-
|
|
|
jsColumns: [
|
|
|
{
|
|
|
prop: 'productCode',
|
|
|
@@ -294,7 +289,9 @@
|
|
|
label: '计量单位',
|
|
|
showOverflowTooltip: true
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ // bom信息map数据存储
|
|
|
+ bomListMap: {}
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -305,6 +302,33 @@
|
|
|
this.getRouteListFn();
|
|
|
},
|
|
|
|
|
|
+ // 全选/取消全选
|
|
|
+ selectAll(selection) {
|
|
|
+ // 说明是全选
|
|
|
+ if (selection.length > 0) {
|
|
|
+ this.bomList.forEach((el) => {
|
|
|
+ this.bomListMap[el.id] = true;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 取消全选
|
|
|
+ this.bomList.forEach((el) => {
|
|
|
+ delete this.bomListMap[el.id];
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.bomListMap, '看你数据');
|
|
|
+ },
|
|
|
+
|
|
|
+ // 勾选 取消勾选
|
|
|
+ select(selection, row) {
|
|
|
+ // 存在说明已勾选
|
|
|
+ if (this.bomListMap[row.id]) {
|
|
|
+ delete this.bomListMap[row.id];
|
|
|
+ }else{
|
|
|
+ this.bomListMap[row.id] = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
getBomList() {
|
|
|
let params = {
|
|
|
id: this.formData.id,
|
|
|
@@ -314,6 +338,7 @@
|
|
|
size: -1
|
|
|
};
|
|
|
getBom(params).then((res) => {
|
|
|
+ console.log(res, 'res 切换数据');
|
|
|
this.bomList = res?.bomList || [];
|
|
|
(this.baseCount = res.baseCount),
|
|
|
(this.unit = res.unit),
|
|
|
@@ -344,7 +369,8 @@
|
|
|
resourceType: 0
|
|
|
};
|
|
|
});
|
|
|
- this.jhList = _arr;
|
|
|
+ this.jhList.push(..._arr);
|
|
|
+ // this.jhList = _arr;
|
|
|
},
|
|
|
|
|
|
handleAdd() {
|
|
|
@@ -381,8 +407,9 @@
|
|
|
|
|
|
cancel() {
|
|
|
this.formData = {};
|
|
|
- this.jhList = []
|
|
|
+ this.jhList = [];
|
|
|
this.visible = false;
|
|
|
+ this.bomListMap = {};
|
|
|
},
|
|
|
|
|
|
getRouteListFn() {
|
|
|
@@ -413,8 +440,8 @@
|
|
|
id: this.formData.id
|
|
|
};
|
|
|
batchSave(param).then((res) => {
|
|
|
- this.$emit('close', true);
|
|
|
- this.visible = false;
|
|
|
+ this.$emit('close', true);
|
|
|
+ this.visible = false;
|
|
|
});
|
|
|
}
|
|
|
}
|