cardList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <view>
  3. <view class="top-fixed">
  4. <view class="search-box ddflex">
  5. <view class="search-input ddflex fflex">
  6. <image src="/static/images/ssico.png"></image>
  7. <input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
  8. placeholder="请输入姓名" />
  9. </view>
  10. <view class="filter ddflex">
  11. <view class="fflex">
  12. <picker mode="selector" :range="rangeList" range-key="label" v-model="rangeIndex" @change="rangeChange">
  13. <view class="filter-item fflex ddflex f-active" style="text-align: right;justify-content: flex-end;">
  14. <text style="max-width: 150rpx;" class="tover">{{rangeList[rangeIndex].label}}</text>
  15. <image class="filter-item-icon" src="../static/images/down.png"></image>
  16. </view>
  17. </picker>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view style="height: 130rpx;"></view>
  23. <!-- 订单列表 -->
  24. <view style="position: relative;overflow: hidden;" v-if="dataList.length>0">
  25. <view class="register-box" v-for="item,index in dataList" :key="index" @click="jumpUrl('/card/index/index?cardId='+item.id)">
  26. <view class="register-title ddflex fflex">
  27. <image class="register-title-icon" :src="item.avatar?item.avatar:'/static/images/userimg.png'" mode="aspectFill"></image>
  28. <view class="flex" style="min-width: 0;">
  29. <view class="ddflex">
  30. <view class="card-name fflex tover">{{item.realName?item.realName:''}}</view>
  31. <view style="font-size: 26rpx;color: var(--main);font-weight: 400;" v-if="item.auditState==1">审核成功</view>
  32. <view class="review-btn" v-else-if="item.auditState==0" @click.stop="review(item,index)">审核</view>
  33. <view style="font-size: 26rpx;color: red;font-weight: 400;" v-else-if="item.auditState==2">审核失败 {{item.auditFailReason}}</view>
  34. </view>
  35. <view class="ddflex" style="margin-top: 4rpx;">
  36. <view class="card-tag">{{ item.jobName }}</view>
  37. <view class="card-tag">入司{{item.inDate?monthDayDiff(item.inDate):'1年'}}</view>
  38. </view>
  39. <view class="card-area ddflex">
  40. <image src="/card/static/images/area.png"></image>
  41. <view class="flex tover">{{item.address}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="ddflex" style="margin-top: 41rpx;">
  46. <view class="flex">
  47. <view class="card-data">{{item.cntCust?item.cntCust:0}}</view>
  48. <view class="card-label">服务客户</view>
  49. </view>
  50. <view class="card-line"></view>
  51. <view class="flex">
  52. <view class="card-data">{{item.cntCntr?item.cntCntr:0}}</view>
  53. <view class="card-label">保单件数</view>
  54. </view>
  55. <view class="card-line"></view>
  56. <view class="flex">
  57. <view class="card-data">{{item.thumbs?item.thumbs:0}}</view>
  58. <view class="card-label">用户点赞</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view v-else class="nodata">
  64. <image src="../../card/static/images/empty.png" mode="widthFix"></image>
  65. <view>暂无数据</view>
  66. </view>
  67. <view class="ceng" v-show="showPop" @click="showPop=false" @touchmove.stop.prevent="moveHandle">
  68. </view>
  69. <view :style="showPop?'bottom:0;':'bottom:-100%;'"
  70. class="pop">
  71. <view class="pop-scroll">
  72. <view class="pop-title">审核{{clickItem.realName}}的名片</view>
  73. <view class="pop-textarea">
  74. <textarea v-model="tempData" placeholder="如审核不通过请填写不通过原因"></textarea>
  75. </view>
  76. <view style="font-size: 24rpx;color: #999;padding:0 30rpx 30rpx;">注:通过审核可直接点击通过,不通过审核请填写原因</view>
  77. </view>
  78. <view class="ddflex">
  79. <view class="pop-item fflex" style="background-color: red;color: #fff;" @click="unpass">不通过</view>
  80. <view class="pop-item fflex" style="background-color: var(--main);color: #fff;" @click="pass">通过</view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. const app = getApp();
  87. const req = require("../../utils/request.js");
  88. const util = require('../../utils/util.js');
  89. export default {
  90. components: {
  91. },
  92. props: {},
  93. data() {
  94. return {
  95. statusBarHeight:0,
  96. page: 1,
  97. limit: 10,
  98. isLoad: true,
  99. searchVal: '',
  100. dataList: [],
  101. isReference:false,
  102. clickItem:{},
  103. clickIndex:-1,
  104. showPop:false,
  105. tempData:'',
  106. rangeIndex:0,
  107. rangeList:[{
  108. label:'全部',
  109. value:''
  110. },{
  111. label:'待审核',
  112. value:0
  113. },{
  114. label:'审核成功',
  115. value:1
  116. },{
  117. label:'审核失败',
  118. value:2
  119. }]
  120. }
  121. },
  122. onLoad(options) {
  123. this.getDataList()
  124. },
  125. onShow() {
  126. if(this.isReference){
  127. this.isReference = false
  128. this.page=1;
  129. this.isLoad = true
  130. this.getDataList()
  131. }
  132. },
  133. onReachBottom() {
  134. this.page++;
  135. this.getDataList();
  136. },
  137. methods: {
  138. jumpUrl(url) {
  139. uni.navigateTo({
  140. url: url
  141. })
  142. },
  143. // 分页查询
  144. getDataList() {
  145. if (!this.isLoad) return false;
  146. this.isLoad = false;
  147. let queryParams = {
  148. page: this.page,
  149. limit: this.limit
  150. }
  151. if (this.searchVal) {
  152. queryParams.realName = this.searchVal
  153. }
  154. queryParams.auditState = this.rangeList[this.rangeIndex].value
  155. req.getRequest('/api/visiting/card/interfaceYzl/page', queryParams, data => {
  156. data = data.list
  157. if (data != null && data.length == this.limit) {
  158. this.isLoad = true;
  159. }
  160. if (this.page == 1) {
  161. this.dataList = [];
  162. }
  163. if (this.page > 0) {
  164. data = this.dataList.concat(data);
  165. }
  166. this.dataList = data;
  167. console.log('列表数据>>>', this.dataList);
  168. })
  169. },
  170. // 搜索
  171. searchFn() {
  172. this.page = 1;
  173. this.isLoad = true;
  174. this.getDataList();
  175. },
  176. monthDayDiff(date) {
  177. return util.monthDayDiff(date)
  178. },
  179. review(item,index){
  180. this.clickItem = item
  181. this.clickIndex = index
  182. this.tempData = item.auditFailReason?item.auditFailReason:''
  183. this.showPop = true
  184. },
  185. pass(){
  186. uni.showModal({
  187. title:'提示',
  188. content:"是否确定通过"+this.clickItem.realName+"的名片审核",
  189. success: (res) => {
  190. if(res.confirm){
  191. req.postRequest('/api/visiting/card/audit',{id:this.clickItem.id,status:1},data=>{
  192. req.msg("名片已通过审核")
  193. this.dataList[this.clickIndex].auditState = 1
  194. this.clickIndex = -1
  195. this.clickItem = {}
  196. this.tempData = ''
  197. this.showPop = false
  198. })
  199. }
  200. }
  201. })
  202. },
  203. unpass(){
  204. if(!this.tempData){
  205. return req.msg("请填写名片不通过原因")
  206. }
  207. uni.showModal({
  208. title:'提示',
  209. content:"是否确定不通过"+this.clickItem.realName+"的名片审核",
  210. success: (res) => {
  211. if(res.confirm){
  212. req.postRequest('/api/visiting/card/audit',{id:this.clickItem.id,status:2,cause:this.tempData},data=>{
  213. req.msg("名片未通过审核")
  214. this.dataList[this.clickIndex].auditState = 2
  215. this.dataList[this.clickIndex].auditFailReason = this.tempData
  216. this.clickIndex = -1
  217. this.clickItem = {}
  218. this.tempData = ''
  219. this.showPop = false
  220. })
  221. }
  222. }
  223. })
  224. },
  225. rangeChange(e){
  226. this.rangeIndex = e.detail.value
  227. this.page = 1;
  228. this.isLoad = true;
  229. this.getDataList();
  230. }
  231. }
  232. }
  233. </script>
  234. <style>
  235. @import "./cardList.css";
  236. </style>