|
@@ -78,7 +78,14 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="part-box">
|
|
<div class="part-box">
|
|
- <el-table ref="TableList" :data="taskList" border stripe>
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ ref="TableList"
|
|
|
|
+ :data="taskList"
|
|
|
|
+ border
|
|
|
|
+ stripe
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
type="index"
|
|
type="index"
|
|
label="序号"
|
|
label="序号"
|
|
@@ -151,8 +158,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import pickerOptions from "@/constants/datePickerOptions";
|
|
import pickerOptions from "@/constants/datePickerOptions";
|
|
-import { customerCardTaskList } from "../api";
|
|
|
|
-import { download, randomCode } from "@/plugins/utils";
|
|
|
|
|
|
+import { customerCardTaskList, customerPaperExport } from "../api";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "customer-card",
|
|
name: "customer-card",
|
|
@@ -170,6 +176,7 @@ export default {
|
|
current: 1,
|
|
current: 1,
|
|
size: this.GLOBAL.pageSize,
|
|
size: this.GLOBAL.pageSize,
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ multipleSelection: [],
|
|
AUDITING_STATUS: {
|
|
AUDITING_STATUS: {
|
|
STAGE: "待审核",
|
|
STAGE: "待审核",
|
|
SUBMIT: "已审核"
|
|
SUBMIT: "已审核"
|
|
@@ -214,7 +221,12 @@ export default {
|
|
this.current = page;
|
|
this.current = page;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ handleSelectionChange(val) {
|
|
|
|
+ this.multipleSelection = val.map(item => item.id);
|
|
|
|
+ },
|
|
selectMenu(val) {
|
|
selectMenu(val) {
|
|
|
|
+ if (this.filter.status === val) return;
|
|
|
|
+ this.multipleSelection = [];
|
|
this.caches[this.filter.status] = {
|
|
this.caches[this.filter.status] = {
|
|
current: this.current,
|
|
current: this.current,
|
|
taskList: this.taskList,
|
|
taskList: this.taskList,
|
|
@@ -230,20 +242,42 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async toExport() {
|
|
async toExport() {
|
|
|
|
+ // TODO:
|
|
|
|
+ // if (this.loading) return;
|
|
|
|
+ // this.loading = true;
|
|
|
|
+ // const res = await download({
|
|
|
|
+ // type: "post",
|
|
|
|
+ // url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
|
|
|
|
+ // data: {},
|
|
|
|
+ // fileName: `${Date.now()}${randomCode()}.zip`,
|
|
|
|
+ // header: this.getHeadIds()
|
|
|
|
+ // }).catch(error => {
|
|
|
|
+ // this.$message.error(error + "文件下载失败,请重新尝试!");
|
|
|
|
+ // });
|
|
|
|
+ // this.loading = false;
|
|
|
|
+ // if (!res) return;
|
|
|
|
+ // this.$message.success("文件下载成功!");
|
|
|
|
+
|
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
|
+ this.$message.error("请选择要下载的记录!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
|
|
+
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- const res = await download({
|
|
|
|
- type: "post",
|
|
|
|
- url: this.GLOBAL.domain + "/api/admin/exam/task_review/export",
|
|
|
|
- data: {},
|
|
|
|
- fileName: `${Date.now()}${randomCode()}.zip`,
|
|
|
|
- header: this.getHeadIds()
|
|
|
|
- }).catch(error => {
|
|
|
|
- this.$message.error(error + "文件下载失败,请重新尝试!");
|
|
|
|
- });
|
|
|
|
|
|
+ const res = await customerPaperExport({
|
|
|
|
+ ids: this.multipleSelection
|
|
|
|
+ }).catch(() => {});
|
|
this.loading = false;
|
|
this.loading = false;
|
|
- if (!res) return;
|
|
|
|
- this.$message.success("文件下载成功!");
|
|
|
|
|
|
+
|
|
|
|
+ if (res) {
|
|
|
|
+ this.$message.success(
|
|
|
|
+ "下载任务已提交,请在数据管理-任务管理中下载文件!"
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("下载任务提交失败,请重新尝试!");
|
|
|
|
+ }
|
|
},
|
|
},
|
|
toEdit(row) {
|
|
toEdit(row) {
|
|
this.$ls.set("prepareTcPCard", {
|
|
this.$ls.set("prepareTcPCard", {
|