Pārlūkot izejas kodu

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

ccj 2 gadi atpakaļ
vecāks
revīzija
6cfad9353e
1 mainītis faili ar 154 papildinājumiem un 127 dzēšanām
  1. 154 127
      src/views/houseSelfCollect/newWeighingManagement.vue

+ 154 - 127
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -683,7 +683,7 @@
 
     },
     methods: {
-      getVideos(){debugger
+      getVideos(){
           let canvas = document.getElementById('video')
           let url = 'ws://127.0.0.1:8082'
           var player = new JSMpeg.Player(url, {canvas: canvas})
@@ -950,13 +950,15 @@
         this.getList()
       },
       getList() {
-        // 货名
-        getinspectLookGoods({
+        if (this.inWarehouseType != 1) {
+          // 货名
+          getinspectLookGoods({
             warehouseId: this.cangid,
           }).toPromise()
-          .then((response) => {
-            this.purchasePriceList = response
-          })
+            .then((response) => {
+              this.purchasePriceList = response
+            })
+        }
         this.refreshClick(1)
         // getweighingList({
         //     compId: localStorage.getItem('ws-pf_compId'),
@@ -1606,127 +1608,134 @@
             }
             // 毛重
             if (this.tpyeNo == 1) {
-              
-              // console.log(this.weighingList)
               if (this.weighingList.customerNumberCard) {
-                //毛检保存前进行校验
-                getamount({
-                    compId: localStorage.getItem('ws-pf_compId'),
-                    customerNumberCard: this.weighingList.customerNumberCard,
-                    goodsName: this.weighingList.goodsName,
-                  })
-                  .toPromise()
-                  .then((response) => {
+                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 { //收购入库
+                  //毛检保存前进行校验
+                  // if (this.purchasePriceList) {
                     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: '确定',
-                              callback: (action) => {
-                                this.$message({
-                                  type: 'info',
-                                  message: `累计售粮已超出上限`,
-                                })
-                              },
-                            }
-                          )
-                        } 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()
-
+                        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 +
+                                '吨',
+                                '提示', {
+                                confirmButtonText: '确定',
+                                callback: (action) => {
+                                  this.$message({
+                                    type: 'info',
+                                    message: `累计售粮已超出上限`,
+                                  })
+                                },
                               })
-                          } else { //收购入库
-                          
-                            grossWeight(this.weighingList)
-                              .toPromise()
-                              .then((response) => {
-                                if (this.reader) {
-                                  this.reader.cancel()
-                                }
-                                this.$notify.success({
-                                  title: '成功',
-                                  message: '保存成功',
+                            } else {
+                              //累计售粮没有超上限完成毛检保存
+                              grossWeight(this.weighingList)
+                                .toPromise()
+                                .then((response) => {
+                                  if (this.reader) {
+                                    this.reader.cancel()
+                                  }
+                                  this.$notify.success({
+                                    title: '成功',
+                                    message: '保存成功',
+                                  })
+                                  this.getList()
                                 })
-                                this.getList()
+                            }
+                          })
+                          break
+                      }
+                      else {
+                        // this.$message({
+                        //   message: this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作',
+                        //   type: 'warning',
+                        // })
+                        // return
+                        this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作' , {
+                                confirmButtonText: '确定',
                               })
-                          }
-                          //累计售粮没有超上限完成毛检保存
-                          // 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'))
-                          //   })
-                        }
+                        
                       }
                     }
-                  })
+                  //累计售粮没有超上限完成毛检保存
+                  // 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
@@ -1753,18 +1762,36 @@
                       this.getList()
                     })
                 } else { //收购入库
-                  grossWeight(this.weighingList)
-                    .toPromise()
-                    .then((response) => {
-                      if (this.reader) {
-                        this.reader.cancel()
+                    for (let i = 0; i < this.purchasePriceList.length; i++) {
+                      if (
+                        this.weighingList.goodsName ==
+                        this.purchasePriceList[i].goodsName
+                      ) {
+                        grossWeight(this.weighingList)
+                          .toPromise()
+                          .then((response) => {
+                            if (this.reader) {
+                              this.reader.cancel()
+                            }
+                            this.$notify.success({
+                              title: '成功',
+                              message: '保存成功',
+                            })
+                            this.getList()
+                          })
+                          break
                       }
-                      this.$notify.success({
-                        title: '成功',
-                        message: '保存成功',
-                      })
-                      this.getList()
-                    })
+                      else {
+                        // this.$message({
+                        //   message: this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作',
+                        //   type: 'warning',
+                        // })
+                        // return
+                        this.$alert(this.weighingList.goodsName + '的收购价格正在审核中,请审核通过后进行操作' , {
+                                confirmButtonText: '确定',
+                              })
+                      }
+                    }
                 }
                 // grossWeight(this.weighingList)
                 //   .toPromise()