index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class="h-full flex p-3 flex-col businessDetail" v-loading="pageLoading">
  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: 150px">
  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. <!-- 内容 -->
  16. <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar" v-loading="pageLoading">
  17. <div class="w-full h-auto flex justify-between">
  18. <div class="bg-white shadow-md rounded-md" style="width: 46%;">
  19. <Information :data="information" />
  20. </div>
  21. <div class="bg-white ml-2 shadow-md rounded-md flex-1">
  22. <Attachment :data="attachment" :information="information" />
  23. </div>
  24. </div>
  25. <div class="w-full h-auto flex justify-between mt-2">
  26. <div class="bg-white shadow-md rounded-md" style="width: 65%;">
  27. <!-- <RelatedTasks :data="relatedTasks" :information="information" /> -->
  28. <Detailcompinents :data="relatedTasks" :information="information" :formTaskType="0" :filed="'contactsId'" :disabledList="['contactsId']" @refreshData="getDetail" />
  29. </div>
  30. <div class="bg-white ml-2 shadow-md rounded-md flex-1">
  31. <OperationRecord :data="operationRecord" />
  32. </div>
  33. </div>
  34. <div class="w-full h-auto flex justify-between mt-2">
  35. <div class="bg-white shadow-md rounded-md w-full">
  36. <RelatedBusiness :data="relatedBusiness" />
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script lang="ts" setup>
  43. import { ref, reactive, onMounted, inject } from "vue";
  44. import { Edit, ArrowLeft as IconView } from '@element-plus/icons-vue'
  45. import { backPath } from '../../../utils/tools'
  46. import { useRoute } from "vue-router";
  47. import { post } from "@/utils/request";
  48. import { URL_GETALL, URL_GETDETAIL } from "../api";
  49. import Information from '../component/information.vue'
  50. import Attachment from '../component/attachment.vue'
  51. import RelatedTasks from '../component/relatedTasks.vue'
  52. import OperationRecord from '../component/operationRecord.vue'
  53. import Detailcompinents from '@/components/detailcompinents/relatedTasks.vue'
  54. import RelatedBusiness from '../component/relatedBusiness.vue'
  55. const route = useRoute()
  56. const globalPopup = inject<GlobalPopup>('globalPopup')
  57. const information = ref({}) // 基本信息
  58. const attachment = ref([]) // 附件
  59. const relatedTasks = ref([]) // 相关任务
  60. const operationRecord = ref([]) // 操作记录
  61. const relatedBusiness = ref([]) // 相关商机
  62. const rowId = ref(+(route.query.id || ''))
  63. const values = ref<number | string>('')
  64. const options = ref<optionType[]>([])
  65. const pageLoading = ref(false)
  66. function getDetail() {
  67. pageLoading.value = true
  68. post(URL_GETDETAIL, {}).then((res) => {
  69. console.log(res)
  70. }).finally(() => {
  71. pageLoading.value = false
  72. })
  73. }
  74. function getAllContacts() {
  75. post(URL_GETALL, {}).then(({ data }) => {
  76. options.value = (data || []).map((item: any) => ({ value: item.id, label: item.name }))
  77. }).catch((err) => {
  78. globalPopup?.showError(err.message)
  79. })
  80. }
  81. onMounted(() => {
  82. values.value = rowId.value || ''
  83. getAllContacts()
  84. getDetail()
  85. })
  86. </script>
  87. <style lang="scss" scoped></style>