feat(pl): add Excel export for recharge, urea and maintenance process lists
Support filtered and selected export on apply and disburse/process board pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
441e1fdae1
commit
89e8d6e65c
12 files changed
+511
-8
No files matched your search
@@ -1412,6 +1412,8 @@ export interface VehicleRechargeDisburseBoardListResponse {
|
||||
export const vehicleRechargeApplyApi = {
|
||||
list: (params?: Record<string, unknown>) =>
|
||||
request.get<VehicleRechargeApplyListResponse>('/transport/vehicle-recharge-apply/', { params }),
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-recharge-apply/export', data, { responseType: 'blob' }),
|
||||
get: (id: string) => request.get<VehicleRechargeApply>(`/transport/vehicle-recharge-apply/${id}`),
|
||||
create: (data: Partial<VehicleRechargeApply>) =>
|
||||
request.post<VehicleRechargeApply>('/transport/vehicle-recharge-apply/', data),
|
||||
@@ -1430,6 +1432,8 @@ export const vehicleRechargeRecordApi = {
|
||||
'/transport/vehicle-recharge-record/disburse-board',
|
||||
{ params }
|
||||
),
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-recharge-record/disburse-board/export', data, { responseType: 'blob' }),
|
||||
list: (params?: Record<string, unknown>) =>
|
||||
request.get<VehicleRechargeRecordListResponse>('/transport/vehicle-recharge-record/', { params }),
|
||||
get: (id: string) => request.get<VehicleRechargeRecord>(`/transport/vehicle-recharge-record/${id}`),
|
||||
@@ -1530,11 +1534,11 @@ export interface VehicleMaintenanceProcessBoardListResponse {
|
||||
|
||||
export const vehicleMaintenanceApplyApi = {
|
||||
list: (params?: Record<string, unknown>) =>
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-maintenance-apply/export', data, { responseType: 'blob' }),
|
||||
request.get<VehicleMaintenanceApplyListResponse>('/transport/vehicle-maintenance-apply/', {
|
||||
params
|
||||
}),
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-maintenance-apply/export', data, { responseType: 'blob' }),
|
||||
get: (id: string) =>
|
||||
request.get<VehicleMaintenanceApply>(`/transport/vehicle-maintenance-apply/${id}`),
|
||||
create: (data: Partial<VehicleMaintenanceApply>) =>
|
||||
@@ -1556,6 +1560,8 @@ export const vehicleMaintenanceProcessApi = {
|
||||
'/transport/vehicle-maintenance-process/process-board',
|
||||
{ params }
|
||||
),
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-maintenance-process/process-board/export', data, { responseType: 'blob' }),
|
||||
get: (id: string) =>
|
||||
request.get<VehicleMaintenanceProcess>(`/transport/vehicle-maintenance-process/${id}`),
|
||||
create: (data: Partial<VehicleMaintenanceProcess>) =>
|
||||
@@ -1642,6 +1648,8 @@ export interface VehicleUreaDisburseBoardListResponse {
|
||||
export const vehicleUreaApplyApi = {
|
||||
list: (params?: Record<string, unknown>) =>
|
||||
request.get<VehicleUreaApplyListResponse>('/transport/vehicle-urea-apply/', { params }),
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-urea-apply/export', data, { responseType: 'blob' }),
|
||||
get: (id: string) => request.get<VehicleUreaApply>(`/transport/vehicle-urea-apply/${id}`),
|
||||
create: (data: Partial<VehicleUreaApply>) =>
|
||||
request.post<VehicleUreaApply>('/transport/vehicle-urea-apply/', data),
|
||||
@@ -1658,6 +1666,8 @@ export const vehicleUreaDisburseApi = {
|
||||
'/transport/vehicle-urea-disburse/disburse-board',
|
||||
{ params }
|
||||
),
|
||||
export: (data: Record<string, any>) =>
|
||||
request.post('/transport/vehicle-urea-disburse/disburse-board/export', data, { responseType: 'blob' }),
|
||||
get: (id: string) => request.get<VehicleUreaDisburse>(`/transport/vehicle-urea-disburse/${id}`),
|
||||
create: (data: Partial<VehicleUreaDisburse>) =>
|
||||
request.post<VehicleUreaDisburse>('/transport/vehicle-urea-disburse/', data),
|
||||
|
||||
@@ -101,6 +101,15 @@
|
||||
<el-icon><Plus /></el-icon>无申请补录
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="vehicleMaintenanceProcessApi.export"
|
||||
:get-filter-params="getMaintProcessExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.applyId)"
|
||||
:visible-columns="maintProcessExportColumns"
|
||||
filename="维保过程.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -414,6 +423,7 @@
|
||||
<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 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'
|
||||
@@ -518,6 +528,25 @@ function getMaintProcessStatCellValue(row: VehicleMaintenanceProcessBoardItem, p
|
||||
const submitLoading = ref(false)
|
||||
const deleteLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const selectedRows = ref<VehicleMaintenanceProcessBoardItem[]>([])
|
||||
|
||||
function getMaintProcessExportFilterParams() {
|
||||
return {
|
||||
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
|
||||
maintenanceType: searchForm.maintenanceType || undefined,
|
||||
applyStatus: searchForm.applyStatus || undefined,
|
||||
applyDateFrom: applyDateRange.value?.[0],
|
||||
applyDateTo: applyDateRange.value?.[1],
|
||||
processDateFrom: processDateRange.value?.[0],
|
||||
processDateTo: processDateRange.value?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
const maintProcessExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyNo')) cols.unshift('applyNo')
|
||||
return cols
|
||||
})
|
||||
|
||||
const tableData = ref<VehicleMaintenanceProcessBoardItem[]>([])
|
||||
const vehicleOptions = ref<Vehicle[]>([])
|
||||
const vehicleTrailerLookup = computed(() => buildVehicleTrailerLookup(vehicleOptions.value))
|
||||
|
||||
@@ -74,6 +74,15 @@
|
||||
<el-icon><CircleClose /></el-icon>作废
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="vehicleRechargeApplyApi.export"
|
||||
:get-filter-params="getRechargeApplyExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.id)"
|
||||
:visible-columns="rechargeApplyExportColumns"
|
||||
filename="充值申请.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -308,6 +317,7 @@
|
||||
<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 ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import {
|
||||
@@ -376,6 +386,23 @@ const submitLoading = ref(false)
|
||||
const cancelLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const tableData = ref<VehicleRechargeApply[]>([])
|
||||
const selectedRows = ref<VehicleRechargeApply[]>([])
|
||||
|
||||
function getRechargeApplyExportFilterParams() {
|
||||
return {
|
||||
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
|
||||
rechargeType: searchForm.rechargeType || undefined,
|
||||
status: searchForm.status || undefined,
|
||||
applyDateFrom: dateRange.value?.[0],
|
||||
applyDateTo: dateRange.value?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
const rechargeApplyExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyNo')) cols.unshift('applyNo')
|
||||
return cols
|
||||
})
|
||||
|
||||
const vehicleOptions = ref<Vehicle[]>([])
|
||||
const vehicleTrailerLookup = computed(() => buildVehicleTrailerLookup(vehicleOptions.value))
|
||||
const dateRange = ref<string[]>([])
|
||||
|
||||
@@ -104,6 +104,15 @@
|
||||
<el-icon><Delete /></el-icon>撤销发放
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="vehicleRechargeRecordApi.export"
|
||||
:get-filter-params="getRechargeDisburseExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.applyId)"
|
||||
:visible-columns="rechargeDisburseExportColumns"
|
||||
filename="充值发放.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -417,6 +426,7 @@
|
||||
<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 ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { Check, Close, Delete, Edit, Money, Plus, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
@@ -476,6 +486,25 @@ const submitLoading = ref(false)
|
||||
const deleteLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const tableData = ref<VehicleRechargeDisburseBoardItem[]>([])
|
||||
const selectedRows = ref<VehicleRechargeDisburseBoardItem[]>([])
|
||||
|
||||
function getRechargeDisburseExportFilterParams() {
|
||||
return {
|
||||
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
|
||||
rechargeType: searchForm.rechargeType || undefined,
|
||||
applyStatus: searchForm.applyStatus || undefined,
|
||||
applyDateFrom: applyDateRange.value?.[0],
|
||||
applyDateTo: applyDateRange.value?.[1],
|
||||
rechargeDateFrom: rechargeDateRange.value?.[0],
|
||||
rechargeDateTo: rechargeDateRange.value?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
const rechargeDisburseExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyNo')) cols.unshift('applyNo')
|
||||
return cols
|
||||
})
|
||||
|
||||
const vehicleOptions = ref<Vehicle[]>([])
|
||||
const vehicleTrailerLookup = computed(() => buildVehicleTrailerLookup(vehicleOptions.value))
|
||||
const applyDateRange = ref<string[]>([])
|
||||
|
||||
@@ -68,6 +68,15 @@
|
||||
<el-icon><CircleClose /></el-icon>作废
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="vehicleUreaApplyApi.export"
|
||||
:get-filter-params="getUreaApplyExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.id)"
|
||||
:visible-columns="ureaApplyExportColumns"
|
||||
filename="尿素申请.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -335,6 +344,7 @@
|
||||
<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 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'
|
||||
@@ -436,6 +446,22 @@ const submitLoading = ref(false)
|
||||
const cancelLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const tableData = ref<VehicleUreaApply[]>([])
|
||||
const selectedRows = ref<VehicleUreaApply[]>([])
|
||||
|
||||
function getUreaApplyExportFilterParams() {
|
||||
return {
|
||||
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
|
||||
status: searchForm.status || undefined,
|
||||
applyDateFrom: dateRange.value?.[0],
|
||||
applyDateTo: dateRange.value?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
const ureaApplyExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyNo')) cols.unshift('applyNo')
|
||||
return cols
|
||||
})
|
||||
|
||||
const vehicleOptions = ref<Vehicle[]>([])
|
||||
const vehicleTrailerLookup = computed(() => buildVehicleTrailerLookup(vehicleOptions.value))
|
||||
const dateRange = ref<string[]>([])
|
||||
|
||||
@@ -83,6 +83,15 @@
|
||||
<el-icon><Plus /></el-icon>无申请补录
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="vehicleUreaDisburseApi.export"
|
||||
:get-filter-params="getUreaDisburseExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.applyId)"
|
||||
:visible-columns="ureaDisburseExportColumns"
|
||||
filename="尿素发放.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -385,6 +394,7 @@
|
||||
<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 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'
|
||||
@@ -484,6 +494,24 @@ function getUreaDisburseStatCellValue(row: VehicleUreaDisburseBoardItem, prop: s
|
||||
const submitLoading = ref(false)
|
||||
const deleteLoadingMap = reactive<Record<string, boolean>>({})
|
||||
const selectedRows = ref<VehicleUreaDisburseBoardItem[]>([])
|
||||
|
||||
function getUreaDisburseExportFilterParams() {
|
||||
return {
|
||||
q: quickSearchKeyword.value.trim() || searchForm.q || undefined,
|
||||
applyStatus: searchForm.applyStatus || undefined,
|
||||
applyDateFrom: applyDateRange.value?.[0],
|
||||
applyDateTo: applyDateRange.value?.[1],
|
||||
disburseDateFrom: disburseDateRange.value?.[0],
|
||||
disburseDateTo: disburseDateRange.value?.[1]
|
||||
}
|
||||
}
|
||||
|
||||
const ureaDisburseExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('applyNo')) cols.unshift('applyNo')
|
||||
return cols
|
||||
})
|
||||
|
||||
const tableData = ref<VehicleUreaDisburseBoardItem[]>([])
|
||||
const vehicleOptions = ref<Vehicle[]>([])
|
||||
const vehicleTrailerLookup = computed(() => buildVehicleTrailerLookup(vehicleOptions.value))
|
||||
|
||||
Reference in new issue
Block a user