|
@@ -13,7 +13,7 @@
|
|
|
<el-form ref="FilterForm" label-position="left" label-width="85px" inline>
|
|
|
<el-form-item label="学校名称:">
|
|
|
<el-select
|
|
|
- v-model="filter.schoolId"
|
|
|
+ v-model="filter.schId"
|
|
|
style="width: 142px;"
|
|
|
placeholder="请选择"
|
|
|
clearable
|
|
@@ -54,25 +54,35 @@
|
|
|
<el-button type="primary" icon="icon icon-search" @click="toPage(1)"
|
|
|
>查询</el-button
|
|
|
>
|
|
|
- <!-- <el-button
|
|
|
+ <el-button
|
|
|
type="warning"
|
|
|
icon="icon icon-download"
|
|
|
- @click="toPage(1)"
|
|
|
+ @click="toDownloadAll"
|
|
|
v-if="filter.auditingStatus == 0"
|
|
|
>批量下载试卷文件</el-button
|
|
|
- > -->
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
|
|
|
<div class="part-box">
|
|
|
- <el-table ref="TableList" :data="examPages" border stripe>
|
|
|
+ <el-table ref="TableList" :data="cards" border stripe>
|
|
|
<el-table-column prop="schoolName" label="学校名称"></el-table-column>
|
|
|
- <el-table-column prop="title" label="学院"></el-table-column>
|
|
|
- <el-table-column prop="printTime" label="题卡ID"></el-table-column>
|
|
|
- <el-table-column prop="printTime" label="申请时间"></el-table-column>
|
|
|
- <el-table-column prop="cardStatus" label="申请人"></el-table-column>
|
|
|
- <el-table-column prop="overtime" label="标题"></el-table-column>
|
|
|
+ <!-- <el-table-column prop="title" label="学院"></el-table-column> -->
|
|
|
+ <el-table-column prop="cardId" label="题卡ID"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" label="申请时间"></el-table-column>
|
|
|
+ <el-table-column prop="userName" label="申请人"></el-table-column>
|
|
|
+ <el-table-column prop="title" label="标题">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <p
|
|
|
+ class="cont-link"
|
|
|
+ @click="downloadPaper(scope.row)"
|
|
|
+ title="点击下载试卷文件"
|
|
|
+ >
|
|
|
+ {{ scope.row.title }}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -80,15 +90,15 @@
|
|
|
type="text"
|
|
|
icon="icon icon-modify"
|
|
|
@click="toEdit(scope.row)"
|
|
|
- title="确认"
|
|
|
+ title="设计题卡"
|
|
|
v-if="filter.auditingStatus == 0"
|
|
|
></el-button>
|
|
|
<el-button
|
|
|
class="btn-table-icon"
|
|
|
type="text"
|
|
|
icon="icon icon-circle-right"
|
|
|
- @click="toEdit(scope.row)"
|
|
|
- title="确认"
|
|
|
+ @click="toPreview(scope.row)"
|
|
|
+ title="查看"
|
|
|
v-else
|
|
|
></el-button>
|
|
|
</template>
|
|
@@ -111,7 +121,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { AUDITING_STATUS } from "@/constants/enumerate";
|
|
|
-import { auditListPage } from "../api";
|
|
|
+import { download } from "@/plugins/utils";
|
|
|
+import { auditListPage, schoolList } from "../api";
|
|
|
|
|
|
export default {
|
|
|
name: "card-check",
|
|
@@ -120,8 +131,7 @@ export default {
|
|
|
filter: {
|
|
|
auditingStatus: "0",
|
|
|
cardCode: "",
|
|
|
- schoolId: "",
|
|
|
- collegeId: ""
|
|
|
+ schId: ""
|
|
|
},
|
|
|
current: 1,
|
|
|
size: this.GLOBAL.pageSize,
|
|
@@ -130,14 +140,19 @@ export default {
|
|
|
AUDITING_STATUS,
|
|
|
schools: [],
|
|
|
colleges: [],
|
|
|
- examPages: [{ id: "" }],
|
|
|
+ cards: [],
|
|
|
curExam: {}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.filter.schId = this.$ls.get("schoolId");
|
|
|
this.getList();
|
|
|
+ this.getSchoolList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getSchoolList() {
|
|
|
+ this.schools = await schoolList();
|
|
|
+ },
|
|
|
async getList() {
|
|
|
const datas = {
|
|
|
...this.filter,
|
|
@@ -145,19 +160,82 @@ export default {
|
|
|
pageSize: this.size
|
|
|
};
|
|
|
const data = await auditListPage(datas);
|
|
|
- this.examPages = data.records;
|
|
|
+ this.cards = data.records;
|
|
|
this.total = data.total;
|
|
|
},
|
|
|
toPage(page) {
|
|
|
this.current = page;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ async downloadPaper(row) {
|
|
|
+ let load = this.$message({
|
|
|
+ iconClass: "el-message__icon el-icon-loading",
|
|
|
+ message: "Loading...",
|
|
|
+ duration: 0
|
|
|
+ });
|
|
|
+ const data = await download({
|
|
|
+ type: "get",
|
|
|
+ url: `/api/print/card/card/downloadSimplePaper?cardId=${row.cardId}`,
|
|
|
+ fileName: `${row.schoolName}_${row.cardId}${row.attachentType}`,
|
|
|
+ header: {
|
|
|
+ token: this.$ls.get("token")
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error);
|
|
|
+ });
|
|
|
+
|
|
|
+ load.close();
|
|
|
+ if (!data) return;
|
|
|
+ this.$message.success("文件已开始下载!");
|
|
|
+ },
|
|
|
+ async toDownloadAll() {
|
|
|
+ let load = this.$message({
|
|
|
+ iconClass: "el-message__icon el-icon-loading",
|
|
|
+ message: "Loading...",
|
|
|
+ duration: 0
|
|
|
+ });
|
|
|
+
|
|
|
+ let filterNams = [AUDITING_STATUS[this.filter.auditingStatus]];
|
|
|
+ if (this.filter.cardCode) filterNams.push(this.filter.cardCode);
|
|
|
+ filterNams.push(`page-${this.current}.zip`);
|
|
|
+
|
|
|
+ const cardIds = this.cards.map(item => item.cardId).join(",");
|
|
|
+
|
|
|
+ const data = await download({
|
|
|
+ type: "get",
|
|
|
+ url: `/api/print/card/card/downloadPapers?cardIds=${cardIds}`,
|
|
|
+ fileName: filterNams.join("-"),
|
|
|
+ header: {
|
|
|
+ token: this.$ls.get("token")
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error);
|
|
|
+ });
|
|
|
+
|
|
|
+ load.close();
|
|
|
+ if (!data) return;
|
|
|
+ this.$message.success("文件已开始下载!");
|
|
|
+ },
|
|
|
selectAuditStatus(val) {
|
|
|
this.filter.auditingStatus = val * 1;
|
|
|
+ this.toPage(1);
|
|
|
},
|
|
|
toEdit(row) {
|
|
|
- this.curExam = row;
|
|
|
- this.$refs.ModifyData.open();
|
|
|
+ this.$router.push({
|
|
|
+ name: "CardDesign",
|
|
|
+ params: {
|
|
|
+ cardId: row.cardId
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toPreview(row) {
|
|
|
+ this.$router.push({
|
|
|
+ name: "CardPreview",
|
|
|
+ params: {
|
|
|
+ cardId: row.cardId,
|
|
|
+ viewType: "view"
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|