@pisell/private-materials 6.6.101 → 6.6.102
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/footer/utils.js +13 -0
- package/es/components/booking/components/voucher/index.js +42 -3
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +8 -5
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +31 -11
- package/es/components/booking/info2/service/editService/utils.d.ts +3 -0
- package/es/components/booking/info2/service/editService/utils.js +128 -19
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/ticketBooking/utils/index.js +4 -4
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/footer/utils.js +8 -1
- package/lib/components/booking/components/voucher/index.js +43 -3
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -5
- package/lib/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +38 -12
- package/lib/components/booking/info2/service/editService/utils.d.ts +3 -0
- package/lib/components/booking/info2/service/editService/utils.js +94 -12
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/ticketBooking/utils/index.js +2 -2
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -30,11 +29,4 @@ export interface PayGroup {
|
|
|
30
29
|
_order: any;
|
|
31
30
|
front_order_uuid?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare const Provider:
|
|
34
|
-
state: FormState;
|
|
35
|
-
} & {
|
|
36
|
-
dispatch: (params: {
|
|
37
|
-
type: string;
|
|
38
|
-
payload: any;
|
|
39
|
-
}) => void;
|
|
40
|
-
}>;
|
|
32
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,11 +68,4 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider:
|
|
73
|
-
state: FormState;
|
|
74
|
-
} & {
|
|
75
|
-
dispatch: (params: {
|
|
76
|
-
type: string;
|
|
77
|
-
payload: any;
|
|
78
|
-
}) => void;
|
|
79
|
-
}>;
|
|
71
|
+
export declare const Provider: any, Context: any;
|
|
@@ -47,7 +47,7 @@ declare type ScanData = {
|
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
export declare const formatScanCustomer: (data: ScanData) => {
|
|
50
|
-
searchType: "
|
|
50
|
+
searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
|
|
51
51
|
data: any;
|
|
52
52
|
scanCode: string;
|
|
53
53
|
} | null;
|
|
@@ -161,18 +161,18 @@ export var addService = function addService(list, addItem, state, isMultiDay) {
|
|
|
161
161
|
var isSetCount = false;
|
|
162
162
|
value = list.map(function (item) {
|
|
163
163
|
var _item$_extend;
|
|
164
|
-
//
|
|
164
|
+
// 商品券或多次卡已分配到具体商品行,新增数量需另起一行计算。
|
|
165
165
|
var isGoodPassDiscountProduct = (item.discount_list || []).some(function (item) {
|
|
166
|
-
return item.
|
|
166
|
+
return ['good_pass', 'entitlement_pass'].includes(item.tag || item.type);
|
|
167
167
|
});
|
|
168
168
|
var isEdit = item === null || item === void 0 ? void 0 : item.edit;
|
|
169
|
-
//
|
|
169
|
+
// 子商品是否有商品券或多次卡折扣
|
|
170
170
|
var bundleDiscountList = [];
|
|
171
171
|
((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 || (_item$_extend = _item$_extend.other) === null || _item$_extend === void 0 ? void 0 : _item$_extend.bundle) || []).forEach(function (item) {
|
|
172
172
|
bundleDiscountList.push.apply(bundleDiscountList, _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
|
|
173
173
|
});
|
|
174
174
|
var isGoodPassBundleProduct = bundleDiscountList.some(function (item) {
|
|
175
|
-
return item.
|
|
175
|
+
return ['good_pass', 'entitlement_pass'].includes(item.tag || item.type);
|
|
176
176
|
});
|
|
177
177
|
if (isSameProduct(item, addItem) && !isSetCount && !isGoodPassDiscountProduct && !isEdit && !isGoodPassBundleProduct) {
|
|
178
178
|
var _item$_extend2, _addItem$_extend, _item$_extend3;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Capacity: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
6
6
|
export default Capacity;
|
|
@@ -3,5 +3,5 @@ import { SkuStatusOverlayConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const CardMask: ({ props }: {
|
|
5
5
|
props: SkuStatusOverlayConfig;
|
|
6
|
-
}) => string | number | true |
|
|
6
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
7
7
|
export default CardMask;
|
|
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const Countdown: ({ props }: {
|
|
5
5
|
props: ProductCardConfig;
|
|
6
|
-
}) => string | number | true |
|
|
6
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
7
7
|
export default Countdown;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Duration: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
6
6
|
export default Duration;
|
|
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const MemberPrice: ({ props }: {
|
|
5
5
|
props: ProductCardConfig;
|
|
6
|
-
}) => string | number | true |
|
|
6
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
7
7
|
export default MemberPrice;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Resource: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
6
6
|
export default Resource;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Stock: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
6
6
|
export default Stock;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Time: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | React.ReactFragment | JSX.Element | null;
|
|
6
6
|
export default Time;
|
|
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
30
30
|
* @return {*}
|
|
31
31
|
* @Author: xiangfeng.xue
|
|
32
32
|
*/
|
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
34
34
|
/**
|
|
35
35
|
* 计算所有价格明细
|
|
36
36
|
* @param items - 购物车商品数组
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -400,7 +400,14 @@ var formatProducts = (item, quantity) => {
|
|
|
400
400
|
});
|
|
401
401
|
const notManualDiscount = discount_list.filter(
|
|
402
402
|
(item2) => item2.type !== "product"
|
|
403
|
-
)
|
|
403
|
+
).map((discount) => {
|
|
404
|
+
var _a2, _b2;
|
|
405
|
+
if (quantity === void 0 || (discount.tag || discount.type) !== "entitlement_pass" || ((_a2 = discount.metadata) == null ? void 0 : _a2.custom_product_bundle_map_id)) {
|
|
406
|
+
return discount;
|
|
407
|
+
}
|
|
408
|
+
const num = Math.min(Number(((_b2 = discount.metadata) == null ? void 0 : _b2.num) ?? item._extend.quantity), quantity);
|
|
409
|
+
return { ...discount, _num: num, metadata: { ...discount.metadata, num } };
|
|
410
|
+
});
|
|
404
411
|
if (item.isCustomItem) {
|
|
405
412
|
item.product_id = 0;
|
|
406
413
|
}
|
|
@@ -87,6 +87,14 @@ var VoucherCard = (props) => {
|
|
|
87
87
|
const { selectCustomer } = (0, import_pisellos.useCustomer)({
|
|
88
88
|
changeCustomerToGlobalState
|
|
89
89
|
});
|
|
90
|
+
(0, import_react.useEffect)(() => {
|
|
91
|
+
var _a2;
|
|
92
|
+
(_a2 = shopDiscount == null ? void 0 : shopDiscount.setEntitlementPassEnabled) == null ? void 0 : _a2.call(shopDiscount, isBooking4Shop);
|
|
93
|
+
return () => {
|
|
94
|
+
var _a3;
|
|
95
|
+
return (_a3 = shopDiscount == null ? void 0 : shopDiscount.setEntitlementPassEnabled) == null ? void 0 : _a3.call(shopDiscount, false);
|
|
96
|
+
};
|
|
97
|
+
}, [shopDiscount, isBooking4Shop]);
|
|
90
98
|
(0, import_ahooks.useDebounceEffect)(
|
|
91
99
|
() => {
|
|
92
100
|
if (isBooking4Shop) {
|
|
@@ -332,12 +340,44 @@ var VoucherCard = (props) => {
|
|
|
332
340
|
};
|
|
333
341
|
const availableData = (0, import_react.useMemo)(() => {
|
|
334
342
|
if (!isBooking4Shop) return [];
|
|
335
|
-
return discountList.filter((item) => !!item.isAvailable).
|
|
336
|
-
|
|
343
|
+
return discountList.filter((item) => !!item.isAvailable).flatMap((discount) => {
|
|
344
|
+
var _a2, _b2, _c2;
|
|
345
|
+
const currentRow = {
|
|
337
346
|
...discount,
|
|
338
|
-
|
|
347
|
+
// 原卡片仍读取 isSelected,历史扣次不代表本次勾选。
|
|
348
|
+
isSelected: discount.tag === "entitlement_pass" && !discount.isDisabled ? !!discount.isSelected && (((_a2 = discount.appliedProductDetails) == null ? void 0 : _a2.length) || 0) > (((_b2 = discount.committedAppliedProductDetails) == null ? void 0 : _b2.length) || 0) : discount.isSelected,
|
|
349
|
+
isDisabled: discount.isDisabled || (discount.tag === "entitlement_pass" ? !discount.isAvailable : discount.isDisabledForProductUsed) || disabled,
|
|
339
350
|
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
|
|
340
351
|
};
|
|
352
|
+
const committedDetails = discount.tag === "entitlement_pass" ? discount.committedAppliedProductDetails || [] : [];
|
|
353
|
+
if (!committedDetails.length) return [currentRow];
|
|
354
|
+
const historyRow = {
|
|
355
|
+
...discount,
|
|
356
|
+
displayKey: `${discount.id}-last-settlement`,
|
|
357
|
+
isEditMode: true,
|
|
358
|
+
isSelected: true,
|
|
359
|
+
isDisabled: true,
|
|
360
|
+
appliedProductDetails: committedDetails,
|
|
361
|
+
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice({
|
|
362
|
+
...discount,
|
|
363
|
+
savedAmount: 0,
|
|
364
|
+
appliedProductDetails: committedDetails
|
|
365
|
+
})
|
|
366
|
+
};
|
|
367
|
+
const currentDetails = (discount.appliedProductDetails || []).slice(committedDetails.length);
|
|
368
|
+
const canApplyToNewProducts = !discount.isDisabled && (((_c2 = discount.applicableProductDetails) == null ? void 0 : _c2.length) || 0) > 0;
|
|
369
|
+
if (!currentDetails.length && !canApplyToNewProducts) return [historyRow];
|
|
370
|
+
return [historyRow, {
|
|
371
|
+
...currentRow,
|
|
372
|
+
displayKey: `${discount.id}-current`,
|
|
373
|
+
isEditMode: false,
|
|
374
|
+
appliedProductDetails: currentDetails,
|
|
375
|
+
savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice({
|
|
376
|
+
...discount,
|
|
377
|
+
savedAmount: 0,
|
|
378
|
+
appliedProductDetails: currentDetails
|
|
379
|
+
})
|
|
380
|
+
}];
|
|
341
381
|
});
|
|
342
382
|
}, [discountList, isBooking4Shop, disabled]);
|
|
343
383
|
if (!isBooking4Shop) return null;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -4,6 +4,6 @@ declare const useSendModal: (bookingId?: number) => {
|
|
|
4
4
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
5
|
handleOpen: () => void;
|
|
6
6
|
handleValuesChange: (val: any) => void;
|
|
7
|
-
handleOk: (values: SendModalValues) => Promise<
|
|
7
|
+
handleOk: (values: SendModalValues) => Promise<boolean | undefined>;
|
|
8
8
|
};
|
|
9
9
|
export default useSendModal;
|
|
@@ -52,7 +52,7 @@ var useClientFn = (_params) => {
|
|
|
52
52
|
num: 5,
|
|
53
53
|
total: 0,
|
|
54
54
|
search: "",
|
|
55
|
-
with: ["
|
|
55
|
+
with: ["contactsInfo"],
|
|
56
56
|
relation_form_id: (_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id
|
|
57
57
|
});
|
|
58
58
|
const paramsRef = (0, import_react.useRef)(params);
|
|
@@ -77,7 +77,7 @@ var useClientFn = (_params) => {
|
|
|
77
77
|
customer_ids,
|
|
78
78
|
...resetParams
|
|
79
79
|
}, returnResult) => {
|
|
80
|
-
var _a2, _b2;
|
|
80
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
81
81
|
let _setLoading;
|
|
82
82
|
if (resetParams.skip === 1) {
|
|
83
83
|
if (resetParams.search) {
|
|
@@ -100,7 +100,9 @@ var useClientFn = (_params) => {
|
|
|
100
100
|
...resetParams.search ? { num: 10 } : {},
|
|
101
101
|
...state.isFranchisee ? { franchisee_customer_ids: customer_ids } : { customer_ids },
|
|
102
102
|
...!state.isFranchisee && !returnResult ? { _config: { abort: true } } : {},
|
|
103
|
-
with: withKey
|
|
103
|
+
with: withKey,
|
|
104
|
+
with_form_records: 1,
|
|
105
|
+
relation_form_id: (_f2 = (_e2 = (_d2 = (_c2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _c2.config) == null ? void 0 : _d2.basic) == null ? void 0 : _e2.appointment_subject) == null ? void 0 : _f2.form_id
|
|
104
106
|
});
|
|
105
107
|
const list = ((data == null ? void 0 : data.list) || []).map((d) => {
|
|
106
108
|
var _a3;
|
|
@@ -108,9 +110,9 @@ var useClientFn = (_params) => {
|
|
|
108
110
|
...d,
|
|
109
111
|
name: getNickname(d),
|
|
110
112
|
id: d.franchisee_customer_id || d.id,
|
|
111
|
-
form_record: ((_a3 = d.
|
|
112
|
-
...item,
|
|
113
|
+
form_record: ((_a3 = d.form_record_list) == null ? void 0 : _a3.map((item) => ({
|
|
113
114
|
...item.data,
|
|
115
|
+
...item,
|
|
114
116
|
form_record_id: item.id
|
|
115
117
|
}))) || []
|
|
116
118
|
};
|
|
@@ -282,7 +282,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
282
282
|
} else {
|
|
283
283
|
const val = await getClients(
|
|
284
284
|
{
|
|
285
|
-
with: ["
|
|
285
|
+
with: ["contactsInfo"],
|
|
286
286
|
relation_form_id: boardConfig == null ? void 0 : boardConfig.form_id,
|
|
287
287
|
skip: 1,
|
|
288
288
|
num: 20,
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormState } from '../model';
|
|
3
1
|
export declare const walkInData: {
|
|
4
2
|
id: number;
|
|
5
3
|
nickname: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const Provider:
|
|
8
|
-
state: FormState;
|
|
9
|
-
} & {
|
|
10
|
-
dispatch: (params: {
|
|
11
|
-
type: string;
|
|
12
|
-
payload: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
}>;
|
|
5
|
+
export declare const Provider: any, Context: any;
|
|
@@ -92,6 +92,9 @@ var Info = (_, ref) => {
|
|
|
92
92
|
const resourcesRef = (0, import_react.useRef)(null);
|
|
93
93
|
const isChangeTotal = (0, import_react.useRef)(false);
|
|
94
94
|
const shouldReallocateBundlePriceRef = (0, import_react.useRef)(false);
|
|
95
|
+
const isEntitlementPrice = (0, import_utils8.hasEntitlementDiscount)(
|
|
96
|
+
state.service.cacheItem
|
|
97
|
+
);
|
|
95
98
|
const [noteModalOpen, setNoteModalOpen] = (0, import_react.useState)(false);
|
|
96
99
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
97
100
|
const [currentTab, setCurrentTab] = (0, import_react.useState)("batch_edit");
|
|
@@ -247,7 +250,7 @@ var Info = (_, ref) => {
|
|
|
247
250
|
}
|
|
248
251
|
};
|
|
249
252
|
const onFinish = (values, cacheItem) => {
|
|
250
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
|
|
253
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2;
|
|
251
254
|
let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
|
|
252
255
|
if (isShowTimeAndResource && !isSuccess) {
|
|
253
256
|
return;
|
|
@@ -281,7 +284,8 @@ var Info = (_, ref) => {
|
|
|
281
284
|
_extend.startDate = startDate;
|
|
282
285
|
_extend.endDate = endDate;
|
|
283
286
|
}
|
|
284
|
-
const
|
|
287
|
+
const isManualPriceChange = isChangeTotal.current && !(0, import_utils8.hasEntitlementDiscount)(_item);
|
|
288
|
+
const shouldReallocatePrice = isManualPriceChange || shouldReallocateBundlePriceRef.current;
|
|
285
289
|
if (shouldReallocatePrice) {
|
|
286
290
|
const discountRatio = new import_decimal.default(values.total).div(_item._extend.origin_total);
|
|
287
291
|
const bundles2 = ((_c2 = _extend == null ? void 0 : _extend.other) == null ? void 0 : _c2.bundle) || [];
|
|
@@ -306,7 +310,9 @@ var Info = (_, ref) => {
|
|
|
306
310
|
_item._time = (/* @__PURE__ */ new Date()).getTime();
|
|
307
311
|
_item._serviceKey = (0, import_utils3.genServiceKey)(_item);
|
|
308
312
|
_item._holderKey = (0, import_utils3.genHolderKey)(_item);
|
|
309
|
-
|
|
313
|
+
const previousItem = _list.find((item) => item._id === _item._id) ?? _list.find((item) => isSameBookingServiceItem(item, _item));
|
|
314
|
+
const isEntitlementQuantityChange = (0, import_utils8.hasEntitlementDiscount)(previousItem) && Number(_item._extend.quantity || 1) !== Number(((_e2 = previousItem == null ? void 0 : previousItem._extend) == null ? void 0 : _e2.quantity) || 1);
|
|
315
|
+
if (!isEntitlementQuantityChange && (((_g2 = (_f2 = _item._extend) == null ? void 0 : _f2.holder_id) == null ? void 0 : _g2.length) > 1 || ((_h2 = _item._extend) == null ? void 0 : _h2.quantity) > 1 && ((_j2 = (_i2 = _item._extend) == null ? void 0 : _i2.holder_id) == null ? void 0 : _j2.length) >= 1)) {
|
|
310
316
|
let holder_ids = _item._extend.holder_id;
|
|
311
317
|
_item._extend.holder_id = holder_ids[0];
|
|
312
318
|
holder_ids = holder_ids.slice(1);
|
|
@@ -325,8 +331,8 @@ var Info = (_, ref) => {
|
|
|
325
331
|
}
|
|
326
332
|
}
|
|
327
333
|
let _id = _item == null ? void 0 : _item._id;
|
|
328
|
-
let groupId = (
|
|
329
|
-
const origin_total = (
|
|
334
|
+
let groupId = (_k2 = _item == null ? void 0 : _item._extend) == null ? void 0 : _k2.groupId;
|
|
335
|
+
const origin_total = (_o2 = (_n2 = (_m2 = (_l2 = _item._extend) == null ? void 0 : _l2.items) == null ? void 0 : _m2[0]) == null ? void 0 : _n2._extend) == null ? void 0 : _o2.origin_total;
|
|
330
336
|
if (groupId) {
|
|
331
337
|
if (shouldReallocatePrice) {
|
|
332
338
|
_item = deleteDiscountList(_item, true);
|
|
@@ -339,7 +345,7 @@ var Info = (_, ref) => {
|
|
|
339
345
|
} else {
|
|
340
346
|
_item = (0, import_utils8.setProductPrice)(_item, {
|
|
341
347
|
newTotal: values.total,
|
|
342
|
-
origin_total: origin_total ?? ((
|
|
348
|
+
origin_total: origin_total ?? ((_p2 = _item._extend) == null ? void 0 : _p2.origin_total)
|
|
343
349
|
});
|
|
344
350
|
const matchById = _list.some((d) => d._id === _id);
|
|
345
351
|
const matchByBooking = !matchById && _list.some((d) => isSameBookingServiceItem(d, _item));
|
|
@@ -348,13 +354,32 @@ var Info = (_, ref) => {
|
|
|
348
354
|
_item = deleteDiscountList(_item, true);
|
|
349
355
|
}
|
|
350
356
|
if (matchById) {
|
|
351
|
-
_list = _list.
|
|
357
|
+
_list = _list.flatMap((d) => {
|
|
358
|
+
if (d._id !== _id) return [d];
|
|
359
|
+
return (0, import_utils8.updateEntitlementQuantity)(
|
|
360
|
+
d,
|
|
361
|
+
{ ..._item, new: 0 }
|
|
362
|
+
).map((item) => ({
|
|
363
|
+
...item,
|
|
364
|
+
_serviceKey: (0, import_utils3.genServiceKey)(item),
|
|
365
|
+
_holderKey: (0, import_utils3.genHolderKey)(item)
|
|
366
|
+
}));
|
|
367
|
+
});
|
|
352
368
|
} else {
|
|
353
369
|
let replaced = false;
|
|
354
370
|
_list = _list.reduce((acc, d) => {
|
|
355
371
|
if (isSameBookingServiceItem(d, _item)) {
|
|
356
372
|
if (!replaced) {
|
|
357
|
-
acc.push(
|
|
373
|
+
acc.push(
|
|
374
|
+
...(0, import_utils8.updateEntitlementQuantity)(
|
|
375
|
+
d,
|
|
376
|
+
{ ..._item, new: 0, _id: d._id }
|
|
377
|
+
).map((item) => ({
|
|
378
|
+
...item,
|
|
379
|
+
_serviceKey: (0, import_utils3.genServiceKey)(item),
|
|
380
|
+
_holderKey: (0, import_utils3.genHolderKey)(item)
|
|
381
|
+
}))
|
|
382
|
+
);
|
|
358
383
|
replaced = true;
|
|
359
384
|
}
|
|
360
385
|
} else {
|
|
@@ -371,7 +396,7 @@ var Info = (_, ref) => {
|
|
|
371
396
|
(0, import_utils6.deleteCacheParams)();
|
|
372
397
|
console.log("_onFinish", _list);
|
|
373
398
|
form.resetFields();
|
|
374
|
-
if (!!((
|
|
399
|
+
if (!!((_q2 = state.service.cacheItem) == null ? void 0 : _q2.new)) {
|
|
375
400
|
window.dispatchEvent(
|
|
376
401
|
new CustomEvent("onAddNewService", {
|
|
377
402
|
detail: {
|
|
@@ -380,7 +405,7 @@ var Info = (_, ref) => {
|
|
|
380
405
|
})
|
|
381
406
|
);
|
|
382
407
|
}
|
|
383
|
-
(
|
|
408
|
+
(_r2 = window.closeBookingEditModal) == null ? void 0 : _r2.call(window);
|
|
384
409
|
_list.sort((a, b) => {
|
|
385
410
|
var _a3, _b3;
|
|
386
411
|
const aHasHolderId = ((_a3 = a._extend) == null ? void 0 : _a3.holder_id) && (Array.isArray(a._extend.holder_id) ? a._extend.holder_id.length > 0 : true);
|
|
@@ -750,7 +775,7 @@ var Info = (_, ref) => {
|
|
|
750
775
|
precision: 2,
|
|
751
776
|
prefix: state.amountSymbol,
|
|
752
777
|
onChange: handleTotalChange,
|
|
753
|
-
disabled: state.channelDisabledEdit,
|
|
778
|
+
disabled: state.channelDisabledEdit || isEntitlementPrice,
|
|
754
779
|
originalValue: ((_f2 = (_e2 = state.service.cacheItem) == null ? void 0 : _e2._extend) == null ? void 0 : _f2.origin_total) || 0,
|
|
755
780
|
placeholder: ((_h2 = (_g2 = state.service.cacheItem) == null ? void 0 : _g2._extend) == null ? void 0 : _h2.origin_total) || "0",
|
|
756
781
|
size: "large",
|
|
@@ -767,7 +792,8 @@ var Info = (_, ref) => {
|
|
|
767
792
|
useTotal,
|
|
768
793
|
(_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total,
|
|
769
794
|
state.amountSymbol,
|
|
770
|
-
state.channelDisabledEdit
|
|
795
|
+
state.channelDisabledEdit,
|
|
796
|
+
isEntitlementPrice
|
|
771
797
|
]);
|
|
772
798
|
const reason = (0, import_react.useMemo)(() => {
|
|
773
799
|
return isReason ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
判断是否需要进入编辑服务页
|
|
9
9
|
*/
|
|
10
|
+
export declare const hasEntitlementDiscount: (item: any) => boolean;
|
|
11
|
+
/** 已提交部分保留原扣次;增加的数量作为新商品交给 OS 重新计算。 */
|
|
12
|
+
export declare const updateEntitlementQuantity: (previous: any, next: any) => any[];
|
|
10
13
|
export declare const getAutoAllocationStorage: (id: string | number) => any;
|
|
11
14
|
export declare const setAutoAllocationStorage: (data: {
|
|
12
15
|
[key: string]: boolean;
|