瀏覽代碼

前端更新 sdy

zhongtianhaoyuan 3 年之前
父節點
當前提交
7c06ea11e1

+ 2 - 0
src/api/V2/houseSelfCollect/index.js

@@ -68,5 +68,7 @@ export const API_GET_WEIGHTCHECK_GETPRINT= '/weighingManagement/api/getWeighingM
 export const API_POST_PAYMENT_DEL = '/paymentManagement/api/deleteInfo'
 //付款审核
 export const API_POST_PAYMENT_AUDIT = '/paymentManagement/api/openAuditFlow'
+//付款提交
+export const API_POST_PAYMENT_PAYMENTSUBMIT = '/paymentManagement/api/payMoney'
 
 

+ 4 - 2
src/model/houseSelfCollect/index.js

@@ -36,7 +36,8 @@ import {
   API_GET_INSPECT_GETCOUNT,
   API_GET_WEIGHTCHECK_GETPRINT,
   API_POST_PAYMENT_DEL,
-  API_POST_PAYMENT_AUDIT
+  API_POST_PAYMENT_AUDIT,
+  API_POST_PAYMENT_PAYMENTSUBMIT
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -108,4 +109,5 @@ export const getPrint = appRx.get(API_GET_WEIGHTCHECK_GETPRINT, errorCatcher, er
 export const delpayment  = appRx.post(API_POST_PAYMENT_DEL, errorCatcher, errorHandle, filter)
 //付款审核
 export const auditpayment  = appRx.post(API_POST_PAYMENT_AUDIT, errorCatcher, errorHandle, filter)
-
+//付款提交
+export const paymentCommit = appRx.post(API_POST_PAYMENT_PAYMENTSUBMIT, errorCatcher, errorHandle, filter)

+ 216 - 205
src/views/houseSelfCollect/inspectInfo.vue

@@ -344,210 +344,155 @@ export default {
       // + this.verifyinit()
     },
     print() {
-      // if (!this.inspect.qualityNo) {
-      //   this.$message({
-      //     message: '编号不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.binNumber) {
-      //   this.$message({
-      //     message: '仓位不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.customerName) {
-      //   this.$message({
-      //     message: '客户不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.storageTagNo) {
-      //   this.$message({
-      //     message: '囤位号不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
+      if (!this.inspect.qualityNo) {
+        this.$message({
+          message: '编号不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.binNumber) {
+        this.$message({
+          message: '仓位不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.customerName) {
+        this.$message({
+          message: '客户不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.storageTagNo) {
+        this.$message({
+          message: '囤位号不能为空',
+          type: 'warning',
+        })
+        return
+      }
 
-      // if (this.inspect.storageTagNo.length > 10) {
-      //   this.$message({
-      //     message: '囤位号不超过10个字符',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.carNumber) {
-      //   this.$message({
-      //     message: '车牌号不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (this.inspect.carNumber.length > 7) {
-      //   this.$message({
-      //     message: '车牌号输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.goodsName) {
-      //   this.$message({
-      //     message: '货名不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (
-      //   this.inspect.buckleWeightRatio < 0 ||
-      //   this.inspect.buckleWeightRatio > 2
-      // ) {
-      //   this.$message({
-      //     message: '扣重比输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (
-      //   String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
-      //   String(this.inspect.buckleWeightRatio).length -
-      //     (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
-      //     2
-      // ) {
-      //   this.$message({
-      //     message: '扣重比输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.type) {
-      //   this.$message({
-      //     message: '类型不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.type) {
-      //   this.$message({
-      //     message: '类型不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.natureOfGrainPurchase) {
-      //   this.$message({
-      //     message: '购粮性质不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.grade) {
-      //   this.$message({
-      //     message: '等级不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.impurity) {
-      //   this.$message({
-      //     message: '杂质不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.waterContent) {
-      //   this.$message({
-      //     message: '水分不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.mildewGrain) {
-      //   this.$message({
-      //     message: '霉变粒不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.bulkDensity) {
-      //   this.$message({
-      //     message: '容重不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.jiaorenli) {
-      //   this.$message({
-      //     message: '热损伤不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.imperfectGrain) {
-      //   this.$message({
-      //     message: '不完整粒不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // //查看当前用户对应货名有未结算状态的送货
-      // let count = 0
-      // getCount({
-      //   compId: sessionStorage.getItem('ws-pf_compId'),
-      //   customerName: this.inspect.customerName,
-      //   goodsName: this.inspect.goodsName,
-      // })  .toPromise()
-      //   .then((response) => {
-      //        count = response
-      //   })
-      // //  客户下拉校验
-      // getamount({
-      //   compId: sessionStorage.getItem('ws-pf_compId'),
-      //   customerName: this.inspect.customerName,
-      //   goodsName: this.inspect.goodsName,
-      // })
-      //   .toPromise()
-      //   .then((response) => {
-      //     for (let i = 0; i < this.purchasePriceList.length; i++) {
-      //       if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-      //         console.log(this.purchasePriceList[i].saleLimit - response)
-      //         if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
-      //           // this.$confirm(
-      //           //   '当前客户已累计销售我司' +
-      //           //     this.inspect.goodsName +
-      //           //     response +
-      //           //     '吨,最高可售' +
-      //           //     this.purchasePriceList[i].saleLimit +
-      //           //     '吨。',
-      //           //   '提示',
-      //           //   {
-      //           //     cancelButtonText: '取消',
-      //           //     type: 'warning',
-      //           //   }
-      //           // )
-      //           //   .then(() => {})
-      //           //   .catch(() => {
-      //           //     return false
-      //           //   })
-      //             this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
-      //                   '提示',
-      //                   {
-      //                     confirmButtonText: '确定',
-      //                     callback: (action) => {
-      //                       // this.$message({
-      //                       //   type: 'info',
-      //                       //   message: `累计售粮已超出上限`,
-      //                       // })
-      //                     },
-      //                   }
-      //                 )
-      //         }
-      //       }
-      //     }
-      //   })
+      if (this.inspect.storageTagNo.length > 10) {
+        this.$message({
+          message: '囤位号不超过10个字符',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.carNumber) {
+        this.$message({
+          message: '车牌号不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (this.inspect.carNumber.length > 7) {
+        this.$message({
+          message: '车牌号输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.goodsName) {
+        this.$message({
+          message: '货名不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        this.inspect.buckleWeightRatio < 0 ||
+        this.inspect.buckleWeightRatio > 2
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (
+        String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
+        String(this.inspect.buckleWeightRatio).length -
+          (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
+          2
+      ) {
+        this.$message({
+          message: '扣重比输入错误',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.type) {
+        this.$message({
+          message: '类型不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.type) {
+        this.$message({
+          message: '类型不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.natureOfGrainPurchase) {
+        this.$message({
+          message: '购粮性质不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.grade) {
+        this.$message({
+          message: '等级不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.impurity) {
+        this.$message({
+          message: '杂质不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.waterContent) {
+        this.$message({
+          message: '水分不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.mildewGrain) {
+        this.$message({
+          message: '霉变粒不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.bulkDensity) {
+        this.$message({
+          message: '容重不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.jiaorenli) {
+        this.$message({
+          message: '热损伤不能为空',
+          type: 'warning',
+        })
+        return
+      }
+      if (!this.inspect.imperfectGrain) {
+        this.$message({
+          message: '不完整粒不能为空',
+          type: 'warning',
+        })
+        return
+      }
       this.inspect.warehouseName = this.warehouseName
       this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
       this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
@@ -568,8 +513,6 @@ export default {
                     this.inspect = response
                   })
                 this.isShowPrint = true
-                //打印
-                // this.$router.go(-1)
               })
           })
           .catch(() => {
@@ -607,6 +550,40 @@ export default {
       let customers = e.split('(')
       this.inspect.customerName = customers[0]
       this.inspect.customerPhone = customers[1].split(')')[0]
+      if(this.inspect.goodsName && this.inspect.customerName){
+          let count = 0
+      getCount({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        customerName: this.inspect.customerName,
+        goodsName: this.inspect.goodsName,
+      })  .toPromise()
+        .then((response) => {
+             count = response
+        })
+      //  客户下拉校验
+      getamount({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        customerName: this.inspect.customerName,
+        goodsName: this.inspect.goodsName,
+      })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < this.purchasePriceList.length; i++) {
+            if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
+              if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
+                  this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                        '提示',
+                        {
+                          confirmButtonText: '确定',
+                          callback: (action) => {
+                          },
+                        }
+                      )
+              }
+            }
+          }
+        })
+      }
     },
 
     waterContentChange() {
@@ -636,6 +613,40 @@ export default {
             this.unitPrice = response
           })
       }
+       if(this.inspect.goodsName && this.inspect.customerName){
+          let count = 0
+      getCount({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        customerName: this.inspect.customerName,
+        goodsName: this.inspect.goodsName,
+      })  .toPromise()
+        .then((response) => {
+             count = response
+        })
+      //  客户下拉校验
+      getamount({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        customerName: this.inspect.customerName,
+        goodsName: this.inspect.goodsName,
+      })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < this.purchasePriceList.length; i++) {
+            if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
+              if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
+                  this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                        '提示',
+                        {
+                          confirmButtonText: '确定',
+                          callback: (action) => {
+                          },
+                        }
+                      )
+              }
+            }
+          }
+        })
+      }
     },
 
     getList(ids) {

+ 1 - 0
src/views/houseSelfCollect/paymentManagement.vue

@@ -288,6 +288,7 @@ export default {
           data=this.warehouseList[i]
         }
       }
+      console.log(data)
       for (let i = 0; i < data.purchasePriceList.length; i++) {
         if(data.purchasePriceList[i].goodsName==row.goodsName){
           data1=data.purchasePriceList[i]

+ 128 - 29
src/views/houseSelfCollect/settlement.vue

@@ -350,23 +350,11 @@
                 size="small"
               />
             </ws-form-item>
-            <!-- <ws-form-item
-              label="纯重单价(元/公斤)"
-              span="1"
-              prop="waterContent"
-            >
-              <ws-input
-                placeholder="请输入纯重单价"
-                maxlength="100"
-                :disabled="disabled"
-                size="small"
-              />
-            </ws-form-item> -->
             <ws-form-item label="记事(选填)" span="1" prop="waterContent">
               <ws-input
               v-model="paymentList.remarks"
                 placeholder="备注信息,不超过20个字"
-                maxlength="100"
+                maxlength="20"
                 :disabled="disabled"
                 size="small"
               />
@@ -433,15 +421,15 @@ export default {
           }else{
             this.paymentList.grainMoney=this.paymentList.qualityInspectionManagement.solidGrainPrice*this.paymentList.weighingManagement.netWeight
           }
-          console.log(this.paymentList.grainMoney)
-          
+           this.paymentList.grainMoney = this.paymentList.grainMoney.toFixed(2)
         })
     },
     actualPayment(e){
      this.paymentList.capitalize=this.convertCurrency(e)
     },
     grainMoney(){
-      this.paymentList.calculationPayable=(Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy))-this.paymentList.weighingDeduction-this.paymentList.freightDeduction-this.paymentList.unloadDeduction-this.paymentList.otherDeduction-this.paymentList.qualityDeduction
+       this.paymentList.calculationPayable=(Number(this.paymentList.grainMoney)+Number(this.paymentList.weighingSubsidy)+Number(this.paymentList.freightSubsidy)+Number(this.paymentList.unloadSubsidy)+Number(this.paymentList.otherSubsidy))-this.paymentList.weighingDeduction-this.paymentList.freightDeduction-this.paymentList.unloadDeduction-this.paymentList.otherDeduction-this.paymentList.qualityDeduction
+      // this.paymentList.calculationPayable=num.toFixed(2)
     },
      /**
          * 将金额数字转为汉字大写
@@ -536,31 +524,142 @@ export default {
           return chineseStr;
         },
     print() {
-      this.paymentList.id=this.$route.query.id
+       if (!this.paymentList.buckleWeightRatio) {
+          this.$message({
+            message: '扣重比不能为空',
+            type: 'warning',
+          })
+          return
+        }
+        if (this.paymentList.buckleWeightRatio < 0 || this.paymentList.buckleWeightRatio > 2) {
+          this.$message({
+            message: '扣重比输入错误',
+            type: 'warning',
+          })
+          return
+        }
+
+        if (this.paymentList.weighingSubsidy < 0 || this.paymentList.weighingSubsidy > 100000) {
+          this.$message({
+            message: '称重补助范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+     
+        if (this.paymentList.weighingDeduction < 0 || this.paymentList.weighingDeduction > 100000) {
+          this.$message({
+            message: '称重扣款范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+        
+        if (this.paymentList.freightSubsidy < 0 || this.paymentList.freightSubsidy > 100000) {
+          this.$message({
+            message: '运费补助范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+     
+        if (this.paymentList.freightDeduction < 0 || this.paymentList.freightDeduction > 100000) {
+          this.$message({
+            message: '运费扣款范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+      
+        if (this.paymentList.unloadSubsidy < 0 || this.paymentList.unloadSubsidy > 100000) {
+          this.$message({
+            message: '卸车补助范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+      
+        if (this.paymentList.unloadDeduction < 0 || this.paymentList.unloadDeduction > 100000) {
+          this.$message({
+            message: '卸车扣款范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+       
+        if (this.paymentList.otherSubsidy < 0 || this.paymentList.unloadDeduction > 100000) {
+          this.$message({
+            message: '其他补助范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+       
+        if (this.paymentList.qualityDeduction < 0 || this.paymentList.qualityDeduction > 100000) {
+          this.$message({
+            message: '质量扣款范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+      
+        if (this.paymentList.otherDeduction < 0 || this.paymentList.otherDeduction > 100000) {
+          this.$message({
+            message: '其他扣款范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+      //   if (
+      //   String(this.paymentList.actualPayment).indexOf('.') != -1 &&
+      //   String(this.paymentList.actualPayment).length -
+      //     (String(this.paymentList.actualPayment).indexOf('.') + 1) >
+      //     2
+      // ) {
+      //   this.$message({
+      //     message: '毛重输入错误',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
+        if (this.paymentList.actualPayment < 0 || this.paymentList.otherDeduction > 100000) {
+          this.$message({
+            message: '实际付款范围应在0-100000内',
+            type: 'warning',
+          })
+          return
+        }
+        if (this.paymentList.remarks.length > 20) {
+          this.$message({
+            message: '记事字数应在0-20个字',
+            type: 'warning',
+          })
+          return
+        }
+      this.paymentList.id=this.$route.query.id 
+      this.paymentList.settlementClerk =  sessionStorage.getItem('ws-pf_staffName')
       postpaymentedit(this.paymentList).toPromise().then((response) => {
           this.$router.push({ path: 'houseSelfCollectPrint',
             query:{
           name:"123"
         }
-          
         })
-      // this.xx = true;
-      // let newstr = document.getElementById('print').innerHTML
-      // let oldstr = document.body.innerHTML
-      // document.body.innerHTML = newstr
-      // window.print()
-       
         },
-    
         )
-      // document.body.innerHTML = oldstr
-      // window.location.reload()
-      // this.$router.push({ path: 'paymentManagement' })
     },
     buckleWeightRatiochange(e){
-      this.paymentList.qualityInspectionManagement.weightDeduction=(this.paymentList.qualityInspectionManagement.waterContent-this.paymentList.qualityInspectionManagement.waterMin)*this.paymentList.buckleWeightRatio
+      if(this.paymentList.buckleWeightRatio >= 0 && this.paymentList.buckleWeightRatio <= 2){
+        this.paymentList.qualityInspectionManagement.weightDeduction=(this.paymentList.qualityInspectionManagement.waterContent-this.paymentList.qualityInspectionManagement.waterMin)*this.paymentList.buckleWeightRatio
       this.paymentList.base=(100-this.paymentList.qualityInspectionManagement.weightDeduction)/100
       this.paymentList.pureWeight=this.paymentList.base*this.paymentList.weighingManagement.netWeight
+
+      }else{
+         this.$message({
+            message: '扣重比输入错误',
+            type: 'warning',
+          })
+      }
+      
     },
     cancel() {
       this.$router.push({ path: 'paymentManagement' })