zxz vor 2 Jahren
Ursprung
Commit
2fe8730bba
1 geänderte Dateien mit 90 neuen und 44 gelöschten Zeilen
  1. 90 44
      src/views/houseSelfCollect/newWeighingManagement.vue

+ 90 - 44
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -1815,14 +1815,14 @@ export default {
                             '吨',
                             '提示', {
                             confirmButtonText: '确定',
-                            callback: (action) => {
-                              this.$message({
-                                type: 'info',
-                                message: `累计售粮已超出上限`,
-                              })
-                            },
+                            // callback: (action) => {
+                            //   this.$message({
+                            //     type: 'info',
+                            //     message: `累计售粮已超出上限`,
+                            //   })
+                            // },
                           })
-                        } else {
+                        } 
                           //累计售粮没有超上限完成毛检保存
                           grossWeight(this.weighingList)
                             .toPromise()
@@ -1836,7 +1836,6 @@ export default {
                               })
                               this.getList()
                             })
-                        }
                       })
                     return
                   }
@@ -1990,7 +1989,8 @@ export default {
 
             // console.log(this.inWarehouseType)
             //贸易入库需要再走入库接口
-            if (this.inWarehouseType == 1) { //贸易入库皮检
+            if (this.inWarehouseType == 1) {
+               //贸易入库皮检
               getsettleaccout({//查看结算单
                 id: this.weighingList.warehouseInOutId
               }).toPromise().then((response) => {
@@ -2102,43 +2102,89 @@ export default {
 
               })
             } else { //收购入库皮检
-              tare(this.weighingList)
-                .toPromise()
-                .then((response) => {
-                  // if (this.reader) {
-                  //   this.reader.cancel()
-                  // }
-                  this.$notify.success({
-                    title: '成功',
-                    message: '保存成功',
-                  })
-                  this.idPrint = response
-                  if (this.weighingList.serviceManagementType == 1 && (this.warehouseName == '鲅鱼圈金信库' || this
-                    .warehouseName == '哈尔滨依兰库' || this
-                      .warehouseName == '白城内陆港' || this
-                        .warehouseName == '山东园丰库'|| this
-                        .warehouseName == '杜尔伯特家禾库'||this.warehouseName=='甘南宏旗库'||this.warehouseName=='洮南新友谊兴旺库')) {
-                    if (this.weighingList.seller && this.weighingList.buyer) {
-                      let cang = {}
-                      cang.value = this.weighingList.seller
-                      cang.label = this.weighingList.seller
-                      if (this.check(this.weighingList.seller, 1)) {
-                        this.ewCustomerOptions.push(cang)
-                      }
-                      let cang1 = {}
-                      cang1.value = this.weighingList.buyer
-                      cang1.label = this.weighingList.buyer
-                      if (this.check(this.weighingList.buyer, 2)) {
-                        this.companyNameEWOptions.push(cang1)
-                      }
-                    }
-                  }
-                  this.isShowPrintType = true
-                  this.getList()
+              var arr2 = {}
+              for (let i = 0; i < this.purchasePriceList.length; i++) {
+                if (
+                  this.weighingList.goodsName ==
+                  this.purchasePriceList[i].goodsName
+                ) {
+                  arr2 = JSON.parse(JSON.stringify(this.purchasePriceList[i]))
+                  arr2.saleLimit = this.purchasePriceList[i].saleLimit
+                }
+              }
+              if (Object.keys(arr2).length != 0) {
+                getamount({
+                  compId: localStorage.getItem('ws-pf_compId'),
+                  customerNumberCard: this.weighingList.customerNumberCard,
+                  goodsName: this.weighingList.goodsName,
                 })
-                .catch((response) => { })
+                  .toPromise()
+                  .then((response) => {
+                    //累计售粮超上限不能完成皮检保存
+                    let count = (
+                       arr2.saleLimit - response / 1000
+                    ).toFixed(2)
+                    if (count - this.weighingList.netWeight / 1000 < 0) {
+                      this.$alert(
+                        '该客户累计销售' +
+                        this.weighingList.goodsName +
+                        (response / 1000).toFixed(2) +
+                        '吨,还可售粮' +
+                        count +
+                        '吨,当前重量已超出售粮上限' + ((this.weighingList.netWeight / 1000).toFixed(2) - count).toFixed(2) + '吨',
+                        '提示',
+                        {
+                          confirmButtonText: '确定',
+                          callback: (action) => {
+                            this.$message({
+                              type: 'info',
+                              message: `累计售粮已超出上限`,
+                            })
+                          },
+                      })
+                    }
+                    else {
+                      //累计售粮没有超上限完成皮检保存
+                      tare(this.weighingList)
+                        .toPromise()
+                        .then((response) => {
+                          // if (this.reader) {
+                          //   this.reader.cancel()
+                          // }
+                          this.$notify.success({
+                            title: '成功',
+                            message: '保存成功',
+                          })
+                          this.idPrint = response
+                          if (this.weighingList.serviceManagementType == 1 && (this.warehouseName == '鲅鱼圈金信库' || this
+                            .warehouseName == '哈尔滨依兰库' || this
+                              .warehouseName == '白城内陆港' || this
+                                .warehouseName == '山东园丰库' || this
+                                  .warehouseName == '杜尔伯特家禾库' || this.warehouseName == '甘南宏旗库' || this.warehouseName == '洮南新友谊兴旺库')) {
+                            if (this.weighingList.seller && this.weighingList.buyer) {
+                              let cang = {}
+                              cang.value = this.weighingList.seller
+                              cang.label = this.weighingList.seller
+                              if (this.check(this.weighingList.seller, 1)) {
+                                this.ewCustomerOptions.push(cang)
+                              }
+                              let cang1 = {}
+                              cang1.value = this.weighingList.buyer
+                              cang1.label = this.weighingList.buyer
+                              if (this.check(this.weighingList.buyer, 2)) {
+                                this.companyNameEWOptions.push(cang1)
+                              }
+                            }
+                          }
+                          this.isShowPrintType = true
+                          this.getList()
+                        })
+                        .catch((response) => { })
+                    }
+                  })
+                return
+              }
             }
-
           }
         })
         .catch(() => {