@pisell/pisellos 2.2.29 → 2.2.30
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.
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
|
@@ -1745,7 +1745,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1745
1745
|
value: (function () {
|
|
1746
1746
|
var _updateVoucherPaymentItemsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(voucherPaymentItems) {
|
|
1747
1747
|
var _this4 = this;
|
|
1748
|
-
var paymentItems, allPaymentItemsSynced, remainingAmount, remainingValue, isOrderSynced, orderPaymentType, voucherPaymentItemsWithType, currentOrderId, isCurrentOrderReal, updatedOrder;
|
|
1748
|
+
var paymentItems, _this$store$currentOr12, savedVoucherPaymentItems, allPaymentItemsSynced, remainingAmount, remainingValue, isOrderSynced, orderPaymentType, voucherPaymentItemsWithType, currentOrderId, isCurrentOrderReal, updatedOrder;
|
|
1749
1749
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1750
1750
|
while (1) switch (_context18.prev = _context18.next) {
|
|
1751
1751
|
case 0:
|
|
@@ -1760,17 +1760,30 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1760
1760
|
return this.payment.getPaymentItemsAsync(this.store.currentOrder.uuid);
|
|
1761
1761
|
case 5:
|
|
1762
1762
|
paymentItems = _context18.sent;
|
|
1763
|
+
if (!(!voucherPaymentItems || (voucherPaymentItems === null || voucherPaymentItems === void 0 ? void 0 : voucherPaymentItems.length) === 0)) {
|
|
1764
|
+
_context18.next = 10;
|
|
1765
|
+
break;
|
|
1766
|
+
}
|
|
1767
|
+
savedVoucherPaymentItems = ((_this$store$currentOr12 = this.store.currentOrder) === null || _this$store$currentOr12 === void 0 || (_this$store$currentOr12 = _this$store$currentOr12.payment) === null || _this$store$currentOr12 === void 0 ? void 0 : _this$store$currentOr12.filter(function (item) {
|
|
1768
|
+
return item.voucher_id && !item.isSynced;
|
|
1769
|
+
})) || [];
|
|
1770
|
+
if (!((savedVoucherPaymentItems === null || savedVoucherPaymentItems === void 0 ? void 0 : savedVoucherPaymentItems.length) === 0)) {
|
|
1771
|
+
_context18.next = 10;
|
|
1772
|
+
break;
|
|
1773
|
+
}
|
|
1774
|
+
return _context18.abrupt("return");
|
|
1775
|
+
case 10:
|
|
1763
1776
|
allPaymentItemsSynced = paymentItems.every(function (item) {
|
|
1764
1777
|
return item.isSynced;
|
|
1765
1778
|
});
|
|
1766
|
-
_context18.next =
|
|
1779
|
+
_context18.next = 13;
|
|
1767
1780
|
return this.calculateRemainingAmountAsync();
|
|
1768
|
-
case
|
|
1781
|
+
case 13:
|
|
1769
1782
|
remainingAmount = _context18.sent;
|
|
1770
1783
|
remainingValue = new Decimal(remainingAmount);
|
|
1771
1784
|
isOrderSynced = this.store.isOrderSynced;
|
|
1772
1785
|
if (!(remainingValue.lte(0) && isOrderSynced && voucherPaymentItems.length === 0 && allPaymentItemsSynced)) {
|
|
1773
|
-
_context18.next =
|
|
1786
|
+
_context18.next = 19;
|
|
1774
1787
|
break;
|
|
1775
1788
|
}
|
|
1776
1789
|
this.logInfo('订单已同步且支付完成,跳过清空代金券操作避免重复同步:', {
|
|
@@ -1782,7 +1795,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1782
1795
|
reason: 'Order synced and payment completed, skip clear vouchers to avoid duplicate sync'
|
|
1783
1796
|
});
|
|
1784
1797
|
return _context18.abrupt("return");
|
|
1785
|
-
case
|
|
1798
|
+
case 19:
|
|
1786
1799
|
this.logInfo('开始批量更新代金券支付项:', {
|
|
1787
1800
|
voucherPaymentItems: voucherPaymentItems
|
|
1788
1801
|
});
|
|
@@ -1804,18 +1817,18 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1804
1817
|
metadata: metadata
|
|
1805
1818
|
});
|
|
1806
1819
|
}); // 调用 Payment 模块的批量更新方法
|
|
1807
|
-
_context18.next =
|
|
1820
|
+
_context18.next = 24;
|
|
1808
1821
|
return this.payment.updateVoucherPaymentItemsAsync(this.store.currentOrder.uuid, voucherPaymentItemsWithType);
|
|
1809
|
-
case
|
|
1822
|
+
case 24:
|
|
1810
1823
|
// 🚀 清除计算缓存,确保获取最新数据
|
|
1811
1824
|
this.clearCalculationCache();
|
|
1812
1825
|
|
|
1813
1826
|
// 重新从Payment模块获取最新的订单数据,确保支付项同步
|
|
1814
1827
|
currentOrderId = this.store.currentOrder.order_id; // 保存当前的订单ID
|
|
1815
1828
|
isCurrentOrderReal = currentOrderId && !isVirtualOrderId(currentOrderId);
|
|
1816
|
-
_context18.next =
|
|
1829
|
+
_context18.next = 29;
|
|
1817
1830
|
return this.payment.getPaymentOrderByUuidAsync(this.store.currentOrder.uuid);
|
|
1818
|
-
case
|
|
1831
|
+
case 29:
|
|
1819
1832
|
updatedOrder = _context18.sent;
|
|
1820
1833
|
if (updatedOrder) {
|
|
1821
1834
|
// 如果当前订单ID是真实ID,但获取到的订单ID是虚拟ID,需要保护真实ID
|
|
@@ -1830,10 +1843,10 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1830
1843
|
}
|
|
1831
1844
|
|
|
1832
1845
|
// 更新 stateAmount 为剩余未支付金额
|
|
1833
|
-
_context18.next =
|
|
1846
|
+
_context18.next = 33;
|
|
1834
1847
|
return this.updateStateAmountToRemaining(false);
|
|
1835
|
-
case
|
|
1836
|
-
_context18.next =
|
|
1848
|
+
case 33:
|
|
1849
|
+
_context18.next = 35;
|
|
1837
1850
|
return this.core.effects.emit("".concat(this.name, ":onPaymentStarted"), {
|
|
1838
1851
|
orderUuid: this.store.currentOrder.uuid,
|
|
1839
1852
|
paymentMethodCode: 'VOUCHER_BATCH',
|
|
@@ -1842,23 +1855,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1842
1855
|
}, 0).toFixed(2),
|
|
1843
1856
|
timestamp: Date.now()
|
|
1844
1857
|
});
|
|
1845
|
-
case
|
|
1858
|
+
case 35:
|
|
1846
1859
|
this.logInfo('代金券支付项批量更新成功');
|
|
1847
|
-
_context18.next =
|
|
1860
|
+
_context18.next = 44;
|
|
1848
1861
|
break;
|
|
1849
|
-
case
|
|
1850
|
-
_context18.prev =
|
|
1862
|
+
case 38:
|
|
1863
|
+
_context18.prev = 38;
|
|
1851
1864
|
_context18.t0 = _context18["catch"](0);
|
|
1852
1865
|
this.logError('[Checkout] 批量更新代金券支付项失败:', _context18.t0);
|
|
1853
|
-
_context18.next =
|
|
1866
|
+
_context18.next = 43;
|
|
1854
1867
|
return this.handleError(_context18.t0, CheckoutErrorType.PaymentFailed);
|
|
1855
|
-
case
|
|
1868
|
+
case 43:
|
|
1856
1869
|
throw _context18.t0;
|
|
1857
|
-
case
|
|
1870
|
+
case 44:
|
|
1858
1871
|
case "end":
|
|
1859
1872
|
return _context18.stop();
|
|
1860
1873
|
}
|
|
1861
|
-
}, _callee18, this, [[0,
|
|
1874
|
+
}, _callee18, this, [[0, 38]]);
|
|
1862
1875
|
}));
|
|
1863
1876
|
function updateVoucherPaymentItemsAsync(_x17) {
|
|
1864
1877
|
return _updateVoucherPaymentItemsAsync.apply(this, arguments);
|
|
@@ -1983,7 +1996,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1983
1996
|
key: "setDepositAmountAsync",
|
|
1984
1997
|
value: (function () {
|
|
1985
1998
|
var _setDepositAmountAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(depositAmount) {
|
|
1986
|
-
var _this$store$
|
|
1999
|
+
var _this$store$currentOr13, _this$store$currentOr14;
|
|
1987
2000
|
var depositValue, formattedDepositAmount, oldDepositAmount, updateParams;
|
|
1988
2001
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1989
2002
|
while (1) switch (_context20.prev = _context20.next) {
|
|
@@ -1991,8 +2004,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1991
2004
|
this.logInfo('setDepositAmountAsync called', {
|
|
1992
2005
|
depositAmount: depositAmount,
|
|
1993
2006
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
1994
|
-
currentOrderId: (_this$store$
|
|
1995
|
-
currentTotalAmount: (_this$store$
|
|
2007
|
+
currentOrderId: (_this$store$currentOr13 = this.store.currentOrder) === null || _this$store$currentOr13 === void 0 ? void 0 : _this$store$currentOr13.order_id,
|
|
2008
|
+
currentTotalAmount: (_this$store$currentOr14 = this.store.currentOrder) === null || _this$store$currentOr14 === void 0 ? void 0 : _this$store$currentOr14.total_amount
|
|
1996
2009
|
});
|
|
1997
2010
|
_context20.prev = 1;
|
|
1998
2011
|
// 验证定金金额格式
|
|
@@ -2112,17 +2125,17 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2112
2125
|
key: "manualSyncOrderAsync",
|
|
2113
2126
|
value: (function () {
|
|
2114
2127
|
var _manualSyncOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
2115
|
-
var _this$store$
|
|
2116
|
-
var _this$store$
|
|
2128
|
+
var _this$store$currentOr15, _this$store$currentOr16, _this$store$currentOr17;
|
|
2129
|
+
var _this$store$currentOr18, orderUuid, oldOrderId, syncResult, finalOrderId, finalIsVirtual, newRes, _this$store$currentOr19, errorMessage;
|
|
2117
2130
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2118
2131
|
while (1) switch (_context21.prev = _context21.next) {
|
|
2119
2132
|
case 0:
|
|
2120
2133
|
console.log('manualSyncOrderAsync called');
|
|
2121
2134
|
this.logInfo('manualSyncOrderAsync called', {
|
|
2122
2135
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
2123
|
-
currentOrderId: (_this$store$
|
|
2124
|
-
orderUuid: (_this$store$
|
|
2125
|
-
totalAmount: (_this$store$
|
|
2136
|
+
currentOrderId: (_this$store$currentOr15 = this.store.currentOrder) === null || _this$store$currentOr15 === void 0 ? void 0 : _this$store$currentOr15.order_id,
|
|
2137
|
+
orderUuid: (_this$store$currentOr16 = this.store.currentOrder) === null || _this$store$currentOr16 === void 0 ? void 0 : _this$store$currentOr16.uuid,
|
|
2138
|
+
totalAmount: (_this$store$currentOr17 = this.store.currentOrder) === null || _this$store$currentOr17 === void 0 ? void 0 : _this$store$currentOr17.total_amount,
|
|
2126
2139
|
isOrderSynced: this.store.isOrderSynced,
|
|
2127
2140
|
isVirtualOrderId: this.store.currentOrder ? isVirtualOrderId(this.store.currentOrder.order_id) : false
|
|
2128
2141
|
});
|
|
@@ -2182,7 +2195,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2182
2195
|
this.logError('[Checkout] 严重警告:返回的订单ID与存储的订单ID不一致!');
|
|
2183
2196
|
}
|
|
2184
2197
|
newRes = _objectSpread(_objectSpread({}, syncResult), {}, {
|
|
2185
|
-
is_deposit: ((_this$store$
|
|
2198
|
+
is_deposit: ((_this$store$currentOr18 = this.store.currentOrder) === null || _this$store$currentOr18 === void 0 ? void 0 : _this$store$currentOr18.is_deposit) || 0
|
|
2186
2199
|
});
|
|
2187
2200
|
_context21.next = 30;
|
|
2188
2201
|
return this.updateStateAmountToRemaining(false);
|
|
@@ -2196,7 +2209,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2196
2209
|
return _context21.abrupt("return", {
|
|
2197
2210
|
success: false,
|
|
2198
2211
|
message: "\u8BA2\u5355\u540C\u6B65\u5931\u8D25: ".concat(errorMessage),
|
|
2199
|
-
orderUuid: (_this$store$
|
|
2212
|
+
orderUuid: (_this$store$currentOr19 = this.store.currentOrder) === null || _this$store$currentOr19 === void 0 ? void 0 : _this$store$currentOr19.uuid
|
|
2200
2213
|
});
|
|
2201
2214
|
case 38:
|
|
2202
2215
|
case "end":
|
|
@@ -2273,15 +2286,15 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2273
2286
|
key: "cancelCurrentOrderAsync",
|
|
2274
2287
|
value: (function () {
|
|
2275
2288
|
var _cancelCurrentOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(cancelReason) {
|
|
2276
|
-
var _this$store$
|
|
2289
|
+
var _this$store$currentOr20, _this$store$currentOr21, currentOrderUuid, currentOrderId, isOrderSynced, errorMessage;
|
|
2277
2290
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2278
2291
|
while (1) switch (_context22.prev = _context22.next) {
|
|
2279
2292
|
case 0:
|
|
2280
2293
|
_context22.prev = 0;
|
|
2281
2294
|
this.logInfo('开始取消当前本地订单:', {
|
|
2282
2295
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
2283
|
-
orderUuid: (_this$store$
|
|
2284
|
-
orderId: (_this$store$
|
|
2296
|
+
orderUuid: (_this$store$currentOr20 = this.store.currentOrder) === null || _this$store$currentOr20 === void 0 ? void 0 : _this$store$currentOr20.uuid,
|
|
2297
|
+
orderId: (_this$store$currentOr21 = this.store.currentOrder) === null || _this$store$currentOr21 === void 0 ? void 0 : _this$store$currentOr21.order_id,
|
|
2285
2298
|
isOrderSynced: this.store.isOrderSynced,
|
|
2286
2299
|
cancelReason: cancelReason
|
|
2287
2300
|
});
|
|
@@ -2392,7 +2405,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2392
2405
|
key: "saveForLaterPaymentAsync",
|
|
2393
2406
|
value: (function () {
|
|
2394
2407
|
var _saveForLaterPaymentAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2395
|
-
var orderUuid, currentOrderId, allPaymentItems, orderPaymentStatus, syncResult, _this$store$
|
|
2408
|
+
var orderUuid, currentOrderId, allPaymentItems, orderPaymentStatus, syncResult, _this$store$currentOr22, errorMessage;
|
|
2396
2409
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2397
2410
|
while (1) switch (_context23.prev = _context23.next) {
|
|
2398
2411
|
case 0:
|
|
@@ -2451,7 +2464,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2451
2464
|
return _context23.abrupt("return", {
|
|
2452
2465
|
success: false,
|
|
2453
2466
|
message: "\u8BA2\u5355\u4FDD\u5B58\u5931\u8D25: ".concat(errorMessage),
|
|
2454
|
-
orderUuid: (_this$store$
|
|
2467
|
+
orderUuid: (_this$store$currentOr22 = this.store.currentOrder) === null || _this$store$currentOr22 === void 0 ? void 0 : _this$store$currentOr22.uuid
|
|
2455
2468
|
});
|
|
2456
2469
|
case 22:
|
|
2457
2470
|
case "end":
|
|
@@ -2474,7 +2487,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2474
2487
|
key: "updateOrderNoteAsync",
|
|
2475
2488
|
value: (function () {
|
|
2476
2489
|
var _updateOrderNoteAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(note) {
|
|
2477
|
-
var _this$store$
|
|
2490
|
+
var _this$store$currentOr23, _this$store$currentOr24, oldNote, orderInPayment;
|
|
2478
2491
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2479
2492
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2480
2493
|
case 0:
|
|
@@ -2486,7 +2499,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2486
2499
|
throw createCheckoutError(CheckoutErrorType.ValidationFailed, '没有本地订单数据,无法更新备注');
|
|
2487
2500
|
case 3:
|
|
2488
2501
|
console.log('[Checkout] 更新订单备注:', {
|
|
2489
|
-
orderUuid: (_this$store$
|
|
2502
|
+
orderUuid: (_this$store$currentOr23 = this.store.currentOrder) === null || _this$store$currentOr23 === void 0 ? void 0 : _this$store$currentOr23.uuid,
|
|
2490
2503
|
oldNote: this.store.localOrderData.shop_note,
|
|
2491
2504
|
newNote: note
|
|
2492
2505
|
});
|
|
@@ -2519,7 +2532,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2519
2532
|
case 17:
|
|
2520
2533
|
_context24.next = 19;
|
|
2521
2534
|
return this.core.effects.emit("".concat(this.name, ":onOrderNoteChanged"), {
|
|
2522
|
-
orderUuid: (_this$store$
|
|
2535
|
+
orderUuid: (_this$store$currentOr24 = this.store.currentOrder) === null || _this$store$currentOr24 === void 0 ? void 0 : _this$store$currentOr24.uuid,
|
|
2523
2536
|
oldNote: oldNote,
|
|
2524
2537
|
newNote: note,
|
|
2525
2538
|
timestamp: Date.now()
|
|
@@ -2591,7 +2604,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2591
2604
|
key: "handlePaymentSuccess",
|
|
2592
2605
|
value: (function () {
|
|
2593
2606
|
var _handlePaymentSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(data) {
|
|
2594
|
-
var _this$store$
|
|
2607
|
+
var _this$store$currentOr25;
|
|
2595
2608
|
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2596
2609
|
while (1) switch (_context26.prev = _context26.next) {
|
|
2597
2610
|
case 0:
|
|
@@ -2602,7 +2615,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2602
2615
|
return this.core.effects.emit("".concat(this.name, ":onPaymentSuccess"), {
|
|
2603
2616
|
orderUuid: data.orderUuid,
|
|
2604
2617
|
paymentMethodCode: '',
|
|
2605
|
-
amount: ((_this$store$
|
|
2618
|
+
amount: ((_this$store$currentOr25 = this.store.currentOrder) === null || _this$store$currentOr25 === void 0 ? void 0 : _this$store$currentOr25.total_amount) || '0',
|
|
2606
2619
|
timestamp: data.timestamp
|
|
2607
2620
|
});
|
|
2608
2621
|
case 4:
|
|
@@ -2627,7 +2640,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2627
2640
|
key: "handlePaymentError",
|
|
2628
2641
|
value: (function () {
|
|
2629
2642
|
var _handlePaymentError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(data) {
|
|
2630
|
-
var _this$store$
|
|
2643
|
+
var _this$store$currentOr26;
|
|
2631
2644
|
var error;
|
|
2632
2645
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2633
2646
|
while (1) switch (_context27.prev = _context27.next) {
|
|
@@ -2640,7 +2653,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2640
2653
|
return this.core.effects.emit("".concat(this.name, ":onPaymentFailed"), {
|
|
2641
2654
|
orderUuid: data.orderUuid,
|
|
2642
2655
|
paymentMethodCode: '',
|
|
2643
|
-
amount: ((_this$store$
|
|
2656
|
+
amount: ((_this$store$currentOr26 = this.store.currentOrder) === null || _this$store$currentOr26 === void 0 ? void 0 : _this$store$currentOr26.total_amount) || '0',
|
|
2644
2657
|
timestamp: data.timestamp
|
|
2645
2658
|
});
|
|
2646
2659
|
case 5:
|
|
@@ -3771,11 +3784,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3771
3784
|
resolveInFlight,
|
|
3772
3785
|
rejectInFlight,
|
|
3773
3786
|
inFlightPromise,
|
|
3774
|
-
_this$store$currentOr26,
|
|
3775
3787
|
_this$store$currentOr27,
|
|
3788
|
+
_this$store$currentOr28,
|
|
3776
3789
|
_this$store$currentCu2,
|
|
3777
3790
|
_this$otherParams,
|
|
3778
|
-
_this$store$
|
|
3791
|
+
_this$store$currentOr29,
|
|
3779
3792
|
_this$store$localOrde,
|
|
3780
3793
|
_this$store$localOrde2,
|
|
3781
3794
|
_checkoutResponse3,
|
|
@@ -3892,7 +3905,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3892
3905
|
})
|
|
3893
3906
|
});
|
|
3894
3907
|
}); // 确定最终的定金金额:优先使用手动设置的值,否则从支付项中计算
|
|
3895
|
-
manualDepositAmount = ((_this$store$
|
|
3908
|
+
manualDepositAmount = ((_this$store$currentOr27 = this.store.currentOrder) === null || _this$store$currentOr27 === void 0 ? void 0 : _this$store$currentOr27.deposit_amount) || '0.00'; // 优先级逻辑:手动设置的定金金额 > 从支付项计算的金额
|
|
3896
3909
|
manualDepositValue = new Decimal(manualDepositAmount);
|
|
3897
3910
|
if (manualDepositValue.gt(0)) {
|
|
3898
3911
|
// 如果手动设置了定金金额且大于0,使用手动设置的值
|
|
@@ -3952,7 +3965,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3952
3965
|
}),
|
|
3953
3966
|
manualDepositAmount: manualDepositAmount,
|
|
3954
3967
|
finalDepositAmount: finalDepositAmount,
|
|
3955
|
-
isDeposit: ((_this$store$
|
|
3968
|
+
isDeposit: ((_this$store$currentOr28 = this.store.currentOrder) === null || _this$store$currentOr28 === void 0 ? void 0 : _this$store$currentOr28.is_deposit) || 0
|
|
3956
3969
|
});
|
|
3957
3970
|
|
|
3958
3971
|
// 计算订单状态,优先读取外面传递的,如果没有则根据订单支付数据来
|
|
@@ -4000,7 +4013,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4000
4013
|
currency_symbol: this.otherParams.currency_symbol,
|
|
4001
4014
|
currency_format: this.otherParams.currency_format,
|
|
4002
4015
|
business_code: ((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.business_code) || undefined,
|
|
4003
|
-
is_deposit: ((_this$store$
|
|
4016
|
+
is_deposit: ((_this$store$currentOr29 = this.store.currentOrder) !== null && _this$store$currentOr29 !== void 0 && _this$store$currentOr29.is_deposit || Number(finalDepositAmount) > 0 ? 1 : 0) || 0,
|
|
4004
4017
|
deposit_amount: finalDepositAmount,
|
|
4005
4018
|
// 使用最终确定的定金金额(手动设置优先)
|
|
4006
4019
|
product_tax_fee: this.store.localOrderData.tax_fee,
|
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
|
@@ -1171,6 +1171,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1171
1171
|
* @throws 支付项缺少 voucher_id 时抛出错误
|
|
1172
1172
|
*/
|
|
1173
1173
|
async updateVoucherPaymentItemsAsync(voucherPaymentItems) {
|
|
1174
|
+
var _a, _b;
|
|
1174
1175
|
try {
|
|
1175
1176
|
if (!this.store.currentOrder) {
|
|
1176
1177
|
throw (0, import_utils.createCheckoutError)(
|
|
@@ -1181,6 +1182,11 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1181
1182
|
const paymentItems = await this.payment.getPaymentItemsAsync(
|
|
1182
1183
|
this.store.currentOrder.uuid
|
|
1183
1184
|
);
|
|
1185
|
+
if (!voucherPaymentItems || (voucherPaymentItems == null ? void 0 : voucherPaymentItems.length) === 0) {
|
|
1186
|
+
const savedVoucherPaymentItems = ((_b = (_a = this.store.currentOrder) == null ? void 0 : _a.payment) == null ? void 0 : _b.filter((item) => item.voucher_id && !item.isSynced)) || [];
|
|
1187
|
+
if ((savedVoucherPaymentItems == null ? void 0 : savedVoucherPaymentItems.length) === 0)
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1184
1190
|
const allPaymentItemsSynced = paymentItems.every((item) => item.isSynced);
|
|
1185
1191
|
const remainingAmount = await this.calculateRemainingAmountAsync();
|
|
1186
1192
|
const remainingValue = new import_decimal.default(remainingAmount);
|