@pisell/pisellos 2.2.207 → 2.2.209

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.
@@ -234,53 +234,88 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
234
234
  return loadOpenDataConfig;
235
235
  }()
236
236
  }, {
237
- key: "configureIdGeneratorFromOpenData",
237
+ key: "getShortNumberOrDeviceId",
238
238
  value: function () {
239
- var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
240
- var openDataConfig, idGenerator, receiptSequenceLength, receiptSequenceStart, prefix, resetReceiptSequenceDaily, operatingDayBoundary;
239
+ var _getShortNumberOrDeviceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
240
+ var getAsyncIotDeviceInfo, res;
241
241
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
242
242
  while (1) switch (_context3.prev = _context3.next) {
243
243
  case 0:
244
- openDataConfig = null;
245
- _context3.prev = 1;
244
+ getAsyncIotDeviceInfo = this.getAppData('async_iot_device_info');
245
+ if (!getAsyncIotDeviceInfo) {
246
+ _context3.next = 7;
247
+ break;
248
+ }
246
249
  _context3.next = 4;
250
+ return getAsyncIotDeviceInfo === null || getAsyncIotDeviceInfo === void 0 ? void 0 : getAsyncIotDeviceInfo();
251
+ case 4:
252
+ res = _context3.sent;
253
+ if (!res.short_number) {
254
+ _context3.next = 7;
255
+ break;
256
+ }
257
+ return _context3.abrupt("return", res.short_number);
258
+ case 7:
259
+ return _context3.abrupt("return", this.getAppData('device_id') || 0);
260
+ case 8:
261
+ case "end":
262
+ return _context3.stop();
263
+ }
264
+ }, _callee3, this);
265
+ }));
266
+ function getShortNumberOrDeviceId() {
267
+ return _getShortNumberOrDeviceId.apply(this, arguments);
268
+ }
269
+ return getShortNumberOrDeviceId;
270
+ }()
271
+ }, {
272
+ key: "configureIdGeneratorFromOpenData",
273
+ value: function () {
274
+ var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
275
+ var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5;
276
+ var openDataConfig, idGenerator, receiptSequenceLength, receiptSequenceStart, prefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId;
277
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
278
+ while (1) switch (_context4.prev = _context4.next) {
279
+ case 0:
280
+ openDataConfig = null;
281
+ _context4.prev = 1;
282
+ _context4.next = 4;
247
283
  return this.loadOpenDataConfig();
248
284
  case 4:
249
- openDataConfig = _context3.sent;
250
- _context3.next = 11;
285
+ openDataConfig = _context4.sent;
286
+ _context4.next = 11;
251
287
  break;
252
288
  case 7:
253
- _context3.prev = 7;
254
- _context3.t0 = _context3["catch"](1);
255
- console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context3.t0);
256
- return _context3.abrupt("return");
289
+ _context4.prev = 7;
290
+ _context4.t0 = _context4["catch"](1);
291
+ console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context4.t0);
292
+ return _context4.abrupt("return");
257
293
  case 11:
258
- if (openDataConfig) {
259
- _context3.next = 13;
260
- break;
261
- }
262
- return _context3.abrupt("return");
263
- case 13:
294
+ // if (!openDataConfig) return;
264
295
  idGenerator = this.getIdGeneratorPlugin();
265
296
  if (idGenerator !== null && idGenerator !== void 0 && idGenerator.configure) {
266
- _context3.next = 17;
297
+ _context4.next = 15;
267
298
  break;
268
299
  }
269
300
  console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
270
- return _context3.abrupt("return");
271
- case 17:
272
- receiptSequenceLength = this.normalizePositiveInteger(openDataConfig['sale.short_number_digits'], 5);
273
- receiptSequenceStart = this.normalizePositiveInteger(openDataConfig['sale.short_number_start_number'], 1);
274
- prefix = this.normalizeIdPrefix(openDataConfig['sale.short_number_prefix'], 'R');
275
- resetReceiptSequenceDaily = typeof openDataConfig['sale.short_number_daily_reset'] === 'boolean' ? openDataConfig['sale.short_number_daily_reset'] : true;
301
+ return _context4.abrupt("return");
302
+ case 15:
303
+ receiptSequenceLength = this.normalizePositiveInteger((_openDataConfig = openDataConfig) === null || _openDataConfig === void 0 ? void 0 : _openDataConfig['sale.short_number_digits'], 5);
304
+ receiptSequenceStart = this.normalizePositiveInteger((_openDataConfig2 = openDataConfig) === null || _openDataConfig2 === void 0 ? void 0 : _openDataConfig2['sale.short_number_start_number'], 1);
305
+ prefix = this.normalizeIdPrefix((_openDataConfig3 = openDataConfig) === null || _openDataConfig3 === void 0 ? void 0 : _openDataConfig3['sale.short_number_prefix'], 'R');
306
+ resetReceiptSequenceDaily = typeof ((_openDataConfig4 = openDataConfig) === null || _openDataConfig4 === void 0 ? void 0 : _openDataConfig4['sale.short_number_daily_reset']) === 'boolean' ? (_openDataConfig5 = openDataConfig) === null || _openDataConfig5 === void 0 ? void 0 : _openDataConfig5['sale.short_number_daily_reset'] : true;
276
307
  operatingDayBoundary = this.getAppData('operating_day_boundary');
277
- _context3.prev = 22;
278
- _context3.next = 25;
308
+ _context4.next = 22;
309
+ return this.getShortNumberOrDeviceId();
310
+ case 22:
311
+ deviceId = _context4.sent;
312
+ _context4.prev = 23;
313
+ _context4.next = 26;
279
314
  return idGenerator.configure({
280
- biz: 'ticket',
315
+ biz: this.getBookingTicketBusinessCode() || 'ticket',
281
316
  config: {
282
317
  prefix: prefix,
283
- deviceCode: this.getAppData('device_id') || 0,
318
+ deviceCode: deviceId,
284
319
  // TODO 现在 picoding 没这个配置的 key
285
320
  padReceiptSequence: true,
286
321
  receiptSequenceLength: receiptSequenceLength,
@@ -289,18 +324,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
289
324
  receiptSequenceStart: receiptSequenceStart
290
325
  }
291
326
  });
292
- case 25:
293
- _context3.next = 30;
327
+ case 26:
328
+ _context4.next = 31;
294
329
  break;
295
- case 27:
296
- _context3.prev = 27;
297
- _context3.t1 = _context3["catch"](22);
298
- console.warn('[BookingTicket] idGenerator 配置失败', _context3.t1);
299
- case 30:
330
+ case 28:
331
+ _context4.prev = 28;
332
+ _context4.t1 = _context4["catch"](23);
333
+ console.warn('[BookingTicket] idGenerator 配置失败', _context4.t1);
334
+ case 31:
300
335
  case "end":
301
- return _context3.stop();
336
+ return _context4.stop();
302
337
  }
303
- }, _callee3, this, [[1, 7], [22, 27]]);
338
+ }, _callee4, this, [[1, 7], [23, 28]]);
304
339
  }));
305
340
  function configureIdGeneratorFromOpenData() {
306
341
  return _configureIdGeneratorFromOpenData.apply(this, arguments);
@@ -332,16 +367,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
332
367
  }, {
333
368
  key: "loadSalesDetail",
334
369
  value: (function () {
335
- var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderIdOrParams) {
370
+ var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(orderIdOrParams) {
336
371
  var _ref;
337
372
  var sales, customerModule, detailCustomer, orderCustomerSnapshot, protocolCustomerId, protocolCustomer, selectedCustomer, _selectedCustomer$nam, _ref2, detailCustomerId, detailCustomerRest, rawId, customer;
338
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
339
- while (1) switch (_context4.prev = _context4.next) {
373
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
374
+ while (1) switch (_context5.prev = _context5.next) {
340
375
  case 0:
341
- _context4.next = 2;
376
+ _context5.next = 2;
342
377
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "loadSalesDetail", this).call(this, orderIdOrParams);
343
378
  case 2:
344
- sales = _context4.sent;
379
+ sales = _context5.sent;
345
380
  customerModule = this.store.customer;
346
381
  detailCustomer = sales === null || sales === void 0 ? void 0 : sales.customer;
347
382
  orderCustomerSnapshot = this.store.order.getOrderCustomerSnapshot();
@@ -355,7 +390,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
355
390
  } : null;
356
391
  selectedCustomer = (_ref = detailCustomer !== null && detailCustomer !== void 0 ? detailCustomer : orderCustomerSnapshot) !== null && _ref !== void 0 ? _ref : protocolCustomer;
357
392
  if (!(customerModule && selectedCustomer)) {
358
- _context4.next = 17;
393
+ _context5.next = 17;
359
394
  break;
360
395
  }
361
396
  _ref2 = selectedCustomer !== null && selectedCustomer !== void 0 ? selectedCustomer : {}, detailCustomerId = _ref2.id, detailCustomerRest = _objectWithoutProperties(_ref2, _excluded);
@@ -369,15 +404,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
369
404
  });
370
405
  customerModule.setSelectedCustomer(customer);
371
406
  this.setOrderCustomer(customer);
372
- _context4.next = 17;
407
+ _context5.next = 17;
373
408
  return this.store.order.saveDraft();
374
409
  case 17:
375
- return _context4.abrupt("return", sales);
410
+ return _context5.abrupt("return", sales);
376
411
  case 18:
377
412
  case "end":
378
- return _context4.stop();
413
+ return _context5.stop();
379
414
  }
380
- }, _callee4, this);
415
+ }, _callee5, this);
381
416
  }));
382
417
  function loadSalesDetail(_x2) {
383
418
  return _loadSalesDetail.apply(this, arguments);
@@ -387,45 +422,45 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
387
422
  }, {
388
423
  key: "scanPromotionCode",
389
424
  value: function () {
390
- var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(code, customerId) {
425
+ var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(code, customerId) {
391
426
  var raw;
392
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
393
- while (1) switch (_context5.prev = _context5.next) {
427
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
428
+ while (1) switch (_context6.prev = _context6.next) {
394
429
  case 0:
395
430
  if (this.store.order) {
396
- _context5.next = 2;
431
+ _context6.next = 2;
397
432
  break;
398
433
  }
399
434
  throw new Error('order 模块未初始化');
400
435
  case 2:
401
- _context5.next = 4;
436
+ _context6.next = 4;
402
437
  return this.store.order.scanCode(code, customerId);
403
438
  case 4:
404
- raw = _context5.sent;
439
+ raw = _context6.sent;
405
440
  if (!raw.isAvailable) {
406
- _context5.next = 11;
441
+ _context6.next = 11;
407
442
  break;
408
443
  }
409
- _context5.next = 8;
444
+ _context6.next = 8;
410
445
  return this.hydrateOrderCustomerFromScanDiscounts(raw.scannedDiscountList || []);
411
446
  case 8:
412
- _context5.next = 10;
447
+ _context6.next = 10;
413
448
  return this.store.order.recalculateSummary({
414
449
  createIfMissing: true
415
450
  });
416
451
  case 10:
417
452
  this.store.order.persistTempOrder();
418
453
  case 11:
419
- return _context5.abrupt("return", {
454
+ return _context6.abrupt("return", {
420
455
  isAvailable: raw.isAvailable,
421
456
  type: raw.type,
422
457
  unavailableReason: raw.unavailableReason
423
458
  });
424
459
  case 12:
425
460
  case "end":
426
- return _context5.stop();
461
+ return _context6.stop();
427
462
  }
428
- }, _callee5, this);
463
+ }, _callee6, this);
429
464
  }));
430
465
  function scanPromotionCode(_x3, _x4) {
431
466
  return _scanPromotionCode.apply(this, arguments);
@@ -435,42 +470,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
435
470
  }, {
436
471
  key: "hydrateOrderCustomerFromScanDiscounts",
437
472
  value: function () {
438
- var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(discounts) {
473
+ var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(discounts) {
439
474
  var currentOrderCustomer, customerId, customer;
440
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
441
- while (1) switch (_context6.prev = _context6.next) {
475
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
476
+ while (1) switch (_context7.prev = _context7.next) {
442
477
  case 0:
443
478
  currentOrderCustomer = this.store.order.getOrderCustomer();
444
479
  if (!currentOrderCustomer) {
445
- _context6.next = 3;
480
+ _context7.next = 3;
446
481
  break;
447
482
  }
448
- return _context6.abrupt("return");
483
+ return _context7.abrupt("return");
449
484
  case 3:
450
485
  customerId = this.getDiscountCustomerId(discounts);
451
486
  if (customerId) {
452
- _context6.next = 6;
487
+ _context7.next = 6;
453
488
  break;
454
489
  }
455
- return _context6.abrupt("return");
490
+ return _context7.abrupt("return");
456
491
  case 6:
457
- _context6.next = 8;
492
+ _context7.next = 8;
458
493
  return this.resolveCustomerByDiscountCustomerId(customerId);
459
494
  case 8:
460
- customer = _context6.sent;
495
+ customer = _context7.sent;
461
496
  if (customer) {
462
- _context6.next = 11;
497
+ _context7.next = 11;
463
498
  break;
464
499
  }
465
- return _context6.abrupt("return");
500
+ return _context7.abrupt("return");
466
501
  case 11:
467
502
  this.store.customer.setSelectedCustomer(customer);
468
503
  this.setOrderCustomer(customer);
469
504
  case 13:
470
505
  case "end":
471
- return _context6.stop();
506
+ return _context7.stop();
472
507
  }
473
- }, _callee6, this);
508
+ }, _callee7, this);
474
509
  }));
475
510
  function hydrateOrderCustomerFromScanDiscounts(_x5) {
476
511
  return _hydrateOrderCustomerFromScanDiscounts.apply(this, arguments);
@@ -490,36 +525,36 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
490
525
  }, {
491
526
  key: "resolveCustomerByDiscountCustomerId",
492
527
  value: function () {
493
- var _resolveCustomerByDiscountCustomerId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(customerId) {
528
+ var _resolveCustomerByDiscountCustomerId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(customerId) {
494
529
  var _result$list;
495
530
  var localCustomers, localCustomer, normalizedLocalCustomer, result, remoteCustomer;
496
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
497
- while (1) switch (_context7.prev = _context7.next) {
531
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
532
+ while (1) switch (_context8.prev = _context8.next) {
498
533
  case 0:
499
534
  localCustomers = this.store.customer.getCustomers();
500
535
  localCustomer = this.findCustomerById(localCustomers, customerId);
501
536
  normalizedLocalCustomer = localCustomer ? this.normalizeCustomer(localCustomer) : null;
502
537
  if (!(normalizedLocalCustomer && this.hasUsableCustomerDetails(normalizedLocalCustomer))) {
503
- _context7.next = 5;
538
+ _context8.next = 5;
504
539
  break;
505
540
  }
506
- return _context7.abrupt("return", normalizedLocalCustomer);
541
+ return _context8.abrupt("return", normalizedLocalCustomer);
507
542
  case 5:
508
- _context7.next = 7;
543
+ _context8.next = 7;
509
544
  return this.store.customer.queryCustomerList({
510
545
  ids: [customerId],
511
546
  skip: 1,
512
547
  num: 1
513
548
  });
514
549
  case 7:
515
- result = _context7.sent;
550
+ result = _context8.sent;
516
551
  remoteCustomer = this.findCustomerById((result === null || result === void 0 ? void 0 : result.list) || [], customerId) || (result === null || result === void 0 || (_result$list = result.list) === null || _result$list === void 0 ? void 0 : _result$list[0]) || null;
517
- return _context7.abrupt("return", remoteCustomer ? this.normalizeCustomer(remoteCustomer) : null);
552
+ return _context8.abrupt("return", remoteCustomer ? this.normalizeCustomer(remoteCustomer) : null);
518
553
  case 10:
519
554
  case "end":
520
- return _context7.stop();
555
+ return _context8.stop();
521
556
  }
522
- }, _callee7, this);
557
+ }, _callee8, this);
523
558
  }));
524
559
  function resolveCustomerByDiscountCustomerId(_x6) {
525
560
  return _resolveCustomerByDiscountCustomerId.apply(this, arguments);
@@ -582,60 +617,60 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
582
617
  }, {
583
618
  key: "setBookingStatus",
584
619
  value: (function () {
585
- var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(status) {
620
+ var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(status) {
586
621
  var _this$store$order, _this$store$order$get;
587
622
  var tempOrder, orderId, scheduleId, bookings, previous, _data, res;
588
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
589
- while (1) switch (_context8.prev = _context8.next) {
623
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
624
+ while (1) switch (_context9.prev = _context9.next) {
590
625
  case 0:
591
626
  tempOrder = (_this$store$order = this.store.order) === null || _this$store$order === void 0 || (_this$store$order$get = _this$store$order.getTempOrder) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.call(_this$store$order);
592
627
  if (tempOrder) {
593
- _context8.next = 3;
628
+ _context9.next = 3;
594
629
  break;
595
630
  }
596
631
  throw new Error('setBookingStatus: tempOrder 未加载');
597
632
  case 3:
598
633
  orderId = tempOrder.order_id;
599
634
  if (!(orderId === undefined || orderId === null)) {
600
- _context8.next = 6;
635
+ _context9.next = 6;
601
636
  break;
602
637
  }
603
638
  throw new Error('setBookingStatus: tempOrder.order_id 缺失');
604
639
  case 6:
605
640
  scheduleId = resolveScheduleId(tempOrder);
606
641
  if (!(scheduleId === null)) {
607
- _context8.next = 9;
642
+ _context9.next = 9;
608
643
  break;
609
644
  }
610
645
  throw new Error('setBookingStatus: 无法解析 schedule id(metadata 与 root booking 均缺失)');
611
646
  case 9:
612
647
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
613
648
  previous = applyBookingsStatus(bookings, status);
614
- _context8.prev = 11;
615
- _context8.next = 14;
649
+ _context9.prev = 11;
650
+ _context9.next = 14;
616
651
  return this.request.put("/schedule/booking/appointment-status/".concat(scheduleId), {
617
652
  appointment_status: status
618
653
  });
619
654
  case 14:
620
- res = _context8.sent;
621
- _context8.next = 17;
655
+ res = _context9.sent;
656
+ _context9.next = 17;
622
657
  return this.refreshSalesDetail();
623
658
  case 17:
624
659
  this.core.effects.emit("".concat(this.name, ":onBookingStatusChange"), {
625
660
  orderId: orderId,
626
661
  status: status
627
662
  });
628
- return _context8.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
663
+ return _context9.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
629
664
  case 21:
630
- _context8.prev = 21;
631
- _context8.t0 = _context8["catch"](11);
665
+ _context9.prev = 21;
666
+ _context9.t0 = _context9["catch"](11);
632
667
  restoreBookingsStatus(bookings, previous);
633
- throw _context8.t0;
668
+ throw _context9.t0;
634
669
  case 25:
635
670
  case "end":
636
- return _context8.stop();
671
+ return _context9.stop();
637
672
  }
638
- }, _callee8, this, [[11, 21]]);
673
+ }, _callee9, this, [[11, 21]]);
639
674
  }));
640
675
  function setBookingStatus(_x7) {
641
676
  return _setBookingStatus.apply(this, arguments);
@@ -666,35 +701,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
666
701
  }, {
667
702
  key: "transitionChildBooking",
668
703
  value: (function () {
669
- var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
704
+ var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
670
705
  var _this$store$order2, _this$store$order2$ge;
671
706
  var schedule_event_id, action, tempOrder, orderId, bookings, targetStatus, previous, _data2, res;
672
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
673
- while (1) switch (_context9.prev = _context9.next) {
707
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
708
+ while (1) switch (_context10.prev = _context10.next) {
674
709
  case 0:
675
710
  schedule_event_id = params.schedule_event_id, action = params.action;
676
711
  if (!(schedule_event_id === undefined || schedule_event_id === null || schedule_event_id === '')) {
677
- _context9.next = 3;
712
+ _context10.next = 3;
678
713
  break;
679
714
  }
680
715
  throw new Error('transitionChildBooking: schedule_event_id 不能为空');
681
716
  case 3:
682
717
  if (action) {
683
- _context9.next = 5;
718
+ _context10.next = 5;
684
719
  break;
685
720
  }
686
721
  throw new Error('transitionChildBooking: action 不能为空');
687
722
  case 5:
688
723
  tempOrder = (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || (_this$store$order2$ge = _this$store$order2.getTempOrder) === null || _this$store$order2$ge === void 0 ? void 0 : _this$store$order2$ge.call(_this$store$order2);
689
724
  if (tempOrder) {
690
- _context9.next = 8;
725
+ _context10.next = 8;
691
726
  break;
692
727
  }
693
728
  throw new Error('transitionChildBooking: tempOrder 未加载');
694
729
  case 8:
695
730
  orderId = tempOrder.order_id;
696
731
  if (!(orderId === undefined || orderId === null)) {
697
- _context9.next = 11;
732
+ _context10.next = 11;
698
733
  break;
699
734
  }
700
735
  throw new Error('transitionChildBooking: tempOrder.order_id 缺失');
@@ -702,14 +737,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
702
737
  bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
703
738
  targetStatus = resolveStatusAfterTransition(action);
704
739
  previous = targetStatus !== null ? applyChildBookingStatus(bookings, schedule_event_id, targetStatus) : undefined;
705
- _context9.prev = 14;
706
- _context9.next = 17;
740
+ _context10.prev = 14;
741
+ _context10.next = 17;
707
742
  return this.request.post("/schedule/booking-transition/".concat(schedule_event_id), {
708
743
  action: action
709
744
  });
710
745
  case 17:
711
- res = _context9.sent;
712
- _context9.next = 20;
746
+ res = _context10.sent;
747
+ _context10.next = 20;
713
748
  return this.refreshSalesDetail();
714
749
  case 20:
715
750
  this.core.effects.emit("".concat(this.name, ":onChildBookingStatusChange"), {
@@ -718,19 +753,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
718
753
  action: action,
719
754
  status: targetStatus
720
755
  });
721
- return _context9.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
756
+ return _context10.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
722
757
  case 24:
723
- _context9.prev = 24;
724
- _context9.t0 = _context9["catch"](14);
758
+ _context10.prev = 24;
759
+ _context10.t0 = _context10["catch"](14);
725
760
  if (previous !== undefined) {
726
761
  restoreChildBookingStatus(bookings, schedule_event_id, previous);
727
762
  }
728
- throw _context9.t0;
763
+ throw _context10.t0;
729
764
  case 28:
730
765
  case "end":
731
- return _context9.stop();
766
+ return _context10.stop();
732
767
  }
733
- }, _callee9, this, [[14, 24]]);
768
+ }, _callee10, this, [[14, 24]]);
734
769
  }));
735
770
  function transitionChildBooking(_x8) {
736
771
  return _transitionChildBooking.apply(this, arguments);
@@ -751,35 +786,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
751
786
  }, {
752
787
  key: "refreshSalesDetail",
753
788
  value: (function () {
754
- var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
789
+ var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
755
790
  var _this$store$order3, _this$store$order3$ge;
756
791
  var tempOrder, orderId;
757
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
758
- while (1) switch (_context10.prev = _context10.next) {
792
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
793
+ while (1) switch (_context11.prev = _context11.next) {
759
794
  case 0:
760
795
  tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getTempOrder) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
761
796
  if (tempOrder) {
762
- _context10.next = 3;
797
+ _context11.next = 3;
763
798
  break;
764
799
  }
765
800
  throw new Error('refreshSalesDetail: tempOrder 未加载');
766
801
  case 3:
767
802
  orderId = tempOrder.order_id;
768
803
  if (!(orderId === undefined || orderId === null)) {
769
- _context10.next = 6;
804
+ _context11.next = 6;
770
805
  break;
771
806
  }
772
807
  throw new Error('refreshSalesDetail: tempOrder.order_id 缺失');
773
808
  case 6:
774
- return _context10.abrupt("return", this.loadSalesDetail({
809
+ return _context11.abrupt("return", this.loadSalesDetail({
775
810
  orderId: Number(orderId),
776
811
  forceRemote: true
777
812
  }));
778
813
  case 7:
779
814
  case "end":
780
- return _context10.stop();
815
+ return _context11.stop();
781
816
  }
782
- }, _callee10, this);
817
+ }, _callee11, this);
783
818
  }));
784
819
  function refreshSalesDetail() {
785
820
  return _refreshSalesDetail.apply(this, arguments);
@@ -795,7 +830,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
795
830
  }, {
796
831
  key: "loadProducts",
797
832
  value: (function () {
798
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
833
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
799
834
  var params,
800
835
  options,
801
836
  schedule_date,
@@ -804,20 +839,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
804
839
  schedule_datetime,
805
840
  bookingDate,
806
841
  _result,
807
- _args11 = arguments;
808
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
809
- while (1) switch (_context11.prev = _context11.next) {
842
+ _args12 = arguments;
843
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
844
+ while (1) switch (_context12.prev = _context12.next) {
810
845
  case 0:
811
- params = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
812
- options = _args11.length > 1 ? _args11[1] : undefined;
846
+ params = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
847
+ options = _args12.length > 1 ? _args12[1] : undefined;
813
848
  schedule_date = params.schedule_date, customer_id = params.customer_id, menu_list_ids = params.menu_list_ids, schedule_datetime = params.schedule_datetime; // 优先写入 schedule_datetime(含时分),供加购 presetStartTime 与 TimeBar 对齐;
814
849
  // requiresDetail 弹窗仍通过 formatBookingDateForUI 只取日历日 YYYY-MM-DD。
815
850
  bookingDate = schedule_datetime || schedule_date || '';
816
851
  if (bookingDate) {
817
852
  this.setBookingDate(bookingDate);
818
853
  }
819
- _context11.prev = 5;
820
- _context11.next = 8;
854
+ _context12.prev = 5;
855
+ _context12.next = 8;
821
856
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
822
857
  with_count: ['bundleGroup', 'optionGroup'],
823
858
  with_schedule: 1
@@ -825,20 +860,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
825
860
  cacheId: this.cacheId
826
861
  }), options);
827
862
  case 8:
828
- _result = _context11.sent;
863
+ _result = _context12.sent;
829
864
  this.productCatalog = Array.isArray(_result) ? _toConsumableArray(_result) : [];
830
865
  this.core.effects.emit("".concat(this.name, ":onProductsLoaded"), _result);
831
- return _context11.abrupt("return", _result);
866
+ return _context12.abrupt("return", _result);
832
867
  case 14:
833
- _context11.prev = 14;
834
- _context11.t0 = _context11["catch"](5);
835
- console.error('Failed to load products:', _context11.t0);
836
- throw _context11.t0;
868
+ _context12.prev = 14;
869
+ _context12.t0 = _context12["catch"](5);
870
+ console.error('Failed to load products:', _context12.t0);
871
+ throw _context12.t0;
837
872
  case 18:
838
873
  case "end":
839
- return _context11.stop();
874
+ return _context12.stop();
840
875
  }
841
- }, _callee11, this, [[5, 14]]);
876
+ }, _callee12, this, [[5, 14]]);
842
877
  }));
843
878
  function loadProducts() {
844
879
  return _loadProducts.apply(this, arguments);
@@ -863,14 +898,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
863
898
  }, {
864
899
  key: "queryProductDetail",
865
900
  value: (function () {
866
- var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params, options) {
901
+ var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params, options) {
867
902
  var product_id, queryParams, _result2, list;
868
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
869
- while (1) switch (_context12.prev = _context12.next) {
903
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
904
+ while (1) switch (_context13.prev = _context13.next) {
870
905
  case 0:
871
906
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded2);
872
- _context12.prev = 1;
873
- _context12.next = 4;
907
+ _context13.prev = 1;
908
+ _context13.next = 4;
874
909
  return this.store.products.loadProducts(_objectSpread(_objectSpread({
875
910
  with_count: ['bundleGroup', 'optionGroup'],
876
911
  with_schedule: 1
@@ -879,21 +914,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
879
914
  cacheId: this.cacheId
880
915
  }), options);
881
916
  case 4:
882
- _result2 = _context12.sent;
917
+ _result2 = _context13.sent;
883
918
  list = Array.isArray(_result2) ? _result2 : [];
884
- return _context12.abrupt("return", list.find(function (product) {
919
+ return _context13.abrupt("return", list.find(function (product) {
885
920
  return Number(product.id) === Number(product_id);
886
921
  }));
887
922
  case 9:
888
- _context12.prev = 9;
889
- _context12.t0 = _context12["catch"](1);
890
- console.error('Failed to query product detail:', _context12.t0);
891
- throw _context12.t0;
923
+ _context13.prev = 9;
924
+ _context13.t0 = _context13["catch"](1);
925
+ console.error('Failed to query product detail:', _context13.t0);
926
+ throw _context13.t0;
892
927
  case 13:
893
928
  case "end":
894
- return _context12.stop();
929
+ return _context13.stop();
895
930
  }
896
- }, _callee12, this, [[1, 9]]);
931
+ }, _callee13, this, [[1, 9]]);
897
932
  }));
898
933
  function queryProductDetail(_x9, _x10) {
899
934
  return _queryProductDetail.apply(this, arguments);
@@ -908,26 +943,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
908
943
  }, {
909
944
  key: "loadProductDetail",
910
945
  value: (function () {
911
- var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params, options) {
946
+ var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params, options) {
912
947
  var product_id, queryParams, products;
913
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
914
- while (1) switch (_context13.prev = _context13.next) {
948
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
949
+ while (1) switch (_context14.prev = _context14.next) {
915
950
  case 0:
916
951
  product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded3);
917
- _context13.next = 3;
952
+ _context14.next = 3;
918
953
  return this.loadProducts(_objectSpread(_objectSpread({}, queryParams), {}, {
919
954
  product_ids: [product_id]
920
955
  }), options);
921
956
  case 3:
922
- products = _context13.sent;
923
- return _context13.abrupt("return", products.find(function (product) {
957
+ products = _context14.sent;
958
+ return _context14.abrupt("return", products.find(function (product) {
924
959
  return Number(product.id) === Number(product_id);
925
960
  }));
926
961
  case 5:
927
962
  case "end":
928
- return _context13.stop();
963
+ return _context14.stop();
929
964
  }
930
- }, _callee13, this);
965
+ }, _callee14, this);
931
966
  }));
932
967
  function loadProductDetail(_x11, _x12) {
933
968
  return _loadProductDetail.apply(this, arguments);
@@ -962,16 +997,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
962
997
  }, {
963
998
  key: "getProducts",
964
999
  value: (function () {
965
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
966
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
967
- while (1) switch (_context14.prev = _context14.next) {
1000
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
1001
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1002
+ while (1) switch (_context15.prev = _context15.next) {
968
1003
  case 0:
969
- return _context14.abrupt("return", this.store.products.getProducts());
1004
+ return _context15.abrupt("return", this.store.products.getProducts());
970
1005
  case 1:
971
1006
  case "end":
972
- return _context14.stop();
1007
+ return _context15.stop();
973
1008
  }
974
- }, _callee14, this);
1009
+ }, _callee15, this);
975
1010
  }));
976
1011
  function getProducts() {
977
1012
  return _getProducts.apply(this, arguments);
@@ -1024,16 +1059,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1024
1059
  }, {
1025
1060
  key: "getProductByIds",
1026
1061
  value: (function () {
1027
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(ids) {
1028
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1029
- while (1) switch (_context15.prev = _context15.next) {
1062
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(ids) {
1063
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1064
+ while (1) switch (_context16.prev = _context16.next) {
1030
1065
  case 0:
1031
- return _context15.abrupt("return", this.store.products.getProductByIds(ids));
1066
+ return _context16.abrupt("return", this.store.products.getProductByIds(ids));
1032
1067
  case 1:
1033
1068
  case "end":
1034
- return _context15.stop();
1069
+ return _context16.stop();
1035
1070
  }
1036
- }, _callee15, this);
1071
+ }, _callee16, this);
1037
1072
  }));
1038
1073
  function getProductByIds(_x13) {
1039
1074
  return _getProductByIds.apply(this, arguments);
@@ -1049,25 +1084,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1049
1084
  }, {
1050
1085
  key: "getScheduleTimePoints",
1051
1086
  value: (function () {
1052
- var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1087
+ var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
1053
1088
  var result;
1054
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1055
- while (1) switch (_context16.prev = _context16.next) {
1089
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1090
+ while (1) switch (_context17.prev = _context17.next) {
1056
1091
  case 0:
1057
- _context16.next = 2;
1092
+ _context17.next = 2;
1058
1093
  return this.request.post('/menu/schedule-time-points', {
1059
1094
  menu_list_ids: params.menu_list_ids
1060
1095
  }, {
1061
1096
  osServer: true
1062
1097
  });
1063
1098
  case 2:
1064
- result = _context16.sent;
1065
- return _context16.abrupt("return", result.data || []);
1099
+ result = _context17.sent;
1100
+ return _context17.abrupt("return", result.data || []);
1066
1101
  case 4:
1067
1102
  case "end":
1068
- return _context16.stop();
1103
+ return _context17.stop();
1069
1104
  }
1070
- }, _callee16, this);
1105
+ }, _callee17, this);
1071
1106
  }));
1072
1107
  function getScheduleTimePoints(_x14) {
1073
1108
  return _getScheduleTimePoints.apply(this, arguments);
@@ -1083,30 +1118,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1083
1118
  }, {
1084
1119
  key: "getCustomerList",
1085
1120
  value: (function () {
1086
- var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
1121
+ var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1087
1122
  var params,
1088
1123
  _result3,
1089
- _args17 = arguments;
1090
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1091
- while (1) switch (_context17.prev = _context17.next) {
1124
+ _args18 = arguments;
1125
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1126
+ while (1) switch (_context18.prev = _context18.next) {
1092
1127
  case 0:
1093
- params = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
1094
- _context17.prev = 1;
1095
- _context17.next = 4;
1128
+ params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
1129
+ _context18.prev = 1;
1130
+ _context18.next = 4;
1096
1131
  return this.store.customer.getCustomerList(params);
1097
1132
  case 4:
1098
- _result3 = _context17.sent;
1099
- return _context17.abrupt("return", _result3);
1133
+ _result3 = _context18.sent;
1134
+ return _context18.abrupt("return", _result3);
1100
1135
  case 8:
1101
- _context17.prev = 8;
1102
- _context17.t0 = _context17["catch"](1);
1103
- console.error('Failed to get customer list:', _context17.t0);
1104
- throw _context17.t0;
1136
+ _context18.prev = 8;
1137
+ _context18.t0 = _context18["catch"](1);
1138
+ console.error('Failed to get customer list:', _context18.t0);
1139
+ throw _context18.t0;
1105
1140
  case 12:
1106
1141
  case "end":
1107
- return _context17.stop();
1142
+ return _context18.stop();
1108
1143
  }
1109
- }, _callee17, this, [[1, 8]]);
1144
+ }, _callee18, this, [[1, 8]]);
1110
1145
  }));
1111
1146
  function getCustomerList() {
1112
1147
  return _getCustomerList.apply(this, arguments);
@@ -1304,24 +1339,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1304
1339
  }, {
1305
1340
  key: "restoreOrder",
1306
1341
  value: (function () {
1307
- var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1342
+ var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1308
1343
  var _this$store$customer;
1309
1344
  var tempOrder;
1310
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1311
- while (1) switch (_context18.prev = _context18.next) {
1345
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1346
+ while (1) switch (_context19.prev = _context19.next) {
1312
1347
  case 0:
1313
- _context18.next = 2;
1348
+ _context19.next = 2;
1314
1349
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
1315
1350
  case 2:
1316
- tempOrder = _context18.sent;
1351
+ tempOrder = _context19.sent;
1317
1352
  this.clearOrderCustomer();
1318
1353
  (_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
1319
- return _context18.abrupt("return", tempOrder);
1354
+ return _context19.abrupt("return", tempOrder);
1320
1355
  case 6:
1321
1356
  case "end":
1322
- return _context18.stop();
1357
+ return _context19.stop();
1323
1358
  }
1324
- }, _callee18, this);
1359
+ }, _callee19, this);
1325
1360
  }));
1326
1361
  function restoreOrder() {
1327
1362
  return _restoreOrder.apply(this, arguments);
@@ -1347,36 +1382,36 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1347
1382
  return;
1348
1383
  }
1349
1384
  var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
1350
- var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1385
+ var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
1351
1386
  var currentCustomer;
1352
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1353
- while (1) switch (_context19.prev = _context19.next) {
1387
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1388
+ while (1) switch (_context20.prev = _context20.next) {
1354
1389
  case 0:
1355
1390
  if (!previousRefresh) {
1356
- _context19.next = 3;
1391
+ _context20.next = 3;
1357
1392
  break;
1358
1393
  }
1359
- _context19.next = 3;
1394
+ _context20.next = 3;
1360
1395
  return previousRefresh.catch(function () {
1361
1396
  return undefined;
1362
1397
  });
1363
1398
  case 3:
1364
1399
  currentCustomer = _this4.store.order.getOrderCustomer();
1365
1400
  if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
1366
- _context19.next = 6;
1401
+ _context20.next = 6;
1367
1402
  break;
1368
1403
  }
1369
- return _context19.abrupt("return");
1404
+ return _context20.abrupt("return");
1370
1405
  case 6:
1371
- _context19.next = 8;
1406
+ _context20.next = 8;
1372
1407
  return _this4.loadDiscountConfig({
1373
1408
  customerId: customerId
1374
1409
  });
1375
1410
  case 8:
1376
1411
  case "end":
1377
- return _context19.stop();
1412
+ return _context20.stop();
1378
1413
  }
1379
- }, _callee19);
1414
+ }, _callee20);
1380
1415
  }))();
1381
1416
  this.orderCustomerDiscountRefreshInFlight = refreshTask;
1382
1417
  this.orderCustomerDiscountRefreshCustomerId = customerId;
@@ -1429,27 +1464,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1429
1464
  }, {
1430
1465
  key: "changeCustomerPage",
1431
1466
  value: (function () {
1432
- var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(page, pageSize) {
1467
+ var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(page, pageSize) {
1433
1468
  var _result4;
1434
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1435
- while (1) switch (_context20.prev = _context20.next) {
1469
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1470
+ while (1) switch (_context21.prev = _context21.next) {
1436
1471
  case 0:
1437
- _context20.prev = 0;
1438
- _context20.next = 3;
1472
+ _context21.prev = 0;
1473
+ _context21.next = 3;
1439
1474
  return this.store.customer.changeCustomerPage(page, pageSize);
1440
1475
  case 3:
1441
- _result4 = _context20.sent;
1442
- return _context20.abrupt("return", _result4);
1476
+ _result4 = _context21.sent;
1477
+ return _context21.abrupt("return", _result4);
1443
1478
  case 7:
1444
- _context20.prev = 7;
1445
- _context20.t0 = _context20["catch"](0);
1446
- console.error('Failed to change customer page:', _context20.t0);
1447
- throw _context20.t0;
1479
+ _context21.prev = 7;
1480
+ _context21.t0 = _context21["catch"](0);
1481
+ console.error('Failed to change customer page:', _context21.t0);
1482
+ throw _context21.t0;
1448
1483
  case 11:
1449
1484
  case "end":
1450
- return _context20.stop();
1485
+ return _context21.stop();
1451
1486
  }
1452
- }, _callee20, this, [[0, 7]]);
1487
+ }, _callee21, this, [[0, 7]]);
1453
1488
  }));
1454
1489
  function changeCustomerPage(_x15, _x16) {
1455
1490
  return _changeCustomerPage.apply(this, arguments);
@@ -1464,28 +1499,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1464
1499
  }, {
1465
1500
  key: "loadMoreCustomers",
1466
1501
  value: (function () {
1467
- var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1502
+ var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1468
1503
  var _result5;
1469
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1470
- while (1) switch (_context21.prev = _context21.next) {
1504
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1505
+ while (1) switch (_context22.prev = _context22.next) {
1471
1506
  case 0:
1472
- _context21.prev = 0;
1473
- _context21.next = 3;
1507
+ _context22.prev = 0;
1508
+ _context22.next = 3;
1474
1509
  return this.store.customer.loadMoreCustomers();
1475
1510
  case 3:
1476
- _result5 = _context21.sent;
1511
+ _result5 = _context22.sent;
1477
1512
  this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
1478
- return _context21.abrupt("return", _result5);
1513
+ return _context22.abrupt("return", _result5);
1479
1514
  case 8:
1480
- _context21.prev = 8;
1481
- _context21.t0 = _context21["catch"](0);
1482
- console.error('Failed to load more customers:', _context21.t0);
1483
- throw _context21.t0;
1515
+ _context22.prev = 8;
1516
+ _context22.t0 = _context22["catch"](0);
1517
+ console.error('Failed to load more customers:', _context22.t0);
1518
+ throw _context22.t0;
1484
1519
  case 12:
1485
1520
  case "end":
1486
- return _context21.stop();
1521
+ return _context22.stop();
1487
1522
  }
1488
- }, _callee21, this, [[0, 8]]);
1523
+ }, _callee22, this, [[0, 8]]);
1489
1524
  }));
1490
1525
  function loadMoreCustomers() {
1491
1526
  return _loadMoreCustomers.apply(this, arguments);
@@ -1501,31 +1536,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1501
1536
  }, {
1502
1537
  key: "resetAndLoadCustomers",
1503
1538
  value: (function () {
1504
- var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1539
+ var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
1505
1540
  var params,
1506
1541
  _result6,
1507
- _args22 = arguments;
1508
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1509
- while (1) switch (_context22.prev = _context22.next) {
1542
+ _args23 = arguments;
1543
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1544
+ while (1) switch (_context23.prev = _context23.next) {
1510
1545
  case 0:
1511
- params = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
1512
- _context22.prev = 1;
1513
- _context22.next = 4;
1546
+ params = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
1547
+ _context23.prev = 1;
1548
+ _context23.next = 4;
1514
1549
  return this.store.customer.resetAndLoadCustomers(params);
1515
1550
  case 4:
1516
- _result6 = _context22.sent;
1551
+ _result6 = _context23.sent;
1517
1552
  this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
1518
- return _context22.abrupt("return", _result6);
1553
+ return _context23.abrupt("return", _result6);
1519
1554
  case 9:
1520
- _context22.prev = 9;
1521
- _context22.t0 = _context22["catch"](1);
1522
- console.error('Failed to reset and load customers:', _context22.t0);
1523
- throw _context22.t0;
1555
+ _context23.prev = 9;
1556
+ _context23.t0 = _context23["catch"](1);
1557
+ console.error('Failed to reset and load customers:', _context23.t0);
1558
+ throw _context23.t0;
1524
1559
  case 13:
1525
1560
  case "end":
1526
- return _context22.stop();
1561
+ return _context23.stop();
1527
1562
  }
1528
- }, _callee22, this, [[1, 9]]);
1563
+ }, _callee23, this, [[1, 9]]);
1529
1564
  }));
1530
1565
  function resetAndLoadCustomers() {
1531
1566
  return _resetAndLoadCustomers.apply(this, arguments);
@@ -1687,15 +1722,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1687
1722
  }, {
1688
1723
  key: "setOtherParams",
1689
1724
  value: (function () {
1690
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
1725
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(params) {
1691
1726
  var _ref10,
1692
1727
  _ref10$cover,
1693
1728
  cover,
1694
- _args23 = arguments;
1695
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1696
- while (1) switch (_context23.prev = _context23.next) {
1729
+ _args24 = arguments;
1730
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1731
+ while (1) switch (_context24.prev = _context24.next) {
1697
1732
  case 0:
1698
- _ref10 = _args23.length > 1 && _args23[1] !== undefined ? _args23[1] : {}, _ref10$cover = _ref10.cover, cover = _ref10$cover === void 0 ? false : _ref10$cover;
1733
+ _ref10 = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : {}, _ref10$cover = _ref10.cover, cover = _ref10$cover === void 0 ? false : _ref10$cover;
1699
1734
  if (cover) {
1700
1735
  this.otherParams = params;
1701
1736
  } else {
@@ -1703,9 +1738,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1703
1738
  }
1704
1739
  case 2:
1705
1740
  case "end":
1706
- return _context23.stop();
1741
+ return _context24.stop();
1707
1742
  }
1708
- }, _callee23, this);
1743
+ }, _callee24, this);
1709
1744
  }));
1710
1745
  function setOtherParams(_x17) {
1711
1746
  return _setOtherParams.apply(this, arguments);
@@ -1720,16 +1755,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1720
1755
  }, {
1721
1756
  key: "getOtherParams",
1722
1757
  value: (function () {
1723
- var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1724
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1725
- while (1) switch (_context24.prev = _context24.next) {
1758
+ var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1759
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1760
+ while (1) switch (_context25.prev = _context25.next) {
1726
1761
  case 0:
1727
- return _context24.abrupt("return", this.otherParams);
1762
+ return _context25.abrupt("return", this.otherParams);
1728
1763
  case 1:
1729
1764
  case "end":
1730
- return _context24.stop();
1765
+ return _context25.stop();
1731
1766
  }
1732
- }, _callee24, this);
1767
+ }, _callee25, this);
1733
1768
  }));
1734
1769
  function getOtherParams() {
1735
1770
  return _getOtherParams.apply(this, arguments);
@@ -2047,16 +2082,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2047
2082
  }, {
2048
2083
  key: "updateProductInOrder",
2049
2084
  value: (function () {
2050
- var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
2051
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2052
- while (1) switch (_context25.prev = _context25.next) {
2085
+ var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2086
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2087
+ while (1) switch (_context26.prev = _context26.next) {
2053
2088
  case 0:
2054
- return _context25.abrupt("return", this.updateOrderProduct(params));
2089
+ return _context26.abrupt("return", this.updateOrderProduct(params));
2055
2090
  case 1:
2056
2091
  case "end":
2057
- return _context25.stop();
2092
+ return _context26.stop();
2058
2093
  }
2059
- }, _callee25, this);
2094
+ }, _callee26, this);
2060
2095
  }));
2061
2096
  function updateProductInOrder(_x18) {
2062
2097
  return _updateProductInOrder.apply(this, arguments);
@@ -2080,47 +2115,47 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2080
2115
  }, {
2081
2116
  key: "handleGlobalScanCode",
2082
2117
  value: (function () {
2083
- var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(code, bridge) {
2118
+ var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(code, bridge) {
2084
2119
  var _this6 = this;
2085
2120
  var trimmed, _bridge$onNotify, _bridge$refresh, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
2086
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2087
- while (1) switch (_context26.prev = _context26.next) {
2121
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2122
+ while (1) switch (_context27.prev = _context27.next) {
2088
2123
  case 0:
2089
2124
  trimmed = typeof code === 'string' ? code.trim() : '';
2090
2125
  if (trimmed) {
2091
- _context26.next = 4;
2126
+ _context27.next = 4;
2092
2127
  break;
2093
2128
  }
2094
2129
  bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2095
- return _context26.abrupt("return", {
2130
+ return _context27.abrupt("return", {
2096
2131
  status: 'failed',
2097
2132
  reason: 'empty_code'
2098
2133
  });
2099
2134
  case 4:
2100
- _context26.prev = 4;
2135
+ _context27.prev = 4;
2101
2136
  localSearch = function localSearch(v) {
2102
2137
  return _this6.store.products.findProductsByCodeOrBarcode(v);
2103
2138
  };
2104
2139
  scanCallback = handleGlobalScan(this.request, localSearch);
2105
- _context26.next = 9;
2140
+ _context27.next = 9;
2106
2141
  return scanCallback({
2107
2142
  type: 'nativeScanner',
2108
2143
  value: trimmed
2109
2144
  });
2110
2145
  case 9:
2111
- raw = _context26.sent;
2146
+ raw = _context27.sent;
2112
2147
  formatted = formatGlobalScanResult(raw, trimmed);
2113
2148
  if (formatted) {
2114
- _context26.next = 14;
2149
+ _context27.next = 14;
2115
2150
  break;
2116
2151
  }
2117
2152
  bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2118
- return _context26.abrupt("return", {
2153
+ return _context27.abrupt("return", {
2119
2154
  status: 'failed',
2120
2155
  reason: 'not_found'
2121
2156
  });
2122
2157
  case 14:
2123
- _context26.next = 16;
2158
+ _context27.next = 16;
2124
2159
  return applyGlobalScan({
2125
2160
  setOrderCustomer: function setOrderCustomer(customer) {
2126
2161
  return _this6.setOrderCustomer(customer);
@@ -2149,23 +2184,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2149
2184
  }
2150
2185
  }, formatted, bridge);
2151
2186
  case 16:
2152
- _result7 = _context26.sent;
2187
+ _result7 = _context27.sent;
2153
2188
  bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
2154
- return _context26.abrupt("return", _result7);
2189
+ return _context27.abrupt("return", _result7);
2155
2190
  case 21:
2156
- _context26.prev = 21;
2157
- _context26.t0 = _context26["catch"](4);
2158
- console.error('[BookingTicket] handleGlobalScanCode failed', _context26.t0);
2191
+ _context27.prev = 21;
2192
+ _context27.t0 = _context27["catch"](4);
2193
+ console.error('[BookingTicket] handleGlobalScanCode failed', _context27.t0);
2159
2194
  bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
2160
- return _context26.abrupt("return", {
2195
+ return _context27.abrupt("return", {
2161
2196
  status: 'failed',
2162
2197
  reason: 'not_found'
2163
2198
  });
2164
2199
  case 26:
2165
2200
  case "end":
2166
- return _context26.stop();
2201
+ return _context27.stop();
2167
2202
  }
2168
- }, _callee26, this, [[4, 21]]);
2203
+ }, _callee27, this, [[4, 21]]);
2169
2204
  }));
2170
2205
  function handleGlobalScanCode(_x19, _x20) {
2171
2206
  return _handleGlobalScanCode.apply(this, arguments);
@@ -2180,12 +2215,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2180
2215
  }, {
2181
2216
  key: "destroy",
2182
2217
  value: (function () {
2183
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
2218
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2184
2219
  var _this$scan;
2185
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2186
- while (1) switch (_context27.prev = _context27.next) {
2220
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2221
+ while (1) switch (_context28.prev = _context28.next) {
2187
2222
  case 0:
2188
- _context27.next = 2;
2223
+ _context28.next = 2;
2189
2224
  return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
2190
2225
  case 2:
2191
2226
  try {
@@ -2196,9 +2231,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2196
2231
  scanCache.clear();
2197
2232
  case 4:
2198
2233
  case "end":
2199
- return _context27.stop();
2234
+ return _context28.stop();
2200
2235
  }
2201
- }, _callee27, this);
2236
+ }, _callee28, this);
2202
2237
  }));
2203
2238
  function destroy() {
2204
2239
  return _destroy.apply(this, arguments);