提交
This commit is contained in:
1 parent
42ad896456
commit
6b2147aa46
66 files changed
+617071
-28046
No files matched your search
@@ -87,7 +87,7 @@
|
||||
/>
|
||||
<ListQuickSearchInput
|
||||
v-model="quickSearch"
|
||||
placeholder="计划编号/客户名称/产品名称/车牌号"
|
||||
placeholder="计划编号/供方/需方/产品名称/车牌号"
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
@@ -173,15 +173,17 @@
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="pl-plan"
|
||||
class="list-table"
|
||||
:data="planList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
>
|
||||
<div ref="planTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-plan"
|
||||
class="list-table"
|
||||
:data="planList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-dblclick="handleView"
|
||||
@header-dragend="() => planStatsRowRef?.resync?.()"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
@@ -390,6 +392,15 @@
|
||||
align="center"
|
||||
/>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
ref="planStatsRowRef"
|
||||
storage-key="pl-plan-column-stats"
|
||||
:columns="planStatsRowColumns"
|
||||
:data="planList"
|
||||
:table-wrap-el="planTableWrapRef"
|
||||
:get-cell-value="getPlanStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar pl-plan-list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
@@ -528,6 +539,8 @@ import PlPlanArrangeDialog from '@/components/business/pl-plan-arrange-dialog/in
|
||||
import PlPlanFormDialog from '@/components/business/pl-plan-form-dialog/index.vue'
|
||||
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 PlPlanListCertCell from '@/components/business/pl-plan-list-cert-cell/index.vue'
|
||||
import PlPlanListProductCell from '@/components/business/pl-plan-list-product-cell/index.vue'
|
||||
@@ -595,6 +608,64 @@ const {
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('pl-plan-list-columns-v2', listColumnDefs)
|
||||
|
||||
const planTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const planStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const planStatsRowColumns = 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 getPlanStatCellValue(row: Plan, prop: string): unknown {
|
||||
if (prop === 'followStatus') return getPlPlanFollowStatusLabel(row.followStatus)
|
||||
if (prop === 'planType') return getPlanTypeLabel(row.planType)
|
||||
if (prop === 'contractSummary') {
|
||||
return planContractLines(row)
|
||||
.map((l) => `${l.side}${l.no}`)
|
||||
.join(' ')
|
||||
}
|
||||
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.spec || '').filter(Boolean).join('\n')
|
||||
}
|
||||
if (prop === 'productPackageSpec') {
|
||||
return (row.products || []).map((p) => 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)
|
||||
|
||||
@@ -1010,6 +1081,10 @@ async function openArrangeFromQuery() {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.bx-list-table-wrap {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.pl-plan-list-toolbar-row {
|
||||
flex-wrap: nowrap;
|
||||
overflow-x: auto;
|
||||
|
||||
Reference in new issue
Block a user