list.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. }
  106. uni.redirectTo({
  107. url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=`+JSON.stringify(pageInfo)
  108. })
  109. }
  110. function onRefresh() {
  111. data.page = 0;
  112. data.list = [];
  113. data.loading = true;
  114. refreshData();
  115. }
  116. function refreshData() {
  117. const opt = {
  118. jgId: data.jgId, // 机构ID
  119. realName: data.realName, // 姓名
  120. statusBanzheng: data.statusBanzheng, // 办证状态
  121. statusKaoshi: data.statusKaoshi, // 考试状态
  122. userName: data.userName, // 手机号
  123. zyId: data.zyId, // 职业ID
  124. zyLevel: data.zyId, // 职业等级ID
  125. page: 1,
  126. size: 10, // 固定查询10条
  127. }
  128. data.list = [];
  129. // 数学
  130. data.state = 'loading';
  131. data.page++;
  132. opt.page = data.page;
  133. getKaozhengList(opt).then(res => {
  134. data.list = data.list.concat(res.data.data);
  135. data.loading = false;
  136. if (res.data.total > data.list.length) {
  137. data.state = 'more';
  138. data.loading = false;
  139. } else {
  140. data.state = 'no-more';
  141. data.loading = false;
  142. }
  143. }).catch(err => {
  144. data.state = 'more';
  145. data.loading = false;
  146. })
  147. }
  148. function getMore() {
  149. const opt = {
  150. jgId: data.jgId, // 机构ID
  151. realName: data.realName, // 姓名
  152. statusBanzheng: data.statusBanzheng, // 办证状态
  153. statusKaoshi: data.statusKaoshi, // 考试状态
  154. userName: data.userName, // 手机号
  155. zyId: data.zyId, // 职业ID
  156. zyLevel: data.zyId, // 职业等级ID
  157. page: 1,
  158. size: 10, // 固定查询10条
  159. }
  160. if (data.state == 'no-more') return;
  161. data.state = 'loading';
  162. data.page++;
  163. opt.page = data.page;
  164. getKaozhengList(opt).then(res => {
  165. data.list = data.list.concat(res.data.data);
  166. data.loading = false;
  167. if (res.data.total > data.list.length) {
  168. data.state = 'more';
  169. data.loading = false;
  170. } else {
  171. data.state = 'no-more';
  172. data.loading = false;
  173. }
  174. }).catch(err => {
  175. data.state = 'more';
  176. data.loading = false;
  177. })
  178. }
  179. function confirmBtn(dialogData){
  180. data.jgId = dialogData.jigouId;
  181. data.zyId = dialogData.zhiyeId;
  182. data.zyLevel = dialogData.levelId;
  183. data.statusBanzheng = dialogData.banzhengId;
  184. data.statusKaoshi = dialogData.kaoshiId;
  185. refreshData();
  186. }
  187. function searchBtn(){
  188. searchDialogRef.value.handleShow();
  189. }
  190. function dialogSearchBtn(name,searchData){
  191. switch (name) {
  192. case '姓名':
  193. dialogSearchReset();
  194. data.realName = searchData.value;
  195. break;
  196. case '手机号':
  197. data.userName = searchData.value;
  198. break;
  199. }
  200. refreshData();
  201. }
  202. function dialogSearchReset(){
  203. data.userName='';
  204. data.realName='';
  205. }
  206. function telCallBtn(data){
  207. uni.makePhoneCall({
  208. phoneNumber: data //仅为示例
  209. });
  210. }
  211. onLoad((options) => {
  212. data.from = options.from;
  213. })
  214. onShow(() => {
  215. getMore()
  216. })
  217. </script>