@pisell/pisellos 2.2.164 → 2.2.165
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/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +45 -15
- package/dist/modules/Order/index.d.ts +10 -3
- package/dist/modules/Order/index.js +272 -142
- package/dist/modules/Order/types.d.ts +14 -2
- package/dist/modules/Order/types.js +2 -0
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +67 -15
- package/dist/server/index.js +1 -0
- package/dist/solution/BaseSales/index.d.ts +9 -1
- package/dist/solution/BaseSales/index.js +369 -240
- package/dist/solution/BaseSales/types.d.ts +3 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +33 -14
- package/dist/solution/BaseSales/utils.js +36 -7
- package/dist/solution/BookingTicket/index.d.ts +3 -0
- package/dist/solution/BookingTicket/index.js +155 -86
- package/dist/solution/BookingTicket/utils/addProductDecision.js +19 -11
- package/dist/solution/ScanOrder/utils.js +36 -7
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +35 -9
- package/lib/modules/Order/index.d.ts +10 -3
- package/lib/modules/Order/index.js +104 -4
- package/lib/modules/Order/types.d.ts +14 -2
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +58 -9
- package/lib/server/index.js +1 -0
- package/lib/solution/BaseSales/index.d.ts +9 -1
- package/lib/solution/BaseSales/index.js +65 -3
- package/lib/solution/BaseSales/types.d.ts +3 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +31 -10
- package/lib/solution/BaseSales/utils.js +37 -5
- package/lib/solution/BookingTicket/index.d.ts +3 -0
- package/lib/solution/BookingTicket/index.js +48 -6
- package/lib/solution/BookingTicket/utils/addProductDecision.js +16 -8
- package/lib/solution/ScanOrder/utils.js +37 -5
- package/package.json +1 -1
|
@@ -42,6 +42,9 @@ export interface BaseSalesOrderProductIdentity {
|
|
|
42
42
|
product_option_item?: any[];
|
|
43
43
|
product_bundle?: any[];
|
|
44
44
|
}
|
|
45
|
+
export interface BaseSalesUpdateOrderProductQuantityParams extends BaseSalesOrderProductIdentity {
|
|
46
|
+
num: number;
|
|
47
|
+
}
|
|
45
48
|
export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
46
49
|
order_detail_id: number | null;
|
|
47
50
|
num: number;
|
|
@@ -43,9 +43,19 @@ function normalizeOptionItems(optionItems) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function normalizeBundleItems(bundleItems) {
|
|
46
|
+
var preferPriceField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
46
47
|
if (!Array.isArray(bundleItems)) return [];
|
|
47
48
|
return bundleItems.map(function (bundleItem) {
|
|
49
|
+
var _ref2, _ref3, _ref4, _bundleItem$price, _ref5, _ref6, _ref7, _bundleItem$bundle_se, _bundleItem$num, _bundleItem$quantity, _bundleItem$price2, _ref8, _ref9, _bundleItem$original_;
|
|
50
|
+
var unitSelling = preferPriceField ? (_ref2 = (_ref3 = (_ref4 = (_bundleItem$price = bundleItem.price) !== null && _bundleItem$price !== void 0 ? _bundleItem$price : bundleItem.bundle_selling_price) !== null && _ref4 !== void 0 ? _ref4 : bundleItem.custom_price) !== null && _ref3 !== void 0 ? _ref3 : bundleItem.product_price) !== null && _ref2 !== void 0 ? _ref2 : '0' : (_ref5 = (_ref6 = (_ref7 = (_bundleItem$bundle_se = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se !== void 0 ? _bundleItem$bundle_se : bundleItem.price) !== null && _ref7 !== void 0 ? _ref7 : bundleItem.custom_price) !== null && _ref6 !== void 0 ? _ref6 : bundleItem.product_price) !== null && _ref5 !== void 0 ? _ref5 : '0';
|
|
51
|
+
var unitStr = toPriceString(unitSelling, '0.00');
|
|
52
|
+
var num = toSafePositiveInt((_bundleItem$num = bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.num) !== null && _bundleItem$num !== void 0 ? _bundleItem$num : bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.quantity, 1);
|
|
48
53
|
return _objectSpread(_objectSpread({}, bundleItem), {}, {
|
|
54
|
+
num: num,
|
|
55
|
+
quantity: (_bundleItem$quantity = bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.quantity) !== null && _bundleItem$quantity !== void 0 ? _bundleItem$quantity : num,
|
|
56
|
+
price: (_bundleItem$price2 = bundleItem.price) !== null && _bundleItem$price2 !== void 0 ? _bundleItem$price2 : unitStr,
|
|
57
|
+
bundle_selling_price: unitStr,
|
|
58
|
+
original_price: (_ref8 = (_ref9 = (_bundleItem$original_ = bundleItem.original_price) !== null && _bundleItem$original_ !== void 0 ? _bundleItem$original_ : bundleItem.product_price) !== null && _ref9 !== void 0 ? _ref9 : bundleItem.price) !== null && _ref8 !== void 0 ? _ref8 : unitStr,
|
|
49
59
|
option: normalizeOptionItems(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option)
|
|
50
60
|
});
|
|
51
61
|
});
|
|
@@ -64,23 +74,25 @@ function findVariantById(origin, variantId) {
|
|
|
64
74
|
* 注意:这里不生成 identity,缺省时由 OrderModule 自动补齐。
|
|
65
75
|
*/
|
|
66
76
|
export function transformBaseProductToOrderProduct(params) {
|
|
67
|
-
var
|
|
77
|
+
var _ref10, _ref11, _ref12, _payload$product_id, _ref13, _ref14, _payload$product_vari, _payload$_origin, _payload$_origin2, _ref15, _findVariantById, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _payload$price, _ref23, _payload$line_total, _payload$_extend, _ref24, _payload$option, _payload$bundle, _payload$unique_ident, _payload$quantity, _ref25, _ref26, _payload$tax_fee, _ref27, _ref28, _payload$is_charge_ta;
|
|
68
78
|
var payload = params.payload,
|
|
69
79
|
_params$fallbackProdu = params.fallbackProductId,
|
|
70
80
|
fallbackProductId = _params$fallbackProdu === void 0 ? null : _params$fallbackProdu;
|
|
71
81
|
if (!payload || _typeof(payload) !== 'object') return null;
|
|
72
82
|
var sourceProduct = params.sourceProduct || params.sourceItem || {};
|
|
73
|
-
var productId = toProductId((
|
|
83
|
+
var productId = toProductId((_ref10 = (_ref11 = (_ref12 = (_payload$product_id = payload.product_id) !== null && _payload$product_id !== void 0 ? _payload$product_id : payload.id) !== null && _ref12 !== void 0 ? _ref12 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.product_id) !== null && _ref11 !== void 0 ? _ref11 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.id) !== null && _ref10 !== void 0 ? _ref10 : fallbackProductId);
|
|
74
84
|
if (productId === null) return null;
|
|
75
|
-
var productVariantId = toNumber((
|
|
85
|
+
var productVariantId = toNumber((_ref13 = (_ref14 = (_payload$product_vari = payload.product_variant_id) !== null && _payload$product_vari !== void 0 ? _payload$product_vari : payload.variant_id) !== null && _ref14 !== void 0 ? _ref14 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.product_variant_id) !== null && _ref13 !== void 0 ? _ref13 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.variant_id, 0);
|
|
76
86
|
var callbackOrigin = payload.origin || ((_payload$_origin = payload._origin) === null || _payload$_origin === void 0 ? void 0 : _payload$_origin.sourceProduct) || ((_payload$_origin2 = payload._origin) === null || _payload$_origin2 === void 0 ? void 0 : _payload$_origin2.sourceItem) || payload._origin || {};
|
|
77
87
|
var origin = _objectSpread(_objectSpread({}, sourceProduct || {}), callbackOrigin || {});
|
|
78
|
-
var matchedVariant = (
|
|
79
|
-
var sourceProductPrice = toPriceString((
|
|
80
|
-
var
|
|
81
|
-
var
|
|
88
|
+
var matchedVariant = (_ref15 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref15 !== void 0 ? _ref15 : findVariantById(origin, productVariantId);
|
|
89
|
+
var sourceProductPrice = toPriceString((_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_payload$price = payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload.selling_price) !== null && _ref22 !== void 0 ? _ref22 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref21 !== void 0 ? _ref21 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref20 !== void 0 ? _ref20 : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref19 !== void 0 ? _ref19 : origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _ref18 !== void 0 ? _ref18 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _ref17 !== void 0 ? _ref17 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.selling_price) !== null && _ref16 !== void 0 ? _ref16 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price, '0.00');
|
|
90
|
+
var lineCompositeTotal = toPriceString((_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total, sourceProductPrice);
|
|
91
|
+
var hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
|
|
92
|
+
var productOptionItem = normalizeOptionItems((_ref24 = (_payload$option = payload.option) !== null && _payload$option !== void 0 ? _payload$option : payload.options) !== null && _ref24 !== void 0 ? _ref24 : payload.product_option_item);
|
|
93
|
+
var productBundle = normalizeBundleItems((_payload$bundle = payload.bundle) !== null && _payload$bundle !== void 0 ? _payload$bundle : payload.product_bundle, hasPriceOverride);
|
|
82
94
|
var uniqueIdentificationNumber = (_payload$unique_ident = payload.unique_identification_number) !== null && _payload$unique_ident !== void 0 ? _payload$unique_ident : payload.unique;
|
|
83
|
-
var metadata = {
|
|
95
|
+
var metadata = _objectSpread(_objectSpread({
|
|
84
96
|
unique: payload.unique,
|
|
85
97
|
session: payload.session,
|
|
86
98
|
form: payload.form,
|
|
@@ -91,8 +103,14 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
91
103
|
policy_id: payload.policy_id,
|
|
92
104
|
source_shop_id: payload.source_shop_id,
|
|
93
105
|
origin: origin,
|
|
94
|
-
source_product_price: sourceProductPrice
|
|
95
|
-
|
|
106
|
+
source_product_price: sourceProductPrice,
|
|
107
|
+
main_product_selling_price: sourceProductPrice,
|
|
108
|
+
main_product_original_price: sourceProductPrice
|
|
109
|
+
}, hasPriceOverride ? {
|
|
110
|
+
price_override: String(payload.price_override)
|
|
111
|
+
} : {}), payload.bundle_edit !== undefined ? {
|
|
112
|
+
bundle_edit: payload.bundle_edit
|
|
113
|
+
} : {});
|
|
96
114
|
if (uniqueIdentificationNumber) {
|
|
97
115
|
metadata.unique_identification_number = String(uniqueIdentificationNumber);
|
|
98
116
|
}
|
|
@@ -103,10 +121,11 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
103
121
|
num: toSafePositiveInt((_payload$quantity = payload.quantity) !== null && _payload$quantity !== void 0 ? _payload$quantity : payload.num, 1),
|
|
104
122
|
product_option_item: productOptionItem,
|
|
105
123
|
product_bundle: productBundle,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
124
|
+
// 折后行价由 normalizeOrderProduct 按 main + bundle 合成;手动改价时 bundle 已为分摊后单价
|
|
125
|
+
selling_price: lineCompositeTotal,
|
|
126
|
+
original_price: lineCompositeTotal,
|
|
127
|
+
tax_fee: toPriceString((_ref25 = (_ref26 = (_payload$tax_fee = payload.tax_fee) !== null && _payload$tax_fee !== void 0 ? _payload$tax_fee : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.tax_fee) !== null && _ref26 !== void 0 ? _ref26 : origin === null || origin === void 0 ? void 0 : origin.tax_fee) !== null && _ref25 !== void 0 ? _ref25 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.tax_fee, '0.00'),
|
|
128
|
+
is_charge_tax: toNumber((_ref27 = (_ref28 = (_payload$is_charge_ta = payload.is_charge_tax) !== null && _payload$is_charge_ta !== void 0 ? _payload$is_charge_ta : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.is_charge_tax) !== null && _ref28 !== void 0 ? _ref28 : origin === null || origin === void 0 ? void 0 : origin.is_charge_tax) !== null && _ref27 !== void 0 ? _ref27 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.is_charge_tax, 0),
|
|
110
129
|
metadata: metadata,
|
|
111
130
|
note: payload.note != null ? String(payload.note) : '',
|
|
112
131
|
_origin: _objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
|
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import Decimal from 'decimal.js';
|
|
8
|
-
import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
8
|
+
import { composeLinePrice, createUuidV4, resolveManualOverrideLineOriginalPrice, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* 构建金额全为 0 的空 summary。
|
|
@@ -106,17 +106,42 @@ export function isSkuOnlyDeleteIdentity(x) {
|
|
|
106
106
|
* - 因此多次 normalize 不会重复叠加 option/bundle。
|
|
107
107
|
*/
|
|
108
108
|
export function normalizeOrderProduct(product) {
|
|
109
|
-
var _product$metadata, _metadata$origin, _variantList$find, _product$is_charge_ta;
|
|
109
|
+
var _product$metadata, _metadata$origin, _metadata$origin2, _variantList$find, _product$is_charge_ta;
|
|
110
110
|
var metadata = _objectSpread({}, product.metadata || {});
|
|
111
111
|
// 不透明 identity 契约:每条订单行必须带 identity_key。
|
|
112
112
|
// 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
|
|
113
113
|
var resolvedIdentityKey = (_product$metadata = product.metadata) !== null && _product$metadata !== void 0 && _product$metadata.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
|
|
114
114
|
metadata.unique_identification_number = resolvedIdentityKey;
|
|
115
|
-
var
|
|
116
|
-
|
|
115
|
+
var priceOverride = metadata.price_override;
|
|
116
|
+
var originOtherBundle = (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin._extend) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin.other) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.bundle;
|
|
117
|
+
var bundleInput = product.product_bundle || [];
|
|
118
|
+
if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
|
|
119
|
+
var priceById = new Map();
|
|
120
|
+
originOtherBundle.forEach(function (item) {
|
|
121
|
+
var _item$price2;
|
|
122
|
+
if ((item === null || item === void 0 ? void 0 : item.id) == null) return;
|
|
123
|
+
var unit = (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.bundle_selling_price;
|
|
124
|
+
if (unit === undefined || unit === null) return;
|
|
125
|
+
priceById.set(String(item.id), String(unit));
|
|
126
|
+
});
|
|
127
|
+
var base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
|
|
128
|
+
bundleInput = base.map(function (item) {
|
|
129
|
+
var unit = priceById.get(String(item === null || item === void 0 ? void 0 : item.id));
|
|
130
|
+
if (unit === undefined) return item;
|
|
131
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
132
|
+
price: unit,
|
|
133
|
+
bundle_selling_price: unit
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
var normalizedBundle = bundleInput.map(function (item) {
|
|
138
|
+
var _item$bundle_id2, _item$bundle_product_, _item$bundle_group_id, _ref2, _item$bundle_selling_, _ref3, _ref4, _item$price3, _ref5, _item$price_type, _ref6, _item$price_type_ext;
|
|
117
139
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
140
|
+
bundle_id: (_item$bundle_id2 = item.bundle_id) !== null && _item$bundle_id2 !== void 0 ? _item$bundle_id2 : item.id,
|
|
141
|
+
bundle_product_id: (_item$bundle_product_ = item.bundle_product_id) !== null && _item$bundle_product_ !== void 0 ? _item$bundle_product_ : item._bundle_product_id,
|
|
142
|
+
bundle_group_id: (_item$bundle_group_id = item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item.group_id,
|
|
118
143
|
bundle_selling_price: (_ref2 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref2 !== void 0 ? _ref2 : '0.00',
|
|
119
|
-
price: (_ref3 = (_ref4 = (_item$
|
|
144
|
+
price: (_ref3 = (_ref4 = (_item$price3 = item.price) !== null && _item$price3 !== void 0 ? _item$price3 : item.custom_price) !== null && _ref4 !== void 0 ? _ref4 : item.bundle_selling_price) !== null && _ref3 !== void 0 ? _ref3 : '0.00',
|
|
120
145
|
price_type: (_ref5 = (_item$price_type = item.price_type) !== null && _item$price_type !== void 0 ? _item$price_type : item.custom_price_type) !== null && _ref5 !== void 0 ? _ref5 : '',
|
|
121
146
|
price_type_ext: (_ref6 = (_item$price_type_ext = item.price_type_ext) !== null && _item$price_type_ext !== void 0 ? _item$price_type_ext : item.custom_price_type_ext) !== null && _ref6 !== void 0 ? _ref6 : ''
|
|
122
147
|
});
|
|
@@ -134,7 +159,7 @@ export function normalizeOrderProduct(product) {
|
|
|
134
159
|
// 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
|
|
135
160
|
var isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
|
|
136
161
|
var variantId = Number(product.product_variant_id || 0);
|
|
137
|
-
var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$
|
|
162
|
+
var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin2 = metadata.origin) === null || _metadata$origin2 === void 0 ? void 0 : _metadata$origin2.variant : null;
|
|
138
163
|
var variantPrice = Array.isArray(variantList) ? (_variantList$find = variantList.find(function (v) {
|
|
139
164
|
return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
|
|
140
165
|
})) === null || _variantList$find === void 0 ? void 0 : _variantList$find.price : undefined;
|
|
@@ -204,6 +229,10 @@ export function normalizeOrderProduct(product) {
|
|
|
204
229
|
bundle: normalizedBundle,
|
|
205
230
|
useOriginalBundle: true
|
|
206
231
|
});
|
|
232
|
+
var finalOriginalPrice = resolveManualOverrideLineOriginalPrice({
|
|
233
|
+
num: product.num,
|
|
234
|
+
metadata: metadata
|
|
235
|
+
}, composedOriginalPrice);
|
|
207
236
|
return {
|
|
208
237
|
order_detail_id: product.order_detail_id || null,
|
|
209
238
|
product_id: product.product_id,
|
|
@@ -211,7 +240,7 @@ export function normalizeOrderProduct(product) {
|
|
|
211
240
|
product_variant_id: product.product_variant_id,
|
|
212
241
|
product_option_item: normalizedOptions,
|
|
213
242
|
selling_price: composedSellingPrice,
|
|
214
|
-
original_price:
|
|
243
|
+
original_price: finalOriginalPrice,
|
|
215
244
|
tax_fee: product.tax_fee || '0.00',
|
|
216
245
|
is_charge_tax: (_product$is_charge_ta = product.is_charge_tax) !== null && _product$is_charge_ta !== void 0 ? _product$is_charge_ta : 0,
|
|
217
246
|
discount_list: product.discount_list || [],
|
|
@@ -21,6 +21,8 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
21
21
|
private platform;
|
|
22
22
|
private scan;
|
|
23
23
|
private productCatalog;
|
|
24
|
+
private orderCustomerDiscountRefreshInFlight;
|
|
25
|
+
private orderCustomerDiscountRefreshCustomerId;
|
|
24
26
|
/**
|
|
25
27
|
* 在 BaseSales 默认模块清单(products/order/salesSummary/schedule)基础上追加 customer + bookingContext。
|
|
26
28
|
* bookingContext 是 SalesSdk 加车下沉所需的「预约 UI 上下文」(bookingConfig / resourcesOrigin / date)。
|
|
@@ -205,6 +207,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
205
207
|
restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
206
208
|
/** 内部:基于 OrderModule 当前状态构造一份 OrderCustomerChangePayload。 */
|
|
207
209
|
private buildOrderCustomerPayload;
|
|
210
|
+
private refreshDiscountConfigAfterOrderCustomerChange;
|
|
208
211
|
/**
|
|
209
212
|
* 获取客户分页信息
|
|
210
213
|
* @returns 分页信息
|
|
@@ -61,6 +61,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
61
61
|
_defineProperty(_assertThisInitialized(_this), "platform", void 0);
|
|
62
62
|
_defineProperty(_assertThisInitialized(_this), "scan", void 0);
|
|
63
63
|
_defineProperty(_assertThisInitialized(_this), "productCatalog", []);
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshInFlight", null);
|
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "orderCustomerDiscountRefreshCustomerId", null);
|
|
64
66
|
return _this;
|
|
65
67
|
}
|
|
66
68
|
_createClass(BookingTicketImpl, [{
|
|
@@ -135,7 +137,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
135
137
|
key: "loadSalesDetail",
|
|
136
138
|
value: (function () {
|
|
137
139
|
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderIdOrParams) {
|
|
138
|
-
var
|
|
140
|
+
var _ref;
|
|
141
|
+
var sales, customerModule, detailCustomer, orderCustomerSnapshot, protocolCustomerId, protocolCustomer, selectedCustomer, _selectedCustomer$nam, _ref2, detailCustomerId, detailCustomerRest, rawId, customer;
|
|
139
142
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
140
143
|
while (1) switch (_context2.prev = _context2.next) {
|
|
141
144
|
case 0:
|
|
@@ -146,21 +149,36 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
146
149
|
console.log(sales, '1234sales');
|
|
147
150
|
customerModule = this.store.customer;
|
|
148
151
|
detailCustomer = sales === null || sales === void 0 ? void 0 : sales.customer;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
orderCustomerSnapshot = this.store.order.getOrderCustomerSnapshot();
|
|
153
|
+
protocolCustomerId = sales === null || sales === void 0 ? void 0 : sales.customer_id;
|
|
154
|
+
protocolCustomer = protocolCustomerId !== undefined && protocolCustomerId !== null ? {
|
|
155
|
+
id: protocolCustomerId,
|
|
156
|
+
name: String((sales === null || sales === void 0 ? void 0 : sales.customer_name) || ''),
|
|
157
|
+
phone: sales === null || sales === void 0 ? void 0 : sales.phone,
|
|
158
|
+
email: sales === null || sales === void 0 ? void 0 : sales.email,
|
|
159
|
+
country_calling_code: sales === null || sales === void 0 ? void 0 : sales.country_calling_code
|
|
160
|
+
} : null;
|
|
161
|
+
selectedCustomer = (_ref = detailCustomer !== null && detailCustomer !== void 0 ? detailCustomer : orderCustomerSnapshot) !== null && _ref !== void 0 ? _ref : protocolCustomer;
|
|
162
|
+
if (!(customerModule && selectedCustomer)) {
|
|
163
|
+
_context2.next = 18;
|
|
164
|
+
break;
|
|
161
165
|
}
|
|
166
|
+
_ref2 = selectedCustomer !== null && selectedCustomer !== void 0 ? selectedCustomer : {}, detailCustomerId = _ref2.id, detailCustomerRest = _objectWithoutProperties(_ref2, _excluded);
|
|
167
|
+
rawId = detailCustomerId !== null && detailCustomerId !== void 0 ? detailCustomerId : '';
|
|
168
|
+
customer = _objectSpread(_objectSpread({}, detailCustomerRest), {}, {
|
|
169
|
+
id: rawId == null ? '' : rawId,
|
|
170
|
+
name: (_selectedCustomer$nam = selectedCustomer === null || selectedCustomer === void 0 ? void 0 : selectedCustomer.name) !== null && _selectedCustomer$nam !== void 0 ? _selectedCustomer$nam : '',
|
|
171
|
+
phone: selectedCustomer === null || selectedCustomer === void 0 ? void 0 : selectedCustomer.phone,
|
|
172
|
+
email: selectedCustomer === null || selectedCustomer === void 0 ? void 0 : selectedCustomer.email,
|
|
173
|
+
country_calling_code: selectedCustomer === null || selectedCustomer === void 0 ? void 0 : selectedCustomer.country_calling_code
|
|
174
|
+
});
|
|
175
|
+
customerModule.setSelectedCustomer(customer);
|
|
176
|
+
this.setOrderCustomer(customer);
|
|
177
|
+
_context2.next = 18;
|
|
178
|
+
return this.store.order.saveDraft();
|
|
179
|
+
case 18:
|
|
162
180
|
return _context2.abrupt("return", sales);
|
|
163
|
-
case
|
|
181
|
+
case 19:
|
|
164
182
|
case "end":
|
|
165
183
|
return _context2.stop();
|
|
166
184
|
}
|
|
@@ -678,6 +696,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
678
696
|
this.store.order.setOrderCustomer(patch, customer);
|
|
679
697
|
var next = this.buildOrderCustomerPayload();
|
|
680
698
|
this.core.effects.emit("".concat(this.name, ":onOrderCustomerChange"), next);
|
|
699
|
+
this.refreshDiscountConfigAfterOrderCustomerChange(patch.customer_id);
|
|
681
700
|
}
|
|
682
701
|
|
|
683
702
|
/**
|
|
@@ -754,6 +773,56 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
754
773
|
snapshot: this.store.order.getOrderCustomerSnapshot()
|
|
755
774
|
};
|
|
756
775
|
}
|
|
776
|
+
}, {
|
|
777
|
+
key: "refreshDiscountConfigAfterOrderCustomerChange",
|
|
778
|
+
value: function refreshDiscountConfigAfterOrderCustomerChange(customerId) {
|
|
779
|
+
var _this2 = this;
|
|
780
|
+
if (!customerId || customerId === 1) return;
|
|
781
|
+
if (this.orderCustomerDiscountRefreshInFlight && this.orderCustomerDiscountRefreshCustomerId === customerId) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
|
|
785
|
+
var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
786
|
+
var currentCustomer;
|
|
787
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
788
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
789
|
+
case 0:
|
|
790
|
+
if (!previousRefresh) {
|
|
791
|
+
_context12.next = 3;
|
|
792
|
+
break;
|
|
793
|
+
}
|
|
794
|
+
_context12.next = 3;
|
|
795
|
+
return previousRefresh.catch(function () {
|
|
796
|
+
return undefined;
|
|
797
|
+
});
|
|
798
|
+
case 3:
|
|
799
|
+
currentCustomer = _this2.store.order.getOrderCustomer();
|
|
800
|
+
if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
|
|
801
|
+
_context12.next = 6;
|
|
802
|
+
break;
|
|
803
|
+
}
|
|
804
|
+
return _context12.abrupt("return");
|
|
805
|
+
case 6:
|
|
806
|
+
_context12.next = 8;
|
|
807
|
+
return _this2.loadDiscountConfig({
|
|
808
|
+
customerId: customerId
|
|
809
|
+
});
|
|
810
|
+
case 8:
|
|
811
|
+
case "end":
|
|
812
|
+
return _context12.stop();
|
|
813
|
+
}
|
|
814
|
+
}, _callee12);
|
|
815
|
+
}))();
|
|
816
|
+
this.orderCustomerDiscountRefreshInFlight = refreshTask;
|
|
817
|
+
this.orderCustomerDiscountRefreshCustomerId = customerId;
|
|
818
|
+
refreshTask.catch(function (error) {
|
|
819
|
+
console.error('Failed to load discount config after customer change:', error);
|
|
820
|
+
}).finally(function () {
|
|
821
|
+
if (_this2.orderCustomerDiscountRefreshInFlight !== refreshTask) return;
|
|
822
|
+
_this2.orderCustomerDiscountRefreshInFlight = null;
|
|
823
|
+
_this2.orderCustomerDiscountRefreshCustomerId = null;
|
|
824
|
+
});
|
|
825
|
+
}
|
|
757
826
|
|
|
758
827
|
/**
|
|
759
828
|
* 获取客户分页信息
|
|
@@ -795,27 +864,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
795
864
|
}, {
|
|
796
865
|
key: "changeCustomerPage",
|
|
797
866
|
value: (function () {
|
|
798
|
-
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
867
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(page, pageSize) {
|
|
799
868
|
var _result3;
|
|
800
|
-
return _regeneratorRuntime().wrap(function
|
|
801
|
-
while (1) switch (
|
|
869
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
870
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
802
871
|
case 0:
|
|
803
|
-
|
|
804
|
-
|
|
872
|
+
_context13.prev = 0;
|
|
873
|
+
_context13.next = 3;
|
|
805
874
|
return this.store.customer.changeCustomerPage(page, pageSize);
|
|
806
875
|
case 3:
|
|
807
|
-
_result3 =
|
|
808
|
-
return
|
|
876
|
+
_result3 = _context13.sent;
|
|
877
|
+
return _context13.abrupt("return", _result3);
|
|
809
878
|
case 7:
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
console.error('Failed to change customer page:',
|
|
813
|
-
throw
|
|
879
|
+
_context13.prev = 7;
|
|
880
|
+
_context13.t0 = _context13["catch"](0);
|
|
881
|
+
console.error('Failed to change customer page:', _context13.t0);
|
|
882
|
+
throw _context13.t0;
|
|
814
883
|
case 11:
|
|
815
884
|
case "end":
|
|
816
|
-
return
|
|
885
|
+
return _context13.stop();
|
|
817
886
|
}
|
|
818
|
-
},
|
|
887
|
+
}, _callee13, this, [[0, 7]]);
|
|
819
888
|
}));
|
|
820
889
|
function changeCustomerPage(_x8, _x9) {
|
|
821
890
|
return _changeCustomerPage.apply(this, arguments);
|
|
@@ -830,28 +899,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
830
899
|
}, {
|
|
831
900
|
key: "loadMoreCustomers",
|
|
832
901
|
value: (function () {
|
|
833
|
-
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
902
|
+
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
834
903
|
var _result4;
|
|
835
|
-
return _regeneratorRuntime().wrap(function
|
|
836
|
-
while (1) switch (
|
|
904
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
905
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
837
906
|
case 0:
|
|
838
|
-
|
|
839
|
-
|
|
907
|
+
_context14.prev = 0;
|
|
908
|
+
_context14.next = 3;
|
|
840
909
|
return this.store.customer.loadMoreCustomers();
|
|
841
910
|
case 3:
|
|
842
|
-
_result4 =
|
|
911
|
+
_result4 = _context14.sent;
|
|
843
912
|
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result4);
|
|
844
|
-
return
|
|
913
|
+
return _context14.abrupt("return", _result4);
|
|
845
914
|
case 8:
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
console.error('Failed to load more customers:',
|
|
849
|
-
throw
|
|
915
|
+
_context14.prev = 8;
|
|
916
|
+
_context14.t0 = _context14["catch"](0);
|
|
917
|
+
console.error('Failed to load more customers:', _context14.t0);
|
|
918
|
+
throw _context14.t0;
|
|
850
919
|
case 12:
|
|
851
920
|
case "end":
|
|
852
|
-
return
|
|
921
|
+
return _context14.stop();
|
|
853
922
|
}
|
|
854
|
-
},
|
|
923
|
+
}, _callee14, this, [[0, 8]]);
|
|
855
924
|
}));
|
|
856
925
|
function loadMoreCustomers() {
|
|
857
926
|
return _loadMoreCustomers.apply(this, arguments);
|
|
@@ -867,31 +936,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
867
936
|
}, {
|
|
868
937
|
key: "resetAndLoadCustomers",
|
|
869
938
|
value: (function () {
|
|
870
|
-
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
939
|
+
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
871
940
|
var params,
|
|
872
941
|
_result5,
|
|
873
|
-
|
|
874
|
-
return _regeneratorRuntime().wrap(function
|
|
875
|
-
while (1) switch (
|
|
942
|
+
_args15 = arguments;
|
|
943
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
944
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
876
945
|
case 0:
|
|
877
|
-
params =
|
|
878
|
-
|
|
879
|
-
|
|
946
|
+
params = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
|
|
947
|
+
_context15.prev = 1;
|
|
948
|
+
_context15.next = 4;
|
|
880
949
|
return this.store.customer.resetAndLoadCustomers(params);
|
|
881
950
|
case 4:
|
|
882
|
-
_result5 =
|
|
951
|
+
_result5 = _context15.sent;
|
|
883
952
|
this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result5);
|
|
884
|
-
return
|
|
953
|
+
return _context15.abrupt("return", _result5);
|
|
885
954
|
case 9:
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
console.error('Failed to reset and load customers:',
|
|
889
|
-
throw
|
|
955
|
+
_context15.prev = 9;
|
|
956
|
+
_context15.t0 = _context15["catch"](1);
|
|
957
|
+
console.error('Failed to reset and load customers:', _context15.t0);
|
|
958
|
+
throw _context15.t0;
|
|
890
959
|
case 13:
|
|
891
960
|
case "end":
|
|
892
|
-
return
|
|
961
|
+
return _context15.stop();
|
|
893
962
|
}
|
|
894
|
-
},
|
|
963
|
+
}, _callee15, this, [[1, 9]]);
|
|
895
964
|
}));
|
|
896
965
|
function resetAndLoadCustomers() {
|
|
897
966
|
return _resetAndLoadCustomers.apply(this, arguments);
|
|
@@ -936,9 +1005,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
936
1005
|
}, {
|
|
937
1006
|
key: "scanGlobalListener",
|
|
938
1007
|
value: function scanGlobalListener(callback) {
|
|
939
|
-
var
|
|
1008
|
+
var _this3 = this;
|
|
940
1009
|
var localSearch = function localSearch(v) {
|
|
941
|
-
return
|
|
1010
|
+
return _this3.store.products.findProductsByCodeOrBarcode(v);
|
|
942
1011
|
};
|
|
943
1012
|
var scanCallback = handleGlobalScan(this.request, localSearch);
|
|
944
1013
|
var safeCallback = function safeCallback(d) {
|
|
@@ -1053,15 +1122,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1053
1122
|
}, {
|
|
1054
1123
|
key: "setOtherParams",
|
|
1055
1124
|
value: (function () {
|
|
1056
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1057
|
-
var
|
|
1058
|
-
|
|
1125
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
|
|
1126
|
+
var _ref4,
|
|
1127
|
+
_ref4$cover,
|
|
1059
1128
|
cover,
|
|
1060
|
-
|
|
1061
|
-
return _regeneratorRuntime().wrap(function
|
|
1062
|
-
while (1) switch (
|
|
1129
|
+
_args16 = arguments;
|
|
1130
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1131
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1063
1132
|
case 0:
|
|
1064
|
-
|
|
1133
|
+
_ref4 = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : {}, _ref4$cover = _ref4.cover, cover = _ref4$cover === void 0 ? false : _ref4$cover;
|
|
1065
1134
|
if (cover) {
|
|
1066
1135
|
this.otherParams = params;
|
|
1067
1136
|
} else {
|
|
@@ -1069,9 +1138,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1069
1138
|
}
|
|
1070
1139
|
case 2:
|
|
1071
1140
|
case "end":
|
|
1072
|
-
return
|
|
1141
|
+
return _context16.stop();
|
|
1073
1142
|
}
|
|
1074
|
-
},
|
|
1143
|
+
}, _callee16, this);
|
|
1075
1144
|
}));
|
|
1076
1145
|
function setOtherParams(_x10) {
|
|
1077
1146
|
return _setOtherParams.apply(this, arguments);
|
|
@@ -1086,16 +1155,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1086
1155
|
}, {
|
|
1087
1156
|
key: "getOtherParams",
|
|
1088
1157
|
value: (function () {
|
|
1089
|
-
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1090
|
-
return _regeneratorRuntime().wrap(function
|
|
1091
|
-
while (1) switch (
|
|
1158
|
+
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1159
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1160
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1092
1161
|
case 0:
|
|
1093
|
-
return
|
|
1162
|
+
return _context17.abrupt("return", this.otherParams);
|
|
1094
1163
|
case 1:
|
|
1095
1164
|
case "end":
|
|
1096
|
-
return
|
|
1165
|
+
return _context17.stop();
|
|
1097
1166
|
}
|
|
1098
|
-
},
|
|
1167
|
+
}, _callee17, this);
|
|
1099
1168
|
}));
|
|
1100
1169
|
function getOtherParams() {
|
|
1101
1170
|
return _getOtherParams.apply(this, arguments);
|
|
@@ -1261,10 +1330,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1261
1330
|
}, {
|
|
1262
1331
|
key: "buildAddProductCtx",
|
|
1263
1332
|
value: function buildAddProductCtx(extra) {
|
|
1264
|
-
var _extra$date2,
|
|
1333
|
+
var _extra$date2, _ref5, _this$getOrderCustome, _this$getOrderCustome2, _this$store$order$get3, _extra$presetStartTim2;
|
|
1265
1334
|
var bookingContextState = this.store.bookingContext.getState();
|
|
1266
1335
|
var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
|
|
1267
|
-
var orderCustomerId = (
|
|
1336
|
+
var orderCustomerId = (_ref5 = (_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$store$order$get3 = this.store.order.getTempOrder()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id) !== null && _ref5 !== void 0 ? _ref5 : undefined;
|
|
1268
1337
|
return _objectSpread({
|
|
1269
1338
|
bookingConfig: bookingContextState.bookingConfig,
|
|
1270
1339
|
resourcesOrigin: bookingContextState.resourcesOrigin,
|
|
@@ -1364,16 +1433,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1364
1433
|
}, {
|
|
1365
1434
|
key: "updateProductInOrder",
|
|
1366
1435
|
value: (function () {
|
|
1367
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1368
|
-
return _regeneratorRuntime().wrap(function
|
|
1369
|
-
while (1) switch (
|
|
1436
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(params) {
|
|
1437
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1438
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1370
1439
|
case 0:
|
|
1371
|
-
return
|
|
1440
|
+
return _context18.abrupt("return", this.updateOrderProduct(params));
|
|
1372
1441
|
case 1:
|
|
1373
1442
|
case "end":
|
|
1374
|
-
return
|
|
1443
|
+
return _context18.stop();
|
|
1375
1444
|
}
|
|
1376
|
-
},
|
|
1445
|
+
}, _callee18, this);
|
|
1377
1446
|
}));
|
|
1378
1447
|
function updateProductInOrder(_x11) {
|
|
1379
1448
|
return _updateProductInOrder.apply(this, arguments);
|
|
@@ -1388,12 +1457,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1388
1457
|
}, {
|
|
1389
1458
|
key: "destroy",
|
|
1390
1459
|
value: (function () {
|
|
1391
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1460
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1392
1461
|
var _this$scan;
|
|
1393
|
-
return _regeneratorRuntime().wrap(function
|
|
1394
|
-
while (1) switch (
|
|
1462
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1463
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1395
1464
|
case 0:
|
|
1396
|
-
|
|
1465
|
+
_context19.next = 2;
|
|
1397
1466
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
1398
1467
|
case 2:
|
|
1399
1468
|
try {
|
|
@@ -1404,9 +1473,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1404
1473
|
scanCache.clear();
|
|
1405
1474
|
case 4:
|
|
1406
1475
|
case "end":
|
|
1407
|
-
return
|
|
1476
|
+
return _context19.stop();
|
|
1408
1477
|
}
|
|
1409
|
-
},
|
|
1478
|
+
}, _callee19, this);
|
|
1410
1479
|
}));
|
|
1411
1480
|
function destroy() {
|
|
1412
1481
|
return _destroy.apply(this, arguments);
|