kts-component-invoice-operate 3.2.265 → 3.2.267
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 +695 -288
- package/dist/index.js +695 -288
- 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 +76 -0
- package/src/Invoice/index.tsx +3 -0
- package/src/Invoice/tools/calculate/index.ts +2 -3
- package/src/Invoice/ui/default/EndowCodeDrawer/index.tsx +4 -2
- 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,162 @@ 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 deduction = invoiceController.state.goodsListState.deduction || 0;
|
|
11113
|
+
var taxRate = (form === null || form === void 0 ? void 0 : form.getFieldValue('taxRate')) || 0; //税率
|
|
11114
|
+
|
|
11115
|
+
var taxAmount = countTaxAmount(lineAmountIncludeTax, deduction, taxRate) || 0; //税额
|
|
11116
|
+
|
|
11117
|
+
var lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount) || 0; // 不含税金额
|
|
11118
|
+
|
|
11119
|
+
var quantity = (form === null || form === void 0 ? void 0 : form.getFieldValue('quantity')) || 0;
|
|
11120
|
+
var priceExcludeTax = quantity > 0 ? countPrice(lineAmountExcludeTax, quantity) : undefined; // 不含税单价
|
|
11121
|
+
|
|
11122
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue({
|
|
11123
|
+
taxAmount: taxAmount,
|
|
11124
|
+
lineAmountExcludeTax: lineAmountExcludeTax
|
|
11125
|
+
});
|
|
11126
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11127
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
11128
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11129
|
+
while (1) {
|
|
11130
|
+
switch (_context.prev = _context.next) {
|
|
11131
|
+
case 0:
|
|
11132
|
+
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
11133
|
+
taxAmount: taxAmount,
|
|
11134
|
+
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
11135
|
+
priceExcludeTax: priceExcludeTax || undefined
|
|
11136
|
+
});
|
|
11137
|
+
|
|
11138
|
+
case 1:
|
|
11139
|
+
case "end":
|
|
11140
|
+
return _context.stop();
|
|
11141
|
+
}
|
|
11142
|
+
}
|
|
11143
|
+
}, _callee);
|
|
11144
|
+
}));
|
|
11145
|
+
|
|
11146
|
+
return function (_x) {
|
|
11147
|
+
return _ref.apply(this, arguments);
|
|
11148
|
+
};
|
|
11149
|
+
}());
|
|
11150
|
+
} else {
|
|
11151
|
+
// 不含税
|
|
11152
|
+
var _lineAmountIncludeTax = editGood.lineAmountIncludeTax || 0;
|
|
11153
|
+
|
|
11154
|
+
var _deduction = invoiceController.state.goodsListState.deduction || 0;
|
|
11155
|
+
|
|
11156
|
+
var _taxRate = (form === null || form === void 0 ? void 0 : form.getFieldValue('taxRate')) || 0; //税率
|
|
11157
|
+
|
|
11158
|
+
|
|
11159
|
+
var _taxAmount = countTaxAmount(_lineAmountIncludeTax, _deduction, _taxRate) || 0; //税额
|
|
11160
|
+
|
|
11161
|
+
|
|
11162
|
+
var _lineAmountExcludeTax = countAmountExcludeTax(_lineAmountIncludeTax, _taxAmount) || 0; // 不含税金额
|
|
11163
|
+
|
|
11164
|
+
|
|
11165
|
+
var _quantity = (form === null || form === void 0 ? void 0 : form.getFieldValue('quantity')) || 0;
|
|
11166
|
+
|
|
11167
|
+
var _priceExcludeTax = _quantity > 0 ? countPrice(_lineAmountExcludeTax, _quantity) : undefined; // 不含税单价
|
|
11168
|
+
|
|
11169
|
+
|
|
11170
|
+
form === null || form === void 0 ? void 0 : form.setFieldsValue({
|
|
11171
|
+
taxAmount: _taxAmount,
|
|
11172
|
+
lineAmountExcludeTax: _lineAmountExcludeTax
|
|
11173
|
+
});
|
|
11174
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11175
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
11176
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11177
|
+
while (1) {
|
|
11178
|
+
switch (_context2.prev = _context2.next) {
|
|
11179
|
+
case 0:
|
|
11180
|
+
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
11181
|
+
taxAmount: _taxAmount,
|
|
11182
|
+
lineAmountExcludeTax: _lineAmountExcludeTax,
|
|
11183
|
+
priceExcludeTax: _priceExcludeTax || undefined
|
|
11184
|
+
});
|
|
11185
|
+
|
|
11186
|
+
case 1:
|
|
11187
|
+
case "end":
|
|
11188
|
+
return _context2.stop();
|
|
11189
|
+
}
|
|
11190
|
+
}
|
|
11191
|
+
}, _callee2);
|
|
11192
|
+
}));
|
|
11193
|
+
|
|
11194
|
+
return function (_x2) {
|
|
11195
|
+
return _ref2.apply(this, arguments);
|
|
11196
|
+
};
|
|
11197
|
+
}());
|
|
11198
|
+
}
|
|
11199
|
+
} else {
|
|
11200
|
+
invoiceController.run( /*#__PURE__*/function () {
|
|
11201
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
11202
|
+
var good, lineAmountIncludeTax, deduction, taxRate, taxAmount, lineAmountExcludeTax, quantity, priceExcludeTax;
|
|
11203
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11204
|
+
while (1) {
|
|
11205
|
+
switch (_context3.prev = _context3.next) {
|
|
11206
|
+
case 0:
|
|
11207
|
+
good = s.goodsListState.goodsList[0];
|
|
11208
|
+
|
|
11209
|
+
if (good) {
|
|
11210
|
+
_context3.next = 3;
|
|
11211
|
+
break;
|
|
11212
|
+
}
|
|
11213
|
+
|
|
11214
|
+
return _context3.abrupt("return");
|
|
11215
|
+
|
|
11216
|
+
case 3:
|
|
11217
|
+
lineAmountIncludeTax = good.lineAmountIncludeTax || 0;
|
|
11218
|
+
deduction = invoiceController.state.goodsListState.deduction || 0;
|
|
11219
|
+
taxRate = good.taxRate || 0;
|
|
11220
|
+
taxAmount = countTaxAmount(lineAmountIncludeTax, deduction, taxRate) || 0; //税额
|
|
11221
|
+
|
|
11222
|
+
lineAmountExcludeTax = countAmountExcludeTax(lineAmountIncludeTax, taxAmount) || 0; // 不含税金额
|
|
11223
|
+
|
|
11224
|
+
quantity = good.quantity || 0;
|
|
11225
|
+
priceExcludeTax = quantity > 0 ? countPrice(lineAmountExcludeTax, quantity) : undefined; // 不含税单价
|
|
11226
|
+
|
|
11227
|
+
s.goodsListState.goodsList[0] = _objectSpread2(_objectSpread2({}, good), {}, {
|
|
11228
|
+
taxAmount: taxAmount,
|
|
11229
|
+
lineAmountExcludeTax: lineAmountExcludeTax,
|
|
11230
|
+
priceExcludeTax: priceExcludeTax || undefined
|
|
11231
|
+
});
|
|
11232
|
+
s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
|
|
11233
|
+
|
|
11234
|
+
case 12:
|
|
11235
|
+
case "end":
|
|
11236
|
+
return _context3.stop();
|
|
11237
|
+
}
|
|
11238
|
+
}
|
|
11239
|
+
}, _callee3);
|
|
11240
|
+
}));
|
|
11241
|
+
|
|
11242
|
+
return function (_x3) {
|
|
11243
|
+
return _ref3.apply(this, arguments);
|
|
11244
|
+
};
|
|
11245
|
+
}());
|
|
11246
|
+
}
|
|
11247
|
+
}, [differenceInputEnabled]);
|
|
11248
|
+
};
|
|
11249
|
+
|
|
11091
11250
|
/** 更新 商品序号 */
|
|
11092
11251
|
|
|
11093
11252
|
function useToGenerateId(controller) {
|
|
@@ -11761,8 +11920,8 @@ var AddRowButton = (function (props) {
|
|
|
11761
11920
|
})), [controller, rootElement]);
|
|
11762
11921
|
if (isAddRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
11763
11922
|
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
|
-
|
|
11923
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null); // if (isDifferenceInput && goodsNum >= 1) return <></>;
|
|
11924
|
+
|
|
11766
11925
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11767
11926
|
onClick: onClick,
|
|
11768
11927
|
disabled: disabled
|
|
@@ -12638,10 +12797,7 @@ function ItemNameInput(props) {
|
|
|
12638
12797
|
}, []);
|
|
12639
12798
|
var autoComplete = controller.useMemo(function (s) {
|
|
12640
12799
|
return s.autoComplete;
|
|
12641
|
-
}, []);
|
|
12642
|
-
var enabled = controller.useMemo(function (s) {
|
|
12643
|
-
return s.differenceInputState.enabled;
|
|
12644
|
-
}, []);
|
|
12800
|
+
}, []); // const enabled = controller.useMemo((s) => s.differenceInputState.enabled, []);
|
|
12645
12801
|
|
|
12646
12802
|
var _React$useState = React__default['default'].useState([]),
|
|
12647
12803
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -12701,8 +12857,9 @@ function ItemNameInput(props) {
|
|
|
12701
12857
|
setSelectLine(null);
|
|
12702
12858
|
|
|
12703
12859
|
case 8:
|
|
12704
|
-
// 失去焦点时,打开差额开票弹窗
|
|
12705
|
-
|
|
12860
|
+
console.log('onBlur ===>', controller.state.differenceInputState.enabled); // 失去焦点时,打开差额开票弹窗
|
|
12861
|
+
|
|
12862
|
+
if (controller.state.differenceInputState.enabled) {
|
|
12706
12863
|
controller.run( /*#__PURE__*/function () {
|
|
12707
12864
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
12708
12865
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -12725,26 +12882,26 @@ function ItemNameInput(props) {
|
|
|
12725
12882
|
}());
|
|
12726
12883
|
}
|
|
12727
12884
|
|
|
12728
|
-
_context2.next =
|
|
12885
|
+
_context2.next = 15;
|
|
12729
12886
|
break;
|
|
12730
12887
|
|
|
12731
|
-
case
|
|
12732
|
-
_context2.prev =
|
|
12888
|
+
case 12:
|
|
12889
|
+
_context2.prev = 12;
|
|
12733
12890
|
_context2.t0 = _context2["catch"](0);
|
|
12734
12891
|
throw _context2.t0;
|
|
12735
12892
|
|
|
12736
|
-
case
|
|
12893
|
+
case 15:
|
|
12737
12894
|
case "end":
|
|
12738
12895
|
return _context2.stop();
|
|
12739
12896
|
}
|
|
12740
12897
|
}
|
|
12741
|
-
}, _callee2, null, [[0,
|
|
12898
|
+
}, _callee2, null, [[0, 12]]);
|
|
12742
12899
|
}));
|
|
12743
12900
|
|
|
12744
12901
|
return function (_x) {
|
|
12745
12902
|
return _ref.apply(this, arguments);
|
|
12746
12903
|
};
|
|
12747
|
-
}(), [autoComplete.onItemNameBlur, selectLine, props.editGood
|
|
12904
|
+
}(), [autoComplete.onItemNameBlur, selectLine, props.editGood]);
|
|
12748
12905
|
var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
12749
12906
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(searchText) {
|
|
12750
12907
|
var list;
|
|
@@ -14951,6 +15108,11 @@ var useColumns = (function (form) {
|
|
|
14951
15108
|
var deduction = controller.useMemo(function (e) {
|
|
14952
15109
|
return e.goodsListState.deduction;
|
|
14953
15110
|
}, []);
|
|
15111
|
+
/** 差额开票是否启用 */
|
|
15112
|
+
|
|
15113
|
+
var differenceInputStateEnabled = controller.useMemo(function (e) {
|
|
15114
|
+
return e.differenceInputState.enabled;
|
|
15115
|
+
}, []);
|
|
14954
15116
|
/** 计算中启动字段 */
|
|
14955
15117
|
|
|
14956
15118
|
var changeField = controller.useMemo(function (e) {
|
|
@@ -15449,6 +15611,7 @@ var useColumns = (function (form) {
|
|
|
15449
15611
|
textAlign: 'right'
|
|
15450
15612
|
},
|
|
15451
15613
|
maxLength: 25,
|
|
15614
|
+
disabled: differenceInputStateEnabled,
|
|
15452
15615
|
loading: isCipher(changeField, 'priceIncludeTax'),
|
|
15453
15616
|
onChange: function onChange() {
|
|
15454
15617
|
setChangeField('priceIncludeTax');
|
|
@@ -15524,6 +15687,7 @@ var useColumns = (function (form) {
|
|
|
15524
15687
|
textAlign: 'right'
|
|
15525
15688
|
},
|
|
15526
15689
|
maxLength: 25,
|
|
15690
|
+
disabled: differenceInputStateEnabled,
|
|
15527
15691
|
loading: isCipher(changeField, 'priceExcludeTax'),
|
|
15528
15692
|
onChange: function onChange() {
|
|
15529
15693
|
setChangeField('priceExcludeTax');
|
|
@@ -15613,17 +15777,40 @@ var useColumns = (function (form) {
|
|
|
15613
15777
|
textAlign: 'right'
|
|
15614
15778
|
},
|
|
15615
15779
|
loading: isCipher(changeField, 'lineAmountIncludeTax'),
|
|
15780
|
+
readOnly: differenceInputStateEnabled,
|
|
15616
15781
|
onChange: function onChange() {
|
|
15617
15782
|
setChangeField('lineAmountIncludeTax');
|
|
15618
15783
|
onChangeLineAmountIncludeTax(controller, form, record);
|
|
15619
|
-
}
|
|
15784
|
+
},
|
|
15785
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
15786
|
+
controller.run( /*#__PURE__*/function () {
|
|
15787
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
|
|
15788
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
15789
|
+
while (1) {
|
|
15790
|
+
switch (_context13.prev = _context13.next) {
|
|
15791
|
+
case 0:
|
|
15792
|
+
s.differenceInputState.open = true;
|
|
15793
|
+
|
|
15794
|
+
case 1:
|
|
15795
|
+
case "end":
|
|
15796
|
+
return _context13.stop();
|
|
15797
|
+
}
|
|
15798
|
+
}
|
|
15799
|
+
}, _callee13);
|
|
15800
|
+
}));
|
|
15801
|
+
|
|
15802
|
+
return function (_x21) {
|
|
15803
|
+
return _ref3.apply(this, arguments);
|
|
15804
|
+
};
|
|
15805
|
+
}());
|
|
15806
|
+
} : undefined
|
|
15620
15807
|
})));
|
|
15621
15808
|
} else {
|
|
15622
15809
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
15623
15810
|
style: {
|
|
15624
15811
|
padding: '0 10px'
|
|
15625
15812
|
}
|
|
15626
|
-
}, formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
15813
|
+
}, formatSearch((isNaN(parseFloat(value)) ? 0 : parseFloat(value)).toFixed(2), searchValue));
|
|
15627
15814
|
}
|
|
15628
15815
|
}
|
|
15629
15816
|
}, {
|
|
@@ -15635,7 +15822,7 @@ var useColumns = (function (form) {
|
|
|
15635
15822
|
align: 'right',
|
|
15636
15823
|
width: 119,
|
|
15637
15824
|
render: function render(value, record) {
|
|
15638
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab') {
|
|
15825
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && model !== 'prefab' && !differenceInputStateEnabled) {
|
|
15639
15826
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('lineAmountExcludeTax', {
|
|
15640
15827
|
initialValue: editGood.lineAmountExcludeTax,
|
|
15641
15828
|
getValueFromEvent: onNumberValueChange,
|
|
@@ -15647,10 +15834,10 @@ var useColumns = (function (form) {
|
|
|
15647
15834
|
message: '金额必须为数字'
|
|
15648
15835
|
}, {
|
|
15649
15836
|
validator: function () {
|
|
15650
|
-
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15651
|
-
return _regeneratorRuntime().wrap(function
|
|
15837
|
+
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_, value, callback) {
|
|
15838
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
15652
15839
|
while (1) {
|
|
15653
|
-
switch (
|
|
15840
|
+
switch (_context14.prev = _context14.next) {
|
|
15654
15841
|
case 0:
|
|
15655
15842
|
if ("".concat(value).split('.')[0].length > priceIntegerDigit) {
|
|
15656
15843
|
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E".concat(priceIntegerDigit, "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D"));
|
|
@@ -15658,13 +15845,13 @@ var useColumns = (function (form) {
|
|
|
15658
15845
|
|
|
15659
15846
|
case 1:
|
|
15660
15847
|
case "end":
|
|
15661
|
-
return
|
|
15848
|
+
return _context14.stop();
|
|
15662
15849
|
}
|
|
15663
15850
|
}
|
|
15664
|
-
},
|
|
15851
|
+
}, _callee14);
|
|
15665
15852
|
}));
|
|
15666
15853
|
|
|
15667
|
-
function validator(
|
|
15854
|
+
function validator(_x22, _x23, _x24) {
|
|
15668
15855
|
return _validator7.apply(this, arguments);
|
|
15669
15856
|
}
|
|
15670
15857
|
|
|
@@ -15675,7 +15862,30 @@ var useColumns = (function (form) {
|
|
|
15675
15862
|
style: {
|
|
15676
15863
|
textAlign: 'right'
|
|
15677
15864
|
},
|
|
15865
|
+
readOnly: differenceInputStateEnabled,
|
|
15678
15866
|
loading: isCipher(changeField, 'lineAmountExcludeTax'),
|
|
15867
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
15868
|
+
controller.run( /*#__PURE__*/function () {
|
|
15869
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
|
|
15870
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
15871
|
+
while (1) {
|
|
15872
|
+
switch (_context15.prev = _context15.next) {
|
|
15873
|
+
case 0:
|
|
15874
|
+
s.differenceInputState.open = true;
|
|
15875
|
+
|
|
15876
|
+
case 1:
|
|
15877
|
+
case "end":
|
|
15878
|
+
return _context15.stop();
|
|
15879
|
+
}
|
|
15880
|
+
}
|
|
15881
|
+
}, _callee15);
|
|
15882
|
+
}));
|
|
15883
|
+
|
|
15884
|
+
return function (_x25) {
|
|
15885
|
+
return _ref4.apply(this, arguments);
|
|
15886
|
+
};
|
|
15887
|
+
}());
|
|
15888
|
+
} : undefined,
|
|
15679
15889
|
onChange: function onChange() {
|
|
15680
15890
|
setChangeField('lineAmountExcludeTax');
|
|
15681
15891
|
onChangeLineAmountExcludeTax(controller, form, record);
|
|
@@ -15686,7 +15896,7 @@ var useColumns = (function (form) {
|
|
|
15686
15896
|
style: {
|
|
15687
15897
|
padding: '0 10px'
|
|
15688
15898
|
}
|
|
15689
|
-
}, value === '' ? '' : formatSearch(parseFloat(value).toFixed(2), searchValue));
|
|
15899
|
+
}, value === '' ? '' : formatSearch((isNaN(parseFloat(value)) ? 0 : parseFloat(value)).toFixed(2), searchValue));
|
|
15690
15900
|
}
|
|
15691
15901
|
}
|
|
15692
15902
|
}, {
|
|
@@ -15764,11 +15974,12 @@ var useColumns = (function (form) {
|
|
|
15764
15974
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
15765
15975
|
|
|
15766
15976
|
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
15977
|
+
var deduction = controller.state.goodsListState.deduction || 0;
|
|
15767
15978
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
15768
15979
|
|
|
15769
15980
|
if (lineAmountExcludeTax && (taxRate || taxRate === 0) && lineAmountIncludeTax) {
|
|
15770
15981
|
// 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) {
|
|
15982
|
+
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
15983
|
|
|
15773
15984
|
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
15774
15985
|
callback();
|
|
@@ -15897,7 +16108,7 @@ var useColumns = (function (form) {
|
|
|
15897
16108
|
ellipsis: true
|
|
15898
16109
|
});
|
|
15899
16110
|
});
|
|
15900
|
-
}, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
|
|
16111
|
+
}, [isTaxIncluded, editGood, goodsList, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart, differenceInputStateEnabled]);
|
|
15901
16112
|
return controller.setColumnsConfig ? controller.setColumnsConfig(columns) : columns;
|
|
15902
16113
|
});
|
|
15903
16114
|
/** 字段 */
|
|
@@ -16230,61 +16441,6 @@ var useOnRow = (function () {
|
|
|
16230
16441
|
};
|
|
16231
16442
|
});
|
|
16232
16443
|
|
|
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
16444
|
/**
|
|
16289
16445
|
* 点击组件外部 保存正在编辑的货物
|
|
16290
16446
|
*/
|
|
@@ -16296,6 +16452,9 @@ function useWindowClick(controller) {
|
|
|
16296
16452
|
/** 点击组件外部 保存正在编辑的货物 */
|
|
16297
16453
|
React__default['default'].useEffect(function () {
|
|
16298
16454
|
var click = function click() {
|
|
16455
|
+
var _controller$state$goo;
|
|
16456
|
+
|
|
16457
|
+
if (!((_controller$state$goo = controller.state.goodsListState) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.isSaveRowOutside)) return;
|
|
16299
16458
|
setTimeout(controller.saveEditGood);
|
|
16300
16459
|
};
|
|
16301
16460
|
|
|
@@ -17867,9 +18026,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
17867
18026
|
}, [dataSource, searchValue, controller, isTaxIncluded]);
|
|
17868
18027
|
/** 表格行事件 */
|
|
17869
18028
|
|
|
17870
|
-
var _onRow = useOnRow();
|
|
18029
|
+
var _onRow = useOnRow(); // useDeduction(controller, props.deduction);
|
|
18030
|
+
|
|
17871
18031
|
|
|
17872
|
-
useDeduction(controller, props.deduction);
|
|
17873
18032
|
useWindowClick(controller);
|
|
17874
18033
|
/** 批量赋码 */
|
|
17875
18034
|
|
|
@@ -23187,8 +23346,8 @@ var AddRowButton$1 = (function () {
|
|
|
23187
23346
|
})), [controller, rootElement]);
|
|
23188
23347
|
if (isAddRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
23189
23348
|
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
|
-
|
|
23349
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null); // if (isDifferenceInput && goodsNum >= 1) return <></>;
|
|
23350
|
+
|
|
23192
23351
|
return /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
23193
23352
|
size: 'small',
|
|
23194
23353
|
type: 'primary',
|
|
@@ -23514,7 +23673,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
|
|
|
23514
23673
|
break;
|
|
23515
23674
|
}
|
|
23516
23675
|
|
|
23517
|
-
if (!(!err.priceIncludeTax && values.priceIncludeTax)) {
|
|
23676
|
+
if (!(!err.priceIncludeTax && values.priceIncludeTax && !controller.state.differenceInputState.enabled)) {
|
|
23518
23677
|
_context3.next = 26;
|
|
23519
23678
|
break;
|
|
23520
23679
|
}
|
|
@@ -23560,7 +23719,7 @@ var onChangeQuantity$1 = lazyFn$2(function (controller, form, record) {
|
|
|
23560
23719
|
break;
|
|
23561
23720
|
|
|
23562
23721
|
case 36:
|
|
23563
|
-
if (!(!err.priceExcludeTax && values.priceExcludeTax)) {
|
|
23722
|
+
if (!(!err.priceExcludeTax && values.priceExcludeTax && !controller.state.differenceInputState.enabled)) {
|
|
23564
23723
|
_context3.next = 44;
|
|
23565
23724
|
break;
|
|
23566
23725
|
}
|
|
@@ -25644,6 +25803,11 @@ var useColumns$1 = (function (form) {
|
|
|
25644
25803
|
var deduction = controller.useMemo(function (e) {
|
|
25645
25804
|
return e.goodsListState.deduction;
|
|
25646
25805
|
}, []);
|
|
25806
|
+
/** 差额开票是否启用 */
|
|
25807
|
+
|
|
25808
|
+
var differenceInputStateEnabled = controller.useMemo(function (e) {
|
|
25809
|
+
return e.differenceInputState.enabled;
|
|
25810
|
+
}, []);
|
|
25647
25811
|
/** 计算中启动字段 */
|
|
25648
25812
|
|
|
25649
25813
|
var changeField = controller.useMemo(function (e) {
|
|
@@ -25739,58 +25903,24 @@ var useColumns$1 = (function (form) {
|
|
|
25739
25903
|
}, getFieldDecorator('itemName', {
|
|
25740
25904
|
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
25741
25905
|
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
|
-
}])
|
|
25906
|
+
required: isValidateGood,
|
|
25907
|
+
message: '项目名称不能为空'
|
|
25908
|
+
} // {
|
|
25909
|
+
// validator: async (_, __, callback) => {
|
|
25910
|
+
// if (isValidateGood) {
|
|
25911
|
+
// await controller.wait();
|
|
25912
|
+
// const value = controller.state.goodsListState.editGood;
|
|
25913
|
+
// if (!value?.itemName && !value?.itemNameSelf) {
|
|
25914
|
+
// callback('项目名称不能为空');
|
|
25915
|
+
// } else {
|
|
25916
|
+
// return;
|
|
25917
|
+
// }
|
|
25918
|
+
// } else {
|
|
25919
|
+
// callback();
|
|
25920
|
+
// }
|
|
25921
|
+
// }
|
|
25922
|
+
// }
|
|
25923
|
+
])
|
|
25794
25924
|
})( /*#__PURE__*/React__default['default'].createElement(ItemNameInput$1, {
|
|
25795
25925
|
editGood: editGood,
|
|
25796
25926
|
shorthand: editGood.shorthand,
|
|
@@ -25806,22 +25936,22 @@ var useColumns$1 = (function (form) {
|
|
|
25806
25936
|
},
|
|
25807
25937
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgPlus$2, null),
|
|
25808
25938
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
25809
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25810
|
-
return _regeneratorRuntime().wrap(function
|
|
25939
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
25940
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
25811
25941
|
while (1) {
|
|
25812
|
-
switch (
|
|
25942
|
+
switch (_context2.prev = _context2.next) {
|
|
25813
25943
|
case 0:
|
|
25814
25944
|
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
25815
25945
|
|
|
25816
25946
|
case 1:
|
|
25817
25947
|
case "end":
|
|
25818
|
-
return
|
|
25948
|
+
return _context2.stop();
|
|
25819
25949
|
}
|
|
25820
25950
|
}
|
|
25821
|
-
},
|
|
25951
|
+
}, _callee2);
|
|
25822
25952
|
}));
|
|
25823
25953
|
|
|
25824
|
-
return function (
|
|
25954
|
+
return function (_x2) {
|
|
25825
25955
|
return _ref2.apply(this, arguments);
|
|
25826
25956
|
};
|
|
25827
25957
|
}())
|
|
@@ -25859,13 +25989,13 @@ var useColumns$1 = (function (form) {
|
|
|
25859
25989
|
rules: getReplenishRules('itemModelName')
|
|
25860
25990
|
})( /*#__PURE__*/React__default['default'].createElement(MyInput$3, {
|
|
25861
25991
|
onChange: function () {
|
|
25862
|
-
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25992
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
25863
25993
|
var key, value;
|
|
25864
|
-
return _regeneratorRuntime().wrap(function
|
|
25994
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
25865
25995
|
while (1) {
|
|
25866
|
-
switch (
|
|
25996
|
+
switch (_context3.prev = _context3.next) {
|
|
25867
25997
|
case 0:
|
|
25868
|
-
|
|
25998
|
+
_context3.next = 2;
|
|
25869
25999
|
return controller.wait();
|
|
25870
26000
|
|
|
25871
26001
|
case 2:
|
|
@@ -25876,10 +26006,10 @@ var useColumns$1 = (function (form) {
|
|
|
25876
26006
|
|
|
25877
26007
|
case 6:
|
|
25878
26008
|
case "end":
|
|
25879
|
-
return
|
|
26009
|
+
return _context3.stop();
|
|
25880
26010
|
}
|
|
25881
26011
|
}
|
|
25882
|
-
},
|
|
26012
|
+
}, _callee3);
|
|
25883
26013
|
}));
|
|
25884
26014
|
|
|
25885
26015
|
function onChange() {
|
|
@@ -25917,12 +26047,12 @@ var useColumns$1 = (function (form) {
|
|
|
25917
26047
|
return rootElement || document.body;
|
|
25918
26048
|
},
|
|
25919
26049
|
onChange: function () {
|
|
25920
|
-
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25921
|
-
return _regeneratorRuntime().wrap(function
|
|
26050
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
26051
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
25922
26052
|
while (1) {
|
|
25923
|
-
switch (
|
|
26053
|
+
switch (_context4.prev = _context4.next) {
|
|
25924
26054
|
case 0:
|
|
25925
|
-
|
|
26055
|
+
_context4.next = 2;
|
|
25926
26056
|
return controller.wait();
|
|
25927
26057
|
|
|
25928
26058
|
case 2:
|
|
@@ -25932,10 +26062,10 @@ var useColumns$1 = (function (form) {
|
|
|
25932
26062
|
|
|
25933
26063
|
case 3:
|
|
25934
26064
|
case "end":
|
|
25935
|
-
return
|
|
26065
|
+
return _context4.stop();
|
|
25936
26066
|
}
|
|
25937
26067
|
}
|
|
25938
|
-
},
|
|
26068
|
+
}, _callee4);
|
|
25939
26069
|
}));
|
|
25940
26070
|
|
|
25941
26071
|
function onChange() {
|
|
@@ -25971,18 +26101,18 @@ var useColumns$1 = (function (form) {
|
|
|
25971
26101
|
message: '数量必须为数字'
|
|
25972
26102
|
}, {
|
|
25973
26103
|
validator: function () {
|
|
25974
|
-
var
|
|
26104
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
|
|
25975
26105
|
var isvalue, isPrice;
|
|
25976
|
-
return _regeneratorRuntime().wrap(function
|
|
26106
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
25977
26107
|
while (1) {
|
|
25978
|
-
switch (
|
|
26108
|
+
switch (_context5.prev = _context5.next) {
|
|
25979
26109
|
case 0:
|
|
25980
26110
|
if (!isValidateGood) {
|
|
25981
|
-
|
|
26111
|
+
_context5.next = 10;
|
|
25982
26112
|
break;
|
|
25983
26113
|
}
|
|
25984
26114
|
|
|
25985
|
-
|
|
26115
|
+
_context5.next = 3;
|
|
25986
26116
|
return controller.wait();
|
|
25987
26117
|
|
|
25988
26118
|
case 3:
|
|
@@ -25990,15 +26120,15 @@ var useColumns$1 = (function (form) {
|
|
|
25990
26120
|
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
25991
26121
|
|
|
25992
26122
|
if (!(isvalue || isPrice === isvalue)) {
|
|
25993
|
-
|
|
26123
|
+
_context5.next = 7;
|
|
25994
26124
|
break;
|
|
25995
26125
|
}
|
|
25996
26126
|
|
|
25997
|
-
return
|
|
26127
|
+
return _context5.abrupt("return");
|
|
25998
26128
|
|
|
25999
26129
|
case 7:
|
|
26000
26130
|
callback('请输入数量');
|
|
26001
|
-
|
|
26131
|
+
_context5.next = 11;
|
|
26002
26132
|
break;
|
|
26003
26133
|
|
|
26004
26134
|
case 10:
|
|
@@ -26006,14 +26136,14 @@ var useColumns$1 = (function (form) {
|
|
|
26006
26136
|
|
|
26007
26137
|
case 11:
|
|
26008
26138
|
case "end":
|
|
26009
|
-
return
|
|
26139
|
+
return _context5.stop();
|
|
26010
26140
|
}
|
|
26011
26141
|
}
|
|
26012
|
-
},
|
|
26142
|
+
}, _callee5);
|
|
26013
26143
|
}));
|
|
26014
26144
|
|
|
26015
|
-
function validator(
|
|
26016
|
-
return
|
|
26145
|
+
function validator(_x3, _x4, _x5) {
|
|
26146
|
+
return _validator.apply(this, arguments);
|
|
26017
26147
|
}
|
|
26018
26148
|
|
|
26019
26149
|
return validator;
|
|
@@ -26026,21 +26156,21 @@ var useColumns$1 = (function (form) {
|
|
|
26026
26156
|
maxLength: 25,
|
|
26027
26157
|
loading: isCipher$1(changeField, "quantity"),
|
|
26028
26158
|
onChange: function () {
|
|
26029
|
-
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
26030
|
-
return _regeneratorRuntime().wrap(function
|
|
26159
|
+
var _onChange3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
26160
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
26031
26161
|
while (1) {
|
|
26032
|
-
switch (
|
|
26162
|
+
switch (_context6.prev = _context6.next) {
|
|
26033
26163
|
case 0:
|
|
26034
26164
|
setChangeField('quantity');
|
|
26035
|
-
|
|
26165
|
+
_context6.next = 3;
|
|
26036
26166
|
return onChangeQuantity$1(controller, form, record);
|
|
26037
26167
|
|
|
26038
26168
|
case 3:
|
|
26039
26169
|
case "end":
|
|
26040
|
-
return
|
|
26170
|
+
return _context6.stop();
|
|
26041
26171
|
}
|
|
26042
26172
|
}
|
|
26043
|
-
},
|
|
26173
|
+
}, _callee6);
|
|
26044
26174
|
}));
|
|
26045
26175
|
|
|
26046
26176
|
function onChange() {
|
|
@@ -26076,13 +26206,13 @@ var useColumns$1 = (function (form) {
|
|
|
26076
26206
|
message: '单价必须为数字'
|
|
26077
26207
|
}, {
|
|
26078
26208
|
validator: function () {
|
|
26079
|
-
var
|
|
26209
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
|
|
26080
26210
|
var isQuantity, isvalue;
|
|
26081
|
-
return _regeneratorRuntime().wrap(function
|
|
26211
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
26082
26212
|
while (1) {
|
|
26083
|
-
switch (
|
|
26213
|
+
switch (_context7.prev = _context7.next) {
|
|
26084
26214
|
case 0:
|
|
26085
|
-
|
|
26215
|
+
_context7.next = 2;
|
|
26086
26216
|
return controller.wait();
|
|
26087
26217
|
|
|
26088
26218
|
case 2:
|
|
@@ -26090,25 +26220,25 @@ var useColumns$1 = (function (form) {
|
|
|
26090
26220
|
isvalue = !!value || value === 0;
|
|
26091
26221
|
|
|
26092
26222
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
26093
|
-
|
|
26223
|
+
_context7.next = 6;
|
|
26094
26224
|
break;
|
|
26095
26225
|
}
|
|
26096
26226
|
|
|
26097
|
-
return
|
|
26227
|
+
return _context7.abrupt("return");
|
|
26098
26228
|
|
|
26099
26229
|
case 6:
|
|
26100
26230
|
callback('请输入单价');
|
|
26101
26231
|
|
|
26102
26232
|
case 7:
|
|
26103
26233
|
case "end":
|
|
26104
|
-
return
|
|
26234
|
+
return _context7.stop();
|
|
26105
26235
|
}
|
|
26106
26236
|
}
|
|
26107
|
-
},
|
|
26237
|
+
}, _callee7);
|
|
26108
26238
|
}));
|
|
26109
26239
|
|
|
26110
|
-
function validator(
|
|
26111
|
-
return
|
|
26240
|
+
function validator(_x6, _x7, _x8) {
|
|
26241
|
+
return _validator2.apply(this, arguments);
|
|
26112
26242
|
}
|
|
26113
26243
|
|
|
26114
26244
|
return validator;
|
|
@@ -26119,6 +26249,7 @@ var useColumns$1 = (function (form) {
|
|
|
26119
26249
|
textAlign: 'right'
|
|
26120
26250
|
},
|
|
26121
26251
|
maxLength: 25,
|
|
26252
|
+
disabled: differenceInputStateEnabled,
|
|
26122
26253
|
loading: isCipher$1(changeField, 'priceIncludeTax'),
|
|
26123
26254
|
onChange: function onChange() {
|
|
26124
26255
|
setChangeField('priceIncludeTax');
|
|
@@ -26151,13 +26282,13 @@ var useColumns$1 = (function (form) {
|
|
|
26151
26282
|
message: '单价必须为数字'
|
|
26152
26283
|
}, {
|
|
26153
26284
|
validator: function () {
|
|
26154
|
-
var
|
|
26285
|
+
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
26155
26286
|
var isQuantity, isvalue;
|
|
26156
|
-
return _regeneratorRuntime().wrap(function
|
|
26287
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
26157
26288
|
while (1) {
|
|
26158
|
-
switch (
|
|
26289
|
+
switch (_context8.prev = _context8.next) {
|
|
26159
26290
|
case 0:
|
|
26160
|
-
|
|
26291
|
+
_context8.next = 2;
|
|
26161
26292
|
return controller.wait();
|
|
26162
26293
|
|
|
26163
26294
|
case 2:
|
|
@@ -26165,25 +26296,25 @@ var useColumns$1 = (function (form) {
|
|
|
26165
26296
|
isvalue = !!value || value === 0;
|
|
26166
26297
|
|
|
26167
26298
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
26168
|
-
|
|
26299
|
+
_context8.next = 6;
|
|
26169
26300
|
break;
|
|
26170
26301
|
}
|
|
26171
26302
|
|
|
26172
|
-
return
|
|
26303
|
+
return _context8.abrupt("return");
|
|
26173
26304
|
|
|
26174
26305
|
case 6:
|
|
26175
26306
|
callback('请输入单价');
|
|
26176
26307
|
|
|
26177
26308
|
case 7:
|
|
26178
26309
|
case "end":
|
|
26179
|
-
return
|
|
26310
|
+
return _context8.stop();
|
|
26180
26311
|
}
|
|
26181
26312
|
}
|
|
26182
|
-
},
|
|
26313
|
+
}, _callee8);
|
|
26183
26314
|
}));
|
|
26184
26315
|
|
|
26185
|
-
function validator(
|
|
26186
|
-
return
|
|
26316
|
+
function validator(_x9, _x10, _x11) {
|
|
26317
|
+
return _validator3.apply(this, arguments);
|
|
26187
26318
|
}
|
|
26188
26319
|
|
|
26189
26320
|
return validator;
|
|
@@ -26194,6 +26325,7 @@ var useColumns$1 = (function (form) {
|
|
|
26194
26325
|
textAlign: 'right'
|
|
26195
26326
|
},
|
|
26196
26327
|
maxLength: 25,
|
|
26328
|
+
disabled: differenceInputStateEnabled,
|
|
26197
26329
|
loading: isCipher$1(changeField, 'priceExcludeTax'),
|
|
26198
26330
|
onChange: function onChange() {
|
|
26199
26331
|
setChangeField('priceExcludeTax');
|
|
@@ -26229,10 +26361,10 @@ var useColumns$1 = (function (form) {
|
|
|
26229
26361
|
message: '金额错误,请重新输入'
|
|
26230
26362
|
}, {
|
|
26231
26363
|
validator: function () {
|
|
26232
|
-
var
|
|
26233
|
-
return _regeneratorRuntime().wrap(function
|
|
26364
|
+
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
26365
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
26234
26366
|
while (1) {
|
|
26235
|
-
switch (
|
|
26367
|
+
switch (_context9.prev = _context9.next) {
|
|
26236
26368
|
case 0:
|
|
26237
26369
|
if ("".concat(value).split('.')[0].length > priceIntegerDigit) {
|
|
26238
26370
|
callback("\u91D1\u989D\u6574\u6570\u90E8\u5206\u4E0D\u80FD\u5927\u4E8E".concat(priceIntegerDigit, "\u4F4D\uFF0C\u5C0F\u6570\u70B9\u540E\u6700\u591A2\u4F4D"));
|
|
@@ -26240,24 +26372,24 @@ var useColumns$1 = (function (form) {
|
|
|
26240
26372
|
|
|
26241
26373
|
case 1:
|
|
26242
26374
|
case "end":
|
|
26243
|
-
return
|
|
26375
|
+
return _context9.stop();
|
|
26244
26376
|
}
|
|
26245
26377
|
}
|
|
26246
|
-
},
|
|
26378
|
+
}, _callee9);
|
|
26247
26379
|
}));
|
|
26248
26380
|
|
|
26249
|
-
function validator(
|
|
26250
|
-
return
|
|
26381
|
+
function validator(_x12, _x13, _x14) {
|
|
26382
|
+
return _validator4.apply(this, arguments);
|
|
26251
26383
|
}
|
|
26252
26384
|
|
|
26253
26385
|
return validator;
|
|
26254
26386
|
}()
|
|
26255
26387
|
}, {
|
|
26256
26388
|
validator: function () {
|
|
26257
|
-
var
|
|
26258
|
-
return _regeneratorRuntime().wrap(function
|
|
26389
|
+
var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
26390
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
26259
26391
|
while (1) {
|
|
26260
|
-
switch (
|
|
26392
|
+
switch (_context10.prev = _context10.next) {
|
|
26261
26393
|
case 0:
|
|
26262
26394
|
if (deduction && parseFloat(value) <= deduction) {
|
|
26263
26395
|
callback('扣除额不能大于等于价税合计');
|
|
@@ -26265,14 +26397,14 @@ var useColumns$1 = (function (form) {
|
|
|
26265
26397
|
|
|
26266
26398
|
case 1:
|
|
26267
26399
|
case "end":
|
|
26268
|
-
return
|
|
26400
|
+
return _context10.stop();
|
|
26269
26401
|
}
|
|
26270
26402
|
}
|
|
26271
|
-
},
|
|
26403
|
+
}, _callee10);
|
|
26272
26404
|
}));
|
|
26273
26405
|
|
|
26274
|
-
function validator(
|
|
26275
|
-
return
|
|
26406
|
+
function validator(_x15, _x16, _x17) {
|
|
26407
|
+
return _validator5.apply(this, arguments);
|
|
26276
26408
|
}
|
|
26277
26409
|
|
|
26278
26410
|
return validator;
|
|
@@ -26283,10 +26415,33 @@ var useColumns$1 = (function (form) {
|
|
|
26283
26415
|
textAlign: 'right'
|
|
26284
26416
|
},
|
|
26285
26417
|
loading: isCipher$1(changeField, 'lineAmountIncludeTax'),
|
|
26418
|
+
readOnly: differenceInputStateEnabled,
|
|
26286
26419
|
onChange: function onChange() {
|
|
26287
26420
|
setChangeField('lineAmountIncludeTax');
|
|
26288
26421
|
onChangeLineAmountIncludeTax$1(controller, form, record);
|
|
26289
|
-
}
|
|
26422
|
+
},
|
|
26423
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
26424
|
+
controller.run( /*#__PURE__*/function () {
|
|
26425
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
|
|
26426
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
26427
|
+
while (1) {
|
|
26428
|
+
switch (_context11.prev = _context11.next) {
|
|
26429
|
+
case 0:
|
|
26430
|
+
s.differenceInputState.open = true;
|
|
26431
|
+
|
|
26432
|
+
case 1:
|
|
26433
|
+
case "end":
|
|
26434
|
+
return _context11.stop();
|
|
26435
|
+
}
|
|
26436
|
+
}
|
|
26437
|
+
}, _callee11);
|
|
26438
|
+
}));
|
|
26439
|
+
|
|
26440
|
+
return function (_x18) {
|
|
26441
|
+
return _ref3.apply(this, arguments);
|
|
26442
|
+
};
|
|
26443
|
+
}());
|
|
26444
|
+
} : undefined
|
|
26290
26445
|
})));
|
|
26291
26446
|
} else {
|
|
26292
26447
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
@@ -26317,7 +26472,7 @@ var useColumns$1 = (function (form) {
|
|
|
26317
26472
|
message: '金额错误,请重新输入'
|
|
26318
26473
|
}, {
|
|
26319
26474
|
validator: function () {
|
|
26320
|
-
var
|
|
26475
|
+
var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_, value, callback) {
|
|
26321
26476
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
26322
26477
|
while (1) {
|
|
26323
26478
|
switch (_context12.prev = _context12.next) {
|
|
@@ -26334,8 +26489,8 @@ var useColumns$1 = (function (form) {
|
|
|
26334
26489
|
}, _callee12);
|
|
26335
26490
|
}));
|
|
26336
26491
|
|
|
26337
|
-
function validator(
|
|
26338
|
-
return
|
|
26492
|
+
function validator(_x19, _x20, _x21) {
|
|
26493
|
+
return _validator6.apply(this, arguments);
|
|
26339
26494
|
}
|
|
26340
26495
|
|
|
26341
26496
|
return validator;
|
|
@@ -26346,10 +26501,33 @@ var useColumns$1 = (function (form) {
|
|
|
26346
26501
|
textAlign: 'right'
|
|
26347
26502
|
},
|
|
26348
26503
|
loading: isCipher$1(changeField, 'lineAmountExcludeTax'),
|
|
26504
|
+
readOnly: differenceInputStateEnabled,
|
|
26349
26505
|
onChange: function onChange() {
|
|
26350
26506
|
setChangeField('lineAmountExcludeTax');
|
|
26351
26507
|
onChangeLineAmountExcludeTax$1(controller, form, record);
|
|
26352
|
-
}
|
|
26508
|
+
},
|
|
26509
|
+
onClick: differenceInputStateEnabled ? function () {
|
|
26510
|
+
controller.run( /*#__PURE__*/function () {
|
|
26511
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
|
|
26512
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
26513
|
+
while (1) {
|
|
26514
|
+
switch (_context13.prev = _context13.next) {
|
|
26515
|
+
case 0:
|
|
26516
|
+
s.differenceInputState.open = true;
|
|
26517
|
+
|
|
26518
|
+
case 1:
|
|
26519
|
+
case "end":
|
|
26520
|
+
return _context13.stop();
|
|
26521
|
+
}
|
|
26522
|
+
}
|
|
26523
|
+
}, _callee13);
|
|
26524
|
+
}));
|
|
26525
|
+
|
|
26526
|
+
return function (_x22) {
|
|
26527
|
+
return _ref4.apply(this, arguments);
|
|
26528
|
+
};
|
|
26529
|
+
}());
|
|
26530
|
+
} : undefined
|
|
26353
26531
|
})));
|
|
26354
26532
|
} else {
|
|
26355
26533
|
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
@@ -26431,12 +26609,12 @@ var useColumns$1 = (function (form) {
|
|
|
26431
26609
|
var lineAmountIncludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountIncludeTax) || 0; //不含税金额
|
|
26432
26610
|
// const lineAmountExcludeTax = lineAmountIncludeTax-value;
|
|
26433
26611
|
|
|
26612
|
+
var deduction = controller.state.goodsListState.deduction || 0;
|
|
26434
26613
|
var lineAmountExcludeTax = (editGood === null || editGood === void 0 ? void 0 : editGood.lineAmountExcludeTax) || 0;
|
|
26435
26614
|
var taxRate = editGood === null || editGood === void 0 ? void 0 : editGood.taxRate;
|
|
26436
26615
|
|
|
26437
26616
|
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) {
|
|
26617
|
+
var total = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).subtract(mathjs.bignumber(deduction || 0)).multiply(mathjs.bignumber(taxRate || 0)).divide(mathjs.bignumber(100));
|
|
26440
26618
|
|
|
26441
26619
|
if (Math.abs(total.subtract(mathjs.bignumber(value || 0)).done().toNumber()) <= 0.06) {
|
|
26442
26620
|
callback();
|
|
@@ -26498,7 +26676,7 @@ var useColumns$1 = (function (form) {
|
|
|
26498
26676
|
ellipsis: true
|
|
26499
26677
|
});
|
|
26500
26678
|
});
|
|
26501
|
-
}, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType]); // React.useEffect(() => {
|
|
26679
|
+
}, [isTaxIncluded, editGood, controller, taxRateList, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart, calculateType, differenceInputStateEnabled]); // React.useEffect(() => {
|
|
26502
26680
|
// clearTimeout(t)
|
|
26503
26681
|
// const t = setTimeout(() => { setChangeField('') }, 1000);
|
|
26504
26682
|
// return () => { clearTimeout(t) }
|
|
@@ -26827,6 +27005,9 @@ function useWindowClick$1(controller) {
|
|
|
26827
27005
|
/** 点击组件外部 保存正在编辑的货物 */
|
|
26828
27006
|
React__default['default'].useEffect(function () {
|
|
26829
27007
|
var click = function click() {
|
|
27008
|
+
var _controller$state$goo;
|
|
27009
|
+
|
|
27010
|
+
if (!((_controller$state$goo = controller.state.goodsListState) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.isSaveRowOutside)) return;
|
|
26830
27011
|
setTimeout(controller.saveEditGood);
|
|
26831
27012
|
};
|
|
26832
27013
|
|
|
@@ -33854,6 +34035,7 @@ var DrawerBody$4 = function DrawerBody(props) {
|
|
|
33854
34035
|
|
|
33855
34036
|
|
|
33856
34037
|
var onSubmit = React__default['default'].useCallback(function (values) {
|
|
34038
|
+
console.log('天开组件', '点击了赋码确定按钮 ===>', values);
|
|
33857
34039
|
controller.pipeline( /*#__PURE__*/function () {
|
|
33858
34040
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
|
|
33859
34041
|
var endowCodeGood;
|
|
@@ -33861,8 +34043,11 @@ var DrawerBody$4 = function DrawerBody(props) {
|
|
|
33861
34043
|
while (1) {
|
|
33862
34044
|
switch (_context15.prev = _context15.next) {
|
|
33863
34045
|
case 0:
|
|
34046
|
+
// const endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(e => s.goodsListState.goodsMap.get(e));
|
|
33864
34047
|
endowCodeGood = s.goodsListState.endowCode.endowcodeGoodIndex.map(function (e) {
|
|
33865
|
-
return s.goodsListState.
|
|
34048
|
+
return s.goodsListState.goodsList.find(function (item) {
|
|
34049
|
+
return item.$index === e;
|
|
34050
|
+
});
|
|
33866
34051
|
}); // 赋码
|
|
33867
34052
|
|
|
33868
34053
|
endowCodeGood.forEach(function (good) {
|
|
@@ -33876,7 +34061,7 @@ var DrawerBody$4 = function DrawerBody(props) {
|
|
|
33876
34061
|
good.mtzlDm = undefined; //设置成空
|
|
33877
34062
|
// 无论是否含税,都保持价税合计不变
|
|
33878
34063
|
|
|
33879
|
-
good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
|
|
34064
|
+
good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction || 0, values.taxRate);
|
|
33880
34065
|
|
|
33881
34066
|
if (good.taxAmount || good.taxAmount === 0) {
|
|
33882
34067
|
good.lineAmountExcludeTax = countAmountExcludeTax(good.lineAmountIncludeTax || 0, good.taxAmount);
|
|
@@ -36962,9 +37147,50 @@ var VoucherType;
|
|
|
36962
37147
|
|
|
36963
37148
|
VoucherType["OTHER_DEDUCTION_VOUCHER"] = "09";
|
|
36964
37149
|
})(VoucherType || (VoucherType = {}));
|
|
36965
|
-
/**
|
|
37150
|
+
/** 最多只允许输入两位小数的校验器 */
|
|
36966
37151
|
|
|
36967
37152
|
|
|
37153
|
+
var maxTwoDecimalsValidator = function maxTwoDecimalsValidator(_rule, value) {
|
|
37154
|
+
if (value === undefined || value === null || value === '') {
|
|
37155
|
+
return Promise.resolve();
|
|
37156
|
+
}
|
|
37157
|
+
|
|
37158
|
+
var decimalPart = String(value).split('.')[1];
|
|
37159
|
+
|
|
37160
|
+
if (decimalPart && decimalPart.length > 2) {
|
|
37161
|
+
return Promise.reject(new Error('最多只能输入2位小数'));
|
|
37162
|
+
}
|
|
37163
|
+
|
|
37164
|
+
return Promise.resolve();
|
|
37165
|
+
};
|
|
37166
|
+
/** 凭证明细表单实例(用于跨字段校验:本次扣除金额 <= 凭证合计金额) */
|
|
37167
|
+
|
|
37168
|
+
var formInstance;
|
|
37169
|
+
/**
|
|
37170
|
+
* 本次扣除金额不能大于凭证合计金额的校验器
|
|
37171
|
+
*/
|
|
37172
|
+
|
|
37173
|
+
var deductAmtNotExceedVoucherTotalValidator = function deductAmtNotExceedVoucherTotalValidator(_rule, value) {
|
|
37174
|
+
var _formInstance;
|
|
37175
|
+
|
|
37176
|
+
if (value === undefined || value === null || value === '') {
|
|
37177
|
+
return Promise.resolve();
|
|
37178
|
+
}
|
|
37179
|
+
|
|
37180
|
+
var voucherTotalAmt = (_formInstance = formInstance) === null || _formInstance === void 0 ? void 0 : _formInstance.getFieldValue('voucherTotalAmt');
|
|
37181
|
+
|
|
37182
|
+
if (voucherTotalAmt === undefined || voucherTotalAmt === null || voucherTotalAmt === '') {
|
|
37183
|
+
return Promise.resolve();
|
|
37184
|
+
}
|
|
37185
|
+
|
|
37186
|
+
if (Number(value) > Number(voucherTotalAmt)) {
|
|
37187
|
+
return Promise.reject(new Error('本次扣除金额不能大于凭证合计金额'));
|
|
37188
|
+
}
|
|
37189
|
+
|
|
37190
|
+
return Promise.resolve();
|
|
37191
|
+
};
|
|
37192
|
+
/** 凭证类型候选项 */
|
|
37193
|
+
|
|
36968
37194
|
var voucherTypeOptions = [{
|
|
36969
37195
|
value: VoucherType.SPECIAL_INVOICE,
|
|
36970
37196
|
label: '专用发票'
|
|
@@ -37148,19 +37374,36 @@ function DifferenceInputModal(props) {
|
|
|
37148
37374
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
37149
37375
|
form = _Form$useForm2[0];
|
|
37150
37376
|
|
|
37377
|
+
var _Form$useForm3 = ktsComponentsAntdX4.Form.useForm(),
|
|
37378
|
+
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
37379
|
+
topForm = _Form$useForm4[0];
|
|
37380
|
+
/** 记录表单实例,供跨字段校验使用 */
|
|
37381
|
+
|
|
37382
|
+
|
|
37383
|
+
React__default['default'].useEffect(function () {
|
|
37384
|
+
formInstance = form;
|
|
37385
|
+
return function () {
|
|
37386
|
+
formInstance = undefined;
|
|
37387
|
+
};
|
|
37388
|
+
}, [form]);
|
|
37389
|
+
|
|
37151
37390
|
var _React$useState = React__default['default'].useState([]),
|
|
37152
37391
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
37153
37392
|
dataSource = _React$useState2[0],
|
|
37154
37393
|
setDataSource = _React$useState2[1];
|
|
37155
37394
|
|
|
37156
37395
|
var voucherType = ktsComponentsAntdX4.Form.useWatch('voucherType', form) || form.getFieldValue('voucherType');
|
|
37396
|
+
var projectCode = ktsComponentsAntdX4.Form.useWatch('projectCode', topForm) || topForm.getFieldValue('projectCode');
|
|
37397
|
+
/** 凭证合计金额(用于联动校验本次扣除金额) */
|
|
37157
37398
|
|
|
37158
|
-
var
|
|
37159
|
-
|
|
37160
|
-
projectCode = _React$useState4[0],
|
|
37161
|
-
setProjectCode = _React$useState4[1];
|
|
37162
|
-
/** 扣除额 (明细汇总) */
|
|
37399
|
+
var voucherTotalAmt = ktsComponentsAntdX4.Form.useWatch('voucherTotalAmt', form);
|
|
37400
|
+
/** 凭证合计金额变化时,重新校验本次扣除金额 */
|
|
37163
37401
|
|
|
37402
|
+
React__default['default'].useEffect(function () {
|
|
37403
|
+
if (!form.isFieldTouched('currentDeductAmt')) return;
|
|
37404
|
+
form.validateFields(['currentDeductAmt']).catch(function () {});
|
|
37405
|
+
}, [form, voucherTotalAmt]);
|
|
37406
|
+
/** 扣除额 (明细汇总) */
|
|
37164
37407
|
|
|
37165
37408
|
var deductTotal = React__default['default'].useMemo(function () {
|
|
37166
37409
|
return dataSource.reduce(function (acc, curr) {
|
|
@@ -37175,8 +37418,8 @@ function DifferenceInputModal(props) {
|
|
|
37175
37418
|
}, 0);
|
|
37176
37419
|
}, [dataSource]);
|
|
37177
37420
|
var total = props.total || {
|
|
37178
|
-
voucherTotal:
|
|
37179
|
-
deductTotal:
|
|
37421
|
+
voucherTotal: voucherTotal,
|
|
37422
|
+
deductTotal: deductTotal
|
|
37180
37423
|
};
|
|
37181
37424
|
var onFinish = React__default['default'].useCallback(function (values) {
|
|
37182
37425
|
setDataSource([].concat(_toConsumableArray(dataSource), [_objectSpread2(_objectSpread2({}, values), {}, {
|
|
@@ -37185,15 +37428,42 @@ function DifferenceInputModal(props) {
|
|
|
37185
37428
|
})]));
|
|
37186
37429
|
form.resetFields();
|
|
37187
37430
|
}, [dataSource, form]);
|
|
37431
|
+
var onOkClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37432
|
+
var values;
|
|
37433
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37434
|
+
while (1) {
|
|
37435
|
+
switch (_context.prev = _context.next) {
|
|
37436
|
+
case 0:
|
|
37437
|
+
_context.next = 2;
|
|
37438
|
+
return topForm.validateFields();
|
|
37439
|
+
|
|
37440
|
+
case 2:
|
|
37441
|
+
values = _context.sent;
|
|
37442
|
+
onOk === null || onOk === void 0 ? void 0 : onOk(_objectSpread2(_objectSpread2({}, values), {}, {
|
|
37443
|
+
deductTotal: deductTotal,
|
|
37444
|
+
rows: dataSource
|
|
37445
|
+
}));
|
|
37446
|
+
|
|
37447
|
+
case 4:
|
|
37448
|
+
case "end":
|
|
37449
|
+
return _context.stop();
|
|
37450
|
+
}
|
|
37451
|
+
}
|
|
37452
|
+
}, _callee);
|
|
37453
|
+
})), [dataSource, onOk]);
|
|
37188
37454
|
React__default['default'].useEffect(function () {
|
|
37189
37455
|
console.log('DifferenceInputModal props.value ===>', props.value);
|
|
37190
37456
|
|
|
37191
37457
|
if (open) {
|
|
37192
|
-
var _props$value, _props$value2;
|
|
37458
|
+
var _props$value, _props$value2, _props$value3;
|
|
37193
37459
|
|
|
37194
37460
|
form.resetFields();
|
|
37195
|
-
|
|
37196
|
-
|
|
37461
|
+
topForm.resetFields();
|
|
37462
|
+
topForm.setFieldsValue({
|
|
37463
|
+
amountIncludeTax: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.amountIncludeTax,
|
|
37464
|
+
projectCode: (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.projectCode
|
|
37465
|
+
});
|
|
37466
|
+
setDataSource(((_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.rows) || []);
|
|
37197
37467
|
}
|
|
37198
37468
|
}, [open, props.value]);
|
|
37199
37469
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Modal, {
|
|
@@ -37209,20 +37479,14 @@ function DifferenceInputModal(props) {
|
|
|
37209
37479
|
onClick: onCancel
|
|
37210
37480
|
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
37211
37481
|
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
|
-
}
|
|
37482
|
+
onClick: onOkClick
|
|
37220
37483
|
}, "\u786E\u5B9A"))
|
|
37221
37484
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
37222
37485
|
className: "kts-difference-modal"
|
|
37223
37486
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
37224
37487
|
className: "kts-difference-modal-top"
|
|
37225
37488
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form, {
|
|
37489
|
+
form: topForm,
|
|
37226
37490
|
layout: 'horizontal',
|
|
37227
37491
|
className: "kts-difference-modal-top-form",
|
|
37228
37492
|
labelCol: {
|
|
@@ -37231,15 +37495,20 @@ function DifferenceInputModal(props) {
|
|
|
37231
37495
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Row, null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37232
37496
|
span: 12
|
|
37233
37497
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
37498
|
+
name: 'amountIncludeTax',
|
|
37234
37499
|
label: "\u542B\u7A0E\u9500\u552E\u989D",
|
|
37235
|
-
className: "kts-difference-modal-item"
|
|
37500
|
+
className: "kts-difference-modal-item",
|
|
37501
|
+
rules: [{
|
|
37502
|
+
required: true,
|
|
37503
|
+
message: '请输入含税销售额'
|
|
37504
|
+
}, {
|
|
37505
|
+
validator: maxTwoDecimalsValidator
|
|
37506
|
+
}]
|
|
37236
37507
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.InputNumber, {
|
|
37237
37508
|
style: {
|
|
37238
37509
|
width: '100%'
|
|
37239
37510
|
},
|
|
37240
|
-
|
|
37241
|
-
placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D",
|
|
37242
|
-
value: voucherTotal || 0
|
|
37511
|
+
placeholder: "\u8BF7\u8F93\u5165\u542B\u7A0E\u9500\u552E\u989D"
|
|
37243
37512
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37244
37513
|
span: 12
|
|
37245
37514
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
@@ -37255,15 +37524,16 @@ function DifferenceInputModal(props) {
|
|
|
37255
37524
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37256
37525
|
span: 24
|
|
37257
37526
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
37527
|
+
name: 'projectCode',
|
|
37258
37528
|
label: "\u7533\u62A5\u9879\u76EE\u540D\u79F0",
|
|
37259
|
-
className: "kts-difference-modal-item"
|
|
37529
|
+
className: "kts-difference-modal-item",
|
|
37530
|
+
rules: [{
|
|
37531
|
+
required: true,
|
|
37532
|
+
message: '请选择申报项目名称'
|
|
37533
|
+
}]
|
|
37260
37534
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Select, {
|
|
37261
37535
|
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
|
|
37536
|
+
placeholder: "\u8BF7\u9009\u62E9\u7533\u62A5\u9879\u76EE\u540D\u79F0"
|
|
37267
37537
|
}))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Col, {
|
|
37268
37538
|
span: 24
|
|
37269
37539
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Form.Item, {
|
|
@@ -37347,7 +37617,9 @@ function DifferenceInputModal(props) {
|
|
|
37347
37617
|
name: 'voucherTotalAmt',
|
|
37348
37618
|
label: "\u51ED\u8BC1\u5408\u8BA1\u91D1\u989D",
|
|
37349
37619
|
className: "kts-difference-modal-cell",
|
|
37350
|
-
rules: (_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']
|
|
37620
|
+
rules: [].concat(_toConsumableArray(((_voucherTypeRules$vou4 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou4 === void 0 ? void 0 : _voucherTypeRules$vou4['voucherTotalAmt']) || []), [{
|
|
37621
|
+
validator: maxTwoDecimalsValidator
|
|
37622
|
+
}])
|
|
37351
37623
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.InputNumber, {
|
|
37352
37624
|
style: {
|
|
37353
37625
|
width: '100%'
|
|
@@ -37359,7 +37631,11 @@ function DifferenceInputModal(props) {
|
|
|
37359
37631
|
name: 'currentDeductAmt',
|
|
37360
37632
|
label: "\u672C\u6B21\u6263\u9664\u91D1\u989D",
|
|
37361
37633
|
className: "kts-difference-modal-cell",
|
|
37362
|
-
rules: (_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']
|
|
37634
|
+
rules: [].concat(_toConsumableArray(((_voucherTypeRules$vou5 = voucherTypeRules[voucherType]) === null || _voucherTypeRules$vou5 === void 0 ? void 0 : _voucherTypeRules$vou5['currentDeductAmt']) || []), [{
|
|
37635
|
+
validator: maxTwoDecimalsValidator
|
|
37636
|
+
}, {
|
|
37637
|
+
validator: deductAmtNotExceedVoucherTotalValidator
|
|
37638
|
+
}])
|
|
37363
37639
|
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.InputNumber, {
|
|
37364
37640
|
style: {
|
|
37365
37641
|
width: '100%'
|
|
@@ -37388,7 +37664,7 @@ function DifferenceInputModal(props) {
|
|
|
37388
37664
|
onClick: function onClick() {
|
|
37389
37665
|
return form.resetFields();
|
|
37390
37666
|
}
|
|
37391
|
-
}, "\u6E05\
|
|
37667
|
+
}, "\u6E05\u9664"), /*#__PURE__*/React__default['default'].createElement(ktsXui.Button, {
|
|
37392
37668
|
type: 'primary',
|
|
37393
37669
|
size: 'small',
|
|
37394
37670
|
onClick: function onClick() {
|
|
@@ -37450,64 +37726,193 @@ var DifferenceInput = (function () {
|
|
|
37450
37726
|
var data = controller.useMemo(function (s) {
|
|
37451
37727
|
return s.differenceInputState.data;
|
|
37452
37728
|
}, []);
|
|
37729
|
+
/** 计算中启动字段 */
|
|
37730
|
+
|
|
37731
|
+
var setChangeField = React__default['default'].useCallback(function (value) {
|
|
37732
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37733
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
37734
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37735
|
+
while (1) {
|
|
37736
|
+
switch (_context.prev = _context.next) {
|
|
37737
|
+
case 0:
|
|
37738
|
+
s.calculatingField = value;
|
|
37739
|
+
|
|
37740
|
+
case 1:
|
|
37741
|
+
case "end":
|
|
37742
|
+
return _context.stop();
|
|
37743
|
+
}
|
|
37744
|
+
}
|
|
37745
|
+
}, _callee);
|
|
37746
|
+
}));
|
|
37747
|
+
|
|
37748
|
+
return function (_x) {
|
|
37749
|
+
return _ref.apply(this, arguments);
|
|
37750
|
+
};
|
|
37751
|
+
}());
|
|
37752
|
+
}, []);
|
|
37453
37753
|
var value = React__default['default'].useMemo(function () {
|
|
37754
|
+
var _controller$state$goo;
|
|
37755
|
+
|
|
37454
37756
|
return {
|
|
37455
37757
|
rows: (data === null || data === void 0 ? void 0 : data.rows) || [],
|
|
37456
37758
|
projectCode: (data === null || data === void 0 ? void 0 : data.projectCode) || '',
|
|
37457
|
-
|
|
37458
|
-
|
|
37759
|
+
deductTotal: (data === null || data === void 0 ? void 0 : data.deductTotal) || 0,
|
|
37760
|
+
amountIncludeTax: ((_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.getFieldValue('lineAmountIncludeTax')) || 0
|
|
37459
37761
|
};
|
|
37460
37762
|
}, [data, open]);
|
|
37461
|
-
|
|
37462
|
-
|
|
37463
|
-
|
|
37464
|
-
open
|
|
37465
|
-
onCancel: function onCancel() {
|
|
37763
|
+
React__default['default'].useEffect(function () {
|
|
37764
|
+
controller.state.goodsListState.isSaveRowOutside = !open;
|
|
37765
|
+
|
|
37766
|
+
if (open) {
|
|
37466
37767
|
controller.run( /*#__PURE__*/function () {
|
|
37467
|
-
var
|
|
37468
|
-
|
|
37768
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
37769
|
+
var _s$goodsListState$for;
|
|
37770
|
+
|
|
37771
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
37469
37772
|
while (1) {
|
|
37470
|
-
switch (
|
|
37773
|
+
switch (_context2.prev = _context2.next) {
|
|
37471
37774
|
case 0:
|
|
37472
|
-
s.differenceInputState.
|
|
37775
|
+
if (s.differenceInputState.data) {
|
|
37776
|
+
_context2.next = 2;
|
|
37777
|
+
break;
|
|
37778
|
+
}
|
|
37473
37779
|
|
|
37474
|
-
|
|
37780
|
+
return _context2.abrupt("return");
|
|
37781
|
+
|
|
37782
|
+
case 2:
|
|
37783
|
+
s.differenceInputState.data.amountIncludeTax = (_s$goodsListState$for = s.goodsListState.form) === null || _s$goodsListState$for === void 0 ? void 0 : _s$goodsListState$for.getFieldValue('lineAmountIncludeTax');
|
|
37784
|
+
|
|
37785
|
+
case 3:
|
|
37475
37786
|
case "end":
|
|
37476
|
-
return
|
|
37787
|
+
return _context2.stop();
|
|
37477
37788
|
}
|
|
37478
37789
|
}
|
|
37479
|
-
},
|
|
37790
|
+
}, _callee2);
|
|
37480
37791
|
}));
|
|
37481
37792
|
|
|
37482
|
-
return function (
|
|
37483
|
-
return
|
|
37793
|
+
return function (_x2) {
|
|
37794
|
+
return _ref2.apply(this, arguments);
|
|
37484
37795
|
};
|
|
37485
37796
|
}());
|
|
37486
|
-
}
|
|
37487
|
-
|
|
37797
|
+
}
|
|
37798
|
+
}, [open]);
|
|
37799
|
+
console.log('DifferenceInput data ===>', data);
|
|
37800
|
+
return /*#__PURE__*/React__default['default'].createElement(DifferenceInputModal, {
|
|
37801
|
+
value: value,
|
|
37802
|
+
open: open,
|
|
37803
|
+
onCancel: function onCancel() {
|
|
37488
37804
|
controller.run( /*#__PURE__*/function () {
|
|
37489
|
-
var
|
|
37490
|
-
return _regeneratorRuntime().wrap(function
|
|
37805
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
37806
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
37491
37807
|
while (1) {
|
|
37492
|
-
switch (
|
|
37808
|
+
switch (_context3.prev = _context3.next) {
|
|
37493
37809
|
case 0:
|
|
37494
|
-
s.differenceInputState.data = data;
|
|
37495
|
-
s.goodsListState.deduction = data.deductTotal;
|
|
37496
37810
|
s.differenceInputState.open = false;
|
|
37497
37811
|
|
|
37498
|
-
case
|
|
37812
|
+
case 1:
|
|
37499
37813
|
case "end":
|
|
37500
|
-
return
|
|
37814
|
+
return _context3.stop();
|
|
37501
37815
|
}
|
|
37502
37816
|
}
|
|
37503
|
-
},
|
|
37817
|
+
}, _callee3);
|
|
37504
37818
|
}));
|
|
37505
37819
|
|
|
37506
|
-
return function (
|
|
37507
|
-
return
|
|
37820
|
+
return function (_x3) {
|
|
37821
|
+
return _ref3.apply(this, arguments);
|
|
37508
37822
|
};
|
|
37509
37823
|
}());
|
|
37510
|
-
}
|
|
37824
|
+
},
|
|
37825
|
+
onOk: function () {
|
|
37826
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(data) {
|
|
37827
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
37828
|
+
while (1) {
|
|
37829
|
+
switch (_context6.prev = _context6.next) {
|
|
37830
|
+
case 0:
|
|
37831
|
+
_context6.next = 2;
|
|
37832
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37833
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
37834
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
37835
|
+
while (1) {
|
|
37836
|
+
switch (_context4.prev = _context4.next) {
|
|
37837
|
+
case 0:
|
|
37838
|
+
s.goodsListState.isTaxIncluded = true;
|
|
37839
|
+
|
|
37840
|
+
case 1:
|
|
37841
|
+
case "end":
|
|
37842
|
+
return _context4.stop();
|
|
37843
|
+
}
|
|
37844
|
+
}
|
|
37845
|
+
}, _callee4);
|
|
37846
|
+
}));
|
|
37847
|
+
|
|
37848
|
+
return function (_x5) {
|
|
37849
|
+
return _ref4.apply(this, arguments);
|
|
37850
|
+
};
|
|
37851
|
+
}());
|
|
37852
|
+
|
|
37853
|
+
case 2:
|
|
37854
|
+
_context6.next = 4;
|
|
37855
|
+
return controller.wait();
|
|
37856
|
+
|
|
37857
|
+
case 4:
|
|
37858
|
+
_context6.next = 6;
|
|
37859
|
+
return controller.run( /*#__PURE__*/function () {
|
|
37860
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
37861
|
+
var amountIncludeTax, form, record, _s$goodsListState$for2;
|
|
37862
|
+
|
|
37863
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
37864
|
+
while (1) {
|
|
37865
|
+
switch (_context5.prev = _context5.next) {
|
|
37866
|
+
case 0:
|
|
37867
|
+
s.differenceInputState.data = data;
|
|
37868
|
+
s.goodsListState.deduction = data.deductTotal;
|
|
37869
|
+
s.differenceInputState.open = false;
|
|
37870
|
+
s.differenceInputState.amountIncludeTax = data.amountIncludeTax;
|
|
37871
|
+
amountIncludeTax = data.amountIncludeTax || 0; // const deductTotal = data.deductTotal || 0;
|
|
37872
|
+
|
|
37873
|
+
form = s.goodsListState.form;
|
|
37874
|
+
record = s.goodsListState.editGood;
|
|
37875
|
+
|
|
37876
|
+
if (!(s.goodsListState.goodsList && s.goodsListState.goodsList.length > 0)) {
|
|
37877
|
+
_context5.next = 13;
|
|
37878
|
+
break;
|
|
37879
|
+
}
|
|
37880
|
+
|
|
37881
|
+
s.goodsListState.editGood = record;
|
|
37882
|
+
(_s$goodsListState$for2 = s.goodsListState.form) === null || _s$goodsListState$for2 === void 0 ? void 0 : _s$goodsListState$for2.setFieldsValue({
|
|
37883
|
+
lineAmountIncludeTax: amountIncludeTax
|
|
37884
|
+
});
|
|
37885
|
+
setChangeField('lineAmountIncludeTax');
|
|
37886
|
+
_context5.next = 13;
|
|
37887
|
+
return onChangeLineAmountIncludeTax(controller, form, record);
|
|
37888
|
+
|
|
37889
|
+
case 13:
|
|
37890
|
+
case "end":
|
|
37891
|
+
return _context5.stop();
|
|
37892
|
+
}
|
|
37893
|
+
}
|
|
37894
|
+
}, _callee5);
|
|
37895
|
+
}));
|
|
37896
|
+
|
|
37897
|
+
return function (_x6) {
|
|
37898
|
+
return _ref5.apply(this, arguments);
|
|
37899
|
+
};
|
|
37900
|
+
}());
|
|
37901
|
+
|
|
37902
|
+
case 6:
|
|
37903
|
+
case "end":
|
|
37904
|
+
return _context6.stop();
|
|
37905
|
+
}
|
|
37906
|
+
}
|
|
37907
|
+
}, _callee6);
|
|
37908
|
+
}));
|
|
37909
|
+
|
|
37910
|
+
function onOk(_x4) {
|
|
37911
|
+
return _onOk.apply(this, arguments);
|
|
37912
|
+
}
|
|
37913
|
+
|
|
37914
|
+
return onOk;
|
|
37915
|
+
}()
|
|
37511
37916
|
});
|
|
37512
37917
|
});
|
|
37513
37918
|
|
|
@@ -37619,7 +38024,8 @@ var Main$7 = function Main(props) {
|
|
|
37619
38024
|
key = _React$useState2[0],
|
|
37620
38025
|
setKey = _React$useState2[1];
|
|
37621
38026
|
|
|
37622
|
-
useToGenerateId(controller);
|
|
38027
|
+
useToGenerateId(controller);
|
|
38028
|
+
useRecalculateTax(controller); // useClearGoodsList(controller);
|
|
37623
38029
|
|
|
37624
38030
|
React__default['default'].useEffect(function () {
|
|
37625
38031
|
setKey(key + 1);
|
|
@@ -37674,7 +38080,8 @@ var Digtal = function Digtal(props) {
|
|
|
37674
38080
|
key = _React$useState4[0],
|
|
37675
38081
|
setKey = _React$useState4[1];
|
|
37676
38082
|
|
|
37677
|
-
useToGenerateId(controller);
|
|
38083
|
+
useToGenerateId(controller);
|
|
38084
|
+
useRecalculateTax(controller); // useClearGoodsList(controller);
|
|
37678
38085
|
|
|
37679
38086
|
React__default['default'].useEffect(function () {
|
|
37680
38087
|
setKey(key + 1);
|