diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index ad705a04..e1c0d657 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -10,7 +10,7 @@ - 来源库位 + 来源库位 - - + + - + 总数 : {{ totalCount }} @@ -175,56 +175,104 @@ const getDetailList = (pageNo, pageSize, type) => { showMessage(error) }) } +const getExpectin = (pageNo, pageSize, type) => { + uni.showLoading({ + title: '加载中...', + mask: true + }) + + if (type === 'refresh') { + pageNo.value = 1 + dataList.value = [] + } -const setShowList = (list) => { - const resultlist = [] - list.forEach((res) => { - const temp = resultlist.find((res1) => res1.itemCode == res.itemCode) - if (temp == undefined) { - const data = { - itemCode: res.itemCode, - qty: Number(res.qty), - uom: res.uom, - list: [] + const params = { + pageNo: pageNo.value, + pageSize, + filters: [ + { + column: 'locationCode', + action: '==', + value: locationCode.value } - var item = { - packingNumber: res.packingNumber, - batch: res.batch, - uom: res.uom, - qty: Number(res.qty), - inventoryStatus: res.inventoryStatus + ] + } + + getExpectInByLocationCode(params) + .then((res) => { + uni.hideLoading() + if (type === 'refresh') { + uni.stopPullDownRefresh() } - data.list.push(item) - resultlist.push(data) - } else { - temp.qty = calc.add(temp.qty, res.qty) - var item = { - packingNumber: res.packingNumber, - batch: res.batch, - uom: res.uom, - qty: Number(res.qty), - inventoryStatus: res.inventoryStatus + const { list } = res.data + totalCount.value = res.data.total + loadingType.value = 'loadmore' + if (list == null || list.length == 0) { + loadingType.value = 'nomore' + return } - temp.list.push(item) - } - }) - return resultlist + dataList.value = type === 'refresh' ? list : dataList.value.concat(list) + pageNo.value++ + }) + .catch((error) => { + uni.hideLoading() + showMessage(error) + }) } -const ontabtap = (e) => { - const index = e.target.dataset.current || e.currentTarget.dataset.current - tabIndex.value = index - getContentByTab(tabIndex.value) +const getExpectOut = (pageNo, pageSize, type) => { + uni.showLoading({ + title: '加载中...', + mask: true + }) + + if (type === 'refresh') { + pageNo.value = 1 + dataList.value = [] + } + + const params = { + pageNo: pageNo.value, + pageSize, + filters: [ + { + column: 'locationCode', + action: '==', + value: locationCode.value + } + ] + } + + getExpectOutByLocationCode(params) + .then((res) => { + uni.hideLoading() + if (type === 'refresh') { + uni.stopPullDownRefresh() + } + const { list } = res.data + totalCount.value = res.data.total + loadingType.value = 'loadmore' + if (list == null || list.length == 0) { + loadingType.value = 'nomore' + return + } + dataList.value = type === 'refresh' ? list : dataList.value.concat(list) + pageNo.value++ + }) + .catch((error) => { + uni.hideLoading() + showMessage(error) + }) } -const getContentByTab = (index, pageNo, pageSize) => { +const getContentByTab = (index, pageNo, pageSize, type) => { if (index === 0) { - getSummary(pageNo, pageSize) + getSummary(pageNo, pageSize, type) } else if (index === 1) { - getDetailList(pageNo, pageSize) + getDetailList(pageNo, pageSize, type) } else if (index === 2) { - dataIn.value = balances.value + getExpectin(pageNo, pageSize, type) } else if (index == 3) { - dataOut.value = balances.value + getExpectin(pageNo, pageSize, type) } } @@ -242,12 +290,7 @@ const afterCloseMessage = () => { } const tabChange = (index) => { tabIndex.value = index - paging.value.reload(true) -} -const queryList = (pageNo, pageSize) => { - if (locationCode.value != '') { - getContentByTab(tabIndex.value, pageNo, pageSize) - } + getContentByTab(index, pageNo.value, pageSize.value, 'refresh') } diff --git a/src/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/src/uni_modules/uni-combox/components/uni-combox/uni-combox.vue index fe3b2d6c..01a61335 100644 --- a/src/uni_modules/uni-combox/components/uni-combox/uni-combox.vue +++ b/src/uni_modules/uni-combox/components/uni-combox/uni-combox.vue @@ -1,297 +1,295 @@ -