zhiYuanZhe.vue 14 KB

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