瀏覽代碼

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

阿伏兔 4 年之前
父節點
當前提交
17f264a6d5
共有 2 個文件被更改,包括 39 次插入26 次删除
  1. 35 6
      src/views/warehouseBusiness/goodsTransfer/index.vue
  2. 4 20
      src/views/warehouseBusiness/outStock/index.vue

+ 35 - 6
src/views/warehouseBusiness/goodsTransfer/index.vue

@@ -536,7 +536,7 @@
         <h3>库存明细</h3>
         <el-button :disabled="browseStatus" @click.prevent="addRelevant()">新增</el-button>
         <el-button :disabled="dataListSelection.length <= 0" @click.prevent="creditClick()"
-          >入库确认
+          >货转确认
         </el-button>
         <el-button type="primary" @click="submitForm(2)">保 存</el-button>
       </div>
@@ -610,6 +610,14 @@
         >
         </el-table-column>
         <el-table-column
+          prop="fPlannetweight"
+          header-align="center"
+          width="180px"
+          align="center"
+          label="库存净重"
+        >
+        </el-table-column>
+        <el-table-column
           prop="fQty"
           header-align="center"
           width="180px"
@@ -619,6 +627,7 @@
           <template slot-scope="scope">
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
+              @change="qtyChange(scope.row)"
               v-model="scope.row.fQty"
               placeholder="货转件数"
               :disabled="browseStatus"
@@ -644,7 +653,7 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="fPlannetweight"
+          prop="fNetweight"
           header-align="center"
           width="180px"
           align="center"
@@ -653,7 +662,7 @@
           <template slot-scope="scope">
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
-              v-model="scope.row.fPlannetweight"
+              v-model="scope.row.fNetweight"
               placeholder="货转净重"
               :disabled="browseStatus"
               show-word-limit
@@ -1675,8 +1684,12 @@ export default {
     },
     // 库存总账导出数据
     whgenlegData () {
+      if (this.dialogWhgenlegList.length === 0) {
+        this.$message({message: '未勾选信息', type: 'warning'})
+        return false
+      }
       for (let whgen in this.dialogWhgenlegList) {
-        if (!this.form.fMblno) {
+        if (!this.form.fMblno || this.form.fMblno === '') {
           this.$set(this.form, 'fMblno', this.dialogWhgenlegList[whgen].fMblno)
         }
         this.dataList.push({
@@ -1688,9 +1701,11 @@ export default {
           fWarehouselocid: this.dialogWhgenlegList[whgen].fWarehouseLocationid,
           fWarehouselocids: this.dialogWhgenlegList[whgen].fWarehouseLocationids,
           fPlanqty: this.dialogWhgenlegList[whgen].fQtyblc,
+          fPlannetweight: this.dialogWhgenlegList[whgen].fNetweightblc,
           fPlangrossweight: this.dialogWhgenlegList[whgen].fGrossweightblc,
           fQty: 0,
           fCntqty: 1,
+          fNetweight: 0,
           fGrossweight: 0,
           fPackagespecs: null,
           fGoodsval: null,
@@ -2063,11 +2078,11 @@ export default {
       this.dataListSelection = selection;
       if (this.Printinglist.length > 0) {
           this.fTruckno = selection[0].fTruckno;
-          this.fBsdate =  new Date(selection[0].fBsdate) 
+          this.fBsdate =  new Date(selection[0].fBsdate)
           this.fCntrtype = selection[0].fCntrtype;
           this.fGoodsids = selection[0].fGoodsids;
       }
-      
+
     },
      // 库存明细多选框结果
     dataListChange (row) {
@@ -2182,6 +2197,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
+      }
+      // 净重 fPlannetweight
+      // 毛重 fPlangrossweight
+      let netweight = parseFloat(Number(row.fPlannetweight) / Number(row.fQtyblc)).toFixed(6)
+      let grossweigh = parseFloat(Number(row.fPlangrossweight) / 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);
     },

+ 4 - 20
src/views/warehouseBusiness/outStock/index.vue

@@ -2375,29 +2375,13 @@ export default {
     // 库存总账导出数据
     whgenlegData() {
       if (this.dialogWhgenlegList.length === 0) {
-        this.dataList.push({
-          fMblno: this.whgenlegList[0].fMblno,
-          fGoodsid: this.whgenlegList[0].fGoodsid,
-          fCntrtype: null,
-          fQtyblc: this.whgenlegList[0].fQtyblc,
-          fWarehouseLocationids: this.whgenlegList[0]
-            .fWarehouseLocationids,
-          fGoodsids: this.whgenlegList[0].fGoodsids,
-          fGrossweight: 0,
-          fNetweight: 0,
-          fQty: 0,
-          fCntqty: 1,
-          fPackagespecs: null,
-          fWarehouselocid: this.whgenlegList[0].fWarehouseLocationid,
-          fCntrno: this.whgenlegList[0].fCntrno,
-          fGoodsval: null,
-          fTruckno: null,
-          remark: null,
-        });
-        this.whgenlegVisible = false;
+        this.$message({message: '未勾选信息', type: 'warning'})
         return false
       }
       for (let whgen in this.dialogWhgenlegList) {
+        if (!this.form.fMblno || this.form.fMblno === '') {
+          this.$set(this.form, 'fMblno', this.dialogWhgenlegList[whgen].fMblno)
+        }
         this.dataList.push({
           fMblno: this.dialogWhgenlegList[whgen].fMblno,
           fGoodsid: this.dialogWhgenlegList[whgen].fGoodsid,