index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="h-full flex p-3 flex-col thredDetail">
  3. <div class="w-full bg-white p-2 mb-2 shadow-md rounded-md flex items-center">
  4. <div class="icon mr-4">
  5. <el-link :underline="false" @click="backPath()">
  6. <el-icon class="el-icon--right"><icon-view /></el-icon> 返回线索列表
  7. </el-link>
  8. </div>
  9. <div class="mr-8">
  10. <el-select v-model="values" placeholder="请选择" style="width: 250px" @change="getDetail()">
  11. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  12. </el-select>
  13. </div>
  14. </div>
  15. <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar" v-loading="loadings">
  16. <div class="h-full threadDetail">
  17. <div class="layout">
  18. <div class="bg-white w-1/2 shadow-md rounded-md">
  19. <Information :data="information" @refreshData="refreshData"></Information>
  20. </div>
  21. <div class="bg-white w-1/2 ml-3 shadow-md rounded-md">
  22. <Attachment :data="attachment" :information="information" @refreshData="refreshData"></Attachment>
  23. </div>
  24. </div>
  25. <div class="layout pt-3">
  26. <div class="bg-white w-2/3 shadow-md rounded-md">
  27. <DetailCompinents :data="relatedTasks" :information="information" :formTaskType="3"
  28. :disabledList="['taskType', 'clueId']" :filed="'clueId'" @refreshData="refreshData"></DetailCompinents>
  29. </div>
  30. <div class="bg-white w-1/3 ml-3 shadow-md rounded-md">
  31. <OperationRecord :data="operationRecord" :information="information" @refreshData="refreshData">
  32. </OperationRecord>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script lang="ts" setup>
  40. import Information from './components/information.vue'
  41. import Attachment from './components/attachment.vue'
  42. import DetailCompinents from '@/components/detailcompinents/relatedTasks.vue'
  43. import OperationRecord from './components/operationRecord.vue';
  44. import { ref, reactive, onMounted, inject } from "vue";
  45. import { Edit, ArrowLeft as IconView } from '@element-plus/icons-vue'
  46. import { post, get } from "@/utils/request";
  47. import { useRouter, useRoute } from "vue-router";
  48. import { GETDETAIL, GETTALLCLUE } from "../constant"
  49. import { backPath } from '@/utils/tools'
  50. const route = useRoute()
  51. const globalPopup = inject<GlobalPopup>('globalPopup')
  52. const values = ref<any>('')
  53. const options = ref<optionType[]>([])
  54. const information = ref({}) // 基本信息
  55. const attachment = ref([]) // 附件
  56. const relatedTasks = ref([]) // 相关任务
  57. const operationRecord = ref([]) // 操作记录
  58. const loadings = ref(false)
  59. function getDetail() {
  60. const id = values.value
  61. loadings.value = true
  62. post(GETDETAIL, { id }).then((res) => {
  63. const { clueLogList, files, taskList } = res.data
  64. information.value = res.data
  65. attachment.value = files || []
  66. relatedTasks.value = taskList || []
  67. operationRecord.value = clueLogList || []
  68. }).finally(() => {
  69. loadings.value = false
  70. })
  71. }
  72. function getAllClue() {
  73. post(GETTALLCLUE, { }).then(({ data }) => {
  74. options.value = (data ?? []).map((item: { clueName: string; id: number }) => ({
  75. label: item.clueName,
  76. value: item.id
  77. }));
  78. })
  79. }
  80. function refreshData() {
  81. getDetail()
  82. }
  83. onMounted(() => {
  84. const { id } = route.query
  85. values.value = id ? +id : ''
  86. getDetail()
  87. getAllClue()
  88. })
  89. </script>
  90. <style lang="scss" scoped>
  91. .thredDetail {
  92. .icon {
  93. .el-link {
  94. color: #0052CC;
  95. }
  96. }
  97. }
  98. .threadDetail {
  99. display: flex;
  100. flex-direction: column;
  101. .layout {
  102. width: 100%;
  103. height: 50%;
  104. display: flex;
  105. justify-content: space-between;
  106. }
  107. }
  108. </style>