index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="flow-v">
  3. <view class="notice-warp" :style="{height:noticeWarpH + 'px'}">
  4. <view class="search-box">
  5. <u-search :placeholder="$t('app.apply.pleaseKeyword')" v-model="keyword" height="72"
  6. :show-action="false" @change="search" bg-color="#f0f2f6" shape="square">
  7. </u-search>
  8. </view>
  9. <view class="flow-tabs">
  10. <u-tabs ref="tabs" :list="tabsList" active-color="#0177FF" inactive-color="#303133" font-size="30"
  11. v-model="current" name="fullName" @change="change" height="80" :is-scroll="false"></u-tabs>
  12. </view>
  13. <view class="flow-status-tabs" v-if="statusList.length">
  14. <u-subsection :list="statusList" :current="subsectionIndex" name="name" active-color="#2979FF"
  15. inactive-color="#999999" bg-color="#F2F3F7" font-size="24" :bold="false"
  16. @change="subsection"></u-subsection>
  17. </view>
  18. </view>
  19. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
  20. :up="upOption" :top="mescrollTop">
  21. <flowlist :list='list' :swipeAction='current != 3' :category='category' />
  22. </mescroll-body>
  23. </view>
  24. </template>
  25. <script>
  26. import resources from '@/libs/resources.js'
  27. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  28. import FlowMixin from "./FlowMixin.js";
  29. import flowlist from './flowList.vue'
  30. export default {
  31. components: {
  32. flowlist
  33. },
  34. mixins: [MescrollMixin, FlowMixin],
  35. data() {
  36. return {
  37. noticeWarpH: 0,
  38. searchBox: 0,
  39. flowTabs: 0,
  40. flowStatusTabs: 0,
  41. activeItemStyle: {
  42. backgroundColor: '#fff'
  43. },
  44. keyword: '',
  45. category: '0',
  46. list: [],
  47. downOption: {
  48. use: true,
  49. auto: true
  50. },
  51. upOption: {
  52. page: {
  53. num: 0,
  54. size: 20,
  55. time: null
  56. },
  57. empty: {
  58. use: true,
  59. icon: resources.message.nodata,
  60. tip: this.$t('common.noData'),
  61. fixed: true,
  62. top: "300rpx",
  63. },
  64. textNoMore: this.$t('app.apply.noMoreData')
  65. },
  66. }
  67. },
  68. onShow() {
  69. uni.$off('operate')
  70. uni.$on('refresh', () => {
  71. this.list = [];
  72. this.mescroll.resetUpScroll();
  73. })
  74. },
  75. onUnload() {
  76. uni.$off('refresh')
  77. },
  78. mounted() {
  79. this.getContentHeight()
  80. },
  81. methods: {
  82. async getContentHeight() {
  83. const windowHeight = this.$u.sys().windowHeight;
  84. // 获取元素尺寸
  85. const [flowStatusTabs, flowTabs, searchBox] = await Promise.all([
  86. this.$uGetRect('.search-box'),
  87. this.$uGetRect('.flow-tabs'),
  88. this.$uGetRect('.flow-status-tabs')
  89. ]);
  90. this.flowStatusTabs = flowStatusTabs.height
  91. this.flowTabs = flowTabs.height
  92. this.searchBox = searchBox.height
  93. this.mescrollTop = this.flowStatusTabs + this.flowTabs + this.searchBox
  94. this.noticeWarpH = this.mescrollTop
  95. },
  96. getFlowStatus(status) {
  97. let flowStatus;
  98. //待签收
  99. if (this.category == '0') flowStatus = resources.status.signfor
  100. // 待办,在办
  101. if (this.category == '1' || this.category == '2') {
  102. //流转中
  103. if (status == '1') flowStatus = resources.status.circulation
  104. //已退回
  105. if (status == '5') flowStatus = resources.status.back
  106. //协办
  107. if (status == '7') flowStatus = resources.status.assist
  108. //转审
  109. if (status == '3') flowStatus = resources.status.transfer
  110. //撤回
  111. if (status == '6') flowStatus = resources.status.recall
  112. //撤销中
  113. if (status == '8') flowStatus = resources.status.revoking
  114. //加签
  115. if (status == '2') flowStatus = resources.status.addSign
  116. //指派
  117. if (status == '4') flowStatus = resources.status.assign
  118. //转办
  119. if (status == '9') flowStatus = resources.status.transfer2
  120. }
  121. //发起
  122. if (!this.category) {
  123. //待提交
  124. if (status == '0') flowStatus = resources.status.draft
  125. //进行中
  126. if (status == '1') flowStatus = resources.status.doing
  127. //已通过
  128. if (status == '2') flowStatus = resources.status.adopt
  129. //已拒绝
  130. if (status == '3') flowStatus = resources.status.reject
  131. //已终止
  132. if (status == '4') flowStatus = resources.status.cancel
  133. //已暂停
  134. if (status == '5') flowStatus = resources.status.pause
  135. //撤销中
  136. if (status == '6') flowStatus = resources.status.revoking
  137. //已撤销
  138. if (status == '7') flowStatus = resources.status.revoke
  139. //退回
  140. if (status == '8') flowStatus = resources.status.back
  141. //撤回
  142. if (status == '9') flowStatus = resources.status.recall
  143. }
  144. //已办
  145. if (this.category == '3') {
  146. //转审
  147. if (status == '7') flowStatus = resources.status.transfer
  148. //同意
  149. if (status == '1') flowStatus = resources.status.agree
  150. //拒绝
  151. if (status == '0') flowStatus = resources.status.refuse
  152. //加签
  153. if (status == '5') flowStatus = resources.status.addSign
  154. //退回
  155. if (status == '3') flowStatus = resources.status.return
  156. //转办
  157. if (status == '18') flowStatus = resources.status.transfer2
  158. }
  159. //抄送
  160. if (this.category == '4') {
  161. //进行中
  162. if (status == '1') flowStatus = resources.status.doing
  163. //已通过
  164. if (status == '2') flowStatus = resources.status.adopt
  165. //已拒绝
  166. if (status == '3') flowStatus = resources.status.reject
  167. //已退回
  168. if (status == '8') flowStatus = resources.status.back
  169. }
  170. return flowStatus
  171. },
  172. search() {
  173. // 节流,避免输入过快多次请求
  174. this.searchTimer && clearTimeout(this.searchTimer)
  175. this.searchTimer = setTimeout(() => {
  176. this.list = [];
  177. this.mescroll.resetUpScroll();
  178. }, 300)
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss">
  184. page {
  185. background-color: #f0f2f6;
  186. }
  187. .u-tabs {
  188. padding-bottom: 4rpx;
  189. }
  190. </style>