@pisell/private-materials 3.0.203 → 3.0.205
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +27 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +33 -18
- package/es/components/booking/components/customSelect/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +2 -6
- package/es/components/booking/components/footer/amount.js +22 -46
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +35 -266
- package/es/components/booking/forms/model.d.ts +1 -1
- package/es/components/booking/info/addServiceVariant/index.js +1 -8
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
- package/es/components/booking/info/clientVariant/vertical/index.js +9 -124
- package/es/components/booking/info/main.js +15 -28
- package/es/components/booking/info/model.js +0 -3
- package/es/components/booking/info/pet/index.js +5 -54
- package/es/components/booking/info/service/addService/index.js +96 -187
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -12
- package/es/components/booking/info/service/addService/utils.js +26 -103
- package/es/components/booking/info/service/editService/index.js +132 -435
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/service/serve.d.ts +0 -10
- package/es/components/booking/info/service/serve.js +0 -28
- package/es/components/booking/info/utils.d.ts +0 -20
- package/es/components/booking/info/utils.js +0 -37
- package/es/components/booking/locales.d.ts +0 -66
- package/es/components/booking/locales.js +3 -81
- package/es/components/booking/model.d.ts +1 -5
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -1
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +26 -143
- package/es/components/eftpos/form/index.js +12 -6
- package/es/components/eftpos/group/index.d.ts +1 -2
- package/es/components/eftpos/group/index.js +1 -2
- package/es/components/eftpos/hooks.d.ts +4 -4
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftpos/receipt/index.d.ts +24 -0
- package/es/components/eftpos/receipt/index.js +96 -0
- package/es/components/eftposPay/app.d.ts +11 -0
- package/es/components/eftposPay/app.js +173 -0
- package/es/components/eftposPay/component/fail/failCustom.js +1 -0
- package/es/components/eftposPay/component/fail/index.js +1 -0
- package/es/components/eftposPay/component/manual/index.js +4 -1
- package/es/components/eftposPay/component/step/index.d.ts +6 -6
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +27 -1
- package/es/components/eftposPay/const.js +22 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/device.js +2 -2
- package/es/components/eftposPay/helper.d.ts +6 -0
- package/es/components/eftposPay/helper.js +24 -4
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +22 -16
- package/es/components/eftposPay/index.d.ts +1 -1
- package/es/components/eftposPay/index.js +130 -179
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +15 -0
- package/es/components/eftposPay/payo/config.js +20 -8
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +10 -0
- package/es/components/eftposPay/tip.js +177 -0
- package/es/components/eftposPay/tip.less +9 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/es/components/eftposPay/tyro/index.js +55 -22
- package/es/components/eftposPay/windcave/helper.d.ts +1 -1
- package/es/components/eftposPay/windcave/windcave.js +17 -6
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- package/lib/components/booking/components/customSelect/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +2 -6
- package/lib/components/booking/components/footer/amount.js +8 -27
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +35 -161
- package/lib/components/booking/forms/model.d.ts +1 -1
- package/lib/components/booking/info/addServiceVariant/index.js +0 -5
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
- package/lib/components/booking/info/clientVariant/vertical/index.js +11 -87
- package/lib/components/booking/info/main.js +9 -17
- package/lib/components/booking/info/model.js +0 -3
- package/lib/components/booking/info/pet/index.js +25 -61
- package/lib/components/booking/info/service/addService/index.js +84 -115
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
- package/lib/components/booking/info/service/addService/utils.js +10 -58
- package/lib/components/booking/info/service/editService/index.js +182 -425
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/service/serve.d.ts +0 -10
- package/lib/components/booking/info/service/serve.js +2 -7
- package/lib/components/booking/info/utils.d.ts +0 -20
- package/lib/components/booking/info/utils.js +0 -41
- package/lib/components/booking/locales.d.ts +0 -66
- package/lib/components/booking/locales.js +3 -69
- package/lib/components/booking/model.d.ts +1 -5
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +18 -89
- package/lib/components/eftpos/form/index.js +12 -6
- package/lib/components/eftpos/group/index.d.ts +1 -2
- package/lib/components/eftpos/group/index.js +0 -1
- package/lib/components/eftpos/hooks.d.ts +4 -4
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftpos/receipt/index.d.ts +24 -0
- package/lib/components/eftpos/receipt/index.js +88 -0
- package/lib/components/eftposPay/app.d.ts +11 -0
- package/lib/components/eftposPay/app.js +166 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
- package/lib/components/eftposPay/component/fail/index.js +1 -1
- package/lib/components/eftposPay/component/manual/index.js +19 -5
- package/lib/components/eftposPay/component/step/index.d.ts +6 -6
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +27 -1
- package/lib/components/eftposPay/const.js +18 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/device.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +6 -0
- package/lib/components/eftposPay/helper.js +29 -4
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +8 -2
- package/lib/components/eftposPay/index.d.ts +1 -1
- package/lib/components/eftposPay/index.js +106 -144
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +15 -0
- package/lib/components/eftposPay/payo/config.js +33 -9
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +10 -0
- package/lib/components/eftposPay/tip.js +159 -0
- package/lib/components/eftposPay/tip.less +9 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/lib/components/eftposPay/tyro/index.js +40 -9
- package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
- package/lib/components/eftposPay/windcave/windcave.js +29 -6
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +5 -5
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/info/Provider.d.ts +0 -0
- package/es/components/booking/info/Provider.js +0 -54
- package/es/components/booking/info/dateRange/index.d.ts +0 -5
- package/es/components/booking/info/dateRange/index.js +0 -98
- package/es/components/booking/info/dateRange/index.less +0 -21
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/es/components/booking/info/pet/ChangePetModal/index.js +0 -134
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
- package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
- package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
- package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceManager/index.js +0 -277
- package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/es/components/booking/info/service/serviceManager/utils.js +0 -0
- package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/es/components/booking/info/service2/Group/utils.js +0 -146
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -152
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
- package/es/components/booking/info/service2/index.d.ts +0 -6
- package/es/components/booking/info/service2/index.js +0 -57
- package/es/components/booking/info/service2/status.d.ts +0 -31
- package/es/components/booking/info/service2/status.js +0 -78
- package/es/components/booking/info/service2/utils.d.ts +0 -237
- package/es/components/booking/info/service2/utils.js +0 -1064
- package/es/components/booking/materiels/holder/index.d.ts +0 -7
- package/es/components/booking/materiels/holder/index.js +0 -51
- package/es/components/shoppingCart/Provider.d.ts +0 -3
- package/es/components/shoppingCart/Provider.js +0 -86
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +0 -68
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/index.js +0 -72
- package/es/components/shoppingCart/components/Cart/index.less +0 -68
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Empty/index.js +0 -14
- package/es/components/shoppingCart/components/Empty/index.less +0 -19
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Render/index.js +0 -69
- package/es/components/shoppingCart/components/Render/index.less +0 -2
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -132
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useAddService.js +0 -23
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useClearCart.js +0 -59
- package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useContext.js +0 -5
- package/es/components/shoppingCart/index.d.ts +0 -4
- package/es/components/shoppingCart/index.js +0 -24
- package/es/components/shoppingCart/locales.d.ts +0 -33
- package/es/components/shoppingCart/locales.js +0 -38
- package/es/components/shoppingCart/mock.d.ts +0 -40
- package/es/components/shoppingCart/mock.js +0 -40
- package/es/components/shoppingCart/status.d.ts +0 -2
- package/es/components/shoppingCart/status.js +0 -22
- package/es/components/shoppingCart/type.d.ts +0 -39
- package/es/components/shoppingCart/type.js +0 -1
- package/es/components/shoppingCart/utils.d.ts +0 -63
- package/es/components/shoppingCart/utils.js +0 -116
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/info/Provider.d.ts +0 -0
- package/lib/components/booking/info/Provider.js +0 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -5
- package/lib/components/booking/info/dateRange/index.js +0 -111
- package/lib/components/booking/info/dateRange/index.less +0 -21
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -121
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
- package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
- package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceManager/index.js +0 -207
- package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
- package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/lib/components/booking/info/service2/Group/utils.js +0 -142
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -115
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
- package/lib/components/booking/info/service2/index.d.ts +0 -6
- package/lib/components/booking/info/service2/index.js +0 -75
- package/lib/components/booking/info/service2/status.d.ts +0 -31
- package/lib/components/booking/info/service2/status.js +0 -81
- package/lib/components/booking/info/service2/utils.d.ts +0 -237
- package/lib/components/booking/info/service2/utils.js +0 -678
- package/lib/components/booking/materiels/holder/index.d.ts +0 -7
- package/lib/components/booking/materiels/holder/index.js +0 -65
- package/lib/components/shoppingCart/Provider.d.ts +0 -3
- package/lib/components/shoppingCart/Provider.js +0 -110
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/Product.js +0 -73
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/index.js +0 -77
- package/lib/components/shoppingCart/components/Cart/index.less +0 -68
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Empty/index.js +0 -43
- package/lib/components/shoppingCart/components/Empty/index.less +0 -19
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Render/index.js +0 -75
- package/lib/components/shoppingCart/components/Render/index.less +0 -2
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useClearCart.js +0 -66
- package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useContext.js +0 -31
- package/lib/components/shoppingCart/index.d.ts +0 -4
- package/lib/components/shoppingCart/index.js +0 -60
- package/lib/components/shoppingCart/locales.d.ts +0 -33
- package/lib/components/shoppingCart/locales.js +0 -56
- package/lib/components/shoppingCart/mock.d.ts +0 -40
- package/lib/components/shoppingCart/mock.js +0 -76
- package/lib/components/shoppingCart/status.d.ts +0 -2
- package/lib/components/shoppingCart/status.js +0 -60
- package/lib/components/shoppingCart/type.d.ts +0 -39
- package/lib/components/shoppingCart/type.js +0 -17
- package/lib/components/shoppingCart/utils.d.ts +0 -63
- package/lib/components/shoppingCart/utils.js +0 -86
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -48,8 +48,6 @@ var import_icons = require("@ant-design/icons");
|
|
|
48
48
|
var import_serve = require("./serve");
|
|
49
49
|
var import_serve2 = require("../../info2/serve");
|
|
50
50
|
var import_utils3 = require("../../info/utils");
|
|
51
|
-
var import_utils4 = require("../../info/service2/utils");
|
|
52
|
-
var import_AppointmentProductModal = __toESM(require("./AppointmentProductModal"));
|
|
53
51
|
var Footer = (props) => {
|
|
54
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
55
53
|
const { state, buttons, dispatch, source } = props;
|
|
@@ -57,7 +55,6 @@ var Footer = (props) => {
|
|
|
57
55
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
58
56
|
const [checkoutLoading, setCheckoutLoading] = (0, import_react.useState)(false);
|
|
59
57
|
const [isShowPaymentLink, setIsShowPaymentLink] = (0, import_react.useState)(false);
|
|
60
|
-
const appointmentProductRef = (0, import_react.useRef)(null);
|
|
61
58
|
const context = (0, import_useEngineContext.default)();
|
|
62
59
|
const { isTerminal, interaction, store, storage } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
63
60
|
(0, import_react.useEffect)(() => {
|
|
@@ -213,11 +210,6 @@ var Footer = (props) => {
|
|
|
213
210
|
};
|
|
214
211
|
const handleCheckout = async () => {
|
|
215
212
|
if (isEdit) {
|
|
216
|
-
if ((0, import_utils4.isDayBooking)(state)) {
|
|
217
|
-
const isHasDayProducts = handleDaySubmit();
|
|
218
|
-
if (isHasDayProducts)
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
213
|
const res = await handleSave({ type: "checkout" });
|
|
222
214
|
goCheckout((res == null ? void 0 : res.order_id) || state.bookingId);
|
|
223
215
|
return;
|
|
@@ -244,7 +236,7 @@ var Footer = (props) => {
|
|
|
244
236
|
if ((0, import_utils3.isBooking4Shop)(
|
|
245
237
|
(_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils.store) == null ? void 0 : _a2.getState) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id,
|
|
246
238
|
state.renderType
|
|
247
|
-
)
|
|
239
|
+
)) {
|
|
248
240
|
return {
|
|
249
241
|
editBooking: import_serve2.editBookings,
|
|
250
242
|
createBooking: import_serve2.createBookings
|
|
@@ -255,24 +247,11 @@ var Footer = (props) => {
|
|
|
255
247
|
createBooking: state.apis.createBooking
|
|
256
248
|
};
|
|
257
249
|
};
|
|
258
|
-
const handleDaySubmit = () => {
|
|
259
|
-
var _a2;
|
|
260
|
-
const _isHasDayProducts = (0, import_utils4.isHasDayAppointmentProduct)(state);
|
|
261
|
-
if (_isHasDayProducts) {
|
|
262
|
-
(_a2 = appointmentProductRef == null ? void 0 : appointmentProductRef.current) == null ? void 0 : _a2.open();
|
|
263
|
-
}
|
|
264
|
-
return _isHasDayProducts;
|
|
265
|
-
};
|
|
266
250
|
const handleSave = async ({
|
|
267
251
|
type,
|
|
268
252
|
messageShow = true
|
|
269
253
|
}) => {
|
|
270
254
|
var _a2;
|
|
271
|
-
if ((0, import_utils4.isDayBooking)(state)) {
|
|
272
|
-
const isHasDayProducts = handleDaySubmit();
|
|
273
|
-
if (isHasDayProducts)
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
255
|
let _setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
|
|
277
256
|
_setLoading(true);
|
|
278
257
|
const { createBooking, editBooking } = getApis();
|
|
@@ -668,7 +647,7 @@ var Footer = (props) => {
|
|
|
668
647
|
}
|
|
669
648
|
if (transaction_habit_selection.button_rows == 1) {
|
|
670
649
|
if (state.appointment_status !== "cancelled") {
|
|
671
|
-
if (!state.disabledEdit && !state.isBookingCreatePage
|
|
650
|
+
if (!state.disabledEdit && !state.isBookingCreatePage) {
|
|
672
651
|
arr.push(actionMap.sale);
|
|
673
652
|
}
|
|
674
653
|
}
|
|
@@ -882,7 +861,7 @@ var Footer = (props) => {
|
|
|
882
861
|
className: "pisell-lowcode__booking-footer-buttons",
|
|
883
862
|
style: { marginTop: 12 }
|
|
884
863
|
},
|
|
885
|
-
state.appointment_status !== "cancelled" && !state.isBookingCreatePage
|
|
864
|
+
state.appointment_status !== "cancelled" && !state.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(
|
|
886
865
|
import_antd2.Button,
|
|
887
866
|
{
|
|
888
867
|
onClick: () => handleSale(),
|
|
@@ -900,6 +879,6 @@ var Footer = (props) => {
|
|
|
900
879
|
},
|
|
901
880
|
actionMap.orderDetail.label
|
|
902
881
|
)
|
|
903
|
-
) : null, contextHolder
|
|
882
|
+
) : null, contextHolder);
|
|
904
883
|
};
|
|
905
884
|
var footer_default = Footer;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/components/booking/components/footer/utils.ts
|
|
@@ -34,13 +24,9 @@ __export(utils_exports, {
|
|
|
34
24
|
formatValues: () => formatValues
|
|
35
25
|
});
|
|
36
26
|
module.exports = __toCommonJS(utils_exports);
|
|
37
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
38
27
|
var import_utils = require("../../utils");
|
|
39
28
|
var import_utils2 = require("../../utils");
|
|
40
29
|
var import_utilsByBooking = require("../../info2/utilsByBooking");
|
|
41
|
-
var import_utils3 = require("../../utils");
|
|
42
|
-
var import_status = require("../../info/service2/status");
|
|
43
|
-
var import_utils4 = require("../../info/service2/utils");
|
|
44
30
|
var formatNote = (data) => {
|
|
45
31
|
var _a;
|
|
46
32
|
return ((_a = data.notes) == null ? void 0 : _a.orderNote) || "";
|
|
@@ -68,7 +54,6 @@ var formatProductOption = (option) => {
|
|
|
68
54
|
"num": d.num,
|
|
69
55
|
"option_group_item_id": d.product_option_item_id,
|
|
70
56
|
"option_group_id": d.option_group_id
|
|
71
|
-
// "add_price": Number(d?.add_price),
|
|
72
57
|
};
|
|
73
58
|
});
|
|
74
59
|
};
|
|
@@ -85,8 +70,6 @@ var formatProductBundle = (bundle) => {
|
|
|
85
70
|
"num": d.num,
|
|
86
71
|
"extension_id": d.extension_id,
|
|
87
72
|
"extension_type": d.extension_type,
|
|
88
|
-
// "price": Number(d?.price),
|
|
89
|
-
// "price_type": d?.price_type,
|
|
90
73
|
"option": formatProductOption(d.option)
|
|
91
74
|
};
|
|
92
75
|
});
|
|
@@ -94,7 +77,7 @@ var formatProductBundle = (bundle) => {
|
|
|
94
77
|
var getSubType = (item) => {
|
|
95
78
|
var _a;
|
|
96
79
|
const _type = (_a = item.duration) == null ? void 0 : _a.type;
|
|
97
|
-
if (_type) {
|
|
80
|
+
if (_type && _type !== "days") {
|
|
98
81
|
return _type;
|
|
99
82
|
}
|
|
100
83
|
return "minutes";
|
|
@@ -130,128 +113,39 @@ var formatResource = (service) => {
|
|
|
130
113
|
return void 0;
|
|
131
114
|
}
|
|
132
115
|
};
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
const 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) || 0;
|
|
136
|
-
let obj = {
|
|
137
|
-
customer_id: values.customer_id,
|
|
138
|
-
form_id,
|
|
139
|
-
form_record: [((_e = item._extend) == null ? void 0 : _e.holder_id) || 0]
|
|
140
|
-
};
|
|
141
|
-
if (state.isFranchisee) {
|
|
142
|
-
obj.is_source_shop = 1;
|
|
143
|
-
}
|
|
144
|
-
return obj;
|
|
145
|
-
};
|
|
146
|
-
var formatProductPrice = (item) => {
|
|
147
|
-
var _a, _b, _c;
|
|
148
|
-
const other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
149
|
-
let price = Number((_b = item._extend) == null ? void 0 : _b.price);
|
|
150
|
-
if (other == null ? void 0 : other.option) {
|
|
151
|
-
price = (_c = other == null ? void 0 : other.option) == null ? void 0 : _c.reduce((pre, cur) => {
|
|
152
|
-
return pre + Number(cur.price) * Number(cur.num);
|
|
153
|
-
}, price);
|
|
154
|
-
}
|
|
155
|
-
return price;
|
|
156
|
-
};
|
|
157
|
-
var formatMetaData = (item) => {
|
|
158
|
-
var _a, _b, _c, _d, _e;
|
|
159
|
-
let metadata = {};
|
|
160
|
-
if ((_a = item._extend) == null ? void 0 : _a.capacity) {
|
|
161
|
-
metadata.capacity = item._extend.capacity;
|
|
162
|
-
}
|
|
163
|
-
if (item._extend.groupId) {
|
|
164
|
-
metadata.groupId = item._extend.groupId;
|
|
165
|
-
}
|
|
166
|
-
if ((_b = item._extend) == null ? void 0 : _b.holder_id) {
|
|
167
|
-
metadata.holder_id = (_c = item._extend) == null ? void 0 : _c.holder_id;
|
|
168
|
-
}
|
|
169
|
-
if ((_d = item._extend) == null ? void 0 : _d.multiDayPrices) {
|
|
170
|
-
metadata.multiDayPrices = (_e = item._extend) == null ? void 0 : _e.multiDayPrices;
|
|
171
|
-
}
|
|
172
|
-
return metadata;
|
|
173
|
-
};
|
|
174
|
-
var formatProducts = (item) => {
|
|
175
|
-
var _a, _b, _c, _d, _e, _f;
|
|
176
|
-
const total = Number(item._extend.total);
|
|
177
|
-
const origin_total = Number(item._extend.origin_total);
|
|
178
|
-
const discount_amount = origin_total - total;
|
|
179
|
-
const discount_type = discount_amount < 0 ? "change_price" : "discount";
|
|
180
|
-
return {
|
|
181
|
-
"num": item._extend.quantity,
|
|
182
|
-
"price": formatProductPrice(item),
|
|
183
|
-
"product_id": (item == null ? void 0 : item.product_id) || item.id,
|
|
184
|
-
"discount_amount": discount_amount,
|
|
185
|
-
"product_discount_reason": item._extend.discount_reason || "",
|
|
186
|
-
"is_charge_tax": item.is_charge_tax,
|
|
187
|
-
"note": (item == null ? void 0 : item.note) || "",
|
|
188
|
-
"discountway": item._extend.discountway || "num",
|
|
189
|
-
"discount_per": item._extend.discount_per,
|
|
190
|
-
"discount_type": item._extend.discount_type || discount_type,
|
|
191
|
-
"order_detail_id": item._extend.order_detail_id || 0,
|
|
192
|
-
"product_bundle": formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
|
|
193
|
-
"bundle_edit": item._extend.bundle_edit,
|
|
194
|
-
"product_option_item": formatProductOption((_d = (_c = item._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.option),
|
|
195
|
-
"product_variant_id": ((_f = (_e = item._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.product_variant_id) || 0,
|
|
196
|
-
metadata: formatMetaData(item)
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
var formatAppointmentProductLists = (data) => {
|
|
200
|
-
var _a;
|
|
201
|
-
try {
|
|
202
|
-
let list = data.service.value;
|
|
203
|
-
list = list.filter((item) => {
|
|
204
|
-
var _a2;
|
|
205
|
-
return ((_a2 = item._extend) == null ? void 0 : _a2.holder_id) && import_status.appointmentTypes.includes(item.extension_type);
|
|
206
|
-
});
|
|
207
|
-
const groupMap = /* @__PURE__ */ new Map();
|
|
208
|
-
list.forEach((item) => {
|
|
209
|
-
var _a2;
|
|
210
|
-
const key = (_a2 = item._extend) == null ? void 0 : _a2.holder_id;
|
|
211
|
-
if (!groupMap.has(key)) {
|
|
212
|
-
groupMap.set(key, []);
|
|
213
|
-
}
|
|
214
|
-
groupMap.get(key).push(item);
|
|
215
|
-
});
|
|
216
|
-
const result = (_a = Array.from(groupMap.values())) == null ? void 0 : _a.reduce((acc, group) => acc.concat(group), []);
|
|
217
|
-
return list || [];
|
|
218
|
-
} catch (error) {
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
var formatBookings = (data, values) => {
|
|
222
|
-
const isDay = (0, import_utils4.isDayBooking)(data);
|
|
223
|
-
let list = data.service.value;
|
|
224
|
-
if (isDay) {
|
|
225
|
-
list = formatAppointmentProductLists(data);
|
|
226
|
-
}
|
|
227
|
-
let dayParams = {
|
|
228
|
-
relation_products: []
|
|
229
|
-
};
|
|
116
|
+
var formatBookings = (data) => {
|
|
117
|
+
const list = data.service.value;
|
|
230
118
|
const eventOtherParams = data.eventOtherParams;
|
|
231
119
|
let bookings = [];
|
|
232
120
|
bookings = list.map((item) => {
|
|
233
|
-
var _a, _b
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
121
|
+
var _a, _b;
|
|
122
|
+
const start_date = item._extend.startDate.format("YYYY-MM-DD");
|
|
123
|
+
const end_date = item._extend.endDate.format("YYYY-MM-DD");
|
|
124
|
+
const end_time = item._extend.endDate.format("HH:mm");
|
|
237
125
|
let start_time = item._extend.startDate.format("HH:mm");
|
|
238
126
|
if ((0, import_utils.isNowTime)(item._extend.start_time)) {
|
|
239
127
|
start_time = (0, import_utils.getNowTime)();
|
|
240
128
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
start_date = (0, import_dayjs.default)(startDateTime).format("YYYY-MM-DD");
|
|
246
|
-
start_time = (0, import_dayjs.default)(startDateTime).format("HH:mm");
|
|
247
|
-
end_date = (0, import_dayjs.default)(endDateTime).format("YYYY-MM-DD");
|
|
248
|
-
end_time = (0, import_dayjs.default)(endDateTime).format("HH:mm");
|
|
249
|
-
dayParams.relation_products = (item == null ? void 0 : item.relation_products) || [];
|
|
250
|
-
dayParams.holder = formatHolders(data, item, values);
|
|
251
|
-
dayParams.duration = (0, import_utils3.getDays)({ _extend: { start_date: startDateTime, end_date: endDateTime } }, "minutes");
|
|
252
|
-
}
|
|
129
|
+
const total = Number(item._extend.total);
|
|
130
|
+
const origin_total = Number(item._extend.origin_total);
|
|
131
|
+
const discount_amount = origin_total - total;
|
|
132
|
+
const discount_type = discount_amount < 0 ? "change_price" : "discount";
|
|
253
133
|
return {
|
|
254
|
-
"product":
|
|
134
|
+
"product": {
|
|
135
|
+
"num": item._extend.quantity,
|
|
136
|
+
"price": item._extend.price,
|
|
137
|
+
"product_id": item.id,
|
|
138
|
+
"discount_amount": discount_amount,
|
|
139
|
+
"product_discount_reason": item._extend.discount_reason || "",
|
|
140
|
+
"is_charge_tax": item.is_charge_tax,
|
|
141
|
+
"note": "",
|
|
142
|
+
"discountway": item._extend.discountway || "num",
|
|
143
|
+
"discount_per": item._extend.discount_per,
|
|
144
|
+
"discount_type": item._extend.discount_type || discount_type,
|
|
145
|
+
"order_detail_id": item._extend.order_detail_id || 0,
|
|
146
|
+
"product_bundle": formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
|
|
147
|
+
"bundle_edit": item._extend.bundle_edit
|
|
148
|
+
},
|
|
255
149
|
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
256
150
|
"id": item.booking_id || 0,
|
|
257
151
|
"relation_id": item._extend.relation_id || 0,
|
|
@@ -260,31 +154,22 @@ var formatBookings = (data, values) => {
|
|
|
260
154
|
"is_all": false,
|
|
261
155
|
"schedule_id": item._extend.schedule_id || 0,
|
|
262
156
|
"end_time": end_time,
|
|
263
|
-
"sub_type":
|
|
157
|
+
"sub_type": getSubType(item),
|
|
264
158
|
"select_date": start_date,
|
|
265
159
|
"start_time": start_time,
|
|
266
160
|
"end_date": end_date,
|
|
267
161
|
"start_date": start_date,
|
|
268
|
-
"duration":
|
|
162
|
+
"duration": import_utils.flexibleObj.getValue(item._extend.duration),
|
|
269
163
|
"number": item._extend.capacity ? (0, import_utilsByBooking.getSumCapacity)({ cacheItem: item }) : item._extend.number || 1,
|
|
270
164
|
"resources": formatResource(item),
|
|
271
|
-
"metadata":
|
|
272
|
-
|
|
273
|
-
|
|
165
|
+
"metadata": item._extend.capacity ? {
|
|
166
|
+
capacity: item._extend.capacity
|
|
167
|
+
} : void 0,
|
|
168
|
+
...eventOtherParams || {}
|
|
274
169
|
};
|
|
275
170
|
});
|
|
276
171
|
return bookings;
|
|
277
172
|
};
|
|
278
|
-
var formatRelationProducts = (data) => {
|
|
279
|
-
var _a;
|
|
280
|
-
let list = ((_a = data.service) == null ? void 0 : _a.value) || [];
|
|
281
|
-
list = list.filter((item) => !import_status.appointmentTypes.includes(item.extension_type));
|
|
282
|
-
let relationProducts = [];
|
|
283
|
-
relationProducts = list.map((item) => {
|
|
284
|
-
return formatProducts(item);
|
|
285
|
-
});
|
|
286
|
-
return relationProducts || [];
|
|
287
|
-
};
|
|
288
173
|
var formatHolder = (state, values) => {
|
|
289
174
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
290
175
|
const 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) || 0;
|
|
@@ -311,12 +196,9 @@ var formatValues = (state) => {
|
|
|
311
196
|
bookings: [],
|
|
312
197
|
customer_id: 1,
|
|
313
198
|
customer_name: "",
|
|
314
|
-
holder: {}
|
|
315
|
-
relation_products: [],
|
|
316
|
-
metadata: {}
|
|
199
|
+
holder: {}
|
|
317
200
|
};
|
|
318
|
-
|
|
319
|
-
if (!state.bookingId || isDay) {
|
|
201
|
+
if (!state.bookingId) {
|
|
320
202
|
values.shop_note = formatNote(state);
|
|
321
203
|
}
|
|
322
204
|
if (state.bookingId) {
|
|
@@ -332,20 +214,12 @@ var formatValues = (state) => {
|
|
|
332
214
|
...customer
|
|
333
215
|
};
|
|
334
216
|
values.holder = formatHolder(state, values);
|
|
335
|
-
|
|
336
|
-
values.relation_products = formatRelationProducts(state);
|
|
337
|
-
}
|
|
338
|
-
values.bookings = formatBookings(state, values);
|
|
217
|
+
values.bookings = formatBookings(state);
|
|
339
218
|
if (((_c = (_b = values == null ? void 0 : values.bookings) == null ? void 0 : _b[0]) == null ? void 0 : _c.select_date) && !(state == null ? void 0 : state.bookingId)) {
|
|
340
219
|
let startTime = `${(_e = (_d = values == null ? void 0 : values.bookings) == null ? void 0 : _d[0]) == null ? void 0 : _e.start_time}`;
|
|
341
220
|
startTime = `${startTime || "00:00"}:00`;
|
|
342
221
|
values.schedule_date = `${values.bookings[0].select_date} ${startTime}`;
|
|
343
222
|
}
|
|
344
|
-
if (isDay) {
|
|
345
|
-
values.metadata.is_multiday_appointment = 1;
|
|
346
|
-
values.is_bundle_price_calculated = 1;
|
|
347
|
-
}
|
|
348
|
-
debugger;
|
|
349
223
|
return values;
|
|
350
224
|
};
|
|
351
225
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
4
4
|
state: FormState;
|
|
5
5
|
} & {
|
|
6
6
|
dispatch: (params: {
|
|
@@ -49,11 +49,6 @@ var AddServiceVariant = (props) => {
|
|
|
49
49
|
service: { ...stateRef.current.service, ...payload }
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
if (type === "setDate") {
|
|
53
|
-
setGlobalState({
|
|
54
|
-
date: { ...stateRef.current.date, ...payload }
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
52
|
};
|
|
58
53
|
let Cpt = import_addService.default;
|
|
59
54
|
if ((0, import_utils.isBooking4Shop)(
|
|
@@ -19,7 +19,6 @@ interface SelectDrawerProps {
|
|
|
19
19
|
modalOpen: boolean;
|
|
20
20
|
franchiseeLoading?: number;
|
|
21
21
|
showHeader?: boolean;
|
|
22
|
-
showWalkIn?: boolean;
|
|
23
22
|
}
|
|
24
23
|
declare const _default: React.ForwardRefExoticComponent<SelectDrawerProps & React.RefAttributes<unknown>>;
|
|
25
24
|
export default _default;
|
|
@@ -108,16 +108,12 @@ var SelectDrawer = (props, ref) => {
|
|
|
108
108
|
handleAddPet,
|
|
109
109
|
modalOpen,
|
|
110
110
|
franchiseeLoading,
|
|
111
|
-
showHeader
|
|
112
|
-
showWalkIn
|
|
111
|
+
showHeader
|
|
113
112
|
} = props;
|
|
114
113
|
const form = (formData == null ? void 0 : formData[0]) || {};
|
|
115
114
|
const valList = (childrenValue == null ? void 0 : childrenValue[form.id]) || defaultArr;
|
|
116
115
|
const [_value, setValue] = (0, import_react.useState)(valList);
|
|
117
116
|
const clientRef = (0, import_react.useRef)();
|
|
118
|
-
const searchRef = (0, import_react.useRef)();
|
|
119
|
-
const [open, setOpen] = (0, import_react.useState)(false);
|
|
120
|
-
const [search, setSearch] = (0, import_react.useState)("");
|
|
121
117
|
(0, import_react.useEffect)(() => {
|
|
122
118
|
setValue(
|
|
123
119
|
valList.map((item) => ({
|
|
@@ -125,7 +121,10 @@ var SelectDrawer = (props, ref) => {
|
|
|
125
121
|
id: item.id || item.form_record_id
|
|
126
122
|
}))
|
|
127
123
|
);
|
|
128
|
-
}, [valList
|
|
124
|
+
}, [valList]);
|
|
125
|
+
const searchRef = (0, import_react.useRef)();
|
|
126
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
127
|
+
const [search, setSearch] = (0, import_react.useState)("");
|
|
129
128
|
(0, import_react.useEffect)(() => {
|
|
130
129
|
if (!modalOpen) {
|
|
131
130
|
setOpen(false);
|
|
@@ -318,7 +317,7 @@ var SelectDrawer = (props, ref) => {
|
|
|
318
317
|
title: import_utils.locales.getText("pisell2.text.create-new-customer"),
|
|
319
318
|
onClick: handleAddClient
|
|
320
319
|
}
|
|
321
|
-
),
|
|
320
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
322
321
|
ActionItem,
|
|
323
322
|
{
|
|
324
323
|
title: "Walk-In",
|
|
@@ -327,7 +326,7 @@ var SelectDrawer = (props, ref) => {
|
|
|
327
326
|
closeDrawer();
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
|
-
)
|
|
329
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: !!loading, delay: 500 }, !!options.length ? options.map((item) => {
|
|
331
330
|
var _a;
|
|
332
331
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
333
332
|
"div",
|
|
@@ -47,17 +47,13 @@ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineCon
|
|
|
47
47
|
var import_format = require("../../../forms/format");
|
|
48
48
|
var import_utils2 = require("../../utils");
|
|
49
49
|
var import_utils3 = require("../../../utils");
|
|
50
|
-
var import_utils4 = require("../../service2/utils");
|
|
51
|
-
var import_ChangePetModal = __toESM(require("../../pet/ChangePetModal"));
|
|
52
|
-
var import_model = require("../../model");
|
|
53
50
|
var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H;
|
|
55
52
|
const { globalState, setGlobalState } = props;
|
|
56
53
|
const modalRef = (0, import_react.useRef)();
|
|
57
54
|
const state = globalState;
|
|
58
55
|
const stateRef = (0, import_react.useRef)(state);
|
|
59
56
|
const prevCustomerId = (0, import_react.useRef)(null);
|
|
60
|
-
const changePetRef = (0, import_react.useRef)(null);
|
|
61
57
|
const context = (0, import_useEngineContext.default)();
|
|
62
58
|
const [isHasFormRecord, setIsHasFormRecord] = (0, import_react.useState)(true);
|
|
63
59
|
const isFranchisee = (_d = (_c = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.businessUtils) == null ? void 0 : _c.getAppByModal) == null ? void 0 : _d.call(_c, "franchisee");
|
|
@@ -112,14 +108,6 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
112
108
|
}
|
|
113
109
|
});
|
|
114
110
|
}
|
|
115
|
-
if (type === "setService") {
|
|
116
|
-
setGlobalState({
|
|
117
|
-
service: {
|
|
118
|
-
...stateRef.current.service,
|
|
119
|
-
...payload
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
111
|
};
|
|
124
112
|
const boardConfig = (0, import_react.useMemo)(() => {
|
|
125
113
|
var _a2, _b2, _c2;
|
|
@@ -140,18 +128,6 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
140
128
|
state == null ? void 0 : state.modalOpen
|
|
141
129
|
]);
|
|
142
130
|
const handleSelectPet = (val) => {
|
|
143
|
-
var _a2, _b2;
|
|
144
|
-
if ((0, import_utils4.isDayBooking)(state)) {
|
|
145
|
-
const { ids, lists } = (0, import_utils4.isOpenDeletePet)(state, val);
|
|
146
|
-
if ((ids == null ? void 0 : ids.length) > 0 && (lists == null ? void 0 : lists.length) > 0) {
|
|
147
|
-
(_b2 = changePetRef.current) == null ? void 0 : _b2.open({
|
|
148
|
-
ids,
|
|
149
|
-
setGlobalState,
|
|
150
|
-
service: ((_a2 = state.service) == null ? void 0 : _a2.value) || [],
|
|
151
|
-
state
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
131
|
setGlobalState({
|
|
156
132
|
pet: {
|
|
157
133
|
...state.pet,
|
|
@@ -283,7 +259,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
283
259
|
}, [isWalkIn, formId, (_q = state.client.value) == null ? void 0 : _q.id, currentPetValue, boardConfig]);
|
|
284
260
|
const petRender = (0, import_react.useMemo)(() => {
|
|
285
261
|
var _a2, _b2, _c2;
|
|
286
|
-
if ((
|
|
262
|
+
if ((state == null ? void 0 : state.disabledEdit) || boardConfig.type !== "form") {
|
|
287
263
|
return null;
|
|
288
264
|
}
|
|
289
265
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !(currentPetValue == null ? void 0 : currentPetValue.length) && !isHasFormRecord && !isWalkIn && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -348,8 +324,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
348
324
|
handleAddPet,
|
|
349
325
|
currentPetValue,
|
|
350
326
|
formId,
|
|
351
|
-
(_x = (_w = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _w.holder) == null ? void 0 : _x.data_range
|
|
352
|
-
(_y = state.service) == null ? void 0 : _y.value
|
|
327
|
+
(_x = (_w = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _w.holder) == null ? void 0 : _x.data_range
|
|
353
328
|
]);
|
|
354
329
|
const handleOpenClient = () => {
|
|
355
330
|
if (!isWalkIn || (state == null ? void 0 : state.disableEventBookingEdit)) {
|
|
@@ -365,55 +340,6 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
365
340
|
setSearch: (_b2 = modalRef.current) == null ? void 0 : _b2.setSearch
|
|
366
341
|
};
|
|
367
342
|
});
|
|
368
|
-
const isOpenDeleteProduct = (0, import_react.useMemo)(() => {
|
|
369
|
-
if (!(0, import_utils4.isDayBooking)(state))
|
|
370
|
-
return false;
|
|
371
|
-
const pets = (0, import_utils4.getPets)(state);
|
|
372
|
-
const appointmentServices = (0, import_utils4.getAppointmentService)(state);
|
|
373
|
-
if ((pets == null ? void 0 : pets.length) && (appointmentServices == null ? void 0 : appointmentServices.length)) {
|
|
374
|
-
return true;
|
|
375
|
-
}
|
|
376
|
-
return false;
|
|
377
|
-
}, [state]);
|
|
378
|
-
const _handleSelectClient = async (e) => {
|
|
379
|
-
var _a2, _b2, _c2, _d2, _e2;
|
|
380
|
-
handleSelectClient(e);
|
|
381
|
-
if ((0, import_utils4.isDayBooking)(state)) {
|
|
382
|
-
let _value = (e == null ? void 0 : e[e.length - 1]) || import_model.walkInData;
|
|
383
|
-
if (_value.loading) {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
if ((0, import_utils4.isDayBooking)(state) && ((_b2 = (_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) > 0 && ((_c2 = state.client.value) == null ? void 0 : _c2.id) !== (_value == null ? void 0 : _value.id)) {
|
|
387
|
-
const _state = {
|
|
388
|
-
...state,
|
|
389
|
-
client: {
|
|
390
|
-
...state.client,
|
|
391
|
-
value: {
|
|
392
|
-
..._value,
|
|
393
|
-
name: getNickname(_value)
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
if (isOpenDeleteProduct) {
|
|
398
|
-
(_e2 = changePetRef.current) == null ? void 0 : _e2.open({
|
|
399
|
-
setGlobalState,
|
|
400
|
-
service: ((_d2 = state.service) == null ? void 0 : _d2.value) || [],
|
|
401
|
-
state,
|
|
402
|
-
source: "changeClient"
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
const services = await (0, import_utils4.updateServicePrice)(_state);
|
|
406
|
-
console.log(services, state, _value, isOpenDeleteProduct, "wh98797686");
|
|
407
|
-
setGlobalState({
|
|
408
|
-
service: {
|
|
409
|
-
...stateRef.current.service,
|
|
410
|
-
value: services,
|
|
411
|
-
edit: true
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
343
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
418
344
|
"div",
|
|
419
345
|
{
|
|
@@ -433,11 +359,11 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
433
359
|
import_antd.Avatar,
|
|
434
360
|
{
|
|
435
361
|
className: "pisell-lowcode__booking-client-avatar",
|
|
436
|
-
src: import_utils.image.ali((
|
|
362
|
+
src: import_utils.image.ali((_y = state.client.value) == null ? void 0 : _y.cover, 100),
|
|
437
363
|
size: 64,
|
|
438
364
|
icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
|
|
439
365
|
}
|
|
440
|
-
), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((
|
|
366
|
+
), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((_z = state.client.value) == null ? void 0 : _z.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_A = state.client.value) == null ? void 0 : _A.email) : null, ((_B = state.client.value) == null ? void 0 : _B.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_C = state.client.value) == null ? void 0 : _C.phone) : null), !isWalkIn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-action-wrap" }, !state.disabledEdit && /* @__PURE__ */ import_react.default.createElement(
|
|
441
367
|
import_antd.Dropdown.Button,
|
|
442
368
|
{
|
|
443
369
|
menu: {
|
|
@@ -488,26 +414,24 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
488
414
|
showHeader: !state.isBookingCreatePage,
|
|
489
415
|
modalOpen: state.modalOpen,
|
|
490
416
|
loading,
|
|
491
|
-
autoFocus: !((
|
|
417
|
+
autoFocus: !((_F = (_E = (_D = context == null ? void 0 : context.appHelper) == null ? void 0 : _D.utils) == null ? void 0 : _E.isTerminal) == null ? void 0 : _F.call(_E)),
|
|
492
418
|
ref: modalRef,
|
|
493
419
|
onClose: handleClose,
|
|
494
|
-
handleSelectClient
|
|
420
|
+
handleSelectClient,
|
|
495
421
|
handleCreateItem,
|
|
496
422
|
childrenValue: state.pet.value,
|
|
497
423
|
handleSelectPet,
|
|
498
424
|
formData: state.pet.formData,
|
|
499
425
|
searchChange,
|
|
500
426
|
options: renderList,
|
|
501
|
-
holder: (
|
|
502
|
-
client: (
|
|
427
|
+
holder: (_G = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _G.holder,
|
|
428
|
+
client: (_H = state == null ? void 0 : state.client) == null ? void 0 : _H.value,
|
|
503
429
|
loadMore,
|
|
504
430
|
showPet: (boardConfig == null ? void 0 : boardConfig.type) === "form",
|
|
505
431
|
handleAddPet,
|
|
506
|
-
franchiseeLoading
|
|
507
|
-
showWalkIn: !(0, import_utils4.isDayBooking)(state)
|
|
432
|
+
franchiseeLoading
|
|
508
433
|
}
|
|
509
|
-
)
|
|
510
|
-
/* @__PURE__ */ import_react.default.createElement(import_ChangePetModal.default, { ref: changePetRef })
|
|
434
|
+
)
|
|
511
435
|
);
|
|
512
436
|
});
|
|
513
437
|
var vertical_default = VerticalClient;
|