followRecords.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="todo-list">
  3. <u-empty mode="list" text="暂无记录" v-if="followList.length == 0"></u-empty>
  4. <view v-else v-for="(v, i) in followList" :key="i">
  5. <view class="follow-date">
  6. <u-text :bold="true" size="26rpx" :text="v.followDay"></u-text>
  7. </view>
  8. <view class="todo-item" v-for="item in v.followupList" :key="item.id">
  9. <u-row>
  10. <u-col span="12">
  11. <view class="header">
  12. <u-row>
  13. <u-col span="12">
  14. <view class="flex_l">
  15. <text class="tit-txt text-ellipsis flex_1">
  16. {{ item.contactsName }} 跟进({{ formatType(item.followType) }})
  17. </text>
  18. </view>
  19. </u-col>
  20. </u-row>
  21. <view class="content flex">
  22. <text>{{ item.followContent }}</text>
  23. </view>
  24. <view class="content-footer flex1">
  25. <text class="date">{{ item.followDate }}</text>
  26. <view class="flex flex-middle">
  27. <text class="user-txt">联系人:{{ item.contactsName }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </u-col>
  32. </u-row>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import to from 'await-to-js'
  39. import followApi from '../../../api/follow'
  40. export default {
  41. name: 'OmsCustomerDetail',
  42. props: {
  43. customerId: {
  44. type: [String, Number],
  45. default: '0',
  46. },
  47. },
  48. data() {
  49. return {
  50. followList: [],
  51. }
  52. },
  53. mounted() {
  54. this.getRecords()
  55. console.log('customerId', this.customerId)
  56. },
  57. methods: {
  58. async getRecords() {
  59. let params = {
  60. custId: '' + this.customerId,
  61. targetType: '10',
  62. pageSize: 9999,
  63. }
  64. const [err, res] = await to(followApi.getListByDay(params))
  65. if (err) return
  66. if (res.code == 200) this.followList = res.data.list || []
  67. },
  68. formatType(val) {
  69. let str = ''
  70. if (val == 10) str = '电话'
  71. else if (val == 20) str = '邮件'
  72. else if (val == 30) str = '拜访'
  73. return str
  74. },
  75. },
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .todo-list {
  80. height: 100%;
  81. overflow: auto;
  82. .follow-date {
  83. padding: 20rpx 0 20rpx 20rpx;
  84. }
  85. .todo-item {
  86. padding: 12rpx 40rpx 12rpx 46rpx;
  87. background: #f2f3f5;
  88. border-radius: 15rpx;
  89. margin-bottom: 32rpx;
  90. .tit-txt {
  91. font-size: 28rpx;
  92. font-weight: bold;
  93. color: #323232;
  94. }
  95. .content {
  96. padding: 10rpx 0;
  97. font-size: 28rpx;
  98. color: #646464;
  99. }
  100. .content-footer {
  101. padding: 0 0 12rpx 0;
  102. font-size: 24rpx;
  103. .date {
  104. color: #969696;
  105. }
  106. .user-img {
  107. width: 46rpx;
  108. height: 46rpx;
  109. border-radius: 50%;
  110. margin-right: 15rpx;
  111. }
  112. }
  113. }
  114. }
  115. </style>