瀏覽代碼

试卷审核

chulin 2 年之前
父節點
當前提交
27bb99ff20

+ 22 - 0
src/modules/paper/api.js

@@ -103,3 +103,25 @@ export const paperQuestionUnitDeleteApi = ({ unitid, questionId }) => {
     {}
   );
 };
+
+// audit-paper
+export const auditPaperWaitPageListApi = (datas) => {
+  return $httpWithMsg.get(`${QUESTION_API}/paper/audit/page`, {
+    params: datas,
+  });
+};
+export const auditPaperAuditedPageListApi = (datas) => {
+  return $httpWithMsg.get(`${QUESTION_API}/paper/audit/page`, {
+    params: datas,
+  });
+};
+export const auditPaperApplyPageListApi = (datas) => {
+  return $httpWithMsg.get(`${QUESTION_API}/paper/audit/page`, {
+    params: datas,
+  });
+};
+
+export const auditPaperApi = (datas) => {
+  // auditResult,auditRemark,paperIds
+  return $httpWithMsg.post(`${QUESTION_API}/paper/audit`, datas);
+};

+ 110 - 0
src/modules/paper/components/AuditPaperApply.vue

@@ -0,0 +1,110 @@
+<template>
+  <div class="audit-paper-audited">
+    <el-form class="part-filter-form" :model="filter" inline>
+      <el-form-item label="审核状态">
+        <el-select v-model="filter.auditStatus" clearable placeholder="请选择">
+          <el-option label="初级待审" value="FIRST_PENDING_TRIAL"> </el-option>
+          <el-option label="中级待审" value="SECOND_PENDING_TRIAL"> </el-option>
+          <el-option label="高级待审" value="THIRD_PENDING_TRIAL"> </el-option>
+          <el-option label="已撤回" value="WITHDRAW"> </el-option>
+          <el-option label="审核未通过" value="NOT_PASS"> </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="试卷名称">
+        <el-input v-model="filter.name" placeholder="请输入试卷名称"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="danger" @click="toPage(1)">查询</el-button>
+      </el-form-item>
+    </el-form>
+
+    <div class="part-box">
+      <el-table
+        v-loading="loading"
+        element-loading-text="拼命加载中"
+        :data="dataList"
+      >
+        <el-table-column label="试卷名称" prop="name" width="180">
+        </el-table-column>
+        <el-table-column label="课程">
+          <template slot-scope="scope">
+            <span
+              >{{ scope.row.course.name }}({{ scope.row.course.code }})</span
+            >
+          </template>
+        </el-table-column>
+        <el-table-column label="提交时间" prop="updateTime" width="170">
+        </el-table-column>
+        <el-table-column label="状态" prop="updateTime" width="100">
+        </el-table-column>
+        <el-table-column label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <div class="operate_left">
+              <el-button
+                size="mini"
+                type="primary"
+                plain
+                @click="toDetail(scope.row)"
+                >详情</el-button
+              >
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          :current-page="currentPage"
+          :page-size="pageSize"
+          :page-sizes="[10, 20, 50, 100, 200, 300]"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          @current-change="toPage"
+          @size-change="handleSizeChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { auditPaperApplyPageListApi } from "../api";
+
+export default {
+  name: "AuditPaperApply",
+  data() {
+    return {
+      filter: { auditStatus: "", name: "" },
+      dataList: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 0,
+    };
+  },
+  methods: {
+    toPage(page) {
+      this.currentPage = page;
+      this.getList();
+    },
+    async getList() {
+      this.loading = true;
+      const res = await auditPaperApplyPageListApi({
+        ...this.filter,
+        curPage: this.currentPage,
+        pageSize: this.pageSize,
+      }).catch(() => {});
+      this.loading = false;
+      if (!res) return;
+      this.dataList = res.data.content;
+      this.total = res.data.totalElements;
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.toPage(1);
+    },
+    toDetail(row) {
+      console.log(row);
+    },
+  },
+};
+</script>

+ 111 - 0
src/modules/paper/components/AuditPaperAudited.vue

@@ -0,0 +1,111 @@
+<template>
+  <div class="audit-paper-audited">
+    <el-form class="part-filter-form" :model="filter" inline>
+      <el-form-item label="提交人">
+        <el-input
+          v-model="filter.creator"
+          placeholder="请输入提交人姓名"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="试卷名称">
+        <el-input v-model="filter.name" placeholder="请输入试卷名称"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="danger" @click="toPage(1)">查询</el-button>
+      </el-form-item>
+    </el-form>
+
+    <div class="part-box">
+      <el-table
+        v-loading="loading"
+        element-loading-text="拼命加载中"
+        :data="dataList"
+      >
+        <el-table-column label="试卷名称" prop="name" width="180">
+        </el-table-column>
+        <el-table-column label="课程">
+          <template slot-scope="scope">
+            <span
+              >{{ scope.row.course.name }}({{ scope.row.course.code }})</span
+            >
+          </template>
+        </el-table-column>
+        <el-table-column label="提交人" prop="lastModifyName" width="150">
+        </el-table-column>
+        <el-table-column label="提交时间" prop="updateTime" width="170">
+        </el-table-column>
+        <el-table-column label="当前审核状态" prop="updateTime" width="140">
+        </el-table-column>
+        <el-table-column label="状态" prop="updateTime" width="100">
+        </el-table-column>
+        <el-table-column label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <div class="operate_left">
+              <el-button
+                size="mini"
+                type="primary"
+                plain
+                @click="toDetail(scope.row)"
+                >详情</el-button
+              >
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          :current-page="currentPage"
+          :page-size="pageSize"
+          :page-sizes="[10, 20, 50, 100, 200, 300]"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          @current-change="toPage"
+          @size-change="handleSizeChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { auditPaperAuditedPageListApi } from "../api";
+
+export default {
+  name: "AuditPaperAudited",
+  data() {
+    return {
+      filter: { creator: "", name: "" },
+      dataList: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 0,
+    };
+  },
+  methods: {
+    toPage(page) {
+      this.currentPage = page;
+      this.getList();
+    },
+    async getList() {
+      this.loading = true;
+      const res = await auditPaperAuditedPageListApi({
+        ...this.filter,
+        curPage: this.currentPage,
+        pageSize: this.pageSize,
+      }).catch(() => {});
+      this.loading = false;
+      if (!res) return;
+      this.dataList = res.data.content;
+      this.total = res.data.totalElements;
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.toPage(1);
+    },
+    toDetail(row) {
+      console.log(row);
+    },
+  },
+};
+</script>

+ 109 - 0
src/modules/paper/components/AuditPaperDialog.vue

@@ -0,0 +1,109 @@
+<template>
+  <el-dialog
+    class="audit-paper-dialog"
+    :visible.sync="modalIsShow"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @open="visibleChange"
+  >
+    <el-form :model="modalForm" :rules="rules" label-width="120px">
+      <el-form-item label="审核结果" prop="auditResult">
+        <el-select v-model="modelForm.auditResult" disabled>
+          <el-option label="通过" value="PASS"></el-option>
+          <el-option label="不通过" value="NOT_PASS"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="审核意见" prop="auditRemark">
+        <el-input
+          v-model="modelForm.auditRemark"
+          type="textarea"
+          placeholder="请输入内容"
+          maxlength="200"
+        ></el-input>
+      </el-form-item>
+    </el-form>
+
+    <div slot="footer" class="text-center">
+      <el-button type="primary" :disabled="isSubmit" @click="confirm"
+        >确定</el-button
+      >
+      <el-button @click="cancel"> 取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { objAssign } from "@/plugins/utils";
+import { auditPaperApi } from "../api";
+
+const initModelForm = {
+  paperIds: [],
+  auditResult: "",
+  auditRemark: "",
+};
+
+export default {
+  name: "AuditPaperDialog",
+  props: {
+    info: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modelForm: { ...initModelForm },
+      rules: {
+        auditResult: [
+          {
+            required: true,
+            message: "请选择审核结果",
+            trigger: "change",
+          },
+        ],
+        auditRemark: [
+          {
+            validator: (rule, value, callback) => {
+              if (this.modelForm.auditResult === "NOT_PASS" && !value) {
+                return callback(new Error(`请输入审核意见`));
+              }
+
+              callback();
+            },
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    visibleChange() {
+      this.modelForm = objAssign(initModelForm, this.info);
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async confirm() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+      const res = await auditPaperApi(this.modelForm).catch(() => {});
+      this.isSubmit = false;
+      if (!res) return;
+
+      this.$emit("modified");
+      this.cancel();
+    },
+  },
+};
+</script>

+ 152 - 0
src/modules/paper/components/AuditPaperWait.vue

@@ -0,0 +1,152 @@
+<template>
+  <div class="audit-paper-wait">
+    <el-form class="part-filter-form" :model="filter" inline>
+      <el-form-item label="提交人">
+        <el-input
+          v-model="filter.creator"
+          placeholder="请输入提交人姓名"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="试卷名称">
+        <el-input v-model="filter.name" placeholder="请输入试卷名称"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="danger" @click="toPage(1)">查询</el-button>
+      </el-form-item>
+    </el-form>
+
+    <div class="part-box">
+      <el-table
+        v-loading="loading"
+        element-loading-text="拼命加载中"
+        :data="dataList"
+      >
+        <el-table-column label="试卷名称" prop="name" width="180">
+        </el-table-column>
+        <el-table-column label="课程">
+          <template slot-scope="scope">
+            <span
+              >{{ scope.row.course.name }}({{ scope.row.course.code }})</span
+            >
+          </template>
+        </el-table-column>
+        <el-table-column label="提交人" prop="lastModifyName" width="150">
+        </el-table-column>
+        <el-table-column label="修改时间" prop="updateTime" width="153">
+        </el-table-column>
+        <el-table-column label="操作" width="170" fixed="right">
+          <template slot-scope="scope">
+            <div class="operate_left">
+              <el-button
+                size="mini"
+                type="primary"
+                plain
+                @click="toDetail(scope.row)"
+                >详情</el-button
+              >
+              <el-dropdown>
+                <el-button type="primary" size="mini" plain>
+                  审核<i class="el-icon-more el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown" class="action-dropdown">
+                  <el-dropdown-item>
+                    <el-button
+                      size="mini"
+                      type="success"
+                      plain
+                      @click="toAudit('PASS', scope.row.id)"
+                    >
+                      通过
+                    </el-button>
+                  </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button
+                      size="mini"
+                      type="danger"
+                      plain
+                      @click="toAudit('NOT_PASS', scope.row.id)"
+                    >
+                      不通过
+                    </el-button>
+                  </el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          :current-page="currentPage"
+          :page-size="pageSize"
+          :page-sizes="[10, 20, 50, 100, 200, 300]"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          @current-change="toPage"
+          @size-change="handleSizeChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+
+    <!-- AuditPaperDialog -->
+    <audit-paper-dialog
+      ref="AuditPaperDialog"
+      :info="curAuditInfo"
+      @modified="getList"
+    ></audit-paper-dialog>
+  </div>
+</template>
+
+<script>
+import AuditPaperDialog from "./AuditPaperDialog.vue";
+import { auditPaperWaitPageListApi } from "../api";
+
+export default {
+  name: "AuditPaperWait",
+  components: { AuditPaperDialog },
+  data() {
+    return {
+      filter: { creator: "", name: "" },
+      dataList: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 0,
+      curAuditInfo: {
+        paperIds: [],
+        auditResult: "",
+      },
+      loading: false,
+    };
+  },
+  methods: {
+    toPage(page) {
+      this.currentPage = page;
+      this.getList();
+    },
+    async getList() {
+      this.loading = true;
+      const res = await auditPaperWaitPageListApi({
+        ...this.filter,
+        curPage: this.currentPage,
+        pageSize: this.pageSize,
+      }).catch(() => {});
+      this.loading = false;
+      if (!res) return;
+      this.dataList = res.data.content;
+      this.total = res.data.totalElements;
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.toPage(1);
+    },
+    toDetail(row) {
+      console.log(row);
+    },
+    toAudit(auditResult, paperId) {
+      this.curAuditInfo = { auditResult, paperIds: [paperId] };
+      this.$refs.AuditPaperDialog.open();
+    },
+  },
+};
+</script>

+ 6 - 0
src/modules/paper/router.js

@@ -1,4 +1,5 @@
 import BuildPaper from "./views/BuildPaper.vue";
+import AuditPaper from "./views/AuditPaper";
 
 export default [
   {
@@ -6,4 +7,9 @@ export default [
     name: "BuildPaper",
     component: BuildPaper,
   },
+  {
+    path: "/audit-paper",
+    name: "AuditPaper",
+    component: AuditPaper,
+  },
 ];

+ 39 - 0
src/modules/paper/views/AuditPaper.vue

@@ -0,0 +1,39 @@
+<template>
+  <div class="audit-paper">
+    <div class="part-box">
+      <h2 class="part-box-title">试卷审核</h2>
+      <el-tabs v-model="activeName" @tab-click="handleClick">
+        <el-tab-pane label="待审核列表" name="wait">
+          <audit-paper-wait></audit-paper-wait>
+        </el-tab-pane>
+        <el-tab-pane label="我审核的记录" name="audited">
+          <audit-paper-audited></audit-paper-audited>
+        </el-tab-pane>
+        <el-tab-pane label="我提交的审核" name="apply">
+          <audit-paper-apply></audit-paper-apply>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </div>
+</template>
+
+<script>
+import AuditPaperApply from "../components/AuditPaperApply.vue";
+import AuditPaperAudited from "../components/AuditPaperAudited.vue";
+import AuditPaperWait from "../components/AuditPaperWait.vue";
+
+export default {
+  name: "AuditPaper",
+  components: {
+    AuditPaperWait,
+    AuditPaperAudited,
+    AuditPaperApply,
+  },
+  data() {
+    return {
+      activeName: "wait",
+    };
+  },
+  methods: {},
+};
+</script>