index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="h-full flex p-3 flex-col businessDetail">
  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. <!-- 内容 -->
  16. <div class="flex-1 flex flex-col overflow-y-auto overflow-x-hidden scroll-bar"
  17. v-loading="allLoading.customerDetailLoading">
  18. <div class="w-full h-auto flex justify-between">
  19. <div class="bg-white shadow-md rounded-md" style="width: 46%;">
  20. <Information :data="information" @refreshData="getDetail" />
  21. </div>
  22. <div class="bg-white ml-2 shadow-md rounded-md flex-1">
  23. <Attachment :data="information" @refreshData="getDetail" />
  24. </div>
  25. </div>
  26. <div class="w-full h-auto flex justify-between mt-2">
  27. <div class="bg-white shadow-md rounded-md" style="width: 65%;">
  28. <DetailCompinents :data="detailCompinentsData" :information="information" :formTaskType="0"
  29. :filed="'customId'" :disabledList="['taskType', 'customId']"
  30. @refreshData="getDetail" />
  31. </div>
  32. <div class="bg-white ml-2 shadow-md rounded-md flex-1">
  33. <OperationRecord :data="information" />
  34. </div>
  35. </div>
  36. <div class="w-full h-auto flex justify-between mt-2">
  37. <div class="bg-white shadow-md rounded-md w-full">
  38. <RelatedContacts :data="information" @refreshData="getDetail" />
  39. </div>
  40. </div>
  41. <div class="w-full h-auto flex justify-between mt-2">
  42. <div class="bg-white shadow-md rounded-md w-full">
  43. <RelatedBusiness :data="information" @refreshData="getDetail" />
  44. </div>
  45. </div>
  46. <div class="w-full h-auto flex justify-between mt-2">
  47. <div class="bg-white shadow-md rounded-md w-full">
  48. <RelatedOrders :data="information" @refreshData="getDetail" />
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script lang="ts" setup>
  55. import { ref, reactive, onMounted, inject } from "vue";
  56. import type { FormInstance, FormRules } from 'element-plus'
  57. import { backPath } from '@/utils/tools'
  58. import { Edit, ArrowLeft as IconView } from '@element-plus/icons-vue'
  59. import { URL_FETALL, URL_GETDETAIL } from '../api'
  60. import { post, get } from "@/utils/request";
  61. import { useRoute } from "vue-router";
  62. import Information from '../component/information.vue'
  63. import Attachment from '../component/attachment.vue'
  64. import RelatedTasks from '../component/relatedTasks.vue';
  65. import OperationRecord from '../component/operationRecord.vue';
  66. import RelatedBusiness from '../component/relatedBusiness.vue';
  67. import RelatedContacts from "../component/relatedContacts.vue";
  68. import RelatedOrders from "../component/relatedOrders.vue"
  69. import DetailCompinents from '@/components/detailcompinents/relatedTasks.vue'
  70. import { formatDate } from "@/utils/times";
  71. const route = useRoute()
  72. const globalPopup = inject<GlobalPopup>('globalPopup')
  73. const rowId = ref(+(route.query.id || ''))
  74. const values = ref<any>('')
  75. const options = ref<optionType[]>([])
  76. const information = ref<any>({})
  77. const detailCompinentsData = ref([])
  78. const allLoading = reactive({
  79. customerDetailLoading: false
  80. })
  81. function getDetail() {
  82. allLoading.customerDetailLoading = true
  83. post(URL_GETDETAIL, { id: values.value }).then((res) => {
  84. res.data.newCreateTime = formatDate(new Date(res.data.createTime)),
  85. information.value = res.data
  86. detailCompinentsData.value = res.data.tasks || []
  87. }).finally(() => {
  88. allLoading.customerDetailLoading = false
  89. })
  90. }
  91. function getAllCustomer() {
  92. get(URL_FETALL).then(({ data }) => {
  93. options.value = data.map((item: any) => ({
  94. value: item.id,
  95. label: item.customName
  96. }))
  97. })
  98. }
  99. onMounted(() => {
  100. values.value = rowId.value || ''
  101. getAllCustomer()
  102. getDetail()
  103. })
  104. </script>
  105. <style lang="scss" scoped>
  106. .businessDetail {
  107. .icon {
  108. .el-link {
  109. color: #0052CC;
  110. }
  111. }
  112. .text {
  113. .el-link {
  114. color: #fff;
  115. font-size: 14px;
  116. }
  117. }
  118. .backDarkBlue {
  119. background-color: #0052CC;
  120. color: #fff;
  121. }
  122. .backGray {
  123. background-color: #F4F5F7;
  124. color: #000;
  125. }
  126. .startStep {
  127. clip-path: polygon(0% 0%,
  128. 90% 0%,
  129. 100% 50%,
  130. 90% 100%,
  131. 0% 100%);
  132. }
  133. .nextStep {
  134. clip-path: polygon(0% 0%,
  135. 90% 0%,
  136. 100% 50%,
  137. 90% 100%,
  138. 0% 100%,
  139. 10% 50%);
  140. }
  141. .endStep {
  142. clip-path: polygon(0% 0%,
  143. 100% 0%,
  144. 100% 100%,
  145. 0% 100%,
  146. 10% 50%);
  147. }
  148. .itemPing {
  149. padding-top: 4px;
  150. padding-bottom: 4px;
  151. }
  152. }
  153. </style>