Explorar el Código

出库列表显示计划件数修改

wengyuwen hace 4 años
padre
commit
ea92c5f77a

+ 18 - 0
src/views/warehouseBusiness/inStock/index.vue

@@ -1121,6 +1121,7 @@
             <el-input
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fQty"
+              @change="qtyChange(scope.row)"
               placeholder="入库件数"
               :disabled="browseStatus || scope.row.fBillstatus === 40"
               show-word-limit
@@ -3060,6 +3061,23 @@ export default {
     this.adoPt()
   },
   methods: {
+    // 出库件数的计算
+    qtyChange(row) {
+      if (!row.fQty || row.fQty === "") {
+        this.$set(row, "fNetweight", 0);
+        this.$set(row, "fGrossweight", 0);
+        return false;
+      }
+
+      // 净重 fPlannetweight
+      // 毛重 fPlangrossweight
+      // let fVolumn = parseFloat(Number(row.fVolumn) / Number(row.fPlanqty)).toFixed(2);
+      let netweight = parseFloat(Number(this.form.fPlannetweight) / Number(this.form.fPlanqty)).toFixed(2);
+      let grossweigh = parseFloat(Number(this.form.fPlangrossweight) / Number(this.form.fPlanqty)).toFixed(2);
+      // this.$set(row, "fVolumn", parseFloat(Number(fVolumn) * Number(row.fQty)).toFixed(2));
+      this.$set(row, "fNetweight", parseFloat(Number(netweight) * Number(row.fQty)).toFixed(2));
+      this.$set(row, "fGrossweight", parseFloat(Number(grossweigh) * Number(row.fQty)).toFixed(2));
+    },
     adoPt(){
       this.approval = this.$route.query.data
       if (this.approval){

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

@@ -250,9 +250,10 @@
       </template>
       </el-table-column>
       <el-table-column label="仓库" align="center" prop="fWarehouseid" />
-      <el-table-column label="出库件数" align="center" prop="fPlanqty" />
-      <el-table-column label="出库毛重" align="center" prop="fPlangrossweight" />
-      <el-table-column label="出库净重" align="center" prop="fPlannetweight" />
+      <el-table-column label="计划件数" align="center" prop="fPlanqty" />
+      <el-table-column label="出库件数" align="center" prop="fQty" />
+      <el-table-column label="出库毛重" align="center" prop="fGrossweight" />
+      <el-table-column label="出库净重" align="center" prop="fNetweight" />
       <el-table-column label="车号" align="center" prop="fTruckno" width="100"/>
       <el-table-column label="司机" align="center" prop="fDriverName" />
       <el-table-column label="司机电话" align="center" prop="fDriverTel" width="120" show-overflow-tooltip/>
@@ -3825,6 +3826,15 @@ export default {
           } else if (this.dataListSelection[warehouseCr].fBillstatus === 20) {
             this.$message.error("请先装货");
             return false;
+          } else if (!this.dataListSelection[warehouseCr].fQty || this.dataListSelection[warehouseCr].fQty === 0) {
+              this.$message.error('请维护出库件数')
+              return false
+          } else if (!this.dataListSelection[li].fGrossweight || this.dataListSelection[li].fGrossweight === 0) {
+            this.$message.error('请维护出库毛重')
+            return false
+          } else if (!this.dataListSelection[li].fNetweight || this.dataListSelection[li].fNetweight === 0) {
+            this.$message.error('请维护出库净重')
+            return false
           } else if (!this.dataListSelection[warehouseCr].fBusinessType) {
             this.$message.error('请维护业务类型')
             return false
@@ -3964,16 +3974,17 @@ export default {
         } else if (this.dataListSelection[li].fBillstatus >= 30) {
           this.$message.error('请勿重复装货')
           return false
-        } else if (!this.dataListSelection[li].fQty || this.dataListSelection[li].fQty === 0) {
-          this.$message.error('请维护出库件数')
-          return false
-        } else if (!this.dataListSelection[li].fGrossweight || this.dataListSelection[li].fGrossweight === 0) {
-          this.$message.error('请维护出库毛重')
-          return false
-        } else if (!this.dataListSelection[li].fNetweight || this.dataListSelection[li].fNetweight === 0) {
-          this.$message.error('请维护出库净重')
-          return false
+        // } else if (!this.dataListSelection[li].fQty || this.dataListSelection[li].fQty === 0) {
+        //   this.$message.error('请维护出库件数')
+        //   return false
         }
+          // else if (!this.dataListSelection[li].fGrossweight || this.dataListSelection[li].fGrossweight === 0) {
+        //   this.$message.error('请维护出库毛重')
+        //   return false
+        // } else if (!this.dataListSelection[li].fNetweight || this.dataListSelection[li].fNetweight === 0) {
+        //   this.$message.error('请维护出库净重')
+        //   return false
+        // }
       }
       this.$refs['form'].validate((valid) => {
         if (valid) {
@@ -4061,10 +4072,10 @@ export default {
     saveForm () {
       this.updateDeduplication()
       this.$refs['form'].validate((valid) => {
-        if (this.dataList.length === 0) {
-          this.$message.error('请添加库存明细!')
-          return false
-        }
+        // if (this.dataList.length === 0) {
+        //   this.$message.error('请添加库存明细!')
+        //   return false
+        // }
         for (let li in this.dataList) {
           for(let list in this.fStorageTypeOptions){
             if (this.dataList[li].fBusinessType  === this.fStorageTypeOptions[list].dictLabel) {
@@ -4075,10 +4086,10 @@ export default {
         }
         // for (let list in this.dataList) {
         //   this.changeOutStock(this.dataList[list])
-          // if (!this.dataList[list].fQty || Number(this.dataList[list].fQty) === 0) {
-          //   this.$message.error('请维护序号为' + (Number(list) + 1) + '的出库件数!')
-          //   return false
-          // }
+        //   if (!this.dataList[list].fQty || Number(this.dataList[list].fQty) === 0) {
+        //     this.$message.error('请维护序号为' + (Number(list) + 1) + '的出库件数!')
+        //     return false
+        //   }
         //   if (!this.dataList[list].fGrossweight || Number(this.dataList[list].fGrossweight) === 0) {
         //     this.$message.error('请维护序号为' + (Number(list) + 1) + '的出库毛重!')
         //     return false
@@ -4089,6 +4100,9 @@ export default {
         //   }
         // }
         if (valid) {
+          this.form.fNetweight = this.fNetweight
+          this.form.fGrossweight = this.fGrossweight
+          this.form.fQty = this.fQty
           setTimeout(() => {
             this.form.fBillstatus = 2
             let formData = new window.FormData()

+ 1 - 1
src/views/warehouseBusiness/storageFeeCalculation/index.vue

@@ -8,7 +8,7 @@
       v-show="showSearch"
       label-width="88px"
     >
-      <el-form-item label="业务1编号" prop="fBillno">
+      <el-form-item label="业务编号" prop="fBillno">
         <el-input
           v-model="queryParams.fBillno"
           placeholder="请输入业务编号"