detailLeadsItem.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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.leadsName }}
  8. </text>
  9. </view>
  10. <view class="list-item-desc">
  11. <text class="left">
  12. 最后跟进时间:{{ itemData.lastTime || '--' }}
  13. </text>
  14. <text class="right">
  15. {{ itemData.ownerUserName }}
  16. </text>
  17. </view>
  18. </view>
  19. <template v-slot:right>
  20. <view class="delete" @click="setFollow">
  21. 跟进
  22. </view>
  23. </template>
  24. </uni-swipe-action-item>
  25. </uni-swipe-action>
  26. <view v-else class="list-item" @click="handleToDetail">
  27. <view class="list-item-main">
  28. <text class="left">
  29. {{ itemData.leadsName }}
  30. </text>
  31. </view>
  32. <view class="list-item-desc">
  33. <text class="left">
  34. 最后跟进时间:{{ itemData.lastTime || '--' }}
  35. </text>
  36. <text class="right">
  37. {{ itemData.ownerUserName }}
  38. </text>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import {LeadsSetFollow} from 'API/crm/message'
  44. export default {
  45. name: 'DetailLeadsItem',
  46. props: {
  47. itemData: {
  48. type: Object,
  49. required: true
  50. },
  51. openSlider: {
  52. type: Boolean,
  53. default: false
  54. }
  55. },
  56. data() {
  57. return {
  58. rightOptions: [
  59. {
  60. text: '跟进',
  61. style: {
  62. backgroundColor: '#3c80f7',
  63. width: 50
  64. }
  65. }
  66. ]
  67. }
  68. },
  69. methods: {
  70. handleToDetail() {
  71. console.log('to detail')
  72. this.$Router.navigateTo({
  73. url: '/pages_crm/leads/detail',
  74. query: {
  75. id: this.itemData.leadsId
  76. }
  77. })
  78. },
  79. setFollow() {
  80. LeadsSetFollow([
  81. this.itemData.leadsId
  82. ]).then(() => {
  83. this.$toast('跟进成功')
  84. this.$emit('refresh')
  85. }).catch()
  86. },
  87. }
  88. }
  89. </script>
  90. <style scoped lang="scss">
  91. @import "detailItem";
  92. .delete {
  93. width: 170rpx;
  94. height: 100%;
  95. color: white;
  96. font-size: 28rpx;
  97. background-color: $theme-color;
  98. @include center;
  99. }
  100. </style>