LatestProgress.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div v-loading="loading" class="progress">
  3. <el-timeline reverse>
  4. <el-timeline-item v-for="(item, index) in progressList" :key="index" color="#0084FF" placement="top" hide-timestamp>
  5. <div class="details" :style="getColor(item.type)">
  6. <div class="t">{{ getTitle(item.type) }}</div>
  7. <div class="content11" v-if="item.type != 30">
  8. <span class="gray">跟进摘要: </span>
  9. <span class="val"> {{ getContent(item) }} </span>
  10. </div>
  11. <div class="content11" v-else>
  12. <span class="gray">跟进记录: </span>
  13. <span class="val"> {{ item.remark }} </span>
  14. </div>
  15. <div style="margin: 8px 0; display: flex" v-if="item.fileList && item.fileList.length > 0">
  16. <div style="width: 36px; color: #999999">附件:</div>
  17. <div style="width: calc(100% - 36px)">
  18. <div v-for="(file, index) in item.fileList" :key="index">
  19. <a style="color: #409eff; cursor: pointer" @click="openFile(file.fileUrl)">{{ file.fileName }}</a>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="gray">{{ item.createTime }}</div>
  24. </div>
  25. </el-timeline-item>
  26. </el-timeline>
  27. </div>
  28. </template>
  29. <script setup>
  30. const props = defineProps({
  31. customerId: {
  32. type: String,
  33. },
  34. });
  35. const { proxy } = getCurrentInstance();
  36. const loading = ref(false);
  37. const progressList = ref([]);
  38. const getData = () => {
  39. loading.value = true;
  40. proxy.post("/saleQuotation/latestFollowUp", { id: props.customerId }).then((res) => {
  41. progressList.value = res.rows;
  42. if (res.rows && res.rows.length > 0 && res.rows.map((rows) => rows.id).length > 0) {
  43. proxy.post("/fileInfo/getList", { businessIdList: res.rows.map((rows) => rows.id) }).then((fileObj) => {
  44. for (let i = 0; i < res.rows.length; i++) {
  45. progressList.value[i].fileList = fileObj[progressList.value[i].id] || [];
  46. }
  47. });
  48. }
  49. setTimeout(() => {
  50. loading.value = false;
  51. }, 200);
  52. });
  53. };
  54. onMounted(() => {
  55. if (props.customerId) {
  56. getData();
  57. }
  58. });
  59. const getTitle = (type) => {
  60. switch (type) {
  61. case 10:
  62. return "报价单";
  63. case 20:
  64. return "合同";
  65. case 30:
  66. return "手动跟进";
  67. default:
  68. return "";
  69. }
  70. };
  71. const getContent = (item) => {
  72. if (item.type === 10) {
  73. return "报价单总金额 " + proxy.moneyFormat(item.amount, 2);
  74. } else if (item.type === 20) {
  75. return "合同总金额 " + proxy.moneyFormat(item.amount, 2) + ` (${item.contractCode}) `;
  76. }
  77. };
  78. const openFile = (path) => {
  79. window.open(path, "_blank");
  80. };
  81. const getColor = (type) => {
  82. const obj = {
  83. 0: "#EAE8FB",
  84. 10: "#FCF1E4",
  85. 20: "#E2FBE8",
  86. 30: "#D9EDFF",
  87. 40: "#E4F9F9",
  88. };
  89. return "background-color: " + obj[type];
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. :deep(.el-timeline-item) {
  94. padding-bottom: 10px;
  95. }
  96. :deep(.el-timeline-item__wrapper) {
  97. top: 5px;
  98. }
  99. .progress {
  100. padding: 10px;
  101. }
  102. .details {
  103. padding: 10px;
  104. // background-color: #d9edff;
  105. border-radius: 5px;
  106. font-size: 12px;
  107. .t {
  108. color: #333333;
  109. font-weight: bold;
  110. }
  111. .content11 {
  112. margin: 4px 0;
  113. display: flex;
  114. .val {
  115. flex: 1;
  116. overflow: hidden;
  117. white-space: nowrap;
  118. text-overflow: ellipsis;
  119. }
  120. }
  121. .gray {
  122. color: #999999;
  123. }
  124. }
  125. </style>
  126. <style>
  127. ul {
  128. margin: 0px;
  129. padding: 0px;
  130. }
  131. </style>