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,13 +45,13 @@ export default defineConfig({ | ||
45 | icon: 'LineChartOutlined', | 45 | icon: 'LineChartOutlined', |
46 | access: 'canReadAdmin', | 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 | name: '打印', | 56 | name: '打印', |
57 | path: '/print', | 57 | path: '/print', |
src/pages/Invoice/constant.tsx
@@ -20,66 +20,62 @@ export const INVOICE_COLUMNS = [ | @@ -20,66 +20,62 @@ export const INVOICE_COLUMNS = [ | ||
20 | dataIndex: 'invoiceNumber', | 20 | dataIndex: 'invoiceNumber', |
21 | title: '发票号码', | 21 | title: '发票号码', |
22 | valueType: 'text', | 22 | valueType: 'text', |
23 | - width: 80, | ||
24 | }, | 23 | }, |
25 | { | 24 | { |
26 | dataIndex: 'invoiceStatus', | 25 | dataIndex: 'invoiceStatus', |
27 | title: '发票类型', | 26 | title: '发票类型', |
28 | valueType: 'select', | 27 | valueType: 'select', |
29 | - width: 80, | ||
30 | }, | 28 | }, |
31 | { | 29 | { |
32 | title: '状态', | 30 | title: '状态', |
33 | dataIndex: 'status', | 31 | dataIndex: 'status', |
34 | valueType: 'text', | 32 | valueType: 'text', |
35 | - width: 80, | ||
36 | }, | 33 | }, |
37 | { | 34 | { |
38 | title: '购买方', | 35 | title: '购买方', |
39 | dataIndex: 'purchaser', | 36 | dataIndex: 'purchaser', |
40 | valueType: 'text', | 37 | valueType: 'text', |
41 | - width: 80, | ||
42 | }, | 38 | }, |
43 | { | 39 | { |
44 | title: '收款单位', | 40 | title: '收款单位', |
45 | dataIndex: 'payee', | 41 | dataIndex: 'payee', |
46 | valueType: 'text', | 42 | valueType: 'text', |
47 | - width: 80, | ||
48 | }, | 43 | }, |
49 | { | 44 | { |
50 | title: '联系人', | 45 | title: '联系人', |
51 | dataIndex: 'contacts', | 46 | dataIndex: 'contacts', |
52 | valueType: 'text', | 47 | valueType: 'text', |
53 | - width: 80, | ||
54 | }, | 48 | }, |
55 | { | 49 | { |
56 | title: '销售', | 50 | title: '销售', |
57 | dataIndex: 'sale', | 51 | dataIndex: 'sale', |
58 | valueType: 'text', | 52 | valueType: 'text', |
59 | - width: 80, | ||
60 | }, | 53 | }, |
61 | { | 54 | { |
62 | title: '金额', | 55 | title: '金额', |
63 | dataIndex: 'money', | 56 | dataIndex: 'money', |
64 | valueType: 'money', | 57 | valueType: 'money', |
65 | - width: 80, | ||
66 | }, | 58 | }, |
67 | { | 59 | { |
68 | title: '开票日期', | 60 | title: '开票日期', |
69 | dataIndex: 'invoicingTime', | 61 | dataIndex: 'invoicingTime', |
70 | valueType: 'date', | 62 | valueType: 'date', |
71 | - width: 80, | ||
72 | }, | 63 | }, |
73 | { | 64 | { |
74 | title: '收款时间', | 65 | title: '收款时间', |
75 | dataIndex: 'collectionTime', | 66 | dataIndex: 'collectionTime', |
76 | valueType: 'dateTime', | 67 | valueType: 'dateTime', |
77 | - width: 80, | 68 | + }, |
69 | + { | ||
70 | + title: '备注', | ||
71 | + dataIndex: 'notes', | ||
72 | + valueType: 'text', | ||
78 | }, | 73 | }, |
79 | { | 74 | { |
80 | title: '操作', | 75 | title: '操作', |
81 | valueType: 'option', | 76 | valueType: 'option', |
82 | key: 'option', | 77 | key: 'option', |
78 | + fixed: 'right', | ||
83 | render: (text, record, _, action) => [ | 79 | render: (text, record, _, action) => [ |
84 | <a | 80 | <a |
85 | key="editable" | 81 | key="editable" |
@@ -103,3 +99,8 @@ export const INVOICE_COLUMNS = [ | @@ -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 | import { postServiceInvoiceQueryInvoice } from '@/services'; | 2 | import { postServiceInvoiceQueryInvoice } from '@/services'; |
3 | +import { enumValueToLabel } from '@/utils'; | ||
3 | import { getUserInfo } from '@/utils/user'; | 4 | import { getUserInfo } from '@/utils/user'; |
4 | -import { EllipsisOutlined, PlusOutlined } from '@ant-design/icons'; | 5 | +import { EllipsisOutlined } from '@ant-design/icons'; |
5 | import { | 6 | import { |
6 | ActionType, | 7 | ActionType, |
7 | PageContainer, | 8 | PageContainer, |
@@ -10,13 +11,18 @@ import { | @@ -10,13 +11,18 @@ import { | ||
10 | import { history } from '@umijs/max'; | 11 | import { history } from '@umijs/max'; |
11 | import { Avatar, Button, Dropdown, Tag } from 'antd'; | 12 | import { Avatar, Button, Dropdown, Tag } from 'antd'; |
12 | import { useRef } from 'react'; | 13 | import { useRef } from 'react'; |
14 | +import { INVOCING_STATUS, PAYEE_OPTIONS } from '../Order/constant'; | ||
15 | +import './index.less'; | ||
13 | 16 | ||
14 | const userInfo = getUserInfo(); | 17 | const userInfo = getUserInfo(); |
15 | const InvoicePage = () => { | 18 | const InvoicePage = () => { |
16 | const actionRef = useRef<ActionType>(); | 19 | const actionRef = useRef<ActionType>(); |
20 | + // const [pageSize, setPageSize] = useState(10); | ||
21 | + // const [currentPage, setCurrentPage] = useState(1); | ||
17 | return ( | 22 | return ( |
18 | <> | 23 | <> |
19 | <PageContainer | 24 | <PageContainer |
25 | + className="invoice-index" | ||
20 | header={{ | 26 | header={{ |
21 | title: '发票管理', | 27 | title: '发票管理', |
22 | extra: [ | 28 | extra: [ |
@@ -51,11 +57,33 @@ const InvoicePage = () => { | @@ -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 | actionRef={actionRef} | 82 | actionRef={actionRef} |
58 | cardBordered | 83 | cardBordered |
84 | + pagination={{ | ||
85 | + pageSize: 10, | ||
86 | + }} | ||
59 | request={async (params) => { | 87 | request={async (params) => { |
60 | const res = await postServiceInvoiceQueryInvoice({ | 88 | const res = await postServiceInvoiceQueryInvoice({ |
61 | data: { ...params }, | 89 | data: { ...params }, |
@@ -98,24 +126,9 @@ const InvoicePage = () => { | @@ -98,24 +126,9 @@ const InvoicePage = () => { | ||
98 | return values; | 126 | return values; |
99 | }, | 127 | }, |
100 | }} | 128 | }} |
101 | - pagination={{ | ||
102 | - pageSize: 5, | ||
103 | - onChange: (page) => console.log(page), | ||
104 | - }} | ||
105 | dateFormatter="string" | 129 | dateFormatter="string" |
106 | headerTitle="发票列表" | 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 | </PageContainer> | 133 | </PageContainer> |
121 | </> | 134 | </> |
src/pages/Order/components/FinancialDrawer.tsx
@@ -8,14 +8,13 @@ import { enumToSelect } from '@/utils'; | @@ -8,14 +8,13 @@ import { enumToSelect } from '@/utils'; | ||
8 | import { | 8 | import { |
9 | DrawerForm, | 9 | DrawerForm, |
10 | ProFormDatePicker, | 10 | ProFormDatePicker, |
11 | - ProFormDigit, | ||
12 | ProFormSelect, | 11 | ProFormSelect, |
13 | ProFormText, | 12 | ProFormText, |
14 | ProFormTextArea, | 13 | ProFormTextArea, |
15 | } from '@ant-design/pro-components'; | 14 | } from '@ant-design/pro-components'; |
16 | import { Form, message } from 'antd'; | 15 | import { Form, message } from 'antd'; |
17 | import { useEffect, useState } from 'react'; | 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 | export default ({ | 19 | export default ({ |
21 | mainOrder, | 20 | mainOrder, |
@@ -142,31 +141,32 @@ export default ({ | @@ -142,31 +141,32 @@ export default ({ | ||
142 | label="收款时间" | 141 | label="收款时间" |
143 | initialValue={subOrders[0]?.collectMoneyTime} | 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,8 +1058,8 @@ const OrderPage = () => { | ||
1058 | type="link" | 1058 | type="link" |
1059 | onClick={() => { | 1059 | onClick={() => { |
1060 | setSelectedRows([optRecord]); | 1060 | setSelectedRows([optRecord]); |
1061 | - setOrderDrawerVisible(true); | ||
1062 | - // setAfterSalesDrawerVisible(true); | 1061 | + // setOrderDrawerVisible(true); |
1062 | + setAfterSalesDrawerVisible(true); | ||
1063 | setOrderRow(record); | 1063 | setOrderRow(record); |
1064 | setOrderOptType('after-sales'); | 1064 | setOrderOptType('after-sales'); |
1065 | }} | 1065 | }} |
@@ -1931,8 +1931,8 @@ const OrderPage = () => { | @@ -1931,8 +1931,8 @@ const OrderPage = () => { | ||
1931 | return; | 1931 | return; |
1932 | } | 1932 | } |
1933 | } | 1933 | } |
1934 | - setOrderDrawerVisible(true); | ||
1935 | - // setAfterSalesDrawerVisible(true); | 1934 | + // setOrderDrawerVisible(true); |
1935 | + setAfterSalesDrawerVisible(true); | ||
1936 | setOrderRow(record); | 1936 | setOrderRow(record); |
1937 | setOrderOptType('after-sales'); | 1937 | setOrderOptType('after-sales'); |
1938 | }} | 1938 | }} |
src/pages/OrderPrint/components/HoujiePrinter.tsx
@@ -66,15 +66,15 @@ export default ({ mainOrder, subOrders }) => { | @@ -66,15 +66,15 @@ export default ({ mainOrder, subOrders }) => { | ||
66 | style={{ msoWidthSource: 'userset', msoWidthAlt: 1120 }} | 66 | style={{ msoWidthSource: 'userset', msoWidthAlt: 1120 }} |
67 | /> | 67 | /> |
68 | <col | 68 | <col |
69 | - width="151.50" | 69 | + width="91.50" |
70 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2464 }} | 70 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2464 }} |
71 | /> | 71 | /> |
72 | <col | 72 | <col |
73 | - width="169.50" | 73 | + width="139.50" |
74 | style={{ msoWidthSource: 'userset', msoWidthAlt: 3616 }} | 74 | style={{ msoWidthSource: 'userset', msoWidthAlt: 3616 }} |
75 | /> | 75 | /> |
76 | <col | 76 | <col |
77 | - width="165" | 77 | + width="135" |
78 | style={{ msoWidthSource: 'userset', msoWidthAlt: 3520 }} | 78 | style={{ msoWidthSource: 'userset', msoWidthAlt: 3520 }} |
79 | /> | 79 | /> |
80 | <col | 80 | <col |
@@ -85,7 +85,7 @@ export default ({ mainOrder, subOrders }) => { | @@ -85,7 +85,7 @@ export default ({ mainOrder, subOrders }) => { | ||
85 | width="60" | 85 | width="60" |
86 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2432 }} | 86 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2432 }} |
87 | /> | 87 | /> |
88 | - <col width="108" style={{ width: '95.00pt' }} /> | 88 | + <col width="250" /> |
89 | <tr height="42" style={{ height: '21.00pt' }}> | 89 | <tr height="42" style={{ height: '21.00pt' }}> |
90 | <td height="42" style={{ height: '21.00pt' }}></td> | 90 | <td height="42" style={{ height: '21.00pt' }}></td> |
91 | <td | 91 | <td |