Browse Source

feat: 批量纠错

zhangjie 10 months ago
parent
commit
bbe329cfc9

+ 37 - 0
src/assets/styles/pages.scss

@@ -261,11 +261,17 @@
       flex-shrink: 0;
       flex-shrink: 0;
       padding: 20px;
       padding: 20px;
 
 
+      display: flex;
+      flex-direction: column;
+
       .tips-info {
       .tips-info {
         margin-top: 8px;
         margin-top: 8px;
       }
       }
     }
     }
     &-info {
     &-info {
+      flex-grow: 0;
+      flex-shrink: 0;
+
       p {
       p {
         margin-bottom: 6px;
         margin-bottom: 6px;
       }
       }
@@ -274,6 +280,7 @@
       flex-grow: 2;
       flex-grow: 2;
       margin: 0 20px 0 0;
       margin: 0 20px 0 0;
       background-color: $--color-text-gray-5;
       background-color: $--color-text-gray-5;
+      position: relative;
 
 
       .el-carousel {
       .el-carousel {
         height: 100%;
         height: 100%;
@@ -282,6 +289,36 @@
         width: 100%;
         width: 100%;
         height: 100%;
         height: 100%;
       }
       }
+
+      &-tips {
+        position: absolute;
+        top: 5px;
+        right: 5px;
+        z-index: 9;
+        padding: 5px 8px;
+        border-radius: 3px;
+        color: $--color-primary;
+        background: mix(#fff, $--color-primary, 85%);
+      }
+    }
+    &-mid {
+      flex-grow: 0;
+      flex-shrink: 0;
+      margin-bottom: 16px;
+    }
+    &-pages {
+      flex-grow: 2;
+      overflow: hidden;
+      border: 1px solid $--color-border;
+
+      .el-table {
+        height: 100%;
+        overflow: auto;
+        .cell {
+          padding-left: 0;
+          padding-right: 0;
+        }
+      }
     }
     }
   }
   }
 }
 }

+ 64 - 22
src/modules/record/components/ArchivesDetailStudentDialog.vue

@@ -20,6 +20,10 @@
             @on-next="toNextImage"
             @on-next="toNextImage"
             @on-rotate="imageRotateChange"
             @on-rotate="imageRotateChange"
           ></image-contain>
           ></image-contain>
+          <div class="archives-student-content-tips">
+            第{{ curPage.curPageIndex + 1 }}张 /
+            {{ curPage.pindex === 0 ? "正" : "反" }}面
+          </div>
         </div>
         </div>
         <div class="archives-student-action part-box">
         <div class="archives-student-action part-box">
           <div class="archives-student-info">
           <div class="archives-student-info">
@@ -51,25 +55,45 @@
               <span>扫描批次号:</span><span>{{ curPage.batchNo }}</span>
               <span>扫描批次号:</span><span>{{ curPage.batchNo }}</span>
             </p>
             </p>
           </div>
           </div>
-          <el-divider></el-divider>
-          <el-button v-if="showFix" type="primary" size="small" @click="toFix"
-            >纠错</el-button
-          >
-          <el-button
-            type="primary"
-            size="small"
-            :disabled="!curImageRotate"
-            :loading="loading"
-            @click="toSaveRotate"
-            >保存旋转</el-button
-          >
-          <el-button type="danger" size="small" @click="toDelete"
-            >删除</el-button
-          >
-          <p v-if="showFix" class="tips-info tips-error">
-            注意:<br />
-            当图片里学生信息与右侧学生信息不一致时请执行纠错操作!
-          </p>
+          <div class="archives-student-mid">
+            <el-divider></el-divider>
+            <el-button v-if="showFix" type="primary" size="small" @click="toFix"
+              >纠错</el-button
+            >
+            <el-button
+              type="primary"
+              size="small"
+              :disabled="!curImageRotate"
+              :loading="loading"
+              @click="toSaveRotate"
+              >保存旋转</el-button
+            >
+            <el-button type="danger" size="small" @click="toDelete"
+              >删除</el-button
+            >
+            <p v-if="showFix" class="tips-info tips-error">
+              注意:<br />
+              当图片里学生信息与右侧学生信息不一致时请执行纠错操作!
+            </p>
+          </div>
+          <div v-if="showFix" class="archives-student-pages">
+            <el-table
+              :data="pageList"
+              height="100%"
+              @selection-change="handleSelectionChange"
+            >
+              <el-table-column
+                type="selection"
+                width="30"
+                align="center"
+              ></el-table-column>
+              <el-table-column label="全选">
+                <template slot-scope="scope">
+                  第{{ scope.$index + 1 }}张
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
         </div>
         </div>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
@@ -117,6 +141,7 @@ export default {
       pageList: [],
       pageList: [],
       studentInfo: {},
       studentInfo: {},
       loading: false,
       loading: false,
+      multipleSelection: [],
       // image preview
       // image preview
       curImage: { url: "" },
       curImage: { url: "" },
       curImageIndex: 0,
       curImageIndex: 0,
@@ -145,6 +170,9 @@ export default {
     closeHandle() {
     closeHandle() {
       this.$emit("close");
       this.$emit("close");
     },
     },
+    handleSelectionChange(vals) {
+      this.multipleSelection = vals;
+    },
     async getImageList() {
     async getImageList() {
       const resData = await studentPictureList({
       const resData = await studentPictureList({
         paperScanTaskId: this.student.paperScanTaskId,
         paperScanTaskId: this.student.paperScanTaskId,
@@ -159,6 +187,18 @@ export default {
     },
     },
     // actions
     // actions
     toFix() {
     toFix() {
+      if (this.multipleSelection.length) {
+        this.studentInfo = {
+          ...this.student,
+          curPagePaperIndex: 0,
+          pageList: this.multipleSelection.map((item) => {
+            return { ...item, paperScanTaskId: this.student.paperScanTaskId };
+          }),
+        };
+        this.$refs.LibraryDialog.open();
+        return;
+      }
+
       const info = this.getImageInfo(this.curImage.url);
       const info = this.getImageInfo(this.curImage.url);
 
 
       this.studentInfo = {
       this.studentInfo = {
@@ -169,10 +209,12 @@ export default {
       this.$refs.LibraryDialog.open();
       this.$refs.LibraryDialog.open();
     },
     },
     getImageInfo(url) {
     getImageInfo(url) {
-      console.log(url);
-      const curPage = this.pageList.find((item) => item.fileUrls.includes(url));
+      const curPageIndex = this.pageList.findIndex((item) =>
+        item.fileUrls.includes(url)
+      );
+      const curPage = this.pageList[curPageIndex];
       const pindex = curPage.fileUrls.indexOf(url);
       const pindex = curPage.fileUrls.indexOf(url);
-      return { ...curPage, pindex };
+      return { ...curPage, curPageIndex, pindex };
     },
     },
     imageRotateChange(rotate) {
     imageRotateChange(rotate) {
       this.curImageRotate = rotate;
       this.curImageRotate = rotate;

+ 2 - 2
src/modules/record/components/ScanTaskDetailDialog.vue

@@ -47,7 +47,7 @@
         >
         >
           <template slot-scope="scope">
           <template slot-scope="scope">
             <el-button
             <el-button
-              v-if="checkPrivilege('link', 'ClearScanData')"
+              v-if="checkPrivilege('link', 'ClearStudentScanData')"
               class="btn-danger"
               class="btn-danger"
               type="text"
               type="text"
               @click="toClear(scope.row)"
               @click="toClear(scope.row)"
@@ -135,7 +135,7 @@ export default {
 
 
       await clearStudentScanData({
       await clearStudentScanData({
         paperScanTaskId: this.task.paperScanTaskId,
         paperScanTaskId: this.task.paperScanTaskId,
-        studentCode: row.studentCode,
+        studentId: row.studentId,
       });
       });
       this.$message.success("操作成功!");
       this.$message.success("操作成功!");
       this.getList();
       this.getList();