Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

gjy 3 years ago
parent
commit
1290057c1a

+ 226 - 187
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -169,7 +169,7 @@
 
             </div>
 
-            <el-table  ref="singleTable" :data="carList" highlight-current-row @current-change="handleCurrentChange"
+            <el-table ref="singleTable" :data="carList" highlight-current-row @current-change="handleCurrentChange"
               style="width: 100%; overflow-y: scroll !important;; height: calc(100vh - 54vh);margin-top:20px">
               <el-table-column property="number" label="业务编号">
               </el-table-column>
@@ -374,23 +374,20 @@
         submitAllow: false,
         id: '',
         inOutDate: {},
-        idPrint:'',
+        idPrint: '',
         ewCustomerOptions: [{
-            value: '中央储备粮宾县直属库有限公司',
-            label: '中央储备粮宾县直属库有限公司'
-          },{
-            value: '黑龙江利润元粮食贸易有限公司',
-            label: '黑龙江利润元粮食贸易有限公司'
-          }, {
-            value: '黑龙江众利合粮食贸易有限公司',
-            label: '黑龙江众利合粮食贸易有限公司'
-          }, {
-            value: '黑龙江鑫满仓粮食贸易有限公司',
-            label: '黑龙江鑫满仓粮食贸易有限公司'
-          }, {
-            value: '黑龙江中天昊元贸易有限公司',
-            label: '黑龙江中天昊元贸易有限公司'
-          }],
+          value: '黑龙江利润元粮食贸易有限公司',
+          label: '黑龙江利润元粮食贸易有限公司'
+        }, {
+          value: '黑龙江众利合粮食贸易有限公司',
+          label: '黑龙江众利合粮食贸易有限公司'
+        }, {
+          value: '黑龙江鑫满仓粮食贸易有限公司',
+          label: '黑龙江鑫满仓粮食贸易有限公司'
+        }, {
+          value: '黑龙江中天昊元贸易有限公司',
+          label: '黑龙江中天昊元贸易有限公司'
+        }],
         companyNameOptions: [{
           value: '黑龙江利润元粮食贸易有限公司',
           label: '黑龙江利润元粮食贸易有限公司'
@@ -411,14 +408,14 @@
         companyName: '黑龙江利润元粮食贸易有限公司',
         companyNameEW: '厦门建发物产有限公司',
         ewCustomer: '黑龙江利润元粮食贸易有限公司',
-         ewradio: '',
+        ewradio: '',
         ddchecked: false,
         checked: false,
-        isShowPrintType:false,
-        dialogDataList:[],
-        statusType:1,
-        jjSelectPrintList:[],
-        printSeparately:false,
+        isShowPrintType: false,
+        dialogDataList: [],
+        statusType: 1,
+        jjSelectPrintList: [],
+        printSeparately: false,
       }
     },
     activated() {
@@ -454,7 +451,7 @@
             this.tpyeNo = _saomaData.typeNo
             this.inWarehouseType = _saomaData.managementType
             localStorage.removeItem('saoma_data'); //第一次进来结束后清除缓存
-          } else if ( localStorage.getItem('houseSelfCollect_house1')) {
+          } else if (localStorage.getItem('houseSelfCollect_house1')) {
             this.warehouseName = JSON.parse(localStorage.getItem('houseSelfCollect_house1')).value
             for (var i = 0; i < response.length; i++) {
               if (this.warehouseName == this.warehouseList[i].warehouseName) {
@@ -466,12 +463,14 @@
               }
             }
           } else {
-            localStorage.setItem('houseSelfCollect_house1',JSON.stringify({  value:  this.warehouseList[0].warehouseName,
-                warehouseId:  this.warehouseList[0].id,
-                count:  this.warehouseList[0].count,
-                No: this.warehouseList[0].commonWarehouseNo,
-                allowEdit:  this.warehouseList[0].allowEdit,
-                compId: localStorage.getItem('ws-pf_compId')}))
+            localStorage.setItem('houseSelfCollect_house1', JSON.stringify({
+              value: this.warehouseList[0].warehouseName,
+              warehouseId: this.warehouseList[0].id,
+              count: this.warehouseList[0].count,
+              No: this.warehouseList[0].commonWarehouseNo,
+              allowEdit: this.warehouseList[0].allowEdit,
+              compId: localStorage.getItem('ws-pf_compId')
+            }))
             this.warehouseName = this.warehouseList[0].warehouseName
             localStorage.setItem('ck', this.warehouseName)
             this.cangid = this.warehouseList[0].id
@@ -479,7 +478,7 @@
             this.monitorUrl1 = this.warehouseList[0].monitorUrl1
             this.monitorUrl2 = this.warehouseList[0].monitorUrl2
           }
-          
+
           this.deptBudgetList.warehouseName = this.warehouseName
           if (this.allowEdit == 0) {
             this.disabled = true
@@ -506,7 +505,7 @@
           this.printSeparately = false
         }
       },
-        changeEwDD(e) {
+      changeEwDD(e) {
         this.checked = false
         if (e) {
           this.printSeparately = true
@@ -514,43 +513,44 @@
           this.printSeparately = false
         }
       },
-       typePrintCannelClick() {
-           this.ddchecked =  false,
-        this.checked = false,
-        this.dialogDataList = []//打个打印取消时数组至空
+      typePrintCannelClick() {
+        this.ddchecked = false,
+          this.checked = false,
+          this.dialogDataList = [] //打个打印取消时数组至空
         this.isShowPrintType = false
       },
       async typePrintClick(type) {
-           getPrint({
-              id: this.idPrint
-            })
-            .toPromise()
-            .then((response) => {
-              this.dialogDataList = []//点击确认时先清空要打印的数组
-              this.dialogData = response
-              if (response.compName == '黑龙江秋收有限公司') {
-                this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
-              }
-              if (this.checked) {
-                this.dialogDataList.push( this.dialogData)
-                var _datas = JSON.stringify(this.dialogData) 
-                _datas = JSON.parse(_datas)
-                _datas.compName = this.companyNameEW;
-                _datas.customer = this.ewCustomer
-                this.dialogDataList.push(_datas)
-             }else if(this.ddchecked){
-                _datas = this.dialogData
-                _datas.compName = this.companyNameEW;
-                _datas.customer = this.ewCustomer
-                this.dialogDataList.push(_datas)
-             }else{
-                this.dialogData.compName = this.companyName
-                this.dialogDataList.push( this.dialogData)
-             }
-              window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.dialogDataList))
-              // this.printBig("", this.radio)
-            })
-            .catch((response) => {})
+        getPrint({
+            id: this.idPrint
+          })
+          .toPromise()
+          .then((response) => {
+            this.dialogDataList = [] //点击确认时先清空要打印的数组
+            this.dialogData = response
+            if (response.compName == '黑龙江秋收有限公司') {
+              this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
+            }
+            if (this.checked) {
+              this.dialogDataList.push(this.dialogData)
+              var _datas = JSON.stringify(this.dialogData)
+              _datas = JSON.parse(_datas)
+              _datas.compName = this.companyNameEW;
+              _datas.customer = this.ewCustomer
+              this.dialogDataList.push(_datas)
+            } else if (this.ddchecked) {
+              _datas = this.dialogData
+              _datas.compName = this.companyNameEW;
+              _datas.customer = this.ewCustomer
+              this.dialogDataList.push(_datas)
+            } else {
+              this.dialogData.compName = this.companyName
+              this.dialogDataList.push(this.dialogData)
+            }
+            window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this
+              .dialogDataList))
+            // this.printBig("", this.radio)
+          })
+          .catch((response) => {})
       },
       warehouseNameChange() {
         localStorage.setItem('ck', this.warehouseName)
@@ -558,12 +558,14 @@
         this.deptBudgetList.warehouseName = this.warehouseName
         for (var i = 0; i < this.warehouseList.length; i++) {
           if (this.warehouseName == this.warehouseList[i].warehouseName) {
-             localStorage.setItem('houseSelfCollect_house1',JSON.stringify({  value:  this.warehouseList[i].warehouseName,
-                warehouseId:  this.warehouseList[i].id,
-                count:  this.warehouseList[i].count,
-                No: this.warehouseList[i].commonWarehouseNo,
-                allowEdit:  this.warehouseList[i].allowEdit,
-                compId: localStorage.getItem('ws-pf_compId')}))
+            localStorage.setItem('houseSelfCollect_house1', JSON.stringify({
+              value: this.warehouseList[i].warehouseName,
+              warehouseId: this.warehouseList[i].id,
+              count: this.warehouseList[i].count,
+              No: this.warehouseList[i].commonWarehouseNo,
+              allowEdit: this.warehouseList[i].allowEdit,
+              compId: localStorage.getItem('ws-pf_compId')
+            }))
             this.cangid = this.warehouseList[i].id
             this.monitorUrl1 = this.warehouseList[i].monitorUrl1
             this.monitorUrl2 = this.warehouseList[i].monitorUrl2
@@ -594,7 +596,6 @@
         this.getList()
       },
       setVal(data) {
-        debugger
         if (this.information == '毛重') {
           this.weighingList.grossWeight = data
         } else {
@@ -608,29 +609,29 @@
         this.status = status
         if (status == 2) {
           if (this.tpyeNo == 1) {
-            this.statusType=1
-            this.getList( )
+            this.statusType = 1
+            this.getList()
             // this.carList = this.carList1.filter(function(item) {
             //   return item.status == '已称毛重'
             // })
           } else {
-            this.statusType=3
-            this.getList( )
+            this.statusType = 3
+            this.getList()
             // this.carList = this.carList1.filter(function(item) {
             //   return item.status == '已称皮重'
             // })
           }
         } else {
           if (this.tpyeNo == 1) {
-            this.statusType=1
-            this.getList( )
+            this.statusType = 1
+            this.getList()
             // this.mListTop.concat(this.mListBottom)
             // this.carList = this.carList1.filter(function(item) {
             //   return item.status == '已质检'
             // })
           } else {
-            this.statusType=2
-            this.getList( )
+            this.statusType = 2
+            this.getList()
             // this.carList = this.carList1.filter(function(item) {
             //   return item.status == '已称毛重'
             // })
@@ -651,7 +652,7 @@
           .then((response) => {
             this.purchasePriceList = response
           })
-          getweighingList({
+        getweighingList({
             compId: localStorage.getItem('ws-pf_compId'),
             currentPage: this.currentPage,
             pageSize: 99,
@@ -674,7 +675,7 @@
             currentPage: this.currentPage,
             pageSize: this.pageSize,
             searchKeyWord: '',
-            statusType:this.statusType,
+            statusType: this.statusType,
             warehouseName: this.warehouseName,
             managementType: 1,
             serviceManagementType: this.inWarehouseType,
@@ -682,7 +683,7 @@
           })
           .toPromise()
           .then((response) => {
-            this.deptBudgetTotal =response.total
+            this.deptBudgetTotal = response.total
             this.weighingList = response.records
           })
           .catch((response) => {
@@ -996,8 +997,7 @@
       },
       handleCurrentChange(val) {
         this.submitAllow = false
-        if (this.tpyeNo == 2 && this.status == 1 && val && val.qualityInspectionManagement.confirm == 0
-        ) {
+        if (this.tpyeNo == 2 && this.status == 1 && val && val.qualityInspectionManagement.confirm == 0) {
           this.submitAllow = true
           this.$message({
             message: '该条质检信息未确认',
@@ -1087,14 +1087,14 @@
                 this.weighingList = this.inOutDate
                 this.weighingList.pictureAddress = response.data.url
                 tare(this.weighingList)
-                .toPromise()
-                .then((response) => {})
+                  .toPromise()
+                  .then((response) => {})
 
               } else {
                 this.weighingList.pictureAddress = response.data.url
                 tare(this.weighingList)
-                .toPromise()
-                .then((response) => {})
+                  .toPromise()
+                  .then((response) => {})
               }
             })
             this.dialogTableVisible = true
@@ -1105,8 +1105,27 @@
       closePrint() {
         this.isShowPrint = false
       },
+      check(name, type) {
+        if (type == 1) {
+          for (var _tmp = 0; _tmp < this.ewCustomerOptions.length; _tmp++) {
+            if (this.ewCustomerOptions[_tmp].label == name) {
+              return false
+            }
+          }
+          return true
+        } else if (type == 2) {
+          for (var _tmp = 0; _tmp < this.companyNameEWOptions.length; _tmp++) {
+            if (this.companyNameEWOptions[_tmp].label == name) {
+              return false
+            }
+          }
+          return true
+
+        }
+
+      },
       print() {
-      
+
         if (this.reader) {
           this.reader.cancel()
         }
@@ -1189,11 +1208,11 @@
             return
           }
         }
-          if(this.tpyeNo == 2) {
-              if(this.submitAllow){
-                this.$message.error('该条质检信息未确认')
-                return
-              }
+        if (this.tpyeNo == 2) {
+          if (this.submitAllow) {
+            this.$message.error('该条质检信息未确认')
+            return
+          }
         }
         this.$confirm('确定保存检斤信息?', '提示', {
             confirmButtonText: '确定',
@@ -1225,86 +1244,86 @@
             }
             if (this.tpyeNo == 1) {
               // console.log(this.weighingList)
-              if(this.weighingList.customerNumberCard){
+              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: '确定',
-                            callback: (action) => {
-                              this.$message({
-                                type: 'info',
-                                message: `累计售粮已超出上限`,
-                              })
-                            },
-                          }
-                        )
-                      } else {
-                        //累计售粮没有超上限完成毛检保存
-                        // this.weighingList.relationId = this.relationId;
-                        grossWeight(this.weighingList)
-                          .toPromise()
-                          .then((response) => {
-                            if (this.reader) {
-                              this.reader.cancel()
+                    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: '确定',
+                              callback: (action) => {
+                                this.$message({
+                                  type: 'info',
+                                  message: `累计售粮已超出上限`,
+                                })
+                              },
                             }
-                            this.$notify.success({
-                              title: '成功',
-                              message: '保存成功',
-                            })
-                            this.getList()
-                            //贸易入库需要再走入库接口
-                            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 = 
-                              warehousing.id=warehousing.warehouseInOutId
-                              addstorageputList(warehousing).toPromise().then((response) => {
-                                if(response == 'OK'){
-                                  this.getList()
-                                }
+                          )
+                        } else {
+                          //累计售粮没有超上限完成毛检保存
+                          // this.weighingList.relationId = this.relationId;
+                          grossWeight(this.weighingList)
+                            .toPromise()
+                            .then((response) => {
+                              if (this.reader) {
+                                this.reader.cancel()
+                              }
+                              this.$notify.success({
+                                title: '成功',
+                                message: '保存成功',
                               })
-                            }
-                          })
-                          .catch((response) => {
-                            // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-                          })
+                              this.getList()
+                              //贸易入库需要再走入库接口
+                              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 =
+                                  warehousing.id = warehousing.warehouseInOutId
+                                addstorageputList(warehousing).toPromise().then((response) => {
+                                  if (response == 'OK') {
+                                    this.getList()
+                                  }
+                                })
+                              }
+                            })
+                            .catch((response) => {
+                              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+                            })
+                        }
                       }
                     }
-                  }
-                })
-              }else{
-                 grossWeight(this.weighingList)
+                  })
+              } else {
+                grossWeight(this.weighingList)
                   .toPromise()
                   .then((response) => {
                     if (this.reader) {
@@ -1326,9 +1345,9 @@
                       warehousing.statusFlag = 1
                       warehousing.inOutFlag = 2
                       delete warehousing.status
-                      warehousing.id=warehousing.warehouseInOutId
+                      warehousing.id = warehousing.warehouseInOutId
                       addstorageputList(warehousing).toPromise().then((response) => {
-                        if(response == 'OK'){
+                        if (response == 'OK') {
                           this.getList()
                         }
                       })
@@ -1339,7 +1358,7 @@
                   })
               }
             } else if (this.tpyeNo == 2) {
-              console.log(this.inWarehouseType )
+              console.log(this.inWarehouseType)
               this.weighingList.warehouseId = this.cangid;
               this.weighingList.skinInspector = localStorage.getItem('ws-pf_staffName')
               tare(this.weighingList)
@@ -1354,9 +1373,26 @@
                     message: '保存成功',
                   })
                   this.idPrint = response
+                  if (this.weighingList.serviceManagementType == 1 && (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()
-                  
+
                   //贸易入库需要再走入库接口
                   if (this.inWarehouseType == 1) {
 
@@ -1373,18 +1409,17 @@
                       warehousing.deductionWeight /= 1000
                       warehousing.inOutFlag = 2
                       console.log(that.weighingList)
-                      warehousing.inOutTypeKey=that.weighingList.inOutTypeKey
-                      warehousing.inOutType=that.weighingList.inOutType
-                      warehousing.deductionAmount=that.weighingList.deductionAmount
-                      warehousing.id=warehousing.warehouseInOutId
+                      warehousing.inOutTypeKey = that.weighingList.inOutTypeKey
+                      warehousing.inOutType = that.weighingList.inOutType
+                      warehousing.deductionAmount = that.weighingList.deductionAmount
+                      warehousing.id = warehousing.warehouseInOutId
                       // delete that.inOutDate.status
                       that.inOutDate = Object.assign(that.inOutDate, warehousing)
                       addstorageputList(that.inOutDate).toPromise().then((response) => {})
                     })
                   }
                 })
-                .catch((response) => {
-                })
+                .catch((response) => {})
             }
           })
           .catch(() => {
@@ -1820,6 +1855,7 @@
     font-weight: 600;
     text-align: left;
   }
+
   .mask {
     background: black;
     width: 100vw;
@@ -1937,16 +1973,19 @@
     padding: 0 20px;
     margin-top: 20px;
   }
-  /deep/.el-table__body .current-row td{
-    border-top: 4px solid #2aff7c ;
-    border-bottom: 4px solid #2aff7c ;
+
+  /deep/.el-table__body .current-row td {
+    border-top: 4px solid #2aff7c;
+    border-bottom: 4px solid #2aff7c;
   }
-  /deep/.el-table__body .current-row td:first-child{
-    border-left: 4px solid #2aff7c ;
+
+  /deep/.el-table__body .current-row td:first-child {
+    border-left: 4px solid #2aff7c;
     // border-bottom: 1px solid #2aff7c ;
   }
-  /deep/.el-table__body .current-row td:last-child{
-    border-right: 4px solid #2aff7c ;
+
+  /deep/.el-table__body .current-row td:last-child {
+    border-right: 4px solid #2aff7c;
     // border-bottom: 1px solid #2aff7c ;
   }
 </style>

+ 143 - 82
src/views/houseSelfCollect/weightCheckRecord.vue

@@ -15,8 +15,10 @@
     <div class="center">
       <el-row>
         <el-col :span="12">
-            <el-button :type="warehousingType == 1?'primary':''" size="small" @click="changeType(1)" class="btn_css btn_topcss">贸易入库</el-button>
-            <el-button :type="warehousingType == 3?'primary':''" size="small" @click="changeType(3)" class="btn_css btn_topcss">收购入库</el-button>
+          <el-button :type="warehousingType == 1?'primary':''" size="small" @click="changeType(1)"
+            class="btn_css btn_topcss">贸易入库</el-button>
+          <el-button :type="warehousingType == 3?'primary':''" size="small" @click="changeType(3)"
+            class="btn_css btn_topcss">收购入库</el-button>
         </el-col>
         <el-col :span="12" class="bg-right">
           <div style="display:flex">
@@ -24,18 +26,20 @@
               <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName"
                 :value="item.warehouseName"></el-option>
             </el-select>
-            <el-input :placeholder="warehousingType == 1 ? '可按业务编号、合同编号/移库编号、车牌号查找':'可按业务编号、车牌号、客户名查找'" clearable v-model="searchKeyWord" class="search_css"></el-input>
+            <el-input :placeholder="warehousingType == 1 ? '可按业务编号、合同编号/移库编号、车牌号查找':'可按业务编号、车牌号、客户名查找'" clearable
+              v-model="searchKeyWord" class="search_css"></el-input>
             <!-- <el-input placeholder="可按业务编号、车牌号、客户名查找" clearable v-model="searchKeyWord"></el-input> -->
             <el-button type="primary" size="small" @click="lookup">查找</el-button>
           </div>
         </el-col>
       </el-row>
-       <el-button :type="choice == ''?'primary':''" size="small" @click="screen()" class="btn_css">全部</el-button>
-          <el-button :type="choice == 2?'primary':''" size="small" @click="screen(2)" class="btn_css">已称毛重</el-button>
-          <el-button :type="choice == 3?'primary':''" size="small" @click="screen(3)" class="btn_css">已称皮重</el-button>
-          <el-button  size="small" @click="print('',1)">批量打印</el-button>
-      <el-table class="forData" :data="weighingRecordList" style="width: 100%; margin-top: 20px" height="780" @selection-change="handleSelectionChange">
-           <el-table-column type="selection" width="55"></el-table-column>
+      <el-button :type="choice == ''?'primary':''" size="small" @click="screen()" class="btn_css">全部</el-button>
+      <el-button :type="choice == 2?'primary':''" size="small" @click="screen(2)" class="btn_css">已称毛重</el-button>
+      <el-button :type="choice == 3?'primary':''" size="small" @click="screen(3)" class="btn_css">已称皮重</el-button>
+      <el-button size="small" @click="print('',1)">批量打印</el-button>
+      <el-table class="forData" :data="weighingRecordList" style="width: 100%; margin-top: 20px" height="780"
+        @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column type="index" label="序号" width="80">
           <template scope="scope">
             <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
@@ -44,11 +48,11 @@
         </el-table-column>
         <el-table-column prop="number" label="业务编号"></el-table-column>
         <el-table-column prop="contractNo" label="合同编号/移库编号" v-if="warehousingType == 1" width="130">
-        <template scope="scope">
-          <span v-if="scope.row.contractNo">{{scope.row.contractNo}}</span>
-          <span v-else>{{scope.row.moveTaskNo}}</span>
-        </template>
-        
+          <template scope="scope">
+            <span v-if="scope.row.contractNo">{{scope.row.contractNo}}</span>
+            <span v-else>{{scope.row.moveTaskNo}}</span>
+          </template>
+
         </el-table-column>
         <!--//moveTaskNo -->
         <el-table-column prop="customer" label="客户" v-if="warehousingType == 3"></el-table-column>
@@ -64,7 +68,8 @@
         <el-table-column label="操作">
           <template scope="scope">
             <!-- <el-button size="small" @click="print(scope.row)">打印</el-button> -->
-            <el-button @click="print(scope.row)" v-if="scope.row.status == '已称皮重' || scope.row.status == '已称毛重'" v-hasPermission="`acquisitionManagement.acquisitionWeight.print`">打印</el-button>
+            <el-button @click="print(scope.row)" v-if="scope.row.status == '已称皮重' || scope.row.status == '已称毛重'"
+              v-hasPermission="`acquisitionManagement.acquisitionWeight.print`">打印</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -141,9 +146,9 @@
     getweighingList,
     getPrint
   } from '@/model/houseSelfCollect/index'
-   import weightCheckPrint from './component/weightCheckPrint.vue'
+  import weightCheckPrint from './component/weightCheckPrint.vue'
   export default {
-      components: {
+    components: {
       weightCheckPrint
     },
     data() {
@@ -166,26 +171,23 @@
         searchKeyWord: '',
         choice: '',
         warehousingType: 1,
-        isShowPrint:false,
-        dialogData:{},
-        title:'',
-        modification:[],
+        isShowPrint: false,
+        dialogData: {},
+        title: '',
+        modification: [],
         ewCustomerOptions: [{
-            value: '中央储备粮宾县直属库有限公司',
-            label: '中央储备粮宾县直属库有限公司'
-          },{
-            value: '黑龙江利润元粮食贸易有限公司',
-            label: '黑龙江利润元粮食贸易有限公司'
-          }, {
-            value: '黑龙江众利合粮食贸易有限公司',
-            label: '黑龙江众利合粮食贸易有限公司'
-          }, {
-            value: '黑龙江鑫满仓粮食贸易有限公司',
-            label: '黑龙江鑫满仓粮食贸易有限公司'
-          }, {
-            value: '黑龙江中天昊元贸易有限公司',
-            label: '黑龙江中天昊元贸易有限公司'
-          }],
+          value: '黑龙江利润元粮食贸易有限公司',
+          label: '黑龙江利润元粮食贸易有限公司'
+        }, {
+          value: '黑龙江众利合粮食贸易有限公司',
+          label: '黑龙江众利合粮食贸易有限公司'
+        }, {
+          value: '黑龙江鑫满仓粮食贸易有限公司',
+          label: '黑龙江鑫满仓粮食贸易有限公司'
+        }, {
+          value: '黑龙江中天昊元贸易有限公司',
+          label: '黑龙江中天昊元贸易有限公司'
+        }],
         companyNameOptions: [{
           value: '黑龙江利润元粮食贸易有限公司',
           label: '黑龙江利润元粮食贸易有限公司'
@@ -206,14 +208,14 @@
         companyName: '黑龙江利润元粮食贸易有限公司',
         companyNameEW: '厦门建发物产有限公司',
         ewCustomer: '黑龙江利润元粮食贸易有限公司',
-         ewradio: '',
+        ewradio: '',
         ddchecked: false,
         checked: false,
-        isShowPrintType:false,
-        dialogDataList:[],
-        jjSelectPrintList:[],
-        printSeparately:false,
-        onePrint:false,
+        isShowPrintType: false,
+        dialogDataList: [],
+        jjSelectPrintList: [],
+        printSeparately: false,
+        onePrint: false,
       }
     },
     activated() {
@@ -226,17 +228,17 @@
           this.warehouseList = response
         })
       this.compId = localStorage.getItem('ws-pf_compId')
-      this.warehousingType = this.$route.query.inWarehouseType 
+      this.warehousingType = this.$route.query.inWarehouseType
       this.warehouseName = this.$route.query.warehouseName //仓库名
       this.getList()
     },
     methods: {
-       typePrintCannelClick() {
-        this.onePrint = false//单个打印标识
-        this.dialogDataList = []//打个打印取消时数组至空
+      typePrintCannelClick() {
+        this.onePrint = false //单个打印标识
+        this.dialogDataList = [] //打个打印取消时数组至空
         this.isShowPrintType = false
       },
-       handleSelectionChange(val) {
+      handleSelectionChange(val) {
         this.modification = val;
       },
       // batchPrint(){
@@ -254,7 +256,7 @@
           this.printSeparately = false
         }
       },
-        changeEwDD(e) {
+      changeEwDD(e) {
         this.checked = false
         if (e) {
           this.printSeparately = true
@@ -262,7 +264,7 @@
           this.printSeparately = false
         }
       },
-      lookup(){
+      lookup() {
         this.getList()
       },
       changeType(val) {
@@ -277,43 +279,43 @@
         this.$router.go(-1)
       },
       async typePrintClick(type) {
-        if(this.onePrint){//判断是否是单个打印
-           getPrint({
+        if (this.onePrint) { //判断是否是单个打印
+          getPrint({
               id: this.idPrint
             })
             .toPromise()
             .then((response) => {
-              this.dialogDataList = []//点击确认时先清空要打印的数组
+              this.dialogDataList = [] //点击确认时先清空要打印的数组
               this.dialogData = response
               if (response.compName == '黑龙江秋收有限公司') {
                 this.dialogData.compName = '黑龙江中天昊元贸易有限公司'
               }
               if (this.checked) {
-                this.dialogDataList.push( this.dialogData)
-                var _datas = JSON.stringify(this.dialogData) 
+                this.dialogDataList.push(this.dialogData)
+                var _datas = JSON.stringify(this.dialogData)
                 _datas = JSON.parse(_datas)
                 _datas.compName = this.companyNameEW;
                 _datas.customer = this.ewCustomer
                 this.dialogDataList.push(_datas)
-             }else if(this.ddchecked){
+              } else if (this.ddchecked) {
                 _datas = this.dialogData
                 _datas.compName = this.companyNameEW;
                 _datas.customer = this.ewCustomer
                 this.dialogDataList.push(_datas)
-             }else{
+              } else {
                 this.dialogData.companyName = this.companyName
-                this.dialogDataList.push( this.dialogData)
-             }
+                this.dialogDataList.push(this.dialogData)
+              }
               this.printBig('', this.radio)
             })
             .catch((response) => {
               // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
             })
-        }else{
-        //   if (this.isExcelPrint) {
-        //   this.printBig(2, this.radio)
-        //   this.isExcelPrint = false
-        // } else {
+        } else {
+          //   if (this.isExcelPrint) {
+          //   this.printBig(2, this.radio)
+          //   this.isExcelPrint = false
+          // } else {
           this.jjSelectPrintList = []
           let index1 = 0;
           for (let i = 0; i < this.modification.length; i++) {
@@ -334,7 +336,7 @@
               })
               .catch((response) => {})
           }
-        // }
+          // }
         }
       },
       makeEWjjSelectPrintList() {
@@ -346,25 +348,80 @@
         }
         localStorage.setItem('selectPrint_EWjjSelectPrintList', JSON.stringify(_selectPrint_EWjjSelectPrintList))
       },
-    print(row, type, pageType) {
-      //打印
+      check(name, type) {
         if (type == 1) {
-            if(this.modification.length == 0){
-              this.$message.error('请选择批量打印的条目!')
-              return
+          for (var _tmp = 0; _tmp < this.ewCustomerOptions.length; _tmp++) {
+            if (this.ewCustomerOptions[_tmp].label == name) {
+              return false
+            }
+          }
+          return true
+        } else if (type == 2) {
+          for (var _tmp = 0; _tmp < this.companyNameEWOptions.length; _tmp++) {
+            if (this.companyNameEWOptions[_tmp].label == name) {
+              return false
+            }
+          }
+          return true
+
+        }
+
+      },
+      print(row, type, pageType) {
+        //打印
+        debugger
+        if (type == 1) { //
+          if (this.modification.length == 0) {
+            this.$message.error('请选择批量打印的条目!')
+            return
+          }
+          for (let _num = 0; _num < this.modification.length; _num++) {
+            if (this.modification[_num].serviceManagementType == 1 && (this.warehouseName == '鲅鱼圈金信库' || this
+                .warehouseName == '白城内陆港'|| this.warehouseName == '哈尔滨依兰库')) {
+              if (this.modification[_num].seller && this.modification[_num].buyer) {
+                let cang = {}
+                cang.value = this.modification[_num].seller
+                cang.label = this.modification[_num].seller
+                if (this.check(this.modification[_num].seller, 1)) {
+                  this.ewCustomerOptions.push(cang)
+                }
+                let cang1 = {}
+                cang1.value = this.modification[_num].buyer
+                cang1.label = this.modification[_num].buyer
+                if (this.check(this.modification[_num].buyer, 2)) {
+                  this.companyNameEWOptions.push(cang1)
+                }
+              }
             }
+          }
           this.isShowPrintType = true
         } else {
+          if (row.serviceManagementType == 1 && (this.warehouseName == '鲅鱼圈金信库' || this.warehouseName == '白城内陆港'|| this.warehouseName == '哈尔滨依兰库')) {
+            if (row.seller && row.buyer) {
+              let cang = {}
+              cang.value = row.seller
+              cang.label = row.seller
+              if (this.check(row.seller, 1)) {
+                this.ewCustomerOptions.push(cang)
+              }
+              let cang1 = {}
+              cang1.value = row.buyer
+              cang1.label = row.buyer
+              if (this.check(row.buyer, 2)) {
+                this.companyNameEWOptions.push(cang1)
+              }
+            }
+          }
           this.idPrint = row.id
-           this.isShowPrintType = true
-           this.onePrint = true //单个打印标识
+          this.isShowPrintType = true
+          this.onePrint = true //单个打印标识
         }
 
       },
       printSmall() {
         window.open('../../../../static/weightCheck.html?type=1&tableData=' + JSON.stringify(this.dialogData))
       },
-       printBig(type, radioType) {
+      printBig(type, radioType) {
         // 打印额外
         if (this.checked || this.ddchecked) {
           this.makeEWjjSelectPrintList()
@@ -405,7 +462,7 @@
             warehouseName: this.warehouseName,
             managementType: 1,
             serviceManagementType: this.warehousingType,
-            statusType:this.choice
+            statusType: this.choice
           })
           .toPromise()
           .then((response) => {
@@ -505,18 +562,22 @@
       width: 90%;
     }
   }
-  .btn_topcss{
+
+  .btn_topcss {
     margin-top: 15px;
 
   }
-  .btn_css{
-      width: 90px;
-      margin-left: 10px;
-    }
-    .search_css{
-      margin: 0 20px;
-    }
-    .mask {
+
+  .btn_css {
+    width: 90px;
+    margin-left: 10px;
+  }
+
+  .search_css {
+    margin: 0 20px;
+  }
+
+  .mask {
     background: black;
     width: 100vw;
     height: 100vh;

+ 2 - 2
src/views/outboundManagement/weighingManagementNew.vue

@@ -1110,6 +1110,7 @@
         for (let i = 0; i < this.warehouseList.length; i++) {
           if (this.warehouseList[i].value == e) {
             this.warehouseId = this.warehouseList[i].warehouseId
+            this.warehouseCount = this.warehouseList[i].count
           }
         }
         for (let i = 0; i < this.warehouseList1.length; i++) {
@@ -1354,7 +1355,6 @@
         if (!data) return
         for (var i = 0; i < this.outContractNo.length; i++) {
           if (this.outContractNo[i].contractNo == this.weighingList.contractNo) {
-            this.weighingList.goodsName = this.outContractNo[i].goodsName
             this.weighingList.goodsName = this.outContractNo[i].goodsName
             if (this.weighingList.goodsName == '玉米(潮粮)') {
               this.weighingList.type = '潮粮'
@@ -1390,7 +1390,7 @@
                 'YKCK' +
                 this.getTime() +
                 this.warehouseNo +
-                num.substring(num.length - 4,num.length)
+                this.warehouseCount.substring(this.warehouseCount.length - 4,this.warehouseCount.length)
               this.weighingList.buyer = this.outContractNo[i].receiveWarehouse
               this.weighingList.seller = this.outContractNo[i].sendWarehouse
               this.weighingList.goodsName = data.goodsName

+ 0 - 12
src/views/outboundManagement/weighingManagementrecord.vue

@@ -37,24 +37,12 @@
       <el-table-column prop="goodsName" label="货名"></el-table-column>
       <el-table-column prop="carNumber" label="车牌号"></el-table-column>
       <el-table-column prop="grossWeight" label="毛重(公斤)">
-        <template slot-scope="scope">
-          <span>{{Number(scope.row.grossWeight*1000).toFixed(3) == 0? "0": Number(scope.row.grossWeight*1000).toFixed(3)}}</span>
-        </template>
       </el-table-column>
       <el-table-column prop="tare" label="皮重(公斤)">
-        <template slot-scope="scope">
-          <span>{{Number(scope.row.tare*1000).toFixed(3) == 0? "0": Number(scope.row.tare*1000).toFixed(3)}}</span>
-        </template>
       </el-table-column>
       <el-table-column prop="buckleMiscellaneous" label="扣重(公斤)">
-         <template slot-scope="scope">
-          <span>{{Number(scope.row.buckleMiscellaneous*1000).toFixed(3) == 0? "0": Number(scope.row.buckleMiscellaneous*1000).toFixed(3)}}</span>
-        </template>
       </el-table-column>
       <el-table-column prop="netWeight" label="净重(公斤)">
-          <template slot-scope="scope">
-          <span>{{Number(scope.row.netWeight*1000).toFixed(3) == 0? "0": Number(scope.row.netWeight*1000).toFixed(3)}}</span>
-        </template>
       </el-table-column>
       <!-- <el-table-column prop="binNumber" label="仓位号"></el-table-column>
       <el-table-column prop="storageNumber" label="囤位号"></el-table-column> -->