list.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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="22" 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" :selectedIds='data.statusBanzheng' :defaultCount="99"
  17. :showAdd="false" @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 = {
  134. id: 0,
  135. name: '全部状态'
  136. };
  137. allType.value = [newItem, ...res.data];
  138. data.statusBanzheng = 1
  139. data.bzztName = '未办证'
  140. })
  141. }
  142. const clickAlltype = (data) => {
  143. isOpen.value = !isOpen.value;
  144. }
  145. function selectChangeSkill(item) {
  146. if (item.length > 0) {
  147. data.statusBanzheng = item[0].id == 0 ? '' : item[0].id;
  148. data.bzztName = item[0].name;
  149. data.page = 0;
  150. refreshData();
  151. }
  152. }
  153. function deleteFun(data) {
  154. console.log('data', data);
  155. deleteId.value = data.id
  156. commonDialogRef.value.handleShow();
  157. }
  158. function deleteQuerenBtn() {
  159. kaozhengDelete({
  160. ids: [deleteId.value]
  161. }).then(res => {
  162. if (res.code == 0) {
  163. uni.showToast({
  164. title: '成功'
  165. })
  166. handleSearch()
  167. } else {
  168. uni.showToast({
  169. title: '失败'
  170. })
  171. }
  172. })
  173. }
  174. function goUpPage() {
  175. uni.redirectTo({
  176. url: '/pages/admin/ShouYe/shouye'
  177. })
  178. }
  179. // 筛选
  180. function filterBtn() {
  181. filterDialogRef.value.initPage();
  182. filterDialogRef.value.handleShow();
  183. }
  184. function handleSearch() {
  185. data.page = 0;
  186. refreshData();
  187. }
  188. function goBzDetail(item) {
  189. let pageInfo = {
  190. status: 'edit',
  191. id: '',
  192. userId: item.userId,
  193. from: 'banzheng'
  194. }
  195. uni.redirectTo({
  196. url: "/pages/admin/Jiazheng/jiazhengUserManager?pageInfo=" + JSON.stringify(pageInfo)
  197. })
  198. }
  199. function onRefresh() {
  200. data.page = 0;
  201. data.list = [];
  202. data.loading = true;
  203. refreshData();
  204. }
  205. function refreshData() {
  206. const opt = {
  207. jgId: data.jgId, // 机构ID
  208. realName: data.realName, // 姓名
  209. statusBanzheng: data.statusBanzheng, // 办证状态
  210. statusKaoshi: data.statusKaoshi, // 考试状态
  211. userName: data.userName, // 手机号
  212. zyId: data.zyId, // 职业ID
  213. zyLevel: data.zyLevel, // 职业等级ID
  214. page: 1,
  215. size: 10, // 固定查询10条
  216. }
  217. data.list = [];
  218. // 数学
  219. data.state = 'loading';
  220. data.page++;
  221. opt.page = data.page;
  222. getKaozhengList(opt).then(res => {
  223. data.list = data.list.concat(res.data.data);
  224. data.loading = false;
  225. if (res.data.total > data.list.length) {
  226. data.state = 'more';
  227. data.loading = false;
  228. } else {
  229. data.state = 'no-more';
  230. data.loading = false;
  231. }
  232. }).catch(err => {
  233. data.state = 'more';
  234. data.loading = false;
  235. })
  236. }
  237. function getMore() {
  238. const opt = {
  239. jgId: data.jgId, // 机构ID
  240. realName: data.realName, // 姓名
  241. statusBanzheng: data.statusBanzheng == '' ? 1 : data.statusBanzheng, // 办证状态
  242. statusKaoshi: data.statusKaoshi, // 考试状态
  243. userName: data.userName, // 手机号
  244. zyId: data.zyId, // 职业ID
  245. zyLevel: data.zyLevel, // 职业等级ID
  246. page: 1,
  247. size: 10, // 固定查询10条
  248. }
  249. if (data.state == 'no-more') return;
  250. data.state = 'loading';
  251. data.page++;
  252. opt.page = data.page;
  253. getKaozhengList(opt).then(res => {
  254. data.list = data.list.concat(res.data.data);
  255. data.loading = false;
  256. if (res.data.total > data.list.length) {
  257. data.state = 'more';
  258. data.loading = false;
  259. } else {
  260. data.state = 'no-more';
  261. data.loading = false;
  262. }
  263. }).catch(err => {
  264. data.state = 'more';
  265. data.loading = false;
  266. })
  267. }
  268. function confirmBtn(dialogData) {
  269. data.jgId = dialogData.jigouId;
  270. data.zyId = dialogData.zhiyeId;
  271. data.zyLevel = dialogData.levelId;
  272. data.statusKaoshi = dialogData.kaoshiId;
  273. data.page = 0;
  274. refreshData();
  275. }
  276. function searchBtn() {
  277. searchDialogRef.value.handleShow();
  278. }
  279. function dialogSearchBtn(name, searchData) {
  280. switch (name) {
  281. case '姓名':
  282. dialogSearchReset();
  283. data.realName = searchData.value;
  284. break;
  285. case '手机号':
  286. data.userName = searchData.value;
  287. break;
  288. }
  289. data.page = 0;
  290. refreshData();
  291. }
  292. function dialogSearchReset() {
  293. data.userName = '';
  294. data.realName = '';
  295. }
  296. function telCallBtn(data) {
  297. uni.makePhoneCall({
  298. phoneNumber: data //仅为示例
  299. });
  300. }
  301. onLoad((options) => {
  302. data.from = options.from;
  303. })
  304. onShow(() => {
  305. getMore()
  306. getKaozhengBanzhengList();
  307. })
  308. </script>