DetailsRecords.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <!--
  2. * @Author: liuzl 461480418@qq.com
  3. * @Date: 2023-01-09 17:42:13
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-01-09 17:55:42
  6. * @Description: file content
  7. * @FilePath: \订单全流程管理系统\src\views\contract\components\DetailsRecords.vue
  8. -->
  9. <template>
  10. <ul class="records">
  11. <li v-for="(value, key) in dynamicsList" :key="key">
  12. <div class="date">
  13. <h2>{{ key.split('-')[2] }}</h2>
  14. <h3>{{ key.split('-').splice(0, 2).join('.') }}</h3>
  15. </div>
  16. <ul class="content">
  17. <li v-for="(item, index) in dynamicsList[key]" :key="index">
  18. <!-- <el-avatar class="user-avatar"
  19. :src="avatar" /> -->
  20. <vab-icon class="user-avatar" icon="account-circle-fill" />
  21. <div class="text">
  22. <p class="action">{{ item.opnPeople !== '-1' ? item.opnPeople : '' }} {{ opnTypeFormat(item.opnType) }}</p>
  23. <p>{{ item.opnDate }}</p>
  24. <div v-if="item.opnContent">
  25. <p v-if="item.opnType === '30'">
  26. 销售工程师:
  27. <span>{{ item.opnContent.saleName }}</span>
  28. </p>
  29. <p v-if="item.opnType === '40' || item.opnType === '50'">
  30. 项目类别:
  31. <span>
  32. {{
  33. selectDictLabel(nboTypeOptions, item.opnContent.origNboType) +
  34. ' => ' +
  35. selectDictLabel(nboTypeOptions, item.opnContent.nboType)
  36. }}
  37. </span>
  38. </p>
  39. <p v-if="item.opnContent.custName">
  40. 客户名称:
  41. <span>{{ item.opnContent.custName }}</span>
  42. </p>
  43. <template v-else-if="item.opnContent.contactName">
  44. <p>
  45. 联系人名称:
  46. <span>{{ item.opnContent.contactName }}</span>
  47. </p>
  48. <p>职务:{{ item.opnContent.contactPostion }}</p>
  49. <p>手机:{{ item.opnContent.contactTelephone }}</p>
  50. </template>
  51. </div>
  52. </div>
  53. </li>
  54. </ul>
  55. </li>
  56. </ul>
  57. </template>
  58. <script>
  59. export default {
  60. name: 'DetailsRecords',
  61. props: {
  62. dynamicsList: {
  63. // eslint-disable-next-line vue/require-prop-type-constructor
  64. type: Array | Object,
  65. default: () => [],
  66. },
  67. },
  68. data() {
  69. return {
  70. nboTypeOptions: [],
  71. }
  72. },
  73. mounted() {
  74. // console.log(this.dynamicsList)
  75. this.getDicts('proj_nbo_type').then((response) => {
  76. this.nboTypeOptions = response.data.values || []
  77. })
  78. },
  79. methods: {
  80. opnTypeFormat(opnType) {
  81. if (opnType === '10') {
  82. return '创建了项目'
  83. } else if (opnType === '20') {
  84. return '更新了项目'
  85. } else if (opnType === '30') {
  86. return '更新项目状态'
  87. } else if (opnType === '40') {
  88. return '项目升级'
  89. } else if (opnType === '41') {
  90. return '项目升级审批'
  91. } else if (opnType === '50') {
  92. return '项目降级'
  93. } else if (opnType === '51') {
  94. return '项目降级审批'
  95. } else if (opnType === '60') {
  96. return '项目转移'
  97. } else if (opnType === '61') {
  98. return '项目转移审批'
  99. } else if (opnType === '70') {
  100. return '关联了联系人'
  101. } else if (opnType === '71') {
  102. return '解除关联了联系人'
  103. } else if (opnType === '72') {
  104. return '设置首要联系人'
  105. } else if (opnType === '80') {
  106. return '项目转为储备项目'
  107. } else if (opnType === '81') {
  108. return '项目转为储备审批'
  109. } else {
  110. return ''
  111. }
  112. },
  113. },
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .records {
  118. margin: 0;
  119. padding: 10px 20px;
  120. list-style: none;
  121. height: 100%;
  122. overflow-y: auto;
  123. > li {
  124. display: flex;
  125. & + li {
  126. margin-top: 10px;
  127. }
  128. }
  129. .date {
  130. width: 100px;
  131. display: flex;
  132. flex-direction: column;
  133. align-items: center;
  134. h2,
  135. h3 {
  136. margin: 0;
  137. }
  138. h2 {
  139. font-size: 26px;
  140. line-height: 32px;
  141. }
  142. }
  143. .content {
  144. flex: 1;
  145. list-style: none;
  146. li {
  147. display: flex;
  148. & + li {
  149. margin-top: 10px;
  150. }
  151. }
  152. .user-avatar {
  153. font-size: 40px;
  154. }
  155. .text {
  156. flex: 1;
  157. padding-left: 20px;
  158. p {
  159. font-weight: 500;
  160. margin: 0;
  161. line-height: 20px;
  162. span {
  163. color: #1d66dc;
  164. }
  165. }
  166. p:nth-child(2) {
  167. margin-bottom: 10px;
  168. }
  169. .action {
  170. font-weight: bold;
  171. color: #333;
  172. }
  173. }
  174. }
  175. }
  176. </style>