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.js
CHANGED
|
@@ -864,10 +864,11 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
|
|
|
864
864
|
|
|
865
865
|
case 27:
|
|
866
866
|
_values.set('goodsList', this.state.goodsListState.goodsList.slice().map(function (e) {
|
|
867
|
-
var _this3$state, _this3$state$differen, _this3$state$differen2;
|
|
867
|
+
var _this3$state, _this3$state$differen, _this3$state$differen2, _this3$state2, _this3$state2$differe, _this3$state2$differe2;
|
|
868
868
|
|
|
869
869
|
return _objectSpread2(_objectSpread2({}, e), {}, {
|
|
870
|
-
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
|
|
870
|
+
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,
|
|
871
|
+
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
|
|
871
872
|
});
|
|
872
873
|
})); //货物运输列表
|
|
873
874
|
|
|
@@ -1253,6 +1254,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1253
1254
|
this.isValidateGood = true;
|
|
1254
1255
|
this.isValidateMeiTan = true;
|
|
1255
1256
|
this.meiTanGoodIndex = [];
|
|
1257
|
+
this.isSaveRowOutside = true;
|
|
1256
1258
|
|
|
1257
1259
|
this.verifyMeiTanFn = /*#__PURE__*/function () {
|
|
1258
1260
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
|
|
@@ -1664,6 +1666,7 @@ var DifferenceInputState = /*#__PURE__*/_createClass(function DifferenceInputSta
|
|
|
1664
1666
|
this.enabled = false;
|
|
1665
1667
|
this.open = false;
|
|
1666
1668
|
this.data = void 0;
|
|
1669
|
+
this.amountIncludeTax = void 0;
|
|
1667
1670
|
});
|
|
1668
1671
|
|
|
1669
1672
|
var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControllerState() {
|
|
@@ -2303,7 +2306,7 @@ function countAmountIncludeTax(quantity, priceIncludeTax, calculatingDigits) {
|
|
|
2303
2306
|
return parseFloat(mathjs.chain(mathjs.bignumber(priceIncludeTax)).multiply(mathjs.bignumber(quantity)).done().toNumber().toFixed(2)); // return parseFloat(evaluate(`${priceIncludeTax} * ${quantity}`).toFixed(2));
|
|
2304
2307
|
}
|
|
2305
2308
|
/**
|
|
2306
|
-
* 不含税金额 =
|
|
2309
|
+
* 不含税金额 = 含税金额 - 税额
|
|
2307
2310
|
* @param amountIncludeTax 含税金额
|
|
2308
2311
|
* @param taxAmount 税额
|
|
2309
2312
|
* @returns 不含税金额
|
|
@@ -2324,10 +2327,9 @@ function countAmountExcludeTax(amountIncludeTax, taxAmount) {
|
|
|
2324
2327
|
|
|
2325
2328
|
function countTaxAmount(amountIncludeTax, deduction, taxRate) {
|
|
2326
2329
|
if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
|
|
2327
|
-
if (!deduction && deduction !== 0) return undefined;
|
|
2328
2330
|
if (!taxRate && taxRate !== 0) return undefined;
|
|
2329
2331
|
var taxRateBu = mathjs.chain(mathjs.bignumber(taxRate)).divide(mathjs.bignumber(100)).done();
|
|
2330
|
-
return parseFloat(mathjs.chain(mathjs.bignumber(amountIncludeTax)).subtract(mathjs.bignumber(deduction)).divide(mathjs.chain(mathjs.bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
|
|
2332
|
+
return parseFloat(mathjs.chain(mathjs.bignumber(amountIncludeTax)).subtract(mathjs.bignumber(deduction || 0)).divide(mathjs.chain(mathjs.bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
|
|
2331
2333
|
}
|
|
2332
2334
|
/**
|
|
2333
2335
|
* 单价 = 金额/数量
|
|
@@ -9987,6 +9989,7 @@ var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
|
9987
9989
|
/** 税率 */
|
|
9988
9990
|
|
|
9989
9991
|
var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
9992
|
+
console.log('计算税率===>');
|
|
9990
9993
|
form.validateFields( /*#__PURE__*/function () {
|
|
9991
9994
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
|
|
9992
9995
|
var taxRate;
|
|
@@ -10130,7 +10133,7 @@ var updateUnitPriceExcludingTax = /*#__PURE__*/function () {
|
|
|
10130
10133
|
/** 税额 */
|
|
10131
10134
|
|
|
10132
10135
|
/** 扣除额 */
|
|
10133
|
-
deduction = controller.state.goodsListState.deduction;
|
|
10136
|
+
deduction = controller.state.goodsListState.deduction || 0;
|
|
10134
10137
|
editGood = controller.state.goodsListState.editGood; // 计算税额
|
|
10135
10138
|
|
|
10136
10139
|
if (!promptErr(err.lineAmountIncludeTax) && !promptErr(err.taxRate)) {
|
|
@@ -11088,6 +11091,143 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
|
|
|
11088
11091
|
return _createClass(InvoiceController);
|
|
11089
11092
|
}(InvoiceControllerForm);
|
|
11090
11093
|
|
|
11094
|
+
/** 切换是否启用差额开票重新计算税额 */
|
|
11095
|
+
|
|
11096
|
+
var useRecalculateTax = function useRecalculateTax(invoiceController) {
|
|
11097
|
+
var differenceInputEnabled = invoiceController.useMemo(function (s) {
|
|
11098
|
+
return s.differenceInputState.enabled;
|
|
11099
|
+
}, []);
|
|
11100
|
+
React__default['default'].useEffect(function () {
|
|
11101
|
+
console.log('切换是否启用差额开票重新计算税额 - 重新计算税额===>');
|
|
11102
|
+
|
|
11103
|
+
if (invoiceController.state.goodsListState.editGood) {
|
|
11104
|
+
var editGood = invoiceController.state.goodsListState.editGood;
|
|
11105
|
+
var form = invoiceController.state.goodsListState.form;
|
|
11106
|
+
var isTaxIncluded = invoiceController.state.goodsListState.isTaxIncluded;
|
|
11107
|
+
|
|
11108
|
+
if (isTaxIncluded) {
|
|
11109
|
+
// 含税
|
|
11110
|
+
var lineAmountIncludeTax = (form === null || form === void 0 ? void 0 : form.getFieldValue('lineAmountIncludeTax')) || 0; //含税金额
|
|
11111
|
+
|
|
11112
|
+
var taxRate = (form === null || form === void 0 ? void 0 : form.getFieldValue('taxRate')) || 0; //税率
|
|
11113
|
+
|
|
11114
|
+
var taxAmount = countTaxAmount(lineAmountIncludeTax, 0, taxRate) || 0; //税额
|
|
11115
|
+
|
|
11116
|
+
var lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount) || 0; // 不含税金额
|
|
11117
|
+
|
|
11118
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue({
|
|
11119
|
+
taxAmount: taxAmount,
|
|
11120
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11121
|
+
});
|
|
11122
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11123
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
11124
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11125
|
+
while (1) {
|
|
11126
|
+
switch (_context.prev = _context.next) {
|
|
11127
|
+
case 0:
|
|
11128
|
+
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
11129
|
+
taxAmount: taxAmount,
|
|
11130
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11131
|
+
});
|
|
11132
|
+
|
|
11133
|
+
case 1:
|
|
11134
|
+
case "end":
|
|
11135
|
+
return _context.stop();
|
|
11136
|
+
}
|
|
11137
|
+
}
|
|
11138
|
+
}, _callee);
|
|
11139
|
+
}));
|
|
11140
|
+
|
|
11141
|
+
return function (_x) {
|
|
11142
|
+
return _ref.apply(this, arguments);
|
|
11143
|
+
};
|
|
11144
|
+
}());
|
|
11145
|
+
} else {
|
|
11146
|
+
// 不含税
|
|
11147
|
+
var _lineAmountIncludeTax = editGood.lineAmountIncludeTax || 0;
|
|
11148
|
+
|
|
11149
|
+
var _taxRate = (form === null || form === void 0 ? void 0 : form.getFieldValue('taxRate')) || 0; //税率
|
|
11150
|
+
|
|
11151
|
+
|
|
11152
|
+
var _taxAmount = countTaxAmount(_lineAmountIncludeTax, 0, _taxRate) || 0; //税额
|
|
11153
|
+
|
|
11154
|
+
|
|
11155
|
+
var _lineAmountExcludeTax = countAmountExcludeTax(_lineAmountIncludeTax, _taxAmount) || 0; // 不含税金额
|
|
11156
|
+
|
|
11157
|
+
|
|
11158
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue({
|
|
11159
|
+
taxAmount: _taxAmount,
|
|
11160
|
+
lineAmountExcludeTax: _lineAmountExcludeTax
|
|
11161
|
+
});
|
|
11162
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11163
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
11164
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11165
|
+
while (1) {
|
|
11166
|
+
switch (_context2.prev = _context2.next) {
|
|
11167
|
+
case 0:
|
|
11168
|
+
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
11169
|
+
taxAmount: _taxAmount,
|
|
11170
|
+
lineAmountExcludeTax: _lineAmountExcludeTax
|
|
11171
|
+
});
|
|
11172
|
+
|
|
11173
|
+
case 1:
|
|
11174
|
+
case "end":
|
|
11175
|
+
return _context2.stop();
|
|
11176
|
+
}
|
|
11177
|
+
}
|
|
11178
|
+
}, _callee2);
|
|
11179
|
+
}));
|
|
11180
|
+
|
|
11181
|
+
return function (_x2) {
|
|
11182
|
+
return _ref2.apply(this, arguments);
|
|
11183
|
+
};
|
|
11184
|
+
}());
|
|
11185
|
+
}
|
|
11186
|
+
} else {
|
|
11187
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11188
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
11189
|
+
var good, lineAmountIncludeTax, taxRate, taxAmount, lineAmountExcludeTax;
|
|
11190
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11191
|
+
while (1) {
|
|
11192
|
+
switch (_context3.prev = _context3.next) {
|
|
11193
|
+
case 0:
|
|
11194
|
+
good = s.goodsListState.goodsList[0];
|
|
11195
|
+
|
|
11196
|
+
if (good) {
|
|
11197
|
+
_context3.next = 3;
|
|
11198
|
+
break;
|
|
11199
|
+
}
|
|
11200
|
+
|
|
11201
|
+
return _context3.abrupt("return");
|
|
11202
|
+
|
|
11203
|
+
case 3:
|
|
11204
|
+
lineAmountIncludeTax = good.lineAmountIncludeTax || 0;
|
|
11205
|
+
taxRate = good.taxRate || 0;
|
|
11206
|
+
taxAmount = countTaxAmount(lineAmountIncludeTax, 0, taxRate) || 0; //税额
|
|
11207
|
+
|
|
11208
|
+
lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount) || 0; // 不含税金额
|
|
11209
|
+
|
|
11210
|
+
s.goodsListState.goodsList[0] = _objectSpread2(_objectSpread2({}, good), {}, {
|
|
11211
|
+
taxAmount: taxAmount,
|
|
11212
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11213
|
+
});
|
|
11214
|
+
|
|
11215
|
+
case 8:
|
|
11216
|
+
case "end":
|
|
11217
|
+
return _context3.stop();
|
|
11218
|
+
}
|
|
11219
|
+
}
|
|
11220
|
+
}, _callee3);
|
|
11221
|
+
}));
|
|
11222
|
+
|
|
11223
|
+
return function (_x3) {
|
|
11224
|
+
return _ref3.apply(this, arguments);
|
|
11225
|
+
};
|
|
11226
|
+
}());
|
|
11227
|
+
}
|
|
11228
|
+
}, [differenceInputEnabled]);
|
|
11229
|
+
};
|
|
11230
|
+
|
|
11091
11231
|
/** 更新 商品序号 */
|
|
11092
11232
|
|
|
11093
11233
|
function useToGenerateId(controller) {
|
|
@@ -11761,8 +11901,8 @@ var AddRowButton = (function (props) {
|
|
|
11761
11901
|
})), [controller, rootElement]);
|
|
11762
11902
|
if (isAddRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
11763
11903
|
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
11764
|
-
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
11765
|
-
|
|
11904
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null); // if (isDifferenceInput && goodsNum >= 1) return <></>;
|
|
11905
|
+
|
|
11766
11906
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11767
11907
|
onClick: onClick,
|
|
11768
11908
|
disabled: disabled
|
|
@@ -12638,10 +12778,7 @@ function ItemNameInput(props) {
|
|
|
12638
12778
|
}, []);
|
|
12639
12779
|
var autoComplete = controller.useMemo(function (s) {
|
|
12640
12780
|
return s.autoComplete;
|
|
12641
|
-
}, []);
|
|
12642
|
-
var enabled = controller.useMemo(function (s) {
|
|
12643
|
-
return s.differenceInputState.enabled;
|
|
12644
|
-
}, []);
|
|
12781
|
+
}, []); // const enabled = controller.useMemo((s) => s.differenceInputState.enabled, []);
|
|
12645
12782
|
|
|
12646
12783
|
var _React$useState = React__default['default'].useState([]),
|
|
12647
12784
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -12701,8 +12838,9 @@ function ItemNameInput(props) {
|
|
|
12701
12838
|
setSelectLine(null);
|
|
12702
12839
|
|
|
12703
12840
|
case 8:
|
|
12704
|
-
// 失去焦点时,打开差额开票弹窗
|
|
12705
|
-
|
|
12841
|
+
console.log('onBlur ===>', controller.state.differenceInputState.enabled); // 失去焦点时,打开差额开票弹窗
|
|
12842
|
+
|
|
12843
|
+
if (controller.state.differenceInputState.enabled) {
|
|
12706
12844
|
controller.run( /*#__PURE__*/function () {
|
|
12707
12845
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
12708
12846
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -12725,26 +12863,26 @@ function ItemNameInput(props) {
|
|
|
12725
12863
|
}());
|
|
12726
12864
|
}
|
|
12727
12865
|
|
|
12728
|
-
_context2.next =
|
|
12866
|
+
_context2.next = 15;
|
|
12729
12867
|
break;
|
|
12730
12868
|
|
|
12731
|
-
case
|
|
12732
|
-
_context2.prev =
|
|
12869
|
+
case 12:
|
|
12870
|
+
_context2.prev = 12;
|
|
12733
12871
|
_context2.t0 = _context2["catch"](0);
|
|
12734
12872
|
throw _context2.t0;
|
|
12735
12873
|
|
|
12736
|
-
case
|
|
12874
|
+
case 15:
|
|
12737
12875
|
case "end":
|
|
12738
12876
|
return _context2.stop();
|
|
12739
12877
|
}
|
|
12740
12878
|
}
|
|
12741
|
-
}, _callee2, null, [[0,
|
|
12879
|
+
}, _callee2, null, [[0, 12]]);
|
|
12742
12880
|
}));
|
|
12743
12881
|
|
|
12744
12882
|
return function (_x) {
|
|
12745
12883
|
return _ref.apply(this, arguments);
|
|
12746
12884
|
};
|
|
12747
|
-
}(), [autoComplete.onItemNameBlur, selectLine, props.editGood
|
|
12885
|
+
}(), [autoComplete.onItemNameBlur, selectLine, props.editGood]);
|
|
12748
12886
|
var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
12749
12887
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(searchText) {
|
|
12750
12888
|
var list;
|
|
@@ -14951,6 +15089,11 @@ var useColumns = (function (form) {
|
|
|
14951
15089
|
var deduction = controller.useMemo(function (e) {
|
|
14952
15090
|
return e.goodsListState.deduction;
|
|
14953
15091
|
}, []);
|
|
15092
|
+
/** 差额开票是否启用 */
|
|
15093
|
+
|
|
15094
|
+
var differenceInputStateEnabled = controller.useMemo(function (e) {
|
|
15095
|
+
return e.differenceInputState.enabled;
|
|
15096
|
+
}, []);
|
|
14954
15097
|
/** 计算中启动字段 */
|
|
14955
15098
|
|
|
14956
15099
|
var changeField = controller.useMemo(function (e) {
|
|
@@ -15449,6 +15592,7 @@ var useColumns = (function (form) {
|
|
|
15449
15592
|
textAlign: 'right'
|
|
15450
15593
|
},
|
|
15451
15594
|
maxLength: 25,
|
|
15595
|
+
disabled: differenceInputStateEnabled,
|
|
15452
15596
|
loading: isCipher(changeField, 'priceIncludeTax'),
|
|
15453
15597
|
onChange: function onChange() {
|
|
15454
15598
|
setChangeField('priceIncludeTax');
|
|
@@ -15524,6 +15668,7 @@ var useColumns = (function (form) {
|
|
|
15524
15668
|
textAlign: 'right'
|
|
15525
15669
|
},
|
|
15526
15670
|
maxLength: 25,
|
|
15671
|
+
disabled: differenceInputStateEnabled,
|
|
15527
15672
|
loading: isCipher(changeField, 'priceExcludeTax'),
|
|
15528
15673
|
onChange: function onChange() {
|
|
15529
15674
|
setChangeField('priceExcludeTax');
|
|
@@ -15613,17 +15758,40 @@ var useColumns = (function (form) {
|
|
|
15613
15758
|
textAlign: 'right'
|
|
15614
15759
|
},
|
|
15615
15760
|
loading: isCipher(changeField, 'lineAmountIncludeTax'),
|
|
15761
|
+
readOnly: differenceInputStateEnabled,
|
|
15616
15762
|
onChange: function onChange() {
|
|
15617
15763
|
setChangeField('lineAmountIncludeTax');
|
|
15618
15764
|
onChangeLineAmountIncludeTax(controller, form, record);
|
|
15619
|
-
}
|
|
15765
|
+
},
|
|
15766
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
15767
|
+
controller.run( /*#__PURE__*/function () {
|
|
15768
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
|
|
15769
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
15770
|
+
while (1) {
|
|
15771
|
+
switch (_context13.prev = _context13.next) {
|
|
15772
|
+
case 0:
|
|
15773
|
+
s.differenceInputState.open = true;
|
|
15774
|
+
|
|
15775
|
+
case 1:
|
|
15776
|
+
case "end":
|
|
15777
|
+
return _context13.stop();
|
|
15778
|
+
}
|
|
15779
|
+
}
|
|
15780
|
+
}, _callee13);
|
|
15781
|
+
}));
|
|
15782
|
+
|
|
15783
|
+
return function (_x21) {
|
|
15784
|
+
return _ref3.apply(this, arguments);
|
|
15785
|
+
};
|
|
15786
|
+
}());
|
|
15787
|
+
} : undefined
|
|
15620
15788
|
})));
|
|
15621
15789
|
} else {
|
|
15622
15790
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
15623
15791
|
style: {
|
|
15624
15792
|
padding: '0 10px'
|
|
15625
15793
|
}
|
|
15626
|
-
}, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
15794
|
+
}, formatSearch((isNaN(parseFloat(value)) ? 0 : parseFloat(value)).toFixed(2), searchValue));
|
|
15627
15795
|
}
|
|
15628
15796
|
}
|
|
15629
15797
|
}, {
|
|
@@ -15635,7 +15803,7 @@ var useColumns = (function (form) {
|
|
|
15635
15803
|
align: 'right',
|
|
15636
15804
|
width: 119,
|
|
15637
15805
|
render: function render(value, record) {
|
|
15638
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
15806
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab' && !differenceInputStateEnabled) {
|
|
15639
15807
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
|
|
15640
15808
|
initialValue: editGood.lineAmountExcludeTax,
|
|
15641
15809
|
getValueFromEvent: onNumberValueChange,
|
|
@@ -15647,10 +15815,10 @@ var useColumns = (function (form) {
|
|
|
15647
15815
|
message: '金额必须为数字'
|
|
15648
15816
|
}, {
|
|
15649
15817
|
validator: function () {
|
|
15650
|
-
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15651
|
-
return _regeneratorRuntime().wrap(function
|
|
15818
|
+
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_, value, callback) {
|
|
15819
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
15652
15820
|
while (1) {
|
|
15653
|
-
switch (
|
|
15821
|
+
switch (_context14.prev = _context14.next) {
|
|
15654
15822
|
case 0:
|
|
15655
15823
|
if ("".concat(value).split('.')[0].length > priceIntegerDigit) {
|
|
15656
15824
|
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E".concat(priceIntegerDigit, "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D"));
|
|
@@ -15658,13 +15826,13 @@ var useColumns = (function (form) {
|
|
|
15658
15826
|
|
|
15659
15827
|
case 1:
|
|
15660
15828
|
case "end":
|
|
15661
|
-
return
|
|
15829
|
+
return _context14.stop();
|
|
15662
15830
|
}
|
|
15663
15831
|
}
|
|
15664
|
-
},
|
|
15832
|
+
}, _callee14);
|
|
15665
15833
|
}));
|
|
15666
15834
|
|
|
15667
|
-
function validator(
|
|
15835
|
+
function validator(_x22, _x23, _x24) {
|
|
15668
15836
|
return _validator7.apply(this, arguments);
|
|
15669
15837
|
}
|
|
15670
15838
|
|
|
@@ -15675,7 +15843,30 @@ var useColumns = (function (form) {
|
|
|
15675
15843
|
style: {
|
|
15676
15844
|
textAlign: 'right'
|
|
15677
15845
|
},
|
|
15846
|
+
readOnly: differenceInputStateEnabled,
|
|
15678
15847
|
loading: isCipher(changeField, 'lineAmountExcludeTax'),
|
|
15848
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
15849
|
+
controller.run( /*#__PURE__*/function () {
|
|
15850
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
|
|
15851
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
15852
|
+
while (1) {
|
|
15853
|
+
switch (_context15.prev = _context15.next) {
|
|
15854
|
+
case 0:
|
|
15855
|
+
s.differenceInputState.open = true;
|
|
15856
|
+
|
|
15857
|
+
case 1:
|
|
15858
|
+
case "end":
|
|
15859
|
+
return _context15.stop();
|
|
15860
|
+
}
|
|
15861
|
+
}
|
|
15862
|
+
}, _callee15);
|
|
15863
|
+
}));
|
|
15864
|
+
|
|
15865
|
+
return function (_x25) {
|
|
15866
|
+
return _ref4.apply(this, arguments);
|
|
15867
|
+
};
|
|
15868
|
+
}());
|
|
15869
|
+
} : undefined,
|
|
15679
15870
|
onChange: function onChange() {
|
|
15680
15871
|
setChangeField('lineAmountExcludeTax');
|
|
15681
15872
|
onChangeLineAmountExcludeTax(controller, form, record);
|
|
@@ -15686,7 +15877,7 @@ var useColumns = (function (form) {
|
|
|
15686
15877
|
style: {
|
|
15687
15878
|
padding: '0 10px'
|
|
15688
15879
|
}
|
|
15689
|
-
}, value === '' ? '' : formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
15880
|
+
}, value === '' ? '' : formatSearch((isNaN(parseFloat(value)) ? 0 : parseFloat(value)).toFixed(2), searchValue));
|
|
15690
15881
|
}
|
|
15691
15882
|
}
|
|
15692
15883
|
}, {
|
|
@@ -15764,11 +15955,12 @@ var useColumns = (function (form) {
|
|
|
15764
15955
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
15765
15956
|
|
|
15766
15957
|
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
15958
|
+
var deduction = controller.state.goodsListState.deduction || 0;
|
|
15767
15959
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
15768
15960
|
|
|
15769
15961
|
if (lineAmountExcludeTax && (taxRate || taxRate === 0) && lineAmountIncludeTax) {
|
|
15770
15962
|
// const total = bignumber(lineAmountExcludeTax * taxRate / 100);
|
|
15771
|
-
var total = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
15963
|
+
var total = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).subtract(mathjs.bignumber(deduction)).multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
15772
15964
|
|
|
15773
15965
|
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
15774
15966
|
callback();
|
|
@@ -15897,7 +16089,7 @@ var useColumns = (function (form) {
|
|
|
15897
16089
|
ellipsis: true
|
|
15898
16090
|
});
|
|
15899
16091
|
});
|
|
15900
|
-
}, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
|
|
16092
|
+
}, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart, differenceInputStateEnabled]);
|
|
15901
16093
|
return controller.setColumnsConfig ? controller.setColumnsConfig(columns) : columns;
|
|
15902
16094
|
});
|
|
15903
16095
|
/** 字段 */
|
|
@@ -16230,61 +16422,6 @@ var useOnRow = (function () {
|
|
|
16230
16422
|
};
|
|
16231
16423
|
});
|
|
16232
16424
|
|
|
16233
|
-
/**
|
|
16234
|
-
* 扣除额 相关业务
|
|
16235
|
-
*/
|
|
16236
|
-
|
|
16237
|
-
function useDeduction(controller) {
|
|
16238
|
-
var deduction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16239
|
-
// 更新 扣除额
|
|
16240
|
-
React__default['default'].useEffect(function () {
|
|
16241
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
16242
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
16243
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16244
|
-
while (1) {
|
|
16245
|
-
switch (_context.prev = _context.next) {
|
|
16246
|
-
case 0:
|
|
16247
|
-
return _context.abrupt("return", s.goodsListState.deduction = deduction);
|
|
16248
|
-
|
|
16249
|
-
case 1:
|
|
16250
|
-
case "end":
|
|
16251
|
-
return _context.stop();
|
|
16252
|
-
}
|
|
16253
|
-
}
|
|
16254
|
-
}, _callee);
|
|
16255
|
-
}));
|
|
16256
|
-
|
|
16257
|
-
return function (_x) {
|
|
16258
|
-
return _ref.apply(this, arguments);
|
|
16259
|
-
};
|
|
16260
|
-
}())();
|
|
16261
|
-
}, [controller, deduction]); // 重新计算
|
|
16262
|
-
|
|
16263
|
-
React__default['default'].useEffect(function () {
|
|
16264
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
16265
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
16266
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
16267
|
-
while (1) {
|
|
16268
|
-
switch (_context2.prev = _context2.next) {
|
|
16269
|
-
case 0:
|
|
16270
|
-
s.goodsListState.editGood = undefined;
|
|
16271
|
-
s.goodsListState.goodsList = [];
|
|
16272
|
-
|
|
16273
|
-
case 2:
|
|
16274
|
-
case "end":
|
|
16275
|
-
return _context2.stop();
|
|
16276
|
-
}
|
|
16277
|
-
}
|
|
16278
|
-
}, _callee2);
|
|
16279
|
-
}));
|
|
16280
|
-
|
|
16281
|
-
return function (_x2) {
|
|
16282
|
-
return _ref2.apply(this, arguments);
|
|
16283
|
-
};
|
|
16284
|
-
}())();
|
|
16285
|
-
}, [controller, deduction]);
|
|
16286
|
-
}
|
|
16287
|
-
|
|
16288
16425
|
/**
|
|
16289
16426
|
* 点击组件外部 保存正在编辑的货物
|
|
16290
16427
|
*/
|
|
@@ -16296,6 +16433,9 @@ function useWindowClick(controller) {
|
|
|
16296
16433
|
/** 点击组件外部 保存正在编辑的货物 */
|
|
16297
16434
|
React__default['default'].useEffect(function () {
|
|
16298
16435
|
var click = function click() {
|
|
16436
|
+
var _controller$state$goo;
|
|
16437
|
+
|
|
16438
|
+
if (!((_controller$state$goo = controller.state.goodsListState) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.isSaveRowOutside)) return;
|
|
16299
16439
|
setTimeout(controller.saveEditGood);
|
|
16300
16440
|
};
|
|
16301
16441
|
|
|
@@ -17867,9 +18007,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
17867
18007
|
}, [dataSource, searchValue, controller, isTaxIncluded]);
|
|
17868
18008
|
/** 表格行事件 */
|
|
17869
18009
|
|
|
17870
|
-
var _onRow = useOnRow();
|
|
18010
|
+
var _onRow = useOnRow(); // useDeduction(controller, props.deduction);
|
|
18011
|
+
|
|
17871
18012
|
|
|
17872
|
-
useDeduction(controller, props.deduction);
|
|
17873
18013
|
useWindowClick(controller);
|
|
17874
18014
|
/** 批量赋码 */
|
|
17875
18015
|
|
|
@@ -23187,8 +23327,8 @@ var AddRowButton$1 = (function () {
|
|
|
23187
23327
|
})), [controller, rootElement]);
|
|
23188
23328
|
if (isAddRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
23189
23329
|
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
23190
|
-
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
23191
|
-
|
|
23330
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null); // if (isDifferenceInput && goodsNum >= 1) return <></>;
|
|
23331
|
+
|
|
23192
23332
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
23193
23333
|
size: 'small',
|
|
23194
23334
|
type: 'primary',
|
|
@@ -23514,7 +23654,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
|
|
|
23514
23654
|
break;
|
|
23515
23655
|
}
|
|
23516
23656
|
|
|
23517
|
-
if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
|
|
23657
|
+
if (!(!err.priceIncludeTax && values.priceIncludeTax && !controller.state.differenceInputState.enabled)) {
|
|
23518
23658
|
_context3.next = 26;
|
|
23519
23659
|
break;
|
|
23520
23660
|
}
|
|
@@ -23560,7 +23700,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
|
|
|
23560
23700
|
break;
|
|
23561
23701
|
|
|
23562
23702
|
case 36:
|
|
23563
|
-
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
23703
|
+
if (!(!err.priceExcludeTax && values.priceExcludeTax && !controller.state.differenceInputState.enabled)) {
|
|
23564
23704
|
_context3.next = 44;
|
|
23565
23705
|
break;
|
|
23566
23706
|
}
|
|
@@ -25644,6 +25784,11 @@ var useColumns$1 = (function (form) {
|
|
|
25644
25784
|
var deduction = controller.useMemo(function (e) {
|
|
25645
25785
|
return e.goodsListState.deduction;
|
|
25646
25786
|
}, []);
|
|
25787
|
+
/** 差额开票是否启用 */
|
|
25788
|
+
|
|
25789
|
+
var differenceInputStateEnabled = controller.useMemo(function (e) {
|
|
25790
|
+
return e.differenceInputState.enabled;
|
|
25791
|
+
}, []);
|
|
25647
25792
|
/** 计算中启动字段 */
|
|
25648
25793
|
|
|
25649
25794
|
var changeField = controller.useMemo(function (e) {
|
|
@@ -25739,58 +25884,24 @@ var useColumns$1 = (function (form) {
|
|
|
25739
25884
|
}, getFieldDecorator('itemName', {
|
|
25740
25885
|
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
25741
25886
|
rules: [].concat(_toConsumableArray(getReplenishRules('itemName')), [{
|
|
25742
|
-
|
|
25743
|
-
|
|
25744
|
-
|
|
25745
|
-
|
|
25746
|
-
|
|
25747
|
-
|
|
25748
|
-
|
|
25749
|
-
|
|
25750
|
-
|
|
25751
|
-
|
|
25752
|
-
|
|
25753
|
-
|
|
25754
|
-
|
|
25755
|
-
|
|
25756
|
-
|
|
25757
|
-
|
|
25758
|
-
|
|
25759
|
-
|
|
25760
|
-
if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
|
|
25761
|
-
_context2.next = 8;
|
|
25762
|
-
break;
|
|
25763
|
-
}
|
|
25764
|
-
|
|
25765
|
-
callback('项目名称不能为空');
|
|
25766
|
-
_context2.next = 9;
|
|
25767
|
-
break;
|
|
25768
|
-
|
|
25769
|
-
case 8:
|
|
25770
|
-
return _context2.abrupt("return");
|
|
25771
|
-
|
|
25772
|
-
case 9:
|
|
25773
|
-
_context2.next = 12;
|
|
25774
|
-
break;
|
|
25775
|
-
|
|
25776
|
-
case 11:
|
|
25777
|
-
callback();
|
|
25778
|
-
|
|
25779
|
-
case 12:
|
|
25780
|
-
case "end":
|
|
25781
|
-
return _context2.stop();
|
|
25782
|
-
}
|
|
25783
|
-
}
|
|
25784
|
-
}, _callee2);
|
|
25785
|
-
}));
|
|
25786
|
-
|
|
25787
|
-
function validator(_x2, _x3, _x4) {
|
|
25788
|
-
return _validator.apply(this, arguments);
|
|
25789
|
-
}
|
|
25790
|
-
|
|
25791
|
-
return validator;
|
|
25792
|
-
}()
|
|
25793
|
-
}])
|
|
25887
|
+
required: isValidateGood,
|
|
25888
|
+
message: '项目名称不能为空'
|
|
25889
|
+
} // {
|
|
25890
|
+
// validator: async (_, __, callback) => {
|
|
25891
|
+
// if (isValidateGood) {
|
|
25892
|
+
// await controller.wait();
|
|
25893
|
+
// const value = controller.state.goodsListState.editGood;
|
|
25894
|
+
// if (!value?.itemName && !value?.itemNameSelf) {
|
|
25895
|
+
// callback('项目名称不能为空');
|
|
25896
|
+
// } else {
|
|
25897
|
+
// return;
|
|
25898
|
+
// }
|
|
25899
|
+
// } else {
|
|
25900
|
+
// callback();
|
|
25901
|
+
// }
|
|
25902
|
+
// }
|
|
25903
|
+
// }
|
|
25904
|
+
])
|
|
25794
25905
|
})( /*#__PURE__*/React__default['default'].createElement(ItemNameInput$1, {
|
|
25795
25906
|
editGood: editGood,
|
|
25796
25907
|
shorthand: editGood.shorthand,
|
|
@@ -25806,22 +25917,22 @@ var useColumns$1 = (function (form) {
|
|
|
25806
25917
|
},
|
|
25807
25918
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgPlus$2, null),
|
|
25808
25919
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
25809
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25810
|
-
return _regeneratorRuntime().wrap(function
|
|
25920
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
25921
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25811
25922
|
while (1) {
|
|
25812
|
-
switch (
|
|
25923
|
+
switch (_context2.prev = _context2.next) {
|
|
25813
25924
|
case 0:
|
|
25814
25925
|
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
25815
25926
|
|
|
25816
25927
|
case 1:
|
|
25817
25928
|
case "end":
|
|
25818
|
-
return
|
|
25929
|
+
return _context2.stop();
|
|
25819
25930
|
}
|
|
25820
25931
|
}
|
|
25821
|
-
},
|
|
25932
|
+
}, _callee2);
|
|
25822
25933
|
}));
|
|
25823
25934
|
|
|
25824
|
-
return function (
|
|
25935
|
+
return function (_x2) {
|
|
25825
25936
|
return _ref2.apply(this, arguments);
|
|
25826
25937
|
};
|
|
25827
25938
|
}())
|
|
@@ -25859,13 +25970,13 @@ var useColumns$1 = (function (form) {
|
|
|
25859
25970
|
rules: getReplenishRules('itemModelName')
|
|
25860
25971
|
})( /*#__PURE__*/React__default['default'].createElement(MyInput$3, {
|
|
25861
25972
|
onChange: function () {
|
|
25862
|
-
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25973
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
25863
25974
|
var key, value;
|
|
25864
|
-
return _regeneratorRuntime().wrap(function
|
|
25975
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
25865
25976
|
while (1) {
|
|
25866
|
-
switch (
|
|
25977
|
+
switch (_context3.prev = _context3.next) {
|
|
25867
25978
|
case 0:
|
|
25868
|
-
|
|
25979
|
+
_context3.next = 2;
|
|
25869
25980
|
return controller.wait();
|
|
25870
25981
|
|
|
25871
25982
|
case 2:
|
|
@@ -25876,10 +25987,10 @@ var useColumns$1 = (function (form) {
|
|
|
25876
25987
|
|
|
25877
25988
|
case 6:
|
|
25878
25989
|
case "end":
|
|
25879
|
-
return
|
|
25990
|
+
return _context3.stop();
|
|
25880
25991
|
}
|
|
25881
25992
|
}
|
|
25882
|
-
},
|
|
25993
|
+
}, _callee3);
|
|
25883
25994
|
}));
|
|
25884
25995
|
|
|
25885
25996
|
function onChange() {
|
|
@@ -25917,12 +26028,12 @@ var useColumns$1 = (function (form) {
|
|
|
25917
26028
|
return rootElement || document.body;
|
|
25918
26029
|
},
|
|
25919
26030
|
onChange: function () {
|
|
25920
|
-
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25921
|
-
return _regeneratorRuntime().wrap(function
|
|
26031
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
26032
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
25922
26033
|
while (1) {
|
|
25923
|
-
switch (
|
|
26034
|
+
switch (_context4.prev = _context4.next) {
|
|
25924
26035
|
case 0:
|
|
25925
|
-
|
|
26036
|
+
_context4.next = 2;
|
|
25926
26037
|
return controller.wait();
|
|
25927
26038
|
|
|
25928
26039
|
case 2:
|
|
@@ -25932,10 +26043,10 @@ var useColumns$1 = (function (form) {
|
|
|
25932
26043
|
|
|
25933
26044
|
case 3:
|
|
25934
26045
|
case "end":
|
|
25935
|
-
return
|
|
26046
|
+
return _context4.stop();
|
|
25936
26047
|
}
|
|
25937
26048
|
}
|
|
25938
|
-
},
|
|
26049
|
+
}, _callee4);
|
|
25939
26050
|
}));
|
|
25940
26051
|
|
|
25941
26052
|
function onChange() {
|
|
@@ -25971,18 +26082,18 @@ var useColumns$1 = (function (form) {
|
|
|
25971
26082
|
message: '数量必须为数字'
|
|
25972
26083
|
}, {
|
|
25973
26084
|
validator: function () {
|
|
25974
|
-
var
|
|
26085
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
|
|
25975
26086
|
var isvalue, isPrice;
|
|
25976
|
-
return _regeneratorRuntime().wrap(function
|
|
26087
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25977
26088
|
while (1) {
|
|
25978
|
-
switch (
|
|
26089
|
+
switch (_context5.prev = _context5.next) {
|
|
25979
26090
|
case 0:
|
|
25980
26091
|
if (!isValidateGood) {
|
|
25981
|
-
|
|
26092
|
+
_context5.next = 10;
|
|
25982
26093
|
break;
|
|
25983
26094
|
}
|
|
25984
26095
|
|
|
25985
|
-
|
|
26096
|
+
_context5.next = 3;
|
|
25986
26097
|
return controller.wait();
|
|
25987
26098
|
|
|
25988
26099
|
case 3:
|
|
@@ -25990,15 +26101,15 @@ var useColumns$1 = (function (form) {
|
|
|
25990
26101
|
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
25991
26102
|
|
|
25992
26103
|
if (!(isvalue || isPrice === isvalue)) {
|
|
25993
|
-
|
|
26104
|
+
_context5.next = 7;
|
|
25994
26105
|
break;
|
|
25995
26106
|
}
|
|
25996
26107
|
|
|
25997
|
-
return
|
|
26108
|
+
return _context5.abrupt("return");
|
|
25998
26109
|
|
|
25999
26110
|
case 7:
|
|
26000
26111
|
callback('请输入数量');
|
|
26001
|
-
|
|
26112
|
+
_context5.next = 11;
|
|
26002
26113
|
break;
|
|
26003
26114
|
|
|
26004
26115
|
case 10:
|
|
@@ -26006,14 +26117,14 @@ var useColumns$1 = (function (form) {
|
|
|
26006
26117
|
|
|
26007
26118
|
case 11:
|
|
26008
26119
|
case "end":
|
|
26009
|
-
return
|
|
26120
|
+
return _context5.stop();
|
|
26010
26121
|
}
|
|
26011
26122
|
}
|
|
26012
|
-
},
|
|
26123
|
+
}, _callee5);
|
|
26013
26124
|
}));
|
|
26014
26125
|
|
|
26015
|
-
function validator(
|
|
26016
|
-
return
|
|
26126
|
+
function validator(_x3, _x4, _x5) {
|
|
26127
|
+
return _validator.apply(this, arguments);
|
|
26017
26128
|
}
|
|
26018
26129
|
|
|
26019
26130
|
return validator;
|
|
@@ -26026,21 +26137,21 @@ var useColumns$1 = (function (form) {
|
|
|
26026
26137
|
maxLength: 25,
|
|
26027
26138
|
loading: isCipher$1(changeField, "quantity"),
|
|
26028
26139
|
onChange: function () {
|
|
26029
|
-
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
26030
|
-
return _regeneratorRuntime().wrap(function
|
|
26140
|
+
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
26141
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
26031
26142
|
while (1) {
|
|
26032
|
-
switch (
|
|
26143
|
+
switch (_context6.prev = _context6.next) {
|
|
26033
26144
|
case 0:
|
|
26034
26145
|
setChangeField('quantity');
|
|
26035
|
-
|
|
26146
|
+
_context6.next = 3;
|
|
26036
26147
|
return onChangeQuantity$1(controller, form, record);
|
|
26037
26148
|
|
|
26038
26149
|
case 3:
|
|
26039
26150
|
case "end":
|
|
26040
|
-
return
|
|
26151
|
+
return _context6.stop();
|
|
26041
26152
|
}
|
|
26042
26153
|
}
|
|
26043
|
-
},
|
|
26154
|
+
}, _callee6);
|
|
26044
26155
|
}));
|
|
26045
26156
|
|
|
26046
26157
|
function onChange() {
|
|
@@ -26076,13 +26187,13 @@ var useColumns$1 = (function (form) {
|
|
|
26076
26187
|
message: '单价必须为数字'
|
|
26077
26188
|
}, {
|
|
26078
26189
|
validator: function () {
|
|
26079
|
-
var
|
|
26190
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
|
|
26080
26191
|
var isQuantity, isvalue;
|
|
26081
|
-
return _regeneratorRuntime().wrap(function
|
|
26192
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
26082
26193
|
while (1) {
|
|
26083
|
-
switch (
|
|
26194
|
+
switch (_context7.prev = _context7.next) {
|
|
26084
26195
|
case 0:
|
|
26085
|
-
|
|
26196
|
+
_context7.next = 2;
|
|
26086
26197
|
return controller.wait();
|
|
26087
26198
|
|
|
26088
26199
|
case 2:
|
|
@@ -26090,25 +26201,25 @@ var useColumns$1 = (function (form) {
|
|
|
26090
26201
|
isvalue = !!value || value === 0;
|
|
26091
26202
|
|
|
26092
26203
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
26093
|
-
|
|
26204
|
+
_context7.next = 6;
|
|
26094
26205
|
break;
|
|
26095
26206
|
}
|
|
26096
26207
|
|
|
26097
|
-
return
|
|
26208
|
+
return _context7.abrupt("return");
|
|
26098
26209
|
|
|
26099
26210
|
case 6:
|
|
26100
26211
|
callback('请输入单价');
|
|
26101
26212
|
|
|
26102
26213
|
case 7:
|
|
26103
26214
|
case "end":
|
|
26104
|
-
return
|
|
26215
|
+
return _context7.stop();
|
|
26105
26216
|
}
|
|
26106
26217
|
}
|
|
26107
|
-
},
|
|
26218
|
+
}, _callee7);
|
|
26108
26219
|
}));
|
|
26109
26220
|
|
|
26110
|
-
function validator(
|
|
26111
|
-
return
|
|
26221
|
+
function validator(_x6, _x7, _x8) {
|
|
26222
|
+
return _validator2.apply(this, arguments);
|
|
26112
26223
|
}
|
|
26113
26224
|
|
|
26114
26225
|
return validator;
|
|
@@ -26119,6 +26230,7 @@ var useColumns$1 = (function (form) {
|
|
|
26119
26230
|
textAlign: 'right'
|
|
26120
26231
|
},
|
|
26121
26232
|
maxLength: 25,
|
|
26233
|
+
disabled: differenceInputStateEnabled,
|
|
26122
26234
|
loading: isCipher$1(changeField, 'priceIncludeTax'),
|
|
26123
26235
|
onChange: function onChange() {
|
|
26124
26236
|
setChangeField('priceIncludeTax');
|
|
@@ -26151,13 +26263,13 @@ var useColumns$1 = (function (form) {
|
|
|
26151
26263
|
message: '单价必须为数字'
|
|
26152
26264
|
}, {
|
|
26153
26265
|
validator: function () {
|
|
26154
|
-
var
|
|
26266
|
+
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
26155
26267
|
var isQuantity, isvalue;
|
|
26156
|
-
return _regeneratorRuntime().wrap(function
|
|
26268
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
26157
26269
|
while (1) {
|
|
26158
|
-
switch (
|
|
26270
|
+
switch (_context8.prev = _context8.next) {
|
|
26159
26271
|
case 0:
|
|
26160
|
-
|
|
26272
|
+
_context8.next = 2;
|
|
26161
26273
|
return controller.wait();
|
|
26162
26274
|
|
|
26163
26275
|
case 2:
|
|
@@ -26165,25 +26277,25 @@ var useColumns$1 = (function (form) {
|
|
|
26165
26277
|
isvalue = !!value || value === 0;
|
|
26166
26278
|
|
|
26167
26279
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
26168
|
-
|
|
26280
|
+
_context8.next = 6;
|
|
26169
26281
|
break;
|
|
26170
26282
|
}
|
|
26171
26283
|
|
|
26172
|
-
return
|
|
26284
|
+
return _context8.abrupt("return");
|
|
26173
26285
|
|
|
26174
26286
|
case 6:
|
|
26175
26287
|
callback('请输入单价');
|
|
26176
26288
|
|
|
26177
26289
|
case 7:
|
|
26178
26290
|
case "end":
|
|
26179
|
-
return
|
|
26291
|
+
return _context8.stop();
|
|
26180
26292
|
}
|
|
26181
26293
|
}
|
|
26182
|
-
},
|
|
26294
|
+
}, _callee8);
|
|
26183
26295
|
}));
|
|
26184
26296
|
|
|
26185
|
-
function validator(
|
|
26186
|
-
return
|
|
26297
|
+
function validator(_x9, _x10, _x11) {
|
|
26298
|
+
return _validator3.apply(this, arguments);
|
|
26187
26299
|
}
|
|
26188
26300
|
|
|
26189
26301
|
return validator;
|
|
@@ -26194,6 +26306,7 @@ var useColumns$1 = (function (form) {
|
|
|
26194
26306
|
textAlign: 'right'
|
|
26195
26307
|
},
|
|
26196
26308
|
maxLength: 25,
|
|
26309
|
+
disabled: differenceInputStateEnabled,
|
|
26197
26310
|
loading: isCipher$1(changeField, 'priceExcludeTax'),
|
|
26198
26311
|
onChange: function onChange() {
|
|
26199
26312
|
setChangeField('priceExcludeTax');
|
|
@@ -26229,10 +26342,10 @@ var useColumns$1 = (function (form) {
|
|
|
26229
26342
|
message: '金额错误,请重新输入'
|
|
26230
26343
|
}, {
|
|
26231
26344
|
validator: function () {
|
|
26232
|
-
var
|
|
26233
|
-
return _regeneratorRuntime().wrap(function
|
|
26345
|
+
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
26346
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
26234
26347
|
while (1) {
|
|
26235
|
-
switch (
|
|
26348
|
+
switch (_context9.prev = _context9.next) {
|
|
26236
26349
|
case 0:
|
|
26237
26350
|
if ("".concat(value).split('.')[0].length > priceIntegerDigit) {
|
|
26238
26351
|
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E".concat(priceIntegerDigit, "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D"));
|
|
@@ -26240,24 +26353,24 @@ var useColumns$1 = (function (form) {
|
|
|
26240
26353
|
|
|
26241
26354
|
case 1:
|
|
26242
26355
|
case "end":
|
|
26243
|
-
return
|
|
26356
|
+
return _context9.stop();
|
|
26244
26357
|
}
|
|
26245
26358
|
}
|
|
26246
|
-
},
|
|
26359
|
+
}, _callee9);
|
|
26247
26360
|
}));
|
|
26248
26361
|
|
|
26249
|
-
function validator(
|
|
26250
|
-
return
|
|
26362
|
+
function validator(_x12, _x13, _x14) {
|
|
26363
|
+
return _validator4.apply(this, arguments);
|
|
26251
26364
|
}
|
|
26252
26365
|
|
|
26253
26366
|
return validator;
|
|
26254
26367
|
}()
|
|
26255
26368
|
}, {
|
|
26256
26369
|
validator: function () {
|
|
26257
|
-
var
|
|
26258
|
-
return _regeneratorRuntime().wrap(function
|
|
26370
|
+
var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
26371
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
26259
26372
|
while (1) {
|
|
26260
|
-
switch (
|
|
26373
|
+
switch (_context10.prev = _context10.next) {
|
|
26261
26374
|
case 0:
|
|
26262
26375
|
if (deduction && parseFloat(value) <= deduction) {
|
|
26263
26376
|
callback('扣除额不能大于等于价税合计');
|
|
@@ -26265,14 +26378,14 @@ var useColumns$1 = (function (form) {
|
|
|
26265
26378
|
|
|
26266
26379
|
case 1:
|
|
26267
26380
|
case "end":
|
|
26268
|
-
return
|
|
26381
|
+
return _context10.stop();
|
|
26269
26382
|
}
|
|
26270
26383
|
}
|
|
26271
|
-
},
|
|
26384
|
+
}, _callee10);
|
|
26272
26385
|
}));
|
|
26273
26386
|
|
|
26274
|
-
function validator(
|
|
26275
|
-
return
|
|
26387
|
+
function validator(_x15, _x16, _x17) {
|
|
26388
|
+
return _validator5.apply(this, arguments);
|
|
26276
26389
|
}
|
|
26277
26390
|
|
|
26278
26391
|
return validator;
|
|
@@ -26283,10 +26396,33 @@ var useColumns$1 = (function (form) {
|
|
|
26283
26396
|
textAlign: 'right'
|
|
26284
26397
|
},
|
|
26285
26398
|
loading: isCipher$1(changeField, 'lineAmountIncludeTax'),
|
|
26399
|
+
readOnly: differenceInputStateEnabled,
|
|
26286
26400
|
onChange: function onChange() {
|
|
26287
26401
|
setChangeField('lineAmountIncludeTax');
|
|
26288
26402
|
onChangeLineAmountIncludeTax$1(controller, form, record);
|
|
26289
|
-
}
|
|
26403
|
+
},
|
|
26404
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
26405
|
+
controller.run( /*#__PURE__*/function () {
|
|
26406
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
|
|
26407
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
26408
|
+
while (1) {
|
|
26409
|
+
switch (_context11.prev = _context11.next) {
|
|
26410
|
+
case 0:
|
|
26411
|
+
s.differenceInputState.open = true;
|
|
26412
|
+
|
|
26413
|
+
case 1:
|
|
26414
|
+
case "end":
|
|
26415
|
+
return _context11.stop();
|
|
26416
|
+
}
|
|
26417
|
+
}
|
|
26418
|
+
}, _callee11);
|
|
26419
|
+
}));
|
|
26420
|
+
|
|
26421
|
+
return function (_x18) {
|
|
26422
|
+
return _ref3.apply(this, arguments);
|
|
26423
|
+
};
|
|
26424
|
+
}());
|
|
26425
|
+
} : undefined
|
|
26290
26426
|
})));
|
|
26291
26427
|
} else {
|
|
26292
26428
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
@@ -26317,7 +26453,7 @@ var useColumns$1 = (function (form) {
|
|
|
26317
26453
|
message: '金额错误,请重新输入'
|
|
26318
26454
|
}, {
|
|
26319
26455
|
validator: function () {
|
|
26320
|
-
var
|
|
26456
|
+
var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_, value, callback) {
|
|
26321
26457
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
26322
26458
|
while (1) {
|
|
26323
26459
|
switch (_context12.prev = _context12.next) {
|
|
@@ -26334,8 +26470,8 @@ var useColumns$1 = (function (form) {
|
|
|
26334
26470
|
}, _callee12);
|
|
26335
26471
|
}));
|
|
26336
26472
|
|
|
26337
|
-
function validator(
|
|
26338
|
-
return
|
|
26473
|
+
function validator(_x19, _x20, _x21) {
|
|
26474
|
+
return _validator6.apply(this, arguments);
|
|
26339
26475
|
}
|
|
26340
26476
|
|
|
26341
26477
|
return validator;
|
|
@@ -26346,10 +26482,33 @@ var useColumns$1 = (function (form) {
|
|
|
26346
26482
|
textAlign: 'right'
|
|
26347
26483
|
},
|
|
26348
26484
|
loading: isCipher$1(changeField, 'lineAmountExcludeTax'),
|
|
26485
|
+
readOnly: differenceInputStateEnabled,
|
|
26349
26486
|
onChange: function onChange() {
|
|
26350
26487
|
setChangeField('lineAmountExcludeTax');
|
|
26351
26488
|
onChangeLineAmountExcludeTax$1(controller, form, record);
|
|
26352
|
-
}
|
|
26489
|
+
},
|
|
26490
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
26491
|
+
controller.run( /*#__PURE__*/function () {
|
|
26492
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
|
|
26493
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
26494
|
+
while (1) {
|
|
26495
|
+
switch (_context13.prev = _context13.next) {
|
|
26496
|
+
case 0:
|
|
26497
|
+
s.differenceInputState.open = true;
|
|
26498
|
+
|
|
26499
|
+
case 1:
|
|
26500
|
+
case "end":
|
|
26501
|
+
return _context13.stop();
|
|
26502
|
+
}
|
|
26503
|
+
}
|
|
26504
|
+
}, _callee13);
|
|
26505
|
+
}));
|
|
26506
|
+
|
|
26507
|
+
return function (_x22) {
|
|
26508
|
+
return _ref4.apply(this, arguments);
|
|
26509
|
+
};
|
|
26510
|
+
}());
|
|
26511
|
+
} : undefined
|
|
26353
26512
|
})));
|
|
26354
26513
|
} else {
|
|
26355
26514
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
@@ -26431,12 +26590,12 @@ var useColumns$1 = (function (form) {
|
|
|
26431
26590
|
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
26432
26591
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
26433
26592
|
|
|
26593
|
+
var deduction = controller.state.goodsListState.deduction || 0;
|
|
26434
26594
|
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
26435
26595
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
26436
26596
|
|
|
26437
26597
|
if (lineAmountExcludeTax && (taxRate || taxRate === 0) && lineAmountIncludeTax) {
|
|
26438
|
-
|
|
26439
|
-
var total = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100)); // if (Number(Math.abs(Number(total) - Number(value)).toFixed(4)) <= 0.01) {
|
|
26598
|
+
var total = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).subtract(mathjs.bignumber(deduction || 0)).multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100));
|
|
26440
26599
|
|
|
26441
26600
|
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
26442
26601
|
callback();
|
|
@@ -26498,7 +26657,7 @@ var useColumns$1 = (function (form) {
|
|
|
26498
26657
|
ellipsis: true
|
|
26499
26658
|
});
|
|
26500
26659
|
});
|
|
26501
|
-
}, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType]); // React.useEffect(() => {
|
|
26660
|
+
}, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType, differenceInputStateEnabled]); // React.useEffect(() => {
|
|
26502
26661
|
// clearTimeout(t)
|
|
26503
26662
|
// const t = setTimeout(() => { setChangeField('') }, 1000);
|
|
26504
26663
|
// return () => { clearTimeout(t) }
|
|
@@ -26827,6 +26986,9 @@ function useWindowClick$1(controller) {
|
|
|
26827
26986
|
/** 点击组件外部 保存正在编辑的货物 */
|
|
26828
26987
|
React__default['default'].useEffect(function () {
|
|
26829
26988
|
var click = function click() {
|
|
26989
|
+
var _controller$state$goo;
|
|
26990
|
+
|
|
26991
|
+
if (!((_controller$state$goo = controller.state.goodsListState) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.isSaveRowOutside)) return;
|
|
26830
26992
|
setTimeout(controller.saveEditGood);
|
|
26831
26993
|
};
|
|
26832
26994
|
|
|
@@ -36962,8 +37124,49 @@ var VoucherType;
|
|
|
36962
37124
|
|
|
36963
37125
|
VoucherType["OTHER_DEDUCTION_VOUCHER"] = "09";
|
|
36964
37126
|
})(VoucherType || (VoucherType = {}));
|
|
36965
|
-
/**
|
|
37127
|
+
/** 最多只允许输入两位小数的校验器 */
|
|
37128
|
+
|
|
37129
|
+
|
|
37130
|
+
var maxTwoDecimalsValidator = function maxTwoDecimalsValidator(_rule, value) {
|
|
37131
|
+
if (value === undefined || value === null || value === '') {
|
|
37132
|
+
return Promise.resolve();
|
|
37133
|
+
}
|
|
37134
|
+
|
|
37135
|
+
var decimalPart = String(value).split('.')[1];
|
|
37136
|
+
|
|
37137
|
+
if (decimalPart && decimalPart.length > 2) {
|
|
37138
|
+
return Promise.reject(new Error('最多只能输入2位小数'));
|
|
37139
|
+
}
|
|
37140
|
+
|
|
37141
|
+
return Promise.resolve();
|
|
37142
|
+
};
|
|
37143
|
+
/** 凭证明细表单实例(用于跨字段校验:本次扣除金额 <= 凭证合计金额) */
|
|
37144
|
+
|
|
37145
|
+
var formInstance;
|
|
37146
|
+
/**
|
|
37147
|
+
* 本次扣除金额不能大于凭证合计金额的校验器
|
|
37148
|
+
*/
|
|
36966
37149
|
|
|
37150
|
+
var deductAmtNotExceedVoucherTotalValidator = function deductAmtNotExceedVoucherTotalValidator(_rule, value) {
|
|
37151
|
+
var _formInstance;
|
|
37152
|
+
|
|
37153
|
+
if (value === undefined || value === null || value === '') {
|
|
37154
|
+
return Promise.resolve();
|
|
37155
|
+
}
|
|
37156
|
+
|
|
37157
|
+
var voucherTotalAmt = (_formInstance = formInstance) === null || _formInstance === void 0 ? void 0 : _formInstance.getFieldValue('voucherTotalAmt');
|
|
37158
|
+
|
|
37159
|
+
if (voucherTotalAmt === undefined || voucherTotalAmt === null || voucherTotalAmt === '') {
|
|
37160
|
+
return Promise.resolve();
|
|
37161
|
+
}
|
|
37162
|
+
|
|
37163
|
+
if (Number(value) > Number(voucherTotalAmt)) {
|
|
37164
|
+
return Promise.reject(new Error('本次扣除金额不能大于凭证合计金额'));
|
|
37165
|
+
}
|
|
37166
|
+
|
|
37167
|
+
return Promise.resolve();
|
|
37168
|
+
};
|
|
37169
|
+
/** 凭证类型候选项 */
|
|
36967
37170
|
|
|
36968
37171
|
var voucherTypeOptions = [{
|
|
36969
37172
|
value: VoucherType.SPECIAL_INVOICE,
|
|
@@ -37148,19 +37351,36 @@ function DifferenceInputModal(props) {
|
|
|
37148
37351
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
37149
37352
|
form = _Form$useForm2[0];
|
|
37150
37353
|
|
|
37354
|
+
var _Form$useForm3 = ktsComponentsAntdX4.Form.useForm(),
|
|
37355
|
+
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
37356
|
+
topForm = _Form$useForm4[0];
|
|
37357
|
+
/** 记录表单实例,供跨字段校验使用 */
|
|
37358
|
+
|
|
37359
|
+
|
|
37360
|
+
React__default['default'].useEffect(function () {
|
|
37361
|
+
formInstance = form;
|
|
37362
|
+
return function () {
|
|
37363
|
+
formInstance = undefined;
|
|
37364
|
+
};
|
|
37365
|
+
}, [form]);
|
|
37366
|
+
|
|
37151
37367
|
var _React$useState = React__default['default'].useState([]),
|
|
37152
37368
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
37153
37369
|
dataSource = _React$useState2[0],
|
|
37154
37370
|
setDataSource = _React$useState2[1];
|
|
37155
37371
|
|
|
37156
37372
|
var voucherType = ktsComponentsAntdX4.Form.useWatch('voucherType', form) || form.getFieldValue('voucherType');
|
|
37373
|
+
var projectCode = ktsComponentsAntdX4.Form.useWatch('projectCode', topForm) || topForm.getFieldValue('projectCode');
|
|
37374
|
+
/** 凭证合计金额(用于联动校验本次扣除金额) */
|
|
37157
37375
|
|
|
37158
|
-
var
|
|
37159
|
-
|
|
37160
|
-
projectCode = _React$useState4[0],
|
|
37161
|
-
setProjectCode = _React$useState4[1];
|
|
37162
|
-
/** 扣除额 (明细汇总) */
|
|
37376
|
+
var voucherTotalAmt = ktsComponentsAntdX4.Form.useWatch('voucherTotalAmt', form);
|
|
37377
|
+
/** 凭证合计金额变化时,重新校验本次扣除金额 */
|
|
37163
37378
|
|
|
37379
|
+
React__default['default'].useEffect(function () {
|
|
37380
|
+
if (!form.isFieldTouched('currentDeductAmt')) return;
|
|
37381
|
+
form.validateFields(['currentDeductAmt']).catch(function () {});
|
|
37382
|
+
}, [form, voucherTotalAmt]);
|
|
37383
|
+
/** 扣除额 (明细汇总) */
|
|
37164
37384
|
|
|
37165
37385
|
var deductTotal = React__default['default'].useMemo(function () {
|
|
37166
37386
|
return dataSource.reduce(function (acc, curr) {
|
|
@@ -37175,8 +37395,8 @@ function DifferenceInputModal(props) {
|
|
|
37175
37395
|
}, 0);
|
|
37176
37396
|
}, [dataSource]);
|
|
37177
37397
|
var total = props.total || {
|
|
37178
|
-
voucherTotal:
|
|
37179
|
-
deductTotal:
|
|
37398
|
+
voucherTotal: voucherTotal,
|
|
37399
|
+
deductTotal: deductTotal
|
|
37180
37400
|
};
|
|
37181
37401
|
var onFinish = React__default['default'].useCallback(function (values) {
|
|
37182
37402
|
setDataSource([].concat(_toConsumableArray(dataSource), [_objectSpread2(_objectSpread2({}, values), {}, {
|
|
@@ -37185,15 +37405,42 @@ function DifferenceInputModal(props) {
|
|
|
37185
37405
|
})]));
|
|
37186
37406
|
form.resetFields();
|
|
37187
37407
|
}, [dataSource, form]);
|
|
37408
|
+
var onOkClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37409
|
+
var values;
|
|
37410
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37411
|
+
while (1) {
|
|
37412
|
+
switch (_context.prev = _context.next) {
|
|
37413
|
+
case 0:
|
|
37414
|
+
_context.next = 2;
|
|
37415
|
+
return topForm.validateFields();
|
|
37416
|
+
|
|
37417
|
+
case 2:
|
|
37418
|
+
values = _context.sent;
|
|
37419
|
+
onOk === null || onOk === void 0 ? void 0 : onOk(_objectSpread2(_objectSpread2({}, values), {}, {
|
|
37420
|
+
deductTotal: deductTotal,
|
|
37421
|
+
rows: dataSource
|
|
37422
|
+
}));
|
|
37423
|
+
|
|
37424
|
+
case 4:
|
|
37425
|
+
case "end":
|
|
37426
|
+
return _context.stop();
|
|
37427
|
+
}
|
|
37428
|
+
}
|
|
37429
|
+
}, _callee);
|
|
37430
|
+
})), [dataSource, onOk]);
|
|
37188
37431
|
React__default['default'].useEffect(function () {
|
|
37189
37432
|
console.log('DifferenceInputModal props.value ===>', props.value);
|
|
37190
37433
|
|
|
37191
37434
|
if (open) {
|
|
37192
|
-
var _props$value, _props$value2;
|
|
37435
|
+
var _props$value, _props$value2, _props$value3;
|
|
37193
37436
|
|
|
37194
37437
|
form.resetFields();
|
|
37195
|
-
|
|
37196
|
-
|
|
37438
|
+
topForm.resetFields();
|
|
37439
|
+
topForm.setFieldsValue({
|
|
37440
|
+
amountIncludeTax: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.amountIncludeTax,
|
|
37441
|
+
projectCode: (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.projectCode
|
|
37442
|
+
});
|
|
37443
|
+
setDataSource(((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.rows) || []);
|
|
37197
37444
|
}
|
|
37198
37445
|
}, [open, props.value]);
|
|
37199
37446
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Modal, {
|
|
@@ -37209,20 +37456,14 @@ function DifferenceInputModal(props) {
|
|
|
37209
37456
|
onClick: onCancel
|
|
37210
37457
|
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
37211
37458
|
type: "primary",
|
|
37212
|
-
onClick:
|
|
37213
|
-
return onOk === null || onOk === void 0 ? void 0 : onOk({
|
|
37214
|
-
voucherTotal: voucherTotal,
|
|
37215
|
-
deductTotal: deductTotal,
|
|
37216
|
-
rows: dataSource,
|
|
37217
|
-
projectCode: projectCode
|
|
37218
|
-
});
|
|
37219
|
-
}
|
|
37459
|
+
onClick: onOkClick
|
|
37220
37460
|
}, "\u786E\u5B9A"))
|
|
37221
37461
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
37222
37462
|
className: "kts-difference-modal"
|
|
37223
37463
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
37224
37464
|
className: "kts-difference-modal-top"
|
|
37225
37465
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form, {
|
|
37466
|
+
form: topForm,
|
|
37226
37467
|
layout: 'horizontal',
|
|
37227
37468
|
className: "kts-difference-modal-top-form",
|
|
37228
37469
|
labelCol: {
|
|
@@ -37231,15 +37472,20 @@ function DifferenceInputModal(props) {
|
|
|
37231
37472
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Row, null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37232
37473
|
span: 12
|
|
37233
37474
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
37475
|
+
name: 'amountIncludeTax',
|
|
37234
37476
|
label: "\u542B\u7A0E\u9500\u552E\u989D",
|
|
37235
|
-
className: "kts-difference-modal-item"
|
|
37477
|
+
className: "kts-difference-modal-item",
|
|
37478
|
+
rules: [{
|
|
37479
|
+
required: true,
|
|
37480
|
+
message: '请输入含税销售额'
|
|
37481
|
+
}, {
|
|
37482
|
+
validator: maxTwoDecimalsValidator
|
|
37483
|
+
}]
|
|
37236
37484
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.InputNumber, {
|
|
37237
37485
|
style: {
|
|
37238
37486
|
width: '100%'
|
|
37239
37487
|
},
|
|
37240
|
-
|
|
37241
|
-
placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D",
|
|
37242
|
-
value: voucherTotal || 0
|
|
37488
|
+
placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D"
|
|
37243
37489
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37244
37490
|
span: 12
|
|
37245
37491
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
@@ -37255,15 +37501,16 @@ function DifferenceInputModal(props) {
|
|
|
37255
37501
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37256
37502
|
span: 24
|
|
37257
37503
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
37504
|
+
name: 'projectCode',
|
|
37258
37505
|
label: "\u7533\u62A5\u9879\u76EE\u540D\u79F0",
|
|
37259
|
-
className: "kts-difference-modal-item"
|
|
37506
|
+
className: "kts-difference-modal-item",
|
|
37507
|
+
rules: [{
|
|
37508
|
+
required: true,
|
|
37509
|
+
message: '请选择申报项目名称'
|
|
37510
|
+
}]
|
|
37260
37511
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
|
|
37261
37512
|
options: projectOptions,
|
|
37262
|
-
placeholder: "\u8BF7\u9009\u62E9\u7533\u62A5\u9879\u76EE\u540D\u79F0"
|
|
37263
|
-
onChange: function onChange(value) {
|
|
37264
|
-
setProjectCode(value);
|
|
37265
|
-
},
|
|
37266
|
-
value: projectCode
|
|
37513
|
+
placeholder: "\u8BF7\u9009\u62E9\u7533\u62A5\u9879\u76EE\u540D\u79F0"
|
|
37267
37514
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37268
37515
|
span: 24
|
|
37269
37516
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
@@ -37347,7 +37594,9 @@ function DifferenceInputModal(props) {
|
|
|
37347
37594
|
name: 'voucherTotalAmt',
|
|
37348
37595
|
label: "\u51ED\u8BC1\u5408\u8BA1\u91D1\u989D",
|
|
37349
37596
|
className: "kts-difference-modal-cell",
|
|
37350
|
-
rules: (_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']
|
|
37597
|
+
rules: [].concat(_toConsumableArray(((_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']) || []), [{
|
|
37598
|
+
validator: maxTwoDecimalsValidator
|
|
37599
|
+
}])
|
|
37351
37600
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.InputNumber, {
|
|
37352
37601
|
style: {
|
|
37353
37602
|
width: '100%'
|
|
@@ -37359,7 +37608,11 @@ function DifferenceInputModal(props) {
|
|
|
37359
37608
|
name: 'currentDeductAmt',
|
|
37360
37609
|
label: "\u672C\u6B21\u6263\u9664\u91D1\u989D",
|
|
37361
37610
|
className: "kts-difference-modal-cell",
|
|
37362
|
-
rules: (_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']
|
|
37611
|
+
rules: [].concat(_toConsumableArray(((_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']) || []), [{
|
|
37612
|
+
validator: maxTwoDecimalsValidator
|
|
37613
|
+
}, {
|
|
37614
|
+
validator: deductAmtNotExceedVoucherTotalValidator
|
|
37615
|
+
}])
|
|
37363
37616
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.InputNumber, {
|
|
37364
37617
|
style: {
|
|
37365
37618
|
width: '100%'
|
|
@@ -37388,7 +37641,7 @@ function DifferenceInputModal(props) {
|
|
|
37388
37641
|
onClick: function onClick() {
|
|
37389
37642
|
return form.resetFields();
|
|
37390
37643
|
}
|
|
37391
|
-
}, "\u6E05\
|
|
37644
|
+
}, "\u6E05\u9664"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
37392
37645
|
type: 'primary',
|
|
37393
37646
|
size: 'small',
|
|
37394
37647
|
onClick: function onClick() {
|
|
@@ -37450,64 +37703,193 @@ var DifferenceInput = (function () {
|
|
|
37450
37703
|
var data = controller.useMemo(function (s) {
|
|
37451
37704
|
return s.differenceInputState.data;
|
|
37452
37705
|
}, []);
|
|
37706
|
+
/** 计算中启动字段 */
|
|
37707
|
+
|
|
37708
|
+
var setChangeField = React__default['default'].useCallback(function (value) {
|
|
37709
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37710
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
37711
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37712
|
+
while (1) {
|
|
37713
|
+
switch (_context.prev = _context.next) {
|
|
37714
|
+
case 0:
|
|
37715
|
+
s.calculatingField = value;
|
|
37716
|
+
|
|
37717
|
+
case 1:
|
|
37718
|
+
case "end":
|
|
37719
|
+
return _context.stop();
|
|
37720
|
+
}
|
|
37721
|
+
}
|
|
37722
|
+
}, _callee);
|
|
37723
|
+
}));
|
|
37724
|
+
|
|
37725
|
+
return function (_x) {
|
|
37726
|
+
return _ref.apply(this, arguments);
|
|
37727
|
+
};
|
|
37728
|
+
}());
|
|
37729
|
+
}, []);
|
|
37453
37730
|
var value = React__default['default'].useMemo(function () {
|
|
37731
|
+
var _controller$state$goo;
|
|
37732
|
+
|
|
37454
37733
|
return {
|
|
37455
37734
|
rows: (data === null || data === void 0 ? void 0 : data.rows) || [],
|
|
37456
37735
|
projectCode: (data === null || data === void 0 ? void 0 : data.projectCode) || '',
|
|
37457
|
-
|
|
37458
|
-
|
|
37736
|
+
deductTotal: (data === null || data === void 0 ? void 0 : data.deductTotal) || 0,
|
|
37737
|
+
amountIncludeTax: ((_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.getFieldValue('lineAmountIncludeTax')) || 0
|
|
37459
37738
|
};
|
|
37460
37739
|
}, [data, open]);
|
|
37461
|
-
|
|
37462
|
-
|
|
37463
|
-
|
|
37464
|
-
open
|
|
37465
|
-
onCancel: function onCancel() {
|
|
37740
|
+
React__default['default'].useEffect(function () {
|
|
37741
|
+
controller.state.goodsListState.isSaveRowOutside = !open;
|
|
37742
|
+
|
|
37743
|
+
if (open) {
|
|
37466
37744
|
controller.run( /*#__PURE__*/function () {
|
|
37467
|
-
var
|
|
37468
|
-
|
|
37745
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
37746
|
+
var _s$goodsListState$for;
|
|
37747
|
+
|
|
37748
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
37469
37749
|
while (1) {
|
|
37470
|
-
switch (
|
|
37750
|
+
switch (_context2.prev = _context2.next) {
|
|
37471
37751
|
case 0:
|
|
37472
|
-
s.differenceInputState.
|
|
37752
|
+
if (s.differenceInputState.data) {
|
|
37753
|
+
_context2.next = 2;
|
|
37754
|
+
break;
|
|
37755
|
+
}
|
|
37473
37756
|
|
|
37474
|
-
|
|
37757
|
+
return _context2.abrupt("return");
|
|
37758
|
+
|
|
37759
|
+
case 2:
|
|
37760
|
+
s.differenceInputState.data.amountIncludeTax = (_s$goodsListState$for = s.goodsListState.form) === null || _s$goodsListState$for === void 0 ? void 0 : _s$goodsListState$for.getFieldValue('lineAmountIncludeTax');
|
|
37761
|
+
|
|
37762
|
+
case 3:
|
|
37475
37763
|
case "end":
|
|
37476
|
-
return
|
|
37764
|
+
return _context2.stop();
|
|
37477
37765
|
}
|
|
37478
37766
|
}
|
|
37479
|
-
},
|
|
37767
|
+
}, _callee2);
|
|
37480
37768
|
}));
|
|
37481
37769
|
|
|
37482
|
-
return function (
|
|
37483
|
-
return
|
|
37770
|
+
return function (_x2) {
|
|
37771
|
+
return _ref2.apply(this, arguments);
|
|
37484
37772
|
};
|
|
37485
37773
|
}());
|
|
37486
|
-
}
|
|
37487
|
-
|
|
37774
|
+
}
|
|
37775
|
+
}, [open]);
|
|
37776
|
+
console.log('DifferenceInput data ===>', data);
|
|
37777
|
+
return /*#__PURE__*/React__default['default'].createElement(DifferenceInputModal, {
|
|
37778
|
+
value: value,
|
|
37779
|
+
open: open,
|
|
37780
|
+
onCancel: function onCancel() {
|
|
37488
37781
|
controller.run( /*#__PURE__*/function () {
|
|
37489
|
-
var
|
|
37490
|
-
return _regeneratorRuntime().wrap(function
|
|
37782
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
37783
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
37491
37784
|
while (1) {
|
|
37492
|
-
switch (
|
|
37785
|
+
switch (_context3.prev = _context3.next) {
|
|
37493
37786
|
case 0:
|
|
37494
|
-
s.differenceInputState.data = data;
|
|
37495
|
-
s.goodsListState.deduction = data.deductTotal;
|
|
37496
37787
|
s.differenceInputState.open = false;
|
|
37497
37788
|
|
|
37498
|
-
case
|
|
37789
|
+
case 1:
|
|
37499
37790
|
case "end":
|
|
37500
|
-
return
|
|
37791
|
+
return _context3.stop();
|
|
37501
37792
|
}
|
|
37502
37793
|
}
|
|
37503
|
-
},
|
|
37794
|
+
}, _callee3);
|
|
37504
37795
|
}));
|
|
37505
37796
|
|
|
37506
|
-
return function (
|
|
37507
|
-
return
|
|
37797
|
+
return function (_x3) {
|
|
37798
|
+
return _ref3.apply(this, arguments);
|
|
37508
37799
|
};
|
|
37509
37800
|
}());
|
|
37510
|
-
}
|
|
37801
|
+
},
|
|
37802
|
+
onOk: function () {
|
|
37803
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data) {
|
|
37804
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
37805
|
+
while (1) {
|
|
37806
|
+
switch (_context6.prev = _context6.next) {
|
|
37807
|
+
case 0:
|
|
37808
|
+
_context6.next = 2;
|
|
37809
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37810
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
37811
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
37812
|
+
while (1) {
|
|
37813
|
+
switch (_context4.prev = _context4.next) {
|
|
37814
|
+
case 0:
|
|
37815
|
+
s.goodsListState.isTaxIncluded = true;
|
|
37816
|
+
|
|
37817
|
+
case 1:
|
|
37818
|
+
case "end":
|
|
37819
|
+
return _context4.stop();
|
|
37820
|
+
}
|
|
37821
|
+
}
|
|
37822
|
+
}, _callee4);
|
|
37823
|
+
}));
|
|
37824
|
+
|
|
37825
|
+
return function (_x5) {
|
|
37826
|
+
return _ref4.apply(this, arguments);
|
|
37827
|
+
};
|
|
37828
|
+
}());
|
|
37829
|
+
|
|
37830
|
+
case 2:
|
|
37831
|
+
_context6.next = 4;
|
|
37832
|
+
return controller.wait();
|
|
37833
|
+
|
|
37834
|
+
case 4:
|
|
37835
|
+
_context6.next = 6;
|
|
37836
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37837
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
37838
|
+
var amountIncludeTax, form, record, _s$goodsListState$for2;
|
|
37839
|
+
|
|
37840
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
37841
|
+
while (1) {
|
|
37842
|
+
switch (_context5.prev = _context5.next) {
|
|
37843
|
+
case 0:
|
|
37844
|
+
s.differenceInputState.data = data;
|
|
37845
|
+
s.goodsListState.deduction = data.deductTotal;
|
|
37846
|
+
s.differenceInputState.open = false;
|
|
37847
|
+
s.differenceInputState.amountIncludeTax = data.amountIncludeTax;
|
|
37848
|
+
amountIncludeTax = data.amountIncludeTax || 0; // const deductTotal = data.deductTotal || 0;
|
|
37849
|
+
|
|
37850
|
+
form = s.goodsListState.form;
|
|
37851
|
+
record = s.goodsListState.editGood;
|
|
37852
|
+
|
|
37853
|
+
if (!(s.goodsListState.goodsList && s.goodsListState.goodsList.length > 0)) {
|
|
37854
|
+
_context5.next = 13;
|
|
37855
|
+
break;
|
|
37856
|
+
}
|
|
37857
|
+
|
|
37858
|
+
s.goodsListState.editGood = record;
|
|
37859
|
+
(_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.setFieldsValue({
|
|
37860
|
+
lineAmountIncludeTax: amountIncludeTax
|
|
37861
|
+
});
|
|
37862
|
+
setChangeField('lineAmountIncludeTax');
|
|
37863
|
+
_context5.next = 13;
|
|
37864
|
+
return onChangeLineAmountIncludeTax(controller, form, record);
|
|
37865
|
+
|
|
37866
|
+
case 13:
|
|
37867
|
+
case "end":
|
|
37868
|
+
return _context5.stop();
|
|
37869
|
+
}
|
|
37870
|
+
}
|
|
37871
|
+
}, _callee5);
|
|
37872
|
+
}));
|
|
37873
|
+
|
|
37874
|
+
return function (_x6) {
|
|
37875
|
+
return _ref5.apply(this, arguments);
|
|
37876
|
+
};
|
|
37877
|
+
}());
|
|
37878
|
+
|
|
37879
|
+
case 6:
|
|
37880
|
+
case "end":
|
|
37881
|
+
return _context6.stop();
|
|
37882
|
+
}
|
|
37883
|
+
}
|
|
37884
|
+
}, _callee6);
|
|
37885
|
+
}));
|
|
37886
|
+
|
|
37887
|
+
function onOk(_x4) {
|
|
37888
|
+
return _onOk.apply(this, arguments);
|
|
37889
|
+
}
|
|
37890
|
+
|
|
37891
|
+
return onOk;
|
|
37892
|
+
}()
|
|
37511
37893
|
});
|
|
37512
37894
|
});
|
|
37513
37895
|
|
|
@@ -37619,7 +38001,8 @@ var Main$7 = function Main(props) {
|
|
|
37619
38001
|
key = _React$useState2[0],
|
|
37620
38002
|
setKey = _React$useState2[1];
|
|
37621
38003
|
|
|
37622
|
-
useToGenerateId(controller);
|
|
38004
|
+
useToGenerateId(controller);
|
|
38005
|
+
useRecalculateTax(controller); // useClearGoodsList(controller);
|
|
37623
38006
|
|
|
37624
38007
|
React__default['default'].useEffect(function () {
|
|
37625
38008
|
setKey(key + 1);
|
|
@@ -37674,7 +38057,8 @@ var Digtal = function Digtal(props) {
|
|
|
37674
38057
|
key = _React$useState4[0],
|
|
37675
38058
|
setKey = _React$useState4[1];
|
|
37676
38059
|
|
|
37677
|
-
useToGenerateId(controller);
|
|
38060
|
+
useToGenerateId(controller);
|
|
38061
|
+
useRecalculateTax(controller); // useClearGoodsList(controller);
|
|
37678
38062
|
|
|
37679
38063
|
React__default['default'].useEffect(function () {
|
|
37680
38064
|
setKey(key + 1);
|