tplus-components-touch 3.40.1 → 3.40.4

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.
Files changed (46) hide show
  1. package/dist/components/billSearch/api.js +74 -13
  2. package/dist/components/billSearch/api.js.map +1 -1
  3. package/dist/components/billSearch/index.js +39 -27
  4. package/dist/components/billSearch/index.js.map +1 -1
  5. package/dist/components/commonForm/addressPicker/index.js +16 -7
  6. package/dist/components/commonForm/addressPicker/index.js.map +1 -1
  7. package/dist/components/commonForm/datePicker/index.js +6 -3
  8. package/dist/components/commonForm/datePicker/index.js.map +1 -1
  9. package/dist/components/commonForm/formControl/index.js +3 -2
  10. package/dist/components/commonForm/formControl/index.js.map +1 -1
  11. package/dist/components/commonForm/index.js +9 -3
  12. package/dist/components/commonForm/index.js.map +1 -1
  13. package/dist/components/deliverySearch/index.js +1 -1
  14. package/dist/components/deliverySearch/index.js.map +1 -1
  15. package/dist/components/hotKey/index.js +5 -0
  16. package/dist/components/hotKey/index.js.map +1 -1
  17. package/dist/components/hotKey/localConfig.js +65 -0
  18. package/dist/components/hotKey/localConfig.js.map +1 -1
  19. package/dist/components/input/style.less +7 -0
  20. package/dist/components/inventorySearch/tab.js +1 -1
  21. package/dist/components/inventorySearch/tab.js.map +1 -1
  22. package/dist/components/layout/style.less +1 -1
  23. package/dist/components/loading/loadingContent.js +1 -1
  24. package/dist/components/loading/loadingContent.js.map +1 -1
  25. package/dist/components/presale/pickup.js +479 -0
  26. package/dist/components/presale/pickup.js.map +1 -0
  27. package/dist/components/presale/style.less +59 -0
  28. package/dist/components/settlement/prototypeTable/index.js +4 -2
  29. package/dist/components/settlement/prototypeTable/index.js.map +1 -1
  30. package/dist/components/settlement/settlement.js +484 -186
  31. package/dist/components/settlement/settlement.js.map +1 -1
  32. package/dist/components/settlement/settlement.less +24 -9
  33. package/dist/components/settlement/settlementStore.js +320 -230
  34. package/dist/components/settlement/settlementStore.js.map +1 -1
  35. package/dist/components/settlement/utils.js +2 -2
  36. package/dist/components/settlement/utils.js.map +1 -1
  37. package/dist/components/ticon/iconfont/demo_index.html +3 -3
  38. package/dist/components/ticon/iconfont/iconfont.css +3 -3
  39. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  40. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  41. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  42. package/dist/components/touchTable/index.js +12 -0
  43. package/dist/components/touchTable/index.js.map +1 -1
  44. package/dist/index.js +8 -3
  45. package/dist/index.js.map +1 -1
  46. package/package.json +35 -35
@@ -5,6 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Member = exports.PayMode = exports.default = undefined;
7
7
 
8
+ var _isInteger = require('babel-runtime/core-js/number/is-integer');
9
+
10
+ var _isInteger2 = _interopRequireDefault(_isInteger);
11
+
8
12
  var _defineProperty = require('babel-runtime/core-js/object/define-property');
9
13
 
10
14
  var _defineProperty2 = _interopRequireDefault(_defineProperty);
@@ -161,7 +165,7 @@ function _initializerWarningHelper(descriptor, context) {
161
165
  var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
162
166
 
163
167
  var SettlementStore = (_class = function () {
164
- //type==2
168
+ // 预售都是全款;预订是否全款,在点击确认支付时计算订金和商品金额计算得出
165
169
  function SettlementStore() {
166
170
  var _this2 = this;
167
171
 
@@ -176,6 +180,8 @@ var SettlementStore = (_class = function () {
176
180
 
177
181
  _initDefineProp(this, 'newStyle', _descriptor, this);
178
182
 
183
+ this.isFull = true;
184
+
179
185
  _initDefineProp(this, 'setNewStyle', _descriptor2, this);
180
186
 
181
187
  _initDefineProp(this, 'queryPwd', _descriptor3, this);
@@ -276,7 +282,7 @@ var SettlementStore = (_class = function () {
276
282
  }
277
283
  detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
278
284
  detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
279
- //}
285
+ //}
280
286
  detailDTO.taxRate = item.TaxRate;
281
287
  detailDTO.quantity = item.Quantity;
282
288
 
@@ -345,6 +351,10 @@ var SettlementStore = (_class = function () {
345
351
  return (0, _tplusApi.ccApi)({}, '/marketingtool/paygift/executeRightsForPos/' + _this2.billID, false, false, { method: 'get', timeout_skip: true });
346
352
  };
347
353
 
354
+ this.getRefWareHouseList = function () {
355
+ return (0, _tplusApi.ccApi)({}, '/retail/RetailPos/getRefWareHouseList', false, false);
356
+ };
357
+
348
358
  this.checkCoupon = function () {
349
359
  var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
350
360
  var _ref3, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
@@ -498,7 +508,8 @@ var SettlementStore = (_class = function () {
498
508
  var params = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
499
509
  if (params) this.cloudPrintArguments = params;
500
510
  this.setNewStyle();
501
- }
511
+ } //type==2
512
+
502
513
 
503
514
  (0, _createClass3.default)(SettlementStore, [{
504
515
  key: 'initPaymodes',
@@ -538,7 +549,45 @@ var SettlementStore = (_class = function () {
538
549
  });
539
550
  // this.member=context.stores && context.stores.memberStore && context.stores.memberStore.member;
540
551
  this.member = this.dto.Member; //stores.selectMemberStore.selectMemberInfo;
541
- this.brefund = this.paymode.setAmount(this.dto.TotalTaxAmount, this.dto.OnlinePaymentAmount);
552
+
553
+ this.paymode.isNotFullBook = false;
554
+ this.paymode.isNotFullOnlyBook = false;
555
+ //预订按比例收取订金处理
556
+ var value = this.dto.TotalTaxAmount;
557
+
558
+ var _getLoginInfo = this.getLoginInfo(),
559
+ PreSellOrBook = _getLoginInfo.PreSellOrBook,
560
+ PercentageWhenBook = _getLoginInfo.PercentageWhenBook;
561
+
562
+ var _ref5 = this.dto || {},
563
+ IdbusiType = _ref5.IdbusiType,
564
+ DistributionMode = _ref5.DistributionMode;
565
+
566
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
567
+ this.paymode.bookMaxValue = value;
568
+ this.paymode.isNotFullBook = true;
569
+ this.paymode.isNotFullOnlyBook = true;
570
+ value = value * PercentageWhenBook / 100;
571
+ }
572
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK') {
573
+ (0, _mobx.runInAction)(function () {
574
+ _this3.dto.PrepaidAmount = value;
575
+ });
576
+ }
577
+ //预订计算快递或同城配送运费
578
+ if (IdbusiType == 38 && PreSellOrBook != 'DISABLED' && (DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE')) {
579
+ value += this.dto.BuyerPayFreight || 0;
580
+ }
581
+ //预订取货应补款金额
582
+ if (IdbusiType == 39) {
583
+ value = _mutantsMicrofx.stores.drawerStore.thisWaitPaidAmount;
584
+ if (_mutantsMicrofx.stores.drawerStore.totalWaitPaidAmount > 0) {
585
+ this.paymode.isNotFullBook = true;
586
+ this.paymode.bookMaxValue = _mutantsMicrofx.stores.drawerStore.totalWaitPaidAmount;
587
+ }
588
+ }
589
+
590
+ this.brefund = this.paymode.setAmount(value, this.dto.OnlinePaymentAmount);
542
591
  } else {
543
592
  this.brefund = this.paymode.setAmount(amount, 0);
544
593
  this.dto = data;
@@ -586,8 +635,8 @@ var SettlementStore = (_class = function () {
586
635
  var _enumController$getEn5 = _mutantsUtil.enumController.getEnumOj(),
587
636
  PayStyle = _enumController$getEn5.PayStyle;
588
637
 
589
- var _ref5 = _mutantsUtil.platform || {},
590
- isNewRetailBCPos = _ref5.isNewRetailBCPos;
638
+ var _ref6 = _mutantsUtil.platform || {},
639
+ isNewRetailBCPos = _ref6.isNewRetailBCPos;
591
640
 
592
641
  console.log(this.dto, 'dto==========');
593
642
  this.paymode.checkList = [];
@@ -613,14 +662,14 @@ var SettlementStore = (_class = function () {
613
662
  if (themode.paymentType == PayStyle.djq) {
614
663
  (0, _each3.default)(_this5.dto.RetailCouponDetails, function (djq) {
615
664
  if (isNewRetailBCPos) {
616
- var _ref6 = djq || {},
617
- displayText = _ref6.displayText,
618
- promoRuleId = _ref6.promoRuleId,
619
- dateMount = _ref6.dateMount,
620
- promoMethodEnum = _ref6.promoMethodEnum,
621
- discountPct = _ref6.discountPct,
622
- promoId = _ref6.promoId,
623
- id = _ref6.id;
665
+ var _ref7 = djq || {},
666
+ displayText = _ref7.displayText,
667
+ promoRuleId = _ref7.promoRuleId,
668
+ dateMount = _ref7.dateMount,
669
+ promoMethodEnum = _ref7.promoMethodEnum,
670
+ discountPct = _ref7.discountPct,
671
+ promoId = _ref7.promoId,
672
+ id = _ref7.id;
624
673
 
625
674
  _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
626
675
  return;
@@ -663,7 +712,7 @@ var SettlementStore = (_class = function () {
663
712
  }, {
664
713
  key: 'quickSettle',
665
714
  value: function quickSettle(key) {
666
- this.addPay(key, true);
715
+ this.addPay(key, null, true);
667
716
  }
668
717
 
669
718
  //outer call
@@ -671,7 +720,7 @@ var SettlementStore = (_class = function () {
671
720
 
672
721
  }, {
673
722
  key: 'changeFocusAndAddPay',
674
- value: function changeFocusAndAddPay(type) {
723
+ value: function changeFocusAndAddPay(type, bookType) {
675
724
  var _this6 = this;
676
725
 
677
726
  var _enumController$getEn6 = _mutantsUtil.enumController.getEnumOj(),
@@ -696,19 +745,25 @@ var SettlementStore = (_class = function () {
696
745
  TotalTaxAmount: this.paymode.amount,
697
746
  BalanceTaxAmount: this.paymode.currentMode.value
698
747
  } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
699
- _this6.paymode.currentMode.steadCashIntegral = result.Integral;
748
+ // this.paymode.currentMode.steadCashIntegral=result.Integral;
749
+ // this.paymode.currentMode.perIntegral=result.perIntegral;
750
+ // this.paymode.currentMode.cashAmount=result.cashAmount;
751
+ _this6.paymode.currentMode.integralCashOverOrderAmount = result.integralCashOverOrderAmount;
700
752
  _this6.paymode.currentMode.overchargesAmount = result.Amount - _this6.paymode.currentMode.value;
701
753
  });
702
754
  } else {
703
755
  this.addPayDirectly(this.paymode.currentMode);
704
756
  }
705
757
  } else {
706
- this.addPay(type);
758
+ this.addPay(type, bookType);
707
759
  }
708
760
  }
709
761
 
710
762
  // 设置密码后更新会员信息
711
763
 
764
+
765
+ // 查看会员卡信息
766
+
712
767
  }, {
713
768
  key: 'getLoginInfo',
714
769
  value: function getLoginInfo() {
@@ -716,7 +771,7 @@ var SettlementStore = (_class = function () {
716
771
  }
717
772
  }, {
718
773
  key: 'loadCzk',
719
- value: function loadCzk(v) {
774
+ value: function loadCzk(v, returnType) {
720
775
  var _this7 = this;
721
776
 
722
777
  if ((0, _trim3.default)(v) === "") {
@@ -725,136 +780,87 @@ var SettlementStore = (_class = function () {
725
780
  });
726
781
  return;
727
782
  }
728
- var IdStore = this.storeInfo.storeID;
729
- var StoreCode = this.storeInfo.storeCode; //_find(this.storeInfo.storeInfos,(store)=>{return store.ID==IdStore;}).Code;
730
-
731
- var _ref7 = _mutantsUtil.platform || {},
732
- isNewRetailBCPos = _ref7.isNewRetailBCPos;
733
-
734
- var address = '';
735
- if (isNewRetailBCPos) {
736
- // address = '/member/memberProfile/FindByStorageCode/'+v;
737
- address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + v + '/' + true;
738
- return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function () {
739
- var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(result) {
740
- var data, m;
741
- return _regenerator2.default.wrap(function _callee3$(_context3) {
742
- while (1) {
743
- switch (_context3.prev = _context3.next) {
744
- case 0:
745
- data = result.data;
746
- m = data && data.length && data[0];
747
-
748
- if (!(result && result.data.length)) {
749
- _context3.next = 25;
750
- break;
751
- }
783
+ var isOnlyEnabled = returnType ? false : true; //非原单退货为false,其他true
784
+ var address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + v + '/' + isOnlyEnabled;
785
+ return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function () {
786
+ var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(result) {
787
+ var data, m;
788
+ return _regenerator2.default.wrap(function _callee3$(_context3) {
789
+ while (1) {
790
+ switch (_context3.prev = _context3.next) {
791
+ case 0:
792
+ data = result.data;
793
+ m = data && data.length && data[0];
794
+
795
+ if (!(result && result.data.length)) {
796
+ _context3.next = 25;
797
+ break;
798
+ }
752
799
 
753
- if (!(result.data.length === 1)) {
754
- _context3.next = 14;
755
- break;
756
- }
800
+ if (!(result.data.length === 1)) {
801
+ _context3.next = 14;
802
+ break;
803
+ }
804
+
805
+ if (!(m.CardTypeEnum === 'BALANCE_CARD')) {
806
+ _context3.next = 10;
807
+ break;
808
+ }
757
809
 
758
- if (!(m.CardTypeEnum === 'BALANCE_CARD')) {
759
- _context3.next = 10;
760
- break;
810
+ _this7.paymode.updateCardInfo(m);
811
+ _this7.handleCzkData(m);
812
+ return _context3.abrupt('return', result.data);
813
+
814
+ case 10:
815
+ _context3.next = 12;
816
+ return (0, _tplusApi.ccApi)({ dto: _this7.dto, meStorageCardId: m.MeStorageCardId }, '/retail/RetailPos/validateRetailStorageCard', false, false).then(function (result1) {
817
+ var data1 = result1.data ? JSON.parse(result1.data)[0] : {};
818
+ if (data1.enable) {
819
+ _this7.paymode.updateCardInfo(m);
820
+ _this7.handleCzkData(m);
821
+ return result1.data;
822
+ } else {
823
+ _message2.default.warn(data1.disableReason);
761
824
  }
825
+ });
762
826
 
763
- _this7.paymode.updateCardInfo(m);
764
- _this7.handleCzkData(m);
765
- return _context3.abrupt('return', result.data);
766
-
767
- case 10:
768
- _context3.next = 12;
769
- return (0, _tplusApi.ccApi)({ dto: _this7.dto, meStorageCardId: m.MeStorageCardId }, '/retail/RetailPos/validateRetailStorageCard', false, false).then(function (result1) {
770
- var data1 = result1.data ? JSON.parse(result1.data)[0] : {};
771
- if (data1.enable) {
772
- _this7.paymode.updateCardInfo(m);
773
- _this7.handleCzkData(m);
774
- return result1.data;
775
- } else {
776
- _message2.default.warn(data1.disableReason);
777
- }
778
- });
827
+ case 12:
828
+ _context3.next = 25;
829
+ break;
779
830
 
780
- case 12:
781
- _context3.next = 25;
831
+ case 14:
832
+ if (!(result.data && result.data.length === 1)) {
833
+ _context3.next = 19;
782
834
  break;
835
+ }
783
836
 
784
- case 14:
785
- if (!(result.data && result.data.length === 1)) {
786
- _context3.next = 19;
787
- break;
788
- }
789
-
790
- _this7.paymode.updateCardInfo(result.data[0]);
791
- return _context3.abrupt('return', result.data);
837
+ _this7.paymode.updateCardInfo(result.data[0]);
838
+ return _context3.abrupt('return', result.data);
792
839
 
793
- case 19:
794
- if (!(result.data && result.data.length > 1)) {
795
- _context3.next = 23;
796
- break;
797
- }
840
+ case 19:
841
+ if (!(result.data && result.data.length > 1)) {
842
+ _context3.next = 23;
843
+ break;
844
+ }
798
845
 
799
- return _context3.abrupt('return', result.data);
846
+ return _context3.abrupt('return', result.data);
800
847
 
801
- case 23:
802
- _message2.default.warn('没有可用储值卡!');
803
- return _context3.abrupt('return', false);
848
+ case 23:
849
+ _message2.default.warn('没有可用储值卡!');
850
+ return _context3.abrupt('return', false);
804
851
 
805
- case 25:
806
- case 'end':
807
- return _context3.stop();
808
- }
852
+ case 25:
853
+ case 'end':
854
+ return _context3.stop();
809
855
  }
810
- }, _callee3, _this7);
811
- }));
812
-
813
- return function (_x2) {
814
- return _ref8.apply(this, arguments);
815
- };
816
- }()
817
- // result.data.forEach((m) => {
818
- // if (m.CardTypeEnum === 'BALANCE_CARD') {
819
- // // 会员概念改为卡,把这些字段都放开
820
- // this.paymode.updateCardInfo(m);
821
- // }
822
- // })
823
- );
824
- } else {
825
- address = 'AA.DR.newRetailMember.SearchMember';
826
- return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, address, false, false).then(function (result) {
827
- var data = JSON.parse(result.Data);
828
- var m = data && data.length > 0 && data[0];
829
- if (!m || !m.ID) {
830
- (0, _mobx.runInAction)(function () {
831
- _this7.paymode.currentMode.errinfo = "无效的会员卡号";
832
- });
833
- } else {
834
- (0, _mobx.runInAction)(function () {
835
- _this7.paymode.currentMode.errinfo = "";
836
- _this7.paymode.currentMode.member = new Member(m);
837
- _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
838
- _this7.updateEvent();
839
- var message = '';
840
- if (global.CheckMemberStorageProcessorBlock) {
841
- message = CheckMemberStorageProcessorBlock.execute(data[0]);
842
- }
843
- if (!String.isNullOrEmpty(message)) {
844
- _this7.paymode.currentMode.errinfo = message;
845
- } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
846
- _this7.paymode.currentMode.errinfo = "余额不足";
847
- } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
848
- _this7.paymode.currentMode.errinfo = "实收金额必须录入";
849
- } else {
850
- // 查询成功后将焦点移入下一个输入框
851
- var nextInput = document.querySelector('.czk .received .input');
852
- nextInput && nextInput.focus();
853
- }
854
- });
855
- }
856
- });
857
- }
856
+ }
857
+ }, _callee3, _this7);
858
+ }));
859
+
860
+ return function (_x2) {
861
+ return _ref8.apply(this, arguments);
862
+ };
863
+ }());
858
864
  }
859
865
  }, {
860
866
  key: 'addDjq',
@@ -921,12 +927,34 @@ var SettlementStore = (_class = function () {
921
927
  }
922
928
  }
923
929
 
930
+ //积分抵现不包含运费
931
+ var BuyerPayFreight = this.dto.BuyerPayFreight;
932
+ var DistributionMode = this.dto.DistributionMode;
933
+ var IdbusiType = this.dto.IdbusiType;
934
+
935
+ var _getLoginInfo2 = this.getLoginInfo(),
936
+ PreSellOrBook = _getLoginInfo2.PreSellOrBook,
937
+ PercentageWhenBook = _getLoginInfo2.PercentageWhenBook;
938
+
939
+ var value = 0;
940
+ if ((DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && BuyerPayFreight && BuyerPayFreight > 0) {
941
+ value = (0, _utils.getFixedNumber)(Math.Minus(this.paymode.amount, BuyerPayFreight));
942
+ } else if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
943
+ //预订场景下:现场提货,且订金比例非100%时,积分抵现按全款计算(因为只有全款才能使用积分抵现)
944
+ value = this.paymode.bookMaxValue;
945
+ } else {
946
+ value = this.paymode.amount;
947
+ }
948
+
924
949
  (0, _tplusApi.tApi)({ IntegralSteadCashParams: {
925
950
  Idmember: this.paymode.currentMode.memberId,
926
- TotalTaxAmount: this.paymode.amount,
927
- BalanceTaxAmount: this.paymode.amount
951
+ TotalTaxAmount: value,
952
+ BalanceTaxAmount: value
928
953
  } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
929
954
  _this8.paymode.currentMode.member.setExchangable(result.MaxAmount);
955
+ _this8.paymode.currentMode.perIntegral = result.perIntegral;
956
+ _this8.paymode.currentMode.cashAmount = result.cashAmount;
957
+ _this8.paymode.currentMode.integralCashOverOrderAmount = result.integralCashOverOrderAmount;
930
958
  _this8.updateEvent();
931
959
  if (_this8.checkReceived(_this8.paymode.currentMode, "exchangable")) {
932
960
  (0, _mobx.runInAction)(function () {
@@ -968,7 +996,8 @@ var SettlementStore = (_class = function () {
968
996
  authCode: '',
969
997
  steadCashIntegral: null,
970
998
  errinfo: '',
971
- maxamount: this.paymode.amount
999
+ maxamount: this.paymode.amount,
1000
+ virtualPay: themode.virtualPay
972
1001
  });
973
1002
  if (type == PayStyle.hyczk) {
974
1003
  if (!mode.storageCardNo) {
@@ -1012,7 +1041,17 @@ var SettlementStore = (_class = function () {
1012
1041
 
1013
1042
  this.amountHandler && this.amountHandler(type).then(function () {
1014
1043
  (0, _mobx.runInAction)(function () {
1015
- mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(_this9.context.viewModel.getViewItem('Voucher').availableAmount, sum));
1044
+
1045
+ //预售储值结算应包含运费
1046
+ var BuyerPayFreight = _this9.dto.BuyerPayFreight;
1047
+ var DistributionMode = _this9.dto.DistributionMode;
1048
+ var value = 0;
1049
+ if ((DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && BuyerPayFreight && BuyerPayFreight > 0 && type == PayStyle.hyczk) {
1050
+ value = (0, _utils.getFixedNumber)(parseFloat(_this9.context.viewModel.getViewItem('Voucher').availableAmount) + parseFloat(BuyerPayFreight));
1051
+ } else {
1052
+ value = _this9.context.viewModel.getViewItem('Voucher').availableAmount;
1053
+ }
1054
+ mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(value, sum));
1016
1055
  _this9.updateEvent();
1017
1056
  });
1018
1057
  });
@@ -1033,12 +1072,12 @@ var SettlementStore = (_class = function () {
1033
1072
  mode.value = shouldSetValue;
1034
1073
  mode.value2 = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? shouldSetValue / mode.exchangeRate : shouldSetValue * mode.exchangeRate);
1035
1074
  mode.value3 = shouldSetValue;
1036
- this.paymode.calcReserved();
1075
+ this.paymode.calcReserved('bookPay'); //参数multiPay代表复合结算
1037
1076
  }
1038
1077
  }
1039
1078
  }, {
1040
1079
  key: 'changeValue',
1041
- value: function changeValue(index, value, blur) {
1080
+ value: function changeValue(index, value, blur, type) {
1042
1081
  var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
1043
1082
  var v = blur ? (0, _utils.getFixedNumber)(value) : isNaN(value) && value != '-' ? 0.00 : value;
1044
1083
  if (mode) {
@@ -1054,7 +1093,7 @@ var SettlementStore = (_class = function () {
1054
1093
  mode.value2 = v;
1055
1094
  }
1056
1095
 
1057
- this.paymode.calcReserved();
1096
+ this.paymode.calcReserved(type);
1058
1097
  }
1059
1098
  }
1060
1099
  }, {
@@ -1078,7 +1117,7 @@ var SettlementStore = (_class = function () {
1078
1117
  }
1079
1118
  }, {
1080
1119
  key: 'addPay',
1081
- value: function addPay(type, isQuick) {
1120
+ value: function addPay(type, bookType, isQuick) {
1082
1121
  var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
1083
1122
  PayStyle = _enumController$getEn12.PayStyle;
1084
1123
 
@@ -1090,11 +1129,11 @@ var SettlementStore = (_class = function () {
1090
1129
  pos = index == -1 ? pos : index + 1;
1091
1130
  }
1092
1131
  this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk, undefined, isQuick));
1093
- this.paymode.calcReserved();
1132
+ this.paymode.calcReserved(bookType);
1094
1133
  }
1095
1134
  }, {
1096
1135
  key: 'delPay',
1097
- value: function delPay(index) {
1136
+ value: function delPay(index, bookType) {
1098
1137
  var _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(),
1099
1138
  PayStyle = _enumController$getEn13.PayStyle;
1100
1139
 
@@ -1102,7 +1141,7 @@ var SettlementStore = (_class = function () {
1102
1141
  return mode.paymethodId === index;
1103
1142
  });
1104
1143
  this.paymode.currentFocus = -1;
1105
- this.paymode.calcReserved();
1144
+ this.paymode.calcReserved(bookType);
1106
1145
  }
1107
1146
 
1108
1147
  // 获取储值是否重复, 在commit方法中使用
@@ -1397,7 +1436,7 @@ var SettlementStore = (_class = function () {
1397
1436
  var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
1398
1437
  var _this12 = this;
1399
1438
 
1400
- var _enumController$getEn16, PayStyle, TradeType, IPMSG, RetailTypeEnum, dtoParams, payList, payment, tradeType, ret, _ref14, type, data, msg, code;
1439
+ var _enumController$getEn16, PayStyle, TradeType, IPMSG, RetailTypeEnum, _getLoginInfo3, PreSellOrBook, PercentageWhenBook, _ref14, IdbusiType, DistributionMode, prepaidAmount, fullPayment, dtoParams, payList, payment, tradeType, ret, _ref15, type, data, msg, code;
1401
1440
 
1402
1441
  return _regenerator2.default.wrap(function _callee6$(_context6) {
1403
1442
  while (1) {
@@ -1496,32 +1535,48 @@ var SettlementStore = (_class = function () {
1496
1535
  IPMSG = JSON.parse(window.localStorage.IPMSG);
1497
1536
  }
1498
1537
  RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1538
+ _getLoginInfo3 = this.getLoginInfo(), PreSellOrBook = _getLoginInfo3.PreSellOrBook, PercentageWhenBook = _getLoginInfo3.PercentageWhenBook;
1539
+ _ref14 = this.dto || {}, IdbusiType = _ref14.IdbusiType, DistributionMode = _ref14.DistributionMode;
1540
+
1541
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
1542
+ prepaidAmount = (0, _utils.getFixedNumber)(this.dto.RetailPaymentDetails.reduce(function (c, item) {
1543
+ return c + (item.Amount || 0);
1544
+ }, 0));
1545
+ fullPayment = (0, _utils.getFixedNumber)(this.dto.RetailDetails.reduce(function (c, item) {
1546
+ return c + (item.TaxAmount || 0);
1547
+ }, 0));
1548
+
1549
+ this.isFull = fullPayment == prepaidAmount; // 是否全款
1550
+ (0, _mobx.runInAction)(function () {
1551
+ _this12.dto.PrepaidAmount = prepaidAmount;
1552
+ });
1553
+ }
1499
1554
  _context6.t1 = this.dto.IdbusiType == 37;
1500
1555
 
1501
1556
  if (!_context6.t1) {
1502
- _context6.next = 11;
1557
+ _context6.next = 14;
1503
1558
  break;
1504
1559
  }
1505
1560
 
1506
- _context6.next = 10;
1561
+ _context6.next = 13;
1507
1562
  return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1508
1563
 
1509
- case 10:
1564
+ case 13:
1510
1565
  _context6.t1 = _context6.sent;
1511
1566
 
1512
- case 11:
1567
+ case 14:
1513
1568
  _context6.t0 = _context6.t1;
1514
1569
 
1515
1570
  if (_context6.t0) {
1516
- _context6.next = 14;
1571
+ _context6.next = 17;
1517
1572
  break;
1518
1573
  }
1519
1574
 
1520
1575
  _context6.t0 = this.dto.IdbusiType != 37;
1521
1576
 
1522
- case 14:
1577
+ case 17:
1523
1578
  if (!_context6.t0) {
1524
- _context6.next = 33;
1579
+ _context6.next = 36;
1525
1580
  break;
1526
1581
  }
1527
1582
 
@@ -1533,45 +1588,45 @@ var SettlementStore = (_class = function () {
1533
1588
  });
1534
1589
 
1535
1590
  if (!(payList && payList.length > 0)) {
1536
- _context6.next = 30;
1591
+ _context6.next = 33;
1537
1592
  break;
1538
1593
  }
1539
1594
 
1540
1595
  payment = payList[0];
1541
1596
  tradeType = payment && payment.Amount > 0 ? TradeType.PAY : TradeType.REFUND;
1542
- _context6.next = 22;
1597
+ _context6.next = 25;
1543
1598
  return this.thirdPay(1, payment, tradeType, dtoParams);
1544
1599
 
1545
- case 22:
1600
+ case 25:
1546
1601
  ret = _context6.sent;
1547
- _ref14 = ret || {}, type = _ref14.type, data = _ref14.data, msg = _ref14.msg, code = _ref14.code;
1602
+ _ref15 = ret || {}, type = _ref15.type, data = _ref15.data, msg = _ref15.msg, code = _ref15.code;
1548
1603
 
1549
1604
  if (!(type === true)) {
1550
- _context6.next = 28;
1605
+ _context6.next = 31;
1551
1606
  break;
1552
1607
  }
1553
1608
 
1554
1609
  dtoParams = data;
1555
- _context6.next = 30;
1610
+ _context6.next = 33;
1556
1611
  break;
1557
1612
 
1558
- case 28:
1613
+ case 31:
1559
1614
  _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1560
1615
  return _context6.abrupt('return', false);
1561
1616
 
1562
- case 30:
1617
+ case 33:
1563
1618
  this.dtoParams = dtoParams;
1564
1619
  console.log('结算信息:', dtoParams);
1565
1620
  return _context6.abrupt('return', (0, _tplusApi.ccApi)({ dto: dtoParams, cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1566
- var _ref15 = resp || {},
1567
- ID = _ref15.ID;
1621
+ var _ref16 = resp || {},
1622
+ ID = _ref16.ID;
1568
1623
 
1569
1624
  _this12.setDtoID(ID);
1570
1625
  _this12.billID = ID;
1571
1626
  _this12.paymode.checkList = [];
1572
1627
  }));
1573
1628
 
1574
- case 33:
1629
+ case 36:
1575
1630
  case 'end':
1576
1631
  return _context6.stop();
1577
1632
  }
@@ -1597,7 +1652,7 @@ var SettlementStore = (_class = function () {
1597
1652
  return data;
1598
1653
  }
1599
1654
 
1600
- /**
1655
+ /**
1601
1656
  * 二开支付
1602
1657
  * vType:1零售单、2储值单
1603
1658
  * payment:结算方式
@@ -1608,8 +1663,8 @@ var SettlementStore = (_class = function () {
1608
1663
  }, {
1609
1664
  key: 'thirdPay',
1610
1665
  value: function () {
1611
- var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(vType, payment, trade, dto) {
1612
- var cto, params, ret, _ref17, Code, _Message, Result, _ref18, ThirdPaymentReturnInfo;
1666
+ var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(vType, payment, trade, dto) {
1667
+ var cto, params, ret, _ref18, Code, _Message, Result, _ref19, ThirdPaymentReturnInfo;
1613
1668
 
1614
1669
  return _regenerator2.default.wrap(function _callee7$(_context7) {
1615
1670
  while (1) {
@@ -1632,7 +1687,7 @@ var SettlementStore = (_class = function () {
1632
1687
 
1633
1688
  console.log('刷卡返回信息:', ret);
1634
1689
  ret = JSON.parse(ret);
1635
- _ref17 = ret || {}, Code = _ref17.Code, _Message = _ref17.Message, Result = _ref17.Result;
1690
+ _ref18 = ret || {}, Code = _ref18.Code, _Message = _ref18.Message, Result = _ref18.Result;
1636
1691
 
1637
1692
  if (!(Code > 0)) {
1638
1693
  _context7.next = 14;
@@ -1647,7 +1702,7 @@ var SettlementStore = (_class = function () {
1647
1702
  break;
1648
1703
  }
1649
1704
 
1650
- _ref18 = Result || {}, ThirdPaymentReturnInfo = _ref18.ThirdPaymentReturnInfo;
1705
+ _ref19 = Result || {}, ThirdPaymentReturnInfo = _ref19.ThirdPaymentReturnInfo;
1651
1706
 
1652
1707
  if (vType == 1) {
1653
1708
  dto.RetailPaymentDetails.forEach(function (v) {
@@ -1690,7 +1745,7 @@ var SettlementStore = (_class = function () {
1690
1745
  }));
1691
1746
 
1692
1747
  function thirdPay(_x4, _x5, _x6, _x7) {
1693
- return _ref16.apply(this, arguments);
1748
+ return _ref17.apply(this, arguments);
1694
1749
  }
1695
1750
 
1696
1751
  return thirdPay;
@@ -1701,7 +1756,7 @@ var SettlementStore = (_class = function () {
1701
1756
  }, {
1702
1757
  key: 'thirdPayRefund',
1703
1758
  value: function () {
1704
- var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(type) {
1759
+ var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(type) {
1705
1760
  var _this13 = this;
1706
1761
 
1707
1762
  var dto, pay, payment, _enumController$getEn17, TradeType;
@@ -1723,7 +1778,7 @@ var SettlementStore = (_class = function () {
1723
1778
  _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(), TradeType = _enumController$getEn17.TradeType;
1724
1779
 
1725
1780
  setTimeout((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() {
1726
- var ret, _ref21, msg;
1781
+ var ret, _ref22, msg;
1727
1782
 
1728
1783
  return _regenerator2.default.wrap(function _callee8$(_context8) {
1729
1784
  while (1) {
@@ -1734,7 +1789,7 @@ var SettlementStore = (_class = function () {
1734
1789
 
1735
1790
  case 2:
1736
1791
  ret = _context8.sent;
1737
- _ref21 = ret || {}, msg = _ref21.msg;
1792
+ _ref22 = ret || {}, msg = _ref22.msg;
1738
1793
 
1739
1794
  console.log('\u5237\u5361\u652F\u4ED8\u9000\u6B3E:' + msg);
1740
1795
 
@@ -1756,7 +1811,7 @@ var SettlementStore = (_class = function () {
1756
1811
  }));
1757
1812
 
1758
1813
  function thirdPayRefund(_x8) {
1759
- return _ref19.apply(this, arguments);
1814
+ return _ref20.apply(this, arguments);
1760
1815
  }
1761
1816
 
1762
1817
  return thirdPayRefund;
@@ -1769,7 +1824,7 @@ var SettlementStore = (_class = function () {
1769
1824
  }, {
1770
1825
  key: 'querySettleResult',
1771
1826
  value: function () {
1772
- var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10() {
1827
+ var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10() {
1773
1828
  return _regenerator2.default.wrap(function _callee10$(_context10) {
1774
1829
  while (1) {
1775
1830
  switch (_context10.prev = _context10.next) {
@@ -1797,7 +1852,7 @@ var SettlementStore = (_class = function () {
1797
1852
  }));
1798
1853
 
1799
1854
  function querySettleResult() {
1800
- return _ref22.apply(this, arguments);
1855
+ return _ref23.apply(this, arguments);
1801
1856
  }
1802
1857
 
1803
1858
  return querySettleResult;
@@ -1823,14 +1878,14 @@ var SettlementStore = (_class = function () {
1823
1878
  }, {
1824
1879
  key: 'validePwd',
1825
1880
  value: function () {
1826
- var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(value) {
1827
- var _ref24, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, result, count, _result;
1881
+ var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(value) {
1882
+ var _ref25, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, result, count, _result;
1828
1883
 
1829
1884
  return _regenerator2.default.wrap(function _callee11$(_context11) {
1830
1885
  while (1) {
1831
1886
  switch (_context11.prev = _context11.next) {
1832
1887
  case 0:
1833
- _ref24 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref24.isNewRetailBCPos;
1888
+ _ref25 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref25.isNewRetailBCPos;
1834
1889
  _context11.prev = 1;
1835
1890
 
1836
1891
  if (!isNewRetailBCPos) {
@@ -1947,7 +2002,7 @@ var SettlementStore = (_class = function () {
1947
2002
  }));
1948
2003
 
1949
2004
  function validePwd(_x9) {
1950
- return _ref23.apply(this, arguments);
2005
+ return _ref24.apply(this, arguments);
1951
2006
  }
1952
2007
 
1953
2008
  return validePwd;
@@ -2000,14 +2055,14 @@ var SettlementStore = (_class = function () {
2000
2055
  var _this16 = this;
2001
2056
 
2002
2057
  return function () {
2003
- var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(_this) {
2004
- var _getLoginInfo, IdStore, StoreCode, resp;
2058
+ var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(_this) {
2059
+ var _getLoginInfo4, IdStore, StoreCode, resp;
2005
2060
 
2006
2061
  return _regenerator2.default.wrap(function _callee12$(_context12) {
2007
2062
  while (1) {
2008
2063
  switch (_context12.prev = _context12.next) {
2009
2064
  case 0:
2010
- _getLoginInfo = _this16.getLoginInfo(), IdStore = _getLoginInfo.IdStore, StoreCode = _getLoginInfo.StoreCode;
2065
+ _getLoginInfo4 = _this16.getLoginInfo(), IdStore = _getLoginInfo4.IdStore, StoreCode = _getLoginInfo4.StoreCode;
2011
2066
  _context12.next = 3;
2012
2067
  return (0, _tplusApi.tApi)({ Idmember: _this16.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
2013
2068
 
@@ -2027,7 +2082,7 @@ var SettlementStore = (_class = function () {
2027
2082
  }));
2028
2083
 
2029
2084
  return function (_x10) {
2030
- return _ref25.apply(this, arguments);
2085
+ return _ref26.apply(this, arguments);
2031
2086
  };
2032
2087
  }();
2033
2088
  }
@@ -2037,53 +2092,55 @@ var SettlementStore = (_class = function () {
2037
2092
  var _this17 = this;
2038
2093
 
2039
2094
  return function () {
2040
- var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(memberId) {
2041
- var result;
2095
+ var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(memberId, returnType) {
2096
+ var isOnlyEnabled, result;
2042
2097
  return _regenerator2.default.wrap(function _callee13$(_context13) {
2043
2098
  while (1) {
2044
2099
  switch (_context13.prev = _context13.next) {
2045
2100
  case 0:
2046
- _context13.next = 2;
2047
- return (0, _tplusApi.ccApi)({}, '/marketingtool/MeStorageCard/getCardInfoByMemberId/' + memberId + '/' + true, false, false, { method: 'get' });
2101
+ isOnlyEnabled = returnType ? false : true; //非原单退货为false,其他true
2102
+
2103
+ _context13.next = 3;
2104
+ return (0, _tplusApi.ccApi)({}, '/marketingtool/MeStorageCard/getCardInfoByMemberId/' + memberId + '/' + isOnlyEnabled, false, false, { method: 'get' });
2048
2105
 
2049
- case 2:
2106
+ case 3:
2050
2107
  result = _context13.sent;
2051
2108
 
2052
2109
  if (!(result && result.data.length)) {
2053
- _context13.next = 20;
2110
+ _context13.next = 21;
2054
2111
  break;
2055
2112
  }
2056
2113
 
2057
2114
  if (!(result.data.length === 1)) {
2058
- _context13.next = 9;
2115
+ _context13.next = 10;
2059
2116
  break;
2060
2117
  }
2061
2118
 
2062
2119
  _this17.paymode.updateCardInfo(result.data[0]);
2063
2120
  return _context13.abrupt('return', result.data);
2064
2121
 
2065
- case 9:
2122
+ case 10:
2066
2123
  if (!(result.data && result.data.length === 1)) {
2067
- _context13.next = 14;
2124
+ _context13.next = 15;
2068
2125
  break;
2069
2126
  }
2070
2127
 
2071
2128
  _this17.paymode.updateCardInfo(result.data[0]);
2072
2129
  return _context13.abrupt('return', result.data);
2073
2130
 
2074
- case 14:
2131
+ case 15:
2075
2132
  if (!(result.data && result.data.length > 1)) {
2076
- _context13.next = 18;
2133
+ _context13.next = 19;
2077
2134
  break;
2078
2135
  }
2079
2136
 
2080
2137
  return _context13.abrupt('return', result.data);
2081
2138
 
2082
- case 18:
2139
+ case 19:
2083
2140
  _message2.default.warn('没有可用储值卡!');
2084
2141
  return _context13.abrupt('return', false);
2085
2142
 
2086
- case 20:
2143
+ case 21:
2087
2144
  case 'end':
2088
2145
  return _context13.stop();
2089
2146
  }
@@ -2091,8 +2148,8 @@ var SettlementStore = (_class = function () {
2091
2148
  }, _callee13, _this17);
2092
2149
  }));
2093
2150
 
2094
- return function (_x11) {
2095
- return _ref26.apply(this, arguments);
2151
+ return function (_x11, _x12) {
2152
+ return _ref27.apply(this, arguments);
2096
2153
  };
2097
2154
  }();
2098
2155
  }
@@ -2102,21 +2159,22 @@ var SettlementStore = (_class = function () {
2102
2159
  var _this18 = this;
2103
2160
 
2104
2161
  return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
2105
- var address, result;
2162
+ var ctMode, cardNo, result;
2106
2163
  return _regenerator2.default.wrap(function _callee14$(_context14) {
2107
2164
  while (1) {
2108
2165
  switch (_context14.prev = _context14.next) {
2109
2166
  case 0:
2110
- address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + _this18.paymode.currentMode.storageCardNo;
2111
- _context14.next = 3;
2112
- return (0, _tplusApi.ccApi)({}, address, false, false, { method: 'get', timeout_skip: true });
2167
+ ctMode = _this18.paymode && _this18.paymode.currentMode;
2168
+ cardNo = ctMode && ctMode.storageCardNo;
2169
+ _context14.next = 4;
2170
+ return (0, _tplusApi.ccApi)({}, '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + cardNo, false, false, { method: 'get', timeout_skip: true });
2113
2171
 
2114
- case 3:
2172
+ case 4:
2115
2173
  result = _context14.sent;
2116
2174
 
2117
- _this18.paymode.updateCardInfo(result.data);
2175
+ _this18.paymode.updateCardInfo(result && result.data);
2118
2176
 
2119
- case 5:
2177
+ case 6:
2120
2178
  case 'end':
2121
2179
  return _context14.stop();
2122
2180
  }
@@ -2127,7 +2185,7 @@ var SettlementStore = (_class = function () {
2127
2185
  }), _applyDecoratedDescriptor(_class.prototype, 'addDjq', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addDjq'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeClickFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeClickFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPayDirectly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPayDirectly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'delPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'delPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'setDtoID', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'setDtoID'), _class.prototype)), _class);
2128
2186
  exports.default = SettlementStore;
2129
2187
  var PayMode = exports.PayMode = (_class3 = function () {
2130
- //应收
2188
+ //预订场景下,现场提货,且选项设置订金比例非100% or 取货最大补款数大于0时 为 true
2131
2189
  function PayMode() {
2132
2190
  // this.amount=getFixedNumber(amount);
2133
2191
  // this.calcReserved();
@@ -2148,6 +2206,10 @@ var PayMode = exports.PayMode = (_class3 = function () {
2148
2206
 
2149
2207
  _initDefineProp(this, 'thePaymodes', _descriptor11, this);
2150
2208
 
2209
+ this.bookMaxValue = 0;
2210
+ this.isNotFullBook = false;
2211
+ this.isNotFullOnlyBook = false;
2212
+
2151
2213
  _initDefineProp(this, 'storageCardNo', _descriptor12, this);
2152
2214
 
2153
2215
  _initDefineProp(this, 'balance', _descriptor13, this);
@@ -2166,6 +2228,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
2166
2228
  _initDefineProp(this, 'addDjqs', _descriptor16, this);
2167
2229
  }
2168
2230
  // @observable store = null;
2231
+ //只是预订场景下,现场提货,且选项设置订金比例非100%时 为 true
2232
+ //应收
2169
2233
 
2170
2234
 
2171
2235
  (0, _createClass3.default)(PayMode, [{
@@ -2191,13 +2255,25 @@ var PayMode = exports.PayMode = (_class3 = function () {
2191
2255
  }
2192
2256
  }, {
2193
2257
  key: 'calcReserved',
2194
- value: function calcReserved() {
2258
+ value: function calcReserved(type) {
2195
2259
  var sum = 0;
2196
2260
  (0, _each3.default)(this.thePaymodes, function (mode) {
2197
2261
  sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
2198
2262
  });
2199
2263
  this.received = (0, _utils.getFixedNumber)(sum);
2200
- this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
2264
+ if (type === 'bookPay' && this.isNotFullBook) {
2265
+ if (this.amount <= sum && sum <= this.bookMaxValue) {
2266
+ this.receivable = (0, _utils.getFixedNumber)(0);
2267
+ }
2268
+ if (sum < this.amount) {
2269
+ this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
2270
+ }
2271
+ if (sum > this.bookMaxValue) {
2272
+ this.receivable = (0, _utils.getFixedNumber)(this.bookMaxValue - sum);
2273
+ }
2274
+ } else {
2275
+ this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
2276
+ }
2201
2277
  }
2202
2278
  }, {
2203
2279
  key: 'updateMemberStorageCardNo',
@@ -2308,13 +2384,13 @@ var PayMode = exports.PayMode = (_class3 = function () {
2308
2384
  // }
2309
2385
  // else
2310
2386
  // {
2387
+
2311
2388
  var bookingQuantity = 0;
2312
2389
  if (item.BookingQuantity) {
2313
2390
  bookingQuantity = item.BookingQuantity;
2314
2391
  }
2315
2392
  detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
2316
2393
  detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
2317
- //}
2318
2394
  detailDTO.taxRate = item.TaxRate;
2319
2395
  detailDTO.quantity = item.Quantity;
2320
2396
 
@@ -2344,18 +2420,18 @@ var PayMode = exports.PayMode = (_class3 = function () {
2344
2420
  }
2345
2421
  });
2346
2422
 
2347
- var _ref28 = element || {},
2348
- couponCode = _ref28.couponCode,
2349
- name = _ref28.name,
2350
- tieredAmountResult = _ref28.tieredAmountResult,
2351
- fromDate = _ref28.fromDate,
2352
- dateMount = _ref28.dateMount,
2353
- promoMethodEnum = _ref28.promoMethodEnum,
2354
- discountPct = _ref28.discountPct,
2355
- nominalAmount = _ref28.nominalAmount,
2356
- promoId = _ref28.promoId,
2357
- id = _ref28.id,
2358
- doorsill = _ref28.doorsill;
2423
+ var _ref29 = element || {},
2424
+ couponCode = _ref29.couponCode,
2425
+ name = _ref29.name,
2426
+ tieredAmountResult = _ref29.tieredAmountResult,
2427
+ fromDate = _ref29.fromDate,
2428
+ dateMount = _ref29.dateMount,
2429
+ promoMethodEnum = _ref29.promoMethodEnum,
2430
+ discountPct = _ref29.discountPct,
2431
+ nominalAmount = _ref29.nominalAmount,
2432
+ promoId = _ref29.promoId,
2433
+ id = _ref29.id,
2434
+ doorsill = _ref29.doorsill;
2359
2435
 
2360
2436
  var condValue = tieredAmountResult.condValue,
2361
2437
  promoDiscount = tieredAmountResult.promoDiscount,
@@ -2478,6 +2554,19 @@ var PayMode = exports.PayMode = (_class3 = function () {
2478
2554
  } else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
2479
2555
  this.currentMode.errinfo = "余额不足";
2480
2556
  }
2557
+ // 如果是积分抵现的一些判断
2558
+ if (this.currentMode.paymentType === PayStyle.jfdx) {
2559
+ if (this.currentMode.integralCashOverOrderAmount === true) {
2560
+ this.currentMode.steadCashIntegral = Math.ceil(this.currentMode.value / this.currentMode.cashAmount) * this.currentMode.perIntegral;
2561
+ } else if (this.currentMode.integralCashOverOrderAmount === false) {
2562
+ var v1 = this.currentMode.value / this.currentMode.cashAmount;
2563
+ if ((0, _isInteger2.default)(v1)) {
2564
+ this.currentMode.steadCashIntegral = Math.floor(this.currentMode.value / this.currentMode.cashAmount) * this.currentMode.perIntegral;
2565
+ } else {
2566
+ this.currentMode.errinfo = '\u8BF7\u6309\u7167\u79EF\u5206\u62B5\u73B0\u89C4\u5219' + this.currentMode.perIntegral + '\u79EF\u5206\u62B5\u7528' + this.currentMode.cashAmount + '\u5143\u8F93\u5165\u91D1\u989D';
2567
+ }
2568
+ }
2569
+ }
2481
2570
  }
2482
2571
  }, {
2483
2572
  key: 'calcMemberBalance',
@@ -2487,17 +2576,17 @@ var PayMode = exports.PayMode = (_class3 = function () {
2487
2576
  }, {
2488
2577
  key: 'setPaymodes',
2489
2578
  value: function () {
2490
- var _ref29 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(type, isIntegralExchange) {
2579
+ var _ref30 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(type, isIntegralExchange) {
2491
2580
  var _this20 = this;
2492
2581
 
2493
- var _ref30, isHorizontalPad, isHorizontalSunMi, isMobileEnvironment, _enumController$getEn21, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2582
+ var _ref31, isHorizontalPad, isHorizontalSunMi, isMobileEnvironment, _enumController$getEn21, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2494
2583
 
2495
2584
  return _regenerator2.default.wrap(function _callee15$(_context15) {
2496
2585
  while (1) {
2497
2586
  switch (_context15.prev = _context15.next) {
2498
2587
  case 0:
2499
2588
  // 是否移动端判断
2500
- _ref30 = _mutantsUtil.platform || {}, isHorizontalPad = _ref30.isHorizontalPad, isHorizontalSunMi = _ref30.isHorizontalSunMi;
2589
+ _ref31 = _mutantsUtil.platform || {}, isHorizontalPad = _ref31.isHorizontalPad, isHorizontalSunMi = _ref31.isHorizontalSunMi;
2501
2590
  isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
2502
2591
  _enumController$getEn21 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn21.settleStyleType, PayStyle = _enumController$getEn21.PayStyle;
2503
2592
  memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
@@ -2532,6 +2621,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
2532
2621
  exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
2533
2622
  idCurrency: mode.Currency ? mode.Currency.ID : -1,
2534
2623
  calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88",
2624
+ virtualPay: mode.VirtualPay,
2535
2625
  thridPayment: mode.ThirdPaymentInfo
2536
2626
  });
2537
2627
  });
@@ -2547,8 +2637,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
2547
2637
  }, _callee15, this);
2548
2638
  }));
2549
2639
 
2550
- function setPaymodes(_x12, _x13) {
2551
- return _ref29.apply(this, arguments);
2640
+ function setPaymodes(_x13, _x14) {
2641
+ return _ref30.apply(this, arguments);
2552
2642
  }
2553
2643
 
2554
2644
  return setPaymodes;