launch.vue 8.2 KB

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