leaves.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div>
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">我的假期</block>
  6. </cu-custom>
  7. <div class="panlen">
  8. <div class="items">
  9. <div style="height: 2px;"></div>
  10. <picker mode="date" :start="new Date(entryDate).getFullYear()" :end="new Date().getFullYear()" fields="year" :value="datetime" @change="DateChange">
  11. {{datetime}}年度
  12. </picker>
  13. </div>
  14. <div style="text-align: center;margin-top: 10px;">
  15. <span style="font-size: 13px;color: #FFFFFF;">历年年假剩余天数:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{lyearDay}}天</span>
  16. <span style="margin-left:10px;border-left: 2px solid #ccc;font-size: 13px;"></span>
  17. <span style="font-size: 13px;color: #FFFFFF;margin-left:10px ;">当年年假总天数:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{yearDay}}天</span>
  18. </br>
  19. </br>
  20. <span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">剩余年假天数:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{availableDay}}天</span>
  21. <span style="margin-left:10px;border-left: 2px solid #ccc;font-size: 13px;"></span>
  22. <span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">剩余可调休:</span><span style="margin-left:10px ;font-size: 13px;color: #FFFFFF;">{{txcount}}小时</span>
  23. </div>
  24. </div>
  25. <div style="background-color: #FFFFFF;">
  26. <div >
  27. <div style="height: 50px;position: relative;">
  28. <text style="position: absolute;top: 30%;margin-left: 10px;">年假申请记录</text>
  29. <!-- <strong style="position: absolute;top: 30%;font-size: 15px;">年假申请记录</strong> -->
  30. </div>
  31. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
  32. <view class="cu-list menu radius" >
  33. <view class="cu-item " v-for="s in data" v-if="s.holidayType=='年假'">
  34. <navigator class="content" hover-class="none" >
  35. <text>年假 ({{s.holidayCount/24}}天)</text>
  36. <div>
  37. <div style="color: #9C9FAA;">
  38. <span >{{s.startDates}}</span>
  39. <span style="margin-left:5px;">至</span>
  40. <span style="margin-left:5px;">{{s.endDates}}</span>
  41. </div>
  42. </div>
  43. <div >
  44. <span style="float: right ;margin-top: -30px;color: #D6D6D6;" v-if='s.state=="2" ||s.state==2'>已通过</span>
  45. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="1" ||s.state==1'>审批中</span>
  46. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="3" ||s.state==3'>已驳回</span>
  47. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="4" ||s.state==4'>已撤销</span>
  48. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="5" ||s.state==5'>通过后撤销</span>
  49. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="6" ||s.state==6'>已删除</span>
  50. </div>
  51. </navigator>
  52. </view>
  53. </view>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import api from '@/api/api'
  60. export default {
  61. data() {
  62. return {
  63. userUrl:'/sys/weixin/myVacation',
  64. datetime:new Date().getFullYear(),
  65. yearDay:0,
  66. lyearDay:0,
  67. txcount:0,
  68. entryDate:null,
  69. availableDay:0,
  70. data:[],
  71. }
  72. },
  73. created() {
  74. this.query();
  75. },methods:{
  76. query(){
  77. var id=this.$store.getters.userid;
  78. var deptid=uni.getStorageSync('id');
  79. if(deptid!=null&&deptid!=""){
  80. id=deptid;
  81. }
  82. this.$http.get(this.userUrl,{params:{userid:id,year:this.datetime}}).then(res=>{
  83. this.yearDay=res.data.yearCount;
  84. this.availableDay=res.data.syYearCount;
  85. this.txcount=res.data.txCount;
  86. this.lyearDay=res.data.lsyYearCount;
  87. this.entryDate=res.data.entry;
  88. if(""!=res.data.vacationsBody &&res.data.vacationsBody!=null){
  89. this.data=res.data.vacationsBody;
  90. }else{
  91. this.data=[];
  92. }
  93. }).catch(err => {
  94. console.log(err);
  95. });
  96. },
  97. DateChange(e) {
  98. this.datetime = e.detail.value
  99. this.query();
  100. },
  101. ret(){
  102. this.$Router.push({name:'index'})
  103. },
  104. }
  105. }
  106. </script>
  107. <style>
  108. .panlen{
  109. width: 95%;
  110. height: 100px;
  111. border-radius:5px 5px 0 0;
  112. background-color: #3C7AD8;
  113. margin:0 auto;
  114. margin-top: 10px;
  115. }
  116. .items{
  117. width: 70px;
  118. height: 25px;
  119. background-color: #EC770C;
  120. border-radius:5px 0 5px 0;
  121. text-align: center;
  122. color: #FFFFFF;
  123. }
  124. .top{
  125. background-color: #5677AC;
  126. width: 100%;
  127. height: 40px;
  128. }
  129. </style>