ccj пре 2 година
родитељ
комит
705cd39c14
1 измењених фајлова са 172 додато и 175 уклоњено
  1. 172 175
      src/views/houseSelfCollect/newWeighingManagement.vue

+ 172 - 175
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -1605,61 +1605,39 @@
               delete warehousing.qualityInspectionManagement
               delete warehousing.qualityInspectionManagement
             }
             }
             // 毛重
             // 毛重
-            debugger
             if (this.tpyeNo == 1) {
             if (this.tpyeNo == 1) {
+              
               // console.log(this.weighingList)
               // console.log(this.weighingList)
-              for (let i = 0; i < this.purchasePriceList.length; i++) {
-                if (
-                  this.weighingList.goodsName ==
-                  this.purchasePriceList[i].goodsName
-                ) {
-                  if (this.weighingList.customerNumberCard) {
-                    if (this.inWarehouseType == 1) { //判断贸易入库提交毛重
-                      warehousing.grossWeight /= 1000
-                      warehousing.tare /= 1000
-                      warehousing.netWeight /= 1000
-                      warehousing.pureWeight = 1000
-                      warehousing.deductionAmount *= 1000
-                      warehousing.deductionWeight /= 1000
-                      warehousing.statusFlag = 1
-                      warehousing.inOutFlag = 2
-                      warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
-                      warehousing.id = warehousing.warehouseInOutId
-                      warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
-                      warehousing.weighingManagement = this.weighingList
-                      newSubmit(warehousing)
-                        .toPromise()
-                        .then((response) => {
-                          this.$notify.success({
-                            title: '成功',
-                            message: '保存成功',
-                          })
-                          this.getList()
-
-                        })
-                    } else { //收购入库
-                      //毛检保存前进行校验
-                      getamount({
-                        compId: localStorage.getItem('ws-pf_compId'),
-                        customerNumberCard: this.weighingList.customerNumberCard,
-                        goodsName: this.weighingList.goodsName,
-                      })
-                        .toPromise()
-                        .then((response) => {
-                          //累计售粮超上限不能完成毛检保存
-                          let count = (
-                            this.purchasePriceList[i].saleLimit -
-                            response / 1000
-                          ).toFixed(2)
-                          if (count - this.weighingList.grossWeight / 1000 < 0) {
-                            this.$alert(
-                              '该客户累计销售' +
-                              this.weighingList.goodsName +
-                              (response / 1000).toFixed(2) +
-                              '吨,还可售粮' +
-                              count +
-                              '吨',
-                              '提示', {
+              if (this.weighingList.customerNumberCard) {
+                //毛检保存前进行校验
+                getamount({
+                    compId: localStorage.getItem('ws-pf_compId'),
+                    customerNumberCard: this.weighingList.customerNumberCard,
+                    goodsName: this.weighingList.goodsName,
+                  })
+                  .toPromise()
+                  .then((response) => {
+                    for (let i = 0; i < this.purchasePriceList.length; i++) {
+                      if (
+                        this.weighingList.goodsName ==
+                        this.purchasePriceList[i].goodsName
+                      ) {
+                        //累计售粮超上限不能完成毛检保存
+                        let count = (
+                          this.purchasePriceList[i].saleLimit -
+                          response / 1000
+                        ).toFixed(2)
+                        // console.log(this.weighingList.grossWeight / 1000, '毛重转吨')
+                        // this.weighingList.grossWeight/=1000
+                        if (count - this.weighingList.grossWeight / 1000 < 0) {
+                          this.$alert(
+                            '该客户累计销售' +
+                            this.weighingList.goodsName +
+                            (response / 1000).toFixed(2) +
+                            '吨,还可售粮' +
+                            count +
+                            '吨',
+                            '提示', {
                               confirmButtonText: '确定',
                               confirmButtonText: '确定',
                               callback: (action) => {
                               callback: (action) => {
                                 this.$message({
                                 this.$message({
@@ -1667,9 +1645,35 @@
                                   message: `累计售粮已超出上限`,
                                   message: `累计售粮已超出上限`,
                                 })
                                 })
                               },
                               },
-                            })
-                          } else {
-                            //累计售粮没有超上限完成毛检保存
+                            }
+                          )
+                        } else {
+                          //累计售粮没有超上限完成毛检保存
+                          if (this.inWarehouseType == 1) { //判断贸易入库提交毛重
+                            warehousing.grossWeight /= 1000
+                            warehousing.tare /= 1000
+                            warehousing.netWeight /= 1000
+                            warehousing.pureWeight = 1000
+                            warehousing.deductionAmount *= 1000
+                            warehousing.deductionWeight /= 1000
+                            warehousing.statusFlag = 1
+                            warehousing.inOutFlag = 2
+                            warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
+                            warehousing.id = warehousing.warehouseInOutId
+                            warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
+                            warehousing.weighingManagement = this.weighingList
+                            newSubmit(warehousing)
+                              .toPromise()
+                              .then((response) => {
+                                this.$notify.success({
+                                  title: '成功',
+                                  message: '保存成功',
+                                })
+                                this.getList()
+
+                              })
+                          } else { //收购入库
+                          
                             grossWeight(this.weighingList)
                             grossWeight(this.weighingList)
                               .toPromise()
                               .toPromise()
                               .then((response) => {
                               .then((response) => {
@@ -1683,127 +1687,120 @@
                                 this.getList()
                                 this.getList()
                               })
                               })
                           }
                           }
-                        })
-                      //累计售粮没有超上限完成毛检保存
-                      // this.weighingList.relationId = this.relationId;
-                      // grossWeight(this.weighingList)
-                      //   .toPromise()
-                      //   .then((response) => {
-                      //     if (this.reader) {
-                      //       this.reader.cancel()
-                      //     }
-                      //     this.$notify.success({
-                      //       title: '成功',
-                      //       message: '保存成功',
-                      //     })
-                      //     //贸易入库需要再走入库接口
-                      //     if (this.inWarehouseType == 1) {
-                      //       warehousing.grossWeight /= 1000
-                      //       warehousing.tare /= 1000
-                      //       warehousing.netWeight /= 1000
-                      //       warehousing.pureWeight = 1000
-                      //       warehousing.deductionAmount *= 1000
-                      //       warehousing.deductionWeight /= 1000
-                      //       warehousing.statusFlag = 1
-                      //       warehousing.inOutFlag =2
-                      //       warehousing.id = warehousing.warehouseInOutId
-                      //       warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
-                      //       addstorageputList(warehousing).toPromise().then((response) => {
-                      //         if (response == 'OK') {
-                      //           this.getList()
-                      //         }
-                      //       })
-                      //     } else {
-                      //       this.getList()
-                      //     }
-                      //   })
-                      //   .catch((response) => {
-                      //     // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-                      //   })
-                    }
-
-                  } else {
-                    if (this.inWarehouseType == 1) { //贸易入库
-                      warehousing.grossWeight /= 1000
-                      warehousing.tare /= 1000
-                      warehousing.netWeight /= 1000
-                      warehousing.pureWeight = 1000
-                      warehousing.deductionAmount *= 1000
-                      warehousing.deductionWeight /= 1000
-                      warehousing.statusFlag = 1
-                      warehousing.inOutFlag = 2
-                      delete warehousing.status
-                      warehousing.id = warehousing.warehouseInOutId
-                      warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
-                      warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
-                      warehousing.weighingManagement = this.weighingList
-
-                      newSubmit(warehousing)
-                        .toPromise()
-                        .then((response) => {
-                          this.$notify.success({
-                            title: '成功',
-                            message: '保存成功',
-                          })
-                          this.getList()
-                        })
-                    } else { //收购入库
-                      grossWeight(this.weighingList)
-                        .toPromise()
-                        .then((response) => {
-                          if (this.reader) {
-                            this.reader.cancel()
-                          }
-                          this.$notify.success({
-                            title: '成功',
-                            message: '保存成功',
-                          })
-                          this.getList()
-                        })
+                          //累计售粮没有超上限完成毛检保存
+                          // this.weighingList.relationId = this.relationId;
+                          // grossWeight(this.weighingList)
+                          //   .toPromise()
+                          //   .then((response) => {
+                          //     if (this.reader) {
+                          //       this.reader.cancel()
+                          //     }
+                          //     this.$notify.success({
+                          //       title: '成功',
+                          //       message: '保存成功',
+                          //     })
+                          //     //贸易入库需要再走入库接口
+                          //     if (this.inWarehouseType == 1) {
+                          //       warehousing.grossWeight /= 1000
+                          //       warehousing.tare /= 1000
+                          //       warehousing.netWeight /= 1000
+                          //       warehousing.pureWeight = 1000
+                          //       warehousing.deductionAmount *= 1000
+                          //       warehousing.deductionWeight /= 1000
+                          //       warehousing.statusFlag = 1
+                          //       warehousing.inOutFlag =2
+                          //       warehousing.id = warehousing.warehouseInOutId
+                          //       warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
+                          //       addstorageputList(warehousing).toPromise().then((response) => {
+                          //         if (response == 'OK') {
+                          //           this.getList()
+                          //         }
+                          //       })
+                          //     } else {
+                          //       this.getList()
+                          //     }
+                          //   })
+                          //   .catch((response) => {
+                          //     // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                          //   })
+                        }
+                      }
                     }
                     }
-                    // grossWeight(this.weighingList)
-                    //   .toPromise()
-                    //   .then((response) => {
-                    //     if (this.reader) {
-                    //       this.reader.cancel()
-                    //     }
-                    //     this.$notify.success({
-                    //       title: '成功',
-                    //       message: '保存成功',
-                    //     })
-                    //     //贸易入库需要再走入库接口
-                    //     if (this.inWarehouseType == 1) {
-                    //       warehousing.grossWeight /= 1000
-                    //       warehousing.tare /= 1000
-                    //       warehousing.netWeight /= 1000
-                    //       warehousing.pureWeight = 1000
-                    //       warehousing.deductionAmount *= 1000
-                    //       warehousing.deductionWeight /= 1000
-                    //       warehousing.statusFlag = 1
-                    //       warehousing.inOutFlag = 2
-                    //       delete warehousing.status
-                    //       warehousing.id = warehousing.warehouseInOutId
-                    //       warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
-                    //       addstorageputList(warehousing).toPromise().then((response) => {
-                    //         if (response == 'OK') {
-                    //           this.getList()
-                    //         }
-                    //       })
-                    //     } else {
-                    //       this.getList()
-                    //     }
-                    //   })
-                    //   .catch((response) => {
-                    //     // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-                    //   })
-                  }
-                }
-                else {
-                  this.$alert(
-                    this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行检斤操作'), {
-                              confirmButtonText: '确定',}
-                    
+                  })
+              } else {
+                if (this.inWarehouseType == 1) { //贸易入库
+                  warehousing.grossWeight /= 1000
+                  warehousing.tare /= 1000
+                  warehousing.netWeight /= 1000
+                  warehousing.pureWeight = 1000
+                  warehousing.deductionAmount *= 1000
+                  warehousing.deductionWeight /= 1000
+                  warehousing.statusFlag = 1
+                  warehousing.inOutFlag = 2
+                  delete warehousing.status
+                  warehousing.id = warehousing.warehouseInOutId
+                  warehousing.secretaryWeigher = this.deptBudgetList.secretaryWeigher
+                  warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
+                  warehousing.weighingManagement = this.weighingList
+
+                  newSubmit(warehousing)
+                    .toPromise()
+                    .then((response) => {
+                      this.$notify.success({
+                        title: '成功',
+                        message: '保存成功',
+                      })
+                      this.getList()
+                    })
+                } else { //收购入库
+                  grossWeight(this.weighingList)
+                    .toPromise()
+                    .then((response) => {
+                      if (this.reader) {
+                        this.reader.cancel()
+                      }
+                      this.$notify.success({
+                        title: '成功',
+                        message: '保存成功',
+                      })
+                      this.getList()
+                    })
                 }
                 }
+                // grossWeight(this.weighingList)
+                //   .toPromise()
+                //   .then((response) => {
+                //     if (this.reader) {
+                //       this.reader.cancel()
+                //     }
+                //     this.$notify.success({
+                //       title: '成功',
+                //       message: '保存成功',
+                //     })
+                //     //贸易入库需要再走入库接口
+                //     if (this.inWarehouseType == 1) {
+                //       warehousing.grossWeight /= 1000
+                //       warehousing.tare /= 1000
+                //       warehousing.netWeight /= 1000
+                //       warehousing.pureWeight = 1000
+                //       warehousing.deductionAmount *= 1000
+                //       warehousing.deductionWeight /= 1000
+                //       warehousing.statusFlag = 1
+                //       warehousing.inOutFlag = 2
+                //       delete warehousing.status
+                //       warehousing.id = warehousing.warehouseInOutId
+                //       warehousing.warehouseInOutDetail.id = warehousing.inOutDetailId
+                //       addstorageputList(warehousing).toPromise().then((response) => {
+                //         if (response == 'OK') {
+                //           this.getList()
+                //         }
+                //       })
+                //     } else {
+                //       this.getList()
+                //     }
+                //   })
+                //   .catch((response) => {
+                //     // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                //   })
               }
               }
             } else if (this.tpyeNo == 2) {
             } else if (this.tpyeNo == 2) {
               //皮重
               //皮重