CustomerDetailsHeader.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div v-loading="loading">
  3. <div class="flex items-start justify-between">
  4. <div>
  5. <!-- 左上:客户基本信息 -->
  6. <el-col>
  7. <el-row>
  8. <span class="text-xl font-bold">{{ customer.name }}</span>
  9. </el-row>
  10. </el-col>
  11. </div>
  12. <div>
  13. <!-- 右上:按钮 -->
  14. <el-button v-hasPermi="['crm:customer:update']" @click="openForm(customer.id)">
  15. 编辑
  16. </el-button>
  17. <el-button>更改成交状态</el-button>
  18. </div>
  19. </div>
  20. </div>
  21. <ContentWrap class="mt-10px">
  22. <el-descriptions :column="5" direction="vertical">
  23. <el-descriptions-item label="客户级别">
  24. <dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="customer.level" />
  25. </el-descriptions-item>
  26. <el-descriptions-item label="成交状态">
  27. {{ customer.dealStatus ? '已成交' : '未成交' }}
  28. </el-descriptions-item>
  29. <el-descriptions-item label="负责人">{{ customer.ownerUserName }} </el-descriptions-item>
  30. <!-- TODO wanwan 首要联系人? -->
  31. <el-descriptions-item label="首要联系人" />
  32. <!-- TODO wanwan 首要联系人电话? -->
  33. <el-descriptions-item label="首要联系人电话">{{ customer.mobile }} </el-descriptions-item>
  34. </el-descriptions>
  35. </ContentWrap>
  36. <!-- 表单弹窗:添加/修改 -->
  37. <CustomerForm ref="formRef" @success="emit('refresh')" />
  38. </template>
  39. <script setup lang="ts">
  40. import { DICT_TYPE } from '@/utils/dict'
  41. import * as CustomerApi from '@/api/crm/customer'
  42. import CustomerForm from '../CustomerForm.vue'
  43. const { customer, loading } = defineProps<{
  44. customer: CustomerApi.CustomerVO // 客户信息
  45. loading: boolean // 加载中
  46. }>()
  47. /** 修改操作 */
  48. const formRef = ref()
  49. const openForm = (id?: number) => {
  50. formRef.value.open('update', id)
  51. }
  52. const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
  53. </script>