kts-component-invoice-operate 3.2.250 → 3.2.251
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/.vscode/settings.json +14 -0
- package/dist/Invoice/ui/digtal/Architecture/index.d.ts +4 -0
- package/dist/index.esm.js +159 -68
- package/dist/index.js +158 -67
- package/package.json +1 -1
- package/src/Invoice/Invoice-digtal/_test/pay/index.tsx +15 -7
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +11 -10
- package/src/Invoice/_test/importBuyer/index.tsx +1 -0
- package/src/Invoice/index.tsx +4 -0
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.ts +5 -2
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +3 -2
- package/src/Invoice/ui/digtal/Architecture/index.less +4 -0
- package/src/Invoice/ui/digtal/Architecture/index.tsx +45 -7
- package/src/Invoice/ui/digtal/Architecture/svg/plus.svg +1 -0
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +14 -7
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +9 -11
- package/src/Invoice/ui/digtal/GoodsList/ui/Statistics/index.tsx +25 -23
package/dist/index.js
CHANGED
|
@@ -873,42 +873,42 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
873
873
|
_errors.set('payList', _context.t2.errors);
|
|
874
874
|
|
|
875
875
|
case 47:
|
|
876
|
-
_values.set('payList', this.state.payListState.goodsList.slice()); //
|
|
876
|
+
_values.set('payList', this.state.payListState.goodsList.slice()); // 金额(不含税)
|
|
877
877
|
|
|
878
878
|
|
|
879
|
-
_values.set('
|
|
879
|
+
_values.set('lineAmountExcludeTax', function () {
|
|
880
880
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
881
881
|
|
|
882
882
|
_this3.state.goodsListState.goodsList.forEach(function (e) {
|
|
883
883
|
if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
|
|
884
|
-
sum = sum.add(mathjs.bignumber(e.
|
|
884
|
+
sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
|
|
885
885
|
});
|
|
886
886
|
|
|
887
887
|
return sum.done().toNumber();
|
|
888
|
-
}()); //
|
|
888
|
+
}()); // 税额
|
|
889
889
|
|
|
890
890
|
|
|
891
|
-
_values.set('
|
|
891
|
+
_values.set('taxAmount', function () {
|
|
892
892
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
893
893
|
|
|
894
894
|
_this3.state.goodsListState.goodsList.forEach(function (e) {
|
|
895
895
|
if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
|
|
896
|
-
sum = sum.add(mathjs.bignumber(e.
|
|
896
|
+
sum = sum.add(mathjs.bignumber(e.taxAmount || 0));
|
|
897
897
|
});
|
|
898
898
|
|
|
899
899
|
return sum.done().toNumber();
|
|
900
|
-
}()); //
|
|
900
|
+
}()); // 金额(含税)
|
|
901
901
|
|
|
902
902
|
|
|
903
|
-
_values.set('
|
|
903
|
+
_values.set('lineAmountIncludeTax', function () {
|
|
904
904
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
905
905
|
|
|
906
906
|
_this3.state.goodsListState.goodsList.forEach(function (e) {
|
|
907
907
|
if (!e || e.lineAttribute === LineAttributeType$1.赠品行) return;
|
|
908
|
-
sum = sum.add(mathjs.bignumber(e.
|
|
908
|
+
sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
|
|
909
909
|
});
|
|
910
910
|
|
|
911
|
-
return sum.done().toNumber();
|
|
911
|
+
return sum.done().toNumber(); // return chain(bignumber(_values.get('lineAmountExcludeTax'))).add(bignumber(_values.get('taxAmount'))).done().toNumber();
|
|
912
912
|
}()); // 含税标记
|
|
913
913
|
|
|
914
914
|
|
|
@@ -9693,8 +9693,10 @@ var updateUnitPriceTax = /*#__PURE__*/function () {
|
|
|
9693
9693
|
});
|
|
9694
9694
|
|
|
9695
9695
|
case 11:
|
|
9696
|
-
// 税额 = 金额(含税)-金额(不含税)
|
|
9697
|
-
taxAmount = evaluate(
|
|
9696
|
+
// 税额 = 金额(含税)-金额(不含税) (老逻辑)
|
|
9697
|
+
// const taxAmount = evaluate(`${lineAmountIncludeTax} - ${lineAmountExcludeTax}`);
|
|
9698
|
+
// 税额 = 金额(含税)-金额(不含税)(新逻辑)
|
|
9699
|
+
taxAmount = evaluate("".concat(lineAmountExcludeTax, " * ").concat(values.taxRate, "/100"));
|
|
9698
9700
|
form.setFieldsValue({
|
|
9699
9701
|
taxAmount: taxAmount
|
|
9700
9702
|
});
|
|
@@ -14892,9 +14894,8 @@ var useColumns = (function (form) {
|
|
|
14892
14894
|
textAlign: 'right'
|
|
14893
14895
|
},
|
|
14894
14896
|
loading: isCipher(changeField, 'taxAmount'),
|
|
14895
|
-
onChange: function onChange() {
|
|
14896
|
-
|
|
14897
|
-
onChangeTaxAmount(controller, form, record);
|
|
14897
|
+
onChange: function onChange() {// setChangeField('taxAmount');
|
|
14898
|
+
// onChangeTaxAmount(controller, form, record);
|
|
14898
14899
|
}
|
|
14899
14900
|
}) : /*#__PURE__*/React__default['default'].createElement(MyDiv, {
|
|
14900
14901
|
loading: isCipher(changeField, 'taxAmount')
|
|
@@ -20784,13 +20785,13 @@ var Statistics$1 = (function () {
|
|
|
20784
20785
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
20785
20786
|
return s.goodsListState.isTaxIncluded;
|
|
20786
20787
|
}, []);
|
|
20787
|
-
/**
|
|
20788
|
+
/** 金额(不含税) */
|
|
20788
20789
|
|
|
20789
|
-
var
|
|
20790
|
+
var lineAmountExcludeTax = controller.useMemo(function (s) {
|
|
20790
20791
|
var _s$goodsListState$for, _s$goodsListState$for2;
|
|
20791
20792
|
|
|
20792
|
-
if (typeof s.goodsListState.
|
|
20793
|
-
return s.goodsListState.
|
|
20793
|
+
if (typeof s.goodsListState.amountExcludeTax === 'number') {
|
|
20794
|
+
return s.goodsListState.amountExcludeTax;
|
|
20794
20795
|
}
|
|
20795
20796
|
|
|
20796
20797
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
@@ -20799,54 +20800,54 @@ var Statistics$1 = (function () {
|
|
|
20799
20800
|
var err = (_s$goodsListState$for = (_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.getFieldsError()) !== null && _s$goodsListState$for !== void 0 ? _s$goodsListState$for : {};
|
|
20800
20801
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
20801
20802
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
20802
|
-
if (!err.
|
|
20803
|
-
sum = sum.add(mathjs.bignumber(editGood.
|
|
20803
|
+
if (!err.lineAmountExcludeTax) {
|
|
20804
|
+
sum = sum.add(mathjs.bignumber(editGood.lineAmountExcludeTax || 0));
|
|
20804
20805
|
}
|
|
20805
20806
|
} else {
|
|
20806
|
-
sum = sum.add(mathjs.bignumber(e.
|
|
20807
|
+
sum = sum.add(mathjs.bignumber(e.lineAmountExcludeTax || 0));
|
|
20807
20808
|
}
|
|
20808
20809
|
});
|
|
20809
20810
|
return sum.done().toNumber();
|
|
20810
20811
|
}, []);
|
|
20811
|
-
/**
|
|
20812
|
-
|
|
20813
|
-
var lineAmountExcludeTax = controller.useMemo(function (s) {
|
|
20814
|
-
var _s$goodsListState$for3, _s$goodsListState$for4;
|
|
20812
|
+
/** 税额 */
|
|
20815
20813
|
|
|
20816
|
-
|
|
20817
|
-
|
|
20814
|
+
var taxAmount = controller.useMemo(function (s) {
|
|
20815
|
+
if (typeof s.goodsListState.amountTax === 'number') {
|
|
20816
|
+
return s.goodsListState.amountTax;
|
|
20818
20817
|
}
|
|
20819
20818
|
|
|
20820
20819
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
20821
20820
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
20822
20821
|
|
|
20823
|
-
var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
|
|
20824
20822
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
20825
20823
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
20826
|
-
|
|
20827
|
-
sum = sum.add(mathjs.bignumber(editGood.lineAmountExcludeTax || 0));
|
|
20828
|
-
}
|
|
20824
|
+
sum = sum.add(mathjs.bignumber(editGood.taxAmount || 0));
|
|
20829
20825
|
} else {
|
|
20830
|
-
sum = sum.add(mathjs.bignumber(e.
|
|
20826
|
+
sum = sum.add(mathjs.bignumber(e.taxAmount || 0));
|
|
20831
20827
|
}
|
|
20832
20828
|
});
|
|
20833
20829
|
return sum.done().toNumber();
|
|
20834
20830
|
}, []);
|
|
20835
|
-
/**
|
|
20831
|
+
/** 金额(含税) */
|
|
20836
20832
|
|
|
20837
|
-
var
|
|
20838
|
-
|
|
20839
|
-
|
|
20833
|
+
var lineAmountIncludeTax = controller.useMemo(function (s) {
|
|
20834
|
+
var _s$goodsListState$for3, _s$goodsListState$for4;
|
|
20835
|
+
|
|
20836
|
+
if (typeof s.goodsListState.amountIncludeTax === 'number') {
|
|
20837
|
+
return s.goodsListState.amountIncludeTax;
|
|
20840
20838
|
}
|
|
20841
20839
|
|
|
20842
20840
|
var sum = mathjs.chain(mathjs.bignumber(0));
|
|
20843
20841
|
var editGood = s.goodsListState.editGood; // 正在编辑的货物
|
|
20844
20842
|
|
|
20843
|
+
var err = (_s$goodsListState$for3 = (_s$goodsListState$for4 = s.goodsListState.form) === null || _s$goodsListState$for4 === void 0 ? void 0 : _s$goodsListState$for4.getFieldsError()) !== null && _s$goodsListState$for3 !== void 0 ? _s$goodsListState$for3 : {};
|
|
20845
20844
|
s.goodsListState.goodsList.forEach(function (e) {
|
|
20846
20845
|
if (e.$index === (editGood === null || editGood === void 0 ? void 0 : editGood.$index)) {
|
|
20847
|
-
|
|
20846
|
+
if (!err.lineAmountIncludeTax) {
|
|
20847
|
+
sum = sum.add(mathjs.bignumber(editGood.lineAmountIncludeTax || 0));
|
|
20848
|
+
}
|
|
20848
20849
|
} else {
|
|
20849
|
-
sum = sum.add(mathjs.bignumber(e.
|
|
20850
|
+
sum = sum.add(mathjs.bignumber(e.lineAmountIncludeTax || 0));
|
|
20850
20851
|
}
|
|
20851
20852
|
});
|
|
20852
20853
|
return sum.done().toNumber();
|
|
@@ -20889,7 +20890,7 @@ var Statistics$1 = (function () {
|
|
|
20889
20890
|
fontWeight: 'bold',
|
|
20890
20891
|
marginLeft: 4
|
|
20891
20892
|
}
|
|
20892
|
-
}, toStringChinese(
|
|
20893
|
+
}, toStringChinese(lineAmountExcludeTax + taxAmount))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
20893
20894
|
style: {
|
|
20894
20895
|
flex: 1
|
|
20895
20896
|
}
|
|
@@ -20903,7 +20904,7 @@ var Statistics$1 = (function () {
|
|
|
20903
20904
|
minWidth: 119,
|
|
20904
20905
|
maxWidth: 300
|
|
20905
20906
|
}
|
|
20906
|
-
}, "\xA5", parseFloat(
|
|
20907
|
+
}, "\xA5", parseFloat(lineAmountExcludeTax + taxAmount).toFixed(2))));
|
|
20907
20908
|
});
|
|
20908
20909
|
|
|
20909
20910
|
var AddRowButton$1 = (function () {
|
|
@@ -21927,11 +21928,9 @@ var onChangeTaxRate$1 = lazyFn$2(function (controller, form, record) {
|
|
|
21927
21928
|
/** 税额 */
|
|
21928
21929
|
|
|
21929
21930
|
var onChangeTaxAmount$1 = lazyFn$2(function (controller, form, record) {
|
|
21930
|
-
/** 金额(不含税) */
|
|
21931
|
-
var lineAmountExcludeTax;
|
|
21932
21931
|
form.validateFields( /*#__PURE__*/function () {
|
|
21933
21932
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
|
|
21934
|
-
var record,
|
|
21933
|
+
var record, lineAmountIncludeTax;
|
|
21935
21934
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
21936
21935
|
while (1) {
|
|
21937
21936
|
switch (_context9.prev = _context9.next) {
|
|
@@ -21952,27 +21951,27 @@ var onChangeTaxAmount$1 = lazyFn$2(function (controller, form, record) {
|
|
|
21952
21951
|
|
|
21953
21952
|
case 6:
|
|
21954
21953
|
// 计数不含税金额
|
|
21955
|
-
lineAmountExcludeTax = countAmountExcludeTax(
|
|
21954
|
+
// lineAmountExcludeTax = countAmountExcludeTax(record?.lineAmountIncludeTax || 0, values.taxAmount);
|
|
21955
|
+
// form.setFieldsValue({ lineAmountExcludeTax });
|
|
21956
|
+
// const priceExcludeTax: any = countPrice(lineAmountExcludeTax || '', record?.quantity || '', controller.state.calculatingDigits);
|
|
21957
|
+
// await controller.setEditGood({ lineAmountExcludeTax, taxAmount: values.taxAmount, priceExcludeTax });
|
|
21958
|
+
// form.setFieldsValue({ priceExcludeTax });
|
|
21959
|
+
// 计算含税金额
|
|
21960
|
+
lineAmountIncludeTax = mathjs.chain(mathjs.bignumber((record === null || record === void 0 ? void 0 : record.lineAmountExcludeTax) || 0)).add(mathjs.bignumber(values.taxAmount || 0)).done().toNumber();
|
|
21956
21961
|
form.setFieldsValue({
|
|
21957
|
-
|
|
21962
|
+
lineAmountIncludeTax: lineAmountIncludeTax
|
|
21958
21963
|
});
|
|
21959
|
-
|
|
21960
|
-
_context9.next = 11;
|
|
21964
|
+
_context9.next = 10;
|
|
21961
21965
|
return controller.setEditGood({
|
|
21962
|
-
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
21963
21966
|
taxAmount: values.taxAmount,
|
|
21964
|
-
|
|
21967
|
+
lineAmountIncludeTax: lineAmountIncludeTax
|
|
21965
21968
|
});
|
|
21966
21969
|
|
|
21967
|
-
case
|
|
21968
|
-
|
|
21969
|
-
priceExcludeTax: priceExcludeTax
|
|
21970
|
-
}); // 清楚 计算中启动字段
|
|
21971
|
-
|
|
21972
|
-
_context9.next = 14;
|
|
21970
|
+
case 10:
|
|
21971
|
+
_context9.next = 12;
|
|
21973
21972
|
return clearCalculatingField$1(controller);
|
|
21974
21973
|
|
|
21975
|
-
case
|
|
21974
|
+
case 12:
|
|
21976
21975
|
case "end":
|
|
21977
21976
|
return _context9.stop();
|
|
21978
21977
|
}
|
|
@@ -22123,7 +22122,8 @@ var updateUnitPriceTax$1 = /*#__PURE__*/function () {
|
|
|
22123
22122
|
|
|
22124
22123
|
case 12:
|
|
22125
22124
|
// 税额 = 金额(含税)-金额(不含税)
|
|
22126
|
-
taxAmount = evaluate(
|
|
22125
|
+
// const taxAmount = evaluate(`${lineAmountIncludeTax} - ${lineAmountExcludeTax}`);
|
|
22126
|
+
taxAmount = format2(evaluate("".concat(lineAmountExcludeTax, " * ").concat(values.taxRate, "/100")));
|
|
22127
22127
|
form.setFieldsValue({
|
|
22128
22128
|
taxAmount: taxAmount
|
|
22129
22129
|
});
|
|
@@ -24176,21 +24176,22 @@ var useColumns$1 = (function (form) {
|
|
|
24176
24176
|
message: '税额不能为空'
|
|
24177
24177
|
}, {
|
|
24178
24178
|
validator: function validator(rule, value, callback) {
|
|
24179
|
-
//含税金额
|
|
24179
|
+
//含税金额(lineAmountExcludeTax)
|
|
24180
24180
|
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
24181
24181
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
24182
24182
|
|
|
24183
|
-
var lineAmountExcludeTax =
|
|
24183
|
+
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
24184
24184
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
24185
|
+
console.log('taxRate ===>', taxRate);
|
|
24185
24186
|
|
|
24186
|
-
if (lineAmountExcludeTax && taxRate && lineAmountIncludeTax) {
|
|
24187
|
+
if (lineAmountExcludeTax && (taxRate || taxRate === 0) && lineAmountIncludeTax) {
|
|
24187
24188
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
24188
|
-
var total = lineAmountExcludeTax.multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
24189
|
+
var total = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
24189
24190
|
|
|
24190
|
-
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.
|
|
24191
|
+
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
24191
24192
|
callback();
|
|
24192
24193
|
} else {
|
|
24193
|
-
callback('
|
|
24194
|
+
callback('第' + record.serialNo + '行税额校验不通过!');
|
|
24194
24195
|
}
|
|
24195
24196
|
} else {
|
|
24196
24197
|
callback();
|
|
@@ -26748,9 +26749,25 @@ var LicensePlateNumber = function LicensePlateNumber(props) {
|
|
|
26748
26749
|
// )
|
|
26749
26750
|
// }
|
|
26750
26751
|
|
|
26751
|
-
var css_248z$s = ".kts-invoice-operate-real-estate-info-digtal {\n padding: 20px;\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-real-estate-info-digtal .real-estate-info-digtal-label {\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-real-estate-info-digtal .break-word {\n word-break: break-word;\n}\n";
|
|
26752
|
+
var css_248z$s = ".kts-invoice-operate-real-estate-info-digtal {\n padding: 20px;\n border-bottom: 2px solid #9F613E;\n border-left: 2px solid #9F613E;\n border-right: 2px solid #9F613E;\n}\n.kts-invoice-operate-real-estate-info-digtal .real-estate-info-digtal-label {\n color: #9F613E;\n font-weight: bold;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item {\n margin-bottom: 0;\n}\n.kts-invoice-operate-real-estate-info-digtal .ktsAnt3x-row.ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: normal;\n}\n.kts-invoice-operate-real-estate-info-digtal .break-word {\n word-break: break-word;\n}\n";
|
|
26752
26753
|
styleInject(css_248z$s);
|
|
26753
26754
|
|
|
26755
|
+
var _path$a;
|
|
26756
|
+
|
|
26757
|
+
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
|
|
26758
|
+
|
|
26759
|
+
function SvgPlus$3(props) {
|
|
26760
|
+
return /*#__PURE__*/React.createElement("svg", _extends$e({
|
|
26761
|
+
className: "plus_svg__icon",
|
|
26762
|
+
viewBox: "0 0 1024 1024",
|
|
26763
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26764
|
+
width: 200,
|
|
26765
|
+
height: 200
|
|
26766
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
26767
|
+
d: "M644.879 886.426c0-71.304-56.367-129.106-125.887-129.106-69.511 0-125.898 57.802-125.898 129.106 0 71.323 56.388 129.124 125.898 129.124 69.52 0 125.887-57.803 125.887-129.124zm0-387.336c0-71.303-56.367-129.124-125.887-129.124-69.511 0-125.898 57.822-125.898 129.124 0 71.303 56.388 129.106 125.898 129.106 69.52 0 125.887-57.803 125.887-129.106zm0-361.515c0-71.324-56.367-129.125-125.887-129.125-69.511 0-125.898 57.801-125.898 129.125 0 71.304 56.388 129.105 125.898 129.105 69.52-.001 125.887-57.802 125.887-129.105z"
|
|
26768
|
+
})));
|
|
26769
|
+
}
|
|
26770
|
+
|
|
26754
26771
|
/** 特殊信息-建筑服务 */
|
|
26755
26772
|
|
|
26756
26773
|
var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
@@ -26765,7 +26782,18 @@ var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fun
|
|
|
26765
26782
|
return model === 'readOnly';
|
|
26766
26783
|
}, [model]); // 注册 form
|
|
26767
26784
|
|
|
26768
|
-
controller.useForm('serviceDataDtoInfo', form);
|
|
26785
|
+
controller.useForm('serviceDataDtoInfo', form); // 监听 crossCitiesSign 字段值变化
|
|
26786
|
+
|
|
26787
|
+
var _React$useState = React__default['default'].useState(form.getFieldValue('crossCitiesSign')),
|
|
26788
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26789
|
+
crossCitiesSign = _React$useState2[0],
|
|
26790
|
+
setCrossCitiesSign = _React$useState2[1]; // 同步表单初始值和外部更新
|
|
26791
|
+
|
|
26792
|
+
|
|
26793
|
+
React__default['default'].useEffect(function () {
|
|
26794
|
+
var currentValue = form.getFieldValue('crossCitiesSign');
|
|
26795
|
+
setCrossCitiesSign(currentValue);
|
|
26796
|
+
}, [form]);
|
|
26769
26797
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
26770
26798
|
className: "kts-invoice-operate-real-estate-info-digtal"
|
|
26771
26799
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -26835,6 +26863,9 @@ var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fun
|
|
|
26835
26863
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
26836
26864
|
style: {
|
|
26837
26865
|
width: '100%'
|
|
26866
|
+
},
|
|
26867
|
+
onChange: function onChange(value) {
|
|
26868
|
+
return setCrossCitiesSign(value);
|
|
26838
26869
|
}
|
|
26839
26870
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select.Option, {
|
|
26840
26871
|
value: 'Y'
|
|
@@ -26842,6 +26873,62 @@ var Architecture = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fun
|
|
|
26842
26873
|
value: 'N'
|
|
26843
26874
|
}, "\u5426"))))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
26844
26875
|
span: 6
|
|
26876
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
26877
|
+
label: "\u8DE8\u533A\u57DF\u6D89\u7A0E\u4E8B\u9879\u62A5\u9A8C\u7BA1\u7406\u7F16\u53F7"
|
|
26878
|
+
}, getFieldDecorator('crossRegionTaxReportNo', {
|
|
26879
|
+
rules: [{
|
|
26880
|
+
required: crossCitiesSign === 'Y',
|
|
26881
|
+
message: '请输入跨区域涉税事项报验管理编号'
|
|
26882
|
+
}]
|
|
26883
|
+
})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Input, {
|
|
26884
|
+
readOnly: true,
|
|
26885
|
+
autoComplete: 'off',
|
|
26886
|
+
addonAfter: props.showGetCrossRegionTaxReportNoButton && /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Button, {
|
|
26887
|
+
style: {
|
|
26888
|
+
height: 0,
|
|
26889
|
+
padding: 0,
|
|
26890
|
+
width: "auto"
|
|
26891
|
+
},
|
|
26892
|
+
type: "link",
|
|
26893
|
+
icon: /*#__PURE__*/React__default['default'].createElement(Icon, {
|
|
26894
|
+
component: SvgPlus$3
|
|
26895
|
+
}),
|
|
26896
|
+
disabled: readOnly || crossCitiesSign !== 'Y',
|
|
26897
|
+
onClick: function () {
|
|
26898
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
26899
|
+
var _props$getCrossRegion;
|
|
26900
|
+
|
|
26901
|
+
var no;
|
|
26902
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26903
|
+
while (1) {
|
|
26904
|
+
switch (_context.prev = _context.next) {
|
|
26905
|
+
case 0:
|
|
26906
|
+
_context.next = 2;
|
|
26907
|
+
return (_props$getCrossRegion = props.getCrossRegionTaxReportNo) === null || _props$getCrossRegion === void 0 ? void 0 : _props$getCrossRegion.call(props);
|
|
26908
|
+
|
|
26909
|
+
case 2:
|
|
26910
|
+
no = _context.sent;
|
|
26911
|
+
form.setFieldsValue({
|
|
26912
|
+
crossRegionTaxReportNo: no
|
|
26913
|
+
});
|
|
26914
|
+
|
|
26915
|
+
case 4:
|
|
26916
|
+
case "end":
|
|
26917
|
+
return _context.stop();
|
|
26918
|
+
}
|
|
26919
|
+
}
|
|
26920
|
+
}, _callee);
|
|
26921
|
+
}));
|
|
26922
|
+
|
|
26923
|
+
function onClick() {
|
|
26924
|
+
return _onClick.apply(this, arguments);
|
|
26925
|
+
}
|
|
26926
|
+
|
|
26927
|
+
return onClick;
|
|
26928
|
+
}()
|
|
26929
|
+
})
|
|
26930
|
+
})))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
26931
|
+
span: 6
|
|
26845
26932
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
26846
26933
|
label: "\u5EFA\u7B51\u9879\u76EE\u540D\u79F0"
|
|
26847
26934
|
}, getFieldDecorator('constructName', {
|
|
@@ -31640,7 +31727,11 @@ var Main$6 = function Main(props) {
|
|
|
31640
31727
|
useToGenerateId(controller);
|
|
31641
31728
|
React__default['default'].useEffect(function () {
|
|
31642
31729
|
setKey(key + 1);
|
|
31643
|
-
}, [controller]);
|
|
31730
|
+
}, [controller]); // React.useEffect(() => {
|
|
31731
|
+
// setKey(key + 1)
|
|
31732
|
+
// controller.state.stakeholder.enables = ['taxAmount']
|
|
31733
|
+
// }, [controller]);
|
|
31734
|
+
|
|
31644
31735
|
return /*#__PURE__*/React__default['default'].createElement(InvoiceContext.Provider, {
|
|
31645
31736
|
key: key,
|
|
31646
31737
|
value: controller
|
package/package.json
CHANGED
|
@@ -14581,18 +14581,26 @@ export default () => {
|
|
|
14581
14581
|
title='农产品'
|
|
14582
14582
|
/>
|
|
14583
14583
|
}
|
|
14584
|
-
specialInfor={<Invoice.
|
|
14585
|
-
|
|
14586
|
-
{ label: '现金', value: '001' },
|
|
14587
|
-
{ label: '银行转账', value: '002' },
|
|
14588
|
-
]}
|
|
14584
|
+
specialInfor={<Invoice.Architecture
|
|
14585
|
+
addressOptions={[]}
|
|
14589
14586
|
fieldNames={{
|
|
14590
14587
|
label: 'name',
|
|
14591
14588
|
value: 'name',
|
|
14592
14589
|
children: 'children'
|
|
14593
14590
|
}}
|
|
14594
|
-
/>
|
|
14595
|
-
|
|
14591
|
+
/>}
|
|
14592
|
+
// specialInfor={<Invoice.PayList
|
|
14593
|
+
// vehicleTypeList={[
|
|
14594
|
+
// { label: '现金', value: '001' },
|
|
14595
|
+
// { label: '银行转账', value: '002' },
|
|
14596
|
+
// ]}
|
|
14597
|
+
// fieldNames={{
|
|
14598
|
+
// label: 'name',
|
|
14599
|
+
// value: 'name',
|
|
14600
|
+
// children: 'children'
|
|
14601
|
+
// }}
|
|
14602
|
+
// />
|
|
14603
|
+
// }
|
|
14596
14604
|
stakeholder={
|
|
14597
14605
|
<Invoice.StakeFarmerholder
|
|
14598
14606
|
isExpand={false}
|
|
@@ -69,16 +69,6 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
|
|
|
69
69
|
|
|
70
70
|
_values.set('payList', this.state.payListState.goodsList.slice());
|
|
71
71
|
|
|
72
|
-
// 金额(含税)
|
|
73
|
-
_values.set('lineAmountIncludeTax', (() => {
|
|
74
|
-
let sum = chain(bignumber(0));
|
|
75
|
-
this.state.goodsListState.goodsList.forEach(e => {
|
|
76
|
-
if (!e || e.lineAttribute === LineAttributeType.赠品行) return;
|
|
77
|
-
sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
|
|
78
|
-
});
|
|
79
|
-
return sum.done().toNumber();
|
|
80
|
-
})());
|
|
81
|
-
|
|
82
72
|
// 金额(不含税)
|
|
83
73
|
_values.set('lineAmountExcludeTax', (() => {
|
|
84
74
|
let sum = chain(bignumber(0));
|
|
@@ -99,6 +89,17 @@ export default class InvoiceControllerForm extends GreyReactBox<InvoiceControlle
|
|
|
99
89
|
return sum.done().toNumber();
|
|
100
90
|
})());
|
|
101
91
|
|
|
92
|
+
// 金额(含税)
|
|
93
|
+
_values.set('lineAmountIncludeTax', (() => {
|
|
94
|
+
let sum = chain(bignumber(0));
|
|
95
|
+
this.state.goodsListState.goodsList.forEach(e => {
|
|
96
|
+
if (!e || e.lineAttribute === LineAttributeType.赠品行) return;
|
|
97
|
+
sum = sum.add(bignumber(e.lineAmountIncludeTax || 0));
|
|
98
|
+
});
|
|
99
|
+
return sum.done().toNumber();
|
|
100
|
+
// return chain(bignumber(_values.get('lineAmountExcludeTax'))).add(bignumber(_values.get('taxAmount'))).done().toNumber();
|
|
101
|
+
})());
|
|
102
|
+
|
|
102
103
|
// 含税标记
|
|
103
104
|
_values.set('isTaxIncluded', this.state.goodsListState.isTaxIncluded)
|
|
104
105
|
|
package/src/Invoice/index.tsx
CHANGED
|
@@ -148,6 +148,10 @@ const Main = (props: IInvoiceProps) => {
|
|
|
148
148
|
useToGenerateId(controller);
|
|
149
149
|
|
|
150
150
|
React.useEffect(() => { setKey(key + 1) }, [controller]);
|
|
151
|
+
// React.useEffect(() => {
|
|
152
|
+
// setKey(key + 1)
|
|
153
|
+
// controller.state.stakeholder.enables = ['taxAmount']
|
|
154
|
+
// }, [controller]);
|
|
151
155
|
|
|
152
156
|
return (
|
|
153
157
|
<InvoiceContext.Provider key={key} value={controller}>
|
|
@@ -439,8 +439,11 @@ export const updateUnitPriceTax = async (controller: InvoiceController, form: Wr
|
|
|
439
439
|
await controller.setEditGood({ priceIncludeTax });
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
// 税额 = 金额(含税)-金额(不含税)
|
|
443
|
-
const taxAmount = evaluate(`${lineAmountIncludeTax} - ${lineAmountExcludeTax}`);
|
|
442
|
+
// 税额 = 金额(含税)-金额(不含税) (老逻辑)
|
|
443
|
+
// const taxAmount = evaluate(`${lineAmountIncludeTax} - ${lineAmountExcludeTax}`);
|
|
444
|
+
|
|
445
|
+
// 税额 = 金额(含税)-金额(不含税)(新逻辑)
|
|
446
|
+
const taxAmount = evaluate(`${lineAmountExcludeTax} * ${values.taxRate}/100`);
|
|
444
447
|
form.setFieldsValue({ taxAmount });
|
|
445
448
|
await controller.setEditGood({ taxAmount });
|
|
446
449
|
} else {
|
|
@@ -593,8 +593,8 @@ export default (form: WrappedFormUtils) => {
|
|
|
593
593
|
style={{ textAlign: 'right' }}
|
|
594
594
|
loading={isCipher(changeField, 'taxAmount')}
|
|
595
595
|
onChange={() => {
|
|
596
|
-
setChangeField('taxAmount');
|
|
597
|
-
onChangeTaxAmount(controller, form, record);
|
|
596
|
+
// setChangeField('taxAmount');
|
|
597
|
+
// onChangeTaxAmount(controller, form, record);
|
|
598
598
|
}}
|
|
599
599
|
/>
|
|
600
600
|
: <MyDiv loading={isCipher(changeField, 'taxAmount')} />
|
|
@@ -770,3 +770,4 @@ function dcoding(v: string): string {
|
|
|
770
770
|
function isDutyFree(record: IGood): boolean {
|
|
771
771
|
return (record.taxFreeType as any) === 1 && record.favouredPolicyName === '免税';
|
|
772
772
|
}
|
|
773
|
+
|