This commit is contained in:
zlwu committed 2026-07-05 10:07:24 +08:00
1 parent 33c038b8d9
commit 54b27a3f0e
253 files changed
+30060 -14298

No files matched your search

@@ -30,6 +30,12 @@
<div class="list-toolbar-selected">
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
</div>
<ListQuickSearchInput
v-model="quickSearchKeyword"
placeholder="结算单号"
@search="handleQuickSearch"
@clear="handleQuickSearchClear"
/>
<el-button
class="btn-main"
type="primary"
@@ -38,7 +44,15 @@
>
<el-icon><Money /></el-icon>发放登记
</el-button>
<ListToolbarEndActions :loading="loading" @refresh="fetchData" />
<ListToolbarEndActions
:loading="loading"
:column-defs="listColumnDefs"
v-model:visible-columns="visibleColumns"
v-model:check-all="checkAll"
:is-indeterminate="isIndeterminate"
@refresh="fetchData"
@reset-columns="resetToDefault"
/>
</div>
</div>
@@ -67,17 +81,47 @@
<el-link type="primary" @click="handleView(row)">{{ row.settlementNo }}</el-link>
</template>
</el-table-column>
<el-table-column prop="totalFreight" label="运费合计(元)" min-width="130" align="right">
<el-table-column
v-if="isColumnVisible('totalFreight')"
prop="totalFreight"
label="运费合计(元)"
min-width="130"
align="right"
>
<template #default="{ row }">{{ formatAmount(row.totalFreight) }}</template>
</el-table-column>
<el-table-column prop="planCount" label="关联计划数" min-width="110" align="center" />
<el-table-column prop="licensePlateSummary" label="车牌摘要" min-width="140" show-overflow-tooltip />
<el-table-column prop="approvalFinishedTime" label="审批完成时间" min-width="160" align="center">
<el-table-column
v-if="isColumnVisible('planCount')"
prop="planCount"
label="关联计划数"
min-width="110"
align="center"
/>
<el-table-column
v-if="isColumnVisible('licensePlateSummary')"
prop="licensePlateSummary"
label="车牌摘要"
min-width="140"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('approvalFinishedTime')"
prop="approvalFinishedTime"
label="审批完成时间"
min-width="160"
align="center"
>
<template #default="{ row }">{{
row.approvalFinishedTime ? formatDateTime(row.approvalFinishedTime) : '—'
}}</template>
</el-table-column>
<el-table-column prop="submitterName" label="提交人" min-width="100" align="center">
<el-table-column
v-if="isColumnVisible('submitterName')"
prop="submitterName"
label="提交人"
min-width="100"
align="center"
>
<template #default="{ row }">{{ row.submitterName || '—' }}</template>
</el-table-column>
</el-table>
@@ -107,7 +151,9 @@
</template>
<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 { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import { Money, RefreshLeft, Search } from '@element-plus/icons-vue'
import { freightApi, type FreightSettlement } from '@/api/pl'
import PlFreightDisburseDialog from '@/components/business/pl-freight-disburse-dialog/index.vue'
@@ -115,6 +161,22 @@ import PlFreightSettlementViewDialog from '@/components/business/pl-freight-sett
import { formatMoneyDisplay } from '@/utils/money-format'
import { formatDateTime } from '@/utils/format'
const listColumnDefs = [
{ prop: 'totalFreight', label: '运费合计(元)' },
{ prop: 'planCount', label: '关联计划数' },
{ prop: 'licensePlateSummary', label: '车牌摘要' },
{ prop: 'approvalFinishedTime', label: '审批完成时间' },
{ prop: 'submitterName', label: '提交人' }
]
const {
visibleColumns,
checkAll,
isIndeterminate,
isColumnVisible,
resetToDefault
} = usePersistedListColumns('pl-freight-disburse-columns', listColumnDefs)
const emit = defineEmits<{ disbursed: [] }>()
const loading = ref(false)
@@ -123,6 +185,7 @@ const selectedRows = ref<FreightSettlement[]>([])
const viewingRow = ref<FreightSettlement | null>(null)
const viewDialogRef = ref<InstanceType<typeof PlFreightSettlementViewDialog>>()
const disburseDialogRef = ref<InstanceType<typeof PlFreightDisburseDialog>>()
const quickSearchKeyword = ref('')
const searchForm = reactive({ q: '' })
@@ -146,7 +209,7 @@ async function fetchData() {
try {
const res = await freightApi.list({
tab: 'disburse',
q: searchForm.q || undefined,
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
page: pagination.page,
pageSize: pagination.pageSize
})
@@ -159,12 +222,25 @@ async function fetchData() {
}
function handleSearch() {
quickSearchKeyword.value = ''
pagination.page = 1
fetchData()
}
function handleReset() {
searchForm.q = ''
quickSearchKeyword.value = ''
pagination.page = 1
fetchData()
}
function handleQuickSearch() {
pagination.page = 1
fetchData()
}
function handleQuickSearchClear() {
quickSearchKeyword.value = ''
pagination.page = 1
fetchData()
}
@@ -192,8 +268,16 @@ function handleToolbarDisburse() {
handleDisburse(selectedRows.value[0])
}
function handleDisburseSuccess() {
fetchData()
function syncViewingRowFromList() {
if (!viewingRow.value?.id) return
const updated = settlementList.value.find(row => row.id === viewingRow.value!.id)
if (updated) viewingRow.value = updated
}
async function handleDisburseSuccess() {
await fetchData()
syncViewingRowFromList()
await viewDialogRef.value?.reload()
emit('disbursed')
}