Commit ac326715f44cdce98b2aa125fcec2a6b6824e8bd
1 parent
e1f00000
feat: update 当前生产分支
Showing
7 changed files
with
92 additions
and
72 deletions
.umirc.ts
... | ... | @@ -45,13 +45,13 @@ export default defineConfig({ |
45 | 45 | icon: 'LineChartOutlined', |
46 | 46 | access: 'canReadAdmin', |
47 | 47 | }, |
48 | - { | |
49 | - name: '发票管理', | |
50 | - path: '/invoiceManage', | |
51 | - component: './Invoice', | |
52 | - icon: 'BookOutlined', | |
53 | - access: 'canReadAdmin', | |
54 | - }, | |
48 | + // { | |
49 | + // name: '发票管理', | |
50 | + // path: '/invoiceManage', | |
51 | + // component: './Invoice', | |
52 | + // icon: 'BookOutlined', | |
53 | + // access: 'canReadAdmin', | |
54 | + // }, | |
55 | 55 | { |
56 | 56 | name: '打印', |
57 | 57 | path: '/print', | ... | ... |
src/pages/Invoice/constant.tsx
... | ... | @@ -20,66 +20,62 @@ export const INVOICE_COLUMNS = [ |
20 | 20 | dataIndex: 'invoiceNumber', |
21 | 21 | title: '发票号码', |
22 | 22 | valueType: 'text', |
23 | - width: 80, | |
24 | 23 | }, |
25 | 24 | { |
26 | 25 | dataIndex: 'invoiceStatus', |
27 | 26 | title: '发票类型', |
28 | 27 | valueType: 'select', |
29 | - width: 80, | |
30 | 28 | }, |
31 | 29 | { |
32 | 30 | title: '状态', |
33 | 31 | dataIndex: 'status', |
34 | 32 | valueType: 'text', |
35 | - width: 80, | |
36 | 33 | }, |
37 | 34 | { |
38 | 35 | title: '购买方', |
39 | 36 | dataIndex: 'purchaser', |
40 | 37 | valueType: 'text', |
41 | - width: 80, | |
42 | 38 | }, |
43 | 39 | { |
44 | 40 | title: '收款单位', |
45 | 41 | dataIndex: 'payee', |
46 | 42 | valueType: 'text', |
47 | - width: 80, | |
48 | 43 | }, |
49 | 44 | { |
50 | 45 | title: '联系人', |
51 | 46 | dataIndex: 'contacts', |
52 | 47 | valueType: 'text', |
53 | - width: 80, | |
54 | 48 | }, |
55 | 49 | { |
56 | 50 | title: '销售', |
57 | 51 | dataIndex: 'sale', |
58 | 52 | valueType: 'text', |
59 | - width: 80, | |
60 | 53 | }, |
61 | 54 | { |
62 | 55 | title: '金额', |
63 | 56 | dataIndex: 'money', |
64 | 57 | valueType: 'money', |
65 | - width: 80, | |
66 | 58 | }, |
67 | 59 | { |
68 | 60 | title: '开票日期', |
69 | 61 | dataIndex: 'invoicingTime', |
70 | 62 | valueType: 'date', |
71 | - width: 80, | |
72 | 63 | }, |
73 | 64 | { |
74 | 65 | title: '收款时间', |
75 | 66 | dataIndex: 'collectionTime', |
76 | 67 | valueType: 'dateTime', |
77 | - width: 80, | |
68 | + }, | |
69 | + { | |
70 | + title: '备注', | |
71 | + dataIndex: 'notes', | |
72 | + valueType: 'text', | |
78 | 73 | }, |
79 | 74 | { |
80 | 75 | title: '操作', |
81 | 76 | valueType: 'option', |
82 | 77 | key: 'option', |
78 | + fixed: 'right', | |
83 | 79 | render: (text, record, _, action) => [ |
84 | 80 | <a |
85 | 81 | key="editable" |
... | ... | @@ -103,3 +99,8 @@ export const INVOICE_COLUMNS = [ |
103 | 99 | ], |
104 | 100 | }, |
105 | 101 | ]; |
102 | + | |
103 | +export const INVOICE_STATUS = { | |
104 | + UNVERIFIED: '未核销', | |
105 | + VERIFIED: '已核销', | |
106 | +}; | ... | ... |
src/pages/Invoice/index.less
0 → 100644
src/pages/Invoice/index.tsx
1 | -import { INVOICE_COLUMNS, InvoiceItem } from '@/pages/Invoice/constant'; | |
1 | +import { INVOICE_COLUMNS, INVOICE_STATUS } from '@/pages/Invoice/constant'; | |
2 | 2 | import { postServiceInvoiceQueryInvoice } from '@/services'; |
3 | +import { enumValueToLabel } from '@/utils'; | |
3 | 4 | import { getUserInfo } from '@/utils/user'; |
4 | -import { EllipsisOutlined, PlusOutlined } from '@ant-design/icons'; | |
5 | +import { EllipsisOutlined } from '@ant-design/icons'; | |
5 | 6 | import { |
6 | 7 | ActionType, |
7 | 8 | PageContainer, |
... | ... | @@ -10,13 +11,18 @@ import { |
10 | 11 | import { history } from '@umijs/max'; |
11 | 12 | import { Avatar, Button, Dropdown, Tag } from 'antd'; |
12 | 13 | import { useRef } from 'react'; |
14 | +import { INVOCING_STATUS, PAYEE_OPTIONS } from '../Order/constant'; | |
15 | +import './index.less'; | |
13 | 16 | |
14 | 17 | const userInfo = getUserInfo(); |
15 | 18 | const InvoicePage = () => { |
16 | 19 | const actionRef = useRef<ActionType>(); |
20 | + // const [pageSize, setPageSize] = useState(10); | |
21 | + // const [currentPage, setCurrentPage] = useState(1); | |
17 | 22 | return ( |
18 | 23 | <> |
19 | 24 | <PageContainer |
25 | + className="invoice-index" | |
20 | 26 | header={{ |
21 | 27 | title: '发票管理', |
22 | 28 | extra: [ |
... | ... | @@ -51,11 +57,33 @@ const InvoicePage = () => { |
51 | 57 | ], |
52 | 58 | }} |
53 | 59 | > |
54 | - <ProTable<InvoiceItem> | |
55 | - scroll={{ x: true }} | |
56 | - columns={INVOICE_COLUMNS} | |
60 | + <ProTable | |
61 | + columns={INVOICE_COLUMNS.map((item) => { | |
62 | + let newItem = { ...item }; | |
63 | + if (item.dataIndex === 'invoiceStatus') { | |
64 | + newItem.render = (text) => { | |
65 | + return enumValueToLabel(text.props.text, INVOCING_STATUS); | |
66 | + }; | |
67 | + } | |
68 | + | |
69 | + if (item.dataIndex === 'status') { | |
70 | + newItem.render = (text) => { | |
71 | + return enumValueToLabel(text, INVOICE_STATUS); | |
72 | + }; | |
73 | + } | |
74 | + | |
75 | + if (item.dataIndex === 'payee') { | |
76 | + newItem.render = (text) => { | |
77 | + return enumValueToLabel(text, PAYEE_OPTIONS); | |
78 | + }; | |
79 | + } | |
80 | + return newItem; | |
81 | + })} | |
57 | 82 | actionRef={actionRef} |
58 | 83 | cardBordered |
84 | + pagination={{ | |
85 | + pageSize: 10, | |
86 | + }} | |
59 | 87 | request={async (params) => { |
60 | 88 | const res = await postServiceInvoiceQueryInvoice({ |
61 | 89 | data: { ...params }, |
... | ... | @@ -98,24 +126,9 @@ const InvoicePage = () => { |
98 | 126 | return values; |
99 | 127 | }, |
100 | 128 | }} |
101 | - pagination={{ | |
102 | - pageSize: 5, | |
103 | - onChange: (page) => console.log(page), | |
104 | - }} | |
105 | 129 | dateFormatter="string" |
106 | 130 | headerTitle="发票列表" |
107 | - toolBarRender={() => [ | |
108 | - <Button | |
109 | - key="button" | |
110 | - icon={<PlusOutlined />} | |
111 | - onClick={() => { | |
112 | - actionRef.current?.reload(); | |
113 | - }} | |
114 | - type="primary" | |
115 | - > | |
116 | - 新建 | |
117 | - </Button>, | |
118 | - ]} | |
131 | + scroll={{ x: true }} | |
119 | 132 | /> |
120 | 133 | </PageContainer> |
121 | 134 | </> | ... | ... |
src/pages/Order/components/FinancialDrawer.tsx
... | ... | @@ -8,14 +8,13 @@ import { enumToSelect } from '@/utils'; |
8 | 8 | import { |
9 | 9 | DrawerForm, |
10 | 10 | ProFormDatePicker, |
11 | - ProFormDigit, | |
12 | 11 | ProFormSelect, |
13 | 12 | ProFormText, |
14 | 13 | ProFormTextArea, |
15 | 14 | } from '@ant-design/pro-components'; |
16 | 15 | import { Form, message } from 'antd'; |
17 | 16 | import { useEffect, useState } from 'react'; |
18 | -import { INVOCING_STATUS_OPTIONS_OLD, PAYEE_OPTIONS } from '../constant'; | |
17 | +import { INVOCING_STATUS_OPTIONS_OLD } from '../constant'; | |
19 | 18 | |
20 | 19 | export default ({ |
21 | 20 | mainOrder, |
... | ... | @@ -142,31 +141,32 @@ export default ({ |
142 | 141 | label="收款时间" |
143 | 142 | initialValue={subOrders[0]?.collectMoneyTime} |
144 | 143 | />, |
145 | - <ProFormText | |
146 | - width="lg" | |
147 | - key="invoiceNumber" | |
148 | - name="invoiceNumber" | |
149 | - label="发票号码" | |
150 | - initialValue={subOrders[0]?.invoiceNumber} | |
151 | - />, | |
152 | - <ProFormSelect | |
153 | - key="payee" | |
154 | - placeholder="选择收款单位" | |
155 | - name="payee" | |
156 | - width="lg" | |
157 | - label="收款单位" | |
158 | - options={enumToSelect(PAYEE_OPTIONS)} | |
159 | - initialValue={subOrders[0]?.payee} | |
160 | - rules={[{ required: true, message: '收款单位必填' }]} | |
161 | - />, | |
144 | + // <ProFormText | |
145 | + // width="lg" | |
146 | + // key="invoiceNumber" | |
147 | + // name="invoiceNumber" | |
148 | + // label="发票号码" | |
149 | + // initialValue={subOrders[0]?.invoiceNumber} | |
150 | + // rules={[{ required: true, message: '发票号码必填' }]} | |
151 | + // />, | |
152 | + // <ProFormSelect | |
153 | + // key="payee" | |
154 | + // placeholder="选择收款单位" | |
155 | + // name="payee" | |
156 | + // width="lg" | |
157 | + // label="收款单位" | |
158 | + // options={enumToSelect(PAYEE_OPTIONS)} | |
159 | + // initialValue={subOrders[0]?.payee} | |
160 | + // rules={[{ required: true, message: '收款单位必填' }]} | |
161 | + // />, | |
162 | 162 | |
163 | - <ProFormDigit | |
164 | - key="money" | |
165 | - name="money" | |
166 | - width="lg" | |
167 | - label="金额" | |
168 | - rules={[{ required: true, message: '金额必填' }]} | |
169 | - />, | |
163 | + // <ProFormDigit | |
164 | + // key="money" | |
165 | + // name="money" | |
166 | + // width="lg" | |
167 | + // label="金额" | |
168 | + // rules={[{ required: true, message: '金额必填' }]} | |
169 | + // />, | |
170 | 170 | ] |
171 | 171 | : ''} |
172 | 172 | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -1058,8 +1058,8 @@ const OrderPage = () => { |
1058 | 1058 | type="link" |
1059 | 1059 | onClick={() => { |
1060 | 1060 | setSelectedRows([optRecord]); |
1061 | - setOrderDrawerVisible(true); | |
1062 | - // setAfterSalesDrawerVisible(true); | |
1061 | + // setOrderDrawerVisible(true); | |
1062 | + setAfterSalesDrawerVisible(true); | |
1063 | 1063 | setOrderRow(record); |
1064 | 1064 | setOrderOptType('after-sales'); |
1065 | 1065 | }} |
... | ... | @@ -1931,8 +1931,8 @@ const OrderPage = () => { |
1931 | 1931 | return; |
1932 | 1932 | } |
1933 | 1933 | } |
1934 | - setOrderDrawerVisible(true); | |
1935 | - // setAfterSalesDrawerVisible(true); | |
1934 | + // setOrderDrawerVisible(true); | |
1935 | + setAfterSalesDrawerVisible(true); | |
1936 | 1936 | setOrderRow(record); |
1937 | 1937 | setOrderOptType('after-sales'); |
1938 | 1938 | }} | ... | ... |
src/pages/OrderPrint/components/HoujiePrinter.tsx
... | ... | @@ -66,15 +66,15 @@ export default ({ mainOrder, subOrders }) => { |
66 | 66 | style={{ msoWidthSource: 'userset', msoWidthAlt: 1120 }} |
67 | 67 | /> |
68 | 68 | <col |
69 | - width="151.50" | |
69 | + width="91.50" | |
70 | 70 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2464 }} |
71 | 71 | /> |
72 | 72 | <col |
73 | - width="169.50" | |
73 | + width="139.50" | |
74 | 74 | style={{ msoWidthSource: 'userset', msoWidthAlt: 3616 }} |
75 | 75 | /> |
76 | 76 | <col |
77 | - width="165" | |
77 | + width="135" | |
78 | 78 | style={{ msoWidthSource: 'userset', msoWidthAlt: 3520 }} |
79 | 79 | /> |
80 | 80 | <col |
... | ... | @@ -85,7 +85,7 @@ export default ({ mainOrder, subOrders }) => { |
85 | 85 | width="60" |
86 | 86 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2432 }} |
87 | 87 | /> |
88 | - <col width="108" style={{ width: '95.00pt' }} /> | |
88 | + <col width="250" /> | |
89 | 89 | <tr height="42" style={{ height: '21.00pt' }}> |
90 | 90 | <td height="42" style={{ height: '21.00pt' }}></td> |
91 | 91 | <td | ... | ... |