list.vue 6.6 KB

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