feat(bx): add list Excel export for reimbursement module pages
Wire ListExportDropdown on advance/reimburse/payment/expense/view/wallet lists, with matching POST export endpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
fe15a130cb
commit
dbba755fd8
16 files changed
+901
-11
No files matched your search
@@ -93,6 +93,15 @@
|
||||
<el-button class="btn-ghost" @click="openFlowDialog()">
|
||||
<el-icon><View /></el-icon>查看审批流
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="advanceApi.exportMy"
|
||||
:get-filter-params="getAdvanceApplyExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="advanceApplyExportColumns"
|
||||
filename="我的备用金申请.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -432,6 +441,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
@@ -580,6 +590,18 @@ const viewMainKvFields = computed<ViewField[]>(() => {
|
||||
]
|
||||
})
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
function getAdvanceApplyExportFilterParams() {
|
||||
const q = buildSearchQuery()
|
||||
return { ...q }
|
||||
}
|
||||
|
||||
const advanceApplyExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const editingId = ref<number | null>(null)
|
||||
const flowNodes = ref<any[]>([])
|
||||
const flowHistory = ref<any[]>([])
|
||||
|
||||
@@ -68,6 +68,15 @@
|
||||
<el-icon><Close /></el-icon>驳回
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="advanceApi.exportPendingApproval"
|
||||
:get-filter-params="getAdvancePendingExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="advanceApproveExportColumns"
|
||||
filename="备用金待审批.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="pendingLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -242,6 +251,15 @@
|
||||
@search="handleApprovedQuickSearch"
|
||||
@clear="handleApprovedQuickSearchClear"
|
||||
/>
|
||||
<ListExportDropdown
|
||||
:export-fn="advanceApi.exportApprovedByMe"
|
||||
:get-filter-params="getAdvanceApprovedExportFilterParams"
|
||||
:has-selection="false"
|
||||
:selected-ids="[]"
|
||||
:visible-columns="advanceApproveExportColumns"
|
||||
filename="备用金已审批.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="approvedLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -478,6 +496,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, computed, onMounted } from 'vue'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
@@ -597,6 +616,31 @@ const {
|
||||
})
|
||||
|
||||
const tabLoaded = reactive({ pending: false, approved: false })
|
||||
|
||||
function getAdvancePendingExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (pendingQuickSearchKeyword.value.trim() || pendingFilterForm.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
|
||||
buildApplyDateRangeQuery(pendingFilterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
function getAdvanceApprovedExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (approvedQuickSearchKeyword.value.trim() || approvedFilterForm.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
|
||||
buildApplyDateRangeQuery(approvedFilterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const advanceApproveExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const activeTab = ref('pending')
|
||||
|
||||
const pendingQuickSearchKeyword = ref('')
|
||||
|
||||
@@ -63,9 +63,14 @@
|
||||
<el-button class="btn-main" type="primary" @click="handleToolbarIssue">
|
||||
<el-icon><Check /></el-icon>发放
|
||||
</el-button>
|
||||
<el-button class="btn-ghost" :loading="loadingMap.export" @click="handleExport">
|
||||
<el-icon><Download /></el-icon>导出
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="paymentApi.exportAdvanceIssuesXlsx"
|
||||
:get-filter-params="getAdvanceIssueExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="advanceIssueExportColumns"
|
||||
:filename="activeTab === 'pending' ? '备用金待发放.xlsx' : '备用金已发放.xlsx'"
|
||||
/>
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -260,9 +265,14 @@
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
<el-button class="btn-ghost" :loading="loadingMap.export" @click="handleExport">
|
||||
<el-icon><Download /></el-icon>导出
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="paymentApi.exportAdvanceIssuesXlsx"
|
||||
:get-filter-params="getAdvanceIssueExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="advanceIssueExportColumns"
|
||||
:filename="activeTab === 'pending' ? '备用金待发放.xlsx' : '备用金已发放.xlsx'"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
@@ -528,6 +538,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
@@ -744,6 +755,24 @@ useDbInstantSearch(
|
||||
handleSearch
|
||||
)
|
||||
|
||||
|
||||
function getAdvanceIssueExportFilterParams() {
|
||||
const q: Record<string, any> = {
|
||||
issueStatus: activeTab.value === 'pending' ? 'pending' : 'issued'
|
||||
}
|
||||
const kw = (quickSearchKeyword.value.trim() || filterForm.keyword.trim() || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
if (filterForm.applicantId != null) q.applicantId = filterForm.applicantId
|
||||
buildApplyDateRangeQuery(filterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const advanceIssueExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
async function handleExport() {
|
||||
loadingMap.export = true
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user