|
|
@@ -537,7 +537,8 @@
|
|
|
// requiredFormingNum: 0,
|
|
|
formInline: {
|
|
|
finalState: 0,
|
|
|
- attributeType: 2
|
|
|
+ attributeType: 2,
|
|
|
+ bomId:'',
|
|
|
},
|
|
|
finalStateList: [
|
|
|
{
|
|
|
@@ -645,7 +646,7 @@
|
|
|
return;
|
|
|
}
|
|
|
let list = [];
|
|
|
- console.log(res,'res -01')
|
|
|
+ console.log(res, 'res -01');
|
|
|
res.forEach((el) => {
|
|
|
if (el.status != 1) return;
|
|
|
let obj = {
|
|
|
@@ -681,6 +682,10 @@
|
|
|
},
|
|
|
// 选择BOM版本
|
|
|
async bomVChange(e) {
|
|
|
+ this.formInline.bomId = e;
|
|
|
+ console.log(this.bomListV,'1111111111111');
|
|
|
+ console.log(this.formInline,'22222222222222222')
|
|
|
+ console.log(e,'e')
|
|
|
// return
|
|
|
// let bomData = list.find((el) => el.bomId == e);
|
|
|
// if (!bomData) return;
|
|
|
@@ -846,7 +851,8 @@
|
|
|
clearData() {
|
|
|
this.formInline = {
|
|
|
finalState: 0,
|
|
|
- attributeType: 2
|
|
|
+ attributeType: 2,
|
|
|
+ bomId:''
|
|
|
};
|
|
|
this.baseCount = '';
|
|
|
this.baseUnit = '';
|
|
|
@@ -960,44 +966,62 @@
|
|
|
(el) => el.bomType === this.formInline.bomType
|
|
|
);
|
|
|
const addPOList = this.fieldProcessing(this.selection);
|
|
|
- this.$alert('确定要将所选的数据下发生产计划吗', {
|
|
|
+ // this.$alert('确定要将所选的数据下发生产计划吗', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // callback: (action) => {
|
|
|
+ // let param = {
|
|
|
+ // addPOList: addPOList,
|
|
|
+ // produceType: obj.bomType,
|
|
|
+ // id: this.planInfo.id
|
|
|
+ // };
|
|
|
+ // batchSave(param).then((res) => {
|
|
|
+ // this.$message.success('操作成功');
|
|
|
+ // this.bomVChange(this.formInline.bomId);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ this.$confirm('确定要将所选的数据下发生产计划吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
- callback: (action) => {
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
let param = {
|
|
|
addPOList: addPOList,
|
|
|
produceType: obj.bomType,
|
|
|
id: this.planInfo.id
|
|
|
};
|
|
|
-
|
|
|
batchSave(param).then((res) => {
|
|
|
this.$message.success('操作成功');
|
|
|
this.bomVChange(this.formInline.bomId);
|
|
|
});
|
|
|
- }
|
|
|
- });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+
|
|
|
// this.$refs.factoryAddRef.open();
|
|
|
// this.$refs.factoryAddRef.confirmChoose([row]);
|
|
|
},
|
|
|
|
|
|
// 字段处理
|
|
|
fieldProcessing(arr) {
|
|
|
- // console.log(arr,'arr')
|
|
|
+ console.log(arr, 'arr');
|
|
|
// return;
|
|
|
let list = arr.map((item) => {
|
|
|
return {
|
|
|
- id: this.planInfo.id,
|
|
|
+ id: item.id,
|
|
|
categoryId: item.categoryId,
|
|
|
- productCode: this.planInfo.productCode,
|
|
|
- productName: this.planInfo.productName,
|
|
|
+ productCode: item.code,
|
|
|
+ productName: item.name,
|
|
|
specification: item.specification,
|
|
|
- produceRoutingId: this.planInfo.produceRoutingId,
|
|
|
- produceRoutingName: this.planInfo.produceRoutingName,
|
|
|
- requiredFormingNum: this.planInfo.requiredFormingNum,
|
|
|
+ produceRoutingId: item.produceRoutingId || '',
|
|
|
+ produceRoutingName: item.produceRoutingName || '',
|
|
|
+ requiredFormingNum: item.finalShortageQuantity,
|
|
|
startTime: this.planInfo.startTime,
|
|
|
endTime: this.planInfo.endTime,
|
|
|
unit: item.unit,
|
|
|
- brandNo: this.planInfo.brandNo,
|
|
|
- model: this.planInfo.model,
|
|
|
+ brandNo: item.brandNo || '',
|
|
|
+ batchNo: this.planInfo.batchNo,
|
|
|
+ model: item.model,
|
|
|
resourceType: 0
|
|
|
};
|
|
|
});
|