From 061f57a2f5766c2d51adb18e2ac91960dade32fa Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 14 Mar 2024 16:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E4=B8=8A=E6=9E=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 18 + src/common/directory.js | 10 +- src/common/label.js | 14 +- src/common/record.js | 18 + src/mycomponents/detail/comJobDetailCard.vue | 175 +++++++ src/mycomponents/package/packageCard.vue | 2 +- src/mycomponents/package/packageList.vue | 5 +- .../package/packageRecordCard.vue | 168 +++++++ .../package/packageRecordList.vue | 195 ++++++++ src/mycomponents/qty/balanceQty.vue | 6 +- src/mycomponents/qty/packQty.vue | 1 - src/mycomponents/qty/qty.vue | 18 +- src/mycomponents/record/recordDetailCard.vue | 173 +++++++ .../scan/winScanPackAndLocationNoBalance.vue | 454 ++++++++++++++++++ .../coms/comReceiptDetailCard.vue | 2 +- .../purchaseReceipt/job/receiptDetail.vue | 1 - src/pages/putaway/job/putawayDetail.vue | 154 +++--- src/pages/putaway/record/putawayRecord.vue | 53 +- 18 files changed, 1348 insertions(+), 119 deletions(-) create mode 100644 src/mycomponents/detail/comJobDetailCard.vue create mode 100644 src/mycomponents/package/packageRecordCard.vue create mode 100644 src/mycomponents/package/packageRecordList.vue create mode 100644 src/mycomponents/record/recordDetailCard.vue create mode 100644 src/mycomponents/scan/winScanPackAndLocationNoBalance.vue diff --git a/src/api/request2.js b/src/api/request2.js index 028a6e71..e68bdb0e 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -377,6 +377,24 @@ export function getPackageByNumber(number) { }); } +/**包装 + * 获取包装信息 + * @param {*} + * + */ +export function getPackageListByNumber(number) { + var params = { + number: number, + pageNo: 1, + pageSize: 100 + } + return request({ + url: baseApi + "/wms/package/queryPackageInfo", + method: "get", + data: params, + }); +} + /** diff --git a/src/common/directory.js b/src/common/directory.js index 63139129..c72deb20 100644 --- a/src/common/directory.js +++ b/src/common/directory.js @@ -6,6 +6,7 @@ let uomList = []; let inventoryStatusList = []; let containerTypeList = []; let packUnitList = []; +let packUnitInfoList = []; let requestStatusList = []; let unplannedReceiptReasonList = []; let unplannedIssueReasonList = []; @@ -43,6 +44,7 @@ export function clearCacheData() { inventoryStatusList = []; containerTypeList = []; packUnitList = []; + packUnitInfoList = []; requestStatusList = []; unplannedReceiptReasonList = []; unplannedIssueReasonList = []; @@ -515,11 +517,11 @@ export function getCountStageName(value) { //获取包装规格 export function getPackUnitName(value) { var resultInfo = ""; - if (packUnitList.length == 0) { - packUnitList = uni.getStorageSync('packunit'); + if (packUnitInfoList.length == 0) { + packUnitInfoList = uni.getStorageSync('packunit'); } - if (packUnitList.length > 0) { - for (let item of packUnitList) { + if (packUnitInfoList.length > 0) { + for (let item of packUnitInfoList) { if (item.code == value) { resultInfo = item.name break; diff --git a/src/common/label.js b/src/common/label.js index 7ffefd7e..06e3546a 100644 --- a/src/common/label.js +++ b/src/common/label.js @@ -2,7 +2,7 @@ let labelDic = []; import { getLabelByHeader, - getPackageByNumber + getPackageListByNumber } from '../api/request2.js'; import { @@ -106,13 +106,15 @@ export function getLabelItems(labelItem, scanMsg, callBack) { //查询包装信息 let packingNumber = labelResult.label.packingNumber if (packingNumber != undefined) { - getPackageByNumber(packingNumber).then(pack => { - if (pack.data.list.length == 0) { + getPackageListByNumber(packingNumber).then(pack => { + if (pack.data.reqPackage) { + labelResult.package = pack.data.reqPackage; + labelResult.package.subList = pack.data.subList; + console.log('包装信息', JSON.stringify(labelResult.package)) + + } else { labelResult.success = false; labelResult.message = '包装号[' + packingNumber + ']没有包装信息'; - } else { - labelResult.package = pack.data.list[0]; - console.log('包装信息', JSON.stringify(labelResult.package)) } callBack(labelResult); }).catch(err => { diff --git a/src/common/record.js b/src/common/record.js index 65f102f2..09bff6d6 100644 --- a/src/common/record.js +++ b/src/common/record.js @@ -56,6 +56,24 @@ export function calcHandleQty(detailSource) { } } +export function calcTreeHandleQty(detailSource) { + for (let item of detailSource) { + item.handleQty = new Decimal(0).toNumber(); + + for (let detail of item.subList) { + if (detail != undefined && detail.scaned) { + detail.handleQty = new Decimal(0).toNumber(); + for (let pack of detail.packList){ + if(pack!=undefined&&pack.scaned){ + detail.handleQty = calc.add(detail.handleQty, pack.handleQty); + } + } + item.handleQty = calc.add(item.handleQty, detail.handleQty); + } + } + } +} + export function getBusinessType(typeCode, callback) { let result = { success: true, diff --git a/src/mycomponents/detail/comJobDetailCard.vue b/src/mycomponents/detail/comJobDetailCard.vue new file mode 100644 index 00000000..0ef7c08f --- /dev/null +++ b/src/mycomponents/detail/comJobDetailCard.vue @@ -0,0 +1,175 @@ + + + + + \ No newline at end of file diff --git a/src/mycomponents/package/packageCard.vue b/src/mycomponents/package/packageCard.vue index de08a406..f56df994 100644 --- a/src/mycomponents/package/packageCard.vue +++ b/src/mycomponents/package/packageCard.vue @@ -59,7 +59,7 @@ props: { dataContent: { type: Object, - default: {} + default: null }, isShowContainer: { type: Boolean, diff --git a/src/mycomponents/package/packageList.vue b/src/mycomponents/package/packageList.vue index 2e63aca4..5734021c 100644 --- a/src/mycomponents/package/packageList.vue +++ b/src/mycomponents/package/packageList.vue @@ -5,8 +5,8 @@ + + + + + + + + + + + + + + + + + + + + + 复制 + + + + + + + + + \ No newline at end of file diff --git a/src/mycomponents/package/packageRecordList.vue b/src/mycomponents/package/packageRecordList.vue new file mode 100644 index 00000000..1ecdac3b --- /dev/null +++ b/src/mycomponents/package/packageRecordList.vue @@ -0,0 +1,195 @@ + + + + + + \ No newline at end of file diff --git a/src/mycomponents/qty/balanceQty.vue b/src/mycomponents/qty/balanceQty.vue index 58e339c9..11fa2ed9 100644 --- a/src/mycomponents/qty/balanceQty.vue +++ b/src/mycomponents/qty/balanceQty.vue @@ -9,7 +9,7 @@ - + @@ -18,12 +18,14 @@ import packQty from '@/mycomponents/qty/packQty.vue' import uom from '@/mycomponents/qty/uom.vue' import status from '@/mycomponents/status/status.vue' + import packUnit from '@/mycomponents/qty/packUnit.vue' export default { components: { packQty, uom, - status + status, + packUnit }, data() { return { diff --git a/src/mycomponents/qty/packQty.vue b/src/mycomponents/qty/packQty.vue index ee5df1c9..d8893220 100644 --- a/src/mycomponents/qty/packQty.vue +++ b/src/mycomponents/qty/packQty.vue @@ -7,7 +7,6 @@ + + \ No newline at end of file diff --git a/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue b/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue new file mode 100644 index 00000000..ba630c80 --- /dev/null +++ b/src/mycomponents/scan/winScanPackAndLocationNoBalance.vue @@ -0,0 +1,454 @@ + + + + + diff --git a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue index 0ef7c08f..f79d579c 100644 --- a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue +++ b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue @@ -6,7 +6,7 @@ - + diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue index 545f4e95..3d5c268d 100644 --- a/src/pages/purchaseReceipt/job/receiptDetail.vue +++ b/src/pages/purchaseReceipt/job/receiptDetail.vue @@ -254,7 +254,6 @@ this.showMessage("物料号【" + itemCode + "】不在列表中") } else { //物料在列表中 - var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); if (itemDetail == undefined) { diff --git a/src/pages/putaway/job/putawayDetail.vue b/src/pages/putaway/job/putawayDetail.vue index 6354fa30..8515a896 100644 --- a/src/pages/putaway/job/putawayDetail.vue +++ b/src/pages/putaway/job/putawayDetail.vue @@ -14,10 +14,9 @@ - - + + @@ -38,7 +37,7 @@ - + @@ -61,7 +60,8 @@ goHome, getCurrDateTime, getPackingNumberAndBatch, - navigateBack + navigateBack, + compareAsc } from '@/common/basic.js'; import { @@ -70,14 +70,15 @@ } from '@/common/directory.js'; import { - getDataSource, + getTreeDataSource, calcHandleQty, + calcTreeHandleQty, getScanCount } from '@/common/detail.js'; import winScanButton from '@/mycomponents/scan/winScanButton.vue' - import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" - import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" + import winScanPackAndLocationNoBalance from "@/mycomponents/scan/winScanPackAndLocationNoBalance.vue" + import comJobDetailCard from "@/mycomponents/detail/comJobDetailCard.vue" import locationCompare from '@/mycomponents/location/locationCompare.vue' import jobTop from '@/mycomponents/job/jobTop.vue' @@ -85,9 +86,9 @@ export default { components: { winScanButton, - winScanPackAndLocation, + winScanPackAndLocationNoBalance, locationCompare, - comDetailCard, + comJobDetailCard, jobTop }, data() { @@ -178,7 +179,7 @@ that.jobContent = res.data; that.jobStatus = res.data.status that.subList = res.data.subList; - that.detailSource = getDataSource(that.subList) + that.detailSource = getTreeDataSource(that.subList) that.fromLocationCode = that.subList[0].fromLocationCode that.jobToLocationCode = that.subList[0].toLocationCode; @@ -207,7 +208,7 @@ }, calcHandleQty() { - calcHandleQty(this.detailSource); + calcTreeHandleQty(this.detailSource); this.continueScan() this.$forceUpdate(); }, @@ -254,12 +255,12 @@ getScanResult(result) { try { - var packingNumber = result.balance.packingNumber; - var batch = result.balance.batch; - var qty = result.balance.qty; - var itemCode = result.balance.itemCode; - var locationCode = result.balance.locationCode; - var inventoryStatus = result.balance.inventoryStatus; + var packingNumber = result.label.packingNumber; + var batch = result.label.batch; + var qty = result.label.qty; + var itemCode = result.label.itemCode; + var locationCode = result.fromLocationCode; + var inventoryStatus = "OK"; var detail = this.detailSource.find(r => r.itemCode == itemCode); if (detail == undefined) { @@ -270,53 +271,63 @@ r.batch == batch && r.fromLocationCode == result.fromLocationCode }) + if (itemDetail == undefined) { - this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result - .fromLocationCode + "】不在列表中") - } else { - if (itemDetail.scaned) { - this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result - .fromLocationCode + "】已经扫描") - } else { - let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); - let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); - if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { - if (this.jobContent.allowModifyInventoryStatus == "TRUE") { - this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + - itemStatus + - ']不一致,是否继续上架?', res => { - if (res) { - itemDetail.scaned = true; - itemDetail.handleQty = Number(result.balance.qty); - itemDetail.toInventoryStatus = result.balance.inventoryStatus - itemDetail.balance = result.balance; - itemDetail.balance.balanceQty = Number(result.balance.qty); - itemDetail.balance.packQty = Number(result.package.packQty) - itemDetail.balance.packUnit = result.package.packUnit - this.calcHandleQty(); - } else { - this.scanPopupGetFocus(); - } - }); - } else { - this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + - itemStatus + - ']不一致,不允许转移!', res => { - this.scanPopupGetFocus(); - }); + var isExit; + for (let subItem of detail.subList) { + var item; + for (let pack of subItem.packList) { + if (pack.packingNumber == packingNumber && + pack.batch == batch) { + item = pack; + isExit = pack; + break; } - + } + if (item != undefined) { + subItem.scaned = true + subItem.handleQty = 0; + item=undefined + } + } + if(isExit == undefined){ + this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result + .fromLocationCode + "】不在列表中") + }else { + if (isExit.scaned) { + this.showMessage("箱码【" + packingNumber + "】已经扫描") } else { - itemDetail.scaned = true; - itemDetail.handleQty = Number(result.balance.qty); - itemDetail.toInventoryStatus = itemDetail.inventoryStatus - itemDetail.balance = result.balance; - itemDetail.balance.balanceQty = Number(result.balance.qty); - itemDetail.balance.packQty = Number(result.package.packQty) - itemDetail.balance.packUnit = result.package.packUnit - this.calcHandleQty(); + isExit.scaned = true + isExit.handleQty = Number(result.label.qty); + isExit.toLocationCode = this.toLocationCode; } } + calcTreeHandleQty(this.detailSource); + this.$forceUpdate() + } else { + var scanedLength =0; + itemDetail.packList.forEach(res=>{ + if(res.scaned){ + scanedLength++; + } + }) + if (itemDetail.scaned&&scanedLength==itemDetail.packList.length) { + this.showMessage("箱码【" + packingNumber + "】已经扫描") + } else { + itemDetail.scaned = true; + this.detailSource[0].subList.sort(compareAsc('scaned')); //按扫描信息排序 + itemDetail.handleQty = result.label.qty; + itemDetail.toInventoryStatus = "OK" + itemDetail.packList.forEach(pac => { + pac.scaned = true + pac.handleQty = Number(pac.qty); + pac.toLocationCode = this.toLocationCode; + }) + + calcTreeHandleQty(this.detailSource); + this.continueScan() + this.$forceUpdate() + } } } } catch (e) { @@ -436,13 +447,20 @@ detail.toPackingNumber = info.packingNumber; detail.toBatch = info.batch; detail.toContainerNumber = ''; - - detail.singlePrice = detail.balance.singlePrice; - detail.amount = detail.balance.singlePrice * detail.handleQty; - - detail.arriveDate = detail.balance.arriveDate; - detail.produceDate = detail.balance.produceDate; - detail.expireDate = detail.balance.expireDate; + + detail.singlePrice = 1; + detail.amount = 11; + + detail.arriveDate = getCurrDateTime(); + detail.produceDate = getCurrDateTime(); + detail.expireDate = getCurrDateTime(); + + // detail.singlePrice = detail.balance.singlePrice; + // detail.amount = detail.balance.singlePrice * detail.handleQty; + + // detail.arriveDate = detail.balance.arriveDate; + // detail.produceDate = detail.balance.produceDate; + // detail.expireDate = detail.balance.expireDate; subList.push(detail) } }) diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue index be7af0be..a6c1680f 100644 --- a/src/pages/putaway/record/putawayRecord.vue +++ b/src/pages/putaway/record/putawayRecord.vue @@ -15,10 +15,10 @@ - - + @@ -76,7 +76,7 @@ getBusinessType, createItemInfo, createDetailInfo, - calcHandleQty + calcTreeHandleQty } from '@/common/record.js'; import { @@ -92,7 +92,8 @@ import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' - + import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' + export default { components: { winScanButton, @@ -101,7 +102,8 @@ comBlankView, winScanLocation, winScanPackAndLocation, - recordComDetailCard + recordComDetailCard, + recordDetailCard }, data() { return { @@ -168,32 +170,29 @@ newDetail.toLocationCode = toLocation.code; newDetail.toWarehouseCode = toLocation.warehouseCode; itemp.subList.push(newDetail); + var dataList = pack.subList this.detailSource.push(itemp) + this.detailSource.forEach(res=>{ + res.subList.forEach(pack=>{ + pack.packList = dataList.filter(c=>c.parentNumber==pack.packingNumber) + pack.packList.forEach(pac=>{ + pac.parentPackingNumber =pac.parentNumber; + pac.packingNumber =pac.number; + pac.inventoryStatus="OK"; + pac.scaned=true; + }) + }) + }) }) } else { - var detail = item.subList.find(r => { - if (r.packingNumber == balance.packingNumber && - r.batch == balance.batch && - r.locationCode == balance.locationCode && - r.inventoryStatus == balance.inventoryStatus) { - return r; - } - }) - if (detail == undefined) { - this.getRecommendLocation(balance, pack, toLocation => { - let newDetail = createDetailInfo(balance, pack); - newDetail.toLocationCode = toLocation.code; - newDetail.toWarehouseCode = toLocation.warehouseCode; - item.subList.push(newDetail); - }); - } else { - if (detail.scaned == true) { + var itemDetail = item.subList.find(r => r.packingNumber == balance.packingNumber && r.batch == + balance.batch); + if(itemDetail!=undefined){ this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") } - } } - this.calcHandleQty(); + // calcTreeHandleQty(this.detailSource); }, //获取推荐库位 @@ -235,7 +234,7 @@ }); }, - calcHandleQty() { + calcTreeHandleQty() { for (let item of this.detailSource) { item.qty = 0; for (let detail of item.subList) { @@ -248,7 +247,7 @@ }, updateData() { - this.calcHandleQty(); + this.calcTreeHandleQty(); }, removeItem(index, item) { @@ -449,7 +448,7 @@ }, updateData() { - this.calcHandleQty(); + // this.calcTreeHandleQty(); for (var i = 0; i < this.detailSource.length; i++) { let item = this.detailSource[i]; if (item.qty == 0) {