list.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view class="phone-list-page phone-banzheng-page">
  3. <view class="phone-navBar-box">
  4. <view @click="goUpPage" class="nav-bar-icon"></view>
  5. <view class="filter-btn" @click="filterBtn">筛选</view>
  6. <text class="nav-bar-title">办证管理</text>
  7. <uni-icons class="nav-bar-right-icon" type="search" size="18" color="#666" @click="searchBtn"></uni-icons>
  8. </view>
  9. <!-- 课程列表 -->
  10. <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
  11. :refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
  12. class="phone-scroll-saixuan-view">
  13. <uni-list>
  14. <uni-list-item v-for="item in data.list" class="banzheng-list-item-box">
  15. <template v-slot:body>
  16. <view class="banzheng-list-card-box" @click="goBzDetail(item)">
  17. <view class="card-head-row">
  18. <view class="head-name">{{item.realName}}</view>
  19. <view class="head-status">
  20. <text>{{item.statusBanzheng}}</text>
  21. <text class="status-line"
  22. v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">|</text>
  23. <text
  24. v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">{{item.statusKaoshi}}</text>
  25. <!-- 删除 wgy看这里↓-->
  26. <icon class="head-clear" @click.stop="deleteFun(item)"></icon>
  27. </view>
  28. </view>
  29. <view class="card-body-row">
  30. <view class="card-img-box">
  31. <img :src="item.icon" v-if="item.icon">
  32. <icon class="phone-default-userImg" v-else></icon>
  33. </view>
  34. <view class="body-content-row">
  35. <view class="content-text-row">
  36. <text>手机号:</text>{{item.userName}}
  37. <button type="default" class="phone-green-btn bz-tel-btn"
  38. @click.stop="telCallBtn(item.userName)">打电话</button>
  39. </view>
  40. <view class="content-text-row"><text>证件号:</text>{{item.idcard}}</view>
  41. <view class="jg-zy-box">
  42. <view class="jg-zy-row">
  43. <icon class="bz-icon"></icon><text>报证机构:{{item.jgName}}</text>
  44. </view>
  45. <view class="jg-zy-row">
  46. <icon class="zy-icon"></icon><text>职业名称:{{item.zyName}}
  47. {{item.zyLevel}}</text>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. </uni-list-item>
  55. <uni-load-more :status="data.state" @click="getMore(0)" :contentText="data.contentText"></uni-load-more>
  56. </uni-list>
  57. </scroll-view>
  58. <!-- 页面底端 -->
  59. <customTabbarClientVue :current-tab="0"></customTabbarClientVue>
  60. <!-- 筛选 -->
  61. <filter-dialog ref="filterDialogRef" @confirm-btn="confirmBtn"></filter-dialog>
  62. <!-- 搜索 -->
  63. <search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn"
  64. @reset-search="dialogSearchReset"></search-dialog>
  65. <common-dialog ref="commonDialogRef" :title="deleteTitle" :content="deleteConcent"
  66. @confirm-btn="deleteQuerenBtn"></common-dialog>
  67. </view>
  68. </template>
  69. <script setup>
  70. import customTabbarClientVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  71. import filterDialog from "./filter.vue";
  72. import commonDialog from '@/components/dialog/commonDialog.vue';
  73. import searchDialog from "./search.vue";
  74. import {
  75. ref,
  76. reactive
  77. } from "vue";
  78. import {
  79. onLoad,
  80. onShow
  81. } from "@dcloudio/uni-app";
  82. import {
  83. getKaozhengList,
  84. kaozhengDelete
  85. } from '@/api/banzheng.js'
  86. import {
  87. formatSecondsToCnhms
  88. } from "@/utils/common.js"
  89. const filterDialogRef = ref(null);
  90. const searchDialogRef = ref(null);
  91. const commonDialogRef = ref(null);
  92. const deleteId = ref('');
  93. const deleteTitle = ref('删除');
  94. const deleteConcent = ref('你确定要执行这个操作吗');
  95. const data = reactive({
  96. jgId: '', // 机构ID
  97. realName: '', // 姓名
  98. statusBanzheng: '', // 办证状态
  99. statusKaoshi: '', // 考试状态
  100. userName: '', // 手机号
  101. zyId: '', // 职业ID
  102. zyLevel: '', // 职业等级ID
  103. list: [], // 办证列表
  104. loading: false,
  105. page: 0,
  106. size: 10,
  107. state: 'more',
  108. contentText: {
  109. contentdown: '查看更多',
  110. contentrefresh: '加载中',
  111. contentnomore: '没有更多'
  112. },
  113. from: ''
  114. })
  115. function deleteFun(data) {
  116. console.log('data', data);
  117. deleteId.value = data.id
  118. commonDialogRef.value.handleShow();
  119. }
  120. function deleteQuerenBtn() {
  121. kaozhengDelete({
  122. ids: [deleteId.value]
  123. }).then(res => {
  124. if (res.code == 0) {
  125. uni.showToast({
  126. title: '成功'
  127. })
  128. handleSearch()
  129. } else {
  130. uni.showToast({
  131. title: '失败'
  132. })
  133. }
  134. })
  135. }
  136. function goUpPage() {
  137. uni.redirectTo({
  138. url: '/pages/admin/ShouYe/shouye'
  139. })
  140. }
  141. // 筛选
  142. function filterBtn() {
  143. filterDialogRef.value.initPage();
  144. filterDialogRef.value.handleShow();
  145. }
  146. function handleSearch() {
  147. data.page = 0;
  148. refreshData();
  149. }
  150. function goBzDetail(item) {
  151. let pageInfo = {
  152. status: 'edit',
  153. id: '',
  154. userId: item.userId,
  155. from: 'banzheng'
  156. }
  157. uni.redirectTo({
  158. url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=` + JSON.stringify(pageInfo)
  159. })
  160. }
  161. function onRefresh() {
  162. data.page = 0;
  163. data.list = [];
  164. data.loading = true;
  165. refreshData();
  166. }
  167. function refreshData() {
  168. const opt = {
  169. jgId: data.jgId, // 机构ID
  170. realName: data.realName, // 姓名
  171. statusBanzheng: data.statusBanzheng, // 办证状态
  172. statusKaoshi: data.statusKaoshi, // 考试状态
  173. userName: data.userName, // 手机号
  174. zyId: data.zyId, // 职业ID
  175. zyLevel: data.zyId, // 职业等级ID
  176. page: 1,
  177. size: 10, // 固定查询10条
  178. }
  179. data.list = [];
  180. // 数学
  181. data.state = 'loading';
  182. data.page++;
  183. opt.page = data.page;
  184. getKaozhengList(opt).then(res => {
  185. data.list = data.list.concat(res.data.data);
  186. data.loading = false;
  187. if (res.data.total > data.list.length) {
  188. data.state = 'more';
  189. data.loading = false;
  190. } else {
  191. data.state = 'no-more';
  192. data.loading = false;
  193. }
  194. }).catch(err => {
  195. data.state = 'more';
  196. data.loading = false;
  197. })
  198. }
  199. function getMore() {
  200. const opt = {
  201. jgId: data.jgId, // 机构ID
  202. realName: data.realName, // 姓名
  203. statusBanzheng: data.statusBanzheng, // 办证状态
  204. statusKaoshi: data.statusKaoshi, // 考试状态
  205. userName: data.userName, // 手机号
  206. zyId: data.zyId, // 职业ID
  207. zyLevel: data.zyId, // 职业等级ID
  208. page: 1,
  209. size: 10, // 固定查询10条
  210. }
  211. if (data.state == 'no-more') return;
  212. data.state = 'loading';
  213. data.page++;
  214. opt.page = data.page;
  215. getKaozhengList(opt).then(res => {
  216. data.list = data.list.concat(res.data.data);
  217. data.loading = false;
  218. if (res.data.total > data.list.length) {
  219. data.state = 'more';
  220. data.loading = false;
  221. } else {
  222. data.state = 'no-more';
  223. data.loading = false;
  224. }
  225. }).catch(err => {
  226. data.state = 'more';
  227. data.loading = false;
  228. })
  229. }
  230. function confirmBtn(dialogData) {
  231. data.jgId = dialogData.jigouId;
  232. data.zyId = dialogData.zhiyeId;
  233. data.zyLevel = dialogData.levelId;
  234. data.statusBanzheng = dialogData.banzhengId;
  235. data.statusKaoshi = dialogData.kaoshiId;
  236. data.page = 0;
  237. refreshData();
  238. }
  239. function searchBtn() {
  240. searchDialogRef.value.handleShow();
  241. }
  242. function dialogSearchBtn(name, searchData) {
  243. switch (name) {
  244. case '姓名':
  245. dialogSearchReset();
  246. data.realName = searchData.value;
  247. break;
  248. case '手机号':
  249. data.userName = searchData.value;
  250. break;
  251. }
  252. data.page = 0;
  253. refreshData();
  254. }
  255. function dialogSearchReset() {
  256. data.userName = '';
  257. data.realName = '';
  258. }
  259. function telCallBtn(data) {
  260. uni.makePhoneCall({
  261. phoneNumber: data //仅为示例
  262. });
  263. }
  264. onLoad((options) => {
  265. data.from = options.from;
  266. })
  267. onShow(() => {
  268. getMore()
  269. })
  270. </script>