tplus-components-touch 3.54.4 → 3.54.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -169,9 +169,7 @@ function _initializerWarningHelper(descriptor, context) {
169
169
  var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
170
170
 
171
171
  var SettlementStore = (_class = (_temp = _class2 = function () {
172
- // 赊销-欠款单据
173
- //type==2
174
- //type 1:储值;2:赊销; 不传或0是普通开单
172
+ // 预售都是全款;预订是否全款,在点击确认支付时计算订金和商品金额计算得出
175
173
  function SettlementStore() {
176
174
  (0, _classCallCheck3.default)(this, SettlementStore);
177
175
 
@@ -184,8 +182,9 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
184
182
  this.SettlementApi = _settlementApi2.default;
185
183
  } //赊销-客户id
186
184
 
187
- //赊销-销售合计
188
- // 预售都是全款;预订是否全款,在点击确认支付时计算订金和商品金额计算得出
185
+ // 赊销-欠款单据
186
+ //type==2
187
+ //type 1:储值;2:赊销; 不传或0是普通开单
189
188
 
190
189
 
191
190
  (0, _createClass3.default)(SettlementStore, [{
@@ -210,7 +209,6 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
210
209
  data = _ref.data,
211
210
  payModeKey = _ref.payModeKey,
212
211
  creditSalesVoucher = _ref.creditSalesVoucher,
213
- saleTotalTaxAmount = _ref.saleTotalTaxAmount,
214
212
  custVendorId = _ref.custVendorId;
215
213
 
216
214
  this.setNewStyle();
@@ -223,7 +221,6 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
223
221
  this.brefund = this.paymode.setAmount(amount, 0);
224
222
  this.dto = context.viewModel.data;
225
223
  this.creditSalesVoucher = creditSalesVoucher;
226
- this.saleTotalTaxAmount = saleTotalTaxAmount;
227
224
  this.custVendorId = custVendorId;
228
225
  } else {
229
226
  this.context = context;
@@ -286,17 +283,6 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
286
283
  this.paymode.bookMaxValue = _mutantsMicrofx.stores.drawerStore.totalWaitPaidAmount;
287
284
  }
288
285
  }
289
- if (IdbusiType === 42) {
290
- var _dto = this.dto,
291
- TotalTaxAmount = _dto.TotalTaxAmount,
292
- ArrearsAmount = _dto.ArrearsAmount;
293
-
294
- var returnAmount = Math.abs(TotalTaxAmount) - ArrearsAmount;
295
- value = amount;
296
- (0, _mobx.runInAction)(function () {
297
- _this2.dto.CreditUsageAmount = (0, _utils.getFixedNumber)(-(Math.abs(TotalTaxAmount) - returnAmount), 2);
298
- });
299
- }
300
286
  this.brefund = this.paymode.setAmount(value, this.dto.OnlinePaymentAmount);
301
287
  }
302
288
  this.paymode.clean();
@@ -1111,8 +1097,8 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1111
1097
  "latitude": IPMSG.latitude || "",
1112
1098
  "Retails": this.creditSalesVoucher,
1113
1099
  "IdCustVendor": this.custVendorId,
1114
- "TotalOwedAmount": this.paymode.amount,
1115
- "TotalTaxAmount": this.saleTotalTaxAmount,
1100
+ "TotalOwedAmount": this.paymode.amount, //TotalOwedAmount欠款金额
1101
+ "TotalTaxAmount": this.paymode.received, //TotalTaxAmount 本次结算付款金额
1116
1102
  "RetailPaymentDetails": retailPaymentDetails,
1117
1103
  UserCode: UserCode,
1118
1104
  UserId: UserId,
@@ -1290,7 +1276,7 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1290
1276
  var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5() {
1291
1277
  var _this12 = this;
1292
1278
 
1293
- var _enumController$getEn14, PayStyle, TradeType, IPMSG, RetailTypeEnum, _getLoginInfo3, PreSellOrBook, PercentageWhenBook, _ref14, IdbusiType, DistributionMode, TotalTaxAmount, prepaidAmount, fullPayment, dtoParams, payList, payment, tradeType, ret, _ref15, type, data, msg, code;
1279
+ var _enumController$getEn14, PayStyle, TradeType, IPMSG, RetailTypeEnum, _getLoginInfo3, PreSellOrBook, PercentageWhenBook, _ref14, IdbusiType, DistributionMode, TotalTaxAmount, _dto, _TotalTaxAmount, ArrearsAmount, returnAmount1, prepaidAmount, fullPayment, dtoParams, payList, payment, tradeType, ret, _ref15, type, data, msg, code;
1294
1280
 
1295
1281
  return _regenerator2.default.wrap(function _callee5$(_context5) {
1296
1282
  while (1) {
@@ -1398,6 +1384,14 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1398
1384
  _this12.dto.CreditUsageAmount = (0, _utils.getFixedNumber)(TotalTaxAmount, 2);
1399
1385
  });
1400
1386
  }
1387
+ if (IdbusiType === 42) {
1388
+ _dto = this.dto, _TotalTaxAmount = _dto.TotalTaxAmount, ArrearsAmount = _dto.ArrearsAmount;
1389
+ returnAmount1 = Math.abs(_TotalTaxAmount) - ArrearsAmount;
1390
+
1391
+ (0, _mobx.runInAction)(function () {
1392
+ _this12.dto.CreditUsageAmount = returnAmount1 > 1 ? (0, _utils.getFixedNumber)(-(Math.abs(_TotalTaxAmount) - returnAmount1), 2) : Math.abs(_TotalTaxAmount, 2);
1393
+ });
1394
+ }
1401
1395
  if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
1402
1396
  prepaidAmount = (0, _utils.getFixedNumber)(this.dto.RetailPaymentDetails.reduce(function (c, item) {
1403
1397
  return c + (item.Amount || 0);
@@ -1414,36 +1408,36 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1414
1408
  _context5.t1 = this.dto.IdbusiType == 37;
1415
1409
 
1416
1410
  if (!_context5.t1) {
1417
- _context5.next = 15;
1411
+ _context5.next = 16;
1418
1412
  break;
1419
1413
  }
1420
1414
 
1421
- _context5.next = 14;
1415
+ _context5.next = 15;
1422
1416
  return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1423
1417
 
1424
- case 14:
1418
+ case 15:
1425
1419
  _context5.t1 = _context5.sent;
1426
1420
 
1427
- case 15:
1421
+ case 16:
1428
1422
  _context5.t0 = _context5.t1;
1429
1423
 
1430
1424
  if (_context5.t0) {
1431
- _context5.next = 18;
1425
+ _context5.next = 19;
1432
1426
  break;
1433
1427
  }
1434
1428
 
1435
1429
  _context5.t0 = this.dto.IdbusiType != 37;
1436
1430
 
1437
- case 18:
1431
+ case 19:
1438
1432
  if (!_context5.t0) {
1439
- _context5.next = 38;
1433
+ _context5.next = 39;
1440
1434
  break;
1441
1435
  }
1442
1436
 
1443
1437
  dtoParams = (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } });
1444
1438
 
1445
1439
  if (!(IdbusiType !== 42)) {
1446
- _context5.next = 36;
1440
+ _context5.next = 37;
1447
1441
  break;
1448
1442
  }
1449
1443
 
@@ -1453,36 +1447,36 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1453
1447
  });
1454
1448
 
1455
1449
  if (!(payList && payList.length > 0)) {
1456
- _context5.next = 35;
1450
+ _context5.next = 36;
1457
1451
  break;
1458
1452
  }
1459
1453
 
1460
1454
  payment = payList[0];
1461
1455
  tradeType = payment && payment.Amount > 0 ? TradeType.PAY : TradeType.REFUND;
1462
- _context5.next = 27;
1456
+ _context5.next = 28;
1463
1457
  return this.thirdPay(1, payment, tradeType, dtoParams);
1464
1458
 
1465
- case 27:
1459
+ case 28:
1466
1460
  ret = _context5.sent;
1467
1461
  _ref15 = ret || {}, type = _ref15.type, data = _ref15.data, msg = _ref15.msg, code = _ref15.code;
1468
1462
 
1469
1463
  if (!(type === true)) {
1470
- _context5.next = 33;
1464
+ _context5.next = 34;
1471
1465
  break;
1472
1466
  }
1473
1467
 
1474
1468
  dtoParams = data;
1475
- _context5.next = 35;
1469
+ _context5.next = 36;
1476
1470
  break;
1477
1471
 
1478
- case 33:
1472
+ case 34:
1479
1473
  _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1480
1474
  return _context5.abrupt('return', false);
1481
1475
 
1482
- case 35:
1476
+ case 36:
1483
1477
  this.dtoParams = dtoParams;
1484
1478
 
1485
- case 36:
1479
+ case 37:
1486
1480
  console.log('结算信息:', dtoParams);
1487
1481
  return _context5.abrupt('return', this.SettlementApi.retailPosSettle({
1488
1482
  dto: dtoParams,
@@ -1498,7 +1492,7 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1498
1492
  _this12.paymode.checkList = [];
1499
1493
  }));
1500
1494
 
1501
- case 38:
1495
+ case 39:
1502
1496
  case 'end':
1503
1497
  return _context5.stop();
1504
1498
  }
@@ -1890,7 +1884,6 @@ var SettlementStore = (_class = (_temp = _class2 = function () {
1890
1884
 
1891
1885
  this.isFull = true;
1892
1886
  this.creditSalesVoucher = [];
1893
- this.saleTotalTaxAmount = 0;
1894
1887
  this.isCanSettleOnQuickKey = true;
1895
1888
 
1896
1889
  this.setCanSettleOnQuickKey = function (value) {