MyApproval.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. console.log(this.isClick)
  105. if (this.isClick) {
  106. return
  107. }
  108. item.pageType = 1
  109. this.list = []
  110. uni.setStorageSync("approval", item)
  111. if (item.examplesId === this.file_approval_flow_run_key) {
  112. this.$goto('../ge/geNewsApproval')
  113. } else if (item.examplesId === this.biz_leave_flow_run_key) {
  114. this.$goto('../ge/geApproval')
  115. } else if (item.examplesId === this.reserve_register_flow_run_key) {
  116. this.$goto('../ge/geReserveApproval')
  117. } else if (item.examplesId === this.reserve_consuming_flow_run_key) {
  118. this.$goto('../ge/geReserveApproval')
  119. } else if (item.examplesId === this.reserve_return_flow_run_key) {
  120. this.$goto('../ge/geReserveApproval')
  121. } else if (item.examplesId === this.personnel_hire_approval_flow_run_key) {
  122. this.$goto('../ge/geEntry')
  123. } else if (item.examplesId === this.personnel_dimission_approval_flow_run_key) {
  124. this.$goto('../ge/geDimission')
  125. } else if (item.examplesId === uni.getStorageSync('interview_record_approval_flow_run_key')) {
  126. this.$goto('../ge/geInterview')
  127. } else if (item.examplesId === uni.getStorageSync('instant_notice_approval_flow_run_key')) {
  128. this.$goto('../ge/geNotice')
  129. } else if (item.examplesId === uni.getStorageSync('shift_official_approval_flow_run_key')) {
  130. this.$goto('../ge/geShiftOfficial')
  131. } else if (item.examplesId === uni.getStorageSync('use_seal_approval_flow_run_key')) {
  132. this.$goto('../ge/geUseSeal')
  133. } else if (item.examplesId === uni.getStorageSync('device_repairs_approval_flow_run_key')) {
  134. this.$goto('../ge/geDeviceRepairs')
  135. } else if (item.examplesId === uni.getStorageSync('device_scrap_approval_flow_run_key')) {
  136. this.$goto('../ge/geDeviceScrap')
  137. }else if (item.examplesId === uni.getStorageSync('purchase_approval_flow_run_key')) {
  138. this.$goto('../ge/gePurchase')
  139. }
  140. },
  141. async taskList(paging) {
  142. this.isClick = true
  143. // 发送请求
  144. const {
  145. data: res
  146. } = await this.$httpRequest({
  147. url: '/app/gtd?pageNum=' + paging.page + '&pageSize=' + paging.size,
  148. method: 'get',
  149. urlType: this.$getUrlType()
  150. });
  151. if (res.code === 200) {
  152. if (paging.page === 1) {
  153. this.scrollList = res.rows
  154. this.total = res.total
  155. this.$refs.list.loadSuccess({
  156. list: res.rows,
  157. total: this.total
  158. });
  159. } else if (paging.page > 1) {
  160. for (var i = 0; i < res.rows.length; i++) {
  161. this.scrollList.push(res.rows[i])
  162. }
  163. this.$refs.list.loadSuccess({
  164. list: this.scrollList,
  165. total: this.total
  166. });
  167. }
  168. this.isClick = false
  169. }
  170. },
  171. // 刷新
  172. refresh(paging) {
  173. this.taskList(paging)
  174. this.isClick = false
  175. },
  176. scrolltolower(e) {
  177. console.log(e)
  178. },
  179. load(paging) {
  180. this.taskList(paging)
  181. },
  182. loadSuccess(list) {
  183. this.list = list
  184. this.isClick = false
  185. }
  186. }
  187. }
  188. </script>