|
@@ -887,6 +887,11 @@
|
|
|
newWeightUnit: row.newWeightUnit,
|
|
newWeightUnit: row.newWeightUnit,
|
|
|
measuringUnit: row.measuringUnit
|
|
measuringUnit: row.measuringUnit
|
|
|
};
|
|
};
|
|
|
|
|
+ const actualQuantity = this.add(
|
|
|
|
|
+ row.reportQuantity ? row.reportQuantity : 0,
|
|
|
|
|
+ row.lossQuantity ? row.lossQuantity : 0
|
|
|
|
|
+ );
|
|
|
|
|
+ const remainingQuantity = this.sub(row.formingNum, actualQuantity);
|
|
|
let form = {
|
|
let form = {
|
|
|
realEndTime: row.realEndTime,
|
|
realEndTime: row.realEndTime,
|
|
|
realStartTime: row.realStartTime,
|
|
realStartTime: row.realStartTime,
|
|
@@ -896,9 +901,9 @@
|
|
|
remark: row.assigneeRemark,
|
|
remark: row.assigneeRemark,
|
|
|
qualifiedQuantity: row.qualifiedQuantity,
|
|
qualifiedQuantity: row.qualifiedQuantity,
|
|
|
reportQuantity: row.reportQuantity
|
|
reportQuantity: row.reportQuantity
|
|
|
- ? row.reportQuantity
|
|
|
|
|
|
|
+ ? remainingQuantity
|
|
|
: row.formingNum,
|
|
: row.formingNum,
|
|
|
- lossQuantity: row.lossQuantity ? row.lossQuantity : 0
|
|
|
|
|
|
|
+ lossQuantity: 0
|
|
|
};
|
|
};
|
|
|
if (this.tabValue == '4') {
|
|
if (this.tabValue == '4') {
|
|
|
const data = {
|
|
const data = {
|
|
@@ -924,6 +929,39 @@
|
|
|
this.$refs.detailsRef.open(type, currentRow, form);
|
|
this.$refs.detailsRef.open(type, currentRow, form);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ getDecimalLength(num) {
|
|
|
|
|
+ return (num.toString().split('.')[1] || '').length;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ toInteger(num) {
|
|
|
|
|
+ const len = this.getDecimalLength(num);
|
|
|
|
|
+ return {
|
|
|
|
|
+ int: Math.round(num * Math.pow(10, len)),
|
|
|
|
|
+ factor: Math.pow(10, len)
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ add(a, b) {
|
|
|
|
|
+ const { int: aInt, factor: aFactor } = this.toInteger(a);
|
|
|
|
|
+ const { int: bInt, factor: bFactor } = this.toInteger(b);
|
|
|
|
|
+ const maxFactor = Math.max(aFactor, bFactor);
|
|
|
|
|
+ return (
|
|
|
|
|
+ (aInt * (maxFactor / aFactor) + bInt * (maxFactor / bFactor)) /
|
|
|
|
|
+ maxFactor
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ sub(a, b) {
|
|
|
|
|
+ const { int: aInt, factor: aFactor } = this.toInteger(a);
|
|
|
|
|
+ const { int: bInt, factor: bFactor } = this.toInteger(b);
|
|
|
|
|
+ const maxFactor = Math.max(aFactor, bFactor);
|
|
|
|
|
+ return (
|
|
|
|
|
+ (aInt * (maxFactor / aFactor) - bInt * (maxFactor / bFactor)) /
|
|
|
|
|
+ maxFactor
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
viewRecords(apsAssigneeId) {
|
|
viewRecords(apsAssigneeId) {
|
|
|
listUpdateRealTimeRecord(apsAssigneeId)
|
|
listUpdateRealTimeRecord(apsAssigneeId)
|
|
|
.then((res) => {
|
|
.then((res) => {
|