695593266@qq.com пре 2 месеци
родитељ
комит
39abd9c351
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      src/views/taskList/index.vue

+ 6 - 4
src/views/taskList/index.vue

@@ -966,11 +966,15 @@
           reportQuantityReported: row.reportQuantity || 0,
           lossQuantityReported: row.lossQuantity || 0
         };
+        const taskQuantity = Number(row.quantity) || 0;
         const actualQuantity = this.add(
           row.reportQuantity ? row.reportQuantity : 0,
           row.lossQuantity ? row.lossQuantity : 0
         );
-        const remainingQuantity = this.sub(row.formingNum, actualQuantity);
+        const remainingQuantity = Math.max(
+          this.sub(taskQuantity, actualQuantity),
+          0
+        );
         let form = {
           realEndTime: row.realEndTime,
           realStartTime: row.realStartTime,
@@ -979,9 +983,7 @@
           qualifiedWeight: row.qualifiedWeight,
           remark: row.assigneeRemark,
           qualifiedQuantity: row.qualifiedQuantity,
-          reportQuantity: row.reportQuantity
-            ? remainingQuantity
-            : row.formingNum,
+          reportQuantity: row.reportQuantity ? remainingQuantity : taskQuantity,
           lossQuantity: 0,
           workOrderCode: row.workOrderCode,
           workOrderId: row.workOrderId,