ソースを参照

增加通过后返回审核

谢杰标 3 年 前
コミット
08cd801c01

+ 10 - 0
src/api/education/classManageMent.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+// 通过打回二审状态
+export function rollBackPeriod(data) {
+    return request({
+        url: `/grade/grade/confirm/rollbackPeriod`,
+        method: 'post',
+        data
+    })
+}

+ 10 - 7
src/views/education/classManageMent/classHoursReview/component/LessonTable.vue

@@ -42,9 +42,9 @@
             <div
               class="styFlex"
               v-if="
-                (userData.periodStatus === 0 ||
-                  userData.periodStatus === 2 ||
-                  userData.periodStatus === 3) &&
+                (periodStatus === 0 ||
+                  periodStatus === 2 ||
+                  periodStatus === 3) &&
                 scope.row.periodStatus === 1
               "
             >
@@ -53,7 +53,7 @@
                   class="checkboxList"
                   :label="scope.row.periodStatusId"
                   :disabled="
-                    userData.periodStatus === 3
+                    periodStatus === 3
                       ? false
                       : scope.row.status !== 2
                       ? true
@@ -177,7 +177,7 @@ export default {
       },
     },
   },
-  inject: ["userData", "getUserInfo"],
+  inject: ["getPeriodStatus", "getUserInfo"],
   data() {
     return {
       tableSet: [
@@ -336,8 +336,11 @@ export default {
       }
     },
   },
-  created() {},
-  mounted() {},
+  computed: {
+    periodStatus() {
+      return this.getPeriodStatus();
+    },
+  },
   components: {
     CheatDialog,
   },

+ 42 - 13
src/views/education/classManageMent/classHoursReview/component/StudyTables.vue

@@ -40,7 +40,7 @@
           <div class="num_style" style="color: #0047d0">
             {{
               ["不可审核", "未通过", "通过审核", "待审核", "审核中"][
-                userData.periodStatus + 1
+                periodStatus + 1
               ]
             }}
           </div>
@@ -48,9 +48,8 @@
         </div>
       </div>
       <div class="s_sd">
-        <span v-if="userData.periodStatus !== 3">
+        <template v-if="periodStatus === 2">
           <el-checkbox
-            v-if="userData.periodStatus === 2"
             :disabled="!allIds.length"
             :indeterminate="isIndeterminate"
             v-model="checkAll"
@@ -61,26 +60,29 @@
             style="margin-left: 10px"
             size="mini"
             type="success"
-            v-if="userData.periodStatus === 2"
             @click="getChangeStatus(1)"
             >勾选通过</el-button
           >
-          <el-button
-            size="mini"
-            type="danger"
-            v-if="userData.periodStatus === 2"
-            @click="getChangeStatus(2)"
+          <el-button size="mini" type="danger" @click="getChangeStatus(2)"
             >勾选作弊</el-button
           >
-        </span>
-        <span v-else>
+        </template>
+
+        <template v-if="periodStatus === 3">
           <el-button style="margin-left: 10px" size="mini" @click="checkBack"
             >勾选数据,打回待审核状态</el-button
           >
           <el-button size="mini" type="warning" @click="approvedOK = true"
             >确认审核通过结果</el-button
           >
-        </span>
+        </template>
+        <el-button
+          v-if="periodStatus === 1"
+          style="margin-left: 10px"
+          size="mini"
+          @click="backToAudit"
+          >打回待审核状态</el-button
+        >
       </div>
     </div>
     <div class="tablesBoxs">
@@ -177,6 +179,7 @@ import ModulTable from "./ModulTable.vue";
 import ChapterTable from "./ChapterTable.vue";
 import LessonTable from "./LessonTable.vue";
 import CheatDialog from "./CheatDialog.vue";
+import { rollBackPeriod } from "@/api/education/classManageMent";
 export default {
   props: {
     tablesData: {
@@ -204,7 +207,7 @@ export default {
   },
   provide() {
     return {
-      userData: this.userData,
+      getPeriodStatus: () => this.periodStatus,
       getUserInfo: this.getUserInfo,
     };
   },
@@ -410,6 +413,27 @@ export default {
       let box = document.querySelector(".tablesBoxs");
       box.style.height = window.innerHeight - box.offsetTop - 190 + "px";
     },
+    backToAudit() {
+      this.$confirm("此操作将打回审核状态, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          rollBackPeriod({ orderGoodsId: this.userData.orderGoodsId }).then(
+            (res) => {
+              this.getUserInfo(true);
+              this.$message.success("已打回待审核状态");
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
   },
   mounted() {
     let that = this;
@@ -440,6 +464,11 @@ export default {
       deep: true,
     },
   },
+  computed: {
+    periodStatus() {
+      return this.userData.periodStatus;
+    },
+  },
 };
 </script>
 

+ 2 - 2
src/views/resource/bankManagement/testPaperManagement/index.vue

@@ -248,7 +248,7 @@ export default {
         });
         return;
       }
-      if (int === 1 ||int === 2) {
+      if (int === 1 || int === 2) {
         const jump = () => {
           this.$store.dispatch("changetestPaperPage", null);
           this.$router.push({
@@ -256,7 +256,7 @@ export default {
             query: {
               id: v.examId,
               code: v.code,
-              name:int
+              name: int,
             },
           });
         };