DetailsFollow.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div>
  3. <ul v-if="followList.length" class="follow">
  4. <li v-for="(date, index) in followList" :key="index">
  5. <div class="date">
  6. <h2>{{ date.followDay.split('-')[2] }}</h2>
  7. <h3>
  8. {{ date.followDay.split('-').splice(0, 2).join('.') }}
  9. </h3>
  10. </div>
  11. <ul class="content">
  12. <li v-for="(item, idx) in date.followupList" :key="idx">
  13. <!-- <el-avatar class="user-avatar"
  14. :src="avatar" />-->
  15. <div class="text-container">
  16. <vab-icon class="user-avatar" icon="account-circle-fill" />
  17. <div class="text">
  18. <p class="action">
  19. <span>{{ item.contactsName }} 跟进({{ formatType(item.followType) }})</span>
  20. <span>
  21. <vab-icon icon="time-line" />
  22. {{ item.followDate }}
  23. </span>
  24. </p>
  25. <p>{{ item.followContent }}</p>
  26. <div class="footer">
  27. <p>
  28. 来自客户:
  29. <span>{{ item.custName }}</span>
  30. </p>
  31. <div>
  32. <el-button size="mini" @click="showDetail(item)">
  33. <vab-icon icon="arrow-right-circle-fill" />
  34. 详情
  35. </el-button>
  36. <el-button size="mini" @click="showComment(item)">评论({{ item.commentNumber }})</el-button>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <transition name="height">
  42. <ul v-if="item.showComment" class="comments">
  43. <li v-for="comment in item.comments" :key="comment.id">
  44. <vab-icon class="user-avatar" icon="account-circle-fill" />
  45. <div class="text">
  46. <p>{{ comment.createdName }}</p>
  47. <p>{{ comment.content }}</p>
  48. <p>{{ comment.createdTime }}</p>
  49. </div>
  50. </li>
  51. </ul>
  52. </transition>
  53. </li>
  54. </ul>
  55. </li>
  56. </ul>
  57. <div v-else class="no-follow">暂无跟进记录</div>
  58. </div>
  59. </template>
  60. <script>
  61. import follow from '@/api/customer/follow'
  62. import to from 'await-to-js'
  63. export default {
  64. name: 'Records',
  65. props: {
  66. busId: {
  67. type: Number,
  68. default: 0,
  69. },
  70. },
  71. data() {
  72. return {
  73. followList: [],
  74. }
  75. },
  76. mounted() {
  77. console.log(this.busId)
  78. },
  79. methods: {
  80. async fetchData() {
  81. let params = {
  82. targetId: String(this.busId),
  83. DaysBeforeToday: 9999,
  84. }
  85. let err, res
  86. ;[err, res] = await to(follow.getListByDay(params))
  87. if (err) return
  88. this.followList = res.data.list || []
  89. },
  90. },
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .follow {
  95. height: 100%;
  96. padding: 10px 20px;
  97. overflow: auto;
  98. > li {
  99. display: flex;
  100. + li {
  101. margin-top: 10px;
  102. }
  103. }
  104. .date {
  105. width: 100px;
  106. display: flex;
  107. flex-direction: column;
  108. align-items: center;
  109. h2,
  110. h3 {
  111. margin: 0;
  112. }
  113. h2 {
  114. font-size: 26px;
  115. line-height: 32px;
  116. }
  117. }
  118. .content {
  119. flex: 1;
  120. list-style: none;
  121. > li {
  122. border: 1px solid rgb(215, 232, 244);
  123. background: rgb(247, 251, 254);
  124. border-radius: 4px;
  125. padding: 8px;
  126. overflow: hidden;
  127. .text-container {
  128. display: flex;
  129. }
  130. .comments {
  131. padding-left: 60px;
  132. margin-top: 10px;
  133. max-height: 190px;
  134. overflow: auto;
  135. li {
  136. display: flex;
  137. border-top: 1px solid #e3e5e7;
  138. .text {
  139. flex: 1;
  140. padding: 0 10px;
  141. p {
  142. font-weight: 500;
  143. margin: 0;
  144. line-height: 32px;
  145. }
  146. p:first-child {
  147. line-height: 30px;
  148. font-weight: bold;
  149. }
  150. p:last-child {
  151. font-size: 12px;
  152. color: #9499a0;
  153. text-align: right;
  154. }
  155. }
  156. }
  157. }
  158. + li {
  159. margin-top: 10px;
  160. }
  161. }
  162. .user-avatar {
  163. font-size: 40px;
  164. }
  165. .text {
  166. flex: 1;
  167. padding-left: 20px;
  168. padding-right: 10px;
  169. p {
  170. font-weight: 500;
  171. margin: 0;
  172. line-height: 32px;
  173. span {
  174. color: #1d66dc;
  175. }
  176. }
  177. .action {
  178. display: flex;
  179. justify-content: space-between;
  180. span:first-child {
  181. font-weight: bold;
  182. color: #333;
  183. }
  184. }
  185. .footer {
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. }
  190. }
  191. }
  192. }
  193. .no-follow {
  194. height: 100%;
  195. width: 100%;
  196. display: flex;
  197. align-items: center;
  198. justify-content: center;
  199. font-size: 12px;
  200. color: rgba(0, 0, 0, 0.65);
  201. }
  202. </style>