tplus-components-touch 3.27.35 → 3.27.39

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.
@@ -168,6 +168,7 @@ var SettlementStore = (_class = function () {
168
168
  (0, _classCallCheck3.default)(this, SettlementStore);
169
169
  this.paymode = null;
170
170
  this.dto = null;
171
+ this.dtoParams = null;
171
172
  this.member = null;
172
173
  this.brefund = false;
173
174
  this.bquick = false;
@@ -233,8 +234,6 @@ var SettlementStore = (_class = function () {
233
234
  var promoVoucher = {};
234
235
  _this2.paymode.clearDjqs();
235
236
  _this2.paymode.reCalculationDjqs();
236
- // promoVoucher.bizDate = dto.VoucherDate;
237
- // promoVoucher.bizDate = new Date().getTime();
238
237
  promoVoucher.coupon_code = coupon_code || "";
239
238
  promoVoucher.boName = "Retail";
240
239
  promoVoucher.voucherId = dto.ID;
@@ -321,11 +320,7 @@ var SettlementStore = (_class = function () {
321
320
  _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
322
321
  } else {
323
322
  var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
324
-
325
- var _ref2 = _mutantsUtil.platform || {},
326
- isNewRetailBCPos = _ref2.isNewRetailBCPos;
327
-
328
- _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);
323
+ _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);
329
324
  }
330
325
  });
331
326
  if (promoVoucher.coupon_code) {
@@ -352,14 +347,14 @@ var SettlementStore = (_class = function () {
352
347
  };
353
348
 
354
349
  this.checkCoupon = function () {
355
- var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
356
- var _ref4, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
350
+ var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
351
+ var _ref3, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
357
352
 
358
353
  return _regenerator2.default.wrap(function _callee$(_context) {
359
354
  while (1) {
360
355
  switch (_context.prev = _context.next) {
361
356
  case 0:
362
- _ref4 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref4.isNewRetailBCPos;
357
+ _ref3 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref3.isNewRetailBCPos;
363
358
 
364
359
  if (!isNewRetailBCPos) {
365
360
  _context.next = 7;
@@ -427,10 +422,56 @@ var SettlementStore = (_class = function () {
427
422
  }));
428
423
 
429
424
  return function (_x) {
430
- return _ref3.apply(this, arguments);
425
+ return _ref2.apply(this, arguments);
431
426
  };
432
427
  }();
433
428
 
429
+ this.repeatStorageModal = function (content) {
430
+ return new _promise2.default(function (resolve, reject) {
431
+ _tplusComponentsTouch.ModalWraper.confirm({
432
+ title: '',
433
+ okText: '继续储值',
434
+ className: 'repeat-modal',
435
+ zIndex: 1007,
436
+ content: content,
437
+ onOk: function () {
438
+ var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
439
+ var ret;
440
+ return _regenerator2.default.wrap(function _callee2$(_context2) {
441
+ while (1) {
442
+ switch (_context2.prev = _context2.next) {
443
+ case 0:
444
+ _context2.next = 2;
445
+ return _this2.saveMember();
446
+
447
+ case 2:
448
+ ret = _context2.sent;
449
+
450
+ if (ret === false) {
451
+ resolve(false);
452
+ } else {
453
+ resolve(true);
454
+ }
455
+
456
+ case 4:
457
+ case 'end':
458
+ return _context2.stop();
459
+ }
460
+ }
461
+ }, _callee2, _this2);
462
+ }));
463
+
464
+ return function onOk() {
465
+ return _ref4.apply(this, arguments);
466
+ };
467
+ }(),
468
+ onCancel: function onCancel() {
469
+ resolve(false);
470
+ }
471
+ });
472
+ });
473
+ };
474
+
434
475
  this.checkIntegralExchangeReturn = function (id) {
435
476
  return new _promise2.default(function (resolve, reject) {
436
477
  (0, _tplusApi.tApi)({ param: { refVoucherId: id } }, 'chanjet.RE.NewPos.GetNewIntegralExchange', false, false, { timeout_skip: true }).then(function (resp) {
@@ -604,7 +645,8 @@ var SettlementStore = (_class = function () {
604
645
  authCode: detail.PaymentCode,
605
646
  steadCashIntegral: detail.SteadCashIntegral,
606
647
  overchargesAmount: detail.OverchargesAmount,
607
- boriginReturn: true
648
+ boriginReturn: true,
649
+ thirdPaymentReturnInfo: detail.ThirdPaymentReturnInfo
608
650
  });
609
651
  _this5.paymode.currentMode = newmode;
610
652
  if (themode.paymentType == PayStyle.djq) {
@@ -619,10 +661,10 @@ var SettlementStore = (_class = function () {
619
661
  promoId = _ref7.promoId,
620
662
  id = _ref7.id;
621
663
 
622
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
664
+ _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
623
665
  return;
624
666
  }
625
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
667
+ _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
626
668
  });
627
669
  }
628
670
  _this5.paymode.thePaymodes.push(newmode);
@@ -733,36 +775,36 @@ var SettlementStore = (_class = function () {
733
775
  // address = '/member/memberProfile/FindByStorageCode/'+v;
734
776
  address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + v + '/' + true;
735
777
  return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function () {
736
- var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(result) {
778
+ var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(result) {
737
779
  var data, m;
738
- return _regenerator2.default.wrap(function _callee2$(_context2) {
780
+ return _regenerator2.default.wrap(function _callee3$(_context3) {
739
781
  while (1) {
740
- switch (_context2.prev = _context2.next) {
782
+ switch (_context3.prev = _context3.next) {
741
783
  case 0:
742
784
  data = result.data;
743
785
  m = data && data.length && data[0];
744
786
 
745
787
  if (!(result && result.data.length)) {
746
- _context2.next = 25;
788
+ _context3.next = 25;
747
789
  break;
748
790
  }
749
791
 
750
792
  if (!(result.data.length === 1)) {
751
- _context2.next = 14;
793
+ _context3.next = 14;
752
794
  break;
753
795
  }
754
796
 
755
797
  if (!(m.CardTypeEnum === 'BALANCE_CARD')) {
756
- _context2.next = 10;
798
+ _context3.next = 10;
757
799
  break;
758
800
  }
759
801
 
760
802
  _this7.paymode.updateCardInfo(m);
761
803
  _this7.handleCzkData(m);
762
- return _context2.abrupt('return', result.data);
804
+ return _context3.abrupt('return', result.data);
763
805
 
764
806
  case 10:
765
- _context2.next = 12;
807
+ _context3.next = 12;
766
808
  return (0, _tplusApi.ccApi)({ dto: _this7.dto, meStorageCardId: m.MeStorageCardId }, '/retail/RetailPos/validateRetailStorageCard', false, false).then(function (result1) {
767
809
  var data1 = result1.data ? JSON.parse(result1.data)[0] : {};
768
810
  if (data1.enable) {
@@ -775,36 +817,36 @@ var SettlementStore = (_class = function () {
775
817
  });
776
818
 
777
819
  case 12:
778
- _context2.next = 25;
820
+ _context3.next = 25;
779
821
  break;
780
822
 
781
823
  case 14:
782
824
  if (!(result.data && result.data.length === 1)) {
783
- _context2.next = 19;
825
+ _context3.next = 19;
784
826
  break;
785
827
  }
786
828
 
787
829
  _this7.paymode.updateCardInfo(result.data[0]);
788
- return _context2.abrupt('return', result.data);
830
+ return _context3.abrupt('return', result.data);
789
831
 
790
832
  case 19:
791
833
  if (!(result.data && result.data.length > 1)) {
792
- _context2.next = 23;
834
+ _context3.next = 23;
793
835
  break;
794
836
  }
795
837
 
796
- return _context2.abrupt('return', result.data);
838
+ return _context3.abrupt('return', result.data);
797
839
 
798
840
  case 23:
799
841
  _message2.default.warn('没有可用储值卡!');
800
- return _context2.abrupt('return', false);
842
+ return _context3.abrupt('return', false);
801
843
 
802
844
  case 25:
803
845
  case 'end':
804
- return _context2.stop();
846
+ return _context3.stop();
805
847
  }
806
848
  }
807
- }, _callee2, _this7);
849
+ }, _callee3, _this7);
808
850
  }));
809
851
 
810
852
  return function (_x2) {
@@ -855,12 +897,13 @@ var SettlementStore = (_class = function () {
855
897
  }
856
898
  }, {
857
899
  key: 'addDjq',
858
- value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
900
+ value: function addDjq(promoCouponCode, name, IsEnable, nominalAmount, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
859
901
  var djq = {
860
902
  code: promoCouponCode,
861
903
  promoCouponCode: promoCouponCode,
862
904
  name: name,
863
905
  IsEnable: IsEnable,
906
+ nominalAmount: nominalAmount,
864
907
  amount: amount,
865
908
  doorsill: doorsill, //:"无门槛"
866
909
  LastTS: LastTS,
@@ -961,6 +1004,7 @@ var SettlementStore = (_class = function () {
961
1004
  name: themode.name,
962
1005
  exchangeRate: themode.exchangeRate,
963
1006
  calDirection: themode.calDirection,
1007
+ thridPayment: themode.thridPayment,
964
1008
  value: value,
965
1009
  value2: (0, _utils.getFixedNumber)(themode.calDirection == "88" ? value / themode.exchangeRate : value * themode.exchangeRate),
966
1010
  value3: value,
@@ -990,7 +1034,7 @@ var SettlementStore = (_class = function () {
990
1034
  if (type == PayStyle.hyczk || type == PayStyle.jfdx || type == PayStyle.djq) {
991
1035
  this.setMaxAmount(type, mode);
992
1036
  }
993
- console.log(mode);
1037
+ console.log('\u5F53\u524D\u64CD\u4F5C\u7ED3\u7B97\u65B9\u5F0F\u4FE1\u606F:' + mode);
994
1038
  return mode;
995
1039
  }
996
1040
  }, {
@@ -1037,15 +1081,6 @@ var SettlementStore = (_class = function () {
1037
1081
  key: 'changeFocusOnly',
1038
1082
  value: function changeFocusOnly(type) {
1039
1083
  this.paymode.currentFocus = type;
1040
- // 获取焦点时带入剩余的值
1041
- // let mode=_find(this.paymode.thePaymodes,{'paymentType':type});
1042
- // if(mode && this.isIntegralExchange){
1043
- // const shouldSetValue =getFixedNumber(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
1044
- // mode.value = shouldSetValue;
1045
- // mode.value2 = getFixedNumber(mode.calDirection=="88"?shouldSetValue / mode.exchangeRate:(shouldSetValue * mode.exchangeRate));
1046
- // mode.value3 = shouldSetValue;
1047
- // this.paymode.calcReserved();
1048
- // }
1049
1084
  }
1050
1085
  }, {
1051
1086
  key: 'changeClickFocusOnly',
@@ -1114,8 +1149,6 @@ var SettlementStore = (_class = function () {
1114
1149
  });
1115
1150
  pos = index == -1 ? pos : index + 1;
1116
1151
  }
1117
- // this.paymode.thePaymodes.push(this.genNewMode(type) );
1118
-
1119
1152
  this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk, undefined, isQuick));
1120
1153
  this.paymode.calcReserved(bookType);
1121
1154
  }
@@ -1131,79 +1164,175 @@ var SettlementStore = (_class = function () {
1131
1164
  this.paymode.currentFocus = -1;
1132
1165
  this.paymode.calcReserved(bookType);
1133
1166
  }
1167
+
1168
+ // 获取储值是否重复, 在commit方法中使用
1169
+
1170
+ }, {
1171
+ key: 'findStorageBillValidate',
1172
+ value: function findStorageBillValidate() {
1173
+ var _this10 = this;
1174
+
1175
+ var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
1176
+ PayStyle = _enumController$getEn14.PayStyle;
1177
+
1178
+ (0, _mobx.runInAction)(function () {
1179
+ _this10.dto.StorageMutiSettleDetails = [];
1180
+ var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1181
+ return parseFloat(mode.value) != 0;
1182
+ }) : _this10.paymode.thePaymodes;
1183
+ (0, _each3.default)(thePaymodes, function (mode) {
1184
+ var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1185
+
1186
+ var value = parseFloat(mode.value);
1187
+ var giveChange = null;
1188
+ if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1189
+ value = Math.Add(value, _this10.paymode.receivable);
1190
+ giveChange = Math.abs(_this10.paymode.receivable);
1191
+ }
1192
+ _this10.dto.StorageMutiSettleDetails.push({
1193
+ Code: mode.paymethodId,
1194
+ StorageAmount: value,
1195
+ GiveChange: giveChange,
1196
+ IdsettleStyle: themode.idSettleStyle,
1197
+ IdbankAccount: themode.idBankAccount,
1198
+ PaymentCode: mode.authCode,
1199
+ DynamicPropertyKeys: [],
1200
+ DynamicPropertyValues: [],
1201
+ DataSource: { Id: _this10.dataSource }
1202
+ });
1203
+ });
1204
+ });
1205
+ return (0, _tplusApi.ccApi)((0, _extends3.default)({}, this.dto), '/marketingtool/Storage/findStorageBillValidate', false, false);
1206
+ }
1207
+
1208
+ //判断是否重复弹框
1209
+
1134
1210
  }, {
1135
1211
  key: 'commit',
1136
1212
  value: function () {
1137
- var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(bTest) {
1138
- var _ref11, isNewRetailBCPos;
1213
+ var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(bTest) {
1214
+ var status, paylist, ret, _ref11, _ref11$data, code, returnMsg, state, ret1, ret2;
1139
1215
 
1140
- return _regenerator2.default.wrap(function _callee3$(_context3) {
1216
+ return _regenerator2.default.wrap(function _callee4$(_context4) {
1141
1217
  while (1) {
1142
- switch (_context3.prev = _context3.next) {
1218
+ switch (_context4.prev = _context4.next) {
1143
1219
  case 0:
1144
1220
  console.log('settlementStore.commit开始,参数:' + bTest);
1145
1221
 
1146
1222
  if (!bTest) {
1147
- _context3.next = 3;
1223
+ _context4.next = 3;
1148
1224
  break;
1149
1225
  }
1150
1226
 
1151
- return _context3.abrupt('return', _promise2.default.resolve(true));
1227
+ return _context4.abrupt('return', _promise2.default.resolve(true));
1152
1228
 
1153
1229
  case 3:
1154
- _ref11 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref11.isNewRetailBCPos;
1155
- _context3.prev = 4;
1230
+ status = this.type;
1231
+ _context4.prev = 4;
1232
+ paylist = this.paymode.thePaymodes.filter(function (v) {
1233
+ return !!v.thridPayment && Math.abs(v.value) > 0;
1234
+ }) || [];
1235
+
1236
+ if (!(paylist && paylist.length > 1)) {
1237
+ _context4.next = 9;
1238
+ break;
1239
+ }
1156
1240
 
1157
- if (!(this.type == 1)) {
1158
- _context3.next = 10;
1241
+ _message2.default.warn('二开支付目前仅支持单一结算方式。');
1242
+ return _context4.abrupt('return', _promise2.default.resolve(false));
1243
+
1244
+ case 9:
1245
+ if (!(status == 1)) {
1246
+ _context4.next = 30;
1159
1247
  break;
1160
1248
  }
1161
1249
 
1162
- _context3.next = 8;
1163
- return this.saveMember();
1250
+ _context4.next = 12;
1251
+ return this.findStorageBillValidate();
1164
1252
 
1165
- case 8:
1166
- _context3.next = 18;
1167
- break;
1253
+ case 12:
1254
+ ret = _context4.sent;
1255
+ _ref11 = ret || {}, _ref11$data = _ref11.data;
1256
+ _ref11$data = _ref11$data === undefined ? {} : _ref11$data;
1257
+ code = _ref11$data.code, returnMsg = _ref11$data.returnMsg;
1168
1258
 
1169
- case 10:
1170
- if (!isNewRetailBCPos) {
1171
- _context3.next = 13;
1259
+ if (!(code && code == 10001)) {
1260
+ _context4.next = 24;
1172
1261
  break;
1173
1262
  }
1174
1263
 
1175
- _context3.next = 13;
1264
+ _context4.next = 19;
1265
+ return this.repeatStorageModal(returnMsg);
1266
+
1267
+ case 19:
1268
+ state = _context4.sent;
1269
+
1270
+ if (!(state === false)) {
1271
+ _context4.next = 22;
1272
+ break;
1273
+ }
1274
+
1275
+ return _context4.abrupt('return', _promise2.default.resolve(false));
1276
+
1277
+ case 22:
1278
+ _context4.next = 28;
1279
+ break;
1280
+
1281
+ case 24:
1282
+ _context4.next = 26;
1283
+ return this.saveMember();
1284
+
1285
+ case 26:
1286
+ ret1 = _context4.sent;
1287
+
1288
+ if (ret1 === false) {
1289
+ _promise2.default.resolve(false);
1290
+ }
1291
+
1292
+ case 28:
1293
+ _context4.next = 39;
1294
+ break;
1295
+
1296
+ case 30:
1297
+ _context4.next = 32;
1176
1298
  return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
1177
1299
 
1178
- case 13:
1179
- _context3.next = 15;
1300
+ case 32:
1301
+ _context4.next = 34;
1180
1302
  return this.save();
1181
1303
 
1182
- case 15:
1183
- if (!isNewRetailBCPos) {
1184
- _context3.next = 18;
1304
+ case 34:
1305
+ ret2 = _context4.sent;
1306
+
1307
+ if (!(ret2 === false)) {
1308
+ _context4.next = 37;
1185
1309
  break;
1186
1310
  }
1187
1311
 
1188
- _context3.next = 18;
1312
+ return _context4.abrupt('return', _promise2.default.resolve(false));
1313
+
1314
+ case 37:
1315
+ _context4.next = 39;
1189
1316
  return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
1190
1317
 
1191
- case 18:
1192
- return _context3.abrupt('return', _promise2.default.resolve(true));
1318
+ case 39:
1319
+ return _context4.abrupt('return', _promise2.default.resolve(true));
1193
1320
 
1194
- case 21:
1195
- _context3.prev = 21;
1196
- _context3.t0 = _context3['catch'](4);
1321
+ case 42:
1322
+ _context4.prev = 42;
1323
+ _context4.t0 = _context4['catch'](4);
1197
1324
 
1198
- console.error('settlementStore.commit失败,错误信息:' + _context3.t0);
1199
- return _context3.abrupt('return', _promise2.default.resolve(_context3.t0));
1325
+ console.error('settlementStore.commit失败,错误信息:' + _context4.t0);
1326
+ //其他支付失败时,处理二开支付情况。
1327
+ this.thirdPayRefund(status == 1 ? 2 : 1);
1328
+ return _context4.abrupt('return', _promise2.default.resolve(_context4.t0));
1200
1329
 
1201
- case 25:
1330
+ case 47:
1202
1331
  case 'end':
1203
- return _context3.stop();
1332
+ return _context4.stop();
1204
1333
  }
1205
1334
  }
1206
- }, _callee3, this, [[4, 21]]);
1335
+ }, _callee4, this, [[4, 42]]);
1207
1336
  }));
1208
1337
 
1209
1338
  function commit(_x3) {
@@ -1220,76 +1349,136 @@ var SettlementStore = (_class = function () {
1220
1349
  }
1221
1350
  }, {
1222
1351
  key: 'saveMember',
1223
- value: function saveMember() {
1224
- var _this10 = this;
1352
+ value: function () {
1353
+ var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
1354
+ var _this11 = this;
1225
1355
 
1226
- var _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(),
1227
- PayStyle = _enumController$getEn14.PayStyle;
1356
+ var _enumController$getEn15, PayStyle, TradeType, IPMSG, dtoParams, payList, payment, tradeType, ret, _ref13, type, data, msg, code;
1228
1357
 
1229
- (0, _mobx.runInAction)(function () {
1230
- _this10.dto.StorageMutiSettleDetails = [];
1231
- var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1232
- return parseFloat(mode.value) != 0;
1233
- }) : _this10.paymode.thePaymodes;
1234
- (0, _each3.default)(thePaymodes, function (mode) {
1235
- var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1358
+ return _regenerator2.default.wrap(function _callee5$(_context5) {
1359
+ while (1) {
1360
+ switch (_context5.prev = _context5.next) {
1361
+ case 0:
1362
+ _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn15.PayStyle, TradeType = _enumController$getEn15.TradeType;
1236
1363
 
1237
- var value = parseFloat(mode.value);
1238
- var giveChange = null;
1239
- if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1240
- value = Math.Add(value, _this10.paymode.receivable);
1241
- giveChange = Math.abs(_this10.paymode.receivable);
1364
+ (0, _mobx.runInAction)(function () {
1365
+ _this11.dto.StorageMutiSettleDetails = [];
1366
+ var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1367
+ return parseFloat(mode.value) != 0;
1368
+ }) : _this11.paymode.thePaymodes;
1369
+ (0, _each3.default)(thePaymodes, function (mode) {
1370
+ var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1371
+
1372
+ var value = parseFloat(mode.value);
1373
+ var giveChange = null;
1374
+ if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1375
+ value = Math.Add(value, _this11.paymode.receivable);
1376
+ giveChange = Math.abs(_this11.paymode.receivable);
1377
+ }
1378
+ _this11.dto.StorageMutiSettleDetails.push({
1379
+ Code: mode.paymethodId,
1380
+ StorageAmount: value,
1381
+ GiveChange: giveChange,
1382
+ IdsettleStyle: themode.idSettleStyle,
1383
+ IdbankAccount: themode.idBankAccount,
1384
+ PaymentCode: mode.authCode,
1385
+ DynamicPropertyKeys: [],
1386
+ DynamicPropertyValues: [],
1387
+ DataSource: { Id: _this11.dataSource },
1388
+ ThirdPaymentInfo: themode.thridPayment || null,
1389
+ ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
1390
+ });
1391
+ });
1392
+ });
1393
+ // cc结算调用
1394
+ IPMSG = {};
1395
+
1396
+ if (!!window.localStorage.IPMSG) {
1397
+ IPMSG = JSON.parse(window.localStorage.IPMSG);
1398
+ }
1399
+ dtoParams = this.dto;
1400
+ //处理存在二开支付情况
1401
+
1402
+ payList = dtoParams.StorageMutiSettleDetails.filter(function (v) {
1403
+ return v.ThirdPaymentInfo;
1404
+ });
1405
+
1406
+ if (!(payList && payList.length > 0)) {
1407
+ _context5.next = 19;
1408
+ break;
1409
+ }
1410
+
1411
+ payment = payList[0];
1412
+ tradeType = payment && payment.StorageAmount > 0 ? TradeType.PAY : TradeType.REFUND;
1413
+ _context5.next = 11;
1414
+ return this.thirdPay(2, payment, tradeType, dtoParams);
1415
+
1416
+ case 11:
1417
+ ret = _context5.sent;
1418
+ _ref13 = ret || {}, type = _ref13.type, data = _ref13.data, msg = _ref13.msg, code = _ref13.code;
1419
+
1420
+ if (!(type === true)) {
1421
+ _context5.next = 17;
1422
+ break;
1423
+ }
1424
+
1425
+ dtoParams = data;
1426
+ _context5.next = 19;
1427
+ break;
1428
+
1429
+ case 17:
1430
+ _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1431
+ return _context5.abrupt('return', false);
1432
+
1433
+ case 19:
1434
+ this.dtoParams = dtoParams;
1435
+ console.log('储值结算信息:', dtoParams);
1436
+ return _context5.abrupt('return', (0, _tplusApi.tApi)({ dto: dtoParams }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1437
+ _this11.handlePrint(resp);
1438
+ }));
1439
+
1440
+ case 22:
1441
+ case 'end':
1442
+ return _context5.stop();
1443
+ }
1242
1444
  }
1243
- _this10.dto.StorageMutiSettleDetails.push({
1244
- Code: mode.paymethodId,
1245
- StorageAmount: value,
1246
- GiveChange: giveChange,
1247
- IdsettleStyle: themode.idSettleStyle,
1248
- IdbankAccount: themode.idBankAccount,
1249
- PaymentCode: mode.authCode,
1250
- DynamicPropertyKeys: [],
1251
- DynamicPropertyValues: [],
1252
- DataSource: { Id: _this10.dataSource }
1253
- });
1254
- });
1255
- });
1256
- // cc结算调用
1257
- var IPMSG = {};
1258
- if (!!window.localStorage.IPMSG) {
1259
- IPMSG = JSON.parse(window.localStorage.IPMSG);
1445
+ }, _callee5, this);
1446
+ }));
1447
+
1448
+ function saveMember() {
1449
+ return _ref12.apply(this, arguments);
1260
1450
  }
1261
- return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1262
- _this10.handlePrint(resp);
1263
- });
1264
- }
1451
+
1452
+ return saveMember;
1453
+ }()
1265
1454
  }, {
1266
1455
  key: 'save',
1267
1456
  value: function () {
1268
- var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1269
- var _this11 = this;
1457
+ var _ref14 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
1458
+ var _this12 = this;
1270
1459
 
1271
- var _enumController$getEn15, PayStyle, _ref14, isNewRetailBCPos, IPMSG, RetailTypeEnum, _getLoginInfo2, PreSellOrBook, PercentageWhenBook, _ref15, IdbusiType, DistributionMode, prepaidAmount;
1460
+ var _enumController$getEn16, PayStyle, TradeType, IPMSG, RetailTypeEnum, dtoParams, payList, payment, tradeType, ret, _ref15, type, data, msg, code;
1272
1461
 
1273
- return _regenerator2.default.wrap(function _callee4$(_context4) {
1462
+ return _regenerator2.default.wrap(function _callee6$(_context6) {
1274
1463
  while (1) {
1275
- switch (_context4.prev = _context4.next) {
1464
+ switch (_context6.prev = _context6.next) {
1276
1465
  case 0:
1277
- _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn15.PayStyle;
1466
+ _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn16.PayStyle, TradeType = _enumController$getEn16.TradeType;
1278
1467
 
1279
1468
  (0, _mobx.runInAction)(function () {
1280
- _this11.dto.RetailPaymentDetails = [];
1281
- _this11.dto.RetailStorageDetails = [];
1282
- _this11.dto.RetailCouponDetails = [];
1469
+ _this12.dto.RetailPaymentDetails = [];
1470
+ _this12.dto.RetailStorageDetails = [];
1471
+ _this12.dto.RetailCouponDetails = [];
1283
1472
  var czkSum = 0;
1284
1473
  var count = 0;
1285
- var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1474
+ var thePaymodes = _this12.newStyle ? (0, _filter3.default)(_this12.paymode.thePaymodes, function (mode) {
1286
1475
  return parseFloat(mode.value) != 0;
1287
- }) : _this11.paymode.thePaymodes;
1476
+ }) : _this12.paymode.thePaymodes;
1288
1477
  (0, _each3.default)(thePaymodes, function (mode, index) {
1289
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1478
+ var themode = (0, _find3.default)(_this12.paymode.paymodes, { 'paymentType': mode.paymentType });
1290
1479
  if (mode.paymentType == PayStyle.hyczk) {
1291
1480
  czkSum = Math.Add(czkSum, mode.value);
1292
- _this11.dto.RetailStorageDetails.push({
1481
+ _this12.dto.RetailStorageDetails.push({
1293
1482
  Code: mode.paymethodId,
1294
1483
  MeStorageCardId: mode.meStorageCardId,
1295
1484
  StoragePaymentAmount: mode.value,
@@ -1298,17 +1487,17 @@ var SettlementStore = (_class = function () {
1298
1487
  Idmember: mode.memberId,
1299
1488
  DynamicPropertyKeys: [],
1300
1489
  DynamicPropertyValues: [],
1301
- DataSource: { Id: _this11.dataSource },
1490
+ DataSource: { Id: _this12.dataSource },
1302
1491
  Password: mode.authCode
1303
1492
  });
1304
1493
  } else {
1305
1494
  var value = parseFloat(mode.value);
1306
1495
  var giveChange = null;
1307
- if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1308
- value = Math.Add(value, _this11.paymode.receivable);
1309
- giveChange = Math.abs(_this11.paymode.receivable);
1496
+ if (mode.paymentType == PayStyle.xianjin && _this12.paymode.receivable < 0 && value > Math.abs(_this12.paymode.receivable)) {
1497
+ value = Math.Add(value, _this12.paymode.receivable);
1498
+ giveChange = Math.abs(_this12.paymode.receivable);
1310
1499
  }
1311
- _this11.dto.RetailPaymentDetails.push({
1500
+ _this12.dto.RetailPaymentDetails.push({
1312
1501
  Code: mode.paymethodId,
1313
1502
  OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
1314
1503
  Amount: value,
@@ -1322,11 +1511,13 @@ var SettlementStore = (_class = function () {
1322
1511
  OverchargesAmount: mode.overchargesAmount,
1323
1512
  DynamicPropertyKeys: [],
1324
1513
  DynamicPropertyValues: [],
1325
- DataSource: { Id: _this11.dataSource }
1514
+ DataSource: { Id: _this12.dataSource },
1515
+ ThirdPaymentInfo: themode.thridPayment || null,
1516
+ ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
1326
1517
  });
1327
1518
  if (mode.paymentType == PayStyle.djq) {
1328
- (0, _each3.default)(_this11.paymode.checkList && _this11.paymode.checkList.length ? _this11.paymode.checkList : mode.djqs, function (djq) {
1329
- _this11.dto.RetailCouponDetails.push({
1519
+ (0, _each3.default)(_this12.paymode.checkList && _this12.paymode.checkList.length ? _this12.paymode.checkList : mode.djqs, function (djq) {
1520
+ _this12.dto.RetailCouponDetails.push({
1330
1521
  CouponCode: djq.promoCouponCode,
1331
1522
  ReductionAmount: djq.amount,
1332
1523
  EnableAmount: djq.doorsill,
@@ -1336,53 +1527,28 @@ var SettlementStore = (_class = function () {
1336
1527
  PromotionId: djq.promoId,
1337
1528
  PromotionRuleId: djq.promoRuleId,
1338
1529
  PromoCouponAllocatedId: djq.id,
1339
- DataSource: { Id: _this11.dataSource }
1530
+ DataSource: { Id: _this12.dataSource }
1340
1531
  });
1341
1532
  });
1342
1533
  }
1343
1534
  }
1344
1535
  });
1345
-
1346
- var _ref13 = _mutantsUtil.platform || {},
1347
- isNewRetailBCPos = _ref13.isNewRetailBCPos;
1348
-
1349
- if (_this11.dto.RetailStorageDetails.length > 0) {
1350
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1351
- if (isNewRetailBCPos) {
1352
- _this11.dto.RetailPaymentDetails.push({
1353
- Code: _this11.paymode.counter,
1354
- OrigAmount: czkSum,
1355
- Amount: czkSum,
1356
- IdsettleStyle: themode.idSettleStyle,
1357
- IdbankAccount: themode.idBankAccount,
1358
- DynamicPropertyKeys: [],
1359
- DynamicPropertyValues: [],
1360
- DataSource: { Id: _this11.dataSource },
1361
- RetailStorageDetails: _this11.dto.RetailStorageDetails
1362
- });
1363
- } else {
1364
- _this11.dto.RetailPaymentDetails.push({
1365
- Code: _this11.paymode.counter,
1366
- OrigAmount: czkSum,
1367
- Amount: czkSum,
1368
- IdsettleStyle: themode.idSettleStyle,
1369
- IdbankAccount: themode.idBankAccount,
1370
- DynamicPropertyKeys: [],
1371
- DynamicPropertyValues: [],
1372
- DataSource: { Id: _this11.dataSource }
1373
- });
1374
- }
1536
+ if (_this12.dto.RetailStorageDetails.length > 0) {
1537
+ var themode = (0, _find3.default)(_this12.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1538
+ _this12.dto.RetailPaymentDetails.push({
1539
+ Code: _this12.paymode.counter,
1540
+ OrigAmount: czkSum,
1541
+ Amount: czkSum,
1542
+ IdsettleStyle: themode.idSettleStyle,
1543
+ IdbankAccount: themode.idBankAccount,
1544
+ DynamicPropertyKeys: [],
1545
+ DynamicPropertyValues: [],
1546
+ DataSource: { Id: _this12.dataSource },
1547
+ RetailStorageDetails: _this12.dto.RetailStorageDetails
1548
+ });
1375
1549
  }
1376
1550
  });
1377
- _ref14 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref14.isNewRetailBCPos;
1378
-
1379
- console.log('bc_pos\u73AF\u5883:' + isNewRetailBCPos + ',\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1380
-
1381
- if (!isNewRetailBCPos) {
1382
- _context4.next = 24;
1383
- break;
1384
- }
1385
-
1551
+ console.log('\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1386
1552
  // cc结算调用
1387
1553
  IPMSG = {};
1388
1554
 
@@ -1390,84 +1556,270 @@ var SettlementStore = (_class = function () {
1390
1556
  IPMSG = JSON.parse(window.localStorage.IPMSG);
1391
1557
  }
1392
1558
  RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1393
- _getLoginInfo2 = this.getLoginInfo(), PreSellOrBook = _getLoginInfo2.PreSellOrBook, PercentageWhenBook = _getLoginInfo2.PercentageWhenBook;
1394
- _ref15 = this.dto || {}, IdbusiType = _ref15.IdbusiType, DistributionMode = _ref15.DistributionMode;
1559
+ _context6.t1 = this.dto.IdbusiType == 37;
1395
1560
 
1396
- if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
1397
- prepaidAmount = (0, _utils.getFixedNumber)(this.dto.RetailPaymentDetails.reduce(function (c, item) {
1398
- return c + (item.Amount || 0);
1399
- }, 0));
1561
+ if (!_context6.t1) {
1562
+ _context6.next = 11;
1563
+ break;
1564
+ }
1400
1565
 
1401
- (0, _mobx.runInAction)(function () {
1402
- _this11.dto.PrepaidAmount = prepaidAmount;
1403
- });
1566
+ _context6.next = 10;
1567
+ return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1568
+
1569
+ case 10:
1570
+ _context6.t1 = _context6.sent;
1571
+
1572
+ case 11:
1573
+ _context6.t0 = _context6.t1;
1574
+
1575
+ if (_context6.t0) {
1576
+ _context6.next = 14;
1577
+ break;
1404
1578
  }
1405
- this.dto.RetailDetails.forEach(function (o) {
1406
- if (o.BaseQuantity != o.Quantity && !o.Idunit2) {
1407
- (0, _mobx.runInAction)(function () {
1408
- o.BaseQuantity = o.Quantity;
1409
- });
1410
- _tplusComponentsTouch.ModalWraper.confirm({ content: '请回想该订单下单时的操作步骤,复现退货时提示"退货数量大于可退数量的问题",联系赵录方' });
1411
- }
1579
+
1580
+ _context6.t0 = this.dto.IdbusiType != 37;
1581
+
1582
+ case 14:
1583
+ if (!_context6.t0) {
1584
+ _context6.next = 33;
1585
+ break;
1586
+ }
1587
+
1588
+ dtoParams = (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } });
1589
+ //处理存在二开支付情况
1590
+
1591
+ payList = dtoParams.RetailPaymentDetails.filter(function (v) {
1592
+ return v.ThirdPaymentInfo;
1412
1593
  });
1413
- _context4.t1 = this.dto.IdbusiType == 37;
1414
1594
 
1415
- if (!_context4.t1) {
1416
- _context4.next = 17;
1595
+ if (!(payList && payList.length > 0)) {
1596
+ _context6.next = 30;
1417
1597
  break;
1418
1598
  }
1419
1599
 
1420
- _context4.next = 16;
1421
- return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1600
+ payment = payList[0];
1601
+ tradeType = payment && payment.Amount > 0 ? TradeType.PAY : TradeType.REFUND;
1602
+ _context6.next = 22;
1603
+ return this.thirdPay(1, payment, tradeType, dtoParams);
1422
1604
 
1423
- case 16:
1424
- _context4.t1 = _context4.sent;
1605
+ case 22:
1606
+ ret = _context6.sent;
1607
+ _ref15 = ret || {}, type = _ref15.type, data = _ref15.data, msg = _ref15.msg, code = _ref15.code;
1425
1608
 
1426
- case 17:
1427
- _context4.t0 = _context4.t1;
1609
+ if (!(type === true)) {
1610
+ _context6.next = 28;
1611
+ break;
1612
+ }
1613
+
1614
+ dtoParams = data;
1615
+ _context6.next = 30;
1616
+ break;
1617
+
1618
+ case 28:
1619
+ _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1620
+ return _context6.abrupt('return', false);
1621
+
1622
+ case 30:
1623
+ this.dtoParams = dtoParams;
1624
+ console.log('结算信息:', dtoParams);
1625
+ return _context6.abrupt('return', (0, _tplusApi.ccApi)({ dto: dtoParams, cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1626
+ var _ref16 = resp || {},
1627
+ ID = _ref16.ID;
1628
+
1629
+ _this12.setDtoID(ID);
1630
+ _this12.billID = ID;
1631
+ _this12.paymode.checkList = [];
1632
+ }));
1633
+
1634
+ case 33:
1635
+ case 'end':
1636
+ return _context6.stop();
1637
+ }
1638
+ }
1639
+ }, _callee6, this);
1640
+ }));
1641
+
1642
+ function save() {
1643
+ return _ref14.apply(this, arguments);
1644
+ }
1645
+
1646
+ return save;
1647
+ }()
1648
+
1649
+ //裁剪二开支付数据
1650
+
1651
+ }, {
1652
+ key: 'removeThirdPayDto',
1653
+ value: function removeThirdPayDto(dto) {
1654
+ var data = (0, _extends3.default)({}, dto);
1655
+ delete data['DynamicPropertyKeys'];
1656
+ delete data['DynamicPropertyValues'];
1657
+ return data;
1658
+ }
1659
+
1660
+ /**
1661
+ * 二开支付
1662
+ * vType:1零售单、2储值单
1663
+ * payment:结算方式
1664
+ * trade:00表示结算、02表示退款
1665
+ * dto:结算数据集合
1666
+ */
1667
+
1668
+ }, {
1669
+ key: 'thirdPay',
1670
+ value: function () {
1671
+ var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(vType, payment, trade, dto) {
1672
+ var cto, params, ret, _ref18, Code, _Message, Result, _ref19, ThirdPaymentReturnInfo;
1428
1673
 
1429
- if (_context4.t0) {
1430
- _context4.next = 20;
1674
+ return _regenerator2.default.wrap(function _callee7$(_context7) {
1675
+ while (1) {
1676
+ switch (_context7.prev = _context7.next) {
1677
+ case 0:
1678
+ _context7.prev = 0;
1679
+ cto = this.removeThirdPayDto(dto);
1680
+ params = { VoucherType: vType, Payment: payment, TradeType: trade, dto: cto };
1681
+
1682
+ console.log('刷卡信息:', (0, _stringify2.default)(params));
1683
+ _context7.next = 6;
1684
+ return new _promise2.default(function (resolve, reject) {
1685
+ _mutantsMicrofx.nativeMs.setIpcRendererMethod('ThirdPayment', (0, _extends3.default)({}, params), function (res) {
1686
+ return resolve(res);
1687
+ });
1688
+ });
1689
+
1690
+ case 6:
1691
+ ret = _context7.sent;
1692
+
1693
+ console.log('刷卡返回信息:', ret);
1694
+ ret = JSON.parse(ret);
1695
+ _ref18 = ret || {}, Code = _ref18.Code, _Message = _ref18.Message, Result = _ref18.Result;
1696
+
1697
+ if (!(Code > 0)) {
1698
+ _context7.next = 14;
1431
1699
  break;
1432
1700
  }
1433
1701
 
1434
- _context4.t0 = this.dto.IdbusiType != 37;
1702
+ return _context7.abrupt('return', { type: false, data: null, msg: _Message, code: Code });
1703
+
1704
+ case 14:
1705
+ if (!(trade == '00')) {
1706
+ _context7.next = 20;
1707
+ break;
1708
+ }
1709
+
1710
+ _ref19 = Result || {}, ThirdPaymentReturnInfo = _ref19.ThirdPaymentReturnInfo;
1711
+
1712
+ if (vType == 1) {
1713
+ dto.RetailPaymentDetails.forEach(function (v) {
1714
+ if (v.ThirdPaymentInfo != null && Math.abs(v.Amount) > 0) {
1715
+ v.ThirdPaymentReturnInfo = ThirdPaymentReturnInfo;
1716
+ }
1717
+ });
1718
+ } else if (vType == 2) {
1719
+ dto.StorageMutiSettleDetails.forEach(function (v) {
1720
+ if (v.ThirdPaymentInfo != null && Math.abs(v.StorageAmount) > 0) {
1721
+ v.ThirdPaymentReturnInfo = ThirdPaymentReturnInfo;
1722
+ }
1723
+ });
1724
+ }
1725
+ return _context7.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
1435
1726
 
1436
1727
  case 20:
1437
- if (!_context4.t0) {
1438
- _context4.next = 22;
1728
+ if (!(trade == '02')) {
1729
+ _context7.next = 22;
1439
1730
  break;
1440
1731
  }
1441
1732
 
1442
- return _context4.abrupt('return', (0, _tplusApi.ccApi)({ dto: (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } }), cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1443
- _this11.setDtoID(resp.ID);
1444
- _this11.paymode.checkList = [];
1445
- _this11.billID = resp.ID;
1446
- }));
1733
+ return _context7.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
1447
1734
 
1448
1735
  case 22:
1449
- _context4.next = 25;
1736
+ _context7.next = 27;
1450
1737
  break;
1451
1738
 
1452
1739
  case 24:
1453
- return _context4.abrupt('return', (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
1454
- _this11.setDtoID(resp.ID);
1455
- _this11.billID = resp.ID;
1456
- }));
1740
+ _context7.prev = 24;
1741
+ _context7.t0 = _context7['catch'](0);
1742
+ return _context7.abrupt('return', { type: false, data: null, msg: _context7.t0, code: '9999' });
1457
1743
 
1458
- case 25:
1744
+ case 27:
1459
1745
  case 'end':
1460
- return _context4.stop();
1746
+ return _context7.stop();
1461
1747
  }
1462
1748
  }
1463
- }, _callee4, this);
1749
+ }, _callee7, this, [[0, 24]]);
1464
1750
  }));
1465
1751
 
1466
- function save() {
1467
- return _ref12.apply(this, arguments);
1752
+ function thirdPay(_x4, _x5, _x6, _x7) {
1753
+ return _ref17.apply(this, arguments);
1468
1754
  }
1469
1755
 
1470
- return save;
1756
+ return thirdPay;
1757
+ }()
1758
+
1759
+ //二开支付强制退款情况
1760
+
1761
+ }, {
1762
+ key: 'thirdPayRefund',
1763
+ value: function () {
1764
+ var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(type) {
1765
+ var _this13 = this;
1766
+
1767
+ var dto, pay, payment, _enumController$getEn17, TradeType;
1768
+
1769
+ return _regenerator2.default.wrap(function _callee9$(_context9) {
1770
+ while (1) {
1771
+ switch (_context9.prev = _context9.next) {
1772
+ case 0:
1773
+ dto = type == 1 ? this.dtoParams.RetailPaymentDetails : this.dtoParams.StorageMutiSettleDetails;
1774
+ pay = dto && dto.filter(function (v) {
1775
+ return v.ThirdPaymentInfo;
1776
+ });
1777
+
1778
+ if (pay && pay.length > 0) {
1779
+ setTimeout(function () {
1780
+ _message2.default.warn("支付出现异常,将发起刷卡退款。", { duration: 4.5 });
1781
+ }, 1000);
1782
+ payment = pay[0];
1783
+ _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(), TradeType = _enumController$getEn17.TradeType;
1784
+
1785
+ setTimeout((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() {
1786
+ var ret, _ref22, msg;
1787
+
1788
+ return _regenerator2.default.wrap(function _callee8$(_context8) {
1789
+ while (1) {
1790
+ switch (_context8.prev = _context8.next) {
1791
+ case 0:
1792
+ _context8.next = 2;
1793
+ return _this13.thirdPay(type, payment, TradeType.REFUND, dto);
1794
+
1795
+ case 2:
1796
+ ret = _context8.sent;
1797
+ _ref22 = ret || {}, msg = _ref22.msg;
1798
+
1799
+ console.log('\u5237\u5361\u652F\u4ED8\u9000\u6B3E:' + msg);
1800
+
1801
+ case 5:
1802
+ case 'end':
1803
+ return _context8.stop();
1804
+ }
1805
+ }
1806
+ }, _callee8, _this13);
1807
+ })), 4500);
1808
+ }
1809
+
1810
+ case 3:
1811
+ case 'end':
1812
+ return _context9.stop();
1813
+ }
1814
+ }
1815
+ }, _callee9, this);
1816
+ }));
1817
+
1818
+ function thirdPayRefund(_x8) {
1819
+ return _ref20.apply(this, arguments);
1820
+ }
1821
+
1822
+ return thirdPayRefund;
1471
1823
  }()
1472
1824
  }, {
1473
1825
  key: 'setDtoID',
@@ -1477,35 +1829,35 @@ var SettlementStore = (_class = function () {
1477
1829
  }, {
1478
1830
  key: 'querySettleResult',
1479
1831
  value: function () {
1480
- var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
1481
- return _regenerator2.default.wrap(function _callee5$(_context5) {
1832
+ var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10() {
1833
+ return _regenerator2.default.wrap(function _callee10$(_context10) {
1482
1834
  while (1) {
1483
- switch (_context5.prev = _context5.next) {
1835
+ switch (_context10.prev = _context10.next) {
1484
1836
  case 0:
1485
- _context5.prev = 0;
1486
- _context5.t0 = _promise2.default;
1487
- _context5.next = 4;
1837
+ _context10.prev = 0;
1838
+ _context10.t0 = _promise2.default;
1839
+ _context10.next = 4;
1488
1840
  return (0, _tplusApi.tApi)({ RetailCode: this.dto.Code }, 'chanjet.RE.newRetail.QuerySettleResult', false, false, { timeout_skip: true });
1489
1841
 
1490
1842
  case 4:
1491
- _context5.t1 = _context5.sent;
1492
- return _context5.abrupt('return', _context5.t0.resolve.call(_context5.t0, _context5.t1));
1843
+ _context10.t1 = _context10.sent;
1844
+ return _context10.abrupt('return', _context10.t0.resolve.call(_context10.t0, _context10.t1));
1493
1845
 
1494
1846
  case 8:
1495
- _context5.prev = 8;
1496
- _context5.t2 = _context5['catch'](0);
1497
- return _context5.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1847
+ _context10.prev = 8;
1848
+ _context10.t2 = _context10['catch'](0);
1849
+ return _context10.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1498
1850
 
1499
1851
  case 11:
1500
1852
  case 'end':
1501
- return _context5.stop();
1853
+ return _context10.stop();
1502
1854
  }
1503
1855
  }
1504
- }, _callee5, this, [[0, 8]]);
1856
+ }, _callee10, this, [[0, 8]]);
1505
1857
  }));
1506
1858
 
1507
1859
  function querySettleResult() {
1508
- return _ref16.apply(this, arguments);
1860
+ return _ref23.apply(this, arguments);
1509
1861
  }
1510
1862
 
1511
1863
  return querySettleResult;
@@ -1531,18 +1883,18 @@ var SettlementStore = (_class = function () {
1531
1883
  }, {
1532
1884
  key: 'validePwd',
1533
1885
  value: function () {
1534
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(value) {
1535
- var _ref18, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, result, count, _result;
1886
+ var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11(value) {
1887
+ var _ref25, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, result, count, _result;
1536
1888
 
1537
- return _regenerator2.default.wrap(function _callee6$(_context6) {
1889
+ return _regenerator2.default.wrap(function _callee11$(_context11) {
1538
1890
  while (1) {
1539
- switch (_context6.prev = _context6.next) {
1891
+ switch (_context11.prev = _context11.next) {
1540
1892
  case 0:
1541
- _ref18 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref18.isNewRetailBCPos;
1542
- _context6.prev = 1;
1893
+ _ref25 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref25.isNewRetailBCPos;
1894
+ _context11.prev = 1;
1543
1895
 
1544
1896
  if (!isNewRetailBCPos) {
1545
- _context6.next = 33;
1897
+ _context11.next = 33;
1546
1898
  break;
1547
1899
  }
1548
1900
 
@@ -1552,60 +1904,60 @@ var SettlementStore = (_class = function () {
1552
1904
  memberStorageId = this.paymode.currentMode.meStorageCardId;
1553
1905
 
1554
1906
  if (!cook2) {
1555
- _context6.next = 12;
1907
+ _context11.next = 12;
1556
1908
  break;
1557
1909
  }
1558
1910
 
1559
1911
  if (!cook2.hasOwnProperty(memberStorageId + "")) {
1560
- _context6.next = 12;
1912
+ _context11.next = 12;
1561
1913
  break;
1562
1914
  }
1563
1915
 
1564
1916
  if (!(cook2[memberStorageId] > 3)) {
1565
- _context6.next = 12;
1917
+ _context11.next = 12;
1566
1918
  break;
1567
1919
  }
1568
1920
 
1569
1921
  message = '今日密码错误已达上限,不可使用储值消费,请明日再试,如忘记请重置密码或修改密码。';
1570
- return _context6.abrupt('return', _promise2.default.resolve(message));
1922
+ return _context11.abrupt('return', _promise2.default.resolve(message));
1571
1923
 
1572
1924
  case 12:
1573
1925
  _paymode$currentMode = this.paymode.currentMode, cardTypeEnum = _paymode$currentMode.cardTypeEnum, memberId = _paymode$currentMode.memberId, meStorageCardId = _paymode$currentMode.meStorageCardId, cardStatusEnum = _paymode$currentMode.cardStatusEnum;
1574
1926
  result = null;
1575
1927
 
1576
1928
  if (!(cardTypeEnum === 'BALANCE_CARD')) {
1577
- _context6.next = 20;
1929
+ _context11.next = 20;
1578
1930
  break;
1579
1931
  }
1580
1932
 
1581
- _context6.next = 17;
1933
+ _context11.next = 17;
1582
1934
  return (0, _tplusApi.ccApi)({ md5Password: _tplusApi.User.pwdEncrypt(value.pwd), cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + memberId, false, false);
1583
1935
 
1584
1936
  case 17:
1585
- result = _context6.sent;
1586
- _context6.next = 29;
1937
+ result = _context11.sent;
1938
+ _context11.next = 29;
1587
1939
  break;
1588
1940
 
1589
1941
  case 20:
1590
1942
  if (!(cardStatusEnum === 'BINDING' && this.member && this.member.ID === memberId)) {
1591
- _context6.next = 26;
1943
+ _context11.next = 26;
1592
1944
  break;
1593
1945
  }
1594
1946
 
1595
- _context6.next = 23;
1947
+ _context11.next = 23;
1596
1948
  return (0, _tplusApi.ccApi)({ md5Password: _tplusApi.User.pwdEncrypt(value.pwd), password: value.pwd, cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + meStorageCardId, false, false);
1597
1949
 
1598
1950
  case 23:
1599
- result = _context6.sent;
1600
- _context6.next = 29;
1951
+ result = _context11.sent;
1952
+ _context11.next = 29;
1601
1953
  break;
1602
1954
 
1603
1955
  case 26:
1604
- _context6.next = 28;
1956
+ _context11.next = 28;
1605
1957
  return (0, _tplusApi.ccApi)({ password: value.pwd, cardType: cardTypeEnum }, '/member/MeMemberWallet/checkPaymentPassword/' + meStorageCardId, false, false);
1606
1958
 
1607
1959
  case 28:
1608
- result = _context6.sent;
1960
+ result = _context11.sent;
1609
1961
 
1610
1962
  case 29:
1611
1963
  if (!result.data) {
@@ -1624,38 +1976,38 @@ var SettlementStore = (_class = function () {
1624
1976
  this.setCookie('errorPwd', '', -1);
1625
1977
  this.setCookie('errorPwd', (0, _stringify2.default)(cook2));
1626
1978
  }
1627
- return _context6.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1979
+ return _context11.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1628
1980
 
1629
1981
  case 33:
1630
- _context6.next = 35;
1982
+ _context11.next = 35;
1631
1983
  return (0, _tplusApi.tApi)({ "CheckoutParams": {
1632
1984
  "Idmember": value.id,
1633
1985
  "Password": value.pwd
1634
1986
  } }, 'AA.DR.newRetailMember.CheckoutMemberPassword', false, false);
1635
1987
 
1636
1988
  case 35:
1637
- _result = _context6.sent;
1638
- return _context6.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1989
+ _result = _context11.sent;
1990
+ return _context11.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1639
1991
 
1640
1992
  case 37:
1641
- _context6.next = 42;
1993
+ _context11.next = 42;
1642
1994
  break;
1643
1995
 
1644
1996
  case 39:
1645
- _context6.prev = 39;
1646
- _context6.t0 = _context6['catch'](1);
1647
- return _context6.abrupt('return', "failed");
1997
+ _context11.prev = 39;
1998
+ _context11.t0 = _context11['catch'](1);
1999
+ return _context11.abrupt('return', "failed");
1648
2000
 
1649
2001
  case 42:
1650
2002
  case 'end':
1651
- return _context6.stop();
2003
+ return _context11.stop();
1652
2004
  }
1653
2005
  }
1654
- }, _callee6, this, [[1, 39]]);
2006
+ }, _callee11, this, [[1, 39]]);
1655
2007
  }));
1656
2008
 
1657
- function validePwd(_x4) {
1658
- return _ref17.apply(this, arguments);
2009
+ function validePwd(_x9) {
2010
+ return _ref24.apply(this, arguments);
1659
2011
  }
1660
2012
 
1661
2013
  return validePwd;
@@ -1665,7 +2017,7 @@ var SettlementStore = (_class = function () {
1665
2017
  }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
1666
2018
  enumerable: true,
1667
2019
  initializer: function initializer() {
1668
- var _this12 = this;
2020
+ var _this14 = this;
1669
2021
 
1670
2022
  return function (newPass, newPassConfirm) {
1671
2023
  if (!newPass || !newPassConfirm) {
@@ -1677,7 +2029,7 @@ var SettlementStore = (_class = function () {
1677
2029
  var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
1678
2030
  return (0, _tplusApi.ccApi)({
1679
2031
  Idstore: idstore,
1680
- meMemberId: _this12.paymode.currentMode.memberId,
2032
+ meMemberId: _this14.paymode.currentMode.memberId,
1681
2033
  oldPassword: null,
1682
2034
  newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
1683
2035
  dataSource: "POS"
@@ -1691,131 +2043,131 @@ var SettlementStore = (_class = function () {
1691
2043
  }), _applyDecoratedDescriptor(_class.prototype, 'initByOriginReturn', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'initByOriginReturn'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'quickSettle', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'quickSettle'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusAndAddPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusAndAddPay'), _class.prototype), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'updateMemberInfo', [_mobx.action], {
1692
2044
  enumerable: true,
1693
2045
  initializer: function initializer() {
1694
- var _this13 = this;
2046
+ var _this15 = this;
1695
2047
 
1696
2048
  return function () {
1697
- var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(_this) {
1698
- var _getLoginInfo3, IdStore, StoreCode, resp;
2049
+ var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(_this) {
2050
+ var _getLoginInfo2, IdStore, StoreCode, resp;
1699
2051
 
1700
- return _regenerator2.default.wrap(function _callee7$(_context7) {
2052
+ return _regenerator2.default.wrap(function _callee12$(_context12) {
1701
2053
  while (1) {
1702
- switch (_context7.prev = _context7.next) {
2054
+ switch (_context12.prev = _context12.next) {
1703
2055
  case 0:
1704
- _getLoginInfo3 = _this13.getLoginInfo(), IdStore = _getLoginInfo3.IdStore, StoreCode = _getLoginInfo3.StoreCode;
1705
- _context7.next = 3;
1706
- return (0, _tplusApi.tApi)({ Idmember: _this13.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
2056
+ _getLoginInfo2 = _this15.getLoginInfo(), IdStore = _getLoginInfo2.IdStore, StoreCode = _getLoginInfo2.StoreCode;
2057
+ _context12.next = 3;
2058
+ return (0, _tplusApi.tApi)({ Idmember: _this15.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
1707
2059
 
1708
2060
  case 3:
1709
- resp = _context7.sent;
2061
+ resp = _context12.sent;
1710
2062
 
1711
2063
  _this.member = resp;
1712
2064
  _this.paymode.updateMemberStorageCardNo(resp.StorageCardNo, resp.WalletEnabled);
1713
- return _context7.abrupt('return', _promise2.default.resolve(resp));
2065
+ return _context12.abrupt('return', _promise2.default.resolve(resp));
1714
2066
 
1715
2067
  case 7:
1716
2068
  case 'end':
1717
- return _context7.stop();
2069
+ return _context12.stop();
1718
2070
  }
1719
2071
  }
1720
- }, _callee7, _this13);
2072
+ }, _callee12, _this15);
1721
2073
  }));
1722
2074
 
1723
- return function (_x5) {
1724
- return _ref19.apply(this, arguments);
2075
+ return function (_x10) {
2076
+ return _ref26.apply(this, arguments);
1725
2077
  };
1726
2078
  }();
1727
2079
  }
1728
2080
  }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'updateCurrentMode', [_mobx.action], {
1729
2081
  enumerable: true,
1730
2082
  initializer: function initializer() {
1731
- var _this14 = this;
2083
+ var _this16 = this;
1732
2084
 
1733
2085
  return function () {
1734
- var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(memberId) {
2086
+ var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(memberId) {
1735
2087
  var result;
1736
- return _regenerator2.default.wrap(function _callee8$(_context8) {
2088
+ return _regenerator2.default.wrap(function _callee13$(_context13) {
1737
2089
  while (1) {
1738
- switch (_context8.prev = _context8.next) {
2090
+ switch (_context13.prev = _context13.next) {
1739
2091
  case 0:
1740
- _context8.next = 2;
2092
+ _context13.next = 2;
1741
2093
  return (0, _tplusApi.ccApi)({}, '/marketingtool/MeStorageCard/getCardInfoByMemberId/' + memberId + '/' + true, false, false, { method: 'get' });
1742
2094
 
1743
2095
  case 2:
1744
- result = _context8.sent;
2096
+ result = _context13.sent;
1745
2097
 
1746
2098
  if (!(result && result.data.length)) {
1747
- _context8.next = 20;
2099
+ _context13.next = 20;
1748
2100
  break;
1749
2101
  }
1750
2102
 
1751
2103
  if (!(result.data.length === 1)) {
1752
- _context8.next = 9;
2104
+ _context13.next = 9;
1753
2105
  break;
1754
2106
  }
1755
2107
 
1756
- _this14.paymode.updateCardInfo(result.data[0]);
1757
- return _context8.abrupt('return', result.data);
2108
+ _this16.paymode.updateCardInfo(result.data[0]);
2109
+ return _context13.abrupt('return', result.data);
1758
2110
 
1759
2111
  case 9:
1760
2112
  if (!(result.data && result.data.length === 1)) {
1761
- _context8.next = 14;
2113
+ _context13.next = 14;
1762
2114
  break;
1763
2115
  }
1764
2116
 
1765
- _this14.paymode.updateCardInfo(result.data[0]);
1766
- return _context8.abrupt('return', result.data);
2117
+ _this16.paymode.updateCardInfo(result.data[0]);
2118
+ return _context13.abrupt('return', result.data);
1767
2119
 
1768
2120
  case 14:
1769
2121
  if (!(result.data && result.data.length > 1)) {
1770
- _context8.next = 18;
2122
+ _context13.next = 18;
1771
2123
  break;
1772
2124
  }
1773
2125
 
1774
- return _context8.abrupt('return', result.data);
2126
+ return _context13.abrupt('return', result.data);
1775
2127
 
1776
2128
  case 18:
1777
2129
  _message2.default.warn('没有可用储值卡!');
1778
- return _context8.abrupt('return', false);
2130
+ return _context13.abrupt('return', false);
1779
2131
 
1780
2132
  case 20:
1781
2133
  case 'end':
1782
- return _context8.stop();
2134
+ return _context13.stop();
1783
2135
  }
1784
2136
  }
1785
- }, _callee8, _this14);
2137
+ }, _callee13, _this16);
1786
2138
  }));
1787
2139
 
1788
- return function (_x6) {
1789
- return _ref20.apply(this, arguments);
2140
+ return function (_x11) {
2141
+ return _ref27.apply(this, arguments);
1790
2142
  };
1791
2143
  }();
1792
2144
  }
1793
2145
  }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'updateCardInfo', [_mobx.action], {
1794
2146
  enumerable: true,
1795
2147
  initializer: function initializer() {
1796
- var _this15 = this;
2148
+ var _this17 = this;
1797
2149
 
1798
- return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9() {
2150
+ return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
1799
2151
  var address, result;
1800
- return _regenerator2.default.wrap(function _callee9$(_context9) {
2152
+ return _regenerator2.default.wrap(function _callee14$(_context14) {
1801
2153
  while (1) {
1802
- switch (_context9.prev = _context9.next) {
2154
+ switch (_context14.prev = _context14.next) {
1803
2155
  case 0:
1804
- address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + _this15.paymode.currentMode.storageCardNo;
1805
- _context9.next = 3;
2156
+ address = '/marketingtool/MeStorageCard/getCardInfoByCardNo/' + _this17.paymode.currentMode.storageCardNo;
2157
+ _context14.next = 3;
1806
2158
  return (0, _tplusApi.ccApi)({}, address, false, false, { method: 'get', timeout_skip: true });
1807
2159
 
1808
2160
  case 3:
1809
- result = _context9.sent;
2161
+ result = _context14.sent;
1810
2162
 
1811
- _this15.paymode.updateCardInfo(result.data);
2163
+ _this17.paymode.updateCardInfo(result.data);
1812
2164
 
1813
2165
  case 5:
1814
2166
  case 'end':
1815
- return _context9.stop();
2167
+ return _context14.stop();
1816
2168
  }
1817
2169
  }
1818
- }, _callee9, _this15);
2170
+ }, _callee14, _this17);
1819
2171
  }));
1820
2172
  }
1821
2173
  }), _applyDecoratedDescriptor(_class.prototype, 'addDjq', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addDjq'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeClickFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeClickFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPayDirectly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPayDirectly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'delPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'delPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'setDtoID', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'setDtoID'), _class.prototype)), _class);
@@ -1934,7 +2286,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1934
2286
  }, {
1935
2287
  key: 'calcDjqCheckValue',
1936
2288
  value: function calcDjqCheckValue(q1, dto, params) {
1937
- var _this16 = this;
2289
+ var _this18 = this;
1938
2290
 
1939
2291
  var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
1940
2292
  var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
@@ -1948,12 +2300,12 @@ var PayMode = exports.PayMode = (_class3 = function () {
1948
2300
  this.checkList = [];
1949
2301
  }
1950
2302
 
1951
- var _ref22 = _mutantsUtil.platform || {},
1952
- isNewRetailBCPos = _ref22.isNewRetailBCPos;
2303
+ var _ref29 = _mutantsUtil.platform || {},
2304
+ isNewRetailBCPos = _ref29.isNewRetailBCPos;
1953
2305
 
1954
- var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1955
- PayStyle = _enumController$getEn16.PayStyle,
1956
- Differentiate = _enumController$getEn16.Differentiate;
2306
+ var _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(),
2307
+ PayStyle = _enumController$getEn18.PayStyle,
2308
+ Differentiate = _enumController$getEn18.Differentiate;
1957
2309
 
1958
2310
  if (q1) {
1959
2311
  if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
@@ -1981,7 +2333,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1981
2333
  if (!q1.checked) {
1982
2334
  this.checkList.forEach(function (ele, i) {
1983
2335
  if (ele.id === q1.id) {
1984
- _this16.checkList.splice(i, 1);
2336
+ _this18.checkList.splice(i, 1);
1985
2337
  }
1986
2338
  });
1987
2339
  } else {
@@ -2053,24 +2405,24 @@ var PayMode = exports.PayMode = (_class3 = function () {
2053
2405
  if (result && result.length != 0) {
2054
2406
  result.forEach(function (element, index) {
2055
2407
  var djq1 = false;
2056
- _this16.currentMode.djqs.forEach(function (djq) {
2408
+ _this18.currentMode.djqs.forEach(function (djq) {
2057
2409
  if (element.id === djq.id) {
2058
2410
  djq1 = true;
2059
2411
  }
2060
2412
  });
2061
2413
 
2062
- var _ref23 = element || {},
2063
- couponCode = _ref23.couponCode,
2064
- name = _ref23.name,
2065
- tieredAmountResult = _ref23.tieredAmountResult,
2066
- fromDate = _ref23.fromDate,
2067
- dateMount = _ref23.dateMount,
2068
- promoMethodEnum = _ref23.promoMethodEnum,
2069
- discountPct = _ref23.discountPct,
2070
- nominalAmount = _ref23.nominalAmount,
2071
- promoId = _ref23.promoId,
2072
- id = _ref23.id,
2073
- doorsill = _ref23.doorsill;
2414
+ var _ref30 = element || {},
2415
+ couponCode = _ref30.couponCode,
2416
+ name = _ref30.name,
2417
+ tieredAmountResult = _ref30.tieredAmountResult,
2418
+ fromDate = _ref30.fromDate,
2419
+ dateMount = _ref30.dateMount,
2420
+ promoMethodEnum = _ref30.promoMethodEnum,
2421
+ discountPct = _ref30.discountPct,
2422
+ nominalAmount = _ref30.nominalAmount,
2423
+ promoId = _ref30.promoId,
2424
+ id = _ref30.id,
2425
+ doorsill = _ref30.doorsill;
2074
2426
 
2075
2427
  var condValue = tieredAmountResult.condValue,
2076
2428
  promoDiscount = tieredAmountResult.promoDiscount,
@@ -2098,10 +2450,10 @@ var PayMode = exports.PayMode = (_class3 = function () {
2098
2450
  // couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
2099
2451
  // id
2100
2452
  // })
2101
- _this16.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
2453
+ _this18.addDjqs(couponCode, name, true, nominalAmount, promoDiscount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
2102
2454
  djq1 = false;
2103
2455
  } else {
2104
- _this16.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
2456
+ _this18.setCouponNum(element.id, couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
2105
2457
  // this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
2106
2458
  // djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
2107
2459
  }
@@ -2114,11 +2466,11 @@ var PayMode = exports.PayMode = (_class3 = function () {
2114
2466
  }, {
2115
2467
  key: 'calcDjqValue',
2116
2468
  value: function calcDjqValue(q1) {
2117
- var _ref24 = _mutantsUtil.platform || {},
2118
- isNewRetailBCPos = _ref24.isNewRetailBCPos;
2469
+ var _ref31 = _mutantsUtil.platform || {},
2470
+ isNewRetailBCPos = _ref31.isNewRetailBCPos;
2119
2471
 
2120
- var _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(),
2121
- Differentiate = _enumController$getEn17.Differentiate;
2472
+ var _enumController$getEn19 = _mutantsUtil.enumController.getEnumOj(),
2473
+ Differentiate = _enumController$getEn19.Differentiate;
2122
2474
 
2123
2475
  if (q1) {
2124
2476
  if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
@@ -2180,8 +2532,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
2180
2532
  this.currentMode.errinfo = '';
2181
2533
  var sum = this.amount;
2182
2534
 
2183
- var _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(),
2184
- PayStyle = _enumController$getEn18.PayStyle;
2535
+ var _enumController$getEn20 = _mutantsUtil.enumController.getEnumOj(),
2536
+ PayStyle = _enumController$getEn20.PayStyle;
2185
2537
 
2186
2538
  this.thePaymodes && this.thePaymodes.forEach(function (mode) {
2187
2539
  if (mode.paymentType === PayStyle.hyczk) {
@@ -2205,30 +2557,36 @@ var PayMode = exports.PayMode = (_class3 = function () {
2205
2557
  }, {
2206
2558
  key: 'setPaymodes',
2207
2559
  value: function () {
2208
- var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(type, isIntegralExchange) {
2209
- var _this17 = this;
2560
+ var _ref32 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(type, isIntegralExchange) {
2561
+ var _this19 = this;
2210
2562
 
2211
- var _enumController$getEn19, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2563
+ var _ref33, isHorizontalPad, isHorizontalSunMi, isMobileEnvironment, _enumController$getEn21, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2212
2564
 
2213
- return _regenerator2.default.wrap(function _callee10$(_context10) {
2565
+ return _regenerator2.default.wrap(function _callee15$(_context15) {
2214
2566
  while (1) {
2215
- switch (_context10.prev = _context10.next) {
2567
+ switch (_context15.prev = _context15.next) {
2216
2568
  case 0:
2217
- _enumController$getEn19 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn19.settleStyleType, PayStyle = _enumController$getEn19.PayStyle;
2569
+ // 是否移动端判断
2570
+ _ref33 = _mutantsUtil.platform || {}, isHorizontalPad = _ref33.isHorizontalPad, isHorizontalSunMi = _ref33.isHorizontalSunMi;
2571
+ isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
2572
+ _enumController$getEn21 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn21.settleStyleType, PayStyle = _enumController$getEn21.PayStyle;
2218
2573
  memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
2219
2574
  param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
2220
- _context10.next = 5;
2575
+ _context15.next = 7;
2221
2576
  return (0, _tplusApi.tApi)({ param: param }, 'chanjet.RE.NewPos.GetNewStoreSettleStyles', false, false);
2222
2577
 
2223
- case 5:
2224
- modes = _context10.sent;
2578
+ case 7:
2579
+ modes = _context15.sent;
2225
2580
 
2226
2581
  if (modes) {
2227
2582
  (0, _mobx.runInAction)(function () {
2228
2583
  var paymodes = [];
2229
- (0, _each3.default)(modes.SettleStyles, function (mode, index) {
2584
+ var settleLists = modes.SettleStyles;
2585
+ settleLists = isMobileEnvironment ? settleLists.filter(function (v) {
2586
+ return !v.ThirdPaymentInfo;
2587
+ }) : settleLists;
2588
+ (0, _each3.default)(settleLists, function (mode, index) {
2230
2589
  //产品需求确认会员储值卡结算方式前端展示统一调整为“储值卡" tuzha by 2020-07-08
2231
-
2232
2590
  if (mode.Code == PayStyle.hyczk) {
2233
2591
  mode.Name = '储值卡';
2234
2592
  }
@@ -2244,24 +2602,24 @@ var PayMode = exports.PayMode = (_class3 = function () {
2244
2602
  exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
2245
2603
  idCurrency: mode.Currency ? mode.Currency.ID : -1,
2246
2604
  calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88",
2247
- virtualPay: mode.VirtualPay
2605
+ virtualPay: mode.VirtualPay,
2606
+ thridPayment: mode.ThirdPaymentInfo
2248
2607
  });
2249
2608
  });
2250
- _this17.paymodes = paymodes;
2251
- //modes.QuickSettleStyles
2609
+ _this19.paymodes = paymodes;
2252
2610
  });
2253
2611
  }
2254
2612
 
2255
- case 7:
2613
+ case 9:
2256
2614
  case 'end':
2257
- return _context10.stop();
2615
+ return _context15.stop();
2258
2616
  }
2259
2617
  }
2260
- }, _callee10, this);
2618
+ }, _callee15, this);
2261
2619
  }));
2262
2620
 
2263
- function setPaymodes(_x7, _x8) {
2264
- return _ref25.apply(this, arguments);
2621
+ function setPaymodes(_x12, _x13) {
2622
+ return _ref32.apply(this, arguments);
2265
2623
  }
2266
2624
 
2267
2625
  return setPaymodes;
@@ -2316,21 +2674,22 @@ var PayMode = exports.PayMode = (_class3 = function () {
2316
2674
  }), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _descriptor12 = _applyDecoratedDescriptor(_class3.prototype, 'calcCheckList', [_mobx.action], {
2317
2675
  enumerable: true,
2318
2676
  initializer: function initializer() {
2319
- var _this18 = this;
2677
+ var _this20 = this;
2320
2678
 
2321
2679
  return function () {
2322
- _this18.checkList = [];
2680
+ _this20.checkList = [];
2323
2681
  };
2324
2682
  }
2325
2683
  }), _applyDecoratedDescriptor(_class3.prototype, 'updateMemberStorageCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'updateMemberStorageCardNo'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'updateCardInfo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'updateCardInfo'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor13 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
2326
2684
  enumerable: true,
2327
2685
  initializer: function initializer() {
2328
- var _this19 = this;
2686
+ var _this21 = this;
2329
2687
 
2330
2688
  return function (id, couponNum, promoMethodEnum, nominalAmount, promoDiscount) {
2331
- _this19.currentMode.djqs.forEach(function (ele) {
2689
+ _this21.currentMode.djqs.forEach(function (ele) {
2332
2690
  if (ele.id === id) {
2333
- promoMethodEnum == "CASH_COUPON" ? ele.amount = nominalAmount : ele.amount = promoDiscount;
2691
+ ele.amount = promoDiscount;
2692
+ promoMethodEnum == "CASH_COUPON" && (ele.nominalAmount = nominalAmount);
2334
2693
  ele.couponCategoryEnum = couponNum;
2335
2694
  var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
2336
2695
  ele.IsEnable = IsEnable;
@@ -2341,13 +2700,14 @@ var PayMode = exports.PayMode = (_class3 = function () {
2341
2700
  }), _descriptor14 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
2342
2701
  enumerable: true,
2343
2702
  initializer: function initializer() {
2344
- var _this20 = this;
2703
+ var _this22 = this;
2345
2704
 
2346
- return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2705
+ return function (promoCouponCode, name, IsEnable, nominalAmount, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2347
2706
  var djq = {
2348
2707
  promoCouponCode: promoCouponCode,
2349
2708
  name: name,
2350
2709
  IsEnable: IsEnable,
2710
+ nominalAmount: nominalAmount,
2351
2711
  amount: amount,
2352
2712
  doorsill: doorsill,
2353
2713
  LastTS: LastTS,
@@ -2363,13 +2723,13 @@ var PayMode = exports.PayMode = (_class3 = function () {
2363
2723
  couponCategoryEnum: couponCategoryEnum,
2364
2724
  id: id
2365
2725
  };
2366
- _this20.currentMode.djqs.push(djq);
2726
+ _this22.currentMode.djqs.push(djq);
2367
2727
  };
2368
2728
  }
2369
2729
  }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'reCalculationDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'reCalculationDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clearDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clearDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'setCurrentModeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'setCurrentModeValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcMemberBalance', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcMemberBalance'), _class3.prototype)), _class3);
2370
2730
  var Member = exports.Member = (_class5 = function () {
2371
2731
  function Member(m) {
2372
- var _this21 = this;
2732
+ var _this23 = this;
2373
2733
 
2374
2734
  (0, _classCallCheck3.default)(this, Member);
2375
2735
 
@@ -2392,15 +2752,15 @@ var Member = exports.Member = (_class5 = function () {
2392
2752
  return key == 'canusedbalancestorage';
2393
2753
  });
2394
2754
 
2395
- var _ref26 = _mutantsUtil.platform || {},
2396
- isNewRetailBCPos = _ref26.isNewRetailBCPos;
2755
+ var _ref34 = _mutantsUtil.platform || {},
2756
+ isNewRetailBCPos = _ref34.isNewRetailBCPos;
2397
2757
 
2398
2758
  (0, _mobx.runInAction)(function () {
2399
- _this21.cardNo = m.CardCode;
2759
+ _this23.cardNo = m.CardCode;
2400
2760
  if (index >= 0) {
2401
- _this21.balance = parseFloat(m.DynamicPropertyValues[index]);
2761
+ _this23.balance = parseFloat(m.DynamicPropertyValues[index]);
2402
2762
  } else {
2403
- _this21.balance = _this21.rawbalance;
2763
+ _this23.balance = _this23.rawbalance;
2404
2764
  }
2405
2765
  });
2406
2766
  this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;