kts-component-invoice-operate 3.2.265 → 3.2.266
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/DifferenceInputModal/index.d.ts +8 -2
- package/dist/Invoice/InvoiceController/InvoiceControllerState/DifferenceInputState/index.d.ts +2 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +2 -0
- package/dist/Invoice/InvoiceController/hooks/index.d.ts +3 -0
- package/dist/Invoice/tools/calculate/index.d.ts +1 -1
- package/dist/index.esm.js +670 -286
- package/dist/index.js +670 -286
- package/package.json +1 -1
- package/src/DifferenceInputModal/index.tsx +87 -17
- package/src/Invoice/Invoice-digtal/index.md +9 -9
- package/src/Invoice/InvoiceController/InvoiceControllerForm/index.ts +2 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/DifferenceInputState/index.ts +3 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +3 -0
- package/src/Invoice/InvoiceController/fns/saveEditGood.ts +1 -0
- package/src/Invoice/InvoiceController/hooks/index.ts +63 -0
- package/src/Invoice/index.tsx +3 -0
- package/src/Invoice/tools/calculate/index.ts +2 -3
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/autoFillFn/index.ts +2 -1
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/index.tsx +19 -6
- package/src/Invoice/ui/default/GoodsList/hook/useColumns/ui/ItemNameInput/index.tsx +5 -4
- package/src/Invoice/ui/default/GoodsList/hook/useWindowClick/index.tsx +4 -1
- package/src/Invoice/ui/default/GoodsList/index.tsx +1 -1
- package/src/Invoice/ui/default/GoodsList/ui/AddRowButton/index.tsx +1 -1
- package/src/Invoice/ui/digtal/DifferenceInput/index.tsx +33 -3
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +2 -2
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +34 -21
- package/src/Invoice/ui/digtal/GoodsList/hook/useWindowClick/index.tsx +4 -1
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -854,10 +854,11 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
854
854
|
|
|
855
855
|
case 27:
|
|
856
856
|
_values.set('goodsList', this.state.goodsListState.goodsList.slice().map(function (e) {
|
|
857
|
-
var _this3$state, _this3$state$differen, _this3$state$differen2;
|
|
857
|
+
var _this3$state, _this3$state$differen, _this3$state$differen2, _this3$state2, _this3$state2$differe, _this3$state2$differe2;
|
|
858
858
|
|
|
859
859
|
return _objectSpread2(_objectSpread2({}, e), {}, {
|
|
860
|
-
deductAmount: ((_this3$state = _this3.state) === null || _this3$state === void 0 ? void 0 : (_this3$state$differen = _this3$state.differenceInputState) === null || _this3$state$differen === void 0 ? void 0 : (_this3$state$differen2 = _this3$state$differen.data) === null || _this3$state$differen2 === void 0 ? void 0 : _this3$state$differen2.deductTotal) || 0
|
|
860
|
+
deductAmount: ((_this3$state = _this3.state) === null || _this3$state === void 0 ? void 0 : (_this3$state$differen = _this3$state.differenceInputState) === null || _this3$state$differen === void 0 ? void 0 : (_this3$state$differen2 = _this3$state$differen.data) === null || _this3$state$differen2 === void 0 ? void 0 : _this3$state$differen2.deductTotal) || 0,
|
|
861
|
+
amountIncludeTax: ((_this3$state2 = _this3.state) === null || _this3$state2 === void 0 ? void 0 : (_this3$state2$differe = _this3$state2.differenceInputState) === null || _this3$state2$differe === void 0 ? void 0 : (_this3$state2$differe2 = _this3$state2$differe.data) === null || _this3$state2$differe2 === void 0 ? void 0 : _this3$state2$differe2.amountIncludeTax) || 0
|
|
861
862
|
});
|
|
862
863
|
})); //货物运输列表
|
|
863
864
|
|
|
@@ -1243,6 +1244,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1243
1244
|
this.isValidateGood = true;
|
|
1244
1245
|
this.isValidateMeiTan = true;
|
|
1245
1246
|
this.meiTanGoodIndex = [];
|
|
1247
|
+
this.isSaveRowOutside = true;
|
|
1246
1248
|
|
|
1247
1249
|
this.verifyMeiTanFn = /*#__PURE__*/function () {
|
|
1248
1250
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
|
|
@@ -1654,6 +1656,7 @@ var DifferenceInputState = /*#__PURE__*/_createClass(function DifferenceInputSta
|
|
|
1654
1656
|
this.enabled = false;
|
|
1655
1657
|
this.open = false;
|
|
1656
1658
|
this.data = void 0;
|
|
1659
|
+
this.amountIncludeTax = void 0;
|
|
1657
1660
|
});
|
|
1658
1661
|
|
|
1659
1662
|
var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControllerState() {
|
|
@@ -2293,7 +2296,7 @@ function countAmountIncludeTax(quantity, priceIncludeTax, calculatingDigits) {
|
|
|
2293
2296
|
return parseFloat(chain$1(bignumber(priceIncludeTax)).multiply(bignumber(quantity)).done().toNumber().toFixed(2)); // return parseFloat(evaluate(`${priceIncludeTax} * ${quantity}`).toFixed(2));
|
|
2294
2297
|
}
|
|
2295
2298
|
/**
|
|
2296
|
-
* 不含税金额 =
|
|
2299
|
+
* 不含税金额 = 含税金额 - 税额
|
|
2297
2300
|
* @param amountIncludeTax 含税金额
|
|
2298
2301
|
* @param taxAmount 税额
|
|
2299
2302
|
* @returns 不含税金额
|
|
@@ -2314,10 +2317,9 @@ function countAmountExcludeTax(amountIncludeTax, taxAmount) {
|
|
|
2314
2317
|
|
|
2315
2318
|
function countTaxAmount(amountIncludeTax, deduction, taxRate) {
|
|
2316
2319
|
if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
|
|
2317
|
-
if (!deduction && deduction !== 0) return undefined;
|
|
2318
2320
|
if (!taxRate && taxRate !== 0) return undefined;
|
|
2319
2321
|
var taxRateBu = chain$1(bignumber(taxRate)).divide(bignumber(100)).done();
|
|
2320
|
-
return parseFloat(chain$1(bignumber(amountIncludeTax)).subtract(bignumber(deduction)).divide(chain$1(bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
|
|
2322
|
+
return parseFloat(chain$1(bignumber(amountIncludeTax)).subtract(bignumber(deduction || 0)).divide(chain$1(bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
|
|
2321
2323
|
}
|
|
2322
2324
|
/**
|
|
2323
2325
|
* 单价 = 金额/数量
|
|
@@ -9977,6 +9979,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
9977
9979
|
/** 税率 */
|
|
9978
9980
|
|
|
9979
9981
|
var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
9982
|
+
console.log('计算税率===>');
|
|
9980
9983
|
form.validateFields( /*#__PURE__*/function () {
|
|
9981
9984
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
|
|
9982
9985
|
var taxRate;
|
|
@@ -10120,7 +10123,7 @@ var updateUnitPriceExcludingTax = /*#__PURE__*/function () {
|
|
|
10120
10123
|
/** 税额 */
|
|
10121
10124
|
|
|
10122
10125
|
/** 扣除额 */
|
|
10123
|
-
deduction = controller.state.goodsListState.deduction;
|
|
10126
|
+
deduction = controller.state.goodsListState.deduction || 0;
|
|
10124
10127
|
editGood = controller.state.goodsListState.editGood; // 计算税额
|
|
10125
10128
|
|
|
10126
10129
|
if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
|
|
@@ -11078,6 +11081,143 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
|
|
|
11078
11081
|
return _createClass(InvoiceController);
|
|
11079
11082
|
}(InvoiceControllerForm);
|
|
11080
11083
|
|
|
11084
|
+
/** 切换是否启用差额开票重新计算税额 */
|
|
11085
|
+
|
|
11086
|
+
var useRecalculateTax = function useRecalculateTax(invoiceController) {
|
|
11087
|
+
var differenceInputEnabled = invoiceController.useMemo(function (s) {
|
|
11088
|
+
return s.differenceInputState.enabled;
|
|
11089
|
+
}, []);
|
|
11090
|
+
React.useEffect(function () {
|
|
11091
|
+
console.log('切换是否启用差额开票重新计算税额 - 重新计算税额===>');
|
|
11092
|
+
|
|
11093
|
+
if (invoiceController.state.goodsListState.editGood) {
|
|
11094
|
+
var editGood = invoiceController.state.goodsListState.editGood;
|
|
11095
|
+
var form = invoiceController.state.goodsListState.form;
|
|
11096
|
+
var isTaxIncluded = invoiceController.state.goodsListState.isTaxIncluded;
|
|
11097
|
+
|
|
11098
|
+
if (isTaxIncluded) {
|
|
11099
|
+
// 含税
|
|
11100
|
+
var lineAmountIncludeTax = (form === null || form === void 0 ? void 0 : form.getFieldValue('lineAmountIncludeTax')) || 0; //含税金额
|
|
11101
|
+
|
|
11102
|
+
var taxRate = (form === null || form === void 0 ? void 0 : form.getFieldValue('taxRate')) || 0; //税率
|
|
11103
|
+
|
|
11104
|
+
var taxAmount = countTaxAmount(lineAmountIncludeTax, 0, taxRate) || 0; //税额
|
|
11105
|
+
|
|
11106
|
+
var lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount) || 0; // 不含税金额
|
|
11107
|
+
|
|
11108
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue({
|
|
11109
|
+
taxAmount: taxAmount,
|
|
11110
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11111
|
+
});
|
|
11112
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11113
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
11114
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11115
|
+
while (1) {
|
|
11116
|
+
switch (_context.prev = _context.next) {
|
|
11117
|
+
case 0:
|
|
11118
|
+
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
11119
|
+
taxAmount: taxAmount,
|
|
11120
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11121
|
+
});
|
|
11122
|
+
|
|
11123
|
+
case 1:
|
|
11124
|
+
case "end":
|
|
11125
|
+
return _context.stop();
|
|
11126
|
+
}
|
|
11127
|
+
}
|
|
11128
|
+
}, _callee);
|
|
11129
|
+
}));
|
|
11130
|
+
|
|
11131
|
+
return function (_x) {
|
|
11132
|
+
return _ref.apply(this, arguments);
|
|
11133
|
+
};
|
|
11134
|
+
}());
|
|
11135
|
+
} else {
|
|
11136
|
+
// 不含税
|
|
11137
|
+
var _lineAmountIncludeTax = editGood.lineAmountIncludeTax || 0;
|
|
11138
|
+
|
|
11139
|
+
var _taxRate = (form === null || form === void 0 ? void 0 : form.getFieldValue('taxRate')) || 0; //税率
|
|
11140
|
+
|
|
11141
|
+
|
|
11142
|
+
var _taxAmount = countTaxAmount(_lineAmountIncludeTax, 0, _taxRate) || 0; //税额
|
|
11143
|
+
|
|
11144
|
+
|
|
11145
|
+
var _lineAmountExcludeTax = countAmountExcludeTax(_lineAmountIncludeTax, _taxAmount) || 0; // 不含税金额
|
|
11146
|
+
|
|
11147
|
+
|
|
11148
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue({
|
|
11149
|
+
taxAmount: _taxAmount,
|
|
11150
|
+
lineAmountExcludeTax: _lineAmountExcludeTax
|
|
11151
|
+
});
|
|
11152
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11153
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
11154
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11155
|
+
while (1) {
|
|
11156
|
+
switch (_context2.prev = _context2.next) {
|
|
11157
|
+
case 0:
|
|
11158
|
+
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
11159
|
+
taxAmount: _taxAmount,
|
|
11160
|
+
lineAmountExcludeTax: _lineAmountExcludeTax
|
|
11161
|
+
});
|
|
11162
|
+
|
|
11163
|
+
case 1:
|
|
11164
|
+
case "end":
|
|
11165
|
+
return _context2.stop();
|
|
11166
|
+
}
|
|
11167
|
+
}
|
|
11168
|
+
}, _callee2);
|
|
11169
|
+
}));
|
|
11170
|
+
|
|
11171
|
+
return function (_x2) {
|
|
11172
|
+
return _ref2.apply(this, arguments);
|
|
11173
|
+
};
|
|
11174
|
+
}());
|
|
11175
|
+
}
|
|
11176
|
+
} else {
|
|
11177
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11178
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
11179
|
+
var good, lineAmountIncludeTax, taxRate, taxAmount, lineAmountExcludeTax;
|
|
11180
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11181
|
+
while (1) {
|
|
11182
|
+
switch (_context3.prev = _context3.next) {
|
|
11183
|
+
case 0:
|
|
11184
|
+
good = s.goodsListState.goodsList[0];
|
|
11185
|
+
|
|
11186
|
+
if (good) {
|
|
11187
|
+
_context3.next = 3;
|
|
11188
|
+
break;
|
|
11189
|
+
}
|
|
11190
|
+
|
|
11191
|
+
return _context3.abrupt("return");
|
|
11192
|
+
|
|
11193
|
+
case 3:
|
|
11194
|
+
lineAmountIncludeTax = good.lineAmountIncludeTax || 0;
|
|
11195
|
+
taxRate = good.taxRate || 0;
|
|
11196
|
+
taxAmount = countTaxAmount(lineAmountIncludeTax, 0, taxRate) || 0; //税额
|
|
11197
|
+
|
|
11198
|
+
lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount) || 0; // 不含税金额
|
|
11199
|
+
|
|
11200
|
+
s.goodsListState.goodsList[0] = _objectSpread2(_objectSpread2({}, good), {}, {
|
|
11201
|
+
taxAmount: taxAmount,
|
|
11202
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11203
|
+
});
|
|
11204
|
+
|
|
11205
|
+
case 8:
|
|
11206
|
+
case "end":
|
|
11207
|
+
return _context3.stop();
|
|
11208
|
+
}
|
|
11209
|
+
}
|
|
11210
|
+
}, _callee3);
|
|
11211
|
+
}));
|
|
11212
|
+
|
|
11213
|
+
return function (_x3) {
|
|
11214
|
+
return _ref3.apply(this, arguments);
|
|
11215
|
+
};
|
|
11216
|
+
}());
|
|
11217
|
+
}
|
|
11218
|
+
}, [differenceInputEnabled]);
|
|
11219
|
+
};
|
|
11220
|
+
|
|
11081
11221
|
/** 更新 商品序号 */
|
|
11082
11222
|
|
|
11083
11223
|
function useToGenerateId(controller) {
|
|
@@ -11751,8 +11891,8 @@ var AddRowButton = (function (props) {
|
|
|
11751
11891
|
})), [controller, rootElement]);
|
|
11752
11892
|
if (isAddRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
11753
11893
|
if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
11754
|
-
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
11755
|
-
|
|
11894
|
+
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null); // if (isDifferenceInput && goodsNum >= 1) return <></>;
|
|
11895
|
+
|
|
11756
11896
|
return /*#__PURE__*/React.createElement(Button, {
|
|
11757
11897
|
onClick: onClick,
|
|
11758
11898
|
disabled: disabled
|
|
@@ -12628,10 +12768,7 @@ function ItemNameInput(props) {
|
|
|
12628
12768
|
}, []);
|
|
12629
12769
|
var autoComplete = controller.useMemo(function (s) {
|
|
12630
12770
|
return s.autoComplete;
|
|
12631
|
-
}, []);
|
|
12632
|
-
var enabled = controller.useMemo(function (s) {
|
|
12633
|
-
return s.differenceInputState.enabled;
|
|
12634
|
-
}, []);
|
|
12771
|
+
}, []); // const enabled = controller.useMemo((s) => s.differenceInputState.enabled, []);
|
|
12635
12772
|
|
|
12636
12773
|
var _React$useState = React.useState([]),
|
|
12637
12774
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -12691,8 +12828,9 @@ function ItemNameInput(props) {
|
|
|
12691
12828
|
setSelectLine(null);
|
|
12692
12829
|
|
|
12693
12830
|
case 8:
|
|
12694
|
-
// 失去焦点时,打开差额开票弹窗
|
|
12695
|
-
|
|
12831
|
+
console.log('onBlur ===>', controller.state.differenceInputState.enabled); // 失去焦点时,打开差额开票弹窗
|
|
12832
|
+
|
|
12833
|
+
if (controller.state.differenceInputState.enabled) {
|
|
12696
12834
|
controller.run( /*#__PURE__*/function () {
|
|
12697
12835
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
12698
12836
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -12715,26 +12853,26 @@ function ItemNameInput(props) {
|
|
|
12715
12853
|
}());
|
|
12716
12854
|
}
|
|
12717
12855
|
|
|
12718
|
-
_context2.next =
|
|
12856
|
+
_context2.next = 15;
|
|
12719
12857
|
break;
|
|
12720
12858
|
|
|
12721
|
-
case
|
|
12722
|
-
_context2.prev =
|
|
12859
|
+
case 12:
|
|
12860
|
+
_context2.prev = 12;
|
|
12723
12861
|
_context2.t0 = _context2["catch"](0);
|
|
12724
12862
|
throw _context2.t0;
|
|
12725
12863
|
|
|
12726
|
-
case
|
|
12864
|
+
case 15:
|
|
12727
12865
|
case "end":
|
|
12728
12866
|
return _context2.stop();
|
|
12729
12867
|
}
|
|
12730
12868
|
}
|
|
12731
|
-
}, _callee2, null, [[0,
|
|
12869
|
+
}, _callee2, null, [[0, 12]]);
|
|
12732
12870
|
}));
|
|
12733
12871
|
|
|
12734
12872
|
return function (_x) {
|
|
12735
12873
|
return _ref.apply(this, arguments);
|
|
12736
12874
|
};
|
|
12737
|
-
}(), [autoComplete.onItemNameBlur, selectLine, props.editGood
|
|
12875
|
+
}(), [autoComplete.onItemNameBlur, selectLine, props.editGood]);
|
|
12738
12876
|
var onSearch = React.useCallback( /*#__PURE__*/function () {
|
|
12739
12877
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(searchText) {
|
|
12740
12878
|
var list;
|
|
@@ -14941,6 +15079,11 @@ var useColumns = (function (form) {
|
|
|
14941
15079
|
var deduction = controller.useMemo(function (e) {
|
|
14942
15080
|
return e.goodsListState.deduction;
|
|
14943
15081
|
}, []);
|
|
15082
|
+
/** 差额开票是否启用 */
|
|
15083
|
+
|
|
15084
|
+
var differenceInputStateEnabled = controller.useMemo(function (e) {
|
|
15085
|
+
return e.differenceInputState.enabled;
|
|
15086
|
+
}, []);
|
|
14944
15087
|
/** 计算中启动字段 */
|
|
14945
15088
|
|
|
14946
15089
|
var changeField = controller.useMemo(function (e) {
|
|
@@ -15439,6 +15582,7 @@ var useColumns = (function (form) {
|
|
|
15439
15582
|
textAlign: 'right'
|
|
15440
15583
|
},
|
|
15441
15584
|
maxLength: 25,
|
|
15585
|
+
disabled: differenceInputStateEnabled,
|
|
15442
15586
|
loading: isCipher(changeField, 'priceIncludeTax'),
|
|
15443
15587
|
onChange: function onChange() {
|
|
15444
15588
|
setChangeField('priceIncludeTax');
|
|
@@ -15514,6 +15658,7 @@ var useColumns = (function (form) {
|
|
|
15514
15658
|
textAlign: 'right'
|
|
15515
15659
|
},
|
|
15516
15660
|
maxLength: 25,
|
|
15661
|
+
disabled: differenceInputStateEnabled,
|
|
15517
15662
|
loading: isCipher(changeField, 'priceExcludeTax'),
|
|
15518
15663
|
onChange: function onChange() {
|
|
15519
15664
|
setChangeField('priceExcludeTax');
|
|
@@ -15603,17 +15748,40 @@ var useColumns = (function (form) {
|
|
|
15603
15748
|
textAlign: 'right'
|
|
15604
15749
|
},
|
|
15605
15750
|
loading: isCipher(changeField, 'lineAmountIncludeTax'),
|
|
15751
|
+
readOnly: differenceInputStateEnabled,
|
|
15606
15752
|
onChange: function onChange() {
|
|
15607
15753
|
setChangeField('lineAmountIncludeTax');
|
|
15608
15754
|
onChangeLineAmountIncludeTax(controller, form, record);
|
|
15609
|
-
}
|
|
15755
|
+
},
|
|
15756
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
15757
|
+
controller.run( /*#__PURE__*/function () {
|
|
15758
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
|
|
15759
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
15760
|
+
while (1) {
|
|
15761
|
+
switch (_context13.prev = _context13.next) {
|
|
15762
|
+
case 0:
|
|
15763
|
+
s.differenceInputState.open = true;
|
|
15764
|
+
|
|
15765
|
+
case 1:
|
|
15766
|
+
case "end":
|
|
15767
|
+
return _context13.stop();
|
|
15768
|
+
}
|
|
15769
|
+
}
|
|
15770
|
+
}, _callee13);
|
|
15771
|
+
}));
|
|
15772
|
+
|
|
15773
|
+
return function (_x21) {
|
|
15774
|
+
return _ref3.apply(this, arguments);
|
|
15775
|
+
};
|
|
15776
|
+
}());
|
|
15777
|
+
} : undefined
|
|
15610
15778
|
})));
|
|
15611
15779
|
} else {
|
|
15612
15780
|
return /*#__PURE__*/React.createElement("span", {
|
|
15613
15781
|
style: {
|
|
15614
15782
|
padding: '0 10px'
|
|
15615
15783
|
}
|
|
15616
|
-
}, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
15784
|
+
}, formatSearch((isNaN(parseFloat(value)) ? 0 : parseFloat(value)).toFixed(2), searchValue));
|
|
15617
15785
|
}
|
|
15618
15786
|
}
|
|
15619
15787
|
}, {
|
|
@@ -15625,7 +15793,7 @@ var useColumns = (function (form) {
|
|
|
15625
15793
|
align: 'right',
|
|
15626
15794
|
width: 119,
|
|
15627
15795
|
render: function render(value, record) {
|
|
15628
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
15796
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab' && !differenceInputStateEnabled) {
|
|
15629
15797
|
return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
|
|
15630
15798
|
initialValue: editGood.lineAmountExcludeTax,
|
|
15631
15799
|
getValueFromEvent: onNumberValueChange,
|
|
@@ -15637,10 +15805,10 @@ var useColumns = (function (form) {
|
|
|
15637
15805
|
message: '金额必须为数字'
|
|
15638
15806
|
}, {
|
|
15639
15807
|
validator: function () {
|
|
15640
|
-
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15641
|
-
return _regeneratorRuntime().wrap(function
|
|
15808
|
+
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_, value, callback) {
|
|
15809
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
15642
15810
|
while (1) {
|
|
15643
|
-
switch (
|
|
15811
|
+
switch (_context14.prev = _context14.next) {
|
|
15644
15812
|
case 0:
|
|
15645
15813
|
if ("".concat(value).split('.')[0].length > priceIntegerDigit) {
|
|
15646
15814
|
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E".concat(priceIntegerDigit, "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D"));
|
|
@@ -15648,13 +15816,13 @@ var useColumns = (function (form) {
|
|
|
15648
15816
|
|
|
15649
15817
|
case 1:
|
|
15650
15818
|
case "end":
|
|
15651
|
-
return
|
|
15819
|
+
return _context14.stop();
|
|
15652
15820
|
}
|
|
15653
15821
|
}
|
|
15654
|
-
},
|
|
15822
|
+
}, _callee14);
|
|
15655
15823
|
}));
|
|
15656
15824
|
|
|
15657
|
-
function validator(
|
|
15825
|
+
function validator(_x22, _x23, _x24) {
|
|
15658
15826
|
return _validator7.apply(this, arguments);
|
|
15659
15827
|
}
|
|
15660
15828
|
|
|
@@ -15665,7 +15833,30 @@ var useColumns = (function (form) {
|
|
|
15665
15833
|
style: {
|
|
15666
15834
|
textAlign: 'right'
|
|
15667
15835
|
},
|
|
15836
|
+
readOnly: differenceInputStateEnabled,
|
|
15668
15837
|
loading: isCipher(changeField, 'lineAmountExcludeTax'),
|
|
15838
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
15839
|
+
controller.run( /*#__PURE__*/function () {
|
|
15840
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
|
|
15841
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
15842
|
+
while (1) {
|
|
15843
|
+
switch (_context15.prev = _context15.next) {
|
|
15844
|
+
case 0:
|
|
15845
|
+
s.differenceInputState.open = true;
|
|
15846
|
+
|
|
15847
|
+
case 1:
|
|
15848
|
+
case "end":
|
|
15849
|
+
return _context15.stop();
|
|
15850
|
+
}
|
|
15851
|
+
}
|
|
15852
|
+
}, _callee15);
|
|
15853
|
+
}));
|
|
15854
|
+
|
|
15855
|
+
return function (_x25) {
|
|
15856
|
+
return _ref4.apply(this, arguments);
|
|
15857
|
+
};
|
|
15858
|
+
}());
|
|
15859
|
+
} : undefined,
|
|
15669
15860
|
onChange: function onChange() {
|
|
15670
15861
|
setChangeField('lineAmountExcludeTax');
|
|
15671
15862
|
onChangeLineAmountExcludeTax(controller, form, record);
|
|
@@ -15676,7 +15867,7 @@ var useColumns = (function (form) {
|
|
|
15676
15867
|
style: {
|
|
15677
15868
|
padding: '0 10px'
|
|
15678
15869
|
}
|
|
15679
|
-
}, value === '' ? '' : formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
15870
|
+
}, value === '' ? '' : formatSearch((isNaN(parseFloat(value)) ? 0 : parseFloat(value)).toFixed(2), searchValue));
|
|
15680
15871
|
}
|
|
15681
15872
|
}
|
|
15682
15873
|
}, {
|
|
@@ -15754,11 +15945,12 @@ var useColumns = (function (form) {
|
|
|
15754
15945
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
15755
15946
|
|
|
15756
15947
|
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
15948
|
+
var deduction = controller.state.goodsListState.deduction || 0;
|
|
15757
15949
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
15758
15950
|
|
|
15759
15951
|
if (lineAmountExcludeTax && (taxRate || taxRate === 0) && lineAmountIncludeTax) {
|
|
15760
15952
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
15761
|
-
var total = chain$1(bignumber(lineAmountExcludeTax)).multiply(bignumber(taxRate || 0)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
15953
|
+
var total = chain$1(bignumber(lineAmountExcludeTax)).subtract(bignumber(deduction)).multiply(bignumber(taxRate || 0)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
15762
15954
|
|
|
15763
15955
|
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
15764
15956
|
callback();
|
|
@@ -15887,7 +16079,7 @@ var useColumns = (function (form) {
|
|
|
15887
16079
|
ellipsis: true
|
|
15888
16080
|
});
|
|
15889
16081
|
});
|
|
15890
|
-
}, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
|
|
16082
|
+
}, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart, differenceInputStateEnabled]);
|
|
15891
16083
|
return controller.setColumnsConfig ? controller.setColumnsConfig(columns) : columns;
|
|
15892
16084
|
});
|
|
15893
16085
|
/** 字段 */
|
|
@@ -16220,61 +16412,6 @@ var useOnRow = (function () {
|
|
|
16220
16412
|
};
|
|
16221
16413
|
});
|
|
16222
16414
|
|
|
16223
|
-
/**
|
|
16224
|
-
* 扣除额 相关业务
|
|
16225
|
-
*/
|
|
16226
|
-
|
|
16227
|
-
function useDeduction(controller) {
|
|
16228
|
-
var deduction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16229
|
-
// 更新 扣除额
|
|
16230
|
-
React.useEffect(function () {
|
|
16231
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
16232
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
16233
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16234
|
-
while (1) {
|
|
16235
|
-
switch (_context.prev = _context.next) {
|
|
16236
|
-
case 0:
|
|
16237
|
-
return _context.abrupt("return", s.goodsListState.deduction = deduction);
|
|
16238
|
-
|
|
16239
|
-
case 1:
|
|
16240
|
-
case "end":
|
|
16241
|
-
return _context.stop();
|
|
16242
|
-
}
|
|
16243
|
-
}
|
|
16244
|
-
}, _callee);
|
|
16245
|
-
}));
|
|
16246
|
-
|
|
16247
|
-
return function (_x) {
|
|
16248
|
-
return _ref.apply(this, arguments);
|
|
16249
|
-
};
|
|
16250
|
-
}())();
|
|
16251
|
-
}, [controller, deduction]); // 重新计算
|
|
16252
|
-
|
|
16253
|
-
React.useEffect(function () {
|
|
16254
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
16255
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
16256
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
16257
|
-
while (1) {
|
|
16258
|
-
switch (_context2.prev = _context2.next) {
|
|
16259
|
-
case 0:
|
|
16260
|
-
s.goodsListState.editGood = undefined;
|
|
16261
|
-
s.goodsListState.goodsList = [];
|
|
16262
|
-
|
|
16263
|
-
case 2:
|
|
16264
|
-
case "end":
|
|
16265
|
-
return _context2.stop();
|
|
16266
|
-
}
|
|
16267
|
-
}
|
|
16268
|
-
}, _callee2);
|
|
16269
|
-
}));
|
|
16270
|
-
|
|
16271
|
-
return function (_x2) {
|
|
16272
|
-
return _ref2.apply(this, arguments);
|
|
16273
|
-
};
|
|
16274
|
-
}())();
|
|
16275
|
-
}, [controller, deduction]);
|
|
16276
|
-
}
|
|
16277
|
-
|
|
16278
16415
|
/**
|
|
16279
16416
|
* 点击组件外部 保存正在编辑的货物
|
|
16280
16417
|
*/
|
|
@@ -16286,6 +16423,9 @@ function useWindowClick(controller) {
|
|
|
16286
16423
|
/** 点击组件外部 保存正在编辑的货物 */
|
|
16287
16424
|
React.useEffect(function () {
|
|
16288
16425
|
var click = function click() {
|
|
16426
|
+
var _controller$state$goo;
|
|
16427
|
+
|
|
16428
|
+
if (!((_controller$state$goo = controller.state.goodsListState) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.isSaveRowOutside)) return;
|
|
16289
16429
|
setTimeout(controller.saveEditGood);
|
|
16290
16430
|
};
|
|
16291
16431
|
|
|
@@ -17857,9 +17997,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
17857
17997
|
}, [dataSource, searchValue, controller, isTaxIncluded]);
|
|
17858
17998
|
/** 表格行事件 */
|
|
17859
17999
|
|
|
17860
|
-
var _onRow = useOnRow();
|
|
18000
|
+
var _onRow = useOnRow(); // useDeduction(controller, props.deduction);
|
|
18001
|
+
|
|
17861
18002
|
|
|
17862
|
-
useDeduction(controller, props.deduction);
|
|
17863
18003
|
useWindowClick(controller);
|
|
17864
18004
|
/** 批量赋码 */
|
|
17865
18005
|
|
|
@@ -23177,8 +23317,8 @@ var AddRowButton$1 = (function () {
|
|
|
23177
23317
|
})), [controller, rootElement]);
|
|
23178
23318
|
if (isAddRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
23179
23319
|
if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
23180
|
-
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
23181
|
-
|
|
23320
|
+
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null); // if (isDifferenceInput && goodsNum >= 1) return <></>;
|
|
23321
|
+
|
|
23182
23322
|
return /*#__PURE__*/React.createElement(Button$1, {
|
|
23183
23323
|
size: 'small',
|
|
23184
23324
|
type: 'primary',
|
|
@@ -23504,7 +23644,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
|
|
|
23504
23644
|
break;
|
|
23505
23645
|
}
|
|
23506
23646
|
|
|
23507
|
-
if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
|
|
23647
|
+
if (!(!err.priceIncludeTax && values.priceIncludeTax && !controller.state.differenceInputState.enabled)) {
|
|
23508
23648
|
_context3.next = 26;
|
|
23509
23649
|
break;
|
|
23510
23650
|
}
|
|
@@ -23550,7 +23690,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
|
|
|
23550
23690
|
break;
|
|
23551
23691
|
|
|
23552
23692
|
case 36:
|
|
23553
|
-
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
23693
|
+
if (!(!err.priceExcludeTax && values.priceExcludeTax && !controller.state.differenceInputState.enabled)) {
|
|
23554
23694
|
_context3.next = 44;
|
|
23555
23695
|
break;
|
|
23556
23696
|
}
|
|
@@ -25634,6 +25774,11 @@ var useColumns$1 = (function (form) {
|
|
|
25634
25774
|
var deduction = controller.useMemo(function (e) {
|
|
25635
25775
|
return e.goodsListState.deduction;
|
|
25636
25776
|
}, []);
|
|
25777
|
+
/** 差额开票是否启用 */
|
|
25778
|
+
|
|
25779
|
+
var differenceInputStateEnabled = controller.useMemo(function (e) {
|
|
25780
|
+
return e.differenceInputState.enabled;
|
|
25781
|
+
}, []);
|
|
25637
25782
|
/** 计算中启动字段 */
|
|
25638
25783
|
|
|
25639
25784
|
var changeField = controller.useMemo(function (e) {
|
|
@@ -25729,58 +25874,24 @@ var useColumns$1 = (function (form) {
|
|
|
25729
25874
|
}, getFieldDecorator('itemName', {
|
|
25730
25875
|
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
25731
25876
|
rules: [].concat(_toConsumableArray(getReplenishRules('itemName')), [{
|
|
25732
|
-
|
|
25733
|
-
|
|
25734
|
-
|
|
25735
|
-
|
|
25736
|
-
|
|
25737
|
-
|
|
25738
|
-
|
|
25739
|
-
|
|
25740
|
-
|
|
25741
|
-
|
|
25742
|
-
|
|
25743
|
-
|
|
25744
|
-
|
|
25745
|
-
|
|
25746
|
-
|
|
25747
|
-
|
|
25748
|
-
|
|
25749
|
-
|
|
25750
|
-
if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
|
|
25751
|
-
_context2.next = 8;
|
|
25752
|
-
break;
|
|
25753
|
-
}
|
|
25754
|
-
|
|
25755
|
-
callback('项目名称不能为空');
|
|
25756
|
-
_context2.next = 9;
|
|
25757
|
-
break;
|
|
25758
|
-
|
|
25759
|
-
case 8:
|
|
25760
|
-
return _context2.abrupt("return");
|
|
25761
|
-
|
|
25762
|
-
case 9:
|
|
25763
|
-
_context2.next = 12;
|
|
25764
|
-
break;
|
|
25765
|
-
|
|
25766
|
-
case 11:
|
|
25767
|
-
callback();
|
|
25768
|
-
|
|
25769
|
-
case 12:
|
|
25770
|
-
case "end":
|
|
25771
|
-
return _context2.stop();
|
|
25772
|
-
}
|
|
25773
|
-
}
|
|
25774
|
-
}, _callee2);
|
|
25775
|
-
}));
|
|
25776
|
-
|
|
25777
|
-
function validator(_x2, _x3, _x4) {
|
|
25778
|
-
return _validator.apply(this, arguments);
|
|
25779
|
-
}
|
|
25780
|
-
|
|
25781
|
-
return validator;
|
|
25782
|
-
}()
|
|
25783
|
-
}])
|
|
25877
|
+
required: isValidateGood,
|
|
25878
|
+
message: '项目名称不能为空'
|
|
25879
|
+
} // {
|
|
25880
|
+
// validator: async (_, __, callback) => {
|
|
25881
|
+
// if (isValidateGood) {
|
|
25882
|
+
// await controller.wait();
|
|
25883
|
+
// const value = controller.state.goodsListState.editGood;
|
|
25884
|
+
// if (!value?.itemName && !value?.itemNameSelf) {
|
|
25885
|
+
// callback('项目名称不能为空');
|
|
25886
|
+
// } else {
|
|
25887
|
+
// return;
|
|
25888
|
+
// }
|
|
25889
|
+
// } else {
|
|
25890
|
+
// callback();
|
|
25891
|
+
// }
|
|
25892
|
+
// }
|
|
25893
|
+
// }
|
|
25894
|
+
])
|
|
25784
25895
|
})( /*#__PURE__*/React.createElement(ItemNameInput$1, {
|
|
25785
25896
|
editGood: editGood,
|
|
25786
25897
|
shorthand: editGood.shorthand,
|
|
@@ -25796,22 +25907,22 @@ var useColumns$1 = (function (form) {
|
|
|
25796
25907
|
},
|
|
25797
25908
|
icon: /*#__PURE__*/React.createElement(SvgPlus$2, null),
|
|
25798
25909
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
25799
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25800
|
-
return _regeneratorRuntime().wrap(function
|
|
25910
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
25911
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25801
25912
|
while (1) {
|
|
25802
|
-
switch (
|
|
25913
|
+
switch (_context2.prev = _context2.next) {
|
|
25803
25914
|
case 0:
|
|
25804
25915
|
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
25805
25916
|
|
|
25806
25917
|
case 1:
|
|
25807
25918
|
case "end":
|
|
25808
|
-
return
|
|
25919
|
+
return _context2.stop();
|
|
25809
25920
|
}
|
|
25810
25921
|
}
|
|
25811
|
-
},
|
|
25922
|
+
}, _callee2);
|
|
25812
25923
|
}));
|
|
25813
25924
|
|
|
25814
|
-
return function (
|
|
25925
|
+
return function (_x2) {
|
|
25815
25926
|
return _ref2.apply(this, arguments);
|
|
25816
25927
|
};
|
|
25817
25928
|
}())
|
|
@@ -25849,13 +25960,13 @@ var useColumns$1 = (function (form) {
|
|
|
25849
25960
|
rules: getReplenishRules('itemModelName')
|
|
25850
25961
|
})( /*#__PURE__*/React.createElement(MyInput$3, {
|
|
25851
25962
|
onChange: function () {
|
|
25852
|
-
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25963
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
25853
25964
|
var key, value;
|
|
25854
|
-
return _regeneratorRuntime().wrap(function
|
|
25965
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
25855
25966
|
while (1) {
|
|
25856
|
-
switch (
|
|
25967
|
+
switch (_context3.prev = _context3.next) {
|
|
25857
25968
|
case 0:
|
|
25858
|
-
|
|
25969
|
+
_context3.next = 2;
|
|
25859
25970
|
return controller.wait();
|
|
25860
25971
|
|
|
25861
25972
|
case 2:
|
|
@@ -25866,10 +25977,10 @@ var useColumns$1 = (function (form) {
|
|
|
25866
25977
|
|
|
25867
25978
|
case 6:
|
|
25868
25979
|
case "end":
|
|
25869
|
-
return
|
|
25980
|
+
return _context3.stop();
|
|
25870
25981
|
}
|
|
25871
25982
|
}
|
|
25872
|
-
},
|
|
25983
|
+
}, _callee3);
|
|
25873
25984
|
}));
|
|
25874
25985
|
|
|
25875
25986
|
function onChange() {
|
|
@@ -25907,12 +26018,12 @@ var useColumns$1 = (function (form) {
|
|
|
25907
26018
|
return rootElement || document.body;
|
|
25908
26019
|
},
|
|
25909
26020
|
onChange: function () {
|
|
25910
|
-
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25911
|
-
return _regeneratorRuntime().wrap(function
|
|
26021
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
26022
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
25912
26023
|
while (1) {
|
|
25913
|
-
switch (
|
|
26024
|
+
switch (_context4.prev = _context4.next) {
|
|
25914
26025
|
case 0:
|
|
25915
|
-
|
|
26026
|
+
_context4.next = 2;
|
|
25916
26027
|
return controller.wait();
|
|
25917
26028
|
|
|
25918
26029
|
case 2:
|
|
@@ -25922,10 +26033,10 @@ var useColumns$1 = (function (form) {
|
|
|
25922
26033
|
|
|
25923
26034
|
case 3:
|
|
25924
26035
|
case "end":
|
|
25925
|
-
return
|
|
26036
|
+
return _context4.stop();
|
|
25926
26037
|
}
|
|
25927
26038
|
}
|
|
25928
|
-
},
|
|
26039
|
+
}, _callee4);
|
|
25929
26040
|
}));
|
|
25930
26041
|
|
|
25931
26042
|
function onChange() {
|
|
@@ -25961,18 +26072,18 @@ var useColumns$1 = (function (form) {
|
|
|
25961
26072
|
message: '数量必须为数字'
|
|
25962
26073
|
}, {
|
|
25963
26074
|
validator: function () {
|
|
25964
|
-
var
|
|
26075
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
|
|
25965
26076
|
var isvalue, isPrice;
|
|
25966
|
-
return _regeneratorRuntime().wrap(function
|
|
26077
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25967
26078
|
while (1) {
|
|
25968
|
-
switch (
|
|
26079
|
+
switch (_context5.prev = _context5.next) {
|
|
25969
26080
|
case 0:
|
|
25970
26081
|
if (!isValidateGood) {
|
|
25971
|
-
|
|
26082
|
+
_context5.next = 10;
|
|
25972
26083
|
break;
|
|
25973
26084
|
}
|
|
25974
26085
|
|
|
25975
|
-
|
|
26086
|
+
_context5.next = 3;
|
|
25976
26087
|
return controller.wait();
|
|
25977
26088
|
|
|
25978
26089
|
case 3:
|
|
@@ -25980,15 +26091,15 @@ var useColumns$1 = (function (form) {
|
|
|
25980
26091
|
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
25981
26092
|
|
|
25982
26093
|
if (!(isvalue || isPrice === isvalue)) {
|
|
25983
|
-
|
|
26094
|
+
_context5.next = 7;
|
|
25984
26095
|
break;
|
|
25985
26096
|
}
|
|
25986
26097
|
|
|
25987
|
-
return
|
|
26098
|
+
return _context5.abrupt("return");
|
|
25988
26099
|
|
|
25989
26100
|
case 7:
|
|
25990
26101
|
callback('请输入数量');
|
|
25991
|
-
|
|
26102
|
+
_context5.next = 11;
|
|
25992
26103
|
break;
|
|
25993
26104
|
|
|
25994
26105
|
case 10:
|
|
@@ -25996,14 +26107,14 @@ var useColumns$1 = (function (form) {
|
|
|
25996
26107
|
|
|
25997
26108
|
case 11:
|
|
25998
26109
|
case "end":
|
|
25999
|
-
return
|
|
26110
|
+
return _context5.stop();
|
|
26000
26111
|
}
|
|
26001
26112
|
}
|
|
26002
|
-
},
|
|
26113
|
+
}, _callee5);
|
|
26003
26114
|
}));
|
|
26004
26115
|
|
|
26005
|
-
function validator(
|
|
26006
|
-
return
|
|
26116
|
+
function validator(_x3, _x4, _x5) {
|
|
26117
|
+
return _validator.apply(this, arguments);
|
|
26007
26118
|
}
|
|
26008
26119
|
|
|
26009
26120
|
return validator;
|
|
@@ -26016,21 +26127,21 @@ var useColumns$1 = (function (form) {
|
|
|
26016
26127
|
maxLength: 25,
|
|
26017
26128
|
loading: isCipher$1(changeField, "quantity"),
|
|
26018
26129
|
onChange: function () {
|
|
26019
|
-
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
26020
|
-
return _regeneratorRuntime().wrap(function
|
|
26130
|
+
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
26131
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
26021
26132
|
while (1) {
|
|
26022
|
-
switch (
|
|
26133
|
+
switch (_context6.prev = _context6.next) {
|
|
26023
26134
|
case 0:
|
|
26024
26135
|
setChangeField('quantity');
|
|
26025
|
-
|
|
26136
|
+
_context6.next = 3;
|
|
26026
26137
|
return onChangeQuantity$1(controller, form, record);
|
|
26027
26138
|
|
|
26028
26139
|
case 3:
|
|
26029
26140
|
case "end":
|
|
26030
|
-
return
|
|
26141
|
+
return _context6.stop();
|
|
26031
26142
|
}
|
|
26032
26143
|
}
|
|
26033
|
-
},
|
|
26144
|
+
}, _callee6);
|
|
26034
26145
|
}));
|
|
26035
26146
|
|
|
26036
26147
|
function onChange() {
|
|
@@ -26066,13 +26177,13 @@ var useColumns$1 = (function (form) {
|
|
|
26066
26177
|
message: '单价必须为数字'
|
|
26067
26178
|
}, {
|
|
26068
26179
|
validator: function () {
|
|
26069
|
-
var
|
|
26180
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
|
|
26070
26181
|
var isQuantity, isvalue;
|
|
26071
|
-
return _regeneratorRuntime().wrap(function
|
|
26182
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
26072
26183
|
while (1) {
|
|
26073
|
-
switch (
|
|
26184
|
+
switch (_context7.prev = _context7.next) {
|
|
26074
26185
|
case 0:
|
|
26075
|
-
|
|
26186
|
+
_context7.next = 2;
|
|
26076
26187
|
return controller.wait();
|
|
26077
26188
|
|
|
26078
26189
|
case 2:
|
|
@@ -26080,25 +26191,25 @@ var useColumns$1 = (function (form) {
|
|
|
26080
26191
|
isvalue = !!value || value === 0;
|
|
26081
26192
|
|
|
26082
26193
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
26083
|
-
|
|
26194
|
+
_context7.next = 6;
|
|
26084
26195
|
break;
|
|
26085
26196
|
}
|
|
26086
26197
|
|
|
26087
|
-
return
|
|
26198
|
+
return _context7.abrupt("return");
|
|
26088
26199
|
|
|
26089
26200
|
case 6:
|
|
26090
26201
|
callback('请输入单价');
|
|
26091
26202
|
|
|
26092
26203
|
case 7:
|
|
26093
26204
|
case "end":
|
|
26094
|
-
return
|
|
26205
|
+
return _context7.stop();
|
|
26095
26206
|
}
|
|
26096
26207
|
}
|
|
26097
|
-
},
|
|
26208
|
+
}, _callee7);
|
|
26098
26209
|
}));
|
|
26099
26210
|
|
|
26100
|
-
function validator(
|
|
26101
|
-
return
|
|
26211
|
+
function validator(_x6, _x7, _x8) {
|
|
26212
|
+
return _validator2.apply(this, arguments);
|
|
26102
26213
|
}
|
|
26103
26214
|
|
|
26104
26215
|
return validator;
|
|
@@ -26109,6 +26220,7 @@ var useColumns$1 = (function (form) {
|
|
|
26109
26220
|
textAlign: 'right'
|
|
26110
26221
|
},
|
|
26111
26222
|
maxLength: 25,
|
|
26223
|
+
disabled: differenceInputStateEnabled,
|
|
26112
26224
|
loading: isCipher$1(changeField, 'priceIncludeTax'),
|
|
26113
26225
|
onChange: function onChange() {
|
|
26114
26226
|
setChangeField('priceIncludeTax');
|
|
@@ -26141,13 +26253,13 @@ var useColumns$1 = (function (form) {
|
|
|
26141
26253
|
message: '单价必须为数字'
|
|
26142
26254
|
}, {
|
|
26143
26255
|
validator: function () {
|
|
26144
|
-
var
|
|
26256
|
+
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
26145
26257
|
var isQuantity, isvalue;
|
|
26146
|
-
return _regeneratorRuntime().wrap(function
|
|
26258
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
26147
26259
|
while (1) {
|
|
26148
|
-
switch (
|
|
26260
|
+
switch (_context8.prev = _context8.next) {
|
|
26149
26261
|
case 0:
|
|
26150
|
-
|
|
26262
|
+
_context8.next = 2;
|
|
26151
26263
|
return controller.wait();
|
|
26152
26264
|
|
|
26153
26265
|
case 2:
|
|
@@ -26155,25 +26267,25 @@ var useColumns$1 = (function (form) {
|
|
|
26155
26267
|
isvalue = !!value || value === 0;
|
|
26156
26268
|
|
|
26157
26269
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
26158
|
-
|
|
26270
|
+
_context8.next = 6;
|
|
26159
26271
|
break;
|
|
26160
26272
|
}
|
|
26161
26273
|
|
|
26162
|
-
return
|
|
26274
|
+
return _context8.abrupt("return");
|
|
26163
26275
|
|
|
26164
26276
|
case 6:
|
|
26165
26277
|
callback('请输入单价');
|
|
26166
26278
|
|
|
26167
26279
|
case 7:
|
|
26168
26280
|
case "end":
|
|
26169
|
-
return
|
|
26281
|
+
return _context8.stop();
|
|
26170
26282
|
}
|
|
26171
26283
|
}
|
|
26172
|
-
},
|
|
26284
|
+
}, _callee8);
|
|
26173
26285
|
}));
|
|
26174
26286
|
|
|
26175
|
-
function validator(
|
|
26176
|
-
return
|
|
26287
|
+
function validator(_x9, _x10, _x11) {
|
|
26288
|
+
return _validator3.apply(this, arguments);
|
|
26177
26289
|
}
|
|
26178
26290
|
|
|
26179
26291
|
return validator;
|
|
@@ -26184,6 +26296,7 @@ var useColumns$1 = (function (form) {
|
|
|
26184
26296
|
textAlign: 'right'
|
|
26185
26297
|
},
|
|
26186
26298
|
maxLength: 25,
|
|
26299
|
+
disabled: differenceInputStateEnabled,
|
|
26187
26300
|
loading: isCipher$1(changeField, 'priceExcludeTax'),
|
|
26188
26301
|
onChange: function onChange() {
|
|
26189
26302
|
setChangeField('priceExcludeTax');
|
|
@@ -26219,10 +26332,10 @@ var useColumns$1 = (function (form) {
|
|
|
26219
26332
|
message: '金额错误,请重新输入'
|
|
26220
26333
|
}, {
|
|
26221
26334
|
validator: function () {
|
|
26222
|
-
var
|
|
26223
|
-
return _regeneratorRuntime().wrap(function
|
|
26335
|
+
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
26336
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
26224
26337
|
while (1) {
|
|
26225
|
-
switch (
|
|
26338
|
+
switch (_context9.prev = _context9.next) {
|
|
26226
26339
|
case 0:
|
|
26227
26340
|
if ("".concat(value).split('.')[0].length > priceIntegerDigit) {
|
|
26228
26341
|
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E".concat(priceIntegerDigit, "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D"));
|
|
@@ -26230,24 +26343,24 @@ var useColumns$1 = (function (form) {
|
|
|
26230
26343
|
|
|
26231
26344
|
case 1:
|
|
26232
26345
|
case "end":
|
|
26233
|
-
return
|
|
26346
|
+
return _context9.stop();
|
|
26234
26347
|
}
|
|
26235
26348
|
}
|
|
26236
|
-
},
|
|
26349
|
+
}, _callee9);
|
|
26237
26350
|
}));
|
|
26238
26351
|
|
|
26239
|
-
function validator(
|
|
26240
|
-
return
|
|
26352
|
+
function validator(_x12, _x13, _x14) {
|
|
26353
|
+
return _validator4.apply(this, arguments);
|
|
26241
26354
|
}
|
|
26242
26355
|
|
|
26243
26356
|
return validator;
|
|
26244
26357
|
}()
|
|
26245
26358
|
}, {
|
|
26246
26359
|
validator: function () {
|
|
26247
|
-
var
|
|
26248
|
-
return _regeneratorRuntime().wrap(function
|
|
26360
|
+
var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
26361
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
26249
26362
|
while (1) {
|
|
26250
|
-
switch (
|
|
26363
|
+
switch (_context10.prev = _context10.next) {
|
|
26251
26364
|
case 0:
|
|
26252
26365
|
if (deduction && parseFloat(value) <= deduction) {
|
|
26253
26366
|
callback('扣除额不能大于等于价税合计');
|
|
@@ -26255,14 +26368,14 @@ var useColumns$1 = (function (form) {
|
|
|
26255
26368
|
|
|
26256
26369
|
case 1:
|
|
26257
26370
|
case "end":
|
|
26258
|
-
return
|
|
26371
|
+
return _context10.stop();
|
|
26259
26372
|
}
|
|
26260
26373
|
}
|
|
26261
|
-
},
|
|
26374
|
+
}, _callee10);
|
|
26262
26375
|
}));
|
|
26263
26376
|
|
|
26264
|
-
function validator(
|
|
26265
|
-
return
|
|
26377
|
+
function validator(_x15, _x16, _x17) {
|
|
26378
|
+
return _validator5.apply(this, arguments);
|
|
26266
26379
|
}
|
|
26267
26380
|
|
|
26268
26381
|
return validator;
|
|
@@ -26273,10 +26386,33 @@ var useColumns$1 = (function (form) {
|
|
|
26273
26386
|
textAlign: 'right'
|
|
26274
26387
|
},
|
|
26275
26388
|
loading: isCipher$1(changeField, 'lineAmountIncludeTax'),
|
|
26389
|
+
readOnly: differenceInputStateEnabled,
|
|
26276
26390
|
onChange: function onChange() {
|
|
26277
26391
|
setChangeField('lineAmountIncludeTax');
|
|
26278
26392
|
onChangeLineAmountIncludeTax$1(controller, form, record);
|
|
26279
|
-
}
|
|
26393
|
+
},
|
|
26394
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
26395
|
+
controller.run( /*#__PURE__*/function () {
|
|
26396
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
|
|
26397
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
26398
|
+
while (1) {
|
|
26399
|
+
switch (_context11.prev = _context11.next) {
|
|
26400
|
+
case 0:
|
|
26401
|
+
s.differenceInputState.open = true;
|
|
26402
|
+
|
|
26403
|
+
case 1:
|
|
26404
|
+
case "end":
|
|
26405
|
+
return _context11.stop();
|
|
26406
|
+
}
|
|
26407
|
+
}
|
|
26408
|
+
}, _callee11);
|
|
26409
|
+
}));
|
|
26410
|
+
|
|
26411
|
+
return function (_x18) {
|
|
26412
|
+
return _ref3.apply(this, arguments);
|
|
26413
|
+
};
|
|
26414
|
+
}());
|
|
26415
|
+
} : undefined
|
|
26280
26416
|
})));
|
|
26281
26417
|
} else {
|
|
26282
26418
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -26307,7 +26443,7 @@ var useColumns$1 = (function (form) {
|
|
|
26307
26443
|
message: '金额错误,请重新输入'
|
|
26308
26444
|
}, {
|
|
26309
26445
|
validator: function () {
|
|
26310
|
-
var
|
|
26446
|
+
var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_, value, callback) {
|
|
26311
26447
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
26312
26448
|
while (1) {
|
|
26313
26449
|
switch (_context12.prev = _context12.next) {
|
|
@@ -26324,8 +26460,8 @@ var useColumns$1 = (function (form) {
|
|
|
26324
26460
|
}, _callee12);
|
|
26325
26461
|
}));
|
|
26326
26462
|
|
|
26327
|
-
function validator(
|
|
26328
|
-
return
|
|
26463
|
+
function validator(_x19, _x20, _x21) {
|
|
26464
|
+
return _validator6.apply(this, arguments);
|
|
26329
26465
|
}
|
|
26330
26466
|
|
|
26331
26467
|
return validator;
|
|
@@ -26336,10 +26472,33 @@ var useColumns$1 = (function (form) {
|
|
|
26336
26472
|
textAlign: 'right'
|
|
26337
26473
|
},
|
|
26338
26474
|
loading: isCipher$1(changeField, 'lineAmountExcludeTax'),
|
|
26475
|
+
readOnly: differenceInputStateEnabled,
|
|
26339
26476
|
onChange: function onChange() {
|
|
26340
26477
|
setChangeField('lineAmountExcludeTax');
|
|
26341
26478
|
onChangeLineAmountExcludeTax$1(controller, form, record);
|
|
26342
|
-
}
|
|
26479
|
+
},
|
|
26480
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
26481
|
+
controller.run( /*#__PURE__*/function () {
|
|
26482
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
|
|
26483
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
26484
|
+
while (1) {
|
|
26485
|
+
switch (_context13.prev = _context13.next) {
|
|
26486
|
+
case 0:
|
|
26487
|
+
s.differenceInputState.open = true;
|
|
26488
|
+
|
|
26489
|
+
case 1:
|
|
26490
|
+
case "end":
|
|
26491
|
+
return _context13.stop();
|
|
26492
|
+
}
|
|
26493
|
+
}
|
|
26494
|
+
}, _callee13);
|
|
26495
|
+
}));
|
|
26496
|
+
|
|
26497
|
+
return function (_x22) {
|
|
26498
|
+
return _ref4.apply(this, arguments);
|
|
26499
|
+
};
|
|
26500
|
+
}());
|
|
26501
|
+
} : undefined
|
|
26343
26502
|
})));
|
|
26344
26503
|
} else {
|
|
26345
26504
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -26421,12 +26580,12 @@ var useColumns$1 = (function (form) {
|
|
|
26421
26580
|
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
26422
26581
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
26423
26582
|
|
|
26583
|
+
var deduction = controller.state.goodsListState.deduction || 0;
|
|
26424
26584
|
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
26425
26585
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
26426
26586
|
|
|
26427
26587
|
if (lineAmountExcludeTax && (taxRate || taxRate === 0) && lineAmountIncludeTax) {
|
|
26428
|
-
|
|
26429
|
-
var total = chain$1(bignumber(lineAmountExcludeTax)).multiply(bignumber(taxRate || 0)).divide(bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
26588
|
+
var total = chain$1(bignumber(lineAmountExcludeTax)).subtract(bignumber(deduction || 0)).multiply(bignumber(taxRate || 0)).divide(bignumber(100));
|
|
26430
26589
|
|
|
26431
26590
|
if (Math.abs(total.subtract(bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
26432
26591
|
callback();
|
|
@@ -26488,7 +26647,7 @@ var useColumns$1 = (function (form) {
|
|
|
26488
26647
|
ellipsis: true
|
|
26489
26648
|
});
|
|
26490
26649
|
});
|
|
26491
|
-
}, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType]); // React.useEffect(() => {
|
|
26650
|
+
}, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType, differenceInputStateEnabled]); // React.useEffect(() => {
|
|
26492
26651
|
// clearTimeout(t)
|
|
26493
26652
|
// const t = setTimeout(() => { setChangeField('') }, 1000);
|
|
26494
26653
|
// return () => { clearTimeout(t) }
|
|
@@ -26817,6 +26976,9 @@ function useWindowClick$1(controller) {
|
|
|
26817
26976
|
/** 点击组件外部 保存正在编辑的货物 */
|
|
26818
26977
|
React.useEffect(function () {
|
|
26819
26978
|
var click = function click() {
|
|
26979
|
+
var _controller$state$goo;
|
|
26980
|
+
|
|
26981
|
+
if (!((_controller$state$goo = controller.state.goodsListState) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.isSaveRowOutside)) return;
|
|
26820
26982
|
setTimeout(controller.saveEditGood);
|
|
26821
26983
|
};
|
|
26822
26984
|
|
|
@@ -36952,8 +37114,49 @@ var VoucherType;
|
|
|
36952
37114
|
|
|
36953
37115
|
VoucherType["OTHER_DEDUCTION_VOUCHER"] = "09";
|
|
36954
37116
|
})(VoucherType || (VoucherType = {}));
|
|
36955
|
-
/**
|
|
37117
|
+
/** 最多只允许输入两位小数的校验器 */
|
|
37118
|
+
|
|
37119
|
+
|
|
37120
|
+
var maxTwoDecimalsValidator = function maxTwoDecimalsValidator(_rule, value) {
|
|
37121
|
+
if (value === undefined || value === null || value === '') {
|
|
37122
|
+
return Promise.resolve();
|
|
37123
|
+
}
|
|
37124
|
+
|
|
37125
|
+
var decimalPart = String(value).split('.')[1];
|
|
37126
|
+
|
|
37127
|
+
if (decimalPart && decimalPart.length > 2) {
|
|
37128
|
+
return Promise.reject(new Error('最多只能输入2位小数'));
|
|
37129
|
+
}
|
|
37130
|
+
|
|
37131
|
+
return Promise.resolve();
|
|
37132
|
+
};
|
|
37133
|
+
/** 凭证明细表单实例(用于跨字段校验:本次扣除金额 <= 凭证合计金额) */
|
|
37134
|
+
|
|
37135
|
+
var formInstance;
|
|
37136
|
+
/**
|
|
37137
|
+
* 本次扣除金额不能大于凭证合计金额的校验器
|
|
37138
|
+
*/
|
|
36956
37139
|
|
|
37140
|
+
var deductAmtNotExceedVoucherTotalValidator = function deductAmtNotExceedVoucherTotalValidator(_rule, value) {
|
|
37141
|
+
var _formInstance;
|
|
37142
|
+
|
|
37143
|
+
if (value === undefined || value === null || value === '') {
|
|
37144
|
+
return Promise.resolve();
|
|
37145
|
+
}
|
|
37146
|
+
|
|
37147
|
+
var voucherTotalAmt = (_formInstance = formInstance) === null || _formInstance === void 0 ? void 0 : _formInstance.getFieldValue('voucherTotalAmt');
|
|
37148
|
+
|
|
37149
|
+
if (voucherTotalAmt === undefined || voucherTotalAmt === null || voucherTotalAmt === '') {
|
|
37150
|
+
return Promise.resolve();
|
|
37151
|
+
}
|
|
37152
|
+
|
|
37153
|
+
if (Number(value) > Number(voucherTotalAmt)) {
|
|
37154
|
+
return Promise.reject(new Error('本次扣除金额不能大于凭证合计金额'));
|
|
37155
|
+
}
|
|
37156
|
+
|
|
37157
|
+
return Promise.resolve();
|
|
37158
|
+
};
|
|
37159
|
+
/** 凭证类型候选项 */
|
|
36957
37160
|
|
|
36958
37161
|
var voucherTypeOptions = [{
|
|
36959
37162
|
value: VoucherType.SPECIAL_INVOICE,
|
|
@@ -37138,19 +37341,36 @@ function DifferenceInputModal(props) {
|
|
|
37138
37341
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
37139
37342
|
form = _Form$useForm2[0];
|
|
37140
37343
|
|
|
37344
|
+
var _Form$useForm3 = Form$2.useForm(),
|
|
37345
|
+
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
37346
|
+
topForm = _Form$useForm4[0];
|
|
37347
|
+
/** 记录表单实例,供跨字段校验使用 */
|
|
37348
|
+
|
|
37349
|
+
|
|
37350
|
+
React.useEffect(function () {
|
|
37351
|
+
formInstance = form;
|
|
37352
|
+
return function () {
|
|
37353
|
+
formInstance = undefined;
|
|
37354
|
+
};
|
|
37355
|
+
}, [form]);
|
|
37356
|
+
|
|
37141
37357
|
var _React$useState = React.useState([]),
|
|
37142
37358
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
37143
37359
|
dataSource = _React$useState2[0],
|
|
37144
37360
|
setDataSource = _React$useState2[1];
|
|
37145
37361
|
|
|
37146
37362
|
var voucherType = Form$2.useWatch('voucherType', form) || form.getFieldValue('voucherType');
|
|
37363
|
+
var projectCode = Form$2.useWatch('projectCode', topForm) || topForm.getFieldValue('projectCode');
|
|
37364
|
+
/** 凭证合计金额(用于联动校验本次扣除金额) */
|
|
37147
37365
|
|
|
37148
|
-
var
|
|
37149
|
-
|
|
37150
|
-
projectCode = _React$useState4[0],
|
|
37151
|
-
setProjectCode = _React$useState4[1];
|
|
37152
|
-
/** 扣除额 (明细汇总) */
|
|
37366
|
+
var voucherTotalAmt = Form$2.useWatch('voucherTotalAmt', form);
|
|
37367
|
+
/** 凭证合计金额变化时,重新校验本次扣除金额 */
|
|
37153
37368
|
|
|
37369
|
+
React.useEffect(function () {
|
|
37370
|
+
if (!form.isFieldTouched('currentDeductAmt')) return;
|
|
37371
|
+
form.validateFields(['currentDeductAmt']).catch(function () {});
|
|
37372
|
+
}, [form, voucherTotalAmt]);
|
|
37373
|
+
/** 扣除额 (明细汇总) */
|
|
37154
37374
|
|
|
37155
37375
|
var deductTotal = React.useMemo(function () {
|
|
37156
37376
|
return dataSource.reduce(function (acc, curr) {
|
|
@@ -37165,8 +37385,8 @@ function DifferenceInputModal(props) {
|
|
|
37165
37385
|
}, 0);
|
|
37166
37386
|
}, [dataSource]);
|
|
37167
37387
|
var total = props.total || {
|
|
37168
|
-
voucherTotal:
|
|
37169
|
-
deductTotal:
|
|
37388
|
+
voucherTotal: voucherTotal,
|
|
37389
|
+
deductTotal: deductTotal
|
|
37170
37390
|
};
|
|
37171
37391
|
var onFinish = React.useCallback(function (values) {
|
|
37172
37392
|
setDataSource([].concat(_toConsumableArray(dataSource), [_objectSpread2(_objectSpread2({}, values), {}, {
|
|
@@ -37175,15 +37395,42 @@ function DifferenceInputModal(props) {
|
|
|
37175
37395
|
})]));
|
|
37176
37396
|
form.resetFields();
|
|
37177
37397
|
}, [dataSource, form]);
|
|
37398
|
+
var onOkClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37399
|
+
var values;
|
|
37400
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37401
|
+
while (1) {
|
|
37402
|
+
switch (_context.prev = _context.next) {
|
|
37403
|
+
case 0:
|
|
37404
|
+
_context.next = 2;
|
|
37405
|
+
return topForm.validateFields();
|
|
37406
|
+
|
|
37407
|
+
case 2:
|
|
37408
|
+
values = _context.sent;
|
|
37409
|
+
onOk === null || onOk === void 0 ? void 0 : onOk(_objectSpread2(_objectSpread2({}, values), {}, {
|
|
37410
|
+
deductTotal: deductTotal,
|
|
37411
|
+
rows: dataSource
|
|
37412
|
+
}));
|
|
37413
|
+
|
|
37414
|
+
case 4:
|
|
37415
|
+
case "end":
|
|
37416
|
+
return _context.stop();
|
|
37417
|
+
}
|
|
37418
|
+
}
|
|
37419
|
+
}, _callee);
|
|
37420
|
+
})), [dataSource, onOk]);
|
|
37178
37421
|
React.useEffect(function () {
|
|
37179
37422
|
console.log('DifferenceInputModal props.value ===>', props.value);
|
|
37180
37423
|
|
|
37181
37424
|
if (open) {
|
|
37182
|
-
var _props$value, _props$value2;
|
|
37425
|
+
var _props$value, _props$value2, _props$value3;
|
|
37183
37426
|
|
|
37184
37427
|
form.resetFields();
|
|
37185
|
-
|
|
37186
|
-
|
|
37428
|
+
topForm.resetFields();
|
|
37429
|
+
topForm.setFieldsValue({
|
|
37430
|
+
amountIncludeTax: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.amountIncludeTax,
|
|
37431
|
+
projectCode: (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.projectCode
|
|
37432
|
+
});
|
|
37433
|
+
setDataSource(((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.rows) || []);
|
|
37187
37434
|
}
|
|
37188
37435
|
}, [open, props.value]);
|
|
37189
37436
|
return /*#__PURE__*/React.createElement(Modal$2, {
|
|
@@ -37199,20 +37446,14 @@ function DifferenceInputModal(props) {
|
|
|
37199
37446
|
onClick: onCancel
|
|
37200
37447
|
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button$1, {
|
|
37201
37448
|
type: "primary",
|
|
37202
|
-
onClick:
|
|
37203
|
-
return onOk === null || onOk === void 0 ? void 0 : onOk({
|
|
37204
|
-
voucherTotal: voucherTotal,
|
|
37205
|
-
deductTotal: deductTotal,
|
|
37206
|
-
rows: dataSource,
|
|
37207
|
-
projectCode: projectCode
|
|
37208
|
-
});
|
|
37209
|
-
}
|
|
37449
|
+
onClick: onOkClick
|
|
37210
37450
|
}, "\u786E\u5B9A"))
|
|
37211
37451
|
}, /*#__PURE__*/React.createElement("div", {
|
|
37212
37452
|
className: "kts-difference-modal"
|
|
37213
37453
|
}, /*#__PURE__*/React.createElement("div", {
|
|
37214
37454
|
className: "kts-difference-modal-top"
|
|
37215
37455
|
}, /*#__PURE__*/React.createElement(Form$2, {
|
|
37456
|
+
form: topForm,
|
|
37216
37457
|
layout: 'horizontal',
|
|
37217
37458
|
className: "kts-difference-modal-top-form",
|
|
37218
37459
|
labelCol: {
|
|
@@ -37221,15 +37462,20 @@ function DifferenceInputModal(props) {
|
|
|
37221
37462
|
}, /*#__PURE__*/React.createElement(Row$1, null, /*#__PURE__*/React.createElement(Col$1, {
|
|
37222
37463
|
span: 12
|
|
37223
37464
|
}, /*#__PURE__*/React.createElement(Form$2.Item, {
|
|
37465
|
+
name: 'amountIncludeTax',
|
|
37224
37466
|
label: "\u542B\u7A0E\u9500\u552E\u989D",
|
|
37225
|
-
className: "kts-difference-modal-item"
|
|
37467
|
+
className: "kts-difference-modal-item",
|
|
37468
|
+
rules: [{
|
|
37469
|
+
required: true,
|
|
37470
|
+
message: '请输入含税销售额'
|
|
37471
|
+
}, {
|
|
37472
|
+
validator: maxTwoDecimalsValidator
|
|
37473
|
+
}]
|
|
37226
37474
|
}, /*#__PURE__*/React.createElement(InputNumber$1, {
|
|
37227
37475
|
style: {
|
|
37228
37476
|
width: '100%'
|
|
37229
37477
|
},
|
|
37230
|
-
|
|
37231
|
-
placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D",
|
|
37232
|
-
value: voucherTotal || 0
|
|
37478
|
+
placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D"
|
|
37233
37479
|
}))), /*#__PURE__*/React.createElement(Col$1, {
|
|
37234
37480
|
span: 12
|
|
37235
37481
|
}, /*#__PURE__*/React.createElement(Form$2.Item, {
|
|
@@ -37245,15 +37491,16 @@ function DifferenceInputModal(props) {
|
|
|
37245
37491
|
}))), /*#__PURE__*/React.createElement(Col$1, {
|
|
37246
37492
|
span: 24
|
|
37247
37493
|
}, /*#__PURE__*/React.createElement(Form$2.Item, {
|
|
37494
|
+
name: 'projectCode',
|
|
37248
37495
|
label: "\u7533\u62A5\u9879\u76EE\u540D\u79F0",
|
|
37249
|
-
className: "kts-difference-modal-item"
|
|
37496
|
+
className: "kts-difference-modal-item",
|
|
37497
|
+
rules: [{
|
|
37498
|
+
required: true,
|
|
37499
|
+
message: '请选择申报项目名称'
|
|
37500
|
+
}]
|
|
37250
37501
|
}, /*#__PURE__*/React.createElement(Select$2, {
|
|
37251
37502
|
options: projectOptions,
|
|
37252
|
-
placeholder: "\u8BF7\u9009\u62E9\u7533\u62A5\u9879\u76EE\u540D\u79F0"
|
|
37253
|
-
onChange: function onChange(value) {
|
|
37254
|
-
setProjectCode(value);
|
|
37255
|
-
},
|
|
37256
|
-
value: projectCode
|
|
37503
|
+
placeholder: "\u8BF7\u9009\u62E9\u7533\u62A5\u9879\u76EE\u540D\u79F0"
|
|
37257
37504
|
}))), /*#__PURE__*/React.createElement(Col$1, {
|
|
37258
37505
|
span: 24
|
|
37259
37506
|
}, /*#__PURE__*/React.createElement(Form$2.Item, {
|
|
@@ -37337,7 +37584,9 @@ function DifferenceInputModal(props) {
|
|
|
37337
37584
|
name: 'voucherTotalAmt',
|
|
37338
37585
|
label: "\u51ED\u8BC1\u5408\u8BA1\u91D1\u989D",
|
|
37339
37586
|
className: "kts-difference-modal-cell",
|
|
37340
|
-
rules: (_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']
|
|
37587
|
+
rules: [].concat(_toConsumableArray(((_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']) || []), [{
|
|
37588
|
+
validator: maxTwoDecimalsValidator
|
|
37589
|
+
}])
|
|
37341
37590
|
}, /*#__PURE__*/React.createElement(InputNumber$1, {
|
|
37342
37591
|
style: {
|
|
37343
37592
|
width: '100%'
|
|
@@ -37349,7 +37598,11 @@ function DifferenceInputModal(props) {
|
|
|
37349
37598
|
name: 'currentDeductAmt',
|
|
37350
37599
|
label: "\u672C\u6B21\u6263\u9664\u91D1\u989D",
|
|
37351
37600
|
className: "kts-difference-modal-cell",
|
|
37352
|
-
rules: (_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']
|
|
37601
|
+
rules: [].concat(_toConsumableArray(((_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']) || []), [{
|
|
37602
|
+
validator: maxTwoDecimalsValidator
|
|
37603
|
+
}, {
|
|
37604
|
+
validator: deductAmtNotExceedVoucherTotalValidator
|
|
37605
|
+
}])
|
|
37353
37606
|
}, /*#__PURE__*/React.createElement(InputNumber$1, {
|
|
37354
37607
|
style: {
|
|
37355
37608
|
width: '100%'
|
|
@@ -37378,7 +37631,7 @@ function DifferenceInputModal(props) {
|
|
|
37378
37631
|
onClick: function onClick() {
|
|
37379
37632
|
return form.resetFields();
|
|
37380
37633
|
}
|
|
37381
|
-
}, "\u6E05\
|
|
37634
|
+
}, "\u6E05\u9664"), /*#__PURE__*/React.createElement(Button$1, {
|
|
37382
37635
|
type: 'primary',
|
|
37383
37636
|
size: 'small',
|
|
37384
37637
|
onClick: function onClick() {
|
|
@@ -37440,64 +37693,193 @@ var DifferenceInput = (function () {
|
|
|
37440
37693
|
var data = controller.useMemo(function (s) {
|
|
37441
37694
|
return s.differenceInputState.data;
|
|
37442
37695
|
}, []);
|
|
37696
|
+
/** 计算中启动字段 */
|
|
37697
|
+
|
|
37698
|
+
var setChangeField = React.useCallback(function (value) {
|
|
37699
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37700
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
37701
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37702
|
+
while (1) {
|
|
37703
|
+
switch (_context.prev = _context.next) {
|
|
37704
|
+
case 0:
|
|
37705
|
+
s.calculatingField = value;
|
|
37706
|
+
|
|
37707
|
+
case 1:
|
|
37708
|
+
case "end":
|
|
37709
|
+
return _context.stop();
|
|
37710
|
+
}
|
|
37711
|
+
}
|
|
37712
|
+
}, _callee);
|
|
37713
|
+
}));
|
|
37714
|
+
|
|
37715
|
+
return function (_x) {
|
|
37716
|
+
return _ref.apply(this, arguments);
|
|
37717
|
+
};
|
|
37718
|
+
}());
|
|
37719
|
+
}, []);
|
|
37443
37720
|
var value = React.useMemo(function () {
|
|
37721
|
+
var _controller$state$goo;
|
|
37722
|
+
|
|
37444
37723
|
return {
|
|
37445
37724
|
rows: (data === null || data === void 0 ? void 0 : data.rows) || [],
|
|
37446
37725
|
projectCode: (data === null || data === void 0 ? void 0 : data.projectCode) || '',
|
|
37447
|
-
|
|
37448
|
-
|
|
37726
|
+
deductTotal: (data === null || data === void 0 ? void 0 : data.deductTotal) || 0,
|
|
37727
|
+
amountIncludeTax: ((_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.getFieldValue('lineAmountIncludeTax')) || 0
|
|
37449
37728
|
};
|
|
37450
37729
|
}, [data, open]);
|
|
37451
|
-
|
|
37452
|
-
|
|
37453
|
-
|
|
37454
|
-
open
|
|
37455
|
-
onCancel: function onCancel() {
|
|
37730
|
+
React.useEffect(function () {
|
|
37731
|
+
controller.state.goodsListState.isSaveRowOutside = !open;
|
|
37732
|
+
|
|
37733
|
+
if (open) {
|
|
37456
37734
|
controller.run( /*#__PURE__*/function () {
|
|
37457
|
-
var
|
|
37458
|
-
|
|
37735
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
37736
|
+
var _s$goodsListState$for;
|
|
37737
|
+
|
|
37738
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
37459
37739
|
while (1) {
|
|
37460
|
-
switch (
|
|
37740
|
+
switch (_context2.prev = _context2.next) {
|
|
37461
37741
|
case 0:
|
|
37462
|
-
s.differenceInputState.
|
|
37742
|
+
if (s.differenceInputState.data) {
|
|
37743
|
+
_context2.next = 2;
|
|
37744
|
+
break;
|
|
37745
|
+
}
|
|
37463
37746
|
|
|
37464
|
-
|
|
37747
|
+
return _context2.abrupt("return");
|
|
37748
|
+
|
|
37749
|
+
case 2:
|
|
37750
|
+
s.differenceInputState.data.amountIncludeTax = (_s$goodsListState$for = s.goodsListState.form) === null || _s$goodsListState$for === void 0 ? void 0 : _s$goodsListState$for.getFieldValue('lineAmountIncludeTax');
|
|
37751
|
+
|
|
37752
|
+
case 3:
|
|
37465
37753
|
case "end":
|
|
37466
|
-
return
|
|
37754
|
+
return _context2.stop();
|
|
37467
37755
|
}
|
|
37468
37756
|
}
|
|
37469
|
-
},
|
|
37757
|
+
}, _callee2);
|
|
37470
37758
|
}));
|
|
37471
37759
|
|
|
37472
|
-
return function (
|
|
37473
|
-
return
|
|
37760
|
+
return function (_x2) {
|
|
37761
|
+
return _ref2.apply(this, arguments);
|
|
37474
37762
|
};
|
|
37475
37763
|
}());
|
|
37476
|
-
}
|
|
37477
|
-
|
|
37764
|
+
}
|
|
37765
|
+
}, [open]);
|
|
37766
|
+
console.log('DifferenceInput data ===>', data);
|
|
37767
|
+
return /*#__PURE__*/React.createElement(DifferenceInputModal, {
|
|
37768
|
+
value: value,
|
|
37769
|
+
open: open,
|
|
37770
|
+
onCancel: function onCancel() {
|
|
37478
37771
|
controller.run( /*#__PURE__*/function () {
|
|
37479
|
-
var
|
|
37480
|
-
return _regeneratorRuntime().wrap(function
|
|
37772
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
37773
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
37481
37774
|
while (1) {
|
|
37482
|
-
switch (
|
|
37775
|
+
switch (_context3.prev = _context3.next) {
|
|
37483
37776
|
case 0:
|
|
37484
|
-
s.differenceInputState.data = data;
|
|
37485
|
-
s.goodsListState.deduction = data.deductTotal;
|
|
37486
37777
|
s.differenceInputState.open = false;
|
|
37487
37778
|
|
|
37488
|
-
case
|
|
37779
|
+
case 1:
|
|
37489
37780
|
case "end":
|
|
37490
|
-
return
|
|
37781
|
+
return _context3.stop();
|
|
37491
37782
|
}
|
|
37492
37783
|
}
|
|
37493
|
-
},
|
|
37784
|
+
}, _callee3);
|
|
37494
37785
|
}));
|
|
37495
37786
|
|
|
37496
|
-
return function (
|
|
37497
|
-
return
|
|
37787
|
+
return function (_x3) {
|
|
37788
|
+
return _ref3.apply(this, arguments);
|
|
37498
37789
|
};
|
|
37499
37790
|
}());
|
|
37500
|
-
}
|
|
37791
|
+
},
|
|
37792
|
+
onOk: function () {
|
|
37793
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data) {
|
|
37794
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
37795
|
+
while (1) {
|
|
37796
|
+
switch (_context6.prev = _context6.next) {
|
|
37797
|
+
case 0:
|
|
37798
|
+
_context6.next = 2;
|
|
37799
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37800
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
37801
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
37802
|
+
while (1) {
|
|
37803
|
+
switch (_context4.prev = _context4.next) {
|
|
37804
|
+
case 0:
|
|
37805
|
+
s.goodsListState.isTaxIncluded = true;
|
|
37806
|
+
|
|
37807
|
+
case 1:
|
|
37808
|
+
case "end":
|
|
37809
|
+
return _context4.stop();
|
|
37810
|
+
}
|
|
37811
|
+
}
|
|
37812
|
+
}, _callee4);
|
|
37813
|
+
}));
|
|
37814
|
+
|
|
37815
|
+
return function (_x5) {
|
|
37816
|
+
return _ref4.apply(this, arguments);
|
|
37817
|
+
};
|
|
37818
|
+
}());
|
|
37819
|
+
|
|
37820
|
+
case 2:
|
|
37821
|
+
_context6.next = 4;
|
|
37822
|
+
return controller.wait();
|
|
37823
|
+
|
|
37824
|
+
case 4:
|
|
37825
|
+
_context6.next = 6;
|
|
37826
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37827
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
37828
|
+
var amountIncludeTax, form, record, _s$goodsListState$for2;
|
|
37829
|
+
|
|
37830
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
37831
|
+
while (1) {
|
|
37832
|
+
switch (_context5.prev = _context5.next) {
|
|
37833
|
+
case 0:
|
|
37834
|
+
s.differenceInputState.data = data;
|
|
37835
|
+
s.goodsListState.deduction = data.deductTotal;
|
|
37836
|
+
s.differenceInputState.open = false;
|
|
37837
|
+
s.differenceInputState.amountIncludeTax = data.amountIncludeTax;
|
|
37838
|
+
amountIncludeTax = data.amountIncludeTax || 0; // const deductTotal = data.deductTotal || 0;
|
|
37839
|
+
|
|
37840
|
+
form = s.goodsListState.form;
|
|
37841
|
+
record = s.goodsListState.editGood;
|
|
37842
|
+
|
|
37843
|
+
if (!(s.goodsListState.goodsList && s.goodsListState.goodsList.length > 0)) {
|
|
37844
|
+
_context5.next = 13;
|
|
37845
|
+
break;
|
|
37846
|
+
}
|
|
37847
|
+
|
|
37848
|
+
s.goodsListState.editGood = record;
|
|
37849
|
+
(_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.setFieldsValue({
|
|
37850
|
+
lineAmountIncludeTax: amountIncludeTax
|
|
37851
|
+
});
|
|
37852
|
+
setChangeField('lineAmountIncludeTax');
|
|
37853
|
+
_context5.next = 13;
|
|
37854
|
+
return onChangeLineAmountIncludeTax(controller, form, record);
|
|
37855
|
+
|
|
37856
|
+
case 13:
|
|
37857
|
+
case "end":
|
|
37858
|
+
return _context5.stop();
|
|
37859
|
+
}
|
|
37860
|
+
}
|
|
37861
|
+
}, _callee5);
|
|
37862
|
+
}));
|
|
37863
|
+
|
|
37864
|
+
return function (_x6) {
|
|
37865
|
+
return _ref5.apply(this, arguments);
|
|
37866
|
+
};
|
|
37867
|
+
}());
|
|
37868
|
+
|
|
37869
|
+
case 6:
|
|
37870
|
+
case "end":
|
|
37871
|
+
return _context6.stop();
|
|
37872
|
+
}
|
|
37873
|
+
}
|
|
37874
|
+
}, _callee6);
|
|
37875
|
+
}));
|
|
37876
|
+
|
|
37877
|
+
function onOk(_x4) {
|
|
37878
|
+
return _onOk.apply(this, arguments);
|
|
37879
|
+
}
|
|
37880
|
+
|
|
37881
|
+
return onOk;
|
|
37882
|
+
}()
|
|
37501
37883
|
});
|
|
37502
37884
|
});
|
|
37503
37885
|
|
|
@@ -37609,7 +37991,8 @@ var Main$7 = function Main(props) {
|
|
|
37609
37991
|
key = _React$useState2[0],
|
|
37610
37992
|
setKey = _React$useState2[1];
|
|
37611
37993
|
|
|
37612
|
-
useToGenerateId(controller);
|
|
37994
|
+
useToGenerateId(controller);
|
|
37995
|
+
useRecalculateTax(controller); // useClearGoodsList(controller);
|
|
37613
37996
|
|
|
37614
37997
|
React.useEffect(function () {
|
|
37615
37998
|
setKey(key + 1);
|
|
@@ -37664,7 +38047,8 @@ var Digtal = function Digtal(props) {
|
|
|
37664
38047
|
key = _React$useState4[0],
|
|
37665
38048
|
setKey = _React$useState4[1];
|
|
37666
38049
|
|
|
37667
|
-
useToGenerateId(controller);
|
|
38050
|
+
useToGenerateId(controller);
|
|
38051
|
+
useRecalculateTax(controller); // useClearGoodsList(controller);
|
|
37668
38052
|
|
|
37669
38053
|
React.useEffect(function () {
|
|
37670
38054
|
setKey(key + 1);
|