applicantsList.vue 8.9 KB

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