713 lines
24 KiB
Vue
713 lines
24 KiB
Vue
<template>
|
||
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
||
<!-- 多标签模式 -->
|
||
<template v-if="!singlePage">
|
||
<!-- 顶部多标签页区域(对齐 order/orderManagement 的 tab-section) -->
|
||
<div class="tab-section">
|
||
<!-- 标签排序入口(tab 区域左侧,对齐 order/orderManagement) -->
|
||
<div class="tab-sort-entry">
|
||
<el-tooltip content="标签排序" placement="bottom">
|
||
<el-button class="sort-entry-btn" size="small" link @click="openSortDialog">
|
||
<el-icon><Sort /></el-icon>
|
||
</el-button>
|
||
</el-tooltip>
|
||
</div>
|
||
<div class="tabs-header-action">
|
||
<!-- 可抓取订单数(order.wave.fetchableOrderCount):当前仓库团购可抓取订单数,点击刷新 -->
|
||
<el-tooltip placement="bottom">
|
||
<template #content>
|
||
<template v-if="fetchableOrderCount">
|
||
<div>当前仓库可抓取团购订单:{{ fetchableOrderCount.order_count }} 单</div>
|
||
<div>
|
||
命中 {{ fetchableOrderCount.group_count }} 组 · 阈值 {{ fetchableOrderCount.same_order_quantity }} · 候选 {{ fetchableOrderCount.raw_order_count }} 单
|
||
</div>
|
||
</template>
|
||
<div v-else-if="fetchableOrderCountError">{{ fetchableOrderCountError }}</div>
|
||
<div v-else>统计中…</div>
|
||
<div>点击「可抓取订单」可刷新统计</div>
|
||
</template>
|
||
<span
|
||
class="fetchable-order-chip"
|
||
:class="{
|
||
'is-active': !fetchableOrderCountLoading && !fetchableOrderCountError && (fetchableOrderCount?.order_count ?? 0) > 0,
|
||
'is-error': !!fetchableOrderCountError
|
||
}"
|
||
@click="fetchFetchableOrderCount"
|
||
>
|
||
<span class="chip-label">可抓取订单</span>
|
||
<em class="chip-count">{{ fetchableOrderCountLoading ? '…' : (fetchableOrderCount ? fetchableOrderCount.order_count : '—') }}</em>
|
||
</span>
|
||
</el-tooltip>
|
||
<!-- 已确认打印未领单波次数量(order.wave.confirmPrintUnclaimedWaveCount 长轮询实时刷新) -->
|
||
<el-tooltip
|
||
content="已确认打印但未领单的波次数量,实时刷新"
|
||
placement="bottom"
|
||
>
|
||
<span class="unclaimed-print-chip" :class="{ 'is-active': confirmPrintUnclaimedWaveCount > 0 }">
|
||
<span class="chip-label">确认打印未领单</span>
|
||
<em class="chip-count">{{ confirmPrintUnclaimedWaveCount }}</em>
|
||
</span>
|
||
</el-tooltip>
|
||
</div>
|
||
<el-tabs
|
||
v-model="activeTab"
|
||
tab-position="top"
|
||
type="border-card"
|
||
class="tab-container"
|
||
>
|
||
<el-tab-pane
|
||
v-for="tab in tabs"
|
||
:key="tab.name"
|
||
:name="tab.name"
|
||
:lazy="false"
|
||
>
|
||
<template #label>
|
||
<span class="custom-tab-label">{{ tab.label }}</span>
|
||
</template>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</div>
|
||
|
||
<!-- 主内容区容器(对齐 order/orderManagement 的 main-container) -->
|
||
<div class="main-container">
|
||
<transition name="tab-fade" mode="out-in">
|
||
<keep-alive v-if="tabCacheEnabled" :max="tabCacheMax">
|
||
<component
|
||
:is="activeComponent"
|
||
:key="activeTab"
|
||
v-bind="activeTabProps"
|
||
/>
|
||
</keep-alive>
|
||
<component
|
||
v-else
|
||
:is="activeComponent"
|
||
:key="activeTab"
|
||
v-bind="activeTabProps"
|
||
/>
|
||
</transition>
|
||
</div>
|
||
</template>
|
||
|
||
<!-- 单页模式:直接渲染默认页签组件,复用 .tab-container 样式结构 -->
|
||
<div v-else class="tab-container single-page-container">
|
||
<keep-alive>
|
||
<component
|
||
:is="defaultTab.component"
|
||
:key="defaultTab.name"
|
||
v-bind="defaultTab.props || {}"
|
||
/>
|
||
</keep-alive>
|
||
</div>
|
||
|
||
<SortSettingDialog
|
||
v-model:visible="sortDialogVisible"
|
||
:tabs="DEFAULT_TAB_OPTIONS"
|
||
scope="order.wave.tabs.order"
|
||
@saved="handleSortSaved"
|
||
/>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import { ref, watch, computed, markRaw, onMounted, onUnmounted, onActivated, onDeactivated } from 'vue'
|
||
import { useRoute, useRouter } from 'vue-router'
|
||
import { ElMessage } from 'element-plus'
|
||
import { useSettingsStore } from '@/stores/modules/settings'
|
||
import { useExperimentalStore } from '@/stores/modules/experimental'
|
||
import { Sort } from '@element-plus/icons-vue'
|
||
import SortSettingDialog from '@/components/SortSettingDialog.vue'
|
||
import { useUserPreferenceStore } from '@/stores/modules/userPreference'
|
||
import GroupWaveBatchListPanel from './GroupWaveBatchListPanel.vue'
|
||
import SandanWaveBatchListPanel from './SandanWaveBatchListPanel.vue'
|
||
import FallbackOrderListPanel from './FallbackOrderListPanel.vue'
|
||
import WaveStrategyListPanel from './WaveStrategyListPanel.vue'
|
||
import WavePickTaskListPanel from './WavePickTaskListPanel.vue'
|
||
import { safeInvoke } from '@/utils/safe-invoke'
|
||
import { orderWaveConfirmPrintScan, orderWaveConfirmPrintUnclaimedWaveCount } from '@/api/order/order'
|
||
import { orderWaveFetchableOrderCount, type WaveFetchableOrderCountResponse } from '@/api/order.wave/orderwave'
|
||
import { useBarcodeScan } from '@/composables/useBarcodeScan'
|
||
import { WAVE_PAGE_CONFIG } from './config/wave-config'
|
||
|
||
const route = useRoute()
|
||
const router = useRouter()
|
||
const settingsStore = useSettingsStore()
|
||
const experimentalStore = useExperimentalStore()
|
||
/** tab 缓存开关(实验性设置,默认开) */
|
||
const tabCacheEnabled = computed(() => experimentalStore.tabCacheEnabled)
|
||
/** tab 缓存最大数量(实验性设置,默认 2,超出 LRU 淘汰最久未用) */
|
||
const tabCacheMax = computed(() => experimentalStore.tabCacheMax)
|
||
|
||
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
|
||
const singlePage = WAVE_PAGE_CONFIG.singlePage
|
||
const containerHeight = computed(() => {
|
||
const baseH = shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)'
|
||
return baseH
|
||
})
|
||
|
||
/** 单页模式下使用的默认标签(始终为 tabs 第一项) */
|
||
const defaultTab = computed(() => tabs.value[0]!)
|
||
|
||
const activeTab = ref('groupWave')
|
||
|
||
/** 当前激活页签对应的组件(渲染在主内容区 main-container 中,对齐 order/orderManagement) */
|
||
const activeComponent = computed(() => {
|
||
const tab = tabs.value.find((t) => t.name === activeTab.value)
|
||
return tab?.component
|
||
})
|
||
|
||
/** 当前激活页签对应的 props(对齐 order/orderManagement) */
|
||
const activeTabProps = computed(() => {
|
||
const tab = tabs.value.find((t) => t.name === activeTab.value)
|
||
return tab?.props || {}
|
||
})
|
||
|
||
type WaveTabItem = {
|
||
name: string
|
||
label: string
|
||
component: any
|
||
props?: Record<string, unknown>
|
||
}
|
||
|
||
const tabs = ref<WaveTabItem[]>([
|
||
{
|
||
name: 'groupWave',
|
||
label: '团购波次',
|
||
component: markRaw(GroupWaveBatchListPanel),
|
||
props: { scanBoxCacheKey: 'wave-order-group-wave' }
|
||
},
|
||
{
|
||
name: 'sandanWave',
|
||
label: '散单波次',
|
||
component: markRaw(SandanWaveBatchListPanel),
|
||
props: { scanBoxCacheKey: 'wave-order-sandan-wave' }
|
||
},
|
||
{
|
||
name: 'sandanFallbackOrders',
|
||
label: '不符合波次策略订单列表',
|
||
component: markRaw(FallbackOrderListPanel),
|
||
props: { scanBoxCacheKey: 'wave-order-sandan-fallback-orders' }
|
||
},
|
||
{
|
||
name: 'sandanWaveStrategy',
|
||
label: '波次策略',
|
||
component: markRaw(WaveStrategyListPanel),
|
||
props: { scanBoxCacheKey: 'wave-order-sandan-wave-strategy' }
|
||
},
|
||
{
|
||
name: 'pickTaskWave',
|
||
label: '拣货中任务',
|
||
component: markRaw(WavePickTaskListPanel),
|
||
props: { scanBoxCacheKey: 'wave-order-pick-task' }
|
||
}
|
||
])
|
||
|
||
// ============================================================
|
||
// 标签排序(浏览器本地保存,scope=order.wave.tabs.order)
|
||
// ============================================================
|
||
/** 默认 tab 顺序(弹窗选项 / 恢复默认用) */
|
||
const DEFAULT_TAB_OPTIONS = tabs.value.map(({ name, label }) => ({ name, label }))
|
||
const sortDialogVisible = ref(false)
|
||
const preferenceStore = useUserPreferenceStore()
|
||
const TAB_ORDER_SCOPE = 'order.wave.tabs.order'
|
||
|
||
function openSortDialog() {
|
||
sortDialogVisible.value = true
|
||
}
|
||
|
||
/** 保存标签顺序:按新顺序重排 tabs 数组(组件对象原样复用,缺失项留在末尾) */
|
||
function handleSortSaved(order: string[]) {
|
||
applyTabOrder(order)
|
||
}
|
||
|
||
/** 读取本账号保存的标签顺序并应用;无配置时保持默认顺序 */
|
||
function applySavedTabOrder() {
|
||
const saved = preferenceStore.get(TAB_ORDER_SCOPE)
|
||
if (!Array.isArray(saved) || !saved.length) return
|
||
applyTabOrder(saved)
|
||
}
|
||
|
||
/** 按给定 tab.name 顺序重排 tabs;非法项剔除,缺失项按当前 tabs 补在末尾 */
|
||
function applyTabOrder(order: string[]) {
|
||
const byName = new Map(tabs.value.map((t) => [t.name, t]))
|
||
const ordered: WaveTabItem[] = []
|
||
for (const name of order) {
|
||
if (byName.has(name)) ordered.push(byName.get(name)!)
|
||
}
|
||
for (const t of tabs.value) {
|
||
if (!ordered.some((x) => x.name === t.name)) ordered.push(t)
|
||
}
|
||
tabs.value = ordered
|
||
}
|
||
|
||
/**
|
||
* 首屏 / 刷新 / 外部导航时从地址栏恢复 tab(?tab=<name>)。
|
||
* 说明:布局层 AppMain 的 router-view :key 已收窄为 route.name ?? route.path
|
||
* (见 layout/component/AppMain.vue),同页 query 变化不再触发整页销毁重建,
|
||
* 因此可安全地在页签切换时把当前 tab 写回 URL,刷新 / 复制链接都能回到对应页签。
|
||
* 非法 / 缺失 tab 时归位到团购波次。
|
||
*/
|
||
watch(
|
||
() => route.query.tab,
|
||
(newTab) => {
|
||
const validTabs = tabs.value.map((t) => t.name)
|
||
const raw = newTab === undefined || newTab === null ? '' : String(newTab).trim()
|
||
activeTab.value = raw && validTabs.includes(raw) ? raw : 'groupWave'
|
||
},
|
||
{ immediate: true }
|
||
)
|
||
|
||
/** 将当前 tab 名称写入 URL query(?tab=);用 replace 避免每次切换新增历史记录 */
|
||
function syncActiveTabToUrl(name: string) {
|
||
if (String(route.query.tab ?? '') === name) return
|
||
void router.replace({ query: { ...route.query, tab: name } }).catch(() => {})
|
||
}
|
||
|
||
/**
|
||
* 监听 activeTab 变化并把当前页签同步到 URL。
|
||
* 注意:不能用 @tab-change——el-tabs 的 v-model 会先更新 activeTab,事件触发时新旧值已相等,
|
||
* 原代码的守卫恒 return 导致 URL 从未写回;改由 watcher 作为单一同步入口。
|
||
* 与上方 route.query.tab 监听互斥:URL 已等于 activeTab 时不重复 replace,不会死循环。
|
||
*/
|
||
watch(activeTab, (name) => {
|
||
safeInvoke(() => syncActiveTabToUrl(String(name)))
|
||
})
|
||
|
||
// ============================================================
|
||
// 扫码确认打印(全局扫码事件)
|
||
// ============================================================
|
||
/**
|
||
* 波次管理页注册全局扫码事件:扫描波次内任一订单的面单号(长度超过 8 位)→
|
||
* order.wave.confirmPrintScan(与领单 pick.waveClaimScan 操作一致):把该波次下全部已打印
|
||
* (print_status='fin')且非拦截的订单批量置 confirm_print_status='fin',并写订单操作日志
|
||
* (ORDER_CONFIRM_PRINT)。
|
||
* - 拦截订单跳过(不确认、不阻断);波次下存在未打印订单时后端阻断并给出提示;
|
||
* - 波次下订单已全部确认时重复扫描返回 already_confirmed;
|
||
* - 监听随页面生命周期注册/移除:切到其他页面(keep-alive 页面走 onDeactivated)立即摘除监听,
|
||
* 不会在后台继续响应扫码。
|
||
*/
|
||
const confirmPrintScanPending = ref(false)
|
||
|
||
async function handleConfirmPrintScan(waybillNo: string) {
|
||
if (confirmPrintScanPending.value) return
|
||
confirmPrintScanPending.value = true
|
||
try {
|
||
const res = await orderWaveConfirmPrintScan({ waybill_no: waybillNo })
|
||
// 兼容 data 嵌套与顶层平铺两种返回
|
||
const data = res?.data ?? res
|
||
const waveLabel = data?.wave_no ? `波次 ${data.wave_no}` : '该波次'
|
||
if (data?.status === 'already_confirmed') {
|
||
ElMessage.info(`${waveLabel}(${waybillNo})订单已全部确认打印`)
|
||
return
|
||
}
|
||
const detail = [
|
||
`本次确认打印 ${Number(data?.newly_confirmed_order_count ?? 0)} 单`,
|
||
data?.total_order_count ? `共 ${data.total_order_count} 单` : '',
|
||
data?.intercepted_order_count ? `跳过拦截 ${data.intercepted_order_count} 单` : ''
|
||
].filter(Boolean).join(',')
|
||
ElMessage.success(`${waveLabel}(${waybillNo})确认打印成功:${detail}`)
|
||
} catch {
|
||
// 请求层已统一提示(存在未打印订单阻断 / 订单未分配波次 / 未查询到该面单号等)
|
||
} finally {
|
||
confirmPrintScanPending.value = false
|
||
}
|
||
}
|
||
|
||
useBarcodeScan({
|
||
// 长度超过 8 位(>=9)才提交确认打印接口,短条码(指令/库位等)一律忽略
|
||
minLength: 9,
|
||
// 处理中不采集,避免连扫时并发重复提交
|
||
enabled: () => !confirmPrintScanPending.value,
|
||
onScan: (code) => { void handleConfirmPrintScan(code) }
|
||
})
|
||
|
||
// ============================================================
|
||
// 确认打印未领单波次数量(tab 区展示,长轮询实时刷新)
|
||
// ============================================================
|
||
/**
|
||
* order.wave.confirmPrintUnclaimedWaveCount 长轮询:
|
||
* - 不带 last_count 立即返回当前值(status=current);带 last_count 则挂起等待变化(最长 60 秒);
|
||
* - 确认打印 / 领单成功会递增统计版本号,挂起中的请求 1 秒内发现变化并返回新值(status=changed);
|
||
* - 生命周期:进入波次页(mounted / keep-alive activated)开始轮询,离开页面(unmounted / deactivated)
|
||
* 立即停止,挂起中的响应按「轮询代数」作废;回到波次页重新轮询(先不带 last_count 取当前值)。
|
||
*/
|
||
const confirmPrintUnclaimedWaveCount = ref(0)
|
||
/** 长轮询基线(上次返回的 count);null = 下次请求不带 last_count,立即取当前值 */
|
||
let unclaimedCountBaseline: number | null = null
|
||
/** 轮询代数:启动/停止时自增,用于丢弃上一轮挂起中(离开页面后)的响应 */
|
||
let unclaimedCountGeneration = 0
|
||
let unclaimedCountPolling = false
|
||
/** 连续失败上限:权限/仓库上下文等错误不会自愈,停止轮询避免反复弹提示(切页回来会重新尝试) */
|
||
const UNCLAIMED_COUNT_MAX_FAILURES = 3
|
||
/** 请求失败后的重试间隔 */
|
||
const UNCLAIMED_COUNT_RETRY_MS = 10000
|
||
|
||
function delay(ms: number) {
|
||
// 注意:本目录 eslint 未声明浏览器全局,用 globalThis 取定时器避免 no-undef
|
||
return new Promise<void>((resolve) => { globalThis.setTimeout(resolve, ms) })
|
||
}
|
||
|
||
async function pollConfirmPrintUnclaimedWaveCount() {
|
||
// 单页模式不渲染 tab 区,无需轮询;已在轮询时重复调用直接忽略
|
||
if (unclaimedCountPolling || singlePage) return
|
||
const generation = ++unclaimedCountGeneration
|
||
unclaimedCountPolling = true
|
||
/** 本轮是否仍然有效(离开页面会使代数自增) */
|
||
const isCurrent = () => unclaimedCountPolling && generation === unclaimedCountGeneration
|
||
let failures = 0
|
||
|
||
while (isCurrent()) {
|
||
try {
|
||
const res = await orderWaveConfirmPrintUnclaimedWaveCount(
|
||
unclaimedCountBaseline === null ? {} : { last_count: unclaimedCountBaseline }
|
||
)
|
||
if (!isCurrent()) break
|
||
// 兼容 data 嵌套与顶层平铺两种返回
|
||
const data = res?.data ?? res
|
||
const next = Number(data?.count)
|
||
if (Number.isFinite(next) && next >= 0) {
|
||
confirmPrintUnclaimedWaveCount.value = next
|
||
unclaimedCountBaseline = next
|
||
}
|
||
failures = 0
|
||
} catch {
|
||
// 错误已由请求层统一提示,这里只做退避重试
|
||
if (!isCurrent()) break
|
||
failures += 1
|
||
if (failures >= UNCLAIMED_COUNT_MAX_FAILURES) {
|
||
console.warn('[wave] 确认打印未领单数量轮询连续失败,已暂停;切换页面后重新尝试')
|
||
break
|
||
}
|
||
await delay(UNCLAIMED_COUNT_RETRY_MS)
|
||
}
|
||
}
|
||
|
||
// 正常退出(连续失败暂停)时也清空基线:下次启动先立即取一次当前值
|
||
if (generation === unclaimedCountGeneration) {
|
||
unclaimedCountPolling = false
|
||
unclaimedCountBaseline = null
|
||
}
|
||
}
|
||
|
||
/** 停止轮询:挂起中的请求结果不再写回,回到页面时重新取一次当前值 */
|
||
function stopConfirmPrintUnclaimedWaveCountPoll() {
|
||
unclaimedCountGeneration += 1
|
||
unclaimedCountPolling = false
|
||
unclaimedCountBaseline = null
|
||
}
|
||
|
||
onMounted(() => { void pollConfirmPrintUnclaimedWaveCount() })
|
||
// 切到其他页面即停止刷新;keep-alive 页面走 onDeactivated(不触发 onUnmounted)
|
||
onUnmounted(stopConfirmPrintUnclaimedWaveCountPoll)
|
||
onActivated(() => { void pollConfirmPrintUnclaimedWaveCount() })
|
||
onDeactivated(stopConfirmPrintUnclaimedWaveCountPoll)
|
||
|
||
onMounted(() => {
|
||
applySavedTabOrder()
|
||
})
|
||
|
||
// ============================================================
|
||
// 可抓取订单数(tab 区展示,order.wave.fetchableOrderCount)
|
||
// ============================================================
|
||
/**
|
||
* order.wave.fetchableOrderCount:当前仓库团购可抓取订单数。
|
||
* 口径与 order.wave.groupOrderFetchList 一致(同一候选条件 + items_hash 粗分组 + 团购阈值过滤),
|
||
* 但不分页、不查明细;页面级不带筛选条件 → 按仓库配置阈值统计全仓。
|
||
* 刷新时机:进入页面(mounted / keep-alive activated)与切回「团购波次」页签;也可点击标签手动刷新。
|
||
* 失败不弹 toast,仅在标签内提示,不影响页面其它功能。
|
||
*/
|
||
const fetchableOrderCountLoading = ref(false)
|
||
const fetchableOrderCount = ref<WaveFetchableOrderCountResponse | null>(null)
|
||
const fetchableOrderCountError = ref('')
|
||
|
||
/** 业务成功码(1/200/0 视为成功;无 code 视为成功) */
|
||
function isSuccessCode(code: unknown) {
|
||
if (code === undefined || code === null) return true
|
||
return code === 1 || code === 200 || code === 0
|
||
}
|
||
|
||
async function fetchFetchableOrderCount() {
|
||
// 单页模式不渲染 tab 区;处理中重复点击直接忽略
|
||
if (singlePage || fetchableOrderCountLoading.value) return
|
||
fetchableOrderCountLoading.value = true
|
||
fetchableOrderCountError.value = ''
|
||
try {
|
||
const res = await orderWaveFetchableOrderCount({}) as
|
||
WaveFetchableOrderCountResponse & { code?: number; message?: string; data?: Partial<WaveFetchableOrderCountResponse> }
|
||
if (!res || !isSuccessCode(res.code)) {
|
||
throw new Error(res?.message || '统计可抓取订单数失败')
|
||
}
|
||
// 兼容 data 嵌套与顶层平铺两种返回
|
||
const payload = (
|
||
res.data && typeof res.data === 'object' && !Array.isArray(res.data) ? res.data : res
|
||
) as WaveFetchableOrderCountResponse
|
||
fetchableOrderCount.value = payload
|
||
} catch (error: any) {
|
||
console.error('fetch fetchable order count failed:', error)
|
||
fetchableOrderCount.value = null
|
||
fetchableOrderCountError.value = error?.message || '统计可抓取订单数失败'
|
||
} finally {
|
||
fetchableOrderCountLoading.value = false
|
||
}
|
||
}
|
||
|
||
// keep-alive 页面:首次挂载与每次回到页面都刷新(loading 守卫避免与 activated 重复请求)
|
||
onMounted(() => { void fetchFetchableOrderCount() })
|
||
onActivated(() => { void fetchFetchableOrderCount() })
|
||
|
||
/** 切回「团购波次」页签时刷新可抓取订单数 */
|
||
watch(activeTab, (name) => {
|
||
if (name === 'groupWave') void fetchFetchableOrderCount()
|
||
})
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.order-management-wrapper {
|
||
position: relative;
|
||
width: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
}
|
||
|
||
/* ===== 顶部多标签页区域(对齐 order/orderManagement 的 tab-section) ===== */
|
||
.tab-section {
|
||
flex-shrink: 0;
|
||
position: relative;
|
||
background: #fff;
|
||
border: 1px solid #e8eef7;
|
||
border-bottom: none;
|
||
border-radius: 6px 6px 0 0;
|
||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
||
overflow: hidden;
|
||
}
|
||
|
||
.tabs-header-action {
|
||
position: absolute;
|
||
top: 4px;
|
||
right: 16px;
|
||
height: 38px;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
z-index: 2;
|
||
}
|
||
|
||
/* 已确认打印未领单波次数量(tab 区常显;>0 时高亮提醒) */
|
||
.unclaimed-print-chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
height: 22px;
|
||
padding: 0 10px;
|
||
border-radius: 11px;
|
||
font-size: 12px;
|
||
line-height: 22px;
|
||
color: #606266;
|
||
background: #f4f4f5;
|
||
border: 1px solid #e9e9eb;
|
||
cursor: default;
|
||
|
||
.chip-count {
|
||
font-style: normal;
|
||
font-weight: 600;
|
||
color: #909399;
|
||
}
|
||
|
||
&.is-active {
|
||
color: #d48806;
|
||
background: rgba(230, 162, 60, 0.1);
|
||
border-color: rgba(230, 162, 60, 0.35);
|
||
|
||
.chip-count {
|
||
color: #d48806;
|
||
}
|
||
}
|
||
}
|
||
|
||
/* 可抓取订单数(tab 区常显;点击可刷新统计;>0 时高亮) */
|
||
.fetchable-order-chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
height: 22px;
|
||
padding: 0 10px;
|
||
border-radius: 11px;
|
||
font-size: 12px;
|
||
line-height: 22px;
|
||
color: #606266;
|
||
background: #f4f4f5;
|
||
border: 1px solid #e9e9eb;
|
||
cursor: pointer;
|
||
transition: all 0.2s;
|
||
|
||
&:hover {
|
||
color: #409eff;
|
||
background: rgba(64, 158, 255, 0.08);
|
||
border-color: rgba(64, 158, 255, 0.35);
|
||
}
|
||
|
||
.chip-count {
|
||
font-style: normal;
|
||
font-weight: 600;
|
||
color: #909399;
|
||
}
|
||
|
||
&.is-active {
|
||
color: #409eff;
|
||
background: rgba(64, 158, 255, 0.1);
|
||
border-color: rgba(64, 158, 255, 0.35);
|
||
|
||
.chip-count {
|
||
color: #409eff;
|
||
}
|
||
}
|
||
|
||
&.is-error {
|
||
color: #f56c6c;
|
||
background: rgba(245, 108, 108, 0.1);
|
||
border-color: rgba(245, 108, 108, 0.35);
|
||
|
||
.chip-count {
|
||
color: #f56c6c;
|
||
}
|
||
}
|
||
}
|
||
|
||
/* 标签排序入口(tab 区域左侧,样式对齐 order/orderManagement) */
|
||
.tab-sort-entry {
|
||
position: absolute;
|
||
top: 4px;
|
||
left: 12px;
|
||
height: 38px;
|
||
display: flex;
|
||
align-items: center;
|
||
z-index: 2;
|
||
|
||
.sort-entry-btn {
|
||
color: #606266;
|
||
font-size: 15px;
|
||
padding: 4px 6px;
|
||
border-radius: 4px;
|
||
transition: all 0.2s;
|
||
|
||
&:hover {
|
||
color: #409eff;
|
||
background-color: rgba(64, 158, 255, 0.08);
|
||
}
|
||
}
|
||
}
|
||
|
||
.tab-container {
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
:deep(.el-tabs__header) {
|
||
margin-bottom: 0;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
:deep(.el-tabs__header.is-top) {
|
||
padding: 4px 12px 0 46px;
|
||
background: #f8fbff;
|
||
border-bottom: 1px solid #e8eef7;
|
||
margin: 0;
|
||
}
|
||
|
||
:deep(.el-tabs__nav-wrap::after) {
|
||
display: none;
|
||
}
|
||
|
||
:deep(.el-tabs__item.is-top) {
|
||
height: 38px;
|
||
line-height: 38px;
|
||
padding: 0 20px;
|
||
border-radius: 6px 6px 0 0;
|
||
color: #606266;
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||
border: 1px solid transparent;
|
||
border-bottom: none;
|
||
margin-right: 4px;
|
||
}
|
||
|
||
:deep(.el-tabs__item.is-top:hover) {
|
||
color: #409eff;
|
||
background-color: rgba(64, 158, 255, 0.05);
|
||
}
|
||
|
||
:deep(.el-tabs__item.is-top.is-active) {
|
||
color: #409eff;
|
||
font-weight: 600;
|
||
background: #ffffff;
|
||
border-color: #e8eef7;
|
||
border-bottom: 2px solid #ffffff;
|
||
margin-bottom: -1px;
|
||
position: relative;
|
||
z-index: 1;
|
||
}
|
||
|
||
:deep(.el-tabs__active-bar) {
|
||
height: 2px;
|
||
border-radius: 2px;
|
||
background-color: #409eff;
|
||
bottom: 0;
|
||
}
|
||
|
||
/* 隐藏内容区,仅展示标签头(对齐 order/orderManagement) */
|
||
:deep(.el-tabs__content) {
|
||
display: none;
|
||
}
|
||
}
|
||
|
||
.custom-tab-label {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
|
||
/* ===== 主内容区容器(对齐 order/orderManagement 的 main-container) ===== */
|
||
.main-container {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-height: 0;
|
||
background: #fff;
|
||
border: 1px solid #e8eef7;
|
||
border-top: none;
|
||
border-radius: 0 0 6px 6px;
|
||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
||
overflow: hidden;
|
||
}
|
||
|
||
/* ========== 单页模式 ========== */
|
||
|
||
.single-page-container {
|
||
flex: 1;
|
||
min-height: 0;
|
||
background: #fff;
|
||
border: 1px solid #e8eef7;
|
||
border-radius: 6px;
|
||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
||
overflow: hidden;
|
||
|
||
:deep(> *) {
|
||
flex: 1;
|
||
overflow: auto;
|
||
min-height: 0;
|
||
}
|
||
}
|
||
|
||
/* ===== 页签切换淡入淡出(对齐 storage/generalreport 的 tab-fade) ===== */
|
||
.tab-fade-enter-active,
|
||
.tab-fade-leave-active {
|
||
transition: opacity 0.2s ease;
|
||
opacity: 1;
|
||
}
|
||
|
||
.tab-fade-enter-from,
|
||
.tab-fade-leave-to {
|
||
opacity: 0;
|
||
}
|
||
</style>
|