Browse Source

导出文件名称

master
巴林闲侠 2 years ago
parent
commit
52e6836046
  1. 2
      api/app/lib/controllers/attendance/index.js

2
api/app/lib/controllers/attendance/index.js

@ -290,7 +290,7 @@ async function exportVacateStatistic (ctx) {
}]
)
const fileName = `请假统计_${startDate ? moment(startDate).format('YYYY-MM-DD') : ''}-${endDate ? moment(endDate).format('YYYY-MM-DD') : ''}_${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const fileName = `请假统计_${startDate ? moment(startDate).format('YYYY-MM-DD') : ''}${startDate && endDate ? '-' : ''}${endDate ? moment(endDate).format('YYYY-MM-DD') : ''}${startDate || endDate ? '_' : ''}${moment().format('YYYYMMDDHHmmss')}` + '.csv'
const filePath = await simpleExcelDown({ data: returnD, header, fileName: fileName })
const fileData = fs.readFileSync(filePath);

Loading…
Cancel
Save