detailCustomerItem.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <uni-swipe-action v-if="openSlider">
  3. <uni-swipe-action-item>
  4. <view class="list-item" @click="handleToDetail">
  5. <view class="list-item-main">
  6. <text class="left">
  7. {{ itemData.customerName }}
  8. </text>
  9. <text
  10. :class="itemData.dealStatus === 1 ? 'success' : 'waiting'"
  11. class="cell-right status">
  12. {{ itemData.dealStatus === 1 ? '已成交' : '未成交' }}
  13. </text>
  14. </view>
  15. <view class="list-item-desc">
  16. <text class="left">
  17. 最后跟进时间:{{ itemData.lastTime || '--' }}
  18. </text>
  19. <text class="cell-right owner-user">
  20. {{ itemData.ownerUserName }}
  21. </text>
  22. </view>
  23. </view>
  24. <template v-slot:right>
  25. <view class="delete" @click="setFollow">
  26. 跟进
  27. </view>
  28. </template>
  29. </uni-swipe-action-item>
  30. </uni-swipe-action>
  31. <view v-else class="list-item" @click="handleToDetail">
  32. <view class="list-item-main">
  33. <text class="left">
  34. {{ itemData.customerName }}
  35. </text>
  36. <text
  37. :class="itemData.dealStatus === 1 ? 'success' : 'waiting'"
  38. class="cell-right status">
  39. {{ itemData.dealStatus === 1 ? '已成交' : '未成交' }}
  40. </text>
  41. </view>
  42. <view class="list-item-desc">
  43. <text class="left">
  44. 最后跟进时间:{{ itemData.lastTime || '--' }}
  45. </text>
  46. <text class="cell-right owner-user">
  47. {{ itemData.ownerUserName }}
  48. </text>
  49. </view>
  50. <view
  51. v-if="type === 8"
  52. class="list-item-desc">
  53. <text class="left">
  54. 距进入公海时间:<text style="color: red">
  55. {{ itemData.poolDay }}天
  56. </text>
  57. </text>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import {CustomerSetFollow} from 'API/crm/message'
  63. export default {
  64. name: 'DetailCustomerItem',
  65. props: {
  66. itemData: {
  67. type: Object,
  68. required: true
  69. },
  70. openSlider: {
  71. type: Boolean,
  72. default: false
  73. },
  74. type: {
  75. type: Number,
  76. default: null
  77. }
  78. },
  79. methods: {
  80. handleToDetail() {
  81. this.$Router.navigateTo({
  82. url: '/pages_crm/customer/detail',
  83. query: {
  84. id: this.itemData.customerId
  85. }
  86. })
  87. },
  88. setFollow() {
  89. CustomerSetFollow([
  90. this.itemData.customerId
  91. ]).then(res => {
  92. this.$toast('跟进成功')
  93. this.$emit('refresh')
  94. }).catch()
  95. },
  96. }
  97. }
  98. </script>
  99. <style scoped lang="scss">
  100. @import "detailItem";
  101. .status {
  102. font-size: 26rpx;
  103. font-weight: 500;
  104. line-height: normal;
  105. padding: 5rpx 18rpx;
  106. border-radius: 4rpx;
  107. @include center;
  108. &.success {
  109. color: #14AE36;
  110. background-color: #DCFFDF;
  111. }
  112. &.waiting {
  113. color: #FF8700;
  114. background-color: #FFF3E5;
  115. }
  116. }
  117. .owner-user {
  118. font-size: 28rpx;
  119. color: $gray;
  120. }
  121. .delete {
  122. width: 150rpx;
  123. height: 100%;
  124. color: white;
  125. font-size: 28rpx;
  126. background-color: $theme-color;
  127. @include center;
  128. }
  129. </style>