qukaidi 4 年之前
父節點
當前提交
640dc351da

+ 41 - 21
src/views/Warehousing/inStock/index.vue

@@ -793,33 +793,53 @@ export default {
       });
     },
     //合计
-    getSum(param) {
+  getSum(param) {
       const { columns, data } = param;
       const sums = [];
+      var values = [];
       columns.forEach((column, index) => {
         if (index === 0) {
-          sums[index] = "总计";
-        } else if (
-          index === 13 ||
-          index === 10 ||
-          index === 11 ||
-          index === 12
+          sums[index] = "";
+          return;
+        }
+        if (column.property === "fGrossweight") {
+          values = data.map((item) => Number(item["fGrossweight"]));
+        }
+        if (column.property === "fNetweight") {
+          values = data.map((item) => Number(item["fNetweight"]));
+        }
+        if (column.property === "fQty") {
+          values = data.map((item) => Number(item["fQty"]));
+        }
+        if (column.property === "fPlanqty") {
+          values = data.map((item) => Number(item.fPlanqty));
+        }
+        if (
+          column.property === "fGrossweight" ||
+          column.property === "fNetweight" ||
+          column.property === "fQty" ||
+          column.property === "fPlanqty"
         ) {
-          const values = data.map((item) => Number(item[column.property]));
-          if (!values.every((value) => isNaN(value))) {
-            sums[index] = values.reduce((prev, curr) => {
-              const value = Number(curr);
-              if (!isNaN(value)) {
-                return prev + curr;
-              } else {
-                return prev;
-              }
-            }, 0);
-            if (index === 13 || index === 12) {
-              sums[index] = (sums[index] / 1000).toFixed(2) + "(吨)";
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
             }
-            if (index === 11) {
-              sums[index] = sums[index];
+          }, 0);
+          if (column.property === "fGrossweight") {
+            sums[index] = sums[index].toFixed(2) + "吨";
+          }
+          if (column.property === "fNetweight") {
+            sums[index] = sums[index].toFixed(2) + "吨";
+          }
+          if (column.property === "fQty") {
+            sums[index] = sums[index].toFixed(2);
+          }
+          if (column.property === "fPlanqty") {
+            if (sums[index]) {
+              sums[index] = sums[index]
             }
           }
         }

+ 1 - 1
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -969,7 +969,7 @@
             >
               <template slot-scope="scope">
                 <el-input
-                  v-model="scope.row.fDriverName"
+                  v-model="scope.row.fDriverTel"
                   placeholder="司机电话"
                   :disabled="browseStatus || scope.row.fBillstatus >= 20"
                 />

+ 40 - 20
src/views/Warehousing/outStock/index.vue

@@ -804,30 +804,50 @@ export default {
     getSum(param) {
       const { columns, data } = param;
       const sums = [];
+      var values = [];
       columns.forEach((column, index) => {
         if (index === 0) {
-          sums[index] = "总计";
-        } else if (
-          index === 13 ||
-          index === 10 ||
-          index === 11 ||
-          index === 12
+          sums[index] = "";
+          return;
+        }
+        if (column.property === "fGrossweight") {
+          values = data.map((item) => Number(item["fGrossweight"]));
+        }
+        if (column.property === "fNetweight") {
+          values = data.map((item) => Number(item["fNetweight"]));
+        }
+        if (column.property === "fQty") {
+          values = data.map((item) => Number(item["fQty"]));
+        }
+        if (column.property === "fPlanqty") {
+          values = data.map((item) => Number(item.fPlanqty));
+        }
+        if (
+          column.property === "fGrossweight" ||
+          column.property === "fNetweight" ||
+          column.property === "fQty" ||
+          column.property === "fPlanqty"
         ) {
-          const values = data.map((item) => Number(item[column.property]));
-          if (!values.every((value) => isNaN(value))) {
-            sums[index] = values.reduce((prev, curr) => {
-              const value = Number(curr);
-              if (!isNaN(value)) {
-                return prev + curr;
-              } else {
-                return prev;
-              }
-            }, 0);
-            if (index === 13 || index === 12) {
-              sums[index] = (sums[index] / 1000).toFixed(2) + "(吨)";
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
             }
-            if (index === 11) {
-              sums[index] = sums[index];
+          }, 0);
+          if (column.property === "fGrossweight") {
+            sums[index] = sums[index].toFixed(2) + "吨";
+          }
+          if (column.property === "fNetweight") {
+            sums[index] = sums[index].toFixed(2) + "吨";
+          }
+          if (column.property === "fQty") {
+            sums[index] = sums[index].toFixed(2);
+          }
+          if (column.property === "fPlanqty") {
+            if (sums[index]) {
+              sums[index] = sums[index]
             }
           }
         }