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
@@ -23,6 +23,9 @@ export const expenseItemApi = {
|
||||
},
|
||||
delete(id: BxId) {
|
||||
return bxRequest.delete(`/expense-items/${id}`)
|
||||
},
|
||||
export(data: Record<string, any>) {
|
||||
return bxRequest.post('/expense-items/export', data, { responseType: 'blob' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +66,12 @@ export const advanceApi = {
|
||||
my(params: { page: number; pageSize: number; status?: string; keyword?: string } & BxApplyDateFilter) {
|
||||
return bxRequest.get('/advances/my', { params })
|
||||
},
|
||||
exportMy(data: Record<string, any>) {
|
||||
return bxRequest.post('/advances/my/export', data, { responseType: 'blob' })
|
||||
},
|
||||
exportList(data: Record<string, any>) {
|
||||
return bxRequest.post('/advances/export', data, { responseType: 'blob' })
|
||||
},
|
||||
myStats() {
|
||||
return bxRequest.get('/advances/my/stats')
|
||||
},
|
||||
@@ -77,6 +86,9 @@ export const advanceApi = {
|
||||
} & BxApplyDateFilter) {
|
||||
return bxRequest.get('/advances/pending-approval', { params })
|
||||
},
|
||||
exportPendingApproval(data: Record<string, any>) {
|
||||
return bxRequest.post('/advances/pending-approval/export', data, { responseType: 'blob' })
|
||||
},
|
||||
pendingApprovalStats() {
|
||||
return bxRequest.get('/advances/pending-approval/stats')
|
||||
},
|
||||
@@ -88,6 +100,9 @@ export const advanceApi = {
|
||||
} & BxApplyDateFilter) {
|
||||
return bxRequest.get('/advances/approved-by-me', { params })
|
||||
},
|
||||
exportApprovedByMe(data: Record<string, any>) {
|
||||
return bxRequest.post('/advances/approved-by-me/export', data, { responseType: 'blob' })
|
||||
},
|
||||
getById(id: BxId) {
|
||||
return bxRequest.get(`/advances/${id}`)
|
||||
},
|
||||
@@ -135,6 +150,18 @@ export const reimburseApi = {
|
||||
} & BxApplyDateFilter) {
|
||||
return bxRequest.get('/reimburses/', { params })
|
||||
},
|
||||
exportMy(data: Record<string, any>) {
|
||||
return bxRequest.post('/reimburses/my/export', data, { responseType: 'blob' })
|
||||
},
|
||||
exportList(data: Record<string, any>) {
|
||||
return bxRequest.post('/reimburses/export', data, { responseType: 'blob' })
|
||||
},
|
||||
exportPendingApproval(data: Record<string, any>) {
|
||||
return bxRequest.post('/reimburses/pending-approval/export', data, { responseType: 'blob' })
|
||||
},
|
||||
exportApprovedByMe(data: Record<string, any>) {
|
||||
return bxRequest.post('/reimburses/approved-by-me/export', data, { responseType: 'blob' })
|
||||
},
|
||||
my(params: { page: number; pageSize: number; status?: string; keyword?: string } & BxApplyDateFilter) {
|
||||
return bxRequest.get('/reimburses/my', { params })
|
||||
},
|
||||
@@ -222,6 +249,15 @@ export const paymentApi = {
|
||||
} & BxApplyDateFilter) {
|
||||
return bxRequest.get('/payments/pending', { params })
|
||||
},
|
||||
exportPending(data: Record<string, any>) {
|
||||
return bxRequest.post('/payments/pending/export', data, { responseType: 'blob' })
|
||||
},
|
||||
exportProcessed(data: Record<string, any>) {
|
||||
return bxRequest.post('/payments/processed/export', data, { responseType: 'blob' })
|
||||
},
|
||||
exportAdvanceIssuesXlsx(data: Record<string, any>) {
|
||||
return bxRequest.post('/payments/advance-issues/export-xlsx', data, { responseType: 'blob' })
|
||||
},
|
||||
pay(id: BxId, data?: { payRemark?: string; actualAmount?: number }) {
|
||||
return bxRequest.post(`/payments/${id}/pay`, data)
|
||||
},
|
||||
@@ -297,6 +333,9 @@ export const invoiceWalletApi = {
|
||||
},
|
||||
list(params: { page: number; pageSize: number; keyword?: string }) {
|
||||
return bxRequest.get('/invoice-wallets', { params })
|
||||
},
|
||||
export(data: Record<string, any>) {
|
||||
return bxRequest.post('/invoice-wallets/export', data, { responseType: 'blob' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -83,6 +83,15 @@
|
||||
<el-icon><SortUp /></el-icon>收起全部
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="expenseItemApi.export"
|
||||
:get-filter-params="getExpenseItemExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="expenseItemExportColumns"
|
||||
filename="费用科目.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -361,6 +370,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 ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
@@ -433,6 +443,20 @@ const expenseTree = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
function getExpenseItemExportFilterParams() {
|
||||
return {
|
||||
name: appliedSearchForm.name || undefined,
|
||||
status: appliedSearchForm.status !== '' && appliedSearchForm.status != null ? String(appliedSearchForm.status) : undefined
|
||||
}
|
||||
}
|
||||
|
||||
const expenseItemExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('itemName')) cols.unshift('itemName')
|
||||
return cols
|
||||
})
|
||||
|
||||
|
||||
const formData = reactive({
|
||||
id: 0 as number,
|
||||
itemName: '',
|
||||
|
||||
@@ -39,6 +39,14 @@
|
||||
<el-button class="btn-main" type="primary" @click="openProxyUpload()">
|
||||
<el-icon><Upload /></el-icon>代传发票
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="invoiceWalletApi.export"
|
||||
:get-filter-params="() => ({ keyword: buildKeyword() })"
|
||||
:has-selection="false"
|
||||
:selected-ids="[]"
|
||||
:visible-columns="['ownerUserName','totalAmount','usedAmount','balance','invoiceCount']"
|
||||
filename="发票夹汇总.xlsx"
|
||||
/>
|
||||
<ListToolbarEndActions :loading="loading" :show-columns="false" @refresh="handleSearch" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -286,7 +294,8 @@
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/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 BxInvoiceFileSelect from '@/components/bx/base/BxInvoiceFileSelect.vue'
|
||||
|
||||
@@ -67,6 +67,15 @@
|
||||
<el-button class="btn-ghost" @click="handleToolbarOffset">
|
||||
<el-icon><Switch /></el-icon>冲抵备用金
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="paymentApi.exportPending"
|
||||
:get-filter-params="getPaymentPendingExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="paymentExportColumns"
|
||||
filename="报销待付款.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -264,6 +273,15 @@
|
||||
@search="handleProcessedQuickSearch"
|
||||
@clear="handleProcessedQuickSearchClear"
|
||||
/>
|
||||
<ListExportDropdown
|
||||
:export-fn="paymentApi.exportProcessed"
|
||||
:get-filter-params="getPaymentProcessedExportFilterParams"
|
||||
:has-selection="false"
|
||||
:selected-ids="[]"
|
||||
:visible-columns="paymentExportColumns"
|
||||
filename="报销已付款.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="processedLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -691,6 +709,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'
|
||||
@@ -881,6 +900,31 @@ const offsetPayAmount = computed({
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function getPaymentPendingExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (quickSearchKeyword.value.trim() || filterForm.code.trim() || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
if (filterForm.applicantId != null) q.applicantId = filterForm.applicantId
|
||||
buildApplyDateRangeQuery(filterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
function getPaymentProcessedExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (processedQuickSearchKeyword.value.trim() || processedFilterForm.code.trim() || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
if (processedFilterForm.applicantId != null) q.applicantId = processedFilterForm.applicantId
|
||||
buildApplyDateRangeQuery(processedFilterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const paymentExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const activeTab = ref('pending')
|
||||
const tabLoaded = reactive({ pending: true, processed: false })
|
||||
|
||||
|
||||
@@ -96,6 +96,15 @@
|
||||
>
|
||||
<el-icon><Filter /></el-icon>清空列过滤
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="reimburseApi.exportMy"
|
||||
:get-filter-params="getReimburseApplyExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="reimburseApplyExportColumns"
|
||||
filename="我的报销申请.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -789,6 +798,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 ColumnHeaderFilter from '@/components/business/column-header-filter/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
@@ -1061,6 +1071,18 @@ const viewProcessKvFields = computed<ViewField[]>(() => {
|
||||
]
|
||||
})
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
function getReimburseApplyExportFilterParams() {
|
||||
const q = buildSearchQuery()
|
||||
return { ...q }
|
||||
}
|
||||
|
||||
const reimburseApplyExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const flowNodes = ref<any[]>([])
|
||||
const flowHistory = ref<any[]>([])
|
||||
const flowLoading = ref(false)
|
||||
|
||||
@@ -95,6 +95,15 @@
|
||||
<el-icon><Close /></el-icon>驳回
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="reimburseApi.exportPendingApproval"
|
||||
:get-filter-params="getReimbursePendingExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="reimburseApproveExportColumns"
|
||||
filename="报销待审批.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="pendingLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -318,6 +327,15 @@
|
||||
@search="handleApprovedQuickSearch"
|
||||
@clear="handleApprovedQuickSearchClear"
|
||||
/>
|
||||
<ListExportDropdown
|
||||
:export-fn="reimburseApi.exportApprovedByMe"
|
||||
:get-filter-params="getReimburseApprovedExportFilterParams"
|
||||
:has-selection="false"
|
||||
:selected-ids="[]"
|
||||
:visible-columns="reimburseApproveExportColumns"
|
||||
filename="报销已审批.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="approvedLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -614,6 +632,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 { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
@@ -758,6 +777,31 @@ const {
|
||||
})
|
||||
|
||||
const tabLoaded = reactive({ pending: false, approved: false })
|
||||
|
||||
function getReimbursePendingExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (pendingQuickSearchKeyword.value.trim() || pendingFilterForm.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
if (pendingFilterForm.expenseName) q.expenseName = pendingFilterForm.expenseName
|
||||
buildApplyDateRangeQuery(pendingFilterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
function getReimburseApprovedExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (approvedQuickSearchKeyword.value.trim() || approvedFilterForm.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
if (approvedFilterForm.expenseName) q.expenseName = approvedFilterForm.expenseName
|
||||
buildApplyDateRangeQuery(approvedFilterForm.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const reimburseApproveExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const activeTab = ref('pending')
|
||||
const menuStore = useMenuStore()
|
||||
|
||||
|
||||
@@ -82,6 +82,15 @@
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
<ListExportDropdown
|
||||
:export-fn="exportBxViewAll"
|
||||
:get-filter-params="getBxViewExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="bxViewExportColumns"
|
||||
filename="业务视图.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -373,6 +382,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 ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
@@ -419,7 +429,44 @@
|
||||
type DialogKey = 'viewDetail'
|
||||
|
||||
const loading = ref(false)
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
async function exportBxViewAll(payload: Record<string, any>) {
|
||||
const biz = appliedFilter.bizType || filterForm.bizType || ''
|
||||
const ids: string[] = payload.ids || []
|
||||
if (ids.length) {
|
||||
const selected = selectedRows.value.filter((r: any) => ids.includes(String(r.id)))
|
||||
const adv = selected.filter((r: any) => r.bizType === '备用金')
|
||||
const rei = selected.filter((r: any) => r.bizType === '报销单')
|
||||
if (adv.length && rei.length) {
|
||||
throw new Error('请选择同一业务类型的记录再导出')
|
||||
}
|
||||
if (adv.length) {
|
||||
return advanceApi.exportList({ ...payload, ids: adv.map((r: any) => String(r.id)) })
|
||||
}
|
||||
return reimburseApi.exportList({ ...payload, ids: rei.map((r: any) => String(r.id)) })
|
||||
}
|
||||
if (biz === '备用金') return advanceApi.exportList(payload)
|
||||
if (biz === '报销单') return reimburseApi.exportList(payload)
|
||||
throw new Error('请先筛选业务类型(备用金/报销单)后再导出')
|
||||
}
|
||||
|
||||
function getBxViewExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (quickSearchKeyword.value.trim() || filterForm.keyword || appliedFilter.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
const status = filterForm.status || appliedFilter.status
|
||||
if (status) q.status = status
|
||||
buildApplyDateRangeQuery(filterForm.applyDateRange || appliedFilter.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const bxViewExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const selectedRows = ref<any[]>([])
|
||||
const dialogs = reactive<Record<DialogKey, boolean>>({
|
||||
viewDetail: false
|
||||
})
|
||||
|
||||
@@ -80,6 +80,15 @@
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
<ListExportDropdown
|
||||
:export-fn="exportBxViewMine"
|
||||
:get-filter-params="getBxViewExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="bxViewExportColumns"
|
||||
filename="业务视图.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="tableLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -361,6 +370,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 ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
@@ -400,7 +410,44 @@
|
||||
|
||||
const tableLoading = ref(false)
|
||||
const searchLoading = ref(false)
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
async function exportBxViewMine(payload: Record<string, any>) {
|
||||
const biz = appliedFilter.bizType || filterForm.bizType || ''
|
||||
const ids: string[] = payload.ids || []
|
||||
if (ids.length) {
|
||||
const selected = selectedRows.value.filter((r: any) => ids.includes(String(r.id)))
|
||||
const adv = selected.filter((r: any) => r.bizType === '备用金')
|
||||
const rei = selected.filter((r: any) => r.bizType === '报销单')
|
||||
if (adv.length && rei.length) {
|
||||
throw new Error('请选择同一业务类型的记录再导出')
|
||||
}
|
||||
if (adv.length) {
|
||||
return advanceApi.exportMy({ ...payload, ids: adv.map((r: any) => String(r.id)) })
|
||||
}
|
||||
return reimburseApi.exportMy({ ...payload, ids: rei.map((r: any) => String(r.id)) })
|
||||
}
|
||||
if (biz === '备用金') return advanceApi.exportMy(payload)
|
||||
if (biz === '报销单') return reimburseApi.exportMy(payload)
|
||||
throw new Error('请先筛选业务类型(备用金/报销单)后再导出')
|
||||
}
|
||||
|
||||
function getBxViewExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (quickSearchKeyword.value.trim() || filterForm.keyword || appliedFilter.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
const status = filterForm.status || appliedFilter.status
|
||||
if (status) q.status = status
|
||||
buildApplyDateRangeQuery(filterForm.applyDateRange || appliedFilter.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const bxViewExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const selectedRows = ref<any[]>([])
|
||||
const dialogs = reactive<Record<DialogKey, boolean>>({
|
||||
viewDetail: false
|
||||
})
|
||||
|
||||
@@ -96,6 +96,15 @@
|
||||
<el-icon><Close /></el-icon>批量驳回
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="exportBxViewTodo"
|
||||
:get-filter-params="getBxViewExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => String(r.id))"
|
||||
:visible-columns="bxViewExportColumns"
|
||||
filename="业务视图.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="tableLoading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -439,6 +448,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 type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
@@ -784,7 +794,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
async function exportBxViewTodo(payload: Record<string, any>) {
|
||||
const biz = appliedFilter.bizType || filterForm.bizType || ''
|
||||
const ids: string[] = payload.ids || []
|
||||
if (ids.length) {
|
||||
const selected = selectedRows.value.filter((r: any) => ids.includes(String(r.id)))
|
||||
const adv = selected.filter((r: any) => r.bizType === '备用金')
|
||||
const rei = selected.filter((r: any) => r.bizType === '报销单')
|
||||
if (adv.length && rei.length) {
|
||||
throw new Error('请选择同一业务类型的记录再导出')
|
||||
}
|
||||
if (adv.length) {
|
||||
return advanceApi.exportPendingApproval({ ...payload, ids: adv.map((r: any) => String(r.id)) })
|
||||
}
|
||||
return reimburseApi.exportPendingApproval({ ...payload, ids: rei.map((r: any) => String(r.id)) })
|
||||
}
|
||||
if (biz === '备用金') return advanceApi.exportPendingApproval(payload)
|
||||
if (biz === '报销单') return reimburseApi.exportPendingApproval(payload)
|
||||
throw new Error('请先筛选业务类型(备用金/报销单)后再导出')
|
||||
}
|
||||
|
||||
function getBxViewExportFilterParams() {
|
||||
const q: Record<string, any> = {}
|
||||
const kw = (quickSearchKeyword.value.trim() || filterForm.keyword || appliedFilter.keyword || '').trim()
|
||||
if (kw) q.keyword = kw
|
||||
const status = filterForm.status || appliedFilter.status
|
||||
if (status) q.status = status
|
||||
buildApplyDateRangeQuery(filterForm.applyDateRange || appliedFilter.applyDateRange, q)
|
||||
return q
|
||||
}
|
||||
|
||||
const bxViewExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyCode')) cols.unshift('applyCode')
|
||||
return cols
|
||||
})
|
||||
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
function onSelectionChange(rows: any[]) {
|
||||
selectedRows.value = rows
|
||||
|
||||
Reference in new issue
Block a user