kts-component-invoice-operate 3.2.201 → 3.2.203

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.
@@ -31,13 +31,6 @@ export declare function countTaxAmount(amountIncludeTax: string | number, deduct
31
31
  * @returns 单价
32
32
  */
33
33
  export declare function countPrice(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '';
34
- /**
35
- * 单价 = 金额/数量 不做小数限制
36
- * @param amount 金额
37
- * @param quantity 数量
38
- * @returns 单价
39
- */
40
- export declare function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '';
41
34
  /**
42
35
  * 数量 = 金额/单价
43
36
  * @param amount 金额
@@ -14,8 +14,10 @@ export interface IStakeholder {
14
14
  isNaturalPerson?: boolean;
15
15
  /** 是否展开 */
16
16
  isExpand?: boolean;
17
+ /** 购方,销方银行信息 勾选按钮是否显示 **/
17
18
  leqi?: boolean;
18
- riskData?: any;
19
+ /** 购方,销方地址电话 勾选按钮是否显示 **/
20
+ riskData?: boolean;
19
21
  invoiceMarkCallback?: (value: any) => void;
20
22
  }
21
23
  /** 干系人 */
package/dist/index.esm.js CHANGED
@@ -1650,19 +1650,20 @@ function countPrice(amount, quantity, calculatingDigits) {
1650
1650
  if (!amount && amount !== 0) return undefined;
1651
1651
  if (!quantity && quantity !== 0) return undefined;
1652
1652
  return format15(chain$1(bignumber(amount)).divide(bignumber(quantity)).done().toNumber(), calculatingDigits);
1653
- }
1654
- /**
1655
- * 单价 = 金额/数量 不做小数限制
1656
- * @param amount 金额
1657
- * @param quantity 数量
1658
- * @returns 单价
1659
- */
1653
+ } // /**
1654
+ // * 单价 = 金额/数量 不做小数限制
1655
+ // * @param amount 金额
1656
+ // * @param quantity 数量
1657
+ // * @returns 单价
1658
+ // */
1659
+ // export function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '' {
1660
+ // if (!amount && amount !== 0) return undefined;
1661
+ // if (!quantity && quantity !== 0) return undefined;
1662
+ // return chain(bignumber(amount)).divide(bignumber(quantity))
1663
+ // .done()
1664
+ // .toString().substr(0,25)
1665
+ // }
1660
1666
 
1661
- function countPriceNoLimit(amount, quantity, calculatingDigits) {
1662
- if (!amount && amount !== 0) return undefined;
1663
- if (!quantity && quantity !== 0) return undefined;
1664
- return chain$1(bignumber(amount)).divide(bignumber(quantity)).done().toString().substr(0, 25);
1665
- }
1666
1667
  /**
1667
1668
  * 数量 = 金额/单价
1668
1669
  * @param amount 金额
@@ -1715,7 +1716,6 @@ var calculator = /*#__PURE__*/Object.freeze({
1715
1716
  countAmountExcludeTax: countAmountExcludeTax,
1716
1717
  countTaxAmount: countTaxAmount,
1717
1718
  countPrice: countPrice,
1718
- countPriceNoLimit: countPriceNoLimit,
1719
1719
  countQuantity: countQuantity,
1720
1720
  nonScientificNotation: nonScientificNotation
1721
1721
  });
@@ -17476,8 +17476,6 @@ var formatCompanyName = function formatCompanyName(e) {
17476
17476
 
17477
17477
 
17478
17478
  var Stakeholder$1 = decorator(Form.create())(function (props) {
17479
- var _props$riskData2, _props$riskData3;
17480
-
17481
17479
  var form = props.form,
17482
17480
  isShowImportButton = props.isShowImportButton,
17483
17481
  onClickImportButton = props.onClickImportButton,
@@ -17512,9 +17510,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
17512
17510
  /** 直连 */
17513
17511
 
17514
17512
  var riskspanW = React.useMemo(function () {
17515
- var _props$riskData;
17516
-
17517
- if (((_props$riskData = props.riskData) === null || _props$riskData === void 0 ? void 0 : _props$riskData.code) === 'success') {
17513
+ if (props.riskData) {
17518
17514
  return 0;
17519
17515
  } else {
17520
17516
  return 2;
@@ -17668,7 +17664,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
17668
17664
  readOnly: isReadOnly('buyerAccount'),
17669
17665
  placeholder: "\u8BF7\u8F93\u5165\u94F6\u884C\u8D26\u53F7",
17670
17666
  autoComplete: "off"
17671
- })))), (props.leqi || ((_props$riskData2 = props.riskData) === null || _props$riskData2 === void 0 ? void 0 : _props$riskData2.code) === 'success') && /*#__PURE__*/React.createElement(Col, {
17667
+ })))), props.leqi && /*#__PURE__*/React.createElement(Col, {
17672
17668
  span: 4,
17673
17669
  style: {
17674
17670
  display: isExpand ? undefined : 'none'
@@ -17791,7 +17787,7 @@ var Stakeholder$1 = decorator(Form.create())(function (props) {
17791
17787
  readOnly: isReadOnly('sellerAccount'),
17792
17788
  placeholder: "\u8BF7\u8F93\u5165\u94F6\u884C\u8D26\u53F7",
17793
17789
  autoComplete: "off"
17794
- })))), (props.leqi || ((_props$riskData3 = props.riskData) === null || _props$riskData3 === void 0 ? void 0 : _props$riskData3.code) === 'success') && /*#__PURE__*/React.createElement(Col, {
17790
+ })))), props.leqi && /*#__PURE__*/React.createElement(Col, {
17795
17791
  span: 4,
17796
17792
  style: {
17797
17793
  display: isExpand ? undefined : 'none'
@@ -19401,7 +19397,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19401
19397
 
19402
19398
  case 11:
19403
19399
  calculatingDigits = controller.state.calculatingDigits;
19404
- quantity = values.quantity;
19400
+ quantity = format15(values.quantity, calculatingDigits);
19405
19401
  _context3.next = 16;
19406
19402
  return controller.setEditGood({
19407
19403
  quantity: quantity
@@ -19423,7 +19419,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19423
19419
  }
19424
19420
 
19425
19421
  // 可以找到 单价(含税)
19426
- priceIncludeTax = values.priceIncludeTax;
19422
+ priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
19427
19423
  lineAmountIncludeTax = format2(evaluate("".concat(priceIncludeTax, " * ").concat(quantity)));
19428
19424
  form.setFieldsValue({
19429
19425
  lineAmountIncludeTax: lineAmountIncludeTax
@@ -19445,7 +19441,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19445
19441
 
19446
19442
  // 可以找到 金额(含税)
19447
19443
  _lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
19448
- _priceIncludeTax = evaluate("".concat(_lineAmountIncludeTax, " / ").concat(quantity));
19444
+ _priceIncludeTax = format15(evaluate("".concat(_lineAmountIncludeTax, " / ").concat(quantity)), calculatingDigits);
19449
19445
  form.setFieldsValue({
19450
19446
  priceIncludeTax: _priceIncludeTax
19451
19447
  });
@@ -19469,7 +19465,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19469
19465
  }
19470
19466
 
19471
19467
  // 可以找到 单价(不含税)
19472
- priceExcludeTax = values.priceExcludeTax;
19468
+ priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
19473
19469
  lineAmountExcludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceExcludeTax)));
19474
19470
  form.setFieldsValue({
19475
19471
  lineAmountExcludeTax: lineAmountExcludeTax
@@ -19492,7 +19488,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19492
19488
 
19493
19489
  // 可以找到 金额(不含税)
19494
19490
  _lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
19495
- _priceExcludeTax = evaluate("".concat(_lineAmountExcludeTax, " / ").concat(quantity));
19491
+ _priceExcludeTax = format15(evaluate("".concat(_lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
19496
19492
  form.setFieldsValue({
19497
19493
  priceExcludeTax: _priceExcludeTax
19498
19494
  });
@@ -19568,7 +19564,7 @@ var onChangePriceIncludeTax$1 = lazyFn$2(function (controller, form, record) {
19568
19564
 
19569
19565
  case 11:
19570
19566
  calculatingDigits = controller.state.calculatingDigits;
19571
- priceIncludeTax = values.priceIncludeTax;
19567
+ priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
19572
19568
  _context4.next = 15;
19573
19569
  return controller.setEditGood({
19574
19570
  priceIncludeTax: priceIncludeTax
@@ -19584,7 +19580,7 @@ var onChangePriceIncludeTax$1 = lazyFn$2(function (controller, form, record) {
19584
19580
  break;
19585
19581
  }
19586
19582
 
19587
- quantity = values.quantity;
19583
+ quantity = format15(values.quantity, calculatingDigits);
19588
19584
  lineAmountIncludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceIncludeTax)));
19589
19585
  form.setFieldsValue({
19590
19586
  lineAmountIncludeTax: lineAmountIncludeTax
@@ -19605,7 +19601,7 @@ var onChangePriceIncludeTax$1 = lazyFn$2(function (controller, form, record) {
19605
19601
  }
19606
19602
 
19607
19603
  _lineAmountIncludeTax2 = format2(values.lineAmountIncludeTax);
19608
- _quantity = evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(priceIncludeTax));
19604
+ _quantity = format15(evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(priceIncludeTax)), calculatingDigits);
19609
19605
  form.setFieldsValue({
19610
19606
  quantity: _quantity
19611
19607
  });
@@ -19680,7 +19676,7 @@ var onChangePriceExcludeTax$1 = lazyFn$2(function (controller, form, record) {
19680
19676
 
19681
19677
  case 11:
19682
19678
  calculatingDigits = controller.state.calculatingDigits;
19683
- priceExcludeTax = values.priceExcludeTax;
19679
+ priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
19684
19680
  _context5.next = 15;
19685
19681
  return controller.setEditGood({
19686
19682
  priceExcludeTax: priceExcludeTax
@@ -19696,7 +19692,7 @@ var onChangePriceExcludeTax$1 = lazyFn$2(function (controller, form, record) {
19696
19692
  break;
19697
19693
  }
19698
19694
 
19699
- quantity = values.quantity;
19695
+ quantity = format15(values.quantity, calculatingDigits);
19700
19696
  lineAmountExcludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceExcludeTax)));
19701
19697
  form.setFieldsValue({
19702
19698
  lineAmountExcludeTax: lineAmountExcludeTax
@@ -19717,7 +19713,7 @@ var onChangePriceExcludeTax$1 = lazyFn$2(function (controller, form, record) {
19717
19713
  }
19718
19714
 
19719
19715
  _lineAmountExcludeTax2 = format2(values.lineAmountExcludeTax);
19720
- _quantity2 = evaluate("".concat(_lineAmountExcludeTax2, " / ").concat(priceExcludeTax));
19716
+ _quantity2 = format15(evaluate("".concat(_lineAmountExcludeTax2, " / ").concat(priceExcludeTax)), calculatingDigits);
19721
19717
  form.setFieldsValue({
19722
19718
  quantity: _quantity2
19723
19719
  });
@@ -22131,7 +22127,6 @@ var useColumns$1 = (function (form) {
22131
22127
  style: {
22132
22128
  textAlign: 'right'
22133
22129
  },
22134
- max: 99999999999999999999,
22135
22130
  loading: isCipher$1(changeField, 'lineAmountIncludeTax'),
22136
22131
  onChange: function onChange() {
22137
22132
  setChangeField('lineAmountIncludeTax');
@@ -24930,7 +24925,7 @@ function _addGood$2() {
24930
24925
  _context4.next = 6;
24931
24926
  return controller.run( /*#__PURE__*/function () {
24932
24927
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
24933
- var _controller$state$goo;
24928
+ var _controller$state$fre;
24934
24929
 
24935
24930
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24936
24931
  while (1) {
@@ -24942,7 +24937,7 @@ function _addGood$2() {
24942
24937
  }
24943
24938
 
24944
24939
  _context3.next = 3;
24945
- return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
24940
+ return (_controller$state$fre = controller.state.freightListState.form) === null || _controller$state$fre === void 0 ? void 0 : _controller$state$fre.validateFields( /*#__PURE__*/function () {
24946
24941
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
24947
24942
  var firstError;
24948
24943
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -27395,7 +27390,7 @@ var DrawerBody$3 = function DrawerBody(props) {
27395
27390
  }
27396
27391
 
27397
27392
  if (good.lineAmountExcludeTax && good.quantity) {
27398
- good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27393
+ good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27399
27394
  } //赋值商品的可用税率
27400
27395
 
27401
27396
 
@@ -27774,11 +27769,12 @@ function AddComparisonDrawer() {
27774
27769
  // })
27775
27770
  // }
27776
27771
 
27777
- var config = {
27778
- number: 'BigNumber',
27779
- precision: 64
27780
- };
27781
- create(all, config);
27772
+ // const config = {
27773
+ // number: 'BigNumber',
27774
+ // precision: 64,
27775
+ // }
27776
+ // create(all, config);
27777
+
27782
27778
  /** 发票组件的上下文 */
27783
27779
 
27784
27780
  var InvoiceContext = /*#__PURE__*/React.createContext(undefined);
package/dist/index.js CHANGED
@@ -1660,19 +1660,20 @@ function countPrice(amount, quantity, calculatingDigits) {
1660
1660
  if (!amount && amount !== 0) return undefined;
1661
1661
  if (!quantity && quantity !== 0) return undefined;
1662
1662
  return format15(mathjs.chain(mathjs.bignumber(amount)).divide(mathjs.bignumber(quantity)).done().toNumber(), calculatingDigits);
1663
- }
1664
- /**
1665
- * 单价 = 金额/数量 不做小数限制
1666
- * @param amount 金额
1667
- * @param quantity 数量
1668
- * @returns 单价
1669
- */
1663
+ } // /**
1664
+ // * 单价 = 金额/数量 不做小数限制
1665
+ // * @param amount 金额
1666
+ // * @param quantity 数量
1667
+ // * @returns 单价
1668
+ // */
1669
+ // export function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '' {
1670
+ // if (!amount && amount !== 0) return undefined;
1671
+ // if (!quantity && quantity !== 0) return undefined;
1672
+ // return chain(bignumber(amount)).divide(bignumber(quantity))
1673
+ // .done()
1674
+ // .toString().substr(0,25)
1675
+ // }
1670
1676
 
1671
- function countPriceNoLimit(amount, quantity, calculatingDigits) {
1672
- if (!amount && amount !== 0) return undefined;
1673
- if (!quantity && quantity !== 0) return undefined;
1674
- return mathjs.chain(mathjs.bignumber(amount)).divide(mathjs.bignumber(quantity)).done().toString().substr(0, 25);
1675
- }
1676
1677
  /**
1677
1678
  * 数量 = 金额/单价
1678
1679
  * @param amount 金额
@@ -1725,7 +1726,6 @@ var calculator = /*#__PURE__*/Object.freeze({
1725
1726
  countAmountExcludeTax: countAmountExcludeTax,
1726
1727
  countTaxAmount: countTaxAmount,
1727
1728
  countPrice: countPrice,
1728
- countPriceNoLimit: countPriceNoLimit,
1729
1729
  countQuantity: countQuantity,
1730
1730
  nonScientificNotation: nonScientificNotation
1731
1731
  });
@@ -17486,8 +17486,6 @@ var formatCompanyName = function formatCompanyName(e) {
17486
17486
 
17487
17487
 
17488
17488
  var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
17489
- var _props$riskData2, _props$riskData3;
17490
-
17491
17489
  var form = props.form,
17492
17490
  isShowImportButton = props.isShowImportButton,
17493
17491
  onClickImportButton = props.onClickImportButton,
@@ -17522,9 +17520,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
17522
17520
  /** 直连 */
17523
17521
 
17524
17522
  var riskspanW = React__default['default'].useMemo(function () {
17525
- var _props$riskData;
17526
-
17527
- if (((_props$riskData = props.riskData) === null || _props$riskData === void 0 ? void 0 : _props$riskData.code) === 'success') {
17523
+ if (props.riskData) {
17528
17524
  return 0;
17529
17525
  } else {
17530
17526
  return 2;
@@ -17678,7 +17674,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
17678
17674
  readOnly: isReadOnly('buyerAccount'),
17679
17675
  placeholder: "\u8BF7\u8F93\u5165\u94F6\u884C\u8D26\u53F7",
17680
17676
  autoComplete: "off"
17681
- })))), (props.leqi || ((_props$riskData2 = props.riskData) === null || _props$riskData2 === void 0 ? void 0 : _props$riskData2.code) === 'success') && /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
17677
+ })))), props.leqi && /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
17682
17678
  span: 4,
17683
17679
  style: {
17684
17680
  display: isExpand ? undefined : 'none'
@@ -17801,7 +17797,7 @@ var Stakeholder$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
17801
17797
  readOnly: isReadOnly('sellerAccount'),
17802
17798
  placeholder: "\u8BF7\u8F93\u5165\u94F6\u884C\u8D26\u53F7",
17803
17799
  autoComplete: "off"
17804
- })))), (props.leqi || ((_props$riskData3 = props.riskData) === null || _props$riskData3 === void 0 ? void 0 : _props$riskData3.code) === 'success') && /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
17800
+ })))), props.leqi && /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
17805
17801
  span: 4,
17806
17802
  style: {
17807
17803
  display: isExpand ? undefined : 'none'
@@ -19411,7 +19407,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19411
19407
 
19412
19408
  case 11:
19413
19409
  calculatingDigits = controller.state.calculatingDigits;
19414
- quantity = values.quantity;
19410
+ quantity = format15(values.quantity, calculatingDigits);
19415
19411
  _context3.next = 16;
19416
19412
  return controller.setEditGood({
19417
19413
  quantity: quantity
@@ -19433,7 +19429,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19433
19429
  }
19434
19430
 
19435
19431
  // 可以找到 单价(含税)
19436
- priceIncludeTax = values.priceIncludeTax;
19432
+ priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
19437
19433
  lineAmountIncludeTax = format2(evaluate("".concat(priceIncludeTax, " * ").concat(quantity)));
19438
19434
  form.setFieldsValue({
19439
19435
  lineAmountIncludeTax: lineAmountIncludeTax
@@ -19455,7 +19451,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19455
19451
 
19456
19452
  // 可以找到 金额(含税)
19457
19453
  _lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
19458
- _priceIncludeTax = evaluate("".concat(_lineAmountIncludeTax, " / ").concat(quantity));
19454
+ _priceIncludeTax = format15(evaluate("".concat(_lineAmountIncludeTax, " / ").concat(quantity)), calculatingDigits);
19459
19455
  form.setFieldsValue({
19460
19456
  priceIncludeTax: _priceIncludeTax
19461
19457
  });
@@ -19479,7 +19475,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19479
19475
  }
19480
19476
 
19481
19477
  // 可以找到 单价(不含税)
19482
- priceExcludeTax = values.priceExcludeTax;
19478
+ priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
19483
19479
  lineAmountExcludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceExcludeTax)));
19484
19480
  form.setFieldsValue({
19485
19481
  lineAmountExcludeTax: lineAmountExcludeTax
@@ -19502,7 +19498,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
19502
19498
 
19503
19499
  // 可以找到 金额(不含税)
19504
19500
  _lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
19505
- _priceExcludeTax = evaluate("".concat(_lineAmountExcludeTax, " / ").concat(quantity));
19501
+ _priceExcludeTax = format15(evaluate("".concat(_lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
19506
19502
  form.setFieldsValue({
19507
19503
  priceExcludeTax: _priceExcludeTax
19508
19504
  });
@@ -19578,7 +19574,7 @@ var onChangePriceIncludeTax$1 = lazyFn$2(function (controller, form, record) {
19578
19574
 
19579
19575
  case 11:
19580
19576
  calculatingDigits = controller.state.calculatingDigits;
19581
- priceIncludeTax = values.priceIncludeTax;
19577
+ priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
19582
19578
  _context4.next = 15;
19583
19579
  return controller.setEditGood({
19584
19580
  priceIncludeTax: priceIncludeTax
@@ -19594,7 +19590,7 @@ var onChangePriceIncludeTax$1 = lazyFn$2(function (controller, form, record) {
19594
19590
  break;
19595
19591
  }
19596
19592
 
19597
- quantity = values.quantity;
19593
+ quantity = format15(values.quantity, calculatingDigits);
19598
19594
  lineAmountIncludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceIncludeTax)));
19599
19595
  form.setFieldsValue({
19600
19596
  lineAmountIncludeTax: lineAmountIncludeTax
@@ -19615,7 +19611,7 @@ var onChangePriceIncludeTax$1 = lazyFn$2(function (controller, form, record) {
19615
19611
  }
19616
19612
 
19617
19613
  _lineAmountIncludeTax2 = format2(values.lineAmountIncludeTax);
19618
- _quantity = evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(priceIncludeTax));
19614
+ _quantity = format15(evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(priceIncludeTax)), calculatingDigits);
19619
19615
  form.setFieldsValue({
19620
19616
  quantity: _quantity
19621
19617
  });
@@ -19690,7 +19686,7 @@ var onChangePriceExcludeTax$1 = lazyFn$2(function (controller, form, record) {
19690
19686
 
19691
19687
  case 11:
19692
19688
  calculatingDigits = controller.state.calculatingDigits;
19693
- priceExcludeTax = values.priceExcludeTax;
19689
+ priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
19694
19690
  _context5.next = 15;
19695
19691
  return controller.setEditGood({
19696
19692
  priceExcludeTax: priceExcludeTax
@@ -19706,7 +19702,7 @@ var onChangePriceExcludeTax$1 = lazyFn$2(function (controller, form, record) {
19706
19702
  break;
19707
19703
  }
19708
19704
 
19709
- quantity = values.quantity;
19705
+ quantity = format15(values.quantity, calculatingDigits);
19710
19706
  lineAmountExcludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceExcludeTax)));
19711
19707
  form.setFieldsValue({
19712
19708
  lineAmountExcludeTax: lineAmountExcludeTax
@@ -19727,7 +19723,7 @@ var onChangePriceExcludeTax$1 = lazyFn$2(function (controller, form, record) {
19727
19723
  }
19728
19724
 
19729
19725
  _lineAmountExcludeTax2 = format2(values.lineAmountExcludeTax);
19730
- _quantity2 = evaluate("".concat(_lineAmountExcludeTax2, " / ").concat(priceExcludeTax));
19726
+ _quantity2 = format15(evaluate("".concat(_lineAmountExcludeTax2, " / ").concat(priceExcludeTax)), calculatingDigits);
19731
19727
  form.setFieldsValue({
19732
19728
  quantity: _quantity2
19733
19729
  });
@@ -22141,7 +22137,6 @@ var useColumns$1 = (function (form) {
22141
22137
  style: {
22142
22138
  textAlign: 'right'
22143
22139
  },
22144
- max: 99999999999999999999,
22145
22140
  loading: isCipher$1(changeField, 'lineAmountIncludeTax'),
22146
22141
  onChange: function onChange() {
22147
22142
  setChangeField('lineAmountIncludeTax');
@@ -24940,7 +24935,7 @@ function _addGood$2() {
24940
24935
  _context4.next = 6;
24941
24936
  return controller.run( /*#__PURE__*/function () {
24942
24937
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
24943
- var _controller$state$goo;
24938
+ var _controller$state$fre;
24944
24939
 
24945
24940
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
24946
24941
  while (1) {
@@ -24952,7 +24947,7 @@ function _addGood$2() {
24952
24947
  }
24953
24948
 
24954
24949
  _context3.next = 3;
24955
- return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
24950
+ return (_controller$state$fre = controller.state.freightListState.form) === null || _controller$state$fre === void 0 ? void 0 : _controller$state$fre.validateFields( /*#__PURE__*/function () {
24956
24951
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
24957
24952
  var firstError;
24958
24953
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -27405,7 +27400,7 @@ var DrawerBody$3 = function DrawerBody(props) {
27405
27400
  }
27406
27401
 
27407
27402
  if (good.lineAmountExcludeTax && good.quantity) {
27408
- good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27403
+ good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits);
27409
27404
  } //赋值商品的可用税率
27410
27405
 
27411
27406
 
@@ -27784,11 +27779,12 @@ function AddComparisonDrawer() {
27784
27779
  // })
27785
27780
  // }
27786
27781
 
27787
- var config = {
27788
- number: 'BigNumber',
27789
- precision: 64
27790
- };
27791
- mathjs.create(mathjs.all, config);
27782
+ // const config = {
27783
+ // number: 'BigNumber',
27784
+ // precision: 64,
27785
+ // }
27786
+ // create(all, config);
27787
+
27792
27788
  /** 发票组件的上下文 */
27793
27789
 
27794
27790
  var InvoiceContext = /*#__PURE__*/React__default['default'].createContext(undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.201",
3
+ "version": "3.2.203",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -36,7 +36,7 @@
36
36
  ## 不动产经营租赁服务
37
37
  <code src="./_test/realEstateInfo/index.tsx"></code>
38
38
 
39
-
39
+ -->
40
40
 
41
41
  ## 货物运输服务
42
- <code src="./_test/freight/index.tsx"></code> -->
42
+ <code src="./_test/freight/index.tsx"></code>
@@ -26,12 +26,12 @@ import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
26
26
  import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
27
27
  import EndowCodeDrawer from './ui/default/EndowCodeDrawer';
28
28
  import AddComparisonDrawer from './ui/default/AddComparisonDrawer';
29
- import { create, all } from 'mathjs';
30
- const config = {
31
- number: 'BigNumber',
32
- precision: 64,
33
- }
34
- create(all, config);
29
+ // import { create, all } from 'mathjs';
30
+ // const config = {
31
+ // number: 'BigNumber',
32
+ // precision: 64,
33
+ // }
34
+ // create(all, config);
35
35
 
36
36
 
37
37
  /** 发票组件的上下文 */
@@ -90,19 +90,19 @@ export function countPrice(amount: string | number, quantity: string | number, c
90
90
  .done()
91
91
  .toNumber(), calculatingDigits)
92
92
  }
93
- /**
94
- * 单价 = 金额/数量 不做小数限制
95
- * @param amount 金额
96
- * @param quantity 数量
97
- * @returns 单价
98
- */
99
- export function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '' {
100
- if (!amount && amount !== 0) return undefined;
101
- if (!quantity && quantity !== 0) return undefined;
102
- return chain(bignumber(amount)).divide(bignumber(quantity))
103
- .done()
104
- .toString().substr(0,25)
105
- }
93
+ // /**
94
+ // * 单价 = 金额/数量 不做小数限制
95
+ // * @param amount 金额
96
+ // * @param quantity 数量
97
+ // * @returns 单价
98
+ // */
99
+ // export function countPriceNoLimit(amount: string | number, quantity: string | number, calculatingDigits?: number): number | undefined | '' {
100
+ // if (!amount && amount !== 0) return undefined;
101
+ // if (!quantity && quantity !== 0) return undefined;
102
+ // return chain(bignumber(amount)).divide(bignumber(quantity))
103
+ // .done()
104
+ // .toString().substr(0,25)
105
+ // }
106
106
 
107
107
  /**
108
108
  * 数量 = 金额/单价
@@ -6,7 +6,7 @@ import { Input, NumberPicker } from '@formily/antd-components';
6
6
  import { format15 } from '../GoodsList/hook/useColumns/autoFillFn';
7
7
  import { LineAttributeType } from '../../../InvoiceController';
8
8
  import IGood from '../../../InvoiceController/InvoiceControllerState/GoodsListState/IGood';
9
- import { countTaxAmount, countAmountExcludeTax, countPrice,countPriceNoLimit } from '../../../tools/calculate';
9
+ import { countTaxAmount, countAmountExcludeTax, countPrice } from '../../../tools/calculate';
10
10
  import { bytesLnegth, cutStr } from '../../../tools/strringFn';
11
11
  import {
12
12
  SchemaForm,
@@ -493,7 +493,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
493
493
  good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
494
494
  }
495
495
  if (good.lineAmountExcludeTax && good.quantity) {
496
- good.priceExcludeTax = countPriceNoLimit(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
496
+ good.priceExcludeTax = countPrice(good.lineAmountExcludeTax, good.quantity, controller.state.calculatingDigits) as any;
497
497
  }
498
498
 
499
499
  //赋值商品的可用税率
@@ -51,7 +51,7 @@ async function addGood(controller: InvoiceController) {
51
51
  // key: '你正在编辑一个货物运输行',
52
52
  // });
53
53
  // return;
54
- await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
54
+ await controller.state.freightListState.form?.validateFields(async (err: any, values: any) => {
55
55
  if (err) {
56
56
  const firstError: any = Object.values(err)[0];
57
57
  message.error({
@@ -67,7 +67,7 @@ export const onChangeQuantity = lazyFn(
67
67
  };
68
68
 
69
69
  const calculatingDigits = controller.state.calculatingDigits;
70
- const quantity = values.quantity;
70
+ const quantity = format15(values.quantity, calculatingDigits);
71
71
  await controller.setEditGood({ quantity });
72
72
  form.setFieldsValue({ quantity });
73
73
 
@@ -76,16 +76,16 @@ export const onChangeQuantity = lazyFn(
76
76
  // 含税
77
77
  if (!err.priceIncludeTax && values.priceIncludeTax) {
78
78
  // 可以找到 单价(含税)
79
- const priceIncludeTax = values.priceIncludeTax;
79
+ const priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
80
80
  const lineAmountIncludeTax = format2(evaluate(`${priceIncludeTax} * ${quantity}`));
81
81
  form.setFieldsValue({ lineAmountIncludeTax });
82
82
  await controller.setEditGood({ lineAmountIncludeTax });
83
83
  } else if (!err.lineAmountIncludeTax && values.lineAmountIncludeTax) {
84
84
  // 可以找到 金额(含税)
85
85
  const lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
86
- const priceIncludeTax =
87
- evaluate(`${lineAmountIncludeTax} / ${quantity}`)
88
- ;
86
+ const priceIncludeTax = format15(
87
+ evaluate(`${lineAmountIncludeTax} / ${quantity}`),
88
+ calculatingDigits);
89
89
  form.setFieldsValue({ priceIncludeTax });
90
90
  await controller.setEditGood({ priceIncludeTax });
91
91
  }
@@ -96,14 +96,14 @@ export const onChangeQuantity = lazyFn(
96
96
  // 不含税
97
97
  if (!err.priceExcludeTax && values.priceExcludeTax) {
98
98
  // 可以找到 单价(不含税)
99
- const priceExcludeTax = values.priceExcludeTax;
99
+ const priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
100
100
  const lineAmountExcludeTax = format2(evaluate(`${quantity} * ${priceExcludeTax}`));
101
101
  form.setFieldsValue({ lineAmountExcludeTax });
102
102
  await controller.setEditGood({ lineAmountExcludeTax, quantity });
103
103
  } else if (!err.lineAmountExcludeTax && values.lineAmountExcludeTax) {
104
104
  // 可以找到 金额(不含税)
105
105
  const lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
106
- const priceExcludeTax = evaluate(`${lineAmountExcludeTax} / ${quantity}`);
106
+ const priceExcludeTax = format15(evaluate(`${lineAmountExcludeTax} / ${quantity}`), calculatingDigits);
107
107
  form.setFieldsValue({ priceExcludeTax });
108
108
  await controller.setEditGood({ priceExcludeTax, quantity });
109
109
  }
@@ -136,19 +136,19 @@ export const onChangePriceIncludeTax = lazyFn(
136
136
  }
137
137
 
138
138
  const calculatingDigits = controller.state.calculatingDigits;
139
- const priceIncludeTax = values.priceIncludeTax;
139
+ const priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
140
140
  await controller.setEditGood({ priceIncludeTax });
141
141
  form.setFieldsValue({ priceIncludeTax });
142
142
 
143
143
  // 是否有数量
144
144
  if (!err.quantity && values.quantity) {
145
- const quantity = values.quantity;
145
+ const quantity = format15(values.quantity, calculatingDigits);
146
146
  const lineAmountIncludeTax = format2(evaluate(`${quantity} * ${priceIncludeTax}`));
147
147
  form.setFieldsValue({ lineAmountIncludeTax });
148
148
  await controller.setEditGood({ lineAmountIncludeTax });
149
149
  } else if (!err.lineAmountIncludeTax && values.lineAmountIncludeTax) {
150
150
  const lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
151
- const quantity = evaluate(`${lineAmountIncludeTax} / ${priceIncludeTax}`);
151
+ const quantity = format15(evaluate(`${lineAmountIncludeTax} / ${priceIncludeTax}`), calculatingDigits);
152
152
  form.setFieldsValue({ quantity });
153
153
  await controller.setEditGood({ quantity });
154
154
  }
@@ -180,22 +180,22 @@ export const onChangePriceExcludeTax = lazyFn(
180
180
  }
181
181
 
182
182
  const calculatingDigits = controller.state.calculatingDigits;
183
- const priceExcludeTax = values.priceExcludeTax;
183
+ const priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
184
184
  await controller.setEditGood({ priceExcludeTax });
185
185
  form.setFieldsValue({ priceExcludeTax });
186
186
 
187
187
  // 是否有数量
188
188
  if (!err.quantity && values.quantity) {
189
- const quantity = values.quantity;
189
+ const quantity = format15(values.quantity, calculatingDigits);
190
190
  const lineAmountExcludeTax = format2(evaluate(`${quantity} * ${priceExcludeTax}`));
191
191
  form.setFieldsValue({ lineAmountExcludeTax });
192
192
  await controller.setEditGood({ lineAmountExcludeTax });
193
193
  } else if (!err.lineAmountExcludeTax && values.lineAmountExcludeTax) {
194
194
  const lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
195
- const quantity =
196
- evaluate(`${lineAmountExcludeTax} / ${priceExcludeTax}`)
197
-
198
- ;
195
+ const quantity = format15(
196
+ evaluate(`${lineAmountExcludeTax} / ${priceExcludeTax}`),
197
+ calculatingDigits
198
+ );
199
199
  form.setFieldsValue({ quantity });
200
200
  await controller.setEditGood({ quantity });
201
201
  }
@@ -400,7 +400,6 @@ export default (form: WrappedFormUtils) => {
400
400
  })(
401
401
  <MyInput
402
402
  style={{ textAlign: 'right' }}
403
- max={99999999999999999999}
404
403
  loading={isCipher(changeField, 'lineAmountIncludeTax')}
405
404
  onChange={() => {
406
405
  setChangeField('lineAmountIncludeTax');
@@ -69,9 +69,11 @@ export interface IStakeholder {
69
69
  /** 是否展开 */
70
70
  isExpand?: boolean;
71
71
 
72
+ /** 购方,销方银行信息 勾选按钮是否显示 **/
72
73
  leqi?: boolean;
73
74
 
74
- riskData?: any;
75
+ /** 购方,销方地址电话 勾选按钮是否显示 **/
76
+ riskData?: boolean;
75
77
 
76
78
  invoiceMarkCallback?: (value: any) => void;
77
79
  }
@@ -102,7 +104,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
102
104
  }, [props.leqi, props.riskData]);
103
105
  /** 直连 */
104
106
  const riskspanW = React.useMemo(() => {
105
- if (props.riskData?.code === 'success') {
107
+ if (props.riskData) {
106
108
  return 0;
107
109
  } else {
108
110
  return 2;
@@ -228,7 +230,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
228
230
  })(<MyInput readOnly={isReadOnly('buyerAccount')} placeholder="请输入银行账号" autoComplete="off" />)}
229
231
  </Form.Item>
230
232
  </Col>
231
- {(props.leqi || props.riskData?.code === 'success') &&
233
+ {(props.leqi) &&
232
234
  <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
233
235
  <Form.Item colon={false}>
234
236
  {getFieldDecorator('buyerBankAccountFlag', {
@@ -309,7 +311,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
309
311
  })(<MyInput readOnly={isReadOnly('sellerAccount')} placeholder="请输入银行账号" autoComplete="off" />)}
310
312
  </Form.Item>
311
313
  </Col>
312
- {(props.leqi || props.riskData?.code === 'success') &&
314
+ {(props.leqi ) &&
313
315
  <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
314
316
  <Form.Item colon={false}>
315
317
  {getFieldDecorator('sellerBankAccountFlag', {