瀏覽代碼

1116新需求

zhangjie 2 年之前
父節點
當前提交
59a06e1a39

+ 4 - 0
src/assets/styles/base.scss

@@ -452,6 +452,10 @@ body {
 .width-200 {
   width: 200px;
 }
+.inline-middle {
+  display: inline-block;
+  vertical-align: middle;
+}
 
 // other
 .tips-info {

+ 2 - 2
src/assets/styles/pages.scss

@@ -206,8 +206,8 @@
 
       &-page {
         position: absolute;
-        top: 0;
-        left: 20px;
+        top: 5px;
+        left: 5px;
         z-index: 99;
       }
     }

+ 19 - 2
src/modules/base/views/SystemSetting.vue

@@ -17,6 +17,16 @@
             >
           </el-radio-group>
         </el-form-item>
+        <el-form-item prop="openGlobalMatch" label="是否开启全局匹配:">
+          <el-radio-group v-model="modalForm.openGlobalMatch">
+            <el-radio
+              v-for="item in BOOLEAN_STATUS"
+              :key="item.value"
+              :label="item.value"
+              >{{ item.label }}</el-radio
+            >
+          </el-radio-group>
+        </el-form-item>
         <el-form-item>
           <el-button type="primary" :disabled="isSubmit" @click="submit"
             >确认</el-button
@@ -30,7 +40,8 @@
 <script>
 import { systemSettingQuery, updateSystemSetting } from "../api";
 const initModalForm = {
-  openOcr: false
+  openOcr: false,
+  openGlobalMatch: false
 };
 
 export default {
@@ -56,6 +67,13 @@ export default {
             message: "请选择",
             trigger: "change"
           }
+        ],
+        openGlobalMatch: [
+          {
+            required: true,
+            message: "请选择",
+            trigger: "change"
+          }
         ]
       }
     };
@@ -67,7 +85,6 @@ export default {
     async getSysSet() {
       const res = await systemSettingQuery();
       this.modalForm = this.$objAssign(initModalForm, res || {});
-      if (!this.modalForm.openOcr) this.modalForm.openOcr = false;
     },
     async submit() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});

+ 11 - 0
src/modules/record/api.js

@@ -60,6 +60,9 @@ export const dataCheckUndoListPage = datas => {
 export const dataCheckDoneListPage = datas => {
   return $postParam("/api/admin/paper/library/page_bind", datas);
 };
+export const dataCheckAbnormalListPage = datas => {
+  return $postParam("/api/admin/paper/library/page_abnormal", datas);
+};
 export const studentPictureList = paperScanTaskDetailId => {
   return $postParam("/api/admin/paper/library/list_student_picture", {
     paperScanTaskDetailId
@@ -71,9 +74,17 @@ export const studentUnbindTaskListPage = datas => {
 export const paperBindUser = datas => {
   return $postParam("/api/admin/paper/library/bind", datas);
 };
+export const abnormalPaper = paperLibraryId => {
+  return $postParam("/api/admin/paper/library/abnormal", { paperLibraryId });
+};
 export const listByStudentCode = datas => {
   return $postParam("/api/admin/paper/library/list_by_student_code", datas);
 };
 export const libraryOcrResult = datas => {
   return $postParam("/api/admin/paper/library/ocr", datas);
 };
+export const getPaperdetail = paperLibraryId => {
+  return $postParam("/api/admin/paper/library/get_paper_data", {
+    paperLibraryId
+  });
+};

+ 1 - 1
src/modules/record/components/ArchivesDetailStudentDialog.vue

@@ -64,7 +64,7 @@
     <library-dialog
       v-if="modalIsShow"
       ref="LibraryDialog"
-      model="fix"
+      mode="fix"
       :student="studentInfo"
       @closed="getImageList"
     ></library-dialog>

+ 35 - 5
src/modules/record/components/LibraryDialog.vue

@@ -25,7 +25,16 @@
               >设置OCR识别区</el-button
             >
             <el-divider></el-divider>
-            <h4 class="mb-1">绑定学生</h4>
+            <div v-if="openGlobalMatch" class="box-justify mb-2">
+              <h4>绑定学生</h4>
+              <div>
+                <span class="inline-middle mr-1">全局匹配</span>
+                <el-switch
+                  v-model="globalMatch"
+                  @change="getStudentList"
+                ></el-switch>
+              </div>
+            </div>
             <el-input
               v-model="studentNameOrNo"
               class="width-full"
@@ -73,6 +82,12 @@
               @click="switchCurPage(1)"
               >反面</el-button
             >
+            <el-button
+              type="danger"
+              :disabled="curPage.abnormal"
+              @click="toAbnormalPaper"
+              >标记异常</el-button
+            >
           </div>
           <image-contain
             ref="ImageContain"
@@ -135,7 +150,8 @@ import {
   paperBindUser,
   studentUnbindTaskListPage,
   scanTaskStudentListPage,
-  libraryOcrResult
+  libraryOcrResult,
+  abnormalPaper
 } from "../api";
 import { systemSettingQuery } from "../../base/api";
 import ImageContain from "../../../components/ImageContain.vue";
@@ -150,7 +166,7 @@ const initModalForm = {
 export default {
   name: "library-dialog",
   props: {
-    model: {
+    mode: {
       type: String,
       default: "undo",
       validate: val => ["undo", "fix"].includes(val)
@@ -165,7 +181,7 @@ export default {
       type: Object,
       default() {
         return {
-          curImage: "",
+          curPagePaperIndex: 0,
           pageList: []
         };
       }
@@ -193,6 +209,8 @@ export default {
       // ocr
       isSetOcrSet: false,
       openOcr: false,
+      openGlobalMatch: false,
+      globalMatch: false,
       ocrArea: { x: null, y: null, width: null, height: null, rotate: 0 },
       ocrResult: [],
       ocrResultDialogIsShow: false
@@ -200,7 +218,7 @@ export default {
   },
   computed: {
     IS_UNDO_MODEL() {
-      return this.model === "undo";
+      return this.mode === "undo";
     }
   },
   mounted() {
@@ -245,6 +263,7 @@ export default {
     async getSysSet() {
       const res = await systemSettingQuery();
       this.openOcr = res && res.openOcr;
+      this.openGlobalMatch = res && res.openGlobalMatch;
     },
     nameOrNoInput() {
       this.clearSetTs();
@@ -258,6 +277,7 @@ export default {
       const datas = {
         paperScanTaskId: this.curPage.paperScanTaskId,
         param: this.studentNameOrNo,
+        globalMatch: this.globalMatch,
         pageNumber: 1,
         pageSize: 30
       };
@@ -279,6 +299,16 @@ export default {
         this.isSwitchFb = false;
       }
     },
+    async toAbnormalPaper() {
+      const res = await this.$confirm(`确定要标记当前试卷为异常吗?`, "提示", {
+        type: "warning"
+      }).catch(() => {});
+      if (res !== "confirm") return;
+
+      await abnormalPaper(this.curPage.id);
+      this.$message.success("标记成功!");
+      this.toNextPaper();
+    },
     async getUndoPageList() {
       const data = await studentUnbindTaskListPage({ ...this.filterData });
       this.undoPageList.push(...data);

+ 31 - 7
src/modules/record/views/ArchivesDetail.vue

@@ -88,24 +88,45 @@
           width="55"
           align="center"
         ></el-table-column>
-        <el-table-column prop="studentName" label="姓名"></el-table-column>
-        <el-table-column prop="studentCode" label="学号"></el-table-column>
-        <el-table-column prop="majorName" label="专业"></el-table-column>
+        <el-table-column
+          prop="studentName"
+          label="姓名"
+          min-width="120"
+        ></el-table-column>
+        <el-table-column
+          prop="studentCode"
+          label="学号"
+          min-width="120"
+        ></el-table-column>
+        <el-table-column
+          prop="belongOrgName"
+          label="学院"
+          min-width="140"
+        ></el-table-column>
+        <el-table-co0lumn
+          prop="majorName"
+          label="专业"
+          min-width="140"
+        ></el-table-co0lumn>
         <el-table-column
           prop="clazzName"
           label="班级"
-          width="180"
+          min-width="100"
+        ></el-table-column>
+        <el-table-column
+          prop="courseName"
+          label="课程"
+          min-width="100"
         ></el-table-column>
-        <el-table-column prop="courseName" label="课程"></el-table-column>
         <el-table-column
           prop="teacherName"
           label="任课老师"
-          width="120"
+          min-width="120"
         ></el-table-column>
         <el-table-column
           prop="teachClazzName"
           label="教学班"
-          width="120"
+          min-width="120"
         ></el-table-column>
         <el-table-column prop="createTime" label="创建时间" width="170">
           <span slot-scope="scope">{{
@@ -212,6 +233,9 @@ export default {
       this.multipleSelection = val.map(item => item.paperScanTaskDetailId);
     },
     toDetail(row) {
+      if (!row.bindCount) {
+        return;
+      }
       this.curRow = row;
       this.$refs.ArchivesDetailStudentDialog.open();
     },

+ 105 - 3
src/modules/record/views/LibraryManage.vue

@@ -49,6 +49,9 @@
         <span>{{ item.name }}</span>
         <span v-if="item.code === 'UNDO'">({{ undoPage.total }})</span>
         <span v-if="item.code === 'DONE'">({{ donePage.total }})</span>
+        <span v-if="item.code === 'ABNORMAL'"
+          >({{ abnormalPage.total }})</span
+        >
       </el-button>
     </div>
 
@@ -82,7 +85,7 @@
       </div>
     </div>
 
-    <div v-else class="part-box part-box-pad">
+    <div v-if="curDoneType === 'DONE'" class="part-box part-box-pad">
       <el-table ref="TableList" key="2" :data="doneDataList">
         <el-table-column
           type="index"
@@ -143,6 +146,52 @@
       </div>
     </div>
 
+    <div v-if="curDoneType === 'ABNORMAL'" class="part-box part-box-pad">
+      <el-table ref="TableList" :data="abnormalDataList">
+        <el-table-column
+          type="index"
+          label="序号"
+          width="70"
+          :index="indexMethod"
+        ></el-table-column>
+        <el-table-column prop="path" label="文件名称">
+          <span slot-scope="scope">{{ scope.row.path | fileNameFilter }}</span>
+        </el-table-column>
+        <el-table-column prop="createTime" label="创建时间" width="170">
+          <span slot-scope="scope">{{
+            scope.row.createTime | timestampFilter
+          }}</span>
+        </el-table-column>
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          width="100"
+          fixed="right"
+        >
+          <template slot-scope="scope">
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toDoAbnormal(scope.row)"
+            >
+              立即处理
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="part-page">
+        <el-pagination
+          background
+          layout="total,prev, pager, next"
+          :current-page="undoPage.current"
+          :total="undoPage.total"
+          :page-size="size"
+          @current-change="toUndoPage"
+        >
+        </el-pagination>
+      </div>
+    </div>
+
     <!-- ImageListPreviewDialog -->
     <image-list-preview-dialog
       ref="ImageListPreviewDialog"
@@ -152,6 +201,8 @@
     <library-dialog
       ref="LibraryDialog"
       :filter-data="filter"
+      :mode="curMode"
+      :student="curStudent"
       @closed="search"
     ></library-dialog>
   </div>
@@ -161,7 +212,9 @@
 import {
   dataCheckUndoListPage,
   dataCheckDoneListPage,
-  studentPictureList
+  dataCheckAbnormalListPage,
+  studentPictureList,
+  getPaperdetail
 } from "../api";
 import ImageListPreviewDialog from "../../../components/ImageListPreviewDialog.vue";
 import LibraryDialog from "../components/LibraryDialog.vue";
@@ -193,11 +246,16 @@ export default {
         {
           code: "DONE",
           name: "已处理"
+        },
+        {
+          code: "ABNORMAL",
+          name: "异常"
         }
       ],
       curDoneType: "UNDO",
       undoDataList: [],
       doneDataList: [],
+      abnormalDataList: [],
       size: this.GLOBAL.pageSize,
       undoPage: {
         current: 1,
@@ -207,7 +265,14 @@ export default {
         current: 1,
         total: 0
       },
-      curImageList: []
+      abnormalPage: {
+        current: 1,
+        total: 0
+      },
+      curImageList: [],
+      curMode: "",
+      curStudent: {},
+      loading: false
     };
   },
   mounted() {
@@ -217,6 +282,11 @@ export default {
     selectMenu(type) {
       this.curDoneType = type;
     },
+    indexMethod(index) {
+      let { current } = this[`${this.curDoneType.toLowerCase()}Page`];
+      const size = this.size || 10;
+      return (current - 1) * size + index + 1;
+    },
     async toDetail(row) {
       if (!row.bindCount) return;
 
@@ -232,6 +302,7 @@ export default {
     search() {
       this.toUndoPage(1);
       this.toDonePage(1);
+      this.toAbnormalPage(1);
     },
     async getUndoList() {
       if (!this.checkPrivilege("list", "list")) return;
@@ -265,7 +336,38 @@ export default {
       this.donePage.current = page;
       this.getDoneList();
     },
+    async getAbnormalList() {
+      if (!this.checkPrivilege("list", "list")) return;
+
+      const datas = {
+        ...this.filter,
+        pageNumber: this.abnormalPage.current,
+        pageSize: this.size
+      };
+      const data = await dataCheckAbnormalListPage(datas);
+      this.abnormalDataList = data.records;
+      this.abnormalPage.total = data.total;
+    },
+    toAbnormalPage(page) {
+      this.abnormalPage.current = page;
+      this.getAbnormalList();
+    },
     todoTask() {
+      this.curMode = "undo";
+      this.$refs.LibraryDialog.open();
+    },
+    async toDoAbnormal(row) {
+      if (this.loading) return;
+      this.loading = true;
+      const data = await getPaperdetail(row.id).catch(() => {});
+      this.loading = false;
+      if (!data) return;
+
+      this.curStudent = {
+        curPagePaperIndex: 0,
+        pageList: data
+      };
+      this.curMode = "fix";
       this.$refs.LibraryDialog.open();
     }
   }