diff --git a/src/common/basic.js b/src/common/basic.js index b22c9641..c9a0a7af 100644 --- a/src/common/basic.js +++ b/src/common/basic.js @@ -727,6 +727,13 @@ export function getPackingNumberAndBatch(managementList, itemCode, packingNumber // }) // scanErrorAudio(); // } +export function compare(key) { + return function(a, b) { + var val1 = a[key]; + var val2 = b[key]; + return val2 - val1; + } +} export function compareTime() { return function(a, b) { diff --git a/src/mycomponents/job/jobComMainDetailCard.vue b/src/mycomponents/job/jobComMainDetailCard.vue index 3c2f8a4c..3707c201 100644 --- a/src/mycomponents/job/jobComMainDetailCard.vue +++ b/src/mycomponents/job/jobComMainDetailCard.vue @@ -1,7 +1,7 @@ @@ -39,6 +42,9 @@ import jobFilter from '@/mycomponents/job/jobFilter.vue' import comCountJobCard from '@/pages/count/coms/comCountJobCard.vue' import jobListPopup from '@/pages/count/coms/jobListPopup.vue' import jobInfoPopup from '@/pages/count/coms/jobInfoPopup.vue' +import jobListView from '@/mycomponents/jobList/jobList.vue' +import winScanButton from '@/mycomponents/scan/winScanButton.vue' +import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue' import { useCountStore } from '@/store' // 获取自定义的store @@ -60,6 +66,8 @@ const filter = ref() const comMessageRef = ref() const jobInfoPopupRef = ref() const jobListPopupRef = ref() +const jobListRef = ref() +const scanPopup = ref() onShow(() => { nextTick(() => { getList('refresh') @@ -162,6 +170,14 @@ const openJobDetail = (item) => { const selectedItem = (item) => { openJobDetail(item) } +const openScanPopup = () => { + scanPopup.value.openScanPopup() +} + +const selectItem = (item) => { + scanPopup.value.closeScanPopup() + openJobDetail(item) +} const showItemList = (itemList) => { jobListPopupRef.value.openPopup(itemList) } @@ -254,6 +270,58 @@ const showMessage = (message) => { } }) } +const getScanResult = (result) => { + uni.showLoading({ + title: '加载中....', + mask: true + }) + const filters = [] + filters.push({ + column: 'status', + action: 'in', + value: '1,2' + }) + filters.push({ + column: 'locationCode', + action: '==', + value: result.label.code + }) + + const params = { + filters, + pageNo: 1, + pageSize: 1000, + sort: 'number', + by: 'DESC' + } + getCountJobList(params) + .then((res) => { + uni.hideLoading() + const resultList = res.data.list + resultList.forEach((item) => { + item.title = item.number + item.selected = false + }) + const list = [] + resultList.forEach((item) => { + if (!list.find((subItem) => subItem.title == item.title)) { + list.push(item) + } + }) + + if (list.length == 0) { + showMessage('未查找到库位' + `【${result.label.code}】的盘点任务`) + } else if (list.length == 1) { + selectItem(list[0]) + } else { + jobListRef.value.openList(list) + } + }) + .catch((error) => { + uni.hideLoading() + showMessage(error) + }) +} diff --git a/src/pages/issue/coms/comScanIssuePack.vue b/src/pages/issue/coms/comScanIssuePack.vue index 3a7bf0f3..06c0b56a 100644 --- a/src/pages/issue/coms/comScanIssuePack.vue +++ b/src/pages/issue/coms/comScanIssuePack.vue @@ -290,6 +290,7 @@ const afterGetBalance = (label, balance, packageInfo) => { batch.detail = fromLocation.Batchs[0].detail } fromLocation.Batchs.unshift(batch) + emit('afterScan') } }) } else { diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue index 0b365bf0..0c63f16b 100644 --- a/src/pages/issue/job/issueDetail.vue +++ b/src/pages/issue/job/issueDetail.vue @@ -313,12 +313,20 @@ const afterScan = () => { const s = '' detail.Items.forEach((item) => { let totalHandleQty = 0 + let isHandleEmpty = false // 多个库位时 handleQty =0; item.Locations.forEach((lco) => { lco.Batchs.forEach((batch) => { - totalHandleQty = calc.add(totalHandleQty, batch.handleQty) + if (batch.handleQty != 0) { + totalHandleQty = calc.add(totalHandleQty, batch.handleQty) + } else { + isHandleEmpty = true + } }) }) if (item.qty == totalHandleQty) { + if (isHandleEmpty) { + return + } submit() } else { comMessageRef.value.showQuestionMessage(`实际扫描数量【${totalHandleQty}】与物料需求数量【${item.qty}】不一致,是否继续提交`, (res) => {