From 5a42a54da9518a204ba9451b4425fe7036b4cbfe Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 30 Jul 2024 17:28:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E5=8C=85=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/config.js | 2 + src/mycomponents/print/print.vue | 150 ++++++++++++++++++ src/pages/index/index.vue | 5 + src/pages/login/index.vue | 7 +- .../package/record/overPackageRecord.vue | 13 +- src/pages/setter/index.vue | 4 +- 6 files changed, 176 insertions(+), 5 deletions(-) create mode 100644 src/common/config.js create mode 100644 src/mycomponents/print/print.vue diff --git a/src/common/config.js b/src/common/config.js new file mode 100644 index 00000000..1288b666 --- /dev/null +++ b/src/common/config.js @@ -0,0 +1,2 @@ +export const overPagePrint="overPage_print" +export const overPageTemplate="overPage_Template" \ No newline at end of file diff --git a/src/mycomponents/print/print.vue b/src/mycomponents/print/print.vue new file mode 100644 index 00000000..f7e5439d --- /dev/null +++ b/src/mycomponents/print/print.vue @@ -0,0 +1,150 @@ + + + + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ce10f123..bff5bd9a 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -77,6 +77,11 @@ getSwitchByCode, getBusinessType } from '@/api/request2.js'; + + import { + overPagePrint, + overPageTemplate + } from '@/common/config.js'; export default { components: {}, diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 2206d6d9..20a86f20 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -97,6 +97,7 @@ import { getCaptchaImage } from '@/api/request2.js'; + import storage from '@/common/utils/storage' import { mapState, mapMutations @@ -124,8 +125,10 @@ // computed: mapState(['forcedLogin', 'hasLogin']), mounted() { this.tenantValue = this.tenantArray[0].value - uni.clearStorageSync() - uni.clearStorage(); //清除缓存 + // uni.clearStorageSync() + // uni.clearStorage(); //清除缓存 + + storage.clearStorage() if (process.env.NODE_ENV === 'development') { this.username = "admin" this.password = "win123456"; diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index dd5a5d24..e8872f30 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -4,6 +4,8 @@ + + @@ -110,7 +112,7 @@ import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import packUnit from '@/mycomponents/qty/packUnit.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' - + import print from '@/mycomponents/print/print.vue' import { getCurrDateTime @@ -128,7 +130,8 @@ packageTarget, recordComDetailCard, packUnit, - winComScanBalance + winComScanBalance, + print }, onLoad(option){ uni.setNavigationBarTitle({ @@ -235,6 +238,12 @@ }, getScanResult(result) { this.setData(result); + + setTimeout(res=>{ + + this.$res.printService.setDefaultData() + + }) }, setData(result) { diff --git a/src/pages/setter/index.vue b/src/pages/setter/index.vue index a8fb8437..a3e6a7e1 100644 --- a/src/pages/setter/index.vue +++ b/src/pages/setter/index.vue @@ -42,6 +42,8 @@ removeToken } from '@/common/utils/auth' + import storage from '@/common/utils/storage' + // #ifdef APP-PLUS import { appUpdate @@ -109,7 +111,7 @@ }; function clearStorage() { - uni.clearStorageSync() + storage.clearStorage() removeToken(); };