Răsfoiți Sursa

批量重审

xiatian 3 ani în urmă
părinte
comite
c642e45a25
2 a modificat fișierele cu 290 adăugiri și 9 ștergeri
  1. 195 2
      src/modules/oe/views/alreadyAudited.vue
  2. 95 7
      src/modules/oe/views/examDetail.vue

+ 195 - 2
src/modules/oe/views/alreadyAudited.vue

@@ -169,6 +169,38 @@
             @click="exportData"
             >导出</el-button
           >
+          <el-dropdown
+            v-show="currentPagePrivileges.ALREADY_AUDITED_REDO_AUDIT"
+          >
+            <el-button
+              style="margin-left: 10px"
+              icon="el-icon-arrow-down"
+              type="primary"
+              :disabled="noBatchSelected"
+              size="small"
+              >重审</el-button
+            >
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="success"
+                  icon="el-icon-success"
+                  @click="redoAuditBatch('pass')"
+                  >通&nbsp;&nbsp;过</el-button
+                >
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="danger"
+                  icon="el-icon-error"
+                  @click="redoAuditBatch('nopass')"
+                  >不通过</el-button
+                >
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
         </el-col>
       </el-row>
       <el-row class="margin-top-10">
@@ -181,6 +213,7 @@
             border
             @selection-change="handleSelectionChange"
           >
+            <el-table-column type="selection" width="40"></el-table-column>
             <el-table-column label="考试ID">
               <template slot-scope="scope">
                 <el-button
@@ -309,6 +342,53 @@
           </div>
         </el-col>
       </el-row>
+      <el-dialog
+        title="审核"
+        :visible.sync="dialogAuditFormVisible"
+        @closed="auditDialogClosed"
+      >
+        <el-form ref="redoAuditForm" :model="auditForm">
+          <el-form-item
+            label="违纪类型"
+            prop="illegallyTypeId"
+            :rules="[
+              { required: true, message: '请选择违纪类型', trigger: 'change' },
+            ]"
+          >
+            <el-select
+              v-model="auditForm.illegallyTypeId"
+              filterable
+              remote
+              :remote-method="getDisciplineTypeList"
+              clearable
+              placeholder="请选择"
+              size="small"
+              @clear="getDisciplineTypeList"
+            >
+              <el-option
+                v-for="item in disciplineTypeList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="详情描述" style="margin-top: 15px">
+            <el-input
+              v-model="auditForm.disciplineDetail"
+              type="textarea"
+              :autosize="{ minRows: 6, maxRows: 10 }"
+              placeholder="请输入内容"
+            ></el-input>
+          </el-form-item>
+          <div class="dialog-footer margin-top-10 text-center">
+            <el-button type="primary" @click="doRedoAuditNoPass"
+              >确 定</el-button
+            >
+            <el-button @click="dialogAuditFormVisible = false">取 消</el-button>
+          </div>
+        </el-form>
+      </el-dialog>
     </el-main>
   </el-container>
 </template>
@@ -368,16 +448,36 @@ export default {
       currentPagePrivileges: {
         INVIGILATE_AUDIT_STATUS: false, //数据状态
         SNAPSHOT_DETAILS: false, //详情查看
+        ALREADY_AUDITED_REDO_AUDIT: false, //重新审核
       },
       getPermissionStatus: false, //获取权限状态
       disciplineTypeList: [],
       startExamDatetimeRange: [],
       endExamDatetimeRange: [],
       auditExamDatetimeRange: [],
+      isOnlineExam: false,
+      dialogAuditFormVisible: false,
+      selectedIds: [],
+      auditForm: {
+        examRecordDataIds: [],
+        illegallyTypeId: null,
+        disciplineDetail: "",
+        isPass: null,
+      },
     };
   },
   computed: {
     ...mapState({ user: (state) => state.user }),
+    noBatchSelected() {
+      if (!this.isOnlineExam) {
+        return true;
+      }
+      if (this.selectedIds.length === 0) {
+        return true;
+      } else {
+        return false;
+      }
+    },
   },
   watch: {
     //监控权限是否获取完成
@@ -396,6 +496,91 @@ export default {
     this.getDisciplineTypeList("");
   },
   methods: {
+    doRedoAuditNoPass() {
+      this.$refs["redoAuditForm"].validate((valid) => {
+        if (valid) {
+          var redoAuditInfo = {
+            examRecordDataIds: this.auditForm.examRecordDataIds,
+            isPass: false,
+            illegallyTypeId: this.auditForm.illegallyTypeId,
+            disciplineDetail: this.auditForm.disciplineDetail,
+          };
+          this.$http
+            .post("/api/ecs_oe_admin/exam/audit/redoAudit", redoAuditInfo)
+            .then(() => {
+              this.$notify({
+                title: "成功",
+                message: "操作成功",
+                type: "success",
+              });
+              this.doRedoAuditNoPassPostProcess();
+              this.search();
+            })
+            .catch((res) => {
+              var errorMsg = "操作失败";
+              if (res.response && res.response.data) {
+                errorMsg = res.response.data.desc;
+              }
+              this.doRedoAuditNoPassPostProcess();
+              this.$notify({
+                title: "提示",
+                message: errorMsg,
+                type: "error",
+              });
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    doRedoAuditNoPassPostProcess() {
+      this.auditForm = {
+        examRecordDataId: null,
+        illegallyTypeId: null,
+        disciplineDetail: "",
+        isPass: null,
+      };
+      this.$refs["redoAuditForm"].resetFields();
+      this.dialogAuditFormVisible = false;
+    },
+    auditDialogClosed() {
+      this.$refs["redoAuditForm"].resetFields();
+    },
+    redoAuditBatch(isPass) {
+      this.auditForm.examRecordDataIds = this.selectedIds;
+      if (isPass != "pass") {
+        this.dialogAuditFormVisible = true;
+      } else {
+        //审核通过
+        var redoAuditInfo = {
+          examRecordDataIds: this.auditForm.examRecordDataIds,
+          isPass: true,
+          illegallyTypeId: null,
+          disciplineDetail: "",
+        };
+        this.$http
+          .post("/api/ecs_oe_admin/exam/audit/redoAudit", redoAuditInfo)
+          .then(() => {
+            this.$notify({
+              title: "成功",
+              message: "操作成功",
+              type: "success",
+            });
+            this.search();
+          })
+          .catch((res) => {
+            var errorMsg = "操作失败";
+            if (res.response && res.response.data) {
+              errorMsg = res.response.data.desc;
+            }
+            this.$notify({
+              title: "提示",
+              message: errorMsg,
+              type: "error",
+            });
+          });
+      }
+    },
     resetForm() {
       this.form = {
         examRecordDataId: null,
@@ -478,8 +663,16 @@ export default {
     selectable(row) {
       return row.isWarn;
     },
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
+    handleSelectionChange(row) {
+      this.selectedIds = [];
+      row.forEach((element) => {
+        if (element.examType == "ONLINE") {
+          this.isOnlineExam = true;
+        } else {
+          this.isOnlineExam = false;
+        }
+        this.selectedIds.push(element.examRecordDataId);
+      });
     },
     /**
      * pagesize改变时触发

+ 95 - 7
src/modules/oe/views/examDetail.vue

@@ -103,16 +103,47 @@
         >
       </el-col>
       <el-row>
-        <el-col v-show="currentPagePrivileges.EXAM_DETAIL_EXPORT">
+        <el-col>
           <div class="block-seperator"></div>
           <span>操作:</span>
           <el-button
+            v-show="currentPagePrivileges.EXAM_DETAIL_EXPORT"
             type="primary"
             size="small"
             icon="el-icon-download"
             @click="exportData"
             >导出</el-button
           >
+          <el-dropdown v-show="currentPagePrivileges.REDO_AUDIT">
+            <el-button
+              style="margin-left: 10px"
+              icon="el-icon-arrow-down"
+              type="primary"
+              :disabled="noBatchSelected"
+              size="small"
+              >重审</el-button
+            >
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="success"
+                  icon="el-icon-success"
+                  @click="redoAuditBatch('pass')"
+                  >通&nbsp;&nbsp;过</el-button
+                >
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="danger"
+                  icon="el-icon-error"
+                  @click="redoAuditBatch('nopass')"
+                  >不通过</el-button
+                >
+              </el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
         </el-col>
       </el-row>
       <el-row class="margin-top-10">
@@ -125,6 +156,7 @@
             border
             @selection-change="handleSelectionChange"
           >
+            <el-table-column type="selection" width="40"></el-table-column>
             <el-table-column label="考试ID" width="120">
               <template slot-scope="scope">
                 <el-button
@@ -476,6 +508,8 @@ export default {
   mixins: [pagePrivilege],
   data() {
     return {
+      isOnlineExam: false,
+      selectedIds: [],
       disciplineTypeList: [],
       total: 0,
       tableLoading: false,
@@ -530,7 +564,7 @@ export default {
       },
       dialogAuditFormVisible: false,
       auditForm: {
-        examRecordDataId: null,
+        examRecordDataIds: [],
         illegallyTypeId: null,
         disciplineDetail: "",
         isPass: null,
@@ -539,6 +573,16 @@ export default {
   },
   computed: {
     ...mapState({ user: (state) => state.user }),
+    noBatchSelected() {
+      if (!this.isOnlineExam) {
+        return true;
+      }
+      if (this.selectedIds.length === 0) {
+        return true;
+      } else {
+        return false;
+      }
+    },
   },
   created() {
     this.form.rootOrgId = this.user.rootOrgId;
@@ -644,8 +688,16 @@ export default {
           });
         });
     },
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
+    handleSelectionChange(row) {
+      this.selectedIds = [];
+      row.forEach((element) => {
+        if (element.examType == "ONLINE") {
+          this.isOnlineExam = true;
+        } else {
+          this.isOnlineExam = false;
+        }
+        this.selectedIds.push(element.dataId);
+      });
     },
     /**
      * pagesize改变时触发
@@ -733,13 +785,49 @@ export default {
       }
     },
     redoAudit(examRecordDataId, isPass) {
+      this.auditForm.examRecordDataIds = [];
+      this.auditForm.examRecordDataIds.push(examRecordDataId);
+      if (isPass != "pass") {
+        this.dialogAuditFormVisible = true;
+      } else {
+        //审核通过
+        var redoAuditInfo = {
+          examRecordDataIds: this.auditForm.examRecordDataIds,
+          isPass: true,
+          illegallyTypeId: null,
+          disciplineDetail: "",
+        };
+        this.$http
+          .post("/api/ecs_oe_admin/exam/audit/redoAudit", redoAuditInfo)
+          .then(() => {
+            this.$notify({
+              title: "成功",
+              message: "操作成功",
+              type: "success",
+            });
+            this.search();
+          })
+          .catch((res) => {
+            var errorMsg = "操作失败";
+            if (res.response && res.response.data) {
+              errorMsg = res.response.data.desc;
+            }
+            this.$notify({
+              title: "提示",
+              message: errorMsg,
+              type: "error",
+            });
+          });
+      }
+    },
+    redoAuditBatch(isPass) {
+      this.auditForm.examRecordDataIds = this.selectedIds;
       if (isPass != "pass") {
         this.dialogAuditFormVisible = true;
-        this.auditForm.examRecordDataId = examRecordDataId;
       } else {
         //审核通过
         var redoAuditInfo = {
-          examRecordDataIds: [examRecordDataId],
+          examRecordDataIds: this.auditForm.examRecordDataIds,
           isPass: true,
           illegallyTypeId: null,
           disciplineDetail: "",
@@ -771,7 +859,7 @@ export default {
       this.$refs["redoAuditForm"].validate((valid) => {
         if (valid) {
           var redoAuditInfo = {
-            examRecordDataIds: [this.auditForm.examRecordDataId],
+            examRecordDataIds: this.auditForm.examRecordDataIds,
             isPass: false,
             illegallyTypeId: this.auditForm.illegallyTypeId,
             disciplineDetail: this.auditForm.disciplineDetail,