chartForgetCustomer.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <home-section title="遗忘提醒" class="forget-customer">
  3. <view class="list">
  4. <view
  5. v-for="(item, index) in list"
  6. :key="index"
  7. class="list-item"
  8. @click="handleToForgetList(item)">
  9. <view class="list-item__label">
  10. {{ item.label }}
  11. </view>
  12. <view class="list-item__content">
  13. <text class="num">
  14. {{ item.num }}
  15. </text>
  16. <text class="unit">
  17. </text>
  18. </view>
  19. </view>
  20. </view>
  21. </home-section>
  22. </template>
  23. <script>
  24. import { ForgetCount } from 'API/crm/work'
  25. import HomeSection from './homeSection'
  26. export default {
  27. name: 'ChartForgetCustomer',
  28. components: {
  29. HomeSection
  30. },
  31. props: {
  32. params: {
  33. type: Object,
  34. default: () => {}
  35. }
  36. },
  37. data() {
  38. return {
  39. list: [
  40. {label: '超过7天未联系的客户', num: 0, field: 'sevenDays', day: 7},
  41. {label: '超过15天未联系的客户', num: 0, field: 'fifteenDays', day: 15},
  42. {label: '超过30天未联系的客户', num: 0, field: 'oneMonth', day: 30},
  43. {label: '超过3个月未联系的客户', num: 0, field: 'threeMonth', day: 90},
  44. {label: '超过6个月未联系的客户', num: 0, field: 'sixMonth', day: 180},
  45. {label: '逾期未联系的客户', num: 0, field: 'unContactCustomerCount', day: 0},
  46. ]
  47. }
  48. },
  49. watch: {
  50. params: {
  51. handler() {
  52. this.getDataNum()
  53. },
  54. deep: true
  55. }
  56. },
  57. mounted() {
  58. this.getDataNum()
  59. },
  60. methods: {
  61. /**
  62. * 获取遗忘提醒数据
  63. */
  64. getDataNum() {
  65. ForgetCount(this.params).then(res => {
  66. this.list.forEach((item, index) => {
  67. if (res.hasOwnProperty(item.field)) {
  68. item.num = res[item.field]
  69. }
  70. this.$set(this.list, index, item)
  71. })
  72. }).catch()
  73. },
  74. handleToForgetList(item) {
  75. console.log('item: ', item)
  76. this.$Router.navigateTo({
  77. url: '/pages_crm/homeReport/forgetCustomer',
  78. query: {
  79. ...this.params,
  80. day: item.day
  81. }
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped lang="scss">
  88. .list {
  89. width: 100%;
  90. padding: 10rpx 0 20rpx;
  91. // flex-wrap: wrap;
  92. .list-item {
  93. width: 47.5%;
  94. font-size: 24rpx;
  95. // box-shadow: 0 0 16px 0 rgba(0,0,0,.08);
  96. margin-top: 10rpx;
  97. padding: 15rpx 20rpx;
  98. display: inline-block;
  99. &:nth-child(2n+1) {
  100. margin-right: 5%;
  101. }
  102. .list-item__label {
  103. }
  104. .list-item__content {
  105. line-height: normal;
  106. margin-top: 5rpx;
  107. .num {
  108. color: $theme-color;
  109. font-size: 34rpx;
  110. font-weight: bold;
  111. margin-right: 10rpx;
  112. }
  113. .unit {
  114. font-size: 26rpx;
  115. }
  116. }
  117. }
  118. }
  119. </style>