@pisell/pisellos 2.1.135 → 2.1.136
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.
|
@@ -2462,7 +2462,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2462
2462
|
key: "checkResourceAvailable",
|
|
2463
2463
|
value: function () {
|
|
2464
2464
|
var _checkResourceAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(resourceId, hasOrderId) {
|
|
2465
|
-
var _this$
|
|
2465
|
+
var _this$otherParams$bus, _this$otherParams10, _this$otherParams$cha, _this$otherParams11, _this$otherParams12, _this$otherParams12$g, _occupyDetail$form_re, _occupyDetail$form_re2, _this$otherParams13, _this$store$order5, _this$store$order7, _this$store$order7$ge, _this$otherParams14, businessCode, channel, openDataTarget, openData, dineInConfig, closedBehaviorValue, closedMessage, basicUnavailableMessage, pauseMessage, makeShopClosed, operatingHourIds, outsideOperatingHours, scheduleList, now, tempOrder, reservationLinkIds, pendingRequestEntryPax, pendingRequestPaxMin, pendingRequestPaxMax, reservationProductList, scheduleDate, scheduleDatetime, loaded, occupancyMinutes, paxBounds, occupyDetail, resourceSelectType, resourceState, availabilityInfo, _this$store$order6, _res$data, res, entryPaxNumber, lastOrderInfo, historicalItems;
|
|
2466
2466
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2467
2467
|
while (1) switch (_context36.prev = _context36.next) {
|
|
2468
2468
|
case 0:
|
|
@@ -2470,25 +2470,28 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2470
2470
|
resourceId: resourceId
|
|
2471
2471
|
});
|
|
2472
2472
|
_context36.prev = 1;
|
|
2473
|
-
|
|
2474
|
-
|
|
2473
|
+
businessCode = String((_this$otherParams$bus = (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : '').trim();
|
|
2474
|
+
channel = String((_this$otherParams$cha = (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.channel) !== null && _this$otherParams$cha !== void 0 ? _this$otherParams$cha : '').trim();
|
|
2475
|
+
openDataTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : 'dine_in+scan_to_order';
|
|
2476
|
+
_context36.next = 7;
|
|
2477
|
+
return (_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 || (_this$otherParams12$g = _this$otherParams12.getOpenData) === null || _this$otherParams12$g === void 0 ? void 0 : _this$otherParams12$g.call(_this$otherParams12, {
|
|
2475
2478
|
scope: 'board',
|
|
2476
|
-
target:
|
|
2479
|
+
target: openDataTarget,
|
|
2477
2480
|
section_code: ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow']
|
|
2478
2481
|
});
|
|
2479
|
-
case
|
|
2482
|
+
case 7:
|
|
2480
2483
|
openData = _context36.sent;
|
|
2481
2484
|
if (!((openData === null || openData === void 0 ? void 0 : openData.status) === false)) {
|
|
2482
|
-
_context36.next =
|
|
2485
|
+
_context36.next = 10;
|
|
2483
2486
|
break;
|
|
2484
2487
|
}
|
|
2485
2488
|
throw new Error((openData === null || openData === void 0 ? void 0 : openData.message) || '获取店铺配置失败');
|
|
2486
|
-
case
|
|
2489
|
+
case 10:
|
|
2487
2490
|
dineInConfig = (openData === null || openData === void 0 ? void 0 : openData.data) || {};
|
|
2488
2491
|
this.otherParams.dineInConfig = dineInConfig;
|
|
2489
|
-
_context36.next =
|
|
2492
|
+
_context36.next = 14;
|
|
2490
2493
|
return this.syncItemRuleConfigsFromDineInConfig(dineInConfig);
|
|
2491
|
-
case
|
|
2494
|
+
case 14:
|
|
2492
2495
|
closedBehaviorValue = dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.closed_behavior'];
|
|
2493
2496
|
closedMessage = (dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.closed_message']) || (dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.message']) || (dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['basic.closed_message']);
|
|
2494
2497
|
basicUnavailableMessage = (dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['basic.unavailable_message']) || closedMessage;
|
|
@@ -2505,21 +2508,21 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2505
2508
|
};
|
|
2506
2509
|
}; // 1. 基础开关 basic.enable 关闭
|
|
2507
2510
|
if (!((dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['basic.enable']) === false)) {
|
|
2508
|
-
_context36.next =
|
|
2511
|
+
_context36.next = 21;
|
|
2509
2512
|
break;
|
|
2510
2513
|
}
|
|
2511
2514
|
return _context36.abrupt("return", makeShopClosed(basicUnavailableMessage));
|
|
2512
|
-
case
|
|
2515
|
+
case 21:
|
|
2513
2516
|
if (!toBoolean(dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.paused'])) {
|
|
2514
|
-
_context36.next =
|
|
2517
|
+
_context36.next = 24;
|
|
2515
2518
|
break;
|
|
2516
2519
|
}
|
|
2517
2520
|
if (!((dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.pause_behavior']) === 'hide_all')) {
|
|
2518
|
-
_context36.next =
|
|
2521
|
+
_context36.next = 24;
|
|
2519
2522
|
break;
|
|
2520
2523
|
}
|
|
2521
2524
|
return _context36.abrupt("return", makeShopClosed(pauseMessage));
|
|
2522
|
-
case
|
|
2525
|
+
case 24:
|
|
2523
2526
|
// 3. 营业时间 operating_hours 闸门
|
|
2524
2527
|
operatingHourIds = Array.isArray(dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.operating_hours']) ? dineInConfig['availability.operating_hours'].map(function (id) {
|
|
2525
2528
|
return Number(id);
|
|
@@ -2535,27 +2538,27 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2535
2538
|
}
|
|
2536
2539
|
}
|
|
2537
2540
|
if (!(outsideOperatingHours && closedBehaviorValue !== 'show_menu_disabled')) {
|
|
2538
|
-
_context36.next =
|
|
2541
|
+
_context36.next = 29;
|
|
2539
2542
|
break;
|
|
2540
2543
|
}
|
|
2541
2544
|
return _context36.abrupt("return", makeShopClosed(closedMessage, closedBehaviorValue));
|
|
2542
|
-
case
|
|
2545
|
+
case 29:
|
|
2543
2546
|
// Step1: 先加载预约规则商品,拿到 enabledReservationRuleProducts 与容量附加信息
|
|
2544
2547
|
// (resourceSelectType 需要基于这些商品 + 占用接口的 form_id 计算,故必须前置)
|
|
2545
2548
|
tempOrder = this.ensureTempOrder();
|
|
2546
2549
|
reservationLinkIds = collectLinkProductIdsFromReservationRules(dineInConfig['fulfillment.enabled_resource_rules']);
|
|
2547
2550
|
if (!(reservationLinkIds.length === 0)) {
|
|
2548
|
-
_context36.next =
|
|
2551
|
+
_context36.next = 35;
|
|
2549
2552
|
break;
|
|
2550
2553
|
}
|
|
2551
2554
|
this.enabledReservationRuleProducts = [];
|
|
2552
|
-
_context36.next =
|
|
2555
|
+
_context36.next = 46;
|
|
2553
2556
|
break;
|
|
2554
|
-
case
|
|
2557
|
+
case 35:
|
|
2555
2558
|
tempOrder.metadata = _objectSpread({}, tempOrder.metadata || {});
|
|
2556
2559
|
delete tempOrder.metadata.table_occupancy_duration;
|
|
2557
2560
|
reservationProductList = new ProductList("".concat(this.name, "_reservationEnabledRules"), this.defaultVersion);
|
|
2558
|
-
_context36.next =
|
|
2561
|
+
_context36.next = 40;
|
|
2559
2562
|
return reservationProductList.initialize(this.core, {
|
|
2560
2563
|
store: {
|
|
2561
2564
|
list: [],
|
|
@@ -2567,17 +2570,17 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2567
2570
|
cacheId: this.cacheId
|
|
2568
2571
|
})
|
|
2569
2572
|
});
|
|
2570
|
-
case
|
|
2573
|
+
case 40:
|
|
2571
2574
|
scheduleDate = dayjs().format('YYYY-MM-DD');
|
|
2572
2575
|
scheduleDatetime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
2573
|
-
_context36.next =
|
|
2576
|
+
_context36.next = 44;
|
|
2574
2577
|
return reservationProductList.loadProducts({
|
|
2575
2578
|
product_ids: reservationLinkIds,
|
|
2576
2579
|
schedule_date: scheduleDate,
|
|
2577
2580
|
schedule_datetime: scheduleDatetime,
|
|
2578
2581
|
cacheId: this.cacheId
|
|
2579
2582
|
});
|
|
2580
|
-
case
|
|
2583
|
+
case 44:
|
|
2581
2584
|
loaded = _context36.sent;
|
|
2582
2585
|
if (Array.isArray(loaded)) {
|
|
2583
2586
|
this.enabledReservationRuleProducts = loaded;
|
|
@@ -2602,10 +2605,10 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2602
2605
|
}
|
|
2603
2606
|
});
|
|
2604
2607
|
}
|
|
2605
|
-
case
|
|
2606
|
-
_context36.next =
|
|
2608
|
+
case 46:
|
|
2609
|
+
_context36.next = 48;
|
|
2607
2610
|
return this.fetchResourceOccupyDetailByResourceId(resourceId);
|
|
2608
|
-
case
|
|
2611
|
+
case 48:
|
|
2609
2612
|
occupyDetail = _context36.sent;
|
|
2610
2613
|
// Step3: 结合预约规则商品的 product_resource.resources 与占用接口返回的 form_id,
|
|
2611
2614
|
// 计算当前桌台的 resourceSelectType(single/multiple/capacity)
|
|
@@ -2639,30 +2642,30 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2639
2642
|
} : {}), this.store.resource.requestPaxMax !== undefined ? {
|
|
2640
2643
|
requestPaxMax: this.store.resource.requestPaxMax
|
|
2641
2644
|
} : {});
|
|
2642
|
-
tempOrder.relation_id = resourceId || ((_this$
|
|
2645
|
+
tempOrder.relation_id = resourceId || ((_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.relation_id);
|
|
2643
2646
|
tempOrder.table_form_id = resourceState.tableFormId;
|
|
2644
2647
|
tempOrder.resource_id = resourceId;
|
|
2645
2648
|
(_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 || _this$store$order5.persistTempOrder();
|
|
2646
2649
|
|
|
2647
2650
|
// 空闲状态下自动准备本地临时订单,供后续“购物车式”商品操作使用
|
|
2648
2651
|
if (!(availabilityInfo.mode === 'idle')) {
|
|
2649
|
-
_context36.next =
|
|
2652
|
+
_context36.next = 63;
|
|
2650
2653
|
break;
|
|
2651
2654
|
}
|
|
2652
|
-
_context36.next =
|
|
2655
|
+
_context36.next = 63;
|
|
2653
2656
|
return this.addNewOrder();
|
|
2654
|
-
case
|
|
2657
|
+
case 63:
|
|
2655
2658
|
// 如果是加单模式,tempOrder 里 需要记录 lastOrderId,提交的时候走加单接口
|
|
2656
2659
|
if (availabilityInfo.mode === 'additional_order' || availabilityInfo.mode === 'additional_order_with_code') {
|
|
2657
2660
|
tempOrder.order_id = resourceState.lastOrderId;
|
|
2658
2661
|
}
|
|
2659
2662
|
if (!tempOrder.order_id) {
|
|
2660
|
-
_context36.next =
|
|
2663
|
+
_context36.next = 72;
|
|
2661
2664
|
break;
|
|
2662
2665
|
}
|
|
2663
|
-
_context36.next =
|
|
2666
|
+
_context36.next = 67;
|
|
2664
2667
|
return (_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getOrderInfoByRemote(tempOrder.order_id);
|
|
2665
|
-
case
|
|
2668
|
+
case 67:
|
|
2666
2669
|
res = _context36.sent;
|
|
2667
2670
|
// 找到下单的时候输入的 entryPaxNumber
|
|
2668
2671
|
entryPaxNumber = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 || (_res$data = _res$data.bookings) === null || _res$data === void 0 || (_res$data = _res$data.find(function (p) {
|
|
@@ -2670,12 +2673,12 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2670
2673
|
return (_p$metadata = p.metadata) === null || _p$metadata === void 0 ? void 0 : _p$metadata.collect_pax;
|
|
2671
2674
|
})) === null || _res$data === void 0 || (_res$data = _res$data.metadata) === null || _res$data === void 0 ? void 0 : _res$data.collect_pax;
|
|
2672
2675
|
if (!entryPaxNumber) {
|
|
2673
|
-
_context36.next =
|
|
2676
|
+
_context36.next = 72;
|
|
2674
2677
|
break;
|
|
2675
2678
|
}
|
|
2676
|
-
_context36.next =
|
|
2679
|
+
_context36.next = 72;
|
|
2677
2680
|
return this.setEntryPaxNumber(entryPaxNumber);
|
|
2678
|
-
case
|
|
2681
|
+
case 72:
|
|
2679
2682
|
lastOrderInfo = (_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 || (_this$store$order7$ge = _this$store$order7.getLastOrderInfo) === null || _this$store$order7$ge === void 0 ? void 0 : _this$store$order7$ge.call(_this$store$order7);
|
|
2680
2683
|
historicalItems = hasOrderId && Array.isArray(lastOrderInfo === null || lastOrderInfo === void 0 ? void 0 : lastOrderInfo.products) ? lastOrderInfo.products.reduce(function (acc, p) {
|
|
2681
2684
|
if (typeof (p === null || p === void 0 ? void 0 : p.product_id) !== 'number') return acc;
|
|
@@ -2687,13 +2690,13 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2687
2690
|
} : {}));
|
|
2688
2691
|
return acc;
|
|
2689
2692
|
}, []) : []; // pax 由 setEntryPaxNumber 负责写入 itemRuleRuntimeConfig.pax
|
|
2690
|
-
_context36.next =
|
|
2693
|
+
_context36.next = 76;
|
|
2691
2694
|
return this.setItemRuleRuntimeConfig({
|
|
2692
|
-
serviceType: (_this$
|
|
2695
|
+
serviceType: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode,
|
|
2693
2696
|
submissionIndex: hasOrderId ? 1 : 0,
|
|
2694
2697
|
historicalItems: historicalItems
|
|
2695
2698
|
});
|
|
2696
|
-
case
|
|
2699
|
+
case 76:
|
|
2697
2700
|
// operating_hours 超出营业时段 + closed_behavior=show_menu_disabled:
|
|
2698
2701
|
// 允许浏览商品但 UI 层需拦截“下一步”,这里覆盖最终 mode 并回传错误提示
|
|
2699
2702
|
if (outsideOperatingHours && closedBehaviorValue === 'show_menu_disabled') {
|
|
@@ -2715,18 +2718,18 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2715
2718
|
isFull: resourceState.isFull
|
|
2716
2719
|
});
|
|
2717
2720
|
return _context36.abrupt("return", availabilityInfo);
|
|
2718
|
-
case
|
|
2719
|
-
_context36.prev =
|
|
2721
|
+
case 81:
|
|
2722
|
+
_context36.prev = 81;
|
|
2720
2723
|
_context36.t0 = _context36["catch"](1);
|
|
2721
2724
|
this.logMethodError('checkResourceAvailable', _context36.t0.message, {
|
|
2722
2725
|
resourceId: resourceId
|
|
2723
2726
|
});
|
|
2724
2727
|
throw _context36.t0;
|
|
2725
|
-
case
|
|
2728
|
+
case 85:
|
|
2726
2729
|
case "end":
|
|
2727
2730
|
return _context36.stop();
|
|
2728
2731
|
}
|
|
2729
|
-
}, _callee36, this, [[1,
|
|
2732
|
+
}, _callee36, this, [[1, 81]]);
|
|
2730
2733
|
}));
|
|
2731
2734
|
function checkResourceAvailable(_x18, _x19) {
|
|
2732
2735
|
return _checkResourceAvailable.apply(this, arguments);
|
|
@@ -2769,14 +2772,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2769
2772
|
key: "getProductList",
|
|
2770
2773
|
value: function () {
|
|
2771
2774
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
|
|
2772
|
-
var _this$
|
|
2775
|
+
var _this$otherParams15;
|
|
2773
2776
|
var menu_list_ids, _this$store$products, res, formattedRes;
|
|
2774
2777
|
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
2775
2778
|
while (1) switch (_context38.prev = _context38.next) {
|
|
2776
2779
|
case 0:
|
|
2777
2780
|
this.logMethodStart('getProductList');
|
|
2778
2781
|
// 可以直接通过配置里的 menu 读取
|
|
2779
|
-
menu_list_ids = ((_this$
|
|
2782
|
+
menu_list_ids = ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 || (_this$otherParams15 = _this$otherParams15.dineInConfig) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15['menu.associated_menus'].map(function (n) {
|
|
2780
2783
|
return Number(n.value);
|
|
2781
2784
|
})) || [];
|
|
2782
2785
|
_context38.prev = 2;
|
|
@@ -2979,9 +2982,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2979
2982
|
}, {
|
|
2980
2983
|
key: "getFulfillmentModes",
|
|
2981
2984
|
value: function getFulfillmentModes() {
|
|
2982
|
-
var _this$
|
|
2985
|
+
var _this$otherParams16;
|
|
2983
2986
|
this.logMethodStart('getFulfillmentModes');
|
|
2984
|
-
var dineInConfig = ((_this$
|
|
2987
|
+
var dineInConfig = ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.dineInConfig) || {};
|
|
2985
2988
|
var result = {
|
|
2986
2989
|
enablePickup: Boolean(dineInConfig['fulfillment.enable_pickup']),
|
|
2987
2990
|
enableTableService: Boolean(dineInConfig['fulfillment.enable_table_service'])
|
|
@@ -2995,9 +2998,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2995
2998
|
}, {
|
|
2996
2999
|
key: "checkManualPickupRef",
|
|
2997
3000
|
value: function checkManualPickupRef() {
|
|
2998
|
-
var _this$
|
|
3001
|
+
var _this$otherParams17;
|
|
2999
3002
|
this.logMethodStart('checkManualPickupRef');
|
|
3000
|
-
var dineInConfig = ((_this$
|
|
3003
|
+
var dineInConfig = ((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.dineInConfig) || {};
|
|
3001
3004
|
var refMode = dineInConfig['fulfillment.fulfillment_ref_mode'];
|
|
3002
3005
|
var manualInputType = dineInConfig['fulfillment.manual_input_type'];
|
|
3003
3006
|
var enabled = refMode === 'manual_input';
|
|
@@ -1426,14 +1426,17 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1426
1426
|
// 通过 resource_id + 店铺配置
|
|
1427
1427
|
// hasOrderId 表示 url 上是否有 orderid,如果是的话,后续的流程会走加单
|
|
1428
1428
|
async checkResourceAvailable(resourceId, hasOrderId) {
|
|
1429
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
1429
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
1430
1430
|
this.logMethodStart("checkResourceAvailable", {
|
|
1431
1431
|
resourceId
|
|
1432
1432
|
});
|
|
1433
1433
|
try {
|
|
1434
|
-
const
|
|
1434
|
+
const businessCode = String(((_a = this.otherParams) == null ? void 0 : _a.businessCode) ?? "").trim();
|
|
1435
|
+
const channel = String(((_b = this.otherParams) == null ? void 0 : _b.channel) ?? "").trim();
|
|
1436
|
+
const openDataTarget = businessCode && channel ? `${businessCode}+${channel}` : "dine_in+scan_to_order";
|
|
1437
|
+
const openData = await ((_d = (_c = this.otherParams) == null ? void 0 : _c.getOpenData) == null ? void 0 : _d.call(_c, {
|
|
1435
1438
|
scope: "board",
|
|
1436
|
-
target:
|
|
1439
|
+
target: openDataTarget,
|
|
1437
1440
|
section_code: ["basic", "fulfillment", "reservation", "sale", "menu", "availability", "workflow"]
|
|
1438
1441
|
}));
|
|
1439
1442
|
if ((openData == null ? void 0 : openData.status) === false) {
|
|
@@ -1560,16 +1563,16 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1560
1563
|
table_form_id: resourceState.tableFormId,
|
|
1561
1564
|
deskmate_valid: resourceState.deskmate_valid,
|
|
1562
1565
|
table_form_record: resourceState.table_form_record,
|
|
1563
|
-
policy: (
|
|
1564
|
-
partyroom_booking: (
|
|
1566
|
+
policy: (_e = occupyDetail == null ? void 0 : occupyDetail.form_record) == null ? void 0 : _e.policy,
|
|
1567
|
+
partyroom_booking: (_f = occupyDetail == null ? void 0 : occupyDetail.form_record) == null ? void 0 : _f.partyroom_booking,
|
|
1565
1568
|
...this.store.resource.requestEntryPax !== void 0 ? { requestEntryPax: this.store.resource.requestEntryPax } : {},
|
|
1566
1569
|
...this.store.resource.requestPaxMin !== void 0 ? { requestPaxMin: this.store.resource.requestPaxMin } : {},
|
|
1567
1570
|
...this.store.resource.requestPaxMax !== void 0 ? { requestPaxMax: this.store.resource.requestPaxMax } : {}
|
|
1568
1571
|
};
|
|
1569
|
-
tempOrder.relation_id = resourceId || ((
|
|
1572
|
+
tempOrder.relation_id = resourceId || ((_g = this.otherParams) == null ? void 0 : _g.relation_id);
|
|
1570
1573
|
tempOrder.table_form_id = resourceState.tableFormId;
|
|
1571
1574
|
tempOrder.resource_id = resourceId;
|
|
1572
|
-
(
|
|
1575
|
+
(_h = this.store.order) == null ? void 0 : _h.persistTempOrder();
|
|
1573
1576
|
if (availabilityInfo.mode === "idle") {
|
|
1574
1577
|
await this.addNewOrder();
|
|
1575
1578
|
}
|
|
@@ -1577,16 +1580,16 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1577
1580
|
tempOrder.order_id = resourceState.lastOrderId;
|
|
1578
1581
|
}
|
|
1579
1582
|
if (tempOrder.order_id) {
|
|
1580
|
-
const res = await ((
|
|
1581
|
-
const entryPaxNumber = (
|
|
1583
|
+
const res = await ((_i = this.store.order) == null ? void 0 : _i.getOrderInfoByRemote(tempOrder.order_id));
|
|
1584
|
+
const entryPaxNumber = (_m = (_l = (_k = (_j = res == null ? void 0 : res.data) == null ? void 0 : _j.bookings) == null ? void 0 : _k.find((p) => {
|
|
1582
1585
|
var _a2;
|
|
1583
1586
|
return (_a2 = p.metadata) == null ? void 0 : _a2.collect_pax;
|
|
1584
|
-
})) == null ? void 0 :
|
|
1587
|
+
})) == null ? void 0 : _l.metadata) == null ? void 0 : _m.collect_pax;
|
|
1585
1588
|
if (entryPaxNumber) {
|
|
1586
1589
|
await this.setEntryPaxNumber(entryPaxNumber);
|
|
1587
1590
|
}
|
|
1588
1591
|
}
|
|
1589
|
-
const lastOrderInfo = (
|
|
1592
|
+
const lastOrderInfo = (_o = (_n = this.store.order) == null ? void 0 : _n.getLastOrderInfo) == null ? void 0 : _o.call(_n);
|
|
1590
1593
|
const historicalItems = hasOrderId && Array.isArray(lastOrderInfo == null ? void 0 : lastOrderInfo.products) ? lastOrderInfo.products.reduce((acc, p) => {
|
|
1591
1594
|
if (typeof (p == null ? void 0 : p.product_id) !== "number")
|
|
1592
1595
|
return acc;
|
|
@@ -1598,7 +1601,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1598
1601
|
return acc;
|
|
1599
1602
|
}, []) : [];
|
|
1600
1603
|
await this.setItemRuleRuntimeConfig({
|
|
1601
|
-
serviceType: (
|
|
1604
|
+
serviceType: (_p = this.otherParams) == null ? void 0 : _p.businessCode,
|
|
1602
1605
|
submissionIndex: hasOrderId ? 1 : 0,
|
|
1603
1606
|
historicalItems
|
|
1604
1607
|
});
|