DetailsRecords.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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="['41', '51', '61', '81'].includes(item.opnType)">
  40. 审批结果:
  41. <span>{{ selectDictLabel(approStatusOptions, item.opnContent.approStatus) }}</span>
  42. </p>
  43. <p v-if="item.opnContent.custName">
  44. 客户名称:
  45. <span>{{ item.opnContent.custName }}</span>
  46. </p>
  47. <template v-else-if="item.opnContent.contactName">
  48. <p>
  49. 联系人名称:
  50. <span>{{ item.opnContent.contactName }}</span>
  51. </p>
  52. <p>职务:{{ item.opnContent.contactPostion }}</p>
  53. <p>手机:{{ item.opnContent.contactTelephone }}</p>
  54. </template>
  55. </div>
  56. </div>
  57. </li>
  58. </ul>
  59. </li>
  60. </ul>
  61. </template>
  62. <script>
  63. export default {
  64. name: 'DetailsRecords',
  65. props: {
  66. dynamicsList: {
  67. // eslint-disable-next-line vue/require-prop-type-constructor
  68. type: Array | Object,
  69. default: () => [],
  70. },
  71. },
  72. data() {
  73. return {
  74. nboTypeOptions: [],
  75. approStatusOptions: [],
  76. }
  77. },
  78. mounted() {
  79. // console.log(this.dynamicsList)
  80. this.getDicts('proj_nbo_type').then((response) => {
  81. this.nboTypeOptions = response.data.values || []
  82. })
  83. this.getDicts('proj_appro_status').then((response) => {
  84. this.approStatusOptions = response.data.values || []
  85. })
  86. },
  87. methods: {
  88. opnTypeFormat(opnType) {
  89. if (opnType === '10') {
  90. return '创建了项目'
  91. } else if (opnType === '11') {
  92. return '创建项目审批'
  93. } else if (opnType === '20') {
  94. return '更新了项目'
  95. } else if (opnType === '30') {
  96. return '更新项目状态'
  97. } else if (opnType === '40') {
  98. return '项目升级'
  99. } else if (opnType === '41') {
  100. return '项目升级审批'
  101. } else if (opnType === '50') {
  102. return '项目降级'
  103. } else if (opnType === '51') {
  104. return '项目降级审批'
  105. } else if (opnType === '60') {
  106. return '项目转移'
  107. } else if (opnType === '61') {
  108. return '项目转移审批'
  109. } else if (opnType === '70') {
  110. return '关联了联系人'
  111. } else if (opnType === '71') {
  112. return '解除关联了联系人'
  113. } else if (opnType === '72') {
  114. return '设置首要联系人'
  115. } else if (opnType === '80') {
  116. return '项目转为储备项目'
  117. } else if (opnType === '81') {
  118. return '项目转为储备审批'
  119. } else {
  120. return ''
  121. }
  122. },
  123. },
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .records {
  128. margin: 0;
  129. padding: 10px 20px;
  130. list-style: none;
  131. height: 100%;
  132. overflow-y: auto;
  133. > li {
  134. display: flex;
  135. & + li {
  136. margin-top: 10px;
  137. }
  138. }
  139. .date {
  140. width: 100px;
  141. display: flex;
  142. flex-direction: column;
  143. align-items: center;
  144. h2,
  145. h3 {
  146. margin: 0;
  147. }
  148. h2 {
  149. font-size: 26px;
  150. line-height: 32px;
  151. }
  152. }
  153. .content {
  154. flex: 1;
  155. list-style: none;
  156. li {
  157. display: flex;
  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. p {
  169. font-weight: 500;
  170. margin: 0;
  171. line-height: 20px;
  172. span {
  173. color: #1d66dc;
  174. }
  175. }
  176. p:nth-child(2) {
  177. margin-bottom: 10px;
  178. }
  179. .action {
  180. font-weight: bold;
  181. color: #333;
  182. }
  183. }
  184. }
  185. }
  186. </style>