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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
| import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
| /** 产品详情列表的列定义 */
| export function useDetailListColumns(
| showBusinessPrice: boolean,
| ): VxeTableGridOptions['columns'] {
| return [
| {
| field: 'itemName',
| title: '产品名称',
| },
| {
| field: 'itemCode',
| title: '物料编码',
| },
| {
| field: 'itemBarCode',
| title: '物料条码',
| },
| {
| field: 'itemUnitName',
| title: '单位',
| },
| {
| field: 'itemPrice',
| title: '原价(元)',
| formatter: 'formatAmount2',
| },
| {
| field: 'businessPrice',
| title: '商机价格(元)',
| formatter: 'formatAmount2',
| visible: showBusinessPrice,
| },
| {
| field: 'contractPrice',
| title: '合同价格(元)',
| formatter: 'formatAmount2',
| visible: !showBusinessPrice,
| },
| {
| field: 'count',
| title: '数量',
| formatter: 'formatAmount3',
| },
| {
| field: 'totalPrice',
| title: '合计金额(元)',
| formatter: 'formatAmount2',
| },
| ];
| }
|
| /** 产品编辑表格的列定义 */
| export function useProductEditTableColumns(): VxeTableGridOptions['columns'] {
| return [
| { type: 'seq', title: '序号', minWidth: 50 },
| {
| field: 'itemId',
| title: '产品名称',
| minWidth: 100,
| slots: { default: 'itemId' },
| },
| {
| field: 'itemSpecification',
| title: '规格型号',
| minWidth: 120,
| },
| {
| field: 'itemUnitName',
| title: '单位',
| minWidth: 80,
| },
| {
| field: 'itemUnitName2',
| title: '辅单位1',
| minWidth: 80,
| },
| {
| field: 'itemUnitName3',
| title: '辅单位2',
| minWidth: 80,
| },
| {
| field: 'itemPrice',
| title: '原价(元)',
| minWidth: 100,
| formatter: 'formatAmount2',
| },
| {
| field: 'contractPrice',
| title: '合同价(元)',
| minWidth: 100,
| slots: { default: 'contractPrice' },
| },
| {
| field: 'count',
| title: '数量',
| minWidth: 100,
| slots: { default: 'count' },
| },
| {
| field: 'totalPrice',
| title: '合计',
| minWidth: 100,
| formatter: 'formatAmount2',
| },
| {
| title: '操作',
| width: 80,
| fixed: 'right',
| slots: { default: 'actions' },
| },
| ];
| }
|
|