Przeglądaj źródła

调整货转、调拨弹窗界面 细节

阿伏兔 4 lat temu
rodzic
commit
b89c1533db

+ 31 - 29
src/views/warehouseBusiness/goodsTransfer/index.vue

@@ -641,16 +641,8 @@
           header-align="center"
           align="center"
           width="180px"
-          label="*库存件数"
+          label="*结余件数"
         >
-          <template slot-scope="scope">
-            <el-input
-              v-model="scope.row.fPlanqty"
-              placeholder="库存件数"
-              disabled
-              show-word-limit
-            />
-          </template>
         </el-table-column>
         <el-table-column
           prop="fPlangrossweight"
@@ -659,14 +651,6 @@
           width="180px"
           label="*库存毛重"
         >
-          <template slot-scope="scope">
-            <el-input
-              v-model="scope.row.fPlangrossweight"
-              placeholder="库存毛重"
-              disabled
-              show-word-limit
-            />
-          </template>
         </el-table-column>
         <el-table-column
           prop="fPlannetweight"
@@ -675,14 +659,6 @@
           align="center"
           label="*库存净重"
         >
-          <template slot-scope="scope">
-            <el-input
-              v-model="scope.row.fPlannetweight"
-              placeholder="库存净重"
-              disabled
-              show-word-limit
-            />
-          </template>
         </el-table-column>
         <el-table-column
           prop="fQty"
@@ -712,9 +688,10 @@
           <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")'
+              :disabled="browseStatus || scope.row.fBillstatus === 6"
+              @change="changeTransfer(scope.row)"
               v-model="scope.row.fGrossweight"
               placeholder="货转毛重"
-              :disabled="browseStatus || scope.row.fBillstatus === 6"
               show-word-limit
             />
           </template>
@@ -729,9 +706,10 @@
           <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")'
+              :disabled="browseStatus || scope.row.fBillstatus === 6"
               v-model="scope.row.fNetweight"
+              @change="changeTransfer(scope.row)"
               placeholder="货转净重"
-              :disabled="browseStatus || scope.row.fBillstatus === 6"
               show-word-limit
             />
           </template>
@@ -2615,13 +2593,37 @@
           this.$set(row, 'fGrossweight', 0)
           return false
         }
-        // 净重 fPlannetweight
-        // 毛重 fPlangrossweight
+        if (row.fPlanqty < row.fQty) {
+          this.$message.error("货转件数超出结余件数!");
+          this.$set(row, 'fQty', 0)
+          this.$set(row, 'fNetweight', 0)
+          this.$set(row, 'fGrossweight', 0)
+          return false;
+        }
         let netweight = parseFloat(Number(row.fPlannetweight) / Number(row.fPlanqty)).toFixed(6)
         let grossweigh = parseFloat(Number(row.fPlangrossweight) / Number(row.fPlanqty)).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))
       },
+      // 修改毛重净重
+      changeTransfer (row) {
+        let fNetweight = 0;
+        let fGrossweight = 0;
+        if (row.fNetweight) {
+          fNetweight = row.fNetweight
+        }
+        if (row.fGrossweight) {
+          fGrossweight = row.fGrossweight
+        }
+        if (row.fPlannetweight < fNetweight) {
+          this.$message({ message: '货转净重超出结余净重', type: 'warning' })
+          return false
+        }
+        if (row.fPlangrossweight < fGrossweight) {
+          this.$message({ message: '货转毛重超出结余毛重', type: 'warning' })
+          return false
+        }
+      },
       deleteRow(index, rows) {
         rows.splice(index, 1)
         this.this.updateDeduplication()

+ 48 - 4
src/views/warehouseBusiness/stockTransfer/index.vue

@@ -736,7 +736,23 @@
           header-align="center"
           align="center"
           width="180px"
-          label="*当前库存"
+          label="*结余库存"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="fPlangrossweight"
+          header-align="center"
+          align="center"
+          width="180px"
+          label="*结余毛重"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="fPlannetweight"
+          header-align="center"
+          align="center"
+          width="180px"
+          label="*结余净重"
         >
         </el-table-column>
         <el-table-column
@@ -769,6 +785,7 @@
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               :disabled="browseStatus || scope.row.fBillstatus === 6"
               v-model="scope.row.fGrossweight"
+              @change="changeStock(scope.row)"
               placeholder="调拨毛重"
               show-word-limit
             />
@@ -786,6 +803,7 @@
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               :disabled="browseStatus || scope.row.fBillstatus === 6"
               v-model="scope.row.fNetweight"
+              @change="changeStock(scope.row)"
               placeholder="调拨净重"
               show-word-limit
             />
@@ -3805,7 +3823,7 @@ export default {
       this.$set(this.form, 'fMarks', Array.from(new Set(fMarks)).join(","))
       this.$set(this.form, 'fProductName', Array.from(new Set(fGoodsid)).join(","))
     },
-    // 保存agreementitemsList
+    // 保存
     saveForm () {
       this.updateDeduplication()
       this.$refs['form'].validate((valid) => {
@@ -3814,6 +3832,7 @@ export default {
           return false
         }
         for (let list in this.dataList) {
+          this.changeStock(this.dataList[list])
           if (!this.dataList[list].fQty || Number(this.dataList[list].fQty) === 0) {
             this.$message.error('请维护序号为' + (Number(list) + 1) + '的调拨件数!')
             return false
@@ -3861,6 +3880,7 @@ export default {
           return false
         }
         for (let list in this.dataList) {
+          this.changeStock(this.dataList[list])
           if (!this.dataList[list].fQty || this.dataList[list].fQty === 0) {
             this.$message.error('请输入调拨件数!')
             return false
@@ -3957,6 +3977,25 @@ export default {
           this.download(response.msg);
         });
     },
+    // 修改毛重净重
+    changeStock (row) {
+      let fNetweight = 0;
+      let fGrossweight = 0;
+      if (row.fNetweight) {
+        fNetweight = row.fNetweight
+      }
+      if (row.fGrossweight) {
+        fGrossweight = row.fGrossweight
+      }
+      if (row.fPlannetweight < fNetweight) {
+        this.$message({ message: '调拨净重超出结余净重', type: 'warning' })
+        return false
+      }
+      if (row.fPlangrossweight < fGrossweight) {
+        this.$message({ message: '调拨毛重超出结余毛重', type: 'warning' })
+        return false
+      }
+    },
     // 调拨件数的计算
     qtyChange(row) {
       if (!row.fQty || row.fQty === "") {
@@ -3964,8 +4003,13 @@ export default {
         this.$set(row, "fGrossweight", 0);
         return false;
       }
-      // 净重 fPlannetweight
-      // 毛重 fPlangrossweight
+      if (row.fPlanqty < row.fQty) {
+        this.$message.error("出库件数超出结余件数!");
+        this.$set(row, 'fQty', 0)
+        this.$set(row, 'fNetweight', 0)
+        this.$set(row, 'fGrossweight', 0)
+        return false;
+      }
       let fVolumn = parseFloat(Number(row.fVolumn) / Number(row.fPlanqty)).toFixed(2);
       let netweight = parseFloat(Number(row.fPlannetweight) / Number(row.fPlanqty)).toFixed(2);
       let grossweigh = parseFloat(Number(row.fPlangrossweight) / Number(row.fPlanqty)).toFixed(2);