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
@@ -0,0 +1,260 @@
1
+
2
+ import React from "react";
3
+ import Icon from '@ant-design/icons';
4
+ import { decorator } from "grey-react-box";
5
+ import { Form } from "kts-components-antd-x3";
6
+ import { Button, Col, Input, InputProps, Row } from 'kts-xui'
7
+ import { FormComponentProps } from "kts-components-antd-x3/lib/form";
8
+ import { ReactComponent as ArrowUpSvg } from './svg/arrowUp.svg';
9
+ import { ReactComponent as ArrowDownSvg } from './svg/arrowDown.svg';
10
+ import { ReactComponent as PlusSvg } from './svg/plus.svg'
11
+ import InvoiceController from "../../../InvoiceController";
12
+ import Invoice from "../../../../Invoice";
13
+ import './index.less';
14
+
15
+ const RULES = {
16
+ companyName: (label: string) => [
17
+ { required: true, message: `${label}必填` },
18
+ { max: 300, message: `${label}内容超长` },
19
+ { pattern: /^([A-Za-z()\u4e00-\u9fa5])*$/g, message: `${label}仅能中文、英文、括号` }
20
+ ],
21
+ taxId: (label: string) => [
22
+ { max: 26, message: `${label}内容超长` },
23
+ { pattern: /^([A-Z0-9])*$/g, message: `${label}仅能数字、英文大写` }
24
+ ],
25
+ bankName: (label: string) => [
26
+ { max: 120, message: `${label}内容超长` },
27
+ { pattern: /^([\u4e00-\u9fa5])*$/g, message: `${label}仅能中文` }
28
+ ],
29
+ bankAccount: (label: string) => [
30
+ { max: 100, message: `${label}内容超长` },
31
+ { pattern: /^([0-9])*$/g, message: `${label}仅能数字` }
32
+ ]
33
+ }
34
+
35
+ const formatCompanyName = (e: any) => {
36
+ const value = e?.target?.value;
37
+ if (value) {
38
+ return value.replace('(', '(').replace(')', ')').replace(' ', '');
39
+ }
40
+ }
41
+
42
+ export interface IStakeholder {
43
+
44
+ /** 是否显示导入按钮 */
45
+ isShowImportButton?: boolean;
46
+
47
+ /** 点击了 */
48
+ onClickImportButton?: (e: InvoiceController) => void
49
+ }
50
+
51
+ /** 干系人 */
52
+ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.create())(props => {
53
+
54
+ const { form, isShowImportButton, onClickImportButton } = props;
55
+
56
+ const [isExpand, setExpand] = React.useState(true);
57
+
58
+ const { getFieldDecorator } = form;
59
+
60
+ const controller = Invoice.useInvoiceController();
61
+
62
+ const model = controller.useMemo(s => s.model, []);
63
+
64
+ const disableds = controller.useMemo(s => s.stakeholder.disableds || [], []);
65
+
66
+ const rulesMap = controller.useMemo(s => s.stakeholder.rulesMap || {}, []);
67
+
68
+ const readOnly = React.useMemo(() => model === 'readOnly', [model]);
69
+
70
+ const onExpand = React.useCallback(() => { setExpand(e => !e) }, []);
71
+
72
+ const isReadOnly = React.useCallback(field => readOnly || disableds.indexOf(field) >= 0, [disableds, readOnly]);
73
+
74
+ const getRules = React.useCallback((field, defaultRules) => {
75
+ if (isReadOnly(field)) return [];
76
+ return rulesMap[field] || defaultRules;
77
+ }, [rulesMap, isReadOnly, isReadOnly]);
78
+
79
+ controller.useForm('stakeholder', form);
80
+
81
+ return (
82
+ <div className="kts-invoice-operate-invoice-digtal-stakeholder" >
83
+ <div>
84
+ {'购买方信息'.split('').map(e => <span>{e}</span>)}
85
+ {
86
+ !readOnly &&
87
+ <Icon
88
+ className="digtal-stakeholder-expand-button"
89
+ component={isExpand ? ArrowUpSvg : ArrowDownSvg}
90
+ onClick={onExpand}
91
+ />
92
+ }
93
+ </div>
94
+ <div>
95
+ <Form className="digtal-stakeholder-form" >
96
+ <Row gutter={[16, 0]}>
97
+ <Col span={24} >
98
+ <Form.Item label='名称' colon={false}>
99
+ {getFieldDecorator('buyerName', {
100
+ rules: getRules('buyerName', RULES.companyName('购买方名称')),
101
+ getValueFromEvent: formatCompanyName
102
+ })(
103
+ <MyInput
104
+ readOnly={isReadOnly('buyerName')}
105
+ placeholder="请输入"
106
+ autoComplete="off"
107
+ suffix={
108
+ isShowImportButton === true &&
109
+ <Button
110
+ type='link'
111
+ style={{ padding: 0, width: 20 }}
112
+ icon={<Icon component={PlusSvg} />}
113
+ onClick={() => { onClickImportButton && onClickImportButton(controller) }}
114
+ />
115
+ }
116
+ />
117
+ )}
118
+ </Form.Item>
119
+ </Col>
120
+
121
+ <Col span={24} >
122
+ <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
123
+ {getFieldDecorator('buyerTaxId', {
124
+ rules: getRules('buyerTaxId', [{ required: true, message: '购买方纳税人识别号必填' }, ...RULES.taxId('购买方纳税人识别号')])
125
+ })(<MyInput readOnly={isReadOnly('buyerTaxId')} placeholder="请输入" autoComplete="off" />)}
126
+ </Form.Item>
127
+ </Col>
128
+ {
129
+ !readOnly && isExpand && (
130
+ <>
131
+ <Col span={15} >
132
+ <Form.Item label='购买方地址' colon={false}>
133
+ {getFieldDecorator('buyerAddress', {
134
+ rules: getRules('buyerAddress', [{ max: 300, message: '购买方地址内容超长' }])
135
+ })(<MyInput readOnly={isReadOnly('buyerAddress')} placeholder="请输入" autoComplete="off" />)}
136
+ </Form.Item>
137
+ </Col>
138
+
139
+ <Col span={9} >
140
+ <Form.Item label='电话' colon={false}>
141
+ {getFieldDecorator('buyerPhone', {
142
+ rules: getRules('buyerPhone', [{ max: 60, message: '购买方电话内容超长' }])
143
+ })(<MyInput readOnly={isReadOnly('buyerPhone')} placeholder="请输入" autoComplete="off" />)}
144
+ </Form.Item>
145
+ </Col>
146
+
147
+ <Col span={12} >
148
+ <Form.Item label='购买方开户银行' colon={false}>
149
+ {getFieldDecorator('buyerBank', {
150
+ rules: getRules('buyerBank', RULES.bankName('购买方开户银行'))
151
+ })(<MyInput readOnly={isReadOnly('buyerBank')} placeholder="请输入" autoComplete="off" />)}
152
+ </Form.Item>
153
+ </Col>
154
+
155
+ <Col span={12} >
156
+ <Form.Item label='银行账号' colon={false}>
157
+ {getFieldDecorator('buyerAccount', {
158
+ rules: getRules('buyerAccount', RULES.bankAccount('购买方银行账号'))
159
+ })(<MyInput readOnly={isReadOnly('buyerAccount')} placeholder="请输入" autoComplete="off" />)}
160
+ </Form.Item>
161
+ </Col>
162
+ </>
163
+ )
164
+ }
165
+ </Row>
166
+ </Form>
167
+ </div>
168
+ <div>
169
+ {'销售方信息'.split('').map(e => <span>{e}</span>)}
170
+ {
171
+ !readOnly &&
172
+ <Icon
173
+ className="digtal-stakeholder-expand-button"
174
+ component={isExpand ? ArrowUpSvg : ArrowDownSvg}
175
+ onClick={onExpand}
176
+ />
177
+ }
178
+ </div>
179
+ <div>
180
+ {
181
+ !readOnly &&
182
+ <div style={{ marginTop: 20 }} >
183
+ <Button type="link" >查看当前可用授信额度</Button>
184
+ </div>
185
+ }
186
+ <Form className="digtal-stakeholder-form" >
187
+ <Row gutter={[16, 0]}>
188
+ <Col span={24} >
189
+ <Form.Item label='名称' colon={false}>
190
+ {getFieldDecorator('supplierName', {
191
+ rules: getRules('supplierName', RULES.companyName('销售方名称')),
192
+ getValueFromEvent: formatCompanyName
193
+ })(<MyInput readOnly={isReadOnly('supplierName')} placeholder="请输入" autoComplete="off" />)}
194
+ </Form.Item>
195
+ </Col>
196
+
197
+ <Col span={24} >
198
+ <Form.Item label='统一社会信用代码/纳税人识别号' colon={false}>
199
+ {getFieldDecorator('supplierTaxId', {
200
+ rules: getRules('supplierTaxId', [{ required: true, message: '销售方纳税人识别号必填' }, ...RULES.taxId('销售方纳税人识别号')])
201
+ })(<MyInput readOnly={isReadOnly('supplierTaxId')} placeholder="请输入" autoComplete="off" />)}
202
+ </Form.Item>
203
+ </Col>
204
+ {
205
+ !readOnly && isExpand && (
206
+ <>
207
+ <Col span={15} >
208
+ <Form.Item label='销售方地址' colon={false}>
209
+ {getFieldDecorator('sellerAddress', {
210
+ rules: getRules('sellerAddress', [{ max: 300, message: '销售方地址内容超长' }])
211
+ })(<MyInput readOnly={isReadOnly('sellerAddress')} placeholder="请输入" autoComplete="off" />)}
212
+ </Form.Item>
213
+ </Col>
214
+
215
+ <Col span={9} >
216
+ <Form.Item label='电话' colon={false}>
217
+ {getFieldDecorator('sellerPhone', {
218
+ rules: getRules('sellerPhone', [
219
+ { required: true, message: '销售方电话必填' },
220
+ { max: 60, message: '销售方电话内容超长' }
221
+ ])
222
+ })(<MyInput readOnly={isReadOnly('sellerPhone')} placeholder="请输入" autoComplete="off" />)}
223
+ </Form.Item>
224
+ </Col>
225
+
226
+ <Col span={12} >
227
+ <Form.Item label='销售方开户银行' colon={false}>
228
+ {getFieldDecorator('sellerBank', {
229
+ rules: getRules('sellerBank', RULES.bankName('销售方开户银行'))
230
+ })(<MyInput readOnly={isReadOnly('sellerBank')} placeholder="请输入" autoComplete="off" />)}
231
+ </Form.Item>
232
+ </Col>
233
+
234
+ <Col span={12} >
235
+ <Form.Item label='银行账号' colon={false}>
236
+ {getFieldDecorator('sellerAccount', {
237
+ rules: getRules('sellerAccount', RULES.bankAccount('销售方银行账号'))
238
+ })(<MyInput readOnly={isReadOnly('sellerAccount')} placeholder="请输入" autoComplete="off" />)}
239
+ </Form.Item>
240
+ </Col>
241
+ </>
242
+ )
243
+ }
244
+ </Row>
245
+ </Form>
246
+ </div>
247
+ </div>
248
+ )
249
+ })
250
+
251
+ class MyInput extends React.Component<InputProps>{
252
+ render() {
253
+ const props = this.props;
254
+ if (props.readOnly) {
255
+ return <span>{props.value}</span>
256
+ } else {
257
+ return <Input {...props} />
258
+ }
259
+ }
260
+ }
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="13" viewBox="0 0 12 13" fill="none">
2
+ <path d="M2.94338 4.42663C3.03458 4.42662 3.12571 4.46481 3.19459 4.54096L5.99164 7.6327L8.78868 4.54096C8.92463 4.39067 9.14733 4.38824 9.28606 4.53554C9.4248 4.68285 9.42705 4.92408 9.29107 5.07437L6.24283 8.44378C6.17667 8.5169 6.08613 8.55811 5.99164 8.55811C5.89714 8.55811 5.80659 8.5169 5.74044 8.44378L2.69221 5.07437C2.55623 4.92408 2.55849 4.68285 2.69722 4.53554C2.76567 4.46287 2.85455 4.42665 2.94338 4.42663Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 13 13" fill="none">
2
+ <path d="M9.55662 8.57337C9.46542 8.57338 9.37429 8.53519 9.30541 8.45904L6.50836 5.3673L3.71132 8.45904C3.57537 8.60933 3.35267 8.61176 3.21394 8.46446C3.0752 8.31715 3.07295 8.07592 3.20893 7.92563L6.25717 4.55622C6.32333 4.4831 6.41387 4.44189 6.50836 4.44189C6.60286 4.44189 6.69341 4.4831 6.75956 4.55622L9.80779 7.92563C9.94377 8.07592 9.94151 8.31715 9.80278 8.46446C9.73433 8.53713 9.64545 8.57335 9.55662 8.57337Z"/>
3
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 16 15" fill="none">
2
+ <g clip-path="url(#clip0_715_360)">
3
+ <path d="M8 14.5312C4.11687 14.5312 0.96875 11.3831 0.96875 7.5C0.96875 3.61687 4.11687 0.46875 8 0.46875C11.8831 0.46875 15.0312 3.61687 15.0312 7.5C15.0312 11.3831 11.8831 14.5312 8 14.5312ZM8 13.5938C11.3656 13.5938 14.0938 10.8656 14.0938 7.5C14.0938 4.13438 11.3656 1.40625 8 1.40625C4.63438 1.40625 1.90625 4.13438 1.90625 7.5C1.90625 10.8656 4.63438 13.5938 8 13.5938Z"/>
4
+ <path d="M4.25 7.96875C4.12568 7.96875 4.00645 7.91936 3.91854 7.83146C3.83064 7.74355 3.78125 7.62432 3.78125 7.5C3.78125 7.37568 3.83064 7.25645 3.91854 7.16854C4.00645 7.08064 4.12568 7.03125 4.25 7.03125H11.75C11.8743 7.03125 11.9935 7.08064 12.0815 7.16854C12.1694 7.25645 12.2188 7.37568 12.2188 7.5C12.2188 7.62432 12.1694 7.74355 12.0815 7.83146C11.9935 7.91936 11.8743 7.96875 11.75 7.96875H4.25Z"/>
5
+ <path d="M7.53125 3.75C7.53125 3.62568 7.58064 3.50645 7.66854 3.41854C7.75645 3.33064 7.87568 3.28125 8 3.28125C8.12432 3.28125 8.24355 3.33064 8.33146 3.41854C8.41936 3.50645 8.46875 3.62568 8.46875 3.75V11.25C8.46875 11.3743 8.41936 11.4935 8.33146 11.5815C8.24355 11.6694 8.12432 11.7188 8 11.7188C7.87568 11.7188 7.75645 11.6694 7.66854 11.5815C7.58064 11.4935 7.53125 11.3743 7.53125 11.25V3.75Z"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_715_360">
9
+ <rect width="15" height="15" transform="translate(0.5)"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { InvoiceTypeModal } from '../../..';
3
+ import { Button } from 'kts-xui';
4
+
5
+ export default () => {
6
+
7
+ const [open, setOpen] = React.useState(false);
8
+
9
+ return (
10
+ <>
11
+ <Button onClick={() => { setOpen(true) }} >打开</Button>
12
+ <InvoiceTypeModal
13
+ open={open}
14
+ disableds={['business']}
15
+ onOk={e => console.log(e)}
16
+ onCancel={() => { setOpen(false) }}
17
+ defaultBusiness='1'
18
+ defaultInvoiceType='1'
19
+ businessOptions={[
20
+ { label: '成品油', value: '1' }
21
+ ]}
22
+ invoiceTypeOptions={[
23
+ { label: '类型1', value: '1' },
24
+ { label: '类型2', value: '2' },
25
+ { label: '类型3', value: '3' },
26
+ { label: '类型4', value: '4' },
27
+ { label: '类型5', value: '5' },
28
+ ]}
29
+ />
30
+ </>
31
+ )
32
+ };
@@ -0,0 +1,8 @@
1
+ .goods-list-digtal-reselect-invoice-typeModal-radio {
2
+ width : 100%;
3
+ display: flex !important;
4
+
5
+ &>label {
6
+ flex: 1;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ # InvoiceTypeModal
2
+
3
+ ## 简单用法
4
+ <code src="./_test/easiest/index.tsx" ></code>
5
+
6
+ <API name="API" exports='["default"]' src="./index.tsx" ></API>
@@ -0,0 +1,127 @@
1
+
2
+ import React from "react";
3
+ import { Col, Form, Modal, Radio, Row, Select } from "kts-xui";
4
+ import { DefaultOptionType } from "kts-components-antd-x4/lib/select";
5
+ import './index.less';
6
+
7
+ export interface IFormValues {
8
+
9
+ /** 开票种类 */
10
+ billingType: 'digital' | 'taxation';
11
+
12
+ /** 特定业务 */
13
+ business: any;
14
+
15
+ /** 选择票类 */
16
+ invoiceType: any;
17
+ }
18
+
19
+ export interface IInvoiceTypeModalProps {
20
+
21
+ /** 窗口标题 */
22
+ modalTitle?: string;
23
+
24
+ /** 是否开启 */
25
+ open?: boolean;
26
+
27
+ /** 点击了确认 */
28
+ onOk?: (values: IFormValues) => void;
29
+
30
+ /** 点击了取消 */
31
+ onCancel?: () => void;
32
+
33
+ /** 禁用列表 */
34
+ disableds?: ('billingType' | 'invoiceType' | 'business')[];
35
+
36
+ /** 选择票类 选项 */
37
+ invoiceTypeOptions?: DefaultOptionType[];
38
+
39
+ /** 特定业务 选项 */
40
+ businessOptions?: DefaultOptionType[];
41
+
42
+ /** 票类默认值 */
43
+ defaultInvoiceType?: any;
44
+
45
+ /** 特定业务默认值 */
46
+ defaultBusiness?: any;
47
+
48
+ /** 开票种类 默认值 */
49
+ defaultBillingType?: 'digital' | 'taxation';
50
+ }
51
+
52
+ export default function InvoiceTypeModal(props: IInvoiceTypeModalProps) {
53
+
54
+ const { disableds = [] } = props;
55
+
56
+ const [form] = Form.useForm<IFormValues>();
57
+
58
+ const onConfirm = React.useCallback(async () => {
59
+ const values = await form.validateFields();
60
+ props.onOk && props.onOk(values);
61
+ }, [props.onOk])
62
+
63
+ React.useEffect(() => {
64
+ if (props.open) {
65
+ form.resetFields();
66
+ form.setFieldsValue({
67
+ billingType: props.defaultBillingType || 'digital',
68
+ invoiceType: props.defaultInvoiceType,
69
+ business: props.defaultBusiness,
70
+ })
71
+ }
72
+ }, [props.open, props.defaultBillingType, props.defaultBusiness, props.defaultInvoiceType, form])
73
+
74
+ return (
75
+ <Modal
76
+ title={props.modalTitle || "选择开具信息"}
77
+ open={props.open}
78
+ onOk={onConfirm}
79
+ onCancel={props.onCancel}
80
+ okText='确定'
81
+ cancelText='取消'
82
+ >
83
+ <Form form={form} layout="vertical" style={{ paddingTop: 20 }} >
84
+ <Row gutter={[16, 16]}>
85
+ <Col span={24} >
86
+ <Form.Item name='billingType' >
87
+ <Radio.Group
88
+ size='large'
89
+ className="goods-list-digtal-reselect-invoice-typeModal-radio"
90
+ optionType="button"
91
+ disabled={disableds.indexOf('billingType') >= 0}
92
+ options={[
93
+ { label: '数电发票', value: 'digital' },
94
+ { label: '税控发票', value: 'taxation' },
95
+ ]}
96
+ />
97
+ </Form.Item>
98
+ </Col>
99
+
100
+ <Col span={12} >
101
+ <Form.Item
102
+ name='invoiceType'
103
+ label="选择票类"
104
+ rules={[{ required: true, message: '选择票类必填' }]}
105
+ >
106
+ <Select
107
+ size='large'
108
+ disabled={disableds.indexOf('invoiceType') >= 0}
109
+ options={props.invoiceTypeOptions}
110
+ />
111
+ </Form.Item>
112
+ </Col>
113
+
114
+ <Col span={12} >
115
+ <Form.Item name='business' label="特定业务">
116
+ <Select
117
+ size='large'
118
+ disabled={disableds.indexOf('business') >= 0}
119
+ options={props.businessOptions}
120
+ />
121
+ </Form.Item>
122
+ </Col>
123
+ </Row>
124
+ </Form>
125
+ </Modal>
126
+ )
127
+ }
package/src/index.ts CHANGED
@@ -4,3 +4,6 @@ import 'kts-components-antd-x3/dist/kts-components-antd-x3.css';
4
4
  export { default as Invoice } from './Invoice';
5
5
  export { default as InvoiceController } from './Invoice/InvoiceController';
6
6
  export type { default as IGood } from './Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood';
7
+
8
+ export { default as InvoiceTypeModal } from './InvoiceTypeModal';
9
+ export type { IInvoiceTypeModalProps } from './InvoiceTypeModal';