From 3e350ede007e727cfa4eff5d6e7a07acbdcf7934 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 26 Dec 2023 19:12:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=86=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/package/record/mergePackageRecord.vue | 10 +- pages/package/record/splitPackageRecord.vue | 125 ++++++++++++------ .../record/productPutawayRecord.vue | 2 - 3 files changed, 89 insertions(+), 48 deletions(-) diff --git a/pages/package/record/mergePackageRecord.vue b/pages/package/record/mergePackageRecord.vue index a7d2e512..87e3ebc8 100644 --- a/pages/package/record/mergePackageRecord.vue +++ b/pages/package/record/mergePackageRecord.vue @@ -9,7 +9,7 @@ - @@ -89,7 +89,6 @@ return { id: '', scanCount: 0, - jobContent: {}, //任务内容 detailSource: [], //绑定在页面上的数据源 locationTypeList: [], fromLocationCode: "", @@ -244,7 +243,7 @@ mergePackageRecordSubmit(params).then(res => { uni.hideLoading() if (res.data) { - this.showCommitSuccessMessage("提交成功
生成发料接收记录" + res.data) + this.showCommitSuccessMessage("提交成功
生成合包记录
" + res.data) } else { this.showErrorMessage("提交失败[" + res.msg + "]") } @@ -272,8 +271,8 @@ detail.fromInventoryStatus = detail.inventoryStatus; detail.toInventoryStatus = detail.inventoryStatus; - - detail.fromPackingNumber = detail.fromPackingNumber; + detail.fromQty = detail.qty + detail.fromPackingNumber = detail.packingNumber; detail.toPackingNumber = this.toPackingNumber; detail.fromBatch = detail.batch; @@ -325,6 +324,7 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { + this.detailSource = [] this.fromLocationCode = ''; this.toPackingNumber ="" this.toBatch ="" diff --git a/pages/package/record/splitPackageRecord.vue b/pages/package/record/splitPackageRecord.vue index 3165e0ed..3d17eeaf 100644 --- a/pages/package/record/splitPackageRecord.vue +++ b/pages/package/record/splitPackageRecord.vue @@ -27,13 +27,14 @@
+ + - + - @@ -43,6 +44,9 @@ import { goHome, } from '@/common/basic.js'; + import { + splitPackageRecordSubmit + } from '@/api/request2.js'; import { getInventoryStatusDesc, @@ -87,27 +91,28 @@ locationTypeList: [], fromLocationCode: "", toLocationCode: "", - isShowLocation: false, fromlocationTypeList: [], tolocationTypeList: [], - allowModifyLocation: false, inInventoryStatus: "", //目标入库库存状态 outInventoryStatus: "", //来源出库库存状态 - businessType: {} + businessType: {}, + dataContent: {}, + currentItemCode: "", + toPackingNumber: "" }; }, onLoad(option) { - // var typeCode = "SplitPackage" - // getBusinessType(typeCode, res => { - // if (res.success) { - // this.businessType = res.businessType; - // this.fromlocationTypeList = res.fromlocationTypeList; - // this.tolocationTypeList = res.tolocationTypeList; - // this.showFromLocationPopup(); - // } else { - // this.$refs.comMessage.showBreakMessage(res.message); - // } - // }); + var typeCode = "SplitPackage" + getBusinessType(typeCode, res => { + if (res.success) { + this.businessType = res.businessType; + this.fromlocationTypeList = res.fromlocationTypeList; + this.tolocationTypeList = res.tolocationTypeList; + this.showFromLocationPopup(); + } else { + this.showErrorMessage(res.message) + } + }); }, //返回首页 onNavigationBarButtonTap(e) { @@ -121,7 +126,7 @@ onPullDownRefresh() {}, mounted() { - this.showFromLocationPopup(); + // this.showFromLocationPopup(); }, methods: { showScanPopupPack() { @@ -160,7 +165,7 @@ var uom = result.package.uom; var item = this.detailSource.find(r => r.itemCode == itemCode); if (item == undefined) { - this.showMessage("物料号【" + itemCode + "】不在列表中") + this.showErrorMessage("物料号【" + itemCode + "】不在列表中") } else { var temp = { scaned: true, @@ -248,32 +253,67 @@ }, commit() { - if (this.toLocationCode == "") { - this.showMessage("请先选择目标库位") - return; + if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { + uni.showLoading({ + title: "提交中....", + mask: true + }); + + var params = this.setParams(); + console.log("提交" + JSON.stringify(params)) + splitPackageRecordSubmit(params).then(res => { + uni.hideLoading() + if (res.data) { + this.showCommitSuccessMessage("提交成功
生成拆包记录
" + res.data) + } else { + this.showErrorMessage("提交失败[" + res.msg + "]") + } + }).catch(error => { + uni.hideLoading() + this.showErrorMessage(error) + }) + } else { + this.showErrorMessage("没有要提交的数据") } - //允许部分提交 - uni.showLoading({ - title: "提交中....", - mask: true - }); - var params = this.setParams(); - console.log("提交" + JSON.stringify(params)) - // (this.id, params).then(res => { - // uni.hideLoading() - // if (res.data) { - // var hint = res.data.Number; - // this.showCommitSuccessMessage("提交成功" + hint, ) - - // } else { - // this.showErrorMessage("提交失败[" + res.msg + "]") - // } - // }).catch(error => { - // uni.hideLoading() - // this.showErrorMessage(error) - // }) + }, + + setParams() { + + var subList = [] + var creator = this.$store.state.user.id + this.detailSource.forEach(item => { + item.subList.forEach(detail => { + detail.Records.forEach(record => { + if (record.scaned) { + var subItem = {}; + Object.assign(subItem, detail) + subItem.itemCode = subItem.itemCode; + subItem.itemName = detail.package.itemName; + subItem.itemDesc1 = detail.package.itemDesc1; + subItem.itemDesc2 = detail.package.itemDesc2; + + subItem.fromInventoryStatus = subItem.inventoryStatus; + subItem.toInventoryStatus = subItem.inventoryStatus; + subItem.fromQty = subItem.qty + subItem.fromPackingNumber = subItem.packingNumber; + subItem.toPackingNumber = record.packingNumber; + + subItem.fromBatch = subItem.batch; + subItem.toBatch = record.batch; + subItem.fromLocationCode = subItem.fromLocationCode; + subItem.package = "" + subItem.Records="" + subList.push(subItem) + } + + }) + }) + }) + this.dataContent.subList = subList; + this.dataContent.creator = creator; + return this.dataContent; }, showMessage(message) { @@ -320,7 +360,10 @@ showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, res => { + this.detailSource = [] this.fromLocationCode = ''; + this.currentItemCode = "" + this.dataContent = {} }) }, diff --git a/pages/productPutaway/record/productPutawayRecord.vue b/pages/productPutaway/record/productPutawayRecord.vue index 1ffe223d..b29a2738 100644 --- a/pages/productPutaway/record/productPutawayRecord.vue +++ b/pages/productPutaway/record/productPutawayRecord.vue @@ -18,8 +18,6 @@
- -