feat(web-admin): add stockRole variant to transport plan list page
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c4ee338c3a
commit
ce06f0f4e8
1 file changed
+41
-4
@@ -3,14 +3,16 @@
|
|||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<section class="panel">
|
<section class="panel">
|
||||||
<PlPlanTypeTabs
|
<PlPlanTypeTabs
|
||||||
|
v-if="!isStockList"
|
||||||
:model-value="activePlanTypeTab"
|
:model-value="activePlanTypeTab"
|
||||||
:tabs="PL_PLAN_LIST_TABS"
|
:tabs="PL_PLAN_LIST_TABS"
|
||||||
@change="handlePlanTypeTabChange"
|
@change="handlePlanTypeTabChange"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 工具栏(单行:日期下拉 + 检索 + 主操作 + 溢出收纳 + 刷新/列设置) -->
|
<!-- 工具栏:运输计划完整工具栏;库存入库/出库变体仅导出 -->
|
||||||
<div class="list-toolbar">
|
<div class="list-toolbar">
|
||||||
<div class="list-toolbar-row pl-plan-list-toolbar-row">
|
<div class="list-toolbar-row pl-plan-list-toolbar-row">
|
||||||
|
<template v-if="!isStockList">
|
||||||
<ListToolbarDateShortcuts
|
<ListToolbarDateShortcuts
|
||||||
variant="pills"
|
variant="pills"
|
||||||
:active="activeDateShortcut"
|
:active="activeDateShortcut"
|
||||||
@@ -49,6 +51,22 @@
|
|||||||
@refresh="fetchData"
|
@refresh="fetchData"
|
||||||
@reset-columns="handleResetColumns"
|
@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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -57,7 +75,7 @@
|
|||||||
<div ref="planTableWrapRef" class="table-scroll bx-list-table-wrap">
|
<div ref="planTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||||
<ListTable
|
<ListTable
|
||||||
ref="planTableRef"
|
ref="planTableRef"
|
||||||
table-key="pl-plan"
|
:table-key="isStockList ? `pl-stock-${stockRole}-plan` : 'pl-plan'"
|
||||||
:height="tableHeight"
|
:height="tableHeight"
|
||||||
class="list-table pl-plan-merge-list-table"
|
class="list-table pl-plan-merge-list-table"
|
||||||
:data="displayRows"
|
:data="displayRows"
|
||||||
@@ -323,7 +341,7 @@
|
|||||||
<template #default="{ row }">{{ row.plan.followUserName || '—' }}</template>
|
<template #default="{ row }">{{ row.plan.followUserName || '—' }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if="isColumnVisible('arrangeCopy')"
|
v-if="!isStockList && isColumnVisible('arrangeCopy')"
|
||||||
prop="arrangeCopy"
|
prop="arrangeCopy"
|
||||||
label="链接复制"
|
label="链接复制"
|
||||||
min-width="88"
|
min-width="88"
|
||||||
@@ -1154,6 +1172,18 @@ import { useColumnFacetOptions } from '@/composables/useColumnFacetOptions'
|
|||||||
import { useColumnSort } from '@/composables/useColumnSort'
|
import { useColumnSort } from '@/composables/useColumnSort'
|
||||||
import { plPlanColumnFilterDefs } from './columnFilterDefs'
|
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 = [
|
const PLAN_MERGE_COLUMN_PROPS = [
|
||||||
'belongsCompany',
|
'belongsCompany',
|
||||||
@@ -1477,9 +1507,11 @@ tableEl: planTableWrapRef,
|
|||||||
|
|
||||||
function buildListQueryParams(): Record<string, any> {
|
function buildListQueryParams(): Record<string, any> {
|
||||||
const colParams = { ...toQueryParams(), ...toSortQueryParams() }
|
const colParams = { ...toQueryParams(), ...toSortQueryParams() }
|
||||||
|
const params: Record<string, any> = { ...colParams }
|
||||||
|
|
||||||
|
if (!isStockList.value) {
|
||||||
const keyword = quickSearch.value.trim()
|
const keyword = quickSearch.value.trim()
|
||||||
const tabFilters = plPlanListTabToFilters(activePlanTypeTab.value)
|
const tabFilters = plPlanListTabToFilters(activePlanTypeTab.value)
|
||||||
const params: Record<string, any> = { ...colParams }
|
|
||||||
|
|
||||||
if (keyword) params.q = keyword
|
if (keyword) params.q = keyword
|
||||||
|
|
||||||
@@ -1506,6 +1538,11 @@ tableEl: planTableWrapRef,
|
|||||||
|
|
||||||
// 列表「复制给司机/现场/磅单」需要服务端批量标志;默认关闭以降低其它页耗时
|
// 列表「复制给司机/现场/磅单」需要服务端批量标志;默认关闭以降低其它页耗时
|
||||||
params.includeArrangeCopyFlags = 1
|
params.includeArrangeCopyFlags = 1
|
||||||
|
} else {
|
||||||
|
// 库存变体:无 Tab / 无快捷搜(工具栏已隐藏);列头漏斗仍走 colParams
|
||||||
|
params.stockRole = props.stockRole
|
||||||
|
// 不传 includeArrangeCopyFlags
|
||||||
|
}
|
||||||
|
|
||||||
applyMergedCustomerQueryParams(params)
|
applyMergedCustomerQueryParams(params)
|
||||||
applyContractSideQueryParams(
|
applyContractSideQueryParams(
|
||||||
|
|||||||
Reference in new issue
Block a user