Browse Source

12/04 15:53

111
mo 4 years ago
parent
commit
0a1b50fc9c
3 changed files with 257 additions and 192 deletions
  1. 2 0
      .gitignore
  2. 0 3
      debug.log
  3. 255 189
      src/views/workBenchManager/payAppeal.vue

+ 2 - 0
.gitignore

@@ -13,3 +13,5 @@ tests/**/coverage/
 *.ntvs*
 *.njsproj
 *.sln
+debug.log
+*.log

+ 0 - 3
debug.log

@@ -1,3 +0,0 @@
-[1202/094138.882:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
-[1203/094453.892:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
-[1204/095137.834:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

+ 255 - 189
src/views/workBenchManager/payAppeal.vue

@@ -2,178 +2,220 @@
 <template>
   <div class="m-container">
     <h2>
-      <div class="squrt"></div>课时申诉
+      <div class="squrt"></div>
+      考勤申诉
     </h2>
     <div class="m-core">
-      <el-form :inline="true"
-               :model="searchForm">
+      <el-form :inline="true" :model="searchForm">
         <el-form-item>
-          <el-input v-model.trim="searchForm.search"
-                    @keyup.enter.native="search"
-                    placeholder='老师名称'></el-input>
+          <el-input
+            v-model.trim="searchForm.search"
+            @keyup.enter.native="search"
+            placeholder="老师名称"
+          ></el-input>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.organId"
-                     clearable
-                     filterable
-                     placeholder="请选择分部">
-            <el-option v-for="(item,index) in organList"
-                       :key="index"
-                       :label="item.name"
-                       :value="item.id"></el-option>
+          <el-select
+            v-model.trim="searchForm.organId"
+            clearable
+            filterable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item, index) in organList"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-select v-model.trim="searchForm.complaintsStatus"
-                     clearable
-                     filterable
-                     placeholder="申诉状态">
-            <el-option label="已拒绝"
-                       :value="0"></el-option>
-            <el-option label="已通过"
-                       :value="1"></el-option>
-            <el-option label="待处理"
-                       :value="2"></el-option>
-            <el-option label="已撤销"
-                       :value="3"></el-option>
+          <el-select
+            v-model.trim="searchForm.complaintsStatus"
+            clearable
+            filterable
+            placeholder="申诉状态"
+          >
+            <el-option label="已拒绝" :value="0"></el-option>
+            <el-option label="已通过" :value="1"></el-option>
+            <el-option label="待处理" :value="2"></el-option>
+            <el-option label="已撤销" :value="3"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-date-picker v-model.trim="searchForm.timer"
-                          style="width:400px;"
-                          type="daterange"
-                          value-format="yyyy-MM-dd"
-                          range-separator="至"
-                          start-placeholder="课程开始日期"
-                          end-placeholder="课程结束日期"
-                          :picker-options="{
-        firstDayOfWeek: 1
-    }"></el-date-picker>
+          <el-date-picker
+            v-model.trim="searchForm.timer"
+            style="width: 400px"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            start-placeholder="课程开始日期"
+            end-placeholder="课程结束日期"
+            :picker-options="{
+              firstDayOfWeek: 1,
+            }"
+          ></el-date-picker>
         </el-form-item>
         <el-form-item>
-          <el-button type="danger"
-                     @click="search">搜索</el-button>
-          <el-button @click="onReSet"
-                     type="primary">重置</el-button>
+          <el-button type="danger" @click="search">搜索</el-button>
+          <el-button @click="onReSet" type="primary">重置</el-button>
         </el-form-item>
       </el-form>
       <div class="tableWrap">
-        <el-table style="width: 100%"
-                  :header-cell-style="{background:'#EDEEF0',color:'#444'}"
-                  :data="tableList">
-          <el-table-column align="center"
-                           prop="organName"
-                           label="分部"></el-table-column>
-          <el-table-column align="center"
-                           prop="courseScheduleId"
-                           label="课程编号"></el-table-column>
-          <el-table-column align="center"
-                           prop="courseScheduleName"
-                           label="课程名称"></el-table-column>
-          <el-table-column align="center"
-                           width="180"
-                           prop="courseScheduleTime"
-                           label="课程时间">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column
+            align="center"
+            prop="organName"
+            label="分部"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="courseScheduleId"
+            label="课程编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="courseScheduleName"
+            label="课程名称"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            width="180"
+            prop="courseScheduleTime"
+            label="课程时间"
+          >
             <template slot-scope="scope">
               <div>
-                <p>{{scope.row.courseScheduleTime}} {{ scope.row.courseScheduleStartTime | timerForMinFormat }}-{{scope.row.courseScheduleEndTime | timerForMinFormat    }}</p>
+                <p>
+                  {{ scope.row.courseScheduleTime }}
+                  {{ scope.row.courseScheduleStartTime | timerForMinFormat }}-{{
+                    scope.row.courseScheduleEndTime | timerForMinFormat
+                  }}
+                </p>
               </div>
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="status"
-                           label="签到状态">
+          <el-table-column align="center" prop="status" label="签到状态">
             <template slot-scope="scope">
               <div>
-                <p>{{scope.row.signInStatus | attendanceType  }}</p>
+                <p>{{ scope.row.signInStatus | attendanceType }}</p>
               </div>
             </template>
           </el-table-column>
-          <el-table-column align='center'
-                           prop="status"
-                           label="签退状态">
+          <el-table-column align="center" prop="status" label="签退状态">
             <template slot-scope="scope">
               <div>
-                <p>{{scope.row.signOutStatus | attendanceOutType  }}</p>
+                <p>{{ scope.row.signOutStatus | attendanceOutType }}</p>
               </div>
             </template>
           </el-table-column>
-          <el-table-column align="center"
-                           prop="teacherName"
-                           label="老师名称"></el-table-column>
-          <el-table-column align="center"
-                           prop="studentId"
-                           label="状态">
+          <el-table-column
+            align="center"
+            prop="teacherName"
+            label="老师名称"
+          ></el-table-column>
+          <el-table-column align="center" prop="studentId" label="状态">
             <template slot-scope="scope">
               <div>
-                {{scope.row.complaintsStatusEnum|complaintsStatusEnum}}
+                {{ scope.row.complaintsStatusEnum | complaintsStatusEnum }}
               </div>
             </template>
           </el-table-column>
-          <el-table-column align="center"
-                           prop="operatorName"
-                           label="申诉处理者"></el-table-column>
-          <el-table-column align="center"
-                           label="操作">
+          <el-table-column
+            align="center"
+            prop="operatorName"
+            label="申诉处理者"
+          ></el-table-column>
+          <el-table-column align="center" label="操作">
             <!-- teacherAttendance/agreeTeacherAttendanceComplaints -->
             <template slot-scope="scope">
               <div>
-                <el-button type="text"
-                           v-if="permission('teacherAttendance/operation')"
-                           @click="lookDetail(scope.row)">操作</el-button>
+                <el-button
+                  type="text"
+                  v-if="permission('teacherAttendance/operation')"
+                  @click="lookDetail(scope.row)"
+                  >操作</el-button
+                >
               </div>
             </template>
           </el-table-column>
         </el-table>
-        <pagination :total="rules.total"
-                    :page.sync="rules.page"
-                    :limit.sync="rules.limit"
-                    :page-sizes="rules.page_size"
-                    @pagination="getList" />
+        <pagination
+          :total="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
       </div>
     </div>
-    <el-dialog title="考勤申诉"
-               :visible.sync="dialogVisible"
-               width="400px">
+    <el-dialog title="考勤申诉" :visible.sync="dialogVisible" width="400px">
       <div>
         <div class="titleP">
-          <p>签到时间:{{visibleForm.signInTime}}</p>
-          <p>签退时间:{{visibleForm.signOutTime}}</p>
+          <p>签到时间:{{ visibleForm.signInTime }}</p>
+          <p>签退时间:{{ visibleForm.signOutTime }}</p>
         </div>
-        <el-form ref="visibleForm"
-                 :model="visibleForm"
-                 class="visibleForm">
-          <el-form-item label="申诉内容"
-                        :rules="[{ required: true, message: '请填写申诉内容',trigger: 'blur'}]"
-                        prop="complaintsContent">
-            <el-input type="textarea"
-                      :rows="5"
-                      :disabled="visibleForm.complaintsStatusEnum !='2'"
-                      v-model.trim="visibleForm.complaintsContent"></el-input>
+        <el-form ref="visibleForm" :model="visibleForm" class="visibleForm">
+          <el-form-item
+            label="申诉内容"
+            :rules="[
+              { required: true, message: '请填写申诉内容', trigger: 'blur' },
+            ]"
+            prop="complaintsContent"
+          >
+            <el-input
+              type="textarea"
+              :rows="5"
+              :disabled="visibleForm.complaintsStatusEnum != '2'"
+              v-model.trim="visibleForm.complaintsContent"
+            ></el-input>
           </el-form-item>
-          <el-form-item label="处理意见"
-                        :rules="[{ required: true, message: '请填写处理意见',trigger: 'blur'}]"
-                        prop="disposeContent">
-            <el-input type="textarea"
-                      :rows="5"
-                      :disabled="visibleForm.complaintsStatusEnum !='2'"
-                      v-model.trim="visibleForm.disposeContent"></el-input>
+          <el-form-item
+            label="处理意见"
+            :rules="[
+              { required: true, message: '请填写处理意见', trigger: 'blur' },
+            ]"
+            prop="disposeContent"
+          >
+            <el-input
+              type="textarea"
+              :rows="5"
+              :disabled="visibleForm.complaintsStatusEnum != '2'"
+              v-model.trim="visibleForm.disposeContent"
+            ></el-input>
           </el-form-item>
-          <el-form-item label="请选择需要补正的状态"
-                        v-if="visibleForm.complaintsStatusEnum =='2'">
+          <!--  -->
+          <el-form-item label="请选择需要补正的状态">
             <br />
-            <el-checkbox v-model="visibleForm.reSignInStatus">签到状态</el-checkbox>
-            <el-checkbox v-model="visibleForm.reSignOutStatus">签退状态</el-checkbox>
+            <el-checkbox
+              v-model="visibleForm.reSignInStatus"
+              :disabled="visibleForm.complaintsStatusEnum != '2'"
+              >签到状态</el-checkbox
+            >
+            <el-checkbox
+              v-model="visibleForm.reSignOutStatus"
+              :disabled="visibleForm.complaintsStatusEnum != '2'"
+              >签退状态</el-checkbox
+            >
           </el-form-item>
         </el-form>
       </div>
-      <div slot="footer"
-           v-if="visibleForm.complaintsStatusEnum =='2'">
-        <el-button v-permission="'teacherAttendance/rejectTeacherAttendanceComplaints'"
-                   @click="subreset('DENIED')">拒绝</el-button>
-        <el-button v-permission="'teacherAttendance/agreeTeacherAttendanceComplaints'"
-                   type="primary"
-                   @click="subreset('AGREED')">同意</el-button>
+      <div slot="footer" v-if="visibleForm.complaintsStatusEnum == '2'">
+        <el-button
+          v-permission="'teacherAttendance/rejectTeacherAttendanceComplaints'"
+          @click="subreset('DENIED')"
+          >拒绝</el-button
+        >
+        <el-button
+          v-permission="'teacherAttendance/agreeTeacherAttendanceComplaints'"
+          type="primary"
+          @click="subreset('AGREED')"
+          >同意</el-button
+        >
       </div>
     </el-dialog>
   </div>
@@ -185,21 +227,21 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import { getEmployeeOrgan } from "@/api/buildTeam";
-import { permission } from '@/utils/directivePage'
+import { permission } from "@/utils/directivePage";
 import {
   queryTeacherAttendanceComplaints,
   agreeTeacherAttendanceComplaints,
-  rejectTeacherAttendanceComplaints
+  rejectTeacherAttendanceComplaints,
 } from "@/api/journal";
 export default {
   components: { pagination },
-  data () {
+  data() {
     return {
       searchForm: {
         search: null,
         organId: null,
         complaintsStatus: null,
-        timer: []
+        timer: [],
       },
       teacherList: [],
       tableList: [],
@@ -209,7 +251,7 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
       dialogVisible: false,
       visibleForm: {
@@ -220,15 +262,15 @@ export default {
         signOutStatus: null,
         teacherAttendanceId: null,
         reSignInStatus: null,
-        reSignOutStatus: null
-      }
+        reSignOutStatus: null,
+      },
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created () { },
+  created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted () {
-    getEmployeeOrgan().then(res => {
+  mounted() {
+    getEmployeeOrgan().then((res) => {
       if (res.code == 200) {
         this.organList = res.data;
       }
@@ -236,94 +278,118 @@ export default {
     // 获取分部
 
     this.init();
-
-
   },
-  activated () {
+  activated() {
     this.init();
   },
   methods: {
-    init () {
-      this.getList()
+    init() {
+      this.getList();
     },
-    permission (str) {
-      return permission(str)
+    permission(str) {
+      return permission(str);
     },
-    getList () {
-      let obj = {}
-      Object.assign(obj, this.searchForm)
+    getList() {
+      let obj = {};
+      Object.assign(obj, this.searchForm);
       if (obj.timer && obj.timer.length > 0) {
-        obj.courseScheduleStartDate = obj.timer[0]
-        obj.courseScheduleEndDate = obj.timer[1]
+        obj.courseScheduleStartDate = obj.timer[0];
+        obj.courseScheduleEndDate = obj.timer[1];
       }
       obj.rows = this.rules.limit;
       obj.page = this.rules.page;
-      delete obj.timer
-      queryTeacherAttendanceComplaints(obj).then(res => {
+      delete obj.timer;
+      queryTeacherAttendanceComplaints(obj).then((res) => {
         if (res.code == 200) {
           this.rules.total = res.data.total;
-          this.tableList = res.data.rows
+          this.tableList = res.data.rows;
         }
-      })
+      });
     },
-    search () {
+    search() {
       this.rules.page = 1;
       this.getList();
     },
-    onReSet () {
+    onReSet() {
       this.searchForm = {
         search: null,
         organId: null,
         complaintsStatus: null,
-        timer: []
-      }
-      this.search()
+        timer: [],
+      };
+      this.search();
     },
-    subreset (str) {
-      if (str == 'AGREED') {
+    subreset(str) {
+      if (str == "AGREED") {
         // 同意
-        this.$refs['visibleForm'].validate(flag => {
+        this.$refs["visibleForm"].validate((flag) => {
           if (flag) {
-            let obj = {}
-            if (!this.visibleForm.reSignInStatus && !this.visibleForm.reSignOutStatus) {
-              this.$message.error('请修正签到状态或签退状态')
-              return
+            let obj = {};
+            if (
+              !this.visibleForm.reSignInStatus &&
+              !this.visibleForm.reSignOutStatus
+            ) {
+              this.$message.error("请修正签到状态或签退状态");
+              return;
             }
+            let str = "是否将此课程的";
             //visibleForm.reSignInStatus
-            this.visibleForm.reSignInStatus ? obj.signInStatus = 1 : null
-            this.visibleForm.reSignOutStatus ? obj.signOutStatus = 1 : null
-            obj.content = this.visibleForm.disposeContent
+            if (this.visibleForm.reSignInStatus) {
+              obj.signInStatus = 1;
+              str += "【签到状态】";
+            }
+            if (this.visibleForm.reSignOutStatus) {
+              obj.signOutStatus = 1;
+              str += "【签退状态】";
+            }
+            str += "修正为正常";
+            obj.content = this.visibleForm.disposeContent;
             obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
-            agreeTeacherAttendanceComplaints(obj).then(res => {
-              if (res.code == 200) {
-                this.dialogVisible = false;
-                this.$message.success('同意申诉成功')
-                this.getList();
-              }
+
+            this.$confirm(str, "是否", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
             })
+              .then(() => {
+                agreeTeacherAttendanceComplaints(obj).then((res) => {
+                  if (res.code == 200) {
+                    this.dialogVisible = false;
+                    this.$message.success("同意申诉成功");
+                    this.getList();
+                  }
+                });
+              })
+              .catch(() => {});
           }
-        })
-
+        });
       } else {
         // 拒绝
-        this.$refs['visibleForm'].validate(flag => {
+        this.$refs["visibleForm"].validate((flag) => {
           if (flag) {
-            let obj = {}
-            obj.content = this.visibleForm.disposeContent
+            let obj = {};
+            obj.content = this.visibleForm.disposeContent;
             obj.teacherAttendanceId = this.visibleForm.teacherAttendanceId;
-            rejectTeacherAttendanceComplaints(obj).then(res => {
-              if (res.code == 200) {
-                this.dialogVisible = false;
-                this.$message.success('拒绝申诉成功')
-                this.getList();
-              }
+            this.$confirm('驳回申诉', "是否", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
             })
+              .then(() => {
+                rejectTeacherAttendanceComplaints(obj).then((res) => {
+                  if (res.code == 200) {
+                    this.dialogVisible = false;
+                    this.$message.success("拒绝申诉成功");
+                    this.getList();
+                  }
+                });
+              })
+              .catch(() => {});
           }
-        })
-
+        });
       }
     },
-    lookDetail (row) {
+    lookDetail(row) {
       this.visibleForm = {
         complaintsContent: row.complaintsContent,
         complaintsStatusEnum: row.complaintsStatusEnum,
@@ -333,14 +399,14 @@ export default {
         signInTime: row.signInTime,
         signOutTime: row.signOutTime,
         teacherAttendanceId: row.teacherAttendanceId,
-        reSignInStatus: null,
-        reSignOutStatus: null
-      }
-      this.dialogVisible = true
-    }
+        reSignInStatus: row.signInStatus == 1 ? true : false,
+        reSignOutStatus: row.signOutStatus == 1 ? true : false,
+      };
+      this.dialogVisible = true;
+    },
   },
   watch: {
-    dialogVisible (val) {
+    dialogVisible(val) {
       if (!val) {
         this.visibleForm = {
           complaintsContent: null,
@@ -350,11 +416,11 @@ export default {
           signOutStatus: null,
           teacherAttendanceId: null,
           reSignInStatus: null,
-          reSignOutStatus: null
-        }
+          reSignOutStatus: null,
+        };
       }
-    }
-  }
+    },
+  },
 };
 </script>
 <style lang='scss' scoped>