zhiYuanZhe.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. <template>
  2. <view class="box">
  3. <u-navbar :autoBack="true" title="志愿者管理" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
  4. <view class="filter-box">
  5. <view class="b-item" v-for="(item, index) in tabList" :key="index" :class="{ active: index == tab }" @click="tabBtn(index)">
  6. <view class="">{{ item.name }}</view>
  7. </view>
  8. </view>
  9. <!-- 名单 -->
  10. <view class="" v-if="tab === 0">
  11. <view class="top_box">
  12. <view class="" style="width: 100%; display: flex; justify-content: space-between; align-items: center">
  13. <view class="top_item">
  14. <view class="">区域:</view>
  15. <view class="xz2" @click="selectArea">
  16. <view class="">{{ Areatit ? Areatit : '请选择' }}</view>
  17. <view class="">
  18. <uni-icons type="down" size="22" color=""></uni-icons>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="top_item" @click="show = true">
  23. <view class="">状态:</view>
  24. <view class="xz">
  25. <view class="">{{ statetit ? statetit : '请选择' }}</view>
  26. <view class="">
  27. <uni-icons type="down" size="22" color=""></uni-icons>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="scarch_box">
  33. <u-search
  34. @custom="search"
  35. :actionStyle="{ color: '#985741', fontSize: '28rpx', fontWeight: 'bold' }"
  36. height="25"
  37. shape="square"
  38. placeholder="输入关键字搜索"
  39. v-model.trim="value"
  40. ></u-search>
  41. </view>
  42. </view>
  43. <view class="jl_box">
  44. <view class="tit_box">
  45. <view style="width: 130rpx" class="">姓名</view>
  46. <view style="width: 130rpx">电话</view>
  47. <view style="width: 130rpx">地址</view>
  48. <view style="width: 130rpx">操作</view>
  49. </view>
  50. <scroll-view v-if="recordList.length > 0" style="height: 800rpx" scroll-y="true" @scrolltolower="LoadMore">
  51. <view @click="mingDandetailsBtn(item.id)" class="jl_item" v-for="item in recordList" :key="item.id">
  52. <view class="bk">
  53. {{ item.name }}
  54. </view>
  55. <view class="bk sl">
  56. {{ item.mobile }}
  57. </view>
  58. <view class="bk">
  59. {{ item.address }}
  60. </view>
  61. <view class="bk">
  62. <view class="ck">详情</view>
  63. </view>
  64. </view>
  65. </scroll-view>
  66. <u-empty v-else text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  67. </view>
  68. </view>
  69. <u-picker keyName="label" :show="show" @cancel="show = false" :columns="columnsList" @close="close" :closeOnClickOverlay="true" @confirm="qyBtn"></u-picker>
  70. <!-- 审核 -->
  71. <view class="" v-if="tab === 1">
  72. <view class="jl_box">
  73. <view class="tit_box">
  74. <view style="width: 130rpx" class="">姓名</view>
  75. <view style="width: 130rpx">电话</view>
  76. <view style="width: 130rpx">地址</view>
  77. <view style="width: 130rpx">状态</view>
  78. <view style="width: 130rpx">操作</view>
  79. </view>
  80. <scroll-view v-if="toExamine.length > 0" style="height: 800rpx" scroll-y="true" @scrolltolower="LoadMoress">
  81. <view class="jl_item" v-for="item in toExamine" :key="item.id">
  82. <view class="bk">
  83. {{ item.name }}
  84. </view>
  85. <view class="bk">
  86. {{ item.mobile }}
  87. </view>
  88. <view class="bk">
  89. {{ item.address }}
  90. </view>
  91. <view class="bk" :class="{ zhuxiao: item.status_text == '注销' }">
  92. {{ item.status_text }}
  93. </view>
  94. <view class="bk" @click="detailsBtn(item.id)">
  95. <view class="ck">详情</view>
  96. <!-- <view style="width: 170rpx; margin-left: 20rpx" class="ck">
  97. <view class="" @click.stop="agreeBtn(item.id)">同意</view>
  98. <view class="">/</view>
  99. <view @click.stop="returnBtn(item.id)" style="margin-left: 10rpx">驳回</view>
  100. </view> -->
  101. </view>
  102. </view>
  103. </scroll-view>
  104. <u-empty v-else text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty>
  105. </view>
  106. </view>
  107. <!-- 信息弹层 -->
  108. <u-popup bgColor="#f2c8a2" :show="detailsShow" @close="close" mode="center" customStyle="width:600rpx;padding: 30rpx;" round="20rpx">
  109. <view class="ban_box">
  110. <view>
  111. <view class="">姓名:{{ detailsList.name }}</view>
  112. <view class="">联系方式:{{ detailsList.mobile }}</view>
  113. <view class="">住址:{{ detailsList.address }}</view>
  114. <view class="">单位:{{ detailsList.unit_name }}</view>
  115. </view>
  116. <view class="">身份证:{{ detailsList.id_card }}</view>
  117. <view style="height: 300rpx; overflow: scroll">个人简介:{{ detailsList.intro || '暂无介绍' }}</view>
  118. <view class="bt_box">
  119. <view class="bt1" @click="(detailsShow = false), (returnShow = true)">驳回</view>
  120. <view @click="agreeBtn" class="bt2">同意</view>
  121. </view>
  122. </view>
  123. </u-popup>
  124. <!-- 驳回描述弹层 -->
  125. <u-popup bgColor="#f2c8a2" :show="returnShow" @close="close" mode="center" customStyle="width:600rpx;padding: 30rpx;" round="20rpx">
  126. <view style="text-align: center; font-size: 30rpx">确认驳回该申请吗?</view>
  127. <view style="margin-top: 20rpx">
  128. <u--textarea height="80" v-model.trim="returnVal" placeholder="请填写驳回原因:"></u--textarea>
  129. </view>
  130. <view class="bt_box">
  131. <view
  132. class="bt1"
  133. @click.stop="
  134. returnShow = false;
  135. returnVal = '';
  136. "
  137. >
  138. 取消
  139. </view>
  140. <view @click.stop="isOk" class="bt2">确认</view>
  141. </view>
  142. </u-popup>
  143. <tki-tree ref="tkitree" idKey="id" @confirm="onnodeclick" :range="regionList" rangeKey="title" selectParent confirmColor="#4e8af7" />
  144. </view>
  145. </template>
  146. <script>
  147. let that;
  148. export default {
  149. data() {
  150. return {
  151. Areatit: '',
  152. statetit: '',
  153. id: '' /* 区域管理id */,
  154. id2: '' /* 记录区域管理id */,
  155. regionList: [] /* 区域列表 */,
  156. value: '',
  157. page: 1,
  158. tab: 0,
  159. statusId: '',
  160. AreaId: '',
  161. volunteer_id: '' /*志愿者id */,
  162. isLoading: false,
  163. show: false,
  164. returnId: '',
  165. detailsShow: false /* 详情弹层 */,
  166. detailsList: {} /* 详情 */,
  167. returnShow: false /* 弹层 */,
  168. returnVal: '' /* 驳回原因 */,
  169. tabList: [
  170. {
  171. name: '名单'
  172. },
  173. {
  174. name: '审核'
  175. }
  176. ],
  177. columnsList: [
  178. [
  179. { label: '培训中', id: 1 },
  180. { label: '待审核', id: 0 },
  181. { label: '驳回', id: -1 },
  182. { label: '申请注销', id: -2 },
  183. { label: '已注销', id: -3 }
  184. ]
  185. ],
  186. optionIndex: 0,
  187. optionList: [],
  188. // 名单
  189. recordList: [],
  190. /* 审核数据列表 */
  191. toExamine: []
  192. };
  193. },
  194. onLoad(o) {
  195. that = this;
  196. this.id = o.id;
  197. this.id2 = o.id;
  198. this.lists();
  199. this.getCulturalRelicCategory();
  200. },
  201. methods: {
  202. // 名单
  203. lists(id) {
  204. this.isLoading = true;
  205. this.$api.lists({ region_id: id || this.id, status: this.statusId, keywords: this.value, page: this.page, pageSize: 30, main_body_id: 1 }, function (res) {
  206. console.log(res, '名单');
  207. if (res.code == 1) {
  208. that.isLoading = false;
  209. that.recordList = [...that.recordList, ...res.data];
  210. } else {
  211. that.$common.errorToShow(res.msg);
  212. }
  213. });
  214. },
  215. auditingLists() {
  216. this.isLoading = true;
  217. this.$api.lists({ status: '0,-2', page: this.page, pageSize: 10, main_body_id: 1 }, function (res) {
  218. console.log(res, '审核列表');
  219. if (res.code == 1) {
  220. that.isLoading = false;
  221. that.toExamine = [...that.toExamine, ...res.data];
  222. }
  223. });
  224. },
  225. LoadMore() {
  226. if (this.isLoading) {
  227. return;
  228. } else {
  229. // this.value = '';
  230. this.page++;
  231. this.lists();
  232. }
  233. },
  234. LoadMoress() {
  235. if (this.isLoading) {
  236. return;
  237. } else {
  238. this.page++;
  239. this.auditingLists();
  240. }
  241. },
  242. // 详情
  243. detailsBtn(id) {
  244. // console.log(id, 'idid');
  245. this.volunteer_id = id;
  246. this.detailsShow = true;
  247. this.$api.details({ main_body_id: 1, volunteer_id: id }, function (res) {
  248. // console.log(res, 666666666);
  249. if (res.code === 1) {
  250. that.detailsList = res.data;
  251. } else {
  252. that.$common.errorToShow('请稍后再试');
  253. }
  254. });
  255. },
  256. mingDandetailsBtn(id) {
  257. uni.navigateTo({
  258. url: '/index_fenbao/fuWu/paiMing/xiangQing?id=' + id
  259. });
  260. },
  261. tabBtn(i) {
  262. this.tab = i;
  263. this.page = 1;
  264. this.statusId = '';
  265. // this.id = this.id;
  266. if (i == 0) {
  267. that.toExamine = [];
  268. this.lists();
  269. } else {
  270. that.recordList = [];
  271. this.auditingLists();
  272. }
  273. },
  274. qyBtn(e) {
  275. // console.log(e);
  276. this.statetit = e.value[0].label;
  277. this.statusId = e.value[0].id;
  278. this.page = 1;
  279. that.recordList = [];
  280. this.value = '';
  281. this.lists();
  282. this.show = false;
  283. },
  284. search(e) {
  285. this.page = 1;
  286. that.recordList = [];
  287. this.statusId = '';
  288. this.statetit = '';
  289. this.AreaId = '';
  290. this.Areatit = '';
  291. this.id = this.id2;
  292. this.lists();
  293. },
  294. // 审核
  295. examineVolunteer(id, status) {
  296. // console.log(id, status, 454);
  297. this.$api.examineVolunteer({ volunteer_id: id, status: status, main_body_id: 1, feedback: this.returnVal || '' }, function (res) {
  298. console.log(res);
  299. if (res.code == 1) {
  300. // 同意后从列表删除该项
  301. const index = that.toExamine.findIndex((item) => item.id === id);
  302. if (index !== -1) {
  303. that.toExamine.splice(index, 1);
  304. }
  305. that.$common.errorToShow(res.msg);
  306. } else {
  307. that.$common.errorToShow('请稍后再试');
  308. }
  309. });
  310. },
  311. // 通过申请
  312. agreeBtn() {
  313. this.detailsShow = false;
  314. this.examineVolunteer(this.volunteer_id, 2);
  315. // console.log('通过申请', this.volunteer_id);
  316. },
  317. // 确认驳回
  318. isOk() {
  319. if (this.returnVal != '' && this.returnVal.length > 0) {
  320. this.examineVolunteer(this.volunteer_id, -1);
  321. // console.log('驳回', this.volunteer_id);
  322. this.returnShow = false;
  323. this.detailsShow = false;
  324. } else {
  325. that.$common.errorToShow('请填写驳回原因');
  326. }
  327. },
  328. selectArea() {
  329. //打开选择器
  330. this.$refs.tkitree._show();
  331. },
  332. // 区域
  333. getCulturalRelicCategory() {
  334. this.$api.getCulturalRelicCategory({ main_body_id: 1, type: this.id, withself: true }, function (res) {
  335. if (res.code == 1) {
  336. // 创建一个字典,键为id,值为对象,便于快速查找
  337. const itemsById = res.data.reduce((acc, item) => {
  338. acc[item.id] = {
  339. ...item,
  340. children: []
  341. };
  342. return acc;
  343. }, {});
  344. console.log(itemsById, 1212);
  345. // 构建树结构
  346. const tree = res.data
  347. .filter((item) => {
  348. const parent = itemsById[item.pid];
  349. if (parent) {
  350. // 找到字节点
  351. parent.children.push(itemsById[item.id]);
  352. return false;
  353. }
  354. // 未找到字节点,则是根节点
  355. return true; // 没有父节点,所以这是一个根节点
  356. })
  357. .map((id) => itemsById[id.id]);
  358. that.regionList = tree;
  359. }
  360. });
  361. },
  362. onnodeclick(e) {
  363. this.id = e[0].id;
  364. this.AreaId = e[0].id;
  365. this.Areatit = e[0].title;
  366. this.page = 1;
  367. that.recordList = [];
  368. this.value = '';
  369. this.lists(this.AreaId);
  370. },
  371. close() {
  372. this.show = false;
  373. this.returnShow = false;
  374. this.detailsShow = false;
  375. }
  376. }
  377. };
  378. </script>
  379. <style>
  380. .box {
  381. width: 100%;
  382. padding-bottom: 50rpx;
  383. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/xbg_2.png');
  384. background-size: 100% 100%;
  385. background-attachment: fixed;
  386. background-repeat: repeat-y;
  387. height: 100%;
  388. }
  389. .zhuxiao {
  390. color: #f73131;
  391. }
  392. .filter-box {
  393. padding: 30upx 50upx 0 50upx;
  394. margin-bottom: 30upx;
  395. display: flex;
  396. align-items: center;
  397. justify-content: space-between;
  398. }
  399. .filter-box .b-item {
  400. width: 278rpx;
  401. height: 80rpx;
  402. font-size: 30rpx;
  403. color: #ffefc4;
  404. font-weight: 600;
  405. text-align: center;
  406. line-height: 80rpx;
  407. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/cy_tit2.png');
  408. background-size: 100% 100%;
  409. }
  410. .scarch_box {
  411. width: 670rpx;
  412. height: 82rpx;
  413. margin: auto;
  414. margin-top: 40rpx;
  415. padding: 15rpx 0 0 30rpx;
  416. background-image: url('/static/img/search_bg1.png');
  417. background-size: 100% 100%;
  418. }
  419. /deep/.u-search__content.data-v-0a306a29 {
  420. border-radius: 0 !important;
  421. }
  422. .active {
  423. color: #fae5bb !important;
  424. background-image: url('https://huli-app.wenlvti.net/app_static/WenWuGuanJia/image/cy_tit1.png') !important;
  425. }
  426. .top_box {
  427. display: flex;
  428. flex-wrap: wrap;
  429. justify-content: space-between;
  430. width: 90%;
  431. margin: auto;
  432. }
  433. .top_item {
  434. display: flex;
  435. align-items: center;
  436. /* margin-top: 30rpx; */
  437. }
  438. .xz {
  439. display: flex;
  440. align-items: center;
  441. justify-content: space-around;
  442. width: 240rpx;
  443. height: 60rpx;
  444. background-image: url('/static/img/search_bg1.png');
  445. background-size: 100% 100%;
  446. }
  447. .xz2 {
  448. display: flex;
  449. align-items: center;
  450. justify-content: space-around;
  451. width: 240rpx;
  452. height: 60rpx;
  453. background-image: url('/static/img/search_bg1.png');
  454. background-size: 100% 100%;
  455. }
  456. .jl_box {
  457. margin: auto;
  458. margin-top: 40rpx;
  459. text-align: center;
  460. }
  461. .tit_box {
  462. display: flex;
  463. height: 60rpx;
  464. line-height: 60rpx;
  465. font-weight: 700;
  466. font-size: 28rpx;
  467. justify-content: space-around;
  468. background-color: #e4c3a6;
  469. }
  470. .jl_item {
  471. display: flex;
  472. justify-content: space-around;
  473. height: 100rpx;
  474. line-height: 80rpx;
  475. font-size: 28rpx;
  476. /* background-color: #e7cbad; */
  477. }
  478. .bk {
  479. width: 100%;
  480. overflow-x: auto;
  481. white-space: nowrap;
  482. }
  483. .sl {
  484. white-space: nowrap;
  485. overflow: hidden;
  486. text-overflow: ellipsis;
  487. }
  488. .ck {
  489. display: flex;
  490. justify-content: space-around;
  491. width: 145rpx;
  492. height: 50rpx;
  493. font-size: 30rpx;
  494. line-height: 50rpx;
  495. margin-top: 15rpx;
  496. margin-left: 20rpx;
  497. background-color: #b75830;
  498. }
  499. .bt_box {
  500. display: flex;
  501. margin-top: 100rpx;
  502. justify-content: space-around;
  503. }
  504. .bt1 {
  505. width: 220rpx;
  506. height: 78rpx;
  507. border: 1px solid #312520;
  508. border-radius: 39rpx;
  509. text-align: center;
  510. line-height: 78rpx;
  511. color: black;
  512. }
  513. .bt2 {
  514. width: 220rpx;
  515. height: 78rpx;
  516. background: #ca5642;
  517. border-radius: 39rpx;
  518. text-align: center;
  519. line-height: 78rpx;
  520. color: #ffffff;
  521. }
  522. .ban_box {
  523. width: 92%;
  524. margin: auto;
  525. color: #90523c;
  526. font-size: 30rpx;
  527. line-height: 50rpx;
  528. font-weight: 600;
  529. }
  530. .input-value-border {
  531. border: none !important;
  532. }
  533. .placeholder {
  534. color: #333333 !important
  535. ;
  536. }
  537. .input-arrow {
  538. width: 22rpx !important;
  539. height: 22rpx !important;
  540. border-left: 1px solid #000 !important;
  541. border-bottom: 1px solid #000 !important;
  542. }
  543. .uni-data-tree {
  544. width: 310rpx !important;
  545. }
  546. </style>