tplus-components-touch 3.22.1 → 3.22.2
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.
- package/dist/components/billSearch/index.js +64 -4
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +12 -2
- package/dist/components/cloudPrint/api.js +1 -1
- package/dist/components/cloudPrint/api.js.map +1 -1
- package/dist/components/cloudPrint/index.js +57 -33
- package/dist/components/cloudPrint/index.js.map +1 -1
- package/dist/components/cloudPrint/printDispatch.js +223 -0
- package/dist/components/cloudPrint/printDispatch.js.map +1 -0
- package/dist/components/commonForm/addressPicker/index.js +4 -2
- package/dist/components/commonForm/addressPicker/index.js.map +1 -1
- package/dist/components/commonForm/formControl/index.js +3 -0
- package/dist/components/commonForm/formControl/index.js.map +1 -1
- package/dist/components/hotKey/localConfig.js +14 -1
- package/dist/components/hotKey/localConfig.js.map +1 -1
- package/dist/components/keyboard/index.js +1 -1
- package/dist/components/keyboard/index.js.map +1 -1
- package/dist/components/modalWraper/style.less +6 -0
- package/dist/components/settlement/settlement.js +187 -130
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +62 -10
- package/dist/components/settlement/settlementStore.js +431 -190
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/ticon/iconfont/demo_index.html +5202 -4949
- package/dist/components/ticon/iconfont/iconfont.css +887 -843
- package/dist/components/ticon/iconfont/iconfont.js +1 -1
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
- package/dist/components/ticon/iconfont/iconfont.json +1535 -1458
- package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
- package/dist/components/touchTable/index.js +8 -0
- package/dist/components/touchTable/index.js.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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,18 +93,22 @@ 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');
|
|
107
|
-
|
|
108
112
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
109
113
|
|
|
110
114
|
function _initDefineProp(target, property, descriptor, context) {
|
|
@@ -194,6 +198,9 @@ var SettlementStore = (_class = function () {
|
|
|
194
198
|
if (dto.OnlinePaymentAmount) {
|
|
195
199
|
onlinePaymentAmount = dto.OnlinePaymentAmount;
|
|
196
200
|
}
|
|
201
|
+
promoVoucher.promoLinks = (0, _filter3.default)(_this2.paymode.currentMode.djqs, function (djq) {
|
|
202
|
+
return djq.checked;
|
|
203
|
+
});
|
|
197
204
|
promoVoucher.totalAmountWithTax = Math.Minus(dto.TotalTaxAmount, onlinePaymentAmount);
|
|
198
205
|
promoVoucher.redBlueFlagEnum = "BLUE";
|
|
199
206
|
promoVoucher.meMemberId = dto.Idmember;
|
|
@@ -209,7 +216,7 @@ var SettlementStore = (_class = function () {
|
|
|
209
216
|
detailDTO.productSpecId = item.ProductSpecId;
|
|
210
217
|
detailDTO.isManualFreeGift = item.IsPresent;
|
|
211
218
|
detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
|
|
212
|
-
|
|
219
|
+
detailDTO.IsManualChangePrice = item.IsManualChangePrice;
|
|
213
220
|
if (detailDTO.IsManualChangePrice) //如果是手工改价
|
|
214
221
|
{
|
|
215
222
|
detailDTO.listPrice = item.TaxPrice;
|
|
@@ -259,7 +266,8 @@ var SettlementStore = (_class = function () {
|
|
|
259
266
|
var condValue = tieredAmountResult.condValue,
|
|
260
267
|
promoDiscount = tieredAmountResult.promoDiscount,
|
|
261
268
|
displayText = tieredAmountResult.displayText,
|
|
262
|
-
promoRuleId = tieredAmountResult.promoRuleId
|
|
269
|
+
promoRuleId = tieredAmountResult.promoRuleId,
|
|
270
|
+
couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
|
|
263
271
|
|
|
264
272
|
if ((0, _find3.default)(_this2.paymode.currentMode.djqs, function (djq) {
|
|
265
273
|
return djq.code == couponCode;
|
|
@@ -270,7 +278,12 @@ var SettlementStore = (_class = function () {
|
|
|
270
278
|
})) {
|
|
271
279
|
_message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
|
|
272
280
|
} else {
|
|
273
|
-
|
|
281
|
+
var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
|
|
282
|
+
|
|
283
|
+
var _ref2 = _mutantsUtil.platform || {},
|
|
284
|
+
isNewRetailBCPos = _ref2.isNewRetailBCPos;
|
|
285
|
+
|
|
286
|
+
_this2.addDjq(couponCode, name, IsEnable, promoMethodEnum == "CASH_COUPON" ? nominalAmount : isNewRetailBCPos && discountPct > 0 ? 0 : promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, true, 1);
|
|
274
287
|
}
|
|
275
288
|
});
|
|
276
289
|
if (promoVoucher.coupon_code) {
|
|
@@ -293,14 +306,14 @@ var SettlementStore = (_class = function () {
|
|
|
293
306
|
};
|
|
294
307
|
|
|
295
308
|
this.checkCoupon = function () {
|
|
296
|
-
var
|
|
297
|
-
var
|
|
309
|
+
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
|
|
310
|
+
var _ref4, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
|
|
298
311
|
|
|
299
312
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
300
313
|
while (1) {
|
|
301
314
|
switch (_context.prev = _context.next) {
|
|
302
315
|
case 0:
|
|
303
|
-
|
|
316
|
+
_ref4 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref4.isNewRetailBCPos;
|
|
304
317
|
|
|
305
318
|
if (!isNewRetailBCPos) {
|
|
306
319
|
_context.next = 7;
|
|
@@ -368,7 +381,7 @@ var SettlementStore = (_class = function () {
|
|
|
368
381
|
}));
|
|
369
382
|
|
|
370
383
|
return function (_x) {
|
|
371
|
-
return
|
|
384
|
+
return _ref3.apply(this, arguments);
|
|
372
385
|
};
|
|
373
386
|
}();
|
|
374
387
|
|
|
@@ -398,7 +411,6 @@ var SettlementStore = (_class = function () {
|
|
|
398
411
|
this.paymode = new PayMode();
|
|
399
412
|
var params = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
400
413
|
if (params) this.cloudPrintArguments = params;
|
|
401
|
-
this.printUtil = new _tplusComponentsTouch.PrintUtil();
|
|
402
414
|
this.newStyle = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') == 'voucher';
|
|
403
415
|
}
|
|
404
416
|
|
|
@@ -482,8 +494,8 @@ var SettlementStore = (_class = function () {
|
|
|
482
494
|
var _enumController$getEn4 = _mutantsUtil.enumController.getEnumOj(),
|
|
483
495
|
PayStyle = _enumController$getEn4.PayStyle;
|
|
484
496
|
|
|
485
|
-
var
|
|
486
|
-
isNewRetailBCPos =
|
|
497
|
+
var _ref5 = _mutantsUtil.platform || {},
|
|
498
|
+
isNewRetailBCPos = _ref5.isNewRetailBCPos;
|
|
487
499
|
|
|
488
500
|
(0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
|
|
489
501
|
var themode = (0, _find3.default)(_this5.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
|
|
@@ -506,19 +518,19 @@ var SettlementStore = (_class = function () {
|
|
|
506
518
|
if (themode.paymentType == PayStyle.djq) {
|
|
507
519
|
(0, _each3.default)(_this5.dto.RetailCouponDetails, function (djq) {
|
|
508
520
|
if (isNewRetailBCPos) {
|
|
509
|
-
var
|
|
510
|
-
displayText =
|
|
511
|
-
promoRuleId =
|
|
512
|
-
dateMount =
|
|
513
|
-
promoMethodEnum =
|
|
514
|
-
discountPct =
|
|
515
|
-
promoId =
|
|
516
|
-
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);
|
|
521
|
+
var _ref6 = djq || {},
|
|
522
|
+
displayText = _ref6.displayText,
|
|
523
|
+
promoRuleId = _ref6.promoRuleId,
|
|
524
|
+
dateMount = _ref6.dateMount,
|
|
525
|
+
promoMethodEnum = _ref6.promoMethodEnum,
|
|
526
|
+
discountPct = _ref6.discountPct,
|
|
527
|
+
promoId = _ref6.promoId,
|
|
528
|
+
id = _ref6.id;
|
|
529
|
+
|
|
530
|
+
_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
531
|
return;
|
|
520
532
|
}
|
|
521
|
-
_this5.addDjq(djq.CouponCode, djq.CouponTitle, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
|
|
533
|
+
_this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
|
|
522
534
|
});
|
|
523
535
|
}
|
|
524
536
|
_this5.paymode.thePaymodes.push(newmode);
|
|
@@ -595,9 +607,9 @@ var SettlementStore = (_class = function () {
|
|
|
595
607
|
}, {
|
|
596
608
|
key: 'getLoginInfo',
|
|
597
609
|
value: function getLoginInfo() {
|
|
598
|
-
var
|
|
599
|
-
|
|
600
|
-
loginInfo =
|
|
610
|
+
var _ref7 = _mutantsMicrofx.localStore.get('user') || {},
|
|
611
|
+
_ref7$loginInfo = _ref7.loginInfo,
|
|
612
|
+
loginInfo = _ref7$loginInfo === undefined ? {} : _ref7$loginInfo;
|
|
601
613
|
|
|
602
614
|
return loginInfo;
|
|
603
615
|
}
|
|
@@ -616,61 +628,107 @@ var SettlementStore = (_class = function () {
|
|
|
616
628
|
var IdStore = this.storeInfo.storeID;
|
|
617
629
|
var StoreCode = this.storeInfo.storeCode; //_find(this.storeInfo.storeInfos,(store)=>{return store.ID==IdStore;}).Code;
|
|
618
630
|
|
|
619
|
-
var
|
|
620
|
-
isNewRetailBCPos =
|
|
631
|
+
var _ref8 = _mutantsUtil.platform || {},
|
|
632
|
+
isNewRetailBCPos = _ref8.isNewRetailBCPos;
|
|
621
633
|
|
|
622
634
|
var address = '';
|
|
623
635
|
if (isNewRetailBCPos) {
|
|
624
|
-
address = '
|
|
636
|
+
// address = '/member/memberProfile/FindByStorageCode/'+v;
|
|
637
|
+
address = '/member/MeMemberWallet/FindByStorageCode';
|
|
638
|
+
return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function (result) {
|
|
639
|
+
var data = result.data;
|
|
640
|
+
var m = data;
|
|
641
|
+
|
|
642
|
+
var _ref9 = _mutantsUtil.platform || {},
|
|
643
|
+
isNewRetailBCPos = _ref9.isNewRetailBCPos;
|
|
644
|
+
|
|
645
|
+
if (isNewRetailBCPos) {
|
|
646
|
+
_this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
|
|
647
|
+
_this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
|
|
648
|
+
_this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
|
|
649
|
+
_this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
|
|
650
|
+
}
|
|
651
|
+
if (!m || !m.ID) {
|
|
652
|
+
(0, _mobx.runInAction)(function () {
|
|
653
|
+
_this7.paymode.currentMode.errinfo = "无效的会员卡号";
|
|
654
|
+
});
|
|
655
|
+
} else {
|
|
656
|
+
(0, _mobx.runInAction)(function () {
|
|
657
|
+
_this7.paymode.currentMode.errinfo = "";
|
|
658
|
+
_this7.paymode.currentMode.member = new Member(m);
|
|
659
|
+
_this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
|
|
660
|
+
_this7.updateEvent();
|
|
661
|
+
var message = '';
|
|
662
|
+
if (global.CheckMemberStorageProcessorBlock) {
|
|
663
|
+
message = CheckMemberStorageProcessorBlock.execute(m);
|
|
664
|
+
}
|
|
665
|
+
if (!String.isNullOrEmpty(message)) {
|
|
666
|
+
_this7.paymode.currentMode.errinfo = message;
|
|
667
|
+
} else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
|
|
668
|
+
_this7.paymode.currentMode.errinfo = "余额不足";
|
|
669
|
+
} else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
|
|
670
|
+
_this7.paymode.currentMode.errinfo = "实收金额必须录入";
|
|
671
|
+
} else {
|
|
672
|
+
// 查询成功后将焦点移入下一个输入框
|
|
673
|
+
var nextInput = document.querySelector('.czk .received .input');
|
|
674
|
+
nextInput && nextInput.focus();
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
});
|
|
625
679
|
} else {
|
|
626
680
|
address = 'AA.DR.newRetailMember.SearchMember';
|
|
681
|
+
return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, address, false, false).then(function (result) {
|
|
682
|
+
var data = JSON.parse(result.Data);
|
|
683
|
+
var m = data && data.length > 0 && data[0];
|
|
684
|
+
|
|
685
|
+
var _ref10 = _mutantsUtil.platform || {},
|
|
686
|
+
isNewRetailBCPos = _ref10.isNewRetailBCPos;
|
|
687
|
+
|
|
688
|
+
if (isNewRetailBCPos) {
|
|
689
|
+
_this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
|
|
690
|
+
_this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
|
|
691
|
+
_this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
|
|
692
|
+
_this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
|
|
693
|
+
}
|
|
694
|
+
if (!m || !m.ID) {
|
|
695
|
+
(0, _mobx.runInAction)(function () {
|
|
696
|
+
_this7.paymode.currentMode.errinfo = "无效的会员卡号";
|
|
697
|
+
});
|
|
698
|
+
} else {
|
|
699
|
+
(0, _mobx.runInAction)(function () {
|
|
700
|
+
_this7.paymode.currentMode.errinfo = "";
|
|
701
|
+
_this7.paymode.currentMode.member = new Member(m);
|
|
702
|
+
_this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
|
|
703
|
+
_this7.updateEvent();
|
|
704
|
+
var message = '';
|
|
705
|
+
if (global.CheckMemberStorageProcessorBlock) {
|
|
706
|
+
message = CheckMemberStorageProcessorBlock.execute(data[0]);
|
|
707
|
+
}
|
|
708
|
+
if (!String.isNullOrEmpty(message)) {
|
|
709
|
+
_this7.paymode.currentMode.errinfo = message;
|
|
710
|
+
} else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
|
|
711
|
+
_this7.paymode.currentMode.errinfo = "余额不足";
|
|
712
|
+
} else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
|
|
713
|
+
_this7.paymode.currentMode.errinfo = "实收金额必须录入";
|
|
714
|
+
} else {
|
|
715
|
+
// 查询成功后将焦点移入下一个输入框
|
|
716
|
+
var nextInput = document.querySelector('.czk .received .input');
|
|
717
|
+
nextInput && nextInput.focus();
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
});
|
|
627
722
|
}
|
|
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
723
|
}
|
|
668
724
|
}, {
|
|
669
725
|
key: 'addDjq',
|
|
670
|
-
value: function addDjq(
|
|
726
|
+
value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
|
|
671
727
|
var djq = {
|
|
672
|
-
code:
|
|
728
|
+
code: promoCouponCode,
|
|
729
|
+
promoCouponCode: promoCouponCode,
|
|
673
730
|
name: name,
|
|
731
|
+
IsEnable: IsEnable,
|
|
674
732
|
amount: amount,
|
|
675
733
|
doorsill: doorsill, //:"无门槛"
|
|
676
734
|
LastTS: LastTS,
|
|
@@ -683,9 +741,12 @@ var SettlementStore = (_class = function () {
|
|
|
683
741
|
discountPct: discountPct,
|
|
684
742
|
promoId: promoId,
|
|
685
743
|
promoRuleId: promoRuleId,
|
|
686
|
-
|
|
744
|
+
couponCategoryEnum: couponCategoryEnum,
|
|
745
|
+
id: id,
|
|
746
|
+
count: count === 1 && (couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT') ? 1 : null
|
|
687
747
|
};
|
|
688
748
|
this.paymode.currentMode.djqs.push(djq);
|
|
749
|
+
// let copyData = _clonedeep(this.data[targetIndex]);
|
|
689
750
|
!unCheck && !this.boriginReturn && this.paymode.calcDjqValue(djq);
|
|
690
751
|
}
|
|
691
752
|
}, {
|
|
@@ -913,7 +974,7 @@ var SettlementStore = (_class = function () {
|
|
|
913
974
|
}, {
|
|
914
975
|
key: 'commit',
|
|
915
976
|
value: function () {
|
|
916
|
-
var
|
|
977
|
+
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
|
|
917
978
|
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
918
979
|
while (1) {
|
|
919
980
|
switch (_context2.prev = _context2.next) {
|
|
@@ -968,11 +1029,17 @@ var SettlementStore = (_class = function () {
|
|
|
968
1029
|
}));
|
|
969
1030
|
|
|
970
1031
|
function commit(_x2) {
|
|
971
|
-
return
|
|
1032
|
+
return _ref11.apply(this, arguments);
|
|
972
1033
|
}
|
|
973
1034
|
|
|
974
1035
|
return commit;
|
|
975
1036
|
}()
|
|
1037
|
+
}, {
|
|
1038
|
+
key: 'handlePrint',
|
|
1039
|
+
value: function handlePrint(resp) {
|
|
1040
|
+
// 储值打印
|
|
1041
|
+
return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp.ID, {});
|
|
1042
|
+
}
|
|
976
1043
|
}, {
|
|
977
1044
|
key: 'saveMember',
|
|
978
1045
|
value: function saveMember() {
|
|
@@ -1014,80 +1081,16 @@ var SettlementStore = (_class = function () {
|
|
|
1014
1081
|
IPMSG = JSON.parse(window.localStorage.IPMSG);
|
|
1015
1082
|
}
|
|
1016
1083
|
return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
|
|
1017
|
-
|
|
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
|
-
}
|
|
1084
|
+
_this10.handlePrint(resp);
|
|
1082
1085
|
});
|
|
1083
1086
|
}
|
|
1084
1087
|
}, {
|
|
1085
1088
|
key: 'save',
|
|
1086
1089
|
value: function () {
|
|
1087
|
-
var
|
|
1090
|
+
var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
|
|
1088
1091
|
var _this11 = this;
|
|
1089
1092
|
|
|
1090
|
-
var _enumController$getEn13, PayStyle,
|
|
1093
|
+
var _enumController$getEn13, PayStyle, _ref14, isNewRetailBCPos, IPMSG, RetailTypeEnum;
|
|
1091
1094
|
|
|
1092
1095
|
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
1093
1096
|
while (1) {
|
|
@@ -1101,19 +1104,21 @@ var SettlementStore = (_class = function () {
|
|
|
1101
1104
|
_this11.dto.RetailCouponDetails = [];
|
|
1102
1105
|
var czkSum = 0;
|
|
1103
1106
|
var Idmember = _this11.dto.Idmember;
|
|
1107
|
+
var count = 0;
|
|
1104
1108
|
var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
|
|
1105
1109
|
return parseFloat(mode.value) != 0;
|
|
1106
1110
|
}) : _this11.paymode.thePaymodes;
|
|
1107
|
-
(0, _each3.default)(thePaymodes, function (mode) {
|
|
1111
|
+
(0, _each3.default)(thePaymodes, function (mode, index) {
|
|
1108
1112
|
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
|
|
1109
1113
|
if (mode.paymentType == PayStyle.hyczk) {
|
|
1110
1114
|
if (!Idmember) {
|
|
1111
1115
|
Idmember = mode.member.id;
|
|
1112
1116
|
}
|
|
1113
1117
|
czkSum = Math.Add(czkSum, mode.value);
|
|
1114
|
-
|
|
1118
|
+
var MeStorageCardId = mode.member.MeStorageCardId ? mode.member.MeStorageCardId : _this11.member.MeStorageCardId;
|
|
1115
1119
|
_this11.dto.RetailStorageDetails.push({
|
|
1116
1120
|
Code: mode.paymethodId,
|
|
1121
|
+
MeStorageCardId: MeStorageCardId,
|
|
1117
1122
|
StoragePaymentAmount: mode.value,
|
|
1118
1123
|
IsOrigReturn: false,
|
|
1119
1124
|
BalanceStorage: mode.balance,
|
|
@@ -1167,15 +1172,15 @@ var SettlementStore = (_class = function () {
|
|
|
1167
1172
|
}
|
|
1168
1173
|
});
|
|
1169
1174
|
|
|
1170
|
-
var
|
|
1171
|
-
isNewRetailBCPos =
|
|
1175
|
+
var _ref13 = _mutantsUtil.platform || {},
|
|
1176
|
+
isNewRetailBCPos = _ref13.isNewRetailBCPos;
|
|
1172
1177
|
|
|
1173
1178
|
if (_this11.dto.RetailStorageDetails.length > 0) {
|
|
1174
1179
|
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
|
|
1175
1180
|
if (isNewRetailBCPos) {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
})
|
|
1181
|
+
// this.dto.RetailStorageDetails && this.dto.RetailStorageDetails.forEach((value, index) => {
|
|
1182
|
+
// value.MeStorageCardId = (mode.MeStorageCardId ? mode.MeStorageCardId : this.member.MeStorageCardId);
|
|
1183
|
+
// })
|
|
1179
1184
|
_this11.dto.RetailPaymentDetails.push({
|
|
1180
1185
|
Code: _this11.paymode.counter,
|
|
1181
1186
|
OrigAmount: czkSum,
|
|
@@ -1202,7 +1207,7 @@ var SettlementStore = (_class = function () {
|
|
|
1202
1207
|
_this11.dto.Idmember = Idmember;
|
|
1203
1208
|
}
|
|
1204
1209
|
});
|
|
1205
|
-
|
|
1210
|
+
_ref14 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref14.isNewRetailBCPos;
|
|
1206
1211
|
|
|
1207
1212
|
console.log('bc_pos\u73AF\u5883:' + isNewRetailBCPos + ',\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
|
|
1208
1213
|
|
|
@@ -1271,7 +1276,7 @@ var SettlementStore = (_class = function () {
|
|
|
1271
1276
|
}));
|
|
1272
1277
|
|
|
1273
1278
|
function save() {
|
|
1274
|
-
return
|
|
1279
|
+
return _ref12.apply(this, arguments);
|
|
1275
1280
|
}
|
|
1276
1281
|
|
|
1277
1282
|
return save;
|
|
@@ -1284,7 +1289,7 @@ var SettlementStore = (_class = function () {
|
|
|
1284
1289
|
}, {
|
|
1285
1290
|
key: 'querySettleResult',
|
|
1286
1291
|
value: function () {
|
|
1287
|
-
var
|
|
1292
|
+
var _ref15 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
|
|
1288
1293
|
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
|
1289
1294
|
while (1) {
|
|
1290
1295
|
switch (_context4.prev = _context4.next) {
|
|
@@ -1312,7 +1317,7 @@ var SettlementStore = (_class = function () {
|
|
|
1312
1317
|
}));
|
|
1313
1318
|
|
|
1314
1319
|
function querySettleResult() {
|
|
1315
|
-
return
|
|
1320
|
+
return _ref15.apply(this, arguments);
|
|
1316
1321
|
}
|
|
1317
1322
|
|
|
1318
1323
|
return querySettleResult;
|
|
@@ -1338,14 +1343,14 @@ var SettlementStore = (_class = function () {
|
|
|
1338
1343
|
}, {
|
|
1339
1344
|
key: 'validePwd',
|
|
1340
1345
|
value: function () {
|
|
1341
|
-
var
|
|
1342
|
-
var
|
|
1346
|
+
var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(value) {
|
|
1347
|
+
var _ref17, isNewRetailBCPos, cook1, cook2, message, result, count, _result;
|
|
1343
1348
|
|
|
1344
1349
|
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
|
1345
1350
|
while (1) {
|
|
1346
1351
|
switch (_context5.prev = _context5.next) {
|
|
1347
1352
|
case 0:
|
|
1348
|
-
|
|
1353
|
+
_ref17 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref17.isNewRetailBCPos;
|
|
1349
1354
|
_context5.prev = 1;
|
|
1350
1355
|
|
|
1351
1356
|
if (!isNewRetailBCPos) {
|
|
@@ -1429,7 +1434,7 @@ var SettlementStore = (_class = function () {
|
|
|
1429
1434
|
}));
|
|
1430
1435
|
|
|
1431
1436
|
function validePwd(_x3) {
|
|
1432
|
-
return
|
|
1437
|
+
return _ref16.apply(this, arguments);
|
|
1433
1438
|
}
|
|
1434
1439
|
|
|
1435
1440
|
return validePwd;
|
|
@@ -1468,7 +1473,7 @@ var SettlementStore = (_class = function () {
|
|
|
1468
1473
|
var _this13 = this;
|
|
1469
1474
|
|
|
1470
1475
|
return function () {
|
|
1471
|
-
var
|
|
1476
|
+
var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_this) {
|
|
1472
1477
|
var _getLoginInfo, IdStore, StoreCode, resp;
|
|
1473
1478
|
|
|
1474
1479
|
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
|
@@ -1495,13 +1500,14 @@ var SettlementStore = (_class = function () {
|
|
|
1495
1500
|
}));
|
|
1496
1501
|
|
|
1497
1502
|
return function (_x4) {
|
|
1498
|
-
return
|
|
1503
|
+
return _ref18.apply(this, arguments);
|
|
1499
1504
|
};
|
|
1500
1505
|
}();
|
|
1501
1506
|
}
|
|
1502
1507
|
}), _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
1508
|
exports.default = SettlementStore;
|
|
1504
1509
|
var PayMode = exports.PayMode = (_class3 = function () {
|
|
1510
|
+
//应收
|
|
1505
1511
|
function PayMode() {
|
|
1506
1512
|
// this.amount=getFixedNumber(amount);
|
|
1507
1513
|
// this.calcReserved();
|
|
@@ -1523,11 +1529,19 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1523
1529
|
_initDefineProp(this, 'thePaymodes', _descriptor7, this);
|
|
1524
1530
|
|
|
1525
1531
|
this.currentMode = null;
|
|
1532
|
+
this.checkList = [];
|
|
1526
1533
|
this.settle = {
|
|
1527
1534
|
name: "复合结算",
|
|
1528
1535
|
hotKey: "Ctrl+M"
|
|
1529
1536
|
};
|
|
1530
|
-
|
|
1537
|
+
|
|
1538
|
+
_initDefineProp(this, 'calcCheckList', _descriptor8, this);
|
|
1539
|
+
|
|
1540
|
+
_initDefineProp(this, 'setCouponNum', _descriptor9, this);
|
|
1541
|
+
|
|
1542
|
+
_initDefineProp(this, 'addDjqs', _descriptor10, this);
|
|
1543
|
+
}
|
|
1544
|
+
// @observable store = null;
|
|
1531
1545
|
|
|
1532
1546
|
|
|
1533
1547
|
(0, _createClass3.default)(PayMode, [{
|
|
@@ -1562,14 +1576,24 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1562
1576
|
this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
|
|
1563
1577
|
}
|
|
1564
1578
|
}, {
|
|
1565
|
-
key: '
|
|
1566
|
-
value: function
|
|
1579
|
+
key: 'calcDjqCheckValue',
|
|
1580
|
+
value: function calcDjqCheckValue(q1, dto) {
|
|
1567
1581
|
var _this14 = this;
|
|
1568
1582
|
|
|
1569
|
-
var
|
|
1570
|
-
|
|
1583
|
+
var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
|
|
1584
|
+
var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1585
|
+
return djq.checked;
|
|
1586
|
+
});
|
|
1587
|
+
if (qList.length === useLimitPerOrder && !q1.checked) {
|
|
1588
|
+
_message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
var _ref19 = _mutantsUtil.platform || {},
|
|
1593
|
+
isNewRetailBCPos = _ref19.isNewRetailBCPos;
|
|
1571
1594
|
|
|
1572
1595
|
var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
|
|
1596
|
+
PayStyle = _enumController$getEn14.PayStyle,
|
|
1573
1597
|
Differentiate = _enumController$getEn14.Differentiate;
|
|
1574
1598
|
|
|
1575
1599
|
if (q1) {
|
|
@@ -1578,22 +1602,185 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1578
1602
|
return;
|
|
1579
1603
|
}
|
|
1580
1604
|
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1581
|
-
return djq.
|
|
1605
|
+
return djq.promoCouponCode == q1.promoCouponCode;
|
|
1582
1606
|
});
|
|
1583
1607
|
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1584
1608
|
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1585
1609
|
return;
|
|
1586
1610
|
}
|
|
1587
1611
|
//判断是否是选择优惠券 //CC优惠券只能使用一个
|
|
1588
|
-
if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1612
|
+
// if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1613
|
+
// // 检查是否有已经选定优惠券 并且去除选定的优惠券
|
|
1614
|
+
// this.currentMode.djqs.forEach((djq, index) => {
|
|
1615
|
+
// if (djq.checked) this.currentMode.djqs[index].checked = false;
|
|
1616
|
+
// })
|
|
1617
|
+
// }
|
|
1618
|
+
q && (q.checked = !q.checked);
|
|
1619
|
+
}
|
|
1620
|
+
var sum = 0;
|
|
1621
|
+
// console.log(this.store, 'stores-------');
|
|
1622
|
+
if (!q1.checked) {
|
|
1623
|
+
this.checkList.forEach(function (ele, i) {
|
|
1624
|
+
if (ele.id === q1.id) {
|
|
1625
|
+
_this14.checkList.splice(i, 1);
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
} else {
|
|
1629
|
+
if (q1.discountPct > 0) {
|
|
1630
|
+
q1.amount = 0;
|
|
1631
|
+
}
|
|
1632
|
+
this.checkList.push(q1);
|
|
1633
|
+
}
|
|
1634
|
+
this.checkList.forEach(function (ele, i) {
|
|
1635
|
+
if (ele.discountPct > 0) {
|
|
1636
|
+
if (ele.amount === 0) {
|
|
1637
|
+
console.log(ele.amount, _this14.currentMode.receivable, 'amount2222222222');
|
|
1638
|
+
ele.amount = (1 - ele.discountPct) * _this14.currentMode.receivable;
|
|
1639
|
+
console.log(ele.amount, _this14.currentMode.receivable, 'amount1111111111');
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
sum = Math.Add(sum, ele.amount);
|
|
1643
|
+
});
|
|
1644
|
+
this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
|
|
1645
|
+
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1646
|
+
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1647
|
+
var promoVoucher = {};
|
|
1648
|
+
promoVoucher.boName = "Retail";
|
|
1649
|
+
// promoVoucher.promoLinks = _filter(this.currentMode.djqs,djq=>djq.checked);
|
|
1650
|
+
promoVoucher.meMemberId = this.currentMode.member.id;
|
|
1651
|
+
promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
|
|
1652
|
+
promoVoucher.voucherDetailList = [];
|
|
1653
|
+
dto.RetailDetails.forEach(function (item) {
|
|
1654
|
+
var detailDTO = {};
|
|
1655
|
+
detailDTO.uuid = item.Code;
|
|
1656
|
+
detailDTO.detailBoName = "RetailDetail";
|
|
1657
|
+
detailDTO.voucherDetailId = item.ID;
|
|
1658
|
+
detailDTO.productId = item.Idinventory;
|
|
1659
|
+
detailDTO.uomId = item.Idunit;
|
|
1660
|
+
detailDTO.productSpecId = item.ProductSpecId;
|
|
1661
|
+
detailDTO.isManualFreeGift = item.IsPresent;
|
|
1662
|
+
detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
|
|
1663
|
+
detailDTO.IsManualChangePrice = item.IsManualChangePrice;
|
|
1664
|
+
if (detailDTO.IsManualChangePrice) //如果是手工改价
|
|
1665
|
+
{
|
|
1666
|
+
detailDTO.listPrice = item.TaxPrice;
|
|
1667
|
+
detailDTO.netAmountWithTax = item.TaxAmount;
|
|
1668
|
+
} else {
|
|
1669
|
+
var bookingQuantity = 0;
|
|
1670
|
+
if (item.BookingQuantity) {
|
|
1671
|
+
bookingQuantity = item.BookingQuantity;
|
|
1672
|
+
}
|
|
1673
|
+
detailDTO.listPrice = item.MemberPrice;
|
|
1674
|
+
detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
|
|
1675
|
+
}
|
|
1676
|
+
detailDTO.taxRate = item.TaxRate;
|
|
1677
|
+
detailDTO.quantity = item.Quantity;
|
|
1678
|
+
|
|
1679
|
+
detailDTO.amountWithTax = item.RetailAmount;
|
|
1680
|
+
// 促销 start
|
|
1681
|
+
if (item.PromotionDetails && item.PromotionDetails.length != 0) {
|
|
1682
|
+
var promoLinks = [];
|
|
1683
|
+
item.PromotionDetails.forEach(function (promotion) {
|
|
1684
|
+
promoLinks.push({
|
|
1685
|
+
promoId: promotion.IdSalesPromotionDTO,
|
|
1686
|
+
promoRuleId: promotion.PromotionRuleId
|
|
1687
|
+
});
|
|
1592
1688
|
});
|
|
1689
|
+
if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
|
|
1593
1690
|
}
|
|
1691
|
+
// 促销 end
|
|
1692
|
+
promoVoucher.voucherDetailList.push(detailDTO);
|
|
1693
|
+
});
|
|
1694
|
+
promoVoucher.promoLinks = this.checkList;
|
|
1695
|
+
return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
|
|
1696
|
+
if (result && result.length != 0) {
|
|
1697
|
+
result.forEach(function (element) {
|
|
1698
|
+
var djq1 = (0, _filter3.default)(_this14.currentMode.djqs, function (djq) {
|
|
1699
|
+
return djq.id === element.id;
|
|
1700
|
+
});
|
|
1701
|
+
|
|
1702
|
+
var _ref20 = element || {},
|
|
1703
|
+
couponCode = _ref20.couponCode,
|
|
1704
|
+
name = _ref20.name,
|
|
1705
|
+
tieredAmountResult = _ref20.tieredAmountResult,
|
|
1706
|
+
fromDate = _ref20.fromDate,
|
|
1707
|
+
dateMount = _ref20.dateMount,
|
|
1708
|
+
promoMethodEnum = _ref20.promoMethodEnum,
|
|
1709
|
+
discountPct = _ref20.discountPct,
|
|
1710
|
+
nominalAmount = _ref20.nominalAmount,
|
|
1711
|
+
promoId = _ref20.promoId,
|
|
1712
|
+
id = _ref20.id,
|
|
1713
|
+
doorsill = _ref20.doorsill;
|
|
1714
|
+
|
|
1715
|
+
var condValue = tieredAmountResult.condValue,
|
|
1716
|
+
promoDiscount = tieredAmountResult.promoDiscount,
|
|
1717
|
+
displayText = tieredAmountResult.displayText,
|
|
1718
|
+
promoRuleId = tieredAmountResult.promoRuleId,
|
|
1719
|
+
couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
|
|
1720
|
+
|
|
1721
|
+
if (!djq1.length) {
|
|
1722
|
+
// this.currentMode.djqs.push({
|
|
1723
|
+
// promoCouponCode: element.CouponCode,
|
|
1724
|
+
// name: element.CouponTitle,
|
|
1725
|
+
// IsEnable: true,
|
|
1726
|
+
// amount: element.ReductionAmount,
|
|
1727
|
+
// doorsill: element.EnableAmount,
|
|
1728
|
+
// LastTS: element.LastTS,
|
|
1729
|
+
// checked: false,
|
|
1730
|
+
// IsRepelWithPoints: true,
|
|
1731
|
+
// UMemberID: dto.Idmember,
|
|
1732
|
+
// expired: null,
|
|
1733
|
+
// displayText,
|
|
1734
|
+
// promoMethodEnum,
|
|
1735
|
+
// discountPct,
|
|
1736
|
+
// promoId,
|
|
1737
|
+
// promoRuleId,
|
|
1738
|
+
// couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
|
|
1739
|
+
// id
|
|
1740
|
+
// })
|
|
1741
|
+
_this14.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
|
|
1742
|
+
} else {
|
|
1743
|
+
_this14.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum);
|
|
1744
|
+
// this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
|
|
1745
|
+
// djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
|
|
1746
|
+
}
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
});
|
|
1750
|
+
//this.receivable = getFixedNumber(this.receivable - sum);
|
|
1751
|
+
}
|
|
1752
|
+
}, {
|
|
1753
|
+
key: 'calcDjqValue',
|
|
1754
|
+
value: function calcDjqValue(q1) {
|
|
1755
|
+
var _ref21 = _mutantsUtil.platform || {},
|
|
1756
|
+
isNewRetailBCPos = _ref21.isNewRetailBCPos;
|
|
1757
|
+
|
|
1758
|
+
var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
|
|
1759
|
+
Differentiate = _enumController$getEn15.Differentiate;
|
|
1760
|
+
|
|
1761
|
+
if (q1) {
|
|
1762
|
+
if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
|
|
1763
|
+
_message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
|
|
1764
|
+
return;
|
|
1765
|
+
}
|
|
1766
|
+
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1767
|
+
return djq.code == q1.code;
|
|
1768
|
+
});
|
|
1769
|
+
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1770
|
+
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
//判断是否是选择优惠券 //CC优惠券只能使用一个
|
|
1774
|
+
// if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1775
|
+
// // 检查是否有已经选定优惠券 并且去除选定的优惠券
|
|
1776
|
+
// this.currentMode.djqs.forEach((djq, index) => {
|
|
1777
|
+
// if (djq.checked) this.currentMode.djqs[index].checked = false;
|
|
1778
|
+
// })
|
|
1779
|
+
// }
|
|
1594
1780
|
q && (q.checked = !q.checked);
|
|
1595
1781
|
}
|
|
1596
1782
|
var sum = 0;
|
|
1783
|
+
// console.log(this.store, 'stores-------');
|
|
1597
1784
|
(0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1598
1785
|
return djq.checked;
|
|
1599
1786
|
}), function (q) {
|
|
@@ -1602,6 +1789,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1602
1789
|
this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
|
|
1603
1790
|
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1604
1791
|
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1792
|
+
|
|
1605
1793
|
//this.receivable = getFixedNumber(this.receivable - sum);
|
|
1606
1794
|
}
|
|
1607
1795
|
}, {
|
|
@@ -1644,16 +1832,16 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1644
1832
|
}, {
|
|
1645
1833
|
key: 'setPaymodes',
|
|
1646
1834
|
value: function () {
|
|
1647
|
-
var
|
|
1835
|
+
var _ref22 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
|
|
1648
1836
|
var _this15 = this;
|
|
1649
1837
|
|
|
1650
|
-
var _enumController$
|
|
1838
|
+
var _enumController$getEn16, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
|
|
1651
1839
|
|
|
1652
1840
|
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
|
1653
1841
|
while (1) {
|
|
1654
1842
|
switch (_context7.prev = _context7.next) {
|
|
1655
1843
|
case 0:
|
|
1656
|
-
_enumController$
|
|
1844
|
+
_enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn16.settleStyleType, PayStyle = _enumController$getEn16.PayStyle;
|
|
1657
1845
|
memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
|
|
1658
1846
|
param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
|
|
1659
1847
|
_context7.next = 5;
|
|
@@ -1698,7 +1886,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1698
1886
|
}));
|
|
1699
1887
|
|
|
1700
1888
|
function setPaymodes(_x5, _x6) {
|
|
1701
|
-
return
|
|
1889
|
+
return _ref22.apply(this, arguments);
|
|
1702
1890
|
}
|
|
1703
1891
|
|
|
1704
1892
|
return setPaymodes;
|
|
@@ -1740,22 +1928,74 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1740
1928
|
initializer: function initializer() {
|
|
1741
1929
|
return [];
|
|
1742
1930
|
}
|
|
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),
|
|
1931
|
+
}), _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], {
|
|
1932
|
+
enumerable: true,
|
|
1933
|
+
initializer: function initializer() {
|
|
1934
|
+
var _this16 = this;
|
|
1935
|
+
|
|
1936
|
+
return function () {
|
|
1937
|
+
_this16.checkList = [];
|
|
1938
|
+
};
|
|
1939
|
+
}
|
|
1940
|
+
}), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
|
|
1941
|
+
enumerable: true,
|
|
1942
|
+
initializer: function initializer() {
|
|
1943
|
+
var _this17 = this;
|
|
1944
|
+
|
|
1945
|
+
return function (id, couponNum, code) {
|
|
1946
|
+
_this17.currentMode.djqs.forEach(function (ele) {
|
|
1947
|
+
if (ele.id === id) {
|
|
1948
|
+
ele.couponCategoryEnum = couponNum;
|
|
1949
|
+
var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
|
|
1950
|
+
ele.IsEnable = IsEnable;
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
|
|
1956
|
+
enumerable: true,
|
|
1957
|
+
initializer: function initializer() {
|
|
1958
|
+
var _this18 = this;
|
|
1959
|
+
|
|
1960
|
+
return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
|
|
1961
|
+
var djq = {
|
|
1962
|
+
promoCouponCode: promoCouponCode,
|
|
1963
|
+
name: name,
|
|
1964
|
+
IsEnable: IsEnable,
|
|
1965
|
+
amount: amount,
|
|
1966
|
+
doorsill: doorsill,
|
|
1967
|
+
LastTS: LastTS,
|
|
1968
|
+
checked: checked,
|
|
1969
|
+
IsRepelWithPoints: IsRepelWithPoints,
|
|
1970
|
+
UMemberID: UMemberID,
|
|
1971
|
+
expired: expired,
|
|
1972
|
+
displayText: displayText,
|
|
1973
|
+
promoMethodEnum: promoMethodEnum,
|
|
1974
|
+
discountPct: discountPct,
|
|
1975
|
+
promoId: promoId,
|
|
1976
|
+
promoRuleId: promoRuleId,
|
|
1977
|
+
couponCategoryEnum: couponCategoryEnum,
|
|
1978
|
+
id: id
|
|
1979
|
+
};
|
|
1980
|
+
_this18.currentMode.djqs.push(djq);
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
}), _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
1984
|
var Member = exports.Member = (_class5 = function () {
|
|
1745
1985
|
function Member(m) {
|
|
1746
|
-
var
|
|
1986
|
+
var _this19 = this;
|
|
1747
1987
|
|
|
1748
1988
|
(0, _classCallCheck3.default)(this, Member);
|
|
1749
1989
|
|
|
1750
|
-
_initDefineProp(this, 'cardNo',
|
|
1990
|
+
_initDefineProp(this, 'cardNo', _descriptor11, this);
|
|
1751
1991
|
|
|
1752
|
-
_initDefineProp(this, 'balance',
|
|
1992
|
+
_initDefineProp(this, 'balance', _descriptor12, this);
|
|
1753
1993
|
|
|
1754
|
-
_initDefineProp(this, 'exchangable',
|
|
1994
|
+
_initDefineProp(this, 'exchangable', _descriptor13, this);
|
|
1755
1995
|
|
|
1756
|
-
_initDefineProp(this, '
|
|
1996
|
+
_initDefineProp(this, 'MeStorageCardId', _descriptor14, this);
|
|
1757
1997
|
|
|
1758
|
-
_initDefineProp(this, 'StorageCardNo',
|
|
1998
|
+
_initDefineProp(this, 'StorageCardNo', _descriptor15, this);
|
|
1759
1999
|
|
|
1760
2000
|
if (m) {
|
|
1761
2001
|
this.id = m.ID;
|
|
@@ -1766,16 +2006,17 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1766
2006
|
return key == 'canusedbalancestorage';
|
|
1767
2007
|
});
|
|
1768
2008
|
|
|
1769
|
-
var
|
|
1770
|
-
isNewRetailBCPos =
|
|
2009
|
+
var _ref23 = _mutantsUtil.platform || {},
|
|
2010
|
+
isNewRetailBCPos = _ref23.isNewRetailBCPos;
|
|
1771
2011
|
|
|
1772
2012
|
m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
|
|
2013
|
+
m.MeStorageCardId && (this.MeStorageCardId = m.MeStorageCardId);
|
|
1773
2014
|
(0, _mobx.runInAction)(function () {
|
|
1774
|
-
|
|
2015
|
+
_this19.cardNo = m.CardCode;
|
|
1775
2016
|
if (index >= 0) {
|
|
1776
|
-
|
|
2017
|
+
_this19.balance = parseFloat(m.DynamicPropertyValues[index]);
|
|
1777
2018
|
} else {
|
|
1778
|
-
|
|
2019
|
+
_this19.balance = _this19.rawbalance;
|
|
1779
2020
|
}
|
|
1780
2021
|
});
|
|
1781
2022
|
this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
|
|
@@ -1798,7 +2039,7 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1798
2039
|
}, {
|
|
1799
2040
|
key: 'setMeStorageCardId',
|
|
1800
2041
|
value: function setMeStorageCardId(v) {
|
|
1801
|
-
this.
|
|
2042
|
+
this.MeStorageCardId = v;
|
|
1802
2043
|
}
|
|
1803
2044
|
}, {
|
|
1804
2045
|
key: 'setStorageCardNo',
|
|
@@ -1807,19 +2048,19 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1807
2048
|
}
|
|
1808
2049
|
}]);
|
|
1809
2050
|
return Member;
|
|
1810
|
-
}(), (
|
|
2051
|
+
}(), (_descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
|
|
1811
2052
|
enumerable: true,
|
|
1812
2053
|
initializer: null
|
|
1813
|
-
}),
|
|
2054
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
|
|
1814
2055
|
enumerable: true,
|
|
1815
2056
|
initializer: null
|
|
1816
|
-
}),
|
|
2057
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
|
|
1817
2058
|
enumerable: true,
|
|
1818
2059
|
initializer: null
|
|
1819
|
-
}),
|
|
2060
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class5.prototype, 'MeStorageCardId', [_mobx.observable], {
|
|
1820
2061
|
enumerable: true,
|
|
1821
2062
|
initializer: null
|
|
1822
|
-
}),
|
|
2063
|
+
}), _descriptor15 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
|
|
1823
2064
|
enumerable: true,
|
|
1824
2065
|
initializer: null
|
|
1825
2066
|
}), _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);
|