From af89e8740ca25b8ee79e4c07b3c4ff8ebc9bb32b Mon Sep 17 00:00:00 2001 From: guoshuang Date: Tue, 21 Jun 2022 11:32:50 +0800 Subject: [PATCH] =?UTF-8?q?cosmoim-852=20fix=20=E4=BF=84=E7=BD=97=E6=96=AF?= =?UTF-8?q?=E6=8B=A3=E9=85=8D=E4=BB=A3=E7=A0=81=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=A5=E5=8F=8A=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../raw/handover/RUS-picking/ByOrder.vue | 144 ++- .../raw/handover/RUS-picking/BySummary.vue | 1140 ++++++++--------- 2 files changed, 644 insertions(+), 640 deletions(-) diff --git a/src/pages/raw/handover/RUS-picking/ByOrder.vue b/src/pages/raw/handover/RUS-picking/ByOrder.vue index fe3c447..a1ab357 100644 --- a/src/pages/raw/handover/RUS-picking/ByOrder.vue +++ b/src/pages/raw/handover/RUS-picking/ByOrder.vue @@ -181,6 +181,7 @@ export default class RawReceiptDetail extends BasePage { this.LocationList = []; this.qty = ''; this.Barcode = ''; + //不在推荐库位,所以注掉 //根据选择一行数据查询库位 // await this.model.queryItemLoc({ // workArea: session.workareaCode, @@ -207,10 +208,10 @@ export default class RawReceiptDetail extends BasePage { this.customToast(this.$t('message.barcode') as string); return; } - if (!this.some) { - this.customToast(this.$t('message.AppendMateriel6') as string); - return; - } + if (JSON.stringify(this.some) == '{}') { + this.customToast(this.$t('message.Commission_tips6') as any); + return; + } await this.model.searchBarcode({ factoryCode: session.factoryCode, loginName: session.loginName, barcode: this.Barcode, productCode: this.some.materialCode }); this.Container = this.model.ContainerCode; @@ -256,84 +257,87 @@ export default class RawReceiptDetail extends BasePage { this.customToast(this.$t('message.Commission_tips7') as any); return (isTrue = false); } - allqty += parseFloat(item.qty); + //本次输入容器码与下面容器码相同的所有qty的和,用于最大可添加数量校验 + if (this.Barcode == item.barcode) { + allqty += parseFloat(item.qty); + } }); + //下面表格有数据情况下,添加一个时,最大可添加数量校验 if (allqty + parseFloat(this.qty) > parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4)) { this.customToast(this.$t('message.Pi_tip20') as any); return (isTrue = false); } } else { + //下面表格没数据时,添加一个时,最大可添加数量校验 if (parseFloat(this.qty) > parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4)) { this.customToast(this.$t('message.Pi_tip20') as any); return (isTrue = false); } } if (isTrue == true) { - let arr = { - wlCode: this.wlCode.label, - qty: this.qty, - Code: this.wlCode.sendSpot, - barcode: this.Barcode, - }; - this.LocationList.push(arr); - let objString = JSON.stringify(this.some); - let TEM = JSON.parse(objString); - TEM.wlList = null; - TEM.wlCode = this.wlCode.label; - TEM.qty = this.qty; - TEM.barcode = this.Barcode; - this.model.aggregateList[this.someIndex].wlList.push(TEM); - this.model.aggregateList[this.someIndex].currentAmount += parseFloat(this.qty); - this.qty = ''; - // if (parseFloat(this.qty) + parseFloat(this.some.totalMoAmount) > parseFloat(this.some.amount)) { - // uni.showModal({ - // title: 'Tip', - // content: this.$t('message.Pi_tip11') as string, - // confirmText: this.$t('message.workArea_Confirm') as string, - // cancelText: this.$t('message.Cancel') as string, - // showCancel: true, - // success: (res) => { - // if (res.confirm) { - // let arr = { - // wlCode: this.wlCode.label, - // qty: this.qty, - // Code: this.wlCode.sendSpot, - // xxxx: this.form.xxxx, - // }; - // this.LocationList.push(arr); - // let objString = JSON.stringify(this.some); - // let TEM = JSON.parse(objString); - // TEM.wlList = null; - // TEM.wlCode = this.wlCode.label; - // TEM.qty = this.qty; - // TEM.xxxx = this.form.xxxx; - // //add之后有什么操作 - // this.model.proOrderResultList[this.someIndex].wlList.push(TEM); - // this.model.proOrderResultList[this.someIndex].currentAmount += parseFloat(this.qty); - // this.qty = ''; - // this.form.xxxx = ''; - // } - // }, - // }); - // } else { - // let arr = { - // wlCode: this.wlCode.label, - // qty: this.qty, - // Code: this.wlCode.sendSpot, - // xxxx: this.form.xxxx, - // }; - // this.LocationList.push(arr); - // let objString = JSON.stringify(this.some); - // let TEM = JSON.parse(objString); - // TEM.wlList = null; - // TEM.wlCode = this.wlCode.label; - // TEM.qty = this.qty; - // TEM.xxxx = this.form.xxxx; - // this.model.proOrderResultList[this.someIndex].wlList.push(TEM); - // this.model.proOrderResultList[this.someIndex].currentAmount += parseFloat(this.qty); - // this.qty = ''; - // this.form.xxxx = ''; - // } + // let arr = { + // wlCode: this.wlCode.label, + // qty: this.qty, + // Code: this.wlCode.sendSpot, + // barcode: this.Barcode, + // }; + // this.LocationList.push(arr); + // let objString = JSON.stringify(this.some); + // let TEM = JSON.parse(objString); + // TEM.wlList = null; + // TEM.wlCode = this.wlCode.label; + // TEM.qty = this.qty; + // TEM.barcode = this.Barcode; + // this.model.aggregateList[this.someIndex].wlList.push(TEM); + // this.model.aggregateList[this.someIndex].currentAmount += parseFloat(this.qty); + // this.qty = ''; + if (parseFloat(this.qty) + parseFloat(this.some.totalMoAmount) > parseFloat(this.some.amount)) { + uni.showModal({ + title: 'Tip', + content: this.$t('message.Pi_tip11') as string, + confirmText: this.$t('message.workArea_Confirm') as string, + cancelText: this.$t('message.Cancel') as string, + showCancel: true, + success: (res) => { + if (res.confirm) { + let arr = { + wlCode: this.wlCode.label, + qty: this.qty, + Code: this.wlCode.sendSpot, + barcode: this.Barcode, + }; + this.LocationList.push(arr); + let objString = JSON.stringify(this.some); + let TEM = JSON.parse(objString); + TEM.wlList = null; + TEM.wlCode = this.wlCode.label; + TEM.qty = this.qty; + TEM.barcode = this.Barcode; + //add之后有什么操作 + this.model.proOrderResultList[this.someIndex].wlList.push(TEM); + this.model.proOrderResultList[this.someIndex].currentAmount += parseFloat(this.qty); + this.qty = ''; + } + }, + }); + } else { + let arr = { + wlCode: this.wlCode.label, + qty: this.qty, + Code: this.wlCode.sendSpot, + barcode: this.Barcode, + }; + this.LocationList.push(arr); + let objString = JSON.stringify(this.some); + let TEM = JSON.parse(objString); + TEM.wlList = null; + TEM.wlCode = this.wlCode.label; + TEM.qty = this.qty; + TEM.barcode = this.Barcode; + this.model.proOrderResultList[this.someIndex].wlList.push(TEM); + this.model.proOrderResultList[this.someIndex].currentAmount += parseFloat(this.qty); + this.qty = ''; + } } } deleteItem(index: any) { diff --git a/src/pages/raw/handover/RUS-picking/BySummary.vue b/src/pages/raw/handover/RUS-picking/BySummary.vue index 8b8bdfc..79b73a7 100644 --- a/src/pages/raw/handover/RUS-picking/BySummary.vue +++ b/src/pages/raw/handover/RUS-picking/BySummary.vue @@ -1,92 +1,92 @@