|
@@ -40,6 +40,7 @@
|
|
|
>
|
|
>
|
|
|
<template v-slot:reportQuantity="{ row }">
|
|
<template v-slot:reportQuantity="{ row }">
|
|
|
<div>
|
|
<div>
|
|
|
|
|
+ <!-- {{ reportQuantitymax(row) }} -->
|
|
|
<el-input-number
|
|
<el-input-number
|
|
|
size="small"
|
|
size="small"
|
|
|
v-model.number="row.reportQuantity"
|
|
v-model.number="row.reportQuantity"
|
|
@@ -374,38 +375,37 @@
|
|
|
(item) => item.categoryCode === row.categoryCode
|
|
(item) => item.categoryCode === row.categoryCode
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- if (!materialQuotaItem) {
|
|
|
|
|
- return 0 + (row.unit || '');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 计算比例
|
|
|
|
|
- const proportion =
|
|
|
|
|
- materialQuotaItem.count / this.materialQuotaInfo.baseCount;
|
|
|
|
|
-
|
|
|
|
|
- if (this.materialQuotaInfo.standardOutput) {
|
|
|
|
|
- // BOM标准产出
|
|
|
|
|
- const preItem = this.sumOutputDetails.find(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.categoryCode ===
|
|
|
|
|
- this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
|
|
- );
|
|
|
|
|
- if (preItem) {
|
|
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
|
|
|
|
+ if (materialQuotaItem) {
|
|
|
|
|
+ // 计算比例
|
|
|
|
|
+ const proportion =
|
|
|
|
|
+ materialQuotaItem.count /
|
|
|
|
|
+ this.materialQuotaInfo.baseCount;
|
|
|
|
|
+
|
|
|
|
|
+ if (this.materialQuotaInfo.standardOutput) {
|
|
|
|
|
+ // BOM标准产出
|
|
|
|
|
+ const preItem = this.sumOutputDetails.find(
|
|
|
|
|
+ (item) =>
|
|
|
|
|
+ item.categoryCode ===
|
|
|
|
|
+ this.materialQuotaInfo.standardOutput.categoryCode
|
|
|
|
|
+ );
|
|
|
|
|
+ if (preItem) {
|
|
|
|
|
+ preCount += preItem.sumReportQuantity * proportion;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- if (this.categoryInfo) {
|
|
|
|
|
- // 在制品
|
|
|
|
|
- const preItem = this.sumOutputDetails.find(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.categoryCode === this.categoryInfo.categoryCode
|
|
|
|
|
- );
|
|
|
|
|
- if (preItem) {
|
|
|
|
|
- preCount += preItem.sumReportQuantity * proportion;
|
|
|
|
|
|
|
+ if (this.categoryInfo) {
|
|
|
|
|
+ // 在制品
|
|
|
|
|
+ const preItem = this.sumOutputDetails.find(
|
|
|
|
|
+ (item) =>
|
|
|
|
|
+ item.categoryCode === this.categoryInfo.categoryCode
|
|
|
|
|
+ );
|
|
|
|
|
+ if (preItem) {
|
|
|
|
|
+ preCount += preItem.sumReportQuantity * proportion;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ // debugger;
|
|
|
let count = 0;
|
|
let count = 0;
|
|
|
if (outputItem) {
|
|
if (outputItem) {
|
|
|
if (this.executeStatus === 2) {
|
|
if (this.executeStatus === 2) {
|
|
@@ -694,7 +694,7 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ console.log('this.localPickDetails', this.localPickDetails);
|
|
|
this.$emit('update:pickDetails', this.localPickDetails);
|
|
this.$emit('update:pickDetails', this.localPickDetails);
|
|
|
},
|
|
},
|
|
|
// bom标准产出赋值
|
|
// bom标准产出赋值
|
|
@@ -753,9 +753,17 @@
|
|
|
);
|
|
);
|
|
|
console.log('this.materialQuotaInfo', data);
|
|
console.log('this.materialQuotaInfo', data);
|
|
|
if (JSON.stringify(data) === '{}') {
|
|
if (JSON.stringify(data) === '{}') {
|
|
|
- this.materialQuotaInfo = null;
|
|
|
|
|
|
|
+ this.materialQuotaInfo = this.materialQuota;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (data.materialQuota) {
|
|
|
|
|
+ // 过滤数据
|
|
|
|
|
+ data.materialQuota = data.materialQuota.filter((i) => {
|
|
|
|
|
+ return i.isReworkBom != 1;
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.materialQuota = [];
|
|
|
|
|
+ }
|
|
|
this.materialQuotaInfo = data;
|
|
this.materialQuotaInfo = data;
|
|
|
console.log('this.materialQuotaInfo', this.materialQuotaInfo);
|
|
console.log('this.materialQuotaInfo', this.materialQuotaInfo);
|
|
|
}
|
|
}
|
|
@@ -821,7 +829,7 @@
|
|
|
(item) => !(item.categoryId === row.categoryId)
|
|
(item) => !(item.categoryId === row.categoryId)
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ console.log('this.localOutputDetails', this.localOutputDetails);
|
|
|
this.$emit('update:outputDetails', this.localOutputDetails);
|
|
this.$emit('update:outputDetails', this.localOutputDetails);
|
|
|
},
|
|
},
|
|
|
// getCategoryAndLevelByCategoryId 获取产品 在制品信息
|
|
// getCategoryAndLevelByCategoryId 获取产品 在制品信息
|
|
@@ -921,12 +929,18 @@
|
|
|
if (!pickItem) return pickItem.quantity - preCount;
|
|
if (!pickItem) return pickItem.quantity - preCount;
|
|
|
|
|
|
|
|
// 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
// 已执行,处理重新一键报工时,sumReportQuantity包含了当前报工数量
|
|
|
- if (this.executeStatus === 2) {
|
|
|
|
|
- return (
|
|
|
|
|
|
|
+ if (this.executeStatus == 2) {
|
|
|
|
|
+ const count =
|
|
|
pickItem.quantity -
|
|
pickItem.quantity -
|
|
|
- (pickItem.sumReportQuantity - row.reportQuantityCopy) -
|
|
|
|
|
- preCount
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ (row.sumReportQuantity - row.reportQuantityCopy) -
|
|
|
|
|
+ preCount;
|
|
|
|
|
+
|
|
|
|
|
+ // 如果小于本次报工数量 则返回本次报工数量
|
|
|
|
|
+ if (count < row.reportQuantityCopy) {
|
|
|
|
|
+ return row.reportQuantityCopy;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return count;
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
return pickItem.quantity - pickItem.sumReportQuantity - preCount;
|
|
return pickItem.quantity - pickItem.sumReportQuantity - preCount;
|
|
|
}
|
|
}
|