ProductDetailsHeader.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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">{{ product.name }}</span>
  8. </el-row>
  9. </el-col>
  10. </div>
  11. <div>
  12. <!-- 右上:按钮 -->
  13. <el-button @click="openForm('update', product.id)" v-hasPermi="['crm:product: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="产品类别">{{ product.categoryName }}</el-descriptions-item>
  22. <el-descriptions-item label="产品单位">
  23. <dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
  24. </el-descriptions-item>
  25. <el-descriptions-item label="产品价格">
  26. {{ erpPriceInputFormatter(product.price) }} 元
  27. </el-descriptions-item>
  28. <el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item>
  29. </el-descriptions>
  30. </ContentWrap>
  31. <!-- 表单弹窗:添加/修改 -->
  32. <ProductForm ref="formRef" @success="emit('refresh')" />
  33. </template>
  34. <script setup lang="ts">
  35. import ProductForm from '@/views/crm/product/ProductForm.vue'
  36. import { DICT_TYPE } from '@/utils/dict'
  37. import { erpPriceInputFormatter } from '@/utils'
  38. import * as ProductApi from '@/api/crm/product'
  39. // 操作修改
  40. const formRef = ref()
  41. const openForm = (type: string, id?: number) => {
  42. formRef.value.open(type, id)
  43. }
  44. const { product } = defineProps<{ product: ProductApi.ProductVO }>()
  45. </script>