feat(pl): add Excel export for plan contract gaps and document reminders
Complete remaining logistics list export pages under the PL module wave. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b1f734dbb0
commit
fe15a130cb
6 files changed
+205
No files matched your search
@@ -43,6 +43,15 @@
|
||||
<el-icon><CircleCheck /></el-icon>处理
|
||||
</el-button>
|
||||
|
||||
<ListExportDropdown
|
||||
:export-fn="inventoryApi.exportDocumentReminders"
|
||||
:get-filter-params="getReminderExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.id)"
|
||||
:visible-columns="reminderExportColumns"
|
||||
filename="证件到期提醒.xlsx"
|
||||
/>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
:column-defs="listColumnDefs"
|
||||
@@ -159,6 +168,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 { CircleCheck, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { inventoryApi, type DocumentReminder } from '@/api/pl'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
@@ -189,6 +199,19 @@ const reminderSourceList = ref<DocumentReminder[]>([])
|
||||
const quickSearchKeyword = ref('')
|
||||
const selectedRows = ref<DocumentReminder[]>([])
|
||||
|
||||
function getReminderExportFilterParams() {
|
||||
return {
|
||||
status: searchForm.status || undefined
|
||||
}
|
||||
}
|
||||
|
||||
const reminderExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('ownerLabel')) cols.unshift('ownerLabel')
|
||||
return cols
|
||||
})
|
||||
|
||||
|
||||
const searchForm = reactive({
|
||||
status: ''
|
||||
})
|
||||
|
||||
@@ -70,6 +70,14 @@
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
<ListExportDropdown
|
||||
:export-fn="planApi.exportContractGaps"
|
||||
:get-filter-params="getContractGapExportFilterParams"
|
||||
:has-selection="false"
|
||||
:selected-ids="[]"
|
||||
:visible-columns="contractGapExportColumns"
|
||||
filename="计划合同完善.xlsx"
|
||||
/>
|
||||
<el-button class="btn-ghost" :loading="loading" @click="fetchData">
|
||||
<el-icon><Refresh /></el-icon>刷新
|
||||
</el-button>
|
||||
@@ -347,6 +355,7 @@ import PlPlanContractMultiSelect from '@/components/business/pl-plan-contract-mu
|
||||
import PlPlanListProductCell from '@/components/business/pl-plan-list-product-cell/index.vue'
|
||||
import PlPlanViewDialog from '@/components/business/pl-plan-view-dialog/index.vue'
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import ListToolbarDateShortcuts from '@/components/core/list-toolbar-date-shortcuts/index.vue'
|
||||
import { useListDateShortcut } from '@/composables/useListDateShortcut'
|
||||
import {
|
||||
@@ -392,6 +401,29 @@ const pagination = reactive({
|
||||
total: 0
|
||||
})
|
||||
|
||||
function getContractGapExportFilterParams() {
|
||||
const keyword = quickSearch.value.trim()
|
||||
return {
|
||||
q: keyword || undefined,
|
||||
planNo: keyword ? undefined : searchForm.planNo || undefined,
|
||||
gapType: searchForm.gapType || undefined,
|
||||
customerKeyword: keyword ? undefined : searchForm.customerKeyword || undefined,
|
||||
planDateFrom: dateRange.value?.[0] || undefined,
|
||||
planDateTo: dateRange.value?.[1] || undefined
|
||||
}
|
||||
}
|
||||
|
||||
const contractGapExportColumns = [
|
||||
'planNo',
|
||||
'planDate',
|
||||
'planType',
|
||||
'followStatus',
|
||||
'supplierName',
|
||||
'customerName',
|
||||
'gapType'
|
||||
]
|
||||
|
||||
|
||||
function cloneLinks(links?: PlanContractLink[]): PlanContractLink[] {
|
||||
return (links || []).map(item => ({
|
||||
contractId: item.contractId,
|
||||
|
||||
Reference in new issue
Block a user