Blame view

src/pages/Invoice/constant.tsx 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { TableDropdown } from '@ant-design/pro-components';

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; //备注
};

export const INVOICE_COLUMNS = [
  {
    dataIndex: 'invoiceNumber',
    title: '发票号码',
    valueType: 'text',
zhongnanhuang authored
23
    width: 100,
24
25
26
27
28
  },
  {
    dataIndex: 'invoiceStatus',
    title: '发票类型',
    valueType: 'select',
zhongnanhuang authored
29
    width: 100,
30
31
32
33
34
  },
  {
    title: '状态',
    dataIndex: 'status',
    valueType: 'text',
zhongnanhuang authored
35
    width: 100,
36
37
38
39
40
  },
  {
    title: '购买方',
    dataIndex: 'purchaser',
    valueType: 'text',
zhongnanhuang authored
41
    width: 180,
42
43
44
45
46
  },
  {
    title: '收款单位',
    dataIndex: 'payee',
    valueType: 'text',
zhongnanhuang authored
47
    width: 180,
48
49
50
51
52
  },
  {
    title: '联系人',
    dataIndex: 'contacts',
    valueType: 'text',
zhongnanhuang authored
53
    width: 100,
54
55
56
57
58
  },
  {
    title: '销售',
    dataIndex: 'sale',
    valueType: 'text',
zhongnanhuang authored
59
    width: 100,
60
61
62
63
64
  },
  {
    title: '金额',
    dataIndex: 'money',
    valueType: 'money',
zhongnanhuang authored
65
    width: 100,
66
67
68
69
70
  },
  {
    title: '开票日期',
    dataIndex: 'invoicingTime',
    valueType: 'date',
zhongnanhuang authored
71
    width: 150,
72
73
74
75
76
  },
  {
    title: '收款时间',
    dataIndex: 'collectionTime',
    valueType: 'dateTime',
zhongnanhuang authored
77
    width: 200,
78
79
80
81
82
  },
  {
    title: '备注',
    dataIndex: 'notes',
    valueType: 'text',
zhongnanhuang authored
83
    width: 250,
84
85
86
87
88
  },
  {
    title: '操作',
    valueType: 'option',
    key: 'option',
89
    fixed: 'right',
zhongnanhuang authored
90
    width: 120,
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
    render: (text, record, _, action) => [
      <a
        key="editable"
        onClick={() => {
          action?.startEditable?.(record.id);
        }}
      >
        编辑
      </a>,
      <a href={record.url} target="_blank" rel="noopener noreferrer" key="view">
        查看
      </a>,
      <TableDropdown
        key="actionGroup"
        onSelect={() => action?.reload()}
        menus={[
          { key: 'copy', name: '复制' },
          { key: 'delete', name: '删除' },
        ]}
      />,
    ],
  },
];
114
115
116
117
118

export const INVOICE_STATUS = {
  UNVERIFIED: '未核销',
  VERIFIED: '已核销',
};