tplus-components-touch 3.49.2 → 3.49.3
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/commonForm/addressPicker/index.js +22 -8
- package/dist/components/commonForm/addressPicker/index.js.map +1 -1
- package/dist/components/hotKey/index.js +10 -5
- package/dist/components/hotKey/index.js.map +1 -1
- package/dist/components/hotKey/localConfig.js +13 -0
- package/dist/components/hotKey/localConfig.js.map +1 -1
- package/dist/components/message/index.js +3 -4
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/modalWraper/index.js +16 -1
- package/dist/components/modalWraper/index.js.map +1 -1
- package/dist/components/modalWraper/style.less +6 -0
- package/dist/components/settlement/asyncModal.js +4 -1
- package/dist/components/settlement/asyncModal.js.map +1 -1
- package/dist/components/settlement/settlement.js +279 -246
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +3 -0
- package/dist/components/settlement/settlementApi.js +512 -0
- package/dist/components/settlement/settlementApi.js.map +1 -0
- package/dist/components/settlement/settlementStore.js +725 -712
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/ticon/iconfont/demo_index.html +3 -3
- package/dist/components/ticon/iconfont/iconfont.css +3 -3
- package/dist/components/ticon/iconfont/iconfont.js +2 -1
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
- 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 +25 -16
- package/dist/components/touchTable/index.js.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/ticon/iconfont/iconfont.eot +0 -0
- package/dist/components/ticon/iconfont/iconfont.svg +0 -593
@@ -45,7 +45,7 @@ var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
45
45
|
|
46
46
|
var _createClass3 = _interopRequireDefault(_createClass2);
|
47
47
|
|
48
|
-
var _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _desc2, _value2, _class3, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _desc3, _value3, _class5, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21;
|
48
|
+
var _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _class2, _temp, _initialiseProps, _desc2, _value2, _class3, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _desc3, _value3, _class5, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21;
|
49
49
|
|
50
50
|
var _mobx = require('mobx');
|
51
51
|
|
@@ -117,6 +117,10 @@ var _reduce2 = require('lodash/reduce');
|
|
117
117
|
|
118
118
|
var _reduce3 = _interopRequireDefault(_reduce2);
|
119
119
|
|
120
|
+
var _settlementApi = require('./settlementApi');
|
121
|
+
|
122
|
+
var _settlementApi2 = _interopRequireDefault(_settlementApi);
|
123
|
+
|
120
124
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
121
125
|
|
122
126
|
function _initDefineProp(target, property, descriptor, context) {
|
@@ -164,352 +168,19 @@ function _initializerWarningHelper(descriptor, context) {
|
|
164
168
|
|
165
169
|
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
|
166
170
|
|
167
|
-
var SettlementStore = (_class = function () {
|
168
|
-
//
|
171
|
+
var SettlementStore = (_class = (_temp = _class2 = function () {
|
172
|
+
//type==2
|
169
173
|
function SettlementStore() {
|
170
|
-
var _this2 = this;
|
171
|
-
|
172
174
|
(0, _classCallCheck3.default)(this, SettlementStore);
|
173
|
-
this.paymode = null;
|
174
|
-
this.dto = null;
|
175
|
-
this.dtoParams = null;
|
176
|
-
this.member = null;
|
177
|
-
this.brefund = false;
|
178
|
-
this.bquick = false;
|
179
|
-
this.boriginReturn = false;
|
180
|
-
|
181
|
-
_initDefineProp(this, 'newStyle', _descriptor, this);
|
182
|
-
|
183
|
-
this.isFull = true;
|
184
|
-
|
185
|
-
_initDefineProp(this, 'setNewStyle', _descriptor2, this);
|
186
|
-
|
187
|
-
_initDefineProp(this, 'queryPwd', _descriptor3, this);
|
188
|
-
|
189
|
-
_initDefineProp(this, 'updateMemberInfo', _descriptor4, this);
|
190
|
-
|
191
|
-
_initDefineProp(this, 'updateCurrentMode', _descriptor5, this);
|
192
|
-
|
193
|
-
_initDefineProp(this, 'updateCardInfo', _descriptor6, this);
|
194
|
-
|
195
|
-
this.handleCzkData = function (m) {
|
196
|
-
if (!m || !m.StorageCardNo) {
|
197
|
-
(0, _mobx.runInAction)(function () {
|
198
|
-
_this2.paymode.currentMode.errinfo = "无效的会员卡号";
|
199
|
-
});
|
200
|
-
} else {
|
201
|
-
(0, _mobx.runInAction)(function () {
|
202
|
-
_this2.paymode.currentMode.errinfo = "";
|
203
|
-
_this2.paymode.currentMode.memberId = m.ID;
|
204
|
-
_this2.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this2.brefund ? _this2.paymode.receivable : Math.max(_this2.paymode.receivable, 0));
|
205
|
-
_this2.updateEvent();
|
206
|
-
var message = '';
|
207
|
-
var sum = (0, _reduce3.default)(_this2.paymode.thePaymodes, function (total, cur) {
|
208
|
-
return total + cur.value;
|
209
|
-
}, 0);
|
210
|
-
// 对于卡不用判断会员的一些信息
|
211
|
-
// if (global.CheckMemberStorageProcessorBlock ) {
|
212
|
-
// message= CheckMemberStorageProcessorBlock.execute(m);
|
213
|
-
// }
|
214
|
-
if (!String.isNullOrEmpty(message)) {
|
215
|
-
_this2.paymode.currentMode.errinfo = message;
|
216
|
-
} else if (_this2.checkReceived(_this2.paymode.currentMode, "balance")) {
|
217
|
-
_this2.paymode.currentMode.errinfo = "余额不足";
|
218
|
-
} else if (_this2.paymode.amount > 0 && parseFloat(_this2.paymode.amount) !== sum && _this2.paymode.currentMode.value == 0) {
|
219
|
-
_this2.paymode.currentMode.errinfo = "实收金额必须录入";
|
220
|
-
} else {
|
221
|
-
// 查询成功后将焦点移入下一个输入框
|
222
|
-
setTimeout(function () {
|
223
|
-
var nextInput = document.querySelector('.czk .received .input');
|
224
|
-
nextInput && nextInput.select();
|
225
|
-
}, 300);
|
226
|
-
}
|
227
|
-
});
|
228
|
-
}
|
229
|
-
};
|
230
|
-
|
231
|
-
this.getCouponList = function (coupon_code) {
|
232
|
-
var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
|
233
|
-
PayStyle = _enumController$getEn.PayStyle,
|
234
|
-
Differentiate = _enumController$getEn.Differentiate;
|
235
|
-
|
236
|
-
var couponApplyRule = (0, _tplusPoslogin.PosInitData)('CouponApplyRule');
|
237
|
-
|
238
|
-
var _enumController$getEn2 = _mutantsUtil.enumController.getEnumOj(),
|
239
|
-
CouponApplyRule = _enumController$getEn2.CouponApplyRule;
|
240
|
-
|
241
|
-
if (couponApplyRule == CouponApplyRule.SHOWN_BY_CUSTOMER && !!coupon_code || couponApplyRule != CouponApplyRule.SHOWN_BY_CUSTOMER) {
|
242
|
-
var dto = _this2.dto;
|
243
|
-
var promoVoucher = {};
|
244
|
-
_this2.paymode.clearDjqs();
|
245
|
-
_this2.paymode.reCalculationDjqs();
|
246
|
-
promoVoucher.coupon_code = coupon_code || "";
|
247
|
-
promoVoucher.boName = "Retail";
|
248
|
-
promoVoucher.voucherId = dto.ID;
|
249
|
-
var onlinePaymentAmount = 0;
|
250
|
-
if (dto.OnlinePaymentAmount) {
|
251
|
-
onlinePaymentAmount = dto.OnlinePaymentAmount;
|
252
|
-
}
|
253
|
-
promoVoucher.promoLinks = (0, _filter3.default)(_this2.paymode.currentMode.djqs, function (djq) {
|
254
|
-
return djq.checked;
|
255
|
-
});
|
256
|
-
promoVoucher.totalAmountWithTax = Math.Minus(dto.TotalTaxAmount, onlinePaymentAmount);
|
257
|
-
promoVoucher.redBlueFlagEnum = "BLUE";
|
258
|
-
promoVoucher.meMemberId = dto.Idmember;
|
259
|
-
promoVoucher.storeFactorId = dto.Idstore;
|
260
|
-
promoVoucher.voucherDetailList = [];
|
261
|
-
dto.RetailDetails.forEach(function (item) {
|
262
|
-
var detailDTO = {};
|
263
|
-
detailDTO.uuid = item.Code;
|
264
|
-
detailDTO.detailBoName = "RetailDetail";
|
265
|
-
detailDTO.voucherDetailId = item.ID;
|
266
|
-
detailDTO.productId = item.Idinventory;
|
267
|
-
detailDTO.uomId = item.Idunit;
|
268
|
-
detailDTO.productSpecId = item.ProductSpecId;
|
269
|
-
detailDTO.isManualFreeGift = item.IsPresent;
|
270
|
-
detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
|
271
|
-
detailDTO.IsManualChangePrice = item.IsManualChangePrice;
|
272
|
-
// if(detailDTO.IsManualChangePrice)//如果是手工改价
|
273
|
-
// {
|
274
|
-
// detailDTO.listPrice = item.TaxPrice;
|
275
|
-
// detailDTO.netAmountWithTax = item.TaxAmount;
|
276
|
-
// }
|
277
|
-
// else
|
278
|
-
// {
|
279
|
-
var bookingQuantity = 0;
|
280
|
-
if (item.BookingQuantity) {
|
281
|
-
bookingQuantity = item.BookingQuantity;
|
282
|
-
}
|
283
|
-
detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
|
284
|
-
detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
|
285
|
-
//}
|
286
|
-
detailDTO.taxRate = item.TaxRate;
|
287
|
-
detailDTO.quantity = item.Quantity;
|
288
|
-
|
289
|
-
detailDTO.amountWithTax = item.RetailAmount;
|
290
|
-
// 促销 start
|
291
|
-
if (item.PromotionDetails && item.PromotionDetails.length != 0) {
|
292
|
-
var promoLinks = [];
|
293
|
-
item.PromotionDetails.forEach(function (promotion) {
|
294
|
-
promoLinks.push({
|
295
|
-
promoId: promotion.IdSalesPromotionDTO,
|
296
|
-
promoRuleId: promotion.PromotionRuleId
|
297
|
-
});
|
298
|
-
});
|
299
|
-
if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
|
300
|
-
}
|
301
|
-
// 促销 end
|
302
|
-
promoVoucher.voucherDetailList.push(detailDTO);
|
303
|
-
});
|
304
|
-
|
305
|
-
return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
|
306
|
-
if (result && result.length != 0) {
|
307
|
-
result.forEach(function (element) {
|
308
|
-
var _ref = element || {},
|
309
|
-
couponCode = _ref.couponCode,
|
310
|
-
name = _ref.name,
|
311
|
-
tieredAmountResult = _ref.tieredAmountResult,
|
312
|
-
fromDate = _ref.fromDate,
|
313
|
-
dateMount = _ref.dateMount,
|
314
|
-
promoMethodEnum = _ref.promoMethodEnum,
|
315
|
-
discountPct = _ref.discountPct,
|
316
|
-
nominalAmount = _ref.nominalAmount,
|
317
|
-
promoId = _ref.promoId,
|
318
|
-
id = _ref.id;
|
319
|
-
|
320
|
-
var condValue = tieredAmountResult.condValue,
|
321
|
-
promoDiscount = tieredAmountResult.promoDiscount,
|
322
|
-
displayText = tieredAmountResult.displayText,
|
323
|
-
promoRuleId = tieredAmountResult.promoRuleId,
|
324
|
-
couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
|
325
|
-
|
326
|
-
if (result.IsRepelWithPoints && (0, _find3.default)(_this2.paymode.thePaymodes, function (themode) {
|
327
|
-
return themode.paymentType == PayStyle.jfdx;
|
328
|
-
})) {
|
329
|
-
_message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
|
330
|
-
} else {
|
331
|
-
var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
|
332
|
-
_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);
|
333
|
-
}
|
334
|
-
});
|
335
|
-
if (promoVoucher.coupon_code) {
|
336
|
-
_this2.paymode.calcDjqCheckValue(_this2.paymode.currentMode.djqs[0], _this2.dto, 'single');
|
337
|
-
}
|
338
|
-
} else {
|
339
|
-
if (promoVoucher.coupon_code) {
|
340
|
-
_message2.default.info(Differentiate.COUPON + '\u53F7\u4E0D\u5B58\u5728\uFF01');
|
341
|
-
_this2.getCouponList();
|
342
|
-
} else {
|
343
|
-
_message2.default.info('\u6CA1\u6709\u627E\u5230\u53EF\u4F7F\u7528\u7684' + Differentiate.COUPON + '\uFF01');
|
344
|
-
}
|
345
|
-
}
|
346
|
-
});
|
347
|
-
}
|
348
|
-
};
|
349
|
-
|
350
|
-
this.getSettleGift = function () {
|
351
|
-
return (0, _tplusApi.ccApi)({}, '/marketingtool/paygift/executeRightsForPos/' + _this2.billID, false, false, { method: 'get', timeout_skip: true });
|
352
|
-
};
|
353
|
-
|
354
|
-
this.getRefWareHouseList = function () {
|
355
|
-
return (0, _tplusApi.ccApi)({}, '/retail/RetailPos/getRefWareHouseList', false, false);
|
356
|
-
};
|
357
|
-
|
358
|
-
this.checkCoupon = function () {
|
359
|
-
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
|
360
|
-
var _ref3, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
|
361
|
-
|
362
|
-
return _regenerator2.default.wrap(function _callee$(_context) {
|
363
|
-
while (1) {
|
364
|
-
switch (_context.prev = _context.next) {
|
365
|
-
case 0:
|
366
|
-
_ref3 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref3.isNewRetailBCPos;
|
367
|
-
|
368
|
-
if (!isNewRetailBCPos) {
|
369
|
-
_context.next = 7;
|
370
|
-
break;
|
371
|
-
}
|
372
|
-
|
373
|
-
_context.next = 4;
|
374
|
-
return _this2.getCouponList(sn, 'sinlge');
|
375
|
-
|
376
|
-
case 4:
|
377
|
-
return _context.abrupt('return', _context.sent);
|
378
|
-
|
379
|
-
case 7:
|
380
|
-
_enumController$getEn3 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn3.PayStyle, Differentiate = _enumController$getEn3.Differentiate;
|
381
|
-
return _context.abrupt('return', (0, _tplusApi.tApi)({ request: {
|
382
|
-
Uid: _this2.paymode.currentMode.member.uid || '',
|
383
|
-
SN: sn,
|
384
|
-
StoreCode: _this2.dto.Idstore,
|
385
|
-
Inventories: (0, _map3.default)((0, _filter3.default)(_this2.dto.RetailDetails, function (d) {
|
386
|
-
return d.Quantity > 0 && !d.IsPresent;
|
387
|
-
}), function (detail) {
|
388
|
-
return {
|
389
|
-
IdInventory: detail.Inventory.ID,
|
390
|
-
IdUnit: detail.Idunit,
|
391
|
-
Code: detail.Inventory.Code,
|
392
|
-
FreeItem0: JSON.getCellValue(detail, "freeitem0"),
|
393
|
-
FreeItem1: JSON.getCellValue(detail, "freeitem1"),
|
394
|
-
FreeItem2: JSON.getCellValue(detail, "freeitem2"),
|
395
|
-
FreeItem3: JSON.getCellValue(detail, "freeitem3"),
|
396
|
-
FreeItem4: JSON.getCellValue(detail, "freeitem4"),
|
397
|
-
FreeItem5: JSON.getCellValue(detail, "freeitem5"),
|
398
|
-
FreeItem6: JSON.getCellValue(detail, "freeitem6"),
|
399
|
-
FreeItem7: JSON.getCellValue(detail, "freeitem7"),
|
400
|
-
FreeItem8: JSON.getCellValue(detail, "freeitem8"),
|
401
|
-
FreeItem9: JSON.getCellValue(detail, "freeitem9")
|
402
|
-
};
|
403
|
-
}),
|
404
|
-
// inventoryCodes:_join(_map(this.dto.RetailDetails,(detail)=>{return detail.Inventory.Code;}),','),
|
405
|
-
InventoryClassCodes: (0, _join3.default)((0, _map3.default)((0, _filter3.default)(_this2.dto.RetailDetails, function (d) {
|
406
|
-
return d.Quantity > 0;
|
407
|
-
}), function (detail) {
|
408
|
-
return (detail.Inventory.InventoryClass || { Code: '' }).Code;
|
409
|
-
}), ','),
|
410
|
-
Amount: _this2.paymode.amount
|
411
|
-
} }, 'chanjet.AA.DR.coupon.CheckCoupon', false, false).then(function (result) {
|
412
|
-
if ((0, _find3.default)(_this2.paymode.currentMode.djqs, function (djq) {
|
413
|
-
return djq.code == result.SN;
|
414
|
-
})) {
|
415
|
-
_message2.default.info(Differentiate.COUPON + '\u5DF2\u6DFB\u52A0');
|
416
|
-
} else if (result.IsRepelWithPoints && (0, _find3.default)(_this2.paymode.thePaymodes, function (themode) {
|
417
|
-
return themode.paymentType == PayStyle.jfdx;
|
418
|
-
})) {
|
419
|
-
_message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
|
420
|
-
} else {
|
421
|
-
_this2.addDjq(result.SN, result.Title, result.ReduceAmount, result.StartAmount, result.LastTS, false, !result.IsRepelWithPoints, result.UMemberID);
|
422
|
-
}
|
423
|
-
}));
|
424
|
-
|
425
|
-
case 9:
|
426
|
-
case 'end':
|
427
|
-
return _context.stop();
|
428
|
-
}
|
429
|
-
}
|
430
|
-
}, _callee, _this2);
|
431
|
-
}));
|
432
175
|
|
433
|
-
|
434
|
-
return _ref2.apply(this, arguments);
|
435
|
-
};
|
436
|
-
}();
|
437
|
-
|
438
|
-
this.repeatStorageModal = function (content) {
|
439
|
-
return new _promise2.default(function (resolve, reject) {
|
440
|
-
_tplusComponentsTouch.ModalWraper.confirm({
|
441
|
-
title: '',
|
442
|
-
okText: '继续储值',
|
443
|
-
className: 'repeat-modal',
|
444
|
-
zIndex: 1007,
|
445
|
-
content: content,
|
446
|
-
onOk: function () {
|
447
|
-
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
|
448
|
-
var ret;
|
449
|
-
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
450
|
-
while (1) {
|
451
|
-
switch (_context2.prev = _context2.next) {
|
452
|
-
case 0:
|
453
|
-
_context2.next = 2;
|
454
|
-
return _this2.saveMember();
|
455
|
-
|
456
|
-
case 2:
|
457
|
-
ret = _context2.sent;
|
458
|
-
|
459
|
-
if (ret === false) {
|
460
|
-
resolve(false);
|
461
|
-
} else {
|
462
|
-
resolve(true);
|
463
|
-
}
|
464
|
-
|
465
|
-
case 4:
|
466
|
-
case 'end':
|
467
|
-
return _context2.stop();
|
468
|
-
}
|
469
|
-
}
|
470
|
-
}, _callee2, _this2);
|
471
|
-
}));
|
472
|
-
|
473
|
-
return function onOk() {
|
474
|
-
return _ref4.apply(this, arguments);
|
475
|
-
};
|
476
|
-
}(),
|
477
|
-
onCancel: function onCancel() {
|
478
|
-
resolve(false);
|
479
|
-
}
|
480
|
-
});
|
481
|
-
});
|
482
|
-
};
|
483
|
-
|
484
|
-
this.checkIntegralExchangeReturn = function (id) {
|
485
|
-
return new _promise2.default(function (resolve, reject) {
|
486
|
-
(0, _tplusApi.tApi)({ param: { refVoucherId: id } }, 'chanjet.RE.NewPos.GetNewIntegralExchange', false, false, { timeout_skip: true }).then(function (resp) {
|
487
|
-
if (resp && resp.expireIntegral > 0) {
|
488
|
-
_tplusComponentsTouch.ModalWraper.confirm({
|
489
|
-
className: 'tplus-confirm-modal',
|
490
|
-
title: "温馨提示",
|
491
|
-
content: '\u5B58\u5728\u5DF2\u7ECF\u8FC7\u671F\u7684\u79EF\u5206' + resp.expireIntegral + '\u9000\u8D27\u540E\u79EF\u5206\u4E0D\u4F1A\u8FD4\u8FD8\u3002\u662F\u5426\u7EE7\u7EED\u9000\u8D27\uFF1F',
|
492
|
-
cancelable: false,
|
493
|
-
onOk: function onOk() {
|
494
|
-
resolve(true);
|
495
|
-
},
|
496
|
-
onCancel: function onCancel() {
|
497
|
-
reject(false);
|
498
|
-
}
|
499
|
-
});
|
500
|
-
} else {
|
501
|
-
resolve(true);
|
502
|
-
}
|
503
|
-
});
|
504
|
-
});
|
505
|
-
};
|
176
|
+
_initialiseProps.call(this);
|
506
177
|
|
507
178
|
this.paymode = new PayMode();
|
508
179
|
var params = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
509
180
|
if (params) this.cloudPrintArguments = params;
|
510
181
|
this.setNewStyle();
|
511
|
-
|
512
|
-
|
182
|
+
this.SettlementApi = _settlementApi2.default;
|
183
|
+
} // 预售都是全款;预订是否全款,在点击确认支付时计算订金和商品金额计算得出
|
513
184
|
|
514
185
|
(0, _createClass3.default)(SettlementStore, [{
|
515
186
|
key: 'initPaymodes',
|
@@ -521,7 +192,7 @@ var SettlementStore = (_class = function () {
|
|
521
192
|
}, {
|
522
193
|
key: 'init',
|
523
194
|
value: function init(context, amounthandler, datasource, storeinfo, bquick, amount, type, data, payModeKey) {
|
524
|
-
var
|
195
|
+
var _this2 = this;
|
525
196
|
|
526
197
|
this.setNewStyle();
|
527
198
|
this.type = type;
|
@@ -534,17 +205,17 @@ var SettlementStore = (_class = function () {
|
|
534
205
|
(0, _mobx.runInAction)(function () {
|
535
206
|
// 单品金额抹零
|
536
207
|
if (global.DealSingleRowAmountSettingProcessorBlock) {
|
537
|
-
global.DealSingleRowAmountSettingProcessorBlock.execute(
|
208
|
+
global.DealSingleRowAmountSettingProcessorBlock.execute(_this2.dto);
|
538
209
|
}
|
539
210
|
|
540
|
-
var _enumController$
|
541
|
-
PayStyle = _enumController$
|
211
|
+
var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
|
212
|
+
PayStyle = _enumController$getEn.PayStyle;
|
542
213
|
|
543
214
|
var isQuickCash = bquick && payModeKey == PayStyle.xianjin;
|
544
215
|
|
545
216
|
// 成交金额抹零
|
546
217
|
if (global.DealAmountSettingProcessorBlock) {
|
547
|
-
global.DealAmountSettingProcessorBlock.execute(
|
218
|
+
global.DealAmountSettingProcessorBlock.execute(_this2.dto, isQuickCash);
|
548
219
|
}
|
549
220
|
});
|
550
221
|
// this.member=context.stores && context.stores.memberStore && context.stores.memberStore.member;
|
@@ -559,9 +230,9 @@ var SettlementStore = (_class = function () {
|
|
559
230
|
PreSellOrBook = _getLoginInfo.PreSellOrBook,
|
560
231
|
PercentageWhenBook = _getLoginInfo.PercentageWhenBook;
|
561
232
|
|
562
|
-
var
|
563
|
-
IdbusiType =
|
564
|
-
DistributionMode =
|
233
|
+
var _ref = this.dto || {},
|
234
|
+
IdbusiType = _ref.IdbusiType,
|
235
|
+
DistributionMode = _ref.DistributionMode;
|
565
236
|
|
566
237
|
if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
|
567
238
|
this.paymode.bookMaxValue = value;
|
@@ -571,7 +242,7 @@ var SettlementStore = (_class = function () {
|
|
571
242
|
}
|
572
243
|
if (IdbusiType == 38 && PreSellOrBook == 'BOOK') {
|
573
244
|
(0, _mobx.runInAction)(function () {
|
574
|
-
|
245
|
+
_this2.dto.PrepaidAmount = value;
|
575
246
|
});
|
576
247
|
}
|
577
248
|
//预订计算快递或同城配送运费
|
@@ -607,13 +278,13 @@ var SettlementStore = (_class = function () {
|
|
607
278
|
}, {
|
608
279
|
key: 'setModes',
|
609
280
|
value: function setModes() {
|
610
|
-
var
|
281
|
+
var _this3 = this;
|
611
282
|
|
612
283
|
(0, _each3.default)(this.paymode.paymodes, function (p) {
|
613
|
-
if ((0, _findIndex3.default)(
|
284
|
+
if ((0, _findIndex3.default)(_this3.paymode.thePaymodes, function (mode) {
|
614
285
|
return p.paymentType == mode.paymentType;
|
615
286
|
}) == -1) {
|
616
|
-
|
287
|
+
_this3.addPay(p.paymentType);
|
617
288
|
}
|
618
289
|
});
|
619
290
|
if (!this.boriginReturn && this.paymode.thePaymodes.length > 0) {
|
@@ -630,18 +301,18 @@ var SettlementStore = (_class = function () {
|
|
630
301
|
}, {
|
631
302
|
key: 'initByOriginReturn',
|
632
303
|
value: function initByOriginReturn() {
|
633
|
-
var
|
304
|
+
var _this4 = this;
|
634
305
|
|
635
|
-
var _enumController$
|
636
|
-
PayStyle = _enumController$
|
306
|
+
var _enumController$getEn2 = _mutantsUtil.enumController.getEnumOj(),
|
307
|
+
PayStyle = _enumController$getEn2.PayStyle;
|
637
308
|
|
638
|
-
var
|
639
|
-
isNewRetailBCPos =
|
309
|
+
var _ref2 = _mutantsUtil.platform || {},
|
310
|
+
isNewRetailBCPos = _ref2.isNewRetailBCPos;
|
640
311
|
|
641
312
|
console.log(this.dto, 'dto==========');
|
642
313
|
this.paymode.checkList = [];
|
643
314
|
(0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
|
644
|
-
var themode = (0, _find3.default)(
|
315
|
+
var themode = (0, _find3.default)(_this4.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
|
645
316
|
if (detail.SettleStyle.Code === PayStyle.hyczk && !themode) {
|
646
317
|
_tplusComponentsTouch.ModalWraper.info({
|
647
318
|
title: '温馨提示',
|
@@ -651,33 +322,33 @@ var SettlementStore = (_class = function () {
|
|
651
322
|
});
|
652
323
|
}
|
653
324
|
if (themode && themode.paymentType && themode.paymentType != PayStyle.hyczk) {
|
654
|
-
var newmode = (0, _extends3.default)({},
|
325
|
+
var newmode = (0, _extends3.default)({}, _this4.genNewMode(themode.paymentType, false, detail.Amount), {
|
655
326
|
authCode: detail.PaymentCode,
|
656
327
|
steadCashIntegral: detail.SteadCashIntegral,
|
657
328
|
overchargesAmount: detail.OverchargesAmount,
|
658
329
|
boriginReturn: true,
|
659
330
|
thirdPaymentReturnInfo: detail.ThirdPaymentReturnInfo
|
660
331
|
});
|
661
|
-
|
332
|
+
_this4.paymode.currentMode = newmode;
|
662
333
|
if (themode.paymentType == PayStyle.djq) {
|
663
|
-
(0, _each3.default)(
|
334
|
+
(0, _each3.default)(_this4.dto.RetailCouponDetails, function (djq) {
|
664
335
|
if (isNewRetailBCPos) {
|
665
|
-
var
|
666
|
-
displayText =
|
667
|
-
promoRuleId =
|
668
|
-
dateMount =
|
669
|
-
promoMethodEnum =
|
670
|
-
discountPct =
|
671
|
-
promoId =
|
672
|
-
id =
|
673
|
-
|
674
|
-
|
336
|
+
var _ref3 = djq || {},
|
337
|
+
displayText = _ref3.displayText,
|
338
|
+
promoRuleId = _ref3.promoRuleId,
|
339
|
+
dateMount = _ref3.dateMount,
|
340
|
+
promoMethodEnum = _ref3.promoMethodEnum,
|
341
|
+
discountPct = _ref3.discountPct,
|
342
|
+
promoId = _ref3.promoId,
|
343
|
+
id = _ref3.id;
|
344
|
+
|
345
|
+
_this4.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this4.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
|
675
346
|
return;
|
676
347
|
}
|
677
|
-
|
348
|
+
_this4.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
|
678
349
|
});
|
679
350
|
}
|
680
|
-
|
351
|
+
_this4.paymode.thePaymodes.push(newmode);
|
681
352
|
}
|
682
353
|
});
|
683
354
|
(0, _each3.default)(this.dto.RetailStorageDetails, function (detail) {
|
@@ -691,7 +362,7 @@ var SettlementStore = (_class = function () {
|
|
691
362
|
meStorageCardId = detail.DynamicPropertyValues[index].MeStorageCardId;
|
692
363
|
}
|
693
364
|
});
|
694
|
-
var newmode = (0, _extends3.default)({},
|
365
|
+
var newmode = (0, _extends3.default)({}, _this4.genNewMode(PayStyle.hyczk, false, detail.StoragePaymentAmount), {
|
695
366
|
member: new Member(detail.Member ? detail.Member : null),
|
696
367
|
authCode: detail.Password ? detail.Password : null,
|
697
368
|
balance: balanceAmount,
|
@@ -699,7 +370,7 @@ var SettlementStore = (_class = function () {
|
|
699
370
|
meStorageCardId: meStorageCardId ? meStorageCardId : detail.MeStorageCardId,
|
700
371
|
storageCardNo: storageCardNo ? storageCardNo : detail.StorageCardNo
|
701
372
|
});
|
702
|
-
|
373
|
+
_this4.paymode.thePaymodes.push(newmode);
|
703
374
|
});
|
704
375
|
this.paymode.calcReserved();
|
705
376
|
}
|
@@ -721,10 +392,10 @@ var SettlementStore = (_class = function () {
|
|
721
392
|
}, {
|
722
393
|
key: 'changeFocusAndAddPay',
|
723
394
|
value: function changeFocusAndAddPay(type, bookType) {
|
724
|
-
var
|
395
|
+
var _this5 = this;
|
725
396
|
|
726
|
-
var _enumController$
|
727
|
-
PayStyle = _enumController$
|
397
|
+
var _enumController$getEn3 = _mutantsUtil.enumController.getEnumOj(),
|
398
|
+
PayStyle = _enumController$getEn3.PayStyle;
|
728
399
|
|
729
400
|
this.paymode.currentFocus = type;
|
730
401
|
if (this.paymode.currentMode) {
|
@@ -740,16 +411,16 @@ var SettlementStore = (_class = function () {
|
|
740
411
|
}
|
741
412
|
|
742
413
|
//抵现积分
|
743
|
-
|
414
|
+
this.SettlementApi.CalculdateIntegralSteadCash({ IntegralSteadCashParams: {
|
744
415
|
Idmember: this.paymode.currentMode.memberId,
|
745
416
|
TotalTaxAmount: this.paymode.amount,
|
746
417
|
BalanceTaxAmount: this.paymode.currentMode.value
|
747
|
-
} }
|
418
|
+
} }).then(function (result) {
|
748
419
|
// this.paymode.currentMode.steadCashIntegral=result.Integral;
|
749
420
|
// this.paymode.currentMode.perIntegral=result.perIntegral;
|
750
421
|
// this.paymode.currentMode.cashAmount=result.cashAmount;
|
751
|
-
|
752
|
-
|
422
|
+
_this5.paymode.currentMode.integralCashOverOrderAmount = result.isIntegralCashOverOrderAmount;
|
423
|
+
_this5.paymode.currentMode.overchargesAmount = result.Amount - _this5.paymode.currentMode.value;
|
753
424
|
});
|
754
425
|
} else {
|
755
426
|
this.addPayDirectly(this.paymode.currentMode);
|
@@ -772,52 +443,51 @@ var SettlementStore = (_class = function () {
|
|
772
443
|
}, {
|
773
444
|
key: 'loadCzk',
|
774
445
|
value: function loadCzk(v, returnType) {
|
775
|
-
var
|
446
|
+
var _this6 = this;
|
776
447
|
|
777
448
|
if ((0, _trim3.default)(v) === "") {
|
778
449
|
(0, _mobx.runInAction)(function () {
|
779
|
-
|
450
|
+
_this6.paymode.currentMode.errinfo = "请输入储值卡";
|
780
451
|
});
|
781
452
|
return;
|
782
453
|
}
|
783
454
|
var isOnlyEnabled = returnType ? false : true; //非原单退货为false,其他true
|
784
|
-
|
785
|
-
|
786
|
-
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(result) {
|
455
|
+
return this.SettlementApi.getCardInfoByCardNo(v, isOnlyEnabled).then(function () {
|
456
|
+
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(result) {
|
787
457
|
var data, m;
|
788
|
-
return _regenerator2.default.wrap(function
|
458
|
+
return _regenerator2.default.wrap(function _callee$(_context) {
|
789
459
|
while (1) {
|
790
|
-
switch (
|
460
|
+
switch (_context.prev = _context.next) {
|
791
461
|
case 0:
|
792
462
|
data = result.data;
|
793
463
|
m = data && data.length && data[0];
|
794
464
|
|
795
465
|
if (!(result && result.data.length)) {
|
796
|
-
|
466
|
+
_context.next = 25;
|
797
467
|
break;
|
798
468
|
}
|
799
469
|
|
800
470
|
if (!(result.data.length === 1)) {
|
801
|
-
|
471
|
+
_context.next = 14;
|
802
472
|
break;
|
803
473
|
}
|
804
474
|
|
805
475
|
if (!(m.CardTypeEnum === 'BALANCE_CARD')) {
|
806
|
-
|
476
|
+
_context.next = 10;
|
807
477
|
break;
|
808
478
|
}
|
809
479
|
|
810
|
-
|
811
|
-
|
812
|
-
return
|
480
|
+
_this6.paymode.updateCardInfo(m);
|
481
|
+
_this6.handleCzkData(m);
|
482
|
+
return _context.abrupt('return', result.data);
|
813
483
|
|
814
484
|
case 10:
|
815
|
-
|
816
|
-
return
|
485
|
+
_context.next = 12;
|
486
|
+
return _this6.SettlementApi.validateRetailStorageCard({ dto: _this6.dto, meStorageCardId: m.MeStorageCardId }).then(function (result1) {
|
817
487
|
var data1 = result1.data ? JSON.parse(result1.data)[0] : {};
|
818
488
|
if (data1.enable) {
|
819
|
-
|
820
|
-
|
489
|
+
_this6.paymode.updateCardInfo(m);
|
490
|
+
_this6.handleCzkData(m);
|
821
491
|
return result1.data;
|
822
492
|
} else {
|
823
493
|
_message2.default.warn(data1.disableReason);
|
@@ -825,40 +495,40 @@ var SettlementStore = (_class = function () {
|
|
825
495
|
});
|
826
496
|
|
827
497
|
case 12:
|
828
|
-
|
498
|
+
_context.next = 25;
|
829
499
|
break;
|
830
500
|
|
831
501
|
case 14:
|
832
502
|
if (!(result.data && result.data.length === 1)) {
|
833
|
-
|
503
|
+
_context.next = 19;
|
834
504
|
break;
|
835
505
|
}
|
836
506
|
|
837
|
-
|
838
|
-
return
|
507
|
+
_this6.paymode.updateCardInfo(result.data[0]);
|
508
|
+
return _context.abrupt('return', result.data);
|
839
509
|
|
840
510
|
case 19:
|
841
511
|
if (!(result.data && result.data.length > 1)) {
|
842
|
-
|
512
|
+
_context.next = 23;
|
843
513
|
break;
|
844
514
|
}
|
845
515
|
|
846
|
-
return
|
516
|
+
return _context.abrupt('return', result.data);
|
847
517
|
|
848
518
|
case 23:
|
849
519
|
_message2.default.warn('没有可用储值卡!');
|
850
|
-
return
|
520
|
+
return _context.abrupt('return', false);
|
851
521
|
|
852
522
|
case 25:
|
853
523
|
case 'end':
|
854
|
-
return
|
524
|
+
return _context.stop();
|
855
525
|
}
|
856
526
|
}
|
857
|
-
},
|
527
|
+
}, _callee, _this6);
|
858
528
|
}));
|
859
529
|
|
860
|
-
return function (
|
861
|
-
return
|
530
|
+
return function (_x) {
|
531
|
+
return _ref4.apply(this, arguments);
|
862
532
|
};
|
863
533
|
}());
|
864
534
|
}
|
@@ -894,8 +564,8 @@ var SettlementStore = (_class = function () {
|
|
894
564
|
}, {
|
895
565
|
key: 'setCurrentMode',
|
896
566
|
value: function setCurrentMode(id, type, append) {
|
897
|
-
var _enumController$
|
898
|
-
PayStyle = _enumController$
|
567
|
+
var _enumController$getEn4 = _mutantsUtil.enumController.getEnumOj(),
|
568
|
+
PayStyle = _enumController$getEn4.PayStyle;
|
899
569
|
|
900
570
|
var mode = (0, _find3.default)(this.paymode.thePaymodes, { paymethodId: id });
|
901
571
|
if (mode) {
|
@@ -911,10 +581,10 @@ var SettlementStore = (_class = function () {
|
|
911
581
|
}, {
|
912
582
|
key: 'afterSetCurrentMode',
|
913
583
|
value: function afterSetCurrentMode(type) {
|
914
|
-
var
|
584
|
+
var _this7 = this;
|
915
585
|
|
916
|
-
var _enumController$
|
917
|
-
PayStyle = _enumController$
|
586
|
+
var _enumController$getEn5 = _mutantsUtil.enumController.getEnumOj(),
|
587
|
+
PayStyle = _enumController$getEn5.PayStyle;
|
918
588
|
|
919
589
|
if (type == PayStyle.djq) {
|
920
590
|
this.paymode.calcDjqValue();
|
@@ -946,19 +616,19 @@ var SettlementStore = (_class = function () {
|
|
946
616
|
value = this.paymode.amount;
|
947
617
|
}
|
948
618
|
|
949
|
-
|
619
|
+
this.SettlementApi.CalculdateIntegralSteadCash({ IntegralSteadCashParams: {
|
950
620
|
Idmember: this.paymode.currentMode.memberId,
|
951
621
|
TotalTaxAmount: value,
|
952
622
|
BalanceTaxAmount: value
|
953
|
-
} }
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
if (
|
623
|
+
} }).then(function (result) {
|
624
|
+
_this7.paymode.currentMode.member.setExchangable(result.MaxAmount);
|
625
|
+
_this7.paymode.currentMode.perIntegral = result.perIntegral;
|
626
|
+
_this7.paymode.currentMode.cashAmount = result.cashAmount;
|
627
|
+
_this7.paymode.currentMode.integralCashOverOrderAmount = result.isIntegralCashOverOrderAmount;
|
628
|
+
_this7.updateEvent();
|
629
|
+
if (_this7.checkReceived(_this7.paymode.currentMode, "exchangable")) {
|
960
630
|
(0, _mobx.runInAction)(function () {
|
961
|
-
|
631
|
+
_this7.paymode.currentMode.errinfo = '余额不足';
|
962
632
|
});
|
963
633
|
}
|
964
634
|
});
|
@@ -972,8 +642,8 @@ var SettlementStore = (_class = function () {
|
|
972
642
|
}, {
|
973
643
|
key: 'genNewMode',
|
974
644
|
value: function genNewMode(type, notwithm, v, isQuick) {
|
975
|
-
var _enumController$
|
976
|
-
PayStyle = _enumController$
|
645
|
+
var _enumController$getEn6 = _mutantsUtil.enumController.getEnumOj(),
|
646
|
+
PayStyle = _enumController$getEn6.PayStyle;
|
977
647
|
|
978
648
|
var value = (0, _utils.getFixedNumber)(v || (this.brefund ? this.paymode.receivable : Math.max(this.paymode.receivable, 0)));
|
979
649
|
var themode = (0, _find3.default)(this.paymode.paymodes, { 'paymentType': type });
|
@@ -1019,10 +689,10 @@ var SettlementStore = (_class = function () {
|
|
1019
689
|
}, {
|
1020
690
|
key: 'setMaxAmount',
|
1021
691
|
value: function setMaxAmount(type, mode) {
|
1022
|
-
var
|
692
|
+
var _this8 = this;
|
1023
693
|
|
1024
|
-
var _enumController$
|
1025
|
-
PayStyle = _enumController$
|
694
|
+
var _enumController$getEn7 = _mutantsUtil.enumController.getEnumOj(),
|
695
|
+
PayStyle = _enumController$getEn7.PayStyle;
|
1026
696
|
|
1027
697
|
var sum = 0;
|
1028
698
|
if (type == PayStyle.hyczk) {
|
@@ -1043,16 +713,16 @@ var SettlementStore = (_class = function () {
|
|
1043
713
|
(0, _mobx.runInAction)(function () {
|
1044
714
|
|
1045
715
|
//预售储值结算应包含运费
|
1046
|
-
var BuyerPayFreight =
|
1047
|
-
var DistributionMode =
|
716
|
+
var BuyerPayFreight = _this8.dto.BuyerPayFreight;
|
717
|
+
var DistributionMode = _this8.dto.DistributionMode;
|
1048
718
|
var value = 0;
|
1049
719
|
if ((DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && BuyerPayFreight && BuyerPayFreight > 0 && type == PayStyle.hyczk) {
|
1050
|
-
value = (0, _utils.getFixedNumber)(parseFloat(
|
720
|
+
value = (0, _utils.getFixedNumber)(parseFloat(_this8.context.viewModel.getViewItem('Voucher').availableAmount) + parseFloat(BuyerPayFreight));
|
1051
721
|
} else {
|
1052
|
-
value =
|
722
|
+
value = _this8.context.viewModel.getViewItem('Voucher').availableAmount;
|
1053
723
|
}
|
1054
724
|
mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(value, sum));
|
1055
|
-
|
725
|
+
_this8.updateEvent();
|
1056
726
|
});
|
1057
727
|
});
|
1058
728
|
}
|
@@ -1099,8 +769,8 @@ var SettlementStore = (_class = function () {
|
|
1099
769
|
}, {
|
1100
770
|
key: 'addPayDirectly',
|
1101
771
|
value: function addPayDirectly(pay) {
|
1102
|
-
var _enumController$
|
1103
|
-
PayStyle = _enumController$
|
772
|
+
var _enumController$getEn8 = _mutantsUtil.enumController.getEnumOj(),
|
773
|
+
PayStyle = _enumController$getEn8.PayStyle;
|
1104
774
|
|
1105
775
|
if (!(0, _find3.default)(this.paymode.thePaymodes, { paymethodId: pay.paymethodId })) {
|
1106
776
|
var pos = this.paymode.thePaymodes.length;
|
@@ -1118,8 +788,8 @@ var SettlementStore = (_class = function () {
|
|
1118
788
|
}, {
|
1119
789
|
key: 'addPay',
|
1120
790
|
value: function addPay(type, bookType, isQuick) {
|
1121
|
-
var _enumController$
|
1122
|
-
PayStyle = _enumController$
|
791
|
+
var _enumController$getEn9 = _mutantsUtil.enumController.getEnumOj(),
|
792
|
+
PayStyle = _enumController$getEn9.PayStyle;
|
1123
793
|
|
1124
794
|
var pos = this.paymode.thePaymodes.length;
|
1125
795
|
if (type == PayStyle.hyczk) {
|
@@ -1134,8 +804,8 @@ var SettlementStore = (_class = function () {
|
|
1134
804
|
}, {
|
1135
805
|
key: 'delPay',
|
1136
806
|
value: function delPay(index, bookType) {
|
1137
|
-
var _enumController$
|
1138
|
-
PayStyle = _enumController$
|
807
|
+
var _enumController$getEn10 = _mutantsUtil.enumController.getEnumOj(),
|
808
|
+
PayStyle = _enumController$getEn10.PayStyle;
|
1139
809
|
|
1140
810
|
(0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
|
1141
811
|
return mode.paymethodId === index;
|
@@ -1149,26 +819,26 @@ var SettlementStore = (_class = function () {
|
|
1149
819
|
}, {
|
1150
820
|
key: 'findStorageBillValidate',
|
1151
821
|
value: function findStorageBillValidate() {
|
1152
|
-
var
|
822
|
+
var _this9 = this;
|
1153
823
|
|
1154
|
-
var _enumController$
|
1155
|
-
PayStyle = _enumController$
|
824
|
+
var _enumController$getEn11 = _mutantsUtil.enumController.getEnumOj(),
|
825
|
+
PayStyle = _enumController$getEn11.PayStyle;
|
1156
826
|
|
1157
827
|
(0, _mobx.runInAction)(function () {
|
1158
|
-
|
1159
|
-
var thePaymodes =
|
828
|
+
_this9.dto.StorageMutiSettleDetails = [];
|
829
|
+
var thePaymodes = _this9.newStyle ? (0, _filter3.default)(_this9.paymode.thePaymodes, function (mode) {
|
1160
830
|
return parseFloat(mode.value) != 0;
|
1161
|
-
}) :
|
831
|
+
}) : _this9.paymode.thePaymodes;
|
1162
832
|
(0, _each3.default)(thePaymodes, function (mode) {
|
1163
|
-
var themode = (0, _find3.default)(
|
833
|
+
var themode = (0, _find3.default)(_this9.paymode.paymodes, { 'paymentType': mode.paymentType });
|
1164
834
|
|
1165
835
|
var value = parseFloat(mode.value);
|
1166
836
|
var giveChange = null;
|
1167
|
-
if (mode.paymentType == PayStyle.xianjin &&
|
1168
|
-
value = Math.Add(value,
|
1169
|
-
giveChange = Math.abs(
|
837
|
+
if (mode.paymentType == PayStyle.xianjin && _this9.paymode.receivable < 0 && value > Math.abs(_this9.paymode.receivable)) {
|
838
|
+
value = Math.Add(value, _this9.paymode.receivable);
|
839
|
+
giveChange = Math.abs(_this9.paymode.receivable);
|
1170
840
|
}
|
1171
|
-
|
841
|
+
_this9.dto.StorageMutiSettleDetails.push({
|
1172
842
|
Code: mode.paymethodId,
|
1173
843
|
StorageAmount: value,
|
1174
844
|
GiveChange: giveChange,
|
@@ -1177,11 +847,11 @@ var SettlementStore = (_class = function () {
|
|
1177
847
|
PaymentCode: mode.authCode,
|
1178
848
|
DynamicPropertyKeys: [],
|
1179
849
|
DynamicPropertyValues: [],
|
1180
|
-
DataSource: { Id:
|
850
|
+
DataSource: { Id: _this9.dataSource }
|
1181
851
|
});
|
1182
852
|
});
|
1183
853
|
});
|
1184
|
-
return
|
854
|
+
return this.SettlementApi.findStorageBillValidate((0, _extends3.default)({}, this.dto));
|
1185
855
|
}
|
1186
856
|
|
1187
857
|
//判断是否重复弹框
|
@@ -1189,136 +859,136 @@ var SettlementStore = (_class = function () {
|
|
1189
859
|
}, {
|
1190
860
|
key: 'commit',
|
1191
861
|
value: function () {
|
1192
|
-
var
|
1193
|
-
var status, paylist, ret,
|
862
|
+
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
|
863
|
+
var status, paylist, ret, _ref6, _ref6$data, code, returnMsg, state, ret1, ret2;
|
1194
864
|
|
1195
|
-
return _regenerator2.default.wrap(function
|
865
|
+
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
1196
866
|
while (1) {
|
1197
|
-
switch (
|
867
|
+
switch (_context2.prev = _context2.next) {
|
1198
868
|
case 0:
|
1199
869
|
console.log('settlementStore.commit开始,参数:' + bTest);
|
1200
870
|
|
1201
871
|
if (!bTest) {
|
1202
|
-
|
872
|
+
_context2.next = 3;
|
1203
873
|
break;
|
1204
874
|
}
|
1205
875
|
|
1206
|
-
return
|
876
|
+
return _context2.abrupt('return', _promise2.default.resolve(true));
|
1207
877
|
|
1208
878
|
case 3:
|
1209
879
|
status = this.type;
|
1210
|
-
|
880
|
+
_context2.prev = 4;
|
1211
881
|
paylist = this.paymode.thePaymodes.filter(function (v) {
|
1212
882
|
return !!v.thridPayment && Math.abs(v.value) > 0;
|
1213
883
|
}) || [];
|
1214
884
|
|
1215
885
|
if (!(paylist && paylist.length > 1)) {
|
1216
|
-
|
886
|
+
_context2.next = 9;
|
1217
887
|
break;
|
1218
888
|
}
|
1219
889
|
|
1220
890
|
_message2.default.warn('二开支付目前仅支持单一结算方式。');
|
1221
|
-
return
|
891
|
+
return _context2.abrupt('return', _promise2.default.resolve(false));
|
1222
892
|
|
1223
893
|
case 9:
|
1224
894
|
if (!(status == 1)) {
|
1225
|
-
|
895
|
+
_context2.next = 31;
|
1226
896
|
break;
|
1227
897
|
}
|
1228
898
|
|
1229
|
-
|
899
|
+
_context2.next = 12;
|
1230
900
|
return this.findStorageBillValidate();
|
1231
901
|
|
1232
902
|
case 12:
|
1233
|
-
ret =
|
1234
|
-
|
1235
|
-
|
1236
|
-
code =
|
903
|
+
ret = _context2.sent;
|
904
|
+
_ref6 = ret || {}, _ref6$data = _ref6.data;
|
905
|
+
_ref6$data = _ref6$data === undefined ? {} : _ref6$data;
|
906
|
+
code = _ref6$data.code, returnMsg = _ref6$data.returnMsg;
|
1237
907
|
|
1238
908
|
if (!(code && code == 10001)) {
|
1239
|
-
|
909
|
+
_context2.next = 24;
|
1240
910
|
break;
|
1241
911
|
}
|
1242
912
|
|
1243
|
-
|
913
|
+
_context2.next = 19;
|
1244
914
|
return this.repeatStorageModal(returnMsg);
|
1245
915
|
|
1246
916
|
case 19:
|
1247
|
-
state =
|
917
|
+
state = _context2.sent;
|
1248
918
|
|
1249
919
|
if (!(state === false)) {
|
1250
|
-
|
920
|
+
_context2.next = 22;
|
1251
921
|
break;
|
1252
922
|
}
|
1253
923
|
|
1254
|
-
return
|
924
|
+
return _context2.abrupt('return', _promise2.default.resolve(false));
|
1255
925
|
|
1256
926
|
case 22:
|
1257
|
-
|
927
|
+
_context2.next = 29;
|
1258
928
|
break;
|
1259
929
|
|
1260
930
|
case 24:
|
1261
|
-
|
931
|
+
_context2.next = 26;
|
1262
932
|
return this.saveMember();
|
1263
933
|
|
1264
934
|
case 26:
|
1265
|
-
ret1 =
|
935
|
+
ret1 = _context2.sent;
|
1266
936
|
|
1267
937
|
if (!(ret1 === false)) {
|
1268
|
-
|
938
|
+
_context2.next = 29;
|
1269
939
|
break;
|
1270
940
|
}
|
1271
941
|
|
1272
|
-
return
|
942
|
+
return _context2.abrupt('return', _promise2.default.resolve(false));
|
1273
943
|
|
1274
944
|
case 29:
|
1275
|
-
|
945
|
+
_context2.next = 40;
|
1276
946
|
break;
|
1277
947
|
|
1278
948
|
case 31:
|
1279
|
-
|
949
|
+
_context2.next = 33;
|
1280
950
|
return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
|
1281
951
|
|
1282
952
|
case 33:
|
1283
|
-
|
953
|
+
_context2.next = 35;
|
1284
954
|
return this.save();
|
1285
955
|
|
1286
956
|
case 35:
|
1287
|
-
ret2 =
|
957
|
+
ret2 = _context2.sent;
|
1288
958
|
|
1289
959
|
if (!(ret2 === false)) {
|
1290
|
-
|
960
|
+
_context2.next = 38;
|
1291
961
|
break;
|
1292
962
|
}
|
1293
963
|
|
1294
|
-
return
|
964
|
+
return _context2.abrupt('return', _promise2.default.resolve(false));
|
1295
965
|
|
1296
966
|
case 38:
|
1297
|
-
|
967
|
+
_context2.next = 40;
|
1298
968
|
return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
|
1299
969
|
|
1300
970
|
case 40:
|
1301
|
-
return
|
971
|
+
return _context2.abrupt('return', _promise2.default.resolve(true));
|
1302
972
|
|
1303
973
|
case 43:
|
1304
|
-
|
1305
|
-
|
974
|
+
_context2.prev = 43;
|
975
|
+
_context2.t0 = _context2['catch'](4);
|
1306
976
|
|
1307
|
-
console.error('settlementStore.commit失败,错误信息:' +
|
977
|
+
console.error('settlementStore.commit失败,错误信息:' + _context2.t0);
|
1308
978
|
//其他支付失败时,处理二开支付情况。
|
1309
979
|
this.thirdPayRefund(status == 1 ? 2 : 1);
|
1310
|
-
return
|
980
|
+
return _context2.abrupt('return', _promise2.default.resolve(_context2.t0));
|
1311
981
|
|
1312
982
|
case 48:
|
1313
983
|
case 'end':
|
1314
|
-
return
|
984
|
+
return _context2.stop();
|
1315
985
|
}
|
1316
986
|
}
|
1317
|
-
},
|
987
|
+
}, _callee2, this, [[4, 43]]);
|
1318
988
|
}));
|
1319
989
|
|
1320
|
-
function commit(
|
1321
|
-
return
|
990
|
+
function commit(_x2) {
|
991
|
+
return _ref5.apply(this, arguments);
|
1322
992
|
}
|
1323
993
|
|
1324
994
|
return commit;
|
@@ -1332,32 +1002,32 @@ var SettlementStore = (_class = function () {
|
|
1332
1002
|
}, {
|
1333
1003
|
key: 'saveMember',
|
1334
1004
|
value: function () {
|
1335
|
-
var
|
1336
|
-
var
|
1005
|
+
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
|
1006
|
+
var _this10 = this;
|
1337
1007
|
|
1338
|
-
var _enumController$
|
1008
|
+
var _enumController$getEn12, PayStyle, TradeType, IPMSG, dtoParams, payList, payment, tradeType, ret, _ref8, type, data, msg, code;
|
1339
1009
|
|
1340
|
-
return _regenerator2.default.wrap(function
|
1010
|
+
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
1341
1011
|
while (1) {
|
1342
|
-
switch (
|
1012
|
+
switch (_context3.prev = _context3.next) {
|
1343
1013
|
case 0:
|
1344
|
-
_enumController$
|
1014
|
+
_enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn12.PayStyle, TradeType = _enumController$getEn12.TradeType;
|
1345
1015
|
|
1346
1016
|
(0, _mobx.runInAction)(function () {
|
1347
|
-
|
1348
|
-
var thePaymodes =
|
1017
|
+
_this10.dto.StorageMutiSettleDetails = [];
|
1018
|
+
var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
|
1349
1019
|
return parseFloat(mode.value) != 0;
|
1350
|
-
}) :
|
1020
|
+
}) : _this10.paymode.thePaymodes;
|
1351
1021
|
(0, _each3.default)(thePaymodes, function (mode) {
|
1352
|
-
var themode = (0, _find3.default)(
|
1022
|
+
var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
|
1353
1023
|
|
1354
1024
|
var value = parseFloat(mode.value);
|
1355
1025
|
var giveChange = null;
|
1356
|
-
if (mode.paymentType == PayStyle.xianjin &&
|
1357
|
-
value = Math.Add(value,
|
1358
|
-
giveChange = Math.abs(
|
1026
|
+
if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
|
1027
|
+
value = Math.Add(value, _this10.paymode.receivable);
|
1028
|
+
giveChange = Math.abs(_this10.paymode.receivable);
|
1359
1029
|
}
|
1360
|
-
|
1030
|
+
_this10.dto.StorageMutiSettleDetails.push({
|
1361
1031
|
Code: mode.paymethodId,
|
1362
1032
|
StorageAmount: value,
|
1363
1033
|
GiveChange: giveChange,
|
@@ -1366,7 +1036,7 @@ var SettlementStore = (_class = function () {
|
|
1366
1036
|
PaymentCode: mode.authCode,
|
1367
1037
|
DynamicPropertyKeys: [],
|
1368
1038
|
DynamicPropertyValues: [],
|
1369
|
-
DataSource: { Id:
|
1039
|
+
DataSource: { Id: _this10.dataSource },
|
1370
1040
|
ThirdPaymentInfo: themode.thridPayment || null,
|
1371
1041
|
ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
|
1372
1042
|
});
|
@@ -1386,49 +1056,49 @@ var SettlementStore = (_class = function () {
|
|
1386
1056
|
});
|
1387
1057
|
|
1388
1058
|
if (!(payList && payList.length > 0)) {
|
1389
|
-
|
1059
|
+
_context3.next = 19;
|
1390
1060
|
break;
|
1391
1061
|
}
|
1392
1062
|
|
1393
1063
|
payment = payList[0];
|
1394
1064
|
tradeType = payment && payment.StorageAmount > 0 ? TradeType.PAY : TradeType.REFUND;
|
1395
|
-
|
1065
|
+
_context3.next = 11;
|
1396
1066
|
return this.thirdPay(2, payment, tradeType, dtoParams);
|
1397
1067
|
|
1398
1068
|
case 11:
|
1399
|
-
ret =
|
1400
|
-
|
1069
|
+
ret = _context3.sent;
|
1070
|
+
_ref8 = ret || {}, type = _ref8.type, data = _ref8.data, msg = _ref8.msg, code = _ref8.code;
|
1401
1071
|
|
1402
1072
|
if (!(type === true)) {
|
1403
|
-
|
1073
|
+
_context3.next = 17;
|
1404
1074
|
break;
|
1405
1075
|
}
|
1406
1076
|
|
1407
1077
|
dtoParams = data;
|
1408
|
-
|
1078
|
+
_context3.next = 19;
|
1409
1079
|
break;
|
1410
1080
|
|
1411
1081
|
case 17:
|
1412
1082
|
_message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
|
1413
|
-
return
|
1083
|
+
return _context3.abrupt('return', false);
|
1414
1084
|
|
1415
1085
|
case 19:
|
1416
1086
|
this.dtoParams = dtoParams;
|
1417
1087
|
console.log('储值结算信息:', dtoParams);
|
1418
|
-
return
|
1419
|
-
|
1088
|
+
return _context3.abrupt('return', this.SettlementApi.INewRetailMemberStorageSave({ dto: dtoParams }).then(function (resp) {
|
1089
|
+
_this10.handlePrint(resp);
|
1420
1090
|
}));
|
1421
1091
|
|
1422
1092
|
case 22:
|
1423
1093
|
case 'end':
|
1424
|
-
return
|
1094
|
+
return _context3.stop();
|
1425
1095
|
}
|
1426
1096
|
}
|
1427
|
-
},
|
1097
|
+
}, _callee3, this);
|
1428
1098
|
}));
|
1429
1099
|
|
1430
1100
|
function saveMember() {
|
1431
|
-
return
|
1101
|
+
return _ref7.apply(this, arguments);
|
1432
1102
|
}
|
1433
1103
|
|
1434
1104
|
return saveMember;
|
@@ -1436,31 +1106,31 @@ var SettlementStore = (_class = function () {
|
|
1436
1106
|
}, {
|
1437
1107
|
key: 'save',
|
1438
1108
|
value: function () {
|
1439
|
-
var
|
1440
|
-
var
|
1109
|
+
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
|
1110
|
+
var _this11 = this;
|
1441
1111
|
|
1442
|
-
var _enumController$
|
1112
|
+
var _enumController$getEn13, PayStyle, TradeType, IPMSG, RetailTypeEnum, _getLoginInfo3, PreSellOrBook, PercentageWhenBook, _ref10, IdbusiType, DistributionMode, prepaidAmount, fullPayment, dtoParams, payList, payment, tradeType, ret, _ref11, type, data, msg, code;
|
1443
1113
|
|
1444
|
-
return _regenerator2.default.wrap(function
|
1114
|
+
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
1445
1115
|
while (1) {
|
1446
|
-
switch (
|
1116
|
+
switch (_context4.prev = _context4.next) {
|
1447
1117
|
case 0:
|
1448
|
-
_enumController$
|
1118
|
+
_enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn13.PayStyle, TradeType = _enumController$getEn13.TradeType;
|
1449
1119
|
|
1450
1120
|
(0, _mobx.runInAction)(function () {
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1121
|
+
_this11.dto.RetailPaymentDetails = [];
|
1122
|
+
_this11.dto.RetailStorageDetails = [];
|
1123
|
+
_this11.dto.RetailCouponDetails = [];
|
1454
1124
|
var czkSum = 0;
|
1455
1125
|
var count = 0;
|
1456
|
-
var thePaymodes =
|
1126
|
+
var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
|
1457
1127
|
return parseFloat(mode.value) != 0;
|
1458
|
-
}) :
|
1128
|
+
}) : _this11.paymode.thePaymodes;
|
1459
1129
|
(0, _each3.default)(thePaymodes, function (mode, index) {
|
1460
|
-
var themode = (0, _find3.default)(
|
1130
|
+
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
|
1461
1131
|
if (mode.paymentType == PayStyle.hyczk) {
|
1462
1132
|
czkSum = Math.Add(czkSum, mode.value);
|
1463
|
-
|
1133
|
+
_this11.dto.RetailStorageDetails.push({
|
1464
1134
|
Code: mode.paymethodId,
|
1465
1135
|
MeStorageCardId: mode.meStorageCardId,
|
1466
1136
|
StoragePaymentAmount: mode.value,
|
@@ -1469,17 +1139,17 @@ var SettlementStore = (_class = function () {
|
|
1469
1139
|
Idmember: mode.memberId,
|
1470
1140
|
DynamicPropertyKeys: [],
|
1471
1141
|
DynamicPropertyValues: [],
|
1472
|
-
DataSource: { Id:
|
1142
|
+
DataSource: { Id: _this11.dataSource },
|
1473
1143
|
Password: mode.authCode
|
1474
1144
|
});
|
1475
1145
|
} else {
|
1476
1146
|
var value = parseFloat(mode.value);
|
1477
1147
|
var giveChange = null;
|
1478
|
-
if (mode.paymentType == PayStyle.xianjin &&
|
1479
|
-
value = Math.Add(value,
|
1480
|
-
giveChange = Math.abs(
|
1148
|
+
if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
|
1149
|
+
value = Math.Add(value, _this11.paymode.receivable);
|
1150
|
+
giveChange = Math.abs(_this11.paymode.receivable);
|
1481
1151
|
}
|
1482
|
-
|
1152
|
+
_this11.dto.RetailPaymentDetails.push({
|
1483
1153
|
Code: mode.paymethodId,
|
1484
1154
|
OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
|
1485
1155
|
Amount: value,
|
@@ -1493,14 +1163,14 @@ var SettlementStore = (_class = function () {
|
|
1493
1163
|
OverchargesAmount: mode.overchargesAmount,
|
1494
1164
|
DynamicPropertyKeys: [],
|
1495
1165
|
DynamicPropertyValues: [],
|
1496
|
-
DataSource: { Id:
|
1166
|
+
DataSource: { Id: _this11.dataSource },
|
1497
1167
|
ThirdPaymentInfo: themode.thridPayment || null,
|
1498
1168
|
SettleStyle: { Name: mode.name },
|
1499
1169
|
ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
|
1500
1170
|
});
|
1501
1171
|
if (mode.paymentType == PayStyle.djq) {
|
1502
|
-
(0, _each3.default)(
|
1503
|
-
|
1172
|
+
(0, _each3.default)(_this11.paymode.checkList && _this11.paymode.checkList.length ? _this11.paymode.checkList : mode.djqs, function (djq) {
|
1173
|
+
_this11.dto.RetailCouponDetails.push({
|
1504
1174
|
CouponCode: djq.promoCouponCode,
|
1505
1175
|
ReductionAmount: djq.amount,
|
1506
1176
|
EnableAmount: djq.doorsill,
|
@@ -1510,24 +1180,24 @@ var SettlementStore = (_class = function () {
|
|
1510
1180
|
PromotionId: djq.promoId,
|
1511
1181
|
PromotionRuleId: djq.promoRuleId,
|
1512
1182
|
PromoCouponAllocatedId: djq.id,
|
1513
|
-
DataSource: { Id:
|
1183
|
+
DataSource: { Id: _this11.dataSource }
|
1514
1184
|
});
|
1515
1185
|
});
|
1516
1186
|
}
|
1517
1187
|
}
|
1518
1188
|
});
|
1519
|
-
if (
|
1520
|
-
var themode = (0, _find3.default)(
|
1521
|
-
|
1522
|
-
Code:
|
1189
|
+
if (_this11.dto.RetailStorageDetails.length > 0) {
|
1190
|
+
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
|
1191
|
+
_this11.dto.RetailPaymentDetails.push({
|
1192
|
+
Code: _this11.paymode.counter,
|
1523
1193
|
OrigAmount: czkSum,
|
1524
1194
|
Amount: czkSum,
|
1525
1195
|
IdsettleStyle: themode.idSettleStyle,
|
1526
1196
|
IdbankAccount: themode.idBankAccount,
|
1527
1197
|
DynamicPropertyKeys: [],
|
1528
1198
|
DynamicPropertyValues: [],
|
1529
|
-
DataSource: { Id:
|
1530
|
-
RetailStorageDetails:
|
1199
|
+
DataSource: { Id: _this11.dataSource },
|
1200
|
+
RetailStorageDetails: _this11.dto.RetailStorageDetails
|
1531
1201
|
});
|
1532
1202
|
}
|
1533
1203
|
});
|
@@ -1540,7 +1210,7 @@ var SettlementStore = (_class = function () {
|
|
1540
1210
|
}
|
1541
1211
|
RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
|
1542
1212
|
_getLoginInfo3 = this.getLoginInfo(), PreSellOrBook = _getLoginInfo3.PreSellOrBook, PercentageWhenBook = _getLoginInfo3.PercentageWhenBook;
|
1543
|
-
|
1213
|
+
_ref10 = this.dto || {}, IdbusiType = _ref10.IdbusiType, DistributionMode = _ref10.DistributionMode;
|
1544
1214
|
|
1545
1215
|
if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
|
1546
1216
|
prepaidAmount = (0, _utils.getFixedNumber)(this.dto.RetailPaymentDetails.reduce(function (c, item) {
|
@@ -1552,35 +1222,35 @@ var SettlementStore = (_class = function () {
|
|
1552
1222
|
|
1553
1223
|
this.isFull = fullPayment == prepaidAmount; // 是否全款
|
1554
1224
|
(0, _mobx.runInAction)(function () {
|
1555
|
-
|
1225
|
+
_this11.dto.PrepaidAmount = prepaidAmount;
|
1556
1226
|
});
|
1557
1227
|
}
|
1558
|
-
|
1228
|
+
_context4.t1 = this.dto.IdbusiType == 37;
|
1559
1229
|
|
1560
|
-
if (!
|
1561
|
-
|
1230
|
+
if (!_context4.t1) {
|
1231
|
+
_context4.next = 14;
|
1562
1232
|
break;
|
1563
1233
|
}
|
1564
1234
|
|
1565
|
-
|
1235
|
+
_context4.next = 13;
|
1566
1236
|
return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
|
1567
1237
|
|
1568
1238
|
case 13:
|
1569
|
-
|
1239
|
+
_context4.t1 = _context4.sent;
|
1570
1240
|
|
1571
1241
|
case 14:
|
1572
|
-
|
1242
|
+
_context4.t0 = _context4.t1;
|
1573
1243
|
|
1574
|
-
if (
|
1575
|
-
|
1244
|
+
if (_context4.t0) {
|
1245
|
+
_context4.next = 17;
|
1576
1246
|
break;
|
1577
1247
|
}
|
1578
1248
|
|
1579
|
-
|
1249
|
+
_context4.t0 = this.dto.IdbusiType != 37;
|
1580
1250
|
|
1581
1251
|
case 17:
|
1582
|
-
if (!
|
1583
|
-
|
1252
|
+
if (!_context4.t0) {
|
1253
|
+
_context4.next = 36;
|
1584
1254
|
break;
|
1585
1255
|
}
|
1586
1256
|
|
@@ -1592,54 +1262,59 @@ var SettlementStore = (_class = function () {
|
|
1592
1262
|
});
|
1593
1263
|
|
1594
1264
|
if (!(payList && payList.length > 0)) {
|
1595
|
-
|
1265
|
+
_context4.next = 33;
|
1596
1266
|
break;
|
1597
1267
|
}
|
1598
1268
|
|
1599
1269
|
payment = payList[0];
|
1600
1270
|
tradeType = payment && payment.Amount > 0 ? TradeType.PAY : TradeType.REFUND;
|
1601
|
-
|
1271
|
+
_context4.next = 25;
|
1602
1272
|
return this.thirdPay(1, payment, tradeType, dtoParams);
|
1603
1273
|
|
1604
1274
|
case 25:
|
1605
|
-
ret =
|
1606
|
-
|
1275
|
+
ret = _context4.sent;
|
1276
|
+
_ref11 = ret || {}, type = _ref11.type, data = _ref11.data, msg = _ref11.msg, code = _ref11.code;
|
1607
1277
|
|
1608
1278
|
if (!(type === true)) {
|
1609
|
-
|
1279
|
+
_context4.next = 31;
|
1610
1280
|
break;
|
1611
1281
|
}
|
1612
1282
|
|
1613
1283
|
dtoParams = data;
|
1614
|
-
|
1284
|
+
_context4.next = 33;
|
1615
1285
|
break;
|
1616
1286
|
|
1617
1287
|
case 31:
|
1618
1288
|
_message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
|
1619
|
-
return
|
1289
|
+
return _context4.abrupt('return', false);
|
1620
1290
|
|
1621
1291
|
case 33:
|
1622
1292
|
this.dtoParams = dtoParams;
|
1623
1293
|
console.log('结算信息:', dtoParams);
|
1624
|
-
return
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1294
|
+
return _context4.abrupt('return', this.SettlementApi.retailPosSettle({
|
1295
|
+
dto: dtoParams,
|
1296
|
+
cip: IPMSG.query || "",
|
1297
|
+
longitude: IPMSG.longitude || "",
|
1298
|
+
latitude: IPMSG.latitude || ""
|
1299
|
+
}).then(function (resp) {
|
1300
|
+
var _ref12 = resp || {},
|
1301
|
+
ID = _ref12.ID;
|
1302
|
+
|
1303
|
+
_this11.setDtoID(ID);
|
1304
|
+
_this11.billID = ID;
|
1305
|
+
_this11.paymode.checkList = [];
|
1631
1306
|
}));
|
1632
1307
|
|
1633
1308
|
case 36:
|
1634
1309
|
case 'end':
|
1635
|
-
return
|
1310
|
+
return _context4.stop();
|
1636
1311
|
}
|
1637
1312
|
}
|
1638
|
-
},
|
1313
|
+
}, _callee4, this);
|
1639
1314
|
}));
|
1640
1315
|
|
1641
1316
|
function save() {
|
1642
|
-
return
|
1317
|
+
return _ref9.apply(this, arguments);
|
1643
1318
|
}
|
1644
1319
|
|
1645
1320
|
return save;
|
@@ -1667,19 +1342,19 @@ var SettlementStore = (_class = function () {
|
|
1667
1342
|
}, {
|
1668
1343
|
key: 'thirdPay',
|
1669
1344
|
value: function () {
|
1670
|
-
var
|
1671
|
-
var cto, params, ret,
|
1345
|
+
var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(vType, payment, trade, dto) {
|
1346
|
+
var cto, params, ret, _ref14, Code, _Message, Result, _ref15, ThirdPaymentReturnInfo;
|
1672
1347
|
|
1673
|
-
return _regenerator2.default.wrap(function
|
1348
|
+
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
1674
1349
|
while (1) {
|
1675
|
-
switch (
|
1350
|
+
switch (_context5.prev = _context5.next) {
|
1676
1351
|
case 0:
|
1677
|
-
|
1352
|
+
_context5.prev = 0;
|
1678
1353
|
cto = this.removeThirdPayDto(dto);
|
1679
1354
|
params = { VoucherType: vType, Payment: payment, TradeType: trade, dto: cto };
|
1680
1355
|
|
1681
1356
|
console.log('刷卡信息:', (0, _stringify2.default)(params));
|
1682
|
-
|
1357
|
+
_context5.next = 6;
|
1683
1358
|
return new _promise2.default(function (resolve, reject) {
|
1684
1359
|
_mutantsMicrofx.nativeMs.setIpcRendererMethod('ThirdPayment', (0, _extends3.default)({}, params), function (res) {
|
1685
1360
|
return resolve(res);
|
@@ -1687,26 +1362,26 @@ var SettlementStore = (_class = function () {
|
|
1687
1362
|
});
|
1688
1363
|
|
1689
1364
|
case 6:
|
1690
|
-
ret =
|
1365
|
+
ret = _context5.sent;
|
1691
1366
|
|
1692
1367
|
console.log('刷卡返回信息:', ret);
|
1693
1368
|
ret = JSON.parse(ret);
|
1694
|
-
|
1369
|
+
_ref14 = ret || {}, Code = _ref14.Code, _Message = _ref14.Message, Result = _ref14.Result;
|
1695
1370
|
|
1696
1371
|
if (!(Code > 0)) {
|
1697
|
-
|
1372
|
+
_context5.next = 14;
|
1698
1373
|
break;
|
1699
1374
|
}
|
1700
1375
|
|
1701
|
-
return
|
1376
|
+
return _context5.abrupt('return', { type: false, data: null, msg: _Message, code: Code });
|
1702
1377
|
|
1703
1378
|
case 14:
|
1704
1379
|
if (!(trade == '00')) {
|
1705
|
-
|
1380
|
+
_context5.next = 20;
|
1706
1381
|
break;
|
1707
1382
|
}
|
1708
1383
|
|
1709
|
-
|
1384
|
+
_ref15 = Result || {}, ThirdPaymentReturnInfo = _ref15.ThirdPaymentReturnInfo;
|
1710
1385
|
|
1711
1386
|
if (vType == 1) {
|
1712
1387
|
dto.RetailPaymentDetails.forEach(function (v) {
|
@@ -1721,35 +1396,35 @@ var SettlementStore = (_class = function () {
|
|
1721
1396
|
}
|
1722
1397
|
});
|
1723
1398
|
}
|
1724
|
-
return
|
1399
|
+
return _context5.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
|
1725
1400
|
|
1726
1401
|
case 20:
|
1727
1402
|
if (!(trade == '02')) {
|
1728
|
-
|
1403
|
+
_context5.next = 22;
|
1729
1404
|
break;
|
1730
1405
|
}
|
1731
1406
|
|
1732
|
-
return
|
1407
|
+
return _context5.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
|
1733
1408
|
|
1734
1409
|
case 22:
|
1735
|
-
|
1410
|
+
_context5.next = 27;
|
1736
1411
|
break;
|
1737
1412
|
|
1738
1413
|
case 24:
|
1739
|
-
|
1740
|
-
|
1741
|
-
return
|
1414
|
+
_context5.prev = 24;
|
1415
|
+
_context5.t0 = _context5['catch'](0);
|
1416
|
+
return _context5.abrupt('return', { type: false, data: null, msg: _context5.t0, code: '9999' });
|
1742
1417
|
|
1743
1418
|
case 27:
|
1744
1419
|
case 'end':
|
1745
|
-
return
|
1420
|
+
return _context5.stop();
|
1746
1421
|
}
|
1747
1422
|
}
|
1748
|
-
},
|
1423
|
+
}, _callee5, this, [[0, 24]]);
|
1749
1424
|
}));
|
1750
1425
|
|
1751
|
-
function thirdPay(_x4, _x5, _x6
|
1752
|
-
return
|
1426
|
+
function thirdPay(_x3, _x4, _x5, _x6) {
|
1427
|
+
return _ref13.apply(this, arguments);
|
1753
1428
|
}
|
1754
1429
|
|
1755
1430
|
return thirdPay;
|
@@ -1760,14 +1435,14 @@ var SettlementStore = (_class = function () {
|
|
1760
1435
|
}, {
|
1761
1436
|
key: 'thirdPayRefund',
|
1762
1437
|
value: function () {
|
1763
|
-
var
|
1764
|
-
var
|
1438
|
+
var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type) {
|
1439
|
+
var _this12 = this;
|
1765
1440
|
|
1766
|
-
var dto, pay, payment, _enumController$
|
1441
|
+
var dto, pay, payment, _enumController$getEn14, TradeType;
|
1767
1442
|
|
1768
|
-
return _regenerator2.default.wrap(function
|
1443
|
+
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
1769
1444
|
while (1) {
|
1770
|
-
switch (
|
1445
|
+
switch (_context7.prev = _context7.next) {
|
1771
1446
|
case 0:
|
1772
1447
|
dto = type == 1 ? this.dtoParams.RetailPaymentDetails : this.dtoParams.StorageMutiSettleDetails;
|
1773
1448
|
pay = dto && dto.filter(function (v) {
|
@@ -1779,43 +1454,43 @@ var SettlementStore = (_class = function () {
|
|
1779
1454
|
_message2.default.warn("支付出现异常,将发起刷卡退款。", { duration: 4.5 });
|
1780
1455
|
}, 1000);
|
1781
1456
|
payment = pay[0];
|
1782
|
-
_enumController$
|
1457
|
+
_enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(), TradeType = _enumController$getEn14.TradeType;
|
1783
1458
|
|
1784
|
-
setTimeout((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function
|
1785
|
-
var ret,
|
1459
|
+
setTimeout((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
|
1460
|
+
var ret, _ref18, msg;
|
1786
1461
|
|
1787
|
-
return _regenerator2.default.wrap(function
|
1462
|
+
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
1788
1463
|
while (1) {
|
1789
|
-
switch (
|
1464
|
+
switch (_context6.prev = _context6.next) {
|
1790
1465
|
case 0:
|
1791
|
-
|
1792
|
-
return
|
1466
|
+
_context6.next = 2;
|
1467
|
+
return _this12.thirdPay(type, payment, TradeType.REFUND, dto);
|
1793
1468
|
|
1794
1469
|
case 2:
|
1795
|
-
ret =
|
1796
|
-
|
1470
|
+
ret = _context6.sent;
|
1471
|
+
_ref18 = ret || {}, msg = _ref18.msg;
|
1797
1472
|
|
1798
1473
|
console.log('\u5237\u5361\u652F\u4ED8\u9000\u6B3E:' + msg);
|
1799
1474
|
|
1800
1475
|
case 5:
|
1801
1476
|
case 'end':
|
1802
|
-
return
|
1477
|
+
return _context6.stop();
|
1803
1478
|
}
|
1804
1479
|
}
|
1805
|
-
},
|
1480
|
+
}, _callee6, _this12);
|
1806
1481
|
})), 4500);
|
1807
1482
|
}
|
1808
1483
|
|
1809
1484
|
case 3:
|
1810
1485
|
case 'end':
|
1811
|
-
return
|
1486
|
+
return _context7.stop();
|
1812
1487
|
}
|
1813
1488
|
}
|
1814
|
-
},
|
1489
|
+
}, _callee7, this);
|
1815
1490
|
}));
|
1816
1491
|
|
1817
|
-
function thirdPayRefund(
|
1818
|
-
return
|
1492
|
+
function thirdPayRefund(_x7) {
|
1493
|
+
return _ref16.apply(this, arguments);
|
1819
1494
|
}
|
1820
1495
|
|
1821
1496
|
return thirdPayRefund;
|
@@ -1828,35 +1503,35 @@ var SettlementStore = (_class = function () {
|
|
1828
1503
|
}, {
|
1829
1504
|
key: 'querySettleResult',
|
1830
1505
|
value: function () {
|
1831
|
-
var
|
1832
|
-
return _regenerator2.default.wrap(function
|
1506
|
+
var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() {
|
1507
|
+
return _regenerator2.default.wrap(function _callee8$(_context8) {
|
1833
1508
|
while (1) {
|
1834
|
-
switch (
|
1509
|
+
switch (_context8.prev = _context8.next) {
|
1835
1510
|
case 0:
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
return
|
1511
|
+
_context8.prev = 0;
|
1512
|
+
_context8.t0 = _promise2.default;
|
1513
|
+
_context8.next = 4;
|
1514
|
+
return this.SettlementApi.QuerySettleResult({ RetailCode: this.dto.Code });
|
1840
1515
|
|
1841
1516
|
case 4:
|
1842
|
-
|
1843
|
-
return
|
1517
|
+
_context8.t1 = _context8.sent;
|
1518
|
+
return _context8.abrupt('return', _context8.t0.resolve.call(_context8.t0, _context8.t1));
|
1844
1519
|
|
1845
1520
|
case 8:
|
1846
|
-
|
1847
|
-
|
1848
|
-
return
|
1521
|
+
_context8.prev = 8;
|
1522
|
+
_context8.t2 = _context8['catch'](0);
|
1523
|
+
return _context8.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
|
1849
1524
|
|
1850
1525
|
case 11:
|
1851
1526
|
case 'end':
|
1852
|
-
return
|
1527
|
+
return _context8.stop();
|
1853
1528
|
}
|
1854
1529
|
}
|
1855
|
-
},
|
1530
|
+
}, _callee8, this, [[0, 8]]);
|
1856
1531
|
}));
|
1857
1532
|
|
1858
1533
|
function querySettleResult() {
|
1859
|
-
return
|
1534
|
+
return _ref19.apply(this, arguments);
|
1860
1535
|
}
|
1861
1536
|
|
1862
1537
|
return querySettleResult;
|
@@ -1882,18 +1557,18 @@ var SettlementStore = (_class = function () {
|
|
1882
1557
|
}, {
|
1883
1558
|
key: 'validePwd',
|
1884
1559
|
value: function () {
|
1885
|
-
var
|
1886
|
-
var
|
1560
|
+
var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(value) {
|
1561
|
+
var _ref21, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, checkPaymentPasswordParams, checkPaymentPasswordId, result, count, _result;
|
1887
1562
|
|
1888
|
-
return _regenerator2.default.wrap(function
|
1563
|
+
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
1889
1564
|
while (1) {
|
1890
|
-
switch (
|
1565
|
+
switch (_context9.prev = _context9.next) {
|
1891
1566
|
case 0:
|
1892
|
-
|
1893
|
-
|
1567
|
+
_ref21 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref21.isNewRetailBCPos;
|
1568
|
+
_context9.prev = 1;
|
1894
1569
|
|
1895
1570
|
if (!isNewRetailBCPos) {
|
1896
|
-
|
1571
|
+
_context9.next = 23;
|
1897
1572
|
break;
|
1898
1573
|
}
|
1899
1574
|
|
@@ -1903,62 +1578,56 @@ var SettlementStore = (_class = function () {
|
|
1903
1578
|
memberStorageId = this.paymode.currentMode.meStorageCardId;
|
1904
1579
|
|
1905
1580
|
if (!cook2) {
|
1906
|
-
|
1581
|
+
_context9.next = 12;
|
1907
1582
|
break;
|
1908
1583
|
}
|
1909
1584
|
|
1910
1585
|
if (!cook2.hasOwnProperty(memberStorageId + "")) {
|
1911
|
-
|
1586
|
+
_context9.next = 12;
|
1912
1587
|
break;
|
1913
1588
|
}
|
1914
1589
|
|
1915
1590
|
if (!(cook2[memberStorageId] > 3)) {
|
1916
|
-
|
1591
|
+
_context9.next = 12;
|
1917
1592
|
break;
|
1918
1593
|
}
|
1919
1594
|
|
1920
1595
|
message = '今日密码错误已达上限,不可使用储值消费,请明日再试,如忘记请重置密码或修改密码。';
|
1921
|
-
return
|
1596
|
+
return _context9.abrupt('return', _promise2.default.resolve(message));
|
1922
1597
|
|
1923
1598
|
case 12:
|
1924
1599
|
_paymode$currentMode = this.paymode.currentMode, cardTypeEnum = _paymode$currentMode.cardTypeEnum, memberId = _paymode$currentMode.memberId, meStorageCardId = _paymode$currentMode.meStorageCardId, cardStatusEnum = _paymode$currentMode.cardStatusEnum;
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1600
|
+
checkPaymentPasswordParams = {};
|
1601
|
+
checkPaymentPasswordId = null;
|
1602
|
+
|
1603
|
+
if (cardTypeEnum === 'BALANCE_CARD') {
|
1604
|
+
checkPaymentPasswordParams = {
|
1605
|
+
md5Password: _tplusApi.User.pwdEncrypt(value.pwd),
|
1606
|
+
cardType: cardTypeEnum
|
1607
|
+
};
|
1608
|
+
checkPaymentPasswordId = memberId;
|
1609
|
+
} else {
|
1610
|
+
if (cardStatusEnum === 'BINDING' && this.member && this.member.ID === memberId) {
|
1611
|
+
checkPaymentPasswordParams = {
|
1612
|
+
md5Password: _tplusApi.User.pwdEncrypt(value.pwd),
|
1613
|
+
password: value.pwd,
|
1614
|
+
cardType: cardTypeEnum
|
1615
|
+
};
|
1616
|
+
checkPaymentPasswordId = meStorageCardId;
|
1617
|
+
} else {
|
1618
|
+
checkPaymentPasswordParams = {
|
1619
|
+
password: value.pwd,
|
1620
|
+
cardType: cardTypeEnum
|
1621
|
+
};
|
1622
|
+
checkPaymentPasswordId = meStorageCardId;
|
1623
|
+
}
|
1944
1624
|
}
|
1625
|
+
_context9.next = 18;
|
1626
|
+
return this.SettlementApi.checkPaymentPassword(checkPaymentPasswordParams, checkPaymentPasswordId);
|
1945
1627
|
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
case 23:
|
1950
|
-
result = _context11.sent;
|
1951
|
-
_context11.next = 29;
|
1952
|
-
break;
|
1953
|
-
|
1954
|
-
case 26:
|
1955
|
-
_context11.next = 28;
|
1956
|
-
return (0, _tplusApi.ccApi)({ password: value.pwd, cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + meStorageCardId, false, false);
|
1957
|
-
|
1958
|
-
case 28:
|
1959
|
-
result = _context11.sent;
|
1628
|
+
case 18:
|
1629
|
+
result = _context9.sent;
|
1960
1630
|
|
1961
|
-
case 29:
|
1962
1631
|
if (!result.data) {
|
1963
1632
|
if (cook2) {
|
1964
1633
|
if (cook2.hasOwnProperty(memberStorageId + "")) {
|
@@ -1975,45 +1644,386 @@ var SettlementStore = (_class = function () {
|
|
1975
1644
|
this.setCookie('errorPwd', '', -1);
|
1976
1645
|
this.setCookie('errorPwd', (0, _stringify2.default)(cook2));
|
1977
1646
|
}
|
1978
|
-
return
|
1647
|
+
return _context9.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
|
1979
1648
|
|
1980
|
-
case
|
1981
|
-
|
1982
|
-
return
|
1649
|
+
case 23:
|
1650
|
+
_context9.next = 25;
|
1651
|
+
return this.SettlementApi.CheckoutMemberPassword({ "CheckoutParams": {
|
1983
1652
|
"Idmember": value.id,
|
1984
1653
|
"Password": value.pwd
|
1985
|
-
} }
|
1654
|
+
} });
|
1986
1655
|
|
1987
|
-
case
|
1988
|
-
_result =
|
1989
|
-
return
|
1656
|
+
case 25:
|
1657
|
+
_result = _context9.sent;
|
1658
|
+
return _context9.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
|
1990
1659
|
|
1991
|
-
case
|
1992
|
-
|
1660
|
+
case 27:
|
1661
|
+
_context9.next = 32;
|
1993
1662
|
break;
|
1994
1663
|
|
1995
|
-
case
|
1996
|
-
|
1997
|
-
|
1998
|
-
return
|
1664
|
+
case 29:
|
1665
|
+
_context9.prev = 29;
|
1666
|
+
_context9.t0 = _context9['catch'](1);
|
1667
|
+
return _context9.abrupt('return', "failed");
|
1999
1668
|
|
2000
|
-
case
|
1669
|
+
case 32:
|
2001
1670
|
case 'end':
|
2002
|
-
return
|
1671
|
+
return _context9.stop();
|
2003
1672
|
}
|
2004
1673
|
}
|
2005
|
-
},
|
1674
|
+
}, _callee9, this, [[1, 29]]);
|
2006
1675
|
}));
|
2007
1676
|
|
2008
|
-
function validePwd(
|
2009
|
-
return
|
1677
|
+
function validePwd(_x8) {
|
1678
|
+
return _ref20.apply(this, arguments);
|
2010
1679
|
}
|
2011
1680
|
|
2012
1681
|
return validePwd;
|
2013
1682
|
}()
|
2014
1683
|
}]);
|
2015
1684
|
return SettlementStore;
|
2016
|
-
}(),
|
1685
|
+
}(), _initialiseProps = function _initialiseProps() {
|
1686
|
+
var _this13 = this;
|
1687
|
+
|
1688
|
+
this.paymode = null;
|
1689
|
+
this.dto = null;
|
1690
|
+
this.dtoParams = null;
|
1691
|
+
this.member = null;
|
1692
|
+
this.brefund = false;
|
1693
|
+
this.bquick = false;
|
1694
|
+
this.boriginReturn = false;
|
1695
|
+
|
1696
|
+
_initDefineProp(this, 'newStyle', _descriptor, this);
|
1697
|
+
|
1698
|
+
this.isFull = true;
|
1699
|
+
this.isCanSettleOnQuickKey = true;
|
1700
|
+
|
1701
|
+
this.setCanSettleOnQuickKey = function (value) {
|
1702
|
+
_this13.isCanSettleOnQuickKey = value;
|
1703
|
+
};
|
1704
|
+
|
1705
|
+
_initDefineProp(this, 'setNewStyle', _descriptor2, this);
|
1706
|
+
|
1707
|
+
_initDefineProp(this, 'queryPwd', _descriptor3, this);
|
1708
|
+
|
1709
|
+
_initDefineProp(this, 'updateMemberInfo', _descriptor4, this);
|
1710
|
+
|
1711
|
+
_initDefineProp(this, 'updateCurrentMode', _descriptor5, this);
|
1712
|
+
|
1713
|
+
_initDefineProp(this, 'updateCardInfo', _descriptor6, this);
|
1714
|
+
|
1715
|
+
this.handleCzkData = function (m) {
|
1716
|
+
if (!m || !m.StorageCardNo) {
|
1717
|
+
(0, _mobx.runInAction)(function () {
|
1718
|
+
_this13.paymode.currentMode.errinfo = "无效的会员卡号";
|
1719
|
+
});
|
1720
|
+
} else {
|
1721
|
+
(0, _mobx.runInAction)(function () {
|
1722
|
+
_this13.paymode.currentMode.errinfo = "";
|
1723
|
+
_this13.paymode.currentMode.memberId = m.ID;
|
1724
|
+
_this13.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this13.brefund ? _this13.paymode.receivable : Math.max(_this13.paymode.receivable, 0));
|
1725
|
+
_this13.updateEvent();
|
1726
|
+
var message = '';
|
1727
|
+
var sum = (0, _reduce3.default)(_this13.paymode.thePaymodes, function (total, cur) {
|
1728
|
+
return total + cur.value;
|
1729
|
+
}, 0);
|
1730
|
+
// 对于卡不用判断会员的一些信息
|
1731
|
+
// if (global.CheckMemberStorageProcessorBlock ) {
|
1732
|
+
// message= CheckMemberStorageProcessorBlock.execute(m);
|
1733
|
+
// }
|
1734
|
+
if (!String.isNullOrEmpty(message)) {
|
1735
|
+
_this13.paymode.currentMode.errinfo = message;
|
1736
|
+
} else if (_this13.checkReceived(_this13.paymode.currentMode, "balance")) {
|
1737
|
+
_this13.paymode.currentMode.errinfo = "余额不足";
|
1738
|
+
} else if (_this13.paymode.amount > 0 && parseFloat(_this13.paymode.amount) !== sum && _this13.paymode.currentMode.value == 0) {
|
1739
|
+
_this13.paymode.currentMode.errinfo = "实收金额必须录入";
|
1740
|
+
} else {
|
1741
|
+
// 查询成功后将焦点移入下一个输入框
|
1742
|
+
setTimeout(function () {
|
1743
|
+
var nextInput = document.querySelector('.czk .received .input');
|
1744
|
+
nextInput && nextInput.select();
|
1745
|
+
}, 300);
|
1746
|
+
}
|
1747
|
+
});
|
1748
|
+
}
|
1749
|
+
};
|
1750
|
+
|
1751
|
+
this.getCouponList = function (coupon_code) {
|
1752
|
+
var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
|
1753
|
+
PayStyle = _enumController$getEn15.PayStyle,
|
1754
|
+
Differentiate = _enumController$getEn15.Differentiate;
|
1755
|
+
|
1756
|
+
var couponApplyRule = (0, _tplusPoslogin.PosInitData)('CouponApplyRule');
|
1757
|
+
|
1758
|
+
var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
|
1759
|
+
CouponApplyRule = _enumController$getEn16.CouponApplyRule;
|
1760
|
+
|
1761
|
+
if (couponApplyRule == CouponApplyRule.SHOWN_BY_CUSTOMER && !!coupon_code || couponApplyRule != CouponApplyRule.SHOWN_BY_CUSTOMER) {
|
1762
|
+
var dto = _this13.dto;
|
1763
|
+
var promoVoucher = {};
|
1764
|
+
_this13.paymode.clearDjqs();
|
1765
|
+
_this13.paymode.reCalculationDjqs();
|
1766
|
+
promoVoucher.coupon_code = coupon_code || "";
|
1767
|
+
promoVoucher.boName = "Retail";
|
1768
|
+
promoVoucher.voucherId = dto.ID;
|
1769
|
+
var onlinePaymentAmount = 0;
|
1770
|
+
if (dto.OnlinePaymentAmount) {
|
1771
|
+
onlinePaymentAmount = dto.OnlinePaymentAmount;
|
1772
|
+
}
|
1773
|
+
promoVoucher.promoLinks = (0, _filter3.default)(_this13.paymode.currentMode.djqs, function (djq) {
|
1774
|
+
return djq.checked;
|
1775
|
+
});
|
1776
|
+
promoVoucher.totalAmountWithTax = Math.Minus(dto.TotalTaxAmount, onlinePaymentAmount);
|
1777
|
+
promoVoucher.redBlueFlagEnum = "BLUE";
|
1778
|
+
promoVoucher.meMemberId = dto.Idmember;
|
1779
|
+
promoVoucher.storeFactorId = dto.Idstore;
|
1780
|
+
promoVoucher.voucherDetailList = [];
|
1781
|
+
dto.RetailDetails.forEach(function (item) {
|
1782
|
+
var detailDTO = {};
|
1783
|
+
detailDTO.uuid = item.Code;
|
1784
|
+
detailDTO.detailBoName = "RetailDetail";
|
1785
|
+
detailDTO.voucherDetailId = item.ID;
|
1786
|
+
detailDTO.productId = item.Idinventory;
|
1787
|
+
detailDTO.uomId = item.Idunit;
|
1788
|
+
detailDTO.productSpecId = item.ProductSpecId;
|
1789
|
+
detailDTO.isManualFreeGift = item.IsPresent;
|
1790
|
+
detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
|
1791
|
+
detailDTO.IsManualChangePrice = item.IsManualChangePrice;
|
1792
|
+
// if(detailDTO.IsManualChangePrice)//如果是手工改价
|
1793
|
+
// {
|
1794
|
+
// detailDTO.listPrice = item.TaxPrice;
|
1795
|
+
// detailDTO.netAmountWithTax = item.TaxAmount;
|
1796
|
+
// }
|
1797
|
+
// else
|
1798
|
+
// {
|
1799
|
+
var bookingQuantity = 0;
|
1800
|
+
if (item.BookingQuantity) {
|
1801
|
+
bookingQuantity = item.BookingQuantity;
|
1802
|
+
}
|
1803
|
+
detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
|
1804
|
+
detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
|
1805
|
+
//}
|
1806
|
+
detailDTO.taxRate = item.TaxRate;
|
1807
|
+
detailDTO.quantity = item.Quantity;
|
1808
|
+
|
1809
|
+
detailDTO.amountWithTax = item.RetailAmount;
|
1810
|
+
// 促销 start
|
1811
|
+
if (item.PromotionDetails && item.PromotionDetails.length != 0) {
|
1812
|
+
var promoLinks = [];
|
1813
|
+
item.PromotionDetails.forEach(function (promotion) {
|
1814
|
+
promoLinks.push({
|
1815
|
+
promoId: promotion.IdSalesPromotionDTO,
|
1816
|
+
promoRuleId: promotion.PromotionRuleId
|
1817
|
+
});
|
1818
|
+
});
|
1819
|
+
if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
|
1820
|
+
}
|
1821
|
+
// 促销 end
|
1822
|
+
promoVoucher.voucherDetailList.push(detailDTO);
|
1823
|
+
});
|
1824
|
+
return _this13.SettlementApi.findUsefulCouponPromoList(promoVoucher).then(function (result) {
|
1825
|
+
if (result && result.length != 0) {
|
1826
|
+
result.forEach(function (element) {
|
1827
|
+
var _ref22 = element || {},
|
1828
|
+
couponCode = _ref22.couponCode,
|
1829
|
+
name = _ref22.name,
|
1830
|
+
tieredAmountResult = _ref22.tieredAmountResult,
|
1831
|
+
fromDate = _ref22.fromDate,
|
1832
|
+
dateMount = _ref22.dateMount,
|
1833
|
+
promoMethodEnum = _ref22.promoMethodEnum,
|
1834
|
+
discountPct = _ref22.discountPct,
|
1835
|
+
nominalAmount = _ref22.nominalAmount,
|
1836
|
+
promoId = _ref22.promoId,
|
1837
|
+
id = _ref22.id;
|
1838
|
+
|
1839
|
+
var condValue = tieredAmountResult.condValue,
|
1840
|
+
promoDiscount = tieredAmountResult.promoDiscount,
|
1841
|
+
displayText = tieredAmountResult.displayText,
|
1842
|
+
promoRuleId = tieredAmountResult.promoRuleId,
|
1843
|
+
couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
|
1844
|
+
|
1845
|
+
if (result.IsRepelWithPoints && (0, _find3.default)(_this13.paymode.thePaymodes, function (themode) {
|
1846
|
+
return themode.paymentType == PayStyle.jfdx;
|
1847
|
+
})) {
|
1848
|
+
_message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
|
1849
|
+
} else {
|
1850
|
+
var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
|
1851
|
+
_this13.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);
|
1852
|
+
}
|
1853
|
+
});
|
1854
|
+
if (promoVoucher.coupon_code) {
|
1855
|
+
_this13.paymode.calcDjqCheckValue(_this13.paymode.currentMode.djqs[0], _this13.dto, 'single');
|
1856
|
+
}
|
1857
|
+
} else {
|
1858
|
+
if (promoVoucher.coupon_code) {
|
1859
|
+
_message2.default.info(Differentiate.COUPON + '\u53F7\u4E0D\u5B58\u5728\uFF01');
|
1860
|
+
_this13.getCouponList();
|
1861
|
+
} else {
|
1862
|
+
_message2.default.info('\u6CA1\u6709\u627E\u5230\u53EF\u4F7F\u7528\u7684' + Differentiate.COUPON + '\uFF01');
|
1863
|
+
}
|
1864
|
+
}
|
1865
|
+
});
|
1866
|
+
}
|
1867
|
+
};
|
1868
|
+
|
1869
|
+
this.getSettleGift = function () {
|
1870
|
+
return _this13.SettlementApi.executeRightsForPos(_this13.billID);
|
1871
|
+
};
|
1872
|
+
|
1873
|
+
this.getRefWareHouseList = function () {
|
1874
|
+
return _this13.SettlementApi.getRefWareHouseList();
|
1875
|
+
};
|
1876
|
+
|
1877
|
+
this.checkCoupon = function () {
|
1878
|
+
var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(sn) {
|
1879
|
+
var _ref24, isNewRetailBCPos, _enumController$getEn17, PayStyle, Differentiate, params;
|
1880
|
+
|
1881
|
+
return _regenerator2.default.wrap(function _callee10$(_context10) {
|
1882
|
+
while (1) {
|
1883
|
+
switch (_context10.prev = _context10.next) {
|
1884
|
+
case 0:
|
1885
|
+
_ref24 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref24.isNewRetailBCPos;
|
1886
|
+
|
1887
|
+
if (!isNewRetailBCPos) {
|
1888
|
+
_context10.next = 7;
|
1889
|
+
break;
|
1890
|
+
}
|
1891
|
+
|
1892
|
+
_context10.next = 4;
|
1893
|
+
return _this13.getCouponList(sn, 'sinlge');
|
1894
|
+
|
1895
|
+
case 4:
|
1896
|
+
return _context10.abrupt('return', _context10.sent);
|
1897
|
+
|
1898
|
+
case 7:
|
1899
|
+
_enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn17.PayStyle, Differentiate = _enumController$getEn17.Differentiate;
|
1900
|
+
params = { request: {
|
1901
|
+
Uid: _this13.paymode.currentMode.member.uid || '',
|
1902
|
+
SN: sn,
|
1903
|
+
StoreCode: _this13.dto.Idstore,
|
1904
|
+
Inventories: (0, _map3.default)((0, _filter3.default)(_this13.dto.RetailDetails, function (d) {
|
1905
|
+
return d.Quantity > 0 && !d.IsPresent;
|
1906
|
+
}), function (detail) {
|
1907
|
+
return {
|
1908
|
+
IdInventory: detail.Inventory.ID,
|
1909
|
+
IdUnit: detail.Idunit,
|
1910
|
+
Code: detail.Inventory.Code,
|
1911
|
+
FreeItem0: JSON.getCellValue(detail, "freeitem0"),
|
1912
|
+
FreeItem1: JSON.getCellValue(detail, "freeitem1"),
|
1913
|
+
FreeItem2: JSON.getCellValue(detail, "freeitem2"),
|
1914
|
+
FreeItem3: JSON.getCellValue(detail, "freeitem3"),
|
1915
|
+
FreeItem4: JSON.getCellValue(detail, "freeitem4"),
|
1916
|
+
FreeItem5: JSON.getCellValue(detail, "freeitem5"),
|
1917
|
+
FreeItem6: JSON.getCellValue(detail, "freeitem6"),
|
1918
|
+
FreeItem7: JSON.getCellValue(detail, "freeitem7"),
|
1919
|
+
FreeItem8: JSON.getCellValue(detail, "freeitem8"),
|
1920
|
+
FreeItem9: JSON.getCellValue(detail, "freeitem9")
|
1921
|
+
};
|
1922
|
+
}),
|
1923
|
+
// inventoryCodes:_join(_map(this.dto.RetailDetails,(detail)=>{return detail.Inventory.Code;}),','),
|
1924
|
+
InventoryClassCodes: (0, _join3.default)((0, _map3.default)((0, _filter3.default)(_this13.dto.RetailDetails, function (d) {
|
1925
|
+
return d.Quantity > 0;
|
1926
|
+
}), function (detail) {
|
1927
|
+
return (detail.Inventory.InventoryClass || { Code: '' }).Code;
|
1928
|
+
}), ','),
|
1929
|
+
Amount: _this13.paymode.amount
|
1930
|
+
} };
|
1931
|
+
return _context10.abrupt('return', _this13.SettlementApi.CheckCoupon(params).then(function (result) {
|
1932
|
+
if ((0, _find3.default)(_this13.paymode.currentMode.djqs, function (djq) {
|
1933
|
+
return djq.code == result.SN;
|
1934
|
+
})) {
|
1935
|
+
_message2.default.info(Differentiate.COUPON + '\u5DF2\u6DFB\u52A0');
|
1936
|
+
} else if (result.IsRepelWithPoints && (0, _find3.default)(_this13.paymode.thePaymodes, function (themode) {
|
1937
|
+
return themode.paymentType == PayStyle.jfdx;
|
1938
|
+
})) {
|
1939
|
+
_message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
|
1940
|
+
} else {
|
1941
|
+
_this13.addDjq(result.SN, result.Title, result.ReduceAmount, result.StartAmount, result.LastTS, false, !result.IsRepelWithPoints, result.UMemberID);
|
1942
|
+
}
|
1943
|
+
}));
|
1944
|
+
|
1945
|
+
case 10:
|
1946
|
+
case 'end':
|
1947
|
+
return _context10.stop();
|
1948
|
+
}
|
1949
|
+
}
|
1950
|
+
}, _callee10, _this13);
|
1951
|
+
}));
|
1952
|
+
|
1953
|
+
return function (_x9) {
|
1954
|
+
return _ref23.apply(this, arguments);
|
1955
|
+
};
|
1956
|
+
}();
|
1957
|
+
|
1958
|
+
this.repeatStorageModal = function (content) {
|
1959
|
+
return new _promise2.default(function (resolve, reject) {
|
1960
|
+
_tplusComponentsTouch.ModalWraper.confirm({
|
1961
|
+
title: '',
|
1962
|
+
okText: '继续储值',
|
1963
|
+
className: 'repeat-modal',
|
1964
|
+
zIndex: 1007,
|
1965
|
+
content: content,
|
1966
|
+
onOk: function () {
|
1967
|
+
var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11() {
|
1968
|
+
var ret;
|
1969
|
+
return _regenerator2.default.wrap(function _callee11$(_context11) {
|
1970
|
+
while (1) {
|
1971
|
+
switch (_context11.prev = _context11.next) {
|
1972
|
+
case 0:
|
1973
|
+
_context11.next = 2;
|
1974
|
+
return _this13.saveMember();
|
1975
|
+
|
1976
|
+
case 2:
|
1977
|
+
ret = _context11.sent;
|
1978
|
+
|
1979
|
+
if (ret === false) {
|
1980
|
+
resolve(false);
|
1981
|
+
} else {
|
1982
|
+
resolve(true);
|
1983
|
+
}
|
1984
|
+
|
1985
|
+
case 4:
|
1986
|
+
case 'end':
|
1987
|
+
return _context11.stop();
|
1988
|
+
}
|
1989
|
+
}
|
1990
|
+
}, _callee11, _this13);
|
1991
|
+
}));
|
1992
|
+
|
1993
|
+
return function onOk() {
|
1994
|
+
return _ref25.apply(this, arguments);
|
1995
|
+
};
|
1996
|
+
}(),
|
1997
|
+
onCancel: function onCancel() {
|
1998
|
+
resolve(false);
|
1999
|
+
}
|
2000
|
+
});
|
2001
|
+
});
|
2002
|
+
};
|
2003
|
+
|
2004
|
+
this.checkIntegralExchangeReturn = function (id) {
|
2005
|
+
return new _promise2.default(function (resolve, reject) {
|
2006
|
+
_this13.SettlementApi.GetNewIntegralExchange({ param: { refVoucherId: id } }).then(function (resp) {
|
2007
|
+
if (resp && resp.expireIntegral > 0) {
|
2008
|
+
_tplusComponentsTouch.ModalWraper.confirm({
|
2009
|
+
className: 'tplus-confirm-modal',
|
2010
|
+
title: "温馨提示",
|
2011
|
+
content: '\u5B58\u5728\u5DF2\u7ECF\u8FC7\u671F\u7684\u79EF\u5206' + resp.expireIntegral + '\u9000\u8D27\u540E\u79EF\u5206\u4E0D\u4F1A\u8FD4\u8FD8\u3002\u662F\u5426\u7EE7\u7EED\u9000\u8D27\uFF1F',
|
2012
|
+
cancelable: false,
|
2013
|
+
onOk: function onOk() {
|
2014
|
+
resolve(true);
|
2015
|
+
},
|
2016
|
+
onCancel: function onCancel() {
|
2017
|
+
reject(false);
|
2018
|
+
}
|
2019
|
+
});
|
2020
|
+
} else {
|
2021
|
+
resolve(true);
|
2022
|
+
}
|
2023
|
+
});
|
2024
|
+
});
|
2025
|
+
};
|
2026
|
+
}, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'newStyle', [_mobx.observable], {
|
2017
2027
|
enumerable: true,
|
2018
2028
|
initializer: function initializer() {
|
2019
2029
|
return true;
|
@@ -2024,7 +2034,8 @@ var SettlementStore = (_class = function () {
|
|
2024
2034
|
var _this14 = this;
|
2025
2035
|
|
2026
2036
|
return function () {
|
2027
|
-
|
2037
|
+
var voucherDefaultPosMode = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') || 'touch';
|
2038
|
+
_this14.newStyle = voucherDefaultPosMode == 'voucher';
|
2028
2039
|
};
|
2029
2040
|
}
|
2030
2041
|
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
|
@@ -2040,13 +2051,13 @@ var SettlementStore = (_class = function () {
|
|
2040
2051
|
return _message2.default.warn('您两次输入的密码不一致');
|
2041
2052
|
}
|
2042
2053
|
var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
|
2043
|
-
return
|
2054
|
+
return _this15.SettlementApi.setWalletPayPassword({
|
2044
2055
|
Idstore: idstore,
|
2045
2056
|
meMemberId: _this15.paymode.currentMode.memberId,
|
2046
2057
|
oldPassword: null,
|
2047
2058
|
newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
|
2048
2059
|
dataSource: "POS"
|
2049
|
-
}
|
2060
|
+
}).then(function (resp) {
|
2050
2061
|
if (resp.successful) {
|
2051
2062
|
return true;
|
2052
2063
|
}
|
@@ -2068,7 +2079,7 @@ var SettlementStore = (_class = function () {
|
|
2068
2079
|
case 0:
|
2069
2080
|
_getLoginInfo4 = _this16.getLoginInfo(), IdStore = _getLoginInfo4.IdStore, StoreCode = _getLoginInfo4.StoreCode;
|
2070
2081
|
_context12.next = 3;
|
2071
|
-
return
|
2082
|
+
return _this16.SettlementApi.GetUmemberDTO({ Idmember: _this16.member.ID, IdStore: IdStore, StoreCode: StoreCode });
|
2072
2083
|
|
2073
2084
|
case 3:
|
2074
2085
|
resp = _context12.sent;
|
@@ -2103,9 +2114,10 @@ var SettlementStore = (_class = function () {
|
|
2103
2114
|
switch (_context13.prev = _context13.next) {
|
2104
2115
|
case 0:
|
2105
2116
|
isOnlyEnabled = returnType ? false : true; //非原单退货为false,其他true
|
2117
|
+
// 查看会员卡信息
|
2106
2118
|
|
2107
2119
|
_context13.next = 3;
|
2108
|
-
return
|
2120
|
+
return _this17.SettlementApi.getCardInfoByMemberId(memberId, isOnlyEnabled);
|
2109
2121
|
|
2110
2122
|
case 3:
|
2111
2123
|
result = _context13.sent;
|
@@ -2171,7 +2183,7 @@ var SettlementStore = (_class = function () {
|
|
2171
2183
|
ctMode = _this18.paymode && _this18.paymode.currentMode;
|
2172
2184
|
cardNo = ctMode && ctMode.storageCardNo;
|
2173
2185
|
_context14.next = 4;
|
2174
|
-
return
|
2186
|
+
return _this18.SettlementApi.getCardInfoByCardNo(cardNo);
|
2175
2187
|
|
2176
2188
|
case 4:
|
2177
2189
|
result = _context14.sent;
|
@@ -2191,9 +2203,6 @@ exports.default = SettlementStore;
|
|
2191
2203
|
var PayMode = exports.PayMode = (_class3 = function () {
|
2192
2204
|
//预订场景下,现场提货,且选项设置订金比例非100% or 取货最大补款数大于0时 为 true
|
2193
2205
|
function PayMode() {
|
2194
|
-
// this.amount=getFixedNumber(amount);
|
2195
|
-
// this.calcReserved();
|
2196
|
-
|
2197
2206
|
(0, _classCallCheck3.default)(this, PayMode);
|
2198
2207
|
this._counter = 0;
|
2199
2208
|
this.amount = 0;
|
@@ -2230,6 +2239,10 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
2230
2239
|
_initDefineProp(this, 'setCouponNum', _descriptor15, this);
|
2231
2240
|
|
2232
2241
|
_initDefineProp(this, 'addDjqs', _descriptor16, this);
|
2242
|
+
|
2243
|
+
// this.amount=getFixedNumber(amount);
|
2244
|
+
// this.calcReserved();
|
2245
|
+
this.SettlementApi = _settlementApi2.default;
|
2233
2246
|
}
|
2234
2247
|
// @observable store = null;
|
2235
2248
|
//只是预订场景下,现场提货,且选项设置订金比例非100%时 为 true
|
@@ -2414,7 +2427,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
2414
2427
|
promoVoucher.voucherDetailList.push(detailDTO);
|
2415
2428
|
});
|
2416
2429
|
promoVoucher.promoLinks = this.checkList;
|
2417
|
-
return
|
2430
|
+
return this.SettlementApi.findUsefulCouponPromoList(promoVoucher).then(function (result) {
|
2418
2431
|
if (result && result.length != 0) {
|
2419
2432
|
result.forEach(function (element, index) {
|
2420
2433
|
var djq1 = false;
|
@@ -2596,7 +2609,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
|
|
2596
2609
|
memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
|
2597
2610
|
param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
|
2598
2611
|
_context15.next = 7;
|
2599
|
-
return
|
2612
|
+
return _settlementApi2.default.GetNewStoreSettleStyles({ param: param });
|
2600
2613
|
|
2601
2614
|
case 7:
|
2602
2615
|
modes = _context15.sent;
|