ContactDetailsHeader.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div>
  3. <div class="flex items-start justify-between">
  4. <div>
  5. <el-col>
  6. <el-row>
  7. <span class="text-xl font-bold">{{ contact.name }}</span>
  8. </el-row>
  9. </el-col>
  10. </div>
  11. <div>
  12. <!-- 右上:按钮 -->
  13. <el-button @click="openForm('update', contact.id)" v-hasPermi="['crm:contact:update']">
  14. 编辑
  15. </el-button>
  16. </div>
  17. </div>
  18. </div>
  19. <ContentWrap class="mt-10px">
  20. <el-descriptions :column="5" direction="vertical">
  21. <el-descriptions-item label="客户">
  22. {{ contact.customerName }}
  23. </el-descriptions-item>
  24. <el-descriptions-item label="职务">
  25. {{ contact.post }}
  26. </el-descriptions-item>
  27. <el-descriptions-item label="手机">
  28. {{ contact.mobile }}
  29. </el-descriptions-item>
  30. <el-descriptions-item label="创建时间">
  31. {{ contact.createTime ? formatDate(contact.createTime) : '空' }}
  32. </el-descriptions-item>
  33. </el-descriptions>
  34. </ContentWrap>
  35. <!-- 表单弹窗:添加/修改 -->
  36. <ContactForm ref="formRef" @success="emit('refresh')" />
  37. </template>
  38. <script setup lang="ts">
  39. import * as ContactApi from '@/api/crm/contact'
  40. import ContactForm from '@/views/crm/contact/ContactForm.vue'
  41. import { formatDate } from '@/utils/formatTime'
  42. //操作修改
  43. const formRef = ref()
  44. const openForm = (type: string, id?: number) => {
  45. formRef.value.open(type, id)
  46. }
  47. const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
  48. const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
  49. </script>