Browse Source

打印检斤其他公司不显示本公司选项

gjy 2 years ago
parent
commit
6e93ea4a50

+ 2 - 1
src/api/V2/outboundManagement/index.js

@@ -50,4 +50,5 @@ export const API_POST_IMPORT_YK ='/weighingManagement/api/importWeighingMoveOut'
 export const API_GAT_INFO = '/commonSysParameter/getInfo'
 // 是否创建运输任务
 export const API_GET_TRANTASK ='/inOutWarehouseTask/tranTaskCount'
-
+// 查询合同
+export const API_GET_CONTRACT ='/contractManagementInfo/getOutContract'

+ 1 - 0
src/layout/index/top/index.vue

@@ -343,6 +343,7 @@
          listenfullscreen(this.setScreen)
       getcomp({userMobilePhone:this.UserInfo.loginInfo.userMobilePhone}).toPromise().then((res)=>{
         this.compNameoptions=res
+        localStorage.setItem('compNameoptions',JSON.stringify(this.compNameoptions))
       })
     },
     

+ 5 - 2
src/model/outboundManagement/index.js

@@ -28,7 +28,8 @@ import {
     API_POST_GO_BACK,
     API_GAT_INFO,
     API_GET_TRANTASK,
-    API_GET_WEIGHT
+    API_GET_WEIGHT,
+    API_GET_CONTRACT
 }   from '@/api/V2/outboundManagement'
 
   //质检列表
@@ -82,4 +83,6 @@ export const importWordYk = appRx.post(API_POST_IMPORT_YK, errorCatcher, errorHa
 // 导入移库出库
 export const getInfo = appRx.get(API_GAT_INFO, errorCatcher, errorHandle, filter)
 // 是否创建运输任务
-export const gettask = appRx.get(API_GET_TRANTASK, errorCatcher, errorHandle, filter)
+export const gettask = appRx.get(API_GET_TRANTASK, errorCatcher, errorHandle, filter)
+// 获取合同
+export const getcontract = appRx.get(API_GET_CONTRACT, errorCatcher, errorHandle, filter)

+ 67 - 78
src/views/houseSelfCollect/inspectionManagementNew.vue

@@ -561,6 +561,7 @@ import {
 } from '@/model/warehouse/index'
 import {
     gettask,
+    getcontract
   } from '@/model/outboundManagement/index'
 import inspectInfoPrint from './component/inspectInfoPrint.vue'
 import html2canvas from 'html2canvas'
@@ -714,7 +715,7 @@ export default {
       statusTypetext: '初检',
       directselling: false,
       fleetNameList: [],
-      outContractNo: [],
+      outContractNo: {},
       carNumberList: [],
       warehouseTradeCount: 0,
       warehouseTradeCount1: 0,
@@ -938,12 +939,8 @@ export default {
           this.deptBudgetList.contractNo = this.multiSelector1[i].contractNo
 
         }
-        for (let q = 0; q < this.outContractNo.length; q++) {
-          if (this.outContractNo[q].contractNo == this.deptBudgetList.contractNo) {
-            this.deptBudgetList.goodsName = this.outContractNo[q].goodsName
-            this.deptBudgetList.goodsNameKey = this.outContractNo[q].goodsNameKey
-          }
-        }
+        this.deptBudgetList.goodsName = this.outContractNo.goodsName
+        this.deptBudgetList.goodsNameKey = this.outContractNo.goodsNameKey
         this.deptBudgetList.outType = '自运'
         this.goodsdisabled = true
         this.waterContentChange()
@@ -1408,46 +1405,44 @@ export default {
             }
           }
           if (!data) return
-          for (var i = 0; i < this.outContractNo.length; i++) {
-            if (
-              this.outContractNo[i].contractNo == this.deptBudgetList.contractNo
-            ) {
-              console.log(this.outContractNo[i])
-              if (this.outContractNo[i].inOutType == '采购入库') {
-                if (!this.outContractNo[i].unitContractPrice) {
-                  this.deptBudgetList.tips = '卖方' + this.outContractNo[i].seller
+          getcontract({contractNo:this.deptBudgetList.contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
+             this.outContractNo=response
+            console.log(this.outContractNo)
+              if (this.outContractNo.inOutType == '采购入库') {
+                if (!this.outContractNo.unitContractPrice) {
+                  this.deptBudgetList.tips = '卖方' + this.outContractNo.seller
                 } else {
-                  this.deptBudgetList.tips = '卖方' + this.outContractNo[i].seller + '( ' + this.outContractNo[i]
+                  this.deptBudgetList.tips = '卖方' + this.outContractNo.seller + '( ' + this.outContractNo
                     .unitContractPrice + '元/吨)'
                 }
-              } else if (this.outContractNo[i].inOutType == '移库入库') {
-                if (this.outContractNo[i].unitContractPrice) {
-                  this.deptBudgetList.tips = '出货库' + data.sendWarehouse + ' (' + this.outContractNo[i]
+              } else if (this.outContractNo.inOutType == '移库入库') {
+                if (this.outContractNo.unitContractPrice) {
+                  this.deptBudgetList.tips = '出货库' + data.sendWarehouse + ' (' + this.outContractNo
                     .unitContractPrice + '元/吨)'
                 } else {
                   this.deptBudgetList.tips = '出货库' + data.sendWarehouse
                 }
-              } else if (this.outContractNo[i].inOutType == '移库出库') {
+              } else if (this.outContractNo.inOutType == '移库出库') {
 
                 this.deptBudgetList.tips = '入货库' + data.receiveWarehouse
-              } else if (this.outContractNo[i].inOutType == '退库') {
-                if (this.outContractNo[i].contractNo) {
-                  this.deptBudgetList.tips = '买方' + this.outContractNo[i].buyer
+              } else if (this.outContractNo.inOutType == '退库') {
+                if (this.outContractNo.contractNo) {
+                  this.deptBudgetList.tips = '买方' + this.outContractNo.buyer
                 } else {
                   this.deptBudgetList.tips = '出货库' + data.sendWarehouse
                 }
               }
-              this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
-              if (this.outContractNo[i].tranCarInfoList) {
-                this.options2 = this.outContractNo[i].tranCarInfoList
-                this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
+              this.deptBudgetList.inOutType = this.outContractNo.inOutType
+              if (this.outContractNo.tranCarInfoList) {
+                this.options2 = this.outContractNo.tranCarInfoList
+                this.tranCarInfoList = this.outContractNo.tranCarInfoList
                 // this.carstatus = true
               } else {
                 this.options2 = []
               }
-              this.fleetNameList = this.outContractNo[i].tranCarInfoList1
-            }
-          }
+              this.fleetNameList = this.outContractNo.tranCarInfoList1
+
+        })
           this.$forceUpdate()
         })
       // if(){
@@ -3558,47 +3553,43 @@ export default {
         }
       }
       if (!data) return
-      for (var i = 0; i < this.outContractNo.length; i++) {
-        console.log(this.outContractNo[i].contractNo)
-        if (
-          this.outContractNo[i].contractNo == this.deptBudgetList.contractNo
-        ) {
-          if(this.outContractNo[i].priceType == "定价收购"){
+      getcontract({contractNo:this.deptBudgetList.contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
+          if(this.outContractNo.priceType == "定价收购"){
             if( this.deptBudgetList.type == "潮粮"){
-           this.deptBudgetList.tidalGrainPrice = Number(this.outContractNo[i].unitContractPrice/1000).toFixed(2)
+           this.deptBudgetList.tidalGrainPrice = Number(this.outContractNo.unitContractPrice/1000).toFixed(2)
             }else{
-            this.deptBudgetList.dryGrainPrice = Number(this.outContractNo[i].unitContractPrice/1000).toFixed(2)
+            this.deptBudgetList.dryGrainPrice = Number(this.outContractNo.unitContractPrice/1000).toFixed(2)
             }
           }
           if(this.serviceManagementType==3){
-            var arr=this.goodnameList.filter((item)=>{return item.goodsName==this.outContractNo[i].goodsName})
+            var arr=this.goodnameList.filter((item)=>{return item.goodsName==this.outContractNo.goodsName})
             console.log(arr)
             if(arr.length>0){
               this.bulkDensityMin=arr[0].bulkDensityMin
-              this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
-            this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+              this.deptBudgetList.goodsName = this.outContractNo.goodsName
+            this.deptBudgetList.goodsNameKey = this.outContractNo.goodsNameKey
             }else{
               if(this.deptBudgetList.inOutType!="收购入库"){
                  this.deptBudgetList.goodsName=''
                   this.deptBudgetList.goodsNameKey=''
                   this.$message({
-                    message: `当前仓库未设置:`+this.outContractNo[i].goodsName,
+                    message: `当前仓库未设置:`+this.outContractNo.goodsName,
                     type: 'warning',   
                   });
-                  break;
+                  return
               }
             }
           }else{
-            this.fireDirectionList=this.outContractNo[i].fireDirectionList
-            this.shipInfoList=this.outContractNo[i].shipInfoList
-            this.deptBudgetList.goodsName = this.outContractNo[i].goodsName
-            this.deptBudgetList.goodsNameKey = this.outContractNo[i].goodsNameKey
+            this.fireDirectionList=this.outContractNo.fireDirectionList
+            this.shipInfoList=this.outContractNo.shipInfoList
+            this.deptBudgetList.goodsName = this.outContractNo.goodsName
+            this.deptBudgetList.goodsNameKey = this.outContractNo.goodsNameKey
           }
           this.goodsNameChange(this.deptBudgetList.goodsName)
-          this.deptBudgetList.grade = this.outContractNo[i].grade
-          if (this.outContractNo[i].inOutType == '采购入库') {
-            if(this.outContractNo[i].deliverType==1){
-                gettask({contractNo:this.outContractNo[i].contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
+          this.deptBudgetList.grade = this.outContractNo.grade
+          if (this.outContractNo.inOutType == '采购入库') {
+            if(this.outContractNo.deliverType==1){
+                gettask({contractNo:this.outContractNo.contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
                   // console.log(response)
                   if(!response){
                     this.$message({
@@ -3609,20 +3600,20 @@ export default {
                   }
                 })
               }
-            this.customerName = this.outContractNo[i].buyer
-            this.customerPhone = this.outContractNo[i].buyerPhone
+            this.customerName = this.outContractNo.buyer
+            this.customerPhone = this.outContractNo.buyerPhone
             this.warehouseTradeCount = this.warehouseTradeCount1
             this.warehouseTradeCount = '000' + (Number(this.warehouseTradeCount) + 1)
             // this.deptBudgetList.qualityNo = 'CGRK' + this.getTime() + this.warehouseNo + this.warehouseTradeCount
             // .substring(this.warehouseTradeCount.length - 4)
-            if (!this.outContractNo[i].unitContractPrice) {
-              this.deptBudgetList.tips = '卖方' + this.outContractNo[i].seller
+            if (!this.outContractNo.unitContractPrice) {
+              this.deptBudgetList.tips = '卖方' + this.outContractNo.seller
             } else {
-              this.deptBudgetList.tips = '卖方' + this.outContractNo[i].seller + '( ' + this.outContractNo[i]
+              this.deptBudgetList.tips = '卖方' + this.outContractNo.seller + '( ' + this.outContractNo
                 .unitContractPrice + '元/吨)'
             }
             this.deptBudgetList.inOutTypeKey = 1
-          } else if (this.outContractNo[i].inOutType == '移库入库') {
+          } else if (this.outContractNo.inOutType == '移库入库') {
             this.customerName = localStorage.getItem('ws-pf_compName')
             this.warehouseTradeCount = '000' + (Number(this.warehouseTradeCount) + 1)
             // this.deptBudgetList.qualityNo = 'YKRK' + this.getTime() + this.warehouseNo + this.warehouseTradeCount
@@ -3630,30 +3621,30 @@ export default {
             this.deptBudgetList.goodsName = data.goodsName
             this.deptBudgetList.goodsNameKey = data.goodsNameKey
             this.deptBudgetList.grade = data.grade
-            if (this.outContractNo[i].unitContractPrice) {
-              this.deptBudgetList.tips = '出货库' + data.sendWarehouse + ' (' + this.outContractNo[i].unitContractPrice +
+            if (this.outContractNo.unitContractPrice) {
+              this.deptBudgetList.tips = '出货库' + data.sendWarehouse + ' (' + this.outContractNo.unitContractPrice +
                 '元/吨)'
             } else {
               this.deptBudgetList.tips = '出货库' + data.sendWarehouse
             }
             this.deptBudgetList.inOutTypeKey = 3
-          } else if (this.outContractNo[i].inOutType == '移库出库') {
+          } else if (this.outContractNo.inOutType == '移库出库') {
 
             this.deptBudgetList.tips = '入货库' + data.receiveWarehouse
-          } else if (this.outContractNo[i].inOutType == '暂存入库') {
+          } else if (this.outContractNo.inOutType == '暂存入库') {
             this.deptBudgetList.inOutTypeKey = 4
-          } else if (this.outContractNo[i].inOutType == '贸易服务入库') {
+          } else if (this.outContractNo.inOutType == '贸易服务入库') {
             this.deptBudgetList.inOutTypeKey = 5
           }
-          else if (this.outContractNo[i].inOutType == '退库') {
-            if (this.outContractNo[i].contractNo) {
-              this.deptBudgetList.tips = '买方' + this.outContractNo[i].buyer
+          else if (this.outContractNo.inOutType == '退库') {
+            if (this.outContractNo.contractNo) {
+              this.deptBudgetList.tips = '买方' + this.outContractNo.buyer
             } else {
               this.deptBudgetList.tips = '出货库' + data.sendWarehouse
             }
             this.deptBudgetList.inOutTypeKey = 6
           }
-          this.cost = this.outContractNo[i].contractPrice
+          this.cost = this.outContractNo.contractPrice
           if (this.cost) {
             this.isGetCost = true
             this.deptBudgetList.cost = this.cost - this.deptBudgetList.deductionAmount
@@ -3661,38 +3652,36 @@ export default {
             this.isGetCost = false
             this.deptBudgetList.cost = this.deptBudgetList.cost
           }
-          this.deptBudgetList.inOutType = this.outContractNo[i].inOutType
-          if (this.outContractNo[i].inOutType == '移库入库') {
+          this.deptBudgetList.inOutType = this.outContractNo.inOutType
+          if (this.outContractNo.inOutType == '移库入库') {
             this.isSelectType = true
 
           } else {
             this.isSelectType = true
           }
-          // if (this.outContractNo[i].priceType == '随行就市') {
+          // if (this.outContractNo.priceType == '随行就市') {
           //   this.disabled1 = !this.disabled1
           // }
 
-          if (this.outContractNo[i].deliverType == '1') {
+          if (this.outContractNo.deliverType == '1') {
             this.carstatus = true
           } else {
             this.carstatus = false
           }
-          if (this.outContractNo[i].tranCarInfoList) {
-            this.options2 = this.outContractNo[i].tranCarInfoList
-            this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
+          if (this.outContractNo.tranCarInfoList) {
+            this.options2 = this.outContractNo.tranCarInfoList
+            this.tranCarInfoList = this.outContractNo.tranCarInfoList
             // this.carstatus = true
           } else {
             this.options2 = []
             this.tranCarInfoList = []
           }
-          if(this.outContractNo[i].tranCarInfoList1){
-            this.fleetNameList = this.outContractNo[i].tranCarInfoList1
+          if(this.outContractNo.tranCarInfoList1){
+            this.fleetNameList = this.outContractNo.tranCarInfoList1
           }else{
             this.fleetNameList = []
           }
-          
-        }
-      }
+      })
     },
     selectstorageType() {
 

+ 19 - 1
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -535,7 +535,25 @@
       }
     },
     mounted() {
-      
+      if(localStorage.getItem('compNameoptions')){
+        var company=JSON.parse(localStorage.getItem('compNameoptions'))
+        var extra=company.filter((item)=>{
+          return item!='黑龙江中天昊元贸易有限公司'&&item!='黑龙江利润元粮食贸易有限公司'&&item!= '黑龙江众利合粮食贸易有限公司'&&item!='黑龙江鑫满仓粮食贸易有限公司'
+        })
+        if(extra.length>0){
+          this.ewCustomerOptions=[]
+          this.companyNameOptions=[]
+          this.companyNameEWOptions=[]
+          this.companyName=extra[0]
+          this.companyNameEW=extra[0]
+          this.ewCustomer=extra[0]
+          for (let i = 0; i < extra.length; i++) {
+            this.ewCustomerOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameEWOptions.push({value: extra[i],label:extra[i]})
+          }
+        }
+      }
       // this.getVideos()
       this.isShowBalance = true
       var _saomaData = JSON.parse(localStorage.getItem('saoma_data')) //判断是否扫码进来的

+ 27 - 0
src/views/houseSelfCollect/weightCheckRecord.vue

@@ -178,6 +178,9 @@
     importWordYk,
     getweighingDelete
   } from '@/model/houseSelfCollect/index'
+  import {
+    getcomp
+  } from '@/model/indexRx'
   import weightCheckPrint from './component/weightCheckPrint.vue'
   export default {
     components: {
@@ -194,6 +197,7 @@
         // binNumberId: '', //仓位Id
         // warehouseType: '',
         compId: '',
+        UserInfo:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')),
         pickerOptions: {
           shortcuts: [{
               text: '本周',
@@ -307,6 +311,29 @@
     },
     activated() {
       //仓库
+      console.log(localStorage.getItem('compNameoptions'))
+      if(localStorage.getItem('compNameoptions')){
+        var company=JSON.parse(localStorage.getItem('compNameoptions'))
+        var extra=company.filter((item)=>{
+          return item!='黑龙江中天昊元贸易有限公司'&&item!='黑龙江利润元粮食贸易有限公司'&&item!= '黑龙江众利合粮食贸易有限公司'&&item!='黑龙江鑫满仓粮食贸易有限公司'
+        })
+        if(extra.length>0){
+          this.ewCustomerOptions=[]
+          this.companyNameOptions=[]
+          this.companyNameEWOptions=[]
+          this.companyName=extra[0]
+          this.companyNameEW=extra[0]
+          this.ewCustomer=extra[0]
+          for (let i = 0; i < extra.length; i++) {
+            this.ewCustomerOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameEWOptions.push({value: extra[i],label:extra[i]})
+          }
+        }
+        console.log( this.ewCustomerOptions,
+            this.companyNameOptions,
+            this.companyNameEWOptions)
+      }
       selectWarehouseSelf({
           compId: localStorage.getItem('ws-pf_compId'),
         })

+ 73 - 56
src/views/outboundManagement/weighingManagementNew.vue

@@ -403,7 +403,8 @@
     newSubmit,
     getInfo,
     gettask,
-    getweight
+    getweight,
+    getcontract
   } from '@/model/outboundManagement/index'
   import {
     pullDown,
@@ -472,7 +473,7 @@
         information: '皮重',
         carChange1: '手动填写',
         inWarehouseType: 1, //入库类型
-        outContractNo: [],
+        outContractNo: {},
         mListTop: [],
         searchType: '',
         taskNolist: [],
@@ -616,6 +617,25 @@
       }
     },
     mounted() {
+      if(localStorage.getItem('compNameoptions')){
+        var company=JSON.parse(localStorage.getItem('compNameoptions'))
+        var extra=company.filter((item)=>{
+          return item!='黑龙江中天昊元贸易有限公司'&&item!='黑龙江利润元粮食贸易有限公司'&&item!= '黑龙江众利合粮食贸易有限公司'&&item!='黑龙江鑫满仓粮食贸易有限公司'
+        })
+        if(extra.length>0){
+          this.ewCustomerOptions=[]
+          this.companyNameOptions=[]
+          this.companyNameEWOptions=[]
+          this.companyName=extra[0]
+          this.companyNameEW=extra[0]
+          this.ewCustomer=extra[0]
+          for (let i = 0; i < extra.length; i++) {
+            this.ewCustomerOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameEWOptions.push({value: extra[i],label:extra[i]})
+          }
+        }
+      }
       this.getNowTime()
       this.selectWarehouse()
       this.showType = this.isShow
@@ -2098,7 +2118,6 @@
             this.weighingList.goodsName = this.taskNolist[i].goodsName
             this.weighingList.tips = this.taskNolist[i].businessDescribe
             data = this.taskNolist[i]
-            console.log(data,11111111111)
             if(this.taskNolist[i].inOutType=='移库出库'){ 
               
               this.weighingList.contractNo = this.taskNolist[i].moveTaskNo
@@ -2145,27 +2164,26 @@
               }
           }
         }
-        // if (!data) return
-        for (var i = 0; i < this.outContractNo.length; i++) {
-          if (this.outContractNo[i].contractNo == this.weighingList.contractNo) {
-            this.shipInfoList=this.outContractNo[i].shipInfoList
-            this.fireDirectionList=this.outContractNo[i].fireDirectionList
-            this.weighingList.goodsName = this.outContractNo[i].goodsName
+        getcontract({contractNo:this.weighingList.contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
+          this.outContractNo=response
+            this.shipInfoList=this.outContractNo.shipInfoList
+            this.fireDirectionList=this.outContractNo.fireDirectionList
+            this.weighingList.goodsName = this.outContractNo.goodsName
             if (this.weighingList.goodsName == '玉米(潮粮)') {
               this.weighingList.type = '潮粮'
             } else {
               this.weighingList.type = '干粮'
             }
-            console.log(this.outContractNo[i],12222)
+            console.log(this.outContractNo,12222)
             // this.weighingList.contractPrice = this.outContractNo[i].unitContractPrice
-            this.$set(this.weighingList,'contractPrice',this.outContractNo[i].unitContractPrice)
-            this.$set(this.weighingList,'customer',this.outContractNo[i].buyer)
-            this.weighingList.goodsNameKey = this.outContractNo[i].goodsNameKey
-            this.weighingList.grade = this.outContractNo[i].grade
-            this.weighingList.inOutType = this.outContractNo[i].inOutType
-            if (this.outContractNo[i].inOutType == '销售出库') {
-              if(this.outContractNo[i].deliverType==1){
-                gettask({contractNo:this.outContractNo[i].contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
+            this.$set(this.weighingList,'contractPrice',this.outContractNo.unitContractPrice)
+            this.$set(this.weighingList,'customer',this.outContractNo.buyer)
+            this.weighingList.goodsNameKey = this.outContractNo.goodsNameKey
+            this.weighingList.grade = this.outContractNo.grade
+            this.weighingList.inOutType = this.outContractNo.inOutType
+            if (this.outContractNo.inOutType == '销售出库') {
+              if(this.outContractNo.deliverType==1){
+                gettask({contractNo:this.outContractNo.contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
                   // console.log(response)
                   if(!response){
                     this.$message({
@@ -2177,37 +2195,37 @@
                 })
               }
               
-              if(this.outContractNo[i].priceType=='随行就市'){
+              if(this.outContractNo.priceType=='随行就市'){
                 this.priceedit=false
-              }else if(this.outContractNo[i].priceType=='定价销售'){
+              }else if(this.outContractNo.priceType=='定价销售'){
                 this.priceedit=false
               }{
 
               }
               this.warehouseCount = '000' + (Number(this.warehouseCount) + 1)
               this.weighingList.numberLetter = 'XSCK'
-              this.weighingList.buyer = this.outContractNo[i].buyer
+              this.weighingList.buyer = this.outContractNo.buyer
               this.weighingList.seller = localStorage.getItem('ws-pf_compName')
-              if (!this.outContractNo[i].unitContractPrice) {
-                this.weighingList.tips = '买方' + this.outContractNo[i].buyer
+              if (!this.outContractNo.unitContractPrice) {
+                this.weighingList.tips = '买方' + this.outContractNo.buyer
               } else {
                 this.weighingList.tips =
                   '买方' +
-                  this.outContractNo[i].buyer +
+                  this.outContractNo.buyer +
                   '( ' +
-                  this.outContractNo[i].unitContractPrice +
+                  this.outContractNo.unitContractPrice +
                   '元/吨)'
               }
               this.weighingList.inOutTypeKey = 1
-            } else if (this.outContractNo[i].inOutType == '移库出库') {
+            } else if (this.outContractNo.inOutType == '移库出库') {
               for (let q = 0; q < this.warehouseList1.length; q++) {
                 if (this.warehouseList1[q].warehouseName == this.warehouseName) {
-                  if(this.warehouseList1[q].warehouseType==2&&this.warehouseList1[q].createType==1&&this.outContractNo[i].priceType=='定价采购'){
+                  if(this.warehouseList1[q].warehouseType==2&&this.warehouseList1[q].createType==1&&this.outContractNo.priceType=='定价采购'){
                     // console.log(this.outContractNo[i].contractPrice,11111111111)
                     this.priceedit=true
-                    this.weighingList.contractPrice=this.outContractNo[i].contractPrice
+                    this.weighingList.contractPrice=this.outContractNo.contractPrice
                   }
-                  if(this.warehouseList1[q].warehouseType==2&&this.warehouseList1[q].createType==1&&this.outContractNo[i].priceType=='随行就市'){
+                  if(this.warehouseList1[q].warehouseType==2&&this.warehouseList1[q].createType==1&&this.outContractNo.priceType=='随行就市'){
                     this.priceedit=false
                   }
                    if(this.warehouseList1[q].warehouseType==1){
@@ -2215,50 +2233,50 @@
                    }
                 }
               }
-              this.weighingList.priceType=this.outContractNo[i].priceType
+              this.weighingList.priceType=this.outContractNo.priceType
               this.warehouseCount = '000' + (Number(this.warehouseCount) + 1)
               this.weighingList.numberLetter = 'YKCK'
 
-              this.weighingList.buyer = this.outContractNo[i].receiveWarehouse
-              this.weighingList.seller = this.outContractNo[i].sendWarehouse
+              this.weighingList.buyer = this.outContractNo.receiveWarehouse
+              this.weighingList.seller = this.outContractNo.sendWarehouse
               this.weighingList.goodsName = data == null?'玉米':data.goodsName
               this.weighingList.goodsNameKey = data == null?'1':data.goodsNameKey
               this.weighingList.grade = data == null?'二等品':data.grade
-              if (this.outContractNo[i].unitContractPrice) {
+              if (this.outContractNo.unitContractPrice) {
                 this.weighingList.tips =
                   '入货库' +
                   data == null?'':data.receiveWarehouse +
                   '( ' +
-                  this.outContractNo[i].unitContractPrice +
+                  this.outContractNo.unitContractPrice +
                   '元/吨)'
               } else {
                 this.weighingList.tips = '入货库' + data == null?'':data.receiveWarehouse
               }
               this.weighingList.inOutTypeKey = 3
-            } else if (this.outContractNo[i].inOutType == '暂存入库') {
+            } else if (this.outContractNo.inOutType == '暂存入库') {
               this.weighingList.inOutTypeKey = 4
-            } else if (this.outContractNo[i].inOutType == '贸易服务出库') {
+            } else if (this.outContractNo.inOutType == '贸易服务出库') {
               this.weighingList.inOutTypeKey = 5
-            } else if (this.outContractNo[i].inOutType == '采购出库') {
+            } else if (this.outContractNo.inOutType == '采购出库') {
               this.weighingList.inOutTypeKey = 6
             }
-            if (this.outContractNo[i].deliverType == '1') {
+            if (this.outContractNo.deliverType == '1') {
               this.carjudge = false
               
             } else {
               this.carjudge = true
             }
-            if (this.outContractNo[i].tranCarInfoList) {
-              this.options2 = this.outContractNo[i].tranCarInfoList
-              this.tranCarInfoList = this.outContractNo[i].tranCarInfoList
+            if (this.outContractNo.tranCarInfoList) {
+              this.options2 = this.outContractNo.tranCarInfoList
+              this.tranCarInfoList = this.outContractNo.tranCarInfoList
               this.carjudge = false
 
             }else{
               this.options2 = []
               this.tranCarInfoList = []
             }
-            if (this.outContractNo[i].tranCarInfoList1) {
-              this.fleetNameList = this.outContractNo[i].tranCarInfoList1
+            if (this.outContractNo.tranCarInfoList1) {
+              this.fleetNameList = this.outContractNo.tranCarInfoList1
             }else{
               this.fleetNameList = []
             }
@@ -2269,9 +2287,8 @@
                 this.weighingList.selfLoading = '0'
                 this.carChange1 = '手动填写'
               }
-          }
-        }
-        
+        })
+        // if (!data) return
       },
       selectWarehouse() {
         selectWarehouseSelf({
@@ -2342,16 +2359,16 @@
           .then((response) => {
             this.taskNolist = response
           })
-        //合同编号
-        xialaNo({
-            compId: localStorage.getItem('ws-pf_compId'),
-            // loadingstatus: 1,
-            flag: 5,
-          })
-          .toPromise()
-          .then((response) => {
-            this.outContractNo = response
-          })
+        // //合同编号
+        // xialaNo({
+        //     compId: localStorage.getItem('ws-pf_compId'),
+        //     // loadingstatus: 1,
+        //     flag: 5,
+        //   })
+        //   .toPromise()
+        //   .then((response) => {
+        //     this.outContractNo = response
+        //   })
         // this.refreshClick(1)
         getweighingList({
             compId: localStorage.getItem('ws-pf_compId'),

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

@@ -317,6 +317,25 @@
       }
     },
     activated() {
+      if(localStorage.getItem('compNameoptions')){
+        var company=JSON.parse(localStorage.getItem('compNameoptions'))
+        var extra=company.filter((item)=>{
+          return item!='黑龙江中天昊元贸易有限公司'&&item!='黑龙江利润元粮食贸易有限公司'&&item!= '黑龙江众利合粮食贸易有限公司'&&item!='黑龙江鑫满仓粮食贸易有限公司'
+        })
+        if(extra.length>0){
+          this.ewCustomerOptions=[]
+          this.companyNameOptions=[]
+          this.companyNameEWOptions=[]
+          this.companyName=extra[0]
+          this.companyNameEW=extra[0]
+          this.ewCustomer=extra[0]
+          for (let i = 0; i < extra.length; i++) {
+            this.ewCustomerOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameOptions.push({value: extra[i],label:extra[i]})
+            this.companyNameEWOptions.push({value: extra[i],label:extra[i]})
+          }
+        }
+      }
       this.selectWarehouse()
       this.showType = this.isShow
     },