瀏覽代碼

档案详情完毕

zhangjie 2 年之前
父節點
當前提交
5fb7240cba

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

@@ -176,12 +176,12 @@
         flex-shrink: 0;
       }
 
-      &-footer {
-        flex-grow: 0;
-        flex-shrink: 0;
-        margin-top: 10px;
-        text-align: right;
-      }
+      // &-footer {
+      //   flex-grow: 0;
+      //   flex-shrink: 0;
+      //   margin-top: 10px;
+      //   text-align: right;
+      // }
 
       &-student {
         flex-grow: 2;

+ 36 - 5
src/modules/record/components/ArchivesDetailStudentDialog.vue

@@ -12,7 +12,12 @@
     >
       <div class="archives-student-body">
         <div class="archives-student-content part-box">
-          <el-carousel height="100%" :autoplay="false" arrow="always">
+          <el-carousel
+            height="100%"
+            :autoplay="false"
+            arrow="always"
+            @change="imageChange"
+          >
             <el-carousel-item v-for="item in imageList" :key="item">
               <el-image :src="item" fit="contain"></el-image>
             </el-carousel-item>
@@ -60,7 +65,8 @@
       v-if="modalIsShow"
       ref="LibraryDialog"
       model="fix"
-      :student="student"
+      :student="studentInfo"
+      @closed="getImageList"
     ></library-dialog>
   </div>
 </template>
@@ -83,7 +89,10 @@ export default {
   data() {
     return {
       modalIsShow: false,
-      imageList: []
+      imageList: [],
+      imageIndex: 0,
+      pageList: [],
+      studentInfo: {}
     };
   },
   methods: {
@@ -97,10 +106,32 @@ export default {
       this.modalIsShow = true;
     },
     async getImageList() {
-      const data = await studentPictureList(this.student.paperScanTaskDetailId);
-      this.imageList = data || [];
+      const resData = await studentPictureList(
+        this.student.paperScanTaskDetailId
+      );
+      this.pageList = resData || [];
+      let imageList = [];
+      this.pageList.forEach(item => {
+        imageList.push(...item.fileUrls);
+      });
+      this.imageList = imageList;
+    },
+    imageChange(imageIndex) {
+      this.imageIndex = imageIndex;
     },
     toFix() {
+      const curImage = this.imageList[this.imageIndex];
+      const curPage = this.pageList.find(item =>
+        item.fileUrls.includes(curImage)
+      );
+      if (!curPage) return;
+
+      this.studentInfo = {
+        ...this.student,
+        curPagePaperIndex: curPage.fileUrls.indexOf(curImage),
+        pageList: [curPage]
+      };
+
       this.$refs.LibraryDialog.open();
     }
   }

+ 14 - 10
src/modules/record/components/LibraryDialog.vue

@@ -55,11 +55,6 @@
               </el-table-column>
             </el-table>
           </div>
-          <div class="data-check-action-footer">
-            <el-button type="primary" size="small" @click="toNextPaper"
-              >下一张</el-button
-            >
-          </div>
         </div>
         <div class="data-check-content part-box">
           <div v-if="curPagePapers.length" class="data-check-content-page">
@@ -125,7 +120,8 @@ export default {
       type: Object,
       default() {
         return {
-          pages: []
+          curImage: "",
+          pageList: []
         };
       }
     }
@@ -172,9 +168,11 @@ export default {
       this.undoPageList = [];
 
       if (this.IS_UNDO_MODEL) {
+        this.curPagePaperIndex = 0;
         await this.getUndoPageList();
       } else {
-        this.undoPageList = this.student.pages;
+        this.undoPageList = this.student.pageList;
+        this.curPagePaperIndex = this.student.curPagePaperIndex;
       }
 
       if (!this.undoPageList.length) {
@@ -225,7 +223,8 @@ export default {
     },
     toNextPaper() {
       if (!this.undoPageList.length) {
-        this.$message.error("没有下一张!");
+        this.$message.warning("已全部处理完!");
+        this.cancel();
         return;
       }
 
@@ -237,6 +236,7 @@ export default {
       if (this.donePageList.length > 10)
         this.donePageList = this.donePageList.slice(-10);
 
+      this.curPagePaperIndex = 0;
       this.getNextPaper();
     },
     getNextPaper() {
@@ -245,7 +245,7 @@ export default {
         this.getStudentList();
       }
       this.curPagePapers = this.curPage.fileUrls;
-      this.switchCurPage(0);
+      this.switchCurPage(this.curPagePaperIndex);
     },
     toBind(row) {
       this.lastPaperScanTaskId = this.curPage.paperScanTaskId;
@@ -266,7 +266,11 @@ export default {
       if (!res) return;
 
       this.$message.success("绑定成功!");
-      this.toNextPaper();
+      if (this.IS_UNDO_MODEL) {
+        this.toNextPaper();
+      } else {
+        this.cancel();
+      }
     }
   }
 };

+ 7 - 2
src/modules/record/views/LibraryManage.vue

@@ -214,8 +214,13 @@ export default {
     async toDetail(row) {
       if (!row.bindCount) return;
 
-      const data = await studentPictureList(row.paperScanTaskDetailId);
-      this.curImageList = data || [];
+      const resData = await studentPictureList(row.paperScanTaskDetailId);
+      const data = resData || [];
+      let imageList = [];
+      data.forEach(item => {
+        imageList.push(...item.fileUrls);
+      });
+      this.curImageList = imageList;
       this.$refs.ImageListPreviewDialog.open();
     },
     search() {