tplus-components-touch 3.22.1 → 3.22.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.
- package/dist/components/addLog/AddLogProcessor.js +1 -5
- package/dist/components/addLog/AddLogProcessor.js.map +1 -1
- package/dist/components/addLog/OperationLogApi.js +6 -45
- package/dist/components/addLog/OperationLogApi.js.map +1 -1
- 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/loading/index.js +5 -0
- package/dist/components/loading/index.js.map +1 -1
- package/dist/components/loading/loadingContent.js +23 -6
- package/dist/components/loading/loadingContent.js.map +1 -1
- package/dist/components/loading/style.less +12 -2
- package/dist/components/message/index.js +11 -0
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/message/index.less +16 -1
- package/dist/components/modalWraper/style.less +6 -0
- package/dist/components/settlement/settlement.js +243 -142
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +73 -11
- package/dist/components/settlement/settlementStore.js +523 -243
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/ticon/iconfont/demo_index.html +256 -3
- package/dist/components/ticon/iconfont/iconfont.css +47 -3
- 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 +77 -0
- 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 +35 -35
|
@@ -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,11 +278,16 @@ 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) {
|
|
277
|
-
_this2.paymode.
|
|
290
|
+
_this2.paymode.calcDjqCheckValue(_this2.paymode.currentMode.djqs[0], _this2.dto, 'single');
|
|
278
291
|
}
|
|
279
292
|
} else {
|
|
280
293
|
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;
|
|
@@ -308,7 +321,7 @@ var SettlementStore = (_class = function () {
|
|
|
308
321
|
}
|
|
309
322
|
|
|
310
323
|
_context.next = 4;
|
|
311
|
-
return _this2.getCouponList(sn);
|
|
324
|
+
return _this2.getCouponList(sn, 'sinlge');
|
|
312
325
|
|
|
313
326
|
case 4:
|
|
314
327
|
return _context.abrupt('return', _context.sent);
|
|
@@ -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
|
}, {
|
|
@@ -904,7 +965,12 @@ var SettlementStore = (_class = function () {
|
|
|
904
965
|
}, {
|
|
905
966
|
key: 'delPay',
|
|
906
967
|
value: function delPay(index) {
|
|
968
|
+
var _this10 = this;
|
|
969
|
+
|
|
907
970
|
(0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
|
|
971
|
+
if (mode.paymethodId === index) {
|
|
972
|
+
_this10.paymode.amount = _this10.paymode.amount + mode.value;
|
|
973
|
+
}
|
|
908
974
|
return mode.paymethodId === index;
|
|
909
975
|
});
|
|
910
976
|
this.paymode.currentFocus = -1;
|
|
@@ -913,7 +979,9 @@ var SettlementStore = (_class = function () {
|
|
|
913
979
|
}, {
|
|
914
980
|
key: 'commit',
|
|
915
981
|
value: function () {
|
|
916
|
-
var
|
|
982
|
+
var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
|
|
983
|
+
var _ref12, isNewRetailBCPos;
|
|
984
|
+
|
|
917
985
|
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
918
986
|
while (1) {
|
|
919
987
|
switch (_context2.prev = _context2.next) {
|
|
@@ -928,74 +996,96 @@ var SettlementStore = (_class = function () {
|
|
|
928
996
|
return _context2.abrupt('return', _promise2.default.resolve(true));
|
|
929
997
|
|
|
930
998
|
case 3:
|
|
931
|
-
|
|
999
|
+
_ref12 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref12.isNewRetailBCPos;
|
|
1000
|
+
_context2.prev = 4;
|
|
932
1001
|
|
|
933
1002
|
if (!(this.type == 1)) {
|
|
934
|
-
_context2.next =
|
|
1003
|
+
_context2.next = 10;
|
|
935
1004
|
break;
|
|
936
1005
|
}
|
|
937
1006
|
|
|
938
|
-
_context2.next =
|
|
1007
|
+
_context2.next = 8;
|
|
939
1008
|
return this.saveMember();
|
|
940
1009
|
|
|
941
|
-
case
|
|
942
|
-
_context2.next =
|
|
1010
|
+
case 8:
|
|
1011
|
+
_context2.next = 18;
|
|
943
1012
|
break;
|
|
944
1013
|
|
|
945
|
-
case
|
|
946
|
-
|
|
1014
|
+
case 10:
|
|
1015
|
+
if (!isNewRetailBCPos) {
|
|
1016
|
+
_context2.next = 13;
|
|
1017
|
+
break;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
_context2.next = 13;
|
|
1021
|
+
return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
|
|
1022
|
+
|
|
1023
|
+
case 13:
|
|
1024
|
+
_context2.next = 15;
|
|
947
1025
|
return this.save();
|
|
948
1026
|
|
|
949
|
-
case
|
|
1027
|
+
case 15:
|
|
1028
|
+
if (!isNewRetailBCPos) {
|
|
1029
|
+
_context2.next = 18;
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
_context2.next = 18;
|
|
1034
|
+
return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
|
|
1035
|
+
|
|
1036
|
+
case 18:
|
|
950
1037
|
return _context2.abrupt('return', _promise2.default.resolve(true));
|
|
951
1038
|
|
|
952
|
-
case
|
|
953
|
-
_context2.prev =
|
|
954
|
-
_context2.t0 = _context2['catch'](
|
|
1039
|
+
case 21:
|
|
1040
|
+
_context2.prev = 21;
|
|
1041
|
+
_context2.t0 = _context2['catch'](4);
|
|
955
1042
|
|
|
956
1043
|
console.error('settlementStore.commit失败,错误信息:' + _context2.t0);
|
|
957
1044
|
return _context2.abrupt('return', _promise2.default.resolve(_context2.t0));
|
|
958
1045
|
|
|
959
|
-
case
|
|
960
|
-
console.error('settlementStore.commit失败,错误信息:' + err);
|
|
961
|
-
|
|
962
|
-
case 19:
|
|
1046
|
+
case 25:
|
|
963
1047
|
case 'end':
|
|
964
1048
|
return _context2.stop();
|
|
965
1049
|
}
|
|
966
1050
|
}
|
|
967
|
-
}, _callee2, this, [[
|
|
1051
|
+
}, _callee2, this, [[4, 21]]);
|
|
968
1052
|
}));
|
|
969
1053
|
|
|
970
1054
|
function commit(_x2) {
|
|
971
|
-
return
|
|
1055
|
+
return _ref11.apply(this, arguments);
|
|
972
1056
|
}
|
|
973
1057
|
|
|
974
1058
|
return commit;
|
|
975
1059
|
}()
|
|
1060
|
+
}, {
|
|
1061
|
+
key: 'handlePrint',
|
|
1062
|
+
value: function handlePrint(resp) {
|
|
1063
|
+
// 储值打印
|
|
1064
|
+
return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp.ID, {});
|
|
1065
|
+
}
|
|
976
1066
|
}, {
|
|
977
1067
|
key: 'saveMember',
|
|
978
1068
|
value: function saveMember() {
|
|
979
|
-
var
|
|
1069
|
+
var _this11 = this;
|
|
980
1070
|
|
|
981
1071
|
var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
|
|
982
1072
|
PayStyle = _enumController$getEn12.PayStyle;
|
|
983
1073
|
|
|
984
1074
|
(0, _mobx.runInAction)(function () {
|
|
985
|
-
|
|
986
|
-
var thePaymodes =
|
|
1075
|
+
_this11.dto.StorageMutiSettleDetails = [];
|
|
1076
|
+
var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
|
|
987
1077
|
return parseFloat(mode.value) != 0;
|
|
988
|
-
}) :
|
|
1078
|
+
}) : _this11.paymode.thePaymodes;
|
|
989
1079
|
(0, _each3.default)(thePaymodes, function (mode) {
|
|
990
|
-
var themode = (0, _find3.default)(
|
|
1080
|
+
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
|
|
991
1081
|
|
|
992
1082
|
var value = parseFloat(mode.value);
|
|
993
1083
|
var giveChange = null;
|
|
994
|
-
if (mode.paymentType == PayStyle.xianjin &&
|
|
995
|
-
value = Math.Add(value,
|
|
996
|
-
giveChange = Math.abs(
|
|
1084
|
+
if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
|
|
1085
|
+
value = Math.Add(value, _this11.paymode.receivable);
|
|
1086
|
+
giveChange = Math.abs(_this11.paymode.receivable);
|
|
997
1087
|
}
|
|
998
|
-
|
|
1088
|
+
_this11.dto.StorageMutiSettleDetails.push({
|
|
999
1089
|
Code: mode.paymethodId,
|
|
1000
1090
|
StorageAmount: value,
|
|
1001
1091
|
GiveChange: giveChange,
|
|
@@ -1004,7 +1094,7 @@ var SettlementStore = (_class = function () {
|
|
|
1004
1094
|
PaymentCode: mode.authCode,
|
|
1005
1095
|
DynamicPropertyKeys: [],
|
|
1006
1096
|
DynamicPropertyValues: [],
|
|
1007
|
-
DataSource: { Id:
|
|
1097
|
+
DataSource: { Id: _this11.dataSource }
|
|
1008
1098
|
});
|
|
1009
1099
|
});
|
|
1010
1100
|
});
|
|
@@ -1014,78 +1104,14 @@ var SettlementStore = (_class = function () {
|
|
|
1014
1104
|
IPMSG = JSON.parse(window.localStorage.IPMSG);
|
|
1015
1105
|
}
|
|
1016
1106
|
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
|
-
}
|
|
1107
|
+
_this11.handlePrint(resp);
|
|
1082
1108
|
});
|
|
1083
1109
|
}
|
|
1084
1110
|
}, {
|
|
1085
1111
|
key: 'save',
|
|
1086
1112
|
value: function () {
|
|
1087
1113
|
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
|
|
1088
|
-
var
|
|
1114
|
+
var _this12 = this;
|
|
1089
1115
|
|
|
1090
1116
|
var _enumController$getEn13, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum;
|
|
1091
1117
|
|
|
@@ -1096,41 +1122,43 @@ var SettlementStore = (_class = function () {
|
|
|
1096
1122
|
_enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn13.PayStyle;
|
|
1097
1123
|
|
|
1098
1124
|
(0, _mobx.runInAction)(function () {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1125
|
+
_this12.dto.RetailPaymentDetails = [];
|
|
1126
|
+
_this12.dto.RetailStorageDetails = [];
|
|
1127
|
+
_this12.dto.RetailCouponDetails = [];
|
|
1102
1128
|
var czkSum = 0;
|
|
1103
|
-
var Idmember =
|
|
1104
|
-
var
|
|
1129
|
+
var Idmember = _this12.dto.Idmember;
|
|
1130
|
+
var count = 0;
|
|
1131
|
+
var thePaymodes = _this12.newStyle ? (0, _filter3.default)(_this12.paymode.thePaymodes, function (mode) {
|
|
1105
1132
|
return parseFloat(mode.value) != 0;
|
|
1106
|
-
}) :
|
|
1107
|
-
(0, _each3.default)(thePaymodes, function (mode) {
|
|
1108
|
-
var themode = (0, _find3.default)(
|
|
1133
|
+
}) : _this12.paymode.thePaymodes;
|
|
1134
|
+
(0, _each3.default)(thePaymodes, function (mode, index) {
|
|
1135
|
+
var themode = (0, _find3.default)(_this12.paymode.paymodes, { 'paymentType': mode.paymentType });
|
|
1109
1136
|
if (mode.paymentType == PayStyle.hyczk) {
|
|
1110
1137
|
if (!Idmember) {
|
|
1111
1138
|
Idmember = mode.member.id;
|
|
1112
1139
|
}
|
|
1113
1140
|
czkSum = Math.Add(czkSum, mode.value);
|
|
1114
|
-
|
|
1115
|
-
|
|
1141
|
+
var MeStorageCardId = mode.member.MeStorageCardId ? mode.member.MeStorageCardId : _this12.member.MeStorageCardId;
|
|
1142
|
+
_this12.dto.RetailStorageDetails.push({
|
|
1116
1143
|
Code: mode.paymethodId,
|
|
1144
|
+
MeStorageCardId: MeStorageCardId,
|
|
1117
1145
|
StoragePaymentAmount: mode.value,
|
|
1118
1146
|
IsOrigReturn: false,
|
|
1119
1147
|
BalanceStorage: mode.balance,
|
|
1120
1148
|
Idmember: mode.member.id,
|
|
1121
1149
|
DynamicPropertyKeys: [],
|
|
1122
1150
|
DynamicPropertyValues: [],
|
|
1123
|
-
DataSource: { Id:
|
|
1151
|
+
DataSource: { Id: _this12.dataSource },
|
|
1124
1152
|
Password: mode.authCode
|
|
1125
1153
|
});
|
|
1126
1154
|
} else {
|
|
1127
1155
|
var value = parseFloat(mode.value);
|
|
1128
1156
|
var giveChange = null;
|
|
1129
|
-
if (mode.paymentType == PayStyle.xianjin &&
|
|
1130
|
-
value = Math.Add(value,
|
|
1131
|
-
giveChange = Math.abs(
|
|
1157
|
+
if (mode.paymentType == PayStyle.xianjin && _this12.paymode.receivable < 0 && value > Math.abs(_this12.paymode.receivable)) {
|
|
1158
|
+
value = Math.Add(value, _this12.paymode.receivable);
|
|
1159
|
+
giveChange = Math.abs(_this12.paymode.receivable);
|
|
1132
1160
|
}
|
|
1133
|
-
|
|
1161
|
+
_this12.dto.RetailPaymentDetails.push({
|
|
1134
1162
|
Code: mode.paymethodId,
|
|
1135
1163
|
OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
|
|
1136
1164
|
Amount: value,
|
|
@@ -1144,12 +1172,12 @@ var SettlementStore = (_class = function () {
|
|
|
1144
1172
|
OverchargesAmount: mode.overchargesAmount,
|
|
1145
1173
|
DynamicPropertyKeys: [],
|
|
1146
1174
|
DynamicPropertyValues: [],
|
|
1147
|
-
DataSource: { Id:
|
|
1175
|
+
DataSource: { Id: _this12.dataSource }
|
|
1148
1176
|
});
|
|
1149
1177
|
if (mode.paymentType == PayStyle.djq) {
|
|
1150
1178
|
(0, _each3.default)(mode.djqs, function (djq) {
|
|
1151
1179
|
if (djq.checked) {
|
|
1152
|
-
|
|
1180
|
+
_this12.dto.RetailCouponDetails.push({
|
|
1153
1181
|
CouponCode: djq.code,
|
|
1154
1182
|
ReductionAmount: djq.amount,
|
|
1155
1183
|
EnableAmount: djq.doorsill,
|
|
@@ -1159,7 +1187,7 @@ var SettlementStore = (_class = function () {
|
|
|
1159
1187
|
PromotionId: djq.promoId,
|
|
1160
1188
|
PromotionRuleId: djq.promoRuleId,
|
|
1161
1189
|
PromoCouponAllocatedId: djq.id,
|
|
1162
|
-
DataSource: { Id:
|
|
1190
|
+
DataSource: { Id: _this12.dataSource }
|
|
1163
1191
|
});
|
|
1164
1192
|
}
|
|
1165
1193
|
});
|
|
@@ -1170,36 +1198,36 @@ var SettlementStore = (_class = function () {
|
|
|
1170
1198
|
var _ref14 = _mutantsUtil.platform || {},
|
|
1171
1199
|
isNewRetailBCPos = _ref14.isNewRetailBCPos;
|
|
1172
1200
|
|
|
1173
|
-
if (
|
|
1174
|
-
var themode = (0, _find3.default)(
|
|
1201
|
+
if (_this12.dto.RetailStorageDetails.length > 0) {
|
|
1202
|
+
var themode = (0, _find3.default)(_this12.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
|
|
1175
1203
|
if (isNewRetailBCPos) {
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
})
|
|
1179
|
-
|
|
1180
|
-
Code:
|
|
1204
|
+
// this.dto.RetailStorageDetails && this.dto.RetailStorageDetails.forEach((value, index) => {
|
|
1205
|
+
// value.MeStorageCardId = (mode.MeStorageCardId ? mode.MeStorageCardId : this.member.MeStorageCardId);
|
|
1206
|
+
// })
|
|
1207
|
+
_this12.dto.RetailPaymentDetails.push({
|
|
1208
|
+
Code: _this12.paymode.counter,
|
|
1181
1209
|
OrigAmount: czkSum,
|
|
1182
1210
|
Amount: czkSum,
|
|
1183
1211
|
IdsettleStyle: themode.idSettleStyle,
|
|
1184
1212
|
IdbankAccount: themode.idBankAccount,
|
|
1185
1213
|
DynamicPropertyKeys: [],
|
|
1186
1214
|
DynamicPropertyValues: [],
|
|
1187
|
-
DataSource: { Id:
|
|
1188
|
-
RetailStorageDetails:
|
|
1215
|
+
DataSource: { Id: _this12.dataSource },
|
|
1216
|
+
RetailStorageDetails: _this12.dto.RetailStorageDetails
|
|
1189
1217
|
});
|
|
1190
1218
|
} else {
|
|
1191
|
-
|
|
1192
|
-
Code:
|
|
1219
|
+
_this12.dto.RetailPaymentDetails.push({
|
|
1220
|
+
Code: _this12.paymode.counter,
|
|
1193
1221
|
OrigAmount: czkSum,
|
|
1194
1222
|
Amount: czkSum,
|
|
1195
1223
|
IdsettleStyle: themode.idSettleStyle,
|
|
1196
1224
|
IdbankAccount: themode.idBankAccount,
|
|
1197
1225
|
DynamicPropertyKeys: [],
|
|
1198
1226
|
DynamicPropertyValues: [],
|
|
1199
|
-
DataSource: { Id:
|
|
1227
|
+
DataSource: { Id: _this12.dataSource }
|
|
1200
1228
|
});
|
|
1201
1229
|
}
|
|
1202
|
-
|
|
1230
|
+
_this12.dto.Idmember = Idmember;
|
|
1203
1231
|
}
|
|
1204
1232
|
});
|
|
1205
1233
|
_ref15 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref15.isNewRetailBCPos;
|
|
@@ -1248,8 +1276,8 @@ var SettlementStore = (_class = function () {
|
|
|
1248
1276
|
}
|
|
1249
1277
|
|
|
1250
1278
|
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
|
-
|
|
1252
|
-
|
|
1279
|
+
_this12.setDtoID(resp.ID);
|
|
1280
|
+
_this12.billID = resp.ID;
|
|
1253
1281
|
}));
|
|
1254
1282
|
|
|
1255
1283
|
case 18:
|
|
@@ -1258,8 +1286,8 @@ var SettlementStore = (_class = function () {
|
|
|
1258
1286
|
|
|
1259
1287
|
case 20:
|
|
1260
1288
|
return _context3.abrupt('return', (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
|
|
1261
|
-
|
|
1262
|
-
|
|
1289
|
+
_this12.setDtoID(resp.ID);
|
|
1290
|
+
_this12.billID = resp.ID;
|
|
1263
1291
|
}));
|
|
1264
1292
|
|
|
1265
1293
|
case 21:
|
|
@@ -1439,7 +1467,7 @@ var SettlementStore = (_class = function () {
|
|
|
1439
1467
|
}(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
|
|
1440
1468
|
enumerable: true,
|
|
1441
1469
|
initializer: function initializer() {
|
|
1442
|
-
var
|
|
1470
|
+
var _this13 = this;
|
|
1443
1471
|
|
|
1444
1472
|
return function (newPass, newPassConfirm) {
|
|
1445
1473
|
if (!newPass || !newPassConfirm) {
|
|
@@ -1451,7 +1479,7 @@ var SettlementStore = (_class = function () {
|
|
|
1451
1479
|
var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
|
|
1452
1480
|
return (0, _tplusApi.ccApi)({
|
|
1453
1481
|
Idstore: idstore,
|
|
1454
|
-
meMemberId:
|
|
1482
|
+
meMemberId: _this13.member.ID,
|
|
1455
1483
|
oldPassword: null,
|
|
1456
1484
|
newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
|
|
1457
1485
|
dataSource: "POS"
|
|
@@ -1465,7 +1493,7 @@ var SettlementStore = (_class = function () {
|
|
|
1465
1493
|
}), _applyDecoratedDescriptor(_class.prototype, 'initByOriginReturn', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'initByOriginReturn'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'quickSettle', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'quickSettle'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusAndAddPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusAndAddPay'), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'updateMemberInfo', [_mobx.action], {
|
|
1466
1494
|
enumerable: true,
|
|
1467
1495
|
initializer: function initializer() {
|
|
1468
|
-
var
|
|
1496
|
+
var _this14 = this;
|
|
1469
1497
|
|
|
1470
1498
|
return function () {
|
|
1471
1499
|
var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_this) {
|
|
@@ -1475,9 +1503,9 @@ var SettlementStore = (_class = function () {
|
|
|
1475
1503
|
while (1) {
|
|
1476
1504
|
switch (_context6.prev = _context6.next) {
|
|
1477
1505
|
case 0:
|
|
1478
|
-
_getLoginInfo =
|
|
1506
|
+
_getLoginInfo = _this14.getLoginInfo(), IdStore = _getLoginInfo.IdStore, StoreCode = _getLoginInfo.StoreCode;
|
|
1479
1507
|
_context6.next = 3;
|
|
1480
|
-
return (0, _tplusApi.tApi)({ Idmember:
|
|
1508
|
+
return (0, _tplusApi.tApi)({ Idmember: _this14.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
|
|
1481
1509
|
|
|
1482
1510
|
case 3:
|
|
1483
1511
|
resp = _context6.sent;
|
|
@@ -1491,7 +1519,7 @@ var SettlementStore = (_class = function () {
|
|
|
1491
1519
|
return _context6.stop();
|
|
1492
1520
|
}
|
|
1493
1521
|
}
|
|
1494
|
-
}, _callee6,
|
|
1522
|
+
}, _callee6, _this14);
|
|
1495
1523
|
}));
|
|
1496
1524
|
|
|
1497
1525
|
return function (_x4) {
|
|
@@ -1502,6 +1530,7 @@ var SettlementStore = (_class = function () {
|
|
|
1502
1530
|
}), _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
1531
|
exports.default = SettlementStore;
|
|
1504
1532
|
var PayMode = exports.PayMode = (_class3 = function () {
|
|
1533
|
+
//应收
|
|
1505
1534
|
function PayMode() {
|
|
1506
1535
|
// this.amount=getFixedNumber(amount);
|
|
1507
1536
|
// this.calcReserved();
|
|
@@ -1523,11 +1552,19 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1523
1552
|
_initDefineProp(this, 'thePaymodes', _descriptor7, this);
|
|
1524
1553
|
|
|
1525
1554
|
this.currentMode = null;
|
|
1555
|
+
this.checkList = [];
|
|
1526
1556
|
this.settle = {
|
|
1527
1557
|
name: "复合结算",
|
|
1528
1558
|
hotKey: "Ctrl+M"
|
|
1529
1559
|
};
|
|
1530
|
-
|
|
1560
|
+
|
|
1561
|
+
_initDefineProp(this, 'calcCheckList', _descriptor8, this);
|
|
1562
|
+
|
|
1563
|
+
_initDefineProp(this, 'setCouponNum', _descriptor9, this);
|
|
1564
|
+
|
|
1565
|
+
_initDefineProp(this, 'addDjqs', _descriptor10, this);
|
|
1566
|
+
}
|
|
1567
|
+
// @observable store = null;
|
|
1531
1568
|
|
|
1532
1569
|
|
|
1533
1570
|
(0, _createClass3.default)(PayMode, [{
|
|
@@ -1562,14 +1599,27 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1562
1599
|
this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
|
|
1563
1600
|
}
|
|
1564
1601
|
}, {
|
|
1565
|
-
key: '
|
|
1566
|
-
value: function
|
|
1567
|
-
var
|
|
1602
|
+
key: 'calcDjqCheckValue',
|
|
1603
|
+
value: function calcDjqCheckValue(q1, dto, params) {
|
|
1604
|
+
var _this15 = this;
|
|
1605
|
+
|
|
1606
|
+
var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
|
|
1607
|
+
var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1608
|
+
return djq.checked;
|
|
1609
|
+
});
|
|
1610
|
+
if (qList.length === useLimitPerOrder && !q1.checked) {
|
|
1611
|
+
_message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
if (params === 'single') {
|
|
1615
|
+
this.checkList = [];
|
|
1616
|
+
}
|
|
1568
1617
|
|
|
1569
1618
|
var _ref20 = _mutantsUtil.platform || {},
|
|
1570
1619
|
isNewRetailBCPos = _ref20.isNewRetailBCPos;
|
|
1571
1620
|
|
|
1572
1621
|
var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
|
|
1622
|
+
PayStyle = _enumController$getEn14.PayStyle,
|
|
1573
1623
|
Differentiate = _enumController$getEn14.Differentiate;
|
|
1574
1624
|
|
|
1575
1625
|
if (q1) {
|
|
@@ -1578,22 +1628,186 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1578
1628
|
return;
|
|
1579
1629
|
}
|
|
1580
1630
|
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1581
|
-
return djq.
|
|
1631
|
+
return djq.promoCouponCode == q1.promoCouponCode;
|
|
1582
1632
|
});
|
|
1583
1633
|
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1584
1634
|
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1585
1635
|
return;
|
|
1586
1636
|
}
|
|
1587
1637
|
//判断是否是选择优惠券 //CC优惠券只能使用一个
|
|
1588
|
-
if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1638
|
+
// if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1639
|
+
// // 检查是否有已经选定优惠券 并且去除选定的优惠券
|
|
1640
|
+
// this.currentMode.djqs.forEach((djq, index) => {
|
|
1641
|
+
// if (djq.checked) this.currentMode.djqs[index].checked = false;
|
|
1642
|
+
// })
|
|
1643
|
+
// }
|
|
1644
|
+
q && (q.checked = !q.checked);
|
|
1645
|
+
}
|
|
1646
|
+
var sum = 0;
|
|
1647
|
+
// console.log(this.store, 'stores-------');
|
|
1648
|
+
if (!q1.checked) {
|
|
1649
|
+
this.checkList.forEach(function (ele, i) {
|
|
1650
|
+
if (ele.id === q1.id) {
|
|
1651
|
+
_this15.checkList.splice(i, 1);
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
} else {
|
|
1655
|
+
if (q1.discountPct > 0) {
|
|
1656
|
+
q1.amount = 0;
|
|
1657
|
+
}
|
|
1658
|
+
this.checkList.push(q1);
|
|
1659
|
+
}
|
|
1660
|
+
this.checkList.forEach(function (ele, i) {
|
|
1661
|
+
if (ele.discountPct > 0) {
|
|
1662
|
+
if (ele.amount === 0) {
|
|
1663
|
+
ele.amount = (1 - ele.discountPct) * _this15.currentMode.receivable;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
sum = Math.Add(sum, ele.amount);
|
|
1667
|
+
});
|
|
1668
|
+
this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
|
|
1669
|
+
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1670
|
+
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1671
|
+
if (params === 'single') {
|
|
1672
|
+
return;
|
|
1673
|
+
}
|
|
1674
|
+
var promoVoucher = {};
|
|
1675
|
+
promoVoucher.boName = "Retail";
|
|
1676
|
+
// promoVoucher.promoLinks = _filter(this.currentMode.djqs,djq=>djq.checked);
|
|
1677
|
+
promoVoucher.meMemberId = this.currentMode.member.id;
|
|
1678
|
+
promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
|
|
1679
|
+
promoVoucher.voucherDetailList = [];
|
|
1680
|
+
dto.RetailDetails.forEach(function (item) {
|
|
1681
|
+
var detailDTO = {};
|
|
1682
|
+
detailDTO.uuid = item.Code;
|
|
1683
|
+
detailDTO.detailBoName = "RetailDetail";
|
|
1684
|
+
detailDTO.voucherDetailId = item.ID;
|
|
1685
|
+
detailDTO.productId = item.Idinventory;
|
|
1686
|
+
detailDTO.uomId = item.Idunit;
|
|
1687
|
+
detailDTO.productSpecId = item.ProductSpecId;
|
|
1688
|
+
detailDTO.isManualFreeGift = item.IsPresent;
|
|
1689
|
+
detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
|
|
1690
|
+
detailDTO.IsManualChangePrice = item.IsManualChangePrice;
|
|
1691
|
+
if (detailDTO.IsManualChangePrice) //如果是手工改价
|
|
1692
|
+
{
|
|
1693
|
+
detailDTO.listPrice = item.TaxPrice;
|
|
1694
|
+
detailDTO.netAmountWithTax = item.TaxAmount;
|
|
1695
|
+
} else {
|
|
1696
|
+
var bookingQuantity = 0;
|
|
1697
|
+
if (item.BookingQuantity) {
|
|
1698
|
+
bookingQuantity = item.BookingQuantity;
|
|
1699
|
+
}
|
|
1700
|
+
detailDTO.listPrice = item.MemberPrice;
|
|
1701
|
+
detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
|
|
1702
|
+
}
|
|
1703
|
+
detailDTO.taxRate = item.TaxRate;
|
|
1704
|
+
detailDTO.quantity = item.Quantity;
|
|
1705
|
+
|
|
1706
|
+
detailDTO.amountWithTax = item.RetailAmount;
|
|
1707
|
+
// 促销 start
|
|
1708
|
+
if (item.PromotionDetails && item.PromotionDetails.length != 0) {
|
|
1709
|
+
var promoLinks = [];
|
|
1710
|
+
item.PromotionDetails.forEach(function (promotion) {
|
|
1711
|
+
promoLinks.push({
|
|
1712
|
+
promoId: promotion.IdSalesPromotionDTO,
|
|
1713
|
+
promoRuleId: promotion.PromotionRuleId
|
|
1714
|
+
});
|
|
1715
|
+
});
|
|
1716
|
+
if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
|
|
1717
|
+
}
|
|
1718
|
+
// 促销 end
|
|
1719
|
+
promoVoucher.voucherDetailList.push(detailDTO);
|
|
1720
|
+
});
|
|
1721
|
+
promoVoucher.promoLinks = this.checkList;
|
|
1722
|
+
return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
|
|
1723
|
+
if (result && result.length != 0) {
|
|
1724
|
+
result.forEach(function (element) {
|
|
1725
|
+
var djq1 = (0, _filter3.default)(_this15.currentMode.djqs, function (djq) {
|
|
1726
|
+
return djq.id === element.id;
|
|
1727
|
+
});
|
|
1728
|
+
|
|
1729
|
+
var _ref21 = element || {},
|
|
1730
|
+
couponCode = _ref21.couponCode,
|
|
1731
|
+
name = _ref21.name,
|
|
1732
|
+
tieredAmountResult = _ref21.tieredAmountResult,
|
|
1733
|
+
fromDate = _ref21.fromDate,
|
|
1734
|
+
dateMount = _ref21.dateMount,
|
|
1735
|
+
promoMethodEnum = _ref21.promoMethodEnum,
|
|
1736
|
+
discountPct = _ref21.discountPct,
|
|
1737
|
+
nominalAmount = _ref21.nominalAmount,
|
|
1738
|
+
promoId = _ref21.promoId,
|
|
1739
|
+
id = _ref21.id,
|
|
1740
|
+
doorsill = _ref21.doorsill;
|
|
1741
|
+
|
|
1742
|
+
var condValue = tieredAmountResult.condValue,
|
|
1743
|
+
promoDiscount = tieredAmountResult.promoDiscount,
|
|
1744
|
+
displayText = tieredAmountResult.displayText,
|
|
1745
|
+
promoRuleId = tieredAmountResult.promoRuleId,
|
|
1746
|
+
couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
|
|
1747
|
+
|
|
1748
|
+
if (!djq1.length) {
|
|
1749
|
+
// this.currentMode.djqs.push({
|
|
1750
|
+
// promoCouponCode: element.CouponCode,
|
|
1751
|
+
// name: element.CouponTitle,
|
|
1752
|
+
// IsEnable: true,
|
|
1753
|
+
// amount: element.ReductionAmount,
|
|
1754
|
+
// doorsill: element.EnableAmount,
|
|
1755
|
+
// LastTS: element.LastTS,
|
|
1756
|
+
// checked: false,
|
|
1757
|
+
// IsRepelWithPoints: true,
|
|
1758
|
+
// UMemberID: dto.Idmember,
|
|
1759
|
+
// expired: null,
|
|
1760
|
+
// displayText,
|
|
1761
|
+
// promoMethodEnum,
|
|
1762
|
+
// discountPct,
|
|
1763
|
+
// promoId,
|
|
1764
|
+
// promoRuleId,
|
|
1765
|
+
// couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
|
|
1766
|
+
// id
|
|
1767
|
+
// })
|
|
1768
|
+
_this15.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
|
|
1769
|
+
} else {
|
|
1770
|
+
_this15.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum);
|
|
1771
|
+
// this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
|
|
1772
|
+
// djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
|
|
1773
|
+
}
|
|
1592
1774
|
});
|
|
1593
1775
|
}
|
|
1776
|
+
});
|
|
1777
|
+
//this.receivable = getFixedNumber(this.receivable - sum);
|
|
1778
|
+
}
|
|
1779
|
+
}, {
|
|
1780
|
+
key: 'calcDjqValue',
|
|
1781
|
+
value: function calcDjqValue(q1) {
|
|
1782
|
+
var _ref22 = _mutantsUtil.platform || {},
|
|
1783
|
+
isNewRetailBCPos = _ref22.isNewRetailBCPos;
|
|
1784
|
+
|
|
1785
|
+
var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
|
|
1786
|
+
Differentiate = _enumController$getEn15.Differentiate;
|
|
1787
|
+
|
|
1788
|
+
if (q1) {
|
|
1789
|
+
if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
|
|
1790
|
+
_message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1794
|
+
return djq.code == q1.code;
|
|
1795
|
+
});
|
|
1796
|
+
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1797
|
+
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1798
|
+
return;
|
|
1799
|
+
}
|
|
1800
|
+
//判断是否是选择优惠券 //CC优惠券只能使用一个
|
|
1801
|
+
// if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1802
|
+
// // 检查是否有已经选定优惠券 并且去除选定的优惠券
|
|
1803
|
+
// this.currentMode.djqs.forEach((djq, index) => {
|
|
1804
|
+
// if (djq.checked) this.currentMode.djqs[index].checked = false;
|
|
1805
|
+
// })
|
|
1806
|
+
// }
|
|
1594
1807
|
q && (q.checked = !q.checked);
|
|
1595
1808
|
}
|
|
1596
1809
|
var sum = 0;
|
|
1810
|
+
// console.log(this.store, 'stores-------');
|
|
1597
1811
|
(0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1598
1812
|
return djq.checked;
|
|
1599
1813
|
}), function (q) {
|
|
@@ -1602,6 +1816,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1602
1816
|
this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
|
|
1603
1817
|
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1604
1818
|
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1819
|
+
|
|
1605
1820
|
//this.receivable = getFixedNumber(this.receivable - sum);
|
|
1606
1821
|
}
|
|
1607
1822
|
}, {
|
|
@@ -1628,9 +1843,20 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1628
1843
|
value: function setCurrentModeValue(v, max) {
|
|
1629
1844
|
this.currentMode.value = parseFloat(v) || 0;
|
|
1630
1845
|
this.currentMode.errinfo = '';
|
|
1846
|
+
var sum = this.amount;
|
|
1847
|
+
|
|
1848
|
+
var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
|
|
1849
|
+
PayStyle = _enumController$getEn16.PayStyle;
|
|
1850
|
+
|
|
1851
|
+
this.paymodes.thePaymodes && this.paymodes.thePaymodes.forEach(function (mode) {
|
|
1852
|
+
if (mode.paymentType === PayStyle.hyczk) {
|
|
1853
|
+
sum -= mode.value;
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1856
|
+
|
|
1631
1857
|
if (this.amount > 0 && (v === '' || v === '0.00')) {
|
|
1632
1858
|
this.currentMode.errinfo = "实收金额必须录入";
|
|
1633
|
-
} else if (Math.abs(parseFloat(v)) > Math.abs(
|
|
1859
|
+
} else if (Math.abs(parseFloat(v)) > Math.abs(sum)) {
|
|
1634
1860
|
this.currentMode.errinfo = "实收不应大于应收";
|
|
1635
1861
|
} else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
|
|
1636
1862
|
this.currentMode.errinfo = "余额不足";
|
|
@@ -1644,16 +1870,16 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1644
1870
|
}, {
|
|
1645
1871
|
key: 'setPaymodes',
|
|
1646
1872
|
value: function () {
|
|
1647
|
-
var
|
|
1648
|
-
var
|
|
1873
|
+
var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
|
|
1874
|
+
var _this16 = this;
|
|
1649
1875
|
|
|
1650
|
-
var _enumController$
|
|
1876
|
+
var _enumController$getEn17, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
|
|
1651
1877
|
|
|
1652
1878
|
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
|
1653
1879
|
while (1) {
|
|
1654
1880
|
switch (_context7.prev = _context7.next) {
|
|
1655
1881
|
case 0:
|
|
1656
|
-
_enumController$
|
|
1882
|
+
_enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn17.settleStyleType, PayStyle = _enumController$getEn17.PayStyle;
|
|
1657
1883
|
memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
|
|
1658
1884
|
param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
|
|
1659
1885
|
_context7.next = 5;
|
|
@@ -1677,6 +1903,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1677
1903
|
isQuick: (0, _findIndex3.default)(modes.QuickSettleStyles, { 'Code': mode.Code }) >= 0,
|
|
1678
1904
|
orderBy: 1,
|
|
1679
1905
|
paymentType: mode.Code,
|
|
1906
|
+
offlineDisable: mode.offlineDisable,
|
|
1680
1907
|
idSettleStyle: mode.IdSettleStyle,
|
|
1681
1908
|
idBankAccount: mode.IdBankAccount,
|
|
1682
1909
|
exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
|
|
@@ -1684,7 +1911,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1684
1911
|
calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88"
|
|
1685
1912
|
});
|
|
1686
1913
|
});
|
|
1687
|
-
|
|
1914
|
+
_this16.paymodes = paymodes;
|
|
1688
1915
|
//modes.QuickSettleStyles
|
|
1689
1916
|
});
|
|
1690
1917
|
}
|
|
@@ -1698,7 +1925,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1698
1925
|
}));
|
|
1699
1926
|
|
|
1700
1927
|
function setPaymodes(_x5, _x6) {
|
|
1701
|
-
return
|
|
1928
|
+
return _ref23.apply(this, arguments);
|
|
1702
1929
|
}
|
|
1703
1930
|
|
|
1704
1931
|
return setPaymodes;
|
|
@@ -1740,22 +1967,74 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1740
1967
|
initializer: function initializer() {
|
|
1741
1968
|
return [];
|
|
1742
1969
|
}
|
|
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),
|
|
1970
|
+
}), _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], {
|
|
1971
|
+
enumerable: true,
|
|
1972
|
+
initializer: function initializer() {
|
|
1973
|
+
var _this17 = this;
|
|
1974
|
+
|
|
1975
|
+
return function () {
|
|
1976
|
+
_this17.checkList = [];
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
}), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
|
|
1980
|
+
enumerable: true,
|
|
1981
|
+
initializer: function initializer() {
|
|
1982
|
+
var _this18 = this;
|
|
1983
|
+
|
|
1984
|
+
return function (id, couponNum, code) {
|
|
1985
|
+
_this18.currentMode.djqs.forEach(function (ele) {
|
|
1986
|
+
if (ele.id === id) {
|
|
1987
|
+
ele.couponCategoryEnum = couponNum;
|
|
1988
|
+
var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
|
|
1989
|
+
ele.IsEnable = IsEnable;
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
|
|
1995
|
+
enumerable: true,
|
|
1996
|
+
initializer: function initializer() {
|
|
1997
|
+
var _this19 = this;
|
|
1998
|
+
|
|
1999
|
+
return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
|
|
2000
|
+
var djq = {
|
|
2001
|
+
promoCouponCode: promoCouponCode,
|
|
2002
|
+
name: name,
|
|
2003
|
+
IsEnable: IsEnable,
|
|
2004
|
+
amount: amount,
|
|
2005
|
+
doorsill: doorsill,
|
|
2006
|
+
LastTS: LastTS,
|
|
2007
|
+
checked: checked,
|
|
2008
|
+
IsRepelWithPoints: IsRepelWithPoints,
|
|
2009
|
+
UMemberID: UMemberID,
|
|
2010
|
+
expired: expired,
|
|
2011
|
+
displayText: displayText,
|
|
2012
|
+
promoMethodEnum: promoMethodEnum,
|
|
2013
|
+
discountPct: discountPct,
|
|
2014
|
+
promoId: promoId,
|
|
2015
|
+
promoRuleId: promoRuleId,
|
|
2016
|
+
couponCategoryEnum: couponCategoryEnum,
|
|
2017
|
+
id: id
|
|
2018
|
+
};
|
|
2019
|
+
_this19.currentMode.djqs.push(djq);
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
}), _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
2023
|
var Member = exports.Member = (_class5 = function () {
|
|
1745
2024
|
function Member(m) {
|
|
1746
|
-
var
|
|
2025
|
+
var _this20 = this;
|
|
1747
2026
|
|
|
1748
2027
|
(0, _classCallCheck3.default)(this, Member);
|
|
1749
2028
|
|
|
1750
|
-
_initDefineProp(this, 'cardNo',
|
|
2029
|
+
_initDefineProp(this, 'cardNo', _descriptor11, this);
|
|
1751
2030
|
|
|
1752
|
-
_initDefineProp(this, 'balance',
|
|
2031
|
+
_initDefineProp(this, 'balance', _descriptor12, this);
|
|
1753
2032
|
|
|
1754
|
-
_initDefineProp(this, 'exchangable',
|
|
2033
|
+
_initDefineProp(this, 'exchangable', _descriptor13, this);
|
|
1755
2034
|
|
|
1756
|
-
_initDefineProp(this, '
|
|
2035
|
+
_initDefineProp(this, 'MeStorageCardId', _descriptor14, this);
|
|
1757
2036
|
|
|
1758
|
-
_initDefineProp(this, 'StorageCardNo',
|
|
2037
|
+
_initDefineProp(this, 'StorageCardNo', _descriptor15, this);
|
|
1759
2038
|
|
|
1760
2039
|
if (m) {
|
|
1761
2040
|
this.id = m.ID;
|
|
@@ -1766,16 +2045,17 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1766
2045
|
return key == 'canusedbalancestorage';
|
|
1767
2046
|
});
|
|
1768
2047
|
|
|
1769
|
-
var
|
|
1770
|
-
isNewRetailBCPos =
|
|
2048
|
+
var _ref24 = _mutantsUtil.platform || {},
|
|
2049
|
+
isNewRetailBCPos = _ref24.isNewRetailBCPos;
|
|
1771
2050
|
|
|
1772
2051
|
m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
|
|
2052
|
+
m.MeStorageCardId && (this.MeStorageCardId = m.MeStorageCardId);
|
|
1773
2053
|
(0, _mobx.runInAction)(function () {
|
|
1774
|
-
|
|
2054
|
+
_this20.cardNo = m.CardCode;
|
|
1775
2055
|
if (index >= 0) {
|
|
1776
|
-
|
|
2056
|
+
_this20.balance = parseFloat(m.DynamicPropertyValues[index]);
|
|
1777
2057
|
} else {
|
|
1778
|
-
|
|
2058
|
+
_this20.balance = _this20.rawbalance;
|
|
1779
2059
|
}
|
|
1780
2060
|
});
|
|
1781
2061
|
this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
|
|
@@ -1798,7 +2078,7 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1798
2078
|
}, {
|
|
1799
2079
|
key: 'setMeStorageCardId',
|
|
1800
2080
|
value: function setMeStorageCardId(v) {
|
|
1801
|
-
this.
|
|
2081
|
+
this.MeStorageCardId = v;
|
|
1802
2082
|
}
|
|
1803
2083
|
}, {
|
|
1804
2084
|
key: 'setStorageCardNo',
|
|
@@ -1807,19 +2087,19 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1807
2087
|
}
|
|
1808
2088
|
}]);
|
|
1809
2089
|
return Member;
|
|
1810
|
-
}(), (
|
|
2090
|
+
}(), (_descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
|
|
1811
2091
|
enumerable: true,
|
|
1812
2092
|
initializer: null
|
|
1813
|
-
}),
|
|
2093
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
|
|
1814
2094
|
enumerable: true,
|
|
1815
2095
|
initializer: null
|
|
1816
|
-
}),
|
|
2096
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
|
|
1817
2097
|
enumerable: true,
|
|
1818
2098
|
initializer: null
|
|
1819
|
-
}),
|
|
2099
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class5.prototype, 'MeStorageCardId', [_mobx.observable], {
|
|
1820
2100
|
enumerable: true,
|
|
1821
2101
|
initializer: null
|
|
1822
|
-
}),
|
|
2102
|
+
}), _descriptor15 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
|
|
1823
2103
|
enumerable: true,
|
|
1824
2104
|
initializer: null
|
|
1825
2105
|
}), _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);
|