@pisell/pisellos 2.3.88 → 2.3.90
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 +9 -0
- package/dist/modules/Order/types.d.ts +2 -0
- package/dist/modules/Order/utils.js +21 -5
- package/dist/modules/Product/types.d.ts +2 -0
- package/dist/modules/Rules/index.js +11 -8
- package/dist/solution/BaseSales/types.d.ts +2 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +7 -1
- package/dist/solution/BaseSales/utils.js +6 -3
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -1
- package/dist/solution/ScanOrder/types.d.ts +2 -0
- package/dist/solution/ScanOrder/utils.js +6 -3
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/Order/types.d.ts +2 -0
- package/lib/modules/Order/utils.js +17 -0
- package/lib/modules/Product/types.d.ts +2 -0
- package/lib/modules/Rules/index.js +8 -6
- package/lib/solution/BaseSales/types.d.ts +2 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -0
- package/lib/solution/BaseSales/utils.js +3 -0
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/utils/addProductDecision.js +2 -0
- package/lib/solution/ScanOrder/types.d.ts +2 -0
- package/lib/solution/ScanOrder/utils.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// 导出评估器
|
|
2
|
+
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
+
|
|
4
|
+
// 导出适配器
|
|
5
|
+
export { PromotionAdapter } from "./adapter";
|
|
6
|
+
export { default } from "./adapter";
|
|
7
|
+
|
|
8
|
+
// 导出策略配置示例常量
|
|
9
|
+
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
|
|
@@ -191,6 +191,8 @@ export interface OrderLocalizedText {
|
|
|
191
191
|
export interface OrderProduct extends OrderProductIdentity {
|
|
192
192
|
order_detail_id: number | null;
|
|
193
193
|
num: number;
|
|
194
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
195
|
+
production_code?: string;
|
|
194
196
|
bundle_edit?: number;
|
|
195
197
|
product_sku: OrderProductSku;
|
|
196
198
|
gift_card?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["custom_product_bundle_map_id"],
|
|
2
2
|
_excluded2 = ["unique_identification_number"],
|
|
3
|
-
_excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per"],
|
|
3
|
+
_excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per", "production_code"],
|
|
4
4
|
_excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id"],
|
|
5
5
|
_excluded5 = ["collect_pax", "table_occupancy_duration"];
|
|
6
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -814,6 +814,11 @@ function normalizeSubmitPlatform(platform) {
|
|
|
814
814
|
if (lower === 'h5') return 'H5';
|
|
815
815
|
return value;
|
|
816
816
|
}
|
|
817
|
+
function normalizeSubmitProductionCode(value) {
|
|
818
|
+
if (value === undefined || value === null) return undefined;
|
|
819
|
+
var productionCode = String(value).trim();
|
|
820
|
+
return productionCode || undefined;
|
|
821
|
+
}
|
|
817
822
|
|
|
818
823
|
// 后端 checkout 协议字段 option_group_item_id;tempOrder 内部也保持同一字段名。
|
|
819
824
|
function formatSubmitOptionItems(options) {
|
|
@@ -825,6 +830,9 @@ function formatSubmitOptionItems(options) {
|
|
|
825
830
|
option_group_item_id: d === null || d === void 0 ? void 0 : d.option_group_item_id,
|
|
826
831
|
option_group_id: d === null || d === void 0 ? void 0 : d.option_group_id
|
|
827
832
|
});
|
|
833
|
+
var productionCode = normalizeSubmitProductionCode(d === null || d === void 0 ? void 0 : d.production_code);
|
|
834
|
+
delete option.production_code;
|
|
835
|
+
if (productionCode !== undefined) option.production_code = productionCode;
|
|
828
836
|
var addPrice = (_d$add_price = d === null || d === void 0 ? void 0 : d.add_price) !== null && _d$add_price !== void 0 ? _d$add_price : d === null || d === void 0 ? void 0 : d.price;
|
|
829
837
|
if (addPrice !== undefined) option.add_price = String(addPrice);
|
|
830
838
|
delete option.price;
|
|
@@ -865,9 +873,13 @@ function formatSubmitBundleItems(bundle) {
|
|
|
865
873
|
var num = toBundleNumber((_rawBundle$num = rawBundle.num) !== null && _rawBundle$num !== void 0 ? _rawBundle$num : rawBundle.quantity, 1);
|
|
866
874
|
var bundleMapId = resolveSubmitBundleMapId(rawBundle);
|
|
867
875
|
var hasSubmitBundleDiscounts = Array.isArray(rawBundle.discount_list) && rawBundle.discount_list.length > 0;
|
|
868
|
-
|
|
876
|
+
var productionCode = normalizeSubmitProductionCode(rawBundle.production_code);
|
|
877
|
+
return _objectSpread(_objectSpread({
|
|
869
878
|
is_charge_tax: (_rawBundle$is_charge_ = rawBundle.is_charge_tax) !== null && _rawBundle$is_charge_ !== void 0 ? _rawBundle$is_charge_ : 0,
|
|
870
|
-
bundle_variant_id: (_rawBundle$bundle_var = rawBundle.bundle_variant_id) !== null && _rawBundle$bundle_var !== void 0 ? _rawBundle$bundle_var : 0
|
|
879
|
+
bundle_variant_id: (_rawBundle$bundle_var = rawBundle.bundle_variant_id) !== null && _rawBundle$bundle_var !== void 0 ? _rawBundle$bundle_var : 0
|
|
880
|
+
}, productionCode !== undefined ? {
|
|
881
|
+
production_code: productionCode
|
|
882
|
+
} : {}), {}, {
|
|
871
883
|
num: num,
|
|
872
884
|
quantity: toBundleNumber((_rawBundle$quantity = rawBundle.quantity) !== null && _rawBundle$quantity !== void 0 ? _rawBundle$quantity : rawBundle.num, num),
|
|
873
885
|
extension_id: (_rawBundle$extension_ = rawBundle.extension_id) !== null && _rawBundle$extension_ !== void 0 ? _rawBundle$extension_ : 0,
|
|
@@ -889,7 +901,7 @@ function formatSubmitBundleItems(bundle) {
|
|
|
889
901
|
relation_surcharge_ids: relationSurchargeIds,
|
|
890
902
|
product_discount_difference: productDiscountDifference
|
|
891
903
|
})
|
|
892
|
-
};
|
|
904
|
+
});
|
|
893
905
|
});
|
|
894
906
|
}
|
|
895
907
|
|
|
@@ -921,7 +933,9 @@ function normalizeSubmitProduct(product) {
|
|
|
921
933
|
_deprecatedDiscountway = submitProduct.discountway,
|
|
922
934
|
_deprecatedProductDiscountReason = submitProduct.product_discount_reason,
|
|
923
935
|
_deprecatedDiscountPer = submitProduct.discount_per,
|
|
936
|
+
rawProductionCode = submitProduct.production_code,
|
|
924
937
|
productRest = _objectWithoutProperties(submitProduct, _excluded3);
|
|
938
|
+
var productionCode = normalizeSubmitProductionCode(rawProductionCode);
|
|
925
939
|
delete productRest["product_".concat('option', "_item")];
|
|
926
940
|
var rawMetadata = submitProduct.metadata || {};
|
|
927
941
|
var bookingUid = rawMetadata.booking_uid;
|
|
@@ -953,7 +967,9 @@ function normalizeSubmitProduct(product) {
|
|
|
953
967
|
var productSku = _objectSpread(_objectSpread({}, submitProduct.product_sku && _typeof(submitProduct.product_sku) === 'object' ? submitProduct.product_sku : {}), {}, {
|
|
954
968
|
option: formatSubmitOptionItems((_submitProduct$produc = submitProduct.product_sku) === null || _submitProduct$produc === void 0 ? void 0 : _submitProduct$produc.option)
|
|
955
969
|
});
|
|
956
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest),
|
|
970
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, productRest), productionCode !== undefined ? {
|
|
971
|
+
production_code: productionCode
|
|
972
|
+
} : {}), bookingUid ? {
|
|
957
973
|
booking_uid: bookingUid
|
|
958
974
|
} : {}), bundleEdit !== undefined ? {
|
|
959
975
|
bundle_edit: bundleEdit
|
|
@@ -2223,7 +2223,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2223
2223
|
}, {
|
|
2224
2224
|
key: "checkPackageSubItemUsageRules",
|
|
2225
2225
|
value: function checkPackageSubItemUsageRules(discount, flatItem) {
|
|
2226
|
-
var _flatItem$product;
|
|
2226
|
+
var _flatItem$product, _flatItem$originProdu, _flatItem$parentProdu10;
|
|
2227
2227
|
var limitedData = discount.limited_relation_product_data;
|
|
2228
2228
|
var usageRules = limitedData === null || limitedData === void 0 ? void 0 : limitedData.package_sub_item_usage_rules;
|
|
2229
2229
|
var rules = ['original_price'].concat(_toConsumableArray((usageRules === null || usageRules === void 0 ? void 0 : usageRules.rules) || []));
|
|
@@ -2236,7 +2236,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2236
2236
|
// 套餐适用范围配置
|
|
2237
2237
|
var packageScope = usageRules === null || usageRules === void 0 ? void 0 : usageRules.package_scope;
|
|
2238
2238
|
var _ref18 = packageScope || {},
|
|
2239
|
-
|
|
2239
|
+
_ref18$type = _ref18.type,
|
|
2240
|
+
scopeType = _ref18$type === void 0 ? 'product_all' : _ref18$type,
|
|
2240
2241
|
_ref18$exclude_bundle = _ref18.exclude_bundle_product_ids,
|
|
2241
2242
|
exclude_bundle_product_ids = _ref18$exclude_bundle === void 0 ? [] : _ref18$exclude_bundle,
|
|
2242
2243
|
_ref18$include_bundle = _ref18.include_bundle_product_ids,
|
|
@@ -2246,6 +2247,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2246
2247
|
var isMainProduct = flatItem.type === 'main'; // 单独购买
|
|
2247
2248
|
var isBundleItem = flatItem.type === 'bundle'; // 套餐中购买
|
|
2248
2249
|
var bundleMainProductId = (_flatItem$product = flatItem.product) === null || _flatItem$product === void 0 ? void 0 : _flatItem$product.product_id;
|
|
2250
|
+
// 主商品id
|
|
2251
|
+
var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 || (_flatItem$originProdu = _flatItem$originProdu._productOrigin) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu10 = flatItem.parentProduct) === null || _flatItem$parentProdu10 === void 0 ? void 0 : _flatItem$parentProdu10.id) || 0;
|
|
2249
2252
|
|
|
2250
2253
|
// 主商品直接可用
|
|
2251
2254
|
if (isMainProduct) {
|
|
@@ -2258,12 +2261,12 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2258
2261
|
return true; // 单独购买时可用
|
|
2259
2262
|
}
|
|
2260
2263
|
if (isBundleItem) {
|
|
2261
|
-
var _flatItem$bundleItem10, _flatItem$bundleItem11
|
|
2264
|
+
var _flatItem$bundleItem10, _flatItem$bundleItem11;
|
|
2262
2265
|
// 套餐中购买时,判断是否为原价
|
|
2263
2266
|
var priceType = (_flatItem$bundleItem10 = flatItem.bundleItem) === null || _flatItem$bundleItem10 === void 0 ? void 0 : _flatItem$bundleItem10.price_type;
|
|
2264
2267
|
var priceTypeExt = (_flatItem$bundleItem11 = flatItem.bundleItem) === null || _flatItem$bundleItem11 === void 0 ? void 0 : _flatItem$bundleItem11.price_type_ext;
|
|
2265
2268
|
// 主商品id
|
|
2266
|
-
|
|
2269
|
+
// const mainProductId = flatItem?.originProduct?._productOrigin?.id || flatItem?.parentProduct?.id || 0;
|
|
2267
2270
|
// original_price 对应:
|
|
2268
2271
|
// 1. price_type: "markup" && price_type_ext: "product_price"
|
|
2269
2272
|
// markup_price 对应:
|
|
@@ -2288,13 +2291,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2288
2291
|
if (!filter) {
|
|
2289
2292
|
isScopeValid = true;
|
|
2290
2293
|
} else {
|
|
2291
|
-
isScopeValid = !exclude_bundle_product_ids.includes(Number(
|
|
2294
|
+
isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
|
|
2292
2295
|
}
|
|
2293
2296
|
}
|
|
2294
2297
|
|
|
2295
2298
|
// 包含套餐判断, products值兼容旧数据
|
|
2296
2299
|
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
2297
|
-
isScopeValid = include_bundle_product_ids.includes(Number(
|
|
2300
|
+
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
2298
2301
|
}
|
|
2299
2302
|
|
|
2300
2303
|
// 价格和套餐适用范围都符合,则可用
|
|
@@ -2357,13 +2360,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2357
2360
|
if (!filter) {
|
|
2358
2361
|
_isScopeValid = true;
|
|
2359
2362
|
} else {
|
|
2360
|
-
_isScopeValid = !exclude_bundle_product_ids.includes(Number(
|
|
2363
|
+
_isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
|
|
2361
2364
|
}
|
|
2362
2365
|
}
|
|
2363
2366
|
|
|
2364
2367
|
// 包含套餐判断, products值兼容旧数据
|
|
2365
2368
|
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
2366
|
-
_isScopeValid = include_bundle_product_ids.includes(Number(
|
|
2369
|
+
_isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
2367
2370
|
}
|
|
2368
2371
|
|
|
2369
2372
|
// 价格和套餐适用范围都符合,则可用
|
|
@@ -112,6 +112,8 @@ export interface BaseSalesUpdateOrderProductQuantityParams extends BaseSalesOrde
|
|
|
112
112
|
export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
113
113
|
order_detail_id: number | null;
|
|
114
114
|
num: number;
|
|
115
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
116
|
+
production_code?: string;
|
|
115
117
|
product_sku: BaseSalesProductSku;
|
|
116
118
|
/**
|
|
117
119
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
@@ -3,6 +3,7 @@ import type { ProductData } from '../../../modules/Product/types';
|
|
|
3
3
|
export interface BaseProductDetailOptionItem {
|
|
4
4
|
option_group_item_id?: number | string;
|
|
5
5
|
option_group_id?: number | string;
|
|
6
|
+
production_code?: string;
|
|
6
7
|
num?: number | string;
|
|
7
8
|
quantity?: number | string;
|
|
8
9
|
price?: number | string;
|
|
@@ -10,6 +11,7 @@ export interface BaseProductDetailOptionItem {
|
|
|
10
11
|
[key: string]: any;
|
|
11
12
|
}
|
|
12
13
|
export interface BaseProductDetailBundleItem {
|
|
14
|
+
production_code?: string;
|
|
13
15
|
option?: BaseProductDetailOptionItem[];
|
|
14
16
|
[key: string]: any;
|
|
15
17
|
}
|
|
@@ -18,6 +20,7 @@ export interface BaseProductDetailPayload {
|
|
|
18
20
|
product_id?: number | string | null;
|
|
19
21
|
variant_id?: number | string | null;
|
|
20
22
|
product_variant_id?: number | string | null;
|
|
23
|
+
production_code?: string;
|
|
21
24
|
quantity?: number | string;
|
|
22
25
|
num?: number | string;
|
|
23
26
|
option?: BaseProductDetailOptionItem[];
|
|
@@ -30,6 +30,10 @@ function toPriceString(value) {
|
|
|
30
30
|
if (!Number.isFinite(parsedValue)) return fallback;
|
|
31
31
|
return parsedValue.toFixed(2);
|
|
32
32
|
}
|
|
33
|
+
function normalizeProductionCode(value) {
|
|
34
|
+
if (value === undefined || value === null) return '';
|
|
35
|
+
return String(value).trim();
|
|
36
|
+
}
|
|
33
37
|
function isBlankValue(value) {
|
|
34
38
|
return value === undefined || value === null || typeof value === 'string' && value.trim() === '';
|
|
35
39
|
}
|
|
@@ -104,7 +108,7 @@ function findVariantById(origin, variantId) {
|
|
|
104
108
|
* 注意:这里不生成 identity,缺省时由 OrderModule 自动补齐。
|
|
105
109
|
*/
|
|
106
110
|
export function transformBaseProductToOrderProduct(params) {
|
|
107
|
-
var _ref10, _ref11, _ref12, _payload$product_id, _ref13, _ref14, _payload$product_vari, _payload$_origin, _payload$_origin2, _ref15, _findVariantById, _ref16, _ref17, _ref18, _ref19, _ref20, _matchedVariant$price, _ref21, _ref22, _payload$price, _ref23, _payload$line_total, _payload$_extend, _ref24, _ref25, _payload$product_sku$, _payload$product_sku, _payload$bundle, _payload$quantity, _payload$_extend2, _extend, _extend2, _ref26, _ref27, _origin$base_price, _ref28, _ref29, _payload$line_total2, _payload$_extend3, _payload$_extend4, _extend3, _payload$_extend5, _payload$_extend6, _ref30, _ref31, _payload$tax_fee, _ref32, _ref33, _payload$is_charge_ta;
|
|
111
|
+
var _ref10, _ref11, _ref12, _payload$product_id, _ref13, _ref14, _payload$product_vari, _payload$_origin, _payload$_origin2, _ref15, _findVariantById, _origin$production_co, _ref16, _ref17, _ref18, _ref19, _ref20, _matchedVariant$price, _ref21, _ref22, _payload$price, _ref23, _payload$line_total, _payload$_extend, _ref24, _ref25, _payload$product_sku$, _payload$product_sku, _payload$bundle, _payload$quantity, _payload$_extend2, _extend, _extend2, _ref26, _ref27, _origin$base_price, _ref28, _ref29, _payload$line_total2, _payload$_extend3, _payload$_extend4, _extend3, _payload$_extend5, _payload$_extend6, _ref30, _ref31, _payload$tax_fee, _ref32, _ref33, _payload$is_charge_ta;
|
|
108
112
|
var payload = params.payload,
|
|
109
113
|
_params$fallbackProdu = params.fallbackProductId,
|
|
110
114
|
fallbackProductId = _params$fallbackProdu === void 0 ? null : _params$fallbackProdu;
|
|
@@ -116,6 +120,7 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
116
120
|
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 || {};
|
|
117
121
|
var origin = _objectSpread(_objectSpread({}, sourceProduct || {}), callbackOrigin || {});
|
|
118
122
|
var matchedVariant = (_ref15 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref15 !== void 0 ? _ref15 : findVariantById(origin, productVariantId);
|
|
123
|
+
var productionCode = normalizeProductionCode(Object.prototype.hasOwnProperty.call(payload, 'production_code') ? payload.production_code : productVariantId > 0 ? matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.production_code : (_origin$production_co = origin === null || origin === void 0 ? void 0 : origin.production_code) !== null && _origin$production_co !== void 0 ? _origin$production_co : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.production_code);
|
|
119
124
|
var hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
|
|
120
125
|
// 手动改价后 payload.price 是分摊后的主商品售价,不能再作为券前 source。
|
|
121
126
|
// 此时优先从商品/variant 快照读取目录价;售价仍由 line_total - bundle 推导。
|
|
@@ -198,6 +203,7 @@ export function transformBaseProductToOrderProduct(params) {
|
|
|
198
203
|
return _objectSpread(_objectSpread({
|
|
199
204
|
product_id: productId,
|
|
200
205
|
product_variant_id: productVariantId,
|
|
206
|
+
production_code: productionCode,
|
|
201
207
|
unique_identification_number: uniqueIdentificationNumber ? String(uniqueIdentificationNumber) : undefined,
|
|
202
208
|
num: resolvedQuantity,
|
|
203
209
|
product_sku: _objectSpread(_objectSpread({}, payload.product_sku && _typeof(payload.product_sku) === 'object' ? payload.product_sku : {}), {}, {
|
|
@@ -256,11 +256,14 @@ export function normalizeOrderProduct(product) {
|
|
|
256
256
|
sellingPrice: composedSellingPrice,
|
|
257
257
|
quantity: getSafeProductNum(product.num)
|
|
258
258
|
});
|
|
259
|
-
return {
|
|
259
|
+
return _objectSpread(_objectSpread({
|
|
260
260
|
order_detail_id: product.order_detail_id || null,
|
|
261
261
|
product_id: product.product_id,
|
|
262
262
|
num: getSafeProductNum(product.num),
|
|
263
|
-
product_variant_id: product.product_variant_id
|
|
263
|
+
product_variant_id: product.product_variant_id
|
|
264
|
+
}, product.production_code !== undefined && product.production_code !== null ? {
|
|
265
|
+
production_code: String(product.production_code).trim()
|
|
266
|
+
} : {}), {}, {
|
|
264
267
|
product_sku: productSku,
|
|
265
268
|
selling_price: composedSellingPrice,
|
|
266
269
|
original_price: finalOriginalPrice,
|
|
@@ -270,5 +273,5 @@ export function normalizeOrderProduct(product) {
|
|
|
270
273
|
product_bundle: normalizedBundle,
|
|
271
274
|
metadata: metadata,
|
|
272
275
|
note: product.note != null ? String(product.note) : ''
|
|
273
|
-
};
|
|
276
|
+
});
|
|
274
277
|
}
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "lots_of_space" | "filling_up_fast" | "sold_out";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|
|
@@ -319,7 +319,7 @@ export function transformDetailToProductAndBooking(cacheItem, ctx) {
|
|
|
319
319
|
* 把 cacheItem._extend.other 中的字段 + 顶层运行态拼成 `BaseProductDetailPayload`。
|
|
320
320
|
*/
|
|
321
321
|
function buildBasePayloadFromCacheItem(cacheItem, ctx) {
|
|
322
|
-
var _cacheItem$_extend, _cacheItem$_extend$qu, _cacheItem$_extend2, _cacheItem$product_id, _cacheItem$id, _ref5, _other$product_varian, _extend$skuValue, _extend$_skuValue, _extend$price, _extend$price2;
|
|
322
|
+
var _cacheItem$_extend, _cacheItem$_extend$qu, _cacheItem$_extend2, _cacheItem$product_id, _cacheItem$id, _ref5, _other$product_varian, _other$production_cod, _extend$skuValue, _extend$_skuValue, _extend$price, _extend$price2;
|
|
323
323
|
var other = (cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.other) || {};
|
|
324
324
|
var quantity = (ctx === null || ctx === void 0 ? void 0 : ctx.quantity) != null && ctx.quantity > 0 ? ctx.quantity : (_cacheItem$_extend$qu = cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend2 = cacheItem._extend) === null || _cacheItem$_extend2 === void 0 ? void 0 : _cacheItem$_extend2.quantity) !== null && _cacheItem$_extend$qu !== void 0 ? _cacheItem$_extend$qu : 1;
|
|
325
325
|
var resolvedPid = (_cacheItem$product_id = cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.product_id) !== null && _cacheItem$product_id !== void 0 ? _cacheItem$product_id : cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.id;
|
|
@@ -329,6 +329,8 @@ function buildBasePayloadFromCacheItem(cacheItem, ctx) {
|
|
|
329
329
|
id: (_cacheItem$id = cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.id) !== null && _cacheItem$id !== void 0 ? _cacheItem$id : cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.product_id,
|
|
330
330
|
product_id: resolvedPid,
|
|
331
331
|
variant_id: (_ref5 = (_other$product_varian = other === null || other === void 0 ? void 0 : other.product_variant_id) !== null && _other$product_varian !== void 0 ? _other$product_varian : other === null || other === void 0 ? void 0 : other.variant_id) !== null && _ref5 !== void 0 ? _ref5 : 0,
|
|
332
|
+
// SKUOptionsSelection 已按 Product / Variant 解析好主商品编码;显式空串也需保留。
|
|
333
|
+
production_code: (_other$production_cod = other === null || other === void 0 ? void 0 : other.production_code) !== null && _other$production_cod !== void 0 ? _other$production_cod : cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.production_code,
|
|
332
334
|
quantity: quantity,
|
|
333
335
|
// 规格弹窗本次选择是 option 权威源,避免目录/旧订单里的空 option 覆盖它。
|
|
334
336
|
product_sku: productSku ? _objectSpread(_objectSpread({}, productSku), {}, {
|
|
@@ -44,6 +44,8 @@ export interface ScanOrderProductSku {
|
|
|
44
44
|
export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
45
45
|
order_detail_id: number | null;
|
|
46
46
|
num: number;
|
|
47
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
48
|
+
production_code?: string;
|
|
47
49
|
product_sku: ScanOrderProductSku;
|
|
48
50
|
/**
|
|
49
51
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
@@ -660,11 +660,14 @@ export function normalizeOrderProduct(product) {
|
|
|
660
660
|
sellingPrice: composedSellingPrice,
|
|
661
661
|
quantity: getSafeProductNum(product.num)
|
|
662
662
|
});
|
|
663
|
-
return {
|
|
663
|
+
return _objectSpread(_objectSpread({
|
|
664
664
|
order_detail_id: product.order_detail_id || null,
|
|
665
665
|
product_id: product.product_id,
|
|
666
666
|
num: getSafeProductNum(product.num),
|
|
667
|
-
product_variant_id: product.product_variant_id
|
|
667
|
+
product_variant_id: product.product_variant_id
|
|
668
|
+
}, product.production_code !== undefined && product.production_code !== null ? {
|
|
669
|
+
production_code: String(product.production_code).trim()
|
|
670
|
+
} : {}), {}, {
|
|
668
671
|
product_sku: productSku,
|
|
669
672
|
selling_price: composedSellingPrice,
|
|
670
673
|
original_price: manualOriginalPrice,
|
|
@@ -674,7 +677,7 @@ export function normalizeOrderProduct(product) {
|
|
|
674
677
|
product_bundle: normalizedBundle,
|
|
675
678
|
metadata: metadata,
|
|
676
679
|
note: product.note != null ? String(product.note) : ''
|
|
677
|
-
};
|
|
680
|
+
});
|
|
678
681
|
}
|
|
679
682
|
|
|
680
683
|
/**
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BUY_X_GET_Y_FREE_STRATEGY", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _examples.BUY_X_GET_Y_FREE_STRATEGY;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ITEM_REWARD_STRATEGY", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _examples.ITEM_REWARD_STRATEGY;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PromotionAdapter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _adapter.PromotionAdapter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "PromotionEvaluator", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _evaluator.PromotionEvaluator;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "X_ITEMS_FOR_Y_PRICE_STRATEGY", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _examples.X_ITEMS_FOR_Y_PRICE_STRATEGY;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "default", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _adapter.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _evaluator = require("./evaluator");
|
|
43
|
+
var _adapter = _interopRequireWildcard(require("./adapter"));
|
|
44
|
+
var _examples = require("./examples");
|
|
45
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
46
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -191,6 +191,8 @@ export interface OrderLocalizedText {
|
|
|
191
191
|
export interface OrderProduct extends OrderProductIdentity {
|
|
192
192
|
order_detail_id: number | null;
|
|
193
193
|
num: number;
|
|
194
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
195
|
+
production_code?: string;
|
|
194
196
|
bundle_edit?: number;
|
|
195
197
|
product_sku: OrderProductSku;
|
|
196
198
|
gift_card?: number;
|
|
@@ -855,6 +855,11 @@ function normalizeSubmitPlatform(platform) {
|
|
|
855
855
|
if (lower === 'h5') return 'H5';
|
|
856
856
|
return value;
|
|
857
857
|
}
|
|
858
|
+
function normalizeSubmitProductionCode(value) {
|
|
859
|
+
if (value === undefined || value === null) return undefined;
|
|
860
|
+
const productionCode = String(value).trim();
|
|
861
|
+
return productionCode || undefined;
|
|
862
|
+
}
|
|
858
863
|
|
|
859
864
|
// 后端 checkout 协议字段 option_group_item_id;tempOrder 内部也保持同一字段名。
|
|
860
865
|
function formatSubmitOptionItems(options) {
|
|
@@ -866,6 +871,9 @@ function formatSubmitOptionItems(options) {
|
|
|
866
871
|
option_group_item_id: d?.option_group_item_id,
|
|
867
872
|
option_group_id: d?.option_group_id
|
|
868
873
|
};
|
|
874
|
+
const productionCode = normalizeSubmitProductionCode(d?.production_code);
|
|
875
|
+
delete option.production_code;
|
|
876
|
+
if (productionCode !== undefined) option.production_code = productionCode;
|
|
869
877
|
const addPrice = d?.add_price ?? d?.price;
|
|
870
878
|
if (addPrice !== undefined) option.add_price = String(addPrice);
|
|
871
879
|
delete option.price;
|
|
@@ -906,9 +914,13 @@ function formatSubmitBundleItems(bundle) {
|
|
|
906
914
|
const num = toBundleNumber(rawBundle.num ?? rawBundle.quantity, 1);
|
|
907
915
|
const bundleMapId = resolveSubmitBundleMapId(rawBundle);
|
|
908
916
|
const hasSubmitBundleDiscounts = Array.isArray(rawBundle.discount_list) && rawBundle.discount_list.length > 0;
|
|
917
|
+
const productionCode = normalizeSubmitProductionCode(rawBundle.production_code);
|
|
909
918
|
return {
|
|
910
919
|
is_charge_tax: rawBundle.is_charge_tax ?? 0,
|
|
911
920
|
bundle_variant_id: rawBundle.bundle_variant_id ?? 0,
|
|
921
|
+
...(productionCode !== undefined ? {
|
|
922
|
+
production_code: productionCode
|
|
923
|
+
} : {}),
|
|
912
924
|
num,
|
|
913
925
|
quantity: toBundleNumber(rawBundle.quantity ?? rawBundle.num, num),
|
|
914
926
|
extension_id: rawBundle.extension_id ?? 0,
|
|
@@ -965,8 +977,10 @@ function normalizeSubmitProduct(product) {
|
|
|
965
977
|
discountway: _deprecatedDiscountway,
|
|
966
978
|
product_discount_reason: _deprecatedProductDiscountReason,
|
|
967
979
|
discount_per: _deprecatedDiscountPer,
|
|
980
|
+
production_code: rawProductionCode,
|
|
968
981
|
...productRest
|
|
969
982
|
} = submitProduct;
|
|
983
|
+
const productionCode = normalizeSubmitProductionCode(rawProductionCode);
|
|
970
984
|
delete productRest[`product_${'option'}_item`];
|
|
971
985
|
const rawMetadata = submitProduct.metadata || {};
|
|
972
986
|
const bookingUid = rawMetadata.booking_uid;
|
|
@@ -1000,6 +1014,9 @@ function normalizeSubmitProduct(product) {
|
|
|
1000
1014
|
};
|
|
1001
1015
|
return {
|
|
1002
1016
|
...productRest,
|
|
1017
|
+
...(productionCode !== undefined ? {
|
|
1018
|
+
production_code: productionCode
|
|
1019
|
+
} : {}),
|
|
1003
1020
|
...(bookingUid ? {
|
|
1004
1021
|
booking_uid: bookingUid
|
|
1005
1022
|
} : {}),
|
|
@@ -1961,7 +1961,7 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1961
1961
|
// 套餐适用范围配置
|
|
1962
1962
|
const packageScope = usageRules?.package_scope;
|
|
1963
1963
|
const {
|
|
1964
|
-
type: scopeType,
|
|
1964
|
+
type: scopeType = 'product_all',
|
|
1965
1965
|
exclude_bundle_product_ids = [],
|
|
1966
1966
|
include_bundle_product_ids = [],
|
|
1967
1967
|
filter = 0
|
|
@@ -1969,6 +1969,8 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1969
1969
|
const isMainProduct = flatItem.type === 'main'; // 单独购买
|
|
1970
1970
|
const isBundleItem = flatItem.type === 'bundle'; // 套餐中购买
|
|
1971
1971
|
const bundleMainProductId = flatItem.product?.product_id;
|
|
1972
|
+
// 主商品id
|
|
1973
|
+
const mainProductId = flatItem?.originProduct?._productOrigin?.id || flatItem?.parentProduct?.id || 0;
|
|
1972
1974
|
|
|
1973
1975
|
// 主商品直接可用
|
|
1974
1976
|
if (isMainProduct) {
|
|
@@ -1985,7 +1987,7 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
1985
1987
|
const priceType = flatItem.bundleItem?.price_type;
|
|
1986
1988
|
const priceTypeExt = flatItem.bundleItem?.price_type_ext;
|
|
1987
1989
|
// 主商品id
|
|
1988
|
-
const mainProductId = flatItem?.originProduct?._productOrigin?.id || flatItem?.parentProduct?.id || 0;
|
|
1990
|
+
// const mainProductId = flatItem?.originProduct?._productOrigin?.id || flatItem?.parentProduct?.id || 0;
|
|
1989
1991
|
// original_price 对应:
|
|
1990
1992
|
// 1. price_type: "markup" && price_type_ext: "product_price"
|
|
1991
1993
|
// markup_price 对应:
|
|
@@ -2010,13 +2012,13 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
2010
2012
|
if (!filter) {
|
|
2011
2013
|
isScopeValid = true;
|
|
2012
2014
|
} else {
|
|
2013
|
-
isScopeValid = !exclude_bundle_product_ids.includes(Number(
|
|
2015
|
+
isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
|
|
2014
2016
|
}
|
|
2015
2017
|
}
|
|
2016
2018
|
|
|
2017
2019
|
// 包含套餐判断, products值兼容旧数据
|
|
2018
2020
|
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
2019
|
-
isScopeValid = include_bundle_product_ids.includes(Number(
|
|
2021
|
+
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
2020
2022
|
}
|
|
2021
2023
|
|
|
2022
2024
|
// 价格和套餐适用范围都符合,则可用
|
|
@@ -2078,13 +2080,13 @@ class RulesModule extends _BaseModule.BaseModule {
|
|
|
2078
2080
|
if (!filter) {
|
|
2079
2081
|
isScopeValid = true;
|
|
2080
2082
|
} else {
|
|
2081
|
-
isScopeValid = !exclude_bundle_product_ids.includes(Number(
|
|
2083
|
+
isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
|
|
2082
2084
|
}
|
|
2083
2085
|
}
|
|
2084
2086
|
|
|
2085
2087
|
// 包含套餐判断, products值兼容旧数据
|
|
2086
2088
|
if (scopeType === 'specific_packages' || scopeType === 'products') {
|
|
2087
|
-
isScopeValid = include_bundle_product_ids.includes(Number(
|
|
2089
|
+
isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
|
|
2088
2090
|
}
|
|
2089
2091
|
|
|
2090
2092
|
// 价格和套餐适用范围都符合,则可用
|
|
@@ -112,6 +112,8 @@ export interface BaseSalesUpdateOrderProductQuantityParams extends BaseSalesOrde
|
|
|
112
112
|
export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
|
|
113
113
|
order_detail_id: number | null;
|
|
114
114
|
num: number;
|
|
115
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
116
|
+
production_code?: string;
|
|
115
117
|
product_sku: BaseSalesProductSku;
|
|
116
118
|
/**
|
|
117
119
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
@@ -3,6 +3,7 @@ import type { ProductData } from '../../../modules/Product/types';
|
|
|
3
3
|
export interface BaseProductDetailOptionItem {
|
|
4
4
|
option_group_item_id?: number | string;
|
|
5
5
|
option_group_id?: number | string;
|
|
6
|
+
production_code?: string;
|
|
6
7
|
num?: number | string;
|
|
7
8
|
quantity?: number | string;
|
|
8
9
|
price?: number | string;
|
|
@@ -10,6 +11,7 @@ export interface BaseProductDetailOptionItem {
|
|
|
10
11
|
[key: string]: any;
|
|
11
12
|
}
|
|
12
13
|
export interface BaseProductDetailBundleItem {
|
|
14
|
+
production_code?: string;
|
|
13
15
|
option?: BaseProductDetailOptionItem[];
|
|
14
16
|
[key: string]: any;
|
|
15
17
|
}
|
|
@@ -18,6 +20,7 @@ export interface BaseProductDetailPayload {
|
|
|
18
20
|
product_id?: number | string | null;
|
|
19
21
|
variant_id?: number | string | null;
|
|
20
22
|
product_variant_id?: number | string | null;
|
|
23
|
+
production_code?: string;
|
|
21
24
|
quantity?: number | string;
|
|
22
25
|
num?: number | string;
|
|
23
26
|
option?: BaseProductDetailOptionItem[];
|
|
@@ -27,6 +27,10 @@ function toPriceString(value, fallback = '0.00') {
|
|
|
27
27
|
if (!Number.isFinite(parsedValue)) return fallback;
|
|
28
28
|
return parsedValue.toFixed(2);
|
|
29
29
|
}
|
|
30
|
+
function normalizeProductionCode(value) {
|
|
31
|
+
if (value === undefined || value === null) return '';
|
|
32
|
+
return String(value).trim();
|
|
33
|
+
}
|
|
30
34
|
function isBlankValue(value) {
|
|
31
35
|
return value === undefined || value === null || typeof value === 'string' && value.trim() === '';
|
|
32
36
|
}
|
|
@@ -108,6 +112,7 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
108
112
|
...(callbackOrigin || {})
|
|
109
113
|
};
|
|
110
114
|
const matchedVariant = findVariantById(callbackOrigin, productVariantId) ?? findVariantById(sourceProduct, productVariantId) ?? findVariantById(origin, productVariantId);
|
|
115
|
+
const productionCode = normalizeProductionCode(Object.prototype.hasOwnProperty.call(payload, 'production_code') ? payload.production_code : productVariantId > 0 ? matchedVariant?.production_code : origin?.production_code ?? sourceProduct?.production_code);
|
|
111
116
|
const hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
|
|
112
117
|
// 手动改价后 payload.price 是分摊后的主商品售价,不能再作为券前 source。
|
|
113
118
|
// 此时优先从商品/variant 快照读取目录价;售价仍由 line_total - bundle 推导。
|
|
@@ -193,6 +198,7 @@ function transformBaseProductToOrderProduct(params) {
|
|
|
193
198
|
return {
|
|
194
199
|
product_id: productId,
|
|
195
200
|
product_variant_id: productVariantId,
|
|
201
|
+
production_code: productionCode,
|
|
196
202
|
unique_identification_number: uniqueIdentificationNumber ? String(uniqueIdentificationNumber) : undefined,
|
|
197
203
|
num: resolvedQuantity,
|
|
198
204
|
product_sku: {
|
|
@@ -257,6 +257,9 @@ function normalizeOrderProduct(product) {
|
|
|
257
257
|
product_id: product.product_id,
|
|
258
258
|
num: getSafeProductNum(product.num),
|
|
259
259
|
product_variant_id: product.product_variant_id,
|
|
260
|
+
...(product.production_code !== undefined && product.production_code !== null ? {
|
|
261
|
+
production_code: String(product.production_code).trim()
|
|
262
|
+
} : {}),
|
|
260
263
|
product_sku: productSku,
|
|
261
264
|
selling_price: composedSellingPrice,
|
|
262
265
|
original_price: finalOriginalPrice,
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "lots_of_space" | "filling_up_fast" | "sold_out";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|
|
@@ -336,6 +336,8 @@ function buildBasePayloadFromCacheItem(cacheItem, ctx) {
|
|
|
336
336
|
id: cacheItem?.id ?? cacheItem?.product_id,
|
|
337
337
|
product_id: resolvedPid,
|
|
338
338
|
variant_id: other?.product_variant_id ?? other?.variant_id ?? 0,
|
|
339
|
+
// SKUOptionsSelection 已按 Product / Variant 解析好主商品编码;显式空串也需保留。
|
|
340
|
+
production_code: other?.production_code ?? cacheItem?.production_code,
|
|
339
341
|
quantity,
|
|
340
342
|
// 规格弹窗本次选择是 option 权威源,避免目录/旧订单里的空 option 覆盖它。
|
|
341
343
|
product_sku: productSku ? {
|
|
@@ -44,6 +44,8 @@ export interface ScanOrderProductSku {
|
|
|
44
44
|
export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
|
|
45
45
|
order_detail_id: number | null;
|
|
46
46
|
num: number;
|
|
47
|
+
/** Product 或当前 Variant 的生产编码 */
|
|
48
|
+
production_code?: string;
|
|
47
49
|
product_sku: ScanOrderProductSku;
|
|
48
50
|
/**
|
|
49
51
|
* 券后 **行 composite 单价** = `metadata.main_product_selling_price`
|
|
@@ -633,6 +633,9 @@ function normalizeOrderProduct(product) {
|
|
|
633
633
|
product_id: product.product_id,
|
|
634
634
|
num: getSafeProductNum(product.num),
|
|
635
635
|
product_variant_id: product.product_variant_id,
|
|
636
|
+
...(product.production_code !== undefined && product.production_code !== null ? {
|
|
637
|
+
production_code: String(product.production_code).trim()
|
|
638
|
+
} : {}),
|
|
636
639
|
product_sku: productSku,
|
|
637
640
|
selling_price: composedSellingPrice,
|
|
638
641
|
original_price: manualOriginalPrice,
|