applicantsList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <view>
  3. <u-navbar title="申请人列表" title-color="#101010">
  4. </u-navbar>
  5. <view class="search-box">
  6. <u-search @custom="getApprovalList(true)"
  7. placeholder="搜索授权用户" bg-color="#f2f4f6" height="80" :show-action="true" v-model="keyword">
  8. </u-search>
  9. </view>
  10. <!-- 列表 -->
  11. <view class="member-list">
  12. <view class="item" v-for="(item,i) in list" >
  13. <view class="infos">
  14. <view class="name">
  15. {{item.createByName}}
  16. </view>
  17. <view class="tel-time">
  18. <span class="tel" >{{item.createByPhone}}</span>
  19. </view>
  20. </view>
  21. <!-- 通过 -->
  22. <view class="infos2" v-if="item.status==0">
  23. <view class="pass" @click="switchBtnApi(item,1)" >
  24. 通过
  25. </view>
  26. <view class="passNo" @click="switchBtnApi(item,2)" >
  27. 拒绝
  28. </view>
  29. </view>
  30. <!-- 已通过 -->
  31. <view class="passed" v-else >
  32. {{item.statusN}}
  33. </view>
  34. </view>
  35. </view>
  36. <u-divider :isnone="list.length==0"
  37. nonetext="暂无记录" border-color="#CFD2D5">
  38. 已经到底了</u-divider>
  39. </view>
  40. </template>
  41. <script>
  42. import * as API from '@/apis/pagejs/managementList.js'
  43. export default {
  44. data() {
  45. return {
  46. keyword:"",
  47. pass:false,
  48. pageIndex: 1,
  49. recordsTotal: 0,
  50. list:[],
  51. }
  52. },
  53. onReady() {
  54. this.getApprovalList()
  55. },
  56. onReachBottom() {
  57. if (this.list.length < this.recordsTotal) {
  58. this.myLoadmore();
  59. }
  60. },
  61. methods: {
  62. switchBtnApiMethod(node,key){
  63. uni.showLoading({
  64. title: "加载中",
  65. mask: true,
  66. })
  67. API.approvalNext({
  68. id:node.id,
  69. status:key
  70. }).then((res) => {
  71. uni.hideLoading();
  72. this.getApprovalList(true)
  73. }).catch(error => {
  74. uni.showToast({
  75. title: error,
  76. icon: "none"
  77. })
  78. })
  79. },
  80. switchBtnApi(node,key){
  81. uni.showModal({
  82. confirmColor:`${key==1?'#3CC51F':'red'}`,
  83. confirmText:`${key==1?'通过':'拒绝'}`,
  84. content: `确认是否要"${key==1?'通过':'拒绝'}"${node.createByName}`,
  85. title: "提示",
  86. success:res=> {
  87. if(res.confirm){
  88. this.switchBtnApiMethod(node,key);
  89. }
  90. }
  91. })
  92. console.log(node,key)
  93. },
  94. myLoadmore() {
  95. this.pageIndex += 1;
  96. this.getApprovalList();
  97. },
  98. getApprovalList(bl) {
  99. uni.showLoading({
  100. title: "加载中",
  101. mask: true,
  102. })
  103. if (bl) {
  104. this.list = [];
  105. this.pageIndex = 1;
  106. }
  107. API.approvalList({
  108. pageIndex:this.pageIndex,
  109. pageSize:20,
  110. nameOrPhone:this.keyword
  111. }).then((res) => {
  112. uni.hideLoading();
  113. this.list = [
  114. ...this.list,
  115. ...res.data.data
  116. ];
  117. this.recordsTotal = res.data.recordsTotal;
  118. }).catch(error => {
  119. uni.showToast({
  120. title: error,
  121. icon: "none"
  122. })
  123. })
  124. },
  125. }
  126. }
  127. </script>
  128. <style>
  129. page{
  130. padding-bottom: 100px;
  131. }
  132. </style>
  133. <style lang="scss" scoped>
  134. .search-box {
  135. padding: 16rpx 32rpx;
  136. position: sticky;
  137. top: 88rpx;
  138. z-index: 999;
  139. background-color: rgba(255,255,255,1);
  140. /deep/.u-content {
  141. border-radius: 8px !important;
  142. }
  143. ;
  144. /deep/.u-search {
  145. position: relative
  146. }
  147. ;
  148. /deep/.u-action {
  149. width: 96rpx;
  150. line-height: 56rpx;
  151. border-radius: 4px;
  152. background-color: rgba(22, 119, 255, 1);
  153. color: rgba(255, 255, 255, 1);
  154. text-align: center;
  155. z-index: 9999;
  156. position: absolute;
  157. right: 12rpx;
  158. }
  159. }
  160. // 列表
  161. .member-list{
  162. background: #fff;
  163. .item{
  164. padding: 32rpx 0;
  165. margin: 0 32rpx;
  166. display: flex;
  167. align-items: center;
  168. border-bottom: 1px solid rgba(244,244,244,1);;
  169. border-bottom: 1px solid #f4f4f4;
  170. justify-content: space-between;
  171. }
  172. .photo{
  173. img{
  174. width: 80rpx;
  175. height: 80rpx;
  176. border-radius: 50px;
  177. }
  178. }
  179. .infos2{
  180. display: flex;
  181. align-items: center;
  182. justify-content: space-between;
  183. }
  184. .infos{
  185. margin-left: 16rpx;
  186. .name{
  187. color: rgba(51,51,51,1);
  188. font-size: 32rpx;
  189. }
  190. .tel-time{
  191. font-size: 24rpx;
  192. margin-top: 4rpx;
  193. .tel{
  194. color: rgba(119,119,119,1);
  195. }
  196. .time{
  197. color: #999999;
  198. margin-left: 16rpx;
  199. }
  200. }
  201. }
  202. .pass{
  203. width: 120rpx;
  204. height: 56rpx;
  205. line-height: 56rpx;
  206. border-radius: 50px;
  207. background-color: rgba(0,185,98,1);
  208. color: rgba(255,255,255,1);
  209. text-align: center;
  210. margin-left: auto;
  211. }
  212. .passNo{
  213. width: 120rpx;
  214. height: 56rpx;
  215. line-height: 56rpx;
  216. border-radius: 50px;
  217. background-color: #CCCCCC ;
  218. color: rgba(255,255,255,1);
  219. text-align: center;
  220. margin-left: 20rpx;
  221. }
  222. .passed{
  223. margin-left: auto;
  224. color: rgba(153,153,153,1);
  225. }
  226. }
  227. </style>