kts-component-invoice-operate 3.2.246 → 3.2.247
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/index.esm.js +32 -32
- package/dist/index.js +32 -32
- package/package.json +1 -1
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +46 -43
package/dist/index.esm.js
CHANGED
|
@@ -14769,40 +14769,40 @@ var useColumns = (function (form) {
|
|
|
14769
14769
|
key: 'taxAmount',
|
|
14770
14770
|
align: 'right',
|
|
14771
14771
|
width: 119,
|
|
14772
|
-
rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
|
|
14773
|
-
required: isEnables('taxAmount'),
|
|
14774
|
-
message: '税额不能为空'
|
|
14775
|
-
}, {
|
|
14776
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
14777
|
-
message: '税额必须为数字'
|
|
14778
|
-
}, {
|
|
14779
|
-
validator: function validator(rule, value, callback) {
|
|
14780
|
-
//含税金额
|
|
14781
|
-
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
14782
|
-
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
14783
|
-
|
|
14784
|
-
var lineAmountExcludeTax = chain$1(bignumber(lineAmountIncludeTax || 0)).subtract(bignumber(value || 0));
|
|
14785
|
-
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
14786
|
-
|
|
14787
|
-
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
14788
|
-
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
14789
|
-
var total = lineAmountExcludeTax.multiply(bignumber(taxRate || 0)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
14790
|
-
|
|
14791
|
-
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
14792
|
-
callback();
|
|
14793
|
-
} else {
|
|
14794
|
-
callback('税额填写错误,请重新输入');
|
|
14795
|
-
}
|
|
14796
|
-
} else {
|
|
14797
|
-
callback();
|
|
14798
|
-
}
|
|
14799
|
-
}
|
|
14800
|
-
}]),
|
|
14801
14772
|
render: function render(value, record) {
|
|
14802
14773
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
14803
|
-
return getFieldDecorator('taxAmount', {
|
|
14774
|
+
return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('taxAmount', {
|
|
14804
14775
|
initialValue: editGood.taxAmount,
|
|
14805
|
-
rules: getReplenishRules('taxAmount')
|
|
14776
|
+
// rules: getReplenishRules('taxAmount'),
|
|
14777
|
+
rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
|
|
14778
|
+
required: isEnables('taxAmount'),
|
|
14779
|
+
message: '税额不能为空'
|
|
14780
|
+
}, {
|
|
14781
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
14782
|
+
message: '税额必须为数字'
|
|
14783
|
+
}, {
|
|
14784
|
+
validator: function validator(rule, value, callback) {
|
|
14785
|
+
//含税金额
|
|
14786
|
+
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
14787
|
+
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
14788
|
+
|
|
14789
|
+
var lineAmountExcludeTax = chain$1(bignumber(lineAmountIncludeTax || 0)).subtract(bignumber(value || 0));
|
|
14790
|
+
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
14791
|
+
|
|
14792
|
+
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
14793
|
+
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
14794
|
+
var total = lineAmountExcludeTax.multiply(bignumber(taxRate || 0)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
14795
|
+
|
|
14796
|
+
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
14797
|
+
callback();
|
|
14798
|
+
} else {
|
|
14799
|
+
callback('税额填写错误,请重新输入');
|
|
14800
|
+
}
|
|
14801
|
+
} else {
|
|
14802
|
+
callback();
|
|
14803
|
+
}
|
|
14804
|
+
}
|
|
14805
|
+
}])
|
|
14806
14806
|
})(isEnables('taxAmount') ? /*#__PURE__*/React.createElement(MyInput, {
|
|
14807
14807
|
style: {
|
|
14808
14808
|
textAlign: 'right'
|
|
@@ -14814,7 +14814,7 @@ var useColumns = (function (form) {
|
|
|
14814
14814
|
}
|
|
14815
14815
|
}) : /*#__PURE__*/React.createElement(MyDiv, {
|
|
14816
14816
|
loading: isCipher(changeField, 'taxAmount')
|
|
14817
|
-
}));
|
|
14817
|
+
})));
|
|
14818
14818
|
} else {
|
|
14819
14819
|
return /*#__PURE__*/React.createElement("span", {
|
|
14820
14820
|
style: {
|
package/dist/index.js
CHANGED
|
@@ -14779,40 +14779,40 @@ var useColumns = (function (form) {
|
|
|
14779
14779
|
key: 'taxAmount',
|
|
14780
14780
|
align: 'right',
|
|
14781
14781
|
width: 119,
|
|
14782
|
-
rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
|
|
14783
|
-
required: isEnables('taxAmount'),
|
|
14784
|
-
message: '税额不能为空'
|
|
14785
|
-
}, {
|
|
14786
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
14787
|
-
message: '税额必须为数字'
|
|
14788
|
-
}, {
|
|
14789
|
-
validator: function validator(rule, value, callback) {
|
|
14790
|
-
//含税金额
|
|
14791
|
-
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
14792
|
-
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
14793
|
-
|
|
14794
|
-
var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(lineAmountIncludeTax || 0)).subtract(mathjs.bignumber(value || 0));
|
|
14795
|
-
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
14796
|
-
|
|
14797
|
-
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
14798
|
-
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
14799
|
-
var total = lineAmountExcludeTax.multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
14800
|
-
|
|
14801
|
-
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
14802
|
-
callback();
|
|
14803
|
-
} else {
|
|
14804
|
-
callback('税额填写错误,请重新输入');
|
|
14805
|
-
}
|
|
14806
|
-
} else {
|
|
14807
|
-
callback();
|
|
14808
|
-
}
|
|
14809
|
-
}
|
|
14810
|
-
}]),
|
|
14811
14782
|
render: function render(value, record) {
|
|
14812
14783
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
14813
|
-
return getFieldDecorator('taxAmount', {
|
|
14784
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxAmount', {
|
|
14814
14785
|
initialValue: editGood.taxAmount,
|
|
14815
|
-
rules: getReplenishRules('taxAmount')
|
|
14786
|
+
// rules: getReplenishRules('taxAmount'),
|
|
14787
|
+
rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
|
|
14788
|
+
required: isEnables('taxAmount'),
|
|
14789
|
+
message: '税额不能为空'
|
|
14790
|
+
}, {
|
|
14791
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
14792
|
+
message: '税额必须为数字'
|
|
14793
|
+
}, {
|
|
14794
|
+
validator: function validator(rule, value, callback) {
|
|
14795
|
+
//含税金额
|
|
14796
|
+
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
14797
|
+
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
14798
|
+
|
|
14799
|
+
var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(lineAmountIncludeTax || 0)).subtract(mathjs.bignumber(value || 0));
|
|
14800
|
+
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
14801
|
+
|
|
14802
|
+
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
14803
|
+
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
14804
|
+
var total = lineAmountExcludeTax.multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
14805
|
+
|
|
14806
|
+
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.01) {
|
|
14807
|
+
callback();
|
|
14808
|
+
} else {
|
|
14809
|
+
callback('税额填写错误,请重新输入');
|
|
14810
|
+
}
|
|
14811
|
+
} else {
|
|
14812
|
+
callback();
|
|
14813
|
+
}
|
|
14814
|
+
}
|
|
14815
|
+
}])
|
|
14816
14816
|
})(isEnables('taxAmount') ? /*#__PURE__*/React__default['default'].createElement(MyInput, {
|
|
14817
14817
|
style: {
|
|
14818
14818
|
textAlign: 'right'
|
|
@@ -14824,7 +14824,7 @@ var useColumns = (function (form) {
|
|
|
14824
14824
|
}
|
|
14825
14825
|
}) : /*#__PURE__*/React__default['default'].createElement(MyDiv, {
|
|
14826
14826
|
loading: isCipher(changeField, 'taxAmount')
|
|
14827
|
-
}));
|
|
14827
|
+
})));
|
|
14828
14828
|
} else {
|
|
14829
14829
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
14830
14830
|
style: {
|
package/package.json
CHANGED
|
@@ -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: '操作',
|