tplus-components-touch 3.27.20 → 3.27.24

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.
@@ -470,6 +470,8 @@ var SettlementStore = (_class = function () {
470
470
  this.paymode.bookMaxValue = value;
471
471
  this.paymode.isNotFullBook = true;
472
472
  value = value * PercentageWhenBook / 100;
473
+ }
474
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK') {
473
475
  (0, _mobx.runInAction)(function () {
474
476
  _this3.dto.PrepaidAmount = value;
475
477
  });
@@ -605,7 +607,7 @@ var SettlementStore = (_class = function () {
605
607
 
606
608
  }, {
607
609
  key: 'changeFocusAndAddPay',
608
- value: function changeFocusAndAddPay(type) {
610
+ value: function changeFocusAndAddPay(type, bookType) {
609
611
  var _this6 = this;
610
612
 
611
613
  var _enumController$getEn5 = _mutantsUtil.enumController.getEnumOj(),
@@ -637,7 +639,7 @@ var SettlementStore = (_class = function () {
637
639
  this.addPayDirectly(this.paymode.currentMode);
638
640
  }
639
641
  } else {
640
- this.addPay(type);
642
+ this.addPay(type, bookType);
641
643
  }
642
644
  }
643
645
 
@@ -866,7 +868,8 @@ var SettlementStore = (_class = function () {
866
868
  authCode: '',
867
869
  steadCashIntegral: null,
868
870
  errinfo: '',
869
- maxamount: this.paymode.amount
871
+ maxamount: this.paymode.amount,
872
+ virtualPay: themode.virtualPay
870
873
  });
871
874
  if (type == PayStyle.hyczk) {
872
875
  if (!mode.member.id || !mode.member.StorageCardNo) {
@@ -940,12 +943,12 @@ var SettlementStore = (_class = function () {
940
943
  mode.value = shouldSetValue;
941
944
  mode.value2 = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? shouldSetValue / mode.exchangeRate : shouldSetValue * mode.exchangeRate);
942
945
  mode.value3 = shouldSetValue;
943
- this.paymode.calcReserved();
946
+ this.paymode.calcReserved('bookPay'); //参数multiPay代表复合结算
944
947
  }
945
948
  }
946
949
  }, {
947
950
  key: 'changeValue',
948
- value: function changeValue(index, value, blur) {
951
+ value: function changeValue(index, value, blur, type) {
949
952
  var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
950
953
  var v = blur ? (0, _utils.getFixedNumber)(value) : isNaN(value) && value != '-' ? 0.00 : value;
951
954
  if (mode) {
@@ -961,7 +964,7 @@ var SettlementStore = (_class = function () {
961
964
  mode.value2 = v;
962
965
  }
963
966
 
964
- this.paymode.calcReserved(true);
967
+ this.paymode.calcReserved(type);
965
968
  }
966
969
  }
967
970
  }, {
@@ -985,7 +988,7 @@ var SettlementStore = (_class = function () {
985
988
  }
986
989
  }, {
987
990
  key: 'addPay',
988
- value: function addPay(type) {
991
+ value: function addPay(type, bookType) {
989
992
  var _enumController$getEn11 = _mutantsUtil.enumController.getEnumOj(),
990
993
  PayStyle = _enumController$getEn11.PayStyle;
991
994
 
@@ -998,11 +1001,11 @@ var SettlementStore = (_class = function () {
998
1001
  }
999
1002
  // this.paymode.thePaymodes.push(this.genNewMode(type) );
1000
1003
  this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk));
1001
- this.paymode.calcReserved();
1004
+ this.paymode.calcReserved(bookType);
1002
1005
  }
1003
1006
  }, {
1004
1007
  key: 'delPay',
1005
- value: function delPay(index) {
1008
+ value: function delPay(index, bookType) {
1006
1009
  var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
1007
1010
  PayStyle = _enumController$getEn12.PayStyle;
1008
1011
 
@@ -1010,7 +1013,7 @@ var SettlementStore = (_class = function () {
1010
1013
  return mode.paymethodId === index;
1011
1014
  });
1012
1015
  this.paymode.currentFocus = -1;
1013
- this.paymode.calcReserved();
1016
+ this.paymode.calcReserved(bookType);
1014
1017
  }
1015
1018
  }, {
1016
1019
  key: 'commit',
@@ -1149,7 +1152,7 @@ var SettlementStore = (_class = function () {
1149
1152
  var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
1150
1153
  var _this11 = this;
1151
1154
 
1152
- var _enumController$getEn14, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum;
1155
+ var _enumController$getEn14, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum, _getLoginInfo2, PreSellOrBook, PercentageWhenBook, _ref16, IdbusiType, DistributionMode, prepaidAmount;
1153
1156
 
1154
1157
  return _regenerator2.default.wrap(function _callee3$(_context3) {
1155
1158
  while (1) {
@@ -1269,7 +1272,7 @@ var SettlementStore = (_class = function () {
1269
1272
  console.log('bc_pos\u73AF\u5883:' + isNewRetailBCPos + ',\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1270
1273
 
1271
1274
  if (!isNewRetailBCPos) {
1272
- _context3.next = 20;
1275
+ _context3.next = 23;
1273
1276
  break;
1274
1277
  }
1275
1278
 
@@ -1280,32 +1283,44 @@ var SettlementStore = (_class = function () {
1280
1283
  IPMSG = JSON.parse(window.localStorage.IPMSG);
1281
1284
  }
1282
1285
  RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1286
+ _getLoginInfo2 = this.getLoginInfo(), PreSellOrBook = _getLoginInfo2.PreSellOrBook, PercentageWhenBook = _getLoginInfo2.PercentageWhenBook;
1287
+ _ref16 = this.dto || {}, IdbusiType = _ref16.IdbusiType, DistributionMode = _ref16.DistributionMode;
1288
+
1289
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
1290
+ prepaidAmount = this.dto.RetailPaymentDetails.reduce(function (c, item) {
1291
+ return c + (item.Amount || 0);
1292
+ }, 0);
1293
+
1294
+ (0, _mobx.runInAction)(function () {
1295
+ _this11.dto.PrepaidAmount = prepaidAmount;
1296
+ });
1297
+ }
1283
1298
  _context3.t1 = this.dto.IdbusiType == 37;
1284
1299
 
1285
1300
  if (!_context3.t1) {
1286
- _context3.next = 13;
1301
+ _context3.next = 16;
1287
1302
  break;
1288
1303
  }
1289
1304
 
1290
- _context3.next = 12;
1305
+ _context3.next = 15;
1291
1306
  return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1292
1307
 
1293
- case 12:
1308
+ case 15:
1294
1309
  _context3.t1 = _context3.sent;
1295
1310
 
1296
- case 13:
1311
+ case 16:
1297
1312
  _context3.t0 = _context3.t1;
1298
1313
 
1299
1314
  if (_context3.t0) {
1300
- _context3.next = 16;
1315
+ _context3.next = 19;
1301
1316
  break;
1302
1317
  }
1303
1318
 
1304
1319
  _context3.t0 = this.dto.IdbusiType != 37;
1305
1320
 
1306
- case 16:
1321
+ case 19:
1307
1322
  if (!_context3.t0) {
1308
- _context3.next = 18;
1323
+ _context3.next = 21;
1309
1324
  break;
1310
1325
  }
1311
1326
 
@@ -1315,17 +1330,17 @@ var SettlementStore = (_class = function () {
1315
1330
  _this11.billID = resp.ID;
1316
1331
  }));
1317
1332
 
1318
- case 18:
1319
- _context3.next = 21;
1333
+ case 21:
1334
+ _context3.next = 24;
1320
1335
  break;
1321
1336
 
1322
- case 20:
1337
+ case 23:
1323
1338
  return _context3.abrupt('return', (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
1324
1339
  _this11.setDtoID(resp.ID);
1325
1340
  _this11.billID = resp.ID;
1326
1341
  }));
1327
1342
 
1328
- case 21:
1343
+ case 24:
1329
1344
  case 'end':
1330
1345
  return _context3.stop();
1331
1346
  }
@@ -1347,7 +1362,7 @@ var SettlementStore = (_class = function () {
1347
1362
  }, {
1348
1363
  key: 'querySettleResult',
1349
1364
  value: function () {
1350
- var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1365
+ var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1351
1366
  return _regenerator2.default.wrap(function _callee4$(_context4) {
1352
1367
  while (1) {
1353
1368
  switch (_context4.prev = _context4.next) {
@@ -1375,7 +1390,7 @@ var SettlementStore = (_class = function () {
1375
1390
  }));
1376
1391
 
1377
1392
  function querySettleResult() {
1378
- return _ref16.apply(this, arguments);
1393
+ return _ref17.apply(this, arguments);
1379
1394
  }
1380
1395
 
1381
1396
  return querySettleResult;
@@ -1401,14 +1416,14 @@ var SettlementStore = (_class = function () {
1401
1416
  }, {
1402
1417
  key: 'validePwd',
1403
1418
  value: function () {
1404
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(value) {
1405
- var _ref18, isNewRetailBCPos, cook1, cook2, message, memberId, result, count, _result;
1419
+ var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(value) {
1420
+ var _ref19, isNewRetailBCPos, cook1, cook2, message, memberId, result, count, _result;
1406
1421
 
1407
1422
  return _regenerator2.default.wrap(function _callee5$(_context5) {
1408
1423
  while (1) {
1409
1424
  switch (_context5.prev = _context5.next) {
1410
1425
  case 0:
1411
- _ref18 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref18.isNewRetailBCPos;
1426
+ _ref19 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref19.isNewRetailBCPos;
1412
1427
  _context5.prev = 1;
1413
1428
 
1414
1429
  if (!isNewRetailBCPos) {
@@ -1493,7 +1508,7 @@ var SettlementStore = (_class = function () {
1493
1508
  }));
1494
1509
 
1495
1510
  function validePwd(_x3) {
1496
- return _ref17.apply(this, arguments);
1511
+ return _ref18.apply(this, arguments);
1497
1512
  }
1498
1513
 
1499
1514
  return validePwd;
@@ -1532,14 +1547,14 @@ var SettlementStore = (_class = function () {
1532
1547
  var _this13 = this;
1533
1548
 
1534
1549
  return function () {
1535
- var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_this) {
1536
- var _getLoginInfo2, IdStore, StoreCode, resp;
1550
+ var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_this) {
1551
+ var _getLoginInfo3, IdStore, StoreCode, resp;
1537
1552
 
1538
1553
  return _regenerator2.default.wrap(function _callee6$(_context6) {
1539
1554
  while (1) {
1540
1555
  switch (_context6.prev = _context6.next) {
1541
1556
  case 0:
1542
- _getLoginInfo2 = _this13.getLoginInfo(), IdStore = _getLoginInfo2.IdStore, StoreCode = _getLoginInfo2.StoreCode;
1557
+ _getLoginInfo3 = _this13.getLoginInfo(), IdStore = _getLoginInfo3.IdStore, StoreCode = _getLoginInfo3.StoreCode;
1543
1558
  _context6.next = 3;
1544
1559
  return (0, _tplusApi.tApi)({ Idmember: _this13.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
1545
1560
 
@@ -1559,7 +1574,7 @@ var SettlementStore = (_class = function () {
1559
1574
  }));
1560
1575
 
1561
1576
  return function (_x4) {
1562
- return _ref19.apply(this, arguments);
1577
+ return _ref20.apply(this, arguments);
1563
1578
  };
1564
1579
  }();
1565
1580
  }
@@ -1628,14 +1643,22 @@ var PayMode = exports.PayMode = (_class3 = function () {
1628
1643
  }
1629
1644
  }, {
1630
1645
  key: 'calcReserved',
1631
- value: function calcReserved(blur) {
1646
+ value: function calcReserved(type) {
1632
1647
  var sum = 0;
1633
1648
  (0, _each3.default)(this.thePaymodes, function (mode) {
1634
1649
  sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
1635
1650
  });
1636
1651
  this.received = (0, _utils.getFixedNumber)(sum);
1637
- if (blur && this.isNotFullBook) {
1638
- this.receivable = (0, _utils.getFixedNumber)(this.bookMaxValue - sum);
1652
+ if (type === 'bookPay' && this.isNotFullBook) {
1653
+ if (this.amount <= sum && sum <= this.bookMaxValue) {
1654
+ this.receivable = (0, _utils.getFixedNumber)(0);
1655
+ }
1656
+ if (sum < this.amount) {
1657
+ this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
1658
+ }
1659
+ if (sum > this.bookMaxValue) {
1660
+ this.receivable = (0, _utils.getFixedNumber)(this.bookMaxValue - sum);
1661
+ }
1639
1662
  } else {
1640
1663
  this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
1641
1664
  }
@@ -1657,8 +1680,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
1657
1680
  this.checkList = [];
1658
1681
  }
1659
1682
 
1660
- var _ref20 = _mutantsUtil.platform || {},
1661
- isNewRetailBCPos = _ref20.isNewRetailBCPos;
1683
+ var _ref21 = _mutantsUtil.platform || {},
1684
+ isNewRetailBCPos = _ref21.isNewRetailBCPos;
1662
1685
 
1663
1686
  var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
1664
1687
  PayStyle = _enumController$getEn15.PayStyle,
@@ -1768,18 +1791,18 @@ var PayMode = exports.PayMode = (_class3 = function () {
1768
1791
  }
1769
1792
  });
1770
1793
 
1771
- var _ref21 = element || {},
1772
- couponCode = _ref21.couponCode,
1773
- name = _ref21.name,
1774
- tieredAmountResult = _ref21.tieredAmountResult,
1775
- fromDate = _ref21.fromDate,
1776
- dateMount = _ref21.dateMount,
1777
- promoMethodEnum = _ref21.promoMethodEnum,
1778
- discountPct = _ref21.discountPct,
1779
- nominalAmount = _ref21.nominalAmount,
1780
- promoId = _ref21.promoId,
1781
- id = _ref21.id,
1782
- doorsill = _ref21.doorsill;
1794
+ var _ref22 = element || {},
1795
+ couponCode = _ref22.couponCode,
1796
+ name = _ref22.name,
1797
+ tieredAmountResult = _ref22.tieredAmountResult,
1798
+ fromDate = _ref22.fromDate,
1799
+ dateMount = _ref22.dateMount,
1800
+ promoMethodEnum = _ref22.promoMethodEnum,
1801
+ discountPct = _ref22.discountPct,
1802
+ nominalAmount = _ref22.nominalAmount,
1803
+ promoId = _ref22.promoId,
1804
+ id = _ref22.id,
1805
+ doorsill = _ref22.doorsill;
1783
1806
 
1784
1807
  var condValue = tieredAmountResult.condValue,
1785
1808
  promoDiscount = tieredAmountResult.promoDiscount,
@@ -1823,8 +1846,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
1823
1846
  }, {
1824
1847
  key: 'calcDjqValue',
1825
1848
  value: function calcDjqValue(q1) {
1826
- var _ref22 = _mutantsUtil.platform || {},
1827
- isNewRetailBCPos = _ref22.isNewRetailBCPos;
1849
+ var _ref23 = _mutantsUtil.platform || {},
1850
+ isNewRetailBCPos = _ref23.isNewRetailBCPos;
1828
1851
 
1829
1852
  var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1830
1853
  Differentiate = _enumController$getEn16.Differentiate;
@@ -1914,7 +1937,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1914
1937
  }, {
1915
1938
  key: 'setPaymodes',
1916
1939
  value: function () {
1917
- var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
1940
+ var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
1918
1941
  var _this15 = this;
1919
1942
 
1920
1943
  var _enumController$getEn18, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
@@ -1952,7 +1975,8 @@ var PayMode = exports.PayMode = (_class3 = function () {
1952
1975
  idBankAccount: mode.IdBankAccount,
1953
1976
  exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
1954
1977
  idCurrency: mode.Currency ? mode.Currency.ID : -1,
1955
- calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88"
1978
+ calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88",
1979
+ virtualPay: mode.VirtualPay
1956
1980
  });
1957
1981
  });
1958
1982
  _this15.paymodes = paymodes;
@@ -1969,7 +1993,7 @@ var PayMode = exports.PayMode = (_class3 = function () {
1969
1993
  }));
1970
1994
 
1971
1995
  function setPaymodes(_x5, _x6) {
1972
- return _ref23.apply(this, arguments);
1996
+ return _ref24.apply(this, arguments);
1973
1997
  }
1974
1998
 
1975
1999
  return setPaymodes;
@@ -2090,8 +2114,8 @@ var Member = exports.Member = (_class5 = function () {
2090
2114
  return key == 'canusedbalancestorage';
2091
2115
  });
2092
2116
 
2093
- var _ref24 = _mutantsUtil.platform || {},
2094
- isNewRetailBCPos = _ref24.isNewRetailBCPos;
2117
+ var _ref25 = _mutantsUtil.platform || {},
2118
+ isNewRetailBCPos = _ref25.isNewRetailBCPos;
2095
2119
 
2096
2120
  m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
2097
2121
  m.MeStorageCardId && (this.MeStorageCardId = m.MeStorageCardId);