kts-component-invoice-operate 3.2.244 → 3.2.246
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.
- package/.dumi/theme/builtins/API.tsx +66 -66
- package/.editorconfig +16 -16
- package/.fatherrc.ts +4 -4
- package/.prettierignore +7 -7
- package/.prettierrc +11 -11
- package/.umirc.ts +8 -8
- package/BRANCH.md +5 -0
- package/README.md +12 -12
- package/branch/3.2.x +1 -0
- package/dist/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.d.ts +2 -0
- package/dist/Invoice/ui/digtal/StakeFarmerholder/index.d.ts +2 -0
- package/dist/index.esm.js +126 -7
- package/dist/index.js +126 -7
- package/docs/index.md +5 -5
- package/docs-dist/404.html +33 -33
- package/docs-dist/index.html +33 -33
- package/docs-dist/static/arrowDown.a1cbf0d8.svg +2 -2
- package/docs-dist/static/arrowUp.4c482054.svg +2 -2
- package/docs-dist/static/fork.5431267d.svg +11 -11
- package/docs-dist/static/plus.44013ce3.svg +11 -11
- package/docs-dist/static/plus.4fd1af30.svg +11 -11
- package/docs-dist/umi.css +18 -18
- package/index.html +12 -12
- package/package.json +62 -62
- package/src/Invoice/Invoice-digtal/_test/architecture/index.tsx +21 -21
- package/src/Invoice/Invoice-digtal/_test/disabled/index.tsx +40 -40
- package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +214 -214
- package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +14580 -14580
- package/src/Invoice/Invoice-digtal/_test/header/index.tsx +84 -84
- package/src/Invoice/Invoice-digtal/_test/importGoods/index.tsx +868 -868
- package/src/Invoice/Invoice-digtal/_test/importStakeholder/index.tsx +18 -18
- package/src/Invoice/Invoice-digtal/_test/lineCredit/index.tsx +19 -19
- package/src/Invoice/Invoice-digtal/_test/pay/index.tsx +14636 -14636
- package/src/Invoice/Invoice-digtal/_test/prefab/index.tsx +150 -150
- package/src/Invoice/Invoice-digtal/_test/readOnly/index.tsx +55 -55
- package/src/Invoice/Invoice-digtal/_test/realEstateInfo/index.tsx +83 -83
- package/src/Invoice/Invoice-digtal/_test/stakeholder/index.tsx +12 -12
- package/src/Invoice/Invoice-digtal/_test/typeSelection/index.tsx +29 -29
- package/src/Invoice/Invoice-digtal/index.md +44 -44
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +116 -116
- package/src/Invoice/InvoiceController/InvoiceControllerState/AutoComplete/index.ts +26 -26
- package/src/Invoice/InvoiceController/InvoiceControllerState/BuyerState/index.tsx +88 -88
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IColumnsReplenish/index.ts +10 -10
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/IGood/index.ts +33 -33
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/ImportGoods/index.ts +81 -81
- package/src/Invoice/InvoiceController/InvoiceControllerState/FreightListState/index.ts +39 -39
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/Drag/index.ts +15 -15
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode/index.tsx +104 -104
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IColumnsReplenish/index.ts +10 -10
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +91 -90
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods/index.ts +84 -84
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/LineAttributeType/index.ts +7 -7
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +9 -9
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +134 -134
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/IColumnsReplenish/index.ts +10 -10
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/IGood/index.ts +35 -35
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/ImportGoods/index.ts +81 -81
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/index.ts +39 -39
- package/src/Invoice/InvoiceController/InvoiceControllerState/Stakeholder/index.ts +13 -13
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +76 -76
- package/src/Invoice/InvoiceController/fns/addFreight.ts +11 -11
- package/src/Invoice/InvoiceController/fns/addGood.ts +11 -11
- package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +126 -126
- package/src/Invoice/InvoiceController/fns/addGoodDiscountV2.ts +86 -86
- package/src/Invoice/InvoiceController/fns/addPay.ts +11 -11
- package/src/Invoice/InvoiceController/fns/delFreight.ts +38 -38
- package/src/Invoice/InvoiceController/fns/delGood.ts +41 -41
- package/src/Invoice/InvoiceController/fns/delPay.ts +38 -38
- package/src/Invoice/InvoiceController/fns/getGoodsSearch.ts +26 -26
- package/src/Invoice/InvoiceController/fns/importGoodsDrawer.ts +79 -79
- package/src/Invoice/InvoiceController/fns/itemBlur.ts +40 -40
- package/src/Invoice/InvoiceController/fns/mergeDetails.ts +201 -201
- package/src/Invoice/InvoiceController/fns/mergeDiscount.ts +35 -35
- package/src/Invoice/InvoiceController/fns/saveEditFreight.ts +24 -24
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +24 -24
- package/src/Invoice/InvoiceController/fns/saveEditPay.ts +23 -23
- package/src/Invoice/InvoiceController/fns/setEditFreight.ts +16 -16
- package/src/Invoice/InvoiceController/fns/setEditGood.ts +16 -16
- package/src/Invoice/InvoiceController/fns/setEditPay.ts +16 -16
- package/src/Invoice/InvoiceController/fns/setFreight.ts +10 -10
- package/src/Invoice/InvoiceController/fns/setGoods.ts +10 -10
- package/src/Invoice/InvoiceController/fns/setPay.ts +10 -10
- package/src/Invoice/InvoiceController/fns/updateInvoiceNo.ts +8 -8
- package/src/Invoice/InvoiceController/index.ts +127 -127
- package/src/Invoice/_test/buyerNameSearch/index.tsx +42 -42
- package/src/Invoice/_test/children/index.tsx +214 -214
- package/src/Invoice/_test/deduction/index.tsx +956 -957
- package/src/Invoice/_test/draft/index.tsx +40 -40
- package/src/Invoice/_test/easiest/index.tsx +5 -5
- package/src/Invoice/_test/endowCode/index.tsx +1158 -1158
- package/src/Invoice/_test/goodsMenuExpand/index.tsx +32 -32
- package/src/Invoice/_test/importBuyer/index.tsx +74 -74
- package/src/Invoice/_test/importGoods/index.tsx +1197 -1197
- package/src/Invoice/_test/invoiceType/index.tsx +59 -59
- package/src/Invoice/_test/isInvoiceNo/index.tsx +12 -12
- package/src/Invoice/_test/replaceHead/index.tsx +22 -22
- package/src/Invoice/_test/retrieveData/index.tsx +22 -22
- package/src/Invoice/_test/seller/index.tsx +28 -28
- package/src/Invoice/_test/setDataSource/index.tsx +73 -73
- package/src/Invoice/_test/unit/index.tsx +19 -19
- package/src/Invoice/index.less +31 -31
- package/src/Invoice/index.md +56 -56
- package/src/Invoice/index.tsx +200 -200
- package/src/Invoice/tools/calculate/index.ts +144 -144
- package/src/Invoice/tools/coolingFn/index.ts +17 -17
- package/src/Invoice/tools/evaluate/index.ts +7 -7
- package/src/Invoice/tools/idGenerator/index.ts +2 -2
- package/src/Invoice/tools/itemName/index.ts +55 -55
- package/src/Invoice/tools/lazyFn/index.ts +19 -19
- package/src/Invoice/tools/mounting/index.ts +13 -13
- package/src/Invoice/tools/strringFn/index.ts +40 -40
- package/src/Invoice/tools/useToGenerateId/index.ts +12 -12
- package/src/Invoice/tools/utils/index.ts +1 -1
- package/src/Invoice/tools/utils/money/index.ts +20 -20
- package/src/Invoice/ui/default/AddComparisonDrawer/index.tsx +149 -149
- package/src/Invoice/ui/default/Buyer/index.less +219 -219
- package/src/Invoice/ui/default/Buyer/index.tsx +114 -114
- package/src/Invoice/ui/default/Buyer/ui/BuyerNameInput/index.tsx +166 -166
- package/src/Invoice/ui/default/Buyer/ui/ImportBuyerButton/index.tsx +21 -21
- package/src/Invoice/ui/default/EndowCodeDrawer/index.less +8 -8
- package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +612 -612
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.ts +681 -647
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +769 -719
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Drag/index.less +20 -20
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Drag/index.tsx +205 -205
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/Expand/index.tsx +57 -57
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemCodeInput/index.less +18 -18
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemCodeInput/index.tsx +49 -49
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemNameInput/index.less +17 -17
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +91 -91
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowEditButton/index.tsx +30 -30
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -43
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +118 -118
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/dist/index.js +32 -32
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -41
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +25 -25
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/index.less +13 -13
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +99 -99
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/RowSaveButton/index.tsx +14 -14
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/TitleText/index.tsx +20 -20
- package/src/Invoice/ui/default/GoodsList/hook/useDeduction/index.tsx +24 -24
- package/src/Invoice/ui/default/GoodsList/hook/useOnRow/index.tsx +52 -52
- package/src/Invoice/ui/default/GoodsList/hook/useRowSelection/index.tsx +120 -120
- package/src/Invoice/ui/default/GoodsList/hook/useWindowClick/index.tsx +23 -23
- package/src/Invoice/ui/default/GoodsList/index.less +185 -185
- package/src/Invoice/ui/default/GoodsList/index.tsx +207 -207
- package/src/Invoice/ui/default/GoodsList/ui/AddRowButton/index.tsx +72 -72
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.less +21 -21
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +244 -244
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -75
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +69 -69
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +65 -65
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useMergeDetails/index.tsx +91 -91
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useMergeDiscount/index.tsx +36 -36
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useSalesDiscount/index.tsx +109 -109
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useSalesGifts/index.tsx +94 -94
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/index.tsx +37 -37
- package/src/Invoice/ui/default/GoodsList/ui/DescribeSwitch/index.tsx +36 -36
- package/src/Invoice/ui/default/GoodsList/ui/Search/index.less +10 -10
- package/src/Invoice/ui/default/GoodsList/ui/Search/index.tsx +52 -52
- package/src/Invoice/ui/default/GoodsList/ui/Statistics/index.less +18 -18
- package/src/Invoice/ui/default/GoodsList/ui/Statistics/index.tsx +114 -114
- package/src/Invoice/ui/default/GoodsList/ui/TableRow/index.less +40 -40
- package/src/Invoice/ui/default/GoodsList/ui/TableRow/index.tsx +71 -71
- package/src/Invoice/ui/default/GoodsList/ui/TableVirtual/index.less +38 -38
- package/src/Invoice/ui/default/GoodsList/ui/TableVirtual/index.tsx +130 -130
- package/src/Invoice/ui/default/GoodsList/ui/TableVirtual.o/index.less +44 -44
- package/src/Invoice/ui/default/GoodsList/ui/TableVirtual.o/index.tsx +96 -96
- package/src/Invoice/ui/default/GoodsList/ui/TaxIncludedSwitch/index.tsx +31 -31
- package/src/Invoice/ui/default/ImportBuyerDrawer/index.tsx +75 -75
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +201 -201
- package/src/Invoice/ui/default/InvoiceHeader/index.less +68 -68
- package/src/Invoice/ui/default/InvoiceHeader/index.tsx +246 -246
- package/src/Invoice/ui/default/Seller/index.less +113 -113
- package/src/Invoice/ui/default/Seller/index.tsx +98 -98
- package/src/Invoice/ui/default/Sign/index.less +14 -14
- package/src/Invoice/ui/default/Sign/index.tsx +71 -71
- package/src/Invoice/ui/digtal/Architecture/index.less +18 -18
- package/src/Invoice/ui/digtal/Architecture/index.tsx +177 -177
- package/src/Invoice/ui/digtal/FreightList/hook/useColumns/dist/index.js +616 -616
- package/src/Invoice/ui/digtal/FreightList/hook/useColumns/index.tsx +246 -246
- package/src/Invoice/ui/digtal/FreightList/hook/useColumns/ui/TitleText/index.tsx +20 -20
- package/src/Invoice/ui/digtal/FreightList/hook/useOnRow/index.tsx +37 -37
- package/src/Invoice/ui/digtal/FreightList/hook/useRowSelection/index.tsx +119 -119
- package/src/Invoice/ui/digtal/FreightList/hook/useWindowClick/index.tsx +23 -23
- package/src/Invoice/ui/digtal/FreightList/index.less +72 -72
- package/src/Invoice/ui/digtal/FreightList/index.tsx +129 -129
- package/src/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.tsx +74 -74
- package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -50
- package/src/Invoice/ui/digtal/FreightList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +36 -36
- package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.less +28 -28
- package/src/Invoice/ui/digtal/FreightList/ui/TableRow/index.tsx +20 -20
- package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.less +38 -38
- package/src/Invoice/ui/digtal/FreightList/ui/TableVirtual/index.tsx +108 -108
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +683 -683
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/dist/index.js +616 -616
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +723 -724
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/svg/plus.svg +11 -11
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/Drag/index.less +20 -20
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/Drag/index.tsx +205 -205
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.less +9 -9
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +87 -87
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowEditButton/index.tsx +30 -30
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/_useAddComparison/index.tsx +43 -43
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +76 -76
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +41 -41
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +34 -34
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.less +13 -13
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +98 -98
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/RowSaveButton/index.tsx +14 -14
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/ui/TitleText/index.tsx +20 -20
- package/src/Invoice/ui/digtal/GoodsList/hook/useOnRow/index.tsx +51 -51
- package/src/Invoice/ui/digtal/GoodsList/hook/useRowSelection/index.tsx +121 -121
- package/src/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.tsx +23 -23
- package/src/Invoice/ui/digtal/GoodsList/index.less +56 -56
- package/src/Invoice/ui/digtal/GoodsList/index.tsx +181 -181
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +87 -87
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +340 -340
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/svg/add.svg +11 -11
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -75
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -50
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -37
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +82 -82
- package/src/Invoice/ui/digtal/GoodsList/ui/BulkMenu/hooks/useReselectInvoiceType/index.tsx +57 -57
- package/src/Invoice/ui/digtal/GoodsList/ui/DescribeSwitch/index.tsx +36 -36
- package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.less +11 -11
- package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.tsx +60 -60
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.less +53 -53
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +98 -98
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/svg/fork.svg +11 -11
- package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.less +28 -28
- package/src/Invoice/ui/digtal/GoodsList/ui/TableRow/index.tsx +52 -52
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.less +38 -38
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.tsx +113 -113
- package/src/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.tsx +34 -34
- package/src/Invoice/ui/digtal/InvoiceHeader/index.less +57 -57
- package/src/Invoice/ui/digtal/InvoiceHeader/index.tsx +77 -77
- package/src/Invoice/ui/digtal/PayList/hook/useColumns/dist/index.js +616 -616
- package/src/Invoice/ui/digtal/PayList/hook/useColumns/index.tsx +168 -168
- package/src/Invoice/ui/digtal/PayList/hook/useColumns/ui/TitleText/index.tsx +20 -20
- package/src/Invoice/ui/digtal/PayList/hook/useOnRow/index.tsx +37 -37
- package/src/Invoice/ui/digtal/PayList/hook/useRowSelection/index.tsx +119 -119
- package/src/Invoice/ui/digtal/PayList/hook/useWindowClick/index.tsx +19 -19
- package/src/Invoice/ui/digtal/PayList/index.less +72 -72
- package/src/Invoice/ui/digtal/PayList/index.tsx +132 -132
- package/src/Invoice/ui/digtal/PayList/ui/AddRowButton/index.tsx +74 -74
- package/src/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -50
- package/src/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +36 -36
- package/src/Invoice/ui/digtal/PayList/ui/TableRow/index.less +28 -28
- package/src/Invoice/ui/digtal/PayList/ui/TableRow/index.tsx +20 -20
- package/src/Invoice/ui/digtal/PayList/ui/TableVirtual/index.less +38 -38
- package/src/Invoice/ui/digtal/PayList/ui/TableVirtual/index.tsx +108 -108
- package/src/Invoice/ui/digtal/RealEstateInfo/index.less +21 -21
- package/src/Invoice/ui/digtal/RealEstateInfo/index.tsx +451 -451
- package/src/Invoice/ui/digtal/Sign/index.less +48 -48
- package/src/Invoice/ui/digtal/Sign/index.tsx +99 -99
- package/src/Invoice/ui/digtal/StakeFarmerholder/index.less +99 -99
- package/src/Invoice/ui/digtal/StakeFarmerholder/index.tsx +1102 -1096
- package/src/Invoice/ui/digtal/StakeFarmerholder/svg/arrowDown.svg +2 -2
- package/src/Invoice/ui/digtal/StakeFarmerholder/svg/arrowUp.svg +2 -2
- package/src/Invoice/ui/digtal/StakeFarmerholder/svg/plus.svg +11 -11
- package/src/Invoice/ui/digtal/Stakeholder/index.less +99 -99
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +453 -453
- package/src/Invoice/ui/digtal/Stakeholder/svg/arrowDown.svg +2 -2
- package/src/Invoice/ui/digtal/Stakeholder/svg/arrowUp.svg +2 -2
- package/src/Invoice/ui/digtal/Stakeholder/svg/plus.svg +11 -11
- package/src/InvoiceTypeModal/_test/easiest/index.tsx +31 -31
- package/src/InvoiceTypeModal/dist/index.js +92 -92
- package/src/InvoiceTypeModal/index.less +7 -7
- package/src/InvoiceTypeModal/index.md +5 -5
- package/src/InvoiceTypeModal/index.tsx +161 -161
- package/src/TaxClassificationCodeModal/_test/easiest/index.tsx +184 -184
- package/src/TaxClassificationCodeModal/index.less +17 -17
- package/src/TaxClassificationCodeModal/index.md +6 -6
- package/src/TaxClassificationCodeModal/index.tsx +152 -152
- package/src/index.ts +13 -13
- package/tsconfig.json +31 -31
- package/typings.d.ts +3 -3
|
@@ -1,616 +1,616 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
36
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
37
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
38
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
|
-
function step(op) {
|
|
40
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
-
while (_) try {
|
|
42
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
|
-
switch (op[0]) {
|
|
45
|
-
case 0: case 1: t = op; break;
|
|
46
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
47
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49
|
-
default:
|
|
50
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
51
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
52
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
53
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54
|
-
if (t[2]) _.ops.pop();
|
|
55
|
-
_.trys.pop(); continue;
|
|
56
|
-
}
|
|
57
|
-
op = body.call(thisArg, _);
|
|
58
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
63
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
64
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
65
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
66
|
-
r[k] = a[j];
|
|
67
|
-
return r;
|
|
68
|
-
};
|
|
69
|
-
exports.__esModule = true;
|
|
70
|
-
var react_1 = require("react");
|
|
71
|
-
var kts_components_antd_x3_1 = require("kts-components-antd-x3");
|
|
72
|
-
var plus_svg_1 = require("./svg/plus.svg");
|
|
73
|
-
var kts_xui_1 = require("kts-xui");
|
|
74
|
-
var itemName_1 = require("../../../../../tools/itemName");
|
|
75
|
-
var InvoiceController_1 = require("../../../../../InvoiceController");
|
|
76
|
-
var __1 = require("../../../../..");
|
|
77
|
-
var TitleText_1 = require("./ui/TitleText");
|
|
78
|
-
var ItemNameInput_1 = require("./ui/ItemNameInput");
|
|
79
|
-
var autoFillFn_1 = require("./autoFillFn");
|
|
80
|
-
exports["default"] = (function (form) {
|
|
81
|
-
var getFieldDecorator = form.getFieldDecorator, getFieldValue = form.getFieldValue;
|
|
82
|
-
var controller = __1["default"].useInvoiceController();
|
|
83
|
-
/** 是否含税 */
|
|
84
|
-
var isTaxIncluded = controller.useMemo(function (e) { return e.goodsListState.isTaxIncluded; }, []);
|
|
85
|
-
/** 组件模式 */
|
|
86
|
-
var model = controller.useMemo(function (e) { return e.model; }, []);
|
|
87
|
-
/** 是否显示我方 */
|
|
88
|
-
var isMyShow = controller.useMemo(function (e) { return e.goodsListState.isMyShow; }, []);
|
|
89
|
-
/** 正在编辑的货物 */
|
|
90
|
-
var editGood = controller.useMemo(function (e) { return e.goodsListState.editGood; }, []);
|
|
91
|
-
/** 搜索条件 */
|
|
92
|
-
var searchValue = controller.useMemo(function (e) { return e.goodsListState.searchValue; }, []);
|
|
93
|
-
/** 税率列表 */
|
|
94
|
-
var taxRateList = controller.useMemo(function (e) { return e.goodsListState.taxRateList; }, []);
|
|
95
|
-
/** 单位列表 */
|
|
96
|
-
var unitList = controller.useMemo(function (e) { return e.goodsListState.unitList; }, []);
|
|
97
|
-
/** 商品表格补充配置 */
|
|
98
|
-
var columnsReplenish = controller.useMemo(function (e) { return e.goodsListState.columnsReplenish; }, []);
|
|
99
|
-
/** 扣除额 */
|
|
100
|
-
var deduction = controller.useMemo(function (e) { return e.goodsListState.deduction; }, []);
|
|
101
|
-
/** 计算中启动字段 */
|
|
102
|
-
var changeField = controller.useMemo(function (e) { return e.calculatingField; }, []);
|
|
103
|
-
/** 计算中启动字段 */
|
|
104
|
-
var setChangeField = react_1["default"].useCallback(function (value) { return controller.run(function (s) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
105
|
-
s.calculatingField = value;
|
|
106
|
-
return [2 /*return*/];
|
|
107
|
-
}); }); }); }, []);
|
|
108
|
-
var onNumberValueChange = react_1["default"].useCallback(function (e) {
|
|
109
|
-
var _a;
|
|
110
|
-
var value = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
111
|
-
if (value) {
|
|
112
|
-
return value.replace(/[^0-9-\.]/g, '');
|
|
113
|
-
}
|
|
114
|
-
}, []);
|
|
115
|
-
/** 获取补充校验规则 */
|
|
116
|
-
var getReplenishRules = react_1["default"].useCallback(function (id) {
|
|
117
|
-
return columnsReplenish[id] ? columnsReplenish[id].rules || [] : [];
|
|
118
|
-
}, [columnsReplenish]);
|
|
119
|
-
/** 金额整数位限制,不传默认9位 */
|
|
120
|
-
var priceIntegerDigit = controller.useMemo(function (e) { return e.priceIntegerDigit || 9; }, []);
|
|
121
|
-
/** 表头 */
|
|
122
|
-
var columns = react_1["default"].useMemo(function () {
|
|
123
|
-
var _a, _b, _c, _d, _e, _f;
|
|
124
|
-
return [
|
|
125
|
-
{
|
|
126
|
-
title: '序号',
|
|
127
|
-
key: 'serialNo',
|
|
128
|
-
dataIndex: 'serialNo',
|
|
129
|
-
width: 50,
|
|
130
|
-
render: function (e) { return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, e); }
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u9879\u76EE\u540D\u79F0"),
|
|
134
|
-
key: 'itemName',
|
|
135
|
-
render: function (_, record) {
|
|
136
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
137
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null,
|
|
138
|
-
react_1["default"].createElement("div", { style: { display: 'flex' } }, getFieldDecorator('itemName', {
|
|
139
|
-
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
140
|
-
rules: __spreadArrays(getReplenishRules('itemName'), [
|
|
141
|
-
{
|
|
142
|
-
validator: function (_, __, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
143
|
-
var value;
|
|
144
|
-
return __generator(this, function (_a) {
|
|
145
|
-
switch (_a.label) {
|
|
146
|
-
case 0: return [4 /*yield*/, controller.wait()];
|
|
147
|
-
case 1:
|
|
148
|
-
_a.sent();
|
|
149
|
-
value = controller.state.goodsListState.editGood;
|
|
150
|
-
if (!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf)) {
|
|
151
|
-
callback('项目名称不能为空');
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
return [2 /*return*/];
|
|
155
|
-
}
|
|
156
|
-
return [2 /*return*/];
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}); }
|
|
160
|
-
}
|
|
161
|
-
])
|
|
162
|
-
})(react_1["default"].createElement(ItemNameInput_1["default"], { shorthand: editGood.shorthand, suffix: react_1["default"].createElement(kts_xui_1.Tooltip, { title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F" },
|
|
163
|
-
react_1["default"].createElement(kts_xui_1.Button, { type: "link", style: { padding: 0, width: 20, fontSize: 20, fill: '#0074ff' }, icon: react_1["default"].createElement(plus_svg_1.ReactComponent, null), onClick: controller.pipeline(function (s) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
164
|
-
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
165
|
-
return [2 /*return*/];
|
|
166
|
-
}); }); }) })), onChange: function () {
|
|
167
|
-
autoFillFn_1.onChangeItemName(controller, form, record);
|
|
168
|
-
} })))));
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
return (react_1["default"].createElement("span", null,
|
|
172
|
-
record.lineAttribute === InvoiceController_1.LineAttributeType.折扣行 ? react_1["default"].createElement("span", { className: 'goods-list-digtal-discount-tag' }, "\u6298\u6263") : react_1["default"].createElement(react_1["default"].Fragment, null),
|
|
173
|
-
react_1["default"].createElement(MyItemNameDiv, { valueT: formatSearch(itemName_1.getItemNameWithShorthand({ shorthand: record.shorthand, full: record.itemNameSelf || '' }), searchValue), valueF: formatSearch(itemName_1.getItemNameWithShorthand({ shorthand: record.shorthand, full: record.itemName || '' }), searchValue), isMyShow: isMyShow })));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_a = columnsReplenish['itemModelName']) === null || _a === void 0 ? void 0 : _a.rules }, "\u89C4\u683C\u578B\u53F7"),
|
|
179
|
-
key: 'itemModelName',
|
|
180
|
-
width: 119,
|
|
181
|
-
render: function (_, record) {
|
|
182
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
183
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('itemModelName', {
|
|
184
|
-
initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName,
|
|
185
|
-
rules: getReplenishRules('itemModelName')
|
|
186
|
-
})(react_1["default"].createElement(MyInput, { onChange: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
|
-
var key, value;
|
|
188
|
-
return __generator(this, function (_a) {
|
|
189
|
-
switch (_a.label) {
|
|
190
|
-
case 0: return [4 /*yield*/, controller.wait()];
|
|
191
|
-
case 1:
|
|
192
|
-
_a.sent();
|
|
193
|
-
key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
|
|
194
|
-
value = {};
|
|
195
|
-
value[key] = form.getFieldsValue().itemModelName;
|
|
196
|
-
controller.setEditGood(value);
|
|
197
|
-
return [2 /*return*/];
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}); } }))));
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
return (react_1["default"].createElement(MyItemNameDiv, { valueT: formatSearch(record.itemModelNameSelf, searchValue), valueF: formatSearch(record.itemModelName, searchValue), isMyShow: isMyShow }));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_b = columnsReplenish['unit']) === null || _b === void 0 ? void 0 : _b.rules }, "\u5355\u4F4D"),
|
|
209
|
-
key: 'unit',
|
|
210
|
-
width: 70,
|
|
211
|
-
render: function (_, record) {
|
|
212
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
213
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('unit', {
|
|
214
|
-
initialValue: editGood.unit,
|
|
215
|
-
rules: getReplenishRules('unit')
|
|
216
|
-
})(react_1["default"].createElement(kts_xui_1.AutoComplete, { style: { width: '100%' }, dataSource: unitList, onChange: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
217
|
-
return __generator(this, function (_a) {
|
|
218
|
-
switch (_a.label) {
|
|
219
|
-
case 0: return [4 /*yield*/, controller.wait()
|
|
220
|
-
// const key = isMyShow ? 'unit' : 'unitOther';
|
|
221
|
-
// const value = {} as any;
|
|
222
|
-
// value[key] = form.getFieldsValue().unit;
|
|
223
|
-
];
|
|
224
|
-
case 1:
|
|
225
|
-
_a.sent();
|
|
226
|
-
// const key = isMyShow ? 'unit' : 'unitOther';
|
|
227
|
-
// const value = {} as any;
|
|
228
|
-
// value[key] = form.getFieldsValue().unit;
|
|
229
|
-
controller.setEditGood({ unit: form.getFieldsValue().unit });
|
|
230
|
-
return [2 /*return*/];
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}); } }))));
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, record.unit);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_c = columnsReplenish['quantity']) === null || _c === void 0 ? void 0 : _c.rules }, "\u6570\u91CF"),
|
|
242
|
-
dataIndex: 'quantity',
|
|
243
|
-
key: 'quantity',
|
|
244
|
-
align: 'right',
|
|
245
|
-
width: 149,
|
|
246
|
-
render: function (value, record) {
|
|
247
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
248
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('quantity', {
|
|
249
|
-
initialValue: editGood.quantity,
|
|
250
|
-
getValueFromEvent: onNumberValueChange,
|
|
251
|
-
rules: __spreadArrays(getReplenishRules('quantity'), [
|
|
252
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '数量必须为数字' },
|
|
253
|
-
{
|
|
254
|
-
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
255
|
-
var isvalue, isPrice;
|
|
256
|
-
return __generator(this, function (_a) {
|
|
257
|
-
switch (_a.label) {
|
|
258
|
-
case 0: return [4 /*yield*/, controller.wait()];
|
|
259
|
-
case 1:
|
|
260
|
-
_a.sent();
|
|
261
|
-
isvalue = !!value || value === 0;
|
|
262
|
-
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
263
|
-
if (isvalue || isPrice === isvalue)
|
|
264
|
-
return [2 /*return*/];
|
|
265
|
-
callback('请输入数量');
|
|
266
|
-
return [2 /*return*/];
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
}); }
|
|
270
|
-
}
|
|
271
|
-
])
|
|
272
|
-
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, maxLength: 16, loading: isCipher(changeField, "quantity"), onChange: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
273
|
-
return __generator(this, function (_a) {
|
|
274
|
-
switch (_a.label) {
|
|
275
|
-
case 0:
|
|
276
|
-
setChangeField('quantity');
|
|
277
|
-
return [4 /*yield*/, autoFillFn_1.onChangeQuantity(controller, form, record)];
|
|
278
|
-
case 1:
|
|
279
|
-
_a.sent();
|
|
280
|
-
return [2 /*return*/];
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
}); } }))));
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, value);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_d = columnsReplenish['priceIncludeTax']) === null || _d === void 0 ? void 0 : _d.rules }, "\u5355\u4EF7(\u542B\u7A0E)"),
|
|
292
|
-
dataIndex: 'priceIncludeTax',
|
|
293
|
-
key: 'priceIncludeTax',
|
|
294
|
-
align: 'right',
|
|
295
|
-
width: 149,
|
|
296
|
-
render: function (value, record) {
|
|
297
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
298
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('priceIncludeTax', {
|
|
299
|
-
initialValue: editGood.priceIncludeTax,
|
|
300
|
-
getValueFromEvent: onNumberValueChange,
|
|
301
|
-
rules: __spreadArrays(getReplenishRules('priceIncludeTax'), [
|
|
302
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
303
|
-
{
|
|
304
|
-
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
305
|
-
var isQuantity, isvalue;
|
|
306
|
-
return __generator(this, function (_a) {
|
|
307
|
-
switch (_a.label) {
|
|
308
|
-
case 0: return [4 /*yield*/, controller.wait()];
|
|
309
|
-
case 1:
|
|
310
|
-
_a.sent();
|
|
311
|
-
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
312
|
-
isvalue = !!value || value === 0;
|
|
313
|
-
if (isvalue || isQuantity === isvalue)
|
|
314
|
-
return [2 /*return*/];
|
|
315
|
-
callback('请输入单价');
|
|
316
|
-
return [2 /*return*/];
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
}); }
|
|
320
|
-
}
|
|
321
|
-
])
|
|
322
|
-
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, maxLength: 16, loading: isCipher(changeField, 'priceIncludeTax'), onChange: function () {
|
|
323
|
-
setChangeField('priceIncludeTax');
|
|
324
|
-
autoFillFn_1.onChangePriceIncludeTax(controller, form, record);
|
|
325
|
-
} }))));
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, value);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_e = columnsReplenish['priceExcludeTax']) === null || _e === void 0 ? void 0 : _e.rules }, "\u5355\u4EF7(\u4E0D\u542B\u7A0E)"),
|
|
334
|
-
dataIndex: 'priceExcludeTax',
|
|
335
|
-
key: 'priceExcludeTax',
|
|
336
|
-
align: 'right',
|
|
337
|
-
width: 149,
|
|
338
|
-
render: function (value, record) {
|
|
339
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
340
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('priceExcludeTax', {
|
|
341
|
-
initialValue: editGood.priceExcludeTax,
|
|
342
|
-
getValueFromEvent: onNumberValueChange,
|
|
343
|
-
rules: __spreadArrays(getReplenishRules('priceExcludeTax'), [
|
|
344
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
345
|
-
{
|
|
346
|
-
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
347
|
-
var isQuantity, isvalue;
|
|
348
|
-
return __generator(this, function (_a) {
|
|
349
|
-
switch (_a.label) {
|
|
350
|
-
case 0: return [4 /*yield*/, controller.wait()];
|
|
351
|
-
case 1:
|
|
352
|
-
_a.sent();
|
|
353
|
-
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
354
|
-
isvalue = !!value || value === 0;
|
|
355
|
-
if (isvalue || isQuantity === isvalue)
|
|
356
|
-
return [2 /*return*/];
|
|
357
|
-
callback('请输入单价');
|
|
358
|
-
return [2 /*return*/];
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
}); }
|
|
362
|
-
}
|
|
363
|
-
])
|
|
364
|
-
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, maxLength: 16, loading: isCipher(changeField, 'priceExcludeTax'), onChange: function () {
|
|
365
|
-
setChangeField('priceExcludeTax');
|
|
366
|
-
autoFillFn_1.onChangePriceExcludeTax(controller, form, record);
|
|
367
|
-
} }))));
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, value);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u91D1\u989D(\u542B\u7A0E)"),
|
|
376
|
-
dataIndex: 'lineAmountIncludeTax',
|
|
377
|
-
key: 'lineAmountIncludeTax',
|
|
378
|
-
width: 119,
|
|
379
|
-
align: 'right',
|
|
380
|
-
render: function (value, record) {
|
|
381
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
382
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('lineAmountIncludeTax', {
|
|
383
|
-
initialValue: editGood.lineAmountIncludeTax,
|
|
384
|
-
getValueFromEvent: onNumberValueChange,
|
|
385
|
-
rules: __spreadArrays(getReplenishRules('lineAmountIncludeTax'), [
|
|
386
|
-
{ required: true, message: '金额不能为空' },
|
|
387
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
388
|
-
{
|
|
389
|
-
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
390
|
-
return __generator(this, function (_a) {
|
|
391
|
-
if (("" + value).split('.')[0].length > priceIntegerDigit) {
|
|
392
|
-
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E" + priceIntegerDigit + "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D");
|
|
393
|
-
}
|
|
394
|
-
return [2 /*return*/];
|
|
395
|
-
});
|
|
396
|
-
}); }
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
400
|
-
return __generator(this, function (_a) {
|
|
401
|
-
if (deduction && parseFloat(value) <= deduction) {
|
|
402
|
-
callback('扣除额不能大于等于价税合计');
|
|
403
|
-
}
|
|
404
|
-
return [2 /*return*/];
|
|
405
|
-
});
|
|
406
|
-
}); }
|
|
407
|
-
},
|
|
408
|
-
])
|
|
409
|
-
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, loading: isCipher(changeField, 'lineAmountIncludeTax'), onChange: function () {
|
|
410
|
-
setChangeField('lineAmountIncludeTax');
|
|
411
|
-
autoFillFn_1.onChangeLineAmountIncludeTax(controller, form, record);
|
|
412
|
-
} }))));
|
|
413
|
-
}
|
|
414
|
-
else {
|
|
415
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
421
|
-
dataIndex: 'lineAmountExcludeTax',
|
|
422
|
-
key: 'lineAmountExcludeTax',
|
|
423
|
-
align: 'right',
|
|
424
|
-
width: 119,
|
|
425
|
-
render: function (value, record) {
|
|
426
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
427
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
|
|
428
|
-
initialValue: editGood.lineAmountExcludeTax,
|
|
429
|
-
getValueFromEvent: onNumberValueChange,
|
|
430
|
-
rules: __spreadArrays(getReplenishRules('lineAmountExcludeTax'), [
|
|
431
|
-
{ required: true, message: '金额不能为空' },
|
|
432
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
433
|
-
{
|
|
434
|
-
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
435
|
-
return __generator(this, function (_a) {
|
|
436
|
-
if (("" + value).split('.')[0].length > priceIntegerDigit) {
|
|
437
|
-
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E" + priceIntegerDigit + "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D");
|
|
438
|
-
}
|
|
439
|
-
return [2 /*return*/];
|
|
440
|
-
});
|
|
441
|
-
}); }
|
|
442
|
-
},
|
|
443
|
-
])
|
|
444
|
-
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, loading: isCipher(changeField, 'lineAmountExcludeTax'), onChange: function () {
|
|
445
|
-
setChangeField('lineAmountExcludeTax');
|
|
446
|
-
autoFillFn_1.onChangeLineAmountExcludeTax(controller, form, record);
|
|
447
|
-
} }))));
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u7A0E\u7387%"),
|
|
456
|
-
dataIndex: 'taxRate',
|
|
457
|
-
key: 'taxRate',
|
|
458
|
-
align: 'right',
|
|
459
|
-
width: 70,
|
|
460
|
-
render: function (value, record) {
|
|
461
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
462
|
-
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('taxRate', {
|
|
463
|
-
initialValue: editGood.taxRate,
|
|
464
|
-
rules: __spreadArrays(getReplenishRules('taxRate'), [
|
|
465
|
-
{ required: true, message: ' ' },
|
|
466
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: ' ' },
|
|
467
|
-
])
|
|
468
|
-
})(react_1["default"].createElement(kts_xui_1.Select, { className: "kts-invoice-operate-goods-list-table-tax-rate",
|
|
469
|
-
// dropdownMenuStyle={{ textAlign: "right" }}
|
|
470
|
-
showArrow: false, style: { width: '100%' }, onChange: function () {
|
|
471
|
-
setChangeField('taxRate');
|
|
472
|
-
autoFillFn_1.onChangeTaxRate(controller, form, record);
|
|
473
|
-
} }, taxRateList.map(function (e, i) {
|
|
474
|
-
return (react_1["default"].createElement(kts_xui_1.Select.Option, { key: i, value: e },
|
|
475
|
-
e,
|
|
476
|
-
"%"));
|
|
477
|
-
})))));
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } },
|
|
481
|
-
value,
|
|
482
|
-
"%");
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_f = columnsReplenish['taxAmount']) === null || _f === void 0 ? void 0 : _f.rules }, "\u7A0E\u989D"),
|
|
488
|
-
dataIndex: 'taxAmount',
|
|
489
|
-
key: 'taxAmount',
|
|
490
|
-
align: 'right',
|
|
491
|
-
width: 119,
|
|
492
|
-
render: function (value, record) {
|
|
493
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
494
|
-
return getFieldDecorator('taxAmount', {
|
|
495
|
-
initialValue: editGood.taxAmount,
|
|
496
|
-
rules: getReplenishRules('taxAmount')
|
|
497
|
-
})(react_1["default"].createElement(MyDiv, { loading: isCipher(changeField, 'taxAmount') }));
|
|
498
|
-
}
|
|
499
|
-
else {
|
|
500
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, parseFloat(value).toFixed(2));
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
},
|
|
504
|
-
]
|
|
505
|
-
// 含税不含税
|
|
506
|
-
.filter(function (e) {
|
|
507
|
-
if (isTaxIncluded) {
|
|
508
|
-
return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
|
|
509
|
-
}
|
|
510
|
-
else {
|
|
511
|
-
return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
|
|
512
|
-
}
|
|
513
|
-
})
|
|
514
|
-
// 只读
|
|
515
|
-
.filter(function (e) {
|
|
516
|
-
if (model === 'readOnly') {
|
|
517
|
-
return e.key !== 'operating';
|
|
518
|
-
}
|
|
519
|
-
else {
|
|
520
|
-
return true;
|
|
521
|
-
}
|
|
522
|
-
})
|
|
523
|
-
.map(function (e) {
|
|
524
|
-
return __assign(__assign({}, e), { ellipsis: true });
|
|
525
|
-
});
|
|
526
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish]);
|
|
527
|
-
// React.useEffect(() => {
|
|
528
|
-
// clearTimeout(t)
|
|
529
|
-
// const t = setTimeout(() => { setChangeField('') }, 1000);
|
|
530
|
-
// return () => { clearTimeout(t) }
|
|
531
|
-
// }, [changeField]);
|
|
532
|
-
return columns;
|
|
533
|
-
});
|
|
534
|
-
/** 字段 */
|
|
535
|
-
function isCipher(name, field) {
|
|
536
|
-
if (!name || !field)
|
|
537
|
-
return false;
|
|
538
|
-
return name !== field;
|
|
539
|
-
}
|
|
540
|
-
var MyInput = /** @class */ (function (_super) {
|
|
541
|
-
__extends(MyInput, _super);
|
|
542
|
-
function MyInput() {
|
|
543
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
544
|
-
}
|
|
545
|
-
MyInput.prototype.render = function () {
|
|
546
|
-
if (this.props.loading) {
|
|
547
|
-
return (react_1["default"].createElement(kts_xui_1.Spin, { size: "small" },
|
|
548
|
-
react_1["default"].createElement(kts_xui_1.Input, __assign({}, this.props, { autoComplete: "off" }))));
|
|
549
|
-
}
|
|
550
|
-
else {
|
|
551
|
-
return react_1["default"].createElement(kts_xui_1.Input, __assign({}, this.props, { autoComplete: "off" }));
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
return MyInput;
|
|
555
|
-
}(react_1["default"].Component));
|
|
556
|
-
var MyDiv = /** @class */ (function (_super) {
|
|
557
|
-
__extends(MyDiv, _super);
|
|
558
|
-
function MyDiv() {
|
|
559
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
560
|
-
}
|
|
561
|
-
MyDiv.prototype.render = function () {
|
|
562
|
-
if (this.props.loading) {
|
|
563
|
-
return (react_1["default"].createElement(kts_xui_1.Spin, { size: "small" },
|
|
564
|
-
react_1["default"].createElement("span", { style: { padding: '0 10px' } }, this.props.value)));
|
|
565
|
-
}
|
|
566
|
-
else {
|
|
567
|
-
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, this.props.value);
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
return MyDiv;
|
|
571
|
-
}(react_1["default"].Component));
|
|
572
|
-
var MyItemNameDiv = /** @class */ (function (_super) {
|
|
573
|
-
__extends(MyItemNameDiv, _super);
|
|
574
|
-
function MyItemNameDiv() {
|
|
575
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
576
|
-
}
|
|
577
|
-
MyItemNameDiv.prototype.render = function () {
|
|
578
|
-
var _a = this.props, isMyShow = _a.isMyShow, valueT = _a.valueT, valueF = _a.valueF;
|
|
579
|
-
if (isMyShow) {
|
|
580
|
-
if (valueT) {
|
|
581
|
-
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueT },
|
|
582
|
-
react_1["default"].createElement("span", { style: { padding: '0 10px', color: '#0074ff' } }, valueT)));
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueF },
|
|
586
|
-
react_1["default"].createElement("span", { style: { padding: '0 10px' } }, valueF)));
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
if (valueF) {
|
|
591
|
-
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueF },
|
|
592
|
-
react_1["default"].createElement("span", { style: { padding: '0 10px' } }, valueF)));
|
|
593
|
-
}
|
|
594
|
-
else {
|
|
595
|
-
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueT },
|
|
596
|
-
react_1["default"].createElement("span", { style: { padding: '0 10px', color: '#0074ff' } }, valueT)));
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
return MyItemNameDiv;
|
|
601
|
-
}(react_1["default"].Component));
|
|
602
|
-
/** 格式搜索结果 */
|
|
603
|
-
function formatSearch(value, search) {
|
|
604
|
-
if (!value || !search)
|
|
605
|
-
return value;
|
|
606
|
-
var __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(function (e) { return dcoding(e); }).join("<span class=\"kts-invoice-operate-goods-list-table-search-protrude\" >" + search + "</span>");
|
|
607
|
-
return react_1["default"].createElement("span", { dangerouslySetInnerHTML: { __html: __html } });
|
|
608
|
-
}
|
|
609
|
-
/** 编码 */
|
|
610
|
-
function ucoding(v) {
|
|
611
|
-
return v.split('').map(function (e) { return "U" + e.charCodeAt(0) + "E"; }).join('');
|
|
612
|
-
}
|
|
613
|
-
/** 解码 */
|
|
614
|
-
function dcoding(v) {
|
|
615
|
-
return v.split('U').map(function (e) { return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : ''; }).join('');
|
|
616
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
36
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
37
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
38
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
|
+
function step(op) {
|
|
40
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
+
while (_) try {
|
|
42
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
|
+
switch (op[0]) {
|
|
45
|
+
case 0: case 1: t = op; break;
|
|
46
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
47
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49
|
+
default:
|
|
50
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
51
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
52
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
53
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54
|
+
if (t[2]) _.ops.pop();
|
|
55
|
+
_.trys.pop(); continue;
|
|
56
|
+
}
|
|
57
|
+
op = body.call(thisArg, _);
|
|
58
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
63
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
64
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
65
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
66
|
+
r[k] = a[j];
|
|
67
|
+
return r;
|
|
68
|
+
};
|
|
69
|
+
exports.__esModule = true;
|
|
70
|
+
var react_1 = require("react");
|
|
71
|
+
var kts_components_antd_x3_1 = require("kts-components-antd-x3");
|
|
72
|
+
var plus_svg_1 = require("./svg/plus.svg");
|
|
73
|
+
var kts_xui_1 = require("kts-xui");
|
|
74
|
+
var itemName_1 = require("../../../../../tools/itemName");
|
|
75
|
+
var InvoiceController_1 = require("../../../../../InvoiceController");
|
|
76
|
+
var __1 = require("../../../../..");
|
|
77
|
+
var TitleText_1 = require("./ui/TitleText");
|
|
78
|
+
var ItemNameInput_1 = require("./ui/ItemNameInput");
|
|
79
|
+
var autoFillFn_1 = require("./autoFillFn");
|
|
80
|
+
exports["default"] = (function (form) {
|
|
81
|
+
var getFieldDecorator = form.getFieldDecorator, getFieldValue = form.getFieldValue;
|
|
82
|
+
var controller = __1["default"].useInvoiceController();
|
|
83
|
+
/** 是否含税 */
|
|
84
|
+
var isTaxIncluded = controller.useMemo(function (e) { return e.goodsListState.isTaxIncluded; }, []);
|
|
85
|
+
/** 组件模式 */
|
|
86
|
+
var model = controller.useMemo(function (e) { return e.model; }, []);
|
|
87
|
+
/** 是否显示我方 */
|
|
88
|
+
var isMyShow = controller.useMemo(function (e) { return e.goodsListState.isMyShow; }, []);
|
|
89
|
+
/** 正在编辑的货物 */
|
|
90
|
+
var editGood = controller.useMemo(function (e) { return e.goodsListState.editGood; }, []);
|
|
91
|
+
/** 搜索条件 */
|
|
92
|
+
var searchValue = controller.useMemo(function (e) { return e.goodsListState.searchValue; }, []);
|
|
93
|
+
/** 税率列表 */
|
|
94
|
+
var taxRateList = controller.useMemo(function (e) { return e.goodsListState.taxRateList; }, []);
|
|
95
|
+
/** 单位列表 */
|
|
96
|
+
var unitList = controller.useMemo(function (e) { return e.goodsListState.unitList; }, []);
|
|
97
|
+
/** 商品表格补充配置 */
|
|
98
|
+
var columnsReplenish = controller.useMemo(function (e) { return e.goodsListState.columnsReplenish; }, []);
|
|
99
|
+
/** 扣除额 */
|
|
100
|
+
var deduction = controller.useMemo(function (e) { return e.goodsListState.deduction; }, []);
|
|
101
|
+
/** 计算中启动字段 */
|
|
102
|
+
var changeField = controller.useMemo(function (e) { return e.calculatingField; }, []);
|
|
103
|
+
/** 计算中启动字段 */
|
|
104
|
+
var setChangeField = react_1["default"].useCallback(function (value) { return controller.run(function (s) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
105
|
+
s.calculatingField = value;
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}); }); }); }, []);
|
|
108
|
+
var onNumberValueChange = react_1["default"].useCallback(function (e) {
|
|
109
|
+
var _a;
|
|
110
|
+
var value = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
111
|
+
if (value) {
|
|
112
|
+
return value.replace(/[^0-9-\.]/g, '');
|
|
113
|
+
}
|
|
114
|
+
}, []);
|
|
115
|
+
/** 获取补充校验规则 */
|
|
116
|
+
var getReplenishRules = react_1["default"].useCallback(function (id) {
|
|
117
|
+
return columnsReplenish[id] ? columnsReplenish[id].rules || [] : [];
|
|
118
|
+
}, [columnsReplenish]);
|
|
119
|
+
/** 金额整数位限制,不传默认9位 */
|
|
120
|
+
var priceIntegerDigit = controller.useMemo(function (e) { return e.priceIntegerDigit || 9; }, []);
|
|
121
|
+
/** 表头 */
|
|
122
|
+
var columns = react_1["default"].useMemo(function () {
|
|
123
|
+
var _a, _b, _c, _d, _e, _f;
|
|
124
|
+
return [
|
|
125
|
+
{
|
|
126
|
+
title: '序号',
|
|
127
|
+
key: 'serialNo',
|
|
128
|
+
dataIndex: 'serialNo',
|
|
129
|
+
width: 50,
|
|
130
|
+
render: function (e) { return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, e); }
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u9879\u76EE\u540D\u79F0"),
|
|
134
|
+
key: 'itemName',
|
|
135
|
+
render: function (_, record) {
|
|
136
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
137
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null,
|
|
138
|
+
react_1["default"].createElement("div", { style: { display: 'flex' } }, getFieldDecorator('itemName', {
|
|
139
|
+
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
140
|
+
rules: __spreadArrays(getReplenishRules('itemName'), [
|
|
141
|
+
{
|
|
142
|
+
validator: function (_, __, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
143
|
+
var value;
|
|
144
|
+
return __generator(this, function (_a) {
|
|
145
|
+
switch (_a.label) {
|
|
146
|
+
case 0: return [4 /*yield*/, controller.wait()];
|
|
147
|
+
case 1:
|
|
148
|
+
_a.sent();
|
|
149
|
+
value = controller.state.goodsListState.editGood;
|
|
150
|
+
if (!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf)) {
|
|
151
|
+
callback('项目名称不能为空');
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
return [2 /*return*/];
|
|
155
|
+
}
|
|
156
|
+
return [2 /*return*/];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}); }
|
|
160
|
+
}
|
|
161
|
+
])
|
|
162
|
+
})(react_1["default"].createElement(ItemNameInput_1["default"], { shorthand: editGood.shorthand, suffix: react_1["default"].createElement(kts_xui_1.Tooltip, { title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F" },
|
|
163
|
+
react_1["default"].createElement(kts_xui_1.Button, { type: "link", style: { padding: 0, width: 20, fontSize: 20, fill: '#0074ff' }, icon: react_1["default"].createElement(plus_svg_1.ReactComponent, null), onClick: controller.pipeline(function (s) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
164
|
+
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
165
|
+
return [2 /*return*/];
|
|
166
|
+
}); }); }) })), onChange: function () {
|
|
167
|
+
autoFillFn_1.onChangeItemName(controller, form, record);
|
|
168
|
+
} })))));
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
return (react_1["default"].createElement("span", null,
|
|
172
|
+
record.lineAttribute === InvoiceController_1.LineAttributeType.折扣行 ? react_1["default"].createElement("span", { className: 'goods-list-digtal-discount-tag' }, "\u6298\u6263") : react_1["default"].createElement(react_1["default"].Fragment, null),
|
|
173
|
+
react_1["default"].createElement(MyItemNameDiv, { valueT: formatSearch(itemName_1.getItemNameWithShorthand({ shorthand: record.shorthand, full: record.itemNameSelf || '' }), searchValue), valueF: formatSearch(itemName_1.getItemNameWithShorthand({ shorthand: record.shorthand, full: record.itemName || '' }), searchValue), isMyShow: isMyShow })));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_a = columnsReplenish['itemModelName']) === null || _a === void 0 ? void 0 : _a.rules }, "\u89C4\u683C\u578B\u53F7"),
|
|
179
|
+
key: 'itemModelName',
|
|
180
|
+
width: 119,
|
|
181
|
+
render: function (_, record) {
|
|
182
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
183
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('itemModelName', {
|
|
184
|
+
initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName,
|
|
185
|
+
rules: getReplenishRules('itemModelName')
|
|
186
|
+
})(react_1["default"].createElement(MyInput, { onChange: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
|
+
var key, value;
|
|
188
|
+
return __generator(this, function (_a) {
|
|
189
|
+
switch (_a.label) {
|
|
190
|
+
case 0: return [4 /*yield*/, controller.wait()];
|
|
191
|
+
case 1:
|
|
192
|
+
_a.sent();
|
|
193
|
+
key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
|
|
194
|
+
value = {};
|
|
195
|
+
value[key] = form.getFieldsValue().itemModelName;
|
|
196
|
+
controller.setEditGood(value);
|
|
197
|
+
return [2 /*return*/];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}); } }))));
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
return (react_1["default"].createElement(MyItemNameDiv, { valueT: formatSearch(record.itemModelNameSelf, searchValue), valueF: formatSearch(record.itemModelName, searchValue), isMyShow: isMyShow }));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_b = columnsReplenish['unit']) === null || _b === void 0 ? void 0 : _b.rules }, "\u5355\u4F4D"),
|
|
209
|
+
key: 'unit',
|
|
210
|
+
width: 70,
|
|
211
|
+
render: function (_, record) {
|
|
212
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
213
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('unit', {
|
|
214
|
+
initialValue: editGood.unit,
|
|
215
|
+
rules: getReplenishRules('unit')
|
|
216
|
+
})(react_1["default"].createElement(kts_xui_1.AutoComplete, { style: { width: '100%' }, dataSource: unitList, onChange: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
|
+
case 0: return [4 /*yield*/, controller.wait()
|
|
220
|
+
// const key = isMyShow ? 'unit' : 'unitOther';
|
|
221
|
+
// const value = {} as any;
|
|
222
|
+
// value[key] = form.getFieldsValue().unit;
|
|
223
|
+
];
|
|
224
|
+
case 1:
|
|
225
|
+
_a.sent();
|
|
226
|
+
// const key = isMyShow ? 'unit' : 'unitOther';
|
|
227
|
+
// const value = {} as any;
|
|
228
|
+
// value[key] = form.getFieldsValue().unit;
|
|
229
|
+
controller.setEditGood({ unit: form.getFieldsValue().unit });
|
|
230
|
+
return [2 /*return*/];
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}); } }))));
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, record.unit);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_c = columnsReplenish['quantity']) === null || _c === void 0 ? void 0 : _c.rules }, "\u6570\u91CF"),
|
|
242
|
+
dataIndex: 'quantity',
|
|
243
|
+
key: 'quantity',
|
|
244
|
+
align: 'right',
|
|
245
|
+
width: 149,
|
|
246
|
+
render: function (value, record) {
|
|
247
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
248
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('quantity', {
|
|
249
|
+
initialValue: editGood.quantity,
|
|
250
|
+
getValueFromEvent: onNumberValueChange,
|
|
251
|
+
rules: __spreadArrays(getReplenishRules('quantity'), [
|
|
252
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '数量必须为数字' },
|
|
253
|
+
{
|
|
254
|
+
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
255
|
+
var isvalue, isPrice;
|
|
256
|
+
return __generator(this, function (_a) {
|
|
257
|
+
switch (_a.label) {
|
|
258
|
+
case 0: return [4 /*yield*/, controller.wait()];
|
|
259
|
+
case 1:
|
|
260
|
+
_a.sent();
|
|
261
|
+
isvalue = !!value || value === 0;
|
|
262
|
+
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
263
|
+
if (isvalue || isPrice === isvalue)
|
|
264
|
+
return [2 /*return*/];
|
|
265
|
+
callback('请输入数量');
|
|
266
|
+
return [2 /*return*/];
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}); }
|
|
270
|
+
}
|
|
271
|
+
])
|
|
272
|
+
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, maxLength: 16, loading: isCipher(changeField, "quantity"), onChange: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
273
|
+
return __generator(this, function (_a) {
|
|
274
|
+
switch (_a.label) {
|
|
275
|
+
case 0:
|
|
276
|
+
setChangeField('quantity');
|
|
277
|
+
return [4 /*yield*/, autoFillFn_1.onChangeQuantity(controller, form, record)];
|
|
278
|
+
case 1:
|
|
279
|
+
_a.sent();
|
|
280
|
+
return [2 /*return*/];
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}); } }))));
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, value);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_d = columnsReplenish['priceIncludeTax']) === null || _d === void 0 ? void 0 : _d.rules }, "\u5355\u4EF7(\u542B\u7A0E)"),
|
|
292
|
+
dataIndex: 'priceIncludeTax',
|
|
293
|
+
key: 'priceIncludeTax',
|
|
294
|
+
align: 'right',
|
|
295
|
+
width: 149,
|
|
296
|
+
render: function (value, record) {
|
|
297
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
298
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('priceIncludeTax', {
|
|
299
|
+
initialValue: editGood.priceIncludeTax,
|
|
300
|
+
getValueFromEvent: onNumberValueChange,
|
|
301
|
+
rules: __spreadArrays(getReplenishRules('priceIncludeTax'), [
|
|
302
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
303
|
+
{
|
|
304
|
+
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
305
|
+
var isQuantity, isvalue;
|
|
306
|
+
return __generator(this, function (_a) {
|
|
307
|
+
switch (_a.label) {
|
|
308
|
+
case 0: return [4 /*yield*/, controller.wait()];
|
|
309
|
+
case 1:
|
|
310
|
+
_a.sent();
|
|
311
|
+
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
312
|
+
isvalue = !!value || value === 0;
|
|
313
|
+
if (isvalue || isQuantity === isvalue)
|
|
314
|
+
return [2 /*return*/];
|
|
315
|
+
callback('请输入单价');
|
|
316
|
+
return [2 /*return*/];
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}); }
|
|
320
|
+
}
|
|
321
|
+
])
|
|
322
|
+
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, maxLength: 16, loading: isCipher(changeField, 'priceIncludeTax'), onChange: function () {
|
|
323
|
+
setChangeField('priceIncludeTax');
|
|
324
|
+
autoFillFn_1.onChangePriceIncludeTax(controller, form, record);
|
|
325
|
+
} }))));
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, value);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_e = columnsReplenish['priceExcludeTax']) === null || _e === void 0 ? void 0 : _e.rules }, "\u5355\u4EF7(\u4E0D\u542B\u7A0E)"),
|
|
334
|
+
dataIndex: 'priceExcludeTax',
|
|
335
|
+
key: 'priceExcludeTax',
|
|
336
|
+
align: 'right',
|
|
337
|
+
width: 149,
|
|
338
|
+
render: function (value, record) {
|
|
339
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
340
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('priceExcludeTax', {
|
|
341
|
+
initialValue: editGood.priceExcludeTax,
|
|
342
|
+
getValueFromEvent: onNumberValueChange,
|
|
343
|
+
rules: __spreadArrays(getReplenishRules('priceExcludeTax'), [
|
|
344
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
345
|
+
{
|
|
346
|
+
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
347
|
+
var isQuantity, isvalue;
|
|
348
|
+
return __generator(this, function (_a) {
|
|
349
|
+
switch (_a.label) {
|
|
350
|
+
case 0: return [4 /*yield*/, controller.wait()];
|
|
351
|
+
case 1:
|
|
352
|
+
_a.sent();
|
|
353
|
+
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
354
|
+
isvalue = !!value || value === 0;
|
|
355
|
+
if (isvalue || isQuantity === isvalue)
|
|
356
|
+
return [2 /*return*/];
|
|
357
|
+
callback('请输入单价');
|
|
358
|
+
return [2 /*return*/];
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}); }
|
|
362
|
+
}
|
|
363
|
+
])
|
|
364
|
+
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, maxLength: 16, loading: isCipher(changeField, 'priceExcludeTax'), onChange: function () {
|
|
365
|
+
setChangeField('priceExcludeTax');
|
|
366
|
+
autoFillFn_1.onChangePriceExcludeTax(controller, form, record);
|
|
367
|
+
} }))));
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, value);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u91D1\u989D(\u542B\u7A0E)"),
|
|
376
|
+
dataIndex: 'lineAmountIncludeTax',
|
|
377
|
+
key: 'lineAmountIncludeTax',
|
|
378
|
+
width: 119,
|
|
379
|
+
align: 'right',
|
|
380
|
+
render: function (value, record) {
|
|
381
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
382
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('lineAmountIncludeTax', {
|
|
383
|
+
initialValue: editGood.lineAmountIncludeTax,
|
|
384
|
+
getValueFromEvent: onNumberValueChange,
|
|
385
|
+
rules: __spreadArrays(getReplenishRules('lineAmountIncludeTax'), [
|
|
386
|
+
{ required: true, message: '金额不能为空' },
|
|
387
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
388
|
+
{
|
|
389
|
+
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
390
|
+
return __generator(this, function (_a) {
|
|
391
|
+
if (("" + value).split('.')[0].length > priceIntegerDigit) {
|
|
392
|
+
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E" + priceIntegerDigit + "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D");
|
|
393
|
+
}
|
|
394
|
+
return [2 /*return*/];
|
|
395
|
+
});
|
|
396
|
+
}); }
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
400
|
+
return __generator(this, function (_a) {
|
|
401
|
+
if (deduction && parseFloat(value) <= deduction) {
|
|
402
|
+
callback('扣除额不能大于等于价税合计');
|
|
403
|
+
}
|
|
404
|
+
return [2 /*return*/];
|
|
405
|
+
});
|
|
406
|
+
}); }
|
|
407
|
+
},
|
|
408
|
+
])
|
|
409
|
+
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, loading: isCipher(changeField, 'lineAmountIncludeTax'), onChange: function () {
|
|
410
|
+
setChangeField('lineAmountIncludeTax');
|
|
411
|
+
autoFillFn_1.onChangeLineAmountIncludeTax(controller, form, record);
|
|
412
|
+
} }))));
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
421
|
+
dataIndex: 'lineAmountExcludeTax',
|
|
422
|
+
key: 'lineAmountExcludeTax',
|
|
423
|
+
align: 'right',
|
|
424
|
+
width: 119,
|
|
425
|
+
render: function (value, record) {
|
|
426
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
427
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
|
|
428
|
+
initialValue: editGood.lineAmountExcludeTax,
|
|
429
|
+
getValueFromEvent: onNumberValueChange,
|
|
430
|
+
rules: __spreadArrays(getReplenishRules('lineAmountExcludeTax'), [
|
|
431
|
+
{ required: true, message: '金额不能为空' },
|
|
432
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额必须为数字' },
|
|
433
|
+
{
|
|
434
|
+
validator: function (_, value, callback) { return __awaiter(void 0, void 0, void 0, function () {
|
|
435
|
+
return __generator(this, function (_a) {
|
|
436
|
+
if (("" + value).split('.')[0].length > priceIntegerDigit) {
|
|
437
|
+
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E" + priceIntegerDigit + "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D");
|
|
438
|
+
}
|
|
439
|
+
return [2 /*return*/];
|
|
440
|
+
});
|
|
441
|
+
}); }
|
|
442
|
+
},
|
|
443
|
+
])
|
|
444
|
+
})(react_1["default"].createElement(MyInput, { style: { textAlign: 'right' }, loading: isCipher(changeField, 'lineAmountExcludeTax'), onChange: function () {
|
|
445
|
+
setChangeField('lineAmountExcludeTax');
|
|
446
|
+
autoFillFn_1.onChangeLineAmountExcludeTax(controller, form, record);
|
|
447
|
+
} }))));
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
title: react_1["default"].createElement(TitleText_1["default"], { required: true }, "\u7A0E\u7387%"),
|
|
456
|
+
dataIndex: 'taxRate',
|
|
457
|
+
key: 'taxRate',
|
|
458
|
+
align: 'right',
|
|
459
|
+
width: 70,
|
|
460
|
+
render: function (value, record) {
|
|
461
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
462
|
+
return (react_1["default"].createElement(kts_components_antd_x3_1.Form.Item, null, getFieldDecorator('taxRate', {
|
|
463
|
+
initialValue: editGood.taxRate,
|
|
464
|
+
rules: __spreadArrays(getReplenishRules('taxRate'), [
|
|
465
|
+
{ required: true, message: ' ' },
|
|
466
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: ' ' },
|
|
467
|
+
])
|
|
468
|
+
})(react_1["default"].createElement(kts_xui_1.Select, { className: "kts-invoice-operate-goods-list-table-tax-rate",
|
|
469
|
+
// dropdownMenuStyle={{ textAlign: "right" }}
|
|
470
|
+
showArrow: false, style: { width: '100%' }, onChange: function () {
|
|
471
|
+
setChangeField('taxRate');
|
|
472
|
+
autoFillFn_1.onChangeTaxRate(controller, form, record);
|
|
473
|
+
} }, taxRateList.map(function (e, i) {
|
|
474
|
+
return (react_1["default"].createElement(kts_xui_1.Select.Option, { key: i, value: e },
|
|
475
|
+
e,
|
|
476
|
+
"%"));
|
|
477
|
+
})))));
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } },
|
|
481
|
+
value,
|
|
482
|
+
"%");
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
title: react_1["default"].createElement(TitleText_1["default"], { rules: (_f = columnsReplenish['taxAmount']) === null || _f === void 0 ? void 0 : _f.rules }, "\u7A0E\u989D"),
|
|
488
|
+
dataIndex: 'taxAmount',
|
|
489
|
+
key: 'taxAmount',
|
|
490
|
+
align: 'right',
|
|
491
|
+
width: 119,
|
|
492
|
+
render: function (value, record) {
|
|
493
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
494
|
+
return getFieldDecorator('taxAmount', {
|
|
495
|
+
initialValue: editGood.taxAmount,
|
|
496
|
+
rules: getReplenishRules('taxAmount')
|
|
497
|
+
})(react_1["default"].createElement(MyDiv, { loading: isCipher(changeField, 'taxAmount') }));
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, parseFloat(value).toFixed(2));
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
]
|
|
505
|
+
// 含税不含税
|
|
506
|
+
.filter(function (e) {
|
|
507
|
+
if (isTaxIncluded) {
|
|
508
|
+
return !(e.key === 'priceExcludeTax' || e.key === 'lineAmountExcludeTax');
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
|
|
512
|
+
}
|
|
513
|
+
})
|
|
514
|
+
// 只读
|
|
515
|
+
.filter(function (e) {
|
|
516
|
+
if (model === 'readOnly') {
|
|
517
|
+
return e.key !== 'operating';
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
return true;
|
|
521
|
+
}
|
|
522
|
+
})
|
|
523
|
+
.map(function (e) {
|
|
524
|
+
return __assign(__assign({}, e), { ellipsis: true });
|
|
525
|
+
});
|
|
526
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish]);
|
|
527
|
+
// React.useEffect(() => {
|
|
528
|
+
// clearTimeout(t)
|
|
529
|
+
// const t = setTimeout(() => { setChangeField('') }, 1000);
|
|
530
|
+
// return () => { clearTimeout(t) }
|
|
531
|
+
// }, [changeField]);
|
|
532
|
+
return columns;
|
|
533
|
+
});
|
|
534
|
+
/** 字段 */
|
|
535
|
+
function isCipher(name, field) {
|
|
536
|
+
if (!name || !field)
|
|
537
|
+
return false;
|
|
538
|
+
return name !== field;
|
|
539
|
+
}
|
|
540
|
+
var MyInput = /** @class */ (function (_super) {
|
|
541
|
+
__extends(MyInput, _super);
|
|
542
|
+
function MyInput() {
|
|
543
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
544
|
+
}
|
|
545
|
+
MyInput.prototype.render = function () {
|
|
546
|
+
if (this.props.loading) {
|
|
547
|
+
return (react_1["default"].createElement(kts_xui_1.Spin, { size: "small" },
|
|
548
|
+
react_1["default"].createElement(kts_xui_1.Input, __assign({}, this.props, { autoComplete: "off" }))));
|
|
549
|
+
}
|
|
550
|
+
else {
|
|
551
|
+
return react_1["default"].createElement(kts_xui_1.Input, __assign({}, this.props, { autoComplete: "off" }));
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
return MyInput;
|
|
555
|
+
}(react_1["default"].Component));
|
|
556
|
+
var MyDiv = /** @class */ (function (_super) {
|
|
557
|
+
__extends(MyDiv, _super);
|
|
558
|
+
function MyDiv() {
|
|
559
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
560
|
+
}
|
|
561
|
+
MyDiv.prototype.render = function () {
|
|
562
|
+
if (this.props.loading) {
|
|
563
|
+
return (react_1["default"].createElement(kts_xui_1.Spin, { size: "small" },
|
|
564
|
+
react_1["default"].createElement("span", { style: { padding: '0 10px' } }, this.props.value)));
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
return react_1["default"].createElement("span", { style: { padding: '0 10px' } }, this.props.value);
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
return MyDiv;
|
|
571
|
+
}(react_1["default"].Component));
|
|
572
|
+
var MyItemNameDiv = /** @class */ (function (_super) {
|
|
573
|
+
__extends(MyItemNameDiv, _super);
|
|
574
|
+
function MyItemNameDiv() {
|
|
575
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
576
|
+
}
|
|
577
|
+
MyItemNameDiv.prototype.render = function () {
|
|
578
|
+
var _a = this.props, isMyShow = _a.isMyShow, valueT = _a.valueT, valueF = _a.valueF;
|
|
579
|
+
if (isMyShow) {
|
|
580
|
+
if (valueT) {
|
|
581
|
+
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueT },
|
|
582
|
+
react_1["default"].createElement("span", { style: { padding: '0 10px', color: '#0074ff' } }, valueT)));
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueF },
|
|
586
|
+
react_1["default"].createElement("span", { style: { padding: '0 10px' } }, valueF)));
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
if (valueF) {
|
|
591
|
+
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueF },
|
|
592
|
+
react_1["default"].createElement("span", { style: { padding: '0 10px' } }, valueF)));
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
return (react_1["default"].createElement(kts_xui_1.Tooltip, { title: valueT },
|
|
596
|
+
react_1["default"].createElement("span", { style: { padding: '0 10px', color: '#0074ff' } }, valueT)));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
return MyItemNameDiv;
|
|
601
|
+
}(react_1["default"].Component));
|
|
602
|
+
/** 格式搜索结果 */
|
|
603
|
+
function formatSearch(value, search) {
|
|
604
|
+
if (!value || !search)
|
|
605
|
+
return value;
|
|
606
|
+
var __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(function (e) { return dcoding(e); }).join("<span class=\"kts-invoice-operate-goods-list-table-search-protrude\" >" + search + "</span>");
|
|
607
|
+
return react_1["default"].createElement("span", { dangerouslySetInnerHTML: { __html: __html } });
|
|
608
|
+
}
|
|
609
|
+
/** 编码 */
|
|
610
|
+
function ucoding(v) {
|
|
611
|
+
return v.split('').map(function (e) { return "U" + e.charCodeAt(0) + "E"; }).join('');
|
|
612
|
+
}
|
|
613
|
+
/** 解码 */
|
|
614
|
+
function dcoding(v) {
|
|
615
|
+
return v.split('U').map(function (e) { return e ? String.fromCharCode(parseInt(e.replace('E', ''))) : ''; }).join('');
|
|
616
|
+
}
|