wangchao 3 лет назад
Родитель
Сommit
653f1e70d9
2 измененных файлов с 21 добавлено и 13 удалено
  1. 18 10
      pages/erp/index.vue
  2. 3 3
      pages/erp/warehousing/selectContractNo.vue

+ 18 - 10
pages/erp/index.vue

@@ -127,7 +127,6 @@ import helper from '@/common/helper.js';
 		},
 
 		onLoad() {
-			this.init()
 		},
 		// #ifndef MP
 		onNavigationBarButtonTap(e) {
@@ -175,9 +174,8 @@ import helper from '@/common/helper.js';
 			})
 			this.$api.doRequest('get', '/openServiceInfo/selectCommonCompany',{
 				phone:this.userInfo.phone
-			}).then(res => {debugger
+			}).then(res => {
 				if (res.data.code == 200) {
-					debugger
 					if(res.data.data.length==0){
 						this.isShowAlert = true
 					}else{
@@ -185,11 +183,13 @@ import helper from '@/common/helper.js';
 					}
 					this.compList = res.data.data
 					this.compName = res.data.data[0].compName
+					this.init(res.data.data[0].compId)
 				}
 			})
 		},
 		methods: {
-			goOpenService(){debugger
+			getCompWarehouse(){},
+			goOpenService(){
 				if (!this.hasLogin) {
 					url = '/pages/public/login';
 				}
@@ -233,7 +233,6 @@ import helper from '@/common/helper.js';
 							warehouseName:this.warehouseName,
 							binNumber:this.binNumber,
 							compId:this.compId,
-							agent:this.agent,
 							warehouseId:this.warehouseId,
 							baseId:this.baseId
 						}
@@ -245,13 +244,16 @@ import helper from '@/common/helper.js';
 			},
 			confirmWarehouse() {},
 			confirmPositon() {},
-			compChange(){},
-			init() {
+			compChange(e){debugger
+				this.compName = this.compList[e[0]].compName
+				this.init(this.compList[e[0]].compId)
+			},
+			init(compId) {
 				console.log(this.userInfo)
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
-					compId: '',
-				}).then(res => {
-					if (res.data.data) {
+					compId: compId,
+				}).then(res => {debugger
+					if (res.data.data.length!=0) {
 						console.log('res',res.data.data)
 							this.warehouseName = res.data.data[0].warehouseName
 							this.warehouseList = res.data.data;
@@ -265,6 +267,12 @@ import helper from '@/common/helper.js';
 							// this.makeBinNumber()
 						
 					}
+					else{
+						this.warehouseList=[]
+						this.warehouseCWList = []
+						this.warehouseName='暂无仓库'
+						this.binNumber='暂无'
+					}
 				})
 			},
 			makeBinNumber(){

+ 3 - 3
pages/erp/warehousing/selectContractNo.vue

@@ -48,7 +48,7 @@
 			this.newSelectList =  uni.getStorageSync('erpContractNoList');
 		},
 		onLoad(options) {
-			this.compId = options.compId
+			this.compId = helper.erpWarehouse.compId 
 			console.log(helper.selectContractNo); 
 			this.getContractNoList()
 		},
@@ -79,7 +79,7 @@
 			},
 			getContractNoList() {
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					// compId: this.compId,
+					compId: this.compId,
 					flag: 7,
 				}).then(res => {
 					if (res.data.code == 200) {
@@ -89,7 +89,7 @@
 					}
 				})
 				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
-					// compId: this.compId,
+					compId: this.compId,
 					flag: 6,
 				}).then(res => {
 					if (res.data.code == 200) {