getsaclientsummary.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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">客户</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. <form action="/">
  23. <van-search
  24. v-model="searchstr"
  25. show-action
  26. placeholder="请输入姓名/电话"
  27. @search="onSearch"
  28. @cancel="onCancel"
  29. />
  30. </form>
  31. <van-row class="iconArea">
  32. <van-col span="24">
  33. <van-col span="8">
  34. <router-link to="/addsaclient">
  35. <van-icon name="friends" badge="+" size="50"/><br/>
  36. <span>添加</span>
  37. </router-link>
  38. </van-col>
  39. <van-col span="8">
  40. <router-link to="/filterclient">
  41. <van-icon name="search" size="50"/><br/>
  42. <span>筛选</span>
  43. </router-link>
  44. </van-col>
  45. <van-col span="8">
  46. </van-col>
  47. </van-col>
  48. </van-row>
  49. <van-list
  50. v-model="loading"
  51. :finished="finished"
  52. finished-text="已显示所有数据"
  53. @load="GetSaClientSummary"
  54. >
  55. <van-cell
  56. v-for="item in getData"
  57. :key="item.saleState"
  58. :title="item.saleState+'客户'"
  59. :value="item.clientCount"
  60. border
  61. is-link
  62. title-class="title1"
  63. value-class="value1"
  64. size="large"
  65. @click="click1($event, item.saleState)"
  66. >
  67. <template #icon>
  68. <i class="fa fa-heart size" aria-hidden="true" v-if="item.saleState=='问询'" style="color:red;"></i>
  69. <i class="fa fa-plane size" aria-hidden="true" v-if="item.saleState=='认筹'"></i>
  70. <i class="fa fa-sort-alpha-desc size" aria-hidden="true" v-if="item.saleState=='排号'" style="color:green;"></i>
  71. <i class="fa fa-bars size" aria-hidden="true" v-if="item.saleState=='预订'" style="color:orange;"></i>
  72. <i class="fa fa-sellsy size" aria-hidden="true" v-if="item.saleState=='认购'" style="color:#ff6600;"></i>
  73. <i class="fa fa-list-alt size" aria-hidden="true" v-if="item.saleState=='签约'" style="color:#ff6600;"></i>
  74. <i class="fa fa-product-hunt size" aria-hidden="true" v-if="item.saleState=='公共'" style="color:blue;"></i>
  75. </template>
  76. </van-cell>
  77. </van-list>
  78. </div>
  79. </template>
  80. <script>
  81. import { GetSaClientSummary } from "@/common/api/loginApi.js";
  82. export default {
  83. name: "login",
  84. data() {
  85. return {
  86. data: [],
  87. loading: false,
  88. finished: false,
  89. searchstr:''
  90. };
  91. },
  92. created: function () {
  93. console.info("created");
  94. //console.info(this.$util);
  95. this.$util.persistLogin(this);
  96. },
  97. computed:{ //计算属性
  98. getData:function(){
  99. var arr=this.data.filter(function(item){
  100. return item.visible==0;
  101. });
  102. console.info('arr',arr);
  103. return arr;
  104. }
  105. },
  106. methods: {
  107. GetSaClientSummary: function () {
  108. var that = this;
  109. var data = {
  110. userCode: that.$store.state.data.userCode,
  111. projectId: that.$store.state.projectId
  112. };
  113. console.info("data", data);
  114. GetSaClientSummary(data).then((res) => {
  115. console.info("GetSaClientSummary", res);
  116. if (!res.result) {
  117. that.$toast(res.msg);
  118. return;
  119. }
  120. res.data.forEach(function (item, index, array) {
  121. that.$set(that.data, index, item);
  122. });
  123. that.loading = false;
  124. that.finished = true;
  125. });
  126. },
  127. // 行选择点击跳转
  128. click1: function (event, saleState) {
  129. //console.info("click1 event", event);
  130. this.$router.push({path:'/getsaclientsummarylist',query:{saleState:saleState}});
  131. },
  132. onClickLeft() {
  133. // this.$toast('返回')
  134. console.info("left");
  135. this.$router.go(-1);
  136. },
  137. onClickRight() {
  138. this.$router.go(0);
  139. },
  140. onSearch(val) { //搜索事件
  141. console.info('onSearch',val);
  142. this.$router.push('/getsaclientlist?search='+val);
  143. },
  144. onCancel() { //搜索的取消事件
  145. console.info('onCancel');
  146. },
  147. },
  148. };
  149. </script>
  150. <!-- Add "scoped" attribute to limit CSS to this component only -->
  151. <style scoped>
  152. .title1 {
  153. color: #999;
  154. }
  155. .value1 {
  156. color: #999;
  157. font-size: 18px;
  158. }
  159. .size{
  160. font-size:16px;
  161. }
  162. .iconArea{
  163. border-bottom: #cfcfcf solid 5px;
  164. }
  165. </style>