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,636 @@
1
+
2
+ import React from 'react';
3
+ import Icon from '@ant-design/icons';
4
+ import { Form } from 'kts-components-antd-x3';
5
+ import { ReactComponent as PlusSvg } from './svg/plus.svg'
6
+ import { AutoComplete, Select, Button, Input, Spin, Tooltip, InputProps } from 'kts-xui';
7
+ import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
8
+ import { getItemNameWithShorthand } from '../../../../../tools/itemName';
9
+ import { IGood, LineAttributeType } from '../../../../../InvoiceController';
10
+ import Invoice from '../../../../..';
11
+ import TitleText from './ui/TitleText';
12
+ import ItemNameInput from './ui/ItemNameInput';
13
+ import {
14
+ onChangeQuantity,
15
+ onChangePriceIncludeTax,
16
+ onChangePriceExcludeTax,
17
+ onChangeLineAmountIncludeTax,
18
+ onChangeLineAmountExcludeTax,
19
+ onChangeTaxRate,
20
+ onChangeItemName,
21
+ } from './autoFillFn';
22
+
23
+ export default (form: WrappedFormUtils) => {
24
+ const { getFieldDecorator, getFieldValue } = form;
25
+
26
+ const controller = Invoice.useInvoiceController();
27
+
28
+ /** 是否含税 */
29
+ const isTaxIncluded = controller.useMemo(e => e.goodsListState.isTaxIncluded, []);
30
+
31
+ /** 组件模式 */
32
+ const model = controller.useMemo(e => e.model, []);
33
+
34
+ /** 是否显示我方 */
35
+ const isMyShow = controller.useMemo(e => e.goodsListState.isMyShow, []);
36
+
37
+ /** 正在编辑的货物 */
38
+ const editGood = controller.useMemo((e) => e.goodsListState.editGood, []);
39
+
40
+ /** 搜索条件 */
41
+ const searchValue = controller.useMemo((e) => e.goodsListState.searchValue, []);
42
+
43
+ /** 税率列表 */
44
+ const taxRateList = controller.useMemo((e) => e.goodsListState.taxRateList, []);
45
+
46
+ /** 单位列表 */
47
+ const unitList = controller.useMemo((e) => e.goodsListState.unitList, []);
48
+
49
+ /** 商品表格补充配置 */
50
+ const columnsReplenish = controller.useMemo((e) => e.goodsListState.columnsReplenish, []);
51
+
52
+ /** 扣除额 */
53
+ const deduction = controller.useMemo((e) => e.goodsListState.deduction, []);
54
+
55
+ /** 计算中启动字段 */
56
+ const changeField = controller.useMemo((e) => e.calculatingField, []);
57
+
58
+ /** 计算中启动字段 */
59
+ const setChangeField = React.useCallback((value: string) => controller.run(async s => { s.calculatingField = value }), []);
60
+
61
+ const onNumberValueChange = React.useCallback((e) => {
62
+ const value = e?.target?.value;
63
+ if (value) {
64
+ return value.replace(/[^0-9-\.]/g, '');
65
+ }
66
+ }, [])
67
+
68
+ /** 获取补充校验规则 */
69
+ const getReplenishRules = React.useCallback((id: string) => {
70
+ return columnsReplenish[id] ? columnsReplenish[id].rules || [] : []
71
+ }, [columnsReplenish])
72
+
73
+ /** 金额整数位限制,不传默认9位 */
74
+ const priceIntegerDigit = controller.useMemo((e) => e.priceIntegerDigit || 9, []);
75
+
76
+ /** 表头 */
77
+ const columns = React.useMemo(() => {
78
+ return [
79
+ {
80
+ title: '序号',
81
+ key: 'serialNo',
82
+ dataIndex: 'serialNo',
83
+ width: 50,
84
+ render: (e: number) => <span style={{ padding: '0 10px' }}>{e}</span>,
85
+ },
86
+ {
87
+ title: <TitleText required >项目名称</TitleText>,
88
+ key: 'itemName',
89
+ render: (_: string, record: IGood) => {
90
+ if (editGood?.$index === record.$index) {
91
+ return (
92
+ <Form.Item>
93
+ <div style={{ display: 'flex' }} >
94
+ {getFieldDecorator('itemName', {
95
+ initialValue: isMyShow ? record.itemNameSelf : record.itemName,
96
+ rules: [
97
+ ...getReplenishRules('itemName'),
98
+ {
99
+ validator: async (_, __, callback) => {
100
+ await controller.wait();
101
+ const value = controller.state.goodsListState.editGood;
102
+ if (!value?.itemName && !value?.itemNameSelf) {
103
+ callback('项目名称不能为空');
104
+ } else {
105
+ return;
106
+ }
107
+ }
108
+ }
109
+ ]
110
+ })(
111
+ <ItemNameInput
112
+ shorthand={editGood.shorthand}
113
+ suffix={
114
+ <Tooltip title="点击从商品管理中添加商品信息">
115
+ <Button
116
+ type="link"
117
+ style={{ padding: 0, width: 20 }}
118
+ icon={<Icon component={PlusSvg} />}
119
+ onClick={controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleDrawer = true })}
120
+ />
121
+ </Tooltip>
122
+ }
123
+ onChange={() => {
124
+ onChangeItemName(controller, form, record);
125
+ }}
126
+ />
127
+ )}
128
+ {/* <div className="kts-invoice-operate-goods-list-able-list-itemName-import">
129
+ {controller.getGoodsList && model !== 'readOnly' && (
130
+ <Tooltip title="点击从商品管理中添加商品信息">
131
+ <Button
132
+ onClick={controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleDrawer = true })}
133
+ type="link"
134
+ icon="plus-circle"
135
+ />
136
+ </Tooltip>
137
+ )}
138
+ </div> */}
139
+ </div>
140
+ </Form.Item>
141
+ );
142
+ } else {
143
+ return (
144
+ <span>
145
+ {record.lineAttribute === LineAttributeType.折扣行 ? <span className='goods-list-digtal-discount-tag'>折扣</span> : <></>}
146
+ <MyItemNameDiv
147
+ valueT={formatSearch(getItemNameWithShorthand({ shorthand: record.shorthand, full: record.itemNameSelf || '' }), searchValue)}
148
+ valueF={formatSearch(getItemNameWithShorthand({ shorthand: record.shorthand, full: record.itemName || '' }), searchValue)}
149
+ isMyShow={isMyShow}
150
+ />
151
+ </span>
152
+ )
153
+ }
154
+ },
155
+ },
156
+ {
157
+ title: <TitleText rules={columnsReplenish['itemModelName']?.rules} >规格型号</TitleText>,
158
+ key: 'itemModelName',
159
+ width: 119,
160
+ render: (_: string, record: IGood) => {
161
+ if (editGood?.$index === record.$index) {
162
+ return (
163
+ <Form.Item>
164
+ {getFieldDecorator('itemModelName', {
165
+ initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName,
166
+ rules: getReplenishRules('itemModelName'),
167
+ })(
168
+ <MyInput
169
+ onChange={async () => {
170
+ await controller.wait()
171
+ const key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
172
+ const value = {} as any;
173
+ value[key] = form.getFieldsValue().itemModelName;
174
+ controller.setEditGood(value);
175
+ }}
176
+ />,
177
+ )}
178
+ </Form.Item>
179
+ );
180
+ } else {
181
+ return (
182
+ <MyItemNameDiv
183
+ valueT={formatSearch(record.itemModelNameSelf, searchValue)}
184
+ valueF={formatSearch(record.itemModelName, searchValue)}
185
+ isMyShow={isMyShow}
186
+ />
187
+ )
188
+ }
189
+ },
190
+ },
191
+ {
192
+ title: <TitleText rules={columnsReplenish['unit']?.rules} >单位</TitleText>,
193
+ key: 'unit',
194
+ width: 70,
195
+ render: (_: string, record: IGood) => {
196
+ if (editGood?.$index === record.$index) {
197
+ return (
198
+ <Form.Item>
199
+ {getFieldDecorator('unit', {
200
+ initialValue: editGood.unit,
201
+ rules: getReplenishRules('unit'),
202
+ })(
203
+ <AutoComplete
204
+ style={{ width: '100%' }}
205
+ dataSource={unitList}
206
+ onChange={async () => {
207
+ await controller.wait()
208
+ // const key = isMyShow ? 'unit' : 'unitOther';
209
+ // const value = {} as any;
210
+ // value[key] = form.getFieldsValue().unit;
211
+ controller.setEditGood({ unit: form.getFieldsValue().unit });
212
+ }}
213
+ />,
214
+ )}
215
+ </Form.Item>
216
+ );
217
+ } else {
218
+ return <span style={{ padding: '0 10px' }}>{record.unit}</span>;
219
+ }
220
+ },
221
+ },
222
+ {
223
+ title: <TitleText rules={columnsReplenish['quantity']?.rules} >数量</TitleText>,
224
+ dataIndex: 'quantity',
225
+ key: 'quantity',
226
+ align: 'right',
227
+ width: 149,
228
+ render: (value: string, record: IGood) => {
229
+ if (editGood?.$index === record.$index) {
230
+ return (
231
+ <Form.Item>
232
+ {getFieldDecorator('quantity', {
233
+ initialValue: editGood.quantity,
234
+ getValueFromEvent: onNumberValueChange,
235
+ rules: [
236
+ ...getReplenishRules('quantity'),
237
+ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '数量必须为数字' },
238
+ {
239
+ validator: async (_, value, callback) => {
240
+ await controller.wait();
241
+ const isvalue = !!value || value === 0;
242
+ const isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
243
+ if (isvalue || isPrice === isvalue) return;
244
+ callback('请输入数量');
245
+ }
246
+ }
247
+ ],
248
+ })(
249
+ <MyInput
250
+ style={{ textAlign: 'right' }}
251
+ maxLength={16}
252
+ loading={isCipher(changeField, "quantity")}
253
+ onChange={async () => {
254
+ setChangeField('quantity');
255
+ await onChangeQuantity(controller, form, record);
256
+ }}
257
+ />,
258
+ )}
259
+ </Form.Item>
260
+ );
261
+ } else {
262
+ return <span style={{ padding: '0 10px' }}>{value}</span>;
263
+ }
264
+ },
265
+ },
266
+ {
267
+ title: <TitleText rules={columnsReplenish['priceIncludeTax']?.rules} >单价(含税)</TitleText>,
268
+ dataIndex: 'priceIncludeTax',
269
+ key: 'priceIncludeTax',
270
+ align: 'right',
271
+ width: 149,
272
+ render: (value: string, record: IGood) => {
273
+ if (editGood?.$index === record.$index) {
274
+ return (
275
+ <Form.Item>
276
+ {getFieldDecorator('priceIncludeTax', {
277
+ initialValue: editGood.priceIncludeTax,
278
+ getValueFromEvent: onNumberValueChange,
279
+ rules: [
280
+ ...getReplenishRules('priceIncludeTax'),
281
+ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
282
+ {
283
+ validator: async (_, value, callback) => {
284
+ await controller.wait();
285
+ const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
286
+ const isvalue = !!value || value === 0;
287
+ if (isvalue || isQuantity === isvalue) return;
288
+ callback('请输入单价');
289
+ }
290
+ }
291
+ ],
292
+ })(
293
+ <MyInput
294
+ style={{ textAlign: 'right' }}
295
+ maxLength={16}
296
+ loading={isCipher(changeField, 'priceIncludeTax')}
297
+ onChange={() => {
298
+ setChangeField('priceIncludeTax');
299
+ onChangePriceIncludeTax(controller, form, record);
300
+ }}
301
+ />,
302
+ )}
303
+ </Form.Item>
304
+ );
305
+ } else {
306
+ return <span style={{ padding: '0 10px' }}>{value}</span>;
307
+ }
308
+ },
309
+ },
310
+ {
311
+ title: <TitleText rules={columnsReplenish['priceExcludeTax']?.rules} >单价(不含税)</TitleText>,
312
+ dataIndex: 'priceExcludeTax',
313
+ key: 'priceExcludeTax',
314
+ align: 'right',
315
+ width: 149,
316
+ render: (value: string, record: IGood) => {
317
+ if (editGood?.$index === record.$index) {
318
+ return (
319
+ <Form.Item>
320
+ {getFieldDecorator('priceExcludeTax', {
321
+ initialValue: editGood.priceExcludeTax,
322
+ getValueFromEvent: onNumberValueChange,
323
+ rules: [
324
+ ...getReplenishRules('priceExcludeTax'),
325
+ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
326
+ {
327
+ validator: async (_, value, callback) => {
328
+ await controller.wait();
329
+ const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
330
+ const isvalue = !!value || value === 0;
331
+ if (isvalue || isQuantity === isvalue) return;
332
+ callback('请输入单价');
333
+ }
334
+ }
335
+ ],
336
+ })(
337
+ <MyInput
338
+ style={{ textAlign: 'right' }}
339
+ maxLength={16}
340
+ loading={isCipher(changeField, 'priceExcludeTax')}
341
+ onChange={() => {
342
+ setChangeField('priceExcludeTax');
343
+ onChangePriceExcludeTax(controller, form, record);
344
+ }}
345
+ />,
346
+ )}
347
+ </Form.Item>
348
+ );
349
+ } else {
350
+ return <span style={{ padding: '0 10px' }}>{value}</span>;
351
+ }
352
+ },
353
+ },
354
+ {
355
+ title: <TitleText required >金额(含税)</TitleText>,
356
+ dataIndex: 'lineAmountIncludeTax',
357
+ key: 'lineAmountIncludeTax',
358
+ width: 119,
359
+ align: 'right',
360
+ render: (value: string, record: IGood) => {
361
+ if (editGood?.$index === record.$index) {
362
+ return (
363
+ <Form.Item>
364
+ {getFieldDecorator('lineAmountIncludeTax', {
365
+ initialValue: editGood.lineAmountIncludeTax,
366
+ getValueFromEvent: onNumberValueChange,
367
+ rules: [
368
+ ...getReplenishRules('lineAmountIncludeTax'),
369
+ { required: true, message: '金额不能为空' },
370
+ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
371
+ {
372
+ validator: async (_, value, callback) => {
373
+ if (`${value}`.split('.')[0].length > priceIntegerDigit) {
374
+ callback(`金额整数部分不能大于${priceIntegerDigit}位,小数点后最多2位`);
375
+ }
376
+ }
377
+ },
378
+ {
379
+ validator: async (_, value, callback) => {
380
+ if (deduction && parseFloat(value) <= deduction) {
381
+ callback('扣除额不能大于等于价税合计');
382
+ }
383
+ }
384
+ },
385
+ ],
386
+ })(
387
+ <MyInput
388
+ style={{ textAlign: 'right' }}
389
+ loading={isCipher(changeField, 'lineAmountIncludeTax')}
390
+ onChange={() => {
391
+ setChangeField('lineAmountIncludeTax');
392
+ onChangeLineAmountIncludeTax(controller, form, record);
393
+ }}
394
+ />,
395
+ )}
396
+ </Form.Item>
397
+ );
398
+ } else {
399
+ return <span style={{ padding: '0 10px' }}>{formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
400
+ }
401
+ },
402
+ },
403
+ {
404
+ title: <TitleText required >金额(不含税)</TitleText>,
405
+ dataIndex: 'lineAmountExcludeTax',
406
+ key: 'lineAmountExcludeTax',
407
+ align: 'right',
408
+ width: 119,
409
+ render: (value: string, record: IGood) => {
410
+ if (editGood?.$index === record.$index) {
411
+ return (
412
+ <Form.Item>
413
+ {getFieldDecorator('lineAmountExcludeTax', {
414
+ initialValue: editGood.lineAmountExcludeTax,
415
+ getValueFromEvent: onNumberValueChange,
416
+ rules: [
417
+ ...getReplenishRules('lineAmountExcludeTax'),
418
+ { required: true, message: '金额不能为空' },
419
+ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
420
+ {
421
+ validator: async (_, value: string, callback) => {
422
+ if (`${value}`.split('.')[0].length > priceIntegerDigit) {
423
+ callback(`金额整数部分不能大于${priceIntegerDigit}位,小数点后最多2位`);
424
+ }
425
+ }
426
+ },
427
+ ],
428
+ })(
429
+ <MyInput
430
+ style={{ textAlign: 'right' }}
431
+ loading={isCipher(changeField, 'lineAmountExcludeTax')}
432
+ onChange={() => {
433
+ setChangeField('lineAmountExcludeTax');
434
+ onChangeLineAmountExcludeTax(controller, form, record);
435
+ }}
436
+ />,
437
+ )}
438
+ </Form.Item>
439
+ );
440
+ } else {
441
+ return <span style={{ padding: '0 10px' }}>{formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
442
+ }
443
+ },
444
+ },
445
+ {
446
+ title: <TitleText required >税率%</TitleText>,
447
+ dataIndex: 'taxRate',
448
+ key: 'taxRate',
449
+ align: 'right',
450
+ width: 70,
451
+ render: (value: string, record: IGood) => {
452
+ if (editGood?.$index === record.$index) {
453
+ return (
454
+ <Form.Item>
455
+ {getFieldDecorator('taxRate', {
456
+ initialValue: editGood.taxRate,
457
+ rules: [
458
+ ...getReplenishRules('taxRate'),
459
+ { required: true, message: ' ' },
460
+ { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: ' ' },
461
+ ],
462
+ })(
463
+ <Select
464
+ className="kts-invoice-operate-goods-list-table-tax-rate"
465
+ // dropdownMenuStyle={{ textAlign: "right" }}
466
+ showArrow={false}
467
+ style={{ width: '100%' }}
468
+ onChange={() => {
469
+ setChangeField('taxRate');
470
+ onChangeTaxRate(controller, form, record);
471
+ }}
472
+ >
473
+ {taxRateList.map((e, i) => {
474
+ return (
475
+ <Select.Option key={i} value={e}>
476
+ {e}%
477
+ </Select.Option>
478
+ );
479
+ })}
480
+ </Select>,
481
+ )}
482
+ </Form.Item>
483
+ );
484
+ } else {
485
+ return <span style={{ padding: '0 10px' }}>{value}%</span>;
486
+ }
487
+ },
488
+ },
489
+ {
490
+ title: <TitleText rules={columnsReplenish['taxAmount']?.rules} >税额</TitleText>,
491
+ dataIndex: 'taxAmount',
492
+ key: 'taxAmount',
493
+ align: 'right',
494
+ width: 119,
495
+ render: (value: string, record: IGood) => {
496
+ if (editGood?.$index === record.$index) {
497
+ return getFieldDecorator('taxAmount', {
498
+ initialValue: editGood.taxAmount,
499
+ rules: getReplenishRules('taxAmount'),
500
+ })(<MyDiv loading={isCipher(changeField, 'taxAmount')} />);
501
+ } else {
502
+ return <span style={{ padding: '0 10px' }}>{parseFloat(value).toFixed(2)}</span>;
503
+ }
504
+ },
505
+ },
506
+ // {
507
+ // title: '操作',
508
+ // key: 'operating',
509
+ // align: 'right',
510
+ // width: 130,
511
+ // fixed: 'right',
512
+ // render: (_value: string, record: IGood) => <RowMenu key={record.lineAttribute} goods={record} />,
513
+ // },
514
+ ]
515
+ // 含税不含税
516
+ .filter((e) => {
517
+ if (isTaxIncluded) {
518
+ return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
519
+ } else {
520
+ return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
521
+ }
522
+ })
523
+ // 只读
524
+ .filter(e => {
525
+ if (model === 'readOnly') {
526
+ return e.key !== 'operating';
527
+ } else {
528
+ return true;
529
+ }
530
+ })
531
+ .map((e) => {
532
+ return {
533
+ ...e,
534
+ ellipsis: true,
535
+ };
536
+ }) as any[];
537
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish]);
538
+
539
+ // React.useEffect(() => {
540
+ // clearTimeout(t)
541
+ // const t = setTimeout(() => { setChangeField('') }, 1000);
542
+ // return () => { clearTimeout(t) }
543
+ // }, [changeField]);
544
+
545
+ return columns;
546
+ };
547
+
548
+ /** 字段 */
549
+ function isCipher(name?: string, field?: string) {
550
+ if (!name || !field) return false;
551
+ return name !== field;
552
+ }
553
+
554
+ class MyInput extends React.Component<InputProps & { loading?: boolean }> {
555
+ render() {
556
+ if (this.props.loading) {
557
+ return (
558
+ <Spin size="small">
559
+ <Input {...this.props} autoComplete="off" />
560
+ </Spin>
561
+ )
562
+ } else {
563
+ return <Input {...this.props} autoComplete="off" />
564
+ }
565
+ }
566
+ }
567
+
568
+ class MyDiv extends React.Component<{ value?: any, loading?: boolean }> {
569
+
570
+ render() {
571
+ if (this.props.loading) {
572
+ return (
573
+ <Spin size="small">
574
+ <span style={{ padding: '0 10px' }}>{this.props.value}</span>
575
+ </Spin>
576
+ )
577
+ } else {
578
+ return <span style={{ padding: '0 10px' }}>{this.props.value}</span>
579
+ }
580
+ }
581
+ }
582
+
583
+ class MyItemNameDiv extends React.Component<{ valueT?: React.ReactNode, valueF?: React.ReactNode, isMyShow: boolean }> {
584
+ render(): React.ReactNode {
585
+
586
+ const { isMyShow, valueT, valueF } = this.props;
587
+
588
+ if (isMyShow) {
589
+ if (valueT) {
590
+ return (
591
+ <Tooltip title={valueT}>
592
+ <span style={{ padding: '0 10px', color: '#0074ff' }}>{valueT}</span>
593
+ </Tooltip>
594
+ )
595
+ } else {
596
+ return (
597
+ <Tooltip title={valueF}>
598
+ <span style={{ padding: '0 10px' }}>{valueF}</span>
599
+ </Tooltip>
600
+ )
601
+ }
602
+ } else {
603
+ if (valueF) {
604
+ return (
605
+ <Tooltip title={valueF}>
606
+ <span style={{ padding: '0 10px' }}>{valueF}</span>
607
+ </Tooltip>
608
+ )
609
+ } else {
610
+ return (
611
+ <Tooltip title={valueT}>
612
+ <span style={{ padding: '0 10px', color: '#0074ff' }}>{valueT}</span>
613
+ </Tooltip>
614
+ )
615
+ }
616
+ }
617
+ }
618
+ }
619
+
620
+ /** 格式搜索结果 */
621
+ function formatSearch(value?: string, search?: string) {
622
+ if (!value || !search) return value;
623
+
624
+ const __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(e => dcoding(e)).join(`<span class="kts-invoice-operate-goods-list-table-search-protrude" >${search}</span>`);
625
+ return <span dangerouslySetInnerHTML={{ __html }} />
626
+ }
627
+
628
+ /** 编码 */
629
+ function ucoding(v: string): string {
630
+ return v.split('').map(e => `U${e.charCodeAt(0)}E`).join('');
631
+ }
632
+
633
+ /** 解码 */
634
+ function dcoding(v: string): string {
635
+ return v.split('U').map(e => e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '').join('');
636
+ }
@@ -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,10 @@
1
+ .kts-invoice-operate-goods-list-itemName-input {
2
+ display : flex;
3
+ flex : 1;
4
+ padding-left: 0;
5
+ height : 31px;
6
+ }
7
+
8
+ .has-error .kts-invoice-operate-goods-list-itemName-input{
9
+ border: 1px solid #f5222d;
10
+ }
@@ -0,0 +1,24 @@
1
+
2
+ import { Input } from 'kts-xui';
3
+ import React, { ChangeEvent } from 'react';
4
+ import './index.less';
5
+
6
+ export default function ItemNameInput(props: {
7
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void,
8
+ suffix?: React.ReactNode,
9
+ value?: string,
10
+ shorthand?: string
11
+ }) {
12
+
13
+ const onChange = React.useCallback((e: ChangeEvent<HTMLInputElement>) => {
14
+ const event = { ...e };
15
+ props.onChange && props.onChange(event);
16
+ }, [])
17
+
18
+ return (
19
+ <div className='kts-invoice-operate-goods-list-itemName-input'>
20
+ {props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
21
+ <Input style={{ height: '100%' }} value={props.value} onChange={onChange} suffix={props.suffix} />
22
+ </div>
23
+ )
24
+ }