导出报名人员excel

main
lijingyu007 5 months ago
parent 0f5d062786
commit 6f557b8af5
  1. 2
      src/api/trainService/index.js
  2. 8
      src/views/trainService/signupStudent.vue

@ -199,7 +199,7 @@ export function setJson(data) {
// 导出excel // 导出excel
export function exportExcelF(id) { export function exportExcelF(id) {
return request({ return request({
url: '/personal/download/resume/' + id, url: '/train/importStudent/' + id,
method: 'get', method: 'get',
responseType: 'blob', responseType: 'blob',
}) })

@ -21,9 +21,9 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="exporExcel" <el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="exporExcel"
>导出为excel</el-button >导出为excel</el-button
> --> >
<!-- 详细学生信息弹层 --> <!-- 详细学生信息弹层 -->
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading"> <el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading">
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
@ -245,9 +245,9 @@ export default {
}, },
// excel // excel
exporExcel() { exporExcel() {
exportExcelF().then((res) => { exportExcelF(this.$route.query.id).then((res) => {
const blob = new Blob([res]) const blob = new Blob([res])
saveAs(blob, this.$route.query.id + '报名表.xlsx') saveAs(blob, this.$route.query.name + '报名表.xlsx')
}) })
}, },
}, },

Loading…
Cancel
Save