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
@@ -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