result.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view>
  3. <van-sticky>
  4. <view class="top-wrap">
  5. <view @click="handleBack">
  6. <van-search disabled use-left-icon-slot shape="round" :value="keyword" placeholder="客户名称/社会信用码">
  7. <view slot="left-icon">
  8. <image src="../static/search-icon.png" mode="aspectFill" class="search-icon"></image>
  9. </view>
  10. </van-search>
  11. </view>
  12. </view>
  13. </van-sticky>
  14. <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="finished&&list.length===0"/>
  15. <view class="list-wrap" v-else>
  16. <approve-list-item v-for="item in list" :key="item.CompanyApprovalId" :data="item"></approve-list-item>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {apiCustomeList} from '@/api/approve/custome.js'
  22. import {apiSealApproveList} from '@/api/approve/seal.js'
  23. import approveListItem from '../components/approveListItem.vue'
  24. export default{
  25. components: {
  26. approveListItem
  27. },
  28. data() {
  29. return {
  30. type:'',
  31. keyword:'',
  32. list:[],
  33. page:1,
  34. finished:false
  35. }
  36. },
  37. onLoad(options) {
  38. this.type=options.type
  39. this.keyword=options.val
  40. if(options.type==='custome'){
  41. this.getCustomeList()
  42. }else if(options.type==='seal'){
  43. this.getSealList()
  44. }
  45. },
  46. onReachBottom() {
  47. if(this.finished) return
  48. this.page++
  49. if(this.type==='custome'){
  50. this.getCustomeList()
  51. }
  52. },
  53. methods: {
  54. handleBack(){
  55. uni.navigateBack({
  56. delta:1
  57. })
  58. },
  59. // 获取客户搜索数据
  60. async getCustomeList() {
  61. const res=await apiCustomeList({
  62. CurrentIndex:this.page,
  63. Status:'',
  64. KeywordEq:this.keyword
  65. })
  66. if(res.code===200){
  67. if(!res.data.List||res.data.List.length===0){
  68. this.finished=true
  69. }else{
  70. let arr=res.data.List.map(item=>{
  71. //申请类型:申请类型:1:试用->正式,2:冻结—>试用,3:试用延期,4:原销售申请领取流失客户,5:正式客户申请服务更新
  72. let applyType=''
  73. switch(item.ApplyMethod){
  74. case 1:
  75. applyType='试用转正式'
  76. break;
  77. case 2:
  78. applyType='冻结转试用'
  79. break;
  80. case 3:
  81. applyType='试用延期'
  82. break;
  83. case 4:
  84. applyType='原销售申领'
  85. break;
  86. case 5:
  87. applyType='服务更新'
  88. break;
  89. }
  90. return {
  91. title:item.CompanyName,
  92. saller:item.ApplyRealName,
  93. submitTime:item.ApprovalTime,
  94. approveTime:item.ApproveTime,
  95. backTime:'',
  96. cancelTime:'',
  97. status:item.ApproveStatus,
  98. applyType:applyType,
  99. id:item.CompanyApprovalId,
  100. type:'custome'
  101. }
  102. })
  103. this.list=[...this.list,...arr]
  104. }
  105. }
  106. },
  107. //获取用印数据
  108. async getSealList(){
  109. const res=await apiSealApproveList({
  110. CurrentIndex:this.page,
  111. Status:'',
  112. KeywordEq:this.keyword
  113. })
  114. if(res.code===200){
  115. if(!res.data.List||res.data.List.length===0){
  116. this.finished=true
  117. }else{
  118. let arr=res.data.List.map(item=>{
  119. return {
  120. title:item.CompanyName,
  121. saller:item.UserName,
  122. submitTime:item.CreateTime,
  123. approveTime:item.ApproveTime,
  124. cancelTime:item.InvalidTime,
  125. backTime:'',
  126. status:item.Status,
  127. applyType:item.SealType,
  128. ContractApprovalId:item.ContractApprovalId,
  129. ContractApprovalRecordId:item.ContractApprovalRecordId,
  130. type:'seal'
  131. }
  132. })
  133. this.list=[...this.list,...arr]
  134. }
  135. }
  136. }
  137. },
  138. }
  139. </script>
  140. <style lang="scss">
  141. .search-icon {
  142. width: 40rpx;
  143. height: 40rpx;
  144. display: block;
  145. position: relative;
  146. top: 4rpx;
  147. margin-right: 10rpx;
  148. }
  149. .list-wrap {
  150. padding: 20rpx;
  151. }
  152. </style>