Commit 6b0d7fb3278c3145b0a69c5ca1d4a37a3f701902
1 parent
0352ab1b
feat: update 发票核销
Showing
5 changed files
with
88 additions
and
42 deletions
src/pages/Invoice/components/BankChooseModal.tsx
... | ... | @@ -7,7 +7,6 @@ import { |
7 | 7 | } from '@/services'; |
8 | 8 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
9 | 9 | import { formatDate } from '@/utils/time'; |
10 | -import { PlusOutlined } from '@ant-design/icons'; | |
11 | 10 | import { |
12 | 11 | ActionType, |
13 | 12 | ProCard, |
... | ... | @@ -92,7 +91,9 @@ export default ({ invoiceId, setVisible, onClose }) => { |
92 | 91 | /> |
93 | 92 | ); |
94 | 93 | |
95 | - case 'status': | |
94 | + case 'status': { | |
95 | + //这里状态不显示在筛选条件中,只能筛异常的流水 | |
96 | + newItem.hideInSearch = true; | |
96 | 97 | return ( |
97 | 98 | <EllipsisDiv |
98 | 99 | text={enumValueToLabel( |
... | ... | @@ -101,7 +102,7 @@ export default ({ invoiceId, setVisible, onClose }) => { |
101 | 102 | )} |
102 | 103 | /> |
103 | 104 | ); |
104 | - | |
105 | + } | |
105 | 106 | case 'payee': |
106 | 107 | return ( |
107 | 108 | <EllipsisDiv |
... | ... | @@ -176,9 +177,6 @@ export default ({ invoiceId, setVisible, onClose }) => { |
176 | 177 | }, |
177 | 178 | }} |
178 | 179 | dataSource={bankData} |
179 | - onDataSourceChange={() => { | |
180 | - console.log('change'); | |
181 | - }} | |
182 | 180 | columnsState={{ |
183 | 181 | persistenceKey: 'pro-table-singe-demos', |
184 | 182 | persistenceType: 'localStorage', |
... | ... | @@ -189,7 +187,6 @@ export default ({ invoiceId, setVisible, onClose }) => { |
189 | 187 | console.log('value: ', value); |
190 | 188 | }, |
191 | 189 | }} |
192 | - rowKey="id" | |
193 | 190 | search={{ |
194 | 191 | labelWidth: 'auto', |
195 | 192 | span: 8, |
... | ... | @@ -198,25 +195,22 @@ export default ({ invoiceId, setVisible, onClose }) => { |
198 | 195 | setting: { |
199 | 196 | listsHeight: 400, |
200 | 197 | }, |
198 | + reload: () => { | |
199 | + loadBankData({ current: 1 }); | |
200 | + }, | |
201 | 201 | }} |
202 | 202 | form={{}} |
203 | 203 | onSubmit={() => { |
204 | 204 | loadBankData({ current: 1 }); |
205 | 205 | }} |
206 | - onReset={() => {}} | |
206 | + onReset={() => { | |
207 | + formRef.current?.resetFields(); | |
208 | + loadBankData({ current: 1 }); | |
209 | + }} | |
207 | 210 | dateFormatter="string" |
208 | 211 | headerTitle="银行流水" |
209 | 212 | scroll={{ x: 1400, y: 360 }} |
210 | - toolBarRender={() => [ | |
211 | - <Button | |
212 | - key="button" | |
213 | - icon={<PlusOutlined />} | |
214 | - onClick={() => {}} | |
215 | - type="primary" | |
216 | - > | |
217 | - 添加 | |
218 | - </Button>, | |
219 | - ]} | |
213 | + toolBarRender={() => []} | |
220 | 214 | /> |
221 | 215 | ); |
222 | 216 | }; |
... | ... | @@ -265,6 +259,7 @@ export default ({ invoiceId, setVisible, onClose }) => { |
265 | 259 | }; |
266 | 260 | |
267 | 261 | useEffect(() => { |
262 | + message.info('1'); | |
268 | 263 | loadBankData({ current: page, pageSize: pageSize }); |
269 | 264 | }, []); |
270 | 265 | |
... | ... | @@ -273,7 +268,7 @@ export default ({ invoiceId, setVisible, onClose }) => { |
273 | 268 | <Modal |
274 | 269 | open |
275 | 270 | width="80%" |
276 | - title="发票详情" | |
271 | + title="添加银行流水" | |
277 | 272 | className="bank-statement-choose" |
278 | 273 | onOk={async () => { |
279 | 274 | setBtnLoading(true); | ... | ... |
src/pages/Invoice/components/InvoiceVerificationModal.tsx
... | ... | @@ -37,7 +37,7 @@ export default ({ invoiceId, setVisible, onClose }) => { |
37 | 37 | }); |
38 | 38 | if (res && res.data) { |
39 | 39 | setInvoiceInfo(res.data.queryInvoiceResponseDto); |
40 | - setRelationOrderIds(res.data.mainOrderId); | |
40 | + setRelationOrderIds(res.data.mainOrderIds); | |
41 | 41 | setRelationBankStatements(res.data.bankStatementResponseDtos); |
42 | 42 | } |
43 | 43 | }; | ... | ... |
src/pages/Invoice/constant.tsx
1 | +import { enumToProTableEnumValue } from '@/utils'; | |
2 | +import { PAYEE_OPTIONS } from '../Order/constant'; | |
3 | + | |
1 | 4 | export type InvoiceItem = { |
2 | 5 | id: number; //id |
3 | 6 | invoiceStatus: string; //发票类型:专票/普票 |
... | ... | @@ -13,6 +16,12 @@ export type InvoiceItem = { |
13 | 16 | notes: string; //备注 |
14 | 17 | }; |
15 | 18 | |
19 | +export const INVOICE_STATUS = { | |
20 | + UNVERIFIED: '未核销', | |
21 | + VERIFIED: '已核销', | |
22 | + ABNORMAL: '异常', | |
23 | +}; | |
24 | + | |
16 | 25 | export const INVOICE_COLUMNS = [ |
17 | 26 | { |
18 | 27 | dataIndex: 'invoiceId', |
... | ... | @@ -33,12 +42,20 @@ export const INVOICE_COLUMNS = [ |
33 | 42 | title: '发票类型', |
34 | 43 | valueType: 'select', |
35 | 44 | width: 100, |
45 | + valueEnum: enumToProTableEnumValue({ | |
46 | + SPECIALLY_INVOICED: '专票', | |
47 | + COMMON_INVOICED: '普票', | |
48 | + }), | |
36 | 49 | }, |
37 | 50 | { |
38 | 51 | title: '状态', |
39 | 52 | dataIndex: 'status', |
40 | 53 | valueType: 'text', |
41 | 54 | width: 100, |
55 | + valueEnum: enumToProTableEnumValue({ | |
56 | + UNVERIFIED: '未核销', | |
57 | + VERIFIED: '已核销', | |
58 | + }), | |
42 | 59 | }, |
43 | 60 | { |
44 | 61 | title: '购买方', |
... | ... | @@ -51,6 +68,7 @@ export const INVOICE_COLUMNS = [ |
51 | 68 | dataIndex: 'payee', |
52 | 69 | valueType: 'text', |
53 | 70 | width: 180, |
71 | + valueEnum: enumToProTableEnumValue(PAYEE_OPTIONS), | |
54 | 72 | }, |
55 | 73 | { |
56 | 74 | title: '联系人', |
... | ... | @@ -73,14 +91,34 @@ export const INVOICE_COLUMNS = [ |
73 | 91 | { |
74 | 92 | title: '开票日期', |
75 | 93 | dataIndex: 'invoicingTime', |
76 | - valueType: 'date', | |
94 | + valueType: 'dateRange', | |
77 | 95 | width: 150, |
96 | + search: { | |
97 | + transform: (value) => { | |
98 | + if (value) { | |
99 | + return { | |
100 | + invoicingBeginTime: value[0], | |
101 | + invoicingEndTime: value[1], | |
102 | + }; | |
103 | + } | |
104 | + }, | |
105 | + }, | |
78 | 106 | }, |
79 | 107 | { |
80 | 108 | title: '收款时间', |
81 | 109 | dataIndex: 'collectionTime', |
82 | - valueType: 'dateTime', | |
110 | + valueType: 'dateRange', | |
83 | 111 | width: 200, |
112 | + search: { | |
113 | + transform: (value) => { | |
114 | + if (value) { | |
115 | + return { | |
116 | + collectionBeginTime: value[0], | |
117 | + collectionEndTime: value[1], | |
118 | + }; | |
119 | + } | |
120 | + }, | |
121 | + }, | |
84 | 122 | }, |
85 | 123 | { |
86 | 124 | title: '备注', |
... | ... | @@ -90,12 +128,6 @@ export const INVOICE_COLUMNS = [ |
90 | 128 | }, |
91 | 129 | ]; |
92 | 130 | |
93 | -export const INVOICE_STATUS = { | |
94 | - UNVERIFIED: '未核销', | |
95 | - VERIFIED: '已核销', | |
96 | - ABNORMAL: '异常', | |
97 | -}; | |
98 | - | |
99 | 131 | export const BANK_STATEMENT_COLUMNS = [ |
100 | 132 | { |
101 | 133 | dataIndex: 'id', |
... | ... | @@ -109,9 +141,13 @@ export const BANK_STATEMENT_COLUMNS = [ |
109 | 141 | { |
110 | 142 | dataIndex: 'status', |
111 | 143 | title: '状态', |
112 | - valueType: 'text', | |
144 | + valueType: 'select', | |
113 | 145 | width: 100, |
114 | 146 | editable: false, |
147 | + valueEnum: enumToProTableEnumValue({ | |
148 | + ABNORMAL: '异常', | |
149 | + VERIFIED: '已核销', | |
150 | + }), | |
115 | 151 | }, |
116 | 152 | { |
117 | 153 | dataIndex: 'serialNumber', | ... | ... |
src/pages/Invoice/index.tsx
... | ... | @@ -70,7 +70,7 @@ const InvoicePage = () => { |
70 | 70 | newItem.render = (text, record) => { |
71 | 71 | let textValue = record[dataIndex]; |
72 | 72 | |
73 | - if (dataType === 'date') { | |
73 | + if (dataType === 'dateRange' || dataType === 'date') { | |
74 | 74 | textValue = formatDate(textValue); |
75 | 75 | } |
76 | 76 | |
... | ... | @@ -309,18 +309,7 @@ const InvoicePage = () => { |
309 | 309 | listsHeight: 400, |
310 | 310 | }, |
311 | 311 | }} |
312 | - form={{ | |
313 | - // 由于配置了 transform,提交的参与与定义的不同这里需要转化一下 | |
314 | - syncToUrl: (values, type) => { | |
315 | - if (type === 'get') { | |
316 | - return { | |
317 | - ...values, | |
318 | - created_at: [values.startTime, values.endTime], | |
319 | - }; | |
320 | - } | |
321 | - return values; | |
322 | - }, | |
323 | - }} | |
312 | + form={{}} | |
324 | 313 | dateFormatter="string" |
325 | 314 | headerTitle="发票列表" |
326 | 315 | scroll={{ x: 1400, y: 360 }} | ... | ... |
src/pages/Order/components/FinancialMergeDrawer.tsx
1 | 1 | // import { PlusOutlined } from '@ant-design/icons'; |
2 | 2 | import { RESPONSE_CODE } from '@/constants/enum'; |
3 | 3 | import { postServiceOrderMergeInvoicing } from '@/services'; |
4 | +import { enumToSelect } from '@/utils'; | |
4 | 5 | import { |
5 | 6 | DrawerForm, |
6 | 7 | ProFormDatePicker, |
8 | + ProFormDigit, | |
7 | 9 | ProFormSelect, |
8 | 10 | ProFormText, |
9 | 11 | ProFormTextArea, |
10 | 12 | } from '@ant-design/pro-components'; |
11 | 13 | import { Form, message } from 'antd'; |
14 | +import { PAYEE_OPTIONS } from '../constant'; | |
12 | 15 | |
13 | 16 | export default ({ dataList, setVisible, onClose }) => { |
14 | 17 | let mainOrderIds = dataList?.map((item) => { |
... | ... | @@ -104,7 +107,30 @@ export default ({ dataList, setVisible, onClose }) => { |
104 | 107 | name="collectMoneyTime" |
105 | 108 | label="收款时间" |
106 | 109 | /> |
110 | + <ProFormText | |
111 | + width="lg" | |
112 | + key="invoiceNumber" | |
113 | + name="invoiceNumber" | |
114 | + label="发票号码" | |
115 | + rules={[{ required: true, message: '发票号码必填' }]} | |
116 | + /> | |
117 | + <ProFormSelect | |
118 | + key="payee" | |
119 | + placeholder="选择收款单位" | |
120 | + name="payee" | |
121 | + width="lg" | |
122 | + label="收款单位" | |
123 | + options={enumToSelect(PAYEE_OPTIONS)} | |
124 | + rules={[{ required: true, message: '收款单位必填' }]} | |
125 | + /> | |
107 | 126 | |
127 | + <ProFormDigit | |
128 | + key="money" | |
129 | + name="money" | |
130 | + width="lg" | |
131 | + label="金额" | |
132 | + rules={[{ required: true, message: '金额必填' }]} | |
133 | + /> | |
108 | 134 | <ProFormSelect |
109 | 135 | placeholder="是否完全开票" |
110 | 136 | name="afterInvoicingStatus" | ... | ... |