MyApproval.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <scroll-list ref="list" :option="option" @load="load" @refresh="refresh" @loadSuccess="loadSuccess"
  4. @scrolltolower="scrolltolower">
  5. <view v-for="(item, index) in list" :key="index" @click="handleTest(item)">
  6. <view class="infoBody">
  7. <view>
  8. <view style="border-bottom: 1px #b8b8b8 solid;">
  9. <uni-row class="demo-uni-row">
  10. <uni-col :span="20">
  11. <view class="demo-uni-col dark"
  12. style="font-size: 36rpx;margin: -20rpx 0 0 0;font-weight: bold;letter-spacing:5rpx;">
  13. {{item.formData.title}}
  14. </view>
  15. </uni-col>
  16. <uni-col v-if="item.msgIsRead === '0'" :span="4">
  17. <view class="demo-uni-col light"
  18. style="color: rgb(55,186,189);margin-bottom: 10rpx;">
  19. 新进度
  20. </view>
  21. </uni-col>
  22. </uni-row>
  23. </view>
  24. <uni-row class="demo-uni-row">
  25. <uni-col>
  26. <view class="demo-uni-col light" style="padding: 26rpx;color: #b1b1b1;">
  27. {{item.formData.reason ? item.formData.reason : ''}}
  28. </view>
  29. </uni-col>
  30. </uni-row>
  31. <uni-row class="demo-uni-row">
  32. <uni-col :span="5">
  33. <view class="demo-uni-col light" style="color: #727272;">
  34. 申请人:
  35. </view>
  36. </uni-col>
  37. <uni-col :span="6">
  38. <view class="demo-uni-col light" style="color: #727272;">
  39. {{item.formData.apply_user_name}}
  40. </view>
  41. </uni-col>
  42. <uni-col :span="13">
  43. <view class="demo-uni-col light" style="color: #727272;">
  44. {{item.createTime}}
  45. </view>
  46. </uni-col>
  47. </uni-row>
  48. </view>
  49. <view></view>
  50. </view>
  51. </view>
  52. </scroll-list>
  53. </view>
  54. </template>
  55. <style lang="scss" scoped>
  56. // page {
  57. // background-color: #f3f3f3;
  58. // }
  59. .page-wrap {}
  60. .infoBody {
  61. background-color: #ffffff;
  62. padding: 40rpx;
  63. border-radius: 20rpx;
  64. margin: 20rpx;
  65. box-shadow: 0px 2px 10px #cccccc;
  66. }
  67. </style>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. option: {
  73. page: 1,
  74. size: 5,
  75. auto: true
  76. },
  77. page: 1,
  78. list: [],
  79. scrollList: [],
  80. total: 0,
  81. file_approval_flow_run_key: '',
  82. biz_leave_flow_run_key: '',
  83. reserve_consuming_flow_run_key: '',
  84. personnel_hire_approval_flow_run_key: '',
  85. personnel_dimission_approval_flow_run_key: '',
  86. isClick: false
  87. }
  88. },
  89. onLoad() {
  90. this.file_approval_flow_run_key = uni.getStorageSync('file_approval_flow_run_key')
  91. this.biz_leave_flow_run_key = uni.getStorageSync('biz_leave_flow_run_key')
  92. this.reserve_consuming_flow_run_key = uni.getStorageSync('reserve_consuming_flow_run_key')
  93. this.reserve_return_flow_run_key = uni.getStorageSync('reserve_return_flow_run_key')
  94. this.reserve_register_flow_run_key = uni.getStorageSync('reserve_register_flow_run_key')
  95. this.personnel_hire_approval_flow_run_key = uni.getStorageSync('personnel_hire_approval_flow_run_key')
  96. this.personnel_dimission_approval_flow_run_key = uni.getStorageSync(
  97. 'personnel_dimission_approval_flow_run_key')
  98. },
  99. onShow() {
  100. this.$refs.list.refresh()
  101. },
  102. methods: {
  103. handleTest(item) {
  104. if (this.isClick) {
  105. return
  106. }
  107. item.pageType = 1
  108. this.list = []
  109. uni.setStorageSync("approval", item)
  110. if (item.examplesId === this.file_approval_flow_run_key) {
  111. this.$goto('../ge/geNewsApproval')
  112. } else if (item.examplesId === this.biz_leave_flow_run_key) {
  113. this.$goto('../ge/geApproval')
  114. } else if (item.examplesId === this.reserve_register_flow_run_key) {
  115. this.$goto('../ge/geReserveApproval')
  116. } else if (item.examplesId === this.reserve_consuming_flow_run_key) {
  117. this.$goto('../ge/geReserveApproval')
  118. } else if (item.examplesId === this.reserve_return_flow_run_key) {
  119. this.$goto('../ge/geReserveApproval')
  120. } else if (item.examplesId === this.personnel_hire_approval_flow_run_key) {
  121. this.$goto('../ge/geEntry')
  122. } else if (item.examplesId === this.personnel_dimission_approval_flow_run_key) {
  123. this.$goto('../ge/geDimission')
  124. } else if (item.examplesId === uni.getStorageSync('interview_record_approval_flow_run_key')) {
  125. this.$goto('../ge/geInterview')
  126. } else if (item.examplesId === uni.getStorageSync('instant_notice_approval_flow_run_key')) {
  127. this.$goto('../ge/geNotice')
  128. } else if (item.examplesId === uni.getStorageSync('shift_official_approval_flow_run_key')) {
  129. this.$goto('../ge/geShiftOfficial')
  130. } else if (item.examplesId === uni.getStorageSync('use_seal_approval_flow_run_key')) {
  131. this.$goto('../ge/geUseSeal')
  132. } else if (item.examplesId === uni.getStorageSync('device_repairs_approval_flow_run_key')) {
  133. this.$goto('../ge/geDeviceRepairs')
  134. } else if (item.examplesId === uni.getStorageSync('device_scrap_approval_flow_run_key')) {
  135. this.$goto('../ge/geDeviceScrap')
  136. }else if (item.examplesId === uni.getStorageSync('purchase_approval_flow_run_key')) {
  137. this.$goto('../ge/gePurchase')
  138. }else if (item.examplesId === uni.getStorageSync('contract_approval_flow_run_key')) {
  139. this.$goto('../ge/geContract')
  140. }
  141. },
  142. async taskList(paging) {
  143. this.isClick = true
  144. // 发送请求
  145. const {
  146. data: res
  147. } = await this.$httpRequest({
  148. url: '/app/gtd?pageNum=' + paging.page + '&pageSize=' + paging.size,
  149. method: 'get',
  150. urlType: this.$getUrlType()
  151. });
  152. if (res.code === 200) {
  153. if (paging.page === 1) {
  154. this.scrollList = res.rows
  155. this.total = res.total
  156. this.$refs.list.loadSuccess({
  157. list: res.rows,
  158. total: this.total
  159. });
  160. } else if (paging.page > 1) {
  161. for (var i = 0; i < res.rows.length; i++) {
  162. this.scrollList.push(res.rows[i])
  163. }
  164. this.$refs.list.loadSuccess({
  165. list: this.scrollList,
  166. total: this.total
  167. });
  168. }
  169. this.isClick = false
  170. }
  171. },
  172. // 刷新
  173. refresh(paging) {
  174. this.taskList(paging)
  175. this.isClick = false
  176. },
  177. scrolltolower(e) {
  178. console.log(e)
  179. },
  180. load(paging) {
  181. this.taskList(paging)
  182. },
  183. loadSuccess(list) {
  184. this.list = list
  185. this.isClick = false
  186. }
  187. }
  188. }
  189. </script>