zhiYuanZhe.vue 15 KB

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