| | |
| | | console.log('仓位码: ', e); |
| | | let index = this.HStockPlaceNameList.findIndex(elem => elem['条码编号'] == e) |
| | | console.log('index: ', index); |
| | | // 不先置空的话,数据再次扫描相同的仓位码 不会触发组件内的刷新 |
| | | // 不先置空的话,数据再次扫描相同的仓位码 不会触发组件内的刷新 |
| | | this.hform.HStockPlaceID = 0 |
| | | this.hform.HStockPlaceName = '' |
| | | await this.$nextTick() |
| | |
| | | }) |
| | | }, |
| | | }); |
| | | |
| | | uni.request({ |
| | | url: this.serverUrl + '/Gy_StockPlace/list', |
| | | data: { |
| | | sWhere: "", |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.count == 1) { |
| | | this.HStockPlaceNameList = res.data.data |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHStockPlaceName[i] = res.data.data[i].仓位名称 |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓位数据请求失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | }); |
| | | // 仓位的获取推迟到 选择仓库后 仓位大于1000条时,此方法获取补全 |
| | | // uni.request({ |
| | | // url: this.serverUrl + '/Gy_StockPlace/list', |
| | | // data: { |
| | | // sWhere: "", |
| | | // user: uni.getStorageSync('HUserName'), |
| | | // Organization: uni.getStorageSync('Organization') |
| | | // }, |
| | | // success: (res) => { |
| | | // if (res.data.count == 1) { |
| | | // this.HStockPlaceNameList = res.data.data |
| | | // for (var i = 0; i < res.data.data.length; i++) { |
| | | // this.arrayHStockPlaceName[i] = res.data.data[i].仓位名称 |
| | | // } |
| | | // } else { |
| | | // uni.showToast({ |
| | | // title: '仓位数据请求失败', |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | // }, |
| | | // fail: (res) => { |
| | | // console.log(res); |
| | | // uni.showToast({ |
| | | // title: '接口请求失败', |
| | | // icon: 'none' |
| | | // }) |
| | | // }, |
| | | // }); |
| | | |
| | | // this.getHYDList() |
| | | }, |
| | |
| | | |
| | | if (this.HWHNameList[i]['启用仓位'] == 'Y') { |
| | | this.showHStockPlaceName = true |
| | | this.getStockPlaceRemote(this.HWHNameList[i]["HSPGroupID"]) |
| | | } else { |
| | | this.hform.HStockPlaceName = '' |
| | | this.showHStockPlaceName = false |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 获取仓位 |
| | | async getStockPlaceRemote(HSPGroupID) { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_StockPlace/list', |
| | | data: { |
| | | sWhere: ` and HSPGroupID = ${HSPGroupID}`, |
| | | user: uni.getStorageSync('HUserName'), |
| | | Organization: uni.getStorageSync('Organization') |
| | | }, |
| | | }) |
| | | |
| | | if (res.data.count == 1) { |
| | | this.HStockPlaceNameList = res.data.data |
| | | for (var i = 0; i < res.data.data.length; i++) { |
| | | this.arrayHStockPlaceName[i] = res.data.data[i].仓位名称 |
| | | } |
| | | } else { |
| | | uni.showToast({ |
| | | title: '仓位数据请求失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | } catch (err) { |
| | | uni.showToast({ |
| | | title: '仓位数据请求失败', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | //选择仓位 |
| | | HStockPlaceNameChange(e) { |
| | | console.log('e: ',e); |
| | | console.log('e: ', e); |
| | | let index = this.HStockPlaceNameList.findIndex(elem => elem['仓位名称'] == e) |
| | | |
| | | if (index != -1) { |
| | |
| | | } |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: res.data.Message |
| | | }) |
| | | } |
| | | } catch (err) { |