WMS_PDA/src/App.vue
liufumingren e8db7a2293 feat: 退件收件任务模块(列表/扫码登记/扫描记录/导出)+ 库存盘点作业页完善
- 退件收件:returnRecord 改为收件任务列表(默认只看本人创建、可切全部、新建任务默认「用户名 当天日期」、左滑删除),扫码登记抽到 ReturnScanPanel 组件并由 returnRecordScan 页面承载,登记带 return_received_task_id

- 扫描记录:按任务 ID 过滤、底部剩余空间独立滚动(上拉/点击加载更多、下拉刷新)、标题显示任务登记总条数、原单退回显示货主名、常用备注抽屉(localStorage)、导出(异步任务+进度轮询+二维码/复制链接)

- 库存盘点:库位/商品/单库位作业页拆分与 workDataDetail/workDataSpaceDetails/recordList 接入;App.vue 图片预览层 z-index、auth-guard 整页启动路由修复;apis.js 补 returnReceivedTask/returnReceived.list/export 与漏登记保护
2026-10-06 04:49:40 +08:00

87 lines
3.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script>
import { getToken } from '@/core/utils/auth'
import { ensureEntry } from '@/core/utils/auth-guard'
let bootstrapping = false
let validatedToken = ''
// H5(history 模式)下,整页直接刷新/打开 packMode 等“非入口页”时 uni-app 不创建页面视图(白屏)。
// 该状态仅本次整页启动时自愈一次(页面缺失则回跳入口),避免重复触发。
let h5WhiteHealDone = false
export default {
onLaunch() {
this.bootstrapAuth()
},
onShow() {
this.bootstrapAuth()
this.h5WhiteScreenHeal()
},
methods: {
async bootstrapAuth() {
if (bootstrapping) {
return
}
const token = getToken()
const forceValidate = !!token && token !== validatedToken
bootstrapping = true
try {
const result = await ensureEntry(this.$store, forceValidate)
validatedToken = result.loggedIn ? token : ''
} finally {
bootstrapping = false
}
},
// H5 白屏自愈:manifest h5 路由为 history 模式时,若应用是“整页加载”方式
// 直接从 packMode 等非 tab、非入口页启动,uni-app 不会渲染出页面视图(uni-page),
// 且该会话内后续客户端跳转同样失效,页面会一直白屏(刷新也无法恢复)。
// 这里在启动后检测:uni-app 外壳已挂载但 uni-page 缺失 → 判定为白屏态,
// 整页回跳根路径让应用从入口正常启动,避免停留在白屏。真机/App 端不参与编译。
h5WhiteScreenHeal() {
// #ifdef H5
if (h5WhiteHealDone) return
h5WhiteHealDone = true
if (typeof window === 'undefined' || !window.location) return
const bootPath = window.location.pathname || '/'
// 入口页(根/登录页)本身可正常渲染,无需处理
if (bootPath === '/' || bootPath === '/pages/login/index') return
setTimeout(() => {
// 外壳 uni-app 已存在但页面视图 uni-page 缺失 → 白屏,回跳入口
const shell = document.querySelector('uni-app')
const page = document.querySelector('uni-page')
if (shell && !page) {
console.warn('[App] H5 深链接整页启动未渲染页面视图(白屏),自动回跳入口页:', bootPath)
window.location.replace('/')
}
}, 1500)
// #endif
}
}
}
</script>
<style lang="scss">
/* 每个页面公共css */
@import "@/uni_modules/uview-ui/index.scss";
@import "common/demo.scss";
.status_bar {
height: var(--status-bar-height);
background-color: #FFFFFF;
}
.normar_container{
height:100vh;
display:flex;
flex-direction: column;
background-color: #f8f8f8;
}
/* uni 系统图片预览层(uni.previewImage):
H5 下框架给 .uni-system-preview-image 的 z-index 只有 999,会被 uView 弹窗
(popup 默认 10075、toast 10090)盖住 —— 表现为"在弹窗里点图片预览看不到"。
这里统一抬高到所有业务弹层之上(App 端预览是原生全屏,不受此样式影响)。 */
.uni-system-preview-image {
z-index: 10100 !important;
}
</style>