recordDetailList.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="uni-app">
  3. <view class="status-bar" />
  4. <view class="main-container">
  5. <wk-nav-bar :title="navTitle" />
  6. <view class="list-view">
  7. <wk-scroll-view
  8. :status="listStatus"
  9. class="list-scroll"
  10. @refresh="getList({}, true)"
  11. @loadmore="getList()">
  12. <view
  13. v-for="(item, index) in listData"
  14. :key="index"
  15. class="record-item"
  16. @click="handleToDetail(item)">
  17. <view class="user-info">
  18. <wk-avatar
  19. :name="item.realname"
  20. :avatar="item.userImg"
  21. :preview="false"
  22. class="avatar" />
  23. <view class="info">
  24. <view class="username">
  25. <text>{{ item.realname }}</text>
  26. <view
  27. v-if="item.category"
  28. class="category">
  29. {{ item.category }}
  30. </view>
  31. </view>
  32. <view class="text">
  33. {{ item.createTime }}
  34. </view>
  35. </view>
  36. <view class="type-box">
  37. {{ titleMap[item.activityType].type }}-{{ typeMap[item.type] || '跟进记录' }}
  38. </view>
  39. </view>
  40. <view class="log-content">
  41. <log-item :log-data="item" :perview="false" />
  42. </view>
  43. <view class="record-footer">
  44. <view :class="titleMap[item.activityType].icon" class="wk icon" />
  45. <view class="text">
  46. <text style="color: #333">
  47. {{ titleMap[item.activityType].type }}-
  48. </text>{{ item.activityTypeName }}
  49. </view>
  50. </view>
  51. </view>
  52. </wk-scroll-view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import { instrumentQueryRecordList } from 'API/crm/work'
  59. import { QueryLogBulletinByType } from 'API/oa/journal'
  60. import LogItem from '@/components/base/log-item.vue'
  61. import mainListMixins from '@/mixins/mainList.js'
  62. import { isArray } from '@/utils/types.js'
  63. export default {
  64. name: 'RecordDetailList',
  65. components: {
  66. LogItem
  67. },
  68. mixins: [mainListMixins],
  69. data() {
  70. return {
  71. routerQuery: {},
  72. GetListFn: instrumentQueryRecordList,
  73. titleMap: {
  74. 1: {label: '新增的线索跟进记录', type: '线索', icon: 'wk-leads', path: '/pages_crm/leads/detail'},
  75. 2: {label: '新增的客户跟进记录', type: '客户', icon: 'wk-customer', path: '/pages_crm/customer/detail'},
  76. 3: {label: '新增的联系人跟进记录', type: '联系人', icon: 'wk-contacts', path: '/pages_crm/contacts/detail'},
  77. 5: {label: '新增的商机跟进记录', type: '商机', icon: 'wk-business', path: '/pages_crm/business/detail'},
  78. 6: {label: '新增的合同跟进记录', type: '合同', icon: 'wk-contract', path: '/pages_crm/contract/detail'}
  79. },
  80. typeMap: {
  81. 1: '跟进记录',
  82. 2: '创建记录',
  83. 3: '商机阶段变更',
  84. 4: '外勤签到'
  85. }
  86. }
  87. },
  88. computed: {
  89. navTitle() {
  90. return this.titleMap[this.routerQuery.crmType].label
  91. }
  92. },
  93. onLoad(options = {}) {
  94. this.routerQuery = {
  95. ...options,
  96. crmType: Number(options.crmType),
  97. label: Number(options.crmType),
  98. dataType: Number(options.dataType)
  99. }
  100. if (this.routerQuery.logId) {
  101. this.GetListFn = QueryLogBulletinByType
  102. }
  103. this.getList()
  104. },
  105. methods: {
  106. getParams() {
  107. if (this.routerQuery.logId) {
  108. return {
  109. logId: this.routerQuery.logId,
  110. crmType: this.routerQuery.crmType,
  111. queryType: 0,
  112. type: 5
  113. }
  114. }
  115. if (this.routerQuery.userList && !isArray(this.routerQuery.userList)) {
  116. this.routerQuery.userList = this.routerQuery.userList.split(',')
  117. }
  118. if (this.routerQuery.deptList && !isArray(this.routerQuery.deptList)) {
  119. this.routerQuery.deptList = this.routerQuery.deptList.split(',')
  120. }
  121. return {
  122. queryType: 0,
  123. ...this.routerQuery
  124. }
  125. },
  126. handleToDetail(item) {
  127. console.log('item-', item)
  128. this.$Router.navigateTo({
  129. url: this.titleMap[item.activityType].path,
  130. query: {
  131. id: item.activityTypeId
  132. }
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style scoped lang="scss">
  139. .list-view {
  140. flex: 1;
  141. overflow: hidden;
  142. .list-scroll {
  143. position: relative;
  144. width: 100%;
  145. height: 100%;
  146. overflow: hidden;
  147. .record-item {
  148. background-color: white;
  149. margin-top: 20rpx;
  150. .user-info {
  151. padding: 20rpx 30rpx;
  152. @include left;
  153. .avatar {
  154. width: 65rpx;
  155. height: 65rpx;
  156. }
  157. .info {
  158. flex: 1;
  159. margin-left: 16rpx;
  160. .username {
  161. font-size: 28rpx;
  162. font-weight: 500;
  163. color: #333;
  164. @include left;
  165. .category {
  166. height: 38rpx;
  167. font-size: 26rpx;
  168. color: #999;
  169. background-color: #f6f6f6;
  170. border-radius: 38rpx;
  171. padding: 0 15rpx;
  172. margin-left: 20rpx;
  173. @include center;
  174. }
  175. }
  176. .text {
  177. font-size: 24rpx;
  178. color: #999;
  179. }
  180. }
  181. .type-box {
  182. font-size: 24rpx;
  183. color: #999;
  184. }
  185. }
  186. .log-content {
  187. padding: 0 30rpx 15rpx;
  188. }
  189. .record-footer {
  190. width: 100%;
  191. font-size: 26rpx;
  192. color: $theme-color;
  193. background-color: #f5f8fa;
  194. border-top: 1rpx solid $border-color;
  195. border-bottom: 1rpx solid $border-color;
  196. padding: 15rpx 30rpx;
  197. @include left;
  198. .icon {
  199. font-size: 32rpx;
  200. color: $theme-color;
  201. margin-right: 15rpx;
  202. }
  203. }
  204. }
  205. }
  206. }
  207. </style>