aboutOperation.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <section class="section about-operation">
  3. <view class="section-title">
  4. <image :src="$static('images/crm_about/point.png')" class="icon" />
  5. <text class="title">
  6. 操作记录
  7. </text>
  8. </view>
  9. <view class="section-body">
  10. <template v-if="listData.length > 0">
  11. <view class="list">
  12. <view v-for="(item, index) in listData" :key="index" class="list-item">
  13. <view class="icon-box">
  14. <text class="icon" />
  15. </view>
  16. <view class="content">
  17. <view class="user-info">
  18. <wk-avatar :name="item.realname" :avatar="item.img" class="avatar" />
  19. <text class="username">
  20. {{ item.realname }}
  21. </text>
  22. <text class="time">
  23. {{ item.createTime }}
  24. </text>
  25. </view>
  26. <view
  27. v-for="(content, childIndex) in item.content"
  28. :key="childIndex"
  29. class="option">
  30. <text class="option-text">
  31. {{ content }}
  32. </text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <template v-else>
  39. <view class="no-data">
  40. 暂无数据
  41. </view>
  42. </template>
  43. </view>
  44. </section>
  45. </template>
  46. <script>
  47. /**
  48. * 操作记录
  49. */
  50. import { baseRecordList } from 'API/base'
  51. import { isArray } from '@/utils/types.js'
  52. export default {
  53. name: 'AboutOperation',
  54. props: {
  55. type: {
  56. type: String,
  57. default: null
  58. },
  59. detailId: {
  60. type: [String, Number],
  61. default: null
  62. }
  63. },
  64. data() {
  65. return {
  66. typesMap: {
  67. crm_customer: {key: 2, value: '客户'},
  68. crm_contacts: {key: 3, value: '联系人'},
  69. crm_business: {key: 5, value: '商机'},
  70. crm_product: {key: 4, value: '产品'},
  71. crm_contract: {key: 6, value: '合同'},
  72. crm_leads: {key: 1, value: '线索'},
  73. crm_invoice: {key: 18, value: '发票'},
  74. },
  75. listData: []
  76. }
  77. },
  78. created() {
  79. this.getList()
  80. },
  81. methods: {
  82. getList() {
  83. if (!this.typesMap.hasOwnProperty(this.type)) return
  84. let params = {
  85. types: this.typesMap[this.type].key,
  86. actionId: this.detailId
  87. }
  88. baseRecordList(params).then(response => {
  89. if (isArray(response)) {
  90. this.listData = response
  91. }
  92. }).catch()
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. @import './style.scss';
  99. .about-operation {
  100. background-color: white;
  101. .section-body {
  102. padding: 0 30rpx;
  103. .list {
  104. margin-top: 36rpx;
  105. .list-item {
  106. display: flex;
  107. .time {
  108. flex-direction: column;
  109. @include left;
  110. .date {
  111. font-size: 26rpx;
  112. color: $dark;
  113. }
  114. .now {
  115. font-size: 24rpx;
  116. color: $gray;
  117. }
  118. }
  119. .icon-box{
  120. position: relative;
  121. display: flex;
  122. .icon {
  123. z-index: 2;
  124. width: 20rpx;
  125. height: 20rpx;
  126. border-radius: 50%;
  127. border: 5rpx solid #d5d5d5;
  128. margin: 14rpx 24rpx 0;
  129. }
  130. &::before {
  131. position: absolute;
  132. z-index: 1;
  133. top: 30rpx;
  134. left: 50%;
  135. transform: translateX(-50%);
  136. content: '';
  137. width: 1rpx;
  138. height: calc(100% - 16rpx);
  139. border-left: 1rpx dotted #d8d8d8;
  140. display: block;
  141. }
  142. }
  143. .content {
  144. flex: 1;
  145. padding-bottom: 36rpx;
  146. overflow: hidden;
  147. .user-info {
  148. font-size: 30rpx;
  149. @include left;
  150. .avatar {
  151. width: 70rpx;
  152. height: 70rpx;
  153. }
  154. .username {
  155. flex: 1;
  156. margin-left: 15rpx;
  157. }
  158. .time {
  159. font-size: 26rpx;
  160. color: #999;
  161. }
  162. }
  163. .option {
  164. font-size: 26rpx;
  165. color: $gray;
  166. display: flex;
  167. flex-wrap: wrap;
  168. padding-left: 80rpx;
  169. .option-title {}
  170. .option-text {
  171. flex: 1;
  172. word-break: break-all;
  173. overflow: hidden;
  174. }
  175. }
  176. }
  177. &:last-child {
  178. .icon-box {
  179. &::before {
  180. display: none;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>