kts-component-invoice-operate 3.2.181-6 → 3.2.181-7

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
@@ -8491,12 +8491,70 @@ var clearCalculatingField = /*#__PURE__*/function () {
8491
8491
  };
8492
8492
  }();
8493
8493
  /** 数量改变了 */
8494
+ // export const onChangeQuantity = lazyFn(
8495
+ // (controller: InvoiceController, form: WrappedFormUtils, record: IGood) => {
8496
+ // form.validateFields(async (err, values) => {
8497
+ // err = err || {};
8498
+ // if (!values.quantity && values.quantity !== 0) {
8499
+ // await controller.setEditGood({ quantity: undefined });
8500
+ // await clearCalculatingField(controller);
8501
+ // return;
8502
+ // }
8503
+ // if (err.quantity) {
8504
+ // await clearCalculatingField(controller);
8505
+ // return
8506
+ // };
8507
+ // const calculatingDigits = controller.state.calculatingDigits;
8508
+ // const quantity = format15(values.quantity, calculatingDigits);
8509
+ // await controller.setEditGood({ quantity });
8510
+ // form.setFieldsValue({ quantity });
8511
+ // // 是否含税
8512
+ // if (controller.state.goodsListState.isTaxIncluded) {
8513
+ // // 含税
8514
+ // if (!err.priceIncludeTax && values.priceIncludeTax) {
8515
+ // // 可以找到 单价(含税)
8516
+ // const priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
8517
+ // const lineAmountIncludeTax = format2(evaluate(`${priceIncludeTax} * ${quantity}`));
8518
+ // form.setFieldsValue({ lineAmountIncludeTax });
8519
+ // await controller.setEditGood({ lineAmountIncludeTax });
8520
+ // } else if (!err.lineAmountIncludeTax && values.lineAmountIncludeTax) {
8521
+ // // 可以找到 金额(含税)
8522
+ // const lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
8523
+ // const priceIncludeTax = format15(
8524
+ // evaluate(`${lineAmountIncludeTax} / ${quantity}`),
8525
+ // calculatingDigits);
8526
+ // form.setFieldsValue({ priceIncludeTax });
8527
+ // await controller.setEditGood({ priceIncludeTax });
8528
+ // }
8529
+ // // 更新不含税
8530
+ // await updateUnitPriceExcludingTax(controller, form, record);
8531
+ // } else {
8532
+ // // 不含税
8533
+ // if (!err.priceExcludeTax && values.priceExcludeTax) {
8534
+ // const priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
8535
+ // const lineAmountExcludeTax = format2(evaluate(`${quantity} * ${priceExcludeTax}`));
8536
+ // form.setFieldsValue({ lineAmountExcludeTax });
8537
+ // await controller.setEditGood({ lineAmountExcludeTax, quantity });
8538
+ // } else if (!err.lineAmountExcludeTax && values.lineAmountExcludeTax) {
8539
+ // const lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8540
+ // const priceExcludeTax = format15(evaluate(`${lineAmountExcludeTax} / ${quantity}`), calculatingDigits);
8541
+ // form.setFieldsValue({ priceExcludeTax });
8542
+ // await controller.setEditGood({ priceExcludeTax, quantity });
8543
+ // }
8544
+ // // 更新含税
8545
+ // await updateUnitPriceTax(controller, form, record);
8546
+ // }
8547
+ // // 清楚 计算中启动字段
8548
+ // await clearCalculatingField(controller);
8549
+ // });
8550
+ // },
8551
+ // 1000,
8552
+ // );
8494
8553
 
8495
8554
  var onChangeQuantity = lazyFn(function (controller, form, record) {
8496
8555
  form.validateFields( /*#__PURE__*/function () {
8497
8556
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
8498
- var calculatingDigits, quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
8499
-
8557
+ var calculatingDigits, quantity, lineAmountIncludeTax, priceIncludeTax, lineAmountExcludeTax, priceExcludeTax;
8500
8558
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8501
8559
  while (1) {
8502
8560
  switch (_context3.prev = _context3.next) {
@@ -8535,113 +8593,69 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8535
8593
  case 11:
8536
8594
  calculatingDigits = controller.state.calculatingDigits;
8537
8595
  quantity = format15(values.quantity, calculatingDigits);
8538
- _context3.next = 16;
8596
+ _context3.next = 15;
8539
8597
  return controller.setEditGood({
8540
8598
  quantity: quantity
8541
8599
  });
8542
8600
 
8543
- case 16:
8601
+ case 15:
8544
8602
  form.setFieldsValue({
8545
8603
  quantity: quantity
8546
8604
  }); // 是否含税
8547
8605
 
8548
8606
  if (!controller.state.goodsListState.isTaxIncluded) {
8549
- _context3.next = 36;
8607
+ _context3.next = 27;
8550
8608
  break;
8551
8609
  }
8552
8610
 
8553
- if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
8554
- _context3.next = 26;
8555
- break;
8556
- }
8557
-
8558
- // 可以找到 单价(含税)
8559
- priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
8560
- lineAmountIncludeTax = format2(evaluate("".concat(priceIncludeTax, " * ").concat(quantity)));
8561
- form.setFieldsValue({
8562
- lineAmountIncludeTax: lineAmountIncludeTax
8563
- });
8564
- _context3.next = 24;
8565
- return controller.setEditGood({
8566
- lineAmountIncludeTax: lineAmountIncludeTax
8567
- });
8568
-
8569
- case 24:
8570
- _context3.next = 32;
8571
- break;
8572
-
8573
- case 26:
8574
8611
  if (!(!err.lineAmountIncludeTax && values.lineAmountIncludeTax)) {
8575
- _context3.next = 32;
8612
+ _context3.next = 23;
8576
8613
  break;
8577
8614
  }
8578
8615
 
8579
- // 可以找到 金额(含税)
8580
- _lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
8581
- _priceIncludeTax = format15(evaluate("".concat(_lineAmountIncludeTax, " / ").concat(quantity)), calculatingDigits);
8616
+ lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
8617
+ priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(quantity)), calculatingDigits);
8582
8618
  form.setFieldsValue({
8583
- priceIncludeTax: _priceIncludeTax
8619
+ priceIncludeTax: priceIncludeTax
8584
8620
  });
8585
- _context3.next = 32;
8621
+ _context3.next = 23;
8586
8622
  return controller.setEditGood({
8587
- priceIncludeTax: _priceIncludeTax
8623
+ priceIncludeTax: priceIncludeTax
8588
8624
  });
8589
8625
 
8590
- case 32:
8591
- _context3.next = 34;
8626
+ case 23:
8627
+ _context3.next = 25;
8592
8628
  return updateUnitPriceExcludingTax(controller, form, record);
8593
8629
 
8594
- case 34:
8595
- _context3.next = 52;
8596
- break;
8597
-
8598
- case 36:
8599
- if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
8600
- _context3.next = 44;
8601
- break;
8602
- }
8603
-
8604
- priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
8605
- lineAmountExcludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceExcludeTax)));
8606
- form.setFieldsValue({
8607
- lineAmountExcludeTax: lineAmountExcludeTax
8608
- });
8609
- _context3.next = 42;
8610
- return controller.setEditGood({
8611
- lineAmountExcludeTax: lineAmountExcludeTax,
8612
- quantity: quantity
8613
- });
8614
-
8615
- case 42:
8616
- _context3.next = 50;
8630
+ case 25:
8631
+ _context3.next = 35;
8617
8632
  break;
8618
8633
 
8619
- case 44:
8634
+ case 27:
8620
8635
  if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
8621
- _context3.next = 50;
8636
+ _context3.next = 33;
8622
8637
  break;
8623
8638
  }
8624
8639
 
8625
- _lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8626
- _priceExcludeTax = format15(evaluate("".concat(_lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
8640
+ lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8641
+ priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
8627
8642
  form.setFieldsValue({
8628
- priceExcludeTax: _priceExcludeTax
8643
+ priceExcludeTax: priceExcludeTax
8629
8644
  });
8630
- _context3.next = 50;
8645
+ _context3.next = 33;
8631
8646
  return controller.setEditGood({
8632
- priceExcludeTax: _priceExcludeTax,
8633
- quantity: quantity
8647
+ priceExcludeTax: priceExcludeTax
8634
8648
  });
8635
8649
 
8636
- case 50:
8637
- _context3.next = 52;
8650
+ case 33:
8651
+ _context3.next = 35;
8638
8652
  return updateUnitPriceTax(controller, form, record);
8639
8653
 
8640
- case 52:
8641
- _context3.next = 54;
8654
+ case 35:
8655
+ _context3.next = 37;
8642
8656
  return clearCalculatingField(controller);
8643
8657
 
8644
- case 54:
8658
+ case 37:
8645
8659
  case "end":
8646
8660
  return _context3.stop();
8647
8661
  }
@@ -8659,7 +8673,7 @@ var onChangeQuantity = lazyFn(function (controller, form, record) {
8659
8673
  var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8660
8674
  form.validateFields( /*#__PURE__*/function () {
8661
8675
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
8662
- var calculatingDigits, priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
8676
+ var calculatingDigits, priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax, _quantity;
8663
8677
 
8664
8678
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8665
8679
  while (1) {
@@ -8735,8 +8749,8 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8735
8749
  break;
8736
8750
  }
8737
8751
 
8738
- _lineAmountIncludeTax2 = format2(values.lineAmountIncludeTax);
8739
- _quantity = format15(evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(priceIncludeTax)), calculatingDigits);
8752
+ _lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
8753
+ _quantity = format15(evaluate("".concat(_lineAmountIncludeTax, " / ").concat(priceIncludeTax)), calculatingDigits);
8740
8754
  form.setFieldsValue({
8741
8755
  quantity: _quantity
8742
8756
  });
@@ -8771,7 +8785,7 @@ var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
8771
8785
  var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8772
8786
  form.validateFields( /*#__PURE__*/function () {
8773
8787
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
8774
- var calculatingDigits, priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
8788
+ var calculatingDigits, priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax, _quantity2;
8775
8789
 
8776
8790
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8777
8791
  while (1) {
@@ -8847,8 +8861,8 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8847
8861
  break;
8848
8862
  }
8849
8863
 
8850
- _lineAmountExcludeTax2 = format2(values.lineAmountExcludeTax);
8851
- _quantity2 = format15(evaluate("".concat(_lineAmountExcludeTax2, " / ").concat(priceExcludeTax)), calculatingDigits);
8864
+ _lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
8865
+ _quantity2 = format15(evaluate("".concat(_lineAmountExcludeTax, " / ").concat(priceExcludeTax)), calculatingDigits);
8852
8866
  form.setFieldsValue({
8853
8867
  quantity: _quantity2
8854
8868
  });
@@ -8883,7 +8897,7 @@ var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
8883
8897
  var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8884
8898
  form.validateFields( /*#__PURE__*/function () {
8885
8899
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
8886
- var calculatingDigits, lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
8900
+ var calculatingDigits, lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax, _quantity3;
8887
8901
 
8888
8902
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
8889
8903
  while (1) {
@@ -8951,8 +8965,8 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8951
8965
  break;
8952
8966
  }
8953
8967
 
8954
- _priceIncludeTax2 = format15(values.priceIncludeTax, calculatingDigits);
8955
- _quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(_priceIncludeTax2)), calculatingDigits);
8968
+ _priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
8969
+ _quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(_priceIncludeTax)), calculatingDigits);
8956
8970
  form.setFieldsValue({
8957
8971
  quantity: _quantity3
8958
8972
  });
@@ -8987,7 +9001,7 @@ var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
8987
9001
  var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
8988
9002
  form.validateFields( /*#__PURE__*/function () {
8989
9003
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, values) {
8990
- var calculatingDigits, lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
9004
+ var calculatingDigits, lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax, _quantity4;
8991
9005
 
8992
9006
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
8993
9007
  while (1) {
@@ -9055,8 +9069,8 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
9055
9069
  break;
9056
9070
  }
9057
9071
 
9058
- _priceExcludeTax2 = format15(values.priceExcludeTax, calculatingDigits);
9059
- _quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(_priceExcludeTax2)), calculatingDigits);
9072
+ _priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
9073
+ _quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(_priceExcludeTax)), calculatingDigits);
9060
9074
  form.setFieldsValue({
9061
9075
  quantity: _quantity4
9062
9076
  });
@@ -9802,21 +9816,21 @@ var onChangeSwitchTax = /*#__PURE__*/function () {
9802
9816
 
9803
9817
  var _quantity5 = format15(sourceQuantity, calculatingDigits);
9804
9818
 
9805
- var _priceExcludeTax3 = format15(sourcePriceExcludeTax, calculatingDigits);
9819
+ var _priceExcludeTax2 = format15(sourcePriceExcludeTax, calculatingDigits);
9806
9820
 
9807
- var _lineAmountExcludeTax3 = format2(evaluate("".concat(_priceExcludeTax3, " * ").concat(_quantity5)));
9821
+ var _lineAmountExcludeTax2 = format2(evaluate("".concat(_priceExcludeTax2, " * ").concat(_quantity5)));
9808
9822
 
9809
- var _lineAmountIncludeTax3 = format2(evaluate("".concat(_lineAmountExcludeTax3, " * (1+(").concat(taxRate, "/100))")));
9823
+ var _lineAmountIncludeTax2 = format2(evaluate("".concat(_lineAmountExcludeTax2, " * (1+(").concat(taxRate, "/100))")));
9810
9824
 
9811
- var _priceIncludeTax3 = format15(evaluate("".concat(_lineAmountIncludeTax3, " / ").concat(_quantity5)), calculatingDigits);
9825
+ var _priceIncludeTax2 = format15(evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(_quantity5)), calculatingDigits);
9812
9826
 
9813
- var _taxAmount = evaluate("".concat(_lineAmountIncludeTax3, " - ").concat(_lineAmountExcludeTax3));
9827
+ var _taxAmount = evaluate("".concat(_lineAmountIncludeTax2, " - ").concat(_lineAmountExcludeTax2));
9814
9828
 
9815
9829
  return _objectSpread2(_objectSpread2({}, good), {}, {
9816
- lineAmountExcludeTax: _lineAmountExcludeTax3,
9817
- lineAmountIncludeTax: _lineAmountIncludeTax3,
9830
+ lineAmountExcludeTax: _lineAmountExcludeTax2,
9831
+ lineAmountIncludeTax: _lineAmountIncludeTax2,
9818
9832
  taxAmount: _taxAmount,
9819
- priceIncludeTax: _priceIncludeTax3
9833
+ priceIncludeTax: _priceIncludeTax2
9820
9834
  });
9821
9835
  }
9822
9836
  });
@@ -14001,13 +14015,14 @@ var useColumns = (function (form) {
14001
14015
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('priceIncludeTax', {
14002
14016
  initialValue: nonScientificNotation(editGood.priceIncludeTax),
14003
14017
  getValueFromEvent: onNumberValueChange,
14004
- rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [{
14018
+ rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
14019
+ {
14005
14020
  pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
14006
- message: '单价必须为数字'
14021
+ message: '金额必须为数字'
14007
14022
  }, {
14008
14023
  validator: function () {
14009
14024
  var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
14010
- var isQuantity, isvalue;
14025
+ var quantity, isQuantityValid, isValueValid;
14011
14026
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
14012
14027
  while (1) {
14013
14028
  switch (_context9.prev = _context9.next) {
@@ -14016,20 +14031,38 @@ var useColumns = (function (form) {
14016
14031
  return controller.wait();
14017
14032
 
14018
14033
  case 2:
14019
- isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
14020
- isvalue = !!value || value === 0;
14021
-
14022
- if (!(isvalue || isQuantity === isvalue)) {
14023
- _context9.next = 6;
14034
+ // const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
14035
+ // const isvalue = !!value || value === 0;
14036
+ // if (isvalue || isQuantity === isvalue) return;
14037
+ // callback('请输入单价');
14038
+ quantity = getFieldValue('quantity');
14039
+ isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
14040
+ isValueValid = value !== undefined && value !== null && value !== '';
14041
+
14042
+ if (!(isValueValid && isQuantityValid)) {
14043
+ _context9.next = 7;
14024
14044
  break;
14025
14045
  }
14026
14046
 
14027
14047
  return _context9.abrupt("return");
14028
14048
 
14029
- case 6:
14030
- callback('请输入单价');
14031
-
14032
14049
  case 7:
14050
+ if (isValueValid) {
14051
+ _context9.next = 9;
14052
+ break;
14053
+ }
14054
+
14055
+ return _context9.abrupt("return", callback('金额不能为空'));
14056
+
14057
+ case 9:
14058
+ if (isQuantityValid) {
14059
+ _context9.next = 11;
14060
+ break;
14061
+ }
14062
+
14063
+ return _context9.abrupt("return", callback('数量不能为空'));
14064
+
14065
+ case 11:
14033
14066
  case "end":
14034
14067
  return _context9.stop();
14035
14068
  }
@@ -14082,29 +14115,44 @@ var useColumns = (function (form) {
14082
14115
  }, {
14083
14116
  validator: function () {
14084
14117
  var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
14085
- var isQuantity, isvalue;
14118
+ var quantity, isQuantityValid, isValueValid;
14086
14119
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
14087
14120
  while (1) {
14088
14121
  switch (_context10.prev = _context10.next) {
14089
14122
  case 0:
14090
- _context10.next = 2;
14091
- return controller.wait();
14092
-
14093
- case 2:
14094
- isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
14095
- isvalue = !!value || value === 0;
14096
-
14097
- if (!(isvalue || isQuantity === isvalue)) {
14098
- _context10.next = 6;
14123
+ // await controller.wait();
14124
+ // const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
14125
+ // const isvalue = !!value || value === 0;
14126
+ // if (isvalue || isQuantity === isvalue) return;
14127
+ // callback('请输入单价');
14128
+ quantity = getFieldValue('quantity');
14129
+ isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
14130
+ isValueValid = value !== undefined && value !== null && value !== '';
14131
+
14132
+ if (!(isValueValid && isQuantityValid)) {
14133
+ _context10.next = 5;
14099
14134
  break;
14100
14135
  }
14101
14136
 
14102
14137
  return _context10.abrupt("return");
14103
14138
 
14104
- case 6:
14105
- callback('请输入单价');
14139
+ case 5:
14140
+ if (isValueValid) {
14141
+ _context10.next = 7;
14142
+ break;
14143
+ }
14144
+
14145
+ return _context10.abrupt("return", callback('金额不能为空'));
14106
14146
 
14107
14147
  case 7:
14148
+ if (isQuantityValid) {
14149
+ _context10.next = 9;
14150
+ break;
14151
+ }
14152
+
14153
+ return _context10.abrupt("return", callback('数量不能为空'));
14154
+
14155
+ case 9:
14108
14156
  case "end":
14109
14157
  return _context10.stop();
14110
14158
  }
@@ -26890,6 +26938,8 @@ var DrawerBody$1 = function DrawerBody() {
26890
26938
  onClick: function onClick() {
26891
26939
  controller.run( /*#__PURE__*/function () {
26892
26940
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
26941
+ var _s$goodsListState$edi, _s$goodsListState$edi2, _s$goodsListState$edi3, _s$goodsListState$edi4, _s$goodsListState$edi5, _s$goodsListState$edi6, _s$goodsListState$edi7, _s$goodsListState$edi8, _s$goodsListState$edi9, _s$goodsListState$edi10, _s$goodsListState$edi11, _s$goodsListState$edi12, _s$goodsListState$edi13, _s$goodsListState$edi14;
26942
+
26893
26943
  var between, editGood;
26894
26944
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
26895
26945
  while (1) {
@@ -26926,17 +26976,31 @@ var DrawerBody$1 = function DrawerBody() {
26926
26976
  // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
26927
26977
  record.quantity = undefined;
26928
26978
  record.lineAmountExcludeTax = undefined;
26929
- record.lineAmountIncludeTax = undefined; // 中间数据
26979
+ record.lineAmountIncludeTax = undefined;
26980
+ console.log('s.goodsListState.editGood:', s.goodsListState.editGood); // 光电定制化功能:无论是否有值都替换 itemCode, itemName, shorthand, taxCategoryCode, taxClassificationCode;
26981
+ // 如果其他输入框有值就不替换,没值就替换:itemModelName, lineAmountExcludeTax, lineAmountIncludeTax,lineAttribute,priceExcludeTax,
26982
+ // priceIncludeTax,quantity, serialNo, taxAmount, taxRate, unit
26983
+ // 中间数据
26930
26984
 
26931
26985
  between = _objectSpread2({}, record);
26986
+ console.log(':between:', between);
26932
26987
  between.itemName = getItemName(record, s.goodsListState.editGood);
26933
26988
  between.itemCode = getItemCode(record, s.goodsListState.editGood);
26934
26989
  between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
26935
26990
 
26936
- editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), {}, {
26937
- itemModelName: undefined,
26938
- itemModelNameSelf: undefined
26939
- }, between);
26991
+ editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between), {}, {
26992
+ itemModelName: (_s$goodsListState$edi = (_s$goodsListState$edi2 = s.goodsListState.editGood) === null || _s$goodsListState$edi2 === void 0 ? void 0 : _s$goodsListState$edi2.itemModelName) !== null && _s$goodsListState$edi !== void 0 ? _s$goodsListState$edi : between.itemModelName,
26993
+ lineAmountExcludeTax: (_s$goodsListState$edi3 = (_s$goodsListState$edi4 = s.goodsListState.editGood) === null || _s$goodsListState$edi4 === void 0 ? void 0 : _s$goodsListState$edi4.lineAmountExcludeTax) !== null && _s$goodsListState$edi3 !== void 0 ? _s$goodsListState$edi3 : between.lineAmountExcludeTax,
26994
+ lineAmountIncludeTax: (_s$goodsListState$edi5 = (_s$goodsListState$edi6 = s.goodsListState.editGood) === null || _s$goodsListState$edi6 === void 0 ? void 0 : _s$goodsListState$edi6.lineAmountIncludeTax) !== null && _s$goodsListState$edi5 !== void 0 ? _s$goodsListState$edi5 : between.lineAmountIncludeTax,
26995
+ // lineAttribute:s.goodsListState.editGood?.lineAttribute,
26996
+ priceExcludeTax: (_s$goodsListState$edi7 = (_s$goodsListState$edi8 = s.goodsListState.editGood) === null || _s$goodsListState$edi8 === void 0 ? void 0 : _s$goodsListState$edi8.priceExcludeTax) !== null && _s$goodsListState$edi7 !== void 0 ? _s$goodsListState$edi7 : between.priceExcludeTax,
26997
+ priceIncludeTax: (_s$goodsListState$edi9 = (_s$goodsListState$edi10 = s.goodsListState.editGood) === null || _s$goodsListState$edi10 === void 0 ? void 0 : _s$goodsListState$edi10.priceIncludeTax) !== null && _s$goodsListState$edi9 !== void 0 ? _s$goodsListState$edi9 : between.priceIncludeTax,
26998
+ quantity: (_s$goodsListState$edi11 = (_s$goodsListState$edi12 = s.goodsListState.editGood) === null || _s$goodsListState$edi12 === void 0 ? void 0 : _s$goodsListState$edi12.quantity) !== null && _s$goodsListState$edi11 !== void 0 ? _s$goodsListState$edi11 : between.quantity,
26999
+ // serialNo:s.goodsListState.editGood?.itemModelName ?? between.itemModelName,
27000
+ // taxAmount:s.goodsListState.editGood?.itemModelName ?? between.itemModelName,
27001
+ // taxRate:s.goodsListState.editGood?.itemModelName ?? between.itemModelName,
27002
+ unit: (_s$goodsListState$edi13 = (_s$goodsListState$edi14 = s.goodsListState.editGood) === null || _s$goodsListState$edi14 === void 0 ? void 0 : _s$goodsListState$edi14.unit) !== null && _s$goodsListState$edi13 !== void 0 ? _s$goodsListState$edi13 : between.unit
27003
+ });
26940
27004
 
26941
27005
  if (editGood.taxRate) {
26942
27006
  editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
@@ -26964,27 +27028,27 @@ var DrawerBody$1 = function DrawerBody() {
26964
27028
  // s.goodsListState.form.setFieldsValue({
26965
27029
  // ...editGood,
26966
27030
  // });
26967
- // }
27031
+ // }
26968
27032
 
26969
27033
  s.goodsListState.importGoods.isVisibleDrawer = false;
26970
27034
 
26971
27035
  if (!s.goodsListState.isTaxIncluded) {
26972
- _context2.next = 26;
27036
+ _context2.next = 28;
26973
27037
  break;
26974
27038
  }
26975
27039
 
26976
- _context2.next = 24;
27040
+ _context2.next = 26;
26977
27041
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
26978
27042
 
26979
- case 24:
26980
- _context2.next = 28;
27043
+ case 26:
27044
+ _context2.next = 30;
26981
27045
  break;
26982
27046
 
26983
- case 26:
26984
- _context2.next = 28;
27047
+ case 28:
27048
+ _context2.next = 30;
26985
27049
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
26986
27050
 
26987
- case 28:
27051
+ case 30:
26988
27052
  case "end":
26989
27053
  return _context2.stop();
26990
27054
  }