Commit 18cc2f96dc9137a89e0911875ad004244b64bea6
1 parent
7937df06
feat: 手动开票功能开发
Showing
2 changed files
with
41 additions
and
13 deletions
src/pages/Invoice/components/ManualInvoicingModal.tsx
... | ... | @@ -2,13 +2,15 @@ import UploadC from '@/pages/Invoice/components/UploadSingleImg'; |
2 | 2 | import { postOrderErpOrderStagesUpload } from '@/services'; |
3 | 3 | import { |
4 | 4 | ModalForm, |
5 | + ProCard, | |
5 | 6 | ProFormDatePicker, |
7 | + ProFormList, | |
6 | 8 | ProFormText, |
7 | 9 | } from '@ant-design/pro-components'; |
8 | 10 | import { Col, Form, Row, message } from 'antd'; |
9 | 11 | import { RcFile } from 'antd/es/upload'; |
10 | 12 | |
11 | -export default () => { | |
13 | +export default ({ record }) => { | |
12 | 14 | const [form] = Form.useForm<{ name: string; company: string }>(); |
13 | 15 | return ( |
14 | 16 | <ModalForm<{ |
... | ... | @@ -66,6 +68,25 @@ export default () => { |
66 | 68 | ></UploadC> |
67 | 69 | </Col> |
68 | 70 | </Row> |
71 | + <ProFormList | |
72 | + name="invoiceDetails" | |
73 | + label="明细" | |
74 | + creatorButtonProps={false} | |
75 | + copyIconProps={false} | |
76 | + itemRender={({ listDom, action }, { index }) => ( | |
77 | + <ProCard | |
78 | + bordered | |
79 | + style={{ marginBlockEnd: 8 }} | |
80 | + title={`明细${index + 1}`} | |
81 | + extra={action} | |
82 | + bodyStyle={{ paddingBlockEnd: 0 }} | |
83 | + > | |
84 | + {listDom} | |
85 | + </ProCard> | |
86 | + )} | |
87 | + creatorRecord={{ name: '', items: [{ name: '' }] }} | |
88 | + initialValue={record.invoiceDetails} | |
89 | + ></ProFormList> | |
69 | 90 | </ModalForm> |
70 | 91 | ); |
71 | 92 | }; | ... | ... |
src/pages/Invoice/index.tsx
... | ... | @@ -64,6 +64,7 @@ const InvoicePage = () => { |
64 | 64 | let invoiceTypeRet = await postServiceConstInvoiceType(); |
65 | 65 | setInvoiceTypeValueEnum(invoiceTypeRet.data); |
66 | 66 | } |
67 | + | |
67 | 68 | extracted().catch(console.error); |
68 | 69 | }, []); |
69 | 70 | |
... | ... | @@ -72,6 +73,7 @@ const InvoicePage = () => { |
72 | 73 | let invoicingTypeRet = await postServiceConstInvoicingType(); |
73 | 74 | setInvoicingTypeValueEnum(invoicingTypeRet.data); |
74 | 75 | } |
76 | + | |
75 | 77 | extracted().catch(console.error); |
76 | 78 | }, []); |
77 | 79 | |
... | ... | @@ -315,16 +317,17 @@ const InvoicePage = () => { |
315 | 317 | valueType: 'option', |
316 | 318 | key: 'option', |
317 | 319 | render: (text, record) => { |
320 | + console.log('record' + JSON.stringify(record)); | |
318 | 321 | return [ |
319 | 322 | /*<InvoiceRecordDetailModal |
320 | - key="detail" | |
321 | - id={record.id} | |
322 | - subOrderIds={record.subOrderIds} | |
323 | - onClose={()=>{ | |
324 | - waitDealrecordActionRef.current?.reload(); | |
325 | - } | |
326 | - } | |
327 | - />*/ | |
323 | + key="detail" | |
324 | + id={record.id} | |
325 | + subOrderIds={record.subOrderIds} | |
326 | + onClose={()=>{ | |
327 | + waitDealrecordActionRef.current?.reload(); | |
328 | + } | |
329 | + } | |
330 | + />*/ | |
328 | 331 | <a |
329 | 332 | key="detail" |
330 | 333 | onClick={() => { |
... | ... | @@ -335,10 +338,14 @@ const InvoicePage = () => { |
335 | 338 | 详情 |
336 | 339 | </a>, |
337 | 340 | <InvoiceModal key="invoiceModal" recordId={record.id} />, |
338 | - <ManualInvoicingModal | |
339 | - key={'ManualInvoicingModal'} | |
340 | - record={record} | |
341 | - ></ManualInvoicingModal>, | |
341 | + <> | |
342 | + {record.paths.includes('INVOICING') && ( | |
343 | + <ManualInvoicingModal | |
344 | + key={'ManualInvoicingModal'} | |
345 | + record={record} | |
346 | + ></ManualInvoicingModal> | |
347 | + )} | |
348 | + </>, | |
342 | 349 | ]; |
343 | 350 | }, |
344 | 351 | }, | ... | ... |