tplus-components-touch 3.41.4 → 3.41.5

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.
@@ -463,17 +463,18 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
463
463
  } else {
464
464
  item.badge = { text: '', position: '', className: '' };
465
465
  }
466
- if (!item.IsPresent) {
467
- discountRetailTotalAount += item.RetailPrice * item.Quantity;
468
- }
469
466
  if (item.PromotionDetails && item.PromotionDetails.length > 0) {
470
467
  count++;
471
468
  }
472
469
  item.InventoryName = item.Inventory.Name;
473
470
  item.Discount = (0, _utils.getRoundValue)(item.RetailPrice - item.TaxPrice, pricePrecision);
474
- discountPrototypeTotalAmount += item.DetailDiscountAmount;
471
+ if (!item.IsPresent) {
472
+ discountPrototypeTotalAmount += item.DetailDiscountAmount;
473
+ item.TotalDiscount = item.DetailDiscountAmount;
474
+ } else {
475
+ item.TotalDiscount = 0;
476
+ }
475
477
  //item.TotalDiscount = getFixedNumber(item.Discount * item.Quantity);
476
- item.TotalDiscount = item.DetailDiscountAmount;
477
478
  item.nAmount = (0, _utils.getFixedNumber)(item.TaxAmount);
478
479
  item.UnitName = item.Unit.Name;
479
480
  item.nQuantity = (0, _utils.getRoundValue)(item.Quantity, quantityPrecision);
@@ -484,7 +485,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
484
485
  dataSource: dataSource,
485
486
  discountTotalAmount: (0, _utils.getFixedNumber)(_this2.props.amount),
486
487
  discountPrototypeTotalAmount: (0, _utils.getFixedNumber)(discountPrototypeTotalAmount),
487
- discountRetailTotalAount: (0, _utils.getFixedNumber)(_this2.props.amount + discountPrototypeTotalAmount)
488
+ discountRetailTotalAount: (0, _utils.getFixedNumber)(_this2.props.amount + parseFloat(discountPrototypeTotalAmount))
488
489
  });
489
490
  return count;
490
491
  };
@@ -1212,6 +1213,14 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1212
1213
  };
1213
1214
 
1214
1215
  _this2.onTabsClick = function (key, bookType) {
1216
+ if (!_this2.isDjqValidated(key)) {
1217
+ return;
1218
+ };
1219
+ var _this2$store3 = _this2.store,
1220
+ paymode = _this2$store3.paymode,
1221
+ brefund = _this2$store3.brefund,
1222
+ boriginReturn = _this2$store3.boriginReturn;
1223
+
1215
1224
  var _enumController$getEn9 = _mutantsUtil.enumController.getEnumOj(),
1216
1225
  PayStyle = _enumController$getEn9.PayStyle,
1217
1226
  Differentiate = _enumController$getEn9.Differentiate;
@@ -1228,10 +1237,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1228
1237
  var _enumController$getEn10 = _mutantsUtil.enumController.getEnumOj(),
1229
1238
  MultiPay = _enumController$getEn10.MultiPay;
1230
1239
 
1231
- var _this2$store3 = _this2.store,
1232
- paymode = _this2$store3.paymode,
1233
- brefund = _this2$store3.brefund,
1234
- boriginReturn = _this2$store3.boriginReturn;
1235
1240
  var noAlreadyWarn = _this2.state.noAlreadyWarn;
1236
1241
 
1237
1242
  if (!_mutantsMicrofx.stores.offlineSys.shouldSettlement(key)) return false;
@@ -1510,6 +1515,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
1510
1515
  };
1511
1516
 
1512
1517
  _this2.onHotKeyClick1 = function (mode, index, boriginReturn, bookType) {
1518
+ if (!_this2.isDjqValidated(mode.paymentType)) {
1519
+ return;
1520
+ };
1513
1521
  // if (bookType == 'bookPay' && this.store.paymode.isNotFullOnlyBook && mode.virtualPay){
1514
1522
  // return Message.error("付订金时不可使用零售抵现类结算方式!");
1515
1523
  // }
@@ -3485,6 +3493,20 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3485
3493
 
3486
3494
  //jfdx
3487
3495
 
3496
+ }, {
3497
+ key: 'isDjqValidated',
3498
+ value: function isDjqValidated(key) {
3499
+ var paymode = this.store.paymode;
3500
+
3501
+ var _enumController$getEn32 = _mutantsUtil.enumController.getEnumOj(),
3502
+ PayStyle = _enumController$getEn32.PayStyle;
3503
+
3504
+ if (key === PayStyle.djq && Math.Minus(paymode.received, paymode.amount) > 0) {
3505
+ _message2.default.warn('实收金额已大于应收金额,不允许使用优惠券');
3506
+ return false;
3507
+ }
3508
+ return true;
3509
+ }
3488
3510
 
3489
3511
  /**
3490
3512
  *
@@ -3575,8 +3597,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3575
3597
  }, {
3576
3598
  key: 'onKeyboardChange',
3577
3599
  value: function onKeyboardChange(key) {
3578
- var _enumController$getEn32 = _mutantsUtil.enumController.getEnumOj(),
3579
- PayStyle = _enumController$getEn32.PayStyle;
3600
+ var _enumController$getEn33 = _mutantsUtil.enumController.getEnumOj(),
3601
+ PayStyle = _enumController$getEn33.PayStyle;
3580
3602
 
3581
3603
  if (this.currentInput) {
3582
3604
  if (this.store.paymode.currentMode) {
@@ -3597,9 +3619,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3597
3619
  value: function renderToolbtn(mode, index, bookType) {
3598
3620
  var _this7 = this;
3599
3621
 
3600
- var _enumController$getEn33 = _mutantsUtil.enumController.getEnumOj(),
3601
- PayIcon = _enumController$getEn33.PayIcon,
3602
- PayStyle = _enumController$getEn33.PayStyle;
3622
+ var _enumController$getEn34 = _mutantsUtil.enumController.getEnumOj(),
3623
+ PayIcon = _enumController$getEn34.PayIcon,
3624
+ PayStyle = _enumController$getEn34.PayStyle;
3603
3625
 
3604
3626
  var isReturn = this.props.isReturn;
3605
3627
  var _store = this.store,
@@ -3671,11 +3693,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3671
3693
  value: function render() {
3672
3694
  var _this8 = this;
3673
3695
 
3674
- var _enumController$getEn34 = _mutantsUtil.enumController.getEnumOj(),
3675
- PayIcon = _enumController$getEn34.PayIcon,
3676
- PayIcon2 = _enumController$getEn34.PayIcon2,
3677
- PayStyle = _enumController$getEn34.PayStyle,
3678
- Differentiate = _enumController$getEn34.Differentiate;
3696
+ var _enumController$getEn35 = _mutantsUtil.enumController.getEnumOj(),
3697
+ PayIcon = _enumController$getEn35.PayIcon,
3698
+ PayIcon2 = _enumController$getEn35.PayIcon2,
3699
+ PayStyle = _enumController$getEn35.PayStyle,
3700
+ Differentiate = _enumController$getEn35.Differentiate;
3679
3701
 
3680
3702
  var _state2 = this.state,
3681
3703
  btnDissabled = _state2.btnDissabled,