luobang 1 år sedan
förälder
incheckning
3a87673a94

+ 1 - 1
build/utils.js

@@ -19,7 +19,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 // let devModules = ['all']
 // let devModules = ['index']
 let devModules = ['all']
-// let devModules = ['index', 'statisticalReport', 'appoint', 'sale', 'WMS']
+// let devModules = ['index', 'sale']
 
 if (pathSrc.indexOf('node_modules') > -1) {
   devModules = require('../../../cors.js').devModules

+ 0 - 1
src/views/WMS/components/steel/bar2_steel/bar2_steel_inboundReal.vue

@@ -124,7 +124,6 @@ export default {
       return days
     },
     onclick() {
-      debugger
       let startTime = null
       let endTime = null
       // 判断用户有没有班次,有班次则提供默认时间

+ 56 - 4
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -3442,16 +3442,40 @@ export default {
     getTotalNum(data) {
       //通过车序号的个数来计算车数
       let arr = []
+      let arrNetAmount = []
+      let noWeightBatchIdList = []
+      let weightBatchIdList = []
+      let totalWeightList = []
+      let hash = {}
       arr = data.map(e => {
         return e.saleOrderMaterialId
       })
+      noWeightBatchIdList = data.reduce((prev, item) => {
+        if (!item.weightBatchId) {
+          prev.push(item)
+        }
+        return prev
+      }, [])
+      weightBatchIdList = data.reduce((prev, item) => {
+        if (item.weightBatchId) {
+          prev.push(item)
+        }
+        return prev
+      }, [])
+      arrNetAmount = weightBatchIdList.reduce(function(prev, item, index, arr) {
+        hash[item.weightBatchId]
+          ? null
+          : (hash[item.weightBatchId] = true && prev.push(item))
+        return prev
+      }, [])
+      totalWeightList = noWeightBatchIdList.concat(arrNetAmount)
       this.totalCapacity = Array.from(new Set(arr)).length
       this.totalNetWeight =
-        data.reduce(function(prev, item) {
+        totalWeightList.reduce(function(prev, item, index) {
           return prev + item.netWeight * 1000
         }, 0) / 1000
       this.totalDetailsAmount =
-        data.reduce((prev, item) => {
+        totalWeightList.reduce((prev, item) => {
           return prev + item.detailsAmount * 1000
         }, 0) / 1000
     },
@@ -3459,16 +3483,44 @@ export default {
     getTotalNumSettled(data) {
       //通过车序号的个数来计算车数
       let arr = []
+      let arrNetAmount = []
+      let noWeightBatchIdList = []
+      let weightBatchIdList = []
+      let totalWeightList = []
+      let hash = {}
       arr = data.map(e => {
         return e.saleOrderMaterialId
       })
+      noWeightBatchIdList = data.reduce((prev, item) => {
+        if (!item.weightBatchId) {
+          prev.push(item)
+        }
+        return prev
+      }, [])
+      weightBatchIdList = data.reduce((prev, item) => {
+        if (item.weightBatchId) {
+          prev.push(item)
+        }
+        return prev
+      }, [])
+      arrNetAmount = weightBatchIdList.reduce(function(prev, item, index, arr) {
+        if (item.weightBatchId) {
+          hash[item.weightBatchId]
+            ? ''
+            : (hash[item.weightBatchId] = true && prev.push(item))
+          return prev
+        } else {
+          return prev.push(item)
+        }
+      }, [])
+      totalWeightList = noWeightBatchIdList.concat(arrNetAmount)
       this.setteldTotalCapacity = Array.from(new Set(arr)).length
       this.totalNetWeightSettled =
-        data.reduce(function(prev, item) {
+        totalWeightList.reduce(function(prev, item) {
           return prev + item.netWeight * 1000
         }, 0) / 1000
       this.totalDetailsAmountSettled =
-        data.reduce((prev, item) => {
+        totalWeightList.reduce((prev, item) => {
           return prev + item.detailsAmount * 1000
         }, 0) / 1000
     },