list.vue 8.9 KB

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