tplus-components-touch 3.42.5 → 3.42.6
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.
@@ -279,6 +279,22 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
279
279
|
_this2.hotkeydebouncedPayMode = "";
|
280
280
|
_this2.currentInput = null;
|
281
281
|
|
282
|
+
_this2.getIsReturn = function () {
|
283
|
+
var dataModal = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data;
|
284
|
+
return dataModal.IdbusiType === 35 || dataModal.IdbusiType === 40; //40预售退货类型。
|
285
|
+
};
|
286
|
+
|
287
|
+
_this2.getBoriginReturn = function () {
|
288
|
+
var boriginReturn = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data && JSON.getCellValue(_this2.context.viewModel.data, "IsOriginalReturn");
|
289
|
+
return boriginReturn || false;
|
290
|
+
};
|
291
|
+
|
292
|
+
_this2.getNotBoriginReturn = function () {
|
293
|
+
var isReturn = _this2.getIsReturn();
|
294
|
+
var boriginReturn = _this2.getBoriginReturn();
|
295
|
+
return isReturn && !boriginReturn;
|
296
|
+
};
|
297
|
+
|
282
298
|
_this2.resizeSettlementToolBtns = function () {
|
283
299
|
var newStyle = _this2.store.newStyle;
|
284
300
|
var isMemberStorePage = _this2.props.isMemberStorePage;
|
@@ -413,14 +429,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
413
429
|
_this2.handleGuestShow(amount < 0 ? 2 : 3, amount);
|
414
430
|
setTimeout(function () {
|
415
431
|
_this2.handleDefault();
|
416
|
-
// // 单据模式 临时性获取第一个结算方式焦点
|
417
|
-
// // document.querySelector('.modeItem:nth-child(1) .content input').focus()
|
418
432
|
var _this2$store = _this2.store,
|
419
433
|
paymode = _this2$store.paymode,
|
420
434
|
brefund = _this2$store.brefund,
|
421
435
|
newStyle = _this2$store.newStyle;
|
422
436
|
|
423
|
-
var boriginReturn = _this2.
|
437
|
+
var boriginReturn = _this2.getBoriginReturn();
|
424
438
|
var thePaymodes = newStyle ? (0, _filter3.default)(paymode.thePaymodes, function (m) {
|
425
439
|
return !(_this2.checkModeDisabled(m.paymentType, brefund, boriginReturn) && parseFloat(m.value) == 0);
|
426
440
|
}) : paymode.thePaymodes;
|
@@ -632,36 +646,37 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
632
646
|
|
633
647
|
_this2.showCzkModal = function () {
|
634
648
|
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(id, append) {
|
635
|
-
var _enumController$getEn2, PayStyle,
|
649
|
+
var _ref2, isInputMember, _enumController$getEn2, PayStyle, ctMode, memberId, returnType, memberdata1;
|
636
650
|
|
637
651
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
638
652
|
while (1) {
|
639
653
|
switch (_context.prev = _context.next) {
|
640
654
|
case 0:
|
641
|
-
_this2.
|
655
|
+
_ref2 = _this2.state || {}, isInputMember = _ref2.isInputMember;
|
642
656
|
_enumController$getEn2 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn2.PayStyle;
|
657
|
+
ctMode = _this2.store && _this2.store.paymode && _this2.store.paymode.currentMode;
|
658
|
+
memberId = ctMode && ctMode.memberId;
|
659
|
+
returnType = _this2.getNotBoriginReturn();
|
643
660
|
|
661
|
+
_this2.connectRfCard();
|
644
662
|
_this2.store.setCurrentMode(id, PayStyle.hyczk, append);
|
645
|
-
|
646
|
-
_context.t0 = isInputMember && _this2.store.paymode.currentMode.memberId;
|
663
|
+
_context.t0 = isInputMember && memberId;
|
647
664
|
|
648
665
|
if (!_context.t0) {
|
649
|
-
_context.next =
|
666
|
+
_context.next = 12;
|
650
667
|
break;
|
651
668
|
}
|
652
669
|
|
653
|
-
_context.next =
|
654
|
-
return _this2.store.updateCurrentMode(
|
670
|
+
_context.next = 11;
|
671
|
+
return _this2.store.updateCurrentMode(memberId, returnType);
|
655
672
|
|
656
|
-
case
|
673
|
+
case 11:
|
657
674
|
_context.t0 = _context.sent;
|
658
675
|
|
659
|
-
case
|
676
|
+
case 12:
|
660
677
|
memberdata1 = _context.t0;
|
661
678
|
|
662
|
-
_this2.setState({
|
663
|
-
czkVisible: true
|
664
|
-
});
|
679
|
+
_this2.setState({ czkVisible: true });
|
665
680
|
if (memberdata1 && memberdata1.length === 1) {
|
666
681
|
_this2.handleCzkMoreData(true);
|
667
682
|
_this2.store.handleCzkData(memberdata1[0]);
|
@@ -677,7 +692,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
677
692
|
}, 300);
|
678
693
|
}
|
679
694
|
|
680
|
-
case
|
695
|
+
case 15:
|
681
696
|
case 'end':
|
682
697
|
return _context.stop();
|
683
698
|
}
|
@@ -721,7 +736,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
721
736
|
};
|
722
737
|
|
723
738
|
_this2.handleCzkData = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
|
724
|
-
var _enumController$getEn3, PayStyle;
|
739
|
+
var _enumController$getEn3, PayStyle, returnType;
|
725
740
|
|
726
741
|
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
727
742
|
while (1) {
|
@@ -733,43 +748,44 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
733
748
|
_enumController$getEn3 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn3.PayStyle;
|
734
749
|
|
735
750
|
if (_this2.store.paymode.currentMode.storageCardNo) {
|
736
|
-
_context2.next =
|
751
|
+
_context2.next = 6;
|
737
752
|
break;
|
738
753
|
}
|
739
754
|
|
740
|
-
|
741
|
-
|
755
|
+
returnType = _this2.getNotBoriginReturn();
|
756
|
+
_context2.next = 6;
|
757
|
+
return _this2.store.loadCzk(_this2.czkInput.input.value, returnType);
|
742
758
|
|
743
|
-
case
|
759
|
+
case 6:
|
744
760
|
if (_this2.store.paymode.currentMode.storageCardNo) {
|
745
|
-
_context2.next =
|
761
|
+
_context2.next = 9;
|
746
762
|
break;
|
747
763
|
}
|
748
764
|
|
749
765
|
_message2.default.error("请录入储值卡!");
|
750
766
|
return _context2.abrupt('return');
|
751
767
|
|
752
|
-
case
|
768
|
+
case 9:
|
753
769
|
if (!(0, _find3.default)(_this2.store.paymode.thePaymodes, function (mode) {
|
754
770
|
return mode.paymethodId != _this2.store.paymode.currentMode.paymethodId && mode.paymentType == PayStyle.hyczk && mode.storageCardNo == _this2.store.paymode.currentMode.storageCardNo;
|
755
771
|
})) {
|
756
|
-
_context2.next =
|
772
|
+
_context2.next = 12;
|
757
773
|
break;
|
758
774
|
}
|
759
775
|
|
760
776
|
_message2.default.error("该储值卡已使用。");
|
761
777
|
return _context2.abrupt('return');
|
762
778
|
|
763
|
-
case
|
779
|
+
case 12:
|
764
780
|
if (!(_this2.store.bquick && _this2.store.paymode.amount != _this2.store.paymode.currentMode.value)) {
|
765
|
-
_context2.next =
|
781
|
+
_context2.next = 15;
|
766
782
|
break;
|
767
783
|
}
|
768
784
|
|
769
785
|
_message2.default.error("实收金额应等于应收金额。");
|
770
786
|
return _context2.abrupt('return');
|
771
787
|
|
772
|
-
case
|
788
|
+
case 15:
|
773
789
|
|
774
790
|
_this2.setState({
|
775
791
|
czkVisible: false,
|
@@ -780,7 +796,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
780
796
|
_this2.store.paymode.calcMemberBalance();
|
781
797
|
_this2.handleCzk();
|
782
798
|
|
783
|
-
case
|
799
|
+
case 19:
|
784
800
|
case 'end':
|
785
801
|
return _context2.stop();
|
786
802
|
}
|
@@ -1354,10 +1370,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
1354
1370
|
};
|
1355
1371
|
|
1356
1372
|
_this2.setCurrentModeValue = function (val, max) {
|
1373
|
+
var returnType = _this2.getNotBoriginReturn();
|
1374
|
+
|
1357
1375
|
var _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(),
|
1358
1376
|
PayStyle = _enumController$getEn13.PayStyle;
|
1359
1377
|
|
1360
|
-
var reg = /^[\d.]+$/g;
|
1378
|
+
var reg = returnType ? /^[\d.-]+$/g : /^[\d.]+$/g;
|
1361
1379
|
if (_this2.store.paymode.currentMode.paymentType === PayStyle.hyczk || _this2.store.paymode.currentMode.paymentType === PayStyle.jfdx) {
|
1362
1380
|
if (!val) {
|
1363
1381
|
_this2.setState({
|
@@ -1484,15 +1502,16 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
1484
1502
|
return;
|
1485
1503
|
}
|
1486
1504
|
_this2.czkdebounced = (0, _debounce3.default)((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
|
1487
|
-
var memberdata1;
|
1505
|
+
var returnType, memberdata1;
|
1488
1506
|
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
1489
1507
|
while (1) {
|
1490
1508
|
switch (_context5.prev = _context5.next) {
|
1491
1509
|
case 0:
|
1492
|
-
|
1493
|
-
|
1510
|
+
returnType = _this2.getNotBoriginReturn();
|
1511
|
+
_context5.next = 3;
|
1512
|
+
return _this2.store.loadCzk(v, returnType);
|
1494
1513
|
|
1495
|
-
case
|
1514
|
+
case 3:
|
1496
1515
|
memberdata1 = _context5.sent;
|
1497
1516
|
|
1498
1517
|
if (memberdata1 && memberdata1.length === 1) {
|
@@ -1509,7 +1528,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
1509
1528
|
});
|
1510
1529
|
}
|
1511
1530
|
|
1512
|
-
case
|
1531
|
+
case 5:
|
1513
1532
|
case 'end':
|
1514
1533
|
return _context5.stop();
|
1515
1534
|
}
|
@@ -1615,8 +1634,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
1615
1634
|
_this2.hotkeydebounced = null;
|
1616
1635
|
}
|
1617
1636
|
_this2.hotkeydebounced = (0, _debounce3.default)(function () {
|
1618
|
-
|
1619
|
-
var boriginReturn = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data && JSON.getCellValue(_this2.context.viewModel.data, "IsOriginalReturn");
|
1637
|
+
var boriginReturn = _this2.getBoriginReturn();
|
1620
1638
|
var thePaymodes = newStyle ? (0, _filter3.default)(paymode.thePaymodes, function (m) {
|
1621
1639
|
return !(_this2.checkModeDisabled(m.paymentType, brefund, boriginReturn) && parseFloat(m.value) == 0);
|
1622
1640
|
}) : paymode.thePaymodes;
|
@@ -1625,7 +1643,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
1625
1643
|
if (!notsettle && !_this2.checkSettleDisabled(paymode, thePaymodes)) {
|
1626
1644
|
_this2.handleSettle();
|
1627
1645
|
} else if ((thePaymodes || []).length > 0) {
|
1628
|
-
|
1629
1646
|
// 根据currentIndex = paymethodeId 获取当前支付方式位置
|
1630
1647
|
var payIndex = -1;
|
1631
1648
|
thePaymodes.forEach(function (paymodes, index) {
|
@@ -2808,7 +2825,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
2808
2825
|
if (_this2.debounced) {
|
2809
2826
|
_this2.debounced.cancel();
|
2810
2827
|
_this2.debounced = null;
|
2811
|
-
// console.log("debounce canceled");
|
2812
2828
|
}
|
2813
2829
|
if (!isKeyBorad) {
|
2814
2830
|
_this2.debounced = (0, _debounce3.default)(function () {
|
@@ -3432,6 +3448,15 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
3432
3448
|
}
|
3433
3449
|
}
|
3434
3450
|
|
3451
|
+
//是否退货
|
3452
|
+
|
3453
|
+
|
3454
|
+
//原单退货状态
|
3455
|
+
|
3456
|
+
|
3457
|
+
//非原单退货状态
|
3458
|
+
|
3459
|
+
|
3435
3460
|
//对结算按钮超出的处理
|
3436
3461
|
|
3437
3462
|
}, {
|
@@ -3536,6 +3561,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
3536
3561
|
|
3537
3562
|
// 处理客显显示功能
|
3538
3563
|
|
3564
|
+
|
3539
3565
|
//that[`inputS${paymode.paymethodId}`]
|
3540
3566
|
|
3541
3567
|
}, {
|
@@ -3729,10 +3755,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
3729
3755
|
newPassConfirm = _state2.newPassConfirm,
|
3730
3756
|
newPass = _state2.newPass,
|
3731
3757
|
isNotAutoFocus = _state2.isNotAutoFocus;
|
3732
|
-
|
3733
|
-
var _ref32 = _mutantsUtil.platform || {},
|
3734
|
-
isNewRetailBCPos = _ref32.isNewRetailBCPos;
|
3735
|
-
|
3736
3758
|
var _store2 = this.store,
|
3737
3759
|
paymode = _store2.paymode,
|
3738
3760
|
brefund = _store2.brefund,
|
@@ -3748,7 +3770,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
3748
3770
|
noIsMinAmount = _props.noIsMinAmount;
|
3749
3771
|
// 原单退货
|
3750
3772
|
|
3751
|
-
var boriginReturn = this.
|
3773
|
+
var boriginReturn = this.getBoriginReturn();
|
3752
3774
|
var totalTaxAmount = this.context && this.context.viewModel && this.context.viewModel.data && this.context.viewModel.data.TotalTaxAmount;
|
3753
3775
|
|
3754
3776
|
//收订金
|
@@ -3817,11 +3839,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
3817
3839
|
quantity4 = 0;
|
3818
3840
|
var sumQuantity = 0; //数量总和的值,包括称重的。
|
3819
3841
|
|
3820
|
-
var
|
3821
|
-
|
3822
|
-
buyQuantity =
|
3823
|
-
|
3824
|
-
returnQuantity =
|
3842
|
+
var _ref32 = quantityDetail || {},
|
3843
|
+
_ref32$buyQuantity = _ref32.buyQuantity,
|
3844
|
+
buyQuantity = _ref32$buyQuantity === undefined ? 0 : _ref32$buyQuantity,
|
3845
|
+
_ref32$returnQuantity = _ref32.returnQuantity,
|
3846
|
+
returnQuantity = _ref32$returnQuantity === undefined ? 0 : _ref32$returnQuantity;
|
3825
3847
|
|
3826
3848
|
var quantityPrecision = (0, _tplusPoslogin.PosInitData)("QuantityPrecision");
|
3827
3849
|
quantityPrecision = quantityPrecision ? parseInt(quantityPrecision) : '';
|
@@ -4706,7 +4728,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
4706
4728
|
return _this8.czkInput = input;
|
4707
4729
|
},
|
4708
4730
|
onKeyDown: function () {
|
4709
|
-
var
|
4731
|
+
var _ref33 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(e) {
|
4710
4732
|
var time, _paymode;
|
4711
4733
|
|
4712
4734
|
return _regenerator2.default.wrap(function _callee17$(_context17) {
|
@@ -4762,7 +4784,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
4762
4784
|
}));
|
4763
4785
|
|
4764
4786
|
return function (_x13) {
|
4765
|
-
return
|
4787
|
+
return _ref33.apply(this, arguments);
|
4766
4788
|
};
|
4767
4789
|
}(),
|
4768
4790
|
onFocus: function onFocus(e) {
|
@@ -4819,8 +4841,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
4819
4841
|
_this8.setCurrentModeValue(event.target.value, Math.min(currentMode.maxamount, currentMode.balance));
|
4820
4842
|
},
|
4821
4843
|
defaultValue: currentMode && (0, _utils.getFixedNumber)(brefund ? currentMode.value : Math.min(currentMode.value, currentMode.maxamount, currentMode.balance)),
|
4822
|
-
ref: function ref(
|
4823
|
-
return _this8["inputCzkAmount"] =
|
4844
|
+
ref: function ref(_ref34) {
|
4845
|
+
return _this8["inputCzkAmount"] = _ref34;
|
4824
4846
|
},
|
4825
4847
|
onFocus: function onFocus(e) {
|
4826
4848
|
_this8.inputkey = "inputCzkAmount";
|
@@ -5490,8 +5512,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
5490
5512
|
_this8.setCurrentModeValue(e.target.value, Math.min(currentMode.maxamount, currentMode.member.exchangable));
|
5491
5513
|
},
|
5492
5514
|
defaultValue: currentMode && currentMode.member && (0, _utils.getFixedNumber)(Math.min(currentMode.value, currentMode.maxamount, currentMode.member.exchangable)),
|
5493
|
-
ref: function ref(
|
5494
|
-
return _this8["inputJfdxAmount"] =
|
5515
|
+
ref: function ref(_ref35) {
|
5516
|
+
return _this8["inputJfdxAmount"] = _ref35;
|
5495
5517
|
},
|
5496
5518
|
onFocus: function onFocus(e) {
|
5497
5519
|
_this8.inputkey = "inputJfdxAmount";
|