|
@@ -0,0 +1,102 @@
|
|
|
+<template>
|
|
|
+ <div class="rule-examroom">
|
|
|
+ <div class="part-box">
|
|
|
+ <el-table ref="TableList" :data="dataList" border stripe>
|
|
|
+ <el-table-column prop="schoolId" label="学校ID"></el-table-column>
|
|
|
+ <el-table-column prop="schoolName" label="学校名称"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" label="上传时间"></el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ class="btn-table-icon"
|
|
|
+ type="text"
|
|
|
+ icon="icon icon-upload-act"
|
|
|
+ @click="toUpload(scope.row)"
|
|
|
+ title="上传"
|
|
|
+ ></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="part-page">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :current-page="current"
|
|
|
+ :total="total"
|
|
|
+ :page-size="size"
|
|
|
+ @current-change="toPage"
|
|
|
+ hide-on-single-page
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <upload-file-dialog
|
|
|
+ :paper-attachment="curAttachment"
|
|
|
+ :format="['pdf']"
|
|
|
+ @confirm="uploadConfirm"
|
|
|
+ ref="UploadFileDialog"
|
|
|
+ ></upload-file-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { checkinExamList, saveCheckinExam } from "../api";
|
|
|
+import UploadFileDialog from "@/components/UploadFileDialog";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "rule-examroom",
|
|
|
+ components: { UploadFileDialog },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ schoolId: this.$ls.get("schoolId"),
|
|
|
+ dataList: [],
|
|
|
+ current: 1,
|
|
|
+ size: this.GLOBAL.pageSize,
|
|
|
+ total: 0,
|
|
|
+ curAttachment: {},
|
|
|
+ curCheckinExam: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.toPage(1);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getList() {
|
|
|
+ const data = await checkinExamList(this.schoolId);
|
|
|
+ this.dataList = data.records;
|
|
|
+ this.total = data.total;
|
|
|
+ },
|
|
|
+ toPage(page) {
|
|
|
+ this.current = page;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ toUpload(row) {
|
|
|
+ this.curCheckinExam = row;
|
|
|
+ this.curAttachment = {
|
|
|
+ attachmentId: row.attachmentId,
|
|
|
+ filename: ""
|
|
|
+ };
|
|
|
+ this.$refs.UploadFileDialog.open();
|
|
|
+ console.log(row);
|
|
|
+ },
|
|
|
+ async uploadConfirm(attachment) {
|
|
|
+ const datas = {
|
|
|
+ attachmentId: attachment.attachmentId,
|
|
|
+ createId: "",
|
|
|
+ id: this.curCheckinExam.id,
|
|
|
+ schoolId: this.curCheckinExam.schoolId,
|
|
|
+ updateId: ""
|
|
|
+ };
|
|
|
+ const userId = this.$ls.get("user", { id: "" }).id;
|
|
|
+ const modInfo = this.curCheckinExam.id
|
|
|
+ ? { updateId: userId }
|
|
|
+ : { createId: userId };
|
|
|
+ await saveCheckinExam(Object.assign(datas, modInfo));
|
|
|
+
|
|
|
+ this.$message.success("编辑成功!");
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|