20250528-修复会议导出功能

This commit is contained in:
luoyu 2025-05-28 15:56:41 +08:00
parent 86285f74c3
commit 2a3229a59a

View File

@ -93,11 +93,10 @@
<span class='table-page-search-submitButtons'>
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
<a-button style='margin-left: 8px' @click='reset'>重置</a-button>
<!-- 先做隐藏 20250527-->
<!-- <a-button v-if='isAdmin' type='danger' style='margin-left: 8px'-->
<!-- @click='showExportDayModal = true'>导出会议日程</a-button>-->
<!-- <a-button v-if='isAdmin' type='danger' style='margin-left: 8px'-->
<!-- @click='showExportMonthModal = true'>导出月度汇总</a-button>-->
<a-button v-if='isAdmin' type='danger' style='margin-left: 8px'
@click='showExportDayModal = true'>导出会议日程</a-button>
<a-button v-if='isAdmin' type='danger' style='margin-left: 8px'
@click='showExportMonthModal = true'>导出月度汇总</a-button>
</span>
</a-col>
</a-row>
@ -199,8 +198,8 @@
@ok='handleExportDay'
@cancel='showExportDayModal = false'
>
<a-form-item label='选择日期范围'>
<a-range-picker v-model='exportDayDate' style='width: 100%' />
<a-form-item label='选择日期'>
<a-date-picker v-model='exportDayDate' style='width: 100%' placeholder='请选择具体日期' />
</a-form-item>
<!-- <a-form-item label='会议名称'>
<a-input v-model='exportDayTitle' placeholder='可选,输入会议名称进行筛选' />
@ -659,13 +658,12 @@ export default {
},
//
handleExportDay() {
if (!this.exportDayDate || this.exportDayDate.length !== 2) {
this.$message.error('请选择日期范围')
if (!this.exportDayDate) {
this.$message.error('请选择日期')
return
}
const startDate = this.exportDayDate[0].format('YYYY-MM-DD')
const endDate = this.exportDayDate[1].format('YYYY-MM-DD')
const selectedDate = this.exportDayDate.format('YYYY-MM-DD')
//
this.$message.loading({ content: '正在导出数据,请稍候...', key: 'exportLoading', duration: 0 })
@ -674,16 +672,16 @@ export default {
const timestamp = new Date().getTime()
expMRByDate({
'filterDate': '',
'startDate': startDate,
'endDate': endDate,
'filterDate': selectedDate,
'startDate': '',
'endDate': '',
'userOrg': this.exportDayUserOrg,
'title': this.exportDayTitle,
'status': this.exportDayStatus,
'_t': timestamp
}).then(res => {
this.$message.success({ content: '导出成功', key: 'exportLoading' })
const fileName = startDate + '至' + endDate + '会议室预约记录'
const fileName = selectedDate + '会议室预约记录'
this.exportExcel(fileName, res)
this.showExportDayModal = false
}).catch(error => {