xiatian 3 سال پیش
والد
کامیت
cd49b8d67e

+ 5 - 0
src/modules/questions/routes/routes.js

@@ -29,6 +29,7 @@ import ViewPaper from "../views/ViewPaper.vue";
 import OrgProperty from "../views/OrgProperty.vue";
 import PaperPendingTrial from "../views/PaperPendingTrial.vue";
 import EditPaperPendingTrial from "../views/EditPaperPendingTrial.vue";
+import ExamPaperPendingTrial from "../views/ExamPaperPendingTrial.vue";
 
 export default [
   {
@@ -105,6 +106,10 @@ export default [
         path: "paper_pending_trial/:isClear", //题库待审列表
         component: PaperPendingTrial,
       },
+      {
+        path: "exam_paper_pending_trial/:isClear", //题库待审列表
+        component: ExamPaperPendingTrial,
+      },
       {
         path: "gen_paper/:isClear", //卷库试卷列表
         component: GenPaper,

+ 821 - 0
src/modules/questions/views/ExamPaperPendingTrial.vue

@@ -0,0 +1,821 @@
+<template>
+  <section class="content">
+    <div v-show="isClear == 1">
+      <LinkTitlesCustom :current-paths="['卷库管理 ', '待审列表']" />
+    </div>
+    <div class="box-body">
+      <el-form
+        :inline="true"
+        :model="formSearch"
+        label-position="right"
+        label-width="70px"
+      >
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="课程名称">
+              <el-select
+                v-model="formSearch.courseNo"
+                class="search_width"
+                filterable
+                :remote-method="getCourses"
+                remote
+                clearable
+                placeholder="全部"
+                size="small"
+                @focus="(e) => getCourses(e.target.value)"
+              >
+                <el-option
+                  v-for="item in courseInfoSelect"
+                  :key="item.courseNo"
+                  :label="item.courseInfo"
+                  :value="item.courseNo"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="试卷名称">
+              <el-input
+                v-model="formSearch.name"
+                class="search_width"
+                placeholder="试卷名称"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="审核状态">
+              <el-select
+                v-model="formSearch.auditStatus"
+                class="search_width"
+                clearable
+                placeholder="请选择"
+                size="small"
+              >
+                <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-col>
+          <el-col :span="6">
+            <el-form-item label="录入人">
+              <el-input
+                v-model="formSearch.creator"
+                class="search_width"
+                placeholder="录入人"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="修改人">
+              <el-input
+                v-model="formSearch.lastModifyName"
+                class="search_width"
+                placeholder="修改人"
+                size="small"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <div class="search_down">
+              <el-button size="small" type="primary" @click="searchFrom"
+                ><i class="el-icon-search"></i> 查询</el-button
+              >
+              <el-button size="small" @click="resetForm"
+                ><i class="el-icon-refresh"></i> 重 置</el-button
+              >
+            </div>
+          </el-col>
+        </el-row>
+        <div
+          style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0"
+        ></div>
+        <el-row>
+          <el-form-item>
+            <span>批量操作:</span>
+            <el-button
+              :disabled="noBatchSelected"
+              size="mini"
+              type="danger"
+              plain
+              @click="deletePapers"
+              >批量删除</el-button
+            >
+            <el-button
+              :disabled="noBatchSelected"
+              size="mini"
+              type="primary"
+              plain
+              @click="auditPapers('PASS')"
+              >批量通过</el-button
+            >
+            <el-button
+              :disabled="noBatchSelected"
+              size="mini"
+              type="primary"
+              plain
+              @click="auditPapers('NOT_PASS')"
+              >批量不通过</el-button
+            >
+            <el-button
+              :disabled="noBatchSelected"
+              size="mini"
+              type="primary"
+              plain
+              @click="withdrawPapers()"
+              >批量撤回</el-button
+            >
+            <el-button
+              :disabled="noBatchSelected"
+              size="mini"
+              type="primary"
+              plain
+              @click="submitPapers()"
+              >批量提交</el-button
+            >
+          </el-form-item>
+        </el-row>
+      </el-form>
+      <div style="width: 100%; margin-bottom: 10px"></div>
+      <el-table
+        v-loading="loading"
+        element-loading-text="拼命加载中"
+        :data="tableData"
+        border
+        style="width: 100%"
+        @selection-change="selectChange"
+      >
+        <el-table-column type="selection" width="40"></el-table-column>
+        <el-table-column label="课程名称" width="180">
+          <template slot-scope="scope">
+            <span>{{ scope.row.course.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="课程代码" width="80">
+          <template slot-scope="scope">
+            <span>{{ scope.row.course.code }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="试卷名称" width="180">
+          <template slot-scope="scope">
+            <span>{{ scope.row.name }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="试卷总分"
+          width="103"
+          sortable
+          prop="totalScore"
+        >
+        </el-table-column>
+        <el-table-column
+          label="试卷难度"
+          width="103"
+          sortable
+          prop="difficultyDegree"
+        >
+        </el-table-column>
+        <el-table-column
+          label="大题数量"
+          width="103"
+          sortable
+          prop="paperDetailCount"
+        >
+        </el-table-column>
+        <el-table-column width="100" label="审核状态">
+          <span slot-scope="scope">{{
+            scope.row.auditStatus | paperAuditStatusFilter
+          }}</span>
+        </el-table-column>
+        <el-table-column label="录入员" width="150">
+          <template slot-scope="scope">
+            <span>{{ scope.row.creator }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="创建时间"
+          width="153"
+          sortable
+          prop="creationDate"
+        >
+        </el-table-column>
+        <el-table-column label="修改人" width="150">
+          <template slot-scope="scope">
+            <span>{{ scope.row.lastModifyName }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="修改时间"
+          width="153"
+          sortable
+          prop="updateDate"
+        >
+        </el-table-column>
+        <el-table-column label="操作" width="270" fixed="right">
+          <template slot-scope="scope">
+            <div class="operate_left">
+              <el-button
+                size="mini"
+                type="primary"
+                plain
+                @click="editImportPaper(scope.row)"
+                ><i class="el-icon-view"></i>详情</el-button
+              >
+              <el-dropdown
+                v-show="isShowAuditBtn(scope.row)"
+                class="button_left"
+              >
+                <el-button type="primary" size="mini" plain>
+                  审核<i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item>
+                    <el-button
+                      size="mini"
+                      type="success"
+                      @click="auditPaper('PASS', scope.row.id)"
+                    >
+                      <i class="el-icon-success"></i>通过
+                    </el-button>
+                  </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button
+                      size="mini"
+                      type="danger"
+                      @click="auditPaper('NOT_PASS', scope.row.id)"
+                    >
+                      <i class="el-icon-error"></i>不通过
+                    </el-button>
+                  </el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+              <el-dropdown class="button_left">
+                <el-button type="primary" size="mini" plain>
+                  更多 <i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item>
+                    <el-button
+                      v-show="isShowDeleteBtn(scope.row)"
+                      size="mini"
+                      type="danger"
+                      @click="deletePaper(scope.row)"
+                      ><i class="el-icon-delete"></i>删除</el-button
+                    >
+                  </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button
+                      v-show="isShowWithdrawBtn(scope.row)"
+                      size="mini"
+                      type="primary"
+                      plain
+                      @click="withdrawPaper(scope.row)"
+                      ><i class="el-icon-tickets"></i>撤回</el-button
+                    >
+                  </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button
+                      v-show="isShowSubmitBtn(scope.row)"
+                      size="mini"
+                      type="primary"
+                      plain
+                      @click="submitPaper(scope.row)"
+                      ><i class="el-icon-finished"></i>提交</el-button
+                    >
+                  </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button
+                      size="mini"
+                      type="primary"
+                      plain
+                      @click="exportPaper(scope.row)"
+                      ><i class="el-icon-download"></i>下载</el-button
+                    >
+                  </el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="page pull-right">
+        <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="handleCurrentChange"
+          @size-change="handleSizeChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <el-dialog title="审核试卷" width="50%" :visible.sync="auditPaperDialog">
+      <AuditPaper
+        v-if="auditPaperDialog"
+        :paper-ids="selectedPaperIds"
+        :audit-result="auditResult"
+        @afterAudit="afterAudit"
+      ></AuditPaper>
+    </el-dialog>
+  </section>
+</template>
+
+<script>
+import { QUESTION_API } from "@/constants/constants";
+import { LEVEL_TYPE } from "../constants/constants";
+import { mapState } from "vuex";
+import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
+import AuditPaper from "./AuditPaper.vue";
+export default {
+  components: { LinkTitlesCustom, AuditPaper },
+  data() {
+    return {
+      auditPaperDialog: false,
+      auditResult: "",
+      publicityDis: false,
+      difficultyDegreeDis: false,
+      quesLoading: false,
+      quesPropertyDialog: false,
+      difficultyDegree: 0.1,
+      publicity: true,
+      isClear: 0,
+      courseLoading: false,
+      formSearch: {
+        courseNo: "",
+        courseName: "",
+        creator: "",
+        lastModifyName: "",
+        auditStatus: "",
+        name: "",
+      },
+      tableData: [],
+      currentPage: 1,
+      pageSize: 10,
+      total: 0,
+      loading: false,
+      courseList: [],
+      levelList: LEVEL_TYPE,
+      dialogVisible: false,
+      selectedPaperIds: [],
+      fileList: [],
+      uploadAction: "",
+      formUpload: {
+        paperName: "",
+      },
+      uploadData: {},
+      fileLoading: false,
+      exportDialog: false,
+      exportModel: {
+        id: "",
+        courseCode: "",
+        courseName: "",
+        exportContentList: [],
+        seqMode: "MODE1",
+      },
+      isShow: true,
+      dialogModel: false,
+      rowIds: [],
+      isShowPrintExamPackage: false,
+      isShowPrintExamPackagePassword: false,
+      printExamPackagePassword: "",
+      printFrom: {
+        examId: "",
+      },
+      rules: {
+        examId: [{ required: true, message: "请输入名称", trigger: "change" }],
+      },
+    };
+  },
+  computed: {
+    ...mapState({
+      user: (state) => state.user,
+    }),
+    paperIds() {
+      var paperIds = "";
+      for (let paperId of this.selectedPaperIds) {
+        if (!paperIds) {
+          paperIds += paperId;
+        } else {
+          paperIds += "," + paperId;
+        }
+      }
+      return paperIds;
+    },
+    courseInfoSelect() {
+      var courseList = [];
+      for (let course of this.courseList) {
+        var courseInfo = course.name + "(" + course.code + ")";
+        var courseNo = course.code;
+        var courseName = course.name;
+        courseList.push({
+          courseNo: courseNo,
+          courseInfo: courseInfo,
+          courseName: courseName,
+        });
+      }
+      return courseList;
+    },
+    noBatchSelected() {
+      return this.selectedPaperIds.length === 0;
+    },
+  },
+  watch: {
+    $route: "initVue",
+  },
+  created() {
+    this.initVue();
+  },
+  methods: {
+    getCourseName(courseNo) {
+      for (let course of this.courseList) {
+        if (course.code == courseNo) {
+          this.formSearch.courseName = course.name;
+        }
+      }
+    },
+    editImportPaper(row) {
+      //缓存查询对象
+      this.getCourseName(this.formSearch.courseNo);
+      sessionStorage.setItem("paper", JSON.stringify(this.formSearch));
+      sessionStorage.setItem("paper_currentPage", this.currentPage);
+      sessionStorage.setItem("question_back", "false");
+      this.$router.push({
+        path:
+          "/edit_paper_pending_trial/" + row.id + "/exam_paper_pending_trial",
+      });
+    },
+    afterAudit() {
+      this.auditPaperDialog = false;
+      this.searchPaper();
+    },
+    auditPapers(pass) {
+      this.auditResult = pass;
+      this.auditPaperDialog = true;
+    },
+    auditPaper(pass, id) {
+      this.auditResult = pass;
+      this.selectedPaperIds = [];
+      this.selectedPaperIds.push(id);
+      this.auditPaperDialog = true;
+    },
+    isShowAuditBtn(row) {
+      if (
+        row.auditStatus != "WITHDRAW" &&
+        row.auditStatus != "NOT_PASS" &&
+        this.isMyAudit(row)
+      ) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    isMyAudit(row) {
+      if (
+        row.auditStatus == "FIRST_PENDING_TRIAL" &&
+        this.user.auditAuthority == "FIRST"
+      ) {
+        return true;
+      }
+      if (
+        row.auditStatus == "SECOND_PENDING_TRIAL" &&
+        this.user.auditAuthority == "SECOND"
+      ) {
+        return true;
+      }
+      if (
+        row.auditStatus == "THIRD_PENDING_TRIAL" &&
+        this.user.auditAuthority == "THIRD"
+      ) {
+        return true;
+      }
+      return false;
+    },
+    exportPaper(row) {
+      var key = this.user.key;
+      var token = this.user.token;
+      window.open(
+        QUESTION_API +
+          "/originalPaper/export/" +
+          row.id +
+          "?$key=" +
+          key +
+          "&$token=" +
+          token
+      );
+    },
+    submitPapers() {
+      this.$confirm("确认提交试卷吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        this.$http
+          .post(
+            QUESTION_API + "/paper/submit",
+            new URLSearchParams({ paperIds: this.selectedPaperIds })
+          )
+          .then(
+            () => {
+              this.$notify({
+                message: "提交成功",
+                type: "success",
+              });
+              this.searchPaper();
+            },
+            (error) => {
+              this.$notify({
+                message: error.response.data.desc,
+                type: "error",
+              });
+              this.loading = false;
+            }
+          );
+      });
+    },
+    submitPaper(row) {
+      this.$confirm("确认提交试卷吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.selectedPaperIds = [];
+        this.selectedPaperIds.push(row.id);
+        this.loading = true;
+        this.$http
+          .post(
+            QUESTION_API + "/paper/submit",
+            new URLSearchParams({ paperIds: this.selectedPaperIds })
+          )
+          .then(
+            () => {
+              this.$notify({
+                message: "提交成功",
+                type: "success",
+              });
+              this.searchPaper();
+            },
+            (error) => {
+              this.$notify({
+                message: error.response.data.desc,
+                type: "error",
+              });
+              this.loading = false;
+            }
+          );
+      });
+    },
+    isShowSubmitBtn(row) {
+      if (row.creationBy == this.user.userId && row.auditStatus == "WITHDRAW") {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    isShowWithdrawBtn(row) {
+      if (
+        row.creationBy == this.user.userId &&
+        row.auditStatus != "WITHDRAW" &&
+        row.auditStatus != "NOT_PASS"
+      ) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    withdrawPapers() {
+      this.$confirm("确认撤回试卷吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        this.$http
+          .post(
+            QUESTION_API + "/paper/withdraw",
+            new URLSearchParams({ paperIds: this.selectedPaperIds })
+          )
+          .then(
+            () => {
+              this.$notify({
+                message: "撤回成功",
+                type: "success",
+              });
+              this.searchPaper();
+            },
+            (error) => {
+              this.$notify({
+                message: error.response.data.desc,
+                type: "error",
+              });
+              this.loading = false;
+            }
+          );
+      });
+    },
+    withdrawPaper(row) {
+      this.$confirm("确认撤回试卷吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        this.selectedPaperIds = [];
+        this.selectedPaperIds.push(row.id);
+        this.$http
+          .post(
+            QUESTION_API + "/paper/withdraw",
+            new URLSearchParams({ paperIds: this.selectedPaperIds })
+          )
+          .then(
+            () => {
+              this.$notify({
+                message: "撤回成功",
+                type: "success",
+              });
+              this.searchPaper();
+            },
+            (error) => {
+              this.$notify({
+                message: error.response.data.desc,
+                type: "error",
+              });
+              this.loading = false;
+            }
+          );
+      });
+    },
+    isShowDeleteBtn(row) {
+      if (row.creationBy == this.user.userId && row.auditStatus == "WITHDRAW") {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    deletePapers() {
+      this.$confirm("确认删除试卷吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+
+        this.$http
+          .post(
+            QUESTION_API + "/paper/audit/delete",
+            new URLSearchParams({ paperIds: this.selectedPaperIds })
+          )
+          .then(
+            () => {
+              this.$notify({
+                message: "删除成功",
+                type: "success",
+              });
+              this.searchPaper();
+            },
+            (error) => {
+              this.$notify({
+                message: error.response.data.desc,
+                type: "error",
+              });
+              this.loading = false;
+            }
+          );
+      });
+    },
+    deletePaper(row) {
+      this.$confirm("确认删除试卷吗?", "提示", {
+        type: "warning",
+      }).then(() => {
+        this.loading = true;
+        this.selectedPaperIds = [];
+        this.selectedPaperIds.push(row.id);
+        this.$http
+          .post(
+            QUESTION_API + "/paper/audit/delete",
+            new URLSearchParams({ paperIds: this.selectedPaperIds })
+          )
+          .then(
+            () => {
+              this.$notify({
+                message: "删除成功",
+                type: "success",
+              });
+              this.searchPaper();
+            },
+            (error) => {
+              this.$notify({
+                message: error.response.data.desc,
+                type: "error",
+              });
+              this.loading = false;
+            }
+          );
+      });
+    },
+    resetForm() {
+      this.formSearch = {
+        courseNo: "",
+        courseName: "",
+        level: "",
+        name: "",
+      };
+    },
+    //查询
+    searchFrom() {
+      this.currentPage = 1;
+      this.searchPaper();
+    },
+    searchPaper() {
+      this.selectedPaperIds = [];
+      var pageNo = this.currentPage;
+      this.currentPage = 1;
+      this.loading = true;
+      var url =
+        QUESTION_API +
+        "/exam_pending_trial_paper/" +
+        pageNo +
+        "/" +
+        this.pageSize;
+      this.$http.get(url, { params: this.formSearch }).then((response) => {
+        this.tableData = response.data.content;
+        this.total = response.data.totalElements;
+        this.currentPage = Number(pageNo);
+      });
+      this.loading = false;
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.searchPaper();
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.searchPaper();
+    },
+    getCourseObj(courseNo) {
+      for (let course of this.courseList) {
+        if (course.code == courseNo) {
+          return course;
+        }
+      }
+      return "";
+    },
+    selectChange(row) {
+      this.selectedPaperIds = [];
+      row.forEach((element) => {
+        this.selectedPaperIds.push(element.id);
+      });
+    },
+    //查询所有课程
+    getCourses(query) {
+      if (query) {
+        query = query.trim();
+      }
+      this.courseLoading = true;
+      this.$http
+        .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
+        .then((response) => {
+          this.courseList = response.data;
+          this.courseLoading = false;
+        });
+    },
+    removeItem() {
+      sessionStorage.removeItem("paper");
+      sessionStorage.removeItem("paper_currentPage");
+    },
+    cancel(formData) {
+      this.resetForm2(formData);
+      this.dialogModel = false;
+    },
+    resetForm2(formData) {
+      this.printFrom.examId = "";
+      this.$refs[formData].clearValidate();
+    },
+    initVue() {
+      this.isClear = this.$route.params.isClear;
+      if (this.isClear == 0 || !this.isClear) {
+        this.removeItem();
+        this.formSearch = {
+          courseNo: "",
+          courseName: "",
+          level: "",
+          name: "",
+        };
+        this.currentPage = 1;
+      } else {
+        this.formSearch = JSON.parse(sessionStorage.getItem("paper"));
+        this.currentPage =
+          sessionStorage.getItem("paper_currentPage") == null
+            ? 1
+            : parseInt(sessionStorage.getItem("paper_currentPage"));
+      }
+      this.getCourses(this.formSearch.courseName);
+      this.searchPaper();
+    },
+  },
+};
+</script>
+<style scoped src="../styles/Common.css"></style>

+ 15 - 14
src/modules/questions/views/GenPaperDetail.vue

@@ -1036,16 +1036,17 @@ export default {
 
       this.fullscreenLoading = true;
       this.$http.post(url, this.genPaper).then(
-        (response) => {
+        () => {
           this.$notify({
             message: "组卷成功",
             type: "success",
           });
           this.fullscreenLoading = false;
-          let paperId = response.data.paper.id;
-          this.$router.push({
-            path: "/edit_paper/" + paperId + "/gen_paper",
-          });
+          // let paperId = response.data.paper.id;
+          // this.$router.push({
+          //   path: "/edit_paper/" + paperId + "/gen_paper",
+          // });
+          this.back();
         },
         (error) => {
           this.$notify({
@@ -1078,20 +1079,20 @@ export default {
           this.genPaper.frozenPaperIds.push(element);
         });
         this.$http.post(url, this.genPaper).then(
-          (response) => {
+          () => {
             this.$notify({
               message: "组卷成功",
               type: "success",
             });
             this.fullscreenLoading = false;
-            if (this.genPaper.genNumber == 1) {
-              let paperId = response.data.paper.id;
-              this.$router.push({
-                path: "/edit_paper/" + paperId + "/gen_paper",
-              });
-            } else {
-              this.back();
-            }
+            // if (this.genPaper.genNumber == 1) {
+            //   let paperId = response.data.paper.id;
+            //   this.$router.push({
+            //     path: "/edit_paper/" + paperId + "/gen_paper",
+            //   });
+            // } else {
+            this.back();
+            // }
           },
           (error) => {
             this.$notify({