applicantsList.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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-info" v-for="(item,i) in list" @click="infoBtn(item)" >
  13. <view class="item" >
  14. <view class="infos">
  15. <view class="name">
  16. {{item.createByName}}
  17. </view>
  18. <view class="tel-time">
  19. <span class="tel" >{{item.createByPhone}}</span>
  20. </view>
  21. </view>
  22. <!-- 通过 -->
  23. <view class="infos3" v-if="item.status==0">
  24. <view class="infos2">
  25. <view class="pass" @click="switchBtnApi(item,1)" >
  26. 通过
  27. </view>
  28. <view class="passNo" @click="switchBtnApi(item,2)" >
  29. 拒绝
  30. </view>
  31. </view>
  32. <view style=" color: #999999;">
  33. <span class="tel" >{{item.createTime}}</span>
  34. </view>
  35. </view>
  36. <!-- 已通过 -->
  37. <view class="passed" style="text-align: end;" v-else >
  38. <view>
  39. {{item.statusN}}
  40. </view>
  41. <view >
  42. <span class="tel" >{{item.createTime}}</span>
  43. </view>
  44. </view>
  45. </view>
  46. <view >
  47. <view class="remark" style="width: 100%;" >
  48. <textarea style="background-color: #f5f5f5;height: 100rpx;width: 90%;padding: 20rpx;border-radius: 5px;margin: 20rpx;font-size: 28rpx;" v-model="item.vmodelremark" disabled >
  49. </textarea>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <u-divider :isnone="list.length==0"
  55. nonetext="暂无记录" border-color="#CFD2D5">
  56. 已经到底了</u-divider>
  57. <u-popup v-model="show" mode="bottom">
  58. <view class="popup2" >
  59. <view class="title">
  60. {{userName}}-权限管理
  61. <view class="title2">返回上一页面可继续分配权限</view>
  62. </view>
  63. <scroll-view scroll-y="true" style="height: 600rpx;" >
  64. <u-checkbox-group style=" width: 100%;" @change="checkboxGroupChange">
  65. <view class="content">
  66. <view class="item" v-for="(item,i) in meterList" >
  67. <view class="item-title">
  68. {{replaceLastTwoWords(item.name)}}
  69. </view>
  70. <view class="item-radio">
  71. <!-- <label class="radio">
  72. <radio value="" /><text></text>
  73. </label> -->
  74. <u-checkbox
  75. v-model="item.checked"
  76. :name="item.id"
  77. ></u-checkbox>
  78. </view>
  79. </view>
  80. </view>
  81. </u-checkbox-group>
  82. <u-divider border-color="#CFD2D5">
  83. 已经到底了</u-divider>
  84. </scroll-view>
  85. <view class="popup-bottom">
  86. <view class="button cancel" @click="show=false">
  87. 取消
  88. </view>
  89. <view class="button save" @click="submitBtn()" >
  90. 保存
  91. </view>
  92. </view>
  93. </view>
  94. </u-popup>
  95. </view>
  96. </template>
  97. <script>
  98. import * as API from '@/apis/pagejs/managementList.js'
  99. export default {
  100. data() {
  101. return {
  102. keyword:"",
  103. pass:false,
  104. pageIndex: 1,
  105. recordsTotal: 0,
  106. list:[],
  107. meterList:[],
  108. meterListIn:[],
  109. userId:"",
  110. userName:"",
  111. show:false,
  112. }
  113. },
  114. onReady() {
  115. this.getApprovalList()
  116. },
  117. onReachBottom() {
  118. if (this.list.length < this.recordsTotal) {
  119. this.myLoadmore();
  120. }
  121. },
  122. methods: {
  123. infoBtn(item){
  124. if(0){
  125. //测试用
  126. this.getAuthorizedUserDetails(item.createBy)
  127. }
  128. if(item.status==1){
  129. uni.showToast({
  130. title: "返回上一页面可分配权限",
  131. icon: "none"
  132. })
  133. }
  134. },
  135. vmodelremark(item){
  136. var remark=(item.informationTitle?'申请授权:'+item.informationTitle:'')+
  137. (item.remark?'\n申请备注:'+item.remark:'')
  138. item.vmodelremark=remark
  139. },
  140. submitBtn(){
  141. uni.showLoading({
  142. title: "加载中",
  143. mask: true,
  144. })
  145. var meterIds="";
  146. if(this.meterListIn.length){
  147. meterIds=this.meterListIn.join()
  148. }
  149. API.authorizedUserSave({
  150. userId:this.userId,
  151. meterIds:meterIds,
  152. }).then((res) => {
  153. //this.userId=id;
  154. uni.hideLoading();
  155. //this.meterList=res.data.meterList;
  156. this.show=false
  157. uni.showModal({
  158. title:"提示",
  159. content:"设置成功",
  160. showCancel:false,
  161. })
  162. }).catch(error => {
  163. uni.showToast({
  164. title: error,
  165. icon: "none"
  166. })
  167. })
  168. },
  169. checkboxGroupChange(e){
  170. console.log(e)
  171. this.meterListIn=e
  172. },
  173. getAuthorizedUserDetails(id) {
  174. uni.showLoading({
  175. title: "加载中",
  176. mask: true,
  177. })
  178. API.authorizedUserDetails({
  179. userId:id,
  180. }).then((res) => {
  181. this.userId=id;
  182. uni.hideLoading();
  183. this.meterList=res.data.meterList;
  184. this.show=true
  185. this.meterListIn=[]
  186. for(var i in this.meterList){
  187. var obj=this.meterList[i]
  188. if(obj.checked){
  189. this.meterListIn.push(obj.id)
  190. }
  191. }
  192. }).catch(error => {
  193. uni.showToast({
  194. title: error,
  195. icon: "none"
  196. })
  197. })
  198. },
  199. switchBtnApiMethod(node,key){
  200. uni.showLoading({
  201. title: "加载中",
  202. mask: true,
  203. })
  204. API.approvalNext({
  205. id:node.id,
  206. status:key
  207. }).then((res) => {
  208. uni.hideLoading();
  209. if(key==1){
  210. this.getAuthorizedUserDetails(node.createBy)
  211. this.userName=node.createByName
  212. }
  213. this.getApprovalList(true)
  214. }).catch(error => {
  215. uni.showToast({
  216. title: error,
  217. icon: "none"
  218. })
  219. })
  220. },
  221. switchBtnApi(node,key){
  222. uni.showModal({
  223. confirmColor:`${key==1?'#3CC51F':'red'}`,
  224. confirmText:`${key==1?'通过':'拒绝'}`,
  225. content: `确认是否要"${key==1?'通过':'拒绝'}"${node.createByName}`,
  226. title: "提示",
  227. success:res=> {
  228. if(res.confirm){
  229. this.switchBtnApiMethod(node,key);
  230. }
  231. }
  232. })
  233. console.log(node,key)
  234. },
  235. myLoadmore() {
  236. this.pageIndex += 1;
  237. this.getApprovalList();
  238. },
  239. getApprovalList(bl) {
  240. uni.showLoading({
  241. title: "加载中",
  242. mask: true,
  243. })
  244. if (bl) {
  245. this.list = [];
  246. this.pageIndex = 1;
  247. }
  248. API.approvalList({
  249. pageIndex:this.pageIndex,
  250. pageSize:20,
  251. nameOrPhone:this.keyword
  252. }).then((res) => {
  253. uni.hideLoading();
  254. this.list = [
  255. ...this.list,
  256. ...res.data.data
  257. ];
  258. for(var i in this.list){
  259. var obj=this.list[i]
  260. this.vmodelremark(obj)
  261. }
  262. this.recordsTotal = res.data.recordsTotal;
  263. }).catch(error => {
  264. uni.showToast({
  265. title: error,
  266. icon: "none"
  267. })
  268. })
  269. },
  270. }
  271. }
  272. </script>
  273. <style>
  274. </style>
  275. <style lang="scss" scoped>
  276. .search-box {
  277. padding: 16rpx 32rpx;
  278. position: sticky;
  279. top: 88rpx;
  280. z-index: 999;
  281. background-color: rgba(255,255,255,1);
  282. /deep/.u-content {
  283. border-radius: 8px !important;
  284. }
  285. ;
  286. /deep/.u-search {
  287. position: relative
  288. }
  289. ;
  290. /deep/.u-action {
  291. width: 96rpx;
  292. line-height: 56rpx;
  293. border-radius: 4px;
  294. background-color: rgba(22, 119, 255, 1);
  295. color: rgba(255, 255, 255, 1);
  296. text-align: center;
  297. z-index: 9999;
  298. position: absolute;
  299. right: 12rpx;
  300. }
  301. }
  302. // 列表
  303. .member-list{
  304. background: #fff;
  305. .item-info{
  306. padding: 32rpx 0;
  307. margin: 0 32rpx;
  308. border-bottom: 1px solid rgba(244,244,244,1);;
  309. border-bottom: 1px solid #f4f4f4;
  310. }
  311. .item{
  312. display: flex;
  313. align-items: center;
  314. justify-content: space-between;
  315. }
  316. .photo{
  317. img{
  318. width: 80rpx;
  319. height: 80rpx;
  320. border-radius: 50px;
  321. }
  322. }
  323. .infos2{
  324. display: flex;
  325. align-items: center;
  326. justify-content: space-between;
  327. }
  328. .infos{
  329. margin-left: 16rpx;
  330. .name{
  331. color: rgba(51,51,51,1);
  332. font-size: 32rpx;
  333. }
  334. .tel-time{
  335. font-size: 24rpx;
  336. margin-top: 4rpx;
  337. .tel{
  338. color: rgba(119,119,119,1);
  339. }
  340. .time{
  341. color: #999999;
  342. margin-left: 16rpx;
  343. }
  344. }
  345. }
  346. .pass{
  347. width: 120rpx;
  348. height: 56rpx;
  349. line-height: 56rpx;
  350. border-radius: 50px;
  351. background-color: rgba(0,185,98,1);
  352. color: rgba(255,255,255,1);
  353. text-align: center;
  354. margin-left: auto;
  355. }
  356. .passNo{
  357. width: 120rpx;
  358. height: 56rpx;
  359. line-height: 56rpx;
  360. border-radius: 50px;
  361. background-color: #CCCCCC ;
  362. color: rgba(255,255,255,1);
  363. text-align: center;
  364. margin-left: 20rpx;
  365. }
  366. .passed{
  367. margin-left: auto;
  368. color: rgba(153,153,153,1);
  369. }
  370. }
  371. // 人员权限管理
  372. .popup2{
  373. padding: 32rpx 0;
  374. .title{
  375. color: rgba(16,16,16,1);
  376. font-size: 36rpx;
  377. font-weight: bold;
  378. text-align: center;
  379. }
  380. .title2{
  381. color: red;
  382. font-size: 32rpx;
  383. font-weight: 400;
  384. text-align: center;
  385. }
  386. .content{
  387. width: 100%;
  388. margin-bottom: 24rpx;
  389. .item{
  390. display: flex;
  391. align-items: center;
  392. justify-content: space-between;
  393. padding: 28rpx 30rpx;
  394. border-bottom: 1px solid rgba(245,245,245,1);
  395. }
  396. }
  397. .popup-bottom{
  398. display: flex;
  399. justify-content: space-between;
  400. padding: 0 32rpx;
  401. .button{
  402. width: 328rpx;
  403. height: 80rpx;
  404. line-height: 80rpx;
  405. border-radius: 4px;
  406. font-size: 32rpx;
  407. text-align: center;
  408. }
  409. .cancel{
  410. background-color: rgba(222,225,228,1);
  411. color: rgba(51,51,51,1);
  412. }
  413. .save{
  414. background-color: rgba(22,119,255,1);
  415. color: rgba(255,255,255,1);
  416. }
  417. }
  418. }
  419. </style>