From 085868a42b06cf12355afa9c2bd3fb7e02ea0656 Mon Sep 17 00:00:00 2001 From: niexiting <85552560@qq.com> Date: Fri, 2 Aug 2024 14:48:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E9=A2=84=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/array.js | 21 ++++- src/common/record.js | 55 ++++++----- .../record/recordComDetailCard.vue | 26 ++++- src/mycomponents/scan/winScanPackage.vue | 18 +++- .../record/productPutawayRecord.vue | 94 ++++++++++++------- 5 files changed, 147 insertions(+), 67 deletions(-) diff --git a/src/common/array.js b/src/common/array.js index ed1cf95d..91363cf2 100644 --- a/src/common/array.js +++ b/src/common/array.js @@ -278,6 +278,25 @@ export function getEditRemoveOption() { } +//详情编辑移除 +export function getEditLocationRemoveOption() { + let option_edit_remove = [{ + text: '修改\n库位', + style: { + backgroundColor: '#F1A532' + } + }, + { + text: '移除', + style: { + backgroundColor: '#F56C6C' + } + } + ]; + return option_edit_remove; +} + + // 库存状态字典项 export function getInventoryStatusArray() { let array = [{ @@ -333,4 +352,4 @@ export function getLocationTypeArray(data) { } return list -} +} \ No newline at end of file diff --git a/src/common/record.js b/src/common/record.js index af79a00d..c13c1471 100644 --- a/src/common/record.js +++ b/src/common/record.js @@ -5,11 +5,15 @@ import { import { getDirectoryItemArray, } from '@/common/directory.js'; -import { calc } from '@/common/calc' -import { Decimal } from 'decimal.js';//引入 - import { - deepCopyData - } from '@/common/basic.js'; +import { + calc +} from '@/common/calc' +import { + Decimal +} from 'decimal.js'; //引入 +import { + deepCopyData +} from '@/common/basic.js'; export function createItemInfo(balance, pack) { let item = { @@ -18,10 +22,13 @@ export function createItemInfo(balance, pack) { packQty: pack.packQty, packUnit: pack.packUnit, qty: new Decimal(balance.qty).toNumber(), - handleQty:new Decimal(0).toNumber(), + handleQty: new Decimal(0).toNumber(), uom: pack.uom, - subList: [] + subList: [], + // packingNumber: pack.number, + // parentPackingNumber: pack.parentNumber, } + item.containerNumber = pack.parentNumber != null ? pack.parentNumber : pack.number; return item; } @@ -34,7 +41,7 @@ export function createDetailInfo(balance, pack) { detail.qty = new Decimal(detail.qty).toNumber(); detail.packQty = new Decimal(pack.packQty).toNumber() detail.packUnit = pack.packUnit - detail.handleQty = new Decimal(detail.qty).toNumber() ; + detail.handleQty = new Decimal(detail.qty).toNumber(); detail.package = pack; detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的 detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的 @@ -48,11 +55,11 @@ export function calcHandleQty(detailSource) { item.handleQty = new Decimal(0).toNumber(); item.qty = new Decimal(0).toNumber(); for (let detail of item.subList) { - if(detail!=undefined){ - if(detail.scaned){ - item.handleQty = calc.add(item.handleQty,detail.handleQty); + if (detail != undefined) { + if (detail.scaned) { + item.handleQty = calc.add(item.handleQty, detail.handleQty); } - item.qty = calc.add(item.qty,detail.qty); + item.qty = calc.add(item.qty, detail.qty); } } } @@ -61,13 +68,13 @@ 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); + 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); @@ -80,10 +87,10 @@ export function getBusinessType(typeCode, callback) { let result = { success: true, businessType: '', - fromLocationAreaTypeList:'', - toLocationAreaTypeList:'', - itemCodeTypeList:"", - useOnTheWay:"FALSE", + fromLocationAreaTypeList: '', + toLocationAreaTypeList: '', + itemCodeTypeList: "", + useOnTheWay: "FALSE", fromInventoryStatuses: '', toInventoryStatuses: '', message: '' @@ -91,12 +98,12 @@ export function getBusinessType(typeCode, callback) { getBusinesstypeByCode(typeCode).then(res => { if (res.data.total > 0) { result.businessType = res.data.list[0]; - result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes) ; - result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes) ; + result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes); + result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes); result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes) result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses; result.toInventoryStatuses = res.data.list[0].inInventoryStatuses; - result.useOnTheWay =res.data.list[0].useOnTheWay + result.useOnTheWay = res.data.list[0].useOnTheWay callback(result) } else { result.success = false; @@ -108,4 +115,4 @@ export function getBusinessType(typeCode, callback) { result.message = error; callback(result) }) -} +} \ No newline at end of file diff --git a/src/mycomponents/record/recordComDetailCard.vue b/src/mycomponents/record/recordComDetailCard.vue index ee19e0bb..a0e9aa4c 100644 --- a/src/mycomponents/record/recordComDetailCard.vue +++ b/src/mycomponents/record/recordComDetailCard.vue @@ -7,6 +7,10 @@ + + + + @@ -40,11 +44,14 @@ import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue' import location from '@/mycomponents/balance/location.vue' import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue' + import pack from '@/mycomponents/balance/pack.vue' + import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' import { getDetailOption, getDetailEditRemoveOption, - getClearOption + getClearOption, + getEditLocationRemoveOption } from '@/common/array.js'; export default { components: { @@ -55,7 +62,9 @@ balanceDetailPopup, purchaseLabel, location, - recordDetailPopup + recordDetailPopup, + pack, + PackageAndItemCard // winListHint }, props: { @@ -124,19 +133,21 @@ mounted() { this.detailOptions = getDetailOption(); this.scanOptions = getDetailEditRemoveOption(); - this.removeOptions = getClearOption(); + this.removeOptions = getEditLocationRemoveOption(); }, methods: { removeItem(e, dataContent) { - if (e.content.text == "清空") { + if (e.content.text == "移除") { this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?", res => { if (res) { - this.$emit('removeItem') + this.$emit('removeItem',dataContent) // this.$emit('removeItem', this.dataContent) } }); + } else { + this.editLocation(dataContent) } }, swipeClick(e, item, index) { @@ -169,6 +180,11 @@ }); }, + editLocation(item) { + this.editItem = item; + this.$emit('editLocation', item) + }, + confirm(qty) { // this.editItem.qty = qty; this.editItem.handleQty = qty; diff --git a/src/mycomponents/scan/winScanPackage.vue b/src/mycomponents/scan/winScanPackage.vue index a2d698dc..a710f171 100644 --- a/src/mycomponents/scan/winScanPackage.vue +++ b/src/mycomponents/scan/winScanPackage.vue @@ -128,14 +128,14 @@ value: this.businessType.outInventoryStatuses }) } - if (this.businessType.outAreaTypes != null){ + if (this.businessType.outAreaTypes != null) { filters.push({ column: "areaType", action: "in", value: this.businessType.outAreaTypes }) } - if (this.businessType.outAreaCodes != null){ + if (this.businessType.outAreaCodes != null) { filters.push({ column: "areaCode", action: "in", @@ -172,7 +172,16 @@ pageSize: 100, } getBalanceByFilter(params).then(res => { - if (res.data.list.length == 0) { + if (res.data.list.length > 0) { + res.data.list.forEach(r => { + if (packageInfo.parentNumber !== null) { + r.parentPackingNumber = packageInfo.parentNumber + } else { + r.parentPackingNumber = packageInfo.number + } + }) + callback(res.data.list) + } else { //如果扫描的是托标签,按托标签没查找到库存再按托标签下的子标签查询库存 if (packageInfo.subList.length > 0) { let packparams = ''; @@ -194,6 +203,7 @@ this.packGetFocus(); }) } else { + res1.data.list.forEach(r => r.parentPackingNumber = packageInfo.number) callback(res1.data.list) } }).catch(err => { @@ -204,8 +214,6 @@ this.packGetFocus(); }) } - } else { - callback(res.data.list) } }).catch(err => { this.showErrorMessage(err.message); diff --git a/src/pages/productPutaway/record/productPutawayRecord.vue b/src/pages/productPutaway/record/productPutawayRecord.vue index 7bfe2254..ec7975ed 100644 --- a/src/pages/productPutaway/record/productPutawayRecord.vue +++ b/src/pages/productPutaway/record/productPutawayRecord.vue @@ -11,10 +11,9 @@ + @updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"> - @@ -23,10 +22,12 @@ - + + @@ -34,13 +35,16 @@ +