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,13 +2,15 @@ import UploadC from '@/pages/Invoice/components/UploadSingleImg'; | ||
2 | import { postOrderErpOrderStagesUpload } from '@/services'; | 2 | import { postOrderErpOrderStagesUpload } from '@/services'; |
3 | import { | 3 | import { |
4 | ModalForm, | 4 | ModalForm, |
5 | + ProCard, | ||
5 | ProFormDatePicker, | 6 | ProFormDatePicker, |
7 | + ProFormList, | ||
6 | ProFormText, | 8 | ProFormText, |
7 | } from '@ant-design/pro-components'; | 9 | } from '@ant-design/pro-components'; |
8 | import { Col, Form, Row, message } from 'antd'; | 10 | import { Col, Form, Row, message } from 'antd'; |
9 | import { RcFile } from 'antd/es/upload'; | 11 | import { RcFile } from 'antd/es/upload'; |
10 | 12 | ||
11 | -export default () => { | 13 | +export default ({ record }) => { |
12 | const [form] = Form.useForm<{ name: string; company: string }>(); | 14 | const [form] = Form.useForm<{ name: string; company: string }>(); |
13 | return ( | 15 | return ( |
14 | <ModalForm<{ | 16 | <ModalForm<{ |
@@ -66,6 +68,25 @@ export default () => { | @@ -66,6 +68,25 @@ export default () => { | ||
66 | ></UploadC> | 68 | ></UploadC> |
67 | </Col> | 69 | </Col> |
68 | </Row> | 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 | </ModalForm> | 90 | </ModalForm> |
70 | ); | 91 | ); |
71 | }; | 92 | }; |
src/pages/Invoice/index.tsx
@@ -64,6 +64,7 @@ const InvoicePage = () => { | @@ -64,6 +64,7 @@ const InvoicePage = () => { | ||
64 | let invoiceTypeRet = await postServiceConstInvoiceType(); | 64 | let invoiceTypeRet = await postServiceConstInvoiceType(); |
65 | setInvoiceTypeValueEnum(invoiceTypeRet.data); | 65 | setInvoiceTypeValueEnum(invoiceTypeRet.data); |
66 | } | 66 | } |
67 | + | ||
67 | extracted().catch(console.error); | 68 | extracted().catch(console.error); |
68 | }, []); | 69 | }, []); |
69 | 70 | ||
@@ -72,6 +73,7 @@ const InvoicePage = () => { | @@ -72,6 +73,7 @@ const InvoicePage = () => { | ||
72 | let invoicingTypeRet = await postServiceConstInvoicingType(); | 73 | let invoicingTypeRet = await postServiceConstInvoicingType(); |
73 | setInvoicingTypeValueEnum(invoicingTypeRet.data); | 74 | setInvoicingTypeValueEnum(invoicingTypeRet.data); |
74 | } | 75 | } |
76 | + | ||
75 | extracted().catch(console.error); | 77 | extracted().catch(console.error); |
76 | }, []); | 78 | }, []); |
77 | 79 | ||
@@ -315,16 +317,17 @@ const InvoicePage = () => { | @@ -315,16 +317,17 @@ const InvoicePage = () => { | ||
315 | valueType: 'option', | 317 | valueType: 'option', |
316 | key: 'option', | 318 | key: 'option', |
317 | render: (text, record) => { | 319 | render: (text, record) => { |
320 | + console.log('record' + JSON.stringify(record)); | ||
318 | return [ | 321 | return [ |
319 | /*<InvoiceRecordDetailModal | 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 | <a | 331 | <a |
329 | key="detail" | 332 | key="detail" |
330 | onClick={() => { | 333 | onClick={() => { |
@@ -335,10 +338,14 @@ const InvoicePage = () => { | @@ -335,10 +338,14 @@ const InvoicePage = () => { | ||
335 | 详情 | 338 | 详情 |
336 | </a>, | 339 | </a>, |
337 | <InvoiceModal key="invoiceModal" recordId={record.id} />, | 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 | }, |