leaves.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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}}天</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}}天</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.startDates}}</span>
  32. <span style="margin-left:5px;">至</span>
  33. <span style="margin-left:5px;">{{s.endDates}}</span>
  34. </div>
  35. </div>
  36. <div >
  37. <span style="float: right ;margin-top: -30px;color: #D6D6D6;" v-if='s.state=="2" ||s.state==2'>已通过</span>
  38. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="1" ||s.state==1'>审批中</span>
  39. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="3" ||s.state==3'>已驳回</span>
  40. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="4" ||s.state==4'>已撤销</span>
  41. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="5" ||s.state==5'>通过后撤销</span>
  42. <span style="float: right ;color: #F09745;margin-top: -30px;" v-if='s.state=="6" ||s.state==6'>已删除</span>
  43. </div>
  44. </navigator>
  45. </view>
  46. </view>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import api from '@/api/api'
  53. export default {
  54. data() {
  55. return {
  56. userUrl:'/sys/weixin/myVacation',
  57. datetime:null,
  58. yearDay:null,
  59. availableDay:null,
  60. data:[],
  61. }
  62. },
  63. created() {
  64. var date=new Date();
  65. this.datetime=date.getFullYear();
  66. var id=this.$store.getters.userid;
  67. var deptid=uni.getStorageSync('id');
  68. if(deptid!=null&&deptid!=""){
  69. id=deptid;
  70. }
  71. this.$http.get(this.userUrl,{params:{userid:id}}).then(res=>{
  72. console.log(res);
  73. this.yearDay=res.data.vacations.nVacRete;
  74. this.availableDay=res.data.vacations.nTotal;
  75. if(""!=res.data.vacationsBody &&res.data.vacationsBody!=null){
  76. this.data=res.data.vacationsBody;
  77. }
  78. }).catch(err => {
  79. console.log(err);
  80. });
  81. },methods:{
  82. ret(){
  83. this.$Router.push({name:'index'})
  84. },
  85. }
  86. }
  87. </script>
  88. <style>
  89. .panlen{
  90. width: 95%;
  91. height: 100px;
  92. border-radius:5px 5px 0 0;
  93. background-color: #3C7AD8;
  94. margin:0 auto;
  95. margin-top: 10px;
  96. }
  97. .items{
  98. width: 70px;
  99. height: 25px;
  100. background-color: #EC770C;
  101. border-radius:5px 0 5px 0;
  102. text-align: center;
  103. color: #FFFFFF;
  104. }
  105. .top{
  106. background-color: #5677AC;
  107. width: 100%;
  108. height: 40px;
  109. }
  110. </style>