|
@@ -259,6 +259,7 @@ import {
|
|
|
findStudentExtraExerciseDetail
|
|
|
} from "@/api/afterSchool";
|
|
|
import { getEmployeeOrgan } from "@/api/buildTeam";
|
|
|
+import { Export } from '@/utils/downLoadFile'
|
|
|
import axios from "axios";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
export default {
|
|
@@ -341,52 +342,15 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
// 导出
|
|
|
- onExport () {
|
|
|
- let url = "/api-web/export/extraExercisesReplys";
|
|
|
+ async onExport () {
|
|
|
let obj = this.getDate();
|
|
|
- const options = {
|
|
|
- method: "get",
|
|
|
- headers: {
|
|
|
- Authorization: getToken()
|
|
|
- },
|
|
|
- url,
|
|
|
- params: obj,
|
|
|
- responseType: "blob"
|
|
|
- };
|
|
|
-
|
|
|
- this.$confirm("您确定导出列表?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- axios(options).then(res => {
|
|
|
- let blob = new Blob([res.data], {
|
|
|
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
|
|
|
- type: "application/vnd.ms-excel;charset=utf-8"
|
|
|
- // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
- });
|
|
|
- let objectUrl = URL.createObjectURL(blob);
|
|
|
- let link = document.createElement("a");
|
|
|
- let nowTime = new Date();
|
|
|
- let ymd =
|
|
|
- nowTime.getFullYear() +
|
|
|
- "" +
|
|
|
- (nowTime.getMonth() + 1) +
|
|
|
- "" +
|
|
|
- nowTime.getDate() +
|
|
|
- "" +
|
|
|
- nowTime.getHours() +
|
|
|
- "" +
|
|
|
- nowTime.getMinutes();
|
|
|
- let fname = ymd + "课外训练(学员).xls";
|
|
|
- link.href = objectUrl;
|
|
|
- link.setAttribute("download", fname);
|
|
|
- document.body.appendChild(link);
|
|
|
- link.click();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => { });
|
|
|
+ console.log(obj)
|
|
|
+ await Export(this, {
|
|
|
+ url: '/api-web/export/extraExercisesReplys',
|
|
|
+ fileName: '课外训练(学员).xlsx',
|
|
|
+ method: 'get',
|
|
|
+ params: obj
|
|
|
+ }, '您确定导出列表?')
|
|
|
},
|
|
|
getDate () {
|
|
|
let obj = {};
|