lex-xin 5 years ago
parent
commit
9ccf895b79

+ 23 - 3
src/api/audition.js

@@ -34,8 +34,8 @@ const teacherSalaryComplaintAdd = (data) => {
 const teacherSalaryComplaintGet = (data) => {
   return axios({
       url: api + '/teacherSalaryComplaints/get',
-      method: 'post',
-      data: qs.stringify(data)
+      method: 'get',
+      params: data
   })
 }
 
@@ -57,11 +57,31 @@ const repealComplaints = (data) => {
   })
 }
 
+// 获取教师指定年份每月的课酬
+const findTeacherYearSalarys = (data) => {
+  return axios({
+      url: api + '/courseScheduleTeacherSalary/findTeacherYearSalarys',
+      method: 'get',
+      params: data
+  })
+}
+
+// 申诉列表
+const teacherSalaryComplaintQueryPage = (data) => {
+  return axios({
+      url: api + '/teacherSalaryComplaints/queryPage',
+      method: 'get',
+      params: data
+  })
+}
+
 export {
   findTeacherSettlementCourseSalarys,
   confirmTeacherMonthSalary,
   teacherSalaryComplaintAdd,
   teacherSalaryComplaintGet,
   findByMonth,
-  repealComplaints
+  repealComplaints,
+  findTeacherYearSalarys,
+  teacherSalaryComplaintQueryPage
 }

+ 6 - 1
src/views/audition/AppealDetail.vue

@@ -94,7 +94,12 @@ export default {
           let result = res.data
           if(result.code == 200) {
             this.$toast('撤销申诉成功')
-            this.$router.push('/remuneration')
+            if(this.$route.query.record) {
+              this.$router.push('/appealRecord')
+            } else {
+              this.$router.push('/remuneration')
+            }
+            
           } else {
             this.$toast(result.msg)
           }

+ 91 - 13
src/views/audition/AppealRecord.vue

@@ -3,9 +3,11 @@
     <m-header v-if="headerStatus" />
 
     <van-list v-if="dataShow" v-model="loading" :finished="finished" finished-text="没有更多了" @load="getList">
-      <van-cell v-for="i in 5" :key="i">
-        <template #title>4月5日 15:05 </template>
-        <template #default>4月课酬申诉<span class="agree">待处理</span></template>
+      <van-cell v-for="(item, index) in dataList" :key="index" @click="onGOTO(item)">
+        <template #title>{{ item.createTime | getMonthDay }} {{ item.createTime | getHourMin }} </template>
+        <template #default>{{ new Date(item.salarySettlementMonth + '-01').getMonth() + 1 }}月课酬申诉
+          <span :class="item.statusEnum">{{ item.statusEnum | statusFilter }}</span>
+        </template>
       </van-cell>
     </van-list>
     <m-empty class="empty" msg="暂无数据" v-else key="data" />
@@ -14,7 +16,8 @@
 <script>
 import MHeader from "@/components/MHeader"
 import MEmpty from "@/components/MEmpty"
-import { browser }  from '@/common/common'
+import { getSTD }  from '@/common/common'
+import { teacherSalaryComplaintQueryPage } from '@/api/audition'
 export default {
   name: "appealReocrd",
   components: { MHeader, MEmpty },
@@ -23,7 +26,12 @@ export default {
       headerStatus: true,
       loading: false,
       finished: false,
-      dataShow: true
+      dataShow: true,
+      dataList: [],
+      params: {
+        page: 1,
+        rows: 20
+      }
     };
   },
   mounted() {
@@ -32,15 +40,85 @@ export default {
       localStorage.setItem("Authorization", decodeURI(params.Authorization));
       localStorage.setItem("userInfo", decodeURI(params.Authorization));
     }
-    document.title = '处理结果'
-    if(browser().android || browser().iPhone) {
-      this.headerStatus = false
-    }
+    document.title = '课酬申诉记录'
+    // if(browser().android || browser().iPhone) {
+    //   this.headerStatus = false
+    // }
   },
   methods: {
+    onGOTO(item) {
+      if(item.statusEnum == 'PENDING') {
+        this.$router.push({
+          path: 'appealDetail',
+          query: {
+            record: 1, //
+            haveComplaints: 1,
+            appealDateStr: item.salarySettlementMonth
+          }
+        })
+      } else if(item.statusEnum == 'DONE' || item.statusEnum == 'AGREED' || item.statusEnum == 'DENIED') {
+        this.$router.push({
+          path: 'appealResult', 
+          query: {
+            id: item.id
+          }
+        })
+      }
+    },
     getList() {
-      this.finished = true
+      let params = this.params;
+      teacherSalaryComplaintQueryPage().then(res => {
+        let result = res.data
+        this.loading = false
+        if (result.code == 200) {
+          params.page = result.data.pageNo
+          this.dataList = this.dataList.concat(result.data.rows)
+          if (params.page >= result.data.totalPage) {
+            this.finished = true;
+          }
+          this.params.page++;
+        } else {
+          this.finished = true;
+        }
+        // 判断是否有数据
+        if (this.dataList.length <= 0) {
+          this.dataShow = false;
+        }
+      })
+    },
+  },
+  filters: {
+    getHourMin(time) {
+      let tempDate = time
+      if(!time) {
+        return ''
+      }
+      if(typeof(tempDate) == 'string') {
+          tempDate = new Date(time.replace(/-/ig, '/'))
+      }
+      let hour = tempDate.getHours()
+      let minut = tempDate.getMinutes()
+      return getSTD(hour) + ':' + getSTD(minut)
+    },
+    getMonthDay(time) {
+      let tempDate = time || new Date()
+      if(typeof(tempDate) == 'string') {
+          tempDate = new Date(time.replace(/-/ig, '/'))
+      }
+      let month = tempDate.getMonth() + 1
+      let day = tempDate.getDate()
+      return month + '月' + day + '日'
     },
+    statusFilter(status) {
+      let template = {
+        PENDING: '处理中',
+        DONE: '已完成',
+        AGREED: '已同意',
+        DENIED: '已拒绝',
+        WITHDRAWN: '已撤销'
+      }
+      return template[status]
+    }
   }
 };
 </script>
@@ -66,13 +144,13 @@ export default {
     color: #1A1A1A;
     width: 60%;
     flex: 0 auto;
-    .agree {
+    .AGREED {
       color: #2EC7A5;
     }
-    .reject {
+    .DENIED {
       color: #EC4848;
     }
-    .over {
+    .DONE, .WITHDRAWN {
       color: #808080;
     }
   }

+ 57 - 9
src/views/audition/AppealResult.vue

@@ -4,29 +4,44 @@
 
     <van-panel>
       <template #header>
-        <div class="title">3月5日提交的课酬申诉</div>
-        <div class="status">申诉同意</div>
+        <div class="title">{{ dataInfo.createTime | getMonthDay }}提交的课酬申诉</div>
+        <!-- PENDING,Done,AGREED,DENIED,WITHDRAWN -->
+        <div class="status" :class="[dataInfo.statusEnum == 'AGREED' ? 'agree' : '']" v-if="dataInfo.statusEnum == 'AGREED'">已同意</div>
+        <div class="status" :class="[dataInfo.statusEnum == 'DENIED' ? 'error' : '']" v-if="dataInfo.statusEnum == 'DENIED'">已拒绝</div>
+        <div class="status" v-if="dataInfo.statusEnum == 'WITHDRAWN'">已撤销</div>
+        <div class="status" v-if="dataInfo.statusEnum == 'Done'">已完成</div>
       </template>
       <div class="appealContent van-hairline--top">
         <h2>申诉内容:</h2>
-        <div class="desc">盼望着,盼望着,东风来了,春天的脚步近了。一切都像刚睡醒的样子,欣欣然张开了眼。山朗润起来了,水涨起来了,太阳的脸红起来了。小草偷偷地从土地里钻出来,嫩嫩的,绿绿的。园子里,田野里,瞧去,一大片一大片满是的。坐着,躺着,打两</div>
+        <div class="desc">
+          <!-- {{ dataInfo.reason }} -->
+          <van-field v-model="dataInfo.reason" autosize disabled type="textarea" />
+        </div>
       </div>
     </van-panel>
     <div class="appealContent">
-      <h2>申诉内容:</h2>
-      <div class="desc">盼望着,盼望着,东风来了,春天的脚步近了。一切都像刚睡醒的样子,欣欣然张开了眼。山朗润起来了,水涨起来了,太阳的脸红起来了。小草偷偷地从土地里钻出来,嫩嫩的,绿绿的。园子里,田野里,瞧去,一大片一大片满是的。坐着,躺着,打两</div>
+      <h2>处理意见:</h2>
+      <div class="desc">
+        <!-- {{ dataInfo.handingSuggestion }} -->
+        <van-field v-model="dataInfo.handingSuggestion" autosize disabled type="textarea" />  
+      </div>
     </div>
   </div>
 </template>
 <script>
-import MHeader from "@/components/MHeader";
+import MHeader from "@/components/MHeader"
 import { browser }  from '@/common/common'
+import { teacherSalaryComplaintGet } from '@/api/audition'
 export default {
   name: "teacherList",
   components: { MHeader },
   data() {
     return {
       headerStatus: true,
+      dataInfo: {
+        reason: null,
+        handingSuggestion: null
+      }
     };
   },
   mounted() {
@@ -39,8 +54,38 @@ export default {
     if(browser().android || browser().iPhone) {
       this.headerStatus = false
     }
+
+    this.__init()
   },
   methods: {
+    __init() {
+      let query = this.$route.query
+      this.$toast.loading({
+        duration: 0, // 持续展示 toast
+        forbidClick: true,
+        message: '加载中...',
+      });
+      teacherSalaryComplaintGet({ id: query.id }).then(res => {
+        let result = res.data
+        this.$toast.clear()
+        if(result.code == 200) {
+          this.dataInfo = result.data
+        } else {
+          this.$toast(result.msg)
+        }
+      })
+    }
+  },
+  filters: {
+    getMonthDay(time) {
+      let tempDate = time || new Date()
+      if(typeof(tempDate) == 'string') {
+          tempDate = new Date(time.replace(/-/ig, '/'))
+      }
+      let month = tempDate.getMonth() + 1
+      let day = tempDate.getDate()
+      return month + '月' + day + '日'
+    }
   }
 };
 </script>
@@ -61,11 +106,14 @@ export default {
   }
   .status {
     padding: 0 .1rem .15rem;
-    color: #2EC7A5;
+    color: #1A1A1A;
     font-size: .16rem;
     &.error {
       color: #EC4848;
     }
+    &.agree {
+      color: #2EC7A5;
+    }
   }
 }
 .appealContent {
@@ -75,10 +123,10 @@ export default {
   h2 {
     font-size: .16rem;
     color: #666666;
-    padding: .15rem 0 .13rem;
+    padding: .15rem 0 0;
   }
   .desc {
-    padding: 0 .2rem;
+    // padding: 0 .2rem;
     text-indent: .3rem;
     color: #1A1A1A;
   }

+ 49 - 15
src/views/audition/MonthAppeal.vue

@@ -6,25 +6,20 @@
       </template>
     </m-header>
     <van-dropdown-menu>
-      <van-dropdown-item v-model="value1" :options="option1" />
+      <van-dropdown-item v-model="value1" :options="option1" @change="getList" />
     </van-dropdown-menu>
 
     <div v-if="dataShow">
       <van-cell-group>
-        <van-cell title="4月">
+        <van-cell v-for="(item, index) in dataList" :key="index" :title="item.monthStr" :class="item.isNow ? '' : 'disabled'">
           <template #default>
-            总计:<span class="countMoney">2000元</span>
-          </template>
-        </van-cell>
-        <van-cell title="3月" class="disabled">
-          <template #default>
-            总计:<span class="countMoney">2000元</span>
+            总计:<span class="countMoney">{{ item.totalActualSalary }}元</span>
           </template>
         </van-cell>
       </van-cell-group>
 
       <div class="allCount">
-        合计:<span class="allMoney">5000.00<i>元</i></span>
+        合计:<span class="allMoney">{{ totalSalary }}<i>元</i></span>
       </div>
     </div>
     <m-empty class="empty" msg="暂无数据" v-else key="data" />
@@ -33,7 +28,8 @@
 <script>
 import MHeader from "@/components/MHeader"
 import MEmpty from "@/components/MEmpty"
-import { browser }  from '@/common/common'
+import { getSTD }  from '@/common/common'
+import { findTeacherYearSalarys } from '@/api/audition'
 export default {
   name: "teacherList",
   components: { MHeader, MEmpty },
@@ -46,7 +42,9 @@ export default {
         { text: '2021年', value: 2021 },
         { text: '2022年', value: 2022 }
       ],
-      dataShow: true
+      dataShow: true,
+      dataList: [],
+      totalSalary: 0
     };
   },
   mounted() {
@@ -55,12 +53,48 @@ export default {
       localStorage.setItem("Authorization", decodeURI(params.Authorization));
       localStorage.setItem("userInfo", decodeURI(params.Authorization));
     }
-    document.title = "确认课酬";
-    if (browser().android || browser().iPhone) {
-      this.headerStatus = false;
-    }
+    document.title = "月度课酬列表";
+    // if (browser().android || browser().iPhone) {
+    //   this.headerStatus = false;
+    // }
+
+    this.getList()
   },
   methods: {
+    getList() {
+      this.$toast.loading({
+        duration: 0, // 持续展示 toast
+        forbidClick: true,
+        message: '加载中...',
+      });
+      findTeacherYearSalarys({ year: this.value1 }).then(res => {
+        let result = res.data
+        this.$toast.clear()
+        if(result.code == 200) {
+          this.totalSalary = result.data.totalSalary
+          let t = new Date()
+          t.setMonth(t.getMonth() - 1)
+          let temp = t.getFullYear() + '-' + getSTD(t.getMonth() + 1)
+          result.data.monthSalarys.forEach(item => {
+            if(item.month == temp) {
+              item.isNow = true
+            } else {
+              item.isNow = false
+            }
+            let tempDate = new Date(item.month + '-01')
+            item.monthStr = (tempDate.getMonth() + 1) + '月'
+          })
+          this.dataList = result.data.monthSalarys.reverse()
+          if(this.dataList.length <= 0) {
+            this.dataShow = false
+          } else {
+            this.dataShow = true
+          }
+        } else {
+          this.$toast(result.msg)
+        }
+      })
+    },
     onAppealRecord() {
       this.$router.push({
         path: 'appealRecord'

+ 6 - 5
src/views/audition/Remuneration.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="wrap">
+  <div class="wrap" id="remuneration">
     <m-header v-if="headerStatus" />
 
     <div class="monthMoney">{{ appealDate }}课酬</div>
@@ -32,10 +32,10 @@
             </template>
             <template #default>
               <p class="money" :class="[item.reduceSalary > 0 ? 'error' : '']">
-                ¥<span>{{ item.actualSalary }}</span>
+                ¥<span>{{ item.finalSalary }}</span>
               </p>
               <div class="moneyInfo" v-if="item.reduceSalary > 0">
-                课酬:¥{{ item.expectSalary }}
+                课酬:¥{{ item.actualSalary }}
                 <br />扣款:¥{{ item.reduceSalary }}
               </div>
             </template>
@@ -160,6 +160,7 @@ export default {
           if(result.code == 200) {
             this.$toast('课酬确认成功')
             this.confirmStatus = 1
+            document.querySelector('#remuneration').scrollTop = 0
           } else {
             this.$toast(result.msg)
           }
@@ -189,8 +190,8 @@ export default {
       if(typeof(tempDate) == 'string') {
           tempDate = new Date(time.replace(/-/ig, '/'))
       }
-      let month = tempDate.getFullYear()
-      let day = tempDate.getMonth() + 1
+      let month = tempDate.getMonth() + 1
+      let day = tempDate.getDate()
       return month + '月' + day + '日'
     }
   }