kts-component-invoice-operate 3.2.181-28 → 3.2.181-29

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 CHANGED
@@ -14508,12 +14508,117 @@ var useColumns = (function (form) {
14508
14508
  width: 119,
14509
14509
  render: function render(value, record) {
14510
14510
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
14511
- return getFieldDecorator('taxAmount', {
14511
+ return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('taxAmount', {
14512
14512
  initialValue: editGood.taxAmount,
14513
- rules: getReplenishRules('taxAmount')
14514
- })( /*#__PURE__*/React.createElement(MyDiv, {
14515
- loading: isCipher(changeField, 'taxAmount')
14516
- }));
14513
+ getValueFromEvent: onNumberValueChange,
14514
+ rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
14515
+ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
14516
+ message: '税额必须为数字'
14517
+ }, {
14518
+ validator: function () {
14519
+ var _validator8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_, taxAmountValue, callback) {
14520
+ var amount, taxRate, amountNum, taxRateNum, taxAmountNum, calculatedTaxAmount, diff;
14521
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
14522
+ while (1) {
14523
+ switch (_context15.prev = _context15.next) {
14524
+ case 0:
14525
+ _context15.next = 2;
14526
+ return controller.wait();
14527
+
14528
+ case 2:
14529
+ amount = getFieldValue(isTaxIncluded ? 'lineAmountIncludeTax' : 'lineAmountExcludeTax');
14530
+ taxRate = getFieldValue('taxRate');
14531
+
14532
+ if (!(!amount || amount === '' || !taxRate || taxRate === '' || !taxAmountValue || taxAmountValue === '')) {
14533
+ _context15.next = 6;
14534
+ break;
14535
+ }
14536
+
14537
+ return _context15.abrupt("return");
14538
+
14539
+ case 6:
14540
+ amountNum = parseFloat(amount);
14541
+ taxRateNum = parseFloat(taxRate);
14542
+ taxAmountNum = parseFloat(taxAmountValue); // 根据是否含税使用不同的计算方式
14543
+
14544
+ if (isTaxIncluded) {
14545
+ // 含税:税额 = (含税金额 - 扣除额) / (1 + 税率) * 税率
14546
+ calculatedTaxAmount = countTaxAmount(amountNum, deduction || 0, taxRateNum);
14547
+ } else {
14548
+ // 不含税:税额 = 不含税金额 * 税率 / 100
14549
+ calculatedTaxAmount = amountNum * taxRateNum / 100;
14550
+ }
14551
+
14552
+ if (!(calculatedTaxAmount === undefined || isNaN(calculatedTaxAmount))) {
14553
+ _context15.next = 12;
14554
+ break;
14555
+ }
14556
+
14557
+ return _context15.abrupt("return");
14558
+
14559
+ case 12:
14560
+ // 校验:|计算税额 - 实际税额| <= 0.06
14561
+ diff = Math.abs(calculatedTaxAmount - taxAmountNum);
14562
+
14563
+ if (diff > 0.06) {
14564
+ callback("\u7A0E\u989D\u4E0E\u8BA1\u7B97\u503C\uFF08".concat(calculatedTaxAmount.toFixed(2), "\uFF09\u7684\u5DEE\u989D\uFF08").concat(diff.toFixed(2), "\uFF09\u8D85\u8FC70.06\uFF0C\u8BF7\u8C03\u6574"));
14565
+ }
14566
+
14567
+ case 14:
14568
+ case "end":
14569
+ return _context15.stop();
14570
+ }
14571
+ }
14572
+ }, _callee15);
14573
+ }));
14574
+
14575
+ function validator(_x24, _x25, _x26) {
14576
+ return _validator8.apply(this, arguments);
14577
+ }
14578
+
14579
+ return validator;
14580
+ }()
14581
+ }])
14582
+ })( /*#__PURE__*/React.createElement(MyInput, {
14583
+ style: {
14584
+ textAlign: 'right'
14585
+ },
14586
+ maxLength: 25,
14587
+ loading: isCipher(changeField, 'taxAmount'),
14588
+ onChange: function () {
14589
+ var _onChange5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
14590
+ var taxAmount;
14591
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
14592
+ while (1) {
14593
+ switch (_context16.prev = _context16.next) {
14594
+ case 0:
14595
+ setChangeField('taxAmount');
14596
+ _context16.next = 3;
14597
+ return controller.wait();
14598
+
14599
+ case 3:
14600
+ taxAmount = form.getFieldsValue().taxAmount;
14601
+ controller.setEditGood({
14602
+ taxAmount: taxAmount
14603
+ });
14604
+ _context16.next = 7;
14605
+ return clearCalculatingField(controller);
14606
+
14607
+ case 7:
14608
+ case "end":
14609
+ return _context16.stop();
14610
+ }
14611
+ }
14612
+ }, _callee16);
14613
+ }));
14614
+
14615
+ function onChange() {
14616
+ return _onChange5.apply(this, arguments);
14617
+ }
14618
+
14619
+ return onChange;
14620
+ }()
14621
+ })));
14517
14622
  } else {
14518
14623
  return /*#__PURE__*/React.createElement("span", {
14519
14624
  style: {
package/dist/index.js CHANGED
@@ -14518,12 +14518,117 @@ var useColumns = (function (form) {
14518
14518
  width: 119,
14519
14519
  render: function render(value, record) {
14520
14520
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
14521
- return getFieldDecorator('taxAmount', {
14521
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxAmount', {
14522
14522
  initialValue: editGood.taxAmount,
14523
- rules: getReplenishRules('taxAmount')
14524
- })( /*#__PURE__*/React__default['default'].createElement(MyDiv, {
14525
- loading: isCipher(changeField, 'taxAmount')
14526
- }));
14523
+ getValueFromEvent: onNumberValueChange,
14524
+ rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
14525
+ pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
14526
+ message: '税额必须为数字'
14527
+ }, {
14528
+ validator: function () {
14529
+ var _validator8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_, taxAmountValue, callback) {
14530
+ var amount, taxRate, amountNum, taxRateNum, taxAmountNum, calculatedTaxAmount, diff;
14531
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
14532
+ while (1) {
14533
+ switch (_context15.prev = _context15.next) {
14534
+ case 0:
14535
+ _context15.next = 2;
14536
+ return controller.wait();
14537
+
14538
+ case 2:
14539
+ amount = getFieldValue(isTaxIncluded ? 'lineAmountIncludeTax' : 'lineAmountExcludeTax');
14540
+ taxRate = getFieldValue('taxRate');
14541
+
14542
+ if (!(!amount || amount === '' || !taxRate || taxRate === '' || !taxAmountValue || taxAmountValue === '')) {
14543
+ _context15.next = 6;
14544
+ break;
14545
+ }
14546
+
14547
+ return _context15.abrupt("return");
14548
+
14549
+ case 6:
14550
+ amountNum = parseFloat(amount);
14551
+ taxRateNum = parseFloat(taxRate);
14552
+ taxAmountNum = parseFloat(taxAmountValue); // 根据是否含税使用不同的计算方式
14553
+
14554
+ if (isTaxIncluded) {
14555
+ // 含税:税额 = (含税金额 - 扣除额) / (1 + 税率) * 税率
14556
+ calculatedTaxAmount = countTaxAmount(amountNum, deduction || 0, taxRateNum);
14557
+ } else {
14558
+ // 不含税:税额 = 不含税金额 * 税率 / 100
14559
+ calculatedTaxAmount = amountNum * taxRateNum / 100;
14560
+ }
14561
+
14562
+ if (!(calculatedTaxAmount === undefined || isNaN(calculatedTaxAmount))) {
14563
+ _context15.next = 12;
14564
+ break;
14565
+ }
14566
+
14567
+ return _context15.abrupt("return");
14568
+
14569
+ case 12:
14570
+ // 校验:|计算税额 - 实际税额| <= 0.06
14571
+ diff = Math.abs(calculatedTaxAmount - taxAmountNum);
14572
+
14573
+ if (diff > 0.06) {
14574
+ callback("\u7A0E\u989D\u4E0E\u8BA1\u7B97\u503C\uFF08".concat(calculatedTaxAmount.toFixed(2), "\uFF09\u7684\u5DEE\u989D\uFF08").concat(diff.toFixed(2), "\uFF09\u8D85\u8FC70.06\uFF0C\u8BF7\u8C03\u6574"));
14575
+ }
14576
+
14577
+ case 14:
14578
+ case "end":
14579
+ return _context15.stop();
14580
+ }
14581
+ }
14582
+ }, _callee15);
14583
+ }));
14584
+
14585
+ function validator(_x24, _x25, _x26) {
14586
+ return _validator8.apply(this, arguments);
14587
+ }
14588
+
14589
+ return validator;
14590
+ }()
14591
+ }])
14592
+ })( /*#__PURE__*/React__default['default'].createElement(MyInput, {
14593
+ style: {
14594
+ textAlign: 'right'
14595
+ },
14596
+ maxLength: 25,
14597
+ loading: isCipher(changeField, 'taxAmount'),
14598
+ onChange: function () {
14599
+ var _onChange5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
14600
+ var taxAmount;
14601
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
14602
+ while (1) {
14603
+ switch (_context16.prev = _context16.next) {
14604
+ case 0:
14605
+ setChangeField('taxAmount');
14606
+ _context16.next = 3;
14607
+ return controller.wait();
14608
+
14609
+ case 3:
14610
+ taxAmount = form.getFieldsValue().taxAmount;
14611
+ controller.setEditGood({
14612
+ taxAmount: taxAmount
14613
+ });
14614
+ _context16.next = 7;
14615
+ return clearCalculatingField(controller);
14616
+
14617
+ case 7:
14618
+ case "end":
14619
+ return _context16.stop();
14620
+ }
14621
+ }
14622
+ }, _callee16);
14623
+ }));
14624
+
14625
+ function onChange() {
14626
+ return _onChange5.apply(this, arguments);
14627
+ }
14628
+
14629
+ return onChange;
14630
+ }()
14631
+ })));
14527
14632
  } else {
14528
14633
  return /*#__PURE__*/React__default['default'].createElement("span", {
14529
14634
  style: {
@@ -0,0 +1 @@
1
+ <svg t="1670833534624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8020" width="200" height="200"><path d="M748.51214222 770.64874667h-70.48760889v-45.43829334h70.48760889c109.51793778 0 198.64689778-89.12896 198.64689778-198.64689778 0-106.60522667-83.30353778-193.98656-189.90876445-198.64689777l-16.31118222-0.58254223-4.66033778-15.72864c-30.87473778-110.10048-132.81962667-187.57859555-247.58044444-187.57859555-140.97521778 0-256.31857778 114.76081778-256.90112 255.15349333v16.89372445l-16.89372444 4.66033777c-69.90506667 19.80643555-118.25607111 83.88608-118.25607112 156.12131556 0 89.71150222 72.81777778 162.52928 162.52928 162.52928h82.13845334v45.43829334H259.17667555c-114.76081778 0-207.96757333-93.20675555-207.96757333-207.96757334 0-46.02083555 14.56355555-89.71150222 43.10812445-126.41166222 23.88423111-30.87473778 55.92405333-54.75896889 92.62421333-68.15744 4.66033778-73.98286222 35.53507555-143.30538667 88.54641778-196.31672889 57.08913778-56.50659555 132.81962667-87.96387555 213.21045333-87.96387555 67.57489778 0 131.072 21.55406222 184.08334222 62.33201777 47.18592 36.11761778 83.30353778 86.79879111 102.52743112 142.72284445 56.50659555 6.40796445 109.51793778 32.03982222 149.13080888 73.40032 43.69066667 45.43829333 68.15744 105.44014222 68.15744 168.93724444 0 65.24472889-25.63185778 126.41166222-71.65269333 172.43249778-46.02083555 47.18592-107.18776889 72.81777778-172.43249778 72.81777778z" p-id="8021"></path><path d="M539.96202667 785.21230222H494.52373333V479.37763555h45.43829334v305.83466667z" p-id="8022"></path><path d="M600.54641778 704.82147555l31.45728 32.62236445-118.83861333 115.34336-111.26556445-115.92590222 32.62236445-31.45728 79.80828444 83.30353777 86.21624889-83.88608z" p-id="8023"></path></svg>
@@ -0,0 +1 @@
1
+ <svg t="1670833567548" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8168" width="200" height="200"><path d="M748.43022222 770.38933333h-70.42844444v-45.51111111h70.42844444c109.568 0 198.656-89.088 198.656-198.656 0-106.60977778-83.39911111-193.76355555-189.78133333-198.42844444l-16.49777778-0.68266667-4.43733333-15.81511111c-30.94755555-110.36444445-132.77866667-187.50577778-247.58044445-187.50577778-140.85688889 0-256.11377778 114.57422222-257.13777778 255.31733333l-0.11377777 17.06666667-16.49777778 4.66488889c-69.632 19.68355555-118.21511111 83.968-118.21511111 156.33066667 0 89.54311111 72.93155555 162.47466667 162.47466666 162.47466667h82.37511112v45.5111111H259.41333333c-114.688 0-207.98577778-93.29777778-207.98577778-207.98577777 0-46.19377778 14.79111111-89.99822222 42.89422223-126.52088889 23.77955555-30.94755555 56.09244445-54.72711111 92.38755555-68.38044444 4.43733333-74.18311111 35.61244445-143.24622222 88.74666667-196.03911112 57.11644445-56.66133333 132.77866667-87.95022222 213.33333333-87.95022222 67.35644445 0 131.072 21.61777778 184.32 62.57777778 47.33155555 36.40888889 83.17155555 86.58488889 102.28622222 142.79111111 56.77511111 6.25777778 109.22666667 32.08533333 149.16266667 73.61422222 43.80444445 45.62488889 67.92533333 105.69955555 67.92533333 168.96 0 65.19466667-25.37244445 126.52088889-71.45244444 172.60088889-46.08 46.19377778-107.40622222 71.56622222-172.60088889 71.56622222z" p-id="8169"></path><path d="M494.36444445 546.816h45.5111111v306.06222222h-45.5111111z" p-id="8170"></path><path d="M433.60711111 627.37066667l-31.63022222-32.65422222 118.89777778-115.48444445 111.38844444 116.05333333-32.768 31.51644445-79.75822222-83.05777778z" p-id="8171"></path></svg>