leadsItem.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <button class="leads-item" @click="handleDetail">
  3. <view class="cell">
  4. <text class="cell-left name">
  5. {{ itemData.leadsName }}
  6. </text>
  7. <text class="cell-right" />
  8. </view>
  9. <view class="cell">
  10. <text class="cell-left time">
  11. 最后跟进时间:{{ itemData.lastTime | formatTime }}
  12. </text>
  13. <text class="cell-right status">
  14. {{ itemData.ownerUserName }}
  15. </text>
  16. </view>
  17. </button>
  18. </template>
  19. <script>
  20. import moment from 'moment'
  21. export default {
  22. name: 'LeadsItem',
  23. filters: {
  24. formatTime(val) {
  25. if (!val) return '--'
  26. return moment(val).format('YYYY-MM-DD')
  27. }
  28. },
  29. props: {
  30. itemData: {
  31. type: Object,
  32. required: true
  33. }
  34. },
  35. methods: {
  36. /**
  37. * 线索详情跳转
  38. */
  39. handleDetail() {
  40. if (!this.$auth('crm.leads.read')) {
  41. this.$toast('权限不足')
  42. return
  43. }
  44. this.$Router.navigateTo({
  45. url: '/pages_crm/leads/detail',
  46. query: {
  47. id: this.itemData.leadsId
  48. }
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. @import "../../style/listItem";
  56. .leads-item {
  57. border-bottom: 1rpx solid $border-color;
  58. background-color: white;
  59. padding: 20rpx 32rpx;
  60. .cell {
  61. .name {
  62. font-size: 32rpx;
  63. color: #212121;
  64. @include ellipsis;
  65. }
  66. .time, .status {
  67. font-size: 26rpx;
  68. color: $gray;
  69. }
  70. }
  71. }
  72. </style>