list.vue 6.8 KB

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