leave.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. {{datetime}}年度
  11. </div>
  12. <div style="text-align: center;margin-top: 10px;">
  13. <span style="color: #93B5E9;">年假总天数:</span><span style="margin-left:10px ;font-size: 18px;color: #FFFFFF;">{{yearDay/24}}天</span>
  14. <span style="margin-left:10px;border-left: 2px solid #ccc;"></span>
  15. <span style="margin-left:10px ;color: #93B5E9;">当前可用年假:</span><span style="margin-left:10px ;font-size: 18px;color: #FFFFFF;">{{availableDay/24}}天</span>
  16. </div>
  17. </div>
  18. <div style="background-color: #FFFFFF;">
  19. <div >
  20. <div style="height: 50px;position: relative;">
  21. <text style="position: absolute;top: 30%;margin-left: 10px;">年假申请记录</text>
  22. <!-- <strong style="position: absolute;top: 30%;font-size: 15px;">年假申请记录</strong> -->
  23. </div>
  24. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
  25. <view class="cu-list menu radius" >
  26. <view class="cu-item " v-for="s in data">
  27. <navigator class="content" hover-class="none">
  28. <text>年假 ({{s.holidayCount/24}}天)</text>
  29. <div>
  30. <div style="color: #9C9FAA;">
  31. <span >{{s.startDate}}</span>
  32. <span style="margin-left:5px;">至</span>
  33. <span style="margin-left:5px;">{{s.endDate}}</span>
  34. <span style="margin-left:5px;" v-if='s.end=="1"'>上午</span>
  35. <span style="margin-left:5px;" v-if='s.end=="2"'>下午</span>
  36. </div>
  37. </div>
  38. <div >
  39. <span style="float: right ;margin-top: -30px;color: #D6D6D6;" v-if='s.state=="2" ||s.state==2'>已通过</span>
  40. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="1" ||s.state==1'>审批中</span>
  41. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="3" ||s.state==3'>已驳回</span>
  42. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="4" ||s.state==4'>已撤销</span>
  43. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="5" ||s.state==5'>通过后撤销</span>
  44. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="6" ||s.state==6'>已删除</span>
  45. </div>
  46. </navigator>
  47. <!-- <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div> -->
  48. </view>
  49. </view>
  50. <!-- <div v-for="s in data">
  51. <div style="height: 70px;position: relative;">
  52. <div style="position: absolute;top: 10px;">
  53. <strong style="font-size: 16px;">年假</strong ><strong style="margin-left:10px;font-size: 16px;">({{s.holidayCount/24}}天)</strong>
  54. <div style="color: #9C9FAA;">
  55. <span >{{s.startDate}}</span>
  56. <span style="margin-left:5px;" v-if='s.start=="1"'>上午</span>
  57. <span style="margin-left:5px;" v-if='s.start=="2"'>下午</span>
  58. <span style="margin-left:5px;">至</span>
  59. <span style="margin-left:5px;">{{s.endDate}}</span>
  60. <span style="margin-left:5px;" v-if='s.end=="1"'>上午</span>
  61. <span style="margin-left:5px;" v-if='s.end=="2"'>下午</span>
  62. </div>
  63. </div>
  64. <span style="width: 10px;height: 10px;float: right;" ></span>
  65. <span style="float: right ;margin-top: 25px;color: #D6D6D6;" v-if='s.state=="2" ||s.state==2'>已通过</span>
  66. <span style="float: right ;color: #F09745;margin-top: 25px;" v-if='s.state=="1" ||s.state==1'>审批中</span>
  67. <span style="float: right ;color: #F09745;margin-top: 25px;" v-if='s.state=="3" ||s.state==3'>已驳回</span>
  68. <span style="float: right ;color: #F09745;margin-top: 25px;" v-if='s.state=="4" ||s.state==4'>已撤销</span>
  69. <span style="float: right ;color: #F09745;margin-top: 25px;" v-if='s.state=="5" ||s.state==5'>通过后撤销</span>
  70. <span style="float: right ;color: #F09745;margin-top: 25px;" v-if='s.state=="6" ||s.state==6'>已删除</span>
  71. </div>
  72. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
  73. </div> -->
  74. </div>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import api from '@/api/api'
  80. export default {
  81. data() {
  82. return {
  83. userUrl:'/vacation/vacation/list2',
  84. datetime:null,
  85. yearDay:null,
  86. availableDay:null,
  87. data:[],
  88. }
  89. },
  90. created() {
  91. var date=new Date();
  92. this.datetime=date.getFullYear();
  93. this.$http.get(this.userUrl,{params:{userid:this.$store.getters.userid}}).then(res=>{
  94. console.log(res);
  95. this.yearDay=res.data.vacations.yearDay;
  96. this.availableDay=res.data.vacations.availableDay;
  97. if(""!=res.data.vacationsBody &&res.data.vacationsBody!=null){
  98. this.data=res.data.vacationsBody;
  99. }
  100. }).catch(err => {
  101. console.log(err);
  102. });
  103. },methods:{
  104. ret(){
  105. this.$Router.push({name:'index'})
  106. },
  107. /* mynoontip(r) {
  108. const date = new Date(r);
  109. var s=date.getHours();
  110. if (date.getHours() >= 0 && date.getHours() < 12) {
  111. return "上午";
  112. } else if (date.getHours() >= 12 && date.getHours() <= 18) {
  113. return "下午";
  114. }
  115. }, */
  116. }
  117. }
  118. </script>
  119. <style>
  120. .panlen{
  121. width: 95%;
  122. height: 100px;
  123. border-radius:5px 5px 0 0;
  124. background-color: #3C7AD8;
  125. margin:0 auto;
  126. margin-top: 10px;
  127. }
  128. .items{
  129. width: 70px;
  130. height: 25px;
  131. background-color: #EC770C;
  132. border-radius:5px 0 5px 0;
  133. text-align: center;
  134. color: #FFFFFF;
  135. }
  136. .top{
  137. background-color: #5677AC;
  138. width: 100%;
  139. height: 40px;
  140. }
  141. </style>