kts-component-invoice-operate 3.2.181-6 → 3.2.181-8
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 +376 -252
- package/dist/index.js +376 -252
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/fns/importGoodsDrawer.ts +15 -12
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.ts +81 -25
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +26 -9
- package/src/Invoice/ui/default/ImportGoodsDrawer/index.tsx +22 -6
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +84 -27
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +24 -8
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,
|
|
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 =
|
|
8596
|
+
_context3.next = 15;
|
|
8539
8597
|
return controller.setEditGood({
|
|
8540
8598
|
quantity: quantity
|
|
8541
8599
|
});
|
|
8542
8600
|
|
|
8543
|
-
case
|
|
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 =
|
|
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 =
|
|
8612
|
+
_context3.next = 23;
|
|
8576
8613
|
break;
|
|
8577
8614
|
}
|
|
8578
8615
|
|
|
8579
|
-
|
|
8580
|
-
|
|
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:
|
|
8619
|
+
priceIncludeTax: priceIncludeTax
|
|
8584
8620
|
});
|
|
8585
|
-
_context3.next =
|
|
8621
|
+
_context3.next = 23;
|
|
8586
8622
|
return controller.setEditGood({
|
|
8587
|
-
priceIncludeTax:
|
|
8623
|
+
priceIncludeTax: priceIncludeTax
|
|
8588
8624
|
});
|
|
8589
8625
|
|
|
8590
|
-
case
|
|
8591
|
-
_context3.next =
|
|
8626
|
+
case 23:
|
|
8627
|
+
_context3.next = 25;
|
|
8592
8628
|
return updateUnitPriceExcludingTax(controller, form, record);
|
|
8593
8629
|
|
|
8594
|
-
case
|
|
8595
|
-
_context3.next =
|
|
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
|
|
8634
|
+
case 27:
|
|
8620
8635
|
if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
|
|
8621
|
-
_context3.next =
|
|
8636
|
+
_context3.next = 33;
|
|
8622
8637
|
break;
|
|
8623
8638
|
}
|
|
8624
8639
|
|
|
8625
|
-
|
|
8626
|
-
|
|
8640
|
+
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
8641
|
+
priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
|
|
8627
8642
|
form.setFieldsValue({
|
|
8628
|
-
priceExcludeTax:
|
|
8643
|
+
priceExcludeTax: priceExcludeTax
|
|
8629
8644
|
});
|
|
8630
|
-
_context3.next =
|
|
8645
|
+
_context3.next = 33;
|
|
8631
8646
|
return controller.setEditGood({
|
|
8632
|
-
priceExcludeTax:
|
|
8633
|
-
quantity: quantity
|
|
8647
|
+
priceExcludeTax: priceExcludeTax
|
|
8634
8648
|
});
|
|
8635
8649
|
|
|
8636
|
-
case
|
|
8637
|
-
_context3.next =
|
|
8650
|
+
case 33:
|
|
8651
|
+
_context3.next = 35;
|
|
8638
8652
|
return updateUnitPriceTax(controller, form, record);
|
|
8639
8653
|
|
|
8640
|
-
case
|
|
8641
|
-
_context3.next =
|
|
8654
|
+
case 35:
|
|
8655
|
+
_context3.next = 37;
|
|
8642
8656
|
return clearCalculatingField(controller);
|
|
8643
8657
|
|
|
8644
|
-
case
|
|
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,
|
|
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
|
-
|
|
8739
|
-
_quantity = format15(evaluate("".concat(
|
|
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,
|
|
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
|
-
|
|
8851
|
-
_quantity2 = format15(evaluate("".concat(
|
|
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,
|
|
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
|
-
|
|
8955
|
-
_quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(
|
|
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,
|
|
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
|
-
|
|
9059
|
-
_quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(
|
|
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
|
|
9819
|
+
var _priceExcludeTax2 = format15(sourcePriceExcludeTax, calculatingDigits);
|
|
9806
9820
|
|
|
9807
|
-
var
|
|
9821
|
+
var _lineAmountExcludeTax2 = format2(evaluate("".concat(_priceExcludeTax2, " * ").concat(_quantity5)));
|
|
9808
9822
|
|
|
9809
|
-
var
|
|
9823
|
+
var _lineAmountIncludeTax2 = format2(evaluate("".concat(_lineAmountExcludeTax2, " * (1+(").concat(taxRate, "/100))")));
|
|
9810
9824
|
|
|
9811
|
-
var
|
|
9825
|
+
var _priceIncludeTax2 = format15(evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(_quantity5)), calculatingDigits);
|
|
9812
9826
|
|
|
9813
|
-
var _taxAmount = evaluate("".concat(
|
|
9827
|
+
var _taxAmount = evaluate("".concat(_lineAmountIncludeTax2, " - ").concat(_lineAmountExcludeTax2));
|
|
9814
9828
|
|
|
9815
9829
|
return _objectSpread2(_objectSpread2({}, good), {}, {
|
|
9816
|
-
lineAmountExcludeTax:
|
|
9817
|
-
lineAmountIncludeTax:
|
|
9830
|
+
lineAmountExcludeTax: _lineAmountExcludeTax2,
|
|
9831
|
+
lineAmountIncludeTax: _lineAmountIncludeTax2,
|
|
9818
9832
|
taxAmount: _taxAmount,
|
|
9819
|
-
priceIncludeTax:
|
|
9833
|
+
priceIncludeTax: _priceIncludeTax2
|
|
9820
9834
|
});
|
|
9821
9835
|
}
|
|
9822
9836
|
});
|
|
@@ -9861,6 +9875,8 @@ var onChangeSwitchTax = /*#__PURE__*/function () {
|
|
|
9861
9875
|
|
|
9862
9876
|
var importGoodsDrawer = /*#__PURE__*/(function () {
|
|
9863
9877
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, record, controller) {
|
|
9878
|
+
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, _s$goodsListState$edi15, _s$goodsListState$edi16;
|
|
9879
|
+
|
|
9864
9880
|
var between, editGood;
|
|
9865
9881
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9866
9882
|
while (1) {
|
|
@@ -9880,24 +9896,28 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
|
|
|
9880
9896
|
return _context.abrupt("return");
|
|
9881
9897
|
|
|
9882
9898
|
case 3:
|
|
9883
|
-
// 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
|
|
9899
|
+
console.log('aaaaaaaa122222:'); // 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
|
|
9900
|
+
|
|
9884
9901
|
record.quantity = undefined;
|
|
9885
9902
|
record.lineAmountExcludeTax = undefined;
|
|
9886
9903
|
record.lineAmountIncludeTax = undefined; // 中间数据
|
|
9887
9904
|
|
|
9888
|
-
between = _objectSpread2({}, record);
|
|
9905
|
+
between = _objectSpread2({}, record); // 光电定制化功能:无论是否有值都替换 itemCode, itemName, shorthand, taxCategoryCode, taxClassificationCode;
|
|
9906
|
+
// 如果其他输入框有值就不替换,没值就替换:itemModelName, lineAmountExcludeTax, lineAmountIncludeTax,lineAttribute,priceExcludeTax,
|
|
9907
|
+
// priceIncludeTax,quantity, serialNo, taxAmount, taxRate, unit
|
|
9908
|
+
|
|
9889
9909
|
between.itemCode = record.itemCode;
|
|
9890
9910
|
between.shorthand = record.shorthand;
|
|
9891
9911
|
between.itemName = record.itemName;
|
|
9892
9912
|
between.itemNameOther = record.itemName;
|
|
9893
|
-
between.itemModelName = record.itemModelName;
|
|
9894
|
-
between.unit = record.unit;
|
|
9895
|
-
between.quantity = record.quantity;
|
|
9896
|
-
between.priceIncludeTax = record.priceIncludeTax;
|
|
9897
|
-
between.lineAmountIncludeTax = record.lineAmountIncludeTax;
|
|
9898
|
-
between.lineAmountExcludeTax = record.lineAmountExcludeTax;
|
|
9899
|
-
between.taxRate = record.taxRate;
|
|
9900
|
-
between.taxAmount = record.taxAmount; // 设置编辑货物
|
|
9913
|
+
between.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 : record.itemModelName;
|
|
9914
|
+
between.unit = (_s$goodsListState$edi3 = (_s$goodsListState$edi4 = s.goodsListState.editGood) === null || _s$goodsListState$edi4 === void 0 ? void 0 : _s$goodsListState$edi4.itemModelName) !== null && _s$goodsListState$edi3 !== void 0 ? _s$goodsListState$edi3 : record.unit;
|
|
9915
|
+
between.quantity = (_s$goodsListState$edi5 = (_s$goodsListState$edi6 = s.goodsListState.editGood) === null || _s$goodsListState$edi6 === void 0 ? void 0 : _s$goodsListState$edi6.itemModelName) !== null && _s$goodsListState$edi5 !== void 0 ? _s$goodsListState$edi5 : record.quantity;
|
|
9916
|
+
between.priceIncludeTax = (_s$goodsListState$edi7 = (_s$goodsListState$edi8 = s.goodsListState.editGood) === null || _s$goodsListState$edi8 === void 0 ? void 0 : _s$goodsListState$edi8.itemModelName) !== null && _s$goodsListState$edi7 !== void 0 ? _s$goodsListState$edi7 : record.priceIncludeTax;
|
|
9917
|
+
between.lineAmountIncludeTax = (_s$goodsListState$edi9 = (_s$goodsListState$edi10 = s.goodsListState.editGood) === null || _s$goodsListState$edi10 === void 0 ? void 0 : _s$goodsListState$edi10.itemModelName) !== null && _s$goodsListState$edi9 !== void 0 ? _s$goodsListState$edi9 : record.lineAmountIncludeTax;
|
|
9918
|
+
between.lineAmountExcludeTax = (_s$goodsListState$edi11 = (_s$goodsListState$edi12 = s.goodsListState.editGood) === null || _s$goodsListState$edi12 === void 0 ? void 0 : _s$goodsListState$edi12.itemModelName) !== null && _s$goodsListState$edi11 !== void 0 ? _s$goodsListState$edi11 : record.lineAmountExcludeTax;
|
|
9919
|
+
between.taxRate = (_s$goodsListState$edi13 = (_s$goodsListState$edi14 = s.goodsListState.editGood) === null || _s$goodsListState$edi14 === void 0 ? void 0 : _s$goodsListState$edi14.itemModelName) !== null && _s$goodsListState$edi13 !== void 0 ? _s$goodsListState$edi13 : record.taxRate;
|
|
9920
|
+
between.taxAmount = (_s$goodsListState$edi15 = (_s$goodsListState$edi16 = s.goodsListState.editGood) === null || _s$goodsListState$edi16 === void 0 ? void 0 : _s$goodsListState$edi16.itemModelName) !== null && _s$goodsListState$edi15 !== void 0 ? _s$goodsListState$edi15 : record.taxAmount; // 设置编辑货物
|
|
9901
9921
|
|
|
9902
9922
|
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
9903
9923
|
|
|
@@ -9928,22 +9948,22 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
|
|
|
9928
9948
|
|
|
9929
9949
|
|
|
9930
9950
|
if (!s.goodsListState.isTaxIncluded) {
|
|
9931
|
-
_context.next =
|
|
9951
|
+
_context.next = 30;
|
|
9932
9952
|
break;
|
|
9933
9953
|
}
|
|
9934
9954
|
|
|
9935
|
-
_context.next =
|
|
9955
|
+
_context.next = 28;
|
|
9936
9956
|
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
9937
9957
|
|
|
9938
|
-
case
|
|
9939
|
-
_context.next =
|
|
9958
|
+
case 28:
|
|
9959
|
+
_context.next = 32;
|
|
9940
9960
|
break;
|
|
9941
9961
|
|
|
9942
|
-
case
|
|
9943
|
-
_context.next =
|
|
9962
|
+
case 30:
|
|
9963
|
+
_context.next = 32;
|
|
9944
9964
|
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
9945
9965
|
|
|
9946
|
-
case
|
|
9966
|
+
case 32:
|
|
9947
9967
|
case "end":
|
|
9948
9968
|
return _context.stop();
|
|
9949
9969
|
}
|
|
@@ -14001,13 +14021,14 @@ var useColumns = (function (form) {
|
|
|
14001
14021
|
return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('priceIncludeTax', {
|
|
14002
14022
|
initialValue: nonScientificNotation(editGood.priceIncludeTax),
|
|
14003
14023
|
getValueFromEvent: onNumberValueChange,
|
|
14004
|
-
rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [{
|
|
14024
|
+
rules: [].concat(_toConsumableArray(getReplenishRules('priceIncludeTax')), [// { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '单价必须为数字' },
|
|
14025
|
+
{
|
|
14005
14026
|
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
14006
|
-
message: '
|
|
14027
|
+
message: '金额必须为数字'
|
|
14007
14028
|
}, {
|
|
14008
14029
|
validator: function () {
|
|
14009
14030
|
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
14010
|
-
var
|
|
14031
|
+
var quantity, isQuantityValid, isValueValid;
|
|
14011
14032
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
14012
14033
|
while (1) {
|
|
14013
14034
|
switch (_context9.prev = _context9.next) {
|
|
@@ -14016,20 +14037,38 @@ var useColumns = (function (form) {
|
|
|
14016
14037
|
return controller.wait();
|
|
14017
14038
|
|
|
14018
14039
|
case 2:
|
|
14019
|
-
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
14020
|
-
isvalue = !!value || value === 0;
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14040
|
+
// const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
14041
|
+
// const isvalue = !!value || value === 0;
|
|
14042
|
+
// if (isvalue || isQuantity === isvalue) return;
|
|
14043
|
+
// callback('请输入单价');
|
|
14044
|
+
quantity = getFieldValue('quantity');
|
|
14045
|
+
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
14046
|
+
isValueValid = value !== undefined && value !== null && value !== '';
|
|
14047
|
+
|
|
14048
|
+
if (!(isValueValid && isQuantityValid)) {
|
|
14049
|
+
_context9.next = 7;
|
|
14024
14050
|
break;
|
|
14025
14051
|
}
|
|
14026
14052
|
|
|
14027
14053
|
return _context9.abrupt("return");
|
|
14028
14054
|
|
|
14029
|
-
case 6:
|
|
14030
|
-
callback('请输入单价');
|
|
14031
|
-
|
|
14032
14055
|
case 7:
|
|
14056
|
+
if (isValueValid) {
|
|
14057
|
+
_context9.next = 9;
|
|
14058
|
+
break;
|
|
14059
|
+
}
|
|
14060
|
+
|
|
14061
|
+
return _context9.abrupt("return", callback('金额不能为空'));
|
|
14062
|
+
|
|
14063
|
+
case 9:
|
|
14064
|
+
if (isQuantityValid) {
|
|
14065
|
+
_context9.next = 11;
|
|
14066
|
+
break;
|
|
14067
|
+
}
|
|
14068
|
+
|
|
14069
|
+
return _context9.abrupt("return", callback('数量不能为空'));
|
|
14070
|
+
|
|
14071
|
+
case 11:
|
|
14033
14072
|
case "end":
|
|
14034
14073
|
return _context9.stop();
|
|
14035
14074
|
}
|
|
@@ -14082,7 +14121,7 @@ var useColumns = (function (form) {
|
|
|
14082
14121
|
}, {
|
|
14083
14122
|
validator: function () {
|
|
14084
14123
|
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
14085
|
-
var
|
|
14124
|
+
var quantity, isQuantityValid, isValueValid;
|
|
14086
14125
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
14087
14126
|
while (1) {
|
|
14088
14127
|
switch (_context10.prev = _context10.next) {
|
|
@@ -14091,20 +14130,38 @@ var useColumns = (function (form) {
|
|
|
14091
14130
|
return controller.wait();
|
|
14092
14131
|
|
|
14093
14132
|
case 2:
|
|
14094
|
-
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
14095
|
-
isvalue = !!value || value === 0;
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14133
|
+
// const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
14134
|
+
// const isvalue = !!value || value === 0;
|
|
14135
|
+
// if (isvalue || isQuantity === isvalue) return;
|
|
14136
|
+
// callback('请输入单价');
|
|
14137
|
+
quantity = getFieldValue('quantity');
|
|
14138
|
+
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
14139
|
+
isValueValid = value !== undefined && value !== null && value !== '';
|
|
14140
|
+
|
|
14141
|
+
if (!(isValueValid && isQuantityValid)) {
|
|
14142
|
+
_context10.next = 7;
|
|
14099
14143
|
break;
|
|
14100
14144
|
}
|
|
14101
14145
|
|
|
14102
14146
|
return _context10.abrupt("return");
|
|
14103
14147
|
|
|
14104
|
-
case 6:
|
|
14105
|
-
callback('请输入单价');
|
|
14106
|
-
|
|
14107
14148
|
case 7:
|
|
14149
|
+
if (isValueValid) {
|
|
14150
|
+
_context10.next = 9;
|
|
14151
|
+
break;
|
|
14152
|
+
}
|
|
14153
|
+
|
|
14154
|
+
return _context10.abrupt("return", callback('金额不能为空'));
|
|
14155
|
+
|
|
14156
|
+
case 9:
|
|
14157
|
+
if (isQuantityValid) {
|
|
14158
|
+
_context10.next = 11;
|
|
14159
|
+
break;
|
|
14160
|
+
}
|
|
14161
|
+
|
|
14162
|
+
return _context10.abrupt("return", callback('数量不能为空'));
|
|
14163
|
+
|
|
14164
|
+
case 11:
|
|
14108
14165
|
case "end":
|
|
14109
14166
|
return _context10.stop();
|
|
14110
14167
|
}
|
|
@@ -19826,12 +19883,72 @@ var clearCalculatingField$1 = /*#__PURE__*/function () {
|
|
|
19826
19883
|
};
|
|
19827
19884
|
}();
|
|
19828
19885
|
/** 数量改变了 */
|
|
19886
|
+
// export const onChangeQuantity = lazyFn(
|
|
19887
|
+
// (controller: InvoiceController, form: WrappedFormUtils, record: IGood) => {
|
|
19888
|
+
// form.validateFields(async (err, values) => {
|
|
19889
|
+
// err = err || {};
|
|
19890
|
+
// if (!values.quantity && values.quantity !== 0) {
|
|
19891
|
+
// await controller.setEditGood({ quantity: undefined });
|
|
19892
|
+
// await clearCalculatingField(controller);
|
|
19893
|
+
// return;
|
|
19894
|
+
// }
|
|
19895
|
+
// if (err.quantity) {
|
|
19896
|
+
// await clearCalculatingField(controller);
|
|
19897
|
+
// return
|
|
19898
|
+
// };
|
|
19899
|
+
// const calculatingDigits = controller.state.calculatingDigits;
|
|
19900
|
+
// const quantity = format15(values.quantity, calculatingDigits);
|
|
19901
|
+
// await controller.setEditGood({ quantity });
|
|
19902
|
+
// form.setFieldsValue({ quantity });
|
|
19903
|
+
// // 是否含税
|
|
19904
|
+
// if (controller.state.goodsListState.isTaxIncluded) {
|
|
19905
|
+
// // 含税
|
|
19906
|
+
// if (!err.priceIncludeTax && values.priceIncludeTax) {
|
|
19907
|
+
// // 可以找到 单价(含税)
|
|
19908
|
+
// const priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
|
|
19909
|
+
// const lineAmountIncludeTax = format2(evaluate(`${priceIncludeTax} * ${quantity}`));
|
|
19910
|
+
// form.setFieldsValue({ lineAmountIncludeTax });
|
|
19911
|
+
// await controller.setEditGood({ lineAmountIncludeTax });
|
|
19912
|
+
// } else if (!err.lineAmountIncludeTax && values.lineAmountIncludeTax) {
|
|
19913
|
+
// // 可以找到 金额(含税)
|
|
19914
|
+
// const lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
|
|
19915
|
+
// const priceIncludeTax = format15(
|
|
19916
|
+
// evaluate(`${lineAmountIncludeTax} / ${quantity}`),
|
|
19917
|
+
// calculatingDigits);
|
|
19918
|
+
// form.setFieldsValue({ priceIncludeTax });
|
|
19919
|
+
// await controller.setEditGood({ priceIncludeTax });
|
|
19920
|
+
// }
|
|
19921
|
+
// // 更新不含税
|
|
19922
|
+
// await updateUnitPriceExcludingTax(controller, form, record);
|
|
19923
|
+
// } else {
|
|
19924
|
+
// // 不含税
|
|
19925
|
+
// if (!err.priceExcludeTax && values.priceExcludeTax) {
|
|
19926
|
+
// // 可以找到 单价(不含税)
|
|
19927
|
+
// const priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
|
|
19928
|
+
// const lineAmountExcludeTax = format2(evaluate(`${quantity} * ${priceExcludeTax}`));
|
|
19929
|
+
// form.setFieldsValue({ lineAmountExcludeTax });
|
|
19930
|
+
// await controller.setEditGood({ lineAmountExcludeTax, quantity });
|
|
19931
|
+
// } else if (!err.lineAmountExcludeTax && values.lineAmountExcludeTax) {
|
|
19932
|
+
// // 可以找到 金额(不含税)
|
|
19933
|
+
// const lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
19934
|
+
// const priceExcludeTax = format15(evaluate(`${lineAmountExcludeTax} / ${quantity}`), calculatingDigits);
|
|
19935
|
+
// form.setFieldsValue({ priceExcludeTax });
|
|
19936
|
+
// await controller.setEditGood({ priceExcludeTax, quantity });
|
|
19937
|
+
// }
|
|
19938
|
+
// // 更新含税
|
|
19939
|
+
// await updateUnitPriceTax(controller, form, record);
|
|
19940
|
+
// }
|
|
19941
|
+
// // 清楚 计算中启动字段
|
|
19942
|
+
// await clearCalculatingField(controller);
|
|
19943
|
+
// });
|
|
19944
|
+
// },
|
|
19945
|
+
// 1000,
|
|
19946
|
+
// );
|
|
19829
19947
|
|
|
19830
19948
|
var onChangeQuantity$1 = lazyFn$1(function (controller, form, record) {
|
|
19831
19949
|
form.validateFields( /*#__PURE__*/function () {
|
|
19832
19950
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
|
|
19833
|
-
var calculatingDigits, quantity,
|
|
19834
|
-
|
|
19951
|
+
var calculatingDigits, quantity, lineAmountIncludeTax, priceIncludeTax, lineAmountExcludeTax, priceExcludeTax;
|
|
19835
19952
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
19836
19953
|
while (1) {
|
|
19837
19954
|
switch (_context3.prev = _context3.next) {
|
|
@@ -19870,115 +19987,69 @@ var onChangeQuantity$1 = lazyFn$1(function (controller, form, record) {
|
|
|
19870
19987
|
case 11:
|
|
19871
19988
|
calculatingDigits = controller.state.calculatingDigits;
|
|
19872
19989
|
quantity = format15(values.quantity, calculatingDigits);
|
|
19873
|
-
_context3.next =
|
|
19990
|
+
_context3.next = 15;
|
|
19874
19991
|
return controller.setEditGood({
|
|
19875
19992
|
quantity: quantity
|
|
19876
19993
|
});
|
|
19877
19994
|
|
|
19878
|
-
case
|
|
19995
|
+
case 15:
|
|
19879
19996
|
form.setFieldsValue({
|
|
19880
19997
|
quantity: quantity
|
|
19881
19998
|
}); // 是否含税
|
|
19882
19999
|
|
|
19883
20000
|
if (!controller.state.goodsListState.isTaxIncluded) {
|
|
19884
|
-
_context3.next =
|
|
20001
|
+
_context3.next = 27;
|
|
19885
20002
|
break;
|
|
19886
20003
|
}
|
|
19887
20004
|
|
|
19888
|
-
if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
|
|
19889
|
-
_context3.next = 26;
|
|
19890
|
-
break;
|
|
19891
|
-
}
|
|
19892
|
-
|
|
19893
|
-
// 可以找到 单价(含税)
|
|
19894
|
-
priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
|
|
19895
|
-
lineAmountIncludeTax = format2(evaluate("".concat(priceIncludeTax, " * ").concat(quantity)));
|
|
19896
|
-
form.setFieldsValue({
|
|
19897
|
-
lineAmountIncludeTax: lineAmountIncludeTax
|
|
19898
|
-
});
|
|
19899
|
-
_context3.next = 24;
|
|
19900
|
-
return controller.setEditGood({
|
|
19901
|
-
lineAmountIncludeTax: lineAmountIncludeTax
|
|
19902
|
-
});
|
|
19903
|
-
|
|
19904
|
-
case 24:
|
|
19905
|
-
_context3.next = 32;
|
|
19906
|
-
break;
|
|
19907
|
-
|
|
19908
|
-
case 26:
|
|
19909
20005
|
if (!(!err.lineAmountIncludeTax && values.lineAmountIncludeTax)) {
|
|
19910
|
-
_context3.next =
|
|
20006
|
+
_context3.next = 23;
|
|
19911
20007
|
break;
|
|
19912
20008
|
}
|
|
19913
20009
|
|
|
19914
|
-
|
|
19915
|
-
|
|
19916
|
-
_priceIncludeTax = format15(evaluate("".concat(_lineAmountIncludeTax, " / ").concat(quantity)), calculatingDigits);
|
|
20010
|
+
lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
|
|
20011
|
+
priceIncludeTax = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(quantity)), calculatingDigits);
|
|
19917
20012
|
form.setFieldsValue({
|
|
19918
|
-
priceIncludeTax:
|
|
20013
|
+
priceIncludeTax: priceIncludeTax
|
|
19919
20014
|
});
|
|
19920
|
-
_context3.next =
|
|
20015
|
+
_context3.next = 23;
|
|
19921
20016
|
return controller.setEditGood({
|
|
19922
|
-
priceIncludeTax:
|
|
20017
|
+
priceIncludeTax: priceIncludeTax
|
|
19923
20018
|
});
|
|
19924
20019
|
|
|
19925
|
-
case
|
|
19926
|
-
_context3.next =
|
|
20020
|
+
case 23:
|
|
20021
|
+
_context3.next = 25;
|
|
19927
20022
|
return updateUnitPriceExcludingTax$1(controller, form, record);
|
|
19928
20023
|
|
|
19929
|
-
case
|
|
19930
|
-
_context3.next =
|
|
19931
|
-
break;
|
|
19932
|
-
|
|
19933
|
-
case 36:
|
|
19934
|
-
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
19935
|
-
_context3.next = 44;
|
|
19936
|
-
break;
|
|
19937
|
-
}
|
|
19938
|
-
|
|
19939
|
-
// 可以找到 单价(不含税)
|
|
19940
|
-
priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
|
|
19941
|
-
lineAmountExcludeTax = format2(evaluate("".concat(quantity, " * ").concat(priceExcludeTax)));
|
|
19942
|
-
form.setFieldsValue({
|
|
19943
|
-
lineAmountExcludeTax: lineAmountExcludeTax
|
|
19944
|
-
});
|
|
19945
|
-
_context3.next = 42;
|
|
19946
|
-
return controller.setEditGood({
|
|
19947
|
-
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
19948
|
-
quantity: quantity
|
|
19949
|
-
});
|
|
19950
|
-
|
|
19951
|
-
case 42:
|
|
19952
|
-
_context3.next = 50;
|
|
20024
|
+
case 25:
|
|
20025
|
+
_context3.next = 35;
|
|
19953
20026
|
break;
|
|
19954
20027
|
|
|
19955
|
-
case
|
|
20028
|
+
case 27:
|
|
19956
20029
|
if (!(!err.lineAmountExcludeTax && values.lineAmountExcludeTax)) {
|
|
19957
|
-
_context3.next =
|
|
20030
|
+
_context3.next = 33;
|
|
19958
20031
|
break;
|
|
19959
20032
|
}
|
|
19960
20033
|
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
_priceExcludeTax = format15(evaluate("".concat(_lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
|
|
20034
|
+
lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
20035
|
+
priceExcludeTax = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(quantity)), calculatingDigits);
|
|
19964
20036
|
form.setFieldsValue({
|
|
19965
|
-
priceExcludeTax:
|
|
20037
|
+
priceExcludeTax: priceExcludeTax
|
|
19966
20038
|
});
|
|
19967
|
-
_context3.next =
|
|
20039
|
+
_context3.next = 33;
|
|
19968
20040
|
return controller.setEditGood({
|
|
19969
|
-
priceExcludeTax:
|
|
19970
|
-
quantity: quantity
|
|
20041
|
+
priceExcludeTax: priceExcludeTax
|
|
19971
20042
|
});
|
|
19972
20043
|
|
|
19973
|
-
case
|
|
19974
|
-
_context3.next =
|
|
20044
|
+
case 33:
|
|
20045
|
+
_context3.next = 35;
|
|
19975
20046
|
return updateUnitPriceTax$1(controller, form, record);
|
|
19976
20047
|
|
|
19977
|
-
case
|
|
19978
|
-
_context3.next =
|
|
20048
|
+
case 35:
|
|
20049
|
+
_context3.next = 37;
|
|
19979
20050
|
return clearCalculatingField$1(controller);
|
|
19980
20051
|
|
|
19981
|
-
case
|
|
20052
|
+
case 37:
|
|
19982
20053
|
case "end":
|
|
19983
20054
|
return _context3.stop();
|
|
19984
20055
|
}
|
|
@@ -19996,7 +20067,7 @@ var onChangeQuantity$1 = lazyFn$1(function (controller, form, record) {
|
|
|
19996
20067
|
var onChangePriceIncludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
19997
20068
|
form.validateFields( /*#__PURE__*/function () {
|
|
19998
20069
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
|
|
19999
|
-
var calculatingDigits, priceIncludeTax, quantity, lineAmountIncludeTax,
|
|
20070
|
+
var calculatingDigits, priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax, _quantity;
|
|
20000
20071
|
|
|
20001
20072
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
20002
20073
|
while (1) {
|
|
@@ -20072,8 +20143,8 @@ var onChangePriceIncludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
|
20072
20143
|
break;
|
|
20073
20144
|
}
|
|
20074
20145
|
|
|
20075
|
-
|
|
20076
|
-
_quantity = format15(evaluate("".concat(
|
|
20146
|
+
_lineAmountIncludeTax = format2(values.lineAmountIncludeTax);
|
|
20147
|
+
_quantity = format15(evaluate("".concat(_lineAmountIncludeTax, " / ").concat(priceIncludeTax)), calculatingDigits);
|
|
20077
20148
|
form.setFieldsValue({
|
|
20078
20149
|
quantity: _quantity
|
|
20079
20150
|
});
|
|
@@ -20108,7 +20179,7 @@ var onChangePriceIncludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
|
20108
20179
|
var onChangePriceExcludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
20109
20180
|
form.validateFields( /*#__PURE__*/function () {
|
|
20110
20181
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
|
|
20111
|
-
var calculatingDigits, priceExcludeTax, quantity, lineAmountExcludeTax,
|
|
20182
|
+
var calculatingDigits, priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax, _quantity2;
|
|
20112
20183
|
|
|
20113
20184
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
20114
20185
|
while (1) {
|
|
@@ -20184,8 +20255,8 @@ var onChangePriceExcludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
|
20184
20255
|
break;
|
|
20185
20256
|
}
|
|
20186
20257
|
|
|
20187
|
-
|
|
20188
|
-
_quantity2 = format15(evaluate("".concat(
|
|
20258
|
+
_lineAmountExcludeTax = format2(values.lineAmountExcludeTax);
|
|
20259
|
+
_quantity2 = format15(evaluate("".concat(_lineAmountExcludeTax, " / ").concat(priceExcludeTax)), calculatingDigits);
|
|
20189
20260
|
form.setFieldsValue({
|
|
20190
20261
|
quantity: _quantity2
|
|
20191
20262
|
});
|
|
@@ -20220,7 +20291,7 @@ var onChangePriceExcludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
|
20220
20291
|
var onChangeLineAmountIncludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
20221
20292
|
form.validateFields( /*#__PURE__*/function () {
|
|
20222
20293
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
|
|
20223
|
-
var calculatingDigits, lineAmountIncludeTax, quantity, priceIncludeTax,
|
|
20294
|
+
var calculatingDigits, lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax, _quantity3;
|
|
20224
20295
|
|
|
20225
20296
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
20226
20297
|
while (1) {
|
|
@@ -20288,8 +20359,8 @@ var onChangeLineAmountIncludeTax$1 = lazyFn$1(function (controller, form, record
|
|
|
20288
20359
|
break;
|
|
20289
20360
|
}
|
|
20290
20361
|
|
|
20291
|
-
|
|
20292
|
-
_quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(
|
|
20362
|
+
_priceIncludeTax = format15(values.priceIncludeTax, calculatingDigits);
|
|
20363
|
+
_quantity3 = format15(evaluate("".concat(lineAmountIncludeTax, " / ").concat(_priceIncludeTax)), calculatingDigits);
|
|
20293
20364
|
form.setFieldsValue({
|
|
20294
20365
|
quantity: _quantity3
|
|
20295
20366
|
});
|
|
@@ -20324,7 +20395,7 @@ var onChangeLineAmountIncludeTax$1 = lazyFn$1(function (controller, form, record
|
|
|
20324
20395
|
var onChangeLineAmountExcludeTax$1 = lazyFn$1(function (controller, form, record) {
|
|
20325
20396
|
form.validateFields( /*#__PURE__*/function () {
|
|
20326
20397
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, values) {
|
|
20327
|
-
var calculatingDigits, lineAmountExcludeTax, quantity, priceExcludeTax,
|
|
20398
|
+
var calculatingDigits, lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax, _quantity4;
|
|
20328
20399
|
|
|
20329
20400
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
20330
20401
|
while (1) {
|
|
@@ -20392,8 +20463,8 @@ var onChangeLineAmountExcludeTax$1 = lazyFn$1(function (controller, form, record
|
|
|
20392
20463
|
break;
|
|
20393
20464
|
}
|
|
20394
20465
|
|
|
20395
|
-
|
|
20396
|
-
_quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(
|
|
20466
|
+
_priceExcludeTax = format15(values.priceExcludeTax, calculatingDigits);
|
|
20467
|
+
_quantity4 = format15(evaluate("".concat(lineAmountExcludeTax, " / ").concat(_priceExcludeTax)), calculatingDigits);
|
|
20397
20468
|
form.setFieldsValue({
|
|
20398
20469
|
quantity: _quantity4
|
|
20399
20470
|
});
|
|
@@ -21013,21 +21084,21 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
21013
21084
|
|
|
21014
21085
|
var _quantity5 = format15(sourceQuantity, calculatingDigits);
|
|
21015
21086
|
|
|
21016
|
-
var
|
|
21087
|
+
var _priceExcludeTax2 = format15(sourcePriceExcludeTax, calculatingDigits);
|
|
21017
21088
|
|
|
21018
|
-
var
|
|
21089
|
+
var _lineAmountExcludeTax2 = format2(evaluate("".concat(_priceExcludeTax2, " * ").concat(_quantity5)));
|
|
21019
21090
|
|
|
21020
|
-
var
|
|
21091
|
+
var _lineAmountIncludeTax2 = format2(evaluate("".concat(_lineAmountExcludeTax2, " * (1+(").concat(taxRate, "/100))")));
|
|
21021
21092
|
|
|
21022
|
-
var
|
|
21093
|
+
var _priceIncludeTax2 = format15(evaluate("".concat(_lineAmountIncludeTax2, " / ").concat(_quantity5)), calculatingDigits);
|
|
21023
21094
|
|
|
21024
|
-
var _taxAmount = evaluate("".concat(
|
|
21095
|
+
var _taxAmount = evaluate("".concat(_lineAmountIncludeTax2, " - ").concat(_lineAmountExcludeTax2));
|
|
21025
21096
|
|
|
21026
21097
|
return _objectSpread2(_objectSpread2({}, good), {}, {
|
|
21027
|
-
lineAmountExcludeTax:
|
|
21028
|
-
lineAmountIncludeTax:
|
|
21098
|
+
lineAmountExcludeTax: _lineAmountExcludeTax2,
|
|
21099
|
+
lineAmountIncludeTax: _lineAmountIncludeTax2,
|
|
21029
21100
|
taxAmount: _taxAmount,
|
|
21030
|
-
priceIncludeTax:
|
|
21101
|
+
priceIncludeTax: _priceIncludeTax2
|
|
21031
21102
|
});
|
|
21032
21103
|
}
|
|
21033
21104
|
});
|
|
@@ -22394,7 +22465,7 @@ var useColumns$1 = (function (form) {
|
|
|
22394
22465
|
}, {
|
|
22395
22466
|
validator: function () {
|
|
22396
22467
|
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
22397
|
-
var
|
|
22468
|
+
var quantity, isQuantityValid, isValueValid;
|
|
22398
22469
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
22399
22470
|
while (1) {
|
|
22400
22471
|
switch (_context8.prev = _context8.next) {
|
|
@@ -22403,20 +22474,38 @@ var useColumns$1 = (function (form) {
|
|
|
22403
22474
|
return controller.wait();
|
|
22404
22475
|
|
|
22405
22476
|
case 2:
|
|
22406
|
-
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
22407
|
-
isvalue = !!value || value === 0;
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
|
|
22477
|
+
// const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
22478
|
+
// const isvalue = !!value || value === 0;
|
|
22479
|
+
// if (isvalue || isQuantity === isvalue) return;
|
|
22480
|
+
// callback('请输入单价');
|
|
22481
|
+
quantity = getFieldValue('quantity');
|
|
22482
|
+
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
22483
|
+
isValueValid = value !== undefined && value !== null && value !== '';
|
|
22484
|
+
|
|
22485
|
+
if (!(isValueValid && isQuantityValid)) {
|
|
22486
|
+
_context8.next = 7;
|
|
22411
22487
|
break;
|
|
22412
22488
|
}
|
|
22413
22489
|
|
|
22414
22490
|
return _context8.abrupt("return");
|
|
22415
22491
|
|
|
22416
|
-
case 6:
|
|
22417
|
-
callback('请输入单价');
|
|
22418
|
-
|
|
22419
22492
|
case 7:
|
|
22493
|
+
if (isValueValid) {
|
|
22494
|
+
_context8.next = 9;
|
|
22495
|
+
break;
|
|
22496
|
+
}
|
|
22497
|
+
|
|
22498
|
+
return _context8.abrupt("return", callback('金额不能为空'));
|
|
22499
|
+
|
|
22500
|
+
case 9:
|
|
22501
|
+
if (isQuantityValid) {
|
|
22502
|
+
_context8.next = 11;
|
|
22503
|
+
break;
|
|
22504
|
+
}
|
|
22505
|
+
|
|
22506
|
+
return _context8.abrupt("return", callback('数量不能为空'));
|
|
22507
|
+
|
|
22508
|
+
case 11:
|
|
22420
22509
|
case "end":
|
|
22421
22510
|
return _context8.stop();
|
|
22422
22511
|
}
|
|
@@ -22469,7 +22558,7 @@ var useColumns$1 = (function (form) {
|
|
|
22469
22558
|
}, {
|
|
22470
22559
|
validator: function () {
|
|
22471
22560
|
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
22472
|
-
var
|
|
22561
|
+
var quantity, isQuantityValid, isValueValid;
|
|
22473
22562
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
22474
22563
|
while (1) {
|
|
22475
22564
|
switch (_context9.prev = _context9.next) {
|
|
@@ -22478,20 +22567,38 @@ var useColumns$1 = (function (form) {
|
|
|
22478
22567
|
return controller.wait();
|
|
22479
22568
|
|
|
22480
22569
|
case 2:
|
|
22481
|
-
isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
22482
|
-
isvalue = !!value || value === 0;
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22570
|
+
// const isQuantity = !!getFieldValue('quantity') || getFieldValue('quantity') === 0;
|
|
22571
|
+
// const isvalue = !!value || value === 0;
|
|
22572
|
+
// if (isvalue || isQuantity === isvalue) return;
|
|
22573
|
+
// callback('请输入单价');
|
|
22574
|
+
quantity = getFieldValue('quantity');
|
|
22575
|
+
isQuantityValid = quantity !== undefined && quantity !== null && quantity !== '';
|
|
22576
|
+
isValueValid = value !== undefined && value !== null && value !== '';
|
|
22577
|
+
|
|
22578
|
+
if (!(isValueValid && isQuantityValid)) {
|
|
22579
|
+
_context9.next = 7;
|
|
22486
22580
|
break;
|
|
22487
22581
|
}
|
|
22488
22582
|
|
|
22489
22583
|
return _context9.abrupt("return");
|
|
22490
22584
|
|
|
22491
|
-
case 6:
|
|
22492
|
-
callback('请输入单价');
|
|
22493
|
-
|
|
22494
22585
|
case 7:
|
|
22586
|
+
if (isValueValid) {
|
|
22587
|
+
_context9.next = 9;
|
|
22588
|
+
break;
|
|
22589
|
+
}
|
|
22590
|
+
|
|
22591
|
+
return _context9.abrupt("return", callback('金额不能为空'));
|
|
22592
|
+
|
|
22593
|
+
case 9:
|
|
22594
|
+
if (isQuantityValid) {
|
|
22595
|
+
_context9.next = 11;
|
|
22596
|
+
break;
|
|
22597
|
+
}
|
|
22598
|
+
|
|
22599
|
+
return _context9.abrupt("return", callback('数量不能为空'));
|
|
22600
|
+
|
|
22601
|
+
case 11:
|
|
22495
22602
|
case "end":
|
|
22496
22603
|
return _context9.stop();
|
|
22497
22604
|
}
|
|
@@ -26890,6 +26997,8 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
26890
26997
|
onClick: function onClick() {
|
|
26891
26998
|
controller.run( /*#__PURE__*/function () {
|
|
26892
26999
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
27000
|
+
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, _s$goodsListState$edi15, _s$goodsListState$edi16;
|
|
27001
|
+
|
|
26893
27002
|
var between, editGood;
|
|
26894
27003
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
26895
27004
|
while (1) {
|
|
@@ -26926,17 +27035,32 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
26926
27035
|
// 导入时清空之前输入的值,使用导入的单价和税率(参考税局系统)
|
|
26927
27036
|
record.quantity = undefined;
|
|
26928
27037
|
record.lineAmountExcludeTax = undefined;
|
|
26929
|
-
record.lineAmountIncludeTax = undefined;
|
|
27038
|
+
record.lineAmountIncludeTax = undefined;
|
|
27039
|
+
console.log('s.goodsListState.editGood1:', s.goodsListState.editGood); // 光电定制化功能:无论是否有值都替换 itemCode, itemName, shorthand, taxCategoryCode, taxClassificationCode;
|
|
27040
|
+
// 如果其他输入框有值就不替换,没值就替换:itemModelName, lineAmountExcludeTax, lineAmountIncludeTax,lineAttribute,priceExcludeTax,
|
|
27041
|
+
// priceIncludeTax,quantity, serialNo, taxAmount, taxRate, unit
|
|
27042
|
+
// 中间数据
|
|
26930
27043
|
|
|
26931
27044
|
between = _objectSpread2({}, record);
|
|
27045
|
+
console.log(':between:', between);
|
|
26932
27046
|
between.itemName = getItemName(record, s.goodsListState.editGood);
|
|
26933
27047
|
between.itemCode = getItemCode(record, s.goodsListState.editGood);
|
|
26934
27048
|
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
|
|
26935
27049
|
|
|
26936
|
-
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), {}, {
|
|
26937
|
-
itemModelName:
|
|
26938
|
-
itemModelNameSelf:
|
|
26939
|
-
|
|
27050
|
+
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between), {}, {
|
|
27051
|
+
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,
|
|
27052
|
+
itemModelNameSelf: (_s$goodsListState$edi3 = (_s$goodsListState$edi4 = s.goodsListState.editGood) === null || _s$goodsListState$edi4 === void 0 ? void 0 : _s$goodsListState$edi4.itemModelNameSelf) !== null && _s$goodsListState$edi3 !== void 0 ? _s$goodsListState$edi3 : between.itemModelNameSelf,
|
|
27053
|
+
lineAmountExcludeTax: (_s$goodsListState$edi5 = (_s$goodsListState$edi6 = s.goodsListState.editGood) === null || _s$goodsListState$edi6 === void 0 ? void 0 : _s$goodsListState$edi6.lineAmountExcludeTax) !== null && _s$goodsListState$edi5 !== void 0 ? _s$goodsListState$edi5 : between.lineAmountExcludeTax,
|
|
27054
|
+
lineAmountIncludeTax: (_s$goodsListState$edi7 = (_s$goodsListState$edi8 = s.goodsListState.editGood) === null || _s$goodsListState$edi8 === void 0 ? void 0 : _s$goodsListState$edi8.lineAmountIncludeTax) !== null && _s$goodsListState$edi7 !== void 0 ? _s$goodsListState$edi7 : between.lineAmountIncludeTax,
|
|
27055
|
+
priceExcludeTax: (_s$goodsListState$edi9 = (_s$goodsListState$edi10 = s.goodsListState.editGood) === null || _s$goodsListState$edi10 === void 0 ? void 0 : _s$goodsListState$edi10.priceExcludeTax) !== null && _s$goodsListState$edi9 !== void 0 ? _s$goodsListState$edi9 : between.priceExcludeTax,
|
|
27056
|
+
priceIncludeTax: (_s$goodsListState$edi11 = (_s$goodsListState$edi12 = s.goodsListState.editGood) === null || _s$goodsListState$edi12 === void 0 ? void 0 : _s$goodsListState$edi12.priceIncludeTax) !== null && _s$goodsListState$edi11 !== void 0 ? _s$goodsListState$edi11 : between.priceIncludeTax,
|
|
27057
|
+
quantity: (_s$goodsListState$edi13 = (_s$goodsListState$edi14 = s.goodsListState.editGood) === null || _s$goodsListState$edi14 === void 0 ? void 0 : _s$goodsListState$edi14.quantity) !== null && _s$goodsListState$edi13 !== void 0 ? _s$goodsListState$edi13 : between.quantity,
|
|
27058
|
+
unit: (_s$goodsListState$edi15 = (_s$goodsListState$edi16 = s.goodsListState.editGood) === null || _s$goodsListState$edi16 === void 0 ? void 0 : _s$goodsListState$edi16.unit) !== null && _s$goodsListState$edi15 !== void 0 ? _s$goodsListState$edi15 : between.unit // serialNo:s.goodsListState.editGood?.itemModelName ?? between.itemModelName,
|
|
27059
|
+
// taxAmount:s.goodsListState.editGood?.itemModelName ?? between.itemModelName,
|
|
27060
|
+
// taxRate:s.goodsListState.editGood?.itemModelName ?? between.itemModelName,
|
|
27061
|
+
// lineAttribute:s.goodsListState.editGood?.lineAttribute,
|
|
27062
|
+
|
|
27063
|
+
});
|
|
26940
27064
|
|
|
26941
27065
|
if (editGood.taxRate) {
|
|
26942
27066
|
editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
|
|
@@ -26964,27 +27088,27 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
26964
27088
|
// s.goodsListState.form.setFieldsValue({
|
|
26965
27089
|
// ...editGood,
|
|
26966
27090
|
// });
|
|
26967
|
-
// }
|
|
27091
|
+
// }
|
|
26968
27092
|
|
|
26969
27093
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
26970
27094
|
|
|
26971
27095
|
if (!s.goodsListState.isTaxIncluded) {
|
|
26972
|
-
_context2.next =
|
|
27096
|
+
_context2.next = 28;
|
|
26973
27097
|
break;
|
|
26974
27098
|
}
|
|
26975
27099
|
|
|
26976
|
-
_context2.next =
|
|
27100
|
+
_context2.next = 26;
|
|
26977
27101
|
return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
|
|
26978
27102
|
|
|
26979
|
-
case
|
|
26980
|
-
_context2.next =
|
|
27103
|
+
case 26:
|
|
27104
|
+
_context2.next = 30;
|
|
26981
27105
|
break;
|
|
26982
27106
|
|
|
26983
|
-
case
|
|
26984
|
-
_context2.next =
|
|
27107
|
+
case 28:
|
|
27108
|
+
_context2.next = 30;
|
|
26985
27109
|
return updateUnitPriceTax(controller, s.goodsListState.form, record);
|
|
26986
27110
|
|
|
26987
|
-
case
|
|
27111
|
+
case 30:
|
|
26988
27112
|
case "end":
|
|
26989
27113
|
return _context2.stop();
|
|
26990
27114
|
}
|