diff --git a/src/pages/raw/handover/virtual/index.vue b/src/pages/raw/handover/virtual/index.vue index c7ef253..aba78d8 100644 --- a/src/pages/raw/handover/virtual/index.vue +++ b/src/pages/raw/handover/virtual/index.vue @@ -199,6 +199,7 @@ export default class Virtual extends BasePage { orderNoList: orderNoList, materialCodeList: materialCodeList, }; + this.model.QueryParams(params); await this.model.queryProOrderResult(params); this.model.setSapFactoryCode({ sapFactoryCode: this.form.sapFactoryCode }); this.toPage(this.page.raw.handover.virtual.result); diff --git a/src/pages/raw/handover/virtual/model.ts b/src/pages/raw/handover/virtual/model.ts index fa2691e..d08ddeb 100644 --- a/src/pages/raw/handover/virtual/model.ts +++ b/src/pages/raw/handover/virtual/model.ts @@ -33,6 +33,7 @@ export class VirtualModule extends VuexModule { * sap 工厂代码 */ sapFactoryCode = ''; + nextQueryParams: any = {}; /** * 查询列表 @@ -85,6 +86,14 @@ export class VirtualModule extends VuexModule { clearProOrderResultList() { this.proOrderResultList = []; } + /** + * 保存查询条件 + */ + @MutationAction + async QueryParams(params: any) { + const nextQueryParams = params; + return { nextQueryParams }; + } /** * 查询列表 */ diff --git a/src/pages/raw/handover/virtual/summary.vue b/src/pages/raw/handover/virtual/summary.vue index f9196d1..c4f71dd 100644 --- a/src/pages/raw/handover/virtual/summary.vue +++ b/src/pages/raw/handover/virtual/summary.vue @@ -8,7 +8,7 @@ - + @@ -140,21 +140,6 @@ export default class VirtualSummary extends BasePage { this.$submitForm.setRules(this.submitFormRules); this.isBusinessFinished = false; } - - beforeDestroy() { - if (model.proOrderResultList.length > 0 && !this.isBusinessFinished) { - this.unlock(); - } - } - - /** - * 行点击 - */ - // onRowClick(e: any) { - // const lineData: SummaryItem = e.lineData; - // this.amountForm.amount = String(lineData.amount - lineData.hvAmount); - // } - /** * 接收人回车 */ @@ -176,9 +161,6 @@ export default class VirtualSummary extends BasePage { this.amountForm.amount = num; } } - /** - * 确认 - */ onOk() { this.$amountForm.validate(async (valid) => { if (!valid) return; @@ -220,26 +202,9 @@ export default class VirtualSummary extends BasePage { 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 - ) { + if (inputAmount <= 0) { 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; @@ -256,10 +221,6 @@ export default class VirtualSummary extends BasePage { } }); } - - /** - * 上传 - */ onSubmit() { this.$submitForm.validate(async (valid) => { if (valid) { @@ -287,6 +248,7 @@ 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, @@ -309,44 +271,25 @@ export default class VirtualSummary extends BasePage { factoryCode: session.factoryCode as string, loginName: session.loginName as string, sapFactoryCode: 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), }); + await this.model.queryProOrderResult(this.model.nextQueryParams); + if (this.model.proOrderResultList.length == 0) { + uni.showToast({ + title: this.$t('message.Pi_NoDataFound') as string, + }); + setTimeout(() => { + uni.navigateBack({ delta: 2 }); + }, 2000); + } this.submitForm.receiverName = ''; this.submitForm.receiver = ''; this.submitForm.password = ''; this.isBusinessFinished = true; - model.clearProOrderResultList(); - setTimeout(() => { - uni.navigateBack({ delta: 2 }); - }, 2000); } }); } - - /** - * 解锁 - */ async unlock() { try { await http.post(url.virtual.unlock.list, { @@ -356,10 +299,6 @@ export default class VirtualSummary extends BasePage { }); } catch (e) { this.customToast((this.$t('message.Summary_Tip') as string) + e.message); - // uni.showToast({ - // icon: 'none', - // title: (this.$t('message.Summary_Tip') as string) + e.message, - // }); } } }