tplus-components-touch 3.18.12 → 3.21.1
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 +2 -62
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +2 -12
- package/dist/components/hotKey/localConfig.js +1 -14
- package/dist/components/hotKey/localConfig.js.map +1 -1
- package/dist/components/modalWraper/style.less +0 -6
- package/dist/components/settlement/settlement.js +71 -21
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +62 -10
- package/dist/components/settlement/settlementStore.js +256 -36
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/ticon/iconfont/demo.css +539 -539
- package/dist/components/ticon/iconfont/demo_index.html +5041 -5179
- package/dist/components/ticon/iconfont/iconfont.css +859 -883
- package/dist/components/ticon/iconfont/iconfont.js +4 -4
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
- package/dist/components/ticon/iconfont/iconfont.json +1486 -1528
- 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 +0 -8
- package/dist/components/touchTable/index.js.map +1 -1
- package/package.json +35 -35
|
@@ -337,6 +337,37 @@
|
|
|
337
337
|
font-size: 20px;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
+
.col4 {
|
|
341
|
+
width: 496px;
|
|
342
|
+
margin-left: 16px;
|
|
343
|
+
border-bottom: 1px solid #E6E6EB;
|
|
344
|
+
.ant-btn {
|
|
345
|
+
margin-right: 2px;
|
|
346
|
+
padding: 0 10px;
|
|
347
|
+
font-size: 14px;
|
|
348
|
+
border: none;
|
|
349
|
+
border-bottom: 2px solid;
|
|
350
|
+
border-radius: 0;
|
|
351
|
+
margin-bottom: -1px;
|
|
352
|
+
position: relative;
|
|
353
|
+
}
|
|
354
|
+
.couponBorder {
|
|
355
|
+
border-color: #E6E6EB;
|
|
356
|
+
&::after{
|
|
357
|
+
position: absolute;
|
|
358
|
+
bottom: -1px;
|
|
359
|
+
left: 0px;
|
|
360
|
+
content: '';
|
|
361
|
+
width: 100%;
|
|
362
|
+
height: 1px;
|
|
363
|
+
border-bottom: 1px solid white;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
.couponTip {
|
|
367
|
+
color: #F83A41;
|
|
368
|
+
font-size: 12px;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
340
371
|
}
|
|
341
372
|
.djq2outer{
|
|
342
373
|
padding-top:8px;
|
|
@@ -429,7 +460,10 @@
|
|
|
429
460
|
left: -5px;
|
|
430
461
|
}
|
|
431
462
|
.djqLeftCash{
|
|
432
|
-
|
|
463
|
+
// background-image: linear-gradient(-137deg, #FD6E21 0%, #F9365D 100%);
|
|
464
|
+
}
|
|
465
|
+
.djqLeftCashGrey {
|
|
466
|
+
background-image: linear-gradient(137deg, #CBCAC9 0%, #B0B0B0 100%);
|
|
433
467
|
}
|
|
434
468
|
.djqLeftDiscount{
|
|
435
469
|
background-image: linear-gradient(-137deg, #FF8F36 0%, #FD6B59 100%);
|
|
@@ -442,15 +476,15 @@
|
|
|
442
476
|
background-color: #FFFFFF;
|
|
443
477
|
border-radius: 1px 4px 4px 1px;
|
|
444
478
|
text-align: left;
|
|
445
|
-
text-indent:
|
|
479
|
+
text-indent: 14px;
|
|
446
480
|
cursor: pointer;
|
|
447
481
|
.name{
|
|
448
482
|
// padding-left:23px;
|
|
449
483
|
padding-top:16px;
|
|
450
484
|
padding-bottom: 19px;
|
|
451
485
|
font-size: 17px;
|
|
452
|
-
color: #333333;
|
|
453
486
|
line-height: 16px;
|
|
487
|
+
width: 136px;
|
|
454
488
|
}
|
|
455
489
|
.info{
|
|
456
490
|
// padding-left:23px;
|
|
@@ -459,17 +493,35 @@
|
|
|
459
493
|
color: #333333;
|
|
460
494
|
line-height: 13px;
|
|
461
495
|
}
|
|
462
|
-
.
|
|
463
|
-
|
|
496
|
+
.noxuanzhong {
|
|
497
|
+
position: absolute;
|
|
498
|
+
top: 12px;
|
|
499
|
+
right: 12px;
|
|
500
|
+
border: 1px solid #979797;
|
|
501
|
+
border-radius: 0.83px;
|
|
502
|
+
width: 18px;
|
|
503
|
+
height: 18px;
|
|
504
|
+
}
|
|
505
|
+
.noxuanzhong1 {
|
|
506
|
+
position: absolute;
|
|
507
|
+
top: 6px;
|
|
508
|
+
right: 6px;
|
|
509
|
+
border: 1px solid #979797;
|
|
510
|
+
border-radius: 0.83px;
|
|
511
|
+
width: 18px;
|
|
512
|
+
height: 18px;
|
|
513
|
+
background: #F0F0F0;
|
|
464
514
|
}
|
|
465
|
-
|
|
466
515
|
}
|
|
467
516
|
|
|
468
517
|
.djqRightSelected{
|
|
469
|
-
background:#FFFFFF url('http://newretail-static-pro-bj.oss-cn-beijing-internal.aliyuncs.com/pos/img/shiyong.png') no-repeat !important;
|
|
470
|
-
background-position: right bottom !important;
|
|
471
|
-
.
|
|
472
|
-
|
|
518
|
+
// background:#FFFFFF url('http://newretail-static-pro-bj.oss-cn-beijing-internal.aliyuncs.com/pos/img/shiyong.png') no-repeat !important;
|
|
519
|
+
// background-position: right bottom !important;
|
|
520
|
+
.checkIcon {
|
|
521
|
+
font-size: 20px;
|
|
522
|
+
position: absolute;
|
|
523
|
+
top: 6px;
|
|
524
|
+
right: 6px;
|
|
473
525
|
}
|
|
474
526
|
}
|
|
475
527
|
}
|
|
@@ -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, _desc3, _value3, _class5, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14;
|
|
45
45
|
|
|
46
46
|
var _mobx = require('mobx');
|
|
47
47
|
|
|
@@ -93,6 +93,10 @@ 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);
|
|
@@ -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;
|
|
@@ -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,8 @@ 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
|
+
_this2.addDjq(couponCode, name, IsEnable, promoMethodEnum == "CASH_COUPON" ? nominalAmount : promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, true, 1);
|
|
274
283
|
}
|
|
275
284
|
});
|
|
276
285
|
if (promoVoucher.coupon_code) {
|
|
@@ -515,10 +524,10 @@ var SettlementStore = (_class = function () {
|
|
|
515
524
|
promoId = _ref5.promoId,
|
|
516
525
|
id = _ref5.id;
|
|
517
526
|
|
|
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);
|
|
527
|
+
_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
528
|
return;
|
|
520
529
|
}
|
|
521
|
-
_this5.addDjq(djq.CouponCode, djq.CouponTitle, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
|
|
530
|
+
_this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
|
|
522
531
|
});
|
|
523
532
|
}
|
|
524
533
|
_this5.paymode.thePaymodes.push(newmode);
|
|
@@ -667,10 +676,12 @@ var SettlementStore = (_class = function () {
|
|
|
667
676
|
}
|
|
668
677
|
}, {
|
|
669
678
|
key: 'addDjq',
|
|
670
|
-
value: function addDjq(
|
|
679
|
+
value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
|
|
671
680
|
var djq = {
|
|
672
|
-
code:
|
|
681
|
+
code: promoCouponCode,
|
|
682
|
+
promoCouponCode: promoCouponCode,
|
|
673
683
|
name: name,
|
|
684
|
+
IsEnable: IsEnable,
|
|
674
685
|
amount: amount,
|
|
675
686
|
doorsill: doorsill, //:"无门槛"
|
|
676
687
|
LastTS: LastTS,
|
|
@@ -683,9 +694,12 @@ var SettlementStore = (_class = function () {
|
|
|
683
694
|
discountPct: discountPct,
|
|
684
695
|
promoId: promoId,
|
|
685
696
|
promoRuleId: promoRuleId,
|
|
686
|
-
|
|
697
|
+
couponCategoryEnum: couponCategoryEnum,
|
|
698
|
+
id: id,
|
|
699
|
+
count: count === 1 && (couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT') ? 1 : null
|
|
687
700
|
};
|
|
688
701
|
this.paymode.currentMode.djqs.push(djq);
|
|
702
|
+
// let copyData = _clonedeep(this.data[targetIndex]);
|
|
689
703
|
!unCheck && !this.boriginReturn && this.paymode.calcDjqValue(djq);
|
|
690
704
|
}
|
|
691
705
|
}, {
|
|
@@ -1502,6 +1516,7 @@ var SettlementStore = (_class = function () {
|
|
|
1502
1516
|
}), _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
1517
|
exports.default = SettlementStore;
|
|
1504
1518
|
var PayMode = exports.PayMode = (_class3 = function () {
|
|
1519
|
+
// @observable store = null;
|
|
1505
1520
|
function PayMode() {
|
|
1506
1521
|
// this.amount=getFixedNumber(amount);
|
|
1507
1522
|
// this.calcReserved();
|
|
@@ -1527,6 +1542,10 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1527
1542
|
name: "复合结算",
|
|
1528
1543
|
hotKey: "Ctrl+M"
|
|
1529
1544
|
};
|
|
1545
|
+
|
|
1546
|
+
_initDefineProp(this, 'setCouponNum', _descriptor8, this);
|
|
1547
|
+
|
|
1548
|
+
_initDefineProp(this, 'addDjqs', _descriptor9, this);
|
|
1530
1549
|
} //应收
|
|
1531
1550
|
|
|
1532
1551
|
|
|
@@ -1562,14 +1581,24 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1562
1581
|
this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
|
|
1563
1582
|
}
|
|
1564
1583
|
}, {
|
|
1565
|
-
key: '
|
|
1566
|
-
value: function
|
|
1584
|
+
key: 'calcDjqCheckValue',
|
|
1585
|
+
value: function calcDjqCheckValue(q1, dto) {
|
|
1567
1586
|
var _this14 = this;
|
|
1568
1587
|
|
|
1588
|
+
var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
|
|
1589
|
+
var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1590
|
+
return djq.checked;
|
|
1591
|
+
});
|
|
1592
|
+
if (qList.length === useLimitPerOrder && !q1.checked) {
|
|
1593
|
+
_message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1569
1597
|
var _ref20 = _mutantsUtil.platform || {},
|
|
1570
1598
|
isNewRetailBCPos = _ref20.isNewRetailBCPos;
|
|
1571
1599
|
|
|
1572
1600
|
var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
|
|
1601
|
+
PayStyle = _enumController$getEn14.PayStyle,
|
|
1573
1602
|
Differentiate = _enumController$getEn14.Differentiate;
|
|
1574
1603
|
|
|
1575
1604
|
if (q1) {
|
|
@@ -1578,22 +1607,169 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1578
1607
|
return;
|
|
1579
1608
|
}
|
|
1580
1609
|
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1581
|
-
return djq.
|
|
1610
|
+
return djq.promoCouponCode == q1.promoCouponCode;
|
|
1582
1611
|
});
|
|
1583
1612
|
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1584
1613
|
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1585
1614
|
return;
|
|
1586
1615
|
}
|
|
1587
1616
|
//判断是否是选择优惠券 //CC优惠券只能使用一个
|
|
1588
|
-
if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1617
|
+
// if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1618
|
+
// // 检查是否有已经选定优惠券 并且去除选定的优惠券
|
|
1619
|
+
// this.currentMode.djqs.forEach((djq, index) => {
|
|
1620
|
+
// if (djq.checked) this.currentMode.djqs[index].checked = false;
|
|
1621
|
+
// })
|
|
1622
|
+
// }
|
|
1623
|
+
q && (q.checked = !q.checked);
|
|
1624
|
+
}
|
|
1625
|
+
var sum = 0;
|
|
1626
|
+
// console.log(this.store, 'stores-------');
|
|
1627
|
+
(0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1628
|
+
return djq.checked;
|
|
1629
|
+
}), function (q) {
|
|
1630
|
+
sum = Math.Add(sum, q.amount);
|
|
1631
|
+
});
|
|
1632
|
+
this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
|
|
1633
|
+
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1634
|
+
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1635
|
+
var promoVoucher = {};
|
|
1636
|
+
promoVoucher.boName = "Retail";
|
|
1637
|
+
promoVoucher.promoLinks = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1638
|
+
return djq.checked;
|
|
1639
|
+
});
|
|
1640
|
+
promoVoucher.meMemberId = this.currentMode.member.id;
|
|
1641
|
+
promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
|
|
1642
|
+
promoVoucher.voucherDetailList = [];
|
|
1643
|
+
dto.RetailDetails.forEach(function (item) {
|
|
1644
|
+
var detailDTO = {};
|
|
1645
|
+
detailDTO.uuid = item.Code;
|
|
1646
|
+
detailDTO.detailBoName = "RetailDetail";
|
|
1647
|
+
detailDTO.voucherDetailId = item.ID;
|
|
1648
|
+
detailDTO.productId = item.Idinventory;
|
|
1649
|
+
detailDTO.uomId = item.Idunit;
|
|
1650
|
+
detailDTO.productSpecId = item.ProductSpecId;
|
|
1651
|
+
detailDTO.isManualFreeGift = item.IsPresent;
|
|
1652
|
+
detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
|
|
1653
|
+
|
|
1654
|
+
if (detailDTO.IsManualChangePrice) //如果是手工改价
|
|
1655
|
+
{
|
|
1656
|
+
detailDTO.listPrice = item.TaxPrice;
|
|
1657
|
+
detailDTO.netAmountWithTax = item.TaxAmount;
|
|
1658
|
+
} else {
|
|
1659
|
+
var bookingQuantity = 0;
|
|
1660
|
+
if (item.BookingQuantity) {
|
|
1661
|
+
bookingQuantity = item.BookingQuantity;
|
|
1662
|
+
}
|
|
1663
|
+
detailDTO.listPrice = item.MemberPrice;
|
|
1664
|
+
detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
|
|
1665
|
+
}
|
|
1666
|
+
detailDTO.taxRate = item.TaxRate;
|
|
1667
|
+
detailDTO.quantity = item.Quantity;
|
|
1668
|
+
|
|
1669
|
+
detailDTO.amountWithTax = item.RetailAmount;
|
|
1670
|
+
// 促销 start
|
|
1671
|
+
if (item.PromotionDetails && item.PromotionDetails.length != 0) {
|
|
1672
|
+
var promoLinks = [];
|
|
1673
|
+
item.PromotionDetails.forEach(function (promotion) {
|
|
1674
|
+
promoLinks.push({
|
|
1675
|
+
promoId: promotion.IdSalesPromotionDTO,
|
|
1676
|
+
promoRuleId: promotion.PromotionRuleId
|
|
1677
|
+
});
|
|
1592
1678
|
});
|
|
1679
|
+
if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
|
|
1680
|
+
}
|
|
1681
|
+
// 促销 end
|
|
1682
|
+
promoVoucher.voucherDetailList.push(detailDTO);
|
|
1683
|
+
});
|
|
1684
|
+
return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
|
|
1685
|
+
if (result && result.length != 0) {
|
|
1686
|
+
result.forEach(function (element) {
|
|
1687
|
+
var djq1 = (0, _filter3.default)(_this14.currentMode.djqs, function (djq) {
|
|
1688
|
+
return djq.id === element.id;
|
|
1689
|
+
});
|
|
1690
|
+
|
|
1691
|
+
var _ref21 = element || {},
|
|
1692
|
+
couponCode = _ref21.couponCode,
|
|
1693
|
+
name = _ref21.name,
|
|
1694
|
+
tieredAmountResult = _ref21.tieredAmountResult,
|
|
1695
|
+
fromDate = _ref21.fromDate,
|
|
1696
|
+
dateMount = _ref21.dateMount,
|
|
1697
|
+
promoMethodEnum = _ref21.promoMethodEnum,
|
|
1698
|
+
discountPct = _ref21.discountPct,
|
|
1699
|
+
nominalAmount = _ref21.nominalAmount,
|
|
1700
|
+
promoId = _ref21.promoId,
|
|
1701
|
+
id = _ref21.id,
|
|
1702
|
+
doorsill = _ref21.doorsill;
|
|
1703
|
+
|
|
1704
|
+
var condValue = tieredAmountResult.condValue,
|
|
1705
|
+
promoDiscount = tieredAmountResult.promoDiscount,
|
|
1706
|
+
displayText = tieredAmountResult.displayText,
|
|
1707
|
+
promoRuleId = tieredAmountResult.promoRuleId,
|
|
1708
|
+
couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
|
|
1709
|
+
|
|
1710
|
+
if (!djq1.length) {
|
|
1711
|
+
// this.currentMode.djqs.push({
|
|
1712
|
+
// promoCouponCode: element.CouponCode,
|
|
1713
|
+
// name: element.CouponTitle,
|
|
1714
|
+
// IsEnable: true,
|
|
1715
|
+
// amount: element.ReductionAmount,
|
|
1716
|
+
// doorsill: element.EnableAmount,
|
|
1717
|
+
// LastTS: element.LastTS,
|
|
1718
|
+
// checked: false,
|
|
1719
|
+
// IsRepelWithPoints: true,
|
|
1720
|
+
// UMemberID: dto.Idmember,
|
|
1721
|
+
// expired: null,
|
|
1722
|
+
// displayText,
|
|
1723
|
+
// promoMethodEnum,
|
|
1724
|
+
// discountPct,
|
|
1725
|
+
// promoId,
|
|
1726
|
+
// promoRuleId,
|
|
1727
|
+
// couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
|
|
1728
|
+
// id
|
|
1729
|
+
// })
|
|
1730
|
+
_this14.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
|
|
1731
|
+
} else {
|
|
1732
|
+
_this14.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum);
|
|
1733
|
+
// this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
|
|
1734
|
+
// djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
|
|
1735
|
+
}
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
//this.receivable = getFixedNumber(this.receivable - sum);
|
|
1740
|
+
}
|
|
1741
|
+
}, {
|
|
1742
|
+
key: 'calcDjqValue',
|
|
1743
|
+
value: function calcDjqValue(q1) {
|
|
1744
|
+
var _ref22 = _mutantsUtil.platform || {},
|
|
1745
|
+
isNewRetailBCPos = _ref22.isNewRetailBCPos;
|
|
1746
|
+
|
|
1747
|
+
var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
|
|
1748
|
+
Differentiate = _enumController$getEn15.Differentiate;
|
|
1749
|
+
|
|
1750
|
+
if (q1) {
|
|
1751
|
+
if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
|
|
1752
|
+
_message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
|
|
1753
|
+
return;
|
|
1593
1754
|
}
|
|
1755
|
+
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1756
|
+
return djq.code == q1.code;
|
|
1757
|
+
});
|
|
1758
|
+
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1759
|
+
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1760
|
+
return;
|
|
1761
|
+
}
|
|
1762
|
+
//判断是否是选择优惠券 //CC优惠券只能使用一个
|
|
1763
|
+
// if (q1 && !q1.checked && isNewRetailBCPos) {
|
|
1764
|
+
// // 检查是否有已经选定优惠券 并且去除选定的优惠券
|
|
1765
|
+
// this.currentMode.djqs.forEach((djq, index) => {
|
|
1766
|
+
// if (djq.checked) this.currentMode.djqs[index].checked = false;
|
|
1767
|
+
// })
|
|
1768
|
+
// }
|
|
1594
1769
|
q && (q.checked = !q.checked);
|
|
1595
1770
|
}
|
|
1596
1771
|
var sum = 0;
|
|
1772
|
+
// console.log(this.store, 'stores-------');
|
|
1597
1773
|
(0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1598
1774
|
return djq.checked;
|
|
1599
1775
|
}), function (q) {
|
|
@@ -1602,6 +1778,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1602
1778
|
this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
|
|
1603
1779
|
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1604
1780
|
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1781
|
+
|
|
1605
1782
|
//this.receivable = getFixedNumber(this.receivable - sum);
|
|
1606
1783
|
}
|
|
1607
1784
|
}, {
|
|
@@ -1644,16 +1821,16 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1644
1821
|
}, {
|
|
1645
1822
|
key: 'setPaymodes',
|
|
1646
1823
|
value: function () {
|
|
1647
|
-
var
|
|
1824
|
+
var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
|
|
1648
1825
|
var _this15 = this;
|
|
1649
1826
|
|
|
1650
|
-
var _enumController$
|
|
1827
|
+
var _enumController$getEn16, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
|
|
1651
1828
|
|
|
1652
1829
|
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
|
1653
1830
|
while (1) {
|
|
1654
1831
|
switch (_context7.prev = _context7.next) {
|
|
1655
1832
|
case 0:
|
|
1656
|
-
_enumController$
|
|
1833
|
+
_enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn16.settleStyleType, PayStyle = _enumController$getEn16.PayStyle;
|
|
1657
1834
|
memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
|
|
1658
1835
|
param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
|
|
1659
1836
|
_context7.next = 5;
|
|
@@ -1698,7 +1875,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1698
1875
|
}));
|
|
1699
1876
|
|
|
1700
1877
|
function setPaymodes(_x5, _x6) {
|
|
1701
|
-
return
|
|
1878
|
+
return _ref23.apply(this, arguments);
|
|
1702
1879
|
}
|
|
1703
1880
|
|
|
1704
1881
|
return setPaymodes;
|
|
@@ -1740,22 +1917,65 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
|
1740
1917
|
initializer: function initializer() {
|
|
1741
1918
|
return [];
|
|
1742
1919
|
}
|
|
1743
|
-
}), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, '
|
|
1920
|
+
}), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor8 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
|
|
1921
|
+
enumerable: true,
|
|
1922
|
+
initializer: function initializer() {
|
|
1923
|
+
var _this16 = this;
|
|
1924
|
+
|
|
1925
|
+
return function (id, couponNum, code) {
|
|
1926
|
+
_this16.currentMode.djqs.forEach(function (ele) {
|
|
1927
|
+
if (ele.id === id) {
|
|
1928
|
+
ele.couponCategoryEnum = couponNum;
|
|
1929
|
+
var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
|
|
1930
|
+
ele.IsEnable = IsEnable;
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
|
|
1936
|
+
enumerable: true,
|
|
1937
|
+
initializer: function initializer() {
|
|
1938
|
+
var _this17 = this;
|
|
1939
|
+
|
|
1940
|
+
return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
|
|
1941
|
+
var djq = {
|
|
1942
|
+
promoCouponCode: promoCouponCode,
|
|
1943
|
+
name: name,
|
|
1944
|
+
IsEnable: IsEnable,
|
|
1945
|
+
amount: amount,
|
|
1946
|
+
doorsill: doorsill,
|
|
1947
|
+
LastTS: LastTS,
|
|
1948
|
+
checked: checked,
|
|
1949
|
+
IsRepelWithPoints: IsRepelWithPoints,
|
|
1950
|
+
UMemberID: UMemberID,
|
|
1951
|
+
expired: expired,
|
|
1952
|
+
displayText: displayText,
|
|
1953
|
+
promoMethodEnum: promoMethodEnum,
|
|
1954
|
+
discountPct: discountPct,
|
|
1955
|
+
promoId: promoId,
|
|
1956
|
+
promoRuleId: promoRuleId,
|
|
1957
|
+
couponCategoryEnum: couponCategoryEnum,
|
|
1958
|
+
id: id
|
|
1959
|
+
};
|
|
1960
|
+
_this17.currentMode.djqs.push(djq);
|
|
1961
|
+
};
|
|
1962
|
+
}
|
|
1963
|
+
}), _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
1964
|
var Member = exports.Member = (_class5 = function () {
|
|
1745
1965
|
function Member(m) {
|
|
1746
|
-
var
|
|
1966
|
+
var _this18 = this;
|
|
1747
1967
|
|
|
1748
1968
|
(0, _classCallCheck3.default)(this, Member);
|
|
1749
1969
|
|
|
1750
|
-
_initDefineProp(this, 'cardNo',
|
|
1970
|
+
_initDefineProp(this, 'cardNo', _descriptor10, this);
|
|
1751
1971
|
|
|
1752
|
-
_initDefineProp(this, 'balance',
|
|
1972
|
+
_initDefineProp(this, 'balance', _descriptor11, this);
|
|
1753
1973
|
|
|
1754
|
-
_initDefineProp(this, 'exchangable',
|
|
1974
|
+
_initDefineProp(this, 'exchangable', _descriptor12, this);
|
|
1755
1975
|
|
|
1756
|
-
_initDefineProp(this, 'meStorageCardId',
|
|
1976
|
+
_initDefineProp(this, 'meStorageCardId', _descriptor13, this);
|
|
1757
1977
|
|
|
1758
|
-
_initDefineProp(this, 'StorageCardNo',
|
|
1978
|
+
_initDefineProp(this, 'StorageCardNo', _descriptor14, this);
|
|
1759
1979
|
|
|
1760
1980
|
if (m) {
|
|
1761
1981
|
this.id = m.ID;
|
|
@@ -1766,16 +1986,16 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1766
1986
|
return key == 'canusedbalancestorage';
|
|
1767
1987
|
});
|
|
1768
1988
|
|
|
1769
|
-
var
|
|
1770
|
-
isNewRetailBCPos =
|
|
1989
|
+
var _ref24 = _mutantsUtil.platform || {},
|
|
1990
|
+
isNewRetailBCPos = _ref24.isNewRetailBCPos;
|
|
1771
1991
|
|
|
1772
1992
|
m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
|
|
1773
1993
|
(0, _mobx.runInAction)(function () {
|
|
1774
|
-
|
|
1994
|
+
_this18.cardNo = m.CardCode;
|
|
1775
1995
|
if (index >= 0) {
|
|
1776
|
-
|
|
1996
|
+
_this18.balance = parseFloat(m.DynamicPropertyValues[index]);
|
|
1777
1997
|
} else {
|
|
1778
|
-
|
|
1998
|
+
_this18.balance = _this18.rawbalance;
|
|
1779
1999
|
}
|
|
1780
2000
|
});
|
|
1781
2001
|
this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
|
|
@@ -1807,19 +2027,19 @@ var Member = exports.Member = (_class5 = function () {
|
|
|
1807
2027
|
}
|
|
1808
2028
|
}]);
|
|
1809
2029
|
return Member;
|
|
1810
|
-
}(), (
|
|
2030
|
+
}(), (_descriptor10 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
|
|
1811
2031
|
enumerable: true,
|
|
1812
2032
|
initializer: null
|
|
1813
|
-
}),
|
|
2033
|
+
}), _descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
|
|
1814
2034
|
enumerable: true,
|
|
1815
2035
|
initializer: null
|
|
1816
|
-
}),
|
|
2036
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
|
|
1817
2037
|
enumerable: true,
|
|
1818
2038
|
initializer: null
|
|
1819
|
-
}),
|
|
2039
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class5.prototype, 'meStorageCardId', [_mobx.observable], {
|
|
1820
2040
|
enumerable: true,
|
|
1821
2041
|
initializer: null
|
|
1822
|
-
}),
|
|
2042
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
|
|
1823
2043
|
enumerable: true,
|
|
1824
2044
|
initializer: null
|
|
1825
2045
|
}), _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);
|