Browse Source

调整出库逻辑bug

阿伏兔 4 năm trước cách đây
mục cha
commit
6601f02153

+ 0 - 31
src/views/warehouseBusiness/agreement/index.vue

@@ -629,7 +629,6 @@ export default {
       }
       this.$router.push({ path: '/index' })
       this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
-        console.log(visitedViews)
         if (this.isActive(view)) {
           this.toLastView(visitedViews, view)
         }
@@ -649,7 +648,6 @@ export default {
         this.cancelButton = false
         this.reset()
         getAgreement(this.approval.billId).then(response => {
-          console.log(response)
           this.deptName = response.data.dept.deptName
           this.form = response.data.tWarehouseAgreement
           this.fMblnoOptions = response.data.corps
@@ -658,10 +656,8 @@ export default {
             this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
             // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
           }
-          // console.log(response.data.feesList)
           this.fWbuOptions = response.data.feesList
           // this.add = row
-          console.log(JSON.stringify(this.agreementitemsList))
           this.open = true
           this.browseStatus = true
         })
@@ -669,7 +665,6 @@ export default {
     },
     goApproval(){
       this.addOrUpdateVisib = true
-      console.log(this.approval)
       this.$nextTick(() => {
         this.$refs.ApprovalComments.init(this.form.fId,this.agreementId)
       })
@@ -689,7 +684,6 @@ export default {
       this.addOrUpdateVisib = false
       let id = '448'
       let actId = '110'
-      console.log(this.form.fId)
       this.$nextTick(() => {
         this.$refs.addOrUpdate.init(this.form.fId, this.agreementId)
       })
@@ -705,10 +699,7 @@ export default {
       this.notChange = true
       this.browseStatus = true
       getAgreement(row.fId).then(response => {
-        console.log(response)
         this.Operator = response.data.corps.createBy
-        console.log(response.data.corps.createBy)
-        console.log(response)
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
         this.fMblnoOptions = response.data.corps
@@ -717,10 +708,8 @@ export default {
           this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
           // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
         }
-        // console.log(response.data.feesList)
         this.fWbuOptions = response.data.feesList
         this.add = row
-        console.log(JSON.stringify(this.agreementitemsList))
         this.title = '修改仓储费'
         if (res == 1) {
           this.notChange = true
@@ -729,7 +718,6 @@ export default {
             this.reset()
             // const fId = row.fId || this.ids
             getAgreement(row.fId).then(response => {
-              console.log(response)
               this.deptName = response.data.dept.deptName
               this.form = response.data.tWarehouseAgreement
               this.fMblnoOptions = response.data.corps
@@ -738,10 +726,8 @@ export default {
                 this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
                 // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
               }
-              // console.log(response.data.feesList)
               this.fWbuOptions = response.data.feesList
               this.add = row
-              console.log(JSON.stringify(this.agreementitemsList))
               this.open = true
             })
           }else {
@@ -754,7 +740,6 @@ export default {
       })
       // const fId = row.fId || this.ids
       getAgreement(row.fId).then(response => {
-        console.log(response)
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
         this.fMblnoOptions = response.data.corps
@@ -763,10 +748,8 @@ export default {
           this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
           // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
         }
-        // console.log(response.data.feesList)
         this.fWbuOptions = response.data.feesList
         this.add = row
-        console.log(JSON.stringify(this.agreementitemsList))
         this.open = true
       })
     },
@@ -778,7 +761,6 @@ export default {
         billId: this.form.fId
       }
       RevocationApproval(data).then(data => {
-        console.log(data)
         if (data.code === 200) {
           this.$message.success('撤销成功')
           this.open = false
@@ -835,12 +817,8 @@ export default {
         this.$message.error('审核完成时才能启用');
       }
     },
-    test_s() {
-      console.log(this.agreementitemsList)
-    },
     /** 创建仓储费明细表列表 */
     getList_s() {
-      console.log(this.agreementitemsList)
       queryUserVal().then((response) => {
         this.agreementitemsList.push({
           //行号
@@ -871,7 +849,6 @@ export default {
       })
 
       listAgreementitems(this.queryParams).then(response => {
-        console.log(response)
       })
     },
     /* 远程模糊查询商品 */
@@ -892,7 +869,6 @@ export default {
     getList() {
       this.loading = true
       listAgreements(this.queryParams).then(response => {
-        console.log(response)
         this.agreementList = response.rows
         this.total = response.total
         this.loading = false
@@ -906,7 +882,6 @@ export default {
       }
       let queryParams = { pageNum: 1, pageSize: 10, fName: name }
       listFees(queryParams).then((response) => {
-        console.log(this.fWbuOptions)
         this.fWbuOptions = response.rows
       })
     },
@@ -966,8 +941,6 @@ export default {
     },
     // 变更计价单位
     changeFeeUnit(row) {
-      console.log(this.fCntqty)
-      console.log(row)
       if (!row.fFeeUnitid) {
         return false
       }
@@ -1027,7 +1000,6 @@ export default {
       this.browseStatus = false
       const fId = row.fId || this.ids
       getAgreement(fId).then(response => {
-        console.log(response)
         this.deptName = response.data.dept.deptName
         this.form = response.data.tWarehouseAgreement
         this.fMblnoOptions = response.data.corps
@@ -1036,10 +1008,8 @@ export default {
           this.$set(this.agreementitemsList[item], 'fFeeunitid', this.agreementitemsList[item].fFeeunitid + '')
           // this.fWRemoteMethod(this.agreementitemsList[item].fFeeid)
         }
-        // console.log(response.data.feesList)
         this.fWbuOptions = response.data.feesList
         this.add = row
-        console.log(JSON.stringify(this.agreementitemsList))
         this.open = true
         this.title = '修改仓储费'
       })
@@ -1057,7 +1027,6 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      console.log(this.form)
       this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.fId != null) {

+ 41 - 2
src/views/warehouseBusiness/outStock/index.vue

@@ -828,6 +828,7 @@
               :disabled="browseStatus || scope.row.fBillstatus === 20 || scope.row.fBillstatus === 30 || scope.row.fBillstatus === 40"
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fGrossweight"
+              @change="changeOutStock(scope.row)"
               placeholder="出库毛重"
               show-word-limit
             />
@@ -845,6 +846,7 @@
               oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
               v-model="scope.row.fNetweight"
               :disabled="browseStatus || scope.row.fBillstatus === 20 || scope.row.fBillstatus === 30 || scope.row.fBillstatus === 40"
+              @change="changeOutStock(scope.row)"
               placeholder="出库净重"
               show-word-limit
             />
@@ -1013,7 +1015,6 @@
             <el-select
               v-model="scope.row.fIsPass"
               placeholder="是否放行"
-              clearable
               :disabled="browseStatus || scope.row.fBillstatus === 20 || scope.row.fBillstatus === 40"
               style="width: 80%"
             >
@@ -1074,7 +1075,7 @@
             <el-button
               @click.native.prevent="deleteRow(scope.$index, dataList)"
               size="small"
-              :disabled="browseStatus || scope.row.fBillstatus === 20 || scope.row.fBillstatus === 30 || scope.row.fBillstatus === 40"
+              :disabled="browseStatus || scope.row.fBillstatus === 40"
             >移除
             </el-button>
           </template>
@@ -3807,6 +3808,7 @@ export default {
           return false
         }
         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
@@ -3854,6 +3856,7 @@ export default {
           return false
         }
         for (let list in this.dataList) {
+          this.changeOutStock(this.dataList[list])
           if (this.dataList[list].fQty === 0) {
             this.$message.error('请输入出库件数!')
             return false
@@ -3953,6 +3956,13 @@ export default {
         this.$set(row, "fGrossweight", 0);
         return false;
       }
+      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;
+      }
       // 净重 fPlannetweight
       // 毛重 fPlangrossweight
       let fVolumn = parseFloat(Number(row.fVolumn) / Number(row.fPlanqty)).toFixed(2);
@@ -3962,8 +3972,37 @@ export default {
       this.$set(row, "fNetweight", parseFloat(Number(netweight) * Number(row.fQty)).toFixed(2));
       this.$set(row, "fGrossweight", parseFloat(Number(grossweigh) * Number(row.fQty)).toFixed(2));
     },
+    // 修改毛重净重
+    changeOutStock (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);
+      if (this.dataList.length === 0) {
+        this.formBrowseStatus = false
+        return false
+      }
+      for (let li in this.dataList) {
+        if (this.dataList[li].fBillstatus > 10) {
+          this.formBrowseStatus = true
+          return false
+        }
+      }
     },
     /* 远程模糊查询用户 */
     corpsRemoteMethod(name) {