@pisell/pisellos 2.1.137 → 2.1.138
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.
|
@@ -2508,7 +2508,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2508
2508
|
key: "checkResourceAvailable",
|
|
2509
2509
|
value: function () {
|
|
2510
2510
|
var _checkResourceAvailable = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(resourceId, hasOrderId) {
|
|
2511
|
-
var _this$
|
|
2511
|
+
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;
|
|
2512
2512
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2513
2513
|
while (1) switch (_context36.prev = _context36.next) {
|
|
2514
2514
|
case 0:
|
|
@@ -2516,25 +2516,28 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2516
2516
|
resourceId: resourceId
|
|
2517
2517
|
});
|
|
2518
2518
|
_context36.prev = 1;
|
|
2519
|
-
|
|
2520
|
-
|
|
2519
|
+
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();
|
|
2520
|
+
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();
|
|
2521
|
+
openDataTarget = businessCode && channel ? "".concat(businessCode, "+").concat(channel) : 'dine_in+scan_to_order';
|
|
2522
|
+
_context36.next = 7;
|
|
2523
|
+
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, {
|
|
2521
2524
|
scope: 'board',
|
|
2522
|
-
target:
|
|
2525
|
+
target: openDataTarget,
|
|
2523
2526
|
section_code: ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow']
|
|
2524
2527
|
});
|
|
2525
|
-
case
|
|
2528
|
+
case 7:
|
|
2526
2529
|
openData = _context36.sent;
|
|
2527
2530
|
if (!((openData === null || openData === void 0 ? void 0 : openData.status) === false)) {
|
|
2528
|
-
_context36.next =
|
|
2531
|
+
_context36.next = 10;
|
|
2529
2532
|
break;
|
|
2530
2533
|
}
|
|
2531
2534
|
throw new Error((openData === null || openData === void 0 ? void 0 : openData.message) || '获取店铺配置失败');
|
|
2532
|
-
case
|
|
2535
|
+
case 10:
|
|
2533
2536
|
dineInConfig = (openData === null || openData === void 0 ? void 0 : openData.data) || {};
|
|
2534
2537
|
this.otherParams.dineInConfig = dineInConfig;
|
|
2535
|
-
_context36.next =
|
|
2538
|
+
_context36.next = 14;
|
|
2536
2539
|
return this.syncItemRuleConfigsFromDineInConfig(dineInConfig);
|
|
2537
|
-
case
|
|
2540
|
+
case 14:
|
|
2538
2541
|
closedBehaviorValue = dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.closed_behavior'];
|
|
2539
2542
|
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']);
|
|
2540
2543
|
basicUnavailableMessage = (dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['basic.unavailable_message']) || closedMessage;
|
|
@@ -2551,21 +2554,21 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2551
2554
|
};
|
|
2552
2555
|
}; // 1. 基础开关 basic.enable 关闭
|
|
2553
2556
|
if (!((dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['basic.enable']) === false)) {
|
|
2554
|
-
_context36.next =
|
|
2557
|
+
_context36.next = 21;
|
|
2555
2558
|
break;
|
|
2556
2559
|
}
|
|
2557
2560
|
return _context36.abrupt("return", makeShopClosed(basicUnavailableMessage));
|
|
2558
|
-
case
|
|
2561
|
+
case 21:
|
|
2559
2562
|
if (!toBoolean(dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.paused'])) {
|
|
2560
|
-
_context36.next =
|
|
2563
|
+
_context36.next = 24;
|
|
2561
2564
|
break;
|
|
2562
2565
|
}
|
|
2563
2566
|
if (!((dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.pause_behavior']) === 'hide_all')) {
|
|
2564
|
-
_context36.next =
|
|
2567
|
+
_context36.next = 24;
|
|
2565
2568
|
break;
|
|
2566
2569
|
}
|
|
2567
2570
|
return _context36.abrupt("return", makeShopClosed(pauseMessage));
|
|
2568
|
-
case
|
|
2571
|
+
case 24:
|
|
2569
2572
|
// 3. 营业时间 operating_hours 闸门
|
|
2570
2573
|
operatingHourIds = Array.isArray(dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.operating_hours']) ? dineInConfig['availability.operating_hours'].map(function (id) {
|
|
2571
2574
|
return Number(id);
|
|
@@ -2581,27 +2584,27 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2581
2584
|
}
|
|
2582
2585
|
}
|
|
2583
2586
|
if (!(outsideOperatingHours && closedBehaviorValue !== 'show_menu_disabled')) {
|
|
2584
|
-
_context36.next =
|
|
2587
|
+
_context36.next = 29;
|
|
2585
2588
|
break;
|
|
2586
2589
|
}
|
|
2587
2590
|
return _context36.abrupt("return", makeShopClosed(closedMessage, closedBehaviorValue));
|
|
2588
|
-
case
|
|
2591
|
+
case 29:
|
|
2589
2592
|
// Step1: 先加载预约规则商品,拿到 enabledReservationRuleProducts 与容量附加信息
|
|
2590
2593
|
// (resourceSelectType 需要基于这些商品 + 占用接口的 form_id 计算,故必须前置)
|
|
2591
2594
|
tempOrder = this.ensureTempOrder();
|
|
2592
2595
|
reservationLinkIds = collectLinkProductIdsFromReservationRules(dineInConfig['fulfillment.enabled_resource_rules']);
|
|
2593
2596
|
if (!(reservationLinkIds.length === 0)) {
|
|
2594
|
-
_context36.next =
|
|
2597
|
+
_context36.next = 35;
|
|
2595
2598
|
break;
|
|
2596
2599
|
}
|
|
2597
2600
|
this.enabledReservationRuleProducts = [];
|
|
2598
|
-
_context36.next =
|
|
2601
|
+
_context36.next = 46;
|
|
2599
2602
|
break;
|
|
2600
|
-
case
|
|
2603
|
+
case 35:
|
|
2601
2604
|
tempOrder.metadata = _objectSpread({}, tempOrder.metadata || {});
|
|
2602
2605
|
delete tempOrder.metadata.table_occupancy_duration;
|
|
2603
2606
|
reservationProductList = new ProductList("".concat(this.name, "_reservationEnabledRules"), this.defaultVersion);
|
|
2604
|
-
_context36.next =
|
|
2607
|
+
_context36.next = 40;
|
|
2605
2608
|
return reservationProductList.initialize(this.core, {
|
|
2606
2609
|
store: {
|
|
2607
2610
|
list: [],
|
|
@@ -2613,17 +2616,17 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2613
2616
|
cacheId: this.cacheId
|
|
2614
2617
|
})
|
|
2615
2618
|
});
|
|
2616
|
-
case
|
|
2619
|
+
case 40:
|
|
2617
2620
|
scheduleDate = dayjs().format('YYYY-MM-DD');
|
|
2618
2621
|
scheduleDatetime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
2619
|
-
_context36.next =
|
|
2622
|
+
_context36.next = 44;
|
|
2620
2623
|
return reservationProductList.loadProducts({
|
|
2621
2624
|
product_ids: reservationLinkIds,
|
|
2622
2625
|
schedule_date: scheduleDate,
|
|
2623
2626
|
schedule_datetime: scheduleDatetime,
|
|
2624
2627
|
cacheId: this.cacheId
|
|
2625
2628
|
});
|
|
2626
|
-
case
|
|
2629
|
+
case 44:
|
|
2627
2630
|
loaded = _context36.sent;
|
|
2628
2631
|
if (Array.isArray(loaded)) {
|
|
2629
2632
|
this.enabledReservationRuleProducts = loaded;
|
|
@@ -2648,10 +2651,10 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2648
2651
|
}
|
|
2649
2652
|
});
|
|
2650
2653
|
}
|
|
2651
|
-
case
|
|
2652
|
-
_context36.next =
|
|
2654
|
+
case 46:
|
|
2655
|
+
_context36.next = 48;
|
|
2653
2656
|
return this.fetchResourceOccupyDetailByResourceId(resourceId);
|
|
2654
|
-
case
|
|
2657
|
+
case 48:
|
|
2655
2658
|
occupyDetail = _context36.sent;
|
|
2656
2659
|
// Step3: 结合预约规则商品的 product_resource.resources 与占用接口返回的 form_id,
|
|
2657
2660
|
// 计算当前桌台的 resourceSelectType(single/multiple/capacity)
|
|
@@ -2685,30 +2688,30 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2685
2688
|
} : {}), this.store.resource.requestPaxMax !== undefined ? {
|
|
2686
2689
|
requestPaxMax: this.store.resource.requestPaxMax
|
|
2687
2690
|
} : {});
|
|
2688
|
-
tempOrder.relation_id = resourceId || ((_this$
|
|
2691
|
+
tempOrder.relation_id = resourceId || ((_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.relation_id);
|
|
2689
2692
|
tempOrder.table_form_id = resourceState.tableFormId;
|
|
2690
2693
|
tempOrder.resource_id = resourceId;
|
|
2691
2694
|
(_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 || _this$store$order5.persistTempOrder();
|
|
2692
2695
|
|
|
2693
2696
|
// 空闲状态下自动准备本地临时订单,供后续“购物车式”商品操作使用
|
|
2694
2697
|
if (!(availabilityInfo.mode === 'idle')) {
|
|
2695
|
-
_context36.next =
|
|
2698
|
+
_context36.next = 63;
|
|
2696
2699
|
break;
|
|
2697
2700
|
}
|
|
2698
|
-
_context36.next =
|
|
2701
|
+
_context36.next = 63;
|
|
2699
2702
|
return this.addNewOrder();
|
|
2700
|
-
case
|
|
2703
|
+
case 63:
|
|
2701
2704
|
// 如果是加单模式,tempOrder 里 需要记录 lastOrderId,提交的时候走加单接口
|
|
2702
2705
|
if (availabilityInfo.mode === 'additional_order' || availabilityInfo.mode === 'additional_order_with_code') {
|
|
2703
2706
|
tempOrder.order_id = resourceState.lastOrderId;
|
|
2704
2707
|
}
|
|
2705
2708
|
if (!tempOrder.order_id) {
|
|
2706
|
-
_context36.next =
|
|
2709
|
+
_context36.next = 72;
|
|
2707
2710
|
break;
|
|
2708
2711
|
}
|
|
2709
|
-
_context36.next =
|
|
2712
|
+
_context36.next = 67;
|
|
2710
2713
|
return (_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getOrderInfoByRemote(tempOrder.order_id);
|
|
2711
|
-
case
|
|
2714
|
+
case 67:
|
|
2712
2715
|
res = _context36.sent;
|
|
2713
2716
|
// 找到下单的时候输入的 entryPaxNumber
|
|
2714
2717
|
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) {
|
|
@@ -2716,12 +2719,12 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2716
2719
|
return (_p$metadata = p.metadata) === null || _p$metadata === void 0 ? void 0 : _p$metadata.collect_pax;
|
|
2717
2720
|
})) === null || _res$data === void 0 || (_res$data = _res$data.metadata) === null || _res$data === void 0 ? void 0 : _res$data.collect_pax;
|
|
2718
2721
|
if (!entryPaxNumber) {
|
|
2719
|
-
_context36.next =
|
|
2722
|
+
_context36.next = 72;
|
|
2720
2723
|
break;
|
|
2721
2724
|
}
|
|
2722
|
-
_context36.next =
|
|
2725
|
+
_context36.next = 72;
|
|
2723
2726
|
return this.setEntryPaxNumber(entryPaxNumber);
|
|
2724
|
-
case
|
|
2727
|
+
case 72:
|
|
2725
2728
|
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);
|
|
2726
2729
|
historicalItems = hasOrderId && Array.isArray(lastOrderInfo === null || lastOrderInfo === void 0 ? void 0 : lastOrderInfo.products) ? lastOrderInfo.products.reduce(function (acc, p) {
|
|
2727
2730
|
if (typeof (p === null || p === void 0 ? void 0 : p.product_id) !== 'number') return acc;
|
|
@@ -2733,13 +2736,13 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2733
2736
|
} : {}));
|
|
2734
2737
|
return acc;
|
|
2735
2738
|
}, []) : []; // pax 由 setEntryPaxNumber 负责写入 itemRuleRuntimeConfig.pax
|
|
2736
|
-
_context36.next =
|
|
2739
|
+
_context36.next = 76;
|
|
2737
2740
|
return this.setItemRuleRuntimeConfig({
|
|
2738
|
-
serviceType: (_this$
|
|
2741
|
+
serviceType: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode,
|
|
2739
2742
|
submissionIndex: hasOrderId ? 1 : 0,
|
|
2740
2743
|
historicalItems: historicalItems
|
|
2741
2744
|
});
|
|
2742
|
-
case
|
|
2745
|
+
case 76:
|
|
2743
2746
|
// operating_hours 超出营业时段 + closed_behavior=show_menu_disabled:
|
|
2744
2747
|
// 允许浏览商品但 UI 层需拦截“下一步”,这里覆盖最终 mode 并回传错误提示
|
|
2745
2748
|
if (outsideOperatingHours && closedBehaviorValue === 'show_menu_disabled') {
|
|
@@ -2761,18 +2764,18 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2761
2764
|
isFull: resourceState.isFull
|
|
2762
2765
|
});
|
|
2763
2766
|
return _context36.abrupt("return", availabilityInfo);
|
|
2764
|
-
case
|
|
2765
|
-
_context36.prev =
|
|
2767
|
+
case 81:
|
|
2768
|
+
_context36.prev = 81;
|
|
2766
2769
|
_context36.t0 = _context36["catch"](1);
|
|
2767
2770
|
this.logMethodError('checkResourceAvailable', _context36.t0.message, {
|
|
2768
2771
|
resourceId: resourceId
|
|
2769
2772
|
});
|
|
2770
2773
|
throw _context36.t0;
|
|
2771
|
-
case
|
|
2774
|
+
case 85:
|
|
2772
2775
|
case "end":
|
|
2773
2776
|
return _context36.stop();
|
|
2774
2777
|
}
|
|
2775
|
-
}, _callee36, this, [[1,
|
|
2778
|
+
}, _callee36, this, [[1, 81]]);
|
|
2776
2779
|
}));
|
|
2777
2780
|
function checkResourceAvailable(_x18, _x19) {
|
|
2778
2781
|
return _checkResourceAvailable.apply(this, arguments);
|
|
@@ -2815,14 +2818,14 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2815
2818
|
key: "getProductList",
|
|
2816
2819
|
value: function () {
|
|
2817
2820
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
|
|
2818
|
-
var _this$
|
|
2821
|
+
var _this$otherParams15;
|
|
2819
2822
|
var menu_list_ids, _this$store$products, res, formattedRes;
|
|
2820
2823
|
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
2821
2824
|
while (1) switch (_context38.prev = _context38.next) {
|
|
2822
2825
|
case 0:
|
|
2823
2826
|
this.logMethodStart('getProductList');
|
|
2824
2827
|
// 可以直接通过配置里的 menu 读取
|
|
2825
|
-
menu_list_ids = ((_this$
|
|
2828
|
+
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) {
|
|
2826
2829
|
return Number(n.value);
|
|
2827
2830
|
})) || [];
|
|
2828
2831
|
_context38.prev = 2;
|
|
@@ -3025,9 +3028,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3025
3028
|
}, {
|
|
3026
3029
|
key: "getFulfillmentModes",
|
|
3027
3030
|
value: function getFulfillmentModes() {
|
|
3028
|
-
var _this$
|
|
3031
|
+
var _this$otherParams16;
|
|
3029
3032
|
this.logMethodStart('getFulfillmentModes');
|
|
3030
|
-
var dineInConfig = ((_this$
|
|
3033
|
+
var dineInConfig = ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.dineInConfig) || {};
|
|
3031
3034
|
var result = {
|
|
3032
3035
|
enablePickup: Boolean(dineInConfig['fulfillment.enable_pickup']),
|
|
3033
3036
|
enableTableService: Boolean(dineInConfig['fulfillment.enable_table_service'])
|
|
@@ -3041,9 +3044,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3041
3044
|
}, {
|
|
3042
3045
|
key: "checkManualPickupRef",
|
|
3043
3046
|
value: function checkManualPickupRef() {
|
|
3044
|
-
var _this$
|
|
3047
|
+
var _this$otherParams17;
|
|
3045
3048
|
this.logMethodStart('checkManualPickupRef');
|
|
3046
|
-
var dineInConfig = ((_this$
|
|
3049
|
+
var dineInConfig = ((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.dineInConfig) || {};
|
|
3047
3050
|
var refMode = dineInConfig['fulfillment.fulfillment_ref_mode'];
|
|
3048
3051
|
var manualInputType = dineInConfig['fulfillment.manual_input_type'];
|
|
3049
3052
|
var enabled = refMode === 'manual_input';
|
|
@@ -1457,14 +1457,17 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1457
1457
|
// 通过 resource_id + 店铺配置
|
|
1458
1458
|
// hasOrderId 表示 url 上是否有 orderid,如果是的话,后续的流程会走加单
|
|
1459
1459
|
async checkResourceAvailable(resourceId, hasOrderId) {
|
|
1460
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
1460
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
1461
1461
|
this.logMethodStart("checkResourceAvailable", {
|
|
1462
1462
|
resourceId
|
|
1463
1463
|
});
|
|
1464
1464
|
try {
|
|
1465
|
-
const
|
|
1465
|
+
const businessCode = String(((_a = this.otherParams) == null ? void 0 : _a.businessCode) ?? "").trim();
|
|
1466
|
+
const channel = String(((_b = this.otherParams) == null ? void 0 : _b.channel) ?? "").trim();
|
|
1467
|
+
const openDataTarget = businessCode && channel ? `${businessCode}+${channel}` : "dine_in+scan_to_order";
|
|
1468
|
+
const openData = await ((_d = (_c = this.otherParams) == null ? void 0 : _c.getOpenData) == null ? void 0 : _d.call(_c, {
|
|
1466
1469
|
scope: "board",
|
|
1467
|
-
target:
|
|
1470
|
+
target: openDataTarget,
|
|
1468
1471
|
section_code: ["basic", "fulfillment", "reservation", "sale", "menu", "availability", "workflow"]
|
|
1469
1472
|
}));
|
|
1470
1473
|
if ((openData == null ? void 0 : openData.status) === false) {
|
|
@@ -1591,16 +1594,16 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1591
1594
|
table_form_id: resourceState.tableFormId,
|
|
1592
1595
|
deskmate_valid: resourceState.deskmate_valid,
|
|
1593
1596
|
table_form_record: resourceState.table_form_record,
|
|
1594
|
-
policy: (
|
|
1595
|
-
partyroom_booking: (
|
|
1597
|
+
policy: (_e = occupyDetail == null ? void 0 : occupyDetail.form_record) == null ? void 0 : _e.policy,
|
|
1598
|
+
partyroom_booking: (_f = occupyDetail == null ? void 0 : occupyDetail.form_record) == null ? void 0 : _f.partyroom_booking,
|
|
1596
1599
|
...this.store.resource.requestEntryPax !== void 0 ? { requestEntryPax: this.store.resource.requestEntryPax } : {},
|
|
1597
1600
|
...this.store.resource.requestPaxMin !== void 0 ? { requestPaxMin: this.store.resource.requestPaxMin } : {},
|
|
1598
1601
|
...this.store.resource.requestPaxMax !== void 0 ? { requestPaxMax: this.store.resource.requestPaxMax } : {}
|
|
1599
1602
|
};
|
|
1600
|
-
tempOrder.relation_id = resourceId || ((
|
|
1603
|
+
tempOrder.relation_id = resourceId || ((_g = this.otherParams) == null ? void 0 : _g.relation_id);
|
|
1601
1604
|
tempOrder.table_form_id = resourceState.tableFormId;
|
|
1602
1605
|
tempOrder.resource_id = resourceId;
|
|
1603
|
-
(
|
|
1606
|
+
(_h = this.store.order) == null ? void 0 : _h.persistTempOrder();
|
|
1604
1607
|
if (availabilityInfo.mode === "idle") {
|
|
1605
1608
|
await this.addNewOrder();
|
|
1606
1609
|
}
|
|
@@ -1608,16 +1611,16 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1608
1611
|
tempOrder.order_id = resourceState.lastOrderId;
|
|
1609
1612
|
}
|
|
1610
1613
|
if (tempOrder.order_id) {
|
|
1611
|
-
const res = await ((
|
|
1612
|
-
const entryPaxNumber = (
|
|
1614
|
+
const res = await ((_i = this.store.order) == null ? void 0 : _i.getOrderInfoByRemote(tempOrder.order_id));
|
|
1615
|
+
const entryPaxNumber = (_m = (_l = (_k = (_j = res == null ? void 0 : res.data) == null ? void 0 : _j.bookings) == null ? void 0 : _k.find((p) => {
|
|
1613
1616
|
var _a2;
|
|
1614
1617
|
return (_a2 = p.metadata) == null ? void 0 : _a2.collect_pax;
|
|
1615
|
-
})) == null ? void 0 :
|
|
1618
|
+
})) == null ? void 0 : _l.metadata) == null ? void 0 : _m.collect_pax;
|
|
1616
1619
|
if (entryPaxNumber) {
|
|
1617
1620
|
await this.setEntryPaxNumber(entryPaxNumber);
|
|
1618
1621
|
}
|
|
1619
1622
|
}
|
|
1620
|
-
const lastOrderInfo = (
|
|
1623
|
+
const lastOrderInfo = (_o = (_n = this.store.order) == null ? void 0 : _n.getLastOrderInfo) == null ? void 0 : _o.call(_n);
|
|
1621
1624
|
const historicalItems = hasOrderId && Array.isArray(lastOrderInfo == null ? void 0 : lastOrderInfo.products) ? lastOrderInfo.products.reduce((acc, p) => {
|
|
1622
1625
|
if (typeof (p == null ? void 0 : p.product_id) !== "number")
|
|
1623
1626
|
return acc;
|
|
@@ -1629,7 +1632,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
|
|
|
1629
1632
|
return acc;
|
|
1630
1633
|
}, []) : [];
|
|
1631
1634
|
await this.setItemRuleRuntimeConfig({
|
|
1632
|
-
serviceType: (
|
|
1635
|
+
serviceType: (_p = this.otherParams) == null ? void 0 : _p.businessCode,
|
|
1633
1636
|
submissionIndex: hasOrderId ? 1 : 0,
|
|
1634
1637
|
historicalItems
|
|
1635
1638
|
});
|