This commit is contained in:
zlwu committed 2026-08-17 09:22:31 +08:00
1 parent 42ad896456
commit 6b2147aa46
66 files changed
+617071 -28046

No files matched your search

+82 -10
View File
@@ -82,7 +82,7 @@
/>
<ListQuickSearchInput
v-model="quickSearch"
placeholder="计划编号/客户名称"
placeholder="计划编号/供方/需方/产品名称"
@search="handleQuickSearch"
@clear="handleQuickSearchClear"
/>
@@ -109,15 +109,17 @@
</div>
<div class="list-body list-wrap">
<ListTable table-key="pl-plan-archive"
class="list-table"
:data="planList"
v-loading="loading"
stripe
row-key="id"
@selection-change="handleSelectionChange"
@row-dblclick="handleView"
>
<div ref="archiveTableWrapRef" class="table-scroll bx-list-table-wrap">
<ListTable table-key="pl-plan-archive"
class="list-table"
:data="planList"
v-loading="loading"
stripe
row-key="id"
@selection-change="handleSelectionChange"
@row-dblclick="handleView"
@header-dragend="() => archiveStatsRowRef?.resync?.()"
>
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
<el-table-column
type="index"
@@ -295,6 +297,15 @@
align="center"
/>
</ListTable>
<ListColumnStatsRow
ref="archiveStatsRowRef"
storage-key="pl-plan-archive-column-stats"
:columns="archiveStatsRowColumns"
:data="planList"
:table-wrap-el="archiveTableWrapRef"
:get-cell-value="getArchiveStatCellValue"
/>
</div>
<div class="pagination list-pager-bar">
<div class="list-pager-selected">
@@ -342,6 +353,8 @@
<script setup lang="ts">
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
import type { StatsRowColumn } from '@/utils/list-column-stats'
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import {
FolderChecked,
@@ -412,6 +425,60 @@ const {
resetToDefault
} = usePersistedListColumns('pl-plan-archive-list-columns', listColumnDefs)
const archiveTableWrapRef = ref<HTMLElement | null>(null)
const archiveStatsRowRef = ref<{ resync?: () => void } | null>(null)
const archiveStatsRowColumns = computed((): StatsRowColumn[] => {
const cols: StatsRowColumn[] = [
{ key: '__selection', interactive: false },
{ key: '__index', interactive: false },
{ key: 'planNo', interactive: true, prop: 'planNo' }
]
for (const def of listColumnDefs) {
if (!isColumnVisible(def.prop)) continue
cols.push({
key: def.prop,
interactive: true,
prop: def.prop
})
}
return cols
})
function getArchiveStatCellValue(row: Plan, prop: string): unknown {
if (prop === 'archiveStatus') return getPlPlanArchiveStatusLabel(row.archiveStatus)
if (prop === 'followStatus') return getPlPlanFollowStatusLabel(row.followStatus)
if (prop === 'planType') return getPlanTypeLabel(row.planType)
if (prop === 'productPlanQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.quantity) || 0), 0)
}
if (prop === 'productActualQty') {
return (row.products || []).reduce((sum, p) => sum + (Number(p.actualQty) || 0), 0)
}
if (prop === 'productName') {
return (row.products || []).map((p) => p.productName || '').filter(Boolean).join('\n')
}
if (prop === 'productSpec') {
return (row.products || [])
.map((p) => p.model || p.packageSpec || '')
.filter(Boolean)
.join('\n')
}
if (prop === 'productUnit') {
return (row.products || []).map((p) => p.unit || '').filter(Boolean).join('\n')
}
if (prop === 'planAttachments') {
return ''
}
if (prop === 'licensePlate') {
return formatPlVehiclePlateDisplay(row.licensePlate, row.trailerNo)
}
if (prop === 'personnelSummary') {
return normalizePlPersonnelSummaryDisplay(row.personnelSummary)
}
return (row as any)?.[prop]
}
const selectedRows = ref<Plan[]>([])
const viewingPlan = ref<Plan | null>(null)
@@ -515,6 +582,7 @@ function handleReset() {
function handleQuickSearch() {
searchForm.planNo = ''
searchForm.customerName = ''
searchForm.productName = ''
pagination.page = 1
fetchData()
}
@@ -611,6 +679,10 @@ onMounted(() => {
</script>
<style scoped lang="scss">
.bx-list-table-wrap {
min-width: 0;
}
.pl-plan-list-toolbar-row {
flex-wrap: wrap;
}