list.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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" v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">|</text>
  22. <text v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">{{item.statusKaoshi}}</text>
  23. <!-- 删除 wgy看这里↓-->
  24. <icon class="head-clear"></icon>
  25. </view>
  26. </view>
  27. <view class="card-body-row">
  28. <view class="card-img-box">
  29. <img :src="item.icon" v-if="item.icon">
  30. <icon class="phone-default-userImg" v-else></icon>
  31. </view>
  32. <view class="body-content-row">
  33. <view class="content-text-row">
  34. <text>手机号:</text>{{item.userName}}
  35. <button type="default" class="phone-green-btn bz-tel-btn" @click.stop="telCallBtn(item.userName)">打电话</button>
  36. </view>
  37. <view class="content-text-row"><text>证件号:</text>{{item.idcard}}</view>
  38. <view class="jg-zy-box">
  39. <view class="jg-zy-row"><icon class="bz-icon"></icon><text>报证机构:{{item.jgName}}</text></view>
  40. <view class="jg-zy-row"><icon class="zy-icon"></icon><text>职业名称:{{item.zyName}} {{item.zyLevel}}</text></view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. </uni-list-item>
  47. <uni-load-more :status="data.state" @click="getMore(0)" :contentText="data.contentText"></uni-load-more>
  48. </uni-list>
  49. </scroll-view>
  50. <!-- 页面底端 -->
  51. <customTabbarClientVue :current-tab="0"></customTabbarClientVue>
  52. <!-- 筛选 -->
  53. <filter-dialog ref="filterDialogRef" @confirm-btn="confirmBtn"></filter-dialog>
  54. <!-- 搜索 -->
  55. <search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn" @reset-search="dialogSearchReset"></search-dialog>
  56. </view>
  57. </template>
  58. <script setup>
  59. import customTabbarClientVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
  60. import filterDialog from "./filter.vue";
  61. import searchDialog from "./search.vue";
  62. import {ref,reactive} from "vue";
  63. import {onLoad,onShow} from "@dcloudio/uni-app";
  64. import {getKaozhengList} from '@/api/banzheng.js'
  65. import {formatSecondsToCnhms} from "@/utils/common.js"
  66. const filterDialogRef = ref(null);
  67. const searchDialogRef = ref(null);
  68. const data = reactive({
  69. jgId: '', // 机构ID
  70. realName: '', // 姓名
  71. statusBanzheng: '', // 办证状态
  72. statusKaoshi: '', // 考试状态
  73. userName: '', // 手机号
  74. zyId: '', // 职业ID
  75. zyLevel: '', // 职业等级ID
  76. list: [], // 办证列表
  77. loading: false,
  78. page: 0,
  79. size: 10,
  80. state: 'more',
  81. contentText: {
  82. contentdown: '查看更多',
  83. contentrefresh: '加载中',
  84. contentnomore: '没有更多'
  85. },
  86. from: ''
  87. })
  88. function goUpPage() {
  89. uni.redirectTo({
  90. url: '/pages/admin/ShouYe/shouye'
  91. })
  92. }
  93. // 筛选
  94. function filterBtn(){
  95. filterDialogRef.value.initPage();
  96. filterDialogRef.value.handleShow();
  97. }
  98. function handleSearch() {
  99. data.page = 0;
  100. refreshData();
  101. }
  102. function goBzDetail(item) {
  103. let pageInfo = {
  104. status:'edit',
  105. id:'',
  106. userId:item.userId,
  107. from:'banzheng'
  108. }
  109. uni.redirectTo({
  110. url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=`+JSON.stringify(pageInfo)
  111. })
  112. }
  113. function onRefresh() {
  114. data.page = 0;
  115. data.list = [];
  116. data.loading = true;
  117. refreshData();
  118. }
  119. function refreshData() {
  120. const opt = {
  121. jgId: data.jgId, // 机构ID
  122. realName: data.realName, // 姓名
  123. statusBanzheng: data.statusBanzheng, // 办证状态
  124. statusKaoshi: data.statusKaoshi, // 考试状态
  125. userName: data.userName, // 手机号
  126. zyId: data.zyId, // 职业ID
  127. zyLevel: data.zyId, // 职业等级ID
  128. page: 1,
  129. size: 10, // 固定查询10条
  130. }
  131. data.list = [];
  132. // 数学
  133. data.state = 'loading';
  134. data.page++;
  135. opt.page = data.page;
  136. getKaozhengList(opt).then(res => {
  137. data.list = data.list.concat(res.data.data);
  138. data.loading = false;
  139. if (res.data.total > data.list.length) {
  140. data.state = 'more';
  141. data.loading = false;
  142. } else {
  143. data.state = 'no-more';
  144. data.loading = false;
  145. }
  146. }).catch(err => {
  147. data.state = 'more';
  148. data.loading = false;
  149. })
  150. }
  151. function getMore() {
  152. const opt = {
  153. jgId: data.jgId, // 机构ID
  154. realName: data.realName, // 姓名
  155. statusBanzheng: data.statusBanzheng, // 办证状态
  156. statusKaoshi: data.statusKaoshi, // 考试状态
  157. userName: data.userName, // 手机号
  158. zyId: data.zyId, // 职业ID
  159. zyLevel: data.zyId, // 职业等级ID
  160. page: 1,
  161. size: 10, // 固定查询10条
  162. }
  163. if (data.state == 'no-more') return;
  164. data.state = 'loading';
  165. data.page++;
  166. opt.page = data.page;
  167. getKaozhengList(opt).then(res => {
  168. data.list = data.list.concat(res.data.data);
  169. data.loading = false;
  170. if (res.data.total > data.list.length) {
  171. data.state = 'more';
  172. data.loading = false;
  173. } else {
  174. data.state = 'no-more';
  175. data.loading = false;
  176. }
  177. }).catch(err => {
  178. data.state = 'more';
  179. data.loading = false;
  180. })
  181. }
  182. function confirmBtn(dialogData){
  183. data.jgId = dialogData.jigouId;
  184. data.zyId = dialogData.zhiyeId;
  185. data.zyLevel = dialogData.levelId;
  186. data.statusBanzheng = dialogData.banzhengId;
  187. data.statusKaoshi = dialogData.kaoshiId;
  188. data.page = 0;
  189. refreshData();
  190. }
  191. function searchBtn(){
  192. searchDialogRef.value.handleShow();
  193. }
  194. function dialogSearchBtn(name,searchData){
  195. switch (name) {
  196. case '姓名':
  197. dialogSearchReset();
  198. data.realName = searchData.value;
  199. break;
  200. case '手机号':
  201. data.userName = searchData.value;
  202. break;
  203. }
  204. data.page = 0;
  205. refreshData();
  206. }
  207. function dialogSearchReset(){
  208. data.userName='';
  209. data.realName='';
  210. }
  211. function telCallBtn(data){
  212. uni.makePhoneCall({
  213. phoneNumber: data //仅为示例
  214. });
  215. }
  216. onLoad((options) => {
  217. data.from = options.from;
  218. })
  219. onShow(() => {
  220. getMore()
  221. })
  222. </script>