ContactDetailsHeader.vue 1.9 KB

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