done.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="content pending">
  3. <u-sticky bgColor="#fff">
  4. <view class="search-wrap">
  5. <view class="input-wrap">
  6. <u-search
  7. bgColor='#fff'
  8. :showAction='false'
  9. :placeholder="$t('base.list.inputPlaceholder')"
  10. @search="searchList"
  11. @clear='searchList'
  12. v-model="keyword">
  13. </u-search>
  14. <view class="search-btn" @click="searchList">{{$t("customer_meter.search")}}</view>
  15. </view>
  16. <!-- <uni-icons type="settings-filled" size='24' @click="onClickRight"></uni-icons> -->
  17. </view>
  18. </u-sticky>
  19. <view class="swiper-box">
  20. <template v-if="allPendingList.length">
  21. <u-list @scrolltolower="scrolltolower" :preLoadScreen="1.5">
  22. <u-list-item v-for="(item, index) in allPendingList" :key="index">
  23. <view class="order-card">
  24. <view class="order-card-title">
  25. {{$t('approval.approvalTitle')}}:{{item.fullName}}
  26. <u-tag v-if="item.status == 1" size="mini" borderColor="#4680F9" bgColor="#fff" color="#4680F9" :text="$t('approval.adopt')"></u-tag>
  27. <u-tag v-else size="mini" borderColor="#4680F9" bgColor="#fff" color="#4680F9" :text="$t('approval.reject')"></u-tag>
  28. </view>
  29. <view class="order-info">
  30. <p class="info-line">
  31. <text class="label">{{$t('approval.process')}}:</text>
  32. <text class="info">{{item.flowName || ''}}</text>
  33. </p>
  34. <p class="info-line">
  35. <text class="label">{{$t('approval.originatingTime')}}:</text>
  36. <text class="info">{{formatTime(item.startTime) || ''}}</text>
  37. </p>
  38. <p class="info-line">
  39. <text class="label">{{$t('approval.originator')}}:</text>
  40. <text class="info">{{item.userName || ''}}</text>
  41. </p>
  42. <p class="info-line">
  43. <text class="label">{{$t('approval.currentNode')}}:</text>
  44. <text class="info">{{item.currentNodeName}}</text>
  45. </p>
  46. <!-- <p class="info-line">
  47. <text class="label">{{$t('approval.urgency')}}</text>
  48. <text class="info" v-if="item.flowUrgent == 1">{{$t('approval.ordinary')}}</text>
  49. <text class="info" v-if="item.flowUrgent == 2">{{$t('approval.important')}}</text>
  50. <text class="info" v-if="item.flowUrgent == 3">{{$t('approval.urgent')}}</text>
  51. </p> -->
  52. <p class="info-line">
  53. <text class="label">{{$t('approval.timeReceipt')}}:</text>
  54. <text class="info">{{item.claimTime || ''}}</text>
  55. </p>
  56. <p class="info-line">
  57. <text class="label">{{$t('approval.handlingTime')}}:</text>
  58. <text class="info">{{item.creatorTime || ''}}</text>
  59. </p>
  60. </view>
  61. <view>
  62. <view class="card-oper">
  63. <view class="btn" v-if="item.currentNodeName != '流程已结束'">
  64. <button class="oper-btn red" @click="recall(item)">{{$t('approval.withdraw')}}</button>
  65. </view>
  66. <view class="btn">
  67. <button class="oper-btn bule" @click="checkView(item)">{{$t('approval.details')}}</button>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </u-list-item>
  73. </u-list>
  74. </template>
  75. <template v-else>
  76. <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
  77. </u-empty>
  78. </template>
  79. </view>
  80. <u-loading-page
  81. color="#666"
  82. loading-mode="semicircle"
  83. :loading="loading">
  84. </u-loading-page>
  85. <u-modal :show="showRecall" @confirm="confirm" ref="addModal" showCancelButton closeOnClickOverlay @cancel="showRecall=false" @close="showRecall=false">
  86. <view class="invite-box">
  87. <view class="invite-box-title">{{$t('approval.reasonWithdrawal')}}</view>
  88. <u--input :placeholder="$t('base.common.placeholderI')+$t('approval.reasonWithdrawal')" border="surround" v-model="handleOpinion"></u--input>
  89. </view>
  90. </u-modal>
  91. <u-toast ref="loadingToast" />
  92. </view>
  93. </template>
  94. <script>
  95. import dayjs from 'dayjs'
  96. import {
  97. getPendingList,
  98. recall, //撤回
  99. } from "../../api/approval"
  100. export default {
  101. data(){
  102. return{
  103. dayjs,
  104. handleOpinion:"",
  105. showRecall:false,
  106. page: {
  107. pages: 1,
  108. size: 10,
  109. },
  110. hasMore:false,
  111. allPendingList:[],
  112. keyword:'',
  113. loading:true,
  114. }
  115. },
  116. onLoad(options) {
  117. this.getPendingList()
  118. },
  119. methods:{
  120. getPendingList(){
  121. this.loading=true
  122. let data={
  123. currentPage:this.page.pages,
  124. pageSize:this.page.size,
  125. keyword:this.keyword || '',
  126. }
  127. getPendingList(2,data).then(res=>{
  128. if (res.data.code == 200) {
  129. if (this.hasMore) {
  130. this.allPendingList = [
  131. ...this.allPendingList,
  132. ...res.data.data.list,
  133. ];
  134. } else {
  135. this.allPendingList = res.data.data.list;
  136. }
  137. console.log(this.allPendingList);
  138. this.total = res.data.data.pagination.total
  139. if (this.allPendingList.length >= this.total) {
  140. this.hasMore = false;
  141. } else {
  142. this.hasMore = true;
  143. }
  144. this.loading = false
  145. }
  146. })
  147. },
  148. recall(item){
  149. this.currentItem = item
  150. this.showRecall = true
  151. },
  152. //
  153. confirm(){
  154. let _this=this
  155. this.$refs.loadingToast.show({
  156. type:"loading",
  157. message: _this.$t('base.common.loading'),
  158. duration:'100000',
  159. })
  160. this.showRecall = false
  161. recall(this.currentItem.id,{handleOpinion:this.handleOpinion}).then(res=>{
  162. this.$refs.loadingToast.hide()
  163. if(res.data.code == 200){
  164. uni.showToast({
  165. title: _this.$t('approval.withdrawalSucceeded'),
  166. icon: 'success',
  167. })
  168. this.searchList()
  169. }else{
  170. uni.showModal({
  171. // title: '提示',
  172. content: res.data.msg || _this.$t('base.common.equestFailed'),
  173. showCancel: false,
  174. })
  175. }
  176. })
  177. },
  178. checkView(item){
  179. console.log(item);
  180. uni.navigateTo({ url: '/subpages/approvalform/'+item.flowCode+'?id='+item.processId })
  181. },
  182. //加载更多
  183. scrolltolower() {
  184. console.log("1111111111111111");
  185. if (this.hasMore) {
  186. this.page.pages += 1;
  187. this.getPendingList();
  188. }
  189. },
  190. //搜索列表
  191. searchList(){
  192. this.page.pages = 1
  193. this.hasMore = false
  194. this.getPendingList()
  195. },
  196. //转化时间
  197. formatTime(time){
  198. let str =''
  199. if(time){
  200. time = Number(time)
  201. str=dayjs(time).format('YYYY-MM-DD HH:mm:ss')
  202. }else{
  203. str =''
  204. }
  205. return str
  206. }
  207. }
  208. }
  209. </script>
  210. <style>
  211. /* #ifndef APP-NVUE */
  212. view {
  213. /* display: flex; */
  214. box-sizing: border-box;
  215. /* flex-direction: column; */
  216. }
  217. page {
  218. box-sizing: border-box;
  219. /* padding: 40rpx 40rpx 80rpx; */
  220. height: 100%;
  221. }
  222. /* #endif*/
  223. </style>
  224. <style lang="scss" scoped>
  225. @import '../../common/css/approval.scss';
  226. </style>