kts-component-invoice-operate 3.2.195 → 3.2.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +215 -101
- package/dist/index.js +215 -101
- package/package.json +1 -1
- package/src/Invoice/ui/digtal/FreightList/ui/AddRowButton/index.tsx +16 -6
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/autoFillFn/index.ts +16 -6
- package/src/Invoice/ui/digtal/GoodsList/hook/useColumns/index.tsx +1 -1
- package/src/Invoice/ui/digtal/GoodsList/ui/AddRowButton/index.tsx +16 -6
- package/src/Invoice/ui/digtal/GoodsList/ui/Search/index.tsx +14 -4
package/dist/index.esm.js
CHANGED
|
@@ -19133,53 +19133,82 @@ function addGood$2(_x) {
|
|
|
19133
19133
|
|
|
19134
19134
|
|
|
19135
19135
|
function _addGood$1() {
|
|
19136
|
-
_addGood$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
19137
|
-
return _regeneratorRuntime().wrap(function
|
|
19136
|
+
_addGood$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller) {
|
|
19137
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
19138
19138
|
while (1) {
|
|
19139
|
-
switch (
|
|
19139
|
+
switch (_context4.prev = _context4.next) {
|
|
19140
19140
|
case 0:
|
|
19141
|
-
|
|
19141
|
+
_context4.next = 2;
|
|
19142
19142
|
return controller.saveEditGood();
|
|
19143
19143
|
|
|
19144
19144
|
case 2:
|
|
19145
|
-
|
|
19145
|
+
_context4.next = 4;
|
|
19146
19146
|
return controller.wait();
|
|
19147
19147
|
|
|
19148
19148
|
case 4:
|
|
19149
|
-
|
|
19149
|
+
_context4.next = 6;
|
|
19150
19150
|
return controller.run( /*#__PURE__*/function () {
|
|
19151
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
19152
|
-
|
|
19151
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
19152
|
+
var _controller$state$goo;
|
|
19153
|
+
|
|
19154
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
19153
19155
|
while (1) {
|
|
19154
|
-
switch (
|
|
19156
|
+
switch (_context3.prev = _context3.next) {
|
|
19155
19157
|
case 0:
|
|
19156
19158
|
if (!s.goodsListState.editGood) {
|
|
19157
|
-
|
|
19159
|
+
_context3.next = 3;
|
|
19158
19160
|
break;
|
|
19159
19161
|
}
|
|
19160
19162
|
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
|
|
19163
|
+
_context3.next = 3;
|
|
19164
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
19165
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
19166
|
+
var firstError;
|
|
19167
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
19168
|
+
while (1) {
|
|
19169
|
+
switch (_context2.prev = _context2.next) {
|
|
19170
|
+
case 0:
|
|
19171
|
+
if (!err) {
|
|
19172
|
+
_context2.next = 4;
|
|
19173
|
+
break;
|
|
19174
|
+
}
|
|
19175
|
+
|
|
19176
|
+
firstError = Object.values(err)[0];
|
|
19177
|
+
message$1.error({
|
|
19178
|
+
content: firstError.errors[0].message,
|
|
19179
|
+
key: '你正在编辑一个货物'
|
|
19180
|
+
});
|
|
19181
|
+
return _context2.abrupt("return");
|
|
19182
|
+
|
|
19183
|
+
case 4:
|
|
19184
|
+
case "end":
|
|
19185
|
+
return _context2.stop();
|
|
19186
|
+
}
|
|
19187
|
+
}
|
|
19188
|
+
}, _callee2);
|
|
19189
|
+
}));
|
|
19190
|
+
|
|
19191
|
+
return function (_x5, _x6) {
|
|
19192
|
+
return _ref3.apply(this, arguments);
|
|
19193
|
+
};
|
|
19194
|
+
}());
|
|
19166
19195
|
|
|
19167
19196
|
case 3:
|
|
19168
|
-
|
|
19197
|
+
_context3.next = 5;
|
|
19169
19198
|
return controller.addGood({
|
|
19170
19199
|
taxRate: s.goodsListState.defaultRate,
|
|
19171
19200
|
lineAttribute: LineAttributeType$1.正常
|
|
19172
19201
|
});
|
|
19173
19202
|
|
|
19174
19203
|
case 5:
|
|
19175
|
-
s.goodsListState.editGood =
|
|
19204
|
+
s.goodsListState.editGood = _context3.sent;
|
|
19176
19205
|
|
|
19177
19206
|
case 6:
|
|
19178
19207
|
case "end":
|
|
19179
|
-
return
|
|
19208
|
+
return _context3.stop();
|
|
19180
19209
|
}
|
|
19181
19210
|
}
|
|
19182
|
-
},
|
|
19211
|
+
}, _callee3);
|
|
19183
19212
|
}));
|
|
19184
19213
|
|
|
19185
19214
|
return function (_x4) {
|
|
@@ -19189,10 +19218,10 @@ function _addGood$1() {
|
|
|
19189
19218
|
|
|
19190
19219
|
case 6:
|
|
19191
19220
|
case "end":
|
|
19192
|
-
return
|
|
19221
|
+
return _context4.stop();
|
|
19193
19222
|
}
|
|
19194
19223
|
}
|
|
19195
|
-
},
|
|
19224
|
+
}, _callee4);
|
|
19196
19225
|
}));
|
|
19197
19226
|
return _addGood$1.apply(this, arguments);
|
|
19198
19227
|
}
|
|
@@ -19202,34 +19231,34 @@ function rollBottom$1(_x2, _x3) {
|
|
|
19202
19231
|
}
|
|
19203
19232
|
|
|
19204
19233
|
function _rollBottom$1() {
|
|
19205
|
-
_rollBottom$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
19234
|
+
_rollBottom$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(controller, rootElement) {
|
|
19206
19235
|
var cont;
|
|
19207
|
-
return _regeneratorRuntime().wrap(function
|
|
19236
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
19208
19237
|
while (1) {
|
|
19209
|
-
switch (
|
|
19238
|
+
switch (_context5.prev = _context5.next) {
|
|
19210
19239
|
case 0:
|
|
19211
|
-
|
|
19240
|
+
_context5.next = 2;
|
|
19212
19241
|
return controller.wait();
|
|
19213
19242
|
|
|
19214
19243
|
case 2:
|
|
19215
19244
|
cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
|
|
19216
19245
|
|
|
19217
19246
|
if (cont) {
|
|
19218
|
-
|
|
19247
|
+
_context5.next = 5;
|
|
19219
19248
|
break;
|
|
19220
19249
|
}
|
|
19221
19250
|
|
|
19222
|
-
return
|
|
19251
|
+
return _context5.abrupt("return");
|
|
19223
19252
|
|
|
19224
19253
|
case 5:
|
|
19225
19254
|
cont.scrollTop = cont.scrollHeight;
|
|
19226
19255
|
|
|
19227
19256
|
case 6:
|
|
19228
19257
|
case "end":
|
|
19229
|
-
return
|
|
19258
|
+
return _context5.stop();
|
|
19230
19259
|
}
|
|
19231
19260
|
}
|
|
19232
|
-
},
|
|
19261
|
+
}, _callee5);
|
|
19233
19262
|
}));
|
|
19234
19263
|
return _rollBottom$1.apply(this, arguments);
|
|
19235
19264
|
}
|
|
@@ -20360,14 +20389,14 @@ var onChangeItemName$1 = /*#__PURE__*/function () {
|
|
|
20360
20389
|
/** 修改了含税开关 重新计算 */
|
|
20361
20390
|
|
|
20362
20391
|
var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
20363
|
-
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
20392
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(controller, isTaxIncluded) {
|
|
20364
20393
|
var calculatingDigits;
|
|
20365
|
-
return _regeneratorRuntime().wrap(function
|
|
20394
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
20366
20395
|
while (1) {
|
|
20367
|
-
switch (
|
|
20396
|
+
switch (_context22.prev = _context22.next) {
|
|
20368
20397
|
case 0:
|
|
20369
20398
|
if (controller.state.goodsListState.isRecalculateWhenSwitchTax) {
|
|
20370
|
-
|
|
20399
|
+
_context22.next = 3;
|
|
20371
20400
|
break;
|
|
20372
20401
|
}
|
|
20373
20402
|
|
|
@@ -20393,37 +20422,64 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
20393
20422
|
return _ref20.apply(this, arguments);
|
|
20394
20423
|
};
|
|
20395
20424
|
}())();
|
|
20396
|
-
return
|
|
20425
|
+
return _context22.abrupt("return");
|
|
20397
20426
|
|
|
20398
20427
|
case 3:
|
|
20399
20428
|
calculatingDigits = controller.state.calculatingDigits;
|
|
20400
|
-
|
|
20429
|
+
_context22.next = 6;
|
|
20401
20430
|
return controller.saveEditGood();
|
|
20402
20431
|
|
|
20403
20432
|
case 6:
|
|
20404
|
-
|
|
20433
|
+
_context22.next = 8;
|
|
20405
20434
|
return controller.wait();
|
|
20406
20435
|
|
|
20407
20436
|
case 8:
|
|
20408
|
-
|
|
20437
|
+
_context22.next = 10;
|
|
20409
20438
|
return controller.run( /*#__PURE__*/function () {
|
|
20410
|
-
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
20411
|
-
var _s$goodsListState, needRefresh, newGoodsList;
|
|
20439
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(s) {
|
|
20440
|
+
var _controller$state$goo, _s$goodsListState, needRefresh, newGoodsList;
|
|
20412
20441
|
|
|
20413
|
-
return _regeneratorRuntime().wrap(function
|
|
20442
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
20414
20443
|
while (1) {
|
|
20415
|
-
switch (
|
|
20444
|
+
switch (_context21.prev = _context21.next) {
|
|
20416
20445
|
case 0:
|
|
20417
20446
|
if (!s.goodsListState.editGood) {
|
|
20418
|
-
|
|
20447
|
+
_context21.next = 3;
|
|
20419
20448
|
break;
|
|
20420
20449
|
}
|
|
20421
20450
|
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20426
|
-
|
|
20451
|
+
_context21.next = 3;
|
|
20452
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
20453
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(err, values) {
|
|
20454
|
+
var firstError;
|
|
20455
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
20456
|
+
while (1) {
|
|
20457
|
+
switch (_context20.prev = _context20.next) {
|
|
20458
|
+
case 0:
|
|
20459
|
+
if (!err) {
|
|
20460
|
+
_context20.next = 4;
|
|
20461
|
+
break;
|
|
20462
|
+
}
|
|
20463
|
+
|
|
20464
|
+
firstError = Object.values(err)[0];
|
|
20465
|
+
message.error({
|
|
20466
|
+
content: firstError.errors[0].message,
|
|
20467
|
+
key: '你正在编辑一个货物'
|
|
20468
|
+
});
|
|
20469
|
+
return _context20.abrupt("return");
|
|
20470
|
+
|
|
20471
|
+
case 4:
|
|
20472
|
+
case "end":
|
|
20473
|
+
return _context20.stop();
|
|
20474
|
+
}
|
|
20475
|
+
}
|
|
20476
|
+
}, _callee20);
|
|
20477
|
+
}));
|
|
20478
|
+
|
|
20479
|
+
return function (_x40, _x41) {
|
|
20480
|
+
return _ref22.apply(this, arguments);
|
|
20481
|
+
};
|
|
20482
|
+
}());
|
|
20427
20483
|
|
|
20428
20484
|
case 3:
|
|
20429
20485
|
s.goodsListState.isTaxIncluded = isTaxIncluded;
|
|
@@ -20505,10 +20561,10 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
20505
20561
|
|
|
20506
20562
|
case 5:
|
|
20507
20563
|
case "end":
|
|
20508
|
-
return
|
|
20564
|
+
return _context21.stop();
|
|
20509
20565
|
}
|
|
20510
20566
|
}
|
|
20511
|
-
},
|
|
20567
|
+
}, _callee21);
|
|
20512
20568
|
}));
|
|
20513
20569
|
|
|
20514
20570
|
return function (_x39) {
|
|
@@ -20518,10 +20574,10 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
20518
20574
|
|
|
20519
20575
|
case 10:
|
|
20520
20576
|
case "end":
|
|
20521
|
-
return
|
|
20577
|
+
return _context22.stop();
|
|
20522
20578
|
}
|
|
20523
20579
|
}
|
|
20524
|
-
},
|
|
20580
|
+
}, _callee22);
|
|
20525
20581
|
}));
|
|
20526
20582
|
|
|
20527
20583
|
return function onChangeSwitchTax(_x36, _x37) {
|
|
@@ -20608,56 +20664,85 @@ function Search$1() {
|
|
|
20608
20664
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
20609
20665
|
return s.goodsListState.isTaxIncluded;
|
|
20610
20666
|
}, []);
|
|
20611
|
-
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
20612
|
-
|
|
20667
|
+
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
20668
|
+
var _controller$state$goo;
|
|
20669
|
+
|
|
20670
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
20613
20671
|
while (1) {
|
|
20614
|
-
switch (
|
|
20672
|
+
switch (_context2.prev = _context2.next) {
|
|
20615
20673
|
case 0:
|
|
20616
|
-
|
|
20674
|
+
_context2.next = 2;
|
|
20617
20675
|
return controller.saveEditGood();
|
|
20618
20676
|
|
|
20619
20677
|
case 2:
|
|
20620
|
-
|
|
20678
|
+
_context2.next = 4;
|
|
20621
20679
|
return controller.wait();
|
|
20622
20680
|
|
|
20623
20681
|
case 4:
|
|
20624
20682
|
if (!controller.state.goodsListState.editGood) {
|
|
20625
|
-
|
|
20683
|
+
_context2.next = 7;
|
|
20626
20684
|
break;
|
|
20627
20685
|
}
|
|
20628
20686
|
|
|
20629
|
-
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20687
|
+
_context2.next = 7;
|
|
20688
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
20689
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, values) {
|
|
20690
|
+
var firstError;
|
|
20691
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20692
|
+
while (1) {
|
|
20693
|
+
switch (_context.prev = _context.next) {
|
|
20694
|
+
case 0:
|
|
20695
|
+
if (!err) {
|
|
20696
|
+
_context.next = 4;
|
|
20697
|
+
break;
|
|
20698
|
+
}
|
|
20699
|
+
|
|
20700
|
+
firstError = Object.values(err)[0];
|
|
20701
|
+
message$1.error({
|
|
20702
|
+
content: firstError.errors[0].message,
|
|
20703
|
+
key: '你正在编辑一个货物'
|
|
20704
|
+
});
|
|
20705
|
+
return _context.abrupt("return");
|
|
20706
|
+
|
|
20707
|
+
case 4:
|
|
20708
|
+
case "end":
|
|
20709
|
+
return _context.stop();
|
|
20710
|
+
}
|
|
20711
|
+
}
|
|
20712
|
+
}, _callee);
|
|
20713
|
+
}));
|
|
20714
|
+
|
|
20715
|
+
return function (_x, _x2) {
|
|
20716
|
+
return _ref2.apply(this, arguments);
|
|
20717
|
+
};
|
|
20718
|
+
}());
|
|
20634
20719
|
|
|
20635
20720
|
case 7:
|
|
20636
20721
|
case "end":
|
|
20637
|
-
return
|
|
20722
|
+
return _context2.stop();
|
|
20638
20723
|
}
|
|
20639
20724
|
}
|
|
20640
|
-
},
|
|
20725
|
+
}, _callee2);
|
|
20641
20726
|
})), []);
|
|
20642
20727
|
React.useEffect(function () {
|
|
20643
20728
|
controller.run( /*#__PURE__*/function () {
|
|
20644
|
-
var
|
|
20645
|
-
return _regeneratorRuntime().wrap(function
|
|
20729
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
20730
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
20646
20731
|
while (1) {
|
|
20647
|
-
switch (
|
|
20732
|
+
switch (_context3.prev = _context3.next) {
|
|
20648
20733
|
case 0:
|
|
20649
20734
|
s.goodsListState.searchValue = value.trim();
|
|
20650
20735
|
|
|
20651
20736
|
case 1:
|
|
20652
20737
|
case "end":
|
|
20653
|
-
return
|
|
20738
|
+
return _context3.stop();
|
|
20654
20739
|
}
|
|
20655
20740
|
}
|
|
20656
|
-
},
|
|
20741
|
+
}, _callee3);
|
|
20657
20742
|
}));
|
|
20658
20743
|
|
|
20659
|
-
return function (
|
|
20660
|
-
return
|
|
20744
|
+
return function (_x3) {
|
|
20745
|
+
return _ref3.apply(this, arguments);
|
|
20661
20746
|
};
|
|
20662
20747
|
}());
|
|
20663
20748
|
}, [value, controller]);
|
|
@@ -22166,7 +22251,7 @@ var useColumns$1 = (function (form) {
|
|
|
22166
22251
|
align: 'right',
|
|
22167
22252
|
width: 119,
|
|
22168
22253
|
render: function render(value, record) {
|
|
22169
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxAmount')) {
|
|
22254
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxAmount') && model !== 'prefab') {
|
|
22170
22255
|
return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('taxAmount', {
|
|
22171
22256
|
initialValue: editGood.taxAmount,
|
|
22172
22257
|
rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
|
|
@@ -24815,50 +24900,79 @@ function addGood$3(_x) {
|
|
|
24815
24900
|
|
|
24816
24901
|
|
|
24817
24902
|
function _addGood$2() {
|
|
24818
|
-
_addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
24819
|
-
return _regeneratorRuntime().wrap(function
|
|
24903
|
+
_addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller) {
|
|
24904
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
24820
24905
|
while (1) {
|
|
24821
|
-
switch (
|
|
24906
|
+
switch (_context4.prev = _context4.next) {
|
|
24822
24907
|
case 0:
|
|
24823
|
-
|
|
24908
|
+
_context4.next = 2;
|
|
24824
24909
|
return controller.saveEditFreight();
|
|
24825
24910
|
|
|
24826
24911
|
case 2:
|
|
24827
|
-
|
|
24912
|
+
_context4.next = 4;
|
|
24828
24913
|
return controller.wait();
|
|
24829
24914
|
|
|
24830
24915
|
case 4:
|
|
24831
|
-
|
|
24916
|
+
_context4.next = 6;
|
|
24832
24917
|
return controller.run( /*#__PURE__*/function () {
|
|
24833
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
24834
|
-
|
|
24918
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
24919
|
+
var _controller$state$goo;
|
|
24920
|
+
|
|
24921
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
24835
24922
|
while (1) {
|
|
24836
|
-
switch (
|
|
24923
|
+
switch (_context3.prev = _context3.next) {
|
|
24837
24924
|
case 0:
|
|
24838
24925
|
if (!s.freightListState.editGood) {
|
|
24839
|
-
|
|
24926
|
+
_context3.next = 3;
|
|
24840
24927
|
break;
|
|
24841
24928
|
}
|
|
24842
24929
|
|
|
24843
|
-
|
|
24844
|
-
|
|
24845
|
-
|
|
24846
|
-
|
|
24847
|
-
|
|
24930
|
+
_context3.next = 3;
|
|
24931
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
24932
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
24933
|
+
var firstError;
|
|
24934
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
24935
|
+
while (1) {
|
|
24936
|
+
switch (_context2.prev = _context2.next) {
|
|
24937
|
+
case 0:
|
|
24938
|
+
if (!err) {
|
|
24939
|
+
_context2.next = 4;
|
|
24940
|
+
break;
|
|
24941
|
+
}
|
|
24942
|
+
|
|
24943
|
+
firstError = Object.values(err)[0];
|
|
24944
|
+
message$1.error({
|
|
24945
|
+
content: firstError.errors[0].message,
|
|
24946
|
+
key: '你正在编辑一个货物'
|
|
24947
|
+
});
|
|
24948
|
+
return _context2.abrupt("return");
|
|
24949
|
+
|
|
24950
|
+
case 4:
|
|
24951
|
+
case "end":
|
|
24952
|
+
return _context2.stop();
|
|
24953
|
+
}
|
|
24954
|
+
}
|
|
24955
|
+
}, _callee2);
|
|
24956
|
+
}));
|
|
24957
|
+
|
|
24958
|
+
return function (_x5, _x6) {
|
|
24959
|
+
return _ref3.apply(this, arguments);
|
|
24960
|
+
};
|
|
24961
|
+
}());
|
|
24848
24962
|
|
|
24849
24963
|
case 3:
|
|
24850
|
-
|
|
24964
|
+
_context3.next = 5;
|
|
24851
24965
|
return controller.addFreight({});
|
|
24852
24966
|
|
|
24853
24967
|
case 5:
|
|
24854
|
-
s.freightListState.editGood =
|
|
24968
|
+
s.freightListState.editGood = _context3.sent;
|
|
24855
24969
|
|
|
24856
24970
|
case 6:
|
|
24857
24971
|
case "end":
|
|
24858
|
-
return
|
|
24972
|
+
return _context3.stop();
|
|
24859
24973
|
}
|
|
24860
24974
|
}
|
|
24861
|
-
},
|
|
24975
|
+
}, _callee3);
|
|
24862
24976
|
}));
|
|
24863
24977
|
|
|
24864
24978
|
return function (_x4) {
|
|
@@ -24868,10 +24982,10 @@ function _addGood$2() {
|
|
|
24868
24982
|
|
|
24869
24983
|
case 6:
|
|
24870
24984
|
case "end":
|
|
24871
|
-
return
|
|
24985
|
+
return _context4.stop();
|
|
24872
24986
|
}
|
|
24873
24987
|
}
|
|
24874
|
-
},
|
|
24988
|
+
}, _callee4);
|
|
24875
24989
|
}));
|
|
24876
24990
|
return _addGood$2.apply(this, arguments);
|
|
24877
24991
|
}
|
|
@@ -24881,34 +24995,34 @@ function rollBottom$2(_x2, _x3) {
|
|
|
24881
24995
|
}
|
|
24882
24996
|
|
|
24883
24997
|
function _rollBottom$2() {
|
|
24884
|
-
_rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
24998
|
+
_rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(controller, rootElement) {
|
|
24885
24999
|
var cont;
|
|
24886
|
-
return _regeneratorRuntime().wrap(function
|
|
25000
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
24887
25001
|
while (1) {
|
|
24888
|
-
switch (
|
|
25002
|
+
switch (_context5.prev = _context5.next) {
|
|
24889
25003
|
case 0:
|
|
24890
|
-
|
|
25004
|
+
_context5.next = 2;
|
|
24891
25005
|
return controller.wait();
|
|
24892
25006
|
|
|
24893
25007
|
case 2:
|
|
24894
25008
|
cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
|
|
24895
25009
|
|
|
24896
25010
|
if (cont) {
|
|
24897
|
-
|
|
25011
|
+
_context5.next = 5;
|
|
24898
25012
|
break;
|
|
24899
25013
|
}
|
|
24900
25014
|
|
|
24901
|
-
return
|
|
25015
|
+
return _context5.abrupt("return");
|
|
24902
25016
|
|
|
24903
25017
|
case 5:
|
|
24904
25018
|
cont.scrollTop = cont.scrollHeight;
|
|
24905
25019
|
|
|
24906
25020
|
case 6:
|
|
24907
25021
|
case "end":
|
|
24908
|
-
return
|
|
25022
|
+
return _context5.stop();
|
|
24909
25023
|
}
|
|
24910
25024
|
}
|
|
24911
|
-
},
|
|
25025
|
+
}, _callee5);
|
|
24912
25026
|
}));
|
|
24913
25027
|
return _rollBottom$2.apply(this, arguments);
|
|
24914
25028
|
}
|
package/dist/index.js
CHANGED
|
@@ -19143,53 +19143,82 @@ function addGood$2(_x) {
|
|
|
19143
19143
|
|
|
19144
19144
|
|
|
19145
19145
|
function _addGood$1() {
|
|
19146
|
-
_addGood$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
19147
|
-
return _regeneratorRuntime().wrap(function
|
|
19146
|
+
_addGood$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller) {
|
|
19147
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
19148
19148
|
while (1) {
|
|
19149
|
-
switch (
|
|
19149
|
+
switch (_context4.prev = _context4.next) {
|
|
19150
19150
|
case 0:
|
|
19151
|
-
|
|
19151
|
+
_context4.next = 2;
|
|
19152
19152
|
return controller.saveEditGood();
|
|
19153
19153
|
|
|
19154
19154
|
case 2:
|
|
19155
|
-
|
|
19155
|
+
_context4.next = 4;
|
|
19156
19156
|
return controller.wait();
|
|
19157
19157
|
|
|
19158
19158
|
case 4:
|
|
19159
|
-
|
|
19159
|
+
_context4.next = 6;
|
|
19160
19160
|
return controller.run( /*#__PURE__*/function () {
|
|
19161
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
19162
|
-
|
|
19161
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
19162
|
+
var _controller$state$goo;
|
|
19163
|
+
|
|
19164
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
19163
19165
|
while (1) {
|
|
19164
|
-
switch (
|
|
19166
|
+
switch (_context3.prev = _context3.next) {
|
|
19165
19167
|
case 0:
|
|
19166
19168
|
if (!s.goodsListState.editGood) {
|
|
19167
|
-
|
|
19169
|
+
_context3.next = 3;
|
|
19168
19170
|
break;
|
|
19169
19171
|
}
|
|
19170
19172
|
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19173
|
+
_context3.next = 3;
|
|
19174
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
19175
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
19176
|
+
var firstError;
|
|
19177
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
19178
|
+
while (1) {
|
|
19179
|
+
switch (_context2.prev = _context2.next) {
|
|
19180
|
+
case 0:
|
|
19181
|
+
if (!err) {
|
|
19182
|
+
_context2.next = 4;
|
|
19183
|
+
break;
|
|
19184
|
+
}
|
|
19185
|
+
|
|
19186
|
+
firstError = Object.values(err)[0];
|
|
19187
|
+
ktsXui.message.error({
|
|
19188
|
+
content: firstError.errors[0].message,
|
|
19189
|
+
key: '你正在编辑一个货物'
|
|
19190
|
+
});
|
|
19191
|
+
return _context2.abrupt("return");
|
|
19192
|
+
|
|
19193
|
+
case 4:
|
|
19194
|
+
case "end":
|
|
19195
|
+
return _context2.stop();
|
|
19196
|
+
}
|
|
19197
|
+
}
|
|
19198
|
+
}, _callee2);
|
|
19199
|
+
}));
|
|
19200
|
+
|
|
19201
|
+
return function (_x5, _x6) {
|
|
19202
|
+
return _ref3.apply(this, arguments);
|
|
19203
|
+
};
|
|
19204
|
+
}());
|
|
19176
19205
|
|
|
19177
19206
|
case 3:
|
|
19178
|
-
|
|
19207
|
+
_context3.next = 5;
|
|
19179
19208
|
return controller.addGood({
|
|
19180
19209
|
taxRate: s.goodsListState.defaultRate,
|
|
19181
19210
|
lineAttribute: LineAttributeType$1.正常
|
|
19182
19211
|
});
|
|
19183
19212
|
|
|
19184
19213
|
case 5:
|
|
19185
|
-
s.goodsListState.editGood =
|
|
19214
|
+
s.goodsListState.editGood = _context3.sent;
|
|
19186
19215
|
|
|
19187
19216
|
case 6:
|
|
19188
19217
|
case "end":
|
|
19189
|
-
return
|
|
19218
|
+
return _context3.stop();
|
|
19190
19219
|
}
|
|
19191
19220
|
}
|
|
19192
|
-
},
|
|
19221
|
+
}, _callee3);
|
|
19193
19222
|
}));
|
|
19194
19223
|
|
|
19195
19224
|
return function (_x4) {
|
|
@@ -19199,10 +19228,10 @@ function _addGood$1() {
|
|
|
19199
19228
|
|
|
19200
19229
|
case 6:
|
|
19201
19230
|
case "end":
|
|
19202
|
-
return
|
|
19231
|
+
return _context4.stop();
|
|
19203
19232
|
}
|
|
19204
19233
|
}
|
|
19205
|
-
},
|
|
19234
|
+
}, _callee4);
|
|
19206
19235
|
}));
|
|
19207
19236
|
return _addGood$1.apply(this, arguments);
|
|
19208
19237
|
}
|
|
@@ -19212,34 +19241,34 @@ function rollBottom$1(_x2, _x3) {
|
|
|
19212
19241
|
}
|
|
19213
19242
|
|
|
19214
19243
|
function _rollBottom$1() {
|
|
19215
|
-
_rollBottom$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
19244
|
+
_rollBottom$1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(controller, rootElement) {
|
|
19216
19245
|
var cont;
|
|
19217
|
-
return _regeneratorRuntime().wrap(function
|
|
19246
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
19218
19247
|
while (1) {
|
|
19219
|
-
switch (
|
|
19248
|
+
switch (_context5.prev = _context5.next) {
|
|
19220
19249
|
case 0:
|
|
19221
|
-
|
|
19250
|
+
_context5.next = 2;
|
|
19222
19251
|
return controller.wait();
|
|
19223
19252
|
|
|
19224
19253
|
case 2:
|
|
19225
19254
|
cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
|
|
19226
19255
|
|
|
19227
19256
|
if (cont) {
|
|
19228
|
-
|
|
19257
|
+
_context5.next = 5;
|
|
19229
19258
|
break;
|
|
19230
19259
|
}
|
|
19231
19260
|
|
|
19232
|
-
return
|
|
19261
|
+
return _context5.abrupt("return");
|
|
19233
19262
|
|
|
19234
19263
|
case 5:
|
|
19235
19264
|
cont.scrollTop = cont.scrollHeight;
|
|
19236
19265
|
|
|
19237
19266
|
case 6:
|
|
19238
19267
|
case "end":
|
|
19239
|
-
return
|
|
19268
|
+
return _context5.stop();
|
|
19240
19269
|
}
|
|
19241
19270
|
}
|
|
19242
|
-
},
|
|
19271
|
+
}, _callee5);
|
|
19243
19272
|
}));
|
|
19244
19273
|
return _rollBottom$1.apply(this, arguments);
|
|
19245
19274
|
}
|
|
@@ -20370,14 +20399,14 @@ var onChangeItemName$1 = /*#__PURE__*/function () {
|
|
|
20370
20399
|
/** 修改了含税开关 重新计算 */
|
|
20371
20400
|
|
|
20372
20401
|
var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
20373
|
-
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
20402
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(controller, isTaxIncluded) {
|
|
20374
20403
|
var calculatingDigits;
|
|
20375
|
-
return _regeneratorRuntime().wrap(function
|
|
20404
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
20376
20405
|
while (1) {
|
|
20377
|
-
switch (
|
|
20406
|
+
switch (_context22.prev = _context22.next) {
|
|
20378
20407
|
case 0:
|
|
20379
20408
|
if (controller.state.goodsListState.isRecalculateWhenSwitchTax) {
|
|
20380
|
-
|
|
20409
|
+
_context22.next = 3;
|
|
20381
20410
|
break;
|
|
20382
20411
|
}
|
|
20383
20412
|
|
|
@@ -20403,37 +20432,64 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
20403
20432
|
return _ref20.apply(this, arguments);
|
|
20404
20433
|
};
|
|
20405
20434
|
}())();
|
|
20406
|
-
return
|
|
20435
|
+
return _context22.abrupt("return");
|
|
20407
20436
|
|
|
20408
20437
|
case 3:
|
|
20409
20438
|
calculatingDigits = controller.state.calculatingDigits;
|
|
20410
|
-
|
|
20439
|
+
_context22.next = 6;
|
|
20411
20440
|
return controller.saveEditGood();
|
|
20412
20441
|
|
|
20413
20442
|
case 6:
|
|
20414
|
-
|
|
20443
|
+
_context22.next = 8;
|
|
20415
20444
|
return controller.wait();
|
|
20416
20445
|
|
|
20417
20446
|
case 8:
|
|
20418
|
-
|
|
20447
|
+
_context22.next = 10;
|
|
20419
20448
|
return controller.run( /*#__PURE__*/function () {
|
|
20420
|
-
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
20421
|
-
var _s$goodsListState, needRefresh, newGoodsList;
|
|
20449
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(s) {
|
|
20450
|
+
var _controller$state$goo, _s$goodsListState, needRefresh, newGoodsList;
|
|
20422
20451
|
|
|
20423
|
-
return _regeneratorRuntime().wrap(function
|
|
20452
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
20424
20453
|
while (1) {
|
|
20425
|
-
switch (
|
|
20454
|
+
switch (_context21.prev = _context21.next) {
|
|
20426
20455
|
case 0:
|
|
20427
20456
|
if (!s.goodsListState.editGood) {
|
|
20428
|
-
|
|
20457
|
+
_context21.next = 3;
|
|
20429
20458
|
break;
|
|
20430
20459
|
}
|
|
20431
20460
|
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20461
|
+
_context21.next = 3;
|
|
20462
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
20463
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(err, values) {
|
|
20464
|
+
var firstError;
|
|
20465
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
20466
|
+
while (1) {
|
|
20467
|
+
switch (_context20.prev = _context20.next) {
|
|
20468
|
+
case 0:
|
|
20469
|
+
if (!err) {
|
|
20470
|
+
_context20.next = 4;
|
|
20471
|
+
break;
|
|
20472
|
+
}
|
|
20473
|
+
|
|
20474
|
+
firstError = Object.values(err)[0];
|
|
20475
|
+
ktsComponentsAntdX3.message.error({
|
|
20476
|
+
content: firstError.errors[0].message,
|
|
20477
|
+
key: '你正在编辑一个货物'
|
|
20478
|
+
});
|
|
20479
|
+
return _context20.abrupt("return");
|
|
20480
|
+
|
|
20481
|
+
case 4:
|
|
20482
|
+
case "end":
|
|
20483
|
+
return _context20.stop();
|
|
20484
|
+
}
|
|
20485
|
+
}
|
|
20486
|
+
}, _callee20);
|
|
20487
|
+
}));
|
|
20488
|
+
|
|
20489
|
+
return function (_x40, _x41) {
|
|
20490
|
+
return _ref22.apply(this, arguments);
|
|
20491
|
+
};
|
|
20492
|
+
}());
|
|
20437
20493
|
|
|
20438
20494
|
case 3:
|
|
20439
20495
|
s.goodsListState.isTaxIncluded = isTaxIncluded;
|
|
@@ -20515,10 +20571,10 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
20515
20571
|
|
|
20516
20572
|
case 5:
|
|
20517
20573
|
case "end":
|
|
20518
|
-
return
|
|
20574
|
+
return _context21.stop();
|
|
20519
20575
|
}
|
|
20520
20576
|
}
|
|
20521
|
-
},
|
|
20577
|
+
}, _callee21);
|
|
20522
20578
|
}));
|
|
20523
20579
|
|
|
20524
20580
|
return function (_x39) {
|
|
@@ -20528,10 +20584,10 @@ var onChangeSwitchTax$1 = /*#__PURE__*/function () {
|
|
|
20528
20584
|
|
|
20529
20585
|
case 10:
|
|
20530
20586
|
case "end":
|
|
20531
|
-
return
|
|
20587
|
+
return _context22.stop();
|
|
20532
20588
|
}
|
|
20533
20589
|
}
|
|
20534
|
-
},
|
|
20590
|
+
}, _callee22);
|
|
20535
20591
|
}));
|
|
20536
20592
|
|
|
20537
20593
|
return function onChangeSwitchTax(_x36, _x37) {
|
|
@@ -20618,56 +20674,85 @@ function Search$1() {
|
|
|
20618
20674
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
20619
20675
|
return s.goodsListState.isTaxIncluded;
|
|
20620
20676
|
}, []);
|
|
20621
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
20622
|
-
|
|
20677
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
20678
|
+
var _controller$state$goo;
|
|
20679
|
+
|
|
20680
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
20623
20681
|
while (1) {
|
|
20624
|
-
switch (
|
|
20682
|
+
switch (_context2.prev = _context2.next) {
|
|
20625
20683
|
case 0:
|
|
20626
|
-
|
|
20684
|
+
_context2.next = 2;
|
|
20627
20685
|
return controller.saveEditGood();
|
|
20628
20686
|
|
|
20629
20687
|
case 2:
|
|
20630
|
-
|
|
20688
|
+
_context2.next = 4;
|
|
20631
20689
|
return controller.wait();
|
|
20632
20690
|
|
|
20633
20691
|
case 4:
|
|
20634
20692
|
if (!controller.state.goodsListState.editGood) {
|
|
20635
|
-
|
|
20693
|
+
_context2.next = 7;
|
|
20636
20694
|
break;
|
|
20637
20695
|
}
|
|
20638
20696
|
|
|
20639
|
-
|
|
20640
|
-
|
|
20641
|
-
|
|
20642
|
-
|
|
20643
|
-
|
|
20697
|
+
_context2.next = 7;
|
|
20698
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
20699
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, values) {
|
|
20700
|
+
var firstError;
|
|
20701
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20702
|
+
while (1) {
|
|
20703
|
+
switch (_context.prev = _context.next) {
|
|
20704
|
+
case 0:
|
|
20705
|
+
if (!err) {
|
|
20706
|
+
_context.next = 4;
|
|
20707
|
+
break;
|
|
20708
|
+
}
|
|
20709
|
+
|
|
20710
|
+
firstError = Object.values(err)[0];
|
|
20711
|
+
ktsXui.message.error({
|
|
20712
|
+
content: firstError.errors[0].message,
|
|
20713
|
+
key: '你正在编辑一个货物'
|
|
20714
|
+
});
|
|
20715
|
+
return _context.abrupt("return");
|
|
20716
|
+
|
|
20717
|
+
case 4:
|
|
20718
|
+
case "end":
|
|
20719
|
+
return _context.stop();
|
|
20720
|
+
}
|
|
20721
|
+
}
|
|
20722
|
+
}, _callee);
|
|
20723
|
+
}));
|
|
20724
|
+
|
|
20725
|
+
return function (_x, _x2) {
|
|
20726
|
+
return _ref2.apply(this, arguments);
|
|
20727
|
+
};
|
|
20728
|
+
}());
|
|
20644
20729
|
|
|
20645
20730
|
case 7:
|
|
20646
20731
|
case "end":
|
|
20647
|
-
return
|
|
20732
|
+
return _context2.stop();
|
|
20648
20733
|
}
|
|
20649
20734
|
}
|
|
20650
|
-
},
|
|
20735
|
+
}, _callee2);
|
|
20651
20736
|
})), []);
|
|
20652
20737
|
React__default['default'].useEffect(function () {
|
|
20653
20738
|
controller.run( /*#__PURE__*/function () {
|
|
20654
|
-
var
|
|
20655
|
-
return _regeneratorRuntime().wrap(function
|
|
20739
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
20740
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
20656
20741
|
while (1) {
|
|
20657
|
-
switch (
|
|
20742
|
+
switch (_context3.prev = _context3.next) {
|
|
20658
20743
|
case 0:
|
|
20659
20744
|
s.goodsListState.searchValue = value.trim();
|
|
20660
20745
|
|
|
20661
20746
|
case 1:
|
|
20662
20747
|
case "end":
|
|
20663
|
-
return
|
|
20748
|
+
return _context3.stop();
|
|
20664
20749
|
}
|
|
20665
20750
|
}
|
|
20666
|
-
},
|
|
20751
|
+
}, _callee3);
|
|
20667
20752
|
}));
|
|
20668
20753
|
|
|
20669
|
-
return function (
|
|
20670
|
-
return
|
|
20754
|
+
return function (_x3) {
|
|
20755
|
+
return _ref3.apply(this, arguments);
|
|
20671
20756
|
};
|
|
20672
20757
|
}());
|
|
20673
20758
|
}, [value, controller]);
|
|
@@ -22176,7 +22261,7 @@ var useColumns$1 = (function (form) {
|
|
|
22176
22261
|
align: 'right',
|
|
22177
22262
|
width: 119,
|
|
22178
22263
|
render: function render(value, record) {
|
|
22179
|
-
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxAmount')) {
|
|
22264
|
+
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index && !disableds.includes('taxAmount') && model !== 'prefab') {
|
|
22180
22265
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('taxAmount', {
|
|
22181
22266
|
initialValue: editGood.taxAmount,
|
|
22182
22267
|
rules: [].concat(_toConsumableArray(getReplenishRules('taxAmount')), [{
|
|
@@ -24825,50 +24910,79 @@ function addGood$3(_x) {
|
|
|
24825
24910
|
|
|
24826
24911
|
|
|
24827
24912
|
function _addGood$2() {
|
|
24828
|
-
_addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
24829
|
-
return _regeneratorRuntime().wrap(function
|
|
24913
|
+
_addGood$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(controller) {
|
|
24914
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
24830
24915
|
while (1) {
|
|
24831
|
-
switch (
|
|
24916
|
+
switch (_context4.prev = _context4.next) {
|
|
24832
24917
|
case 0:
|
|
24833
|
-
|
|
24918
|
+
_context4.next = 2;
|
|
24834
24919
|
return controller.saveEditFreight();
|
|
24835
24920
|
|
|
24836
24921
|
case 2:
|
|
24837
|
-
|
|
24922
|
+
_context4.next = 4;
|
|
24838
24923
|
return controller.wait();
|
|
24839
24924
|
|
|
24840
24925
|
case 4:
|
|
24841
|
-
|
|
24926
|
+
_context4.next = 6;
|
|
24842
24927
|
return controller.run( /*#__PURE__*/function () {
|
|
24843
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
24844
|
-
|
|
24928
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
24929
|
+
var _controller$state$goo;
|
|
24930
|
+
|
|
24931
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
24845
24932
|
while (1) {
|
|
24846
|
-
switch (
|
|
24933
|
+
switch (_context3.prev = _context3.next) {
|
|
24847
24934
|
case 0:
|
|
24848
24935
|
if (!s.freightListState.editGood) {
|
|
24849
|
-
|
|
24936
|
+
_context3.next = 3;
|
|
24850
24937
|
break;
|
|
24851
24938
|
}
|
|
24852
24939
|
|
|
24853
|
-
|
|
24854
|
-
|
|
24855
|
-
|
|
24856
|
-
|
|
24857
|
-
|
|
24940
|
+
_context3.next = 3;
|
|
24941
|
+
return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
|
|
24942
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
24943
|
+
var firstError;
|
|
24944
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
24945
|
+
while (1) {
|
|
24946
|
+
switch (_context2.prev = _context2.next) {
|
|
24947
|
+
case 0:
|
|
24948
|
+
if (!err) {
|
|
24949
|
+
_context2.next = 4;
|
|
24950
|
+
break;
|
|
24951
|
+
}
|
|
24952
|
+
|
|
24953
|
+
firstError = Object.values(err)[0];
|
|
24954
|
+
ktsXui.message.error({
|
|
24955
|
+
content: firstError.errors[0].message,
|
|
24956
|
+
key: '你正在编辑一个货物'
|
|
24957
|
+
});
|
|
24958
|
+
return _context2.abrupt("return");
|
|
24959
|
+
|
|
24960
|
+
case 4:
|
|
24961
|
+
case "end":
|
|
24962
|
+
return _context2.stop();
|
|
24963
|
+
}
|
|
24964
|
+
}
|
|
24965
|
+
}, _callee2);
|
|
24966
|
+
}));
|
|
24967
|
+
|
|
24968
|
+
return function (_x5, _x6) {
|
|
24969
|
+
return _ref3.apply(this, arguments);
|
|
24970
|
+
};
|
|
24971
|
+
}());
|
|
24858
24972
|
|
|
24859
24973
|
case 3:
|
|
24860
|
-
|
|
24974
|
+
_context3.next = 5;
|
|
24861
24975
|
return controller.addFreight({});
|
|
24862
24976
|
|
|
24863
24977
|
case 5:
|
|
24864
|
-
s.freightListState.editGood =
|
|
24978
|
+
s.freightListState.editGood = _context3.sent;
|
|
24865
24979
|
|
|
24866
24980
|
case 6:
|
|
24867
24981
|
case "end":
|
|
24868
|
-
return
|
|
24982
|
+
return _context3.stop();
|
|
24869
24983
|
}
|
|
24870
24984
|
}
|
|
24871
|
-
},
|
|
24985
|
+
}, _callee3);
|
|
24872
24986
|
}));
|
|
24873
24987
|
|
|
24874
24988
|
return function (_x4) {
|
|
@@ -24878,10 +24992,10 @@ function _addGood$2() {
|
|
|
24878
24992
|
|
|
24879
24993
|
case 6:
|
|
24880
24994
|
case "end":
|
|
24881
|
-
return
|
|
24995
|
+
return _context4.stop();
|
|
24882
24996
|
}
|
|
24883
24997
|
}
|
|
24884
|
-
},
|
|
24998
|
+
}, _callee4);
|
|
24885
24999
|
}));
|
|
24886
25000
|
return _addGood$2.apply(this, arguments);
|
|
24887
25001
|
}
|
|
@@ -24891,34 +25005,34 @@ function rollBottom$2(_x2, _x3) {
|
|
|
24891
25005
|
}
|
|
24892
25006
|
|
|
24893
25007
|
function _rollBottom$2() {
|
|
24894
|
-
_rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
25008
|
+
_rollBottom$2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(controller, rootElement) {
|
|
24895
25009
|
var cont;
|
|
24896
|
-
return _regeneratorRuntime().wrap(function
|
|
25010
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
24897
25011
|
while (1) {
|
|
24898
|
-
switch (
|
|
25012
|
+
switch (_context5.prev = _context5.next) {
|
|
24899
25013
|
case 0:
|
|
24900
|
-
|
|
25014
|
+
_context5.next = 2;
|
|
24901
25015
|
return controller.wait();
|
|
24902
25016
|
|
|
24903
25017
|
case 2:
|
|
24904
25018
|
cont = rootElement === null || rootElement === void 0 ? void 0 : rootElement.querySelector('.ktsAntX-table-body');
|
|
24905
25019
|
|
|
24906
25020
|
if (cont) {
|
|
24907
|
-
|
|
25021
|
+
_context5.next = 5;
|
|
24908
25022
|
break;
|
|
24909
25023
|
}
|
|
24910
25024
|
|
|
24911
|
-
return
|
|
25025
|
+
return _context5.abrupt("return");
|
|
24912
25026
|
|
|
24913
25027
|
case 5:
|
|
24914
25028
|
cont.scrollTop = cont.scrollHeight;
|
|
24915
25029
|
|
|
24916
25030
|
case 6:
|
|
24917
25031
|
case "end":
|
|
24918
|
-
return
|
|
25032
|
+
return _context5.stop();
|
|
24919
25033
|
}
|
|
24920
25034
|
}
|
|
24921
|
-
},
|
|
25035
|
+
}, _callee5);
|
|
24922
25036
|
}));
|
|
24923
25037
|
return _rollBottom$2.apply(this, arguments);
|
|
24924
25038
|
}
|
package/package.json
CHANGED
|
@@ -20,8 +20,8 @@ export default () => {
|
|
|
20
20
|
const goodMax = controller.useMemo(s => s.freightListState.goodMax, []);
|
|
21
21
|
|
|
22
22
|
/** 按钮是否禁用 */
|
|
23
|
-
const disabled = React.useMemo(() =>{
|
|
24
|
-
return
|
|
23
|
+
const disabled = React.useMemo(() => {
|
|
24
|
+
return typeof goodMax === 'number' ? goodsNum >= goodMax : false
|
|
25
25
|
}, [goodMax, goodsNum])
|
|
26
26
|
|
|
27
27
|
const onClick = React.useCallback(async () => {
|
|
@@ -46,11 +46,21 @@ async function addGood(controller: InvoiceController) {
|
|
|
46
46
|
await controller.wait();
|
|
47
47
|
await controller.run(async (s) => {
|
|
48
48
|
if (s.freightListState.editGood) {
|
|
49
|
-
message.error({
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
// message.error({
|
|
50
|
+
// content: '你正在编辑一个货物运输行',
|
|
51
|
+
// key: '你正在编辑一个货物运输行',
|
|
52
|
+
// });
|
|
53
|
+
// return;
|
|
54
|
+
await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
|
|
55
|
+
if (err) {
|
|
56
|
+
const firstError: any = Object.values(err)[0];
|
|
57
|
+
message.error({
|
|
58
|
+
content: firstError.errors[0].message,
|
|
59
|
+
key: '你正在编辑一个货物',
|
|
60
|
+
});
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
52
63
|
});
|
|
53
|
-
return;
|
|
54
64
|
}
|
|
55
65
|
s.freightListState.editGood = await controller.addFreight({});
|
|
56
66
|
});
|
|
@@ -365,7 +365,7 @@ export const onChangeTaxAmount = lazyFn(
|
|
|
365
365
|
form.setFieldsValue({ lineAmountExcludeTax });
|
|
366
366
|
|
|
367
367
|
const priceExcludeTax: any = countPrice(lineAmountExcludeTax || '', record?.quantity || '', controller.state.calculatingDigits);
|
|
368
|
-
|
|
368
|
+
|
|
369
369
|
await controller.setEditGood({ lineAmountExcludeTax, taxAmount: values.taxAmount, priceExcludeTax });
|
|
370
370
|
form.setFieldsValue({ priceExcludeTax });
|
|
371
371
|
|
|
@@ -587,12 +587,22 @@ export const onChangeSwitchTax = async (controller: InvoiceController, isTaxIncl
|
|
|
587
587
|
|
|
588
588
|
await controller.run(async s => {
|
|
589
589
|
if (s.goodsListState.editGood) {
|
|
590
|
-
message.error({
|
|
591
|
-
|
|
592
|
-
|
|
590
|
+
// message.error({
|
|
591
|
+
// content: '你正在编辑一个货物',
|
|
592
|
+
// key: '你正在编辑一个货物',
|
|
593
|
+
// });
|
|
594
|
+
|
|
595
|
+
// return;
|
|
596
|
+
await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
|
|
597
|
+
if (err) {
|
|
598
|
+
const firstError: any = Object.values(err)[0];
|
|
599
|
+
message.error({
|
|
600
|
+
content: firstError.errors[0].message,
|
|
601
|
+
key: '你正在编辑一个货物',
|
|
602
|
+
});
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
593
605
|
});
|
|
594
|
-
|
|
595
|
-
return;
|
|
596
606
|
}
|
|
597
607
|
|
|
598
608
|
s.goodsListState.isTaxIncluded = isTaxIncluded;
|
|
@@ -508,7 +508,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
508
508
|
align: 'right',
|
|
509
509
|
width: 119,
|
|
510
510
|
render: (value: string, record: IGood) => {
|
|
511
|
-
if (editGood?.$index === record.$index && !disableds.includes('taxAmount')) {
|
|
511
|
+
if (editGood?.$index === record.$index && !disableds.includes('taxAmount')&& model !== 'prefab') {
|
|
512
512
|
return (
|
|
513
513
|
<Form.Item>
|
|
514
514
|
{getFieldDecorator('taxAmount', {
|
|
@@ -23,8 +23,8 @@ export default () => {
|
|
|
23
23
|
const goodMax = controller.useMemo(s => s.goodsListState.goodMax, []);
|
|
24
24
|
|
|
25
25
|
/** 按钮是否禁用 */
|
|
26
|
-
const disabled = React.useMemo(() =>{
|
|
27
|
-
return
|
|
26
|
+
const disabled = React.useMemo(() => {
|
|
27
|
+
return typeof goodMax === 'number' ? goodsNum >= goodMax : !!searchValue
|
|
28
28
|
}, [goodMax, goodsNum, searchValue])
|
|
29
29
|
|
|
30
30
|
const onClick = React.useCallback(async () => {
|
|
@@ -49,11 +49,21 @@ async function addGood(controller: InvoiceController) {
|
|
|
49
49
|
await controller.wait();
|
|
50
50
|
await controller.run(async (s) => {
|
|
51
51
|
if (s.goodsListState.editGood) {
|
|
52
|
-
message.error({
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// message.error({
|
|
53
|
+
// content: '你正在编辑一个货物',
|
|
54
|
+
// key: '你正在编辑一个货物',
|
|
55
|
+
// });
|
|
56
|
+
// return;
|
|
57
|
+
await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
|
|
58
|
+
if (err) {
|
|
59
|
+
const firstError: any = Object.values(err)[0];
|
|
60
|
+
message.error({
|
|
61
|
+
content: firstError.errors[0].message,
|
|
62
|
+
key: '你正在编辑一个货物',
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
55
66
|
});
|
|
56
|
-
return;
|
|
57
67
|
}
|
|
58
68
|
s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
59
69
|
});
|
|
@@ -21,11 +21,21 @@ export default function Search() {
|
|
|
21
21
|
await controller.saveEditGood();
|
|
22
22
|
await controller.wait();
|
|
23
23
|
if (controller.state.goodsListState.editGood) {
|
|
24
|
-
message.error({
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// message.error({
|
|
25
|
+
// content: '你正在编辑一个货物',
|
|
26
|
+
// key: '你正在编辑一个货物',
|
|
27
|
+
// });
|
|
28
|
+
// return;
|
|
29
|
+
await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
|
|
30
|
+
if (err) {
|
|
31
|
+
const firstError: any = Object.values(err)[0];
|
|
32
|
+
message.error({
|
|
33
|
+
content: firstError.errors[0].message,
|
|
34
|
+
key: '你正在编辑一个货物',
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
27
38
|
});
|
|
28
|
-
return;
|
|
29
39
|
}
|
|
30
40
|
}, [])
|
|
31
41
|
|