瀏覽代碼

添加出库时 根据出库件数计算出 出库毛重 出库净重

阿伏兔 4 年之前
父節點
當前提交
ec2a523c7f
共有 1 個文件被更改,包括 24 次插入12 次删除
  1. 24 12
      src/views/warehouseBusiness/outStock/index.vue

+ 24 - 12
src/views/warehouseBusiness/outStock/index.vue

@@ -878,7 +878,7 @@
         >
         </el-table-column>
         <el-table-column
-          prop="fgrossweight"
+          prop="fGrossweight"
           header-align="center"
           width="180px"
           align="center"
@@ -895,7 +895,7 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="fnetweight"
+          prop="fNetweight"
           header-align="center"
           width="180px"
           align="center"
@@ -912,7 +912,7 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="fqty"
+          prop="fQty"
           header-align="center"
           width="180px"
           align="center"
@@ -921,6 +921,7 @@
           <template slot-scope="scope">
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "")'
+              @change="qtyChange(scope.row)"
               v-model="scope.row.fQty"
               :disabled="browseStatus"
               placeholder="出库件数"
@@ -962,7 +963,7 @@
             />
           </template>
         </el-table-column>
-        
+
         <el-table-column
           prop="fCntrno"
           header-align="center"
@@ -2365,7 +2366,6 @@ export default {
         });
         return false;
       }
-
       this.whgenlegList = [];
       this.dialogWhgenlegList = [];
       this.whgenlegTotal = 0;
@@ -2374,9 +2374,7 @@ export default {
     },
     // 库存总账导出数据
     whgenlegData() {
-      console.log(this.dialogWhgenlegList);
-      console.log(this.whgenlegList);
-      if (this.dialogWhgenlegList.length == 0) {
+      if (this.dialogWhgenlegList.length === 0) {
         this.dataList.push({
           fMblno: this.whgenlegList[0].fMblno,
           fGoodsid: this.whgenlegList[0].fGoodsid,
@@ -2397,7 +2395,7 @@ export default {
           remark: null,
         });
         this.whgenlegVisible = false;
-        return 
+        return false
       }
       for (let whgen in this.dialogWhgenlegList) {
         this.dataList.push({
@@ -2405,8 +2403,9 @@ export default {
           fGoodsid: this.dialogWhgenlegList[whgen].fGoodsid,
           fCntrtype: null,
           fQtyblc: this.dialogWhgenlegList[whgen].fQtyblc,
-          fWarehouseLocationids: this.dialogWhgenlegList[whgen]
-            .fWarehouseLocationids,
+          fNetweightblc: this.dialogWhgenlegList[whgen].fNetweightblc,
+          fGrossweightblc: this.dialogWhgenlegList[whgen].fGrossweightblc,
+          fWarehouseLocationids: this.dialogWhgenlegList[whgen].fWarehouseLocationids,
           fGoodsids: this.dialogWhgenlegList[whgen].fGoodsids,
           fGrossweight: 0,
           fNetweight: 0,
@@ -2506,7 +2505,6 @@ export default {
       this.whgenlegParams.fCorpid = this.form.fCorpid;
       this.whgenlegParams.fWarehouseid = this.form.fWarehouseid;
       this.whgenlegParams.fTrademodeid = this.form.fTrademodeid;
-
       listWhgenleg(this.whgenlegParams).then((response) => {
         this.whgenlegList = response.rows;
         console.log(this.whgenlegList);
@@ -3169,6 +3167,20 @@ export default {
           this.download(response.msg);
         });
     },
+    // 出库件数的计算
+    qtyChange(row) {
+      if (!row.fQty || row.fQty === '') {
+        this.$set(row, 'fNetweight', 0)
+        this.$set(row, 'fGrossweight', 0)
+        return false
+      }
+      // 净重 fNetweightblc
+      // 毛重 fGrossweightblc
+      let netweight = parseFloat(Number(row.fNetweightblc) / Number(row.fQtyblc)).toFixed(6)
+      let grossweigh = parseFloat(Number(row.fGrossweightblc) / Number(row.fQtyblc)).toFixed(6)
+      this.$set(row, 'fNetweight', parseFloat(Number(netweight) * Number(row.fQty)).toFixed(6))
+      this.$set(row, 'fGrossweight', parseFloat(Number(grossweigh) * Number(row.fQty)).toFixed(6))
+    },
     deleteRow(index, rows) {
       rows.splice(index, 1);
     },