|
@@ -25,10 +25,10 @@
|
|
clearable
|
|
clearable
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
- v-for="(val, key) in PRINT_STATUS"
|
|
|
|
- :key="key"
|
|
|
|
- :value="key"
|
|
|
|
- :label="val"
|
|
|
|
|
|
+ v-for="item in PRINT_STATUS"
|
|
|
|
+ :key="item.key"
|
|
|
|
+ :value="item.key"
|
|
|
|
+ :label="item.name"
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
<el-popover
|
|
<el-popover
|
|
@@ -105,13 +105,13 @@
|
|
@click="toDelete(scope.row)"
|
|
@click="toDelete(scope.row)"
|
|
title="删除"
|
|
title="删除"
|
|
></el-button>
|
|
></el-button>
|
|
- <!-- TODO:打印状态为已打印时可见 -->
|
|
|
|
<el-button
|
|
<el-button
|
|
class="btn-table-icon"
|
|
class="btn-table-icon"
|
|
type="text"
|
|
type="text"
|
|
icon="icon icon-download-act"
|
|
icon="icon icon-download-act"
|
|
@click="toExport(scope.row)"
|
|
@click="toExport(scope.row)"
|
|
- title="导出打印数量"
|
|
|
|
|
|
+ title="导出"
|
|
|
|
+ v-if="scope.row.printStatus === '已打印'"
|
|
></el-button>
|
|
></el-button>
|
|
<el-button
|
|
<el-button
|
|
class="btn-table-icon"
|
|
class="btn-table-icon"
|
|
@@ -141,6 +141,7 @@
|
|
<script>
|
|
<script>
|
|
import { PRINT_STATUS } from "@/constants/enumerate";
|
|
import { PRINT_STATUS } from "@/constants/enumerate";
|
|
import { examListPage, examList, deleteExam } from "../api";
|
|
import { examListPage, examList, deleteExam } from "../api";
|
|
|
|
+import { download } from "@/plugins/utils";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "exam-manage",
|
|
name: "exam-manage",
|
|
@@ -163,6 +164,9 @@ export default {
|
|
created() {
|
|
created() {
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ console.log(this);
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
this.getList();
|
|
this.getList();
|
|
@@ -230,8 +234,28 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- toExport(row) {
|
|
|
|
|
|
+ async toExport(row) {
|
|
console.log(row);
|
|
console.log(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/exam/exam/expPrintCount?examId=1267628105772736513`,
|
|
|
|
+ url: `/api/print/exam/exam/expPrintCount?examId=${row.id}`,
|
|
|
|
+ fileName: `${row.examName}_打印数量.xls`,
|
|
|
|
+ header: {
|
|
|
|
+ token: this.$ls.get("token")
|
|
|
|
+ }
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.$message.error(error);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ load.close();
|
|
|
|
+ if (!data) return;
|
|
|
|
+ this.$message.success("文件已开始下载!");
|
|
},
|
|
},
|
|
toDetail(row) {
|
|
toDetail(row) {
|
|
this.$router.push({
|
|
this.$router.push({
|