From cc68fcbff0165cbbd5b44cafd721fa16ac6fbd22 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 6 Sep 2024 10:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B4=E6=8E=A5=E8=A1=A5?= =?UTF-8?q?=E6=96=99=E6=9F=A5=E8=AF=A2=E5=BA=93=E5=AD=982024/7/10=2015:14:?= =?UTF-8?q?14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 2 +- src/mycomponents/job/jobFilter.vue | 6 + src/mycomponents/scan/winComScanBalance.vue | 9 +- src/pages.json | 2 +- src/pages/count/job/countJob.vue | 7 +- src/pages/issue/job/issueJob.vue | 8 +- .../package/record/overPackageRecord.vue | 7 +- .../record/directRepleinshRecord.vue | 173 +++++------------- 8 files changed, 80 insertions(+), 134 deletions(-) diff --git a/src/api/request2.js b/src/api/request2.js index f22a9e65..2285ddce 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -2621,5 +2621,5 @@ export function getBalanceByParams(data) { */ export function getBusinessType() { - return http.get("/wms/businesstype/page?pageSize=1000&pageNo=1) + return http.get("/wms/businesstype/page?pageSize=1000&pageNo=1") } \ No newline at end of file diff --git a/src/mycomponents/job/jobFilter.vue b/src/mycomponents/job/jobFilter.vue index 2e2a5078..6bb867e5 100644 --- a/src/mycomponents/job/jobFilter.vue +++ b/src/mycomponents/job/jobFilter.vue @@ -102,6 +102,12 @@ watch( // 生产线 const productionLineCodeConfirm = () => { + let lineCode = '' + productionline.value.forEach((item) => { + if (item.text == productionLineCode.value) { + lineCode = item.value + } + }) emit('productionLineCode', productionLineCode.value) } // 来源库位 diff --git a/src/mycomponents/scan/winComScanBalance.vue b/src/mycomponents/scan/winComScanBalance.vue index 06f333d7..27ba1463 100644 --- a/src/mycomponents/scan/winComScanBalance.vue +++ b/src/mycomponents/scan/winComScanBalance.vue @@ -124,7 +124,7 @@ export default { } else if (res.data.length == 1) { result.balance = res.data[0] this.$emit('getBalance', result) - this.closeScanPopup() + // this.closeScanPopup() } else { // 多条记录 this.$refs.balanceSelect.openPopup(res.data) @@ -180,10 +180,15 @@ export default { selectBalanceItem(item) { this.resultData.balance = item this.$emit('getBalance', this.resultData) - this.closeScanPopup() + // this.closeScanPopup() }, closeScanPopup() { this.$refs.popup.close() + }, + getfocus() { + if (this.$refs.comscan) { + this.$refs.comscan.getfocus() + } } } } diff --git a/src/pages.json b/src/pages.json index 2576dc91..008f82d7 100644 --- a/src/pages.json +++ b/src/pages.json @@ -136,7 +136,7 @@ "path": "pages/supplierDeliver/record/supplierDeliverRecord", "style": { "navigationBarTitleText": "供应商发货记录", - "enablePullDownRefresh": true, + "enablePullDownRefresh": false, "titleNView": { // "autoBackButton": "true", "buttons": [ diff --git a/src/pages/count/job/countJob.vue b/src/pages/count/job/countJob.vue index 7d0e7bbb..ffed8425 100644 --- a/src/pages/count/job/countJob.vue +++ b/src/pages/count/job/countJob.vue @@ -306,7 +306,12 @@ const getScanResult = (result) => { value: '1,2' }) filters.push({ - column: 'locationCode', + column: 'countSplitType', + action: '==', + value: 'locationCode' + }) + filters.push({ + column: 'countSplitCode', action: '==', value: result.label.code }) diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue index 4cf5c717..4157792e 100644 --- a/src/pages/issue/job/issueJob.vue +++ b/src/pages/issue/job/issueJob.vue @@ -67,7 +67,7 @@ onShow(() => { }) }) onLoad(() => { - getIssueJobByProductionline() + getIssueJobByProductionline1() }) onReady(() => { detailOptions.value = getDetailOption() @@ -100,13 +100,13 @@ onNavigationBarButtonTap((e) => { filter.value.openFilter() } }) -const getIssueJobByProductionline = () => { +const getIssueJobByProductionline1 = () => { getIssueJobByProductionline().then((res) => { console.log('生产线', res) if (res.code == 0) { productionline.value = res.data.map((item) => ({ - value: item, - text: item + value: item.value, + text: item.name })) } else { productionline.value = [] diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index 2531d55a..b58df4aa 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -204,6 +204,7 @@ const setData = (result) => { detailSource.value.push(itemp) itemCode.value = balance.itemCode fromLocationCode.value = balance.locationCode + scanPopupGetFocus() } else { const detail = item.subList.find((r) => { if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { @@ -214,6 +215,7 @@ const setData = (result) => { if (detail == undefined) { const newDetail = createDetailInfo(balance, pack) item.subList.push(newDetail) + scanPopupGetFocus() } else if (detail.scaned == true) { showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) } @@ -228,6 +230,7 @@ const calcHandleQty1 = () => { const showErrorMessage = (message) => { comMessageRef.value.showErrorMessage(message, (res) => { if (res) { + scanPopupGetFocus() } }) } @@ -266,12 +269,12 @@ const showFromLocationPopup = () => { } const closeScanPopup = () => { - if (scanPopup.value != undefined) { + if (scanPopup.value) { scanPopup.value.closeScanPopup() } } const scanPopupGetFocus = () => { - if (scanPopup.value != undefined) { + if (scanPopup.value) { scanPopup.value.getfocus() } } diff --git a/src/pages/repleinsh/record/directRepleinshRecord.vue b/src/pages/repleinsh/record/directRepleinshRecord.vue index 4f2e975d..ef96ffdd 100644 --- a/src/pages/repleinsh/record/directRepleinshRecord.vue +++ b/src/pages/repleinsh/record/directRepleinshRecord.vue @@ -1,12 +1,12 @@ @@ -61,6 +59,7 @@ import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.v import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' +import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import { useCountStore } from '@/store' // 获取自定义的store const store = useCountStore() @@ -81,6 +80,7 @@ const fromWarehouseCode = ref('') // 来源仓库 const businessTypeCode = ref('Repleinment') const toLocationCode = ref('') const resultData = ref({}) +const itemCode = ref('') const balanceSelectRef = ref({}) const managementList = ref([]) @@ -93,23 +93,26 @@ const scanPopup = ref() const scanLocationCode = ref() onLoad((option) => { clear() + getBusinessType() +}) +// 返回首页 +onNavigationBarButtonTap((e) => { + if (e.index === 0) { + goHome() + } +}) +const getBusinessType = () => { getBusinessType(businessTypeCode.value, (res) => { if (res.success) { businessType.value = res.businessType + fromInventoryStatuses.value = getDirectoryItemArray(res.fromInventoryStatuses) fromLocationAreaTypeList.value = res.fromLocationAreaTypeList - toLocationAreaTypeList.value = res.toLocationAreaTypeList - showFromLocationPopup() + openScanPopup() } else { showErrorMessage(res.message) } }) -}) -// 返回首页 -onNavigationBarButtonTap((e) => { - if (e.index === 0) { - goHome() - } -}) +} const getBalance = (label, packageInfo, callback) => { const filters = [] @@ -161,104 +164,43 @@ const getBalance = (label, packageInfo, callback) => { }) } const getScanResult = (result) => { - resultData.value = result - const packageInfo = result.package - getBalance(result.label, packageInfo, (balances) => { - // 扫描的是外包装 - const s = '' - if (!result.package.parentNumber) { - if (balances.list.length == 0) { - showErrorMessage('未查找到该包装的库存信息,请重新扫描') - } else { - const newBalances = balances.list.filter((b) => b.locationCode == fromLocationCode.value) - if (newBalances.length == 0) { - showErrorMessage('未查找到该包装的库存信息,请重新扫描') - } else if (newBalances.length == 1) { - const balance = newBalances[0] - result.balance = balance - afterGetBalance(result) - } else { - showBalanceSelect(newBalances) - } - } - } else { - // 扫描的是小包装 - if (balances.list.length == 0) { - showErrorMessage('未查找到该包装的库存信息,请重新扫描') - } else { - // 小包装库存 - const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfo.number) - // 外包装库存 - const subParentPackitems = balances.list.filter((r) => r.packingNumber == packageInfo.parentNumber && r.locationCode == fromLocationCode.value) - - // 小包装没有库存, - if (subPackitems.length == 0) { - // 外包装有库存,出库后剩余库存未转换为出库包装规格 - - if (subParentPackitems.length > 0) { - if (subParentPackitems.length == 1) { - const balance = subParentPackitems[0] - balance.qty = packageInfo.qty - result.balance = balance - afterGetBalance(result) - } else { - showBalanceSelect(subParentPackitems) - } - } else { - showErrorMessage(`按外包装【${packageInfo.parentNumber}】和子包装【${packageInfo.number}】都未查找到库存余额`) - } - } else { - let locationCode = fromLocationCode.value - if (balances.list == 1) { - locationCode = balances.list[0].locationCode - } else { - const manyBlances = balances.list.filter((r) => r.locationCode != fromLocationCode.value) - if (manyBlances.length > 0) { - locationCode = manyBlances[0].locationCode - } - } - showErrorMessage(`该包装【${packageInfo.number}】在库位【${locationCode}】已经有库存余额,请重新扫描`) - } - } - } - }) -} - -const showBalanceSelect = (items) => { - balanceSelectRef.value.openPopup(items) + setData(result) } - -const selectBalanceItem = (balance) => { - resultData.value.balance = balance - afterGetBalance(resultData.value) -} - -const afterGetBalance = (result) => { +const setData = (result) => { const { balance } = result const { label } = result const pack = result.package - const { packUnit } = pack - const { packQty } = pack + if (fromLocationCode.value && fromLocationCode.value != balance.locationCode) { + showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]在库位[${fromLocationCode.value}]没有库存余额`) + return + } + const item = detailSource.value.find((res) => { if (res.itemCode == balance.itemCode) { return res } }) - if (fromWarehouseCode.value == '') { - fromWarehouseCode.value = balance.warehouseCode - } if (item == undefined) { + if (itemCode.value != '' && itemCode.value != balance.itemCode) { + showErrorMessage(`请扫描物料为【${itemCode.value}】的箱码`) + return + } + if (fromWarehouseCode.value == '') { + fromWarehouseCode.value = balance.warehouseCode + } const itemp = createItemInfo(balance, pack) - const newDetail = createDetailInfo(balance, pack) - newDetail.packUnit = packUnit || '' - newDetail.packQty = packQty + const newDetail = createDetailInfo(balance, pack) // + newDetail.parentNumber = pack.parentNumber + newDetail.packingNumber = pack.number + newDetail.packUnit = pack.packUnit + newDetail.packQty = pack.packQty itemp.subList.push(newDetail) - const dataList = pack.subList detailSource.value.push(itemp) - calcHandleQty(detailSource.value) + itemCode.value = balance.itemCode + fromLocationCode.value = balance.locationCode.scanPopupGetFocus() } else { const detail = item.subList.find((r) => { - if (r.packingNumber == pack.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { + if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) { return r } }) @@ -266,16 +208,15 @@ const afterGetBalance = (result) => { const newDetail = createDetailInfo(balance, pack) newDetail.parentNumber = pack.parentNumber newDetail.packingNumber = pack.number - newDetail.parentNumber = pack.parentNumber - newDetail.packingNumber = pack.number - newDetail.packUnit = packUnit - newDetail.packQty = packQty + newDetail.packUnit = pack.packUnit + newDetail.packQty = pack.packQty item.subList.push(newDetail) - calcHandleQty(detailSource.value) + scanPopupGetFocus() } else if (detail.scaned == true) { - showErrorMessage(`箱码[${detail.packingNumber}]批次[${balance.batch}]已经在列表中`) + showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`) } } + calcHandleQty(detailSource.value) } const updateData = () => { @@ -303,27 +244,21 @@ const removePack = () => { } const openScanPopup = () => { - if (fromLocationCode.value == '') { - showFromLocationPopup() - return + if (businessType.value) { + scanPopup.value.openScanPopup(businessType.value) + } else { + getBusinessType() } - scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value) -} - -const showFromLocationPopup = () => { - nextTick(() => { - scanLocationCode.value.openScanPopup() - }) } const closeScanPopup = () => { - if (scanPopup.value != undefined) { + if (scanPopup.value) { scanPopup.value.closeScanPopup() } } const scanPopupGetFocus = () => { - if (scanPopup.value != undefined) { + if (scanPopup.value) { scanPopup.value.getfocus() } } @@ -449,14 +384,6 @@ const closeScanMessage = () => { scanPopupGetFocus() } -const getLocation = (location, code) => { - getFromLocationCode(location, code) -} - -const getFromLocationCode = (location, code) => { - fromLocationCode.value = code - openScanPopup() -} const getToLocationCode = (location, code) => { if (fromLocationCode.value == code) { uni.showToast({