From 216a67e5e3a974baf1c8ee0e3f2792b4b08e33ba Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Thu, 11 Jan 2024 13:23:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E8=BD=AC?= =?UTF-8?q?=E7=A7=BB=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/inventoryMove/coms/comMoveRecord.vue | 104 ++++++++++-------- pages/inventoryMove/coms/comMovebalance.vue | 12 +- .../inventoryMove/record/oktoScrapRecord.vue | 2 +- 3 files changed, 65 insertions(+), 53 deletions(-) diff --git a/pages/inventoryMove/coms/comMoveRecord.vue b/pages/inventoryMove/coms/comMoveRecord.vue index 14e52727..7d835a77 100644 --- a/pages/inventoryMove/coms/comMoveRecord.vue +++ b/pages/inventoryMove/coms/comMoveRecord.vue @@ -23,7 +23,7 @@ style="background-color:ghostwhite; width: 100%; "> + :locationTypeList="tolocationTypeList" :isShowEdit="isShowEditLocation"> @@ -63,7 +63,8 @@ } from '@/common/balance.js'; import { - getPackingNumberAndBatchByList + getPackingNumberAndBatchByList, + deepCopyData } from '@/common/basic.js'; import { @@ -124,6 +125,7 @@ dataContent: {}, fromlocationTypeList: [], tolocationTypeList: [], + isShowEditLocation:false } }, @@ -139,29 +141,11 @@ } }); this.initData(); + this.getLocationInfo(); }, onLoad() { - if (this.toLocationCode != '') { - getBasicLocationByCode(this.toLocationCode).then(res => { - if (res.data.total > 0) { - let result = res.data.list[0]; - var type = result.type; - var available = result.available; - if (available == "TRUE") { - this.toLocationInfo = res.data.list[0]; - } else { - this.showErrorMessage("扫描库位[" + this.code + "]不可用") - } - } else { - this.showErrorMessage('库位[' + this.toLocationCode + ']不存在') - } - - }).catch(error => { - uni.hideLoading(); - this.showErrorMessage(error) - }) - } + }, methods: { @@ -170,10 +154,12 @@ this.title = "库存转移记录"; this.toInventoryStatus = "" this.toLocationCode = "" + this.isShowEditLocation =true; } else if (this.businessTypeCode == "HoldToOk") { this.title = "隔离转合格记录"; this.toInventoryStatus = "OK" - this.toLocationCode = "OK" + this.toLocationCode = "" + this.isShowEditLocation =true; } else if (this.businessTypeCode == "HoldToScrap") { this.title = "隔离转报废记录"; this.toInventoryStatus = "SCRAP" @@ -182,10 +168,10 @@ this.title = "合格转隔离记录"; this.toInventoryStatus = "HOLD" this.toLocationCode = "HOLD" - } else if (this.businessTypeCode == "OktoScrap") { + } else if (this.businessTypeCode == "OkToScrap") { this.title = "合格转报废记录"; this.toInventoryStatus = "SCRAP" - this.toLocationCode = "HOLD" + this.toLocationCode = "SCRAP" } else if (this.businessTypeCode == "ScrapToHold") { this.title = "报废转隔离记录"; this.toInventoryStatus = "HOLD" @@ -195,6 +181,29 @@ title: this.title }) }, + getLocationInfo(){ + if (this.toLocationCode != "") { + getBasicLocationByCode(this.toLocationCode).then(res => { + if (res.data.total > 0) { + let result = res.data.list[0]; + var type = result.type; + var available = result.available; + if (available == "TRUE") { + this.toLocationInfo = res.data.list[0]; + } else { + this.showErrorMessage("扫描库位[" + this.code + "]不可用") + } + } else { + this.showErrorMessage('库位[' + this.toLocationCode + ']不存在') + } + + }).catch(error => { + uni.hideLoading(); + this.showErrorMessage(error) + }) + } + }, + openScanPopup() { if (this.fromLocationCode == "") { this.showFromLocationPopup(); @@ -230,13 +239,14 @@ // newDetail.inventoryStatus = balance.inventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toLocationCode = this.toLocationCode; + newDetail.fromLocationCode = result.fromLocationCode itemp.subList.push(newDetail); this.detailSource.push(itemp) } else { var detail = item.subList.find(r => { if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && - r.locationCode == balance.locationCode && + r.fromLocationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus && r.scaned == true) { return r; @@ -248,6 +258,7 @@ // newDetail.inventoryStatus = balance.inventoryStatus; newDetail.toInventoryStatus = this.toInventoryStatus; newDetail.toLocationCode = this.toLocationCode; + newDetail.fromLocationCode = result.fromLocationCode item.subList.push(newDetail); } else { this.showErrorMessage(balance.packingNumber + "已经在列表中") @@ -326,7 +337,7 @@ inventoryMoveRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { - this.showCommitSuccessMessage("提交成功
生成" + this.title + "记录
" + + this.showCommitSuccessMessage("提交成功
生成" + this.title + "
" + res.data) } else { this.showErrorMessage("提交失败[" + res.msg + "]") @@ -386,32 +397,33 @@ if (detail.scaned) { var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch); - var subItem = {}; - Object.assign(subItem, detail) - subItem.itemCode = detail.itemCode; - subItem.itemName = detail.package.itemName; - subItem.itemDesc1 = detail.package.itemDesc1; - subItem.itemDesc2 = detail.package.itemDesc2; + var submitItem = deepCopyData(detail) + submitItem.itemCode = detail.itemCode; + submitItem.itemName = detail.package.itemName; + submitItem.itemDesc1 = detail.package.itemDesc1; + submitItem.itemDesc2 = detail.package.itemDesc2; - subItem.fromInventoryStatus = detail.inventoryStatus; - subItem.toInventoryStatus = detail.toInventoryStatus; + submitItem.fromInventoryStatus = detail.inventoryStatus; + submitItem.toInventoryStatus = detail.toInventoryStatus; - subItem.fromPackingNumber = info.packingNumber; - subItem.toPackingNumber = info.packingNumber; + submitItem.fromPackingNumber = info.packingNumber; + submitItem.toPackingNumber = info.packingNumber; - subItem.fromContainerNumber = detail.containerNumber; - subItem.toContainerNumber = detail.containerNumber + submitItem.fromContainerNumber = detail.containerNumber; + submitItem.toContainerNumber = detail.containerNumber - subItem.fromBatch = info.batch; - subItem.toBatch = info.batch; + submitItem.fromBatch = info.batch; + submitItem.toBatch = info.batch; - subItem.fromLocationCode = detail.locationCode; - subItem.toLocationCode = detail.toLocationCode; + submitItem.fromLocationCode = detail.fromLocationCode; + submitItem.toLocationCode = detail.toLocationCode; - subItem.package = null; - subItem.Records = null; + submitItem.package = null; + submitItem.Records = null; + + submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; - subList.push(subItem) + subList.push(submitItem) } }) }) diff --git a/pages/inventoryMove/coms/comMovebalance.vue b/pages/inventoryMove/coms/comMovebalance.vue index e04d8923..3aebfeb9 100644 --- a/pages/inventoryMove/coms/comMovebalance.vue +++ b/pages/inventoryMove/coms/comMovebalance.vue @@ -6,14 +6,14 @@ - +
- - + + diff --git a/pages/inventoryMove/record/oktoScrapRecord.vue b/pages/inventoryMove/record/oktoScrapRecord.vue index ac309332..dfa24f3a 100644 --- a/pages/inventoryMove/record/oktoScrapRecord.vue +++ b/pages/inventoryMove/record/oktoScrapRecord.vue @@ -1,6 +1,6 @@