feat(web-admin): add stockRole variant to transport plan list page

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-10-14 23:32:35 +08:00
1 parent c4ee338c3a
commit ce06f0f4e8
1 file changed
+41 -4
+41 -4
View File
@@ -3,14 +3,16 @@
<div class="page-container">
<section class="panel">
<PlPlanTypeTabs
v-if="!isStockList"
:model-value="activePlanTypeTab"
:tabs="PL_PLAN_LIST_TABS"
@change="handlePlanTypeTabChange"
/>
<!-- 工具栏(单行:日期下拉 + 检索 + 主操作 + 溢出收纳 + 刷新/列设置) -->
<!-- 工具栏:运输计划完整工具栏;库存入库/出库变体仅导出 -->
<div class="list-toolbar">
<div class="list-toolbar-row pl-plan-list-toolbar-row">
<template v-if="!isStockList">
<ListToolbarDateShortcuts
variant="pills"
:active="activeDateShortcut"
@@ -49,6 +51,22 @@
@refresh="fetchData"
@reset-columns="handleResetColumns"
/>
</template>
<ListExportDropdown
v-else
:export-fn="planApi.export"
:get-filter-params="getPlanExportFilterParams"
:has-selection="true"
:selected-ids="selectedRows.map((r) => r.id)"
:visible-columns="planExportColumns"
:filename="
stockRole === 'inbound'
? '入库计划.xlsx'
: stockRole === 'outbound'
? '出库计划.xlsx'
: '计划列表.xlsx'
"
/>
</div>
</div>
@@ -57,7 +75,7 @@
<div ref="planTableWrapRef" class="table-scroll bx-list-table-wrap">
<ListTable
ref="planTableRef"
table-key="pl-plan"
:table-key="isStockList ? `pl-stock-${stockRole}-plan` : 'pl-plan'"
:height="tableHeight"
class="list-table pl-plan-merge-list-table"
:data="displayRows"
@@ -323,7 +341,7 @@
<template #default="{ row }">{{ row.plan.followUserName || '—' }}</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('arrangeCopy')"
v-if="!isStockList && isColumnVisible('arrangeCopy')"
prop="arrangeCopy"
label="链接复制"
min-width="88"
@@ -1154,6 +1172,18 @@ import { useColumnFacetOptions } from '@/composables/useColumnFacetOptions'
import { useColumnSort } from '@/composables/useColumnSort'
import { plPlanColumnFilterDefs } from './columnFilterDefs'
const props = withDefaults(
defineProps<{
/** 库存管理入库/出库列表变体;不传则为运输计划主列表 */
stockRole?: 'inbound' | 'outbound'
}>(),
{ stockRole: undefined }
)
const isStockList = computed(
() => props.stockRole === 'inbound' || props.stockRole === 'outbound'
)
/** 计划区可合并列(顺序须与表格左侧列一致,不含勾选/序号/计划编号) */
const PLAN_MERGE_COLUMN_PROPS = [
'belongsCompany',
@@ -1477,9 +1507,11 @@ tableEl: planTableWrapRef,
function buildListQueryParams(): Record<string, any> {
const colParams = { ...toQueryParams(), ...toSortQueryParams() }
const params: Record<string, any> = { ...colParams }
if (!isStockList.value) {
const keyword = quickSearch.value.trim()
const tabFilters = plPlanListTabToFilters(activePlanTypeTab.value)
const params: Record<string, any> = { ...colParams }
if (keyword) params.q = keyword
@@ -1506,6 +1538,11 @@ tableEl: planTableWrapRef,
// 列表「复制给司机/现场/磅单」需要服务端批量标志;默认关闭以降低其它页耗时
params.includeArrangeCopyFlags = 1
} else {
// 库存变体:无 Tab / 无快捷搜(工具栏已隐藏);列头漏斗仍走 colParams
params.stockRole = props.stockRole
// 不传 includeArrangeCopyFlags
}
applyMergedCustomerQueryParams(params)
applyContractSideQueryParams(