From d44f9a90be53b45070a33583cc257d5e40dcac88 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Wed, 19 Jan 2022 16:26:31 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=8C=E6=95=B0=E9=87=8F=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/cn.ts | 2 + src/i18n/lang/en.ts | 2 + src/pages/login/login/index.vue | 117 ++++++++++++++---- .../outbound/stoOutbound/DN-delivergoods.vue | 4 +- .../warehouse/wholeLnventory/index.vue | 2 +- src/pages/raw/commission/entrant/index.vue | 4 +- src/pages/raw/handover/feeding/Location.vue | 4 +- src/pages/raw/handover/picking/ByOrder.vue | 2 +- src/pages/raw/handover/picking/BySummary.vue | 2 +- src/pages/raw/handover/returning/index.vue | 2 +- src/pages/raw/ingoods/dnReceipt/ImportDN.vue | 2 +- .../raw/ingoods/dnReceipt/dnReceiving.vue | 11 +- src/pages/raw/warehouse/rowCollect/index.vue | 2 +- .../raw/warehouse/rowInventory/index.vue | 1 + src/pages/raw/warehouse/rowScrap/index.vue | 2 +- src/pages/raw/warehouse/rowTransfer/index.vue | 2 +- 16 files changed, 117 insertions(+), 44 deletions(-) diff --git a/src/i18n/lang/cn.ts b/src/i18n/lang/cn.ts index ea77d66..23a2496 100644 --- a/src/i18n/lang/cn.ts +++ b/src/i18n/lang/cn.ts @@ -27,6 +27,8 @@ export default { //版本更新 updatePrompt: '更新提示', Tip1: '检测到有新版本,是否更新?', + restart: '重启', + Tip2: '更新成功,是否重启?', //服务器设置 ServerSetting: '服务器设置', PleaseInputIPAddress: '请输入IP地址', diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 7442075..a25273a 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -30,6 +30,8 @@ export default { //版本更新 updatePrompt: 'Update tips', Tip1: 'New version detected, update?', + restart: 'restart', + Tip2: 'Update succeeded. Are you sure to restart?', //服务器设置 ServerSetting: 'Server Setting', PleaseInputIPAddress: 'Please input IP address', diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index a7f0d9e..6036d29 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -86,6 +86,7 @@ import { BasePage } from '@/components/base/page'; import { VForm } from 'vue/types/form'; import { Lang } from '@/i18n'; import { url } from '@/utils/url'; +import { path } from 'lodash/fp'; // import { any } from 'lodash/fp'; @Component({ @@ -143,10 +144,8 @@ export default class LoginPage extends BasePage { async update() { await session.QueryVersion(); if (this.Version != session.Version) { - //alert('版本更新啦!'); // 版本更新提示 uni.showModal({ - //title: this.$t('message.updatePrompt') as string, content: this.$t('message.Tip1') as string, confirmText: this.$t('message.workArea_Confirm') as string, cancelText: this.$t('message.Cancel') as string, @@ -154,38 +153,104 @@ export default class LoginPage extends BasePage { if (res.confirm) { //确定执行下载 let downloadApkUrl = session.url; - // uni.downloadFile({ - // url: downloadApkUrl, - // }); - var dtask = plus.downloader.createDownload(downloadApkUrl, {}, function (d, status) { - if (status == 200) { - console.log('Download success: ' + d.filename); - uni.showToast({ - icon: 'none', - title: d.filename, - }); - } else { - console.log('Download failed: ' + status); - } + ////////////////uni下载方法, + uni.downloadFile({ + url: downloadApkUrl, + success: (downloadResult) => { + //uni.hideLoading(); + if (downloadResult.statusCode == 200) { + //安装更新 + plus.runtime.install(downloadResult.tempFilePath, { force: true }, function (res) { + //uni.showToast('更新成功,重启'); + plus.runtime.restart(); + }); + // uni.showModal({ + // //content: '更新更新', + // content: this.$t('message.Tip2') as string, + // confirmText: this.$t('message.restart') as string, + // cancelText: this.$t('message.Cancel') as string, + // success: function (res) { + // if (res.confirm == true) { + // plus.runtime.install(downloadResult.tempFilePath, { force: true }, function (res) { + // //uni.showToast('更新成功,重启'); + // plus.runtime.restart(); + // }); + // } + // }, + // }); + } + }, }); - dtask.start(); + ///////////////////// plus方法 + // plus.downloader + // .createDownload(downloadApkUrl, {}, function (d, status) { + // uni.showModal({ + // content: status, + // }); + // if (status == 200) { + // uni.showModal({ + // title: '', + // content: this.$t('message.Tip2') as string, + // confirmText: this.$t('message.restart') as string, + // cancelText: this.$t('message.Cancel') as string, + // success: function (res) { + // if (res.confirm == true) { + // plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename), { force: true }, function (res) { + // //uni.showToast('更新成功,重启'); + // plus.runtime.restart(); + // }); + // } + // }, + // }); + // } else { + // console.log('Download failed: ' + status); + // } + // }) + // .start(); + // dtask.start(); + /////////////////plus 方法 } else if (res.cancel) { //console.log('用户点击取消'); } }, }); - - //dtask.addEventListener("statechanged", onStateChanged, false); - // await uni.downloadFile({ - // url: session.url, - // success: (res) => { - // console.log('res.statusCode', res.statusCode); - // console.log('res.tempFilePath', res.tempFilePath); - // console.log("url,url,url",session.url); - // }, - // }); } } + /////////////////无用代码无用代码 + // 更新应用资源 + async installApk(path) { + plus.runtime.install( + path, + {}, + function () { + console.log('安装文件成功!'); + + plus.runtime.restart(); + }, + function (e) { + uni.hideLoading(); + console.log(JSON.stringify(e)); //这里!e一直为null,path路径为_downloads/apk/10.apk + uni.showToast({ + title: '安装失败', + mask: false, + duration: 1500, + }); + }, + ); + } + /* 安装失败 */ + failed() { + uni.showToast({ + icon: 'none', + mask: true, + title: '更新失败!请退出重试或向工作人员反映', + duration: 1500, + }); + setTimeout(function () { + plus.runtime.quit(); + }, 1500); + } + //////////////////////////// login(): void { this.$form.validate(async (valid: boolean) => { if (valid) { diff --git a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue index fcaf892..7f2d082 100644 --- a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue +++ b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue @@ -14,7 +14,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/src/pages/product/warehouse/wholeLnventory/index.vue b/src/pages/product/warehouse/wholeLnventory/index.vue index fd8c3b3..54b9cf3 100644 --- a/src/pages/product/warehouse/wholeLnventory/index.vue +++ b/src/pages/product/warehouse/wholeLnventory/index.vue @@ -31,7 +31,7 @@ - + diff --git a/src/pages/raw/commission/entrant/index.vue b/src/pages/raw/commission/entrant/index.vue index ed4ec6c..b4fdf26 100644 --- a/src/pages/raw/commission/entrant/index.vue +++ b/src/pages/raw/commission/entrant/index.vue @@ -47,11 +47,11 @@ {{ $t('message.CommissionedLocation') }} - + {{ $t('message.CommissionedThisNumber') }} - + diff --git a/src/pages/raw/handover/feeding/Location.vue b/src/pages/raw/handover/feeding/Location.vue index d503c91..f4a2b7e 100644 --- a/src/pages/raw/handover/feeding/Location.vue +++ b/src/pages/raw/handover/feeding/Location.vue @@ -26,11 +26,11 @@ {{ $t('message.CommissionedLocation') }} - + {{ $t('message.CommissionedThisNumber') }} - + diff --git a/src/pages/raw/handover/picking/ByOrder.vue b/src/pages/raw/handover/picking/ByOrder.vue index 4ea5057..b15b119 100644 --- a/src/pages/raw/handover/picking/ByOrder.vue +++ b/src/pages/raw/handover/picking/ByOrder.vue @@ -29,7 +29,7 @@ {{ $t('message.CommissionedThisNumber') }}: - + diff --git a/src/pages/raw/handover/picking/BySummary.vue b/src/pages/raw/handover/picking/BySummary.vue index ae3413b..d4ff2c6 100644 --- a/src/pages/raw/handover/picking/BySummary.vue +++ b/src/pages/raw/handover/picking/BySummary.vue @@ -30,7 +30,7 @@ {{ $t('message.CommissionedThisNumber') }}: - + diff --git a/src/pages/raw/handover/returning/index.vue b/src/pages/raw/handover/returning/index.vue index 7b737ef..13fe7d4 100644 --- a/src/pages/raw/handover/returning/index.vue +++ b/src/pages/raw/handover/returning/index.vue @@ -54,7 +54,7 @@ - + diff --git a/src/pages/raw/ingoods/dnReceipt/ImportDN.vue b/src/pages/raw/ingoods/dnReceipt/ImportDN.vue index 17489e3..05d79b8 100644 --- a/src/pages/raw/ingoods/dnReceipt/ImportDN.vue +++ b/src/pages/raw/ingoods/dnReceipt/ImportDN.vue @@ -59,7 +59,7 @@ {{ $t('message.CommissionedThisNumber') }} - + diff --git a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue index 119d3e8..634624a 100644 --- a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue @@ -44,11 +44,11 @@ {{ $t('message.DemandQuantity') }} - + {{ $t('message.Cumulative') }} - + @@ -59,7 +59,7 @@ {{ $t('message.CommissionedThisNumber') }} - + @@ -138,10 +138,13 @@ export default class dnReceiptDom extends BasePage { poNo: any = null; // 需求数量 requestAmount: number = null; - + //receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0]; async onReady() { //this.initLocation(); } + input() { + this.receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0]; + } // 页面初始化 // 页面需要清空仓库,因此需要复用该方法 async initLocation(condition): Promise { diff --git a/src/pages/raw/warehouse/rowCollect/index.vue b/src/pages/raw/warehouse/rowCollect/index.vue index 270f797..1f12565 100644 --- a/src/pages/raw/warehouse/rowCollect/index.vue +++ b/src/pages/raw/warehouse/rowCollect/index.vue @@ -28,7 +28,7 @@ - + diff --git a/src/pages/raw/warehouse/rowInventory/index.vue b/src/pages/raw/warehouse/rowInventory/index.vue index c563e67..2821d63 100644 --- a/src/pages/raw/warehouse/rowInventory/index.vue +++ b/src/pages/raw/warehouse/rowInventory/index.vue @@ -47,6 +47,7 @@ diff --git a/src/pages/raw/warehouse/rowScrap/index.vue b/src/pages/raw/warehouse/rowScrap/index.vue index f7b5d41..eee8e86 100644 --- a/src/pages/raw/warehouse/rowScrap/index.vue +++ b/src/pages/raw/warehouse/rowScrap/index.vue @@ -28,7 +28,7 @@ - + diff --git a/src/pages/raw/warehouse/rowTransfer/index.vue b/src/pages/raw/warehouse/rowTransfer/index.vue index 46bedf4..88a94af 100644 --- a/src/pages/raw/warehouse/rowTransfer/index.vue +++ b/src/pages/raw/warehouse/rowTransfer/index.vue @@ -35,7 +35,7 @@ - + From e06fba98009bdb7923f4a67091d1f3e4224bdb07 Mon Sep 17 00:00:00 2001 From: zhoulei Date: Thu, 20 Jan 2022 18:00:37 +0800 Subject: [PATCH 02/11] =?UTF-8?q?feat:=E5=BC=B9=E7=AA=97=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E3=80=81=E8=BE=93=E5=85=A5=E8=BF=87=E6=BB=A4=E7=9A=84?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=96=B9=E6=A1=88=E7=A4=BA=E4=BE=8B=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 24 +++++++++++++++++------- src/components/base/page.ts | 18 ++++++++++++++---- src/pages/login/login/index.vue | 19 +++++++++++++++---- src/utils/mixin.ts | 27 +++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 src/utils/mixin.ts diff --git a/src/App.vue b/src/App.vue index c997206..afef0a8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,28 +1,38 @@ + diff --git a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue index 7f2d082..206eada 100644 --- a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue +++ b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue @@ -406,6 +406,10 @@ export default class stoOutboundDom extends BasePage { diff --git a/src/pages/product/warehouse/wholeCollect/index.vue b/src/pages/product/warehouse/wholeCollect/index.vue index 1957bfd..8dd52f1 100644 --- a/src/pages/product/warehouse/wholeCollect/index.vue +++ b/src/pages/product/warehouse/wholeCollect/index.vue @@ -36,7 +36,7 @@ - + diff --git a/src/pages/product/warehouse/wholeLnventory/index.vue b/src/pages/product/warehouse/wholeLnventory/index.vue index 54b9cf3..be0478f 100644 --- a/src/pages/product/warehouse/wholeLnventory/index.vue +++ b/src/pages/product/warehouse/wholeLnventory/index.vue @@ -37,11 +37,11 @@ - + - + diff --git a/src/pages/raw/handover/returning/index.vue b/src/pages/raw/handover/returning/index.vue index 13fe7d4..936ef5f 100644 --- a/src/pages/raw/handover/returning/index.vue +++ b/src/pages/raw/handover/returning/index.vue @@ -47,12 +47,12 @@ - + - + diff --git a/src/pages/raw/ingoods/dnReceipt/ImportDN.vue b/src/pages/raw/ingoods/dnReceipt/ImportDN.vue index 04cd8cf..01e0e3e 100644 --- a/src/pages/raw/ingoods/dnReceipt/ImportDN.vue +++ b/src/pages/raw/ingoods/dnReceipt/ImportDN.vue @@ -48,7 +48,7 @@ {{ $t('message.Cumulative') }} - + @@ -548,39 +548,39 @@ export default class dnReceiptDom extends BasePage { } } } - .library { - width: 100%; - height: 100rpx; - display: flex; - .library-left { - width: 50%; - height: 100%; - display: flex; - view { - width: 100rpx; - line-height: 100rpx; - } - .search { - padding-left: 30px; - } - } - .library-right { - width: 50%; - height: 100%; - display: flex; - .library-right-title { - width: 120rpx; - height: 100%; - line-height: 100rpx; - } - .input { - width: 200rpx; - height: 70rpx; - margin-top: 15rpx; - margin-left: 15rpx; - } - } - } + // .library { + // width: 100%; + // height: 100rpx; + // display: flex; + // .library-left { + // width: 50%; + // height: 100%; + // display: flex; + // view { + // width: 100rpx; + // line-height: 100rpx; + // } + // .search { + // padding-left: 30px; + // } + // } + // .library-right { + // width: 50%; + // height: 100%; + // display: flex; + // .library-right-title { + // width: 120rpx; + // height: 100%; + // line-height: 100rpx; + // } + // .input { + // width: 200rpx; + // height: 70rpx; + // margin-top: 15rpx; + // margin-left: 15rpx; + // } + // } + // } .add { width: 100%; height: 100rpx; diff --git a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue index 444326c..b4af540 100644 --- a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue @@ -48,7 +48,7 @@ {{ $t('message.Cumulative') }} - + @@ -575,39 +575,39 @@ export default class dnReceiptDom extends BasePage { } } } - .library { - width: 100%; - height: 100rpx; - display: flex; - .library-left { - width: 50%; - height: 100%; - display: flex; - view { - width: 100rpx; - line-height: 100rpx; - } - .search { - padding-left: 30px; - } - } - .library-right { - width: 50%; - height: 100%; - display: flex; - .library-right-title { - width: 120rpx; - height: 100%; - line-height: 100rpx; - } - .input { - width: 200rpx; - height: 70rpx; - margin-top: 15rpx; - margin-left: 15rpx; - } - } - } + // .library { + // width: 100%; + // height: 100rpx; + // display: flex; + // .library-left { + // width: 50%; + // height: 100%; + // display: flex; + // view { + // width: 100rpx; + // line-height: 100rpx; + // } + // .search { + // padding-left: 30px; + // } + // } + // .library-right { + // width: 50%; + // height: 100%; + // display: flex; + // .library-right-title { + // width: 120rpx; + // height: 100%; + // line-height: 100rpx; + // } + // .input { + // width: 200rpx; + // height: 70rpx; + // margin-top: 15rpx; + // margin-left: 15rpx; + // } + // } + // } .add { width: 100%; height: 100rpx; diff --git a/src/utils/request.ts b/src/utils/request.ts index 0762f42..41a7d3c 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -113,18 +113,41 @@ http.interceptors.response.use( } else if (error) { switch (error.statusCode) { /* eslint-disable */ - case 400: error.message = vm.$t('message.request_Tip1') as string; break - case 401: error.message = vm.$t('message.request_Tip2') as string; break - case 403: error.message = vm.$t('message.request_Tip3') as string; break - case 404: error.message = vm.$t('message.request_Tip4') as string + error.config.url; break - case 408: error.message = vm.$t('message.request_Tip5') as string; break - case 500: error.message = vm.$t('message.request_Tip6') as string; break - case 501: error.message = vm.$t('message.request_Tip7') as string; break - case 502: error.message = vm.$t('message.request_Tip8') as string; break - case 503: error.message = vm.$t('message.request_Tip9') as string; break - case 504: error.message = vm.$t('message.request_Tip10') as string; break - case 505: error.message = vm.$t('message.request_Tip11') as string; break - default: break + case 400: + error.message = vm.$t('message.request_Tip1') as string; + break; + case 401: + error.message = vm.$t('message.request_Tip2') as string; + break; + case 403: + error.message = vm.$t('message.request_Tip3') as string; + break; + case 404: + error.message = (vm.$t('message.request_Tip4') as string) + error.config.url; + break; + case 408: + error.message = vm.$t('message.request_Tip5') as string; + break; + case 500: + error.message = vm.$t('message.request_Tip6') as string; + break; + case 501: + error.message = vm.$t('message.request_Tip7') as string; + break; + case 502: + error.message = vm.$t('message.request_Tip8') as string; + break; + case 503: + error.message = vm.$t('message.request_Tip9') as string; + break; + case 504: + error.message = vm.$t('message.request_Tip10') as string; + break; + case 505: + error.message = vm.$t('message.request_Tip11') as string; + break; + default: + break; /* eslint-enable */ } } @@ -149,9 +172,16 @@ function errorLog(error: Error, hideError: boolean) { } // 显示提示 hideError || - uni.showToast({ - icon: 'none', - title: error.message, + // uni.showToast({ + // icon: 'none', + // title: error.message, + // }); + uni.showModal({ + title: '', + content: error.message, + confirmText: vm.$t('message.workArea_Confirm') as string, + cancelText: vm.$t('message.Cancel') as string, + showCancel: false, }); } From ed7abdb01ead4ccf3dafdef84cc363e5df6599bb Mon Sep 17 00:00:00 2001 From: guoshuang Date: Fri, 21 Jan 2022 09:20:28 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../raw/ingoods/dnReceipt/dnReceiving.vue | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue index 0753630..e728b87 100644 --- a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue @@ -604,7 +604,6 @@ export default class dnReceiptDom extends BasePage { } } } -<<<<<<< HEAD // .library { // width: 100%; // height: 100rpx; @@ -638,41 +637,6 @@ export default class dnReceiptDom extends BasePage { // } // } // } -======= - .library { - width: 100%; - height: 100rpx; - display: flex; - .library-left { - width: 50%; - height: 100%; - display: flex; - view { - width: 100rpx; - line-height: 100rpx; - } - .search { - padding-left: 20px; - } - } - .library-right { - width: 50%; - height: 100%; - display: flex; - .library-right-title { - width: 120rpx; - height: 100%; - padding-left: 4px; - line-height: 100rpx; - } - .input { - width: 200rpx; - height: 70rpx; - margin-top: 15rpx; - } - } - } ->>>>>>> e06fba98009bdb7923f4a67091d1f3e4224bdb07 .add { width: 100%; height: 100rpx; From 68c857a073aae04451dddb5add17b9f7f3a1d7b9 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Fri, 21 Jan 2022 09:31:59 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/raw/ingoods/dnReceipt/dnReceiving.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue index e728b87..27c4aa2 100644 --- a/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue +++ b/src/pages/raw/ingoods/dnReceipt/dnReceiving.vue @@ -131,7 +131,6 @@ export default class dnReceiptDom extends BasePage { poNo: any = null; // 需求数量 requestAmount: number = null; -<<<<<<< HEAD //receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0]; async onReady() { this.model.DNReceivingList = []; @@ -141,8 +140,6 @@ export default class dnReceiptDom extends BasePage { input() { this.receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0]; } -======= ->>>>>>> e06fba98009bdb7923f4a67091d1f3e4224bdb07 // 页面初始化 // 页面需要清空仓库,因此需要复用该方法 async initLocation(condition): Promise { From ed0c35415c323a1f3474273a9c2e46eafc5e45be Mon Sep 17 00:00:00 2001 From: zhoulei Date: Fri, 21 Jan 2022 10:16:24 +0800 Subject: [PATCH 06/11] =?UTF-8?q?update:=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=BC=B9=E7=AA=97mixin\ts=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 9 +++++++++ src/pages/login/login/index.vue | 2 +- src/sfc.d.ts | 10 ++++++++++ types/vue-prototype.d.ts | 24 ++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 types/vue-prototype.d.ts diff --git a/src/main.ts b/src/main.ts index c6400aa..9800895 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,3 +1,12 @@ +/* + * @Author: zhou lei + * @Date: 2021-11-08 12:10:26 + * @LastEditTime: 2022-01-21 09:16:58 + * @LastEditors: zhou lei + * @Description: + * @FilePath: /wms_haiwai_app/src/main.ts + * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 + */ import Vue from 'vue'; import uView from 'uview-ui'; import i18n from '@/i18n'; diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index d515222..8040c71 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -11,7 +11,6 @@ V1.6 - + Date: Fri, 21 Jan 2022 10:28:43 +0800 Subject: [PATCH 07/11] =?UTF-8?q?feat:=E7=BB=9F=E4=B8=80=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - .vscode/settings.json | 85 +++++++++++++++++++ src/pages/login/login/index.vue | 8 +- .../raw/ingoods/dnReceipt/dnReceiving.vue | 2 +- types/vue-prototype.d.ts | 1 + 5 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 2561bb4..c31d257 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ yarn-error.log* # Editor directories and files .project .idea -.vscode *.suo *.ntvs* *.njsproj diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4beef3a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,85 @@ +{ + "i18n-ally.localesPaths": ["src/i18n", "src/i18n/lang"], + "i18n-ally.displayLanguage": "zh", + "workbench.iconTheme": "material-icon-theme", + "git.enableSmartCommit": true, + "git.autofetch": true, + "files.associations": { + "*.js": "javascriptreact", + "*.cjson": "jsonc", + "*.wxss": "css", + "*.wxs": "javascript", + "*.ejs": "plaintext" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + // 代码格式化 + + "editor.fontSize": 12, + "editor.tabSize": 2, + "editor.codeActionsOnSave": { + "source.fixAll": false + }, + "editor.formatOnSave": false, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "window.zoomLevel": 0, + "liveServer.settings.donotShowInfoMsg": true, + "javascript.updateImportsOnFileMove.enabled": "always", + "editor.detectIndentation": false, + "explorer.confirmDelete": false, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + // 头部注释 + "fileheader.customMade": { + // 头部注释默认字段 + "Author": "zhou lei", + "Date": "Do not edit", // 设置后默认设置文件生成时间 + "LastEditTime": "Do not edit", // 设置后,保存文件更改默认更新最后编辑时间 + "LastEditors": "zhou lei", // 设置后,保存文件更改默认更新最后编辑人 + "Description": "", + "FilePath": "Do not edit", // 设置后,默认生成文件相对于项目的路径 + "custom_string_obkoro1": "联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司" + }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.quickSuggestions": { + "strings": true + }, + "emmet.includeLanguages": { + "wxml": "html", + "vue-html": "html" + }, + "emmet.syntaxProfiles": { + "postcss": "css" + }, + "emmet.triggerExpansionOnTab": true, + "tailwindCSS.emmetCompletions": true, + "tailwindCSS.validate": true, + "minapp-vscode.disableAutoConfig": true, + "[scss]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "liveServer.settings.donotVerifyTags": true, + "diffEditor.ignoreTrimWhitespace": false, + "redhat.telemetry.enabled": true, + "gitlens.advanced.messages": { + "suppressGitMissingWarning": true + } +} diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 8040c71..4e7ac45 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -32,7 +32,7 @@ color: 'rgba(255, 255, 255, 0.67)', }" /> - + Date: Fri, 21 Jan 2022 10:32:14 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/product/outbound/stoOutbound/DN-delivergoods.vue | 4 ++-- src/pages/raw/handover/aggregating/index.vue | 3 +-- src/pages/raw/handover/picking/index.vue | 3 +-- src/pages/raw/handover/virtual/index.vue | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue index 206eada..c601c87 100644 --- a/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue +++ b/src/pages/product/outbound/stoOutbound/DN-delivergoods.vue @@ -14,7 +14,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/src/pages/raw/handover/aggregating/index.vue b/src/pages/raw/handover/aggregating/index.vue index 72076f1..4bd735a 100644 --- a/src/pages/raw/handover/aggregating/index.vue +++ b/src/pages/raw/handover/aggregating/index.vue @@ -237,8 +237,7 @@ export default class Aggregating extends BasePage { async onReady() { this.$form.setRules(this.rules); model.clearProOrderList(); - //guoshuang 注掉 解决打开页面默认显示工厂号 - // this.form.sapFactoryCode = session.factoryCode; + this.form.sapFactoryCode = session.factoryCode; } /** * 确认 diff --git a/src/pages/raw/handover/picking/index.vue b/src/pages/raw/handover/picking/index.vue index 96c9172..d31ac5d 100644 --- a/src/pages/raw/handover/picking/index.vue +++ b/src/pages/raw/handover/picking/index.vue @@ -156,8 +156,7 @@ export default class pickingDom extends BasePage { onReady() { this.$form.setRules(this.rules); model.clearProOrderList(); - // guoshuang 注掉,解决打开页面有默认工厂号 - // this.form.sapFactoryCode = session.factoryCode; + this.form.sapFactoryCode = session.factoryCode; } /** diff --git a/src/pages/raw/handover/virtual/index.vue b/src/pages/raw/handover/virtual/index.vue index f8a190a..433674a 100644 --- a/src/pages/raw/handover/virtual/index.vue +++ b/src/pages/raw/handover/virtual/index.vue @@ -269,8 +269,7 @@ export default class Virtual extends BasePage { async onReady() { this.$form.setRules(this.rules); model.clearProOrderList(); - //guoshuang 注掉 解决打开页面默认显示工厂号 - //this.form.sapFactoryCode = session.factoryCode; + this.form.sapFactoryCode = session.factoryCode; } /** From 8bb9abbeae394764261e5087899688f9e4e4bcaa Mon Sep 17 00:00:00 2001 From: zhoulei Date: Fri, 21 Jan 2022 13:39:41 +0800 Subject: [PATCH 09/11] =?UTF-8?q?feat:=E5=85=A8=E5=B1=80=E6=B3=A8=E5=85=A5?= =?UTF-8?q?plus,customToast?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 1 + package.json | 2 ++ src/main.ts | 6 ++++-- src/pages/login/login/index.vue | 5 ----- tsconfig.json | 3 ++- types/vue-prototype.d.ts | 3 ++- yarn.lock | 17 +++++++++++++++++ 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 44c85c1..e651868 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ module.exports = { extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/typescript/recommended', '@vue/prettier', '@vue/prettier/@typescript-eslint'], globals: { uni: true, + plus: true, }, parserOptions: { ecmaVersion: 2020, diff --git a/package.json b/package.json index d7d3445..5456d09 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,9 @@ "@dcloudio/vue-cli-plugin-uni-optimize": "^2.0.0-29820201110001", "@dcloudio/webpack-uni-mp-loader": "^2.0.0-29820201110001", "@dcloudio/webpack-uni-pages-loader": "^2.0.0-29820201110001", + "@types/html5plus": "^1.0.2", "@types/lodash": "^4.14.165", + "@types/uni-app": "^1.4.4", "@typescript-eslint/eslint-plugin": "^4.9.0", "@typescript-eslint/parser": "^4.9.0", "@vue/cli-plugin-babel": "~4.5.0", diff --git a/src/main.ts b/src/main.ts index 9800895..df47f03 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,9 +1,9 @@ /* * @Author: zhou lei * @Date: 2021-11-08 12:10:26 - * @LastEditTime: 2022-01-21 09:16:58 + * @LastEditTime: 2022-01-21 13:37:04 * @LastEditors: zhou lei - * @Description: + * @Description: * @FilePath: /wms_haiwai_app/src/main.ts * 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司 */ @@ -17,6 +17,7 @@ import { Alerts } from '@/components/alert/alert'; import filters from '@/utils/filter'; import plugins from '@/plugins'; import wybTable from '@/plugins/wyb-table/wyb-table.vue'; +import MyMixins from './utils/mixin'; Vue.config.productionTip = false; @@ -28,6 +29,7 @@ Vue.use(Alerts); Vue.use(filters); // 引入插件组件 Vue.use(plugins); +Vue.mixin(MyMixins); Vue.component('wyb-table', wybTable); export default new App({ diff --git a/src/pages/login/login/index.vue b/src/pages/login/login/index.vue index 4e7ac45..968e305 100644 --- a/src/pages/login/login/index.vue +++ b/src/pages/login/login/index.vue @@ -87,12 +87,10 @@ import { BasePage } from '@/components/base/page'; import { VForm } from 'vue/types/form'; import { Lang } from '@/i18n'; // mixin 引入示例目前用于弹窗自定义 -import MyMixins from '@/utils/mixin'; // import { any } from 'lodash/fp'; @Component({ components: { Alerts }, - mixins: [MyMixins], }) export default class LoginPage extends BasePage { /** @@ -170,10 +168,8 @@ export default class LoginPage extends BasePage { //uni.hideLoading(); if (downloadResult.statusCode == 200) { //安装更新 - // eslint-disable-next-line no-undef plus.runtime.install(downloadResult.tempFilePath as any, { force: true }, function () { //uni.showToast('更新成功,重启'); - // eslint-disable-next-line no-undef plus.runtime.restart(); }); // uni.showModal({ @@ -236,7 +232,6 @@ export default class LoginPage extends BasePage { {}, function () { console.log('安装文件成功!'); - plus.runtime.restart(); }, function (e) { diff --git a/tsconfig.json b/tsconfig.json index 846cd51..d4dc543 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,8 @@ "webpack-env", "@dcloudio/types", "miniprogram-api-typings", - "mini-types" + "mini-types", + "@types/html5plus" ], "paths": { "@/*": [ diff --git a/types/vue-prototype.d.ts b/types/vue-prototype.d.ts index f05aa7f..638147a 100644 --- a/types/vue-prototype.d.ts +++ b/types/vue-prototype.d.ts @@ -2,7 +2,7 @@ /* * @Author: zhou lei * @Date: 2022-01-21 09:23:56 - * @LastEditTime: 2022-01-21 09:34:15 + * @LastEditTime: 2022-01-21 11:47:17 * @LastEditors: zhou lei * @Description: * @FilePath: /wms_haiwai_app/types/vue-prototype.d.ts @@ -10,6 +10,7 @@ */ import Vue from 'vue'; // 在 types/vue.d.ts 里 Vue 有构造函数类型 + declare module 'vue/types/vue' { interface Vue { // $myProperty: string; diff --git a/yarn.lock b/yarn.lock index e77c22e..6289b39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1611,6 +1611,11 @@ dependencies: "@types/node" "*" +"@types/html5plus@^1.0.2": + version "1.0.2" + resolved "https://registry.npmmirror.com/@types/html5plus/download/@types/html5plus-1.0.2.tgz#43e1aaca4584e7e2cf0db082389f42fbba98062c" + integrity sha1-Q+GqykWE5+LPDbCCOJ9C+7qYBiw= + "@types/http-proxy-middleware@*": version "0.19.3" resolved "https://registry.npm.taobao.org/@types/http-proxy-middleware/download/@types/http-proxy-middleware-0.19.3.tgz?cache=0&sync_timestamp=1605053627891&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fhttp-proxy-middleware%2Fdownload%2F%40types%2Fhttp-proxy-middleware-0.19.3.tgz#b2eb96fbc0f9ac7250b5d9c4c53aade049497d03" @@ -1737,6 +1742,13 @@ dependencies: source-map "^0.6.1" +"@types/uni-app@^1.4.4": + version "1.4.4" + resolved "https://registry.npmmirror.com/@types/uni-app/download/@types/uni-app-1.4.4.tgz#fe73d0e7c89d5e750605e088ff6695846e019c36" + integrity sha1-/nPQ58idXnUGBeCI/2aVhG4BnDY= + dependencies: + vue "^2.6.8" + "@types/webpack-dev-server@^3.11.0": version "3.11.1" resolved "https://registry.npm.taobao.org/@types/webpack-dev-server/download/@types/webpack-dev-server-3.11.1.tgz?cache=0&sync_timestamp=1605057456418&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fwebpack-dev-server%2Fdownload%2F%40types%2Fwebpack-dev-server-3.11.1.tgz#f8f4dac1da226d530bd15a1d5dc34b23ba766ccb" @@ -11562,6 +11574,11 @@ vue@^2.6.11: resolved "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz?cache=0&sync_timestamp=1606321041576&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123" integrity sha1-9evU+mvShpQD4pqJau1JBEVskSM= +vue@^2.6.8: + version "2.6.14" + resolved "https://registry.npmmirror.com/vue/download/vue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235" + integrity sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ== + vuex-class@^0.3.2: version "0.3.2" resolved "https://registry.npm.taobao.org/vuex-class/download/vuex-class-0.3.2.tgz#c7e96a076c1682137d4d23a8dcfdc63f220e17a8" From 99423b08b2c9df5b3e5ec95791e06286ba0f4f30 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Fri, 21 Jan 2022 13:58:26 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/lang/en.ts | 60 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 5542916..284cd4d 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -25,12 +25,12 @@ export default { Inventory_query: 'Inventory query', success: 'Success', error: 'Error', - successful: 'query was successful', - operation: 'operation', + successful: 'Query was successful', + operation: 'Operation', //版本更新 updatePrompt: 'Update tips', Tip1: 'New version detected, update?', - restart: 'restart', + restart: 'Restart', Tip2: 'Update succeeded. Are you sure to restart?', //服务器设置 ServerSetting: 'Server Setting', @@ -43,7 +43,7 @@ export default { workArea_Title: 'Work area list', workArea_SubTitle: 'Hello, Please select your work area from the list~', workArea_SelelctOne: 'Please select one work area from the list', - workArea_Selelct: 'selelct', + workArea_Selelct: 'Selelct', workArea_Warehouse: 'WH', workArea_WarehouseName: 'WH name', workArea_RegionName: 'Region name', @@ -132,7 +132,7 @@ export default { Pi_upload: 'Upload', Pi_tip1: 'Please input the pick Qty', Pi_tip2: 'The pick up Qty is an greater than 0', - detailed: 'detailed', + detailed: 'Detailed', Pi_tip3: 'Please update the pick up Qty before uploading', Pi_tip10: 'Please update the append Qty before uploading', Pi_tip4: 'No data available to upload', @@ -152,7 +152,7 @@ export default { Pi_CurrentPickingQuantity: 'Current Pick up Qty', Pi_PickedQuantity: 'Picked Qty', Pi_QuantityHandedOver: 'Handedover Qty', - Pi_distribution: 'distribution', + Pi_distribution: 'Distribution', Cumulative: 'Cumulative', //汇总交接 @@ -205,9 +205,9 @@ export default { Scrap: 'FG scrap', CollectionAndBorrowing: 'FG cost center', Inventory: 'FG PSV', - raw_Inventory: 'raw Inventory', + raw_Inventory: 'Raw Inventory', Transfer: 'Library Code', - generate: 'generate', + generate: 'Generate', RowWarehouse: 'RAW WH', SemiProductZC: 'SFG transfer', @@ -235,25 +235,25 @@ export default { // 委外-入库 CommissionEntrant: 'Subcontracting receipt', - CommissionedSingleNumber: 'single', - CommissionedMaterielNo: 'code', - CommissionedMaterielDesc: 'describe', + CommissionedSingleNumber: 'Order No', + CommissionedMaterielNo: 'Code', + CommissionedMaterielDesc: 'Describe', SourceLocation: 'Source location', barcode: 'Please enter barcode', Requisition: 'Requisition', scrapForm: 'Please scan the scrap form first', finishedProduct: 'Please select finished product code first', CommissionedDemandData: 'Demand', - CommissionedCumulativeData: 'total', + CommissionedCumulativeData: 'Total', CommissionedLocation: 'Loc', - CommissionedThisNumber: 'quantity', + CommissionedThisNumber: 'Quantity', CommissionedNumber: 'Receipt quantity', CommissionedEntrantDetails: 'Warehousing', greater: 'Cannot be greater than total', LibraryCode: 'Please change the library code', CommissionedReceiptQuantity: 'Receipt quantity', TargetLocation: 'Please select a different target location', - subcontract: 'subcontract', + subcontract: 'Subcontract', // 委外-出库 CommissionGoOut: 'Subcontracting issue', @@ -273,11 +273,11 @@ export default { endtime: 'Please select an end time', end: 'End time', starttime: 'Please select an start time', - start: 'start time', + start: 'Start time', _tips5: 'Please select the same location', _tips6: 'Please enter the order number to query first', Out: 'Out', - enter: 'enter', + enter: 'Enter', //移库 Warehouse_QueryCriteria: 'Query criteria', Warehouse_TransferOrderNo: 'Transfer order No', @@ -288,7 +288,7 @@ export default { Warehouse_OrderNo: 'Order No', LocationScanned: 'Location scanned', Warehouse_OriginalLocation: 'Original Loc', - code: 'code', + code: 'Inventory number', Warehouse_TargetLocation: 'Target Loc', Warehouse_Tip: 'Please input the transfer order No', transfer_barcode: 'Library transfer barcode', @@ -299,14 +299,14 @@ export default { Scrap_ScrapNo: 'Scrap', Scrap_Tip: 'Please input scrap No', Scrap_ScrapDetails: 'Scrap detail', - operatingTime: 'operatingTime', + operatingTime: 'OperatingTime', finishedProductReport: 'Scrap details', //领用借用 borrow_OrderNo: 'Order No', borrow_Tip: 'Please input order No', borrow_CollectionAndBorrowingDetails: 'Cost center detail', - usingDetail: 'borrowing details', + usingDetail: 'Borrowing details', //成品主菜单 // EnterTheWarehouse: 'Enter The Warehouse', @@ -327,10 +327,10 @@ export default { DumpListSH: 'SFG receive', DumpListSHMX: 'SFG receive detail', deliver: 'DN deliver goods', - Line: 'rowItem', - screen: 'screen', + Line: 'RowItem', + screen: 'Screen', time: 'Please select the time first', - po_Deliver: 'deliver', + po_Deliver: 'Deliver', //成品入库主菜单 product_item1: 'FG inward', product_item2: 'Transfer vehicle offline', @@ -349,12 +349,12 @@ export default { product_TransferCar: 'Transfer vehicle', product_MaterialCode: 'MAT code', product_FGCode: 'FG code', - product_add: 'add', + product_add: 'Add', product_FGDes: 'FG desc', product_MaterialDes: 'MAT desc', product_Number: 'Qty', repeatedly: 'Do not add repeatedly', - delete: 'delete', + delete: 'Delete', product_costCenter: 'Cost center', product_Unit: 'Unit', product_Cancel: 'Cancel', @@ -370,12 +370,12 @@ export default { product_Tip8: 'Success!', product_Tip9: 'The barcode is not in the warehouse', //半成品冰箱下线 - product_unit1: 'pcs', - product_unit2: 'pair', - product_unit3: 'yard', - product_unit4: 'set', - product_unit5: 'ctn', - product_unit6: 'other', + product_unit1: 'PCS', + product_unit2: 'Pair', + product_unit3: 'Yard', + product_unit4: 'Set', + product_unit5: 'CTN', + product_unit6: 'Other', product_unit7: 'Please input material barcode', //成品空调/洗衣机下线 //半成品门体上线 From 16379be177f783041bc4c1435eeaba97d990e7c8 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Fri, 21 Jan 2022 16:28:55 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=88=90=E5=93=81=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=95=BF=E5=AD=98=E6=8F=90=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inbound/finishProductOffline/index.vue | 21 +++----- .../product/outbound/stoOutbound/Back.vue | 7 +-- .../outbound/stoOutbound/DN-delivergoods.vue | 22 ++------ .../product/outbound/stoOutbound/index.vue | 6 +-- .../warehouse/LocationInventory/index.vue | 42 ++++----------- .../warehouse/MaterialInventory/index.vue | 44 ++++----------- .../product/warehouse/wholeCollect/index.vue | 37 +++---------- .../warehouse/wholeLnventory/index.vue | 25 ++------- .../product/warehouse/wholeScrap/index.vue | 54 ++++++------------- .../warehouse/wholeTransfer/Local-details.vue | 5 +- .../product/warehouse/wholeTransfer/index.vue | 32 +++-------- src/utils/mixin.ts | 4 +- 12 files changed, 74 insertions(+), 225 deletions(-) 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, }); } }