tplus-components-touch 3.41.7 → 3.41.10

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.context && _this2.context.viewModel && _this2.context.viewModel.data && JSON.getCellValue(_this2.context.viewModel.data, "IsOriginalReturn");
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, _ref2, isInputMember, memberdata1;
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.connectRfCard();
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
- _ref2 = _this2.state || {}, isInputMember = _ref2.isInputMember;
646
- _context.t0 = isInputMember && _this2.store.paymode.currentMode.memberId;
663
+ _context.t0 = isInputMember && memberId;
647
664
 
648
665
  if (!_context.t0) {
649
- _context.next = 9;
666
+ _context.next = 12;
650
667
  break;
651
668
  }
652
669
 
653
- _context.next = 8;
654
- return _this2.store.updateCurrentMode(_this2.store.paymode.currentMode.memberId);
670
+ _context.next = 11;
671
+ return _this2.store.updateCurrentMode(memberId, returnType);
655
672
 
656
- case 8:
673
+ case 11:
657
674
  _context.t0 = _context.sent;
658
675
 
659
- case 9:
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 12:
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 = 5;
751
+ _context2.next = 6;
737
752
  break;
738
753
  }
739
754
 
740
- _context2.next = 5;
741
- return _this2.store.loadCzk(_this2.czkInput.input.value);
755
+ returnType = _this2.getNotBoriginReturn();
756
+ _context2.next = 6;
757
+ return _this2.store.loadCzk(_this2.czkInput.input.value, returnType);
742
758
 
743
- case 5:
759
+ case 6:
744
760
  if (_this2.store.paymode.currentMode.storageCardNo) {
745
- _context2.next = 8;
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 8:
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 = 11;
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 11:
779
+ case 12:
764
780
  if (!(_this2.store.bquick && _this2.store.paymode.amount != _this2.store.paymode.currentMode.value)) {
765
- _context2.next = 14;
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 14:
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 18:
799
+ case 19:
784
800
  case 'end':
785
801
  return _context2.stop();
786
802
  }
@@ -1350,10 +1366,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1350
1366
  };
1351
1367
 
1352
1368
  _this2.setCurrentModeValue = function (val, max) {
1369
+ var returnType = _this2.getNotBoriginReturn();
1370
+
1353
1371
  var _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(),
1354
1372
  PayStyle = _enumController$getEn13.PayStyle;
1355
1373
 
1356
- var reg = /^[\d.]+$/g;
1374
+ var reg = returnType ? /^[\d.-]+$/g : /^[\d.]+$/g;
1357
1375
  if (_this2.store.paymode.currentMode.paymentType === PayStyle.hyczk || _this2.store.paymode.currentMode.paymentType === PayStyle.jfdx) {
1358
1376
  if (!val) {
1359
1377
  _this2.setState({
@@ -1472,15 +1490,16 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1472
1490
  return;
1473
1491
  }
1474
1492
  _this2.czkdebounced = (0, _debounce3.default)((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
1475
- var memberdata1;
1493
+ var returnType, memberdata1;
1476
1494
  return _regenerator2.default.wrap(function _callee5$(_context5) {
1477
1495
  while (1) {
1478
1496
  switch (_context5.prev = _context5.next) {
1479
1497
  case 0:
1480
- _context5.next = 2;
1481
- return _this2.store.loadCzk(v);
1498
+ returnType = _this2.getNotBoriginReturn();
1499
+ _context5.next = 3;
1500
+ return _this2.store.loadCzk(v, returnType);
1482
1501
 
1483
- case 2:
1502
+ case 3:
1484
1503
  memberdata1 = _context5.sent;
1485
1504
 
1486
1505
  if (memberdata1 && memberdata1.length === 1) {
@@ -1497,7 +1516,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1497
1516
  });
1498
1517
  }
1499
1518
 
1500
- case 4:
1519
+ case 5:
1501
1520
  case 'end':
1502
1521
  return _context5.stop();
1503
1522
  }
@@ -1603,8 +1622,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1603
1622
  _this2.hotkeydebounced = null;
1604
1623
  }
1605
1624
  _this2.hotkeydebounced = (0, _debounce3.default)(function () {
1606
- // let { type, amount, totalVariety, totalQuantity, isReturn, quantityDetail,memberDisabled } = this.props
1607
- var boriginReturn = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data && JSON.getCellValue(_this2.context.viewModel.data, "IsOriginalReturn");
1625
+ var boriginReturn = _this2.getBoriginReturn();
1608
1626
  var thePaymodes = newStyle ? (0, _filter3.default)(paymode.thePaymodes, function (m) {
1609
1627
  return !(_this2.checkModeDisabled(m.paymentType, brefund, boriginReturn) && parseFloat(m.value) == 0);
1610
1628
  }) : paymode.thePaymodes;
@@ -1613,7 +1631,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1613
1631
  if (!notsettle && !_this2.checkSettleDisabled(paymode, thePaymodes)) {
1614
1632
  _this2.handleSettle();
1615
1633
  } else if ((thePaymodes || []).length > 0) {
1616
-
1617
1634
  // 根据currentIndex = paymethodeId 获取当前支付方式位置
1618
1635
  var payIndex = -1;
1619
1636
  thePaymodes.forEach(function (paymodes, index) {
@@ -2781,7 +2798,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2781
2798
  if (_this2.debounced) {
2782
2799
  _this2.debounced.cancel();
2783
2800
  _this2.debounced = null;
2784
- // console.log("debounce canceled");
2785
2801
  }
2786
2802
  if (!isKeyBorad) {
2787
2803
  _this2.debounced = (0, _debounce3.default)(function () {
@@ -3405,6 +3421,15 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3405
3421
  }
3406
3422
  }
3407
3423
 
3424
+ //是否退货
3425
+
3426
+
3427
+ //原单退货状态
3428
+
3429
+
3430
+ //非原单退货状态
3431
+
3432
+
3408
3433
  //对结算按钮超出的处理
3409
3434
 
3410
3435
  }, {
@@ -3509,6 +3534,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3509
3534
 
3510
3535
  // 处理客显显示功能
3511
3536
 
3537
+
3512
3538
  //that[`inputS${paymode.paymethodId}`]
3513
3539
 
3514
3540
  }, {
@@ -3717,7 +3743,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3717
3743
  noIsMinAmount = _props.noIsMinAmount;
3718
3744
  // 原单退货
3719
3745
 
3720
- var boriginReturn = this.context && this.context.viewModel && this.context.viewModel.data && JSON.getCellValue(this.context.viewModel.data, "IsOriginalReturn");
3746
+ var boriginReturn = this.getBoriginReturn();
3721
3747
  var totalTaxAmount = this.context && this.context.viewModel && this.context.viewModel.data && this.context.viewModel.data.TotalTaxAmount;
3722
3748
 
3723
3749
  //收订金