@pisell/pisellos 2.2.223 → 2.2.225
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.
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +3 -0
- package/dist/modules/Customer/index.d.ts +7 -0
- package/dist/modules/Customer/index.js +16 -0
- package/dist/modules/OpenData/index.d.ts +7 -0
- package/dist/modules/OpenData/index.js +15 -0
- package/dist/modules/Order/index.d.ts +44 -0
- package/dist/modules/Order/index.js +306 -113
- package/dist/modules/Order/types.d.ts +16 -0
- package/dist/modules/Order/utils.js +7 -4
- package/dist/modules/Payment/index.d.ts +7 -0
- package/dist/modules/Payment/index.js +12 -0
- package/dist/modules/ProductList/index.d.ts +7 -0
- package/dist/modules/ProductList/index.js +11 -0
- package/dist/modules/SalesSummary/index.d.ts +7 -0
- package/dist/modules/SalesSummary/index.js +58 -23
- package/dist/modules/Schedule/index.d.ts +7 -0
- package/dist/modules/Schedule/index.js +16 -0
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +519 -355
- package/dist/server/modules/order/types.d.ts +2 -0
- package/dist/server/modules/order/utils/filterBookings.js +25 -2
- package/dist/server/utils/small-ticket.js +160 -30
- package/dist/solution/BaseSales/index.d.ts +17 -0
- package/dist/solution/BaseSales/index.js +524 -439
- package/dist/solution/BaseSales/utils/cartPromotion.js +26 -7
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -9
- package/dist/solution/BookingTicket/index.js +42 -76
- package/dist/types/index.d.ts +10 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +1 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +3 -0
- package/lib/modules/Customer/index.d.ts +7 -0
- package/lib/modules/Customer/index.js +12 -0
- package/lib/modules/OpenData/index.d.ts +7 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/Order/index.d.ts +44 -0
- package/lib/modules/Order/index.js +150 -3
- package/lib/modules/Order/types.d.ts +16 -0
- package/lib/modules/Order/utils.js +6 -2
- package/lib/modules/Payment/index.d.ts +7 -0
- package/lib/modules/Payment/index.js +9 -0
- package/lib/modules/ProductList/index.d.ts +7 -0
- package/lib/modules/ProductList/index.js +9 -0
- package/lib/modules/SalesSummary/index.d.ts +7 -0
- package/lib/modules/SalesSummary/index.js +13 -0
- package/lib/modules/Schedule/index.d.ts +7 -0
- package/lib/modules/Schedule/index.js +12 -0
- package/lib/server/index.d.ts +6 -0
- package/lib/server/index.js +136 -3
- package/lib/server/modules/order/types.d.ts +2 -0
- package/lib/server/modules/order/utils/filterBookings.js +17 -2
- package/lib/server/utils/small-ticket.js +141 -32
- package/lib/solution/BaseSales/index.d.ts +17 -0
- package/lib/solution/BaseSales/index.js +48 -10
- package/lib/solution/BaseSales/utils/cartPromotion.js +31 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -9
- package/lib/solution/BookingTicket/index.js +1 -13
- package/lib/types/index.d.ts +10 -0
- package/package.json +1 -1
|
@@ -518,10 +518,89 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
518
518
|
return optionHooks[moduleName] || ((_this$otherParams$mod = this.otherParams[moduleName]) === null || _this$otherParams$mod === void 0 ? void 0 : _this$otherParams$mod.hooks) || otherHooks[moduleName];
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
+
/**
|
|
522
|
+
* 构造传给 BaseSales 子模块的完整运行态参数,保证初始化和后续同步语义一致。
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* const params = this.buildSubModuleOtherParams();
|
|
526
|
+
* this.core.registerModule(orderModule, { otherParams: params });
|
|
527
|
+
*/
|
|
528
|
+
}, {
|
|
529
|
+
key: "buildSubModuleOtherParams",
|
|
530
|
+
value: function buildSubModuleOtherParams() {
|
|
531
|
+
return _objectSpread(_objectSpread({}, this.otherParams), {}, {
|
|
532
|
+
salesSummaryModuleName: "".concat(this.name, "_salesSummary"),
|
|
533
|
+
fatherModule: this.name,
|
|
534
|
+
openCache: this.cacheId ? true : false,
|
|
535
|
+
cacheId: this.cacheId
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* 将父级 otherParams 的变更显式同步给已注册的子模块。
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* await this.syncOtherParamsToSubModules({ channel: 'pos' });
|
|
544
|
+
*/
|
|
545
|
+
}, {
|
|
546
|
+
key: "syncOtherParamsToSubModules",
|
|
547
|
+
value: (function () {
|
|
548
|
+
var _syncOtherParamsToSubModules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(changedParams) {
|
|
549
|
+
var _ref9,
|
|
550
|
+
_ref9$cover,
|
|
551
|
+
cover,
|
|
552
|
+
nextSubModuleOtherParams,
|
|
553
|
+
_args4 = arguments;
|
|
554
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
555
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
556
|
+
case 0:
|
|
557
|
+
_ref9 = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {}, _ref9$cover = _ref9.cover, cover = _ref9$cover === void 0 ? false : _ref9$cover;
|
|
558
|
+
nextSubModuleOtherParams = this.buildSubModuleOtherParams();
|
|
559
|
+
_context4.next = 4;
|
|
560
|
+
return Promise.all(Object.values(this.store).map( /*#__PURE__*/function () {
|
|
561
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(subModule) {
|
|
562
|
+
var targetModule;
|
|
563
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
564
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
565
|
+
case 0:
|
|
566
|
+
targetModule = subModule;
|
|
567
|
+
if (!(!targetModule || typeof targetModule.updateOtherParams !== 'function')) {
|
|
568
|
+
_context3.next = 3;
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
return _context3.abrupt("return");
|
|
572
|
+
case 3:
|
|
573
|
+
_context3.next = 5;
|
|
574
|
+
return targetModule.updateOtherParams(nextSubModuleOtherParams, {
|
|
575
|
+
changedParams: changedParams,
|
|
576
|
+
cover: cover
|
|
577
|
+
});
|
|
578
|
+
case 5:
|
|
579
|
+
case "end":
|
|
580
|
+
return _context3.stop();
|
|
581
|
+
}
|
|
582
|
+
}, _callee3);
|
|
583
|
+
}));
|
|
584
|
+
return function (_x5) {
|
|
585
|
+
return _ref10.apply(this, arguments);
|
|
586
|
+
};
|
|
587
|
+
}()));
|
|
588
|
+
case 4:
|
|
589
|
+
case "end":
|
|
590
|
+
return _context4.stop();
|
|
591
|
+
}
|
|
592
|
+
}, _callee4, this);
|
|
593
|
+
}));
|
|
594
|
+
function syncOtherParamsToSubModules(_x4) {
|
|
595
|
+
return _syncOtherParamsToSubModules.apply(this, arguments);
|
|
596
|
+
}
|
|
597
|
+
return syncOtherParamsToSubModules;
|
|
598
|
+
}()
|
|
521
599
|
/**
|
|
522
600
|
* 读取 sessionStorage[this.name][cacheId],作为子模块 initialState 的来源。
|
|
523
601
|
* sessionStorage 损坏时静默忽略,按空状态注册。
|
|
524
602
|
*/
|
|
603
|
+
)
|
|
525
604
|
}, {
|
|
526
605
|
key: "readSessionCacheData",
|
|
527
606
|
value: function readSessionCacheData() {
|
|
@@ -586,7 +665,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
586
665
|
}, {
|
|
587
666
|
key: "initialize",
|
|
588
667
|
value: function () {
|
|
589
|
-
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
668
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(core) {
|
|
590
669
|
var _this$otherParams4,
|
|
591
670
|
_this3 = this,
|
|
592
671
|
_this$otherParams5;
|
|
@@ -594,11 +673,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
594
673
|
app,
|
|
595
674
|
targetCacheData,
|
|
596
675
|
moduleNames,
|
|
597
|
-
|
|
598
|
-
return _regeneratorRuntime().wrap(function
|
|
599
|
-
while (1) switch (
|
|
676
|
+
_args5 = arguments;
|
|
677
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
678
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
600
679
|
case 0:
|
|
601
|
-
options =
|
|
680
|
+
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
602
681
|
this.core = core;
|
|
603
682
|
this.initializeOptions = options || {};
|
|
604
683
|
// this.store = { ...this.store, ...(options.store as Partial<BaseSalesState>) };
|
|
@@ -610,7 +689,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
610
689
|
// 获取 logger 实例
|
|
611
690
|
this.appPlugin = core.getPlugin('app');
|
|
612
691
|
if (this.appPlugin) {
|
|
613
|
-
|
|
692
|
+
_context5.next = 10;
|
|
614
693
|
break;
|
|
615
694
|
}
|
|
616
695
|
throw new Error('Checkout 解决方案需要 app 插件支持');
|
|
@@ -631,35 +710,30 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
631
710
|
}, hooks ? {
|
|
632
711
|
hooks: hooks
|
|
633
712
|
} : {}), {}, {
|
|
634
|
-
otherParams:
|
|
635
|
-
salesSummaryModuleName: "".concat(_this3.name, "_salesSummary"),
|
|
636
|
-
fatherModule: _this3.name,
|
|
637
|
-
openCache: _this3.cacheId ? true : false,
|
|
638
|
-
cacheId: _this3.cacheId
|
|
639
|
-
})
|
|
713
|
+
otherParams: _this3.buildSubModuleOtherParams()
|
|
640
714
|
}));
|
|
641
715
|
});
|
|
642
716
|
if (!this.store.schedule) {
|
|
643
|
-
|
|
717
|
+
_context5.next = 18;
|
|
644
718
|
break;
|
|
645
719
|
}
|
|
646
|
-
|
|
720
|
+
_context5.next = 18;
|
|
647
721
|
return this.store.schedule.loadAllSchedule();
|
|
648
722
|
case 18:
|
|
649
723
|
if (this.store.order && typeof ((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.enableTempOrderPersist) === 'boolean') {
|
|
650
724
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
651
725
|
}
|
|
652
|
-
|
|
726
|
+
_context5.next = 21;
|
|
653
727
|
return this.getPaymentMethodsAsync();
|
|
654
728
|
case 21:
|
|
655
729
|
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
656
730
|
case 22:
|
|
657
731
|
case "end":
|
|
658
|
-
return
|
|
732
|
+
return _context5.stop();
|
|
659
733
|
}
|
|
660
|
-
},
|
|
734
|
+
}, _callee5, this);
|
|
661
735
|
}));
|
|
662
|
-
function initialize(
|
|
736
|
+
function initialize(_x6) {
|
|
663
737
|
return _initialize.apply(this, arguments);
|
|
664
738
|
}
|
|
665
739
|
return initialize;
|
|
@@ -667,10 +741,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
667
741
|
}, {
|
|
668
742
|
key: "destroy",
|
|
669
743
|
value: function () {
|
|
670
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
744
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
671
745
|
var _this4 = this;
|
|
672
|
-
return _regeneratorRuntime().wrap(function
|
|
673
|
-
while (1) switch (
|
|
746
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
747
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
674
748
|
case 0:
|
|
675
749
|
Object.keys(this.store).forEach(function (key) {
|
|
676
750
|
var sub = _this4.store[key];
|
|
@@ -683,15 +757,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
683
757
|
}
|
|
684
758
|
});
|
|
685
759
|
this.currentSalesDetail = null;
|
|
686
|
-
|
|
760
|
+
_context6.next = 4;
|
|
687
761
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
688
762
|
case 4:
|
|
689
763
|
_get(_getPrototypeOf(BaseSalesImpl.prototype), "destroy", this).call(this);
|
|
690
764
|
case 5:
|
|
691
765
|
case "end":
|
|
692
|
-
return
|
|
766
|
+
return _context6.stop();
|
|
693
767
|
}
|
|
694
|
-
},
|
|
768
|
+
}, _callee6, this);
|
|
695
769
|
}));
|
|
696
770
|
function destroy() {
|
|
697
771
|
return _destroy.apply(this, arguments);
|
|
@@ -708,14 +782,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
708
782
|
}, {
|
|
709
783
|
key: "loadSalesDetail",
|
|
710
784
|
value: (function () {
|
|
711
|
-
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
712
|
-
var
|
|
785
|
+
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(orderIdOrParams) {
|
|
786
|
+
var _ref11, _params$orderId;
|
|
713
787
|
var params, externalSaleNumber, lookup, res, message, currentTempOrder, record, sales;
|
|
714
|
-
return _regeneratorRuntime().wrap(function
|
|
715
|
-
while (1) switch (
|
|
788
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
789
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
716
790
|
case 0:
|
|
717
791
|
if (this.store.order) {
|
|
718
|
-
|
|
792
|
+
_context7.next = 2;
|
|
719
793
|
break;
|
|
720
794
|
}
|
|
721
795
|
throw new Error('order 模块未初始化');
|
|
@@ -724,22 +798,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
724
798
|
orderId: orderIdOrParams
|
|
725
799
|
};
|
|
726
800
|
externalSaleNumber = params.externalSaleNumber || params.external_sale_number;
|
|
727
|
-
lookup = (
|
|
801
|
+
lookup = (_ref11 = (_params$orderId = params.orderId) !== null && _params$orderId !== void 0 ? _params$orderId : externalSaleNumber) !== null && _ref11 !== void 0 ? _ref11 : params.orderNumber;
|
|
728
802
|
if (!(lookup === undefined || lookup === null || lookup === '')) {
|
|
729
|
-
|
|
803
|
+
_context7.next = 7;
|
|
730
804
|
break;
|
|
731
805
|
}
|
|
732
806
|
throw new Error('加载销售详情需要 orderId、externalSaleNumber 或 orderNumber');
|
|
733
807
|
case 7:
|
|
734
|
-
|
|
808
|
+
_context7.next = 9;
|
|
735
809
|
return this.store.order.getSalesOrderByLookup({
|
|
736
810
|
lookup: lookup,
|
|
737
811
|
forceRemote: params.forceRemote
|
|
738
812
|
});
|
|
739
813
|
case 9:
|
|
740
|
-
res =
|
|
814
|
+
res = _context7.sent;
|
|
741
815
|
if (!(!res || res.code !== 200)) {
|
|
742
|
-
|
|
816
|
+
_context7.next = 13;
|
|
743
817
|
break;
|
|
744
818
|
}
|
|
745
819
|
message = res && (res.message || res.msg) || "\u52A0\u8F7D\u9500\u552E\u8BE6\u60C5\u5931\u8D25: ".concat(lookup);
|
|
@@ -747,26 +821,26 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
747
821
|
case 13:
|
|
748
822
|
currentTempOrder = params.merge ? this.store.order.getTempOrder() : null;
|
|
749
823
|
record = params.merge ? mergeSalesDetailRecordWithTempOrder(currentTempOrder, res.data) : res.data;
|
|
750
|
-
|
|
824
|
+
_context7.next = 17;
|
|
751
825
|
return this.store.order.hydrateTempOrderFromRecord(record, {
|
|
752
826
|
recalcOnHydrate: false
|
|
753
827
|
});
|
|
754
828
|
case 17:
|
|
755
|
-
sales =
|
|
829
|
+
sales = _context7.sent;
|
|
756
830
|
this.currentSalesDetail = sales;
|
|
757
|
-
|
|
831
|
+
_context7.next = 21;
|
|
758
832
|
return this.core.effects.emit("".concat(this.name, ":onSalesOrderLoaded"), {
|
|
759
833
|
sales: sales
|
|
760
834
|
});
|
|
761
835
|
case 21:
|
|
762
|
-
return
|
|
836
|
+
return _context7.abrupt("return", sales);
|
|
763
837
|
case 22:
|
|
764
838
|
case "end":
|
|
765
|
-
return
|
|
839
|
+
return _context7.stop();
|
|
766
840
|
}
|
|
767
|
-
},
|
|
841
|
+
}, _callee7, this);
|
|
768
842
|
}));
|
|
769
|
-
function loadSalesDetail(
|
|
843
|
+
function loadSalesDetail(_x7) {
|
|
770
844
|
return _loadSalesDetail.apply(this, arguments);
|
|
771
845
|
}
|
|
772
846
|
return loadSalesDetail;
|
|
@@ -846,34 +920,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
846
920
|
}, {
|
|
847
921
|
key: "replaceTempOrder",
|
|
848
922
|
value: function () {
|
|
849
|
-
var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
923
|
+
var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(tempOrder) {
|
|
850
924
|
var nextTempOrder;
|
|
851
|
-
return _regeneratorRuntime().wrap(function
|
|
852
|
-
while (1) switch (
|
|
925
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
926
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
853
927
|
case 0:
|
|
854
928
|
if (this.store.order) {
|
|
855
|
-
|
|
929
|
+
_context8.next = 2;
|
|
856
930
|
break;
|
|
857
931
|
}
|
|
858
932
|
throw new Error('order 模块未初始化');
|
|
859
933
|
case 2:
|
|
860
|
-
|
|
934
|
+
_context8.next = 4;
|
|
861
935
|
return this.store.order.replaceTempOrder(tempOrder);
|
|
862
936
|
case 4:
|
|
863
|
-
nextTempOrder =
|
|
864
|
-
|
|
937
|
+
nextTempOrder = _context8.sent;
|
|
938
|
+
_context8.next = 7;
|
|
865
939
|
return this.effectsEmit('onTempOrderReplaced', {
|
|
866
940
|
tempOrder: nextTempOrder
|
|
867
941
|
});
|
|
868
942
|
case 7:
|
|
869
|
-
return
|
|
943
|
+
return _context8.abrupt("return", nextTempOrder);
|
|
870
944
|
case 8:
|
|
871
945
|
case "end":
|
|
872
|
-
return
|
|
946
|
+
return _context8.stop();
|
|
873
947
|
}
|
|
874
|
-
},
|
|
948
|
+
}, _callee8, this);
|
|
875
949
|
}));
|
|
876
|
-
function replaceTempOrder(
|
|
950
|
+
function replaceTempOrder(_x8) {
|
|
877
951
|
return _replaceTempOrder.apply(this, arguments);
|
|
878
952
|
}
|
|
879
953
|
return replaceTempOrder;
|
|
@@ -965,40 +1039,40 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
965
1039
|
}, {
|
|
966
1040
|
key: "addNewOrder",
|
|
967
1041
|
value: function () {
|
|
968
|
-
var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1042
|
+
var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
969
1043
|
var tempOrder;
|
|
970
|
-
return _regeneratorRuntime().wrap(function
|
|
971
|
-
while (1) switch (
|
|
1044
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1045
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
972
1046
|
case 0:
|
|
973
|
-
|
|
1047
|
+
_context9.prev = 0;
|
|
974
1048
|
if (this.store.order) {
|
|
975
|
-
|
|
1049
|
+
_context9.next = 3;
|
|
976
1050
|
break;
|
|
977
1051
|
}
|
|
978
1052
|
throw new Error('order 模块未初始化');
|
|
979
1053
|
case 3:
|
|
980
|
-
|
|
1054
|
+
_context9.next = 5;
|
|
981
1055
|
return this.store.order.addNewOrder();
|
|
982
1056
|
case 5:
|
|
983
|
-
tempOrder =
|
|
1057
|
+
tempOrder = _context9.sent;
|
|
984
1058
|
if (!(this.syncAppDataToTempOrder(tempOrder) && this.isTempOrderPersistEnabled())) {
|
|
985
|
-
|
|
1059
|
+
_context9.next = 10;
|
|
986
1060
|
break;
|
|
987
1061
|
}
|
|
988
1062
|
this.store.order.persistTempOrder();
|
|
989
|
-
|
|
1063
|
+
_context9.next = 10;
|
|
990
1064
|
return this.store.order.saveDraft();
|
|
991
1065
|
case 10:
|
|
992
|
-
return
|
|
1066
|
+
return _context9.abrupt("return", tempOrder);
|
|
993
1067
|
case 13:
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
throw
|
|
1068
|
+
_context9.prev = 13;
|
|
1069
|
+
_context9.t0 = _context9["catch"](0);
|
|
1070
|
+
throw _context9.t0;
|
|
997
1071
|
case 16:
|
|
998
1072
|
case "end":
|
|
999
|
-
return
|
|
1073
|
+
return _context9.stop();
|
|
1000
1074
|
}
|
|
1001
|
-
},
|
|
1075
|
+
}, _callee9, this, [[0, 13]]);
|
|
1002
1076
|
}));
|
|
1003
1077
|
function addNewOrder() {
|
|
1004
1078
|
return _addNewOrder.apply(this, arguments);
|
|
@@ -1008,22 +1082,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1008
1082
|
}, {
|
|
1009
1083
|
key: "saveDraft",
|
|
1010
1084
|
value: function () {
|
|
1011
|
-
var _saveDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1012
|
-
return _regeneratorRuntime().wrap(function
|
|
1013
|
-
while (1) switch (
|
|
1085
|
+
var _saveDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
1086
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1087
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1014
1088
|
case 0:
|
|
1015
1089
|
if (this.store.order) {
|
|
1016
|
-
|
|
1090
|
+
_context10.next = 2;
|
|
1017
1091
|
break;
|
|
1018
1092
|
}
|
|
1019
1093
|
throw new Error('order 模块未初始化');
|
|
1020
1094
|
case 2:
|
|
1021
|
-
return
|
|
1095
|
+
return _context10.abrupt("return", this.store.order.saveDraft());
|
|
1022
1096
|
case 3:
|
|
1023
1097
|
case "end":
|
|
1024
|
-
return
|
|
1098
|
+
return _context10.stop();
|
|
1025
1099
|
}
|
|
1026
|
-
},
|
|
1100
|
+
}, _callee10, this);
|
|
1027
1101
|
}));
|
|
1028
1102
|
function saveDraft() {
|
|
1029
1103
|
return _saveDraft.apply(this, arguments);
|
|
@@ -1034,14 +1108,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1034
1108
|
}, {
|
|
1035
1109
|
key: "restoreOrder",
|
|
1036
1110
|
value: function () {
|
|
1037
|
-
var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1111
|
+
var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
1038
1112
|
var tempOrder;
|
|
1039
|
-
return _regeneratorRuntime().wrap(function
|
|
1040
|
-
while (1) switch (
|
|
1113
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1114
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1041
1115
|
case 0:
|
|
1042
|
-
|
|
1116
|
+
_context11.prev = 0;
|
|
1043
1117
|
if (this.store.order) {
|
|
1044
|
-
|
|
1118
|
+
_context11.next = 3;
|
|
1045
1119
|
break;
|
|
1046
1120
|
}
|
|
1047
1121
|
throw new Error('scanOrder 解决方案需要 order 模块支持');
|
|
@@ -1051,29 +1125,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1051
1125
|
this.currentSalesDetail = null;
|
|
1052
1126
|
this.discountConfigCacheKey = null;
|
|
1053
1127
|
this.hasManualDiscountSelection = false;
|
|
1054
|
-
|
|
1128
|
+
_context11.next = 9;
|
|
1055
1129
|
return this.effectsEmit('onTempOrderReplaced', {
|
|
1056
1130
|
tempOrder: tempOrder
|
|
1057
1131
|
});
|
|
1058
1132
|
case 9:
|
|
1059
1133
|
if (!(this.syncAppDataToTempOrder(tempOrder) && this.isTempOrderPersistEnabled())) {
|
|
1060
|
-
|
|
1134
|
+
_context11.next = 13;
|
|
1061
1135
|
break;
|
|
1062
1136
|
}
|
|
1063
1137
|
this.store.order.persistTempOrder();
|
|
1064
|
-
|
|
1138
|
+
_context11.next = 13;
|
|
1065
1139
|
return this.store.order.saveDraft();
|
|
1066
1140
|
case 13:
|
|
1067
|
-
return
|
|
1141
|
+
return _context11.abrupt("return", tempOrder);
|
|
1068
1142
|
case 16:
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
throw
|
|
1143
|
+
_context11.prev = 16;
|
|
1144
|
+
_context11.t0 = _context11["catch"](0);
|
|
1145
|
+
throw _context11.t0;
|
|
1072
1146
|
case 19:
|
|
1073
1147
|
case "end":
|
|
1074
|
-
return
|
|
1148
|
+
return _context11.stop();
|
|
1075
1149
|
}
|
|
1076
|
-
},
|
|
1150
|
+
}, _callee11, this, [[0, 16]]);
|
|
1077
1151
|
}));
|
|
1078
1152
|
function restoreOrder() {
|
|
1079
1153
|
return _restoreOrder.apply(this, arguments);
|
|
@@ -1087,22 +1161,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1087
1161
|
}, {
|
|
1088
1162
|
key: "clearOrderCartLines",
|
|
1089
1163
|
value: (function () {
|
|
1090
|
-
var _clearOrderCartLines = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1164
|
+
var _clearOrderCartLines = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
1091
1165
|
var tempOrder;
|
|
1092
|
-
return _regeneratorRuntime().wrap(function
|
|
1093
|
-
while (1) switch (
|
|
1166
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1167
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1094
1168
|
case 0:
|
|
1095
|
-
|
|
1169
|
+
_context12.prev = 0;
|
|
1096
1170
|
if (this.store.order) {
|
|
1097
|
-
|
|
1171
|
+
_context12.next = 3;
|
|
1098
1172
|
break;
|
|
1099
1173
|
}
|
|
1100
1174
|
throw new Error('order 模块未初始化');
|
|
1101
1175
|
case 3:
|
|
1102
|
-
|
|
1176
|
+
_context12.next = 5;
|
|
1103
1177
|
return this.store.order.clearOrderCartLines();
|
|
1104
1178
|
case 5:
|
|
1105
|
-
tempOrder =
|
|
1179
|
+
tempOrder = _context12.sent;
|
|
1106
1180
|
if (this.currentSalesDetail) {
|
|
1107
1181
|
this.currentSalesDetail = _objectSpread(_objectSpread({}, this.currentSalesDetail), {}, {
|
|
1108
1182
|
products: [],
|
|
@@ -1112,29 +1186,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1112
1186
|
discount_list: []
|
|
1113
1187
|
});
|
|
1114
1188
|
}
|
|
1115
|
-
|
|
1189
|
+
_context12.next = 9;
|
|
1116
1190
|
return this.effectsEmit('onTempOrderReplaced', {
|
|
1117
1191
|
tempOrder: tempOrder
|
|
1118
1192
|
});
|
|
1119
1193
|
case 9:
|
|
1120
1194
|
if (!(this.syncAppDataToTempOrder(tempOrder) && this.isTempOrderPersistEnabled())) {
|
|
1121
|
-
|
|
1195
|
+
_context12.next = 13;
|
|
1122
1196
|
break;
|
|
1123
1197
|
}
|
|
1124
1198
|
this.store.order.persistTempOrder();
|
|
1125
|
-
|
|
1199
|
+
_context12.next = 13;
|
|
1126
1200
|
return this.store.order.saveDraft();
|
|
1127
1201
|
case 13:
|
|
1128
|
-
return
|
|
1202
|
+
return _context12.abrupt("return", tempOrder);
|
|
1129
1203
|
case 16:
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
throw
|
|
1204
|
+
_context12.prev = 16;
|
|
1205
|
+
_context12.t0 = _context12["catch"](0);
|
|
1206
|
+
throw _context12.t0;
|
|
1133
1207
|
case 19:
|
|
1134
1208
|
case "end":
|
|
1135
|
-
return
|
|
1209
|
+
return _context12.stop();
|
|
1136
1210
|
}
|
|
1137
|
-
},
|
|
1211
|
+
}, _callee12, this, [[0, 16]]);
|
|
1138
1212
|
}));
|
|
1139
1213
|
function clearOrderCartLines() {
|
|
1140
1214
|
return _clearOrderCartLines.apply(this, arguments);
|
|
@@ -1151,32 +1225,32 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1151
1225
|
}, {
|
|
1152
1226
|
key: "getSummary",
|
|
1153
1227
|
value: function () {
|
|
1154
|
-
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1228
|
+
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
1155
1229
|
var summary;
|
|
1156
|
-
return _regeneratorRuntime().wrap(function
|
|
1157
|
-
while (1) switch (
|
|
1230
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1231
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1158
1232
|
case 0:
|
|
1159
|
-
|
|
1233
|
+
_context13.prev = 0;
|
|
1160
1234
|
if (this.store.order) {
|
|
1161
|
-
|
|
1235
|
+
_context13.next = 3;
|
|
1162
1236
|
break;
|
|
1163
1237
|
}
|
|
1164
1238
|
throw new Error('order 模块未初始化');
|
|
1165
1239
|
case 3:
|
|
1166
|
-
|
|
1240
|
+
_context13.next = 5;
|
|
1167
1241
|
return this.store.order.getOrderSummary();
|
|
1168
1242
|
case 5:
|
|
1169
|
-
summary =
|
|
1170
|
-
return
|
|
1243
|
+
summary = _context13.sent;
|
|
1244
|
+
return _context13.abrupt("return", summary);
|
|
1171
1245
|
case 9:
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
throw
|
|
1246
|
+
_context13.prev = 9;
|
|
1247
|
+
_context13.t0 = _context13["catch"](0);
|
|
1248
|
+
throw _context13.t0;
|
|
1175
1249
|
case 12:
|
|
1176
1250
|
case "end":
|
|
1177
|
-
return
|
|
1251
|
+
return _context13.stop();
|
|
1178
1252
|
}
|
|
1179
|
-
},
|
|
1253
|
+
}, _callee13, this, [[0, 9]]);
|
|
1180
1254
|
}));
|
|
1181
1255
|
function getSummary() {
|
|
1182
1256
|
return _getSummary.apply(this, arguments);
|
|
@@ -1291,14 +1365,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1291
1365
|
}, {
|
|
1292
1366
|
key: "loadDiscountConfig",
|
|
1293
1367
|
value: function () {
|
|
1294
|
-
var _loadDiscountConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1368
|
+
var _loadDiscountConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
|
|
1295
1369
|
var _this$getOrderIdentit, _tempOrder$customer, _tempOrder$_extend, _tempOrder$_extend2, _discountModule$getDi, _discountModule$getOr, _discountModule$getDi2;
|
|
1296
1370
|
var tempOrder, orderStore, discountModule, rulesModule, orderId, customerId, currentDiscountList, originalDiscountList, hasManualDiscountSelection, discountAction, discountConfigCacheKey, preparedDiscountList, _discountModule$setOr, nextDiscountList, shouldSkipAutoApplyFetchedDiscounts, _summary, _tempOrder$holder, _tempOrder$holder2, _orderStore$summary, holders, result, _iterator, _step, _product$metadata5, _tempOrder$_extend3, _product$metadata$sou, _product$metadata6, _product$metadata7, _product$original_pri, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, summary;
|
|
1297
|
-
return _regeneratorRuntime().wrap(function
|
|
1298
|
-
while (1) switch (
|
|
1371
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1372
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1299
1373
|
case 0:
|
|
1300
1374
|
if (this.store.order) {
|
|
1301
|
-
|
|
1375
|
+
_context14.next = 2;
|
|
1302
1376
|
break;
|
|
1303
1377
|
}
|
|
1304
1378
|
throw new Error('order 模块未初始化');
|
|
@@ -1318,18 +1392,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1318
1392
|
discountConfigCacheKey = [customerId, discountAction, Number(orderId) || 0].join(':');
|
|
1319
1393
|
preparedDiscountList = [];
|
|
1320
1394
|
if (!(customerId && customerId !== 1)) {
|
|
1321
|
-
|
|
1395
|
+
_context14.next = 25;
|
|
1322
1396
|
break;
|
|
1323
1397
|
}
|
|
1324
1398
|
if (!(this.discountConfigCacheKey === discountConfigCacheKey)) {
|
|
1325
|
-
|
|
1399
|
+
_context14.next = 19;
|
|
1326
1400
|
break;
|
|
1327
1401
|
}
|
|
1328
1402
|
preparedDiscountList = originalDiscountList;
|
|
1329
|
-
|
|
1403
|
+
_context14.next = 25;
|
|
1330
1404
|
break;
|
|
1331
1405
|
case 19:
|
|
1332
|
-
|
|
1406
|
+
_context14.next = 21;
|
|
1333
1407
|
return this.store.order.loadDiscountConfig({
|
|
1334
1408
|
customerId: customerId,
|
|
1335
1409
|
action: discountAction,
|
|
@@ -1337,23 +1411,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1337
1411
|
apply: false
|
|
1338
1412
|
});
|
|
1339
1413
|
case 21:
|
|
1340
|
-
preparedDiscountList =
|
|
1414
|
+
preparedDiscountList = _context14.sent;
|
|
1341
1415
|
this.discountConfigCacheKey = discountConfigCacheKey;
|
|
1342
|
-
|
|
1416
|
+
_context14.next = 25;
|
|
1343
1417
|
return discountModule === null || discountModule === void 0 || (_discountModule$setOr = discountModule.setOriginalDiscountList) === null || _discountModule$setOr === void 0 ? void 0 : _discountModule$setOr.call(discountModule, preparedDiscountList);
|
|
1344
1418
|
case 25:
|
|
1345
1419
|
if (!(hasManualDiscountSelection && currentDiscountList.length)) {
|
|
1346
|
-
|
|
1420
|
+
_context14.next = 27;
|
|
1347
1421
|
break;
|
|
1348
1422
|
}
|
|
1349
|
-
return
|
|
1423
|
+
return _context14.abrupt("return", {
|
|
1350
1424
|
productList: tempOrder.products || [],
|
|
1351
1425
|
discountList: currentDiscountList
|
|
1352
1426
|
});
|
|
1353
1427
|
case 27:
|
|
1354
1428
|
nextDiscountList = this.mergeHistoricalDiscountList(preparedDiscountList || (discountModule === null || discountModule === void 0 || (_discountModule$getDi2 = discountModule.getDiscountList) === null || _discountModule$getDi2 === void 0 ? void 0 : _discountModule$getDi2.call(discountModule)) || [], tempOrder.products || []);
|
|
1355
1429
|
nextDiscountList = this.mergeCurrentDiscountSelectionState(nextDiscountList, currentDiscountList);
|
|
1356
|
-
|
|
1430
|
+
_context14.next = 31;
|
|
1357
1431
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1358
1432
|
case 31:
|
|
1359
1433
|
shouldSkipAutoApplyFetchedDiscounts = this.shouldSkipAutoApplyFetchedDiscountsInEditMode({
|
|
@@ -1363,17 +1437,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1363
1437
|
nextDiscountList: nextDiscountList
|
|
1364
1438
|
});
|
|
1365
1439
|
if (!shouldSkipAutoApplyFetchedDiscounts) {
|
|
1366
|
-
|
|
1440
|
+
_context14.next = 40;
|
|
1367
1441
|
break;
|
|
1368
1442
|
}
|
|
1369
|
-
|
|
1443
|
+
_context14.next = 35;
|
|
1370
1444
|
return this.store.order.recalculateSummary({
|
|
1371
1445
|
createIfMissing: true
|
|
1372
1446
|
});
|
|
1373
1447
|
case 35:
|
|
1374
|
-
_summary =
|
|
1448
|
+
_summary = _context14.sent;
|
|
1375
1449
|
this.store.order.persistTempOrder();
|
|
1376
|
-
|
|
1450
|
+
_context14.next = 39;
|
|
1377
1451
|
return this.effectsEmit('onDiscountApplied', {
|
|
1378
1452
|
productList: tempOrder.products || [],
|
|
1379
1453
|
discountList: nextDiscountList,
|
|
@@ -1381,13 +1455,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1381
1455
|
tempOrder: tempOrder
|
|
1382
1456
|
});
|
|
1383
1457
|
case 39:
|
|
1384
|
-
return
|
|
1458
|
+
return _context14.abrupt("return", {
|
|
1385
1459
|
productList: tempOrder.products || [],
|
|
1386
1460
|
discountList: nextDiscountList
|
|
1387
1461
|
});
|
|
1388
1462
|
case 40:
|
|
1389
1463
|
if (!rulesModule) {
|
|
1390
|
-
|
|
1464
|
+
_context14.next = 76;
|
|
1391
1465
|
break;
|
|
1392
1466
|
}
|
|
1393
1467
|
holders = (_tempOrder$holder = tempOrder.holder) !== null && _tempOrder$holder !== void 0 && _tempOrder$holder.form_record_id ? [{
|
|
@@ -1407,21 +1481,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1407
1481
|
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
|
|
1408
1482
|
}
|
|
1409
1483
|
_iterator = _createForOfIteratorHelper(tempOrder.products || []);
|
|
1410
|
-
|
|
1484
|
+
_context14.prev = 45;
|
|
1411
1485
|
_iterator.s();
|
|
1412
1486
|
case 47:
|
|
1413
1487
|
if ((_step = _iterator.n()).done) {
|
|
1414
|
-
|
|
1488
|
+
_context14.next = 62;
|
|
1415
1489
|
break;
|
|
1416
1490
|
}
|
|
1417
1491
|
product = _step.value;
|
|
1418
1492
|
productUid = (_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.unique_identification_number;
|
|
1419
1493
|
runtimeOrigin = productUid ? (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[productUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin : undefined;
|
|
1420
1494
|
if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
|
|
1421
|
-
|
|
1495
|
+
_context14.next = 53;
|
|
1422
1496
|
break;
|
|
1423
1497
|
}
|
|
1424
|
-
return
|
|
1498
|
+
return _context14.abrupt("continue", 60);
|
|
1425
1499
|
case 53:
|
|
1426
1500
|
totalPerUnitDiscount = (product.discount_list || []).reduce(function (sum, pd) {
|
|
1427
1501
|
return sum + Number(pd.amount || 0);
|
|
@@ -1439,41 +1513,41 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1439
1513
|
bundle: product.product_bundle
|
|
1440
1514
|
});
|
|
1441
1515
|
case 60:
|
|
1442
|
-
|
|
1516
|
+
_context14.next = 47;
|
|
1443
1517
|
break;
|
|
1444
1518
|
case 62:
|
|
1445
|
-
|
|
1519
|
+
_context14.next = 67;
|
|
1446
1520
|
break;
|
|
1447
1521
|
case 64:
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
_iterator.e(
|
|
1522
|
+
_context14.prev = 64;
|
|
1523
|
+
_context14.t0 = _context14["catch"](45);
|
|
1524
|
+
_iterator.e(_context14.t0);
|
|
1451
1525
|
case 67:
|
|
1452
|
-
|
|
1526
|
+
_context14.prev = 67;
|
|
1453
1527
|
_iterator.f();
|
|
1454
|
-
return
|
|
1528
|
+
return _context14.finish(67);
|
|
1455
1529
|
case 70:
|
|
1456
1530
|
if (!result.discountList) {
|
|
1457
|
-
|
|
1531
|
+
_context14.next = 76;
|
|
1458
1532
|
break;
|
|
1459
1533
|
}
|
|
1460
1534
|
nextDiscountList = this.mergeHistoricalDiscountList(result.discountList, tempOrder.products || []);
|
|
1461
1535
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
1462
|
-
|
|
1536
|
+
_context14.next = 75;
|
|
1463
1537
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1464
1538
|
case 75:
|
|
1465
1539
|
tempOrder.discount_list = nextDiscountList.filter(function (discount) {
|
|
1466
1540
|
return discount.isSelected;
|
|
1467
1541
|
});
|
|
1468
1542
|
case 76:
|
|
1469
|
-
|
|
1543
|
+
_context14.next = 78;
|
|
1470
1544
|
return this.store.order.recalculateSummary({
|
|
1471
1545
|
createIfMissing: true
|
|
1472
1546
|
});
|
|
1473
1547
|
case 78:
|
|
1474
|
-
summary =
|
|
1548
|
+
summary = _context14.sent;
|
|
1475
1549
|
this.store.order.persistTempOrder();
|
|
1476
|
-
|
|
1550
|
+
_context14.next = 82;
|
|
1477
1551
|
return this.effectsEmit('onDiscountApplied', {
|
|
1478
1552
|
productList: tempOrder.products || [],
|
|
1479
1553
|
discountList: nextDiscountList,
|
|
@@ -1481,17 +1555,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1481
1555
|
tempOrder: tempOrder
|
|
1482
1556
|
});
|
|
1483
1557
|
case 82:
|
|
1484
|
-
return
|
|
1558
|
+
return _context14.abrupt("return", {
|
|
1485
1559
|
productList: tempOrder.products || [],
|
|
1486
1560
|
discountList: nextDiscountList
|
|
1487
1561
|
});
|
|
1488
1562
|
case 83:
|
|
1489
1563
|
case "end":
|
|
1490
|
-
return
|
|
1564
|
+
return _context14.stop();
|
|
1491
1565
|
}
|
|
1492
|
-
},
|
|
1566
|
+
}, _callee14, this, [[45, 64, 67, 70]]);
|
|
1493
1567
|
}));
|
|
1494
|
-
function loadDiscountConfig(
|
|
1568
|
+
function loadDiscountConfig(_x9) {
|
|
1495
1569
|
return _loadDiscountConfig.apply(this, arguments);
|
|
1496
1570
|
}
|
|
1497
1571
|
return loadDiscountConfig;
|
|
@@ -1499,14 +1573,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1499
1573
|
}, {
|
|
1500
1574
|
key: "bestDiscount",
|
|
1501
1575
|
value: function () {
|
|
1502
|
-
var _bestDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1576
|
+
var _bestDiscount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(cb) {
|
|
1503
1577
|
var _discountModule$getOr2, _discountModule$getDi3;
|
|
1504
1578
|
var tempOrder, orderStore, discountModule, rulesModule, originalDiscountList, currentDiscountList, nextDiscountList, result, _tempOrder$holder3, _tempOrder$holder4, _orderStore$summary2, holders;
|
|
1505
|
-
return _regeneratorRuntime().wrap(function
|
|
1506
|
-
while (1) switch (
|
|
1579
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1580
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1507
1581
|
case 0:
|
|
1508
1582
|
if (this.store.order) {
|
|
1509
|
-
|
|
1583
|
+
_context15.next = 2;
|
|
1510
1584
|
break;
|
|
1511
1585
|
}
|
|
1512
1586
|
throw new Error('order 模块未初始化');
|
|
@@ -1522,11 +1596,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1522
1596
|
productList: tempOrder.products || [],
|
|
1523
1597
|
discountList: nextDiscountList
|
|
1524
1598
|
};
|
|
1525
|
-
|
|
1599
|
+
_context15.next = 12;
|
|
1526
1600
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1527
1601
|
case 12:
|
|
1528
1602
|
if (!rulesModule) {
|
|
1529
|
-
|
|
1603
|
+
_context15.next = 23;
|
|
1530
1604
|
break;
|
|
1531
1605
|
}
|
|
1532
1606
|
holders = (_tempOrder$holder3 = tempOrder.holder) !== null && _tempOrder$holder3 !== void 0 && _tempOrder$holder3.form_record_id ? [{
|
|
@@ -1543,12 +1617,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1543
1617
|
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
|
|
1544
1618
|
}
|
|
1545
1619
|
if (!result.discountList) {
|
|
1546
|
-
|
|
1620
|
+
_context15.next = 23;
|
|
1547
1621
|
break;
|
|
1548
1622
|
}
|
|
1549
1623
|
nextDiscountList = this.mergeHistoricalDiscountList(result.discountList, tempOrder.products || []);
|
|
1550
1624
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
1551
|
-
|
|
1625
|
+
_context15.next = 21;
|
|
1552
1626
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1553
1627
|
case 21:
|
|
1554
1628
|
tempOrder.discount_list = nextDiscountList.filter(function (discount) {
|
|
@@ -1559,21 +1633,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1559
1633
|
discountList: nextDiscountList
|
|
1560
1634
|
};
|
|
1561
1635
|
case 23:
|
|
1562
|
-
|
|
1636
|
+
_context15.next = 25;
|
|
1563
1637
|
return this.store.order.recalculateSummary({
|
|
1564
1638
|
createIfMissing: true
|
|
1565
1639
|
});
|
|
1566
1640
|
case 25:
|
|
1567
1641
|
this.store.order.persistTempOrder();
|
|
1568
1642
|
cb === null || cb === void 0 || cb(result);
|
|
1569
|
-
return
|
|
1643
|
+
return _context15.abrupt("return", result);
|
|
1570
1644
|
case 28:
|
|
1571
1645
|
case "end":
|
|
1572
|
-
return
|
|
1646
|
+
return _context15.stop();
|
|
1573
1647
|
}
|
|
1574
|
-
},
|
|
1648
|
+
}, _callee15, this);
|
|
1575
1649
|
}));
|
|
1576
|
-
function bestDiscount(
|
|
1650
|
+
function bestDiscount(_x10) {
|
|
1577
1651
|
return _bestDiscount.apply(this, arguments);
|
|
1578
1652
|
}
|
|
1579
1653
|
return bestDiscount;
|
|
@@ -1587,49 +1661,49 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1587
1661
|
}, {
|
|
1588
1662
|
key: "scanPromotionCode",
|
|
1589
1663
|
value: function () {
|
|
1590
|
-
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1664
|
+
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(code, customerId) {
|
|
1591
1665
|
var raw;
|
|
1592
|
-
return _regeneratorRuntime().wrap(function
|
|
1593
|
-
while (1) switch (
|
|
1666
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1667
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1594
1668
|
case 0:
|
|
1595
|
-
|
|
1669
|
+
_context16.prev = 0;
|
|
1596
1670
|
if (this.store.order) {
|
|
1597
|
-
|
|
1671
|
+
_context16.next = 3;
|
|
1598
1672
|
break;
|
|
1599
1673
|
}
|
|
1600
1674
|
throw new Error('order 模块未初始化');
|
|
1601
1675
|
case 3:
|
|
1602
|
-
|
|
1676
|
+
_context16.next = 5;
|
|
1603
1677
|
return this.store.order.scanCode(code, customerId);
|
|
1604
1678
|
case 5:
|
|
1605
|
-
raw =
|
|
1679
|
+
raw = _context16.sent;
|
|
1606
1680
|
if (!raw.isAvailable) {
|
|
1607
|
-
|
|
1681
|
+
_context16.next = 10;
|
|
1608
1682
|
break;
|
|
1609
1683
|
}
|
|
1610
|
-
|
|
1684
|
+
_context16.next = 9;
|
|
1611
1685
|
return this.store.order.recalculateSummary({
|
|
1612
1686
|
createIfMissing: true
|
|
1613
1687
|
});
|
|
1614
1688
|
case 9:
|
|
1615
1689
|
this.store.order.persistTempOrder();
|
|
1616
1690
|
case 10:
|
|
1617
|
-
return
|
|
1691
|
+
return _context16.abrupt("return", {
|
|
1618
1692
|
isAvailable: raw.isAvailable,
|
|
1619
1693
|
type: raw.type,
|
|
1620
1694
|
unavailableReason: raw.unavailableReason
|
|
1621
1695
|
});
|
|
1622
1696
|
case 13:
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
throw
|
|
1697
|
+
_context16.prev = 13;
|
|
1698
|
+
_context16.t0 = _context16["catch"](0);
|
|
1699
|
+
throw _context16.t0;
|
|
1626
1700
|
case 16:
|
|
1627
1701
|
case "end":
|
|
1628
|
-
return
|
|
1702
|
+
return _context16.stop();
|
|
1629
1703
|
}
|
|
1630
|
-
},
|
|
1704
|
+
}, _callee16, this, [[0, 13]]);
|
|
1631
1705
|
}));
|
|
1632
|
-
function scanPromotionCode(
|
|
1706
|
+
function scanPromotionCode(_x11, _x12) {
|
|
1633
1707
|
return _scanPromotionCode.apply(this, arguments);
|
|
1634
1708
|
}
|
|
1635
1709
|
return scanPromotionCode;
|
|
@@ -1637,14 +1711,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1637
1711
|
}, {
|
|
1638
1712
|
key: "setDiscountSelected",
|
|
1639
1713
|
value: function () {
|
|
1640
|
-
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1714
|
+
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
|
|
1641
1715
|
var _tempOrder$holder5, list, updated, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder6, result, beforeSelectedIds, _iterator2, _step2, d, selectedResourceIds, _iterator3, _step3, _product$metadata8, _tempOrder$_extend4, _product$metadata$sou2, _product$metadata9, _product$metadata10, _product$original_pri2, product, productUid, runtimeOrigin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice;
|
|
1642
|
-
return _regeneratorRuntime().wrap(function
|
|
1643
|
-
while (1) switch (
|
|
1716
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1717
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1644
1718
|
case 0:
|
|
1645
|
-
|
|
1719
|
+
_context17.prev = 0;
|
|
1646
1720
|
if (this.store.order) {
|
|
1647
|
-
|
|
1721
|
+
_context17.next = 3;
|
|
1648
1722
|
break;
|
|
1649
1723
|
}
|
|
1650
1724
|
throw new Error('order 模块未初始化');
|
|
@@ -1665,7 +1739,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1665
1739
|
form_record_id: tempOrder.holder.form_record_id
|
|
1666
1740
|
}] : [];
|
|
1667
1741
|
nextDiscountList = updated;
|
|
1668
|
-
|
|
1742
|
+
_context17.next = 14;
|
|
1669
1743
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
|
|
1670
1744
|
case 14:
|
|
1671
1745
|
if (rulesModule) {
|
|
@@ -1715,21 +1789,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1715
1789
|
return d.id;
|
|
1716
1790
|
}));
|
|
1717
1791
|
_iterator3 = _createForOfIteratorHelper(tempOrder.products);
|
|
1718
|
-
|
|
1792
|
+
_context17.prev = 17;
|
|
1719
1793
|
_iterator3.s();
|
|
1720
1794
|
case 19:
|
|
1721
1795
|
if ((_step3 = _iterator3.n()).done) {
|
|
1722
|
-
|
|
1796
|
+
_context17.next = 35;
|
|
1723
1797
|
break;
|
|
1724
1798
|
}
|
|
1725
1799
|
product = _step3.value;
|
|
1726
1800
|
productUid = (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.unique_identification_number;
|
|
1727
1801
|
runtimeOrigin = productUid ? (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[productUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin : undefined;
|
|
1728
1802
|
if (!(runtimeOrigin !== null && runtimeOrigin !== void 0 && runtimeOrigin.isManualDiscount || isBaseSalesManualProductDiscountProduct(product))) {
|
|
1729
|
-
|
|
1803
|
+
_context17.next = 25;
|
|
1730
1804
|
break;
|
|
1731
1805
|
}
|
|
1732
|
-
return
|
|
1806
|
+
return _context17.abrupt("continue", 33);
|
|
1733
1807
|
case 25:
|
|
1734
1808
|
product.discount_list = (product.discount_list || []).filter(function (pd) {
|
|
1735
1809
|
var _pd$discount$resource, _pd$discount;
|
|
@@ -1755,28 +1829,28 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1755
1829
|
bundle: product.product_bundle
|
|
1756
1830
|
});
|
|
1757
1831
|
case 33:
|
|
1758
|
-
|
|
1832
|
+
_context17.next = 19;
|
|
1759
1833
|
break;
|
|
1760
1834
|
case 35:
|
|
1761
|
-
|
|
1835
|
+
_context17.next = 40;
|
|
1762
1836
|
break;
|
|
1763
1837
|
case 37:
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
_iterator3.e(
|
|
1838
|
+
_context17.prev = 37;
|
|
1839
|
+
_context17.t0 = _context17["catch"](17);
|
|
1840
|
+
_iterator3.e(_context17.t0);
|
|
1767
1841
|
case 40:
|
|
1768
|
-
|
|
1842
|
+
_context17.prev = 40;
|
|
1769
1843
|
_iterator3.f();
|
|
1770
|
-
return
|
|
1844
|
+
return _context17.finish(40);
|
|
1771
1845
|
case 43:
|
|
1772
1846
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
1773
|
-
|
|
1847
|
+
_context17.next = 46;
|
|
1774
1848
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
1775
1849
|
case 46:
|
|
1776
1850
|
tempOrder.discount_list = (nextDiscountList || []).filter(function (d) {
|
|
1777
1851
|
return d.isSelected;
|
|
1778
1852
|
});
|
|
1779
|
-
|
|
1853
|
+
_context17.next = 49;
|
|
1780
1854
|
return this.store.order.recalculateSummary({
|
|
1781
1855
|
createIfMissing: true
|
|
1782
1856
|
});
|
|
@@ -1788,19 +1862,19 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1788
1862
|
selectedDiscountList: tempOrder.discount_list,
|
|
1789
1863
|
tempOrder: tempOrder
|
|
1790
1864
|
});
|
|
1791
|
-
|
|
1865
|
+
_context17.next = 56;
|
|
1792
1866
|
break;
|
|
1793
1867
|
case 53:
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
throw
|
|
1868
|
+
_context17.prev = 53;
|
|
1869
|
+
_context17.t1 = _context17["catch"](0);
|
|
1870
|
+
throw _context17.t1;
|
|
1797
1871
|
case 56:
|
|
1798
1872
|
case "end":
|
|
1799
|
-
return
|
|
1873
|
+
return _context17.stop();
|
|
1800
1874
|
}
|
|
1801
|
-
},
|
|
1875
|
+
}, _callee17, this, [[0, 53], [17, 37, 40, 43]]);
|
|
1802
1876
|
}));
|
|
1803
|
-
function setDiscountSelected(
|
|
1877
|
+
function setDiscountSelected(_x13) {
|
|
1804
1878
|
return _setDiscountSelected.apply(this, arguments);
|
|
1805
1879
|
}
|
|
1806
1880
|
return setDiscountSelected;
|
|
@@ -1808,23 +1882,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1808
1882
|
}, {
|
|
1809
1883
|
key: "applyDiscountCalculationResult",
|
|
1810
1884
|
value: function () {
|
|
1811
|
-
var _applyDiscountCalculationResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1885
|
+
var _applyDiscountCalculationResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(result) {
|
|
1812
1886
|
var tempOrder, orderStore, discountModule;
|
|
1813
|
-
return _regeneratorRuntime().wrap(function
|
|
1814
|
-
while (1) switch (
|
|
1887
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1888
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1815
1889
|
case 0:
|
|
1816
|
-
|
|
1890
|
+
_context18.prev = 0;
|
|
1817
1891
|
if (this.store.order) {
|
|
1818
|
-
|
|
1892
|
+
_context18.next = 3;
|
|
1819
1893
|
break;
|
|
1820
1894
|
}
|
|
1821
1895
|
throw new Error('order 模块未初始化');
|
|
1822
1896
|
case 3:
|
|
1823
1897
|
if (result) {
|
|
1824
|
-
|
|
1898
|
+
_context18.next = 5;
|
|
1825
1899
|
break;
|
|
1826
1900
|
}
|
|
1827
|
-
return
|
|
1901
|
+
return _context18.abrupt("return");
|
|
1828
1902
|
case 5:
|
|
1829
1903
|
tempOrder = this.store.order.ensureTempOrder();
|
|
1830
1904
|
orderStore = this.store.order.store || {};
|
|
@@ -1833,36 +1907,36 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1833
1907
|
tempOrder.products = preserveManualProductDiscountProducts(tempOrder.products, result.productList);
|
|
1834
1908
|
}
|
|
1835
1909
|
if (!result.discountList) {
|
|
1836
|
-
|
|
1910
|
+
_context18.next = 14;
|
|
1837
1911
|
break;
|
|
1838
1912
|
}
|
|
1839
1913
|
OrderModule.populateSavedAmounts(tempOrder.products, result.discountList);
|
|
1840
|
-
|
|
1914
|
+
_context18.next = 13;
|
|
1841
1915
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(result.discountList);
|
|
1842
1916
|
case 13:
|
|
1843
1917
|
tempOrder.discount_list = result.discountList.filter(function (discount) {
|
|
1844
1918
|
return discount.isSelected;
|
|
1845
1919
|
});
|
|
1846
1920
|
case 14:
|
|
1847
|
-
|
|
1921
|
+
_context18.next = 16;
|
|
1848
1922
|
return this.store.order.recalculateSummary({
|
|
1849
1923
|
createIfMissing: true
|
|
1850
1924
|
});
|
|
1851
1925
|
case 16:
|
|
1852
1926
|
this.store.order.persistTempOrder();
|
|
1853
|
-
|
|
1927
|
+
_context18.next = 22;
|
|
1854
1928
|
break;
|
|
1855
1929
|
case 19:
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
throw
|
|
1930
|
+
_context18.prev = 19;
|
|
1931
|
+
_context18.t0 = _context18["catch"](0);
|
|
1932
|
+
throw _context18.t0;
|
|
1859
1933
|
case 22:
|
|
1860
1934
|
case "end":
|
|
1861
|
-
return
|
|
1935
|
+
return _context18.stop();
|
|
1862
1936
|
}
|
|
1863
|
-
},
|
|
1937
|
+
}, _callee18, this, [[0, 19]]);
|
|
1864
1938
|
}));
|
|
1865
|
-
function applyDiscountCalculationResult(
|
|
1939
|
+
function applyDiscountCalculationResult(_x14) {
|
|
1866
1940
|
return _applyDiscountCalculationResult.apply(this, arguments);
|
|
1867
1941
|
}
|
|
1868
1942
|
return applyDiscountCalculationResult;
|
|
@@ -1870,18 +1944,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1870
1944
|
}, {
|
|
1871
1945
|
key: "submitScanOrder",
|
|
1872
1946
|
value: function () {
|
|
1873
|
-
var _submitScanOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1874
|
-
return _regeneratorRuntime().wrap(function
|
|
1875
|
-
while (1) switch (
|
|
1947
|
+
var _submitScanOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
|
|
1948
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1949
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1876
1950
|
case 0:
|
|
1877
|
-
return
|
|
1951
|
+
return _context19.abrupt("return", this.submitSalesOrder(params));
|
|
1878
1952
|
case 1:
|
|
1879
1953
|
case "end":
|
|
1880
|
-
return
|
|
1954
|
+
return _context19.stop();
|
|
1881
1955
|
}
|
|
1882
|
-
},
|
|
1956
|
+
}, _callee19, this);
|
|
1883
1957
|
}));
|
|
1884
|
-
function submitScanOrder(
|
|
1958
|
+
function submitScanOrder(_x15) {
|
|
1885
1959
|
return _submitScanOrder.apply(this, arguments);
|
|
1886
1960
|
}
|
|
1887
1961
|
return submitScanOrder;
|
|
@@ -1895,20 +1969,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1895
1969
|
}, {
|
|
1896
1970
|
key: "submitSalesOrder",
|
|
1897
1971
|
value: (function () {
|
|
1898
|
-
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1972
|
+
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
|
|
1899
1973
|
var _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
|
|
1900
1974
|
var inferredPaymentStatus, submitParams;
|
|
1901
|
-
return _regeneratorRuntime().wrap(function
|
|
1902
|
-
while (1) switch (
|
|
1975
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1976
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1903
1977
|
case 0:
|
|
1904
1978
|
if (this.store.order) {
|
|
1905
|
-
|
|
1979
|
+
_context20.next = 2;
|
|
1906
1980
|
break;
|
|
1907
1981
|
}
|
|
1908
1982
|
throw new Error('BaseSales 解决方案需要 order 模块支持');
|
|
1909
1983
|
case 2:
|
|
1910
1984
|
// this.store.order.persistTempOrder();
|
|
1911
1985
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
1986
|
+
debugger;
|
|
1912
1987
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
1913
1988
|
cacheId: this.cacheId,
|
|
1914
1989
|
platform: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.platform,
|
|
@@ -1924,14 +1999,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1924
1999
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
1925
2000
|
enhancePayload: params.enhancePayload
|
|
1926
2001
|
} : {});
|
|
1927
|
-
return
|
|
1928
|
-
case
|
|
2002
|
+
return _context20.abrupt("return", this.store.order.submitTempOrder(submitParams));
|
|
2003
|
+
case 6:
|
|
1929
2004
|
case "end":
|
|
1930
|
-
return
|
|
2005
|
+
return _context20.stop();
|
|
1931
2006
|
}
|
|
1932
|
-
},
|
|
2007
|
+
}, _callee20, this);
|
|
1933
2008
|
}));
|
|
1934
|
-
function submitSalesOrder(
|
|
2009
|
+
function submitSalesOrder(_x16) {
|
|
1935
2010
|
return _submitSalesOrder.apply(this, arguments);
|
|
1936
2011
|
}
|
|
1937
2012
|
return submitSalesOrder;
|
|
@@ -1939,14 +2014,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1939
2014
|
}, {
|
|
1940
2015
|
key: "printLocalOrderReceipt",
|
|
1941
2016
|
value: function () {
|
|
1942
|
-
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2017
|
+
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(lookup) {
|
|
1943
2018
|
var _this$otherParams10, _this$otherParams11, _this$otherParams12, _this$otherParams13;
|
|
1944
2019
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order3, _data;
|
|
1945
|
-
return _regeneratorRuntime().wrap(function
|
|
1946
|
-
while (1) switch (
|
|
2020
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2021
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1947
2022
|
case 0:
|
|
1948
2023
|
if (this.store.order) {
|
|
1949
|
-
|
|
2024
|
+
_context21.next = 2;
|
|
1950
2025
|
break;
|
|
1951
2026
|
}
|
|
1952
2027
|
throw new Error('BaseSales 解决方案需要 order 模块支持');
|
|
@@ -1977,28 +2052,28 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1977
2052
|
channel: context.channel,
|
|
1978
2053
|
type: context.type
|
|
1979
2054
|
});
|
|
1980
|
-
|
|
2055
|
+
_context21.next = 8;
|
|
1981
2056
|
return this.request.post('/local/print-order', payload, {
|
|
1982
2057
|
osServer: true,
|
|
1983
2058
|
customToast: function customToast() {}
|
|
1984
2059
|
});
|
|
1985
2060
|
case 8:
|
|
1986
|
-
response =
|
|
2061
|
+
response = _context21.sent;
|
|
1987
2062
|
if (hasLookup) {
|
|
1988
|
-
|
|
2063
|
+
_context21.next = 12;
|
|
1989
2064
|
break;
|
|
1990
2065
|
}
|
|
1991
|
-
|
|
2066
|
+
_context21.next = 12;
|
|
1992
2067
|
return (_this$store$order$app = (_this$store$order3 = this.store.order).applyLocalPrintOrderNumbers) === null || _this$store$order$app === void 0 ? void 0 : _this$store$order$app.call(_this$store$order3, response === null || response === void 0 || (_data = response.data) === null || _data === void 0 ? void 0 : _data.order);
|
|
1993
2068
|
case 12:
|
|
1994
|
-
return
|
|
2069
|
+
return _context21.abrupt("return", response);
|
|
1995
2070
|
case 13:
|
|
1996
2071
|
case "end":
|
|
1997
|
-
return
|
|
2072
|
+
return _context21.stop();
|
|
1998
2073
|
}
|
|
1999
|
-
},
|
|
2074
|
+
}, _callee21, this);
|
|
2000
2075
|
}));
|
|
2001
|
-
function printLocalOrderReceipt(
|
|
2076
|
+
function printLocalOrderReceipt(_x17) {
|
|
2002
2077
|
return _printLocalOrderReceipt.apply(this, arguments);
|
|
2003
2078
|
}
|
|
2004
2079
|
return printLocalOrderReceipt;
|
|
@@ -2019,19 +2094,19 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2019
2094
|
}, {
|
|
2020
2095
|
key: "syncPaymentsToOrder",
|
|
2021
2096
|
value: function () {
|
|
2022
|
-
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2023
|
-
var
|
|
2097
|
+
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
|
|
2098
|
+
var _ref12, _params$businessCode, _this$otherParams14, _this$otherParams15, _params$channel;
|
|
2024
2099
|
var businessCode, channel, syncParams, syncState, payments, syncResult;
|
|
2025
|
-
return _regeneratorRuntime().wrap(function
|
|
2026
|
-
while (1) switch (
|
|
2100
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2101
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
2027
2102
|
case 0:
|
|
2028
2103
|
if (this.store.order) {
|
|
2029
|
-
|
|
2104
|
+
_context22.next = 2;
|
|
2030
2105
|
break;
|
|
2031
2106
|
}
|
|
2032
2107
|
throw new Error('order 模块未初始化');
|
|
2033
2108
|
case 2:
|
|
2034
|
-
businessCode = (
|
|
2109
|
+
businessCode = (_ref12 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode) !== null && _ref12 !== void 0 ? _ref12 : (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.business_code;
|
|
2035
2110
|
channel = (_params$channel = params.channel) !== null && _params$channel !== void 0 ? _params$channel : this.getSubmitOrderSalesChannel();
|
|
2036
2111
|
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), businessCode !== undefined ? {
|
|
2037
2112
|
businessCode: businessCode
|
|
@@ -2040,13 +2115,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2040
2115
|
} : {});
|
|
2041
2116
|
syncState = this.store.order.getOrderSyncState();
|
|
2042
2117
|
if (!(params.submitWhenPaid && syncState === 'submitting')) {
|
|
2043
|
-
|
|
2118
|
+
_context22.next = 8;
|
|
2044
2119
|
break;
|
|
2045
2120
|
}
|
|
2046
|
-
return
|
|
2121
|
+
return _context22.abrupt("return", this.store.order.syncPaymentsToOrder(syncParams));
|
|
2047
2122
|
case 8:
|
|
2048
2123
|
payments = params.payments || [];
|
|
2049
|
-
|
|
2124
|
+
_context22.next = 11;
|
|
2050
2125
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncStart, {
|
|
2051
2126
|
payments: payments,
|
|
2052
2127
|
params: syncParams,
|
|
@@ -2054,12 +2129,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2054
2129
|
orderSnapshot: this.store.order.getOrderSnapshot()
|
|
2055
2130
|
});
|
|
2056
2131
|
case 11:
|
|
2057
|
-
|
|
2058
|
-
|
|
2132
|
+
_context22.prev = 11;
|
|
2133
|
+
_context22.next = 14;
|
|
2059
2134
|
return this.store.order.syncPaymentsToOrder(syncParams);
|
|
2060
2135
|
case 14:
|
|
2061
|
-
syncResult =
|
|
2062
|
-
|
|
2136
|
+
syncResult = _context22.sent;
|
|
2137
|
+
_context22.next = 17;
|
|
2063
2138
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, {
|
|
2064
2139
|
ok: true,
|
|
2065
2140
|
syncResult: syncResult,
|
|
@@ -2069,28 +2144,28 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2069
2144
|
orderSnapshot: this.store.order.getOrderSnapshot()
|
|
2070
2145
|
});
|
|
2071
2146
|
case 17:
|
|
2072
|
-
return
|
|
2147
|
+
return _context22.abrupt("return", syncResult);
|
|
2073
2148
|
case 20:
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2149
|
+
_context22.prev = 20;
|
|
2150
|
+
_context22.t0 = _context22["catch"](11);
|
|
2151
|
+
_context22.next = 24;
|
|
2077
2152
|
return this.effectsEmit(BaseSalesHookNames.onPaymentSyncEnd, {
|
|
2078
2153
|
ok: false,
|
|
2079
|
-
error:
|
|
2154
|
+
error: _context22.t0,
|
|
2080
2155
|
payments: this.store.order.getOrderPayments(),
|
|
2081
2156
|
params: syncParams,
|
|
2082
2157
|
amountSnapshot: this.store.order.getOrderAmountSnapshot(),
|
|
2083
2158
|
orderSnapshot: this.store.order.getOrderSnapshot()
|
|
2084
2159
|
});
|
|
2085
2160
|
case 24:
|
|
2086
|
-
throw
|
|
2161
|
+
throw _context22.t0;
|
|
2087
2162
|
case 25:
|
|
2088
2163
|
case "end":
|
|
2089
|
-
return
|
|
2164
|
+
return _context22.stop();
|
|
2090
2165
|
}
|
|
2091
|
-
},
|
|
2166
|
+
}, _callee22, this, [[11, 20]]);
|
|
2092
2167
|
}));
|
|
2093
|
-
function syncPaymentsToOrder(
|
|
2168
|
+
function syncPaymentsToOrder(_x18) {
|
|
2094
2169
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
2095
2170
|
}
|
|
2096
2171
|
return syncPaymentsToOrder;
|
|
@@ -2117,6 +2192,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2117
2192
|
value: function addOrderPayment(payment) {
|
|
2118
2193
|
var _this$otherParams16,
|
|
2119
2194
|
_paymentRecord$paymen,
|
|
2195
|
+
_paymentRecord$create,
|
|
2120
2196
|
_this7 = this;
|
|
2121
2197
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
2122
2198
|
var paymentRecord = payment;
|
|
@@ -2135,10 +2211,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2135
2211
|
if (!metadata.unique_payment_number) {
|
|
2136
2212
|
metadata.unique_payment_number = createUuidV4();
|
|
2137
2213
|
}
|
|
2138
|
-
var
|
|
2214
|
+
var paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
2215
|
+
var paymentTime = (_paymentRecord$paymen = paymentRecord.payment_time) !== null && _paymentRecord$paymen !== void 0 ? _paymentRecord$paymen : paymentTimestamp;
|
|
2216
|
+
var createdAt = (_paymentRecord$create = paymentRecord.created_at) !== null && _paymentRecord$create !== void 0 ? _paymentRecord$create : paymentTimestamp;
|
|
2139
2217
|
var payments = this.store.order.addOrderPayment(_objectSpread(_objectSpread({}, paymentRecord), {}, {
|
|
2140
2218
|
metadata: metadata,
|
|
2141
|
-
payment_time: paymentTime
|
|
2219
|
+
payment_time: paymentTime,
|
|
2220
|
+
created_at: createdAt
|
|
2142
2221
|
}));
|
|
2143
2222
|
var amountSnapshot = this.store.order.getOrderAmountSnapshot();
|
|
2144
2223
|
var syncState = this.store.order.getOrderSyncState();
|
|
@@ -2242,20 +2321,20 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2242
2321
|
}, {
|
|
2243
2322
|
key: "initWalletData",
|
|
2244
2323
|
value: function () {
|
|
2245
|
-
var _initWalletData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2246
|
-
var _params$order_wait_pa,
|
|
2324
|
+
var _initWalletData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
|
|
2325
|
+
var _params$order_wait_pa, _ref13, _tempOrder$is_price_i;
|
|
2247
2326
|
var snapshot, tempOrder, amount, walletBusinessData, result;
|
|
2248
|
-
return _regeneratorRuntime().wrap(function
|
|
2249
|
-
while (1) switch (
|
|
2327
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2328
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2250
2329
|
case 0:
|
|
2251
2330
|
if (this.store.order) {
|
|
2252
|
-
|
|
2331
|
+
_context23.next = 2;
|
|
2253
2332
|
break;
|
|
2254
2333
|
}
|
|
2255
2334
|
throw new Error('order 模块未初始化');
|
|
2256
2335
|
case 2:
|
|
2257
2336
|
if (this.store.payment) {
|
|
2258
|
-
|
|
2337
|
+
_context23.next = 4;
|
|
2259
2338
|
break;
|
|
2260
2339
|
}
|
|
2261
2340
|
throw new Error('payment 模块未初始化');
|
|
@@ -2264,10 +2343,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2264
2343
|
tempOrder = snapshot === null || snapshot === void 0 ? void 0 : snapshot.tempOrder;
|
|
2265
2344
|
amount = snapshot === null || snapshot === void 0 ? void 0 : snapshot.amount;
|
|
2266
2345
|
if (!(!tempOrder || !amount)) {
|
|
2267
|
-
|
|
2346
|
+
_context23.next = 9;
|
|
2268
2347
|
break;
|
|
2269
2348
|
}
|
|
2270
|
-
return
|
|
2349
|
+
return _context23.abrupt("return", {
|
|
2271
2350
|
walletRecommendList: [],
|
|
2272
2351
|
userIdentificationCodes: [],
|
|
2273
2352
|
transformList: [],
|
|
@@ -2286,15 +2365,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2286
2365
|
},
|
|
2287
2366
|
products: this.getWalletProductList(),
|
|
2288
2367
|
order_wait_pay_amount: (_params$order_wait_pa = params === null || params === void 0 ? void 0 : params.order_wait_pay_amount) !== null && _params$order_wait_pa !== void 0 ? _params$order_wait_pa : Number(amount.amountGap || 0),
|
|
2289
|
-
is_price_include_tax: (
|
|
2368
|
+
is_price_include_tax: (_ref13 = (_tempOrder$is_price_i = tempOrder.is_price_include_tax) !== null && _tempOrder$is_price_i !== void 0 ? _tempOrder$is_price_i : this.otherParams.is_price_include_tax) !== null && _ref13 !== void 0 ? _ref13 : 1
|
|
2290
2369
|
}, snapshot.identity.orderId ? {
|
|
2291
2370
|
payment_order_id: String(snapshot.identity.orderId)
|
|
2292
2371
|
} : {});
|
|
2293
|
-
|
|
2372
|
+
_context23.next = 12;
|
|
2294
2373
|
return this.store.payment.wallet.initializeWalletDataFromBusinessAsync(walletBusinessData);
|
|
2295
2374
|
case 12:
|
|
2296
|
-
result =
|
|
2297
|
-
|
|
2375
|
+
result = _context23.sent;
|
|
2376
|
+
_context23.next = 15;
|
|
2298
2377
|
return this.core.effects.emit("".concat(this.name, ":onWalletDataInitialized"), {
|
|
2299
2378
|
orderId: snapshot.identity.orderId,
|
|
2300
2379
|
customerId: walletBusinessData.customer_id,
|
|
@@ -2306,14 +2385,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2306
2385
|
timestamp: Date.now()
|
|
2307
2386
|
});
|
|
2308
2387
|
case 15:
|
|
2309
|
-
return
|
|
2388
|
+
return _context23.abrupt("return", result);
|
|
2310
2389
|
case 16:
|
|
2311
2390
|
case "end":
|
|
2312
|
-
return
|
|
2391
|
+
return _context23.stop();
|
|
2313
2392
|
}
|
|
2314
|
-
},
|
|
2393
|
+
}, _callee23, this);
|
|
2315
2394
|
}));
|
|
2316
|
-
function initWalletData(
|
|
2395
|
+
function initWalletData(_x19) {
|
|
2317
2396
|
return _initWalletData.apply(this, arguments);
|
|
2318
2397
|
}
|
|
2319
2398
|
return initWalletData;
|
|
@@ -2340,35 +2419,35 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2340
2419
|
}, {
|
|
2341
2420
|
key: "getPaymentMethodsAsync",
|
|
2342
2421
|
value: (function () {
|
|
2343
|
-
var _getPaymentMethodsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2422
|
+
var _getPaymentMethodsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
2344
2423
|
var response, paymentMethods;
|
|
2345
|
-
return _regeneratorRuntime().wrap(function
|
|
2346
|
-
while (1) switch (
|
|
2424
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2425
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
2347
2426
|
case 0:
|
|
2348
|
-
|
|
2349
|
-
|
|
2427
|
+
_context24.prev = 0;
|
|
2428
|
+
_context24.next = 3;
|
|
2350
2429
|
return this.request.get('/pay/custom-payment/all', {
|
|
2351
2430
|
filterPaymentMethods: true
|
|
2352
2431
|
}, {
|
|
2353
2432
|
osServer: true
|
|
2354
2433
|
});
|
|
2355
2434
|
case 3:
|
|
2356
|
-
response =
|
|
2435
|
+
response = _context24.sent;
|
|
2357
2436
|
paymentMethods = (response === null || response === void 0 ? void 0 : response.data) || [];
|
|
2358
2437
|
this.paymentMethodsCache = Array.isArray(paymentMethods) ? _toConsumableArray(paymentMethods) : [];
|
|
2359
|
-
return
|
|
2438
|
+
return _context24.abrupt("return", this.getPaymentMethods());
|
|
2360
2439
|
case 9:
|
|
2361
|
-
|
|
2362
|
-
|
|
2440
|
+
_context24.prev = 9;
|
|
2441
|
+
_context24.t0 = _context24["catch"](0);
|
|
2363
2442
|
this.logWarning('getPaymentMethodsAsync: 获取支付方式列表失败,使用缓存列表', {
|
|
2364
|
-
error:
|
|
2443
|
+
error: _context24.t0 instanceof Error ? _context24.t0.message : String(_context24.t0)
|
|
2365
2444
|
});
|
|
2366
|
-
return
|
|
2445
|
+
return _context24.abrupt("return", this.getPaymentMethods());
|
|
2367
2446
|
case 13:
|
|
2368
2447
|
case "end":
|
|
2369
|
-
return
|
|
2448
|
+
return _context24.stop();
|
|
2370
2449
|
}
|
|
2371
|
-
},
|
|
2450
|
+
}, _callee24, this, [[0, 9]]);
|
|
2372
2451
|
}));
|
|
2373
2452
|
function getPaymentMethodsAsync() {
|
|
2374
2453
|
return _getPaymentMethodsAsync.apply(this, arguments);
|
|
@@ -2416,49 +2495,49 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2416
2495
|
}, {
|
|
2417
2496
|
key: "sendCustomerPayLink",
|
|
2418
2497
|
value: (function () {
|
|
2419
|
-
var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2420
|
-
var orderIds,
|
|
2421
|
-
return _regeneratorRuntime().wrap(function
|
|
2422
|
-
while (1) switch (
|
|
2498
|
+
var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(params) {
|
|
2499
|
+
var orderIds, _ref14, _ref15, _submitResult$data$or, _submitResult$data, _submitResult$data2, submitResult, orderId;
|
|
2500
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2501
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2423
2502
|
case 0:
|
|
2424
2503
|
if (this.store.order) {
|
|
2425
|
-
|
|
2504
|
+
_context25.next = 2;
|
|
2426
2505
|
break;
|
|
2427
2506
|
}
|
|
2428
2507
|
throw new Error('order 模块未初始化');
|
|
2429
2508
|
case 2:
|
|
2430
2509
|
orderIds = params.order_ids || params.orderIds || [];
|
|
2431
2510
|
if (!(!orderIds.length || params.submitBeforeSend)) {
|
|
2432
|
-
|
|
2511
|
+
_context25.next = 11;
|
|
2433
2512
|
break;
|
|
2434
2513
|
}
|
|
2435
|
-
|
|
2514
|
+
_context25.next = 6;
|
|
2436
2515
|
return this.submitSalesOrder({
|
|
2437
2516
|
smallTicketDataFlag: 1
|
|
2438
2517
|
});
|
|
2439
2518
|
case 6:
|
|
2440
|
-
submitResult =
|
|
2441
|
-
orderId = (
|
|
2519
|
+
submitResult = _context25.sent;
|
|
2520
|
+
orderId = (_ref14 = (_ref15 = (_submitResult$data$or = submitResult === null || submitResult === void 0 || (_submitResult$data = submitResult.data) === null || _submitResult$data === void 0 ? void 0 : _submitResult$data.order_id) !== null && _submitResult$data$or !== void 0 ? _submitResult$data$or : submitResult === null || submitResult === void 0 ? void 0 : submitResult.order_id) !== null && _ref15 !== void 0 ? _ref15 : submitResult === null || submitResult === void 0 || (_submitResult$data2 = submitResult.data) === null || _submitResult$data2 === void 0 ? void 0 : _submitResult$data2.id) !== null && _ref14 !== void 0 ? _ref14 : submitResult === null || submitResult === void 0 ? void 0 : submitResult.id;
|
|
2442
2521
|
if (orderId) {
|
|
2443
|
-
|
|
2522
|
+
_context25.next = 10;
|
|
2444
2523
|
break;
|
|
2445
2524
|
}
|
|
2446
2525
|
throw new Error('本地订单提交云端失败,无法发送支付链接');
|
|
2447
2526
|
case 10:
|
|
2448
2527
|
orderIds = [orderId];
|
|
2449
2528
|
case 11:
|
|
2450
|
-
return
|
|
2529
|
+
return _context25.abrupt("return", this.store.order.sendCustomerPayLink({
|
|
2451
2530
|
emails: params.emails,
|
|
2452
2531
|
notify_action: params.notify_action,
|
|
2453
2532
|
order_ids: orderIds
|
|
2454
2533
|
}));
|
|
2455
2534
|
case 12:
|
|
2456
2535
|
case "end":
|
|
2457
|
-
return
|
|
2536
|
+
return _context25.stop();
|
|
2458
2537
|
}
|
|
2459
|
-
},
|
|
2538
|
+
}, _callee25, this);
|
|
2460
2539
|
}));
|
|
2461
|
-
function sendCustomerPayLink(
|
|
2540
|
+
function sendCustomerPayLink(_x20) {
|
|
2462
2541
|
return _sendCustomerPayLink.apply(this, arguments);
|
|
2463
2542
|
}
|
|
2464
2543
|
return sendCustomerPayLink;
|
|
@@ -2471,27 +2550,27 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2471
2550
|
}, {
|
|
2472
2551
|
key: "calculateProductBookingPrice",
|
|
2473
2552
|
value: function () {
|
|
2474
|
-
var _calculateProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2553
|
+
var _calculateProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
|
|
2475
2554
|
var _params$customer_id;
|
|
2476
2555
|
var quotation, customerId, authoritativeProduct, product;
|
|
2477
|
-
return _regeneratorRuntime().wrap(function
|
|
2478
|
-
while (1) switch (
|
|
2556
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2557
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2479
2558
|
case 0:
|
|
2480
2559
|
quotation = this.store.quotation;
|
|
2481
2560
|
customerId = (_params$customer_id = params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.getCurrentOrderCustomerId();
|
|
2482
|
-
|
|
2561
|
+
_context26.next = 4;
|
|
2483
2562
|
return this.loadProductForPriceQuery(params, customerId);
|
|
2484
2563
|
case 4:
|
|
2485
|
-
authoritativeProduct =
|
|
2564
|
+
authoritativeProduct = _context26.sent;
|
|
2486
2565
|
product = this.mergeProductForPriceQuery(params.product, authoritativeProduct);
|
|
2487
|
-
|
|
2566
|
+
_context26.next = 8;
|
|
2488
2567
|
return this.loadQuotationForPriceQuery({
|
|
2489
2568
|
quotation: quotation,
|
|
2490
2569
|
customer_id: customerId,
|
|
2491
2570
|
channel: params.channel
|
|
2492
2571
|
});
|
|
2493
2572
|
case 8:
|
|
2494
|
-
return
|
|
2573
|
+
return _context26.abrupt("return", calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
|
|
2495
2574
|
product: product,
|
|
2496
2575
|
fallback_price: authoritativeProduct ? undefined : params.fallback_price,
|
|
2497
2576
|
customer_id: customerId,
|
|
@@ -2499,11 +2578,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2499
2578
|
})));
|
|
2500
2579
|
case 9:
|
|
2501
2580
|
case "end":
|
|
2502
|
-
return
|
|
2581
|
+
return _context26.stop();
|
|
2503
2582
|
}
|
|
2504
|
-
},
|
|
2583
|
+
}, _callee26, this);
|
|
2505
2584
|
}));
|
|
2506
|
-
function calculateProductBookingPrice(
|
|
2585
|
+
function calculateProductBookingPrice(_x21) {
|
|
2507
2586
|
return _calculateProductBookingPrice.apply(this, arguments);
|
|
2508
2587
|
}
|
|
2509
2588
|
return calculateProductBookingPrice;
|
|
@@ -2511,34 +2590,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2511
2590
|
}, {
|
|
2512
2591
|
key: "addProductToOrder",
|
|
2513
2592
|
value: function () {
|
|
2514
|
-
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2593
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(product, booking) {
|
|
2515
2594
|
var products;
|
|
2516
|
-
return _regeneratorRuntime().wrap(function
|
|
2517
|
-
while (1) switch (
|
|
2595
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2596
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2518
2597
|
case 0:
|
|
2519
|
-
|
|
2598
|
+
_context27.prev = 0;
|
|
2520
2599
|
if (this.store.order) {
|
|
2521
|
-
|
|
2600
|
+
_context27.next = 3;
|
|
2522
2601
|
break;
|
|
2523
2602
|
}
|
|
2524
2603
|
throw new Error('order 模块未初始化');
|
|
2525
2604
|
case 3:
|
|
2526
|
-
|
|
2605
|
+
_context27.next = 5;
|
|
2527
2606
|
return this.store.order.addProductToOrder(product, booking);
|
|
2528
2607
|
case 5:
|
|
2529
|
-
products =
|
|
2530
|
-
return
|
|
2608
|
+
products = _context27.sent;
|
|
2609
|
+
return _context27.abrupt("return", products);
|
|
2531
2610
|
case 9:
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
throw
|
|
2611
|
+
_context27.prev = 9;
|
|
2612
|
+
_context27.t0 = _context27["catch"](0);
|
|
2613
|
+
throw _context27.t0;
|
|
2535
2614
|
case 12:
|
|
2536
2615
|
case "end":
|
|
2537
|
-
return
|
|
2616
|
+
return _context27.stop();
|
|
2538
2617
|
}
|
|
2539
|
-
},
|
|
2618
|
+
}, _callee27, this, [[0, 9]]);
|
|
2540
2619
|
}));
|
|
2541
|
-
function addProductToOrder(
|
|
2620
|
+
function addProductToOrder(_x22, _x23) {
|
|
2542
2621
|
return _addProductToOrder.apply(this, arguments);
|
|
2543
2622
|
}
|
|
2544
2623
|
return addProductToOrder;
|
|
@@ -2546,34 +2625,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2546
2625
|
}, {
|
|
2547
2626
|
key: "updateOrderProduct",
|
|
2548
2627
|
value: function () {
|
|
2549
|
-
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2628
|
+
var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
2550
2629
|
var products;
|
|
2551
|
-
return _regeneratorRuntime().wrap(function
|
|
2552
|
-
while (1) switch (
|
|
2630
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2631
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2553
2632
|
case 0:
|
|
2554
|
-
|
|
2633
|
+
_context28.prev = 0;
|
|
2555
2634
|
if (this.store.order) {
|
|
2556
|
-
|
|
2635
|
+
_context28.next = 3;
|
|
2557
2636
|
break;
|
|
2558
2637
|
}
|
|
2559
2638
|
throw new Error('order 模块未初始化');
|
|
2560
2639
|
case 3:
|
|
2561
|
-
|
|
2640
|
+
_context28.next = 5;
|
|
2562
2641
|
return this.store.order.updateOrderProduct(params);
|
|
2563
2642
|
case 5:
|
|
2564
|
-
products =
|
|
2565
|
-
return
|
|
2643
|
+
products = _context28.sent;
|
|
2644
|
+
return _context28.abrupt("return", products);
|
|
2566
2645
|
case 9:
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
throw
|
|
2646
|
+
_context28.prev = 9;
|
|
2647
|
+
_context28.t0 = _context28["catch"](0);
|
|
2648
|
+
throw _context28.t0;
|
|
2570
2649
|
case 12:
|
|
2571
2650
|
case "end":
|
|
2572
|
-
return
|
|
2651
|
+
return _context28.stop();
|
|
2573
2652
|
}
|
|
2574
|
-
},
|
|
2653
|
+
}, _callee28, this, [[0, 9]]);
|
|
2575
2654
|
}));
|
|
2576
|
-
function updateOrderProduct(
|
|
2655
|
+
function updateOrderProduct(_x24) {
|
|
2577
2656
|
return _updateOrderProduct.apply(this, arguments);
|
|
2578
2657
|
}
|
|
2579
2658
|
return updateOrderProduct;
|
|
@@ -2581,34 +2660,34 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2581
2660
|
}, {
|
|
2582
2661
|
key: "updateOrderProductQuantity",
|
|
2583
2662
|
value: function () {
|
|
2584
|
-
var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2663
|
+
var _updateOrderProductQuantity = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
2585
2664
|
var products;
|
|
2586
|
-
return _regeneratorRuntime().wrap(function
|
|
2587
|
-
while (1) switch (
|
|
2665
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2666
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2588
2667
|
case 0:
|
|
2589
|
-
|
|
2668
|
+
_context29.prev = 0;
|
|
2590
2669
|
if (this.store.order) {
|
|
2591
|
-
|
|
2670
|
+
_context29.next = 3;
|
|
2592
2671
|
break;
|
|
2593
2672
|
}
|
|
2594
2673
|
throw new Error('order 模块未初始化');
|
|
2595
2674
|
case 3:
|
|
2596
|
-
|
|
2675
|
+
_context29.next = 5;
|
|
2597
2676
|
return this.store.order.updateOrderProductQuantity(params);
|
|
2598
2677
|
case 5:
|
|
2599
|
-
products =
|
|
2600
|
-
return
|
|
2678
|
+
products = _context29.sent;
|
|
2679
|
+
return _context29.abrupt("return", products);
|
|
2601
2680
|
case 9:
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
throw
|
|
2681
|
+
_context29.prev = 9;
|
|
2682
|
+
_context29.t0 = _context29["catch"](0);
|
|
2683
|
+
throw _context29.t0;
|
|
2605
2684
|
case 12:
|
|
2606
2685
|
case "end":
|
|
2607
|
-
return
|
|
2686
|
+
return _context29.stop();
|
|
2608
2687
|
}
|
|
2609
|
-
},
|
|
2688
|
+
}, _callee29, this, [[0, 9]]);
|
|
2610
2689
|
}));
|
|
2611
|
-
function updateOrderProductQuantity(
|
|
2690
|
+
function updateOrderProductQuantity(_x25) {
|
|
2612
2691
|
return _updateOrderProductQuantity.apply(this, arguments);
|
|
2613
2692
|
}
|
|
2614
2693
|
return updateOrderProductQuantity;
|
|
@@ -2631,12 +2710,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2631
2710
|
}, {
|
|
2632
2711
|
key: "setOrderProductLineNote",
|
|
2633
2712
|
value: (function () {
|
|
2634
|
-
var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2713
|
+
var _setOrderProductLineNote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(identity, note) {
|
|
2635
2714
|
var params, products;
|
|
2636
|
-
return _regeneratorRuntime().wrap(function
|
|
2637
|
-
while (1) switch (
|
|
2715
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2716
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2638
2717
|
case 0:
|
|
2639
|
-
|
|
2718
|
+
_context30.prev = 0;
|
|
2640
2719
|
params = {
|
|
2641
2720
|
product_id: identity.product_id,
|
|
2642
2721
|
product_variant_id: identity.product_variant_id,
|
|
@@ -2651,22 +2730,22 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2651
2730
|
params.product_sku = identity.product_sku;
|
|
2652
2731
|
}
|
|
2653
2732
|
if (identity.product_bundle !== undefined) params.product_bundle = identity.product_bundle;
|
|
2654
|
-
|
|
2733
|
+
_context30.next = 7;
|
|
2655
2734
|
return this.updateOrderProduct(params);
|
|
2656
2735
|
case 7:
|
|
2657
|
-
products =
|
|
2658
|
-
return
|
|
2736
|
+
products = _context30.sent;
|
|
2737
|
+
return _context30.abrupt("return", products);
|
|
2659
2738
|
case 11:
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
throw
|
|
2739
|
+
_context30.prev = 11;
|
|
2740
|
+
_context30.t0 = _context30["catch"](0);
|
|
2741
|
+
throw _context30.t0;
|
|
2663
2742
|
case 14:
|
|
2664
2743
|
case "end":
|
|
2665
|
-
return
|
|
2744
|
+
return _context30.stop();
|
|
2666
2745
|
}
|
|
2667
|
-
},
|
|
2746
|
+
}, _callee30, this, [[0, 11]]);
|
|
2668
2747
|
}));
|
|
2669
|
-
function setOrderProductLineNote(
|
|
2748
|
+
function setOrderProductLineNote(_x26, _x27) {
|
|
2670
2749
|
return _setOrderProductLineNote.apply(this, arguments);
|
|
2671
2750
|
}
|
|
2672
2751
|
return setOrderProductLineNote;
|
|
@@ -2681,32 +2760,32 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2681
2760
|
}, {
|
|
2682
2761
|
key: "removeProductsFromOrder",
|
|
2683
2762
|
value: (function () {
|
|
2684
|
-
var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2685
|
-
return _regeneratorRuntime().wrap(function
|
|
2686
|
-
while (1) switch (
|
|
2763
|
+
var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(identities) {
|
|
2764
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2765
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2687
2766
|
case 0:
|
|
2688
|
-
|
|
2767
|
+
_context31.prev = 0;
|
|
2689
2768
|
if (this.store.order) {
|
|
2690
|
-
|
|
2769
|
+
_context31.next = 3;
|
|
2691
2770
|
break;
|
|
2692
2771
|
}
|
|
2693
2772
|
throw new Error('order 模块未初始化');
|
|
2694
2773
|
case 3:
|
|
2695
|
-
|
|
2774
|
+
_context31.next = 5;
|
|
2696
2775
|
return this.store.order.removeProductsFromOrder(identities);
|
|
2697
2776
|
case 5:
|
|
2698
|
-
return
|
|
2777
|
+
return _context31.abrupt("return", _context31.sent);
|
|
2699
2778
|
case 8:
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
throw
|
|
2779
|
+
_context31.prev = 8;
|
|
2780
|
+
_context31.t0 = _context31["catch"](0);
|
|
2781
|
+
throw _context31.t0;
|
|
2703
2782
|
case 11:
|
|
2704
2783
|
case "end":
|
|
2705
|
-
return
|
|
2784
|
+
return _context31.stop();
|
|
2706
2785
|
}
|
|
2707
|
-
},
|
|
2786
|
+
}, _callee31, this, [[0, 8]]);
|
|
2708
2787
|
}));
|
|
2709
|
-
function removeProductsFromOrder(
|
|
2788
|
+
function removeProductsFromOrder(_x28) {
|
|
2710
2789
|
return _removeProductsFromOrder.apply(this, arguments);
|
|
2711
2790
|
}
|
|
2712
2791
|
return removeProductsFromOrder;
|
|
@@ -2714,18 +2793,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2714
2793
|
}, {
|
|
2715
2794
|
key: "removeProductFromOrder",
|
|
2716
2795
|
value: function () {
|
|
2717
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2718
|
-
return _regeneratorRuntime().wrap(function
|
|
2719
|
-
while (1) switch (
|
|
2796
|
+
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(identity) {
|
|
2797
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2798
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2720
2799
|
case 0:
|
|
2721
|
-
return
|
|
2800
|
+
return _context32.abrupt("return", this.removeProductsFromOrder([identity]));
|
|
2722
2801
|
case 1:
|
|
2723
2802
|
case "end":
|
|
2724
|
-
return
|
|
2803
|
+
return _context32.stop();
|
|
2725
2804
|
}
|
|
2726
|
-
},
|
|
2805
|
+
}, _callee32, this);
|
|
2727
2806
|
}));
|
|
2728
|
-
function removeProductFromOrder(
|
|
2807
|
+
function removeProductFromOrder(_x29) {
|
|
2729
2808
|
return _removeProductFromOrder.apply(this, arguments);
|
|
2730
2809
|
}
|
|
2731
2810
|
return removeProductFromOrder;
|
|
@@ -2775,23 +2854,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2775
2854
|
}, {
|
|
2776
2855
|
key: "applyPromotion",
|
|
2777
2856
|
value: (function () {
|
|
2778
|
-
var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2779
|
-
return _regeneratorRuntime().wrap(function
|
|
2780
|
-
while (1) switch (
|
|
2857
|
+
var _applyPromotion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
|
|
2858
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2859
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2781
2860
|
case 0:
|
|
2782
2861
|
if (this.store.order) {
|
|
2783
|
-
|
|
2862
|
+
_context33.next = 2;
|
|
2784
2863
|
break;
|
|
2785
2864
|
}
|
|
2786
2865
|
throw new Error('order 模块未初始化');
|
|
2787
2866
|
case 2:
|
|
2788
|
-
|
|
2867
|
+
_context33.next = 4;
|
|
2789
2868
|
return this.store.order.applyPromotion();
|
|
2790
2869
|
case 4:
|
|
2791
2870
|
case "end":
|
|
2792
|
-
return
|
|
2871
|
+
return _context33.stop();
|
|
2793
2872
|
}
|
|
2794
|
-
},
|
|
2873
|
+
}, _callee33, this);
|
|
2795
2874
|
}));
|
|
2796
2875
|
function applyPromotion() {
|
|
2797
2876
|
return _applyPromotion.apply(this, arguments);
|
|
@@ -2818,18 +2897,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2818
2897
|
}, {
|
|
2819
2898
|
key: "getProductList",
|
|
2820
2899
|
value: function () {
|
|
2821
|
-
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2900
|
+
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2822
2901
|
var _this$otherParams17;
|
|
2823
2902
|
var menu_list_ids, _this$store$products, res;
|
|
2824
|
-
return _regeneratorRuntime().wrap(function
|
|
2825
|
-
while (1) switch (
|
|
2903
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2904
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2826
2905
|
case 0:
|
|
2827
2906
|
// 可以直接通过配置里的 menu 读取
|
|
2828
2907
|
menu_list_ids = ((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 || (_this$otherParams17 = _this$otherParams17.dineInConfig) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17['menu.associated_menus'].map(function (n) {
|
|
2829
2908
|
return Number(n.value);
|
|
2830
2909
|
})) || [];
|
|
2831
|
-
|
|
2832
|
-
|
|
2910
|
+
_context34.prev = 1;
|
|
2911
|
+
_context34.next = 4;
|
|
2833
2912
|
return (_this$store$products = this.store.products) === null || _this$store$products === void 0 ? void 0 : _this$store$products.loadProducts({
|
|
2834
2913
|
menu_list_ids: menu_list_ids,
|
|
2835
2914
|
cacheId: this.cacheId,
|
|
@@ -2837,17 +2916,17 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2837
2916
|
schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
2838
2917
|
});
|
|
2839
2918
|
case 4:
|
|
2840
|
-
res =
|
|
2841
|
-
return
|
|
2919
|
+
res = _context34.sent;
|
|
2920
|
+
return _context34.abrupt("return", res);
|
|
2842
2921
|
case 8:
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
throw
|
|
2922
|
+
_context34.prev = 8;
|
|
2923
|
+
_context34.t0 = _context34["catch"](1);
|
|
2924
|
+
throw _context34.t0;
|
|
2846
2925
|
case 11:
|
|
2847
2926
|
case "end":
|
|
2848
|
-
return
|
|
2927
|
+
return _context34.stop();
|
|
2849
2928
|
}
|
|
2850
|
-
},
|
|
2929
|
+
}, _callee34, this, [[1, 8]]);
|
|
2851
2930
|
}));
|
|
2852
2931
|
function getProductList() {
|
|
2853
2932
|
return _getProductList.apply(this, arguments);
|
|
@@ -2862,27 +2941,33 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2862
2941
|
}, {
|
|
2863
2942
|
key: "setOtherParams",
|
|
2864
2943
|
value: function () {
|
|
2865
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2866
|
-
var
|
|
2867
|
-
|
|
2944
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(params) {
|
|
2945
|
+
var _this$otherParams18;
|
|
2946
|
+
var _ref16,
|
|
2947
|
+
_ref16$cover,
|
|
2868
2948
|
cover,
|
|
2869
|
-
|
|
2870
|
-
return _regeneratorRuntime().wrap(function
|
|
2871
|
-
while (1) switch (
|
|
2949
|
+
_args35 = arguments;
|
|
2950
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2951
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2872
2952
|
case 0:
|
|
2873
|
-
|
|
2953
|
+
_ref16 = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : {}, _ref16$cover = _ref16.cover, cover = _ref16$cover === void 0 ? false : _ref16$cover;
|
|
2874
2954
|
if (cover) {
|
|
2875
|
-
this.otherParams = params;
|
|
2955
|
+
this.otherParams = _objectSpread({}, params);
|
|
2876
2956
|
} else {
|
|
2877
2957
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
2878
2958
|
}
|
|
2879
|
-
|
|
2959
|
+
this.cacheId = (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.cacheId;
|
|
2960
|
+
_context35.next = 5;
|
|
2961
|
+
return this.syncOtherParamsToSubModules(params, {
|
|
2962
|
+
cover: cover
|
|
2963
|
+
});
|
|
2964
|
+
case 5:
|
|
2880
2965
|
case "end":
|
|
2881
|
-
return
|
|
2966
|
+
return _context35.stop();
|
|
2882
2967
|
}
|
|
2883
|
-
},
|
|
2968
|
+
}, _callee35, this);
|
|
2884
2969
|
}));
|
|
2885
|
-
function setOtherParams(
|
|
2970
|
+
function setOtherParams(_x30) {
|
|
2886
2971
|
return _setOtherParams.apply(this, arguments);
|
|
2887
2972
|
}
|
|
2888
2973
|
return setOtherParams;
|