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