zhangjie 8 달 전
부모
커밋
30465b3939

+ 3 - 1
src/modules/grading/leader/LeaderGrading.vue

@@ -728,7 +728,9 @@ export default {
       await this.getList();
       await this.$refs.MarkerHistory.updatePapers();
 
-      if (!this.papers.length) {
+      if (this.papers.length) {
+        this.selectPaper(0);
+      } else {
         this.paperKey = this.$randomCode();
         this.curPaper = {};
       }

+ 12 - 2
src/modules/grading/marker/MarkerGrading.vue

@@ -508,6 +508,7 @@ export default {
       if (this.papers.length) {
         this.selectPaper(0);
       } else {
+        this.paperKey = this.$randomCode();
         this.curPaper = {};
       }
       if (this.IS_UNDO_STEP) {
@@ -599,7 +600,7 @@ export default {
       this.selectPaper(this.curPaperIndex);
     },
     // paper view action
-    markChange(curPaperOrTask) {
+    async markChange(curPaperOrTask) {
       const dataList = this.carouselType ? this.carouselPapers : this.papers;
       const row = dataList.find((item) => item.id === curPaperOrTask.id);
       if (!row) return;
@@ -613,7 +614,16 @@ export default {
         this.steps.otherStep[spos].count++;
       } else {
         this.steps.otherStep[spos].count--;
-        if (this.curStep.type === "markPaper") this.getList();
+        if (this.curStep.type === "markPaper") {
+          await this.getList();
+
+          if (this.papers.length) {
+            this.selectPaper(0);
+          } else {
+            this.paperKey = this.$randomCode();
+            this.curPaper = {};
+          }
+        }
       }
     },
     async historyMarkChange(curPaperOrTask) {

+ 19 - 8
src/modules/inspection/paperCheck/TaskDetail.vue

@@ -48,7 +48,7 @@
         <div class="page-total">共{{ total }}条</div>
 
         <div class="task-page">
-          <div class="page-item" @click="toPage(1)" title="首页">
+          <div class="page-item" @click="toFirstPage" title="首页">
             <Icon type="ios-skip-backward" />
           </div>
           <div class="page-item" @click="toPrevPage" title="上一页">
@@ -67,7 +67,7 @@
           <div class="page-item" @click="toNextPage" title="下一页">
             <Icon type="md-arrow-dropright" />
           </div>
-          <div class="page-item" @click="toPage(totalPage)" title="尾页">
+          <div class="page-item" @click="toLastPage" title="尾页">
             <Icon type="ios-skip-forward" />
           </div>
         </div>
@@ -141,7 +141,7 @@ export default {
     async initData() {
       const res = await paperCheckProgress({ paperCheckId: this.taskInfo.id });
       if (res && res.secretNumber) {
-        await this.toPage(res.pageNumber + 1);
+        await this.toPage(res.pageNumber);
         const index = this.papers.findIndex(
           (item) => item.sn === res.secretNumber
         );
@@ -163,8 +163,8 @@ export default {
 
       const res = await fetchFunc({
         paperCheckId: this.taskInfo.id,
-        pageNumber: this.current - 1,
-        pageSize: this.size,
+        page: this.current - 1,
+        size: this.size,
       });
       this.papers = res.data.map((item) => {
         return {
@@ -177,7 +177,7 @@ export default {
       this.current = res.page + 1;
     },
     async toPage(page) {
-      if (page > this.totalPage || page < 1) return;
+      if ((this.totalPage && page > this.totalPage) || page < 1) return;
       this.current = page;
       await this.getList();
       this.pageNo = this.current;
@@ -198,17 +198,28 @@ export default {
         this.changePage();
       }
     },
-    changePage() {
+    async changePage() {
       if (!this.pageNo) return;
-      this.toPage(Number(this.pageNo));
+      await this.toPage(Number(this.pageNo));
+      this.selectPaper(0);
+    },
+    async toFirstPage() {
+      await this.toPage(1);
+      this.selectPaper(0);
     },
     async toPrevPage() {
       if (this.current <= 1) return;
       await this.toPage(this.current - 1);
+      this.selectPaper(0);
     },
     async toNextPage() {
       if (this.current >= this.totalPage) return;
       await this.toPage(this.current + 1);
+      this.selectPaper(0);
+    },
+    async toLastPage() {
+      await this.toPage(this.totalPage);
+      this.selectPaper(0);
     },
     // menu
     async toSwitchMenu(item) {

+ 4 - 1
src/modules/mark/leader/LeaderMarking.vue

@@ -353,6 +353,7 @@ export default {
       if (this.papers.length) {
         this.selectPaper(0);
       } else {
+        this.paperKey = this.$randomCode();
         this.curPaper = {};
       }
     },
@@ -530,7 +531,9 @@ export default {
       await this.getList();
       await this.$refs.MarkerHistory.updatePapers();
 
-      if (!this.papers.length) {
+      if (this.papers.length) {
+        this.selectPaper(0);
+      } else {
         this.paperKey = this.$randomCode();
         this.curPaper = {};
       }

+ 11 - 2
src/modules/mark/marker/MarkerMarking.vue

@@ -405,6 +405,7 @@ export default {
       if (this.papers.length) {
         this.selectPaper(0);
       } else {
+        this.paperKey = this.$randomCode();
         this.curPaper = {};
       }
     },
@@ -414,7 +415,7 @@ export default {
       await this.getStepLevels();
       this.toPage(1);
     },
-    markChange(curPaperOrTask) {
+    async markChange(curPaperOrTask) {
       const dataList = this.carouselType ? this.carouselPapers : this.papers;
       const row = dataList.find((item) => item.id === curPaperOrTask.id);
       if (!row) return;
@@ -428,7 +429,15 @@ export default {
         this.steps.otherStep[spos].count++;
       } else {
         this.steps.otherStep[spos].count--;
-        if (this.curStep.type === "markPaper") this.getList();
+        if (this.curStep.type === "markPaper") {
+          await this.getList();
+          if (this.papers.length) {
+            this.selectPaper(0);
+          } else {
+            this.paperKey = this.$randomCode();
+            this.curPaper = {};
+          }
+        }
       }
     },
     async historyMarkChange(curPaperOrTask) {