|
@@ -38,6 +38,16 @@
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <div class="part-box-action">
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-download"
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="toBatchExport"
|
|
|
+ >
|
|
|
+ 批量下载试卷题卡
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="part-box">
|
|
@@ -160,7 +170,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { taskPaperListPage, ableTaskPaper, downloadPaper } from "../api";
|
|
|
+import {
|
|
|
+ taskPaperListPage,
|
|
|
+ ableTaskPaper,
|
|
|
+ downloadPaper,
|
|
|
+ paperAndCardBatchExport
|
|
|
+} from "../api";
|
|
|
import pickerOptions from "@/constants/datePickerOptions";
|
|
|
import { downloadBlob } from "@/plugins/utils";
|
|
|
import ModifyTaskPaper from "../components/ModifyTaskPaper";
|
|
@@ -287,6 +302,24 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error("文件下载失败,请重新尝试!");
|
|
|
}
|
|
|
+ },
|
|
|
+ async toBatchExport() {
|
|
|
+ // 异步导出
|
|
|
+ if (this.loading) return;
|
|
|
+
|
|
|
+ this.loading = true;
|
|
|
+ const res = await paperAndCardBatchExport({
|
|
|
+ ...this.filter
|
|
|
+ }).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ this.$message.success(
|
|
|
+ "导出任务已提交,请在数据管理-任务管理中下载文件!"
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.$message.error("导出任务提交失败,请重新尝试!");
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|