1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| import type { DescriptionItemSchema } from '#/components/description';
|
| import { h } from 'vue';
|
| import { DICT_TYPE } from '@vben/constants';
| import { erpPriceInputFormatter } from '@vben/utils';
|
| import { DictTag } from '#/components/dict-tag';
|
| /** 详情页的字段 */
| export function useDetailSchema(): DescriptionItemSchema[] {
| return [
| {
| field: 'categoryName',
| label: '产品类别',
| },
| {
| field: 'unit',
| label: '产品单位',
| render: (val) =>
| h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: val }),
| },
| {
| field: 'price',
| label: '产品价格(元)',
| render: (val) => erpPriceInputFormatter(val),
| },
| {
| field: 'no',
| label: '产品编码',
| },
| ];
| }
|
| /** 详情页的基础字段 */
| export function useDetailBaseSchema(): DescriptionItemSchema[] {
| return [
| {
| field: 'name',
| label: '产品名称',
| },
| {
| field: 'no',
| label: '产品编码',
| },
| {
| field: 'price',
| label: '价格(元)',
| render: (val) => erpPriceInputFormatter(val),
| },
| {
| field: 'description',
| label: '产品描述',
| },
| {
| field: 'categoryName',
| label: '产品类型',
| },
| {
| field: 'status',
| label: '是否上下架',
| render: (val) =>
| h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_STATUS, value: val }),
| },
| {
| field: 'unit',
| label: '产品单位',
| render: (val) =>
| h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: val }),
| },
| ];
| }
|
|