zxz 2 gadi atpakaļ
vecāks
revīzija
cba3d4a7d6

+ 2 - 0
src/api/V2/houseSelfCollect/index.js

@@ -120,4 +120,6 @@ export const API_POST_CHANE_NO = `/weighingManagement/api/changeWarehouse`
 export const API_GET_CONTRACT ='/contractManagementInfo/getInContract'
 // 发起人撤回
 export const API_SPONSOR_WITHDRAW ='/newWorkflow/api/stopInstance'
+// 获取仓库id
+export const API_GET_BASEID ='/qualityInspectionManagement/selectBaseId'
 

+ 28 - 4
src/layout/index/top/index.vue

@@ -219,7 +219,8 @@
     getLook
   } from '@/model/warehouse/index'
   import {
-    getQRCodeData
+    getQRCodeData,
+    getBaseId
   } from '@/model/houseSelfCollect/index'
 
 
@@ -414,6 +415,9 @@
         if(_userCompId.indexOf(',') != -1){
          _userCompId =  _userCompId.split(',')[1]
         }
+        if(!_userHouseId){
+          this.obtainBaseId(_userCompId,_qualityNo)
+        }
         this.tmp = {
           compId: _userCompId,
           number: _qualityNo,
@@ -421,7 +425,6 @@
         }
         //  this.barCode = ''
         //判断当前账号公司是否是二维码上公司
-        debugger
         if (this.userINfo.userCompany != _userCompId) {
           console.log('请切换公司在试!')
           this.$message.error('当前身份不可操作');
@@ -429,8 +432,9 @@
           return
         }
         //判断二维码上的仓库当前账号是否有权限操作
-        this.getLook(this.cangid,localStorage.getItem('ws-pf_staffName'))
-        
+        if(this.cangid){
+          this.getLook(this.cangid,localStorage.getItem('ws-pf_staffName'))
+        }
       },
       compNameChange(){
       //   this.complogin({username:this.UserInfo.loginInfo.userMobilePhone,
@@ -578,6 +582,26 @@
             
           })
       },
+      //根据公司id、业务编号,获取仓库id
+      async obtainBaseId(compId, qualityNo){
+        await getBaseId({
+            compId: compId,
+            qualityNo: qualityNo,
+          })
+          .toPromise()
+          .then((response) => {
+             this.warehouseId = response.baseId
+             this.cangid = response.baseId
+             this.getLook(this.cangid,localStorage.getItem('ws-pf_staffName'))
+            this.tmp = {
+              compId: compId,
+              number: qualityNo,
+              warehouseId: this.warehouseId
+            }
+            // debugger
+            // this.getQRCodeData(this.tmp)
+          })
+      },
       // 二维码获取数据
       async getQRCodeData(tmp) {
         await getQRCodeData(tmp)

+ 4 - 1
src/model/houseSelfCollect/index.js

@@ -62,7 +62,8 @@ import {
   API_POST_CHANE_NO,
   API_POST_DELETE,
   API_GET_CONTRACT,
-  API_SPONSOR_WITHDRAW
+  API_SPONSOR_WITHDRAW,
+  API_GET_BASEID
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -188,3 +189,5 @@ export const changeNo = appRx.post(API_POST_CHANE_NO, errorCatcher, errorHandle,
 export const getcontract = appRx.get(API_GET_CONTRACT, errorCatcher, errorHandle, filter)
 // 发起人撤回
 export const sponsorWithdraw = appRx.post(API_SPONSOR_WITHDRAW, errorCatcher, errorHandle, filter)
+// 获取仓库id
+export const getBaseId = appRx.get(API_GET_BASEID, errorCatcher, errorHandle, filter)