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