20250523-预约记录页面1.筛选加日期选择范围,2.前面列表加序号

This commit is contained in:
luoyu 2025-05-23 14:22:55 +08:00
parent b57bf57af5
commit c0b8ea896d

View File

@ -237,7 +237,9 @@ export default {
queryParam: {
status: '',
sort: '',
name: ''
name: '',
startDate: '',
endDate: ''
},
//
columns: [
@ -289,11 +291,18 @@ export default {
loadData: parameter => {
// this.queryParam.name = this.$route.params.roomId
let chooseDate = this.queryParam.chooseDate
if (chooseDate) {
//
if (chooseDate && chooseDate.length === 2) {
this.queryParam.startDate = chooseDate[0].format('YYYY-MM-DD')
this.queryParam.endDate = chooseDate[1].format('YYYY-MM-DD')
this.queryParam.filterDate = ''
} else if (chooseDate && chooseDate.length === 1) {
this.queryParam.filterDate = chooseDate[0].format('YYYY-MM-DD')
this.queryParam.startDate = ''
this.queryParam.endDate = ''
} else {
this.queryParam.filterDate = ''
this.queryParam.startDate = ''
this.queryParam.endDate = ''
}
if (this.isAdmin) {
this.queryParam.role = 5
@ -423,9 +432,30 @@ export default {
methods: {
onChangeTime(date, dateString) {
this.queryParam.chooseDate = date
if (date && date.length === 2) {
this.queryParam.startDate = date[0].format('YYYY-MM-DD')
this.queryParam.endDate = date[1].format('YYYY-MM-DD')
this.queryParam.filterDate = ''
} else if (date && date.length === 1) {
this.queryParam.filterDate = date[0].format('YYYY-MM-DD')
this.queryParam.startDate = ''
this.queryParam.endDate = ''
} else {
this.queryParam.filterDate = ''
this.queryParam.startDate = ''
this.queryParam.endDate = ''
}
},
reset() {
this.queryParam = { status: '' }
this.queryParam = {
status: '',
sort: '',
name: '',
startDate: '',
endDate: '',
filterDate: ''
}
this.queryParam.chooseDate = null
this.$refs.table.refresh(true)
},
//
@ -577,40 +607,61 @@ export default {
exportOrderList() {
let chooseDate = this.queryParam.chooseDate
let filterDate = ''
if (chooseDate) {
filterDate = chooseDate.format('YYYY-MM-DD')
let startDate = ''
let endDate = ''
if (chooseDate && chooseDate.length === 2) {
startDate = chooseDate[0].format('YYYY-MM-DD')
endDate = chooseDate[1].format('YYYY-MM-DD')
} else if (chooseDate && chooseDate.length === 1) {
filterDate = chooseDate[0].format('YYYY-MM-DD')
} else {
filterDate = ''
}
if (filterDate == '') {
this.$message.error('请选择会议预约时间')
return
}
expMRByDate({
'filterDate': filterDate,
'startDate': startDate,
'endDate': endDate,
'userOrg': this.queryParam.userOrg,
'title': this.queryParam.title,
'status': this.queryParam.status
}).then(res => {
this.exportExcel(chooseDate.format('YYYYMMDD') + '会议室预约记录', res)
let fileName = ''
if (startDate && endDate) {
fileName = startDate + '至' + endDate + '会议室预约记录'
} else {
fileName = filterDate + '会议室预约记录'
}
this.exportExcel(fileName, res)
})
},
exportMonthOrder() {
let chooseDate = this.queryParam.chooseDate
let filterDate = ''
if (chooseDate) {
filterDate = chooseDate.format('YYYY-MM')
let startMonth = ''
let endMonth = ''
if (chooseDate && chooseDate.length === 2) {
startMonth = chooseDate[0].format('YYYY-MM')
endMonth = chooseDate[1].format('YYYY-MM')
if (startMonth !== endMonth) {
this.$message.error('月度汇总请选择同一个月的日期范围')
return
}
filterDate = startMonth
} else if (chooseDate && chooseDate.length === 1) {
filterDate = chooseDate[0].format('YYYY-MM')
} else {
filterDate = ''
}
if (filterDate == '') {
this.$message.error('请选择会议预约时间')
return
}
expMRByMonth({
'month': filterDate
}).then(res => {
this.exportExcel(chooseDate.format('YYYYMM') + '月度会议汇总', res)
this.exportExcel(filterDate + '月度会议汇总', res)
})
},
exportExcel(filename, res) {