Browse Source

阅卷管理-评卷员管理

zhangjie 1 năm trước cách đây
mục cha
commit
f5774e3d55

+ 20 - 1
src/modules/mark/api.js

@@ -80,7 +80,7 @@ export const markManageItemFinish = (datas) => {
   return $postParam("/api/admin/mark/paper/finish", datas);
 };
 // mark detail
-// mark-progress
+// mark-detail-progress
 export const markProgressSummary = (datas) => {
   return $postParam("/api/admin/mark/group/summary", datas);
 };
@@ -92,3 +92,22 @@ export const markProgressMarkerExport = (datas) => {
     responseType: "blob",
   });
 };
+// mark-detail-marker
+export const markMarkerListPage = (datas) => {
+  return $postParam("/api/admin/mark/marker/list", datas);
+};
+export const markMarkerBind = (datas) => {
+  return $postParam("/api/admin/mark/marker/add", datas);
+};
+export const markMarkerReset = (datas) => {
+  return $postParam("/api/admin/mark/marker/reset", datas);
+};
+export const markMarkerUnbind = (datas) => {
+  return $postParam("/api/admin/mark/marker/delete", datas);
+};
+export const markMarkerRecycle = (datas) => {
+  return $postParam("/api/admin/mark/marker/release", datas);
+};
+export const markMarkerSetTaskCount = (datas) => {
+  return $postParam("/api/admin/mark/marker/setTaskCount", datas);
+};

+ 286 - 0
src/modules/mark/components/markDetail/MarkDetailMarker.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="mark-detail-marker">
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
+        <el-form-item label="班级">
+          <el-select v-model="filter.className" placeholder="班级" clearable>
+            <el-option :value="1">班级1</el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="评阅题目">
+          <el-select
+            v-model="filter.groupQuestion"
+            placeholder="评阅题目"
+            clearable
+          >
+            <el-option :value="1">班级1</el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="评卷员">
+          <el-input
+            v-model.trim="filter.loginName"
+            placeholder="评卷员"
+            clearable
+          >
+          </el-input>
+        </el-form-item>
+        <el-form-item label-width="0px">
+          <el-button type="primary" @click="search">查询</el-button>
+        </el-form-item>
+      </el-form>
+      <div class="part-box-action">
+        <el-button type="primary" @click="toBind"> 绑定评卷员 </el-button>
+        <el-button
+          type="primary"
+          :disabled="!multipleSelection.length"
+          @click="toBatchRecycle"
+        >
+          回收
+        </el-button>
+        <el-button
+          type="primary"
+          :disabled="!multipleSelection.length"
+          @click="toSetTaskCount(multipleSelection)"
+        >
+          设置评卷数
+        </el-button>
+      </div>
+    </div>
+
+    <div class="part-box part-box-pad">
+      <el-table
+        ref="TableList"
+        :data="dataList"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        ></el-table-column>
+        <el-table-column prop="courseName" label="评卷员" min-width="100">
+          <template slot-scope="scope">
+            <el-tag size="medium" type="info">
+              {{ scope.row.name }}({{ scope.row.orgName }})
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="groupQuestions"
+          label="评阅题目"
+          min-width="200"
+        ></el-table-column>
+        <el-table-column
+          prop="markedCount"
+          label="已评数量"
+          width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="currentCount"
+          label="正在评卷"
+          width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="taskCount"
+          label="任务数"
+          width="100"
+        ></el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          width="200"
+          fixed="right"
+        >
+          <template slot-scope="scope">
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toReset(scope.row)"
+              >重置</el-button
+            >
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toUnbind(scope.row)"
+              >解绑</el-button
+            >
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toSimpleRecycle(scope.row)"
+              >回收</el-button
+            >
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toSetTaskCount([scope.row.markUserGroupId])"
+              >设置评卷数</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :pager-count="5"
+          :current-page="current"
+          :total="total"
+          :page-size="size"
+          @current-change="toPage"
+          @size-change="pageSizeChange"
+        >
+        </el-pagination>
+      </div>
+      <p class="tips-info">
+        说明:评卷过程发现某些试题评卷工作任务重需要增加评卷员,可以选择对应评阅题目后绑定评卷员
+      </p>
+    </div>
+
+    <!-- ModifyMarkerTaskCount -->
+    <modify-marker-task-count
+      ref="ModifyMarkerTaskCount"
+      :ids="curIds"
+      @modified="getList"
+    ></modify-marker-task-count>
+    <!-- ModifyMarkerBind -->
+    <modify-marker-bind
+      ref="ModifyMarkerBind"
+      :data="curData"
+      @modified="getList"
+    ></modify-marker-bind>
+  </div>
+</template>
+
+<script>
+import {
+  markMarkerListPage,
+  markMarkerReset,
+  markMarkerUnbind,
+  markMarkerRecycle,
+} from "../api";
+import ModifyMarkerTaskCount from "./ModifyMarkerTaskCount.vue";
+import ModifyMarkerBind from "./ModifyMarkerBind.vue";
+
+export default {
+  name: "mark-detail-marker",
+  props: {
+    baseInfo: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  components: { ModifyMarkerTaskCount, ModifyMarkerBind },
+  data() {
+    return {
+      filter: {
+        groupQuestion: "",
+        className: "",
+        loginName: "",
+      },
+      current: 1,
+      size: this.GLOBAL.pageSize,
+      total: 0,
+      dataList: [],
+      curRow: {},
+      curIds: [],
+      curData: {},
+      multipleSelection: [],
+      downloading: false,
+    };
+  },
+  methods: {
+    async getList() {
+      const datas = {
+        ...this.filter,
+        pageNumber: this.current,
+        pageSize: this.size,
+      };
+      const data = await markMarkerListPage(datas);
+      this.dataList = data.records;
+      this.total = data.total;
+    },
+    toPage(page) {
+      this.current = page;
+      this.getList();
+    },
+    search() {
+      this.toPage(1);
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val.map((item) => item.markUserGroupId);
+    },
+    toBind() {
+      this.curData = {
+        examId: this.baseInfo.examId,
+        paperNumber: this.baseInfo.paperNumber,
+        // TODO: groupNumber
+      };
+      this.$refs.ModifyMarkerBind.open();
+    },
+    // reset marker
+    async toReset(row) {
+      const confirm = await this.$confirm("确定要重置当前评卷员?", "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (confirm !== "confirm") return;
+
+      await markMarkerReset({
+        markUserGroupId: row.markUserGroupId,
+      });
+      this.$message.success("操作成功!");
+      this.getList();
+    },
+    // unbind marker
+    async toUnbind(row) {
+      const confirm = await this.$confirm("确定要解绑当前评卷员?", "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (confirm !== "confirm") return;
+
+      await markMarkerUnbind({
+        markUserGroupId: row.markUserGroupId,
+      });
+      this.$message.success("操作成功!");
+      this.getList();
+    },
+    // recycle marker
+    async toBatchRecycle() {
+      if (!this.multipleSelection.length) return;
+
+      const confirm = await this.$confirm("确定要回收选中的评卷员?", "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (confirm !== "confirm") return;
+
+      this.toRecycle(this.multipleSelection);
+    },
+    async toSimpleRecycle(row) {
+      const confirm = await this.$confirm("确定要回收当前评卷员?", "提示", {
+        type: "warning",
+      }).catch(() => {});
+      if (confirm !== "confirm") return;
+
+      this.toRecycle([row.markUserGroupId]);
+    },
+    async toRecycle(markUserGroupIds) {
+      if (!markUserGroupIds.length) return;
+
+      await markMarkerRecycle({
+        markUserGroupIds,
+      });
+      this.$message.success("操作成功!");
+      this.getList();
+    },
+    // set task count
+    toSetTaskCount(ids) {
+      if (!ids.length) return;
+
+      this.curIds = ids;
+      this.$refs.ModifyMarkerTaskCount.open();
+    },
+  },
+};
+</script>

+ 32 - 8
src/modules/mark/components/markDetail/MarkDetailProgress.vue

@@ -32,10 +32,20 @@
           min-width="200"
         ></el-table-column>
         <el-table-column
-          prop="markerCount"
+          class-name="action-column"
           label="评卷员"
+          align="center"
           min-width="100"
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toMarker(scope.row)"
+              >{{ scope.row.markerCount }}</el-button
+            >
+          </template>
+        </el-table-column>
         <el-table-column
           prop="taskCount"
           label="任务总数"
@@ -101,10 +111,20 @@
           min-width="200"
         ></el-table-column>
         <el-table-column
-          prop="markerCount"
+          class-name="action-column"
           label="评卷员"
-          width="100"
-        ></el-table-column>
+          align="center"
+          min-width="100"
+        >
+          <template slot-scope="scope">
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toMarker(scope.row)"
+              >{{ scope.row.markerCount }}</el-button
+            >
+          </template>
+        </el-table-column>
         <el-table-column
           prop="scoreList"
           label="步骤分"
@@ -203,7 +223,7 @@ export default {
       };
       this.questionList = res.groupInfo || [];
     },
-    async getClassList() {
+    async getList() {
       const datas = {
         examId: this.baseInfo.examId,
         paperNumber: this.baseInfo.paperNumber,
@@ -216,12 +236,16 @@ export default {
     },
     toPage(page) {
       this.current = page;
-      this.getClassList();
+      this.getList();
     },
     toArbitrate(row) {
       console.log(row);
       this.curRow = row;
-      // TODO:
+      // TODO:去仲裁管理
+    },
+    toMarker(row) {
+      // TODO:去评卷员管理
+      console.log(row);
     },
     async toExport() {
       if (this.downloading) return;

+ 100 - 0
src/modules/mark/components/markDetail/ModifyMarkerBind.vue

@@ -0,0 +1,100 @@
+<template>
+  <el-dialog
+    :visible.sync="modalIsShow"
+    title="绑定评卷员"
+    top="10vh"
+    width="448px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @opened="visibleChange"
+  >
+    <el-form ref="modalFormComp" :model="modalForm" :rules="rules">
+      <el-form-item prop="userIds" label="评卷员:">
+        <el-select
+          v-model="modalForm.userIds"
+          placeholder="评卷员"
+          multiple
+          clearable
+        >
+          <el-option v-for="user in userList" :key="user.id" :value="user.id">{{
+            user.name
+          }}</el-option>
+        </el-select>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :loading="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { markMarkerBind } from "../api";
+
+export default {
+  name: "modify-marker-bind",
+  props: {
+    data: {
+      type: Object,
+      default() {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      isSubmit: false,
+      modalIsShow: false,
+      modalForm: { userIds: [] },
+      userList: [],
+      rules: {
+        userIds: [
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              if (!value || !value.length) {
+                return callback(new Error(`请选择评卷员`));
+              }
+              callback();
+            },
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    visibleChange() {
+      this.modalForm = { userIds: [] };
+      this.$nextTick(() => {
+        this.$refs.modalFormComp.clearValidate();
+      });
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+
+      const datas = { ...this.modalForm, ...this.data };
+      const res = await markMarkerBind(datas).catch(() => {});
+      this.isSubmit = false;
+      if (!res) return;
+      this.$message.success("绑定成功!");
+      this.cancel();
+      this.$emit("modified");
+    },
+  },
+};
+</script>

+ 97 - 0
src/modules/mark/components/markDetail/ModifyMarkerTaskCount.vue

@@ -0,0 +1,97 @@
+<template>
+  <el-dialog
+    :visible.sync="modalIsShow"
+    title="设置评卷数"
+    top="10vh"
+    width="448px"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    @opened="visibleChange"
+  >
+    <el-form ref="modalFormComp" :model="modalForm" :rules="rules">
+      <el-form-item prop="taskCount" label="任务数:">
+        <el-input-number
+          style="width: 125px"
+          v-model="modalForm.taskCount"
+          :min="1"
+          :max="9999999"
+          :step="1"
+          step-strictly
+          :controls="false"
+        ></el-input-number>
+      </el-form-item>
+    </el-form>
+    <div slot="footer">
+      <el-button type="primary" :loading="isSubmit" @click="submit"
+        >确认</el-button
+      >
+      <el-button @click="cancel">取消</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { markMarkerSetTaskCount } from "../api";
+
+const initModalForm = {
+  taskCount: null,
+};
+
+export default {
+  name: "modify-marker-task-count",
+  props: {
+    ids: {
+      type: Array,
+      default() {
+        return [];
+      },
+    },
+  },
+  data() {
+    return {
+      modalIsShow: false,
+      isSubmit: false,
+      modalForm: {},
+      rules: {
+        taskCount: [
+          {
+            required: true,
+            message: "请输入任务数量",
+            trigger: "change",
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    visibleChange() {
+      this.modalForm = { ...initModalForm };
+      this.$nextTick(() => {
+        this.$refs.modalFormComp.clearValidate();
+      });
+    },
+    cancel() {
+      this.modalIsShow = false;
+    },
+    open() {
+      this.modalIsShow = true;
+    },
+    async submit() {
+      const valid = await this.$refs.modalFormComp.validate().catch(() => {});
+      if (!valid) return;
+
+      if (this.isSubmit) return;
+      this.isSubmit = true;
+
+      const datas = { ...this.modalForm, markUserGroupIds: this.ids };
+      const res = await markMarkerSetTaskCount(datas).catch(() => {});
+      this.isSubmit = false;
+      if (!res) return;
+      this.$message.success("设置成功!");
+      this.cancel();
+      this.$emit("modified");
+    },
+  },
+};
+</script>

+ 1 - 1
src/modules/mark/components/markParam/MarkParamClass.vue

@@ -29,7 +29,7 @@
               type="info"
               class="mb-1 mr-1"
             >
-              {{ scope.row.name }}({{ scope.row.orgName }})
+              {{ item.name }}({{ item.orgName }})
             </el-tag>
           </template>
         </el-table-column>