@ -47,7 +47,7 @@
|
||||
<el-form-item label="产品单位" prop="unit">
|
||||
<el-select v-model="formData.unit" class="w-1/1" placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.PRODUCT_UNIT)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PRODUCT_UNIT)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
||||
@ -22,29 +22,28 @@
|
||||
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="产品单位">
|
||||
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="product.unit"/>
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="产品价格">{{ fenToYuan(product.price) }}元</el-descriptions-item>
|
||||
<el-descriptions-item label="产品编码">{{ product.no }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</ContentWrap>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ProductForm ref="formRef" @success="emit('refresh')"/>
|
||||
<ProductForm ref="formRef" @success="emit('refresh')" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import ProductForm from '@/views/crm/product/ProductForm.vue'
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import {fenToYuan} from "@/utils";
|
||||
import * as ProductApi from "@/api/crm/product";
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import { fenToYuan } from '@/utils'
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
|
||||
|
||||
|
||||
//操作修改
|
||||
// 操作修改
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
const {product} = defineProps<{ product: ProductApi.ProductVO }>()
|
||||
const { product } = defineProps<{ product: ProductApi.ProductVO }>()
|
||||
const emit = defineEmits(['refresh']) // 定义 success 事件,用于操作成功后的回调
|
||||
|
||||
/** 初始化 */
|
||||
|
||||
@ -14,10 +14,10 @@
|
||||
{{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否上下架">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status"/>
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_STATUS" :value="product.status" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单位">
|
||||
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="product.unit"/>
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-collapse-item>
|
||||
@ -25,12 +25,12 @@
|
||||
</ContentWrap>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {DICT_TYPE} from '@/utils/dict'
|
||||
import { DICT_TYPE } from '@/utils/dict'
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import {fenToYuan} from '@/utils'
|
||||
import { fenToYuan } from '@/utils'
|
||||
import * as ProductCategoryApi from '@/api/crm/product/productCategory'
|
||||
|
||||
const {product} = defineProps<{
|
||||
const { product } = defineProps<{
|
||||
product: ProductApi.ProductVO
|
||||
}>()
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
<el-table-column label="产品类型" align="center" prop="categoryName" width="160" />
|
||||
<el-table-column label="产品单位" align="center" prop="unit">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PRODUCT_UNIT" :value="scope.row.unit" />
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品编码" align="center" prop="no" />
|
||||
|
||||
Reference in New Issue
Block a user