This commit is contained in:
zlwu committed 2026-08-19 09:14:37 +08:00
1 parent c3bd2c00ae
commit a52fe77e34
39 files changed
+609647 -9238

No files matched your search

+30 -17
View File
@@ -2,7 +2,11 @@
<template>
<div class="page-container">
<section class="panel">
<PlPlanTypeTabs v-model="activePlanTypeTab" @change="handlePlanTypeTabChange" />
<PlPlanTypeTabs
:model-value="activePlanTypeTab"
:tabs="PL_PLAN_LIST_TABS"
@change="handlePlanTypeTabChange"
/>
<!-- 筛选区 -->
<div class="filter-block">
@@ -17,7 +21,12 @@
/>
</el-form-item>
<el-form-item label="跟进状态">
<el-select v-model="searchForm.followStatus" placeholder="全部" clearable>
<el-select
v-model="searchForm.followStatus"
placeholder="全部"
clearable
:disabled="activePlanTypeTab === 'pending_arrange'"
>
<el-option
v-for="opt in PL_PLAN_FOLLOW_STATUS_OPTIONS"
:key="opt.value"
@@ -226,9 +235,7 @@
align="center"
>
<template #default="{ row }">
<el-tag :type="getPlanTypeTagType(row.planType)" size="small">
{{ getPlanTypeLabel(row.planType) }}
</el-tag>
{{ getPlanTypeLabel(row.planType) }}
</template>
</el-table-column>
<el-table-column
@@ -557,8 +564,9 @@ import {
getPlPlanFollowStatusTagType,
normalizePlPersonnelSummaryDisplay,
PL_PLAN_FOLLOW_STATUS_OPTIONS,
plPlanTypeTabToFilter,
type PlPlanTypeTab,
PL_PLAN_LIST_TABS,
plPlanListTabToFilters,
type PlPlanListTab,
type PlPrintSlipCommand
} from '@/utils/pl-display'
import { syncViewRowFromFlatList } from '@/utils/view-dialog-refresh'
@@ -742,7 +750,7 @@ async function handlePlanMutationSuccess(payload?: { planId?: string; openArrang
const selectedPlan = computed(() => (selectedRows.value.length === 1 ? selectedRows.value[0] : null))
const dateRange = ref<string[]>([])
const quickSearch = ref('')
const activePlanTypeTab = ref<PlPlanTypeTab>('all')
const activePlanTypeTab = ref<PlPlanListTab>('all')
const searchForm = reactive({
planNo: '',
@@ -759,11 +767,6 @@ const pagination = reactive({
total: 0
})
function getPlanTypeTagType(type: string) {
const map: Record<string, string> = { direct: 'primary', inbound: 'success', outbound: 'warning' }
return map[type] || 'info'
}
function getPlanTypeLabel(type?: string | null) {
if (!type) return '—'
const map: Record<string, string> = { direct: '直销单', inbound: '入库单', outbound: '出库单' }
@@ -788,11 +791,12 @@ async function fetchData() {
loading.value = true
try {
const keyword = quickSearch.value.trim()
const tabFilters = plPlanListTabToFilters(activePlanTypeTab.value)
const res = await planApi.list({
q: keyword || undefined,
planNo: keyword ? undefined : searchForm.planNo || undefined,
planType: searchForm.planType || undefined,
followStatus: searchForm.followStatus || undefined,
planType: tabFilters.planType || undefined,
followStatus: tabFilters.followStatus || searchForm.followStatus || undefined,
customerName: keyword ? undefined : searchForm.customerName || undefined,
productName: keyword ? undefined : searchForm.productName || undefined,
licensePlate: keyword ? undefined : searchForm.licensePlate || undefined,
@@ -814,8 +818,17 @@ function handleSearch() {
fetchData()
}
function handlePlanTypeTabChange(tab: PlPlanTypeTab) {
searchForm.planType = plPlanTypeTabToFilter(tab)
function handlePlanTypeTabChange(tab: PlPlanListTab | string) {
const nextTab = tab as PlPlanListTab
const prevTab = activePlanTypeTab.value
activePlanTypeTab.value = nextTab
const filters = plPlanListTabToFilters(nextTab)
searchForm.planType = filters.planType
if (nextTab === 'pending_arrange') {
searchForm.followStatus = 'pending_arrange'
} else if (prevTab === 'pending_arrange') {
searchForm.followStatus = ''
}
pagination.page = 1
fetchData()
}