kts-component-invoice-operate 3.1.20 → 3.2.0
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/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/{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 +7 -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 +7 -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 +6302 -189
- package/dist/index.js +6288 -174
- 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/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 +19 -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 +74 -19
- 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 +623 -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 +19 -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 +181 -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 +321 -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 +237 -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/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 +123 -0
- package/src/index.ts +3 -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/{Buyer → 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 → 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 → 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/{GoodsList → default/GoodsList}/ui/TaxIncludedSwitch/index.d.ts +0 -0
- /package/dist/Invoice/ui/{ImportBuyerDrawer → default/ImportBuyerDrawer}/index.d.ts +0 -0
- /package/dist/Invoice/ui/{ImportGoodsDrawer → default/ImportGoodsDrawer}/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
package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** 添加商品对照 */
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Menu, message, Typography } from 'kts-components-antd-x3';
|
|
5
|
+
import { IGood, LineAttributeType } from '../../../../../../../../InvoiceController';
|
|
6
|
+
import Invoice from '../../../../../../../../';
|
|
7
|
+
|
|
8
|
+
const { Text } = Typography;
|
|
9
|
+
|
|
10
|
+
export default (goods: IGood) => {
|
|
11
|
+
|
|
12
|
+
const controller = Invoice.useInvoiceController();
|
|
13
|
+
|
|
14
|
+
const productComparison = controller.useMemo(s => s.goodsListState.productComparison, []);
|
|
15
|
+
|
|
16
|
+
const onClick = React.useCallback(async () => {
|
|
17
|
+
await controller.saveEditGood();
|
|
18
|
+
await controller.wait();
|
|
19
|
+
await controller.run(async s => {
|
|
20
|
+
if (s.goodsListState.form) {
|
|
21
|
+
const err: any = s.goodsListState.form.getFieldsError();
|
|
22
|
+
for (let key in err) {
|
|
23
|
+
if (!err[key]) continue;
|
|
24
|
+
message.error(err[key][0]);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
s.goodsListState.addComparisonIndex = goods.$index;
|
|
29
|
+
})
|
|
30
|
+
}, [controller, goods.$index]);
|
|
31
|
+
|
|
32
|
+
if (!(goods.lineAttribute !== LineAttributeType.折扣行)) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return React.useMemo(() => {
|
|
37
|
+
if (productComparison.onComply) {
|
|
38
|
+
return <Menu.Item key="delItem" onClick={onClick}><Text strong>添加商品对照</Text></Menu.Item>
|
|
39
|
+
} else {
|
|
40
|
+
return <></>
|
|
41
|
+
}
|
|
42
|
+
}, [onClick, productComparison])
|
|
43
|
+
};
|
package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Menu, message, Typography } from 'kts-components-antd-x3';
|
|
4
|
+
import { IGood, LineAttributeType } from '../../../../../../../../../InvoiceController';
|
|
5
|
+
import Invoice from '../../../../../../../../..';
|
|
6
|
+
|
|
7
|
+
const { Text } = Typography;
|
|
8
|
+
|
|
9
|
+
export default (goods: IGood) => {
|
|
10
|
+
|
|
11
|
+
const controller = Invoice.useInvoiceController();
|
|
12
|
+
|
|
13
|
+
const model = controller.useMemo(s => s.model, [])
|
|
14
|
+
|
|
15
|
+
/** 是否能添加折扣行 */
|
|
16
|
+
const isAddDiscount = controller.useMemo(s => s.goodsListState.isAddDiscount, [])
|
|
17
|
+
|
|
18
|
+
/** 点击了 添加折扣行 按钮 */
|
|
19
|
+
const onClick = React.useCallback(async e => {
|
|
20
|
+
e.stopPropagation()
|
|
21
|
+
await controller.wait();
|
|
22
|
+
await controller.saveEditGood();
|
|
23
|
+
await controller.run(async s => {
|
|
24
|
+
if (s.goodsListState.form && s.goodsListState.editGood?.$index === goods?.$index) {
|
|
25
|
+
const err: any = s.goodsListState.form.getFieldsError();
|
|
26
|
+
for (let key in err) {
|
|
27
|
+
if (!err[key]) continue;
|
|
28
|
+
message.error(err[key][0]);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
goods = s.goodsListState.goodsMap.get(goods.$index) as any;
|
|
33
|
+
if (goods.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !goods.taxFreeType) {
|
|
34
|
+
message.error({ content: '零税率需要设置免税类型,请在赋码中设置!', key: '零税率需要设置免税类型,请在赋码中设置!' });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (`${goods.lineAmountIncludeTax}` === '0') {
|
|
38
|
+
message.error({ content: '金额为0不能添加折扣行', key: '金额为0不能添加折扣行' });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
s.goodsListState.discountGoodIndex = [goods.$index];
|
|
42
|
+
})
|
|
43
|
+
}, [controller, goods.$index]);
|
|
44
|
+
|
|
45
|
+
if (goods.lineAttribute !== LineAttributeType.正常) {
|
|
46
|
+
return undefined
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!(model !== 'prefab')) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!(isAddDiscount !== false)) {
|
|
54
|
+
return undefined
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (goods.lineAttribute !== LineAttributeType.正常) {
|
|
58
|
+
return undefined
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
key:'addDiscount',
|
|
63
|
+
title:'折扣',
|
|
64
|
+
onClick,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// return React.useMemo(() => {
|
|
68
|
+
// if (goods.lineAttribute !== LineAttributeType.正常) {
|
|
69
|
+
// return undefined
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
|
+
// return (
|
|
73
|
+
// <Menu.Item key="addDiscount" onClick={onClick}><Text strong>折扣</Text></Menu.Item>
|
|
74
|
+
// );
|
|
75
|
+
// }, [onClick, goods.lineAttribute]);
|
|
76
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
// import { Menu, Typography } from 'kts-components-antd-x3';
|
|
3
|
+
import { IGood, LineAttributeType } from '../../../../../../../../../InvoiceController';
|
|
4
|
+
import Invoice from '../../../../../../../../..';
|
|
5
|
+
|
|
6
|
+
// const { Text } = Typography;
|
|
7
|
+
|
|
8
|
+
export default (goods: IGood) => {
|
|
9
|
+
|
|
10
|
+
const controller = Invoice.useInvoiceController();
|
|
11
|
+
|
|
12
|
+
const model = controller.useMemo(s => s.model, [])
|
|
13
|
+
|
|
14
|
+
const isRemRow = controller.useMemo(s => s.goodsListState.isRemRow, [])
|
|
15
|
+
|
|
16
|
+
const onClick = React.useCallback(() => {
|
|
17
|
+
controller.delGood(goods.$index);
|
|
18
|
+
}, [controller, goods.$index]);
|
|
19
|
+
|
|
20
|
+
if (goods.lineAttribute === LineAttributeType.被折扣行) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if(isRemRow === false) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!(model !== 'prefab')) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
key:'delItem',
|
|
34
|
+
title:'删除',
|
|
35
|
+
onClick,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// return React.useMemo(() => {
|
|
39
|
+
// return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
|
|
40
|
+
// }, [onClick])
|
|
41
|
+
};
|
package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
// import { Button } from 'kts-components-antd-x3';
|
|
3
|
+
import Invoice from '../../../../../../../../..';
|
|
4
|
+
import { IGood } from '../../../../../../../../../InvoiceController';
|
|
5
|
+
import { endowCode } from '../../../../autoFillFn';
|
|
6
|
+
|
|
7
|
+
// const { Text } = Typography;
|
|
8
|
+
|
|
9
|
+
export default (goods: IGood) => {
|
|
10
|
+
|
|
11
|
+
const controller = Invoice.useInvoiceController();
|
|
12
|
+
|
|
13
|
+
const onClick = React.useCallback(async () => {
|
|
14
|
+
endowCode(controller, goods);
|
|
15
|
+
}, [controller, goods]);
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
key: 'endowCode',
|
|
19
|
+
title: '赋码',
|
|
20
|
+
onClick,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// return React.useMemo(() => {
|
|
24
|
+
// return (
|
|
25
|
+
// <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
|
|
26
|
+
// );
|
|
27
|
+
// }, [goods.lineAttribute, onClick])
|
|
28
|
+
|
|
29
|
+
// return React.useMemo(() => {
|
|
30
|
+
// return (
|
|
31
|
+
// <Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
|
|
32
|
+
// );
|
|
33
|
+
// }, [goods.lineAttribute, onClick])
|
|
34
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:focus,
|
|
2
|
+
.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,
|
|
3
|
+
.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu {
|
|
4
|
+
font-size: 16px;
|
|
5
|
+
color: #000;
|
|
6
|
+
text-align: center;
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,
|
|
10
|
+
.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu.ktsAnt3x-dropdown-open{
|
|
11
|
+
background: #ebebeb;
|
|
12
|
+
border-radius: 9999px;
|
|
13
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Menu, Dropdown, Icon, Typography } from 'kts-components-antd-x3';
|
|
3
|
+
import Invoice from '../../../../../../..';
|
|
4
|
+
import { IGood } from '../../../../../../../InvoiceController';
|
|
5
|
+
import { ReactComponent as SpotSvg } from './spot.svg';
|
|
6
|
+
|
|
7
|
+
import useDelItem from './hook/useDelItem';
|
|
8
|
+
import useAddDiscount from './hook/useAddDiscount';
|
|
9
|
+
import useEndowCode from './hook/useEndowCode';
|
|
10
|
+
// import useAddComparison from './hook/useAddComparison';
|
|
11
|
+
|
|
12
|
+
import './index.less';
|
|
13
|
+
|
|
14
|
+
const { Text } = Typography;
|
|
15
|
+
|
|
16
|
+
export default (props: { goods: IGood }) => {
|
|
17
|
+
|
|
18
|
+
const controller = Invoice.useInvoiceController();
|
|
19
|
+
|
|
20
|
+
const model = controller.useMemo(s => s.model, [])
|
|
21
|
+
|
|
22
|
+
/** 是否能添加折扣行 */
|
|
23
|
+
const isAddDiscount = controller.useMemo(s => s.goodsListState.isAddDiscount, [])
|
|
24
|
+
|
|
25
|
+
const goodsMenuExpand = controller.useMemo(s => s.goodsListState.goodsMenuExpand, []);
|
|
26
|
+
|
|
27
|
+
const delItem = useDelItem(props.goods);
|
|
28
|
+
const addDiscount = useAddDiscount(props.goods);
|
|
29
|
+
const endowCode = useEndowCode(props.goods);
|
|
30
|
+
// const addComparison = useAddComparison(props.goods);
|
|
31
|
+
|
|
32
|
+
const itemList = React.useMemo(() => {
|
|
33
|
+
const arr: any[] = [];
|
|
34
|
+
|
|
35
|
+
endowCode && arr.push(endowCode); // 赋码
|
|
36
|
+
addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
37
|
+
delItem && arr.push(delItem); // 删除
|
|
38
|
+
|
|
39
|
+
// addComparison && arr.push(addComparison); // 添加商品对照
|
|
40
|
+
|
|
41
|
+
if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
|
|
42
|
+
|
|
43
|
+
arr.unshift(<Menu.Divider key="divider-1" />);
|
|
44
|
+
|
|
45
|
+
for (let i = goodsMenuExpand.length - 1; i >= 0; i--) {
|
|
46
|
+
const fn = goodsMenuExpand[i];
|
|
47
|
+
arr.unshift(fn(props.goods.$index, controller));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return arr;
|
|
51
|
+
}, [controller, endowCode, addDiscount, delItem, goodsMenuExpand, props.goods, model, isAddDiscount])
|
|
52
|
+
|
|
53
|
+
const overlay = React.useMemo(() => {
|
|
54
|
+
if (itemList.length <= 2) {
|
|
55
|
+
return undefined
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Menu>
|
|
60
|
+
{itemList.slice(2).map(e => {
|
|
61
|
+
return <Menu.Item key={e.key} onClick={e.onClick} ><Text strong>{e.title}</Text></Menu.Item>
|
|
62
|
+
})}
|
|
63
|
+
</Menu>
|
|
64
|
+
)
|
|
65
|
+
}, [itemList])
|
|
66
|
+
|
|
67
|
+
const buttonList = React.useMemo(() => {
|
|
68
|
+
return (
|
|
69
|
+
<div style={{ flex: 1, textAlign: 'left', display: 'flex', gap: 10 }} >
|
|
70
|
+
{
|
|
71
|
+
itemList.slice(0, 2).map(e => {
|
|
72
|
+
return (
|
|
73
|
+
<Button key={e.key} type='link' onClick={e.onClick} style={{ padding: 0 }} >
|
|
74
|
+
{e.title}
|
|
75
|
+
</Button>
|
|
76
|
+
)
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}, [itemList])
|
|
82
|
+
|
|
83
|
+
if (itemList.length === 0) { return (<></>) }
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<span style={{ padding: '0 0 0 10px', display: 'flex' }}>
|
|
87
|
+
{buttonList}
|
|
88
|
+
{
|
|
89
|
+
overlay &&
|
|
90
|
+
<Dropdown overlay={overlay} trigger={['click']}>
|
|
91
|
+
<Button className="kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only" type="link">
|
|
92
|
+
<Icon component={SpotSvg} />
|
|
93
|
+
</Button>
|
|
94
|
+
</Dropdown>
|
|
95
|
+
}
|
|
96
|
+
</span>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1574652728953" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4119" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M512 512m-96 0a1.5 1.5 0 1 0 192 0 1.5 1.5 0 1 0-192 0Z" p-id="4120"></path><path d="M512 96.64m-96 0a1.5 1.5 0 1 0 192 0 1.5 1.5 0 1 0-192 0Z" p-id="4121"></path><path d="M512 927.36m-96 0a1.5 1.5 0 1 0 192 0 1.5 1.5 0 1 0-192 0Z" p-id="4122"></path></svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from 'kts-components-antd-x3';
|
|
3
|
+
import Invoice from '../../../../../../';
|
|
4
|
+
import { IGood } from '../../../../../../InvoiceController';
|
|
5
|
+
|
|
6
|
+
export default (props: { goods: IGood }) => {
|
|
7
|
+
const controller = Invoice.useInvoiceController();
|
|
8
|
+
|
|
9
|
+
const onClick = React.useCallback(() => {
|
|
10
|
+
controller.saveEditGood();
|
|
11
|
+
}, [controller]);
|
|
12
|
+
|
|
13
|
+
return <Button type="link" icon="save" onClick={onClick} />;
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Typography } from 'kts-components-antd-x3';
|
|
4
|
+
import { ValidationRule } from 'kts-components-antd-x3/lib/form';
|
|
5
|
+
|
|
6
|
+
const { Text } = Typography;
|
|
7
|
+
|
|
8
|
+
export default (props: { children?: React.ReactNode, required?: boolean, rules?: ValidationRule[] }) => {
|
|
9
|
+
|
|
10
|
+
const { rules, children } = props;
|
|
11
|
+
|
|
12
|
+
const required = React.useMemo(() => rules?.some(e => !!e.required) || props.required, [rules, props.required]);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{required ? <Text type="danger">*</Text> : <></>}
|
|
17
|
+
{children}
|
|
18
|
+
</>
|
|
19
|
+
)
|
|
20
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表格行事件
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import Invoice from '../../../../..';
|
|
7
|
+
import IGood from '../../../../../InvoiceController/InvoiceControllerState/GoodsListState/IGood';
|
|
8
|
+
import { LineAttributeType } from '../../../../../InvoiceController';
|
|
9
|
+
|
|
10
|
+
export default () => {
|
|
11
|
+
/** 控制器 */
|
|
12
|
+
const controller = Invoice.useInvoiceController();
|
|
13
|
+
|
|
14
|
+
const model = controller.useMemo(s => s.model, []);
|
|
15
|
+
|
|
16
|
+
const onClick = React.useCallback(
|
|
17
|
+
async (record: IGood) => {
|
|
18
|
+
if (model === 'prefab') return;
|
|
19
|
+
if (model === 'readOnly') return;
|
|
20
|
+
|
|
21
|
+
const editGood = controller.state.goodsListState.editGood;
|
|
22
|
+
if (record.lineAttribute !== LineAttributeType.正常) return;
|
|
23
|
+
|
|
24
|
+
if (editGood) {
|
|
25
|
+
if (editGood.$index === record.$index) return;
|
|
26
|
+
await controller.saveEditGood();
|
|
27
|
+
await controller.wait();
|
|
28
|
+
await controller.pipeline(async s => { s.goodsListState.editGood || (await controller.setEditGood(record)) })();
|
|
29
|
+
} else {
|
|
30
|
+
await controller.setEditGood(record);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
[controller, model],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
onClick,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Checkbox } from 'kts-components-antd-x3';
|
|
4
|
+
import { LineAttributeType } from '../../../../../InvoiceController';
|
|
5
|
+
import Invoice from '../../../../..';
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
8
|
+
|
|
9
|
+
/** 控制器 */
|
|
10
|
+
const controller = Invoice.useInvoiceController();
|
|
11
|
+
|
|
12
|
+
/** 列表选中的货物索引列表 */
|
|
13
|
+
const selectedRowKeys = controller.useMemo(s => s.goodsListState.selectedGoodIndex, []);
|
|
14
|
+
|
|
15
|
+
/** 货物列表 */
|
|
16
|
+
const goodsList = controller.useMemo(s => s.goodsListState.goodsList, []);
|
|
17
|
+
|
|
18
|
+
/** 搜索条件 */
|
|
19
|
+
const searchValue = controller.useMemo(s => s.goodsListState.searchValue, []);
|
|
20
|
+
|
|
21
|
+
/** 是否全选 */
|
|
22
|
+
// const isAll = controller.useMemo(s => s.goodsListState.goodsList.length > 0 && s.goodsListState.selectedGoodIndex.length === s.goodsListState.goodsList.length, [])
|
|
23
|
+
const isAll = controller.useMemo(s => {
|
|
24
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return false;
|
|
25
|
+
const seeGoodsIndex = controller.getGoodsSearch(s.goodsListState.goodsList, s.goodsListState.searchValue, s.goodsListState.isTaxIncluded).map(e => e.$index);
|
|
26
|
+
const selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e => seeGoodsIndex.some(t => e === t));
|
|
27
|
+
return selectedGoodIndex.length === seeGoodsIndex.length
|
|
28
|
+
}, [])
|
|
29
|
+
|
|
30
|
+
const indeterminate = controller.useMemo(s => {
|
|
31
|
+
const seeGoodsIndex = controller.getGoodsSearch(s.goodsListState.goodsList, s.goodsListState.searchValue, s.goodsListState.isTaxIncluded).map(e => e.$index);
|
|
32
|
+
const selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e => seeGoodsIndex.some(t => e === t));
|
|
33
|
+
if (selectedGoodIndex.length === 0) return false;
|
|
34
|
+
return selectedGoodIndex.length < seeGoodsIndex.length
|
|
35
|
+
}, [])
|
|
36
|
+
|
|
37
|
+
/** 点击了全选 */
|
|
38
|
+
const onClickSelectAll = React.useCallback(async () => {
|
|
39
|
+
if (isAll) {
|
|
40
|
+
await controller.pipeline(async s => {
|
|
41
|
+
const seeGoodsIndex = controller.getGoodsSearch(s.goodsListState.goodsList, s.goodsListState.searchValue, s.goodsListState.isTaxIncluded).map(e => e.$index)
|
|
42
|
+
|
|
43
|
+
s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e=>!seeGoodsIndex.some(t => e === t));
|
|
44
|
+
})()
|
|
45
|
+
} else {
|
|
46
|
+
await controller.pipeline(async s => {
|
|
47
|
+
const seeGoodsIndex = controller.getGoodsSearch(s.goodsListState.goodsList, s.goodsListState.searchValue, s.goodsListState.isTaxIncluded).map(e => e.$index)
|
|
48
|
+
|
|
49
|
+
s.goodsListState.selectedGoodIndex = [...s.goodsListState.selectedGoodIndex, ...seeGoodsIndex];
|
|
50
|
+
s.goodsListState.selectedGoodIndex = Array.from(new Set(s.goodsListState.selectedGoodIndex));
|
|
51
|
+
})()
|
|
52
|
+
}
|
|
53
|
+
await sortOut(true);
|
|
54
|
+
}, [controller, isAll])
|
|
55
|
+
|
|
56
|
+
const onSelect = React.useCallback(async (record, selected) => {
|
|
57
|
+
if (selected) {
|
|
58
|
+
await controller.pipeline(async s => {
|
|
59
|
+
s.goodsListState.selectedGoodIndex = [...s.goodsListState.selectedGoodIndex, record.$index];
|
|
60
|
+
s.goodsListState = { ...s.goodsListState };
|
|
61
|
+
})()
|
|
62
|
+
} else {
|
|
63
|
+
await controller.pipeline(async s => {
|
|
64
|
+
s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e => e !== record.$index);
|
|
65
|
+
s.goodsListState = { ...s.goodsListState };
|
|
66
|
+
})()
|
|
67
|
+
}
|
|
68
|
+
await sortOut(selected);
|
|
69
|
+
}, [controller])
|
|
70
|
+
|
|
71
|
+
const columnTitle = React.useMemo(() => {
|
|
72
|
+
return (
|
|
73
|
+
<Checkbox
|
|
74
|
+
onChange={onClickSelectAll}
|
|
75
|
+
indeterminate={indeterminate}
|
|
76
|
+
checked={isAll}
|
|
77
|
+
></Checkbox>
|
|
78
|
+
)
|
|
79
|
+
}, [goodsList, selectedRowKeys, onClickSelectAll, isAll, indeterminate])
|
|
80
|
+
|
|
81
|
+
/** 选择了商品后 调整 折扣行 和 被折扣行 */
|
|
82
|
+
const sortOut = React.useCallback(async (selected: boolean) => {
|
|
83
|
+
await controller.wait();
|
|
84
|
+
await controller.pipeline(async s => {
|
|
85
|
+
s.goodsListState.selectedGoodIndex.forEach($index => {
|
|
86
|
+
const goods = s.goodsListState.goodsMap.get($index);
|
|
87
|
+
if (!goods || goods.lineAttribute === LineAttributeType.正常) return;
|
|
88
|
+
|
|
89
|
+
// 数组位置
|
|
90
|
+
let t = s.goodsListState.goodsList.indexOf(goods);
|
|
91
|
+
goods.lineAttribute === LineAttributeType.折扣行 ? t : t++;
|
|
92
|
+
const i = s.goodsListState.goodsList[t].$index;
|
|
93
|
+
if (selected) {
|
|
94
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(i) < 0) s.goodsListState.selectedGoodIndex = [...s.goodsListState.selectedGoodIndex, i];
|
|
95
|
+
} else {
|
|
96
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(i) < 0) s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(e => e !== $index);
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
})()
|
|
100
|
+
}, [controller])
|
|
101
|
+
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
sortOut(true);
|
|
104
|
+
}, [sortOut, goodsList])
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
columnWidth: 45,
|
|
108
|
+
columnTitle,
|
|
109
|
+
onSelect,
|
|
110
|
+
selectedRowKeys,
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* 点击组件外部 保存正在编辑的货物
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { InvoiceController } from "../../../../../..";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 点击组件外部 保存正在编辑的货物
|
|
11
|
+
*/
|
|
12
|
+
export default function useWindowClick(controller: InvoiceController) {
|
|
13
|
+
|
|
14
|
+
/** 点击组件外部 保存正在编辑的货物 */
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
const click = () => { setTimeout(controller.saveEditGood) };
|
|
17
|
+
|
|
18
|
+
window.addEventListener('click', click);
|
|
19
|
+
return () => {
|
|
20
|
+
window.removeEventListener('click', click);
|
|
21
|
+
};
|
|
22
|
+
}, [controller]);
|
|
23
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.kts-invoice-operate-goods-list-digtal {
|
|
2
|
+
|
|
3
|
+
.goods-list-digtal-discount-tag {
|
|
4
|
+
display : inline-block;
|
|
5
|
+
height : 20px;
|
|
6
|
+
line-height : 20px;
|
|
7
|
+
border : 1px solid;
|
|
8
|
+
padding : 0 5px;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.kts-invoice-operate-goods-list-table-tax-rate {
|
|
13
|
+
.ktsAnt3x-select-selection-selected-value {
|
|
14
|
+
float: right;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.kts-invoice-operate-goods-list-able {
|
|
19
|
+
display : flex;
|
|
20
|
+
padding : 10px;
|
|
21
|
+
border-bottom: 2px solid #9F613E;
|
|
22
|
+
gap : 10px;
|
|
23
|
+
align-items : center;
|
|
24
|
+
height : 48px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ktsAntX-table {
|
|
28
|
+
|
|
29
|
+
.ktsAntX-table-row.kts-invoice-operate-goods-be-discount .ktsAntX-table-cell {
|
|
30
|
+
color: #f00;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// .ktsAntX-table-row.kts-invoice-operate-goods-discount .ktsAntX-table-cell {
|
|
34
|
+
// background: #f5f5f5;
|
|
35
|
+
// }
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.kts-invoice-operate-goods-list-table-digtal {
|
|
40
|
+
|
|
41
|
+
.ktsAnt3x-form-item-control.has-error {
|
|
42
|
+
border: 1px solid #f00;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab {
|
|
46
|
+
.ktsAnt3x-table-row {
|
|
47
|
+
color : rgba(0, 0, 0, 0.25);
|
|
48
|
+
background: #f5f5f5;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kts-invoice-operate-goods-list-table-search-protrude {
|
|
53
|
+
background : #ff0;
|
|
54
|
+
color : #000;
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
}
|
|
57
|
+
}
|