|
@@ -138,12 +138,28 @@
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
type="success"
|
|
|
- icon="el-icon-upload"
|
|
|
- :loading="loading"
|
|
|
+ icon="el-icon-document"
|
|
|
+ @click="toBuildPdf"
|
|
|
+ >生成PDF</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ icon="el-icon-s-order"
|
|
|
+ @click="toDataTask('PDF_BUILD')"
|
|
|
+ >PDF生成结果</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
@click="toDownload"
|
|
|
>批量下载</el-button
|
|
|
>
|
|
|
- <el-button type="success" @click="viewResult">下载结果</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-s-order"
|
|
|
+ @click="toDataTask('PAPER_DOWNLOAD')"
|
|
|
+ >下载结果</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -165,7 +181,11 @@
|
|
|
label="学号"
|
|
|
width="120"
|
|
|
></el-table-column>
|
|
|
- <el-table-column prop="courseCodeName" label="课程名称(代码)">
|
|
|
+ <el-table-column
|
|
|
+ prop="courseCodeName"
|
|
|
+ label="课程名称(代码)"
|
|
|
+ min-width="280"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.courseName }}({{ scope.row.courseCode }})
|
|
|
</template>
|
|
@@ -220,13 +240,17 @@
|
|
|
<!-- DataTaskDialog -->
|
|
|
<data-task-dialog
|
|
|
ref="DataTaskDialog"
|
|
|
- task-type="PAPER_DOWNLOAD"
|
|
|
+ :task-type="taskType"
|
|
|
></data-task-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { documentDetialListPage, documentDetialDownload } from "../api";
|
|
|
+import {
|
|
|
+ documentDetialListPage,
|
|
|
+ documentDetialDownload,
|
|
|
+ buildStudentPdf,
|
|
|
+} from "../api";
|
|
|
import { BOUND_TYPE } from "@/constants/enumerate";
|
|
|
import ArchivesDetailStudentDialog from "./ArchivesDetailStudentDialog.vue";
|
|
|
import DataTaskDialog from "../../base/components/DataTaskDialog.vue";
|
|
@@ -268,6 +292,7 @@ export default {
|
|
|
multipleSelection: [],
|
|
|
BOUND_TYPE,
|
|
|
loading: false,
|
|
|
+ taskType: "",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -300,15 +325,23 @@ export default {
|
|
|
this.multipleSelection = val.map((item) => item.studentId);
|
|
|
},
|
|
|
async toDownload() {
|
|
|
- if (this.loading) return;
|
|
|
- this.loading = true;
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message.error("请选择记录");
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- const res = await documentDetialDownload(this.filter).catch(() => {});
|
|
|
- this.loading = false;
|
|
|
-
|
|
|
- if (!res) return;
|
|
|
+ await documentDetialDownload(this.multipleSelection);
|
|
|
this.$message.success("任务提交成功,结果请在下载结果中查看!");
|
|
|
},
|
|
|
+ async toBuildPdf() {
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message.error("请选择记录");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ await buildStudentPdf(this.multipleSelection);
|
|
|
+ this.$message.success("任务提交成功,结果请在PDF生成结果中查看!");
|
|
|
+ },
|
|
|
toDetail(row) {
|
|
|
if (!row.bindCount) return;
|
|
|
|
|
@@ -319,7 +352,8 @@ export default {
|
|
|
};
|
|
|
this.$refs.ArchivesDetailStudentDialog.open();
|
|
|
},
|
|
|
- viewResult() {
|
|
|
+ toDataTask(taskType) {
|
|
|
+ this.taskType = taskType;
|
|
|
this.$refs.DataTaskDialog.open();
|
|
|
},
|
|
|
},
|