index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="workbench-page">
  3. <view class="section white-wrap" v-for="item in my_tabs" :key="item.label">
  4. <view class="tab-title">{{item.label}}</view>
  5. <view class="tab-ul">
  6. <view class="tab-item" @click="handleGoNext(tab.url)" v-for="tab in item.child" :key="tab.label">
  7. <image :src="tab.img" mode="aspectFill" class="icon"/>
  8. <view class="label">{{tab.label}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import {shareData} from '@/utils/config.js'
  16. export default{
  17. data() {
  18. return {
  19. my_tabs: [],
  20. tabs: [
  21. {
  22. label: '审批',
  23. child: [
  24. {
  25. label: '客户审批',
  26. url: '/pages-approve/custome/list',
  27. img: require('@/static/icon-1.png')
  28. },
  29. {
  30. label: '合同审批',
  31. url: '/pages-approve/contract/list',
  32. img: require('@/static/icon-2.png')
  33. },
  34. {
  35. label: '用印审批',
  36. url: '/pages-approve/seal/list',
  37. img: require('@/static/icon-3.png')
  38. },
  39. ]
  40. },
  41. {
  42. label: '路演管理',
  43. child: [
  44. {
  45. label: '销售员日历',
  46. url: '/pages-roadshow/sellerCalendar/index',
  47. img: require('@/static/icon-8.png')
  48. },
  49. {
  50. label: '研究员日历',
  51. url: '/pages-roadshow/researcherCalendar/index',
  52. img: require('@/static/icon-5.png')
  53. },
  54. {
  55. label: '我的日历',
  56. url: '/pages-roadshow/myCalendar/index',
  57. img: require('@/static/icon-6.png')
  58. }
  59. ]
  60. },
  61. {
  62. label: '问答社区',
  63. child: [
  64. {
  65. label: '问答管理',
  66. url: '/pages-question/detail/index?type=question',
  67. img: require('@/static/icon-question.png')
  68. },
  69. {
  70. label: '评论管理',
  71. url: '/pages-question/detail/index?type=comment',
  72. img: require('@/static/icon-comment.png')
  73. }
  74. ]
  75. },
  76. {
  77. label: '出差管理',
  78. child: [
  79. {
  80. label: '出差日历',
  81. url: '/pages-businessTrip/calendar/index',
  82. img: require('@/static/icon-businesstrip-calendar.png')
  83. },
  84. {
  85. label: '出差申请',
  86. url: '/pages-businessTrip/apply/list',
  87. img: require('@/static/icon-businesstrip-apply.png')
  88. },
  89. {
  90. label: '出差审批',
  91. url: '/pages-approve/businessTrip/list',
  92. img: require('@/static/icon-businesstrip-approve.png')
  93. },
  94. ]
  95. },
  96. {
  97. label: '视频',
  98. child: [
  99. {
  100. label: '评论管理',
  101. url: '/pages-video/comment/list',
  102. img: require('@/static/icon-comment-video.png')
  103. }
  104. ]
  105. }
  106. ]
  107. }
  108. },
  109. onLoad() {
  110. this.init()
  111. },
  112. onShareAppMessage() {
  113. return shareData
  114. },
  115. methods: {
  116. handleGoNext(url) {
  117. uni.navigateTo({
  118. url
  119. })
  120. },
  121. init() {
  122. const userInfo = this.$store.state.userInfo;
  123. this.my_tabs = !['ficc_admin','admin'].includes(userInfo.RoleTypeCode) ? this.tabs.filter(_ => _.label !== '问答社区') : this.tabs;
  124. if(!userInfo.IsBusinessTrip){//删除出差审批
  125. this.my_tabs=this.my_tabs.map(item=>{
  126. item.child=item.child.filter(_=>_.label!=='出差审批')
  127. return item
  128. })
  129. }
  130. // 权益不显示出差管理模块
  131. if(userInfo.IsRai){
  132. this.my_tabs=this.my_tabs.filter(_ => _.label !== '出差管理')
  133. }
  134. //不是销售不显示销售员日历
  135. //admin和沛总单独开
  136. const showArr = ['ficc_seller','ficc_group','seller','admin']
  137. if(!showArr.includes(userInfo.RoleTypeCode)&&userInfo.AdminId!==66){
  138. this.my_tabs = this.my_tabs.map(item=>{
  139. item.child=item.child.filter(_=>_.label!=='销售员日历')
  140. return item
  141. })
  142. }
  143. }
  144. },
  145. }
  146. </script>
  147. <style lang="scss">
  148. .workbench-page{
  149. padding: 20rpx;
  150. display: flex;
  151. flex-wrap: wrap;
  152. }
  153. .section{
  154. width: 100%;
  155. padding: 30rpx;
  156. box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
  157. font-size: 12px;
  158. font-weight: 400;
  159. color: #666;
  160. margin-bottom: 30rpx;
  161. .tab-title {
  162. font-size: 32rpx;
  163. font-weight: bold;
  164. color: #222;
  165. }
  166. .tab-ul {
  167. margin-top: 40rpx;
  168. display: flex;
  169. align-items: center;
  170. .tab-item {
  171. margin-right: 60rpx;
  172. text-align: center;
  173. .icon{
  174. width: 78rpx;
  175. height: 78rpx;
  176. margin: 0 auto 10rpx;
  177. }
  178. }
  179. }
  180. }
  181. </style>