diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index 53638a6..668dc72 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -182,6 +182,7 @@ export default { Pi_tip16: '只能选择一个DN单', Pi_tip17: '请选择一条DN单', Pi_tip18: '请选中要移库的数据', + Pi_tip19: '只能选择一条修改数量', //汇总交接 Summary_Query: '汇总查询', Summary_Contain: '包含', diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 1588110..57bec3b 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -32,6 +32,7 @@ export default { Pi_tip16: 'You can only select one DN list', Pi_tip17: 'Please select a dn list', Pi_tip18: 'Please select the data to be moved', + Pi_tip19: 'Only one item can be selected to modify the quantity', //版本更新 updatePrompt: 'Update tips', Tip1: 'New version detected, update?', diff --git a/src/pages/product/warehouse/wholeScrap/index.vue b/src/pages/product/warehouse/wholeScrap/index.vue index 59cf5b9..8b9388c 100644 --- a/src/pages/product/warehouse/wholeScrap/index.vue +++ b/src/pages/product/warehouse/wholeScrap/index.vue @@ -160,7 +160,7 @@ export default class productCheckReceipt extends BasePage { }; await this.model.queryScrapList(param); if (this.model.code == '1') { - this.customToast(this.$t('message.product_Tip8') as string); + //this.customToast(this.$t('message.product_Tip8') as string); this.model.recordsList.forEach((item: any) => { item.fileNo = ' '; }); diff --git a/src/pages/raw/handover/virtual/result.vue b/src/pages/raw/handover/virtual/result.vue index d71b4f3..2791956 100644 --- a/src/pages/raw/handover/virtual/result.vue +++ b/src/pages/raw/handover/virtual/result.vue @@ -58,13 +58,13 @@ export default class AggregatingResult extends BasePage { * 汇总 */ async onVirtual() { - const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId); - const params = { - factoryCode: session.factoryCode, - loginName: session.loginName, - orderOutIdList, - }; - await this.model.querySummaryList(params); + // const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId); + // const params = { + // factoryCode: session.factoryCode, + // loginName: session.loginName, + // orderOutIdList, + // }; + // await this.model.querySummaryList(params); this.toPage(this.page.raw.handover.virtual.summary); } } diff --git a/src/pages/raw/handover/virtual/summary.vue b/src/pages/raw/handover/virtual/summary.vue index 8354558..6ff8f0a 100644 --- a/src/pages/raw/handover/virtual/summary.vue +++ b/src/pages/raw/handover/virtual/summary.vue @@ -8,7 +8,7 @@ - + @@ -19,8 +19,8 @@ --> - - + + @@ -143,7 +143,7 @@ export default class VirtualSummary extends BasePage { } beforeDestroy() { - if (model.summaryList.length > 0 && !this.isBusinessFinished) { + if (model.proOrderResultList.length > 0 && !this.isBusinessFinished) { this.unlock(); } } @@ -174,12 +174,13 @@ export default class VirtualSummary extends BasePage { this.$amountForm.validate(async (valid) => { if (!valid) return; // 检查 - const firstRecord = model.summaryList[0]; + const firstRecord = model.proOrderResultList[0]; if (firstRecord === undefined) { this.customToast(this.$t('message.LBWK') as string); return; } console.log('firstRecord', firstRecord); + ///此接口的作用?????? await model.checkAmount({ sapFactoryCode: model.sapFactoryCode, loginName: session.loginName as string, @@ -191,49 +192,55 @@ export default class VirtualSummary extends BasePage { amount: this.amountForm.amount, }); // 改数 - const firstSelection = this.model.summaryList.find((_: any) => _.checked); + const firstSelection = this.model.proOrderResultList.filter((_: any) => _.checked); + console.log('.......????', firstSelection.length); if (firstSelection === undefined) { this.customToast(this.$t('message.Pi_tip7') as string); } else { - const inputAmount = parseFloat(this.amountForm.amount); //本次交接数量 - const totalHvAmount = firstSelection.totalHvAmount; - const demand = firstSelection.amount; //需求数量 - const totalMoAmount = firstSelection.totalMoAmount; //累计拣配数量 - console.log('2222', 2222222222222222222); - if (inputAmount + totalMoAmount > demand) { - this.customToast(this.$t('message.Pi_tip14') as string); + if (firstSelection.length > 1) { + this.customToast(this.$t('message.Pi_tip19') as string); return; - } - console.log(1); - // if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) { - // uni.showToast({ - // icon: 'none', - // title: this.$t('message.Pi_tip8') as string, - // }); - // } - if ( - inputAmount <= 0 - // inputAmount.toString().split(".")[1].length > 3 - ) { - this.customToast(this.$t('message.Pi_tip2') as string); } else { - // model.updateSummaryItem({ - // index: this.model.summaryList.findIndex((_: any) => _.checked), - // newItem: { - // ...firstSelection, - // // oriSendSpot: this.amountForm.oriSendSpot, - // hvAmount: inputAmount, - // }, - // }); - this.model.summaryList.forEach((item: any) => { - if (item.checked) { - item.hvAmount = this.amountForm.amount; - } - }); - uni.showToast({ - icon: 'success', - title: this.$t('message.success') as string, - }); + const inputAmount = parseFloat(this.amountForm.amount); //本次交接数量 + const totalHvAmount = firstSelection[0].totalHvAmount; + const demand = firstSelection[0].amount; //需求数量 + const totalMoAmount = firstSelection[0].totalMoAmount; //累计拣配数量 + console.log('2222', 2222222222222222222); + if (inputAmount + totalMoAmount > demand) { + this.customToast(this.$t('message.Pi_tip14') as string); + return; + } + console.log(1); + // if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) { + // uni.showToast({ + // icon: 'none', + // title: this.$t('message.Pi_tip8') as string, + // }); + // } + if ( + inputAmount <= 0 + // inputAmount.toString().split(".")[1].length > 3 + ) { + this.customToast(this.$t('message.Pi_tip2') as string); + } else { + // model.updateSummaryItem({ + // index: this.model.summaryList.findIndex((_: any) => _.checked), + // newItem: { + // ...firstSelection, + // // oriSendSpot: this.amountForm.oriSendSpot, + // hvAmount: inputAmount, + // }, + // }); + this.model.proOrderResultList.forEach((item: any) => { + if (item.checked) { + item.hvAmount = this.amountForm.amount; + } + }); + uni.showToast({ + icon: 'success', + title: this.$t('message.success') as string, + }); + } } } }); @@ -247,12 +254,12 @@ export default class VirtualSummary extends BasePage { if (valid) { let qtyStase = false; let selectsta = true; - console.log('qqq', model.summaryList); - if (model.summaryList.length === 0) { + console.log('qqq', model.proOrderResultList); + if (model.proOrderResultList.length === 0) { this.customToast(this.$t('message.Pi_tip4') as string); return; } else { - model.summaryList.map((item) => { + model.proOrderResultList.map((item) => { if (!item.checked) { return; } else if (item.hvAmount == 0 || item.hvAmount == null) { @@ -269,7 +276,6 @@ export default class VirtualSummary extends BasePage { } if (qtyStase) { this.customToast(this.$t('message.Summary_PleaseInputNumber') as string); - return; } let res = await auth.checkPassword({ rfPwd: this.submitForm.password, @@ -279,31 +285,40 @@ export default class VirtualSummary extends BasePage { if (res.code != 1) { return; } + let list = []; + console.log('选择是否有标志', model.proOrderResultList); + model.proOrderResultList.forEach((item) => { + if (item.checked) { + list.push(item); + } + }); + console.log("数据。。。",list); await model.uploadSummaryList({ operatorPass: this.submitForm.receiver, factoryCode: session.factoryCode as string, loginName: session.loginName as string, sapFactoryCode: model.sapFactoryCode, - dataList: model.summaryList.map((item) => ({ - ...pick( - [ - 'materialCode', - 'materialDesc', - 'unit', - 'wkposCode', - 'prdMaterialDesc', - 'sendSpot', - // 'oriSendSpot', - 'mrpCode', - ], - item, - ), - amount: String(item.amount), - hvAmount: String(item.hvAmount), - totalMoAmount: String(item.totalMoAmount), - totalHvAmount: String(item.totalHvAmount), - factoryCode: model.sapFactoryCode, - })), + // dataList: list.map((item) => ({ + // ...pick( + // [ + // 'materialCode', + // 'materialDesc', + // 'unit', + // 'wkposCode', + // 'prdMaterialDesc', + // 'sendSpot', + // // 'oriSendSpot', + // 'mrpCode', + // ], + // item, + // ), + // amount: String(item.amount), + // hvAmount: String(item.hvAmount), + // totalMoAmount: String(item.totalMoAmount), + // totalHvAmount: String(item.totalHvAmount), + // factoryCode: model.sapFactoryCode, + // })), + dataList: list, includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId), }); this.submitForm.receiverName = '';