index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <!-- 待办 -->
  3. <view class="wait-handle">
  4. <c-navbar :leftIconSize="0" title="待办"> </c-navbar>
  5. <view class="main">
  6. <view class="header-tabs">
  7. <u-tabs
  8. :current="current"
  9. :itemStyle="itemStyle"
  10. :activeStyle="activeStyle"
  11. :list="tabsList"
  12. @change="tabsChange"
  13. ></u-tabs>
  14. </view>
  15. <view class="content">
  16. <swiper
  17. class="swiper"
  18. :current="current"
  19. @change="swiperChange"
  20. >
  21. <swiper-item
  22. style="padding: 14px; box-sizing: border-box"
  23. :item-id="item.id"
  24. :key="item.idx"
  25. v-for="item in tabsList"
  26. >
  27. <listContent
  28. @approval="approval"
  29. :key="reloadCode"
  30. :type="item.idx"
  31. />
  32. </swiper-item>
  33. </swiper>
  34. </view>
  35. <!-- 审批-form -->
  36. <approval-fm
  37. @reload="reload"
  38. :rId="rId"
  39. :isShow.sync="isShow"
  40. ></approval-fm>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import listContent from './listContent.vue';
  46. import ApprovalFm from '@/pages/waitHandle/approvalDetail/approvalFm.vue';
  47. export default {
  48. name: 'waitHandle',
  49. components: { listContent, ApprovalFm },
  50. data() {
  51. return {
  52. rId: undefined,
  53. isShow: false,
  54. reloadCode: '',
  55. itemStyle: {
  56. width: '33.33%',
  57. height: '44px',
  58. },
  59. activeStyle: {
  60. color: '#436FF6',
  61. },
  62. current: 0,
  63. tabsList: [
  64. {
  65. name: '我发起',
  66. idx: 0,
  67. badge: {
  68. value: 0,
  69. },
  70. },
  71. {
  72. name: '我审批',
  73. idx: 1,
  74. badge: {
  75. value: 5,
  76. },
  77. },
  78. {
  79. name: '抄送我',
  80. idx: 2,
  81. badge: {
  82. value: 0,
  83. },
  84. },
  85. ],
  86. };
  87. },
  88. onShow() {
  89. this.reload();
  90. },
  91. methods: {
  92. reload() {
  93. // 刷新
  94. this.reloadCode = Math.random().toString(36).slice(-6);
  95. },
  96. approval(item) {
  97. this.rId = item.id;
  98. this.isShow = true;
  99. },
  100. tabsChange(e) {
  101. this.current = e.index;
  102. },
  103. swiperChange(e) {
  104. this.current = e.detail.current;
  105. },
  106. },
  107. };
  108. </script>
  109. <style scoped lang="scss">
  110. .wait-handle {
  111. display: flex;
  112. flex-direction: column;
  113. .main {
  114. flex: 1;
  115. display: flex;
  116. flex-direction: column;
  117. .content {
  118. flex: 1;
  119. .swiper {
  120. height: 100%;
  121. }
  122. }
  123. .header-tabs {
  124. background-color: #fff;
  125. /deep/ .u-tabs__wrapper__nav__line {
  126. background-color: #436ff6 !important;
  127. }
  128. /deep/ .u-tabs__wrapper__nav__item__text {
  129. color: inherit;
  130. }
  131. }
  132. }
  133. }
  134. </style>