Footer.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div>
  3. <ul class="footer flex jc-sa w100pc fixed bott0 bg-fff aic footer">
  4. <li class="item">
  5. <router-link to="/index" class="flex2 aic f20 yellow" active-class="active">
  6. <i class="icon-home iconfont f18 text"></i>
  7. <p class="mt-5 f12 text">首页</p>
  8. </router-link>
  9. </li>
  10. <li class="item" v-if="reportsCompany || this.user.manageDeptId != 0 || reportsDept">
  11. <router-link to="/count" class="flex2 aic f20 text" active-class="active">
  12. <van-icon class="text" name="bar-chart-o" />
  13. <p class="mt-5 text f12">填报统计</p>
  14. </router-link>
  15. </li>
  16. <li class="item" v-if="cost">
  17. <router-link to="/cost" class="flex2 aic f20 text" active-class="active">
  18. <van-icon class="text" name="after-sale" />
  19. <p class="mt-5 text f12">成本统计</p>
  20. </router-link>
  21. </li>
  22. <li class="item">
  23. <router-link to="/my" class="flex2 aic f20 text" active-class="active">
  24. <van-icon class="text" name="user-o"></van-icon>
  25. <p class="mt-5 text f12">我的</p>
  26. </router-link>
  27. </li>
  28. </ul>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. user: JSON.parse(localStorage.userInfo),
  36. reportsCompany: false,
  37. reportsDept: false,
  38. cost: false
  39. }
  40. },
  41. mounted() {
  42. this.dealWith()
  43. },
  44. methods: {
  45. dealWith() {
  46. this.user = JSON.parse(localStorage.userInfo)
  47. this.reportsCompany = false
  48. this.reportsDept = false
  49. this.cost = false
  50. for(let i in this.user.functionList){
  51. if(this.user.functionList[i].name == '查看全公司工时'){
  52. this.reportsCompany = true
  53. }
  54. if(this.user.functionList[i].name == '查看本部门工时'){
  55. this.reportsDept = true
  56. }
  57. }
  58. for(let i in this.user.moduleList){
  59. if(this.user.moduleList[i].name == '工时成本统计'){
  60. this.cost = true
  61. }
  62. }
  63. }
  64. }
  65. };
  66. </script>
  67. <style scoped lang="less">
  68. .footer {
  69. border-top: 1px solid #ebebeb;
  70. height: 50px;
  71. position: fixed;
  72. bottom: 0;
  73. width: 100%;
  74. left: 0;
  75. z-index: 10;
  76. .text {
  77. color: #797d82;
  78. }
  79. .active .text {
  80. color: #20a0ff;
  81. }
  82. }
  83. </style>