kts-component-invoice-operate 3.2.246 → 3.2.248
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/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +2 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +6 -0
- package/dist/Invoice/ui/default/MeiTanModal/index.d.ts +4 -0
- package/dist/index.esm.js +329 -41
- package/dist/index.js +328 -40
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/importGoods/index.tsx +671 -1
- package/src/Invoice/Invoice-digtal/index.md +6 -7
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +2 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +17 -1
- package/src/Invoice/_test/importGoods/index.tsx +72 -4
- package/src/Invoice/index.md +5 -5
- package/src/Invoice/index.tsx +3 -0
- package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +23 -15
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +46 -43
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +7 -1
- package/src/Invoice/ui/default/MeiTanModal/index.less +40 -0
- package/src/Invoice/ui/default/MeiTanModal/index.tsx +155 -0
|
@@ -26,20 +26,19 @@
|
|
|
26
26
|
<code src="./_test/disabled/index.tsx"></code>
|
|
27
27
|
|
|
28
28
|
## 导入关系人
|
|
29
|
-
<code src="./_test/importStakeholder/index.tsx"></code
|
|
29
|
+
<code src="./_test/importStakeholder/index.tsx"></code>-->
|
|
30
|
+
|
|
31
|
+
|
|
30
32
|
|
|
31
33
|
## 导入项目
|
|
32
34
|
<code src="./_test/importGoods/index.tsx"></code>
|
|
33
35
|
|
|
34
|
-
## 预制模式
|
|
36
|
+
<!-- ## 预制模式
|
|
35
37
|
<code src="./_test/prefab/index.tsx"></code>
|
|
36
38
|
|
|
37
39
|
## 查看当前可用授信额度
|
|
38
|
-
<code src="./_test/lineCredit/index.tsx"></code>
|
|
39
|
-
|
|
40
|
+
<code src="./_test/lineCredit/index.tsx"></code> -->
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
-->
|
|
43
|
-
<!--
|
|
44
43
|
## 货物运输服务
|
|
45
|
-
<code src="./_test/freight/index.tsx"></code>
|
|
44
|
+
<code src="./_test/freight/index.tsx"></code>
|
|
@@ -23,7 +23,7 @@ export default class GoodsListState {
|
|
|
23
23
|
|
|
24
24
|
/** 是否根据税收分类编码改变商品的可选税率 */
|
|
25
25
|
isUpdateGoodsTaxRateList = false;
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
/** 是否能添加折扣行 */
|
|
28
28
|
isAddDiscount?: boolean;
|
|
29
29
|
|
|
@@ -131,4 +131,20 @@ export default class GoodsListState {
|
|
|
131
131
|
/** 商品校验是否关闭,默认开启 */
|
|
132
132
|
isValidateGood = true;
|
|
133
133
|
|
|
134
|
+
/** 煤炭类校验是否关闭,默认开启 */
|
|
135
|
+
isValidateMeiTan = true;
|
|
136
|
+
|
|
137
|
+
/** 煤炭种类赋值商品索引 */
|
|
138
|
+
meiTanGoodIndex?: string[] = [];
|
|
139
|
+
|
|
140
|
+
/** 煤炭时校验函数 */
|
|
141
|
+
verifyMeiTanFn: (record: any) => Promise<boolean> = async record => {
|
|
142
|
+
const { taxClassificationCode } = record;
|
|
143
|
+
if (taxClassificationCode === '1020101000000000000' || taxClassificationCode === '1020102000000000000' || taxClassificationCode === '1020199000000000000') {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return false;
|
|
148
|
+
};
|
|
149
|
+
|
|
134
150
|
}
|
|
@@ -147,6 +147,40 @@ class MyInvoiceController extends InvoiceController {
|
|
|
147
147
|
this.state.goodsListState.endowCode.onSearchTaxClassificationCode = async (value: any) => {
|
|
148
148
|
console.log(value, 'value-onSearchTaxClassificationCode');
|
|
149
149
|
|
|
150
|
+
if(value === '1020199000000000000') {
|
|
151
|
+
return [
|
|
152
|
+
{
|
|
153
|
+
"taxCategoryCode": "1020199000000000000",
|
|
154
|
+
"productName": "其他煤炭",
|
|
155
|
+
"shorthand": "其他煤炭",
|
|
156
|
+
"id": null,
|
|
157
|
+
"specification": null,
|
|
158
|
+
"createTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
159
|
+
"status": 1,
|
|
160
|
+
"versionCode": "48.0",
|
|
161
|
+
"version": "32.0",
|
|
162
|
+
"startTime": "20190401",
|
|
163
|
+
"endTime": null,
|
|
164
|
+
"cargo": null,
|
|
165
|
+
"desc": null,
|
|
166
|
+
"taxRate": "",
|
|
167
|
+
"keyword": "金融服务",
|
|
168
|
+
"summarizedItem": "Y",
|
|
169
|
+
"countCode": null,
|
|
170
|
+
"customsItem": null,
|
|
171
|
+
"updateTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
172
|
+
"hzx": "Y",
|
|
173
|
+
"children": null,
|
|
174
|
+
"vatspecialManagement": "",
|
|
175
|
+
"pid": "3000000000000000000",
|
|
176
|
+
"vatpolicyBasis": null,
|
|
177
|
+
"vatspecialManagementCode": "",
|
|
178
|
+
"gstpolicyBasisCode": null,
|
|
179
|
+
"gstspecialManagement": null,
|
|
180
|
+
"gstpolicyBasis": null
|
|
181
|
+
},
|
|
182
|
+
]
|
|
183
|
+
}
|
|
150
184
|
return [
|
|
151
185
|
{
|
|
152
186
|
"taxCategoryCode": "1030206030000000000",
|
|
@@ -183,6 +217,40 @@ class MyInvoiceController extends InvoiceController {
|
|
|
183
217
|
|
|
184
218
|
this.state.goodsListState.endowCode.onLoadTaxClassificationCode = async (value: any) => {
|
|
185
219
|
console.log(value, 'value-onSearchTaxClassificationCode');
|
|
220
|
+
if(value === '1020199000000000000') {
|
|
221
|
+
return [
|
|
222
|
+
{
|
|
223
|
+
"taxCategoryCode": "1020199000000000000",
|
|
224
|
+
"productName": "其他煤炭",
|
|
225
|
+
"shorthand": "其他煤炭",
|
|
226
|
+
"id": null,
|
|
227
|
+
"specification": null,
|
|
228
|
+
"createTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
229
|
+
"status": 1,
|
|
230
|
+
"versionCode": "48.0",
|
|
231
|
+
"version": "32.0",
|
|
232
|
+
"startTime": "20190401",
|
|
233
|
+
"endTime": null,
|
|
234
|
+
"cargo": null,
|
|
235
|
+
"desc": null,
|
|
236
|
+
"taxRate": "",
|
|
237
|
+
"keyword": "金融服务",
|
|
238
|
+
"summarizedItem": "Y",
|
|
239
|
+
"countCode": null,
|
|
240
|
+
"customsItem": null,
|
|
241
|
+
"updateTime": "Tue Jun 20 14:55:37 CST 2023",
|
|
242
|
+
"hzx": "Y",
|
|
243
|
+
"children": null,
|
|
244
|
+
"vatspecialManagement": "",
|
|
245
|
+
"pid": "3000000000000000000",
|
|
246
|
+
"vatpolicyBasis": null,
|
|
247
|
+
"vatspecialManagementCode": "",
|
|
248
|
+
"gstpolicyBasisCode": null,
|
|
249
|
+
"gstspecialManagement": null,
|
|
250
|
+
"gstpolicyBasis": null
|
|
251
|
+
},
|
|
252
|
+
]
|
|
253
|
+
}
|
|
186
254
|
if(value === '3000000000000000000') {
|
|
187
255
|
return [
|
|
188
256
|
{
|
|
@@ -809,7 +877,7 @@ const getMok = async (current: number = 1) => {
|
|
|
809
877
|
"id": 146200,
|
|
810
878
|
"internalNumber": "发动机盖",
|
|
811
879
|
"isUalityInspection": null,
|
|
812
|
-
"name": "
|
|
880
|
+
"name": "原煤",
|
|
813
881
|
"preferentialPoliciesType": null,
|
|
814
882
|
"priceAmount": 50,
|
|
815
883
|
"procurementCycle": 0,
|
|
@@ -817,7 +885,7 @@ const getMok = async (current: number = 1) => {
|
|
|
817
885
|
"specification": "abc",
|
|
818
886
|
"spuCode": "6000001738252675",
|
|
819
887
|
"status": 1,
|
|
820
|
-
"taxCategoryCode": "
|
|
888
|
+
"taxCategoryCode": "1020101000000000000",
|
|
821
889
|
"taxExemptionType": "",
|
|
822
890
|
"taxId": 11,
|
|
823
891
|
"taxRate": null,
|
|
@@ -825,13 +893,13 @@ const getMok = async (current: number = 1) => {
|
|
|
825
893
|
"unitName": "件",
|
|
826
894
|
"itemType": "通用",
|
|
827
895
|
"itemNo": "6000001738252675",
|
|
828
|
-
"itemName": "
|
|
896
|
+
"itemName": "原煤",
|
|
829
897
|
"itemCode": "123123",
|
|
830
898
|
"itemModelName": "abc",
|
|
831
899
|
"unit": "件",
|
|
832
900
|
"priceIncludeTax": 50,
|
|
833
901
|
"priceExcludeTax": 50,
|
|
834
|
-
"taxClassificationCode": "
|
|
902
|
+
"taxClassificationCode": "1020101000000000000"
|
|
835
903
|
},
|
|
836
904
|
{
|
|
837
905
|
"attributeVOList": null,
|
package/src/Invoice/index.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# 默认
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 简单用法
|
|
4
4
|
<code src="./_test/easiest/index.tsx"></code>
|
|
5
5
|
|
|
6
6
|
## 设置为草稿,设置默认参数 扩展按钮
|
|
7
7
|
<code src="./_test/draft/index.tsx" title="类似的操作,请查看API" ></code>
|
|
8
8
|
|
|
9
9
|
## 设置购买方名称搜索
|
|
10
|
-
<code src="./_test/buyerNameSearch/index.tsx"></code>
|
|
10
|
+
<code src="./_test/buyerNameSearch/index.tsx"></code>
|
|
11
11
|
|
|
12
12
|
## 设置扣除额(差额征税)
|
|
13
13
|
<code src="./_test/deduction/index.tsx"></code>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<code src="./_test/goodsMenuExpand/index.tsx" title="查看 Console" ></code>
|
|
38
38
|
|
|
39
39
|
## 设置数据源 获取发票单据编号
|
|
40
|
-
<code src="./_test/setDataSource/index.tsx" ></code
|
|
40
|
+
<code src="./_test/setDataSource/index.tsx" ></code>-->
|
|
41
41
|
|
|
42
42
|
## 设置数据源 导入购买方
|
|
43
43
|
<code src="./_test/importBuyer/index.tsx"></code>
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
## 设置数据源 赋码 税收分类编码列表
|
|
49
49
|
<code src="./_test/endowCode/index.tsx"></code>
|
|
50
50
|
|
|
51
|
-
<API name="Invoice 发票组件 API" exports='["default"]' src="./index.tsx" ></API>
|
|
51
|
+
<!-- <API name="Invoice 发票组件 API" exports='["default"]' src="./index.tsx" ></API>
|
|
52
52
|
<API name="InvoiceHeader 发票头 API" exports='["default"]' src="./ui/default/InvoiceHeader/index.tsx"></API>
|
|
53
53
|
<API name="GoodsList 商品列表 API" exports='["default"]' src="./ui/default/GoodsList/index.tsx"></API>
|
|
54
54
|
<API name="Buyer 购买方 API" exports='["default"]' src="./ui/default/Buyer/index.tsx"></API>
|
|
55
55
|
<API name="Seller 销售方 API" exports='["default"]' src="./ui/default/Seller/index.tsx"></API>
|
|
56
|
-
<API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API>
|
|
56
|
+
<API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API> -->
|
package/src/Invoice/index.tsx
CHANGED
|
@@ -27,6 +27,7 @@ import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
|
|
|
27
27
|
import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
|
|
28
28
|
import EndowCodeDrawer from './ui/default/EndowCodeDrawer';
|
|
29
29
|
import AddComparisonDrawer from './ui/default/AddComparisonDrawer';
|
|
30
|
+
import MeiTanModal from './ui/default/MeiTanModal';
|
|
30
31
|
// import { create, all } from 'mathjs';
|
|
31
32
|
// const config = {
|
|
32
33
|
// number: 'BigNumber',
|
|
@@ -164,6 +165,7 @@ const Main = (props: IInvoiceProps) => {
|
|
|
164
165
|
<ImportGoodsDrawer />{/* 导入货品的抽屉 */}
|
|
165
166
|
<EndowCodeDrawer />{/* 给货品赋码的抽屉 */}
|
|
166
167
|
<AddComparisonDrawer />{/* 添加商品对照的抽屉 */}
|
|
168
|
+
<MeiTanModal /> {/* 煤炭类弹框 */}
|
|
167
169
|
</InvoiceContext.Provider>
|
|
168
170
|
);
|
|
169
171
|
};
|
|
@@ -193,6 +195,7 @@ const Digtal = (props: IInvoiceProps) => {
|
|
|
193
195
|
|
|
194
196
|
<ImportGoodsDrawer />{ /** 导入货品的抽屉 */}
|
|
195
197
|
<EndowCodeDrawer />{ /** 给货品赋码的抽屉 */}
|
|
198
|
+
<MeiTanModal /> {/* 煤炭类弹框 */}
|
|
196
199
|
</InvoiceContext.Provider>
|
|
197
200
|
)
|
|
198
201
|
}
|
|
@@ -317,9 +317,9 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
317
317
|
const [list, setList] = React.useState<any>([]);
|
|
318
318
|
|
|
319
319
|
const onSearch = React.useCallback(async (value: any = null) => {
|
|
320
|
-
if(value?.target?.value){
|
|
320
|
+
if (value?.target?.value) {
|
|
321
321
|
const arr = await controller.state.goodsListState.endowCode.onSearchTaxClassificationCode(value?.target?.value);
|
|
322
|
-
const list: any[] = arr.map((item: any)=> {
|
|
322
|
+
const list: any[] = arr.map((item: any) => {
|
|
323
323
|
return {
|
|
324
324
|
...item,
|
|
325
325
|
title: `${item.productName} ${item.taxCategoryCode}`,
|
|
@@ -335,7 +335,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
335
335
|
|
|
336
336
|
const onLoad = React.useCallback(async (value?: any) => {
|
|
337
337
|
const arr = await controller.state.goodsListState.endowCode.onLoadTaxClassificationCode(value?.taxCategoryCode);
|
|
338
|
-
const data: any[] = arr.map((item: any)=> {
|
|
338
|
+
const data: any[] = arr.map((item: any) => {
|
|
339
339
|
return {
|
|
340
340
|
...item,
|
|
341
341
|
title: `${item.productName} ${item.taxCategoryCode}`,
|
|
@@ -345,8 +345,8 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
345
345
|
|
|
346
346
|
const treeData = optimizeTreeData(data);
|
|
347
347
|
|
|
348
|
-
if(value?.key) {
|
|
349
|
-
setList((origin: any)=> {
|
|
348
|
+
if (value?.key) {
|
|
349
|
+
setList((origin: any) => {
|
|
350
350
|
updateTreeData(origin, value.key, treeData)
|
|
351
351
|
});
|
|
352
352
|
} else {
|
|
@@ -386,20 +386,20 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
386
386
|
// });
|
|
387
387
|
let node = info.node || info;
|
|
388
388
|
actions.setFieldState('taxClassificationCode', async s => {
|
|
389
|
-
if(node.taxCategoryCode) {
|
|
389
|
+
if (node.taxCategoryCode) {
|
|
390
390
|
s.value = node.taxCategoryCode
|
|
391
391
|
}
|
|
392
392
|
});
|
|
393
393
|
|
|
394
394
|
actions.setFieldState('shorthand', async (s) => {
|
|
395
|
-
if (node.shorthand){
|
|
395
|
+
if (node.shorthand) {
|
|
396
396
|
s.value = node.shorthand
|
|
397
397
|
}
|
|
398
|
-
});
|
|
398
|
+
});
|
|
399
399
|
setOpen(false);
|
|
400
400
|
}, [controller, actions]);
|
|
401
401
|
|
|
402
|
-
const onSelect = React.useCallback((key: any, info: any) => {
|
|
402
|
+
const onSelect = React.useCallback((key: any, info: any) => {
|
|
403
403
|
let node = info.node || info;
|
|
404
404
|
if (controller.state.goodsListState.isUpdateGoodsTaxRateList) {
|
|
405
405
|
if (node.taxRateList?.length) {
|
|
@@ -421,7 +421,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
421
421
|
}, [controller, actions]);
|
|
422
422
|
|
|
423
423
|
const optimizeTreeData = (data: any): any => {
|
|
424
|
-
return data.map((item: any)=> {
|
|
424
|
+
return data.map((item: any) => {
|
|
425
425
|
return {
|
|
426
426
|
...item,
|
|
427
427
|
selectable: item?.hzx === 'N',
|
|
@@ -459,7 +459,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
459
459
|
info={info}
|
|
460
460
|
onSelect={onSelect}
|
|
461
461
|
onSubmit={onSubmit1}
|
|
462
|
-
onCancel={()=> {setOpen(false); setInfo({})}}
|
|
462
|
+
onCancel={() => { setOpen(false); setInfo({}) }}
|
|
463
463
|
onSearch={onSearch}
|
|
464
464
|
onLoad={onLoad}
|
|
465
465
|
/>
|
|
@@ -486,11 +486,12 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
486
486
|
good.taxFreeType = values.taxFreeType;
|
|
487
487
|
good.favouredPolicyMark = values.favouredPolicyMark;
|
|
488
488
|
good.favouredPolicyName = values.favouredPolicyName;
|
|
489
|
+
good.mtzlDm = undefined; //设置成空
|
|
489
490
|
|
|
490
491
|
// 无论是否含税,都保持价税合计不变
|
|
491
492
|
good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
|
|
492
|
-
if (good.taxAmount || good.taxAmount === 0
|
|
493
|
-
good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
|
|
493
|
+
if (good.taxAmount || good.taxAmount === 0) {
|
|
494
|
+
good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
|
|
494
495
|
}
|
|
495
496
|
if (good.lineAmountExcludeTax && good.quantity) {
|
|
496
497
|
good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
|
|
@@ -500,8 +501,15 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
500
501
|
good.goodsTaxRateList = goodsTaxRateList;
|
|
501
502
|
|
|
502
503
|
});
|
|
503
|
-
|
|
504
504
|
s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
|
|
505
|
+
|
|
506
|
+
// 煤炭类判断
|
|
507
|
+
if (s.goodsListState.isValidateMeiTan) {
|
|
508
|
+
if (await s.goodsListState.verifyMeiTanFn(values) === true) {
|
|
509
|
+
s.goodsListState.meiTanGoodIndex = s.goodsListState.endowCode.endowcodeGoodIndex.slice();
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
505
513
|
s.goodsListState.endowCode.endowcodeGoodIndex = [];
|
|
506
514
|
})();
|
|
507
515
|
}, [controller, goodsTaxRateList]);
|
|
@@ -532,7 +540,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
532
540
|
}, [controller]);
|
|
533
541
|
|
|
534
542
|
return (
|
|
535
|
-
<SchemaForm actions={actions} previewPlaceholder=" "
|
|
543
|
+
<SchemaForm actions={actions} previewPlaceholder=" " components={{ ...components, showSearch: !!controller.state.goodsListState.endowCode.onLoadTaxClassificationCode ? ShowSearch3 : ShowSearch }} effects={effects}>
|
|
536
544
|
<FormButtonGroup>
|
|
537
545
|
<Field
|
|
538
546
|
name="taxClassificationCode"
|
|
@@ -24,6 +24,7 @@ import { getItemNameWithShorthand } from '../../../../../tools/itemName';
|
|
|
24
24
|
import Drag from './ui/Drag';
|
|
25
25
|
import { nonScientificNotation } from '../../../../../tools/calculate';
|
|
26
26
|
import Expand from './ui/Expand';
|
|
27
|
+
import { render } from 'react-dom';
|
|
27
28
|
|
|
28
29
|
export default (form: WrappedFormUtils) => {
|
|
29
30
|
const { getFieldDecorator, getFieldValue } = form;
|
|
@@ -552,50 +553,53 @@ export default (form: WrappedFormUtils) => {
|
|
|
552
553
|
key: 'taxAmount',
|
|
553
554
|
align: 'right',
|
|
554
555
|
width: 119,
|
|
555
|
-
|
|
556
|
-
...getReplenishRules('taxAmount'),
|
|
557
|
-
{ required: isEnables('taxAmount'), message: '税额不能为空' },
|
|
558
|
-
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '税额必须为数字' },
|
|
559
|
-
{
|
|
560
|
-
validator: (rule: any, value: any, callback: any) => {
|
|
561
|
-
//含税金额
|
|
562
|
-
const lineAmountIncludeTax = editGood?.lineAmountIncludeTax || 0;
|
|
563
|
-
//不含税金额
|
|
564
|
-
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
565
|
-
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax || 0)).subtract(bignumber(value || 0));
|
|
566
|
-
const taxRate = editGood?.taxRate;
|
|
567
|
-
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
568
|
-
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
569
|
-
const total = lineAmountExcludeTax.multiply(bignumber(taxRate || 0)).divide(bignumber(100));
|
|
570
|
-
// if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
571
|
-
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
572
|
-
callback();
|
|
573
|
-
} else {
|
|
574
|
-
callback('税额填写错误,请重新输入')
|
|
575
|
-
}
|
|
576
|
-
} else {
|
|
577
|
-
callback();
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
},
|
|
581
|
-
],
|
|
556
|
+
|
|
582
557
|
render: (value: string, record: IGood) => {
|
|
583
558
|
if (editGood?.$index === record.$index) {
|
|
584
|
-
return
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
559
|
+
return <Form.Item>
|
|
560
|
+
{getFieldDecorator('taxAmount', {
|
|
561
|
+
initialValue: editGood.taxAmount,
|
|
562
|
+
// rules: getReplenishRules('taxAmount'),
|
|
563
|
+
rules: [
|
|
564
|
+
...getReplenishRules('taxAmount'),
|
|
565
|
+
{ required: isEnables('taxAmount'), message: '税额不能为空' },
|
|
566
|
+
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '税额必须为数字' },
|
|
567
|
+
{
|
|
568
|
+
validator: (rule: any, value: any, callback: any) => {
|
|
569
|
+
//含税金额
|
|
570
|
+
const lineAmountIncludeTax = editGood?.lineAmountIncludeTax || 0;
|
|
571
|
+
//不含税金额
|
|
572
|
+
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
573
|
+
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax || 0)).subtract(bignumber(value || 0));
|
|
574
|
+
const taxRate = editGood?.taxRate;
|
|
575
|
+
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
576
|
+
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
577
|
+
const total = lineAmountExcludeTax.multiply(bignumber(taxRate || 0)).divide(bignumber(100));
|
|
578
|
+
// if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
579
|
+
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
580
|
+
callback();
|
|
581
|
+
} else {
|
|
582
|
+
callback('税额填写错误,请重新输入')
|
|
583
|
+
}
|
|
584
|
+
} else {
|
|
585
|
+
callback();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
],
|
|
590
|
+
})(
|
|
591
|
+
isEnables('taxAmount')
|
|
592
|
+
? <MyInput
|
|
593
|
+
style={{ textAlign: 'right' }}
|
|
594
|
+
loading={isCipher(changeField, 'taxAmount')}
|
|
595
|
+
onChange={() => {
|
|
596
|
+
setChangeField('taxAmount');
|
|
597
|
+
onChangeTaxAmount(controller, form, record);
|
|
598
|
+
}}
|
|
599
|
+
/>
|
|
600
|
+
: <MyDiv loading={isCipher(changeField, 'taxAmount')} />
|
|
601
|
+
)}
|
|
602
|
+
</Form.Item>
|
|
599
603
|
} else {
|
|
600
604
|
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : value === '' ? '' : parseFloat(value).toFixed(2)}</span>;
|
|
601
605
|
}
|
|
@@ -628,7 +632,6 @@ export default (form: WrappedFormUtils) => {
|
|
|
628
632
|
dataIndex: 'remarks',
|
|
629
633
|
key: 'remarks',
|
|
630
634
|
width: 150,
|
|
631
|
-
|
|
632
635
|
},
|
|
633
636
|
{
|
|
634
637
|
title: '操作',
|
|
@@ -14,7 +14,7 @@ export default () => {
|
|
|
14
14
|
const topExpand = controller.useMemo(s => s.goodsListState.importGoods.topExpand, []);
|
|
15
15
|
|
|
16
16
|
const onClose = React.useCallback(() => {
|
|
17
|
-
controller.pipeline(async s => {
|
|
17
|
+
controller.pipeline(async s => {
|
|
18
18
|
s.goodsListState.importGoods.filter = {};
|
|
19
19
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
20
20
|
})();
|
|
@@ -90,6 +90,7 @@ const DrawerBody = () => {
|
|
|
90
90
|
...s.goodsListState.editGood,
|
|
91
91
|
itemModelName: undefined,
|
|
92
92
|
itemModelNameSelf: undefined,
|
|
93
|
+
mtzlDm: undefined,
|
|
93
94
|
...between
|
|
94
95
|
};
|
|
95
96
|
|
|
@@ -128,6 +129,11 @@ const DrawerBody = () => {
|
|
|
128
129
|
s.goodsListState.isTaxIncluded
|
|
129
130
|
? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
|
|
130
131
|
: await updateUnitPriceTax(controller, s.goodsListState.form, record)
|
|
132
|
+
if (s.goodsListState.isValidateMeiTan) {
|
|
133
|
+
if (await s.goodsListState.verifyMeiTanFn(record) === true) {
|
|
134
|
+
s.goodsListState.meiTanGoodIndex = [editGood.$index];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
131
137
|
})
|
|
132
138
|
}
|
|
133
139
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.kts-invoice-operate-meitan-modal {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
|
|
5
|
+
.kts-invoice-operate-meitan-title {
|
|
6
|
+
|
|
7
|
+
line-height: 30px;
|
|
8
|
+
|
|
9
|
+
.kts-invoice-operate-meitan-title2 {
|
|
10
|
+
margin-left: 24px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.kts-invoice-operate-meitan-content {
|
|
16
|
+
margin-top: 20px;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
background-color: #f9fafd;
|
|
19
|
+
|
|
20
|
+
.content-item {
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
margin: 20px 24px;
|
|
23
|
+
padding: 20px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ktsAntX-space-item {
|
|
28
|
+
margin: 5px 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ktsAntX-form-item-explain {
|
|
32
|
+
margin-top: 20px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
.kts-invoice-operate-meitan-button {
|
|
36
|
+
display: flex!important;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
padding: 2px 20px!important;
|
|
40
|
+
}
|