@pisell/private-materials 3.3.45 → 3.3.47
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 +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +7 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +2 -2
- package/es/components/appointmentBooking/components/Resource/index.js +30 -12
- package/es/components/appointmentBooking/components/Services/index.js +5 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/es/components/appointmentBooking/context.js +7 -3
- package/es/components/appointmentBooking/hooks.js +129 -68
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +6 -1
- package/es/components/booking/addons/index.js +31 -26
- package/es/components/booking/components/footer/amount.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.d.ts +9 -0
- package/es/components/booking/components/footer/utils.js +32 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.js +2 -2
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +4 -1
- package/es/components/booking/info/service2/utils.js +21 -2
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +9 -6
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +56 -18
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +3 -2
- package/es/components/booking/utils.js +5 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
- package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/serve.js +98 -92
- package/es/components/ticketBooking/utils/index.d.ts +1 -0
- package/es/components/ticketBooking/utils/index.js +33 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +3 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
- package/lib/components/appointmentBooking/components/Services/index.js +3 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/lib/components/appointmentBooking/context.js +7 -3
- package/lib/components/appointmentBooking/hooks.js +73 -12
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +2 -0
- package/lib/components/booking/addons/index.js +27 -21
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +9 -0
- package/lib/components/booking/components/footer/utils.js +24 -7
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.js +1 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +4 -1
- package/lib/components/booking/info/service2/utils.js +21 -2
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.js +8 -5
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +59 -23
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +3 -2
- package/lib/components/booking/utils.js +6 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
- package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/serve.js +6 -2
- package/lib/components/ticketBooking/utils/index.d.ts +1 -0
- package/lib/components/ticketBooking/utils/index.js +33 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/package.json +4 -4
|
@@ -27,5 +27,14 @@ export interface ResourceItem {
|
|
|
27
27
|
* @Author: jinglin.tan
|
|
28
28
|
*/
|
|
29
29
|
export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
|
|
30
|
+
/**
|
|
31
|
+
* @title: 格式化商品单价
|
|
32
|
+
* @description:
|
|
33
|
+
* @param {any} item
|
|
34
|
+
* @return {*}
|
|
35
|
+
* @Author: WangHan
|
|
36
|
+
* @Date: 2024-12-23 12:05
|
|
37
|
+
*/
|
|
38
|
+
export declare const formatProductPrice: (item: any) => number;
|
|
30
39
|
export declare const formatValues: (state: any) => any;
|
|
31
40
|
export declare const checkHolderIsError: (state: any) => any;
|
|
@@ -10,7 +10,7 @@ import { isWalkIn } from "../../utils";
|
|
|
10
10
|
import { getSumCapacity } from "../../info2/utilsByBooking";
|
|
11
11
|
import { getDays } from "../../utils";
|
|
12
12
|
import { appointmentTypes } from "../../info/service2/status";
|
|
13
|
-
import { isDaysBooking, formatDayTime, isEventBooking } from "../../info/service2/utils";
|
|
13
|
+
import { isDaysBooking, formatDayTime, isEventBooking, isNormalProductByDurationSchedule } from "../../info/service2/utils";
|
|
14
14
|
import { locales, sendWarningLog } from '@pisell/utils';
|
|
15
15
|
import { PisellToast } from "@pisell/materials";
|
|
16
16
|
var formatNote = function formatNote(data) {
|
|
@@ -47,7 +47,7 @@ export var formatProductOption = function formatProductOption(option) {
|
|
|
47
47
|
return option.map(function (d) {
|
|
48
48
|
return {
|
|
49
49
|
"num": d.num,
|
|
50
|
-
"option_group_item_id": d.product_option_item_id,
|
|
50
|
+
"option_group_item_id": d.product_option_item_id || d.option_group_item_id,
|
|
51
51
|
"option_group_id": d.option_group_id
|
|
52
52
|
// "add_price": Number(d?.add_price),
|
|
53
53
|
};
|
|
@@ -221,7 +221,7 @@ var formatHolders = function formatHolders(state, item, values) {
|
|
|
221
221
|
* @Author: WangHan
|
|
222
222
|
* @Date: 2024-12-23 12:05
|
|
223
223
|
*/
|
|
224
|
-
var formatProductPrice = function formatProductPrice(item) {
|
|
224
|
+
export var formatProductPrice = function formatProductPrice(item) {
|
|
225
225
|
var _item$_extend3, _item$_extend4;
|
|
226
226
|
var other = (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.other;
|
|
227
227
|
var price = Number((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.price);
|
|
@@ -406,6 +406,11 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
406
406
|
return (_d$_extend = d._extend) === null || _d$_extend === void 0 ? void 0 : _d$_extend.holder_id;
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
|
+
if (!isDay && !isEvent) {
|
|
410
|
+
list = list.filter(function (item) {
|
|
411
|
+
return !isNormalProductByDurationSchedule(item);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
409
414
|
var dayParams = {};
|
|
410
415
|
var eventOtherParams = data.eventOtherParams;
|
|
411
416
|
var bookings = [];
|
|
@@ -496,6 +501,21 @@ var formatRelationProducts = function formatRelationProducts(data) {
|
|
|
496
501
|
return relationProducts || [];
|
|
497
502
|
};
|
|
498
503
|
|
|
504
|
+
// 非预约商品格式化
|
|
505
|
+
var formatNormalProducts = function formatNormalProducts(data) {
|
|
506
|
+
var _data$service2;
|
|
507
|
+
var list = ((_data$service2 = data.service) === null || _data$service2 === void 0 ? void 0 : _data$service2.value) || [];
|
|
508
|
+
// 非预约的商品
|
|
509
|
+
list = list.filter(function (item) {
|
|
510
|
+
return isNormalProductByDurationSchedule(item);
|
|
511
|
+
});
|
|
512
|
+
var relationProducts = [];
|
|
513
|
+
relationProducts = list.map(function (item) {
|
|
514
|
+
return formatProducts(item);
|
|
515
|
+
});
|
|
516
|
+
return relationProducts || [];
|
|
517
|
+
};
|
|
518
|
+
|
|
499
519
|
/**
|
|
500
520
|
* @title: 预约主体信息
|
|
501
521
|
* @description:
|
|
@@ -531,7 +551,7 @@ var formatHolder = function formatHolder(state, values) {
|
|
|
531
551
|
|
|
532
552
|
// https://menutech.w.eolink.com/home/api-studio/inside/K2bI3n465fe7244b3dbd6679d87caedfbb0636bf8c29eda/api/2778666/detail/53001549?spaceKey=menutech
|
|
533
553
|
export var formatValues = function formatValues(state) {
|
|
534
|
-
var _values;
|
|
554
|
+
var _values, _values3;
|
|
535
555
|
var values = {
|
|
536
556
|
type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
|
|
537
557
|
platform: "shop",
|
|
@@ -564,13 +584,11 @@ export var formatValues = function formatValues(state) {
|
|
|
564
584
|
|
|
565
585
|
// 主体
|
|
566
586
|
values.holder = formatHolder(state, values);
|
|
567
|
-
if (isDay) {
|
|
587
|
+
if (isDay || isEvent) {
|
|
568
588
|
values.relation_products = formatRelationProducts(state);
|
|
589
|
+
} else {
|
|
590
|
+
values.relation_products = formatNormalProducts(state);
|
|
569
591
|
}
|
|
570
|
-
if (isEvent) {
|
|
571
|
-
values.relation_products = formatRelationProducts(state);
|
|
572
|
-
}
|
|
573
|
-
|
|
574
592
|
// 服务
|
|
575
593
|
values.bookings = formatBookings(state, values);
|
|
576
594
|
|
|
@@ -589,6 +607,9 @@ export var formatValues = function formatValues(state) {
|
|
|
589
607
|
// is_bundle_price_calculated 用于区分商品的price是总价,还是商品的单价
|
|
590
608
|
// values.is_bundle_price_calculated = 1
|
|
591
609
|
}
|
|
610
|
+
if (!((_values3 = values) !== null && _values3 !== void 0 && (_values3 = _values3.bookings) !== null && _values3 !== void 0 && _values3.length)) {
|
|
611
|
+
values.type = 'virtual';
|
|
612
|
+
}
|
|
592
613
|
return values;
|
|
593
614
|
};
|
|
594
615
|
|
|
@@ -596,7 +617,8 @@ export var formatValues = function formatValues(state) {
|
|
|
596
617
|
export var checkHolderIsError = function checkHolderIsError(state) {
|
|
597
618
|
var _state$client;
|
|
598
619
|
var holderError = state.service.value.some(function (item) {
|
|
599
|
-
|
|
620
|
+
// 普通商品不需要检测holder
|
|
621
|
+
return !item._extend.holder_id && !isNormalProductByDurationSchedule(item);
|
|
600
622
|
});
|
|
601
623
|
var clientId = (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id;
|
|
602
624
|
if (holderError && (!clientId || clientId === 0 || clientId === 1)) {
|
|
@@ -28,7 +28,7 @@ import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
|
28
28
|
import TabProduct from "../../../components/TabProduct";
|
|
29
29
|
import AddButton from "../../../components/addButton";
|
|
30
30
|
import Drawer from "../../../components/drawer";
|
|
31
|
-
import { formatProductListByCategory, isSessionProduct, request } from "../../../utils";
|
|
31
|
+
import { formatProductListByCategory, getIsEject, isSessionProduct, request } from "../../../utils";
|
|
32
32
|
import DateRange from "../../dateRange";
|
|
33
33
|
import { Context } from "../../model";
|
|
34
34
|
import { appointmentTypes, inputDateCol } from "../../service2/status";
|
|
@@ -310,7 +310,7 @@ var Info = function Info(props) {
|
|
|
310
310
|
var handleSelectProduct = useMemoizedFn(function (item, type) {
|
|
311
311
|
var isSession = isSessionProduct(item);
|
|
312
312
|
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
313
|
-
var isEject =
|
|
313
|
+
var isEject = getIsEject(item, type);
|
|
314
314
|
|
|
315
315
|
// 跨日预约开启单规格 组合规格 套餐
|
|
316
316
|
if (isDay) {
|
|
@@ -55,6 +55,9 @@ export declare const handleChangeHolder: (products: any[], currentItem: any, oth
|
|
|
55
55
|
export declare const updateServices: (state: any, currentItem: any, type?: string, other?: any, actions?: any) => any;
|
|
56
56
|
export declare const formItems: (items: any[]) => any[];
|
|
57
57
|
export declare const getIsSubjectRequire: (state: any) => boolean;
|
|
58
|
+
export declare const isNormalProductByDurationSchedule: (item: any) => boolean;
|
|
59
|
+
export declare const isAllNormalProduct: (items: any[]) => boolean;
|
|
60
|
+
export declare const isAllNormalProductByState: (state: any) => boolean;
|
|
58
61
|
/**
|
|
59
62
|
* @title: 格式化商品数据
|
|
60
63
|
* @description:
|
|
@@ -241,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
241
244
|
* @Author: WangHan
|
|
242
245
|
* @Date: 2024-12-24 11:32
|
|
243
246
|
*/
|
|
244
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
|
247
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
|
@@ -523,6 +523,22 @@ export var getIsSubjectRequire = function getIsSubjectRequire(state) {
|
|
|
523
523
|
var _state$bookingConfig2, _state$bookingConfig3;
|
|
524
524
|
return (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.appointment_subject) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.type) === 'form' && (state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.config) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.basic) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.subject_require) === 'require';
|
|
525
525
|
};
|
|
526
|
+
|
|
527
|
+
// 非预约商品 通过时长和日程判断是否是普通商品
|
|
528
|
+
export var isNormalProductByDurationSchedule = function isNormalProductByDurationSchedule(item) {
|
|
529
|
+
var _item$schedules, _item$scheduleIds;
|
|
530
|
+
return !(item !== null && item !== void 0 && item.duration) && !(item !== null && item !== void 0 && (_item$schedules = item.schedules) !== null && _item$schedules !== void 0 && _item$schedules.length) && !((_item$scheduleIds = item['schedule.ids']) !== null && _item$scheduleIds !== void 0 && _item$scheduleIds.length);
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
// 是否全部是普通商品
|
|
534
|
+
export var isAllNormalProduct = function isAllNormalProduct(items) {
|
|
535
|
+
return items.every(function (item) {
|
|
536
|
+
return isNormalProductByDurationSchedule(item);
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
export var isAllNormalProductByState = function isAllNormalProductByState(state) {
|
|
540
|
+
return isAllNormalProduct(state.service.value);
|
|
541
|
+
};
|
|
526
542
|
var getGeneralParams = function getGeneralParams(item, state, isParallelResource) {
|
|
527
543
|
var _formData$, _item$_extend5, _item$_extend6, _item$_extend7, _item$_extend8;
|
|
528
544
|
var pet = state.pet,
|
|
@@ -582,12 +598,14 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
582
598
|
lists: mapListItems(resource)
|
|
583
599
|
}];
|
|
584
600
|
}
|
|
601
|
+
var isNormalProduct = isNormalProductByDurationSchedule(item);
|
|
585
602
|
return _objectSpread({
|
|
586
603
|
format: ['HH:mm', 'HH:mm'],
|
|
587
604
|
show_time: true,
|
|
588
605
|
duration_type: 'minutes',
|
|
589
606
|
// 当前可选择holder列表
|
|
590
607
|
holders: formatHolders(holders),
|
|
608
|
+
isShowChangeHolder: !isNormalProduct,
|
|
591
609
|
isShowAction: isShowAddTime(state, item),
|
|
592
610
|
actionText: locales.getText('page.booking.text.add-time'),
|
|
593
611
|
isMultipleResource: true,
|
|
@@ -595,8 +613,8 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
595
613
|
isErrorHolder: getIsSubjectRequire(state),
|
|
596
614
|
addHolderButtonText: (formData === null || formData === void 0 || (_formData$ = formData[0]) === null || _formData$ === void 0 || (_formData$ = _formData$.form) === null || _formData$ === void 0 ? void 0 : _formData$.title) || "",
|
|
597
615
|
holder_id: item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.holder_id,
|
|
598
|
-
start_date: item === null || item === void 0 || (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.startDate,
|
|
599
|
-
end_date: (item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.endDate) || (item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date)
|
|
616
|
+
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.startDate : "",
|
|
617
|
+
end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.endDate) || (item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date) : ""
|
|
600
618
|
}, parallelResourceOtherParams);
|
|
601
619
|
};
|
|
602
620
|
var calcAddTimeTotalPrice = function calcAddTimeTotalPrice(total, addTimeProducts) {
|
|
@@ -634,6 +652,7 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
634
652
|
errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
|
|
635
653
|
}
|
|
636
654
|
var generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
|
|
655
|
+
console.log(isNormalProduct, 'isNormalProduct');
|
|
637
656
|
return _objectSpread(_objectSpread({
|
|
638
657
|
id: item === null || item === void 0 ? void 0 : item.id,
|
|
639
658
|
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
@@ -95,7 +95,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
|
|
|
95
95
|
if (renderType === 'eventBooking') {
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
|
-
var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 6813, 8609, 8610, 8782, 1285, 6124, 8727, 5538];
|
|
98
|
+
var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 6813, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988];
|
|
99
99
|
return booking4Shops.includes(shopId);
|
|
100
100
|
};
|
|
101
101
|
function generateDateRange(start, end) {
|
|
@@ -30,9 +30,10 @@ import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
|
30
30
|
import { getProductDetail } from "../../../info/service/serve";
|
|
31
31
|
import { getIsBundleOrCombination } from "../../../info/utils";
|
|
32
32
|
import { getProductExtend } from "./utils";
|
|
33
|
-
import { formatProductListByCategory, getProductTotalPrice, isSessionProduct, request } from "../../../utils";
|
|
33
|
+
import { formatProductListByCategory, getIsEject, getProductTotalPrice, isSessionProduct, request } from "../../../utils";
|
|
34
34
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
35
35
|
import { useUpdateEffect } from 'ahooks';
|
|
36
|
+
import { isNormalProductByDurationSchedule } from "../../../info/service2/utils";
|
|
36
37
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
|
|
37
38
|
var Info = function Info(props) {
|
|
38
39
|
var _state$client2, _state$service2, _state$service4, _state$service5;
|
|
@@ -241,7 +242,7 @@ var Info = function Info(props) {
|
|
|
241
242
|
var _state$client3;
|
|
242
243
|
var isSession = isSessionProduct(item);
|
|
243
244
|
// 是否有单规格 组合规格 套餐, 或者session商品 如果没有不需要打开弹窗
|
|
244
|
-
var isEject =
|
|
245
|
+
var isEject = getIsEject(item, type);
|
|
245
246
|
var lock = false;
|
|
246
247
|
state.action({
|
|
247
248
|
type: 'pisell1.handleOpenProductModal',
|
|
@@ -249,10 +250,11 @@ var Info = function Info(props) {
|
|
|
249
250
|
id: item.id,
|
|
250
251
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
251
252
|
showConfig: {
|
|
252
|
-
option:
|
|
253
|
+
option: true,
|
|
253
254
|
session: isSession,
|
|
254
|
-
variant:
|
|
255
|
-
package: true
|
|
255
|
+
variant: true,
|
|
256
|
+
package: true,
|
|
257
|
+
number: isNormalProductByDurationSchedule(item)
|
|
256
258
|
},
|
|
257
259
|
is_eject: isEject ? 1 : 0,
|
|
258
260
|
isOS: isSession,
|
|
@@ -278,13 +280,14 @@ var Info = function Info(props) {
|
|
|
278
280
|
_key: e.key,
|
|
279
281
|
_extend: {
|
|
280
282
|
start_date: state.date.value,
|
|
281
|
-
quantity: 1,
|
|
283
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
|
282
284
|
price: _detail.price,
|
|
283
285
|
product_name: item.title,
|
|
284
286
|
other: other
|
|
285
287
|
},
|
|
286
288
|
new: 1
|
|
287
289
|
});
|
|
290
|
+
console.log(cacheItem, 'cacheItem', e);
|
|
288
291
|
var _total = getProductTotalPrice(cacheItem);
|
|
289
292
|
// 用于折扣 可修改
|
|
290
293
|
cacheItem._extend.total = _total;
|
|
@@ -34,9 +34,10 @@ import { getErrorList } from "../../utilsByBooking";
|
|
|
34
34
|
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj, setDefaultCapacitys } from "../addService/utils";
|
|
35
35
|
import { PisellAdjustPriceInputNumber } from '@pisell/materials';
|
|
36
36
|
import { editSessionProduct } from "../../../info/utils";
|
|
37
|
+
import { isNormalProductByDurationSchedule } from "../../../info/service2/utils";
|
|
37
38
|
var submitLock = false;
|
|
38
39
|
var Info = function Info(_, ref) {
|
|
39
|
-
var _state$bookingConfig2, _state$service$cacheI4, _state$service$cacheI5, _state$
|
|
40
|
+
var _state$service3, _state$bookingConfig2, _state$service$cacheI4, _state$service$cacheI5, _state$service6, _state$service8, _window$BaseMaterials, _state$service$cacheI6, _state$service9, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service$cacheI10, _state$bookingConfig3, _state$service$resour;
|
|
40
41
|
var _Form$useForm = Form.useForm(),
|
|
41
42
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
42
43
|
form = _Form$useForm2[0];
|
|
@@ -49,6 +50,10 @@ var Info = function Info(_, ref) {
|
|
|
49
50
|
dispatch = _useContext.dispatch;
|
|
50
51
|
var resourcesRef = useRef(null);
|
|
51
52
|
var isChangeTotal = useRef(false);
|
|
53
|
+
var isNormalProduct = useMemo(function () {
|
|
54
|
+
var _state$service, _state$service2;
|
|
55
|
+
return (state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.cacheItem) && isNormalProductByDurationSchedule(state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.cacheItem);
|
|
56
|
+
}, [state === null || state === void 0 || (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.cacheItem]);
|
|
52
57
|
|
|
53
58
|
// 当前商品信息+ 表单信息
|
|
54
59
|
var getCurrentCacheItem = function getCurrentCacheItem(_cacheItem) {
|
|
@@ -205,7 +210,7 @@ var Info = function Info(_, ref) {
|
|
|
205
210
|
var onFinish = function onFinish(values) {
|
|
206
211
|
var _resourcesRef$current;
|
|
207
212
|
var isSuccess = (_resourcesRef$current = resourcesRef.current) === null || _resourcesRef$current === void 0 ? void 0 : _resourcesRef$current.check();
|
|
208
|
-
if (!isSuccess) {
|
|
213
|
+
if (isShowTimeAndResource && !isSuccess) {
|
|
209
214
|
return;
|
|
210
215
|
}
|
|
211
216
|
// 防止多次提交, 增加锁
|
|
@@ -371,16 +376,16 @@ var Info = function Info(_, ref) {
|
|
|
371
376
|
getDiscount();
|
|
372
377
|
}, [useTotal, (_state$service$cacheI5 = state.service.cacheItem) === null || _state$service$cacheI5 === void 0 || (_state$service$cacheI5 = _state$service$cacheI5._extend) === null || _state$service$cacheI5 === void 0 ? void 0 : _state$service$cacheI5.origin_total]);
|
|
373
378
|
var isDiscount = useMemo(function () {
|
|
374
|
-
var _state$
|
|
375
|
-
if (!((_state$
|
|
379
|
+
var _state$service4, _state$service5;
|
|
380
|
+
if (!((_state$service4 = state.service) !== null && _state$service4 !== void 0 && _state$service4.cacheItem)) {
|
|
376
381
|
return false;
|
|
377
382
|
}
|
|
378
|
-
return useTotal != ((_state$
|
|
379
|
-
}, [useTotal, (_state$
|
|
383
|
+
return useTotal != ((_state$service5 = state.service) === null || _state$service5 === void 0 || (_state$service5 = _state$service5.cacheItem) === null || _state$service5 === void 0 ? void 0 : _state$service5._extend.origin_total);
|
|
384
|
+
}, [useTotal, (_state$service6 = state.service) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.cacheItem) === null || _state$service6 === void 0 ? void 0 : _state$service6._extend.origin_total]);
|
|
380
385
|
var bundles = useMemo(function () {
|
|
381
|
-
var _state$
|
|
382
|
-
return ((_state$
|
|
383
|
-
}, [(_state$
|
|
386
|
+
var _state$service7;
|
|
387
|
+
return ((_state$service7 = state.service) === null || _state$service7 === void 0 || (_state$service7 = _state$service7.cacheItem) === null || _state$service7 === void 0 || (_state$service7 = _state$service7._extend) === null || _state$service7 === void 0 || (_state$service7 = _state$service7.other) === null || _state$service7 === void 0 ? void 0 : _state$service7.bundle) || [];
|
|
388
|
+
}, [(_state$service8 = state.service) === null || _state$service8 === void 0 || (_state$service8 = _state$service8.cacheItem) === null || _state$service8 === void 0 || (_state$service8 = _state$service8._extend) === null || _state$service8 === void 0 || (_state$service8 = _state$service8.other) === null || _state$service8 === void 0 ? void 0 : _state$service8.bundle]);
|
|
384
389
|
|
|
385
390
|
/**
|
|
386
391
|
* @title: 编辑商品
|
|
@@ -415,14 +420,17 @@ var Info = function Info(_, ref) {
|
|
|
415
420
|
id: item.id,
|
|
416
421
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
417
422
|
showConfig: {
|
|
418
|
-
option:
|
|
423
|
+
option: true,
|
|
419
424
|
session: isSession,
|
|
420
|
-
variant:
|
|
421
|
-
package: true
|
|
425
|
+
variant: true,
|
|
426
|
+
package: true,
|
|
427
|
+
number: isNormalProductByDurationSchedule(item)
|
|
422
428
|
},
|
|
423
429
|
isOS: isSession,
|
|
424
430
|
customer_id: (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id,
|
|
425
|
-
value: _objectSpread(_objectSpread({
|
|
431
|
+
value: _objectSpread(_objectSpread({
|
|
432
|
+
quantity: item._extend.quantity
|
|
433
|
+
}, item._extend.other), sessionValue)
|
|
426
434
|
},
|
|
427
435
|
callback: function callback(e, extension_type, detail) {
|
|
428
436
|
var _cacheItem$_extend;
|
|
@@ -436,6 +444,7 @@ var Info = function Info(_, ref) {
|
|
|
436
444
|
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
437
445
|
_key: e.key,
|
|
438
446
|
_extend: _objectSpread(_objectSpread(_objectSpread({}, item._extend), values), {}, {
|
|
447
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || (values === null || values === void 0 ? void 0 : values.quantity) || 1,
|
|
439
448
|
// 覆盖选择的规格和套餐
|
|
440
449
|
other: other
|
|
441
450
|
}),
|
|
@@ -477,7 +486,8 @@ var Info = function Info(_, ref) {
|
|
|
477
486
|
// 更新表单内的商品价格
|
|
478
487
|
form.setFieldsValue({
|
|
479
488
|
total: _total,
|
|
480
|
-
capacity: (_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.capacity
|
|
489
|
+
capacity: (_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.capacity,
|
|
490
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || (values === null || values === void 0 ? void 0 : values.quantity) || 1
|
|
481
491
|
});
|
|
482
492
|
}
|
|
483
493
|
});
|
|
@@ -515,7 +525,13 @@ var Info = function Info(_, ref) {
|
|
|
515
525
|
var handleTotalChange = function handleTotalChange(number) {
|
|
516
526
|
isChangeTotal.current = true;
|
|
517
527
|
};
|
|
518
|
-
|
|
528
|
+
var isShowTimeAndResource = useMemo(function () {
|
|
529
|
+
// 非活动预约 非普通商品时展示
|
|
530
|
+
if (state.renderType !== 'eventBooking' && !isNormalProduct) {
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
533
|
+
return false;
|
|
534
|
+
}, [state.renderType, isNormalProduct]);
|
|
519
535
|
var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
|
|
520
536
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
|
|
521
537
|
titleNoWrap: true
|
|
@@ -556,7 +572,7 @@ var Info = function Info(_, ref) {
|
|
|
556
572
|
className: "current-service-info-name-wrap"
|
|
557
573
|
}, /*#__PURE__*/React.createElement("div", {
|
|
558
574
|
className: "current-service-info-name"
|
|
559
|
-
}, ((_state$
|
|
575
|
+
}, ((_state$service9 = state.service) === null || _state$service9 === void 0 || (_state$service9 = _state$service9.cacheItem) === null || _state$service9 === void 0 || (_state$service9 = _state$service9._extend) === null || _state$service9 === void 0 ? void 0 : _state$service9.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
|
|
560
576
|
onClick: handleEdit
|
|
561
577
|
}, locales.getText('pisell2.text.edit')), !state.isBookingCreatePage && /*#__PURE__*/React.createElement(Button, {
|
|
562
578
|
onClick: handleChange
|
|
@@ -595,7 +611,7 @@ var Info = function Info(_, ref) {
|
|
|
595
611
|
name: "discount_reason"
|
|
596
612
|
}, /*#__PURE__*/React.createElement(Input.TextArea, {
|
|
597
613
|
size: "large"
|
|
598
|
-
}))) : null,
|
|
614
|
+
}))) : null, isShowTimeAndResource && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, {
|
|
599
615
|
span: 12
|
|
600
616
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
601
617
|
label: locales.getText('pisell2.text.start_time'),
|
|
@@ -644,7 +660,29 @@ var Info = function Info(_, ref) {
|
|
|
644
660
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
645
661
|
hidden: true,
|
|
646
662
|
name: "quantity"
|
|
647
|
-
}, /*#__PURE__*/React.createElement(InputNumber, null)))
|
|
663
|
+
}, /*#__PURE__*/React.createElement(InputNumber, null))), isNormalProduct && /*#__PURE__*/React.createElement(Col, {
|
|
664
|
+
span: 24
|
|
665
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
666
|
+
label: locales.getText('pisell2.text.quantity'),
|
|
667
|
+
name: "quantity",
|
|
668
|
+
rules: [{
|
|
669
|
+
required: true
|
|
670
|
+
}]
|
|
671
|
+
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
672
|
+
size: "large",
|
|
673
|
+
style: {
|
|
674
|
+
width: '100%'
|
|
675
|
+
},
|
|
676
|
+
min: 1,
|
|
677
|
+
max: 999999,
|
|
678
|
+
formatter: function formatter(value) {
|
|
679
|
+
if (value !== undefined) {
|
|
680
|
+
// 向下取整
|
|
681
|
+
return Math.floor(value);
|
|
682
|
+
}
|
|
683
|
+
return value;
|
|
684
|
+
}
|
|
685
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
648
686
|
className: "pisell-lowcode__booking-service-body-edit-footer"
|
|
649
687
|
}, /*#__PURE__*/React.createElement("div", {
|
|
650
688
|
className: "pisell-lowcode__booking-service-delete-wrap",
|
|
@@ -141,6 +141,7 @@ export declare const deleteCacheParams: () => void;
|
|
|
141
141
|
*/
|
|
142
142
|
export declare const getDays: (cacheItem: any, type: 'minutes' | 'days') => any;
|
|
143
143
|
export declare const isSessionProduct: (cacheItem: any) => boolean;
|
|
144
|
+
export declare const getIsEject: (item: any, type: 'select' | 'detail') => boolean;
|
|
144
145
|
/**
|
|
145
146
|
* @title: 创建一个服务商品
|
|
146
147
|
* @description:
|
|
@@ -163,10 +164,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
163
164
|
export declare const getDuration: (duration: number | {
|
|
164
165
|
type: string;
|
|
165
166
|
value: number;
|
|
166
|
-
}) => number |
|
|
167
|
+
}) => number | {
|
|
167
168
|
type: string;
|
|
168
169
|
value: number;
|
|
169
|
-
};
|
|
170
|
+
} | "flexible";
|
|
170
171
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
171
172
|
export declare const getIsEdit: (state: any) => boolean;
|
|
172
173
|
export {};
|
|
@@ -635,6 +635,11 @@ export var getDays = function getDays(cacheItem, type) {
|
|
|
635
635
|
export var isSessionProduct = function isSessionProduct(cacheItem) {
|
|
636
636
|
return ['session_product', 'session_ticket'].includes(cacheItem.extension_type);
|
|
637
637
|
};
|
|
638
|
+
export var getIsEject = function getIsEject(item, type) {
|
|
639
|
+
var isSession = isSessionProduct(item);
|
|
640
|
+
// 是否有单规格 组合规格 套餐, 或者session商品 如果没有不需要打开弹窗
|
|
641
|
+
return type === 'detail' || item.bundle_group_count > 0 || item.option_group_count > 0 || item.is_variant > 0 || isSession;
|
|
642
|
+
};
|
|
638
643
|
|
|
639
644
|
/**
|
|
640
645
|
* @title: 创建一个服务商品
|
|
@@ -9,7 +9,7 @@ import { PosProps } from './const';
|
|
|
9
9
|
*/
|
|
10
10
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
11
11
|
className?: string | undefined;
|
|
12
|
-
onChange?: ((status: "page" | "success" | "
|
|
12
|
+
onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
13
13
|
[keys: string]: unknown;
|
|
14
14
|
} | undefined, other?: any) => void) | undefined;
|
|
15
15
|
onClose: () => void;
|
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "page" | "success" | "
|
|
14
|
+
onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -295,9 +295,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
295
295
|
name?: string | undefined;
|
|
296
296
|
symbol?: string | undefined;
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
|
-
mode?: "
|
|
298
|
+
mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | undefined;
|
|
301
301
|
action?: "amount" | "deviceList" | "pay" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|