|
@@ -866,50 +866,41 @@
|
|
|
|
|
|
|
|
console.log('materialList 物料信息', materialObject);
|
|
console.log('materialList 物料信息', materialObject);
|
|
|
|
|
|
|
|
- if (type == '') {
|
|
|
|
|
- this.addForm.outputDetails = materialObject.outputDetails;
|
|
|
|
|
- this.addForm.pickDetails = materialObject.pickDetails.map((i) => {
|
|
|
|
|
- // 物料清单中如果存在则 selected 设置为 true
|
|
|
|
|
- const any = this.addForm.outputDetails.find(
|
|
|
|
|
- (j) => j.categoryId === i.categoryId
|
|
|
|
|
- );
|
|
|
|
|
- if (any) {
|
|
|
|
|
- i.selected = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- i.selected = false;
|
|
|
|
|
- }
|
|
|
|
|
- return i;
|
|
|
|
|
- });
|
|
|
|
|
- this.preOutputDetails = materialObject.preOutputDetails.map((i) => {
|
|
|
|
|
- i.quantity = i.qualifiedQuantity;
|
|
|
|
|
- return i;
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // this.preOutputDetails 是否存在outputType=2的数据
|
|
|
|
|
- const hasInProcess = this.preOutputDetails.some(
|
|
|
|
|
- (i) => i.outputType == 2
|
|
|
|
|
|
|
+ this.addForm.outputDetails = materialObject.outputDetails;
|
|
|
|
|
+ const pickDetails = materialObject.pickDetails.map((i) => {
|
|
|
|
|
+ // 物料清单中如果存在则 selected 设置为 true
|
|
|
|
|
+ const any = this.addForm.outputDetails.find(
|
|
|
|
|
+ (j) => j.categoryId === i.categoryId
|
|
|
);
|
|
);
|
|
|
- if (hasInProcess) {
|
|
|
|
|
- // 产出物为在制品
|
|
|
|
|
- this.addForm.outputType = 2;
|
|
|
|
|
- // 不可选择
|
|
|
|
|
|
|
+ if (any) {
|
|
|
|
|
+ i.selected = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ i.selected = false;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ return i;
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- if (type == 'output') {
|
|
|
|
|
- this.addForm.outputDetails = materialObject.outputDetails;
|
|
|
|
|
- this.addForm.pickDetails = this.addForm.pickDetails.map((i) => {
|
|
|
|
|
- // 物料清单中如果存在则 selected 设置为 true
|
|
|
|
|
- const any = this.addForm.outputDetails.find(
|
|
|
|
|
- (j) => j.categoryId === i.categoryId
|
|
|
|
|
- );
|
|
|
|
|
- if (any) {
|
|
|
|
|
- i.selected = true;
|
|
|
|
|
- } else {
|
|
|
|
|
- i.selected = false;
|
|
|
|
|
- }
|
|
|
|
|
- return i;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const preOutputDetails = materialObject.preOutputDetails.map((i) => {
|
|
|
|
|
+ i.quantity = i.qualifiedQuantity;
|
|
|
|
|
+ return i;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.preOutputDetails = preOutputDetails.filter(
|
|
|
|
|
+ (i) => i.outputType != 1
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ this.addForm.pickDetails = [
|
|
|
|
|
+ ...preOutputDetails.filter((i) => i.outputType == 1),
|
|
|
|
|
+ ...pickDetails
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // this.preOutputDetails 是否存在outputType=2的数据
|
|
|
|
|
+ const hasInProcess = this.preOutputDetails.some(
|
|
|
|
|
+ (i) => i.outputType == 2
|
|
|
|
|
+ );
|
|
|
|
|
+ if (hasInProcess) {
|
|
|
|
|
+ // 产出物为在制品
|
|
|
|
|
+ this.addForm.outputType = 2;
|
|
|
|
|
+ // 不可选择
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 规则信息
|
|
// 规则信息
|