xvying 1 year ago
parent
commit
200ba8648a

+ 7 - 4
src/views/kaohe/checkList.vue

@@ -3,7 +3,7 @@
  * @Author: 旭颖
  * @Date: 2023-03-22 10:15:16
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2023-03-23 16:02:44
+ * @LastEditTime: 2023-03-24 15:34:53
 -->
 <template>
   <div class="index-home" v-loading.fullscreen.lock="loadingFull">
@@ -34,7 +34,9 @@
         align="center"
       >
         <template #default="{ row }">
-          <el-button type="primary" plain size="mini" @click="lookDetail(row)">学生列表</el-button>
+          <el-button type="primary" plain size="mini" @click="lookDetail(row)"
+            >学生列表</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
@@ -68,11 +70,12 @@ export default {
         path: "/kaohe/uploadList",
         query: {
           id: row.id,
-          type:row.type
+          type: row.type,
+          name: row.name,
         },
       });
     },
-    lookDetailList(row){
+    lookDetailList(row) {
       this.$router.push({
         path: "/kaohe/rewardList",
         query: {

+ 8 - 4
src/views/kaohe/components/checkOut.vue

@@ -3,7 +3,7 @@
  * @Author: 旭颖
  * @Date: 2023-03-22 11:54:21
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2023-03-23 20:24:03
+ * @LastEditTime: 2023-03-24 17:15:15
 -->
 <template>
   <el-dialog
@@ -42,6 +42,7 @@ export default {
       form: { id: "", examine_question_id: "", check_status: 2 },
       id: "",
       type: 1,
+      is_single: 1, //是否单个审核
       rules: {
         check_status: [
           {
@@ -52,6 +53,7 @@ export default {
         ],
         check_point: [{ required: true, message: "审核分支", trigger: "blur" }],
       },
+      examine_lists_id: "",
     };
   },
   methods: {
@@ -59,9 +61,10 @@ export default {
       let route = this.$route.query;
       if (row.type == 2) {
         this.type = row.type;
-        this.id = row.examine_id;
-        this.form.examine_question_id = route.id;
+        this.id = row.id;
+        this.form.examine_question_id = route.examine_question_id;
         this.form.id = row.examine_id;
+        this.form.is_single = row.is_single;
         this.dialogVisible = true;
       } else {
         this.form.examine_question_id = route.examine_question_id;
@@ -81,7 +84,7 @@ export default {
           };
           this.form.examine_lists = [obj];
           delete this.form.check_point;
-          // delete this.form.check_status;
+          delete this.form.check_status;
         }
         if (valid) {
           const { message } = await checkOut(this.form);
@@ -92,6 +95,7 @@ export default {
       });
     },
     handleClose() {
+      this.form = { id: "", examine_question_id: "", check_status: 2 };
       this.dialogVisible = false;
     },
   },

+ 22 - 4
src/views/kaohe/components/detail.vue

@@ -3,7 +3,7 @@
  * @Author: 旭颖
  * @Date: 2023-03-22 11:54:21
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2023-03-23 20:20:02
+ * @LastEditTime: 2023-03-24 17:08:43
 -->
 <template>
   <el-drawer
@@ -13,9 +13,18 @@
     :before-close="handleClose"
   >
     <div class="tab-body" style="overflow: auto">
-      <iframe :src="fileList[0].url" height="900px" width="100%" />
+      <iframe
+        v-if="fileList && fileList.length > 0"
+        :src="fileList[0].url"
+        height="900px"
+        width="100%"
+      />
 
-      <div class="button" @click="doCheck" v-if="detail.check_status == 1">
+      <div
+        class="button"
+        @click="doCheck"
+        v-if="detail.check_status == 1 && can_check"
+      >
         审核
       </div>
     </div>
@@ -45,6 +54,7 @@ export default {
       detail: {},
       point: 0,
       fileList: [],
+      can_check: false,
     };
   },
   methods: {
@@ -54,13 +64,20 @@ export default {
         type: 2,
         examine_id: this.examine_id,
         point: this.point,
+        id: this.detail.id,
+        is_single: 1,
       });
     },
     handleClose() {
       this.dialogVisible = false;
     },
     async showEdit(row) {
-      this.examine_id = row.id;
+      let route = this.$route.query;
+      let roles = this.$store.state.user.roles;
+      if (roles.includes("Super admin") || roles.includes("Admin")) {
+        this.can_check = true;
+      }
+      this.examine_id = route.id;
       this.detail = row;
       let data1 = row.resources;
       this.point = row.point;
@@ -97,5 +114,6 @@ export default {
   border-radius: 50%;
   background-color: rgb(230, 88, 22);
   text-align: center;
+  cursor: pointer;
 }
 </style>

+ 86 - 22
src/views/kaohe/fileDetail.vue

@@ -3,7 +3,7 @@
  * @Author: 旭颖
  * @Date: 2023-03-22 11:54:21
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2023-03-23 20:06:09
+ * @LastEditTime: 2023-03-24 17:18:08
 -->
 <template>
   <div class="tab-body" style="overflow: auto">
@@ -11,14 +11,16 @@
     <div class="tips">
       <span>姓名:{{ detail.staff ? detail.staff.true_name : "--" }}</span>
       <span>学号:{{ detail.staff ? detail.staff.no : "--" }}</span>
-      <span>班级:{{ detail.staff ? detail.staff.class : "--" }}</span>
+      <span>班级:{{ detail.staff ? detail.staff.class : "--" }}</span>
       <span>支部:{{ detail.staff ? detail.staff.class : "--" }}</span>
-      <span>分支:{{ detail.staff ? detail.staff.class : "--" }}</span>
+      <span
+        >分值:<span style="color: red">{{ detail.point || "--" }}</span></span
+      >
     </div>
     <div class="check">
       <span
         >审核状态:<el-tag
-          v-if="detail.check_status == 0"
+          v-if="detail.check_status == 1"
           type="primary"
           size="mini"
           >待审核</el-tag
@@ -40,10 +42,22 @@
       </span>
     </div>
 
-    <iframe :src="fileList[0].url" height="900px" width="100%" />
-
-    <!-- v-if="detail.check_status == 1" -->
-    <div class="button" @click="doCheck">审核</div>
+    <iframe
+      v-if="fileList && fileList.length > 0"
+      :src="fileList[0].url"
+      height="900px"
+      width="100%"
+    />
+    <div
+      v-if="detail.check_status == 1 && can_check"
+      class="button"
+      @click="doCheck"
+    >
+      审核
+    </div>
+    <div v-if="can_check" class="button change-page" @click="lastOne">
+      下一个
+    </div>
     <checkOut ref="check-out" @handle-close="handleClose" />
   </div>
 </template>
@@ -70,24 +84,27 @@ export default {
       name: "",
       examine_question_id: "",
       id: "",
+      can_check: false,
+      type: 2, //当前信息
+      examine_id: "",
     };
   },
   created() {
+    let roles = this.$store.state.user.roles;
+    if (roles.includes("Super admin") || roles.includes("Admin")) {
+      this.can_check = true;
+    }
     let route = this.$route.query;
     this.name = route.name;
-    this.type = route.type;
-    console.log(route, "routerouterouteroute");
     this.id = route.id;
+    let role = route.role;
     this.examine_question_id = route.examine_question_id;
-    if (this.type == 1) {
-      this.getDetail(route.examine_question_id);
+    if (role == "admin") {
+      this.examine_id = route.examine_id;
+      this.getDetailStu();
     } else {
-      let data = {
-        type: route.type,
-        examine_question_id: route.examine_question_id,
-        examine_id: route.id,
-      };
-      this.getDetailStu(route.id);
+      this.type = route.type;
+      this.getDetail(route.examine_question_id);
     }
   },
   methods: {
@@ -118,10 +135,43 @@ export default {
       this.fileList = arr;
       console.log(data, "shujushushsu");
     },
-    async getDetailStu(id) {
-      const { data } = await examineDetail({ id: id });
-      console.log(data, "llll");
+    async getDetailStu() {
+      let route = this.$route.query;
+      let row = {
+        // type: route.type,
+        type: this.type,
+        examine_question_id: route.examine_question_id,
+        examine_id: this.examine_id,
+      };
+      const { data } = await examineDetail(row);
+      if (data.id) {
+        this.detail = data;
+        this.examine_id = data.id;
+        let data1 = data.resources;
+        this.point = data.point;
+        let arr = [];
+        for (let key in data1) {
+          arr.push({
+            id: key,
+            url: data1[key],
+          });
+        }
+        this.fileList = arr;
+      } else {
+        this.$message.warning("当前已是最后一条!");
+      }
+    },
+    //上一个
+    lastOne() {
+      this.type = 1;
+      this.getDetailStu();
     },
+    // //下一个
+    // nextOne() {
+    //   this.type = 1;
+    //   this.examine_id = detail.id;
+    //   this.getDetailStu();
+    // },
   },
 };
 </script>
@@ -140,6 +190,10 @@ export default {
     font-size: 14px;
     text-align: center;
     margin-bottom: 10px;
+    span {
+      display: inline-block;
+      margin-right: 20px;
+    }
   }
   .check {
     background-color: #ffe4e4ea;
@@ -148,12 +202,13 @@ export default {
     padding: 10px 0;
     text-align: center;
     span {
+      display: inline-block;
       margin-right: 20px;
     }
   }
   .button {
     position: fixed;
-    bottom: 15vh;
+    bottom: 40vh;
     right: 30px;
     height: 70px;
     width: 70px;
@@ -165,6 +220,15 @@ export default {
     border-radius: 50%;
     background-color: rgb(230, 88, 22);
     text-align: center;
+    cursor: pointer;
+  }
+  .change-page {
+    bottom: 30vh;
+    background-color: rgb(74, 172, 252);
+  }
+  .change-page-1 {
+    bottom: 20vh;
+    background-color: rgb(74, 172, 252);
   }
 }
 </style>

+ 23 - 7
src/views/kaohe/rewardList.vue

@@ -3,7 +3,7 @@
  * @Author: 旭颖
  * @Date: 2023-03-22 10:15:16
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2023-03-23 20:13:07
+ * @LastEditTime: 2023-03-24 16:44:45
 -->
 <template>
   <div class="index-home" v-loading.fullscreen.lock="loadingFull">
@@ -79,7 +79,7 @@
   </div>
 </template>
 <script>
-import { fileDetailStu } from "./api/index";
+import { examineDetail, fileDetailStu } from "./api/index";
 import checkOut from "./components/checkOut";
 import detail from "./components/detail";
 export default {
@@ -89,7 +89,7 @@ export default {
   },
   data() {
     return {
-      type: 1,
+      type: 2,
       totalPage: 0,
       searchParams: {
         page: 1,
@@ -102,10 +102,12 @@ export default {
   },
   created() {
     let route = this.$route.query;
-    console.log(route, "routerouterouteroute");
-    this.type = 2;
-    this.examine_question_id = route.id;
-    this.getList(route.id);
+    let role = route.role;
+    if (role == "admin") {
+      this.getListAdmin();
+    } else {
+      this.getList(route.id);
+    }
   },
   methods: {
     //审核
@@ -130,6 +132,20 @@ export default {
       // });
     },
     //学生提交列表
+    async getListAdmin() {
+      this.loadingFull = true;
+      let route = this.$route.query;
+      let params = {
+        type: this.type,
+        examine_question_id: route.examine_question_id,
+        examine_id: route.id,
+      };
+      const { data } = await examineDetail(params);
+      this.tableData = data.lists;
+      // this.totalPage = data.meta.pagination.total;
+      this.loadingFull = false;
+    },
+    //学生提交列表
     async getList(id) {
       this.loadingFull = true;
       const { data } = await fileDetailStu({ examine_question_id: id });

+ 45 - 15
src/views/kaohe/uploadList.vue

@@ -3,7 +3,7 @@
  * @Author: 旭颖
  * @Date: 2023-03-22 10:15:16
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2023-03-23 18:26:18
+ * @LastEditTime: 2023-03-24 16:43:40
 -->
 <template>
   <div class="index-home" v-loading.fullscreen.lock="loadingFull">
@@ -38,12 +38,11 @@
           {{ row.organization ? row.organization.name : "--" }}
         </template>
       </el-table-column>
-      <el-table-column
-        prop="point"
-        label="分值"
-        min-width="100"
-        align="center"
-      />
+      <el-table-column prop="point" label="分值" min-width="100" align="center">
+        <template #default="{ row }">
+          {{ row.point ? row.point : row.xm_point }}
+        </template>
+      </el-table-column>
       <el-table-column
         prop="check_status"
         label="审核状态"
@@ -51,9 +50,18 @@
         align="center"
       >
         <template #default="{ row }">
-          <el-tag type="primary" v-if="row.check_status == 1">待审核</el-tag>
-          <el-tag type="success" v-if="row.check_status == 2">审核成功</el-tag>
-          <el-tag type="danger" v-if="row.check_status == 3">审核失败</el-tag>
+          <span v-if="row.check_status">
+            <el-tag type="primary" v-if="row.check_status == 1">待审核</el-tag>
+            <el-tag type="success" v-if="row.check_status == 2"
+              >审核成功</el-tag
+            >
+            <el-tag type="danger" v-if="row.check_status == 3">审核失败</el-tag>
+          </span>
+          <span v-else>
+            <el-tag type="primary" v-if="row.xm_status == 1">待审核</el-tag>
+            <el-tag type="success" v-if="row.xm_status == 2">审核成功</el-tag>
+            <el-tag type="danger" v-if="row.xm_status == 3">审核失败</el-tag>
+          </span>
         </template>
       </el-table-column>
       <el-table-column
@@ -76,7 +84,7 @@
             v-if="type == 2"
             plain
             size="mini"
-            @click="lookDetail(row)"
+            @click="lookDetailList(row)"
             >查看</el-button
           >
           <el-button
@@ -132,7 +140,7 @@ export default {
   },
   created() {
     let route = this.$route.query;
-    console.log(route, "routerouterouteroute");
+
     this.type = route.type;
     this.getList(route.id);
   },
@@ -141,13 +149,36 @@ export default {
     checkOutStu() {
       this.$refs["check-out"].showEdit({
         type: this.type,
-        examine_id: row.id,
+        examine_id: row.examine_id,
         point: row.point,
       });
     },
     //查看详情
     lookDetail(row) {
-      this.$refs["detail"].showEdit(row);
+      let route = this.$route.query;
+      this.$router.push({
+        path: "/kaohe/fileDetail",
+        query: {
+          examine_id: row.examine_id,
+          id: row.id,
+          examine_question_id: route.id,
+          name: route.name,
+          type: route.type,
+          role: "admin",
+        },
+      });
+    },
+    lookDetailList(row) {
+      let route = this.$route.query;
+      this.$router.push({
+        path: "/kaohe/rewardList",
+        query: {
+          id: row.id,
+          examine_question_id: route.id,
+          role: "admin",
+          // staff_id: row.staff ? row.staff.id : 0,
+        },
+      });
     },
     //学生提交列表
     async getList(id) {
@@ -155,7 +186,6 @@ export default {
       const { data } = await examList({ examine_question_id: id });
       this.tableData = data.data;
       this.totalPage = data.meta.pagination.total;
-
       this.loadingFull = false;
     },
     //返回考核列表