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.
Files changed (272) 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/readOnly/index.d.ts +4 -0
  5. package/dist/Invoice/Invoice-digtal/_test/stakeholder/index.d.ts +4 -0
  6. package/dist/Invoice/Invoice-digtal/_test/typeSelection/index.d.ts +4 -0
  7. package/dist/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.d.ts +10 -0
  8. package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +6 -0
  9. package/dist/Invoice/InvoiceController/fns/addGoodDiscount.d.ts +1 -1
  10. package/dist/Invoice/InvoiceController/fns/addGoodDiscountV2.d.ts +12 -0
  11. package/dist/Invoice/InvoiceController/fns/delGood.d.ts +1 -1
  12. package/dist/Invoice/InvoiceController/index.d.ts +2 -0
  13. package/dist/Invoice/index.d.ts +25 -12
  14. package/dist/Invoice/tools/mounting/index.d.ts +3 -0
  15. package/dist/Invoice/{ui/GoodsList/hook → tools}/useToGenerateId/index.d.ts +1 -1
  16. package/dist/Invoice/ui/{Buyer → default/Buyer}/index.d.ts +1 -1
  17. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/autoFillFn/index.d.ts +2 -2
  18. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +0 -1
  19. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -1
  20. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -1
  21. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +1 -1
  22. package/dist/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
  23. package/dist/Invoice/ui/default/GoodsList/hook/useDeduction/index.d.ts +8 -0
  24. package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useOnRow/index.d.ts +1 -1
  25. package/dist/Invoice/ui/default/GoodsList/hook/useWindowClick/index.d.ts +8 -0
  26. package/dist/Invoice/ui/{Seller → default/Seller}/index.d.ts +1 -1
  27. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.d.ts +35 -0
  28. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/index.d.ts +3 -0
  29. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.d.ts +7 -0
  30. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.d.ts +6 -0
  31. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +4 -0
  32. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +7 -0
  33. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +7 -0
  34. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +7 -0
  35. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
  36. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.d.ts +6 -0
  37. package/dist/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  38. package/dist/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.d.ts +8 -0
  39. package/dist/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.d.ts +8 -0
  40. package/dist/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.d.ts +8 -0
  41. package/dist/Invoice/ui/digtal/GoodsList/index.d.ts +17 -0
  42. package/dist/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.d.ts +3 -0
  43. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +5 -0
  44. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +5 -0
  45. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
  46. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
  47. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +6 -0
  48. package/dist/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.d.ts +5 -0
  49. package/dist/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.d.ts +3 -0
  50. package/dist/Invoice/ui/digtal/GoodsList/ui/Search/index.d.ts +3 -0
  51. package/dist/Invoice/ui/digtal/GoodsList/ui/Statistics/index.d.ts +4 -0
  52. package/dist/Invoice/ui/digtal/GoodsList/ui/TableRow/index.d.ts +2 -0
  53. package/dist/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.d.ts +4 -0
  54. package/dist/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.d.ts +4 -0
  55. package/dist/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.d.ts +3 -0
  56. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.d.ts +35 -0
  57. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.d.ts +3 -0
  58. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.d.ts +7 -0
  59. package/dist/Invoice/ui/{GoodsList/hook/useColumns/ui/RowMenu → digtal/GoodsList.o/hook/useColumns/ui/RowEditButton}/index.d.ts +0 -1
  60. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.d.ts +4 -0
  61. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +7 -0
  62. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +7 -0
  63. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +7 -0
  64. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.d.ts +7 -0
  65. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.d.ts +6 -0
  66. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.d.ts +8 -0
  67. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.d.ts +8 -0
  68. package/dist/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.d.ts +8 -0
  69. package/dist/Invoice/ui/digtal/GoodsList.o/index.d.ts +20 -0
  70. package/dist/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.d.ts +3 -0
  71. package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.d.ts +2 -0
  72. package/dist/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.d.ts +4 -0
  73. package/dist/Invoice/ui/digtal/InvoiceHeader/index.d.ts +14 -0
  74. package/dist/Invoice/ui/digtal/Sign/index.d.ts +10 -0
  75. package/dist/Invoice/ui/digtal/Stakeholder/index.d.ts +7 -0
  76. package/dist/InvoiceTypeModal/_test/easiest/index.d.ts +3 -0
  77. package/dist/InvoiceTypeModal/index.d.ts +34 -0
  78. package/dist/index.d.ts +2 -0
  79. package/dist/index.esm.js +6302 -189
  80. package/dist/index.js +6288 -174
  81. package/package.json +1 -1
  82. package/src/Invoice/Invoice-digtal/_test/disabled/index.tsx +38 -0
  83. package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +5 -0
  84. package/src/Invoice/Invoice-digtal/_test/header/index.tsx +17 -0
  85. package/src/Invoice/Invoice-digtal/_test/readOnly/index.tsx +42 -0
  86. package/src/Invoice/Invoice-digtal/_test/stakeholder/index.tsx +12 -0
  87. package/src/Invoice/Invoice-digtal/_test/typeSelection/index.tsx +29 -0
  88. package/src/Invoice/Invoice-digtal/index.md +19 -0
  89. package/src/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.ts +11 -0
  90. package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +8 -0
  91. package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +1 -1
  92. package/src/Invoice/InvoiceController/fns/addGoodDiscountV2.ts +84 -0
  93. package/src/Invoice/InvoiceController/fns/delGood.ts +26 -28
  94. package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -0
  95. package/src/Invoice/InvoiceController/index.ts +4 -0
  96. package/src/Invoice/_test/buyerNameSearch/index.tsx +2 -2
  97. package/src/Invoice/_test/easiest/index.tsx +1 -1
  98. package/src/Invoice/_test/endowCode/index.tsx +4 -4
  99. package/src/Invoice/_test/goodsMenuExpand/index.tsx +1 -1
  100. package/src/Invoice/_test/importBuyer/index.tsx +1 -1
  101. package/src/Invoice/_test/importGoods/index.tsx +1 -1
  102. package/src/Invoice/_test/invoiceType/index.tsx +1 -1
  103. package/src/Invoice/_test/seller/index.tsx +1 -1
  104. package/src/Invoice/_test/setDataSource/index.tsx +1 -1
  105. package/src/Invoice/_test/unit/index.tsx +1 -1
  106. package/src/Invoice/index.less +19 -1
  107. package/src/Invoice/index.md +6 -6
  108. package/src/Invoice/index.tsx +74 -19
  109. package/src/Invoice/tools/mounting/index.ts +14 -0
  110. package/src/Invoice/{ui/GoodsList/hook → tools}/useToGenerateId/index.ts +1 -1
  111. package/src/Invoice/ui/{AddComparisonDrawer → default/AddComparisonDrawer}/index.tsx +5 -5
  112. package/src/Invoice/ui/{Buyer → default/Buyer}/index.tsx +2 -2
  113. package/src/Invoice/ui/{Buyer → default/Buyer}/ui/BuyerNameInput/index.tsx +2 -2
  114. package/src/Invoice/ui/{Buyer → default/Buyer}/ui/ImportBuyerButton/index.tsx +1 -1
  115. package/src/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.tsx +5 -5
  116. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/autoFillFn/index.ts +4 -4
  117. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/index.tsx +3 -3
  118. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +2 -2
  119. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +2 -2
  120. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +3 -3
  121. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/index.tsx +2 -2
  122. package/src/Invoice/ui/default/GoodsList/hook/useDeduction/index.tsx +24 -0
  123. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useOnRow/index.tsx +3 -3
  124. package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useRowSelection/index.tsx +2 -2
  125. package/src/Invoice/ui/default/GoodsList/hook/useWindowClick/index.tsx +23 -0
  126. package/src/Invoice/ui/{GoodsList → default/GoodsList}/index.tsx +2 -2
  127. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/AddRowButton/index.tsx +2 -2
  128. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +4 -4
  129. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useDelRowButton/index.tsx +2 -2
  130. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +2 -2
  131. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/DescribeSwitch/index.tsx +1 -1
  132. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.tsx +1 -1
  133. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.tsx +1 -1
  134. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableRow/index.tsx +2 -2
  135. package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TaxIncludedSwitch/index.tsx +1 -1
  136. package/src/Invoice/ui/{ImportBuyerDrawer → default/ImportBuyerDrawer}/index.tsx +1 -1
  137. package/src/Invoice/ui/{ImportGoodsDrawer → default/ImportGoodsDrawer}/index.tsx +4 -4
  138. package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.tsx +1 -1
  139. package/src/Invoice/ui/{Seller → default/Seller}/index.tsx +2 -2
  140. package/src/Invoice/ui/{Sign → default/Sign}/index.tsx +1 -1
  141. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +520 -0
  142. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +623 -0
  143. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.less +10 -0
  144. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +19 -0
  145. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.tsx +30 -0
  146. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -0
  147. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -0
  148. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -0
  149. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -0
  150. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.less +13 -0
  151. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +98 -0
  152. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/spot.svg +1 -0
  153. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.tsx +14 -0
  154. package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.tsx +20 -0
  155. package/src/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.tsx +39 -0
  156. package/src/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.tsx +112 -0
  157. package/src/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.tsx +23 -0
  158. package/src/Invoice/ui/digtal/GoodsList/index.less +57 -0
  159. package/src/Invoice/ui/digtal/GoodsList/index.tsx +181 -0
  160. package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +66 -0
  161. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +321 -0
  162. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/svg/add.svg +12 -0
  163. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -0
  164. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
  165. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +35 -0
  166. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +82 -0
  167. package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.tsx +56 -0
  168. package/src/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.tsx +37 -0
  169. package/src/Invoice/ui/digtal/GoodsList/ui/Search/icon/magnifier.svg +1 -0
  170. package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.less +12 -0
  171. package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.tsx +50 -0
  172. package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.less +54 -0
  173. package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +99 -0
  174. package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/svg/fork.svg +12 -0
  175. package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +28 -0
  176. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.less +39 -0
  177. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.tsx +109 -0
  178. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.less +44 -0
  179. package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual.o/index.tsx +96 -0
  180. package/src/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.tsx +31 -0
  181. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/autoFillFn/index.ts +520 -0
  182. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/index.tsx +624 -0
  183. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.less +10 -0
  184. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/ItemNameInput/index.tsx +19 -0
  185. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowEditButton/index.tsx +30 -0
  186. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -0
  187. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -0
  188. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -0
  189. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -0
  190. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.less +13 -0
  191. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/index.tsx +98 -0
  192. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowMenu/spot.svg +1 -0
  193. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/RowSaveButton/index.tsx +14 -0
  194. package/src/Invoice/ui/digtal/GoodsList.o/hook/useColumns/ui/TitleText/index.tsx +20 -0
  195. package/src/Invoice/ui/digtal/GoodsList.o/hook/useOnRow/index.tsx +39 -0
  196. package/src/Invoice/ui/digtal/GoodsList.o/hook/useRowSelection/index.tsx +112 -0
  197. package/src/Invoice/ui/digtal/GoodsList.o/index.less +7 -0
  198. package/src/Invoice/ui/digtal/GoodsList.o/index.tsx +132 -0
  199. package/src/Invoice/ui/digtal/GoodsList.o/ui/AddRowButton/index.tsx +66 -0
  200. package/src/Invoice/ui/digtal/GoodsList.o/ui/TableRow/index.tsx +28 -0
  201. package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.less +43 -0
  202. package/src/Invoice/ui/digtal/GoodsList.o/ui/TableVirtual/index.tsx +109 -0
  203. package/src/Invoice/ui/digtal/InvoiceHeader/index.less +58 -0
  204. package/src/Invoice/ui/digtal/InvoiceHeader/index.tsx +77 -0
  205. package/src/Invoice/ui/digtal/Sign/index.less +49 -0
  206. package/src/Invoice/ui/digtal/Sign/index.tsx +90 -0
  207. package/src/Invoice/ui/digtal/Stakeholder/index.less +57 -0
  208. package/src/Invoice/ui/digtal/Stakeholder/index.tsx +237 -0
  209. package/src/Invoice/ui/digtal/Stakeholder/svg/arrowDown.svg +3 -0
  210. package/src/Invoice/ui/digtal/Stakeholder/svg/arrowUp.svg +3 -0
  211. package/src/InvoiceTypeModal/_test/easiest/index.tsx +32 -0
  212. package/src/InvoiceTypeModal/index.less +8 -0
  213. package/src/InvoiceTypeModal/index.md +6 -0
  214. package/src/InvoiceTypeModal/index.tsx +123 -0
  215. package/src/index.ts +3 -0
  216. /package/dist/Invoice/ui/{AddComparisonDrawer → default/AddComparisonDrawer}/index.d.ts +0 -0
  217. /package/dist/Invoice/ui/{Buyer → default/Buyer}/ui/BuyerNameInput/index.d.ts +0 -0
  218. /package/dist/Invoice/ui/{Buyer → default/Buyer}/ui/ImportBuyerButton/index.d.ts +0 -0
  219. /package/dist/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.d.ts +0 -0
  220. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/index.d.ts +0 -0
  221. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.d.ts +0 -0
  222. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowEditButton/index.d.ts +0 -0
  223. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowSaveButton/index.d.ts +0 -0
  224. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/TitleText/index.d.ts +0 -0
  225. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/hook/useRowSelection/index.d.ts +0 -0
  226. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/index.d.ts +0 -0
  227. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/AddRowButton/index.d.ts +0 -0
  228. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +0 -0
  229. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +0 -0
  230. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +0 -0
  231. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +0 -0
  232. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/index.d.ts +0 -0
  233. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/DescribeSwitch/index.d.ts +0 -0
  234. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.d.ts +0 -0
  235. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.d.ts +0 -0
  236. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableRow/index.d.ts +0 -0
  237. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.d.ts +0 -0
  238. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.d.ts +0 -0
  239. /package/dist/Invoice/ui/{GoodsList → default/GoodsList}/ui/TaxIncludedSwitch/index.d.ts +0 -0
  240. /package/dist/Invoice/ui/{ImportBuyerDrawer → default/ImportBuyerDrawer}/index.d.ts +0 -0
  241. /package/dist/Invoice/ui/{ImportGoodsDrawer → default/ImportGoodsDrawer}/index.d.ts +0 -0
  242. /package/dist/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.d.ts +0 -0
  243. /package/dist/Invoice/ui/{Sign → default/Sign}/index.d.ts +0 -0
  244. /package/dist/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useDeduction/index.d.ts +0 -0
  245. /package/dist/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useWindowClick/index.d.ts +0 -0
  246. /package/src/Invoice/ui/{Buyer → default/Buyer}/index.less +0 -0
  247. /package/src/Invoice/ui/{EndowCodeDrawer → default/EndowCodeDrawer}/index.less +0 -0
  248. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.less +0 -0
  249. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/ItemNameInput/index.tsx +0 -0
  250. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowEditButton/index.tsx +0 -0
  251. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +0 -0
  252. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/index.less +0 -0
  253. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowMenu/spot.svg +0 -0
  254. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/RowSaveButton/index.tsx +0 -0
  255. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/hook/useColumns/ui/TitleText/index.tsx +0 -0
  256. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/index.less +0 -0
  257. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useAddDiscountRowButton/index.less +0 -0
  258. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +0 -0
  259. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/BulkMenu/index.tsx +0 -0
  260. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/icon/magnifier.svg +0 -0
  261. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Search/index.less +0 -0
  262. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/Statistics/index.less +0 -0
  263. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.less +0 -0
  264. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual/index.tsx +0 -0
  265. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.less +0 -0
  266. /package/src/Invoice/ui/{GoodsList → default/GoodsList}/ui/TableVirtual.o/index.tsx +0 -0
  267. /package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/auto.svg +0 -0
  268. /package/src/Invoice/ui/{InvoiceHeader → default/InvoiceHeader}/index.less +0 -0
  269. /package/src/Invoice/ui/{Seller → default/Seller}/index.less +0 -0
  270. /package/src/Invoice/ui/{Sign → default/Sign}/index.less +0 -0
  271. /package/src/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useDeduction/index.tsx +0 -0
  272. /package/src/Invoice/ui/{GoodsList → digtal/GoodsList.o}/hook/useWindowClick/index.tsx +0 -0
@@ -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
+ };
@@ -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
+ };
@@ -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
+ }