kts-component-invoice-operate 3.1.20 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Invoice/Invoice-digtal/_test/disabled/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/easiest/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/header/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/importStakeholder/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/readOnly/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/stakeholder/index.d.ts +4 -0
- package/dist/Invoice/Invoice-digtal/_test/typeSelection/index.d.ts +4 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.d.ts +10 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/addGoodDiscount.d.ts +1 -1
- package/dist/Invoice/InvoiceController/fns/addGoodDiscountV2.d.ts +12 -0
- package/dist/Invoice/InvoiceController/fns/delGood.d.ts +1 -1
- package/dist/Invoice/InvoiceController/index.d.ts +2 -0
- package/dist/Invoice/index.d.ts +25 -12
- package/dist/Invoice/tools/mounting/index.d.ts +3 -0
- package/dist/Invoice/{ui/GoodsList/hook → tools}/useToGenerateId/index.d.ts +1 -1
- package/dist/Invoice/ui/{Buyer → default/Buyer}/index.d.ts +1 -1
- package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/autoFillFn/index.d.ts +2 -2
- package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +0 -1
- package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -1
- package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -1
- package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +1 -1
- package/dist/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
- package/dist/Invoice/ui/default/GoodsList/hook/useDeduction/index.d.ts +8 -0
- package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useOnRow/index.d.ts +1 -1
- package/dist/Invoice/ui/default/GoodsList/hook/useWindowClick/index.d.ts +8 -0
- package/dist/Invoice/ui/default/ImportGoodsDrawer/index.d.ts +3 -0
- package/dist/Invoice/ui/{Seller → default/Seller}/index.d.ts +1 -1
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.d.ts +35 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList/index.d.ts +17 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +5 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +5 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.d.ts +5 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/Search/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/Statistics/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/TableRow/index.d.ts +2 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.d.ts +35 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.d.ts +7 -0
- package/dist/Invoice/ui/{GoodsList/hook/useColumns/ui/RowMenu → digtal/GoodsList.o/hook/useColumns/ui/RowEditButton}/index.d.ts +0 -1
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/index.d.ts +20 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.d.ts +2 -0
- package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.d.ts +4 -0
- package/dist/Invoice/ui/digtal/InvoiceHeader/index.d.ts +14 -0
- package/dist/Invoice/ui/digtal/Sign/index.d.ts +10 -0
- package/dist/Invoice/ui/digtal/Stakeholder/index.d.ts +12 -0
- package/dist/InvoiceTypeModal/_test/easiest/index.d.ts +3 -0
- package/dist/InvoiceTypeModal/index.d.ts +34 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +6379 -189
- package/dist/index.js +6365 -174
- package/docs-dist/404.html +33 -33
- package/docs-dist/index.html +33 -33
- package/docs-dist/static/add.a70623b4.svg +12 -0
- package/docs-dist/static/arrowDown.a1cbf0d8.svg +3 -0
- package/docs-dist/static/arrowUp.4c482054.svg +3 -0
- package/docs-dist/static/fork.5431267d.svg +12 -0
- package/docs-dist/umi.css +19 -19
- package/docs-dist/umi.js +1 -1
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/disabled/index.tsx +38 -0
- package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +5 -0
- package/src/Invoice/Invoice-digtal/_test/header/index.tsx +17 -0
- package/src/Invoice/Invoice-digtal/_test/importGoods/index.tsx +471 -0
- package/src/Invoice/Invoice-digtal/_test/importStakeholder/index.tsx +17 -0
- package/src/Invoice/Invoice-digtal/_test/readOnly/index.tsx +42 -0
- package/src/Invoice/Invoice-digtal/_test/stakeholder/index.tsx +12 -0
- package/src/Invoice/Invoice-digtal/_test/typeSelection/index.tsx +29 -0
- package/src/Invoice/Invoice-digtal/index.md +25 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.ts +11 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +8 -0
- package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +1 -1
- package/src/Invoice/InvoiceController/fns/addGoodDiscountV2.ts +84 -0
- package/src/Invoice/InvoiceController/fns/delGood.ts +26 -28
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -0
- package/src/Invoice/InvoiceController/index.ts +4 -0
- package/src/Invoice/_test/buyerNameSearch/index.tsx +2 -2
- package/src/Invoice/_test/easiest/index.tsx +1 -1
- package/src/Invoice/_test/endowCode/index.tsx +4 -4
- package/src/Invoice/_test/goodsMenuExpand/index.tsx +1 -1
- package/src/Invoice/_test/importBuyer/index.tsx +1 -1
- package/src/Invoice/_test/importGoods/index.tsx +1 -1
- package/src/Invoice/_test/invoiceType/index.tsx +1 -1
- package/src/Invoice/_test/seller/index.tsx +1 -1
- package/src/Invoice/_test/setDataSource/index.tsx +1 -1
- package/src/Invoice/_test/unit/index.tsx +1 -1
- package/src/Invoice/index.less +19 -1
- package/src/Invoice/index.md +6 -6
- package/src/Invoice/index.tsx +75 -18
- package/src/Invoice/tools/mounting/index.ts +14 -0
- package/src/Invoice/{ui/GoodsList/hook → tools}/useToGenerateId/index.ts +1 -1
- package/src/Invoice/ui/{AddComparisonDrawer → default/AddComparisonDrawer}/index.tsx +5 -5
- package/src/Invoice/ui/{Buyer → default/Buyer}/index.tsx +2 -2
- package/src/Invoice/ui/{Buyer → default/Buyer}/ui/BuyerNameInput/index.tsx +2 -2
- package/src/Invoice/ui/{Buyer → default/Buyer}/ui/ImportBuyerButton/index.tsx +1 -1
- package/src/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.tsx +5 -5
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/autoFillFn/index.ts +4 -4
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/index.tsx +3 -3
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +3 -3
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/index.tsx +2 -2
- package/src/Invoice/ui/default/GoodsList/hook/useDeduction/index.tsx +24 -0
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useOnRow/index.tsx +3 -3
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useRowSelection/index.tsx +2 -2
- package/src/Invoice/ui/default/GoodsList/hook/useWindowClick/index.tsx +23 -0
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/AddRowButton/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +4 -4
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useDelRowButton/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/DescribeSwitch/index.tsx +1 -1
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.tsx +1 -1
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.tsx +1 -1
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableRow/index.tsx +2 -2
- package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TaxIncludedSwitch/index.tsx +1 -1
- package/src/Invoice/ui/{ImportBuyerDrawer → default/ImportBuyerDrawer}/index.tsx +1 -1
- package/src/Invoice/ui/{ImportGoodsDrawer → default/ImportGoodsDrawer}/index.tsx +4 -4
- package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.tsx +1 -1
- package/src/Invoice/ui/{Seller → default/Seller}/index.tsx +2 -2
- package/src/Invoice/ui/{Sign → default/Sign}/index.tsx +1 -1
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +520 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +636 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/svg/plus.svg +12 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.less +10 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +24 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.tsx +30 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.less +13 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +98 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/spot.svg +1 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.tsx +14 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.tsx +20 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.tsx +39 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.tsx +112 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.tsx +23 -0
- package/src/Invoice/ui/digtal/GoodsList/index.less +57 -0
- package/src/Invoice/ui/digtal/GoodsList/index.tsx +180 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +66 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +320 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/svg/add.svg +12 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +35 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +82 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.tsx +56 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.tsx +37 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/Search/icon/magnifier.svg +1 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.less +12 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.tsx +50 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.less +54 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +99 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/svg/fork.svg +12 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +28 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.less +39 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.tsx +109 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.less +44 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.tsx +96 -0
- package/src/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.tsx +31 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.ts +520 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.tsx +624 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.less +10 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.tsx +19 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowEditButton/index.tsx +30 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.less +13 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.tsx +98 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/spot.svg +1 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.tsx +14 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.tsx +20 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.tsx +39 -0
- package/src/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.tsx +112 -0
- package/src/Invoice/ui/digtal/GoodsList.o/index.less +7 -0
- package/src/Invoice/ui/digtal/GoodsList.o/index.tsx +132 -0
- package/src/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.tsx +66 -0
- package/src/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.tsx +28 -0
- package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.less +43 -0
- package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.tsx +109 -0
- package/src/Invoice/ui/digtal/InvoiceHeader/index.less +58 -0
- package/src/Invoice/ui/digtal/InvoiceHeader/index.tsx +77 -0
- package/src/Invoice/ui/digtal/Sign/index.less +49 -0
- package/src/Invoice/ui/digtal/Sign/index.tsx +90 -0
- package/src/Invoice/ui/digtal/Stakeholder/index.less +57 -0
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +260 -0
- package/src/Invoice/ui/digtal/Stakeholder/svg/arrowDown.svg +3 -0
- package/src/Invoice/ui/digtal/Stakeholder/svg/arrowUp.svg +3 -0
- package/src/Invoice/ui/digtal/Stakeholder/svg/plus.svg +12 -0
- package/src/InvoiceTypeModal/_test/easiest/index.tsx +32 -0
- package/src/InvoiceTypeModal/index.less +8 -0
- package/src/InvoiceTypeModal/index.md +6 -0
- package/src/InvoiceTypeModal/index.tsx +127 -0
- package/src/index.ts +3 -0
- /package/dist/Invoice/{ui/Buyer/ui/ImportBuyerButton → Invoice-digtal/_test/importGoods}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{AddComparisonDrawer → default/AddComparisonDrawer}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{Buyer → default/Buyer}/ui/BuyerNameInput/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList/ui/AddRowButton → default/Buyer/ui/ImportBuyerButton}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowEditButton/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowSaveButton/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/TitleText/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useRowSelection/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList/ui/DescribeSwitch → default/GoodsList/ui/AddRowButton}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList/ui/TaxIncludedSwitch → default/GoodsList/ui/DescribeSwitch}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableRow/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.d.ts +0 -0
- /package/dist/Invoice/ui/{ImportBuyerDrawer → default/GoodsList/ui/TaxIncludedSwitch}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{ImportGoodsDrawer → default/ImportBuyerDrawer}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{Sign → default/Sign}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useDeduction/index.d.ts +0 -0
- /package/dist/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useWindowClick/index.d.ts +0 -0
- /package/src/Invoice/ui/{Buyer → default/Buyer}/index.less +0 -0
- /package/src/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowEditButton/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/spot.svg +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowSaveButton/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/TitleText/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/icon/magnifier.svg +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.tsx +0 -0
- /package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/auto.svg +0 -0
- /package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.less +0 -0
- /package/src/Invoice/ui/{Seller → default/Seller}/index.less +0 -0
- /package/src/Invoice/ui/{Sign → default/Sign}/index.less +0 -0
- /package/src/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useDeduction/index.tsx +0 -0
- /package/src/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useWindowClick/index.tsx +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import GoodsListState from './GoodsListState';
|
|
2
2
|
import BuyerState from './BuyerState';
|
|
3
|
+
import Stakeholder from './Stakeholder';
|
|
4
|
+
import { IInvoiceTypeModalProps } from '../../../InvoiceTypeModal';
|
|
3
5
|
|
|
4
6
|
export default class InvoiceControllerState {
|
|
5
7
|
|
|
@@ -31,6 +33,9 @@ export default class InvoiceControllerState {
|
|
|
31
33
|
/** 购买方 */
|
|
32
34
|
buyerState = new BuyerState();
|
|
33
35
|
|
|
36
|
+
/** 干系人 相关-买方、卖方、备注、开票人 */
|
|
37
|
+
stakeholder = new Stakeholder();
|
|
38
|
+
|
|
34
39
|
/** 货物信息 */
|
|
35
40
|
goodsListState = new GoodsListState();
|
|
36
41
|
|
|
@@ -45,4 +50,7 @@ export default class InvoiceControllerState {
|
|
|
45
50
|
|
|
46
51
|
/** 组件根结构 */
|
|
47
52
|
rootElement?: HTMLDivElement | null = null;
|
|
53
|
+
|
|
54
|
+
/** 发票类型选择窗口 */
|
|
55
|
+
typeModalProps?: IInvoiceTypeModalProps;
|
|
48
56
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import { bignumber, chain } from 'mathjs';
|
|
4
|
+
import { InvoiceControllerState, LineAttributeType } from '../';
|
|
5
|
+
import idGenerator from '../../tools/idGenerator';
|
|
6
|
+
|
|
7
|
+
export interface IOptions {
|
|
8
|
+
/** 需要添加的索引 */
|
|
9
|
+
$index: string;
|
|
10
|
+
|
|
11
|
+
/** 折扣 金额 */
|
|
12
|
+
discolineAmountunt: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 给一组货物添加折扣行
|
|
17
|
+
*/
|
|
18
|
+
export default async (state: InvoiceControllerState, options?: IOptions[]) => {
|
|
19
|
+
|
|
20
|
+
if (!options || options.length <= 0) return;
|
|
21
|
+
|
|
22
|
+
const discountGroup = uuidv4();
|
|
23
|
+
|
|
24
|
+
options.forEach(e => {
|
|
25
|
+
const goodsList = state.goodsListState.goodsList;
|
|
26
|
+
const goodsMap = state.goodsListState.goodsMap;
|
|
27
|
+
for (let i = 0; i < goodsList.length; i++) {
|
|
28
|
+
const good = goodsList[i];
|
|
29
|
+
if (good.$index !== e.$index) continue;
|
|
30
|
+
|
|
31
|
+
// 折扣行 税额
|
|
32
|
+
const lineAmountExcludeTax = getLineAmountExcludeTax(e.discolineAmountunt, good.taxRate);
|
|
33
|
+
const taxAmount = getTaxAmount(e.discolineAmountunt, lineAmountExcludeTax);
|
|
34
|
+
|
|
35
|
+
good.lineAttribute = LineAttributeType.被折扣行;
|
|
36
|
+
good.discountGroup = discountGroup;
|
|
37
|
+
|
|
38
|
+
const newGood = {
|
|
39
|
+
discountGroup,
|
|
40
|
+
$index: idGenerator(),
|
|
41
|
+
lineAttribute: LineAttributeType.折扣行,
|
|
42
|
+
taxRate: good.taxRate,
|
|
43
|
+
itemName: good.itemName,
|
|
44
|
+
|
|
45
|
+
taxAmount: -1 * taxAmount,
|
|
46
|
+
lineAmountExcludeTax: -1 * lineAmountExcludeTax,
|
|
47
|
+
lineAmountIncludeTax: -1 * e.discolineAmountunt,
|
|
48
|
+
|
|
49
|
+
taxFreeType: good.taxFreeType,
|
|
50
|
+
favouredPolicyMark: good.favouredPolicyMark,
|
|
51
|
+
favouredPolicyName: good.favouredPolicyName,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
goodsList.splice(i + 1, 0, newGood);
|
|
55
|
+
goodsMap.set(newGood.$index, newGood);
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
state.goodsListState.goodsList = [...state.goodsListState.goodsList];
|
|
60
|
+
state.goodsListState.goodsMap = new Map(state.goodsListState.goodsMap);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** 金额(不含税) = 含税金额 / (1 + 税率) */
|
|
64
|
+
function getLineAmountExcludeTax(lineAmountIncludeTax: number, taxRate: number = 0) {
|
|
65
|
+
const biTaxRate = chain(bignumber(taxRate)).divide(bignumber(100)).done();
|
|
66
|
+
return chain(bignumber(lineAmountIncludeTax))
|
|
67
|
+
.divide(chain(bignumber(1)).add(biTaxRate).done())
|
|
68
|
+
|
|
69
|
+
.multiply(bignumber(100))
|
|
70
|
+
.round()
|
|
71
|
+
.divide(bignumber(100))
|
|
72
|
+
|
|
73
|
+
.done()
|
|
74
|
+
.toNumber()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** 税额 = 含税金额 - 金额(不含税) */
|
|
78
|
+
function getTaxAmount(lineAmountIncludeTax: number, lineAmountExcludeTax: number) {
|
|
79
|
+
return chain(bignumber(lineAmountIncludeTax))
|
|
80
|
+
.subtract(bignumber(lineAmountExcludeTax))
|
|
81
|
+
|
|
82
|
+
.done()
|
|
83
|
+
.toNumber()
|
|
84
|
+
}
|
|
@@ -2,42 +2,40 @@ import { InvoiceControllerState, IGood } from '../';
|
|
|
2
2
|
import LineAttributeType from '../../InvoiceController/InvoiceControllerState/GoodsListState/LineAttributeType';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 删除一个货物
|
|
6
6
|
*/
|
|
7
7
|
export default async (state: InvoiceControllerState, $index?: string) => {
|
|
8
8
|
if (!$index) return;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// 查下要删除的货物
|
|
11
|
+
const goods = state.goodsListState.goodsList.filter((e) => e.$index === $index)[0];
|
|
11
12
|
if (!goods) return;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
) {
|
|
13
|
+
|
|
14
|
+
// 如果正在编辑 就取消编辑
|
|
15
|
+
if (state.goodsListState.editGood && state.goodsListState.editGood.$index === $index) {
|
|
16
16
|
state.goodsListState.editGood = undefined;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
19
|
+
const goodsList = state.goodsListState.goodsList;
|
|
20
|
+
const goodsMap = state.goodsListState.goodsMap;
|
|
21
|
+
|
|
22
|
+
goodsMap.delete($index);
|
|
23
|
+
|
|
24
|
+
for (let i = 0; i < goodsList.length; i++) {
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
);
|
|
26
|
+
if (goodsList[i].$index === $index) {
|
|
27
|
+
const good = goodsList[i];
|
|
28
|
+
|
|
29
|
+
if (good.lineAttribute === LineAttributeType.折扣行 && goodsList[i - 1] && goodsList[i - 1].lineAttribute === LineAttributeType.被折扣行) {
|
|
30
|
+
goodsList[i - 1].lineAttribute = LineAttributeType.正常;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
goodsList.splice(i, 1);
|
|
34
|
+
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
42
37
|
}
|
|
38
|
+
|
|
39
|
+
state.goodsListState.goodsList = [...goodsList];
|
|
40
|
+
state.goodsListState.goodsMap = new Map(goodsMap);
|
|
43
41
|
};
|
|
@@ -7,6 +7,7 @@ import setEditGood from './fns/setEditGood';
|
|
|
7
7
|
import setGoods from './fns/setGoods';
|
|
8
8
|
import delGood from './fns/delGood';
|
|
9
9
|
import addGoodDiscount from './fns/addGoodDiscount';
|
|
10
|
+
import addGoodDiscountV2 from './fns/addGoodDiscountV2';
|
|
10
11
|
import addGood from './fns/addGood';
|
|
11
12
|
import saveEditGood from './fns/saveEditGood';
|
|
12
13
|
import getGoodsSearch from './fns/getGoodsSearch';
|
|
@@ -50,6 +51,9 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
50
51
|
/** 给一组货物添加折扣行 */
|
|
51
52
|
addGoodDiscount = this.pipeline(addGoodDiscount);
|
|
52
53
|
|
|
54
|
+
/** 给一组货物添加折扣行 */
|
|
55
|
+
addGoodDiscountV2 = this.pipeline(addGoodDiscountV2);
|
|
56
|
+
|
|
53
57
|
/** 获取 商品 列表 */
|
|
54
58
|
getGoodsList?: (option?: IGetGoodsListOption | undefined) => Promise<any>;
|
|
55
59
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Invoice } from '
|
|
2
|
+
import { Invoice } from '../../../..';
|
|
3
3
|
import idGenerator from '../../../Invoice/tools/idGenerator';
|
|
4
4
|
import { LineAttributeType } from '../../../Invoice/InvoiceController';
|
|
5
5
|
import { Button, Switch } from 'kts-components-antd-x3';
|
|
@@ -119,10 +119,10 @@ for (let i = 0; i <= 10000; i++) {
|
|
|
119
119
|
$index: idGenerator(),
|
|
120
120
|
itemName: `项目名称${i}`,
|
|
121
121
|
lineAttribute: LineAttributeType.正常,
|
|
122
|
-
lineAmountExcludeTax:
|
|
123
|
-
lineAmountIncludeTax:
|
|
122
|
+
lineAmountExcludeTax: 9.99,
|
|
123
|
+
lineAmountIncludeTax: 10.29,
|
|
124
124
|
taxRate: 3,
|
|
125
|
-
taxAmount: 3,
|
|
125
|
+
taxAmount: 0.3,
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Button } from 'kts-components-antd-x3/lib/radio';
|
|
4
|
-
import { Invoice, IGood } from '
|
|
4
|
+
import { Invoice, IGood } from '../../../..';
|
|
5
5
|
import { IGetBuyerListOption } from '../../../Invoice/InvoiceController/InvoiceControllerState/BuyerState';
|
|
6
6
|
|
|
7
7
|
const InvoiceController = Invoice.InvoiceController
|
package/src/Invoice/index.less
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.kts-invoice-operate {
|
|
2
|
-
border: 1px solid #dcdcdc;
|
|
2
|
+
border : 1px solid #dcdcdc;
|
|
3
3
|
font-size: 12px;
|
|
4
4
|
|
|
5
5
|
&>* {
|
|
@@ -10,3 +10,21 @@
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
.kts-invoice-operate-digtal {
|
|
15
|
+
|
|
16
|
+
font-family: PingFang SC;
|
|
17
|
+
font-size : 14px;
|
|
18
|
+
|
|
19
|
+
.kts-invoice-operate-digtal-cont {
|
|
20
|
+
border: 2px solid #9F613E;
|
|
21
|
+
|
|
22
|
+
&>* {
|
|
23
|
+
border-bottom: 2px solid #9F613E;
|
|
24
|
+
|
|
25
|
+
&:last-child {
|
|
26
|
+
border-bottom: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/Invoice/index.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 默认
|
|
2
2
|
|
|
3
3
|
## 简单用法
|
|
4
4
|
<code src="./_test/easiest/index.tsx"></code>
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
<code src="./_test/endowCode/index.tsx"></code>
|
|
47
47
|
|
|
48
48
|
<API name="Invoice 发票组件 API" exports='["default"]' src="./index.tsx" ></API>
|
|
49
|
-
<API name="InvoiceHeader 发票头 API" exports='["default"]' src="./ui/InvoiceHeader/index.tsx"></API>
|
|
50
|
-
<API name="GoodsList 商品列表 API" exports='["default"]' src="./ui/GoodsList/index.tsx"></API>
|
|
51
|
-
<API name="Buyer 购买方 API" exports='["default"]' src="./ui/Buyer/index.tsx"></API>
|
|
52
|
-
<API name="Seller 销售方 API" exports='["default"]' src="./ui/Seller/index.tsx"></API>
|
|
53
|
-
<API name="Sign 落款 API" exports='["default"]' src="./ui/Sign/index.tsx"></API>
|
|
49
|
+
<API name="InvoiceHeader 发票头 API" exports='["default"]' src="./ui/default/InvoiceHeader/index.tsx"></API>
|
|
50
|
+
<API name="GoodsList 商品列表 API" exports='["default"]' src="./ui/default/GoodsList/index.tsx"></API>
|
|
51
|
+
<API name="Buyer 购买方 API" exports='["default"]' src="./ui/default/Buyer/index.tsx"></API>
|
|
52
|
+
<API name="Seller 销售方 API" exports='["default"]' src="./ui/default/Seller/index.tsx"></API>
|
|
53
|
+
<API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API>
|
package/src/Invoice/index.tsx
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
|
|
1
2
|
import './index.less';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import InvoiceController from './InvoiceController';
|
|
4
|
-
import
|
|
5
|
-
import GoodsList from './ui/GoodsList';
|
|
6
|
-
import useToGenerateId from './ui/GoodsList/hook/useToGenerateId';
|
|
7
|
-
import Seller from './ui/Seller';
|
|
8
|
-
import Sign from './ui/Sign';
|
|
9
|
-
import Buyer from './ui/Buyer';
|
|
10
|
-
import ImportBuyerDrawer from './ui/ImportBuyerDrawer';
|
|
11
|
-
import ImportGoodsDrawer from './ui/ImportGoodsDrawer';
|
|
12
|
-
import EndowCodeDrawer from './ui/EndowCodeDrawer';
|
|
13
|
-
import AddComparisonDrawer from './ui/AddComparisonDrawer';
|
|
5
|
+
import useToGenerateId from './tools/useToGenerateId';
|
|
14
6
|
import idGenerator from './tools/idGenerator';
|
|
15
7
|
import * as calculator from './tools/calculate';
|
|
16
8
|
|
|
9
|
+
import InvoiceHeader from './ui/default/InvoiceHeader';
|
|
10
|
+
import GoodsList from './ui/default/GoodsList';
|
|
11
|
+
import Seller from './ui/default/Seller';
|
|
12
|
+
import Buyer from './ui/default/Buyer';
|
|
13
|
+
import Sign from './ui/default/Sign';
|
|
14
|
+
|
|
15
|
+
import InvoiceHeaderDigtal from './ui/digtal/InvoiceHeader';
|
|
16
|
+
import Stakeholder from './ui/digtal/Stakeholder';
|
|
17
|
+
import SignDigtal from './ui/digtal/Sign';
|
|
18
|
+
import GoodsListDigtal from './ui/digtal/GoodsList';
|
|
19
|
+
|
|
20
|
+
import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
|
|
21
|
+
import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
|
|
22
|
+
import EndowCodeDrawer from './ui/default/EndowCodeDrawer';
|
|
23
|
+
import AddComparisonDrawer from './ui/default/AddComparisonDrawer';
|
|
24
|
+
|
|
17
25
|
|
|
18
26
|
/** 发票组件的上下文 */
|
|
19
27
|
export const InvoiceContext = React.createContext<InvoiceController>(
|
|
@@ -30,38 +38,56 @@ export interface IInvoiceProps {
|
|
|
30
38
|
/** 货物列表UI */
|
|
31
39
|
goodsList?: React.ReactNode;
|
|
32
40
|
|
|
33
|
-
/** 购买方UI */
|
|
41
|
+
/** 购买方UI (invoiceType为default时生效) */
|
|
34
42
|
buyer?: React.ReactNode;
|
|
35
43
|
|
|
36
|
-
/** 销售方UI
|
|
44
|
+
/** 销售方UI (invoiceType为default时生效)*/
|
|
37
45
|
seller?: React.ReactNode;
|
|
38
46
|
|
|
47
|
+
/** 干系人(购买方&销售方) (invoiceType为digtal时生效) */
|
|
48
|
+
stakeholder?: React.ReactNode;
|
|
49
|
+
|
|
39
50
|
/** 落款UI */
|
|
40
51
|
sign?: React.ReactNode;
|
|
41
52
|
|
|
42
53
|
/** 底部扩展UI */
|
|
43
54
|
footExpand?: React.ReactNode;
|
|
55
|
+
|
|
56
|
+
/** 发票种类: default-默认,digtal-数电 */
|
|
57
|
+
invoiceType?: 'default' | 'digtal';
|
|
44
58
|
}
|
|
45
59
|
|
|
46
60
|
export default class Invoice extends React.PureComponent<IInvoiceProps> {
|
|
47
61
|
/** 控制器 */
|
|
48
62
|
static readonly InvoiceController = InvoiceController;
|
|
49
63
|
|
|
50
|
-
/** 发票头 */
|
|
64
|
+
/** 发票头(默认) */
|
|
51
65
|
static readonly InvoiceHeader = InvoiceHeader;
|
|
52
66
|
|
|
53
|
-
/** 货物列表 */
|
|
67
|
+
/** 货物列表(默认) */
|
|
54
68
|
static readonly GoodsList = GoodsList;
|
|
55
69
|
|
|
56
|
-
/** 销售方 */
|
|
70
|
+
/** 销售方(默认) */
|
|
57
71
|
static readonly Seller = Seller;
|
|
58
72
|
|
|
59
|
-
/** 落款 */
|
|
73
|
+
/** 落款(默认) */
|
|
60
74
|
static readonly Sign = Sign;
|
|
61
75
|
|
|
62
|
-
/** 购买方 */
|
|
76
|
+
/** 购买方(默认) */
|
|
63
77
|
static readonly Buyer = Buyer;
|
|
64
78
|
|
|
79
|
+
/** 发票头(数电) */
|
|
80
|
+
static readonly InvoiceHeaderDigtal = InvoiceHeaderDigtal;
|
|
81
|
+
|
|
82
|
+
/** 干系人(数电) */
|
|
83
|
+
static readonly Stakeholder = Stakeholder;
|
|
84
|
+
|
|
85
|
+
/** 落款(数电) */
|
|
86
|
+
static readonly SignDigtal = SignDigtal;
|
|
87
|
+
|
|
88
|
+
/** 货物列表(数电) */
|
|
89
|
+
static readonly GoodsListDigtal = GoodsListDigtal;
|
|
90
|
+
|
|
65
91
|
/** 货物索引生成器 */
|
|
66
92
|
static idGenerator = idGenerator;
|
|
67
93
|
|
|
@@ -72,10 +98,15 @@ export default class Invoice extends React.PureComponent<IInvoiceProps> {
|
|
|
72
98
|
static useInvoiceController = () => { return React.useContext(InvoiceContext) };
|
|
73
99
|
|
|
74
100
|
render() {
|
|
75
|
-
|
|
101
|
+
if (this.props.invoiceType === 'digtal') {
|
|
102
|
+
return <Digtal {...this.props}></Digtal>;
|
|
103
|
+
} else {
|
|
104
|
+
return <Main {...this.props}></Main>;
|
|
105
|
+
}
|
|
76
106
|
}
|
|
77
107
|
}
|
|
78
108
|
|
|
109
|
+
/** 默认 */
|
|
79
110
|
const Main = (props: IInvoiceProps) => {
|
|
80
111
|
|
|
81
112
|
const controller = React.useMemo(() => props.controller || new InvoiceController(), [props.controller]);
|
|
@@ -106,4 +137,30 @@ const Main = (props: IInvoiceProps) => {
|
|
|
106
137
|
);
|
|
107
138
|
};
|
|
108
139
|
|
|
140
|
+
/** 数电 */
|
|
141
|
+
const Digtal = (props: IInvoiceProps) => {
|
|
142
|
+
|
|
143
|
+
const controller = React.useMemo(() => props.controller || new InvoiceController(), [props.controller]);
|
|
109
144
|
|
|
145
|
+
const [key, setKey] = React.useState(0);
|
|
146
|
+
|
|
147
|
+
useToGenerateId(controller);
|
|
148
|
+
|
|
149
|
+
React.useEffect(() => { setKey(key + 1) }, [controller]);
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<InvoiceContext.Provider key={key} value={controller}>
|
|
153
|
+
<div className="kts-invoice-operate-digtal" ref={controller.pipeline<HTMLDivElement | null>(async (s, e) => { s.rootElement = e })} >
|
|
154
|
+
{props.invoiceHeader || <InvoiceHeaderDigtal /> /** 发票头 */}
|
|
155
|
+
<div className='kts-invoice-operate-digtal-cont' >
|
|
156
|
+
{props.stakeholder || <Stakeholder /> /** 干系人 */}
|
|
157
|
+
{props.goodsList || <GoodsListDigtal /** 货物列表 */ />}
|
|
158
|
+
</div>
|
|
159
|
+
{props.sign || <SignDigtal /> /** 落款 */}
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<ImportGoodsDrawer />{/* 导入货品的抽屉 */}
|
|
163
|
+
<EndowCodeDrawer />{/* 给货品赋码的抽屉 */}
|
|
164
|
+
</InvoiceContext.Provider>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
import * as ReactDOM from 'react-dom';
|
|
3
|
+
|
|
4
|
+
/** 挂在组件到跟上 */
|
|
5
|
+
export default function mounting(node: JSX.Element, containerId?: string) {
|
|
6
|
+
ReactDOM.render(node, getContainer(containerId));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function getContainer(containerId: string = 'kts-component-invoice-operate-invoicing-authorization') {
|
|
10
|
+
const div: HTMLElement = document.querySelector(`#${containerId}`) || document.createElement("div");
|
|
11
|
+
div.id = containerId;
|
|
12
|
+
document.body.appendChild(div);
|
|
13
|
+
return div;
|
|
14
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Row, Col, Input, Button, message } from "kts-components-antd-x3";
|
|
4
4
|
import { Form, Drawer } from "kts-xui";
|
|
5
|
-
import { Invoice, IGood } from "
|
|
6
|
-
import { getSN } from "
|
|
7
|
-
import { LineAttributeType } from "
|
|
5
|
+
import { Invoice, IGood } from "../../../..";
|
|
6
|
+
import { getSN } from "../../../tools/itemName";
|
|
7
|
+
import { LineAttributeType } from "../../../InvoiceController";
|
|
8
8
|
|
|
9
9
|
export default function AddComparisonDrawer() {
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ export default function AddComparisonDrawer() {
|
|
|
14
14
|
const controller = Invoice.useInvoiceController();
|
|
15
15
|
|
|
16
16
|
/** 正在 添加商品对照 的货物索引 */
|
|
17
|
-
const addComparisonIndex = controller.useMemo(s => s.goodsListState
|
|
17
|
+
const addComparisonIndex = controller.useMemo(s => s.goodsListState?.addComparisonIndex, []);
|
|
18
18
|
|
|
19
19
|
/** 货物字典 */
|
|
20
20
|
const goodsMap = controller.useMemo(s => s.goodsListState.goodsMap, []);
|
|
@@ -29,7 +29,7 @@ export default function AddComparisonDrawer() {
|
|
|
29
29
|
const onSubmit = React.useCallback(() => {
|
|
30
30
|
controller.run(async s => {
|
|
31
31
|
if (!good) return
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
try {
|
|
34
34
|
const values = await form.validateFields()
|
|
35
35
|
const shorthand = s.goodsListState.isMyShow ? getSN(good.itemNameSelf)?.shorthand : getSN(good.itemName)?.shorthand;
|
|
@@ -4,8 +4,8 @@ import { decorator } from 'grey-react-box';
|
|
|
4
4
|
import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
|
|
5
5
|
import ImportBuyerButton from './ui/ImportBuyerButton';
|
|
6
6
|
import BuyerNameInput from './ui/BuyerNameInput';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import { IFormItem } from '../../../InvoiceController/InvoiceControllerState/BuyerState';
|
|
8
|
+
import Invoice from '../../..';
|
|
9
9
|
import './index.less';
|
|
10
10
|
|
|
11
11
|
const { Text } = Typography;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Popover, Input, Divider, Spin, Empty } from 'kts-components-antd-x3';
|
|
4
|
-
import Invoice from '
|
|
5
|
-
import { IBuyerInfo } from '
|
|
4
|
+
import Invoice from '../../../../..';
|
|
5
|
+
import { IBuyerInfo } from '../../../../../InvoiceController/InvoiceControllerState/BuyerState';
|
|
6
6
|
|
|
7
7
|
export interface IBuyerNameInputProps {
|
|
8
8
|
value?: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Invoice from '
|
|
2
|
+
import Invoice from '../../..';
|
|
3
3
|
import { Button, Drawer, Select, Modal, Input as InputAntd, Form, Tree, message } from 'kts-components-antd-x3';
|
|
4
4
|
import { chain, bignumber } from 'mathjs';
|
|
5
5
|
import { Input, NumberPicker } from '@formily/antd-components';
|
|
6
6
|
import { format15 } from '../GoodsList/hook/useColumns/autoFillFn';
|
|
7
|
-
import { LineAttributeType } from '
|
|
8
|
-
import IGood from '
|
|
9
|
-
import { countTaxAmount } from '
|
|
10
|
-
import { bytesLnegth, cutStr } from '
|
|
7
|
+
import { LineAttributeType } from '../../../InvoiceController';
|
|
8
|
+
import IGood from '../../../InvoiceController/InvoiceControllerState/GoodsListState/IGood';
|
|
9
|
+
import { countTaxAmount } from '../../../tools/calculate';
|
|
10
|
+
import { bytesLnegth, cutStr } from '../../../tools/strringFn';
|
|
11
11
|
import {
|
|
12
12
|
SchemaForm,
|
|
13
13
|
FormButtonGroup,
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* 税额 小数点后 2位
|
|
6
6
|
*/
|
|
7
7
|
import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
|
|
8
|
-
import InvoiceController, { IGood, LineAttributeType } from '
|
|
9
|
-
import evaluate from '
|
|
8
|
+
import InvoiceController, { IGood, LineAttributeType } from '../../../../../../InvoiceController';
|
|
9
|
+
import evaluate from '../../../../../../tools/evaluate';
|
|
10
10
|
import { message } from 'kts-components-antd-x3'
|
|
11
|
-
import { format2, format15, countTaxAmount, countAmountExcludeTax, countPrice } from '
|
|
11
|
+
import { format2, format15, countTaxAmount, countAmountExcludeTax, countPrice } from '../../../../../../tools/calculate';
|
|
12
12
|
import moment from 'moment';
|
|
13
13
|
|
|
14
|
-
export { format2, format15 } from '
|
|
14
|
+
export { format2, format15 } from '../../../../../../tools/calculate';
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|