kts-component-invoice-operate 3.2.226 → 3.2.228-fuling
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/README.md +0 -4
- package/dist/Invoice/Invoice-digtal/_test/pay/index.d.ts +4 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +0 -1
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods/index.d.ts +0 -2
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +0 -2
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/IColumnsReplenish/index.d.ts +6 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/IGood/index.d.ts +12 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/ImportGoods/index.d.ts +21 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/PayListState/index.d.ts +31 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/index.d.ts +2 -0
- package/dist/Invoice/InvoiceController/fns/addPay.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/delPay.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/saveEditPay.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/setEditPay.d.ts +6 -0
- package/dist/Invoice/InvoiceController/fns/setPay.d.ts +6 -0
- package/dist/Invoice/InvoiceController/index.d.ts +6 -0
- package/dist/Invoice/index.d.ts +2 -0
- package/dist/Invoice/ui/default/GoodsList/index.d.ts +0 -1
- package/dist/Invoice/ui/default/GoodsList/ui/AddRowButton/index.d.ts +1 -1
- package/dist/Invoice/ui/digtal/GoodsList/index.d.ts +0 -1
- package/dist/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.d.ts +1 -4
- package/dist/Invoice/ui/digtal/PayList/hook/useColumns/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PayList/hook/useColumns/ui/TitleText/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PayList/hook/useOnRow/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PayList/hook/useRowSelection/index.d.ts +8 -0
- package/dist/Invoice/ui/digtal/PayList/hook/useWindowClick/index.d.ts +5 -0
- package/dist/Invoice/ui/digtal/PayList/index.d.ts +18 -0
- package/dist/Invoice/ui/digtal/PayList/ui/AddRowButton/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useEmptyRefill/index.d.ts +6 -0
- package/dist/Invoice/ui/digtal/PayList/ui/TableRow/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/PayList/ui/TableVirtual/index.d.ts +4 -0
- package/dist/index.esm.js +8097 -6064
- package/dist/index.js +8096 -6063
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/easiest/index.tsx +41 -9
- package/src/Invoice/Invoice-digtal/_test/freight/index.tsx +23 -17
- package/src/Invoice/Invoice-digtal/_test/pay/index.tsx +14637 -0
- package/src/Invoice/Invoice-digtal/_test/realEstateInfo/index.tsx +7 -69
- package/src/Invoice/Invoice-digtal/index.md +16 -8
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +11 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +0 -2
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods/index.ts +0 -3
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +0 -3
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/IColumnsReplenish/index.ts +10 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/IGood/index.ts +35 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/ImportGoods/index.ts +81 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/PayListState/index.ts +40 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/index.ts +3 -0
- package/src/Invoice/InvoiceController/fns/addPay.ts +11 -0
- package/src/Invoice/InvoiceController/fns/delPay.ts +38 -0
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +2 -2
- package/src/Invoice/InvoiceController/fns/saveEditPay.ts +23 -0
- package/src/Invoice/InvoiceController/fns/setEditPay.ts +16 -0
- package/src/Invoice/InvoiceController/fns/setPay.ts +11 -0
- package/src/Invoice/InvoiceController/index.ts +21 -0
- package/src/Invoice/_test/deduction/index.tsx +6 -28
- package/src/Invoice/index.md +4 -4
- package/src/Invoice/index.tsx +3 -0
- package/src/Invoice/tools/useToGenerateId/index.ts +2 -0
- package/src/Invoice/ui/default/GoodsList/index.tsx +1 -3
- package/src/Invoice/ui/default/GoodsList/ui/AddRowButton/index.tsx +1 -8
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +1 -4
- package/src/Invoice/ui/digtal/Architecture/index.tsx +1 -1
- package/src/Invoice/ui/digtal/FreightList/index.tsx +1 -1
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +23 -37
- package/src/Invoice/ui/digtal/GoodsList/index.tsx +1 -3
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +10 -20
- package/src/Invoice/ui/digtal/GoodsList/ui/TableVirtual/index.tsx +6 -11
- package/src/Invoice/ui/digtal/GoodsList/ui/TaxIncludedSwitch/index.tsx +2 -5
- package/src/Invoice/ui/digtal/PayList/hook/useColumns/dist/index.js +616 -0
- package/src/Invoice/ui/digtal/PayList/hook/useColumns/index.tsx +168 -0
- package/src/Invoice/ui/digtal/PayList/hook/useColumns/ui/TitleText/index.tsx +20 -0
- package/src/Invoice/ui/digtal/PayList/hook/useOnRow/index.tsx +37 -0
- package/src/Invoice/ui/digtal/PayList/hook/useRowSelection/index.tsx +120 -0
- package/src/Invoice/ui/digtal/PayList/hook/useWindowClick/index.tsx +19 -0
- package/src/Invoice/ui/digtal/PayList/index.less +73 -0
- package/src/Invoice/ui/digtal/PayList/index.tsx +132 -0
- package/src/Invoice/ui/digtal/PayList/ui/AddRowButton/index.tsx +75 -0
- package/src/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +50 -0
- package/src/Invoice/ui/digtal/PayList/ui/BulkMenu/hooks/useEmptyRefill/index.tsx +37 -0
- package/src/Invoice/ui/digtal/PayList/ui/TableRow/index.less +29 -0
- package/src/Invoice/ui/digtal/PayList/ui/TableRow/index.tsx +21 -0
- package/src/Invoice/ui/digtal/PayList/ui/TableVirtual/index.less +39 -0
- package/src/Invoice/ui/digtal/PayList/ui/TableVirtual/index.tsx +109 -0
- package/src/Invoice/ui/digtal/RealEstateInfo/index.less +0 -7
- package/src/Invoice/ui/digtal/RealEstateInfo/index.tsx +104 -363
- package/src/Invoice/ui/digtal/StakeFarmerholder/index.less +1 -1
- package/src/Invoice/ui/digtal/StakeFarmerholder/index.tsx +528 -207
- package/src/Invoice/ui/digtal/Stakeholder/index.tsx +4 -22
|
@@ -47,8 +47,6 @@ export interface IGoodsListProps {
|
|
|
47
47
|
|
|
48
48
|
/** 是否可以切换(含税/不含税)状态 */
|
|
49
49
|
isSwitchTax?: boolean;
|
|
50
|
-
|
|
51
|
-
addGoodsCheck?:()=>void;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
export default class GoodsList extends React.Component<IGoodsListProps>{
|
|
@@ -139,7 +137,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
139
137
|
<div className="kts-invoice-operate-goods-list-able">
|
|
140
138
|
<div className="kts-invoice-operate-goods-list-able-list">
|
|
141
139
|
{/* 添加行 */}
|
|
142
|
-
<AddRowButton
|
|
140
|
+
<AddRowButton />
|
|
143
141
|
|
|
144
142
|
{/* 批量菜单 */}
|
|
145
143
|
{/* <BulkMenu /> */}
|
|
@@ -3,7 +3,7 @@ import Invoice from '../../../../..';
|
|
|
3
3
|
import { Button, message } from 'kts-components-antd-x3';
|
|
4
4
|
import InvoiceController, { LineAttributeType } from '../../../../../InvoiceController';
|
|
5
5
|
|
|
6
|
-
export default (
|
|
6
|
+
export default () => {
|
|
7
7
|
const controller = Invoice.useInvoiceController();
|
|
8
8
|
|
|
9
9
|
const model = controller.useMemo(s => s.model, []);
|
|
@@ -26,12 +26,6 @@ export default (props: any) => {
|
|
|
26
26
|
const disabled = React.useMemo(() => typeof goodMax === 'number' ? goodsNum >= goodMax : !!searchValue, [goodMax, goodsNum, searchValue])
|
|
27
27
|
|
|
28
28
|
const onClick = React.useCallback(async () => {
|
|
29
|
-
await controller.run(async (s) => {
|
|
30
|
-
if (s.addGoodsCheck) {
|
|
31
|
-
await s.addGoodsCheck();
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
console.log('continue')
|
|
35
29
|
await addGood(controller);
|
|
36
30
|
await rollBottom(controller, rootElement);
|
|
37
31
|
}, [controller, rootElement]);
|
|
@@ -49,7 +43,6 @@ export default (props: any) => {
|
|
|
49
43
|
|
|
50
44
|
/** 添加一个空货物 */
|
|
51
45
|
async function addGood(controller: InvoiceController) {
|
|
52
|
-
|
|
53
46
|
await controller.saveEditGood();
|
|
54
47
|
await controller.wait();
|
|
55
48
|
await controller.run(async (s) => {
|
|
@@ -14,10 +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 => {
|
|
18
|
-
s.goodsListState.importGoods.filter = {};
|
|
19
|
-
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
20
|
-
})();
|
|
17
|
+
controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleDrawer = false })();
|
|
21
18
|
}, [controller]);
|
|
22
19
|
|
|
23
20
|
return (
|
|
@@ -40,7 +40,7 @@ export default decorator<RealEstateInfoProps, FormComponentProps & RealEstateInf
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<div className="kts-invoice-operate-real-estate-info-digtal">
|
|
43
|
-
<div className='real-estate-info-digtal-label'
|
|
43
|
+
<div className='real-estate-info-digtal-label' >特殊信息-建筑服务</div>
|
|
44
44
|
<Row gutter={[17, 0]}>
|
|
45
45
|
<Col span={6} >
|
|
46
46
|
<Form.Item label='土地增值税项目编号' >
|
|
@@ -94,7 +94,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
94
94
|
// controller.useForm('freightInfo', form);
|
|
95
95
|
return (
|
|
96
96
|
<div className="kts-invoice-operate-freight">
|
|
97
|
-
<div className='real-estate-info-digtal-label'
|
|
97
|
+
<div className='real-estate-info-digtal-label' >特殊信息-货物运输</div>
|
|
98
98
|
<div className="kts-invoice-operate-goods-list-digtal" onClick={(e) => { e.stopPropagation() }} >
|
|
99
99
|
<div className="kts-invoice-operate-freight-list-able">
|
|
100
100
|
{/* 添加行 */}
|
|
@@ -73,7 +73,6 @@ export default (form: WrappedFormUtils) => {
|
|
|
73
73
|
/** 计算中启动字段 */
|
|
74
74
|
const changeField = controller.useMemo((e) => e.calculatingField, []);
|
|
75
75
|
|
|
76
|
-
const isValidateGood = controller.useMemo(s => s.goodsListState.isValidateGood, [])
|
|
77
76
|
/** 计算中启动字段 */
|
|
78
77
|
const setChangeField = React.useCallback((value: string) => controller.run(async s => { s.calculatingField = value }), []);
|
|
79
78
|
|
|
@@ -125,16 +124,12 @@ export default (form: WrappedFormUtils) => {
|
|
|
125
124
|
...getReplenishRules('itemName'),
|
|
126
125
|
{
|
|
127
126
|
validator: async (_, __, callback) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
callback('项目名称不能为空');
|
|
133
|
-
} else {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
127
|
+
await controller.wait();
|
|
128
|
+
const value = controller.state.goodsListState.editGood;
|
|
129
|
+
if (!value?.itemName && !value?.itemNameSelf) {
|
|
130
|
+
callback('项目名称不能为空');
|
|
136
131
|
} else {
|
|
137
|
-
|
|
132
|
+
return;
|
|
138
133
|
}
|
|
139
134
|
}
|
|
140
135
|
}
|
|
@@ -257,16 +252,11 @@ export default (form: WrappedFormUtils) => {
|
|
|
257
252
|
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '数量必须为数字' },
|
|
258
253
|
{
|
|
259
254
|
validator: async (_, value, callback) => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
if (isvalue || isPrice === isvalue) return;
|
|
266
|
-
callback('请输入数量');
|
|
267
|
-
} else {
|
|
268
|
-
callback();
|
|
269
|
-
}
|
|
255
|
+
await controller.wait();
|
|
256
|
+
const isvalue = !!value || value === 0;
|
|
257
|
+
const isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
258
|
+
if (isvalue || isPrice === isvalue) return;
|
|
259
|
+
callback('请输入数量');
|
|
270
260
|
}
|
|
271
261
|
}
|
|
272
262
|
],
|
|
@@ -391,7 +381,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
391
381
|
getValueFromEvent: onNumberValueChange,
|
|
392
382
|
rules: [
|
|
393
383
|
...getReplenishRules('lineAmountIncludeTax'),
|
|
394
|
-
{ required:
|
|
384
|
+
{ required: true, message: '金额不能为空' },
|
|
395
385
|
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额错误,请重新输入' },
|
|
396
386
|
{
|
|
397
387
|
validator: async (_, value, callback) => {
|
|
@@ -421,7 +411,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
421
411
|
</Form.Item>
|
|
422
412
|
);
|
|
423
413
|
} else {
|
|
424
|
-
return <span style={{ padding: '0 10px' }}>{
|
|
414
|
+
return <span style={{ padding: '0 10px' }}>{formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
|
|
425
415
|
}
|
|
426
416
|
},
|
|
427
417
|
},
|
|
@@ -440,7 +430,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
440
430
|
getValueFromEvent: onNumberValueChange,
|
|
441
431
|
rules: [
|
|
442
432
|
...getReplenishRules('lineAmountExcludeTax'),
|
|
443
|
-
{ required:
|
|
433
|
+
{ required: true, message: '金额不能为空' },
|
|
444
434
|
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '金额错误,请重新输入' },
|
|
445
435
|
{
|
|
446
436
|
validator: async (_, value: string, callback) => {
|
|
@@ -463,7 +453,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
463
453
|
</Form.Item>
|
|
464
454
|
);
|
|
465
455
|
} else {
|
|
466
|
-
return <span style={{ padding: '0 10px' }}>{
|
|
456
|
+
return <span style={{ padding: '0 10px' }}>{formatSearch(parseFloat(value).toFixed(2), searchValue)}</span>;
|
|
467
457
|
}
|
|
468
458
|
},
|
|
469
459
|
},
|
|
@@ -473,7 +463,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
473
463
|
key: 'taxRate',
|
|
474
464
|
align: 'right',
|
|
475
465
|
width: 70,
|
|
476
|
-
render: (value: string
|
|
466
|
+
render: (value: string, record: IGood) => {
|
|
477
467
|
if (editGood?.$index === record.$index && !disableds.includes('taxRate') && !(model === 'prefab' && calculateType === '3')) {
|
|
478
468
|
return (
|
|
479
469
|
<Form.Item>
|
|
@@ -481,7 +471,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
481
471
|
initialValue: editGood.taxRate,
|
|
482
472
|
rules: [
|
|
483
473
|
...getReplenishRules('taxRate'),
|
|
484
|
-
{ required:
|
|
474
|
+
{ required: true, message: '请选择税率' },
|
|
485
475
|
{ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '请选择正确税率' },
|
|
486
476
|
],
|
|
487
477
|
})(
|
|
@@ -508,11 +498,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
508
498
|
</Form.Item>
|
|
509
499
|
);
|
|
510
500
|
} else {
|
|
511
|
-
|
|
512
|
-
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '免税' : `${value}%`}</span>;
|
|
513
|
-
} else {
|
|
514
|
-
return ''
|
|
515
|
-
}
|
|
501
|
+
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '免税' : `${value}%`}</span>;
|
|
516
502
|
}
|
|
517
503
|
},
|
|
518
504
|
},
|
|
@@ -523,27 +509,27 @@ export default (form: WrappedFormUtils) => {
|
|
|
523
509
|
align: 'right',
|
|
524
510
|
width: 119,
|
|
525
511
|
render: (value: string, record: IGood) => {
|
|
526
|
-
if (editGood?.$index === record.$index && !disableds.includes('taxAmount')
|
|
512
|
+
if (editGood?.$index === record.$index && !disableds.includes('taxAmount')&& model !== 'prefab') {
|
|
527
513
|
return (
|
|
528
514
|
<Form.Item>
|
|
529
515
|
{getFieldDecorator('taxAmount', {
|
|
530
516
|
initialValue: editGood.taxAmount,
|
|
531
517
|
rules: [
|
|
532
518
|
...getReplenishRules('taxAmount'),
|
|
533
|
-
{ required:
|
|
519
|
+
{ required: true, message: '税额不能为空' },
|
|
534
520
|
{
|
|
535
521
|
validator: (rule, value, callback) => {
|
|
536
522
|
//含税金额
|
|
537
523
|
const lineAmountIncludeTax = editGood?.lineAmountIncludeTax || 0;
|
|
538
524
|
//不含税金额
|
|
539
525
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
540
|
-
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax
|
|
526
|
+
const lineAmountExcludeTax = chain(bignumber(lineAmountIncludeTax||0)).subtract(bignumber(value||0));
|
|
541
527
|
const taxRate = editGood?.taxRate;
|
|
542
528
|
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
543
529
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
544
|
-
const total = lineAmountExcludeTax.multiply(bignumber(taxRate
|
|
530
|
+
const total = lineAmountExcludeTax.multiply(bignumber(taxRate||0)).divide(bignumber(100));
|
|
545
531
|
// if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
546
|
-
if (Math.abs(total.subtract(bignumber(value
|
|
532
|
+
if (Math.abs(total.subtract(bignumber(value||0)).done().toNumber()) <= 0.01) {
|
|
547
533
|
callback();
|
|
548
534
|
} else {
|
|
549
535
|
callback('税额填写错误,请重新输入')
|
|
@@ -573,7 +559,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
573
559
|
</Form.Item>
|
|
574
560
|
)
|
|
575
561
|
} else {
|
|
576
|
-
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' :
|
|
562
|
+
return <span style={{ padding: '0 10px' }}>{isDutyFree(record) ? '***' : parseFloat(value).toFixed(2)}</span>;
|
|
577
563
|
}
|
|
578
564
|
},
|
|
579
565
|
},
|
|
@@ -42,8 +42,6 @@ export interface IGoodsListProps {
|
|
|
42
42
|
|
|
43
43
|
/** 是否可以切换(含税/不含税)状态 */
|
|
44
44
|
isSwitchTax?: boolean;
|
|
45
|
-
|
|
46
|
-
onTaxSwitchChange?:(e:any)=>void;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
export default class GoodsList extends React.Component<IGoodsListProps>{
|
|
@@ -139,7 +137,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
139
137
|
{endowCodeButton.button}
|
|
140
138
|
|
|
141
139
|
{/* 是否含税开关 */}
|
|
142
|
-
<TaxIncludedSwitch
|
|
140
|
+
<TaxIncludedSwitch />
|
|
143
141
|
|
|
144
142
|
{/* 搜索 */}
|
|
145
143
|
<Search />
|
|
@@ -45,13 +45,6 @@ export default () => {
|
|
|
45
45
|
|
|
46
46
|
/** 添加一个空货物 */
|
|
47
47
|
async function addGood(controller: InvoiceController) {
|
|
48
|
-
await controller.formList.get('realEstateInfo')?.validateFields(async (err: any, values: any) => {
|
|
49
|
-
|
|
50
|
-
if (err) {
|
|
51
|
-
message.error('请先填写发票行信息,再添加新的行');
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
48
|
await controller.saveEditGood();
|
|
56
49
|
await controller.wait();
|
|
57
50
|
await controller.run(async (s) => {
|
|
@@ -61,19 +54,16 @@ async function addGood(controller: InvoiceController) {
|
|
|
61
54
|
// key: '你正在编辑一个货物',
|
|
62
55
|
// });
|
|
63
56
|
// return;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
57
|
+
await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
|
|
58
|
+
if (err) {
|
|
59
|
+
const firstError: any = Object.values(err)[0];
|
|
60
|
+
message.error({
|
|
61
|
+
content: firstError.errors[0].message,
|
|
62
|
+
key: '你正在编辑一个货物',
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
77
67
|
}
|
|
78
68
|
s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
79
69
|
});
|
|
@@ -40,9 +40,8 @@ export default function <T extends object = any>(props: TableProps<T>) {
|
|
|
40
40
|
|
|
41
41
|
// 设置占位dom的搞
|
|
42
42
|
const placeholderHeight = React.useMemo(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const placeholderHeight = rowHeight * dataSource.length;
|
|
43
|
+
if (!self || !rowHeight || !props.dataSource || !placeholder) return;
|
|
44
|
+
const placeholderHeight = rowHeight * props.dataSource.length;
|
|
46
45
|
placeholder.style.height = `${placeholderHeight}px`;
|
|
47
46
|
return placeholderHeight;
|
|
48
47
|
}, [self, rowHeight, props.dataSource, placeholder]);
|
|
@@ -81,23 +80,19 @@ export default function <T extends object = any>(props: TableProps<T>) {
|
|
|
81
80
|
|
|
82
81
|
// 移动列表
|
|
83
82
|
React.useEffect(() => {
|
|
84
|
-
if (!self) return
|
|
83
|
+
if (!self) return;
|
|
85
84
|
|
|
86
85
|
const table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table') as HTMLDivElement;
|
|
87
|
-
|
|
88
86
|
if (!table) return;
|
|
89
|
-
if ((props.dataSource?.length || 0) < 10) {
|
|
90
|
-
table.style.top = '0px';
|
|
91
|
-
} else {
|
|
92
|
-
table.style.top = `${pointer * rowHeight}px`;
|
|
93
|
-
}
|
|
94
87
|
|
|
95
|
-
|
|
88
|
+
table.style.top = `${pointer * rowHeight}px`;
|
|
89
|
+
}, [pointer, self, rowHeight]);
|
|
96
90
|
|
|
97
91
|
React.useEffect(() => {
|
|
98
92
|
if (!self) return;
|
|
99
93
|
const cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
|
|
100
94
|
if (!cont) return;
|
|
95
|
+
|
|
101
96
|
cont.scrollTop = 0;
|
|
102
97
|
}, [props.dataSource?.length])
|
|
103
98
|
|
|
@@ -3,10 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { Switch } from 'kts-xui';
|
|
4
4
|
import Invoice from '../../../../..';
|
|
5
5
|
import { onChangeSwitchTax } from '../../hook/useColumns/autoFillFn';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export default (props:IProps) => {
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
10
8
|
|
|
11
9
|
const controller = Invoice.useInvoiceController();
|
|
12
10
|
|
|
@@ -18,7 +16,6 @@ export default (props:IProps) => {
|
|
|
18
16
|
|
|
19
17
|
const onChange = React.useCallback(async e => {
|
|
20
18
|
onChangeSwitchTax(controller, e);
|
|
21
|
-
props.onChange && props.onChange(e);
|
|
22
19
|
}, [])
|
|
23
20
|
|
|
24
21
|
return (
|