getsaclientsummarylist.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. @click-left="onClickLeft"
  5. @click-right="onClickRight"
  6. style="background-color: #1989fa"
  7. >
  8. <template #title>
  9. <van-col style="color: #ffffff">{{titleName}}</van-col>
  10. </template>
  11. <template #left>
  12. <i
  13. class="fa fa-arrow-circle-left"
  14. aria-hidden="true"
  15. style="color: #ffffff; font-size: 18px"
  16. ></i>
  17. </template>
  18. <template #right>
  19. <van-icon name="replay" size="18" color="#ffffff" />
  20. </template>
  21. </van-nav-bar>
  22. <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
  23. <van-list
  24. v-model="loading"
  25. :finished="finished"
  26. loading-text="加载中..."
  27. finished-text="我是有底线的~"
  28. @load="onLoad"
  29. >
  30. <van-cell
  31. v-for="item in listdata"
  32. :key="item.clientId"
  33. >
  34. <template #title>
  35. <van-col span="24" class="title1">{{item.name}}</van-col>
  36. <van-col span="24" class="title2">
  37. 业务员:{{item.cUserName}}
  38. </van-col>
  39. </template>
  40. <template #default>
  41. <van-col span="24" class="star" >
  42. <span v-for="i in item.intention" :key="i+'x'" class="size">★</span>
  43. <span v-for="i in 5-item.intention" :key="i" class="size">☆</span>
  44. </van-col>
  45. <van-col span="24" v-if="item.visitdate!=''" class="title3">
  46. 最后接待:{{item.visitdate}}
  47. </van-col>
  48. </template>
  49. </van-cell>
  50. </van-list>
  51. </van-pull-refresh>
  52. </div>
  53. </template>
  54. <script>
  55. import { GetSaClientSummaryList } from "@/common/api/loginApi.js";
  56. export default {
  57. name: "login",
  58. data() {
  59. return {
  60. listdata: [],
  61. loading: false,
  62. finished: false,
  63. isLoading: false,
  64. page:"1"
  65. };
  66. },
  67. created: function () {
  68. console.info("created");
  69. //console.info(this.$util);
  70. this.$util.persistLogin(this);
  71. },
  72. computed:{ //计算属性
  73. titleName:function(){
  74. return this.$route.query.saleState+'客户';
  75. },
  76. },
  77. methods: {
  78. GetSaClientSummaryList: function () {
  79. var that = this;
  80. var data = {
  81. userCode: that.$store.state.data.userCode,
  82. projectId: that.$store.state.projectId,
  83. page: that.page,
  84. pageCount: "10",
  85. saleState:that.$route.query.saleState,
  86. jsonQuery: "",
  87. sortby: "",
  88. };
  89. console.info("data", data);
  90. GetSaClientSummaryList(data).then((res) => {
  91. console.info("GetSaClientSummaryList", res);
  92. if (!res.result) {
  93. that.$toast(res.msg);
  94. return;
  95. }
  96. if(res.data!=null&&res.data.listdata.length>0){
  97. that.loading=false;
  98. res.data.listdata.forEach(function (item, index, array) {
  99. that.listdata.push(item);
  100. //console.info('length:'+res.data.listdata.length,'index:'+index);
  101. if(res.data.listdata.length-1==index){
  102. that.page++;
  103. if(res.data.page.totalPages==that.page-1){
  104. that.finished=true;
  105. }
  106. }
  107. });
  108. if(res.data==null||res.data.listdata==null||res.data.listdata.length==0){
  109. that.finished = true;
  110. }
  111. }
  112. else{
  113. that.finished=true;
  114. }
  115. });
  116. },
  117. // 列表加载
  118. onLoad () {
  119. setTimeout(() => {
  120. this.GetSaClientSummaryList()
  121. this.loading = true
  122. }, 500)
  123. },
  124. onRefresh () {
  125. setTimeout(() => {
  126. // 重新初始化这些属性
  127. this.isLoading = false
  128. this.listdata = []
  129. this.page = 1
  130. this.loading = false
  131. this.finished = false
  132. //this.noData = false
  133. // 请求信息
  134. this.GetSaClientSummaryList()
  135. }, 500)
  136. },
  137. onClickLeft() {
  138. // this.$toast('返回')
  139. console.info("left");
  140. this.$router.go(-1);
  141. },
  142. onClickRight() {
  143. this.$router.go(0);
  144. },
  145. },
  146. };
  147. </script>
  148. <!-- Add "scoped" attribute to limit CSS to this component only -->
  149. <style scoped>
  150. .title1 {
  151. color:#0f0fa7;
  152. font-size:16px;
  153. font-weight:900;
  154. text-align: left;
  155. height:35px;
  156. }
  157. .title2{
  158. color:#999;
  159. text-align: left;
  160. height:25px;
  161. }
  162. .title3{
  163. color:#999;
  164. text-align: right;
  165. height:25px;
  166. }
  167. .star{
  168. height:35px;
  169. }
  170. .size{
  171. font-size:16px;
  172. color:orange;
  173. }
  174. </style>