diff --git a/src/pages/product/inbound/finishProductOffline/index.vue b/src/pages/product/inbound/finishProductOffline/index.vue index acd1b32..f43dfa6 100644 --- a/src/pages/product/inbound/finishProductOffline/index.vue +++ b/src/pages/product/inbound/finishProductOffline/index.vue @@ -10,7 +10,7 @@ - + @@ -24,8 +24,8 @@ - - + + @@ -206,10 +206,7 @@ export default class finishProductOfflineDom extends BasePage { */ onOk() { if (this.selectMaterielList.length == 0) { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip2') as string, - }); + this.customToast(this.$t('message.product_Tip2') as string); } else { this.$form.validate(async (valid: boolean) => { if (!valid) return; @@ -246,10 +243,7 @@ export default class finishProductOfflineDom extends BasePage { } getBarcode() { if (this.form.aimWl.value == undefined) { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip3') as string, - }); + this.customToast(this.$t('message.product_Tip3') as string); return; } console.log('this.form', this.form); @@ -274,10 +268,7 @@ export default class finishProductOfflineDom extends BasePage { this.$table.onCheckAllTap(); }); } else { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip7') as string, - }); + this.customToast(this.$t('message.product_Tip7') as string); } } const item = { diff --git a/src/pages/product/outbound/stoOutbound/Back.vue b/src/pages/product/outbound/stoOutbound/Back.vue index a99bde7..a6663fd 100644 --- a/src/pages/product/outbound/stoOutbound/Back.vue +++ b/src/pages/product/outbound/stoOutbound/Back.vue @@ -66,10 +66,7 @@ export default class stoOutboundDom extends BasePage { } async BackSweep() { if (!this.barCode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.barcode') as string, - }); + this.customToast(this.$t('message.barcode') as string); return; } let params = { @@ -82,7 +79,7 @@ export default class stoOutboundDom extends BasePage { await this.model.BackSweep(params); if (this.model.code == '1') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.succeeded') as string, }); this.barCode = ''; diff --git a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue index c601c87..5551e53 100644 --- a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue +++ b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue @@ -164,10 +164,7 @@ export default class stoOutboundDom extends BasePage { //查询单号详细页面 async detailed() { if (!this.form.orderNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as any, - }); + this.customToast(this.$t('message.Commission_tips1') as any); return; } await this.model.queryDetailed(this.form.orderNo); @@ -175,10 +172,7 @@ export default class stoOutboundDom extends BasePage { } BackSweep() { if (!this.form.orderNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as any, - }); + this.customToast(this.$t('message.Commission_tips1') as any); return; } sessionStorage.setItem('SweepCode', JSON.stringify(this.form.orderNo)); @@ -186,16 +180,13 @@ export default class stoOutboundDom extends BasePage { } async query() { if (!this.form.orderNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as any, - }); + this.customToast(this.$t('message.Commission_tips1') as any); return; } await this.model.findProdInfoByDN(this.form.orderNo); if (model.DNcode == '1') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.successful') as any, }); this.form.productCode = this.model.materielList[0].materialCode; @@ -339,10 +330,7 @@ export default class stoOutboundDom extends BasePage { this.$form.validate(async (valid: boolean) => { if (!valid) return; if (parseInt(this.form.orderAmount) <= this.form.scanAmount) { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip6') as string, - }); + this.customToast(this.$t('message.product_Tip6') as string); return; } //let selctlist: any = []; diff --git a/src/pages/product/outbound/stoOutbound/index.vue b/src/pages/product/outbound/stoOutbound/index.vue index dac1ef5..a446dfe 100644 --- a/src/pages/product/outbound/stoOutbound/index.vue +++ b/src/pages/product/outbound/stoOutbound/index.vue @@ -255,11 +255,11 @@ export default class stoOutboundDom extends BasePage { onSubmit() { this.$form.validate(async (valid: boolean) => { if (this.form.productCode.slice(0, 9) != this.form.barCode.slice(0, 9)) { - uni.showToast({ icon: 'none', title: this.$t('message.product_Tip5') as string }); + this.customToast(this.$t('message.product_Tip5') as string); return; } if (parseInt(this.form.orderAmount) <= parseInt(this.form.scanAmount)) { - uni.showToast({ icon: 'none', title: this.$t('message.product_Tip6') as string }); + this.customToast(this.$t('message.product_Tip6') as string); return; } let list = [ @@ -302,7 +302,7 @@ export default class stoOutboundDom extends BasePage { this.form.scanAmount += 1; this.$table.onCheckAllTap(); } else { - uni.showToast({ icon: 'none', title: this.$t('message.product_Tip7') as string }); + this.customToast(this.$t('message.product_Tip7') as string); } } } diff --git a/src/pages/product/warehouse/LocationInventory/index.vue b/src/pages/product/warehouse/LocationInventory/index.vue index 2dd349e..9b4bfd4 100644 --- a/src/pages/product/warehouse/LocationInventory/index.vue +++ b/src/pages/product/warehouse/LocationInventory/index.vue @@ -87,10 +87,7 @@ export default class ProductCheckReceipt extends BasePage { //单号查询 async query() { if (!this.form.pddNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); return; } let param = { @@ -100,10 +97,7 @@ export default class ProductCheckReceipt extends BasePage { }; await this.model.queryScrapList(param); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); let num = 0; this.model.modelList.forEach((item: any) => { num += item.spQty; @@ -129,16 +123,10 @@ export default class ProductCheckReceipt extends BasePage { //条码扫码 async scanning() { if (!this.form.pddNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); } if (!this.form.barcode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.barcode') as string, - }); + this.customToast(this.$t('message.barcode') as string); } let params = { factoryCode: session.factoryCode, @@ -155,10 +143,7 @@ export default class ProductCheckReceipt extends BasePage { }; await this.model.getProductCode(params); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); this.total += 1; this.model.modelList.forEach((item: any) => { if (item.locCode == this.wl.value) { @@ -172,24 +157,15 @@ export default class ProductCheckReceipt extends BasePage { //确定 async onSubmit() { if (this.form.pddNo == '') { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } if (this.total == '') { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } if (!this.Some) { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip3') as string, - }); + this.customToast(this.$t('message.product_Tip3') as string); return; } const params = { @@ -205,7 +181,7 @@ export default class ProductCheckReceipt extends BasePage { await this.model.onTakeoutConfirm(params); if (this.model.status == 'S') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.success') as string, }); this.form.pddNo = ''; diff --git a/src/pages/product/warehouse/MaterialInventory/index.vue b/src/pages/product/warehouse/MaterialInventory/index.vue index c96b9e3..5a3fbfc 100644 --- a/src/pages/product/warehouse/MaterialInventory/index.vue +++ b/src/pages/product/warehouse/MaterialInventory/index.vue @@ -95,10 +95,7 @@ export default class ProductCheckReceipt extends BasePage { //单号查询 async query() { if (!this.form.pddNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); return; } let param = { @@ -108,11 +105,8 @@ export default class ProductCheckReceipt extends BasePage { }; await this.model.queryScrapList(param); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); - let num: number = 0; + this.customToast(this.$t('message.product_Tip8') as string); + let num = 0; this.model.modelList.forEach((item: any) => { num += parseFloat(item.spQty); let arr: any = {}; @@ -138,16 +132,10 @@ export default class ProductCheckReceipt extends BasePage { //条码扫码 async scanning() { if (!this.form.pddNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.scrapForm') as string, - }); + this.customToast(this.$t('message.scrapForm') as string); } if (!this.form.barcode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.barcode') as string, - }); + this.customToast(this.$t('message.barcode') as string); } let params = { factoryCode: session.factoryCode, @@ -164,10 +152,7 @@ export default class ProductCheckReceipt extends BasePage { }; await this.model.getProductCode(params); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); this.total += 1; this.model.modelList.forEach((item: any) => { if (item.productCode == this.wl.value) { @@ -181,24 +166,15 @@ export default class ProductCheckReceipt extends BasePage { //确定 async onSubmit() { if (this.form.pddNo == '') { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } if (this.total == '') { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } if (!this.Some) { - uni.showToast({ - icon: 'none', - title: this.$t('message.selectCode') as string, - }); + this.customToast(this.$t('message.selectCode') as string); return; } const params = { @@ -214,7 +190,7 @@ export default class ProductCheckReceipt extends BasePage { await this.model.onTakeoutConfirm(params); if (this.model.status == 'S') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.success') as string, }); this.form.pddNo = ''; diff --git a/src/pages/product/warehouse/wholeCollect/index.vue b/src/pages/product/warehouse/wholeCollect/index.vue index 8dd52f1..8d998d8 100644 --- a/src/pages/product/warehouse/wholeCollect/index.vue +++ b/src/pages/product/warehouse/wholeCollect/index.vue @@ -99,10 +99,7 @@ export default class ProductCheckReceipt extends BasePage { //单号查询 async query() { if (!this.form.order3) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); return; } let param = { @@ -115,10 +112,7 @@ export default class ProductCheckReceipt extends BasePage { }; await this.model.queryScrapList(param); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); this.wl.value = this.model.choiceCodeList[0].value; this.Some = this.model.recordsList[0]; } @@ -135,22 +129,13 @@ export default class ProductCheckReceipt extends BasePage { //条码扫码 async scanning() { if (!this.form.order3) { - uni.showToast({ - icon: 'none', - title: this.$t('message.scrapForm') as string, - }); + this.customToast(this.$t('message.scrapForm') as string); } if (!this.Some) { - uni.showToast({ - icon: 'none', - title: this.$t('message.finishedProduct') as string, - }); + this.customToast(this.$t('message.finishedProduct') as string); } if (!this.form.barcode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.barcode') as string, - }); + this.customToast(this.$t('message.barcode') as string); return; } let params = { @@ -162,10 +147,7 @@ export default class ProductCheckReceipt extends BasePage { }; await this.model.getProductCode(params); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); this.Some.actualQty += 1; } } @@ -188,7 +170,7 @@ export default class ProductCheckReceipt extends BasePage { await this.model.onTakeoutConfirm(orderlist); if (this.model.code == '1') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.success') as string, }); } @@ -200,10 +182,7 @@ export default class ProductCheckReceipt extends BasePage { //查询明细 async bill() { if (!this.form.order3) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); return; } await this.model.queryDetailed(this.form.order3); diff --git a/src/pages/product/warehouse/wholeLnventory/index.vue b/src/pages/product/warehouse/wholeLnventory/index.vue index be0478f..8915bdf 100644 --- a/src/pages/product/warehouse/wholeLnventory/index.vue +++ b/src/pages/product/warehouse/wholeLnventory/index.vue @@ -121,17 +121,11 @@ export default class productCheckReceipt extends BasePage { } async query() { if (this.form.pddNo == '') { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); } await this.model.getProductCode(this.form.pddNo); if (model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); // 获取选择库位的集合 const storeList = []; storeList.push(this.model.WlListaa[0]); @@ -177,10 +171,7 @@ export default class productCheckReceipt extends BasePage { // 成功查询后,已扫+1 async scanCode(e: any) { if (!this.form.pddNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, //请扫描单号 - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } const list = { @@ -207,17 +198,11 @@ export default class productCheckReceipt extends BasePage { this.$form.validate((valid: boolean) => { if (!valid) return; if (!this.form.pddNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, //请扫描单号 - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } if (!this.form.originWl.productCode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip6') as string, //请选择物料 - }); + this.customToast(this.$t('message.Warehouse_Tip6') as string); return; } if (this.form.originWl.ypQty == this.form.originWl.spQty) { diff --git a/src/pages/product/warehouse/wholeScrap/index.vue b/src/pages/product/warehouse/wholeScrap/index.vue index eda2d9c..3eda684 100644 --- a/src/pages/product/warehouse/wholeScrap/index.vue +++ b/src/pages/product/warehouse/wholeScrap/index.vue @@ -2,7 +2,7 @@ - + {{ $t('message.Scrap') }} @@ -64,7 +64,7 @@ {{ $t('message.InventoryFinish') }} - {{ $t('message.po_Return') }} + {{ $t('message.po_Return') }} @@ -79,10 +79,10 @@ import { VForm, VFormRules } from 'vue/types/form'; import model from './model'; import { session } from '@/store/modules/session'; -interface OptionType { - label: string; - value: string; -} +// interface OptionType { +// label: string; +// value: string; +// } @Component({ components: { @@ -111,22 +111,13 @@ export default class productCheckReceipt extends BasePage { //条码扫码 async scanning() { if (!this.form.order3) { - uni.showToast({ - icon: 'none', - title: this.$t('message.scrapForm') as string, - }); + this.customToast(this.$t('message.scrapForm') as string); } if (!this.Some) { - uni.showToast({ - icon: 'none', - title: this.$t('message.finishedProduct') as string, - }); + this.customToast(this.$t('message.finishedProduct') as string); } if (!this.form.barcode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.barcode') as string, - }); + this.customToast(this.$t('message.barcode') as string); return; } let params = { @@ -138,10 +129,7 @@ export default class productCheckReceipt extends BasePage { }; await this.model.getProductCode(params); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); this.Some.actualQty += 1; } } @@ -157,10 +145,7 @@ export default class productCheckReceipt extends BasePage { //单号查询 async query() { if (!this.form.order3) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); return; } let param = { @@ -173,10 +158,7 @@ export default class productCheckReceipt extends BasePage { }; await this.model.queryScrapList(param); if (this.model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_Tip8') as string, - }); + this.customToast(this.$t('message.product_Tip8') as string); this.model.recordsList.forEach((item: any) => { item.fileNo = ' '; }); @@ -187,10 +169,7 @@ export default class productCheckReceipt extends BasePage { //确定 async onSubmit() { if (!this.Some.fileNo) { - uni.showToast({ - icon: 'none', - title: this.$t('message.fileNumber') as string, - }); + this.customToast(this.$t('message.fileNumber') as string); return; } const orderlist = [ @@ -211,7 +190,7 @@ export default class productCheckReceipt extends BasePage { await this.model.onTakeoutConfirm(orderlist); if (this.model.code == '1') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.success') as string, }); this.Some = {}; @@ -224,10 +203,7 @@ export default class productCheckReceipt extends BasePage { //查询明细 async bill() { if (!this.form.order3) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Commission_tips1') as string, - }); + this.customToast(this.$t('message.Commission_tips1') as string); return; } await this.model.queryDetailed(this.form.order3); diff --git a/src/pages/product/warehouse/wholeTransfer/Local-details.vue b/src/pages/product/warehouse/wholeTransfer/Local-details.vue index e45800a..4b0c4b7 100644 --- a/src/pages/product/warehouse/wholeTransfer/Local-details.vue +++ b/src/pages/product/warehouse/wholeTransfer/Local-details.vue @@ -37,10 +37,7 @@ export default class RawReceiptDetail extends BasePage { } async generate() { if (this.userDefined4 == '') { - uni.showToast({ - icon: 'none', - title: this.$t('message._tips6') as any, - }); + this.customToast(this.$t('message._tips6') as any); return; } let content = { diff --git a/src/pages/product/warehouse/wholeTransfer/index.vue b/src/pages/product/warehouse/wholeTransfer/index.vue index 6e950e9..0f9a009 100644 --- a/src/pages/product/warehouse/wholeTransfer/index.vue +++ b/src/pages/product/warehouse/wholeTransfer/index.vue @@ -101,16 +101,13 @@ export default class productCheckReceipt extends BasePage { //扫描条码回车 async query() { if (this.form.productCode == ' ' || this.form.productCode.length == 0) { - uni.showToast({ - icon: 'none', - title: this.$t('message.product_unit7') as string, - }); + this.customToast(this.$t('message.product_unit7') as string); return; } await model.getProductCode(this.form.productCode); if (model.code == '1') { uni.showToast({ - icon: 'none', + icon: 'success', title: this.$t('message.successful') as string, }); } @@ -141,31 +138,19 @@ export default class productCheckReceipt extends BasePage { this.$form.validate(async (valid: boolean) => { if (!valid) return; if (this.userDefined4 == ' ' || this.userDefined4.length == 0) { - uni.showToast({ - icon: 'none', - title: this.$t('message.LibraryCode') as string, - }); + this.customToast(this.$t('message.LibraryCode') as string); return; } if (!this.form.productCode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip5') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip5') as string); return; } if (!this.form.aimWl.value) { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip3') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip3') as string); return; } if (this.form.aimWl.value == model.orderInInfo.locCode) { - uni.showToast({ - icon: 'none', - title: this.$t('message.TargetLocation') as string, - }); + this.customToast(this.$t('message.TargetLocation') as string); return; } const orderlist = [ @@ -183,10 +168,7 @@ export default class productCheckReceipt extends BasePage { ]; await this.model.onTakeoutConfirm(orderlist); if (model.code == '1') { - uni.showToast({ - icon: 'none', - title: this.$t('message.Warehouse_Tip9') as string, - }); + this.customToast(this.$t('message.Warehouse_Tip9') as string); this.form.productCode = ''; model.empty(); setTimeout(() => { diff --git a/src/utils/mixin.ts b/src/utils/mixin.ts index 4e475a4..d04d3a7 100644 --- a/src/utils/mixin.ts +++ b/src/utils/mixin.ts @@ -12,7 +12,7 @@ import { Component } from 'vue-property-decorator'; @Component // 一定要用Component修饰 export default class MyMixins extends Vue { - customToast(msg: string, type = 'toast', title = '') { + customToast(msg: string, type = 'MODEL', title = '') { if (type === 'toast') { uni.showToast({ title: msg, @@ -21,6 +21,8 @@ export default class MyMixins extends Vue { uni.showModal({ title: title, content: msg, + confirmText: this.$t('message.workArea_Confirm') as string, + cancelText: this.$t('message.Cancel') as string, }); } }