浏览代码

入库净重计算sdy

zhongtianhaoyuan 3 年之前
父节点
当前提交
4cb4060646

+ 6 - 4
public/static/weightCheckInOut.html

@@ -146,11 +146,13 @@
           </tr>
           <tr class="row">
             <td class="col col-bgc">毛重(吨)</td>
-            <td class="col" colspan="2">{{tableData.grossWeight}}</td>
+            <td class="col">{{tableData.grossWeight}}</td>
             <td class="col col-bgc">皮重(吨)</td>
-            <td class="col" colspan="2">{{tableData.tare}}</td>
-            <td class="col col-bgc">净重(吨)</td>
-            <td class="col" colspan="2">{{tableData.netWeight}}</td>
+            <td class="col">{{tableData.tare}}</td>
+            <td class="col col-bgc">扣重(吨)</td>
+            <td class="col" >{{tableData.deductionWeight}}</td>
+            <td class="col col-bgc" colspan="2">净重(吨)</td>
+            <td class="col" >{{tableData.netWeight}}</td>
           </tr>
         </table>
         <div class="bottom">

+ 32 - 25
src/views/warehouse/warehouseManagementGross.vue

@@ -1876,18 +1876,25 @@
           })
       },
       tarechange(e) {
-        if (
-          this.deptBudgetList.grossWeight &&
-          this.deptBudgetList.tare &&
-          (this.deptBudgetList.deductionWeight ||
-            this.deptBudgetList.deductionWeight == 0)
-        ) {
-          this.deptBudgetList.netWeight = Number(
-            this.deptBudgetList.grossWeight -
-            this.deptBudgetList.tare -
-            this.deptBudgetList.deductionWeight
-          ).toFixed(2)
+        debugger
+        console.log(this.deptBudgetList.tare)
+        console.log(Number(this.deptBudgetList.tare))
+        if(this.deptBudgetList.grossWeight){
+          this.deptBudgetList.netWeight = Number(this.deptBudgetList.grossWeight) - Number(this.deptBudgetList.tare) - Number(this.deptBudgetList.deductionWeight)
         }
+          this.deptBudgetList.netWeight.toFixed(2)
+        // if (
+        //   this.deptBudgetList.grossWeight &&
+        //   (this.deptBudgetList.tare || !this.deptBudgetList.tare) &&
+        //   (this.deptBudgetList.deductionWeight ||
+        //     this.deptBudgetList.deductionWeight == 0)
+        // ) {
+        //   this.deptBudgetList.netWeight = Number(
+        //     this.deptBudgetList.grossWeight -
+        //     this.deptBudgetList.tare -
+        //     this.deptBudgetList.deductionWeight
+        //   ).toFixed(2)
+        // }
       },
       grossWeightchange(e) {
         this.grossWeight = this.deptBudgetList.grossWeight
@@ -2090,20 +2097,20 @@
             return false
           })
       },
-      tarechange(e) {
-        if (
-          this.deptBudgetList.grossWeight &&
-          this.deptBudgetList.tare &&
-          (this.deptBudgetList.deductionWeight ||
-            this.deptBudgetList.deductionWeight == 0)
-        ) {
-          this.deptBudgetList.netWeight = Number(
-            this.deptBudgetList.grossWeight -
-            this.deptBudgetList.tare -
-            this.deptBudgetList.deductionWeight
-          ).toFixed(2)
-        }
-      },
+      // tarechange(e) {
+      //   if (
+      //     this.deptBudgetList.grossWeight &&
+      //     this.deptBudgetList.tare &&
+      //     (this.deptBudgetList.deductionWeight ||
+      //       this.deptBudgetList.deductionWeight == 0)
+      //   ) {
+      //     this.deptBudgetList.netWeight = Number(
+      //       this.deptBudgetList.grossWeight -
+      //       this.deptBudgetList.tare -
+      //       this.deptBudgetList.deductionWeight
+      //     ).toFixed(2)
+      //   }
+      // },
       grossWeightchange(e) {
         this.grossWeight = this.deptBudgetList.grossWeight
         if (

+ 9 - 3
src/views/warehouse/warehouseManagementNoWeightIn.vue

@@ -422,7 +422,7 @@
         //深度监听,可监听到对象、数组的变化
         handler(val, oldVal) {
           if (val.tare) {
-            this.dataList.netWeight = this.dataList.grossWeight - val.tare
+            this.dataList.netWeight = this.dataList.grossWeight - val.tare - val.deductionWeight
           }
         },
         deep: true, //true 深度监听
@@ -1483,16 +1483,22 @@
       },
       tarechange(e) {
         this.tare = this.dataList.tare
+        if(!this.dataList.deductionWeight){
+          this.dataList.deductionWeight = 0
+        }
         if (this.dataList.grossWeight && this.dataList.tare) {
           this.dataList.netWeight = Number(
-            this.dataList.grossWeight - this.dataList.tare
+            this.dataList.grossWeight - this.dataList.tare - this.dataList.deductionWeight
           ).toFixed(2)
         }
       },
       grossWeightchange(e) {
+         if(!this.dataList.deductionWeight){
+          this.dataList.deductionWeight = 0
+        }
         if (this.dataList.grossWeight && this.dataList.tare) {
           this.dataList.netWeight = Number(
-            this.dataList.grossWeight - this.dataList.tare
+            this.dataList.grossWeight - this.dataList.tare - this.dataList.deductionWeight
           ).toFixed(2)
         }
       },