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.
Files changed (286) hide show
  1. package/dist/Invoice/Invoice-digtal/_test/disabled/index.d.ts +4 -0
  2. package/dist/Invoice/Invoice-digtal/_test/easiest/index.d.ts +4 -0
  3. package/dist/Invoice/Invoice-digtal/_test/header/index.d.ts +4 -0
  4. package/dist/Invoice/Invoice-digtal/_test/importStakeholder/index.d.ts +4 -0
  5. package/dist/Invoice/Invoice-digtal/_test/readOnly/index.d.ts +4 -0
  6. package/dist/Invoice/Invoice-digtal/_test/stakeholder/index.d.ts +4 -0
  7. package/dist/Invoice/Invoice-digtal/_test/typeSelection/index.d.ts +4 -0
  8. package/dist/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.d.ts +10 -0
  9. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +6 -0
  10. package/dist/Invoice/InvoiceController/fns/addGoodDiscount.d.ts +1 -1
  11. package/dist/Invoice/InvoiceController/fns/addGoodDiscountV2.d.ts +12 -0
  12. package/dist/Invoice/InvoiceController/fns/delGood.d.ts +1 -1
  13. package/dist/Invoice/InvoiceController/index.d.ts +2 -0
  14. package/dist/Invoice/index.d.ts +25 -12
  15. package/dist/Invoice/tools/mounting/index.d.ts +3 -0
  16. package/dist/Invoice/{ui/GoodsList/hook → tools}/useToGenerateId/index.d.ts +1 -1
  17. package/dist/Invoice/ui/{Buyer → default/Buyer}/index.d.ts +1 -1
  18. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/autoFillFn/index.d.ts +2 -2
  19. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +0 -1
  20. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -1
  21. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -1
  22. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +1 -1
  23. package/dist/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
  24. package/dist/Invoice/ui/default/GoodsList/hook/useDeduction/index.d.ts +8 -0
  25. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useOnRow/index.d.ts +1 -1
  26. package/dist/Invoice/ui/default/GoodsList/hook/useWindowClick/index.d.ts +8 -0
  27. package/dist/Invoice/ui/default/ImportGoodsDrawer/index.d.ts +3 -0
  28. package/dist/Invoice/ui/{Seller → default/Seller}/index.d.ts +1 -1
  29. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.d.ts +35 -0
  30. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/index.d.ts +3 -0
  31. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +8 -0
  32. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.d.ts +6 -0
  33. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +4 -0
  34. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +7 -0
  35. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +7 -0
  36. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +7 -0
  37. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
  38. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.d.ts +6 -0
  39. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  40. package/dist/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.d.ts +8 -0
  41. package/dist/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.d.ts +8 -0
  42. package/dist/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.d.ts +8 -0
  43. package/dist/Invoice/ui/digtal/GoodsList/index.d.ts +17 -0
  44. package/dist/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.d.ts +3 -0
  45. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +5 -0
  46. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +5 -0
  47. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
  48. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
  49. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +6 -0
  50. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.d.ts +5 -0
  51. package/dist/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.d.ts +3 -0
  52. package/dist/Invoice/ui/digtal/GoodsList/ui/Search/index.d.ts +3 -0
  53. package/dist/Invoice/ui/digtal/GoodsList/ui/Statistics/index.d.ts +4 -0
  54. package/dist/Invoice/ui/digtal/GoodsList/ui/TableRow/index.d.ts +2 -0
  55. package/dist/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.d.ts +4 -0
  56. package/dist/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.d.ts +4 -0
  57. package/dist/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.d.ts +3 -0
  58. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.d.ts +35 -0
  59. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.d.ts +3 -0
  60. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.d.ts +7 -0
  61. package/dist/Invoice/ui/{GoodsList/hook/useColumns/ui/RowMenu → digtal/GoodsList.o/hook/useColumns/ui/RowEditButton}/index.d.ts +0 -1
  62. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +4 -0
  63. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +7 -0
  64. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +7 -0
  65. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +7 -0
  66. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
  67. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.d.ts +6 -0
  68. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  69. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.d.ts +8 -0
  70. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.d.ts +8 -0
  71. package/dist/Invoice/ui/digtal/GoodsList.o/index.d.ts +20 -0
  72. package/dist/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.d.ts +3 -0
  73. package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.d.ts +2 -0
  74. package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.d.ts +4 -0
  75. package/dist/Invoice/ui/digtal/InvoiceHeader/index.d.ts +14 -0
  76. package/dist/Invoice/ui/digtal/Sign/index.d.ts +10 -0
  77. package/dist/Invoice/ui/digtal/Stakeholder/index.d.ts +12 -0
  78. package/dist/InvoiceTypeModal/_test/easiest/index.d.ts +3 -0
  79. package/dist/InvoiceTypeModal/index.d.ts +34 -0
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.esm.js +6379 -189
  82. package/dist/index.js +6365 -174
  83. package/docs-dist/404.html +33 -33
  84. package/docs-dist/index.html +33 -33
  85. package/docs-dist/static/add.a70623b4.svg +12 -0
  86. package/docs-dist/static/arrowDown.a1cbf0d8.svg +3 -0
  87. package/docs-dist/static/arrowUp.4c482054.svg +3 -0
  88. package/docs-dist/static/fork.5431267d.svg +12 -0
  89. package/docs-dist/umi.css +19 -19
  90. package/docs-dist/umi.js +1 -1
  91. package/package.json +1 -1
  92. package/src/Invoice/Invoice-digtal/_test/disabled/index.tsx +38 -0
  93. package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +5 -0
  94. package/src/Invoice/Invoice-digtal/_test/header/index.tsx +17 -0
  95. package/src/Invoice/Invoice-digtal/_test/importGoods/index.tsx +471 -0
  96. package/src/Invoice/Invoice-digtal/_test/importStakeholder/index.tsx +17 -0
  97. package/src/Invoice/Invoice-digtal/_test/readOnly/index.tsx +42 -0
  98. package/src/Invoice/Invoice-digtal/_test/stakeholder/index.tsx +12 -0
  99. package/src/Invoice/Invoice-digtal/_test/typeSelection/index.tsx +29 -0
  100. package/src/Invoice/Invoice-digtal/index.md +25 -0
  101. package/src/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.ts +11 -0
  102. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +8 -0
  103. package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +1 -1
  104. package/src/Invoice/InvoiceController/fns/addGoodDiscountV2.ts +84 -0
  105. package/src/Invoice/InvoiceController/fns/delGood.ts +26 -28
  106. package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -0
  107. package/src/Invoice/InvoiceController/index.ts +4 -0
  108. package/src/Invoice/_test/buyerNameSearch/index.tsx +2 -2
  109. package/src/Invoice/_test/easiest/index.tsx +1 -1
  110. package/src/Invoice/_test/endowCode/index.tsx +4 -4
  111. package/src/Invoice/_test/goodsMenuExpand/index.tsx +1 -1
  112. package/src/Invoice/_test/importBuyer/index.tsx +1 -1
  113. package/src/Invoice/_test/importGoods/index.tsx +1 -1
  114. package/src/Invoice/_test/invoiceType/index.tsx +1 -1
  115. package/src/Invoice/_test/seller/index.tsx +1 -1
  116. package/src/Invoice/_test/setDataSource/index.tsx +1 -1
  117. package/src/Invoice/_test/unit/index.tsx +1 -1
  118. package/src/Invoice/index.less +19 -1
  119. package/src/Invoice/index.md +6 -6
  120. package/src/Invoice/index.tsx +75 -18
  121. package/src/Invoice/tools/mounting/index.ts +14 -0
  122. package/src/Invoice/{ui/GoodsList/hook → tools}/useToGenerateId/index.ts +1 -1
  123. package/src/Invoice/ui/{AddComparisonDrawer → default/AddComparisonDrawer}/index.tsx +5 -5
  124. package/src/Invoice/ui/{Buyer → default/Buyer}/index.tsx +2 -2
  125. package/src/Invoice/ui/{Buyer → default/Buyer}/ui/BuyerNameInput/index.tsx +2 -2
  126. package/src/Invoice/ui/{Buyer → default/Buyer}/ui/ImportBuyerButton/index.tsx +1 -1
  127. package/src/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.tsx +5 -5
  128. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/autoFillFn/index.ts +4 -4
  129. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/index.tsx +3 -3
  130. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +2 -2
  131. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +2 -2
  132. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +3 -3
  133. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/index.tsx +2 -2
  134. package/src/Invoice/ui/default/GoodsList/hook/useDeduction/index.tsx +24 -0
  135. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useOnRow/index.tsx +3 -3
  136. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useRowSelection/index.tsx +2 -2
  137. package/src/Invoice/ui/default/GoodsList/hook/useWindowClick/index.tsx +23 -0
  138. package/src/Invoice/ui/{GoodsList → default/GoodsList}/index.tsx +2 -2
  139. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/AddRowButton/index.tsx +2 -2
  140. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +4 -4
  141. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useDelRowButton/index.tsx +2 -2
  142. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +2 -2
  143. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/DescribeSwitch/index.tsx +1 -1
  144. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.tsx +1 -1
  145. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.tsx +1 -1
  146. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableRow/index.tsx +2 -2
  147. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TaxIncludedSwitch/index.tsx +1 -1
  148. package/src/Invoice/ui/{ImportBuyerDrawer → default/ImportBuyerDrawer}/index.tsx +1 -1
  149. package/src/Invoice/ui/{ImportGoodsDrawer → default/ImportGoodsDrawer}/index.tsx +4 -4
  150. package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.tsx +1 -1
  151. package/src/Invoice/ui/{Seller → default/Seller}/index.tsx +2 -2
  152. package/src/Invoice/ui/{Sign → default/Sign}/index.tsx +1 -1
  153. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +520 -0
  154. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +636 -0
  155. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/svg/plus.svg +12 -0
  156. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.less +10 -0
  157. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +24 -0
  158. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.tsx +30 -0
  159. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -0
  160. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -0
  161. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -0
  162. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -0
  163. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.less +13 -0
  164. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +98 -0
  165. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/spot.svg +1 -0
  166. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.tsx +14 -0
  167. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.tsx +20 -0
  168. package/src/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.tsx +39 -0
  169. package/src/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.tsx +112 -0
  170. package/src/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.tsx +23 -0
  171. package/src/Invoice/ui/digtal/GoodsList/index.less +57 -0
  172. package/src/Invoice/ui/digtal/GoodsList/index.tsx +180 -0
  173. package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +66 -0
  174. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +320 -0
  175. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/svg/add.svg +12 -0
  176. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -0
  177. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
  178. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +35 -0
  179. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +82 -0
  180. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.tsx +56 -0
  181. package/src/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.tsx +37 -0
  182. package/src/Invoice/ui/digtal/GoodsList/ui/Search/icon/magnifier.svg +1 -0
  183. package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.less +12 -0
  184. package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.tsx +50 -0
  185. package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.less +54 -0
  186. package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +99 -0
  187. package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/svg/fork.svg +12 -0
  188. package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +28 -0
  189. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.less +39 -0
  190. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.tsx +109 -0
  191. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.less +44 -0
  192. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.tsx +96 -0
  193. package/src/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.tsx +31 -0
  194. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.ts +520 -0
  195. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.tsx +624 -0
  196. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.less +10 -0
  197. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.tsx +19 -0
  198. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowEditButton/index.tsx +30 -0
  199. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -0
  200. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -0
  201. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -0
  202. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -0
  203. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.less +13 -0
  204. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.tsx +98 -0
  205. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/spot.svg +1 -0
  206. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.tsx +14 -0
  207. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.tsx +20 -0
  208. package/src/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.tsx +39 -0
  209. package/src/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.tsx +112 -0
  210. package/src/Invoice/ui/digtal/GoodsList.o/index.less +7 -0
  211. package/src/Invoice/ui/digtal/GoodsList.o/index.tsx +132 -0
  212. package/src/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.tsx +66 -0
  213. package/src/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.tsx +28 -0
  214. package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.less +43 -0
  215. package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.tsx +109 -0
  216. package/src/Invoice/ui/digtal/InvoiceHeader/index.less +58 -0
  217. package/src/Invoice/ui/digtal/InvoiceHeader/index.tsx +77 -0
  218. package/src/Invoice/ui/digtal/Sign/index.less +49 -0
  219. package/src/Invoice/ui/digtal/Sign/index.tsx +90 -0
  220. package/src/Invoice/ui/digtal/Stakeholder/index.less +57 -0
  221. package/src/Invoice/ui/digtal/Stakeholder/index.tsx +260 -0
  222. package/src/Invoice/ui/digtal/Stakeholder/svg/arrowDown.svg +3 -0
  223. package/src/Invoice/ui/digtal/Stakeholder/svg/arrowUp.svg +3 -0
  224. package/src/Invoice/ui/digtal/Stakeholder/svg/plus.svg +12 -0
  225. package/src/InvoiceTypeModal/_test/easiest/index.tsx +32 -0
  226. package/src/InvoiceTypeModal/index.less +8 -0
  227. package/src/InvoiceTypeModal/index.md +6 -0
  228. package/src/InvoiceTypeModal/index.tsx +127 -0
  229. package/src/index.ts +3 -0
  230. /package/dist/Invoice/{ui/Buyer/ui/ImportBuyerButton → Invoice-digtal/_test/importGoods}/index.d.ts +0 -0
  231. /package/dist/Invoice/ui/{AddComparisonDrawer → default/AddComparisonDrawer}/index.d.ts +0 -0
  232. /package/dist/Invoice/ui/{Buyer → default/Buyer}/ui/BuyerNameInput/index.d.ts +0 -0
  233. /package/dist/Invoice/ui/{GoodsList/ui/AddRowButton → default/Buyer/ui/ImportBuyerButton}/index.d.ts +0 -0
  234. /package/dist/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.d.ts +0 -0
  235. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/index.d.ts +0 -0
  236. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.d.ts +0 -0
  237. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowEditButton/index.d.ts +0 -0
  238. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowSaveButton/index.d.ts +0 -0
  239. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/TitleText/index.d.ts +0 -0
  240. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useRowSelection/index.d.ts +0 -0
  241. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/index.d.ts +0 -0
  242. /package/dist/Invoice/ui/{GoodsList/ui/DescribeSwitch → default/GoodsList/ui/AddRowButton}/index.d.ts +0 -0
  243. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +0 -0
  244. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +0 -0
  245. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +0 -0
  246. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +0 -0
  247. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/index.d.ts +0 -0
  248. /package/dist/Invoice/ui/{GoodsList/ui/TaxIncludedSwitch → default/GoodsList/ui/DescribeSwitch}/index.d.ts +0 -0
  249. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.d.ts +0 -0
  250. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.d.ts +0 -0
  251. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableRow/index.d.ts +0 -0
  252. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.d.ts +0 -0
  253. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.d.ts +0 -0
  254. /package/dist/Invoice/ui/{ImportBuyerDrawer → default/GoodsList/ui/TaxIncludedSwitch}/index.d.ts +0 -0
  255. /package/dist/Invoice/ui/{ImportGoodsDrawer → default/ImportBuyerDrawer}/index.d.ts +0 -0
  256. /package/dist/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.d.ts +0 -0
  257. /package/dist/Invoice/ui/{Sign → default/Sign}/index.d.ts +0 -0
  258. /package/dist/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useDeduction/index.d.ts +0 -0
  259. /package/dist/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useWindowClick/index.d.ts +0 -0
  260. /package/src/Invoice/ui/{Buyer → default/Buyer}/index.less +0 -0
  261. /package/src/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.less +0 -0
  262. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.less +0 -0
  263. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.tsx +0 -0
  264. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowEditButton/index.tsx +0 -0
  265. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +0 -0
  266. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/index.less +0 -0
  267. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/spot.svg +0 -0
  268. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowSaveButton/index.tsx +0 -0
  269. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/TitleText/index.tsx +0 -0
  270. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/index.less +0 -0
  271. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.less +0 -0
  272. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +0 -0
  273. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/index.tsx +0 -0
  274. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/icon/magnifier.svg +0 -0
  275. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.less +0 -0
  276. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.less +0 -0
  277. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.less +0 -0
  278. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.tsx +0 -0
  279. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.less +0 -0
  280. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.tsx +0 -0
  281. /package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/auto.svg +0 -0
  282. /package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.less +0 -0
  283. /package/src/Invoice/ui/{Seller → default/Seller}/index.less +0 -0
  284. /package/src/Invoice/ui/{Sign → default/Sign}/index.less +0 -0
  285. /package/src/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useDeduction/index.tsx +0 -0
  286. /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
  }
@@ -26,7 +26,7 @@ export interface IOptions {
26
26
  }
27
27
 
28
28
  /**
29
- * 设置当前的编辑货物
29
+ * 给一组货物添加折扣行
30
30
  */
31
31
  export default async (state: InvoiceControllerState, options?: IOptions) => {
32
32
  if (!options) return;
@@ -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
- const goods = state.goodsListState.goodsList.filter( (e) => e.$index === $index)[0];
10
+ // 查下要删除的货物
11
+ const goods = state.goodsListState.goodsList.filter((e) => e.$index === $index)[0];
11
12
  if (!goods) return;
12
- if (
13
- state.goodsListState.editGood &&
14
- state.goodsListState.editGood.$index === $index
15
- ) {
13
+
14
+ // 如果正在编辑 就取消编辑
15
+ if (state.goodsListState.editGood && state.goodsListState.editGood.$index === $index) {
16
16
  state.goodsListState.editGood = undefined;
17
17
  }
18
18
 
19
- if (goods.lineAttribute === LineAttributeType.正常) {
20
- state.goodsListState.selectedGoodIndex =
21
- state.goodsListState.selectedGoodIndex.filter((e) => e !== $index);
22
- state.goodsListState.goodsList = state.goodsListState.goodsList.filter(
23
- (e) => e.$index !== $index,
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
- if (goods.lineAttribute === LineAttributeType.折扣行) {
28
- state.goodsListState.goodsList = state.goodsListState.goodsList.filter(
29
- (e) => {
30
- if (e.discountGroup !== goods.discountGroup) return true;
31
- if (e.lineAttribute === LineAttributeType.折扣行) {
32
- state.goodsListState.selectedGoodIndex =
33
- state.goodsListState.selectedGoodIndex.filter((e) => e !== $index);
34
- return false;
35
- }
36
- if (e.lineAttribute === LineAttributeType.被折扣行) {
37
- e.lineAttribute = LineAttributeType.正常;
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
  };
@@ -4,6 +4,7 @@ import { InvoiceControllerState } from '../';
4
4
  * 保存正在编辑的货物
5
5
  */
6
6
  export default async (state: InvoiceControllerState) => {
7
+
7
8
  const editGood = state.goodsListState.editGood;
8
9
  const form = state.goodsListState.form;
9
10
 
@@ -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,6 +1,6 @@
1
- import { thomsonCrossSectionDependencies } from 'mathjs';
1
+
2
2
  import React from 'react';
3
- import { Invoice } from '../../../';
3
+ import { Invoice } from '../../../..';
4
4
 
5
5
  export default () => {
6
6
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import Invoice from '../../';
2
+ import Invoice from '../..';
3
3
  import 'antd/dist/antd.css';
4
4
 
5
5
  export default () => <Invoice />;
@@ -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: 100,
123
- lineAmountIncludeTax: 103,
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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Menu, Typography } from 'kts-components-antd-x3';
3
- import { Invoice } from '../../../';
3
+ import { Invoice } from '../../../..';
4
4
 
5
5
  export default () => {
6
6
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Invoice } from '../../../';
2
+ import { Invoice } from '../../../..';
3
3
  import { IGetBuyerListOption } from '../../../Invoice/InvoiceController/InvoiceControllerState/BuyerState';
4
4
 
5
5
  export default () => {
@@ -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
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Input } from 'kts-components-antd-x3';
3
- import { Invoice } from '../../../';
3
+ import { Invoice } from '../../../..';
4
4
  import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
5
5
 
6
6
  export default () => {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AutoComplete, Input, Icon } from 'kts-components-antd-x3';
3
- import { Invoice } from '../../../';
3
+ import { Invoice } from '../../../..';
4
4
 
5
5
  export default () => {
6
6
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Invoice } from '../../../';
2
+ import { Invoice } from '../../../..';
3
3
 
4
4
  const InvoiceController = Invoice.InvoiceController;
5
5
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Invoice } from '../../../';
2
+ import { Invoice } from '../../../..';
3
3
 
4
4
  export default () => {
5
5
  const controller = React.useMemo(() => new Invoice.InvoiceController(), []);
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- # Invoice
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>
@@ -1,19 +1,27 @@
1
+
1
2
  import './index.less';
2
3
  import React from 'react';
3
4
  import InvoiceController from './InvoiceController';
4
- import InvoiceHeader from './ui/InvoiceHeader';
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
- return <Main {...this.props}></Main>;
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
+ }
@@ -1,6 +1,6 @@
1
1
 
2
2
  import React from 'react'
3
- import InvoiceController from '../../../../InvoiceController'
3
+ import InvoiceController from '../../InvoiceController'
4
4
 
5
5
  /** 更新 商品序号 */
6
6
  export default function useToGenerateId(controller: InvoiceController) {
@@ -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 "../../tools/itemName";
7
- import { LineAttributeType } from "../../InvoiceController";
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.addComparisonIndex, []);
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 Invoice from '../../';
8
- import { IFormItem } from '../../InvoiceController/InvoiceControllerState/BuyerState';
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 '../../../../InvoiceController/InvoiceControllerState/BuyerState';
4
+ import Invoice from '../../../../..';
5
+ import { IBuyerInfo } from '../../../../../InvoiceController/InvoiceControllerState/BuyerState';
6
6
 
7
7
  export interface IBuyerNameInputProps {
8
8
  value?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Button } from 'kts-components-antd-x3';
3
- import Invoice from '../../../../';
3
+ import Invoice from '../../../../..';
4
4
 
5
5
  export default () => {
6
6
  const controller = Invoice.useInvoiceController();
@@ -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 '../../InvoiceController';
8
- import IGood from '../../InvoiceController/InvoiceControllerState/GoodsListState/IGood';
9
- import { countTaxAmount } from '../../tools/calculate';
10
- import { bytesLnegth, cutStr } from '../../tools/strringFn';
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 '../../../../../InvoiceController';
9
- import evaluate from '../../../../../tools/evaluate';
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 '../../../../../tools/calculate';
11
+ import { format2, format15, countTaxAmount, countAmountExcludeTax, countPrice } from '../../../../../../tools/calculate';
12
12
  import moment from 'moment';
13
13
 
14
- export { format2, format15 } from '../../../../../tools/calculate';
14
+ export { format2, format15 } from '../../../../../../tools/calculate';
15
15
 
16
16
 
17
17