Browse Source

网考-监考已审-考试记录详情改造

deason 2 years ago
parent
commit
72e851c554
1 changed files with 108 additions and 10 deletions
  1. 108 10
      src/modules/oe/views/alreadyAudited.vue

+ 108 - 10
src/modules/oe/views/alreadyAudited.vue

@@ -374,7 +374,8 @@
         </el-col>
       </el-row>
       <el-dialog
-        title="审核"
+        title="重审"
+        width="400px"
         :visible.sync="dialogAuditFormVisible"
         @closed="auditDialogClosed"
       >
@@ -408,7 +409,7 @@
             <el-input
               v-model="auditForm.disciplineDetail"
               type="textarea"
-              :autosize="{ minRows: 6, maxRows: 10 }"
+              :autosize="{ minRows: 3, maxRows: 5 }"
               placeholder="请输入内容"
             ></el-input>
           </el-form-item>
@@ -420,6 +421,20 @@
           </div>
         </el-form>
       </el-dialog>
+
+      <el-dialog
+        title="考试记录详情"
+        width="1250px"
+        :visible.sync="examRecordDataDialog"
+        @close="examRecordDataDialogClose"
+      >
+        <ExamRecordDetail
+          :exam-record-data-id="curSelectedExamRecordDataId"
+          :show-audit-button="curSelectedShowAuditButton"
+          @changeExamRecordData="changeExamRecordData"
+          @auditExamRecordData="auditExamRecordData"
+        ></ExamRecordDetail>
+      </el-dialog>
     </el-main>
   </el-container>
 </template>
@@ -434,6 +449,11 @@ export default {
   mixins: [pagePrivilege],
   data() {
     return {
+      curSelectedExamRecordDataId: null,
+      curSelectedShowAuditButton: false,
+      examRecordDataDialog: false,
+      toNext: false,
+      curTotalPages: 0,
       auditExplainList: AUDIT_EXPLAIN_LIST,
       total: 0,
       tableLoading: false,
@@ -520,12 +540,12 @@ export default {
         // if (!this.currentPagePrivileges.INVIGILATE_AUDIT_STATUS) {
         //   this.form.status = "UN_PASS";
         // }
-        this.backFill();
+        // this.backFill();
       }
     },
   },
   created() {
-    this.backFill();
+    // this.backFill();
     this.getDisciplineTypeList("");
   },
   methods: {
@@ -715,13 +735,14 @@ export default {
             this.tableData = response.data.content;
             this.total = response.data.totalElements;
             this.form.pageNo = response.data.number + 1;
+            this.curTotalPages = response.data.totalPages;
           } else {
             this.tableData = [];
           }
           this.tableLoading = false;
-          this.$router.push({
-            path: "/oe/alreadyAudited?" + new URLSearchParams(params),
-          });
+          // this.$router.push({
+          //   path: "/oe/alreadyAudited?" + new URLSearchParams(params),
+          // });
         });
     },
     selectable(row) {
@@ -752,10 +773,87 @@ export default {
       this.form.pageNo = val;
       this.search();
     },
+    curSelectedRow(examRecordDataId) {
+      for (let n = 0; n < this.tableData.length; n++) {
+        let row = this.tableData[n];
+        if (examRecordDataId === row.examRecordDataId) {
+          this.$refs["multipleTable"]?.toggleRowSelection(row, true);
+        } else {
+          this.$refs["multipleTable"]?.toggleRowSelection(row, false);
+        }
+      }
+    },
+    examRecordDataDialogClose() {
+      this.examRecordDataDialog = false;
+    },
+    examRecordDataDialogOpen(examRecordDataId, showAuditButton) {
+      this.examRecordDataDialog = true;
+      this.curSelectedShowAuditButton = showAuditButton;
+      this.curSelectedExamRecordDataId = examRecordDataId;
+      this.curSelectedRow(examRecordDataId);
+    },
+    changeExamRecordData(isNext) {
+      // console.log("isNext:" + isNext);
+      let curId = null;
+      let isFirst = false;
+      let isLast = false;
+      let rowSize = this.tableData.length;
+      for (let n = 0; n < rowSize; n++) {
+        isFirst = n === 0;
+        isLast = n === rowSize - 1;
+        let row = this.tableData[n];
+        if (this.curSelectedExamRecordDataId === row.examRecordDataId) {
+          curId = row.examRecordDataId;
+          if (isNext) {
+            if (!isLast) {
+              curId = this.tableData[n + 1].examRecordDataId;
+            } else {
+              // if (this.form.pageNo < this.curTotalPages) {
+              //   // 跳到下一页
+              //   curId = null;
+              //   this.handleCurrentChange(this.form.pageNo + 1);
+              // }
+              this.$message({
+                message: "当前数据为最后一条!",
+                type: "warning",
+                showClose: true,
+              });
+            }
+          } else {
+            if (!isFirst) {
+              curId = this.tableData[n - 1].examRecordDataId;
+            } else {
+              // if (this.form.pageNo > 1) {
+              //   // 跳到上一页
+              //   curId = null;
+              //   this.handleCurrentChange(this.form.pageNo - 1);
+              // }
+              this.$message({
+                message: "当前数据为第一条!",
+                type: "warning",
+                showClose: true,
+              });
+            }
+          }
+          break;
+        }
+      }
+
+      if (curId) {
+        this.curSelectedExamRecordDataId = curId;
+        this.curSelectedRow(curId);
+      } else {
+        this.examRecordDataDialogClose();
+      }
+    },
+    auditExamRecordData(isPass) {
+      console.log("isPass:" + isPass);
+    },
     gotoCaptureDetail(examRecordDataId) {
-      this.$router.push({
-        path: "/oe/captureDetail/" + examRecordDataId + "/alreadyAudited",
-      });
+      this.examRecordDataDialogOpen(examRecordDataId, false);
+      // this.$router.push({
+      //   path: "/oe/captureDetail/" + examRecordDataId + "/alreadyAudited",
+      // });
     },
     backFill() {
       var formData = this.$route.query;