ContactDetailsHeader.vue 1.8 KB

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