Blame view

src/pages/Invoice/constant.tsx 4.03 KB
zhongnanhuang authored
1
2
3
import { enumToProTableEnumValue } from '@/utils';
import { PAYEE_OPTIONS } from '../Order/constant';
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export type InvoiceItem = {
  id: number; //id
  invoiceStatus: string; //发票类型:专票/普票
  invoiceNumber: string; //发票号码
  status: string; //状态
  purchaser: string; //购买方
  payee: string; //收款单位
  contacts: string; //联系人
  sale: string; //销售
  money: number; //金额
  invoicingTime: string; //开票日期
  collectionTime: string; //收款时间
  notes: string; //备注
};
zhongnanhuang authored
19
20
21
22
export const INVOICE_STATUS = {
  UNVERIFIED: '未核销',
  VERIFIED: '已核销',
  ABNORMAL: '异常',
zhongnanhuang authored
23
  PARTIAL_VERIFICATION: '部分核销',
zhongnanhuang authored
24
25
};
26
27
export const INVOICE_COLUMNS = [
  {
zhongnanhuang authored
28
29
30
31
32
33
34
35
    dataIndex: 'invoiceId',
    title: 'id',
    valueType: 'text',
    hideInTable: true,
    hideInSearch: true,
    width: 100,
  },
  {
36
37
38
    dataIndex: 'invoiceNumber',
    title: '发票号码',
    valueType: 'text',
zhongnanhuang authored
39
    width: 100,
40
41
42
43
44
  },
  {
    dataIndex: 'invoiceStatus',
    title: '发票类型',
    valueType: 'select',
zhongnanhuang authored
45
    width: 100,
zhongnanhuang authored
46
47
48
49
    valueEnum: enumToProTableEnumValue({
      SPECIALLY_INVOICED: '专票',
      COMMON_INVOICED: '普票',
    }),
50
51
52
53
54
  },
  {
    title: '状态',
    dataIndex: 'status',
    valueType: 'text',
zhongnanhuang authored
55
    width: 100,
zhongnanhuang authored
56
57
58
    valueEnum: enumToProTableEnumValue({
      UNVERIFIED: '未核销',
      VERIFIED: '已核销',
zhongnanhuang authored
59
      PARTIAL_VERIFICATION: '部分核销',
zhongnanhuang authored
60
    }),
61
62
63
64
65
  },
  {
    title: '购买方',
    dataIndex: 'purchaser',
    valueType: 'text',
zhongnanhuang authored
66
    width: 180,
67
68
69
70
71
  },
  {
    title: '收款单位',
    dataIndex: 'payee',
    valueType: 'text',
zhongnanhuang authored
72
    width: 180,
zhongnanhuang authored
73
    valueEnum: enumToProTableEnumValue(PAYEE_OPTIONS),
74
75
76
77
78
  },
  {
    title: '联系人',
    dataIndex: 'contacts',
    valueType: 'text',
zhongnanhuang authored
79
    width: 100,
80
81
82
83
84
  },
  {
    title: '销售',
    dataIndex: 'sale',
    valueType: 'text',
zhongnanhuang authored
85
    width: 100,
86
87
88
89
90
  },
  {
    title: '金额',
    dataIndex: 'money',
    valueType: 'money',
zhongnanhuang authored
91
    width: 100,
92
93
94
95
  },
  {
    title: '开票日期',
    dataIndex: 'invoicingTime',
zhongnanhuang authored
96
    valueType: 'dateRange',
zhongnanhuang authored
97
    width: 150,
zhongnanhuang authored
98
99
100
101
102
103
104
105
106
107
    search: {
      transform: (value) => {
        if (value) {
          return {
            invoicingBeginTime: value[0],
            invoicingEndTime: value[1],
          };
        }
      },
    },
108
109
110
111
  },
  {
    title: '收款时间',
    dataIndex: 'collectionTime',
zhongnanhuang authored
112
    valueType: 'dateRange',
zhongnanhuang authored
113
    width: 200,
zhongnanhuang authored
114
115
116
117
118
119
120
121
122
123
    search: {
      transform: (value) => {
        if (value) {
          return {
            collectionBeginTime: value[0],
            collectionEndTime: value[1],
          };
        }
      },
    },
124
125
126
127
128
  },
  {
    title: '备注',
    dataIndex: 'notes',
    valueType: 'text',
zhongnanhuang authored
129
    width: 250,
130
131
  },
];
132
zhongnanhuang authored
133
134
135
export const BANK_STATEMENT_COLUMNS = [
  {
    dataIndex: 'id',
zhongnanhuang authored
136
    title: '编号',
zhongnanhuang authored
137
    valueType: 'text',
zhongnanhuang authored
138
139
140
141
    width: 160,
    copyable: true,
    // hideInTable: true,
    // hideInSearch: true,
zhongnanhuang authored
142
    editable: false,
zhongnanhuang authored
143
144
  },
  {
曾国涛 authored
145
    dataIndex: 'statusText',
zhongnanhuang authored
146
    title: '状态',
zhongnanhuang authored
147
    valueType: 'select',
zhongnanhuang authored
148
    width: 100,
zhongnanhuang authored
149
    editable: false,
zhongnanhuang authored
150
151
152
153
154
155
156
157
  },
  {
    dataIndex: 'serialNumber',
    title: '流水号',
    valueType: 'text',
    width: 100,
  },
  {
曾国涛 authored
158
159
160
    dataIndex: 'collectionDate',
    title: '收款时间',
    valueType: 'date',
zhongnanhuang authored
161
    width: 100,
zhongnanhuang authored
162
    hideInSearch: true,
zhongnanhuang authored
163
164
  },
  {
曾国涛 authored
165
166
    dataIndex: 'collectionDateSearch',
    title: '收款时间',
zhongnanhuang authored
167
    valueType: 'dateRange',
zhongnanhuang authored
168
    width: 100,
曾国涛 authored
169
    hideInTable: true,
zhongnanhuang authored
170
171
172
173
    search: {
      transform: (value) => {
        if (value) {
          return {
曾国涛 authored
174
175
            collectionDateBegin: value[0],
            collectionDateEnd: value[1],
zhongnanhuang authored
176
177
178
179
          };
        }
      },
    },
zhongnanhuang authored
180
181
  },
  {
曾国涛 authored
182
183
    dataIndex: 'payeeText',
    title: '收款方',
zhongnanhuang authored
184
185
186
187
    valueType: 'text',
    width: 100,
  },
  {
曾国涛 authored
188
189
    dataIndex: 'payer',
    title: '付款方',
zhongnanhuang authored
190
191
192
193
    valueType: 'text',
    width: 100,
  },
  {
曾国涛 authored
194
195
    dataIndex: 'amount',
    title: '金额',
zhongnanhuang authored
196
197
198
199
    valueType: 'text',
    width: 100,
  },
  {
曾国涛 authored
200
201
    dataIndex: 'remark',
    title: '备注',
zhongnanhuang authored
202
203
204
205
206
207
208
209
210
211
    valueType: 'text',
    width: 100,
  },
  {
    dataIndex: 'remarkNote',
    title: '附言',
    valueType: 'text',
    width: 100,
  },
];