customerItem.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <button class="customer-item" @click="handleDetail">
  3. <view class="cell">
  4. <text class="cell-left name">
  5. {{ itemData.customerName }}
  6. </text>
  7. <view
  8. :class="itemData.dealStatus === 1 ? 'success' : 'waiting'"
  9. class="cell-right status">
  10. {{ itemData.dealStatus === 1 ? '已成交' : '未成交' }}
  11. </view>
  12. </view>
  13. <view class="cell">
  14. <view class="cell-left">
  15. <view v-if="!isSeas" class="text-info">
  16. 负责人:{{ itemData.ownerUserName }}
  17. </view>
  18. <view class="text-info">
  19. 最后跟进时间:{{ itemData.lastTime | formatTime }}
  20. </view>
  21. <view v-if="isSeas" class="text-info">
  22. 放入公海时间:{{ itemData.poolTime | formatTime }}
  23. </view>
  24. <view v-if="hasLevel" class="text-info">
  25. 客户等级:{{ itemData.level || '--' }}
  26. </view>
  27. </view>
  28. <view class="cell-right">
  29. <image
  30. v-if="itemData.businessCount != 0"
  31. :src="$static('images/icon/money_active.png')"
  32. class="icon" />
  33. <image
  34. v-else
  35. :src="$static('images/icon/money_default.png')"
  36. class="icon" />
  37. <image
  38. v-if="itemData.star == 1"
  39. :src="$static('images/icon/star_active.png')"
  40. class="icon" />
  41. <image
  42. v-else
  43. :src="$static('images/icon/star_default.png')"
  44. class="icon" />
  45. </view>
  46. </view>
  47. </button>
  48. </template>
  49. <script>
  50. import moment from 'moment'
  51. export default {
  52. name: 'CustomerItem',
  53. filters: {
  54. getClassName(status) {
  55. if (status === 1) return 'wk-check-fill success'
  56. else return 'wk-close-fill waiting'
  57. },
  58. formatTime(val) {
  59. if (!val) return '--'
  60. return moment(val).format('YYYY-MM-DD')
  61. }
  62. },
  63. props: {
  64. itemData: {
  65. type: Object,
  66. required: true
  67. },
  68. isSeas: {
  69. type: Boolean,
  70. default: false
  71. },
  72. poolId: {
  73. type: [String, Number],
  74. default: null
  75. }
  76. },
  77. data() {
  78. return {
  79. }
  80. },
  81. computed: {
  82. hasLevel() {
  83. return this.itemData.hasOwnProperty('level')
  84. }
  85. },
  86. methods: {
  87. /**
  88. * 客户详情跳转
  89. */
  90. handleDetail(e) {
  91. if (!this.$auth('crm.customer.read')) {
  92. this.$toast('权限不足')
  93. return
  94. }
  95. if (this.isSeas) {
  96. this.$Router.navigateTo({
  97. url: '/pages_crm/seas/detail',
  98. query: {
  99. id: this.itemData.customerId,
  100. poolId: this.poolId || this.itemData.poolId
  101. }
  102. })
  103. } else {
  104. if (!this.$auth('crm.customer.read')) {
  105. this.$toast('权限不足')
  106. return
  107. }
  108. this.$Router.navigateTo({
  109. url: '/pages_crm/customer/detail',
  110. query: {
  111. id: this.itemData.customerId
  112. }
  113. })
  114. }
  115. }
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. @import "../../style/listItem";
  121. .customer-item {
  122. font-size: 24rpx;
  123. border-bottom: 1rpx solid $border-color;
  124. background-color: white;
  125. padding: 20rpx 32rpx;
  126. .cell {
  127. .name {
  128. font-size: 32rpx;
  129. color: #212121;
  130. @include ellipsis;
  131. }
  132. .status {
  133. width: 102rpx;
  134. height: 46rpx;
  135. font-size: 24rpx;
  136. border-radius: 4rpx;
  137. @include center;
  138. &.success {
  139. color: white;
  140. background-color: #FF7300;
  141. }
  142. &.waiting {
  143. color: #BBBBBB;
  144. background-color: #EEEEEE;
  145. }
  146. }
  147. .text-info {
  148. font-size: 26rpx;
  149. color: $gray;
  150. }
  151. .icon {
  152. width: 32rpx;
  153. height: 32rpx;
  154. &:last-child {
  155. margin-left: 15rpx;
  156. }
  157. }
  158. }
  159. }
  160. </style>