diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index 895baae..39e6c33 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -54,6 +54,7 @@ export default { rawMenu_SignOut: '退出', Purchase: '采购单', BackSweep: '退扫', + succeeded: '退扫成功', //po收货 po_ReceivingGoods: 'PO收货', diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 163bcf2..347132c 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -334,6 +334,7 @@ export default { //成品下线 product_Location: 'Loc', + succeeded: 'Scan back succeeded', product_barCode: 'Barcode', sweepBarCode: 'Barcode', QuantityReturned: 'Quantity returned', diff --git a/src/pages/product/outbound/stoOutbound/Back.vue b/src/pages/product/outbound/stoOutbound/Back.vue index a9a1600..ed52608 100644 --- a/src/pages/product/outbound/stoOutbound/Back.vue +++ b/src/pages/product/outbound/stoOutbound/Back.vue @@ -10,19 +10,19 @@ - + - + - + - + @@ -46,14 +46,44 @@ import { session } from '@/store/modules/session'; @Component export default class stoOutboundDom extends BasePage { model = model; - SweepCode: any = ''; + order3: any = ''; firstFocus = false; - arr: any = ''; + barCode: any = ''; + scanAmount: number = 0; + retreatNum: number = 0; onReady() { let code = sessionStorage.getItem('SweepCode'); - this.SweepCode = JSON.parse(code); + this.order3 = JSON.parse(code); + this.model.materielList.forEach((item: any) => { + this.scanAmount += parseFloat(item.outAmount); + }); + } + async BackSweep() { + if (!this.barCode) { + uni.showToast({ + icon: 'none', + title: this.$t('message.barcode') as string, + }); + return; + } + let params = { + barCode: this.barCode, + loginName: session.loginName, + factoryCode: session.factoryCode, + order3: this.order3, + keepBy: session.loginName, + }; + await this.model.BackSweep(params); + if (this.model.code == '1') { + uni.showToast({ + icon: 'none', + title: this.$t('message.succeeded') as string, + }); + } + this.barCode = ''; + this.scanAmount -= 1; + this.retreatNum += 1; } - BackSweep() {} }