From cb5964dbc2c742843c6c80ab2d35576f725750bc Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 2 Sep 2024 13:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=202024/6/19=2017:19:08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/http.ts | 2 + src/hybrid/html/pointPutawayJob.html | 56 ++++++- src/main.ts | 3 + src/mycomponents/scan/winScanLocation.vue | 18 ++- .../scan/winScanPackAndLocation.vue | 16 +- src/pages.json | 1 + .../package/record/overPackageRecord.vue | 20 ++- src/pages/pointPutawayJob/index.vue | 147 +++++++++--------- src/plugins/storage.js | 42 +++++ src/store/modules/countStore.ts | 2 + 10 files changed, 223 insertions(+), 84 deletions(-) create mode 100644 src/plugins/storage.js diff --git a/src/api/http.ts b/src/api/http.ts index 93e5502a..73507521 100644 --- a/src/api/http.ts +++ b/src/api/http.ts @@ -95,6 +95,8 @@ instance.interceptors.response.use((v) => { } }) } else if(v.data.code == 401){ + uni.clearStorageSync() + uni.removeStorageSync('overPackageRecord') uni.showModal({ title: '系统提示', content: '账号未登录,请重新登录', diff --git a/src/hybrid/html/pointPutawayJob.html b/src/hybrid/html/pointPutawayJob.html index 20a53275..686bcb11 100644 --- a/src/hybrid/html/pointPutawayJob.html +++ b/src/hybrid/html/pointPutawayJob.html @@ -17,7 +17,7 @@ diff --git a/src/main.ts b/src/main.ts index 677698d8..a5c6e497 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,6 +10,7 @@ import comMessage from '@/mycomponents/common/comMessage.vue' import tab from './plugins/tab' import modal from './plugins/modal' import time from './plugins/time' +import storage from './plugins/storage' // unocss @@ -31,6 +32,8 @@ export function createApp() { app.config.globalProperties.$modal = modal // 时间对象 app.config.globalProperties.$time = time + // 缓存 + app.config.globalProperties.$storage = storage app.component('com-message', comMessage) diff --git a/src/mycomponents/scan/winScanLocation.vue b/src/mycomponents/scan/winScanLocation.vue index 033ea7b9..4236ee3e 100644 --- a/src/mycomponents/scan/winScanLocation.vue +++ b/src/mycomponents/scan/winScanLocation.vue @@ -14,6 +14,9 @@ + + + @@ -43,11 +46,16 @@ const location = ref({}) const show = ref(false) const scan = ref() const comMessageRef = ref() +const comscansimulate = ref() const openScanPopup = () => { setTimeout((res) => { show.value = true }, 500) } +const openScanPopupSimulate = (location) => { + comscansimulate.value.setItemCodeSimulate(location) + comscansimulate.value.clickScanMsg() +} const closeScanPopup = () => { show.value = false } @@ -119,10 +127,14 @@ const checkLocationType = (type) => { return isPass } const getfocus = () => { - scan.value.getfocus() + if (scan.value) { + scan.value.getfocus() + } } const losefocus = () => { - scan.value.losefocus() + if (scan.value) { + scan.value.losefocus() + } } const showErrorMessage = (message) => { setTimeout((r) => { @@ -138,7 +150,7 @@ const showErrorMessage = (message) => { // 传递给父类 const emit = defineEmits(['getLocation']) -defineExpose({ openScanPopup }) +defineExpose({ openScanPopup, openScanPopupSimulate }) diff --git a/src/mycomponents/scan/winScanPackAndLocation.vue b/src/mycomponents/scan/winScanPackAndLocation.vue index 39886bcd..c2534e03 100644 --- a/src/mycomponents/scan/winScanPackAndLocation.vue +++ b/src/mycomponents/scan/winScanPackAndLocation.vue @@ -17,7 +17,7 @@ placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> --> - + @@ -108,6 +108,10 @@ const balanceSelectRef = ref() const comscan = ref() const comMessageRef = ref() const location = ref() + +const handleConfirm = () => { + emit('confirm', fromLocationCode.value) +} // 直接扫描 const openScanPopupForType = (fromLocationCodeParams, businessTypeParams) => { businessType.value = businessTypeParams @@ -120,9 +124,11 @@ const openScanPopupForType = (fromLocationCodeParams, businessTypeParams) => { fromInventoryStatuses.value = getDirectoryItemArray(businessType.value.outInventoryStatuses) inventoryStatus.value = getDirectoryItemArray(businessType.value.outInventoryStatuses) // 出库库存状态 fromLocationAreaTypeList.value = getDirectoryItemArray(businessType.value.fromLocationAreaTypeList) // 出库库区 - setTimeout((res) => { - show.value = true - }, 500) + if (!show.value) { + setTimeout((res) => { + show.value = true + }, 500) + } } // 在任务中扫描 @@ -426,7 +432,7 @@ const addLocationCode = (code) => { } } // 传递给父类 -const emit = defineEmits(['close', 'getCountScanResult', 'getResult']) +const emit = defineEmits(['close', 'getCountScanResult', 'getResult', 'confirm']) defineExpose({ openScanPopupForType, openScanPopupForJob, packGetFocus, packLoseFocus, closeScanPopup }) diff --git a/src/pages.json b/src/pages.json index ea8d08be..e4b2dedc 100644 --- a/src/pages.json +++ b/src/pages.json @@ -2074,6 +2074,7 @@ } }, { + "path": "pages/check/checkFgLabel", "style": { "navigationBarTitleText": "标签成品标签", "enablePullDownRefresh": false diff --git a/src/pages/package/record/overPackageRecord.vue b/src/pages/package/record/overPackageRecord.vue index 29771438..f167dba1 100644 --- a/src/pages/package/record/overPackageRecord.vue +++ b/src/pages/package/record/overPackageRecord.vue @@ -53,7 +53,7 @@ - + @@ -106,7 +106,7 @@ const scanPopup = ref() const scanLocationCode = ref() const toPackUnit = ref() const comMessageRef = ref() -onLoad((option) => { +onShow(() => { const typeCode = 'OverPackage' getBusinessType(typeCode, (res) => { if (res.success) { @@ -164,7 +164,10 @@ const confirmSelect = (e) => { toPackQty.value = pack.packQty toPackUnitShow.value = e[0].label } - +// 修改库位 +const handleConfirm = (fromLocationCode) => { + scanLocationCode.value.openScanPopupSimulate(fromLocationCode) +} const getScanResult = (result) => { const { balance } = result const { label } = result @@ -237,7 +240,13 @@ const openScanPopup = () => { const showFromLocationPopup = () => { nextTick(() => { - scanLocationCode.value.openScanPopup() + const overPackageRecord = uni.getStorageSync('overPackageRecord') + + if (overPackageRecord) { + scanLocationCode.value.openScanPopupSimulate(overPackageRecord) + } else { + scanLocationCode.value.openScanPopup() + } }) } @@ -372,6 +381,9 @@ const closeScanMessage = () => { scanPopupGetFocus() } const getLocation = (location, code) => { + if (code) { + uni.setStorageSync('overPackageRecord', code) + } getFromLocationCode(location, code) } const getFromLocationCode = (location, code) => { diff --git a/src/pages/pointPutawayJob/index.vue b/src/pages/pointPutawayJob/index.vue index bd595617..0dd724bb 100644 --- a/src/pages/pointPutawayJob/index.vue +++ b/src/pages/pointPutawayJob/index.vue @@ -2,22 +2,28 @@ - + - 目标库位:{{ data.toLocationCode }} + 目标库位:{{ item.toLocationCode }} - - 任务编号:{{ data.number }} - - - 创建人:{{ data.creator || '' }} - - - 创建时间:{{ formatDate(data.createTime) }} + + + + 物料号:{{ item.itemCode }} + + + 托包装号:{{ item.packingNumber }} + + + + + 数量:{{ item.packQty }}个 + + - + @@ -178,52 +184,30 @@ export default { let str = '' this.readFile(htmlFileUrl, (htmlContent) => { this.newHtmlContent = htmlContent - // this.data.forEach(item => { - str += `

-
-
- 目标库位:${this.data.toLocationCode} -
-
- 任务编号:${this.data.number} -
-
- 创建人:${this.data.creator} -
-
- 创建时间:${this.formatDate(this.data.createTime)} -
-
- - - - - - - - - - - tableTrTd -
物品代码物品描述批次包装号包装规格数量计量单位
-
- ` - let str1 = '' - this.data.sublist.forEach((cur, key) => { - str1 += ` - - ${cur.itemCode} - ${cur.itemDesc1} - ${cur.batch} - ${cur.packingNumber} - ${cur.packUnit} - ${cur.qty} - ${cur.uom} - - ` + this.data.sublist.forEach((item) => { + str += `

+
+
+ 目标库位:
${item.toLocationCode}
+
+
+
+
+ 物料号:
${item.itemCode}
+
+
+ 托包装号:
${item.packingNumber}
+
+
+
+
+ 数量:
${item.packQty}个
+
+
+
+
+ ` }) - str = str.replace('tableTrTd', str1) - // }) this.newHtmlContent = this.newHtmlContent.replace('mainBody', str) // 替换物品代码 }) }) @@ -235,7 +219,7 @@ export default { .box { font-size: 26rpx; /* display: flex; */ - padding: 20rpx; + /* padding: 20rpx; */ border: 1px solid #dedede; } @@ -292,25 +276,46 @@ export default { .mb-kw { border-bottom: 1px solid #dedede; - padding-bottom: 20rpx; + padding: 20rpx; + font-size: 30rpx; } -.mb-kw text { +.mb-kw view { + font-weight: bold; + font-size: 46rpx; + text-align: center; +} +.mb-bo { + display: flex; +} +.mb-bo .mb-left { + flex: 1; +} +.mb-bo .mb-left .mb-text { + padding: 20rpx; +} +.mb-bo .mb-left .mb-text:nth-child(1) { + border-bottom: 1px solid #dedede; +} +.mb-bo .mb-left .mb-text view { font-weight: bold; font-size: 32rpx; + text-align: center; } - -.mb-text { - margin-top: 10rpx; +.mb-bo .mb-right { + padding: 20rpx; + width: 260rpx; + border-left: 1px solid #dedede; + display: flex; + align-items: center; } - -::v-deep .u-th { - font-size: 24rpx !important; +.mb-bo .mb-right .mb-text { + width: 100%; } - -::v-deep .u-td { - height: auto !important; - font-size: 24rpx !important; - word-break: break-all; +.mb-bo .mb-right .mb-text view { + font-weight: bold; + font-size: 40rpx; + text-align: center; + width: 100%; } diff --git a/src/plugins/storage.js b/src/plugins/storage.js new file mode 100644 index 00000000..ecc8c283 --- /dev/null +++ b/src/plugins/storage.js @@ -0,0 +1,42 @@ +export default { + // 获取本地存储对应key + getStorage(key){ + return uni.getStorageSync( key ); + }, + // 设置本地存储对应key + setStorage(key,value){ + return uni.setStorageSync( key,value ); + }, +// 清除全部本地存储 + clearStorage (){ + const overPackageRecordPointParams = '' + if( uni.getStorageSync('overPackageRecordPointParams')){ + overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams') + } + const overPackageJobDetailPointParams = '' + if( uni.getStorageSync('overPackageJobDetailPointParams')){ + overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams') + } + uni.clearStorageSync(); + if(overPackageRecordPointParams){ + uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams) + } + if(overPackageJobDetailPointParams){ + uni.setStorageSync('overPackageJobDetailPointParams',overPackageJobDetailPointParams) + } + + }, +// 清除指定key本地存储 + removeStorage ( key ){ + uni.removeStorageSync( key ); + }, + // 关闭当前页面,返回上一页面或多级页面 + constant:{ + id:"id", + token:"token", + avatar: 'avatar', + name: 'name', + roles: 'roles', + permissions: 'permissions' + } +} diff --git a/src/store/modules/countStore.ts b/src/store/modules/countStore.ts index dfc0e889..6b2d9b8e 100644 --- a/src/store/modules/countStore.ts +++ b/src/store/modules/countStore.ts @@ -1,4 +1,5 @@ import { defineStore } from 'pinia' +import * as storage from '@/plugins/storage.js' import { login, logout, @@ -110,6 +111,7 @@ const useStore = defineStore('storeId', { this.post = '' this.dept = '' removeToken() + storage.clearStorage() resolve(res) }).catch(error => { reject(error)