|
|
|
@ -21,7 +21,9 @@ |
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
<!-- <el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="exporExcel" |
|
|
|
|
>导出为excel</el-button |
|
|
|
|
> --> |
|
|
|
|
<!-- 详细学生信息弹层 --> |
|
|
|
|
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading"> |
|
|
|
|
<el-table-column label="序号" align="center" type="index" /> |
|
|
|
@ -88,7 +90,8 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { searchNum, addRemarkI, delSign } from '@/api/trainService/index.js' |
|
|
|
|
import { searchNum, addRemarkI, delSign, exportExcelF } from '@/api/trainService/index.js' |
|
|
|
|
import { saveAs } from 'file-saver' |
|
|
|
|
// 1 报名未开始、2 报名中、 3 报名结束未开课、4 开课中、5 已结束 status字段 |
|
|
|
|
export default { |
|
|
|
|
name: 'peixunbaoming', |
|
|
|
@ -129,6 +132,21 @@ export default { |
|
|
|
|
methods: { |
|
|
|
|
async getStudentList() { |
|
|
|
|
this.loading = true |
|
|
|
|
if (localStorage.getItem('jsondata')) { |
|
|
|
|
const firstData = JSON.parse(localStorage.getItem('jsondata')) |
|
|
|
|
this.headerList = [] |
|
|
|
|
this.headerData = {} |
|
|
|
|
// 取第一项处理表头 |
|
|
|
|
firstData.forEach((it) => { |
|
|
|
|
// 循环标识 |
|
|
|
|
this.headerList.push(it.key) |
|
|
|
|
// 表头文字 |
|
|
|
|
this.headerData[it.key] = it[it.key] |
|
|
|
|
}) |
|
|
|
|
// 处理备注列 |
|
|
|
|
this.headerList.push('remark') |
|
|
|
|
this.headerData.remark = '备注' |
|
|
|
|
} |
|
|
|
|
const res = await searchNum({ |
|
|
|
|
classType: this.$route.query.type, |
|
|
|
|
trainClassId: this.$route.query.id, |
|
|
|
@ -137,19 +155,19 @@ export default { |
|
|
|
|
if (this.$route.query.type == 3 && res.total > 0) { |
|
|
|
|
// 处理json |
|
|
|
|
if (res.rows[0].data) { |
|
|
|
|
this.headerList = [] |
|
|
|
|
this.headerData = {} |
|
|
|
|
// 取第一项处理表头 |
|
|
|
|
const firstData = JSON.parse(res.rows[0].data) |
|
|
|
|
firstData.forEach((it) => { |
|
|
|
|
// 循环标识 |
|
|
|
|
this.headerList.push(it.key) |
|
|
|
|
// 表头文字 |
|
|
|
|
this.headerData[it.key] = it[it.key] |
|
|
|
|
}) |
|
|
|
|
// 处理备注列 |
|
|
|
|
this.headerList.push('remark') |
|
|
|
|
this.headerData.remark = '备注' |
|
|
|
|
// this.headerList = [] |
|
|
|
|
// this.headerData = {} |
|
|
|
|
// // 取第一项处理表头 |
|
|
|
|
// const firstData = JSON.parse(res.rows[0].data) |
|
|
|
|
// firstData.forEach((it) => { |
|
|
|
|
// // 循环标识 |
|
|
|
|
// this.headerList.push(it.key) |
|
|
|
|
// // 表头文字 |
|
|
|
|
// this.headerData[it.key] = it[it.key] |
|
|
|
|
// }) |
|
|
|
|
// // 处理备注列 |
|
|
|
|
// this.headerList.push('remark') |
|
|
|
|
// this.headerData.remark = '备注' |
|
|
|
|
// 表格新数据 |
|
|
|
|
const newData = [] |
|
|
|
|
// 构造表格数据--解析每一条json串 |
|
|
|
@ -225,6 +243,13 @@ export default { |
|
|
|
|
this.form = {} |
|
|
|
|
this.visibleopen = false |
|
|
|
|
}, |
|
|
|
|
// 导出为excel |
|
|
|
|
exporExcel() { |
|
|
|
|
exportExcelF().then((res) => { |
|
|
|
|
const blob = new Blob([res]) |
|
|
|
|
saveAs(blob, this.$route.query.id + '报名表.xlsx') |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
created() {}, |
|
|
|
|
} |
|
|
|
|