tplus-components-touch 3.23.1 → 3.23.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.
Files changed (51) hide show
  1. package/dist/components/addLog/AddLogProcessor.js +1 -5
  2. package/dist/components/addLog/AddLogProcessor.js.map +1 -1
  3. package/dist/components/addLog/OperationLogApi.js +6 -45
  4. package/dist/components/addLog/OperationLogApi.js.map +1 -1
  5. package/dist/components/billSearch/index.js +64 -4
  6. package/dist/components/billSearch/index.js.map +1 -1
  7. package/dist/components/billSearch/index.less +12 -2
  8. package/dist/components/cloudPrint/api.js +1 -1
  9. package/dist/components/cloudPrint/api.js.map +1 -1
  10. package/dist/components/cloudPrint/index.js +114 -106
  11. package/dist/components/cloudPrint/index.js.map +1 -1
  12. package/dist/components/cloudPrint/printDispatch.js +223 -0
  13. package/dist/components/cloudPrint/printDispatch.js.map +1 -0
  14. package/dist/components/commonForm/addressPicker/index.js +4 -2
  15. package/dist/components/commonForm/addressPicker/index.js.map +1 -1
  16. package/dist/components/commonForm/formControl/index.js +3 -0
  17. package/dist/components/commonForm/formControl/index.js.map +1 -1
  18. package/dist/components/hotKey/localConfig.js +14 -1
  19. package/dist/components/hotKey/localConfig.js.map +1 -1
  20. package/dist/components/keyboard/index.js +1 -1
  21. package/dist/components/keyboard/index.js.map +1 -1
  22. package/dist/components/loading/index.js +5 -0
  23. package/dist/components/loading/index.js.map +1 -1
  24. package/dist/components/loading/loadingContent.js +23 -6
  25. package/dist/components/loading/loadingContent.js.map +1 -1
  26. package/dist/components/loading/style.less +12 -2
  27. package/dist/components/message/index.js +11 -0
  28. package/dist/components/message/index.js.map +1 -1
  29. package/dist/components/message/index.less +16 -1
  30. package/dist/components/modalWraper/style.less +6 -0
  31. package/dist/components/settlement/prototypeTable/style.less +1 -1
  32. package/dist/components/settlement/settlement.js +487 -312
  33. package/dist/components/settlement/settlement.js.map +1 -1
  34. package/dist/components/settlement/settlement.less +87 -13
  35. package/dist/components/settlement/settlementStore.js +518 -231
  36. package/dist/components/settlement/settlementStore.js.map +1 -1
  37. package/dist/components/settlement/utils.js +1 -1
  38. package/dist/components/settlement/utils.js.map +1 -1
  39. package/dist/components/ticon/iconfont/demo_index.html +5202 -4949
  40. package/dist/components/ticon/iconfont/iconfont.css +887 -843
  41. package/dist/components/ticon/iconfont/iconfont.js +1 -1
  42. package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
  43. package/dist/components/ticon/iconfont/iconfont.json +1535 -1458
  44. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  45. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  46. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  47. package/dist/components/touchTable/index.js +8 -0
  48. package/dist/components/touchTable/index.js.map +1 -1
  49. package/dist/index.js +17 -2
  50. package/dist/index.js.map +1 -1
  51. package/package.json +2 -2
@@ -41,7 +41,7 @@ var _createClass2 = require('babel-runtime/helpers/createClass');
41
41
 
42
42
  var _createClass3 = _interopRequireDefault(_createClass2);
43
43
 
44
- var _desc, _value, _class, _descriptor, _descriptor2, _desc2, _value2, _class3, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _desc3, _value3, _class5, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12;
44
+ var _desc, _value, _class, _descriptor, _descriptor2, _desc2, _value2, _class3, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _desc3, _value3, _class5, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15;
45
45
 
46
46
  var _mobx = require('mobx');
47
47
 
@@ -93,17 +93,25 @@ var _utils = require('./utils');
93
93
 
94
94
  var _tplusApi = require('tplus-api');
95
95
 
96
+ var _cloneDeep = require('lodash/cloneDeep');
97
+
98
+ var _cloneDeep2 = _interopRequireDefault(_cloneDeep);
99
+
96
100
  var _message = require('../message');
97
101
 
98
102
  var _message2 = _interopRequireDefault(_message);
99
103
 
100
104
  var _mutantsUtil = require('mutants-util');
101
105
 
106
+ var _tplusComponentsTouch = require('tplus-components-touch');
107
+
102
108
  var _moment = require('moment');
103
109
 
104
110
  var _moment2 = _interopRequireDefault(_moment);
105
111
 
106
- var _tplusComponentsTouch = require('tplus-components-touch');
112
+ var _reduce2 = require('lodash/reduce');
113
+
114
+ var _reduce3 = _interopRequireDefault(_reduce2);
107
115
 
108
116
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
109
117
 
@@ -194,6 +202,9 @@ var SettlementStore = (_class = function () {
194
202
  if (dto.OnlinePaymentAmount) {
195
203
  onlinePaymentAmount = dto.OnlinePaymentAmount;
196
204
  }
205
+ promoVoucher.promoLinks = (0, _filter3.default)(_this2.paymode.currentMode.djqs, function (djq) {
206
+ return djq.checked;
207
+ });
197
208
  promoVoucher.totalAmountWithTax = Math.Minus(dto.TotalTaxAmount, onlinePaymentAmount);
198
209
  promoVoucher.redBlueFlagEnum = "BLUE";
199
210
  promoVoucher.meMemberId = dto.Idmember;
@@ -209,19 +220,21 @@ var SettlementStore = (_class = function () {
209
220
  detailDTO.productSpecId = item.ProductSpecId;
210
221
  detailDTO.isManualFreeGift = item.IsPresent;
211
222
  detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
212
-
213
- if (detailDTO.IsManualChangePrice) //如果是手工改价
214
- {
215
- detailDTO.listPrice = item.TaxPrice;
216
- detailDTO.netAmountWithTax = item.TaxAmount;
217
- } else {
218
- var bookingQuantity = 0;
219
- if (item.BookingQuantity) {
220
- bookingQuantity = item.BookingQuantity;
221
- }
222
- detailDTO.listPrice = item.MemberPrice;
223
- detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
223
+ detailDTO.IsManualChangePrice = item.IsManualChangePrice;
224
+ // if(detailDTO.IsManualChangePrice)//如果是手工改价
225
+ // {
226
+ // detailDTO.listPrice = item.TaxPrice;
227
+ // detailDTO.netAmountWithTax = item.TaxAmount;
228
+ // }
229
+ // else
230
+ // {
231
+ var bookingQuantity = 0;
232
+ if (item.BookingQuantity) {
233
+ bookingQuantity = item.BookingQuantity;
224
234
  }
235
+ detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
236
+ detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
237
+ //}
225
238
  detailDTO.taxRate = item.TaxRate;
226
239
  detailDTO.quantity = item.Quantity;
227
240
 
@@ -259,22 +272,24 @@ var SettlementStore = (_class = function () {
259
272
  var condValue = tieredAmountResult.condValue,
260
273
  promoDiscount = tieredAmountResult.promoDiscount,
261
274
  displayText = tieredAmountResult.displayText,
262
- promoRuleId = tieredAmountResult.promoRuleId;
275
+ promoRuleId = tieredAmountResult.promoRuleId,
276
+ couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
263
277
 
264
- if ((0, _find3.default)(_this2.paymode.currentMode.djqs, function (djq) {
265
- return djq.code == couponCode;
266
- })) {
267
- _message2.default.info(Differentiate.COUPON + '\u5DF2\u6DFB\u52A0');
268
- } else if (result.IsRepelWithPoints && (0, _find3.default)(_this2.paymode.thePaymodes, function (themode) {
278
+ if (result.IsRepelWithPoints && (0, _find3.default)(_this2.paymode.thePaymodes, function (themode) {
269
279
  return themode.paymentType == PayStyle.jfdx;
270
280
  })) {
271
281
  _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
272
282
  } else {
273
- _this2.addDjq(couponCode, name, promoMethodEnum == "CASH_COUPON" ? nominalAmount : promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, id, true);
283
+ var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
284
+
285
+ var _ref2 = _mutantsUtil.platform || {},
286
+ isNewRetailBCPos = _ref2.isNewRetailBCPos;
287
+
288
+ _this2.addDjq(couponCode, name, IsEnable, promoMethodEnum == "CASH_COUPON" ? nominalAmount : promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, true, 1);
274
289
  }
275
290
  });
276
291
  if (promoVoucher.coupon_code) {
277
- _this2.paymode.calcDjqValue(_this2.paymode.currentMode.djqs[0]);
292
+ _this2.paymode.calcDjqCheckValue(_this2.paymode.currentMode.djqs[0], _this2.dto, 'single');
278
293
  }
279
294
  } else {
280
295
  if (promoVoucher.coupon_code) {
@@ -293,14 +308,14 @@ var SettlementStore = (_class = function () {
293
308
  };
294
309
 
295
310
  this.checkCoupon = function () {
296
- var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
297
- var _ref3, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
311
+ var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
312
+ var _ref4, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
298
313
 
299
314
  return _regenerator2.default.wrap(function _callee$(_context) {
300
315
  while (1) {
301
316
  switch (_context.prev = _context.next) {
302
317
  case 0:
303
- _ref3 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref3.isNewRetailBCPos;
318
+ _ref4 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref4.isNewRetailBCPos;
304
319
 
305
320
  if (!isNewRetailBCPos) {
306
321
  _context.next = 7;
@@ -308,7 +323,7 @@ var SettlementStore = (_class = function () {
308
323
  }
309
324
 
310
325
  _context.next = 4;
311
- return _this2.getCouponList(sn);
326
+ return _this2.getCouponList(sn, 'sinlge');
312
327
 
313
328
  case 4:
314
329
  return _context.abrupt('return', _context.sent);
@@ -368,7 +383,7 @@ var SettlementStore = (_class = function () {
368
383
  }));
369
384
 
370
385
  return function (_x) {
371
- return _ref2.apply(this, arguments);
386
+ return _ref3.apply(this, arguments);
372
387
  };
373
388
  }();
374
389
 
@@ -398,7 +413,6 @@ var SettlementStore = (_class = function () {
398
413
  this.paymode = new PayMode();
399
414
  var params = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
400
415
  if (params) this.cloudPrintArguments = params;
401
- this.printUtil = new _tplusComponentsTouch.PrintUtil();
402
416
  this.newStyle = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') == 'voucher';
403
417
  }
404
418
 
@@ -482,9 +496,11 @@ var SettlementStore = (_class = function () {
482
496
  var _enumController$getEn4 = _mutantsUtil.enumController.getEnumOj(),
483
497
  PayStyle = _enumController$getEn4.PayStyle;
484
498
 
485
- var _ref4 = _mutantsUtil.platform || {},
486
- isNewRetailBCPos = _ref4.isNewRetailBCPos;
499
+ var _ref5 = _mutantsUtil.platform || {},
500
+ isNewRetailBCPos = _ref5.isNewRetailBCPos;
487
501
 
502
+ console.log(this.dto, 'dto==========');
503
+ this.paymode.checkList = [];
488
504
  (0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
489
505
  var themode = (0, _find3.default)(_this5.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
490
506
  if (detail.SettleStyle.Code === PayStyle.hyczk && !themode) {
@@ -506,19 +522,19 @@ var SettlementStore = (_class = function () {
506
522
  if (themode.paymentType == PayStyle.djq) {
507
523
  (0, _each3.default)(_this5.dto.RetailCouponDetails, function (djq) {
508
524
  if (isNewRetailBCPos) {
509
- var _ref5 = djq || {},
510
- displayText = _ref5.displayText,
511
- promoRuleId = _ref5.promoRuleId,
512
- dateMount = _ref5.dateMount,
513
- promoMethodEnum = _ref5.promoMethodEnum,
514
- discountPct = _ref5.discountPct,
515
- promoId = _ref5.promoId,
516
- id = _ref5.id;
517
-
518
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, id, true);
525
+ var _ref6 = djq || {},
526
+ displayText = _ref6.displayText,
527
+ promoRuleId = _ref6.promoRuleId,
528
+ dateMount = _ref6.dateMount,
529
+ promoMethodEnum = _ref6.promoMethodEnum,
530
+ discountPct = _ref6.discountPct,
531
+ promoId = _ref6.promoId,
532
+ id = _ref6.id;
533
+
534
+ _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
519
535
  return;
520
536
  }
521
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
537
+ _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
522
538
  });
523
539
  }
524
540
  _this5.paymode.thePaymodes.push(newmode);
@@ -595,9 +611,9 @@ var SettlementStore = (_class = function () {
595
611
  }, {
596
612
  key: 'getLoginInfo',
597
613
  value: function getLoginInfo() {
598
- var _ref6 = _mutantsMicrofx.localStore.get('user') || {},
599
- _ref6$loginInfo = _ref6.loginInfo,
600
- loginInfo = _ref6$loginInfo === undefined ? {} : _ref6$loginInfo;
614
+ var _ref7 = _mutantsMicrofx.localStore.get('user') || {},
615
+ _ref7$loginInfo = _ref7.loginInfo,
616
+ loginInfo = _ref7$loginInfo === undefined ? {} : _ref7$loginInfo;
601
617
 
602
618
  return loginInfo;
603
619
  }
@@ -616,61 +632,110 @@ var SettlementStore = (_class = function () {
616
632
  var IdStore = this.storeInfo.storeID;
617
633
  var StoreCode = this.storeInfo.storeCode; //_find(this.storeInfo.storeInfos,(store)=>{return store.ID==IdStore;}).Code;
618
634
 
619
- var _ref7 = _mutantsUtil.platform || {},
620
- isNewRetailBCPos = _ref7.isNewRetailBCPos;
635
+ var _ref8 = _mutantsUtil.platform || {},
636
+ isNewRetailBCPos = _ref8.isNewRetailBCPos;
621
637
 
622
638
  var address = '';
623
639
  if (isNewRetailBCPos) {
624
- address = 'chanjet.AA.DR.INewRetailMember.SearchMember';
640
+ // address = '/member/memberProfile/FindByStorageCode/'+v;
641
+ address = '/member/MeMemberWallet/FindByStorageCode';
642
+ return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function (result) {
643
+ var data = result.data;
644
+ var m = data;
645
+
646
+ var _ref9 = _mutantsUtil.platform || {},
647
+ isNewRetailBCPos = _ref9.isNewRetailBCPos;
648
+
649
+ if (isNewRetailBCPos) {
650
+ _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
651
+ _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
652
+ _this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
653
+ _this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
654
+ }
655
+ if (!m || !m.ID) {
656
+ (0, _mobx.runInAction)(function () {
657
+ _this7.paymode.currentMode.errinfo = "无效的会员卡号";
658
+ });
659
+ } else {
660
+ (0, _mobx.runInAction)(function () {
661
+ _this7.paymode.currentMode.errinfo = "";
662
+ _this7.paymode.currentMode.member = new Member(m);
663
+ _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
664
+ _this7.updateEvent();
665
+ var message = '';
666
+ var sum = (0, _reduce3.default)(_this7.paymode.thePaymodes, function (total, cur) {
667
+ return total + cur.value;
668
+ }, 0);
669
+ if (global.CheckMemberStorageProcessorBlock) {
670
+ message = CheckMemberStorageProcessorBlock.execute(m);
671
+ }
672
+ if (!String.isNullOrEmpty(message)) {
673
+ _this7.paymode.currentMode.errinfo = message;
674
+ } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
675
+ _this7.paymode.currentMode.errinfo = "余额不足";
676
+ } else if (_this7.paymode.amount > 0 && parseFloat(_this7.paymode.amount) !== sum && _this7.paymode.currentMode.value == 0) {
677
+ _this7.paymode.currentMode.errinfo = "实收金额必须录入";
678
+ } else {
679
+ // 查询成功后将焦点移入下一个输入框
680
+ var nextInput = document.querySelector('.czk .received .input');
681
+ nextInput && nextInput.select();
682
+ }
683
+ });
684
+ }
685
+ });
625
686
  } else {
626
687
  address = 'AA.DR.newRetailMember.SearchMember';
688
+ return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, address, false, false).then(function (result) {
689
+ var data = JSON.parse(result.Data);
690
+ var m = data && data.length > 0 && data[0];
691
+
692
+ var _ref10 = _mutantsUtil.platform || {},
693
+ isNewRetailBCPos = _ref10.isNewRetailBCPos;
694
+
695
+ if (isNewRetailBCPos) {
696
+ _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
697
+ _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
698
+ _this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
699
+ _this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
700
+ }
701
+ if (!m || !m.ID) {
702
+ (0, _mobx.runInAction)(function () {
703
+ _this7.paymode.currentMode.errinfo = "无效的会员卡号";
704
+ });
705
+ } else {
706
+ (0, _mobx.runInAction)(function () {
707
+ _this7.paymode.currentMode.errinfo = "";
708
+ _this7.paymode.currentMode.member = new Member(m);
709
+ _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
710
+ _this7.updateEvent();
711
+ var message = '';
712
+ if (global.CheckMemberStorageProcessorBlock) {
713
+ message = CheckMemberStorageProcessorBlock.execute(data[0]);
714
+ }
715
+ if (!String.isNullOrEmpty(message)) {
716
+ _this7.paymode.currentMode.errinfo = message;
717
+ } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
718
+ _this7.paymode.currentMode.errinfo = "余额不足";
719
+ } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
720
+ _this7.paymode.currentMode.errinfo = "实收金额必须录入";
721
+ } else {
722
+ // 查询成功后将焦点移入下一个输入框
723
+ var nextInput = document.querySelector('.czk .received .input');
724
+ nextInput && nextInput.focus();
725
+ }
726
+ });
727
+ }
728
+ });
627
729
  }
628
- return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, address, false, false).then(function (result) {
629
- var data = JSON.parse(result.Data);
630
- var m = data && data.length > 0 && data[0];
631
-
632
- var _ref8 = _mutantsUtil.platform || {},
633
- isNewRetailBCPos = _ref8.isNewRetailBCPos;
634
-
635
- if (isNewRetailBCPos) {
636
- _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
637
- _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
638
- }
639
- if (!m || !m.ID) {
640
- (0, _mobx.runInAction)(function () {
641
- _this7.paymode.currentMode.errinfo = "无效的会员卡号";
642
- });
643
- } else {
644
- (0, _mobx.runInAction)(function () {
645
- _this7.paymode.currentMode.errinfo = "";
646
- _this7.paymode.currentMode.member = new Member(m);
647
- _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
648
- _this7.updateEvent();
649
- var message = '';
650
- if (global.CheckMemberStorageProcessorBlock) {
651
- message = CheckMemberStorageProcessorBlock.execute(data[0]);
652
- }
653
- if (!String.isNullOrEmpty(message)) {
654
- _this7.paymode.currentMode.errinfo = message;
655
- } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
656
- _this7.paymode.currentMode.errinfo = "余额不足";
657
- } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
658
- _this7.paymode.currentMode.errinfo = "实收金额必须录入";
659
- } else {
660
- // 查询成功后将焦点移入下一个输入框
661
- var nextInput = document.querySelector('.czk .received .input');
662
- nextInput && nextInput.focus();
663
- }
664
- });
665
- }
666
- });
667
730
  }
668
731
  }, {
669
732
  key: 'addDjq',
670
- value: function addDjq(code, name, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, id, unCheck) {
733
+ value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
671
734
  var djq = {
672
- code: code,
735
+ code: promoCouponCode,
736
+ promoCouponCode: promoCouponCode,
673
737
  name: name,
738
+ IsEnable: IsEnable,
674
739
  amount: amount,
675
740
  doorsill: doorsill, //:"无门槛"
676
741
  LastTS: LastTS,
@@ -683,9 +748,12 @@ var SettlementStore = (_class = function () {
683
748
  discountPct: discountPct,
684
749
  promoId: promoId,
685
750
  promoRuleId: promoRuleId,
686
- id: id
751
+ couponCategoryEnum: couponCategoryEnum,
752
+ id: id,
753
+ count: count === 1 && (couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT') ? 1 : null
687
754
  };
688
755
  this.paymode.currentMode.djqs.push(djq);
756
+ // let copyData = _clonedeep(this.data[targetIndex]);
689
757
  !unCheck && !this.boriginReturn && this.paymode.calcDjqValue(djq);
690
758
  }
691
759
  }, {
@@ -770,7 +838,7 @@ var SettlementStore = (_class = function () {
770
838
  maxamount: this.paymode.amount
771
839
  });
772
840
  if (type == PayStyle.hyczk) {
773
- if (!mode.member.id) {
841
+ if (!mode.member.id || !mode.member.StorageCardNo) {
774
842
  (0, _mobx.runInAction)(function () {
775
843
  mode.errinfo = '未录入储值卡';
776
844
  });
@@ -904,6 +972,9 @@ var SettlementStore = (_class = function () {
904
972
  }, {
905
973
  key: 'delPay',
906
974
  value: function delPay(index) {
975
+ var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
976
+ PayStyle = _enumController$getEn12.PayStyle;
977
+
907
978
  (0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
908
979
  return mode.paymethodId === index;
909
980
  });
@@ -913,7 +984,9 @@ var SettlementStore = (_class = function () {
913
984
  }, {
914
985
  key: 'commit',
915
986
  value: function () {
916
- var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
987
+ var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
988
+ var _ref12, isNewRetailBCPos;
989
+
917
990
  return _regenerator2.default.wrap(function _callee2$(_context2) {
918
991
  while (1) {
919
992
  switch (_context2.prev = _context2.next) {
@@ -928,58 +1001,80 @@ var SettlementStore = (_class = function () {
928
1001
  return _context2.abrupt('return', _promise2.default.resolve(true));
929
1002
 
930
1003
  case 3:
931
- _context2.prev = 3;
1004
+ _ref12 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref12.isNewRetailBCPos;
1005
+ _context2.prev = 4;
932
1006
 
933
1007
  if (!(this.type == 1)) {
934
- _context2.next = 9;
1008
+ _context2.next = 10;
935
1009
  break;
936
1010
  }
937
1011
 
938
- _context2.next = 7;
1012
+ _context2.next = 8;
939
1013
  return this.saveMember();
940
1014
 
941
- case 7:
942
- _context2.next = 11;
1015
+ case 8:
1016
+ _context2.next = 18;
943
1017
  break;
944
1018
 
945
- case 9:
946
- _context2.next = 11;
1019
+ case 10:
1020
+ if (!isNewRetailBCPos) {
1021
+ _context2.next = 13;
1022
+ break;
1023
+ }
1024
+
1025
+ _context2.next = 13;
1026
+ return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
1027
+
1028
+ case 13:
1029
+ _context2.next = 15;
947
1030
  return this.save();
948
1031
 
949
- case 11:
1032
+ case 15:
1033
+ if (!isNewRetailBCPos) {
1034
+ _context2.next = 18;
1035
+ break;
1036
+ }
1037
+
1038
+ _context2.next = 18;
1039
+ return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
1040
+
1041
+ case 18:
950
1042
  return _context2.abrupt('return', _promise2.default.resolve(true));
951
1043
 
952
- case 14:
953
- _context2.prev = 14;
954
- _context2.t0 = _context2['catch'](3);
1044
+ case 21:
1045
+ _context2.prev = 21;
1046
+ _context2.t0 = _context2['catch'](4);
955
1047
 
956
1048
  console.error('settlementStore.commit失败,错误信息:' + _context2.t0);
957
1049
  return _context2.abrupt('return', _promise2.default.resolve(_context2.t0));
958
1050
 
959
- case 18:
960
- console.error('settlementStore.commit失败,错误信息:' + err);
961
-
962
- case 19:
1051
+ case 25:
963
1052
  case 'end':
964
1053
  return _context2.stop();
965
1054
  }
966
1055
  }
967
- }, _callee2, this, [[3, 14]]);
1056
+ }, _callee2, this, [[4, 21]]);
968
1057
  }));
969
1058
 
970
1059
  function commit(_x2) {
971
- return _ref9.apply(this, arguments);
1060
+ return _ref11.apply(this, arguments);
972
1061
  }
973
1062
 
974
1063
  return commit;
975
1064
  }()
1065
+ }, {
1066
+ key: 'handlePrint',
1067
+ value: function handlePrint(resp) {
1068
+ // 储值打印
1069
+ return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp, {});
1070
+ }
976
1071
  }, {
977
1072
  key: 'saveMember',
978
1073
  value: function saveMember() {
979
1074
  var _this10 = this;
980
1075
 
981
- var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
982
- PayStyle = _enumController$getEn12.PayStyle;
1076
+ var _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(),
1077
+ PayStyle = _enumController$getEn13.PayStyle;
983
1078
 
984
1079
  (0, _mobx.runInAction)(function () {
985
1080
  _this10.dto.StorageMutiSettleDetails = [];
@@ -1014,71 +1109,7 @@ var SettlementStore = (_class = function () {
1014
1109
  IPMSG = JSON.parse(window.localStorage.IPMSG);
1015
1110
  }
1016
1111
  return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1017
- var _ref10 = _mutantsUtil.platform || {},
1018
- isHorizontalPad = _ref10.isHorizontalPad,
1019
- isHorizontalSunMi = _ref10.isHorizontalSunMi;
1020
-
1021
- if (isHorizontalPad === true) {
1022
- // pad打印
1023
- //执行移动端云打印
1024
- if (_this10.cloudPrintArguments) {
1025
- var _ref11 = _this10.cloudPrintArguments || {},
1026
- Open = _ref11.Open,
1027
- Key = _ref11.Key,
1028
- Sign = _ref11.Sign,
1029
- Name = _ref11.Name,
1030
- Card = _ref11.Card;
1031
-
1032
- if (!Open) {
1033
- _message2.default.warn(t('云打印未启用,请设置。'));
1034
- return;
1035
- }
1036
- _this10.printUtil.doStoragePrint({ Key: Key, Sign: Sign, Name: Name, Card: Card }, resp.ID, function (s) {
1037
- var msg = s.msg,
1038
- ret = s.ret;
1039
-
1040
- if (ret === 0) {
1041
- _message2.default.success(t('打印储值小票成功。'));
1042
- } else if (ret === -1) {
1043
- _message2.default.error(t(msg));
1044
- } else {
1045
- _message2.default.error(t('打印储值小票失败。'));
1046
- }
1047
- });
1048
- } else {
1049
- _message2.default.warn(t('云打印未启用,请设置。'));
1050
- }
1051
- return;
1052
- } else if (isHorizontalSunMi === true) {
1053
- _this10.printUtil.doStoragePrint({}, resp.ID, function (s) {
1054
- var msg = s.msg,
1055
- ret = s.ret;
1056
-
1057
- if (ret === 0) {
1058
- _message2.default.success(t('打印储值小票成功。'));
1059
- } else if (ret === -1) {
1060
- _message2.default.error(t(msg));
1061
- } else {
1062
- _message2.default.error(t('打印储值小票失败。'));
1063
- }
1064
- });
1065
- return;
1066
- } else {
1067
- if (global.StoragePrintProcessBlock) {
1068
- var _ref12 = _mutantsUtil.platform || {},
1069
- isNewRetailBCPos = _ref12.isNewRetailBCPos;
1070
-
1071
- if (isNewRetailBCPos) {
1072
- global.StoragePrintProcessBlock.execute(resp);
1073
- } else {
1074
- global.StoragePrintProcessBlock.execute(resp.ID);
1075
- }
1076
- return;
1077
- } else {
1078
- _message2.default.warn(t('打印小票只能在客户端中执行'));
1079
- return;
1080
- }
1081
- }
1112
+ _this10.handlePrint(resp);
1082
1113
  });
1083
1114
  }
1084
1115
  }, {
@@ -1087,13 +1118,13 @@ var SettlementStore = (_class = function () {
1087
1118
  var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
1088
1119
  var _this11 = this;
1089
1120
 
1090
- var _enumController$getEn13, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum;
1121
+ var _enumController$getEn14, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum;
1091
1122
 
1092
1123
  return _regenerator2.default.wrap(function _callee3$(_context3) {
1093
1124
  while (1) {
1094
1125
  switch (_context3.prev = _context3.next) {
1095
1126
  case 0:
1096
- _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn13.PayStyle;
1127
+ _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn14.PayStyle;
1097
1128
 
1098
1129
  (0, _mobx.runInAction)(function () {
1099
1130
  _this11.dto.RetailPaymentDetails = [];
@@ -1101,19 +1132,21 @@ var SettlementStore = (_class = function () {
1101
1132
  _this11.dto.RetailCouponDetails = [];
1102
1133
  var czkSum = 0;
1103
1134
  var Idmember = _this11.dto.Idmember;
1135
+ var count = 0;
1104
1136
  var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1105
1137
  return parseFloat(mode.value) != 0;
1106
1138
  }) : _this11.paymode.thePaymodes;
1107
- (0, _each3.default)(thePaymodes, function (mode) {
1139
+ (0, _each3.default)(thePaymodes, function (mode, index) {
1108
1140
  var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1109
1141
  if (mode.paymentType == PayStyle.hyczk) {
1110
1142
  if (!Idmember) {
1111
1143
  Idmember = mode.member.id;
1112
1144
  }
1113
1145
  czkSum = Math.Add(czkSum, mode.value);
1114
-
1146
+ var MeStorageCardId = mode.member.MeStorageCardId ? mode.member.MeStorageCardId : _this11.member.MeStorageCardId;
1115
1147
  _this11.dto.RetailStorageDetails.push({
1116
1148
  Code: mode.paymethodId,
1149
+ MeStorageCardId: MeStorageCardId,
1117
1150
  StoragePaymentAmount: mode.value,
1118
1151
  IsOrigReturn: false,
1119
1152
  BalanceStorage: mode.balance,
@@ -1147,21 +1180,19 @@ var SettlementStore = (_class = function () {
1147
1180
  DataSource: { Id: _this11.dataSource }
1148
1181
  });
1149
1182
  if (mode.paymentType == PayStyle.djq) {
1150
- (0, _each3.default)(mode.djqs, function (djq) {
1151
- if (djq.checked) {
1152
- _this11.dto.RetailCouponDetails.push({
1153
- CouponCode: djq.code,
1154
- ReductionAmount: djq.amount,
1155
- EnableAmount: djq.doorsill,
1156
- CouponTitle: djq.name,
1157
- IdMember: djq.UMemberID ? mode.member.id : null,
1158
- LastTS: djq.LastTS,
1159
- PromotionId: djq.promoId,
1160
- PromotionRuleId: djq.promoRuleId,
1161
- PromoCouponAllocatedId: djq.id,
1162
- DataSource: { Id: _this11.dataSource }
1163
- });
1164
- }
1183
+ (0, _each3.default)(_this11.paymode.checkList && _this11.paymode.checkList.length ? _this11.paymode.checkList : mode.djqs, function (djq) {
1184
+ _this11.dto.RetailCouponDetails.push({
1185
+ CouponCode: djq.promoCouponCode,
1186
+ ReductionAmount: djq.amount,
1187
+ EnableAmount: djq.doorsill,
1188
+ CouponTitle: djq.name,
1189
+ IdMember: djq.UMemberID ? mode.member.id : null,
1190
+ LastTS: djq.LastTS,
1191
+ PromotionId: djq.promoId,
1192
+ PromotionRuleId: djq.promoRuleId,
1193
+ PromoCouponAllocatedId: djq.id,
1194
+ DataSource: { Id: _this11.dataSource }
1195
+ });
1165
1196
  });
1166
1197
  }
1167
1198
  }
@@ -1173,9 +1204,9 @@ var SettlementStore = (_class = function () {
1173
1204
  if (_this11.dto.RetailStorageDetails.length > 0) {
1174
1205
  var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1175
1206
  if (isNewRetailBCPos) {
1176
- _this11.dto.RetailStorageDetails && _this11.dto.RetailStorageDetails.forEach(function (value) {
1177
- value.MeStorageCardId = _this11.member.MeStorageCardId;
1178
- });
1207
+ // this.dto.RetailStorageDetails && this.dto.RetailStorageDetails.forEach((value, index) => {
1208
+ // value.MeStorageCardId = (mode.MeStorageCardId ? mode.MeStorageCardId : this.member.MeStorageCardId);
1209
+ // })
1179
1210
  _this11.dto.RetailPaymentDetails.push({
1180
1211
  Code: _this11.paymode.counter,
1181
1212
  OrigAmount: czkSum,
@@ -1249,6 +1280,7 @@ var SettlementStore = (_class = function () {
1249
1280
 
1250
1281
  return _context3.abrupt('return', (0, _tplusApi.ccApi)({ dto: (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } }), cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1251
1282
  _this11.setDtoID(resp.ID);
1283
+ _this11.paymode.checkList = [];
1252
1284
  _this11.billID = resp.ID;
1253
1285
  }));
1254
1286
 
@@ -1502,6 +1534,7 @@ var SettlementStore = (_class = function () {
1502
1534
  }), _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);
1503
1535
  exports.default = SettlementStore;
1504
1536
  var PayMode = exports.PayMode = (_class3 = function () {
1537
+ //应收
1505
1538
  function PayMode() {
1506
1539
  // this.amount=getFixedNumber(amount);
1507
1540
  // this.calcReserved();
@@ -1523,11 +1556,19 @@ var PayMode = exports.PayMode = (_class3 = function () {
1523
1556
  _initDefineProp(this, 'thePaymodes', _descriptor7, this);
1524
1557
 
1525
1558
  this.currentMode = null;
1559
+ this.checkList = [];
1526
1560
  this.settle = {
1527
1561
  name: "复合结算",
1528
1562
  hotKey: "Ctrl+M"
1529
1563
  };
1530
- } //应收
1564
+
1565
+ _initDefineProp(this, 'calcCheckList', _descriptor8, this);
1566
+
1567
+ _initDefineProp(this, 'setCouponNum', _descriptor9, this);
1568
+
1569
+ _initDefineProp(this, 'addDjqs', _descriptor10, this);
1570
+ }
1571
+ // @observable store = null;
1531
1572
 
1532
1573
 
1533
1574
  (0, _createClass3.default)(PayMode, [{
@@ -1562,15 +1603,28 @@ var PayMode = exports.PayMode = (_class3 = function () {
1562
1603
  this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
1563
1604
  }
1564
1605
  }, {
1565
- key: 'calcDjqValue',
1566
- value: function calcDjqValue(q1) {
1606
+ key: 'calcDjqCheckValue',
1607
+ value: function calcDjqCheckValue(q1, dto, params) {
1567
1608
  var _this14 = this;
1568
1609
 
1610
+ var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
1611
+ var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
1612
+ return djq.checked;
1613
+ });
1614
+ if (qList.length === useLimitPerOrder && !q1.checked) {
1615
+ _message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
1616
+ return;
1617
+ }
1618
+ if (params === 'single') {
1619
+ this.checkList = [];
1620
+ }
1621
+
1569
1622
  var _ref20 = _mutantsUtil.platform || {},
1570
1623
  isNewRetailBCPos = _ref20.isNewRetailBCPos;
1571
1624
 
1572
- var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
1573
- Differentiate = _enumController$getEn14.Differentiate;
1625
+ var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
1626
+ PayStyle = _enumController$getEn15.PayStyle,
1627
+ Differentiate = _enumController$getEn15.Differentiate;
1574
1628
 
1575
1629
  if (q1) {
1576
1630
  if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
@@ -1578,22 +1632,188 @@ var PayMode = exports.PayMode = (_class3 = function () {
1578
1632
  return;
1579
1633
  }
1580
1634
  var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
1581
- return djq.code == q1.code;
1635
+ return djq.promoCouponCode == q1.promoCouponCode;
1582
1636
  });
1583
1637
  if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
1584
1638
  _message2.default.error("本单金额低于使用门槛,该券不可使用。");
1585
1639
  return;
1586
1640
  }
1587
1641
  //判断是否是选择优惠券 //CC优惠券只能使用一个
1588
- if (q1 && !q1.checked && isNewRetailBCPos) {
1589
- // 检查是否有已经选定优惠券 并且去除选定的优惠券
1590
- this.currentMode.djqs.forEach(function (djq, index) {
1591
- if (djq.checked) _this14.currentMode.djqs[index].checked = false;
1642
+ // if (q1 && !q1.checked && isNewRetailBCPos) {
1643
+ // // 检查是否有已经选定优惠券 并且去除选定的优惠券
1644
+ // this.currentMode.djqs.forEach((djq, index) => {
1645
+ // if (djq.checked) this.currentMode.djqs[index].checked = false;
1646
+ // })
1647
+ // }
1648
+ q && (q.checked = !q.checked);
1649
+ }
1650
+ var sum = 0;
1651
+ // console.log(this.store, 'stores-------');
1652
+ if (!q1.checked) {
1653
+ this.checkList.forEach(function (ele, i) {
1654
+ if (ele.id === q1.id) {
1655
+ _this14.checkList.splice(i, 1);
1656
+ }
1657
+ });
1658
+ } else {
1659
+ this.checkList.push(q1);
1660
+ }
1661
+
1662
+ this.checkList.forEach(function (ele) {
1663
+ sum = Math.Add(sum, ele.amount);
1664
+ });
1665
+ this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1666
+ console.log(this.receivable, sum, Math.min(this.receivable, sum, this.currentMode.maxamount), 'sum---------');
1667
+ this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - Math.min(this.receivable, sum, this.currentMode.maxamount));
1668
+ this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1669
+ if (params === 'single') {
1670
+ return;
1671
+ }
1672
+ var promoVoucher = {};
1673
+ promoVoucher.boName = "Retail";
1674
+ // promoVoucher.promoLinks = _filter(this.currentMode.djqs,djq=>djq.checked);
1675
+ promoVoucher.meMemberId = this.currentMode.member.id;
1676
+ promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
1677
+ promoVoucher.voucherDetailList = [];
1678
+ dto.RetailDetails.forEach(function (item) {
1679
+ var detailDTO = {};
1680
+ detailDTO.uuid = item.Code;
1681
+ detailDTO.detailBoName = "RetailDetail";
1682
+ detailDTO.voucherDetailId = item.ID;
1683
+ detailDTO.productId = item.Idinventory;
1684
+ detailDTO.uomId = item.Idunit;
1685
+ detailDTO.productSpecId = item.ProductSpecId;
1686
+ detailDTO.isManualFreeGift = item.IsPresent;
1687
+ detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
1688
+ detailDTO.IsManualChangePrice = item.IsManualChangePrice;
1689
+
1690
+ // if(detailDTO.IsManualChangePrice)//如果是手工改价
1691
+ // {
1692
+ // detailDTO.listPrice = item.TaxPrice;
1693
+ // detailDTO.netAmountWithTax = item.TaxAmount;
1694
+ // }
1695
+ // else
1696
+ // {
1697
+ var bookingQuantity = 0;
1698
+ if (item.BookingQuantity) {
1699
+ bookingQuantity = item.BookingQuantity;
1700
+ }
1701
+ detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
1702
+ detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
1703
+ //}
1704
+ detailDTO.taxRate = item.TaxRate;
1705
+ detailDTO.quantity = item.Quantity;
1706
+
1707
+ detailDTO.amountWithTax = item.RetailAmount;
1708
+ // 促销 start
1709
+ if (item.PromotionDetails && item.PromotionDetails.length != 0) {
1710
+ var promoLinks = [];
1711
+ item.PromotionDetails.forEach(function (promotion) {
1712
+ promoLinks.push({
1713
+ promoId: promotion.IdSalesPromotionDTO,
1714
+ promoRuleId: promotion.PromotionRuleId
1715
+ });
1716
+ });
1717
+ if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
1718
+ }
1719
+ // 促销 end
1720
+ promoVoucher.voucherDetailList.push(detailDTO);
1721
+ });
1722
+ promoVoucher.promoLinks = this.checkList;
1723
+ return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
1724
+ if (result && result.length != 0) {
1725
+ result.forEach(function (element, index) {
1726
+ var djq1 = false;
1727
+ _this14.currentMode.djqs.forEach(function (djq) {
1728
+ if (element.id === djq.id) {
1729
+ djq1 = true;
1730
+ }
1731
+ });
1732
+
1733
+ var _ref21 = element || {},
1734
+ couponCode = _ref21.couponCode,
1735
+ name = _ref21.name,
1736
+ tieredAmountResult = _ref21.tieredAmountResult,
1737
+ fromDate = _ref21.fromDate,
1738
+ dateMount = _ref21.dateMount,
1739
+ promoMethodEnum = _ref21.promoMethodEnum,
1740
+ discountPct = _ref21.discountPct,
1741
+ nominalAmount = _ref21.nominalAmount,
1742
+ promoId = _ref21.promoId,
1743
+ id = _ref21.id,
1744
+ doorsill = _ref21.doorsill;
1745
+
1746
+ var condValue = tieredAmountResult.condValue,
1747
+ promoDiscount = tieredAmountResult.promoDiscount,
1748
+ displayText = tieredAmountResult.displayText,
1749
+ promoRuleId = tieredAmountResult.promoRuleId,
1750
+ couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
1751
+
1752
+ if (!djq1) {
1753
+ // this.currentMode.djqs.push({
1754
+ // promoCouponCode: element.CouponCode,
1755
+ // name: element.CouponTitle,
1756
+ // IsEnable: true,
1757
+ // amount: element.ReductionAmount,
1758
+ // doorsill: element.EnableAmount,
1759
+ // LastTS: element.LastTS,
1760
+ // checked: false,
1761
+ // IsRepelWithPoints: true,
1762
+ // UMemberID: dto.Idmember,
1763
+ // expired: null,
1764
+ // displayText,
1765
+ // promoMethodEnum,
1766
+ // discountPct,
1767
+ // promoId,
1768
+ // promoRuleId,
1769
+ // couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
1770
+ // id
1771
+ // })
1772
+ _this14.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
1773
+ djq1 = false;
1774
+ } else {
1775
+ _this14.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
1776
+ // this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
1777
+ // djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
1778
+ }
1592
1779
  });
1593
1780
  }
1781
+ // 优惠券【6052098985043】与【6120822326451】不可叠加使用
1782
+ });
1783
+ //this.receivable = getFixedNumber(this.receivable - sum);
1784
+ }
1785
+ }, {
1786
+ key: 'calcDjqValue',
1787
+ value: function calcDjqValue(q1) {
1788
+ var _ref22 = _mutantsUtil.platform || {},
1789
+ isNewRetailBCPos = _ref22.isNewRetailBCPos;
1790
+
1791
+ var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1792
+ Differentiate = _enumController$getEn16.Differentiate;
1793
+
1794
+ if (q1) {
1795
+ if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
1796
+ _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
1797
+ return;
1798
+ }
1799
+ var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
1800
+ return djq.code == q1.code;
1801
+ });
1802
+ if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
1803
+ _message2.default.error("本单金额低于使用门槛,该券不可使用。");
1804
+ return;
1805
+ }
1806
+ //判断是否是选择优惠券 //CC优惠券只能使用一个
1807
+ // if (q1 && !q1.checked && isNewRetailBCPos) {
1808
+ // // 检查是否有已经选定优惠券 并且去除选定的优惠券
1809
+ // this.currentMode.djqs.forEach((djq, index) => {
1810
+ // if (djq.checked) this.currentMode.djqs[index].checked = false;
1811
+ // })
1812
+ // }
1594
1813
  q && (q.checked = !q.checked);
1595
1814
  }
1596
1815
  var sum = 0;
1816
+ // console.log(this.store, 'stores-------');
1597
1817
  (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
1598
1818
  return djq.checked;
1599
1819
  }), function (q) {
@@ -1602,6 +1822,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1602
1822
  this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1603
1823
  this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
1604
1824
  this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1825
+
1605
1826
  //this.receivable = getFixedNumber(this.receivable - sum);
1606
1827
  }
1607
1828
  }, {
@@ -1628,9 +1849,20 @@ var PayMode = exports.PayMode = (_class3 = function () {
1628
1849
  value: function setCurrentModeValue(v, max) {
1629
1850
  this.currentMode.value = parseFloat(v) || 0;
1630
1851
  this.currentMode.errinfo = '';
1631
- if (this.amount > 0 && (v === '' || v === '0.00')) {
1852
+ var sum = this.amount;
1853
+
1854
+ var _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(),
1855
+ PayStyle = _enumController$getEn17.PayStyle;
1856
+
1857
+ this.thePaymodes && this.thePaymodes.forEach(function (mode) {
1858
+ if (mode.paymentType === PayStyle.hyczk) {
1859
+ sum -= mode.value;
1860
+ }
1861
+ });
1862
+
1863
+ if (this.amount > 0 && (v === '' || v === '0.00') && sum !== 0) {
1632
1864
  this.currentMode.errinfo = "实收金额必须录入";
1633
- } else if (Math.abs(parseFloat(v)) > Math.abs(this.amount)) {
1865
+ } else if (Math.abs(parseFloat(v)) > Math.abs(sum)) {
1634
1866
  this.currentMode.errinfo = "实收不应大于应收";
1635
1867
  } else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
1636
1868
  this.currentMode.errinfo = "余额不足";
@@ -1644,16 +1876,16 @@ var PayMode = exports.PayMode = (_class3 = function () {
1644
1876
  }, {
1645
1877
  key: 'setPaymodes',
1646
1878
  value: function () {
1647
- var _ref21 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
1879
+ var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
1648
1880
  var _this15 = this;
1649
1881
 
1650
- var _enumController$getEn15, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
1882
+ var _enumController$getEn18, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
1651
1883
 
1652
1884
  return _regenerator2.default.wrap(function _callee7$(_context7) {
1653
1885
  while (1) {
1654
1886
  switch (_context7.prev = _context7.next) {
1655
1887
  case 0:
1656
- _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn15.settleStyleType, PayStyle = _enumController$getEn15.PayStyle;
1888
+ _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn18.settleStyleType, PayStyle = _enumController$getEn18.PayStyle;
1657
1889
  memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
1658
1890
  param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
1659
1891
  _context7.next = 5;
@@ -1677,6 +1909,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1677
1909
  isQuick: (0, _findIndex3.default)(modes.QuickSettleStyles, { 'Code': mode.Code }) >= 0,
1678
1910
  orderBy: 1,
1679
1911
  paymentType: mode.Code,
1912
+ offlineDisable: mode.offlineDisable,
1680
1913
  idSettleStyle: mode.IdSettleStyle,
1681
1914
  idBankAccount: mode.IdBankAccount,
1682
1915
  exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
@@ -1698,7 +1931,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1698
1931
  }));
1699
1932
 
1700
1933
  function setPaymodes(_x5, _x6) {
1701
- return _ref21.apply(this, arguments);
1934
+ return _ref23.apply(this, arguments);
1702
1935
  }
1703
1936
 
1704
1937
  return setPaymodes;
@@ -1740,22 +1973,75 @@ var PayMode = exports.PayMode = (_class3 = function () {
1740
1973
  initializer: function initializer() {
1741
1974
  return [];
1742
1975
  }
1743
- }), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'reCalculationDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'reCalculationDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clearDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clearDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'setCurrentModeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'setCurrentModeValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcMemberBalance', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcMemberBalance'), _class3.prototype)), _class3);
1976
+ }), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _descriptor8 = _applyDecoratedDescriptor(_class3.prototype, 'calcCheckList', [_mobx.action], {
1977
+ enumerable: true,
1978
+ initializer: function initializer() {
1979
+ var _this16 = this;
1980
+
1981
+ return function () {
1982
+ _this16.checkList = [];
1983
+ };
1984
+ }
1985
+ }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
1986
+ enumerable: true,
1987
+ initializer: function initializer() {
1988
+ var _this17 = this;
1989
+
1990
+ return function (id, couponNum, promoMethodEnum, nominalAmount, promoDiscount) {
1991
+ _this17.currentMode.djqs.forEach(function (ele) {
1992
+ if (ele.id === id) {
1993
+ promoMethodEnum == "CASH_COUPON" ? ele.amount = nominalAmount : ele.amount = promoDiscount;
1994
+ ele.couponCategoryEnum = couponNum;
1995
+ var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
1996
+ ele.IsEnable = IsEnable;
1997
+ }
1998
+ });
1999
+ };
2000
+ }
2001
+ }), _descriptor10 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
2002
+ enumerable: true,
2003
+ initializer: function initializer() {
2004
+ var _this18 = this;
2005
+
2006
+ return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2007
+ var djq = {
2008
+ promoCouponCode: promoCouponCode,
2009
+ name: name,
2010
+ IsEnable: IsEnable,
2011
+ amount: amount,
2012
+ doorsill: doorsill,
2013
+ LastTS: LastTS,
2014
+ checked: checked,
2015
+ IsRepelWithPoints: IsRepelWithPoints,
2016
+ UMemberID: UMemberID,
2017
+ expired: expired,
2018
+ displayText: displayText,
2019
+ promoMethodEnum: promoMethodEnum,
2020
+ discountPct: discountPct,
2021
+ promoId: promoId,
2022
+ promoRuleId: promoRuleId,
2023
+ couponCategoryEnum: couponCategoryEnum,
2024
+ id: id
2025
+ };
2026
+ _this18.currentMode.djqs.push(djq);
2027
+ };
2028
+ }
2029
+ }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'reCalculationDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'reCalculationDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clearDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clearDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'setCurrentModeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'setCurrentModeValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcMemberBalance', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcMemberBalance'), _class3.prototype)), _class3);
1744
2030
  var Member = exports.Member = (_class5 = function () {
1745
2031
  function Member(m) {
1746
- var _this16 = this;
2032
+ var _this19 = this;
1747
2033
 
1748
2034
  (0, _classCallCheck3.default)(this, Member);
1749
2035
 
1750
- _initDefineProp(this, 'cardNo', _descriptor8, this);
2036
+ _initDefineProp(this, 'cardNo', _descriptor11, this);
1751
2037
 
1752
- _initDefineProp(this, 'balance', _descriptor9, this);
2038
+ _initDefineProp(this, 'balance', _descriptor12, this);
1753
2039
 
1754
- _initDefineProp(this, 'exchangable', _descriptor10, this);
2040
+ _initDefineProp(this, 'exchangable', _descriptor13, this);
1755
2041
 
1756
- _initDefineProp(this, 'meStorageCardId', _descriptor11, this);
2042
+ _initDefineProp(this, 'MeStorageCardId', _descriptor14, this);
1757
2043
 
1758
- _initDefineProp(this, 'StorageCardNo', _descriptor12, this);
2044
+ _initDefineProp(this, 'StorageCardNo', _descriptor15, this);
1759
2045
 
1760
2046
  if (m) {
1761
2047
  this.id = m.ID;
@@ -1766,16 +2052,17 @@ var Member = exports.Member = (_class5 = function () {
1766
2052
  return key == 'canusedbalancestorage';
1767
2053
  });
1768
2054
 
1769
- var _ref22 = _mutantsUtil.platform || {},
1770
- isNewRetailBCPos = _ref22.isNewRetailBCPos;
2055
+ var _ref24 = _mutantsUtil.platform || {},
2056
+ isNewRetailBCPos = _ref24.isNewRetailBCPos;
1771
2057
 
1772
2058
  m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
2059
+ m.MeStorageCardId && (this.MeStorageCardId = m.MeStorageCardId);
1773
2060
  (0, _mobx.runInAction)(function () {
1774
- _this16.cardNo = m.CardCode;
2061
+ _this19.cardNo = m.CardCode;
1775
2062
  if (index >= 0) {
1776
- _this16.balance = parseFloat(m.DynamicPropertyValues[index]);
2063
+ _this19.balance = parseFloat(m.DynamicPropertyValues[index]);
1777
2064
  } else {
1778
- _this16.balance = _this16.rawbalance;
2065
+ _this19.balance = _this19.rawbalance;
1779
2066
  }
1780
2067
  });
1781
2068
  this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
@@ -1798,7 +2085,7 @@ var Member = exports.Member = (_class5 = function () {
1798
2085
  }, {
1799
2086
  key: 'setMeStorageCardId',
1800
2087
  value: function setMeStorageCardId(v) {
1801
- this.meStorageCardId = v;
2088
+ this.MeStorageCardId = v;
1802
2089
  }
1803
2090
  }, {
1804
2091
  key: 'setStorageCardNo',
@@ -1807,19 +2094,19 @@ var Member = exports.Member = (_class5 = function () {
1807
2094
  }
1808
2095
  }]);
1809
2096
  return Member;
1810
- }(), (_descriptor8 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
2097
+ }(), (_descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
1811
2098
  enumerable: true,
1812
2099
  initializer: null
1813
- }), _descriptor9 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
2100
+ }), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
1814
2101
  enumerable: true,
1815
2102
  initializer: null
1816
- }), _descriptor10 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
2103
+ }), _descriptor13 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
1817
2104
  enumerable: true,
1818
2105
  initializer: null
1819
- }), _descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'meStorageCardId', [_mobx.observable], {
2106
+ }), _descriptor14 = _applyDecoratedDescriptor(_class5.prototype, 'MeStorageCardId', [_mobx.observable], {
1820
2107
  enumerable: true,
1821
2108
  initializer: null
1822
- }), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
2109
+ }), _descriptor15 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
1823
2110
  enumerable: true,
1824
2111
  initializer: null
1825
2112
  }), _applyDecoratedDescriptor(_class5.prototype, 'setExchangable', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setExchangable'), _class5.prototype), _applyDecoratedDescriptor(_class5.prototype, 'setCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setCardNo'), _class5.prototype), _applyDecoratedDescriptor(_class5.prototype, 'setMeStorageCardId', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setMeStorageCardId'), _class5.prototype), _applyDecoratedDescriptor(_class5.prototype, 'setStorageCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setStorageCardNo'), _class5.prototype)), _class5);