修改打包模式页面

This commit is contained in:
zm2000 2026-09-12 18:00:22 +08:00
parent f39d7e6f4d
commit e3f3c7af09

View File

@ -1,13 +1,22 @@
<template> <template>
<view class="page"> <view class="page">
<view class="mode-topbar"> <view class="mode-topbar">
<text class="mode-title">{{ modeTitle }}</text> <view class="mode-title-wrap">
<image class="mode-logo" src="/static/images/1.png" mode="heightFix" />
<view class="mode-title">{{ modeTitle }}</view>
</view>
<view class="topbar-actions"> <view class="topbar-actions">
<button <button
class="operator-btn" class="operator-btn"
:class="workbenchMember ? 'operator-btn--bound' : ''" :class="workbenchMember ? 'operator-btn--bound' : ''"
@click="handleOperatorClick" @click="handleOperatorClick"
>{{ topbarOperatorText }}</button> >
<view v-if="workbenchMember" class="operator-user-icon">
<view class="operator-user-icon-head"></view>
<view class="operator-user-icon-body"></view>
</view>
<text>{{ topbarOperatorText }}</text>
</button>
<button class="logout-btn" type="warn" @click="handleLogout">退出</button> <button class="logout-btn" type="warn" @click="handleLogout">退出</button>
</view> </view>
</view> </view>
@ -36,9 +45,10 @@
@focus="handleSearchFocus" @focus="handleSearchFocus"
@blur="handleSearchBlur" @blur="handleSearchBlur"
/> />
<view v-if="keyword" class="pack-search-clear" @click="clearKeyword">×</view>
</view> </view>
<view class="pack-card pack-wave"> <view v-if="hasPackRecord" class="pack-card pack-wave">
<view class="pack-wave-head"> <view class="pack-wave-head">
<text class="pack-card-title">{{ isSandan === 1 ? '运单' : '波次' }}</text> <text class="pack-card-title">{{ isSandan === 1 ? '运单' : '波次' }}</text>
<text class="pack-wave-no">{{ isSandan === 1 ? (currentWaybillCode || '暂无运单') : (currentWaveNo || '暂无波次') }}</text> <text class="pack-wave-no">{{ isSandan === 1 ? (currentWaybillCode || '暂无运单') : (currentWaveNo || '暂无波次') }}</text>
@ -60,7 +70,7 @@
</view> </view>
</view> </view>
<view class="pack-card pack-detail"> <view v-if="hasPackRecord" class="pack-card pack-detail">
<view class="pack-detail-title"> <view class="pack-detail-title">
<text class="pack-card-title">商品明细</text> <text class="pack-card-title">商品明细</text>
<text <text
@ -107,6 +117,11 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<view v-if="!hasPackRecord" class="pack-left-empty">
<text class="pack-left-empty-text">暂无打包记录</text>
<text class="pack-left-empty-sub">扫码运单号开始打包</text>
</view>
</view> </view>
<!-- 右面板 30% --> <!-- 右面板 30% -->
@ -126,11 +141,18 @@
</view> </view>
<view class="pack-card pack-records"> <view class="pack-card pack-records">
<text class="pack-card-title">扫描记录</text> <view class="pack-records-title">
<text class="pack-records-title-text">扫描记录</text>
</view>
<view class="pack-records-body"> <view class="pack-records-body">
<view v-if="scanRecords.length === 0" class="pack-empty">暂无扫描记录</view> <view v-if="scanRecords.length === 0" class="pack-empty">暂无扫描记录</view>
<scroll-view v-else scroll-y class="pack-records-scroll"> <scroll-view v-else scroll-y class="pack-records-scroll">
<view v-for="(record, index) in scanRecords" :key="index" class="pack-record-item"> <view
v-for="(record, index) in scanRecords"
:key="index"
class="pack-record-item"
:class="{ 'pack-record-item--even': index % 2 === 0 }"
>
<text class="pack-record-text">{{ record.text }}</text> <text class="pack-record-text">{{ record.text }}</text>
<text class="pack-record-time">{{ record.time }}</text> <text class="pack-record-time">{{ record.time }}</text>
</view> </view>
@ -144,6 +166,7 @@
<!-- 真机扫码捕获:保持隐藏 input 聚焦,WebView 才会持续派发按键 --> <!-- 真机扫码捕获:保持隐藏 input 聚焦,WebView 才会持续派发按键 -->
<input <input
v-if="enableHiddenInputCapture" v-if="enableHiddenInputCapture"
ref="scanHiddenInput"
class="scan-hidden-input" class="scan-hidden-input"
v-model="scanHiddenValue" v-model="scanHiddenValue"
:focus="scanInputFocus" :focus="scanInputFocus"
@ -462,6 +485,9 @@ export default {
groupVerifiedCount() { groupVerifiedCount() {
return this.scannedKindCount return this.scannedKindCount
}, },
hasPackRecord() {
return !!(this.currentOrderRaw || this.currentOrderCode || this.detailList.length > 0)
},
}, },
watch: { watch: {
groupVerifiedCount(val) { groupVerifiedCount(val) {
@ -497,16 +523,19 @@ export default {
}, },
methods: { methods: {
handlePackSearch() { handlePackSearch() {
const kw = String(this.keyword || '').trim() const kw = this.dedupeRepeatedScan(String(this.keyword || '').trim())
if (!kw) { if (!kw) {
return return
} }
console.log('[packaging][scan] handlePackSearch keyword =', kw)
// 工作台信息未就绪时不处理(加载中/失败态) // 工作台信息未就绪时不处理(加载中/失败态)
if (this.infoLoading || this.infoError) { if (this.infoLoading || this.infoError) {
console.log('[packaging][scan] handlePackSearch skip: infoLoading =', this.infoLoading, 'infoError =', this.infoError)
return return
} }
// 未绑定操作员:扫码/输入内容走绑定操作员流程 // 未绑定操作员:扫码/输入内容走绑定操作员流程
if (!this.workbenchMember) { if (!this.workbenchMember) {
console.log('[packaging][scan] handlePackSearch -> queryAndBindOperator (未绑定操作员)')
this.queryAndBindOperator(kw) this.queryAndBindOperator(kw)
return return
} }
@ -534,6 +563,12 @@ export default {
this.queryPackOrderByCode(kw) this.queryPackOrderByCode(kw)
}, },
queryPackOrderByCode(code) { queryPackOrderByCode(code) {
console.log('[packaging][query] queryPackOrderByCode code =', code)
// 未绑定操作员时禁止查询订单,避免绕过绑定流程直接查询
if (!this.workbenchMember) {
uni.showToast({ title: '请先绑定操作员', icon: 'none' })
return
}
const token = this.getWorkbenchToken() const token = this.getWorkbenchToken()
if (!token) { if (!token) {
uni.showToast({ title: '工作台登录已失效', icon: 'none' }) uni.showToast({ title: '工作台登录已失效', icon: 'none' })
@ -563,6 +598,10 @@ export default {
payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null
const flag = body?.flag || raw?.flag || '' const flag = body?.flag || raw?.flag || ''
const bizCode = body?.code ?? raw?.code ?? null const bizCode = body?.code ?? raw?.code ?? null
if (Number(bizCode) === 401) {
this.handleWorkbenchAuthExpired()
return
}
if (flag === 'failure') { if (flag === 'failure') {
uni.showToast({ uni.showToast({
title: body?.message || body?.msg || '未找到对应订单', title: body?.message || body?.msg || '未找到对应订单',
@ -570,7 +609,7 @@ export default {
}) })
return return
} }
if (Number(bizCode) === 401 || Number(bizCode) === 403) { if (Number(bizCode) === 403) {
uni.showToast({ title: '工作台登录已失效,请重新登录', icon: 'none' }) uni.showToast({ title: '工作台登录已失效,请重新登录', icon: 'none' })
return return
} }
@ -810,7 +849,13 @@ export default {
} }
return packOrder(payload).then((body) => { return packOrder(payload).then((body) => {
const res = body?.data || body?.result || body const res = body?.data || body?.result || body
const flag = body?.flag || res?.flag || '' const raw = res && typeof res === 'object' && !Array.isArray(res) ? res : null
const flag = body?.flag || raw?.flag || ''
const bizCode = body?.code ?? raw?.code ?? null
if (Number(bizCode) === 401) {
this.handleWorkbenchAuthExpired()
throw new Error('工作台登录已失效')
}
if (flag === 'failure') { if (flag === 'failure') {
throw new Error(body?.message || body?.msg || '打包上报失败') throw new Error(body?.message || body?.msg || '打包上报失败')
} }
@ -837,29 +882,21 @@ export default {
handleSubmitGroupPack() { handleSubmitGroupPack() {
this.startPack() this.startPack()
}, },
ensurePackFinishedBeforeLeave() { async ensurePackFinishedBeforeLeave() {
const token = this.getWorkbenchToken() const token = this.getWorkbenchToken()
if (!token) { if (!token || !this.packStarted || this.packFinishing) {
return
}
if (!this.packStarted) {
return
}
if (this.packFinishing) {
return return
} }
this.packFinishing = true this.packFinishing = true
finishPack(String(token)) try {
.then(() => { await finishPack(String(token))
this.packStarted = false this.packStarted = false
this.speak('打包完成') this.speak('打包完成')
}) } catch (e) {
.catch(() => { // 失败不阻断
// 失败不阻断 } finally {
}) this.packFinishing = false
.finally(() => { }
this.packFinishing = false
})
}, },
clearPackState() { clearPackState() {
this.detailList = [] this.detailList = []
@ -1006,10 +1043,19 @@ export default {
handleSearchBlur() { handleSearchBlur() {
this.searchFocused = false this.searchFocused = false
this.searchFocus = false this.searchFocus = false
if (this.enableHiddenInputCapture) {
this.scheduleScanInputFocus(150)
}
}, },
activateSearchInput() { activateSearchInput() {
this.searchFocus = true this.searchFocus = true
}, },
clearKeyword() {
this.keyword = ''
this.scanBurstConfirmed = false
// 真机下扫码输入走隐藏输入框,聚焦隐藏框而非可见搜索框,避免弹出软键盘
this.scheduleScanInputFocus(150)
},
/** /**
* 全局键盘监听:扫码枪广播扫描识别 * 全局键盘监听:扫码枪广播扫描识别
* 扫码枪本质是模拟键盘的 HID 设备,字符走浏览器标准 keydown 事件广播。 * 扫码枪本质是模拟键盘的 HID 设备,字符走浏览器标准 keydown 事件广播。
@ -1272,8 +1318,19 @@ export default {
this.scanHiddenFocused = true this.scanHiddenFocused = true
this.scanInputFocus = true this.scanInputFocus = true
this.clearHiddenRefocusTimer() this.clearHiddenRefocusTimer()
this.applyScanInputAttrs()
this.suppressSoftKeyboardBurst() this.suppressSoftKeyboardBurst()
}, },
applyScanInputAttrs() {
const input = this.getScanHiddenInputEl()
if (!input || typeof input.setAttribute !== 'function') {
return
}
input.setAttribute('autocapitalize', 'off')
input.setAttribute('autocorrect', 'off')
input.setAttribute('autocomplete', 'off')
input.setAttribute('spellcheck', 'false')
},
handleHiddenScanBlur() { handleHiddenScanBlur() {
if (!this.isPageActive() || !this.enableHiddenInputCapture) { if (!this.isPageActive() || !this.enableHiddenInputCapture) {
return return
@ -1299,7 +1356,7 @@ export default {
return return
} }
const value = event?.detail?.value || '' const value = event?.detail?.value || ''
this.scanHiddenValue = value // v-model 已同步 scanHiddenValue,这里仅回填可见搜索框并防抖提交
this.keyword = value this.keyword = value
this.clearHiddenScanTimer() this.clearHiddenScanTimer()
this.scanHiddenTimer = setTimeout(() => { this.scanHiddenTimer = setTimeout(() => {
@ -1327,10 +1384,31 @@ export default {
return return
} }
this.scanHiddenValue = '' this.scanHiddenValue = ''
this.clearScanHiddenInputValue()
this.dismissSoftKeyboard() this.dismissSoftKeyboard()
this.submitScanCode(code, 'hidden') this.submitScanCode(code, 'hidden')
this.ensureScanInputFocus() this.ensureScanInputFocus()
}, },
clearScanHiddenInputValue() {
const input = this.getScanHiddenInputEl()
if (input) {
input.value = ''
}
},
getScanHiddenInputEl() {
const ref = this.$refs.scanHiddenInput
if (!ref) {
return null
}
const el = ref.$el || ref
if (!el) {
return null
}
if (el.tagName === 'INPUT') {
return el
}
return typeof el.querySelector === 'function' ? el.querySelector('input') : null
},
ensureScanInputFocus() { ensureScanInputFocus() {
if (!this.isPageActive()) { if (!this.isPageActive()) {
return return
@ -1343,6 +1421,18 @@ export default {
if (!this.scanInputFocus) { if (!this.scanInputFocus) {
this.scanInputFocus = true this.scanInputFocus = true
} }
// 状态可能已为 true 但原生 input 实际已失焦,直接同步聚焦兜底
this.focusScanHiddenInput()
},
focusScanHiddenInput() {
const input = this.getScanHiddenInputEl()
if (input && typeof input.focus === 'function') {
try {
input.focus()
} catch (e) {
// 忽略聚焦失败
}
}
}, },
scheduleScanInputFocus(delay = 0) { scheduleScanInputFocus(delay = 0) {
if (!this.isPageActive()) { if (!this.isPageActive()) {
@ -1361,31 +1451,62 @@ export default {
return return
} }
this.clearKeyboardSuppressTimers() this.clearKeyboardSuppressTimers()
// 仅聚焦时隐藏一次软键盘,避免扫描过程中反复 hideKeyboard 打断输入
uni.hideKeyboard?.() uni.hideKeyboard?.()
;[80, 180, 320].forEach((delay) => {
const timer = setTimeout(() => {
if (!this.isPageActive()) {
return
}
uni.hideKeyboard?.()
}, delay)
this.scanKeyboardSuppressTimers.push(timer)
})
}, },
dismissSoftKeyboard() { dismissSoftKeyboard() {
if (!this.isPageActive()) { if (!this.isPageActive()) {
return return
} }
if (typeof document !== 'undefined') { // 不主动 blur,避免隐藏输入框失焦导致下一次扫码首字符丢失
document.activeElement?.blur?.()
}
uni.hideKeyboard?.() uni.hideKeyboard?.()
}, },
/**
* 扫码枪连续读取同一码时,隐藏输入框可能累积为同一内容重复多次(可能带不完整尾段)。
* 检测重复并只保留第一段完整内容;单段长度需 >= 8 才去重,避免误截短码。
*/
dedupeRepeatedScan(value) {
const s = String(value || '').trim()
const n = s.length
if (n < 2) {
return s
}
const minUnit = 8
const maxUnit = Math.floor(n / 2)
// 完整重复:s = p * k(k >= 2)
for (let len = minUnit; len <= maxUnit; len++) {
if (n % len === 0) {
const p = s.slice(0, len)
if (p.repeat(n / len) === s) {
return p
}
}
}
// 不完整尾段:s = p * k + p 的前缀(k >= 2)
for (let len = minUnit; len <= maxUnit; len++) {
const p = s.slice(0, len)
let rest = s
let count = 0
while (rest.length >= len && rest.slice(0, len) === p) {
rest = rest.slice(len)
count++
}
if (
count >= 2 &&
rest.length > 0 &&
rest.length < len &&
p.slice(0, rest.length) === rest
) {
return p
}
}
return s
},
submitScanCode(code, source) { submitScanCode(code, source) {
if (!this.isPageActive()) { if (!this.isPageActive()) {
return return
} }
const trimmed = (code || '').trim() const trimmed = this.dedupeRepeatedScan((code || '').trim())
if (!trimmed) { if (!trimmed) {
return return
} }
@ -1398,6 +1519,7 @@ export default {
return return
} }
this.lastSubmittedScan = { code: trimmed, at: now } this.lastSubmittedScan = { code: trimmed, at: now }
console.log('[packaging][scan] submitScanCode source =', source, 'code =', trimmed)
// 绑定操作员弹窗打开时:扫码内容进入弹窗临时码输入框并查询(plus.key / 隐藏 input 链路) // 绑定操作员弹窗打开时:扫码内容进入弹窗临时码输入框并查询(plus.key / 隐藏 input 链路)
if (this.operatorDialogVisible) { if (this.operatorDialogVisible) {
if (!this.workbenchMember) { if (!this.workbenchMember) {
@ -1492,6 +1614,8 @@ export default {
this.operatorResult = null this.operatorResult = null
this.operatorSearched = false this.operatorSearched = false
this.clearOperatorSearchTimer() this.clearOperatorSearchTimer()
// 关闭弹窗后把焦点还给隐藏扫码输入框,避免下次扫码首字符丢失
this.scheduleScanInputFocus(150)
}, },
handleOperatorInput() { handleOperatorInput() {
// 手动输入停止后自动查询 // 手动输入停止后自动查询
@ -1519,6 +1643,7 @@ export default {
uni.showToast({ title: '请输入/扫描登录临时码', icon: 'none' }) uni.showToast({ title: '请输入/扫描登录临时码', icon: 'none' })
return return
} }
console.log('[packaging][scan] handleOperatorSearch operatorCode =', code)
this.operatorSearched = true this.operatorSearched = true
this.operatorResult = null this.operatorResult = null
this.queryAndBindOperator(code) this.queryAndBindOperator(code)
@ -1535,6 +1660,10 @@ export default {
payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null
const flag = body?.flag || raw?.flag || '' const flag = body?.flag || raw?.flag || ''
const bizCode = body?.code ?? raw?.code ?? null const bizCode = body?.code ?? raw?.code ?? null
if (Number(bizCode) === 401) {
this.handleWorkbenchAuthExpired()
return
}
if (flag === 'failure' || Number(bizCode) === 404) { if (flag === 'failure' || Number(bizCode) === 404) {
this.operatorResult = null this.operatorResult = null
uni.showToast({ title: '未找到该用户', icon: 'none' }) uni.showToast({ title: '未找到该用户', icon: 'none' })
@ -1592,10 +1721,12 @@ export default {
payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null
const flag = body?.flag || raw?.flag || '' const flag = body?.flag || raw?.flag || ''
const bizCode = body?.code ?? raw?.code ?? null const bizCode = body?.code ?? raw?.code ?? null
if (Number(bizCode) === 401) {
this.handleWorkbenchAuthExpired()
return
}
if (flag === 'failure') { if (flag === 'failure') {
if (Number(bizCode) === 401) { if (Number(bizCode) === 403) {
uni.showToast({ title: '工作台 token 无效', icon: 'none' })
} else if (Number(bizCode) === 403) {
uni.showToast({ title: '工作台不存在或 token 无效', icon: 'none' }) uni.showToast({ title: '工作台不存在或 token 无效', icon: 'none' })
} else { } else {
uni.showToast({ title: body?.message || body?.msg || '绑定失败', icon: 'none' }) uni.showToast({ title: body?.message || body?.msg || '绑定失败', icon: 'none' })
@ -1640,46 +1771,76 @@ export default {
this.removeConfirmVisible = false this.removeConfirmVisible = false
return return
} }
this.doRemoveOperator(this.workbenchMember.id)
},
/**
* 解绑操作员(统一入口)
* - 先上报打包完成,再调用 workbench.removeMember
* - silent=true:静默解绑(退出流程用),不弹提示、失败不阻断
* - 成功后清空订单/核实数据,防止残留给下一位操作员
*/
async doRemoveOperator(memberId, options = {}) {
const { silent = false } = options
const token = this.getWorkbenchToken() const token = this.getWorkbenchToken()
if (!token) { if (!token) {
this.removeConfirmVisible = false if (!silent) {
uni.showToast({ title: '工作台登录已失效', icon: 'none' }) this.exitToLogin('工作台登录已失效,请重新登录', { clearStored: true })
}
return return
} }
if (this.operatorRemoving) { if (this.operatorRemoving) {
return return
} }
// 1. 先上报打包完成
await this.ensurePackFinishedBeforeLeave()
this.operatorRemoving = true this.operatorRemoving = true
removeWorkbenchMember({ try {
ids: [this.workbenchMember.id], const body = await removeWorkbenchMember({
token: String(token), ids: [Number(memberId)],
}) token: String(token),
.then((body) => { })
const payload = body?.data || body?.result || body const payload = body?.data || body?.result || body
const raw = const raw =
payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null
const flag = body?.flag || raw?.flag || '' const flag = body?.flag || raw?.flag || ''
if (flag === 'failure') { const bizCode = body?.code ?? raw?.code ?? null
if (Number(bizCode) === 401) {
// 401:token 失效,统一回登录页(静默场景交由退出流程处理)
if (!silent) {
this.handleWorkbenchAuthExpired()
}
return
}
if (flag === 'failure') {
if (!silent) {
uni.showToast({ title: body?.message || body?.msg || '移除失败', icon: 'none' }) uni.showToast({ title: body?.message || body?.msg || '移除失败', icon: 'none' })
return
} }
const removed = Number(raw?.removed ?? body?.removed ?? 0) return
if (removed > 0) { }
this.ensurePackFinishedBeforeLeave() const removed = Number(raw?.removed ?? body?.removed ?? 0)
this.workbenchMember = null if (removed > 0) {
uni.removeStorageSync(MEMBER_STORAGE_KEY) this.workbenchMember = null
this.removeConfirmVisible = false uni.removeStorageSync(MEMBER_STORAGE_KEY)
// 清空订单/核实数据,防止残留给下一位操作员
this.clearPackState()
this.removeConfirmVisible = false
this.operatorCode = ''
this.operatorResult = null
this.operatorSearched = false
if (!silent) {
this.speak('已移除操作员')
uni.showToast({ title: '已移除操作员', icon: 'none' }) uni.showToast({ title: '已移除操作员', icon: 'none' })
} else {
uni.showToast({ title: '未找到可移除的成员', icon: 'none' })
} }
}) } else if (!silent) {
.catch(() => { uni.showToast({ title: '未找到可移除的成员', icon: 'none' })
}
} catch (e) {
if (!silent) {
uni.showToast({ title: '网络异常,请稍后重试', icon: 'none' }) uni.showToast({ title: '网络异常,请稍后重试', icon: 'none' })
}) }
.finally(() => { } finally {
this.operatorRemoving = false this.operatorRemoving = false
}) }
}, },
pickInfoField(raw, body, keys) { pickInfoField(raw, body, keys) {
const sources = [raw, body] const sources = [raw, body]
@ -1746,7 +1907,7 @@ export default {
payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : null
const flag = body?.flag || raw?.flag || '' const flag = body?.flag || raw?.flag || ''
const bizCode = body?.code ?? raw?.code ?? null const bizCode = body?.code ?? raw?.code ?? null
if (flag === 'failure' || Number(bizCode) === 403) { if (flag === 'failure' || Number(bizCode) === 401 || Number(bizCode) === 403) {
this.workbenchInfo = null this.workbenchInfo = null
this.infoError = '工作台不存在或 token 无效' this.infoError = '工作台不存在或 token 无效'
// token 已失效:清除本地保存的工作台会话,回到登录页重新绑定 // token 已失效:清除本地保存的工作台会话,回到登录页重新绑定
@ -1782,6 +1943,14 @@ export default {
this.infoLoading = false this.infoLoading = false
}) })
}, },
/**
* 工作台 token 失效(401):清除本地会话与操作员缓存,回到登录页
*/
handleWorkbenchAuthExpired() {
this.workbenchMember = null
uni.removeStorageSync(MEMBER_STORAGE_KEY)
this.exitToLogin('工作台登录已失效,请重新登录', { clearStored: true })
},
exitToLogin(message, options = {}) { exitToLogin(message, options = {}) {
const { clearStored = false } = options const { clearStored = false } = options
if (message) { if (message) {
@ -1801,8 +1970,14 @@ export default {
}) })
}, 400) }, 400)
}, },
finishLogout() { async finishLogout() {
this.ensurePackFinishedBeforeLeave() // 1. 上报打包完成
await this.ensurePackFinishedBeforeLeave()
// 2. 静默解绑操作员(操作员归属当前工作台),失败不阻断
if (this.workbenchMember && this.workbenchMember.id) {
await this.doRemoveOperator(this.workbenchMember.id, { silent: true })
}
// 3. 清除会话回登录页
this.exitToLogin('已退出登录') this.exitToLogin('已退出登录')
}, },
handleLogout() { handleLogout() {
@ -1850,7 +2025,7 @@ export default {
flex-direction: column; flex-direction: column;
align-items: stretch; align-items: stretch;
justify-content: flex-start; justify-content: flex-start;
background-color: #f2f2f2; background-color: #e8eaed;
overflow: hidden; overflow: hidden;
} }
@ -1866,7 +2041,20 @@ export default {
.mode-title { .mode-title {
font-size: 38rpx; font-size: 38rpx;
font-weight: 600; font-weight: 600;
color: #fff; color: #ffffff;
}
.mode-title-wrap {
display: flex;
align-items: center;
min-width: 0;
}
.mode-logo {
width: 240rpx;
height: 90rpx;
margin-right: 70rpx;
flex-shrink: 0;
} }
.logout-btn { .logout-btn {
@ -1889,7 +2077,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 40rpx; padding: 16rpx;
overflow: hidden; overflow: hidden;
} }
@ -2030,7 +2218,6 @@ export default {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
display: flex; display: flex;
gap: 24rpx;
} }
.pack-left { .pack-left {
@ -2039,7 +2226,30 @@ export default {
min-height: 0; min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24rpx; }
.pack-left-empty {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: #fff;
border: 1rpx solid #dfe3e8;
border-radius: 16rpx;
margin-top: 12rpx;
}
.pack-left-empty-text {
font-size: 40rpx;
color: #bbb;
}
.pack-left-empty-sub {
font-size: 28rpx;
color: #ccc;
margin-top: 16rpx;
} }
.pack-right { .pack-right {
@ -2048,13 +2258,14 @@ export default {
min-height: 0; min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24rpx; margin-left: 12rpx;
} }
.pack-card { .pack-card {
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 28rpx 32rpx; border: 1rpx solid #dfe3e8;
padding: 15rpx 32rpx 28rpx 32rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -2071,21 +2282,39 @@ export default {
.pack-search { .pack-search {
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
padding: 20rpx 24rpx; border: 1rpx solid #dfe3e8;
padding: 8rpx 24rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex;
align-items: center;
} }
.pack-search-input { .pack-search-input {
height: 64rpx; flex: 1;
line-height: 64rpx; min-width: 0;
height: 48rpx;
line-height: 48rpx;
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
} }
.pack-search-clear {
flex-shrink: 0;
width: 48rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
margin-left: 16rpx;
font-size: 36rpx;
color: #999;
background-color: #e8eaed;
border-radius: 50%;
}
/* 波次 */ /* 波次 */
.pack-wave { .pack-wave {
flex-direction: column; flex-direction: column;
gap: 20rpx; margin-top: 12rpx;
} }
.pack-wave-head { .pack-wave-head {
@ -2102,7 +2331,7 @@ export default {
} }
.pack-wave-no { .pack-wave-no {
font-size: 50rpx; font-size: 70rpx;
font-weight: 600; font-weight: 600;
color: #ffffff; color: #ffffff;
margin-left: 12rpx; margin-left: 12rpx;
@ -2117,21 +2346,26 @@ export default {
/* 货主 / 包材 / 商品总数 */ /* 货主 / 包材 / 商品总数 */
.pack-meta-line { .pack-meta-line {
display: flex; display: flex;
align-items: flex-start; align-items: center;
gap: 48rpx; margin-top: 20rpx;
} }
.pack-meta-item { .pack-meta-item {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 12rpx;
min-width: 0; min-width: 0;
} }
.pack-meta-item + .pack-meta-item {
margin-left: 48rpx;
}
.pack-meta-label { .pack-meta-label {
font-size: 28rpx; font-size: 28rpx;
color: #888; color: #888;
line-height: 1;
flex-shrink: 0;
} }
.pack-meta-value { .pack-meta-value {
@ -2139,18 +2373,20 @@ export default {
color: #333; color: #333;
font-weight: 600; font-weight: 600;
word-break: break-all; word-break: break-all;
margin-left: 12rpx;
line-height: 1;
} }
/* 商品明细 */ /* 商品明细 */
.pack-detail { .pack-detail {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
margin-top: 12rpx;
} }
.pack-detail-title { .pack-detail-title {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 16rpx;
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
@ -2165,6 +2401,7 @@ export default {
border-radius: 999rpx; border-radius: 999rpx;
color: #2f7dff; color: #2f7dff;
background-color: #eef5ff; background-color: #eef5ff;
margin-left: 16rpx;
} }
.pack-order-type--group { .pack-order-type--group {
@ -2224,8 +2461,8 @@ export default {
.pack-detail-row { .pack-detail-row {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 16rpx 0; padding: 8rpx 0;
border-bottom: 1rpx solid #f4f4f4; border-bottom: 1rpx solid #e0e0e0;
} }
.pack-detail-col { .pack-detail-col {
@ -2235,14 +2472,14 @@ export default {
} }
.pack-detail-col--index { .pack-detail-col--index {
flex: 0 0 80rpx; flex: 0 0 60rpx;
text-align: center; text-align: center;
color: #2f7dff; color: #2f7dff;
font-size: 40rpx; font-size: 40rpx;
} }
.pack-detail-col--image { .pack-detail-col--image {
flex: 0 0 210rpx; flex: 0 0 150rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -2255,7 +2492,6 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
gap: 8rpx;
} }
.pack-detail-info-name { .pack-detail-info-name {
@ -2268,6 +2504,7 @@ export default {
font-size: 45rpx; font-size: 45rpx;
color: #ff8c00; color: #ff8c00;
word-break: break-all; word-break: break-all;
margin-top: 8rpx;
} }
.pack-item-img-wrap { .pack-item-img-wrap {
@ -2369,6 +2606,22 @@ export default {
.pack-records { .pack-records {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
margin-top: 12rpx;
overflow: hidden;
padding-left: 0;
padding-right: 0;
}
.pack-records-title {
background-color: #2f7dff;
margin: -15rpx 0 16rpx 0;
padding: 10rpx 20rpx;
}
.pack-records-title-text {
font-size: 32rpx;
font-weight: 600;
color: #fff;
} }
.pack-records-body { .pack-records-body {
@ -2387,16 +2640,26 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 14rpx 0; padding: 14rpx 20rpx;
border-bottom: 1rpx solid #f4f4f4; border-bottom: 1rpx solid #f4f4f4;
} }
.pack-record-item--even {
background-color: #e6effd;
}
.pack-record-text { .pack-record-text {
flex: 1;
min-width: 0;
font-size: 40rpx; font-size: 40rpx;
color: #333; color: #333;
text-align: left;
word-break: break-all;
} }
.pack-record-time { .pack-record-time {
flex-shrink: 0;
margin-left: 16rpx;
font-size: 28rpx; font-size: 28rpx;
color: #aaa; color: #aaa;
} }
@ -2420,7 +2683,6 @@ export default {
.operator-btn { .operator-btn {
min-width: 160rpx; min-width: 160rpx;
height: 60rpx; height: 60rpx;
line-height: 60rpx;
font-size: 30rpx; font-size: 30rpx;
margin: 0 16rpx 0 0; margin: 0 16rpx 0 0;
padding: 0 24rpx; padding: 0 24rpx;
@ -2428,6 +2690,10 @@ export default {
color: #fff; color: #fff;
background-color: #909399; background-color: #909399;
border: 1rpx solid #909399; border: 1rpx solid #909399;
display: flex;
align-items: center;
justify-content: center;
line-height: 1;
} }
.operator-btn::after { .operator-btn::after {
@ -2440,6 +2706,29 @@ export default {
border-color: #2fbf71; border-color: #2fbf71;
} }
.operator-user-icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-right: 8rpx;
}
.operator-user-icon-head {
width: 14rpx;
height: 14rpx;
background-color: #fff;
border-radius: 50%;
}
.operator-user-icon-body {
width: 22rpx;
height: 10rpx;
margin-top: 3rpx;
background-color: #fff;
border-radius: 10rpx 10rpx 0 0;
}
/* 绑定操作员弹窗 */ /* 绑定操作员弹窗 */
.op-mask { .op-mask {
position: fixed; position: fixed;
@ -2485,7 +2774,10 @@ export default {
.op-dialog-body { .op-dialog-body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 24rpx; }
.op-dialog-body > .op-btn {
margin-top: 24rpx;
} }
.op-bound-row { .op-bound-row {
@ -2528,6 +2820,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-top: 24rpx;
} }
.op-result--empty { .op-result--empty {
@ -2558,8 +2851,8 @@ export default {
} }
.op-btn { .op-btn {
height: 64rpx; height: 84rpx;
line-height: 64rpx; line-height: 84rpx;
font-size: 30rpx; font-size: 30rpx;
padding: 0 40rpx; padding: 0 40rpx;
margin: 0; margin: 0;
@ -2592,7 +2885,7 @@ export default {
/* 移除操作员确认弹窗 */ /* 移除操作员确认弹窗 */
.op-dialog--confirm { .op-dialog--confirm {
width: 520rpx; width: 680rpx;
} }
.op-confirm-content { .op-confirm-content {
@ -2607,7 +2900,10 @@ export default {
margin-top: 32rpx; margin-top: 32rpx;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 16rpx; }
.op-confirm-footer > .op-btn + .op-btn {
margin-left: 16rpx;
} }
.op-confirm-footer--equal { .op-confirm-footer--equal {
@ -2642,7 +2938,6 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 16rpx;
z-index: 2; z-index: 2;
} }
@ -2679,6 +2974,11 @@ export default {
width: 120rpx; width: 120rpx;
} }
/* gap 兼容回退:真机 WebView 不支持 flex gap */
.img-preview-toolbar > * + * {
margin-left: 16rpx;
}
.img-preview-body { .img-preview-body {
position: relative; position: relative;
width: 100%; width: 100%;