@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
|
@@ -24,31 +24,20 @@ import Drawer from "../../../components/drawer";
|
|
|
24
24
|
import { Context } from "../../model";
|
|
25
25
|
import { formatAmount, locales } from '@pisell/utils';
|
|
26
26
|
import Duration from "../../../materiels/duration";
|
|
27
|
-
import
|
|
28
|
-
import '@pisell/materials';
|
|
29
|
-
import { Input, Button, Select, Row, Col, Form, Alert, InputNumber, DatePicker } from 'antd';
|
|
27
|
+
import { Input, Button, Select, Row, Col, Form, Alert, InputNumber } from 'antd';
|
|
30
28
|
import "./index.less";
|
|
31
29
|
import CollapsibleList from "../../../components/collapsibleList";
|
|
32
30
|
import { renderBundles } from "../../../components/collapsibleList/utils";
|
|
33
31
|
import { useUpdateEffect, useMemoizedFn } from 'ahooks';
|
|
34
|
-
import BookingList from "./BookingList";
|
|
35
32
|
// import SelectTime from "../../../../../../../materials/src/components/select-time";
|
|
36
|
-
import { getErrorList,
|
|
33
|
+
import { getErrorList, getServiceTimes, deleteCacheParams, getProductTotalPrice } from "../../../utils";
|
|
37
34
|
import Like from "../like";
|
|
38
35
|
import { getNoResource } from "../../../mock";
|
|
39
|
-
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj
|
|
36
|
+
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
|
|
40
37
|
import { PisellAdjustPriceInputNumber, Page } from '@pisell/materials';
|
|
41
|
-
import dayjs from 'dayjs';
|
|
42
|
-
import useSelectPet from "../../service2/hooks/useSelectPet";
|
|
43
|
-
import { disabledDate as _disabledDate, isDayBooking, formatDayTime, isDayBookingProduct } from "../../service2/utils";
|
|
44
|
-
import { createBookingItemsByGroup, getGroupTotalPrice } from "../../service2/Group/utils";
|
|
45
|
-
import { isGroupBooking, filterItemByGroupId } from "../../service2/Group/utils";
|
|
46
|
-
import { getMultiDayPrices } from "../../utils";
|
|
47
|
-
import { useService } from "../serviceManager";
|
|
48
|
-
import EditTabs from "./EditTabs";
|
|
49
38
|
var submitLock = false;
|
|
50
39
|
var Info = function Info(_, ref) {
|
|
51
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$
|
|
40
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$date, _state$date$value, _state$date$value$for, _window$BaseMaterials, _state$service$cacheI19, _state$service7, _state$service7$cache, _state$service7$cache2, _state$service$cacheI20, _state$service$cacheI21, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$bookingConfig12;
|
|
52
41
|
var _Form$useForm = Form.useForm(),
|
|
53
42
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
54
43
|
form = _Form$useForm2[0];
|
|
@@ -57,8 +46,6 @@ var Info = function Info(_, ref) {
|
|
|
57
46
|
var useResource = Form.useWatch('resource', form);
|
|
58
47
|
var useStartTime = Form.useWatch('start_time', form);
|
|
59
48
|
var useDuration = Form.useWatch('duration', form);
|
|
60
|
-
var useStartDate = Form.useWatch('start_date', form);
|
|
61
|
-
var useEndDate = Form.useWatch('end_date', form);
|
|
62
49
|
var _useState = useState(false),
|
|
63
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
64
51
|
resourceLoading = _useState2[0],
|
|
@@ -71,28 +58,12 @@ var Info = function Info(_, ref) {
|
|
|
71
58
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
72
59
|
selectOpen = _useState4[0],
|
|
73
60
|
setSelectOpen = _useState4[1];
|
|
74
|
-
var _useSelectPet = useSelectPet(state),
|
|
75
|
-
holderLists = _useSelectPet.holderLists;
|
|
76
|
-
var _useService = useService({
|
|
77
|
-
state: state,
|
|
78
|
-
dispatch: dispatch
|
|
79
|
-
}),
|
|
80
|
-
editBookingData = _useService.editBookingData,
|
|
81
|
-
editBooking = _useService.editBooking;
|
|
82
|
-
var _useState5 = useState('batch_edit'),
|
|
83
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
84
|
-
currentTab = _useState6[0],
|
|
85
|
-
setCurrentTab = _useState6[1];
|
|
86
|
-
var isDayBookingMode = useMemo(function () {
|
|
87
|
-
return isDayBooking(state);
|
|
88
|
-
}, [state === null || state === void 0 ? void 0 : state.renderType]);
|
|
89
61
|
|
|
90
62
|
// 当前商品信息+ 表单信息
|
|
91
63
|
var getCurrentCacheItem = function getCurrentCacheItem(_cacheItem) {
|
|
92
|
-
var _state$service;
|
|
93
64
|
// 获取当前表单数据
|
|
94
65
|
var values = form.getFieldsValue();
|
|
95
|
-
var _item = _cacheItem ||
|
|
66
|
+
var _item = _cacheItem || state.service.cacheItem;
|
|
96
67
|
return _objectSpread(_objectSpread({}, _item), {}, {
|
|
97
68
|
_extend: _objectSpread(_objectSpread({}, _item === null || _item === void 0 ? void 0 : _item._extend), values)
|
|
98
69
|
});
|
|
@@ -207,8 +178,7 @@ var Info = function Info(_, ref) {
|
|
|
207
178
|
payload: {
|
|
208
179
|
resources: formatResources({
|
|
209
180
|
cacheItem: _cacheItem,
|
|
210
|
-
resourcesOrigin: _list
|
|
211
|
-
isDay: isDayBookingMode
|
|
181
|
+
resourcesOrigin: _list
|
|
212
182
|
})
|
|
213
183
|
}
|
|
214
184
|
});
|
|
@@ -256,13 +226,9 @@ var Info = function Info(_, ref) {
|
|
|
256
226
|
}
|
|
257
227
|
var _list = _toConsumableArray(state.service.value);
|
|
258
228
|
var _id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
_list = _list.filter(function (d) {
|
|
263
|
-
return d._id !== _id;
|
|
264
|
-
});
|
|
265
|
-
}
|
|
229
|
+
_list = _list.filter(function (d) {
|
|
230
|
+
return d._id !== _id;
|
|
231
|
+
});
|
|
266
232
|
dispatch({
|
|
267
233
|
type: 'setService',
|
|
268
234
|
payload: {
|
|
@@ -323,8 +289,8 @@ var Info = function Info(_, ref) {
|
|
|
323
289
|
return d.form_record_id == useResource;
|
|
324
290
|
});
|
|
325
291
|
if (item) {
|
|
326
|
-
var _item$_extend$usableT
|
|
327
|
-
var isMaxLimitRange = (_item$_extend$usableT = item._extend.usableTime) === null || _item$_extend$usableT === void 0 ? void 0 :
|
|
292
|
+
var _item$_extend$usableT;
|
|
293
|
+
var isMaxLimitRange = (_item$_extend$usableT = item._extend.usableTime) === null || _item$_extend$usableT === void 0 ? void 0 : _item$_extend$usableT._extend.isMaxLimitRange;
|
|
328
294
|
// unknown 为未知是否可用, 需要掉后端接口确定
|
|
329
295
|
if (isMaxLimitRange === 'unknown') {
|
|
330
296
|
// 调接口
|
|
@@ -371,56 +337,74 @@ var Info = function Info(_, ref) {
|
|
|
371
337
|
* @Author: zhiwei.Wang
|
|
372
338
|
* @Date: 2024-01-09 14:04
|
|
373
339
|
*/
|
|
374
|
-
var onFinish = useMemoizedFn(
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
_context2.next = 2;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
return _context2.abrupt("return");
|
|
385
|
-
case 2:
|
|
386
|
-
submitLock = true;
|
|
340
|
+
var onFinish = useMemoizedFn(function (values) {
|
|
341
|
+
var _currentResource$_ext;
|
|
342
|
+
// 防止多次提交, 增加锁
|
|
343
|
+
if (submitLock) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
submitLock = true;
|
|
387
347
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
348
|
+
// 1500毫秒后解除
|
|
349
|
+
setTimeout(function () {
|
|
350
|
+
submitLock = false;
|
|
351
|
+
}, 1500);
|
|
352
|
+
var _list = _toConsumableArray(state.service.value);
|
|
353
|
+
var _item = _objectSpread(_objectSpread({}, state.service.cacheItem), {}, {
|
|
354
|
+
autoClose: false,
|
|
355
|
+
errorList: errorList
|
|
356
|
+
});
|
|
357
|
+
var _extend = _objectSpread(_objectSpread({}, _item._extend), values);
|
|
358
|
+
var _getServiceTimes = getServiceTimes({
|
|
359
|
+
_extend: _extend
|
|
360
|
+
}),
|
|
361
|
+
startDate = _getServiceTimes.startDate,
|
|
362
|
+
endDate = _getServiceTimes.endDate;
|
|
363
|
+
_extend.startDate = startDate;
|
|
364
|
+
_extend.endDate = endDate;
|
|
365
|
+
var _ref2 = (currentResource === null || currentResource === void 0 ? void 0 : (_currentResource$_ext = currentResource._extend) === null || _currentResource$_ext === void 0 ? void 0 : _currentResource$_ext.usableTime) || {},
|
|
366
|
+
relation_type = _ref2.relation_type,
|
|
367
|
+
item_id = _ref2.item_id,
|
|
368
|
+
schedule_id = _ref2.schedule_id;
|
|
369
|
+
_extend.relation_type = relation_type || 'form';
|
|
370
|
+
_extend.relation_id = item_id || (currentResource === null || currentResource === void 0 ? void 0 : currentResource.form_record_id) || 0;
|
|
371
|
+
_extend.schedule_id = schedule_id || 0;
|
|
372
|
+
if (_extend.bundle_edit !== undefined) {
|
|
373
|
+
_extend.bundle_edit = 1;
|
|
374
|
+
}
|
|
375
|
+
_item._extend = _extend;
|
|
376
|
+
_item._time = new Date().getTime();
|
|
377
|
+
var _id = _item === null || _item === void 0 ? void 0 : _item._id;
|
|
378
|
+
|
|
379
|
+
// 判断是新增还是编辑
|
|
380
|
+
if (!_list.some(function (d) {
|
|
381
|
+
return d._id === _id;
|
|
382
|
+
})) {
|
|
383
|
+
_list.push(_item);
|
|
384
|
+
} else {
|
|
385
|
+
_list = _list.map(function (d) {
|
|
386
|
+
return d._id === _id ? _objectSpread(_objectSpread({}, _item), {}, {
|
|
387
|
+
new: 0
|
|
388
|
+
}) : d;
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
deleteCacheParams();
|
|
392
|
+
console.log('_onFinish', _list);
|
|
393
|
+
dispatch({
|
|
394
|
+
type: 'setService',
|
|
395
|
+
payload: {
|
|
396
|
+
editModal: false,
|
|
397
|
+
addModal: false,
|
|
398
|
+
value: _list,
|
|
399
|
+
edit: true,
|
|
400
|
+
cacheItem: null,
|
|
401
|
+
changeService: false
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
});
|
|
414
405
|
var setEditData = useMemoizedFn(function (_cacheItem, open) {
|
|
415
|
-
var _values;
|
|
416
|
-
setCurrentTab('batch_edit');
|
|
417
406
|
var cacheItem = _cacheItem || state.service.cacheItem;
|
|
418
407
|
var values = cacheItem._extend;
|
|
419
|
-
|
|
420
|
-
// 没有折扣原因则清空
|
|
421
|
-
values = _objectSpread(_objectSpread({}, values), {}, {
|
|
422
|
-
discount_reason: ((_values = values) === null || _values === void 0 ? void 0 : _values.discount_reason) || ''
|
|
423
|
-
});
|
|
424
408
|
form.setFieldsValue(values);
|
|
425
409
|
if (state.renderType !== 'eventBooking') {
|
|
426
410
|
// 获取资源列表
|
|
@@ -453,7 +437,7 @@ var Info = function Info(_, ref) {
|
|
|
453
437
|
* @Date: 2024-01-09 14:06
|
|
454
438
|
*/
|
|
455
439
|
var errorList = useMemo(function () {
|
|
456
|
-
return getErrorList(currentResource, getCurrentCacheItem()
|
|
440
|
+
return getErrorList(currentResource, getCurrentCacheItem());
|
|
457
441
|
}, [currentResource, useDuration, useStartTime]);
|
|
458
442
|
|
|
459
443
|
/**
|
|
@@ -472,24 +456,12 @@ var Info = function Info(_, ref) {
|
|
|
472
456
|
}
|
|
473
457
|
}
|
|
474
458
|
}, [useStartTime, useDuration, state.renderType, state.service.resourcesOrigin, (_state$service$cacheI7 = state.service.cacheItem) === null || _state$service$cacheI7 === void 0 ? void 0 : _state$service$cacheI7.autoClose]);
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* @title: 是否在terminal上打开预约
|
|
478
|
-
* @description:
|
|
479
|
-
* @param {*} useMemo
|
|
480
|
-
* @return {*}
|
|
481
|
-
* @Author: WangHan
|
|
482
|
-
* @Date: 2024-12-04 19:02
|
|
483
|
-
*/
|
|
484
|
-
var isTerminalBooking = useMemo(function () {
|
|
485
|
-
return state.isBookingCreatePage || state.isTerminalDayBookingPage;
|
|
486
|
-
}, [state.isBookingCreatePage, state.isTerminalDayBookingPage]);
|
|
487
459
|
useEffect(function () {
|
|
488
460
|
// 预约创建页面并且打开了编辑弹窗
|
|
489
|
-
if (
|
|
461
|
+
if (state.isBookingCreatePage && state.service.editModal) {
|
|
490
462
|
setEditData(null, true);
|
|
491
463
|
}
|
|
492
|
-
}, [state.service.editModal,
|
|
464
|
+
}, [state.service.editModal, state.isBookingCreatePage]);
|
|
493
465
|
|
|
494
466
|
/**
|
|
495
467
|
* @title: 资源 时间 发生变化时, 重新计算错误信息
|
|
@@ -500,7 +472,7 @@ var Info = function Info(_, ref) {
|
|
|
500
472
|
*/
|
|
501
473
|
useEffect(function () {
|
|
502
474
|
getErrorMsg();
|
|
503
|
-
}, [useResource, useStartTime, useDuration
|
|
475
|
+
}, [useResource, useStartTime, useDuration]);
|
|
504
476
|
|
|
505
477
|
/**
|
|
506
478
|
* @title: 价格发生变化,重新计算折扣
|
|
@@ -517,33 +489,22 @@ var Info = function Info(_, ref) {
|
|
|
517
489
|
// handleLikeResource("common");
|
|
518
490
|
// }, [useResource]);
|
|
519
491
|
var isDiscount = useMemo(function () {
|
|
520
|
-
var _state$
|
|
521
|
-
if (!((_state$
|
|
492
|
+
var _state$service, _state$service2, _state$service2$cache;
|
|
493
|
+
if (!((_state$service = state.service) !== null && _state$service !== void 0 && _state$service.cacheItem)) {
|
|
522
494
|
return false;
|
|
523
495
|
}
|
|
524
|
-
return useTotal != ((_state$
|
|
525
|
-
}, [useTotal, (_state$
|
|
496
|
+
return useTotal != ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : (_state$service2$cache = _state$service2.cacheItem) === null || _state$service2$cache === void 0 ? void 0 : _state$service2$cache._extend.origin_total);
|
|
497
|
+
}, [useTotal, (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : (_state$service3$cache = _state$service3.cacheItem) === null || _state$service3$cache === void 0 ? void 0 : _state$service3$cache._extend.origin_total]);
|
|
526
498
|
useEffect(function () {
|
|
527
499
|
if (useResource === 0) {
|
|
528
500
|
handleLikeResource('common');
|
|
529
501
|
}
|
|
530
502
|
}, [useResource]);
|
|
531
503
|
var bundles = useMemo(function () {
|
|
532
|
-
var _state$
|
|
533
|
-
return ((_state$
|
|
534
|
-
}, [(_state$
|
|
535
|
-
|
|
536
|
-
var _state$service7, _state$service7$cache, _state$service7$cache2;
|
|
537
|
-
return Object.entries(getMultiDayPrices(((_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : (_state$service7$cache2 = _state$service7$cache._extend) === null || _state$service7$cache2 === void 0 ? void 0 : _state$service7$cache2.multi_day) || [])).map(function (_ref3) {
|
|
538
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
539
|
-
key = _ref4[0],
|
|
540
|
-
value = _ref4[1];
|
|
541
|
-
return {
|
|
542
|
-
key: key,
|
|
543
|
-
value: value
|
|
544
|
-
};
|
|
545
|
-
});
|
|
546
|
-
}, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : (_state$service8$cache = _state$service8.cacheItem) === null || _state$service8$cache === void 0 ? void 0 : (_state$service8$cache2 = _state$service8$cache._extend) === null || _state$service8$cache2 === void 0 ? void 0 : _state$service8$cache2.multi_day]);
|
|
504
|
+
var _state$service4, _state$service4$cache, _state$service4$cache2, _state$service4$cache3;
|
|
505
|
+
return ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$cache = _state$service4.cacheItem) === null || _state$service4$cache === void 0 ? void 0 : (_state$service4$cache2 = _state$service4$cache._extend) === null || _state$service4$cache2 === void 0 ? void 0 : (_state$service4$cache3 = _state$service4$cache2.other) === null || _state$service4$cache3 === void 0 ? void 0 : _state$service4$cache3.bundle) || [];
|
|
506
|
+
}, [(_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : (_state$service5$cache = _state$service5.cacheItem) === null || _state$service5$cache === void 0 ? void 0 : (_state$service5$cache2 = _state$service5$cache._extend) === null || _state$service5$cache2 === void 0 ? void 0 : (_state$service5$cache3 = _state$service5$cache2.other) === null || _state$service5$cache3 === void 0 ? void 0 : _state$service5$cache3.bundle]);
|
|
507
|
+
|
|
547
508
|
/**
|
|
548
509
|
* @title: 获取资源列表数据
|
|
549
510
|
* @description:
|
|
@@ -552,51 +513,25 @@ var Info = function Info(_, ref) {
|
|
|
552
513
|
* @Date: 2024-01-09 13:38
|
|
553
514
|
*/
|
|
554
515
|
var getResourcesData = /*#__PURE__*/function () {
|
|
555
|
-
var
|
|
556
|
-
var
|
|
557
|
-
return _regeneratorRuntime().wrap(function
|
|
558
|
-
while (1) switch (
|
|
516
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
517
|
+
var data, _list;
|
|
518
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
519
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
559
520
|
case 0:
|
|
560
521
|
setResourceLoading(true);
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
_context3.next = 13;
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
format = 'YYYY-MM-DD HH:mm';
|
|
568
|
-
startDate = useStartDate || state.date.value;
|
|
569
|
-
endDate = useEndDate || state.date.end_date;
|
|
570
|
-
_formatDayTime = formatDayTime({
|
|
571
|
-
startDate: startDate,
|
|
572
|
-
endDate: endDate
|
|
573
|
-
}), startDateTime = _formatDayTime.startDateTime, endDateTime = _formatDayTime.endDateTime;
|
|
574
|
-
if (!dayjs(startDateTime).isAfter(dayjs(endDateTime))) {
|
|
575
|
-
_context3.next = 10;
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
578
|
-
return _context3.abrupt("return");
|
|
579
|
-
case 10:
|
|
580
|
-
params.check_time = {
|
|
581
|
-
start_time: dayjs(startDateTime).format(format),
|
|
582
|
-
end_time: dayjs(endDateTime).format(format)
|
|
583
|
-
};
|
|
584
|
-
_context3.next = 14;
|
|
585
|
-
break;
|
|
586
|
-
case 13:
|
|
587
|
-
params.with_date_times = state.date.value.format('YYYY-MM-DD');
|
|
588
|
-
case 14:
|
|
589
|
-
_context3.next = 16;
|
|
590
|
-
return state.apis.getResources(_objectSpread({
|
|
522
|
+
_context2.prev = 1;
|
|
523
|
+
_context2.next = 4;
|
|
524
|
+
return state.apis.getResources({
|
|
591
525
|
skip: 1,
|
|
592
526
|
num: 1000,
|
|
527
|
+
with_date_times: state.date.value.format('YYYY-MM-DD'),
|
|
593
528
|
codes: ['resources', 'therapist', 'table'],
|
|
594
529
|
_config: {
|
|
595
530
|
abort: true
|
|
596
531
|
}
|
|
597
|
-
}
|
|
598
|
-
case
|
|
599
|
-
data =
|
|
532
|
+
});
|
|
533
|
+
case 4:
|
|
534
|
+
data = _context2.sent;
|
|
600
535
|
// 合并无资源
|
|
601
536
|
_list = [getNoResource()].concat((data === null || data === void 0 ? void 0 : data.list) || []);
|
|
602
537
|
dispatch({
|
|
@@ -605,29 +540,29 @@ var Info = function Info(_, ref) {
|
|
|
605
540
|
resourcesOrigin: _list
|
|
606
541
|
}
|
|
607
542
|
});
|
|
608
|
-
|
|
543
|
+
_context2.next = 12;
|
|
609
544
|
break;
|
|
610
|
-
case
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
console.log(
|
|
614
|
-
case
|
|
545
|
+
case 9:
|
|
546
|
+
_context2.prev = 9;
|
|
547
|
+
_context2.t0 = _context2["catch"](1);
|
|
548
|
+
console.log(_context2.t0, 'err');
|
|
549
|
+
case 12:
|
|
615
550
|
setResourceLoading(false);
|
|
616
|
-
case
|
|
551
|
+
case 13:
|
|
617
552
|
case "end":
|
|
618
|
-
return
|
|
553
|
+
return _context2.stop();
|
|
619
554
|
}
|
|
620
|
-
},
|
|
555
|
+
}, _callee2, null, [[1, 9]]);
|
|
621
556
|
}));
|
|
622
557
|
return function getResourcesData() {
|
|
623
|
-
return
|
|
558
|
+
return _ref3.apply(this, arguments);
|
|
624
559
|
};
|
|
625
560
|
}();
|
|
626
561
|
useEffect(function () {
|
|
627
562
|
setTimeout(function () {
|
|
628
563
|
getResourcesData();
|
|
629
564
|
}, 20);
|
|
630
|
-
}, [(_state$date = state.date) === null || _state$date === void 0 ? void 0 : (_state$date$value = _state$date.value) === null || _state$date$value === void 0 ? void 0 : (_state$date$value$for = _state$date$value.format) === null || _state$date$value$for === void 0 ? void 0 : _state$date$value$for.call(_state$date$value, 'YYYY-MM-DD')
|
|
565
|
+
}, [(_state$date = state.date) === null || _state$date === void 0 ? void 0 : (_state$date$value = _state$date.value) === null || _state$date$value === void 0 ? void 0 : (_state$date$value$for = _state$date$value.format) === null || _state$date$value$for === void 0 ? void 0 : _state$date$value$for.call(_state$date$value, 'YYYY-MM-DD')]);
|
|
631
566
|
|
|
632
567
|
/**
|
|
633
568
|
* @title: 编辑商品
|
|
@@ -638,24 +573,11 @@ var Info = function Info(_, ref) {
|
|
|
638
573
|
* @Date: 2024-08-28 17:08
|
|
639
574
|
*/
|
|
640
575
|
var handleEdit = useMemoizedFn(function (e) {
|
|
641
|
-
var _item$_extend3, _state$client, _state$client$value;
|
|
642
576
|
// 当前商品
|
|
643
577
|
var item = state.service.cacheItem;
|
|
644
578
|
|
|
645
579
|
// 表单数据
|
|
646
580
|
var values = form.getFieldsValue();
|
|
647
|
-
var dayValue = {};
|
|
648
|
-
if (isDayBookingMode) {
|
|
649
|
-
var _item$_extend, _item$_extend$other, _item$_extend$other$o, _item$_extend2, _item$_extend2$other;
|
|
650
|
-
// 格式化单规格
|
|
651
|
-
var option = (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : (_item$_extend$other = _item$_extend.other) === null || _item$_extend$other === void 0 ? void 0 : (_item$_extend$other$o = _item$_extend$other.option) === null || _item$_extend$other$o === void 0 ? void 0 : _item$_extend$other$o.map(function (o) {
|
|
652
|
-
return _objectSpread(_objectSpread({}, o), {}, {
|
|
653
|
-
option_group_item_id: o.product_option_item_id
|
|
654
|
-
});
|
|
655
|
-
});
|
|
656
|
-
dayValue.product_variant = ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : (_item$_extend2$other = _item$_extend2.other) === null || _item$_extend2$other === void 0 ? void 0 : _item$_extend2$other.product_variant_id) || 0;
|
|
657
|
-
dayValue.product_option = option || [];
|
|
658
|
-
}
|
|
659
581
|
|
|
660
582
|
// 打开商品详情弹窗
|
|
661
583
|
state.action({
|
|
@@ -664,16 +586,14 @@ var Info = function Info(_, ref) {
|
|
|
664
586
|
id: item.id,
|
|
665
587
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
666
588
|
showConfig: {
|
|
667
|
-
option:
|
|
589
|
+
option: false,
|
|
668
590
|
session: false,
|
|
669
|
-
variant:
|
|
591
|
+
variant: false,
|
|
670
592
|
package: true
|
|
671
593
|
},
|
|
672
|
-
value:
|
|
673
|
-
customer_id: isDayBookingMode ? ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : (_state$client$value = _state$client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id) || 1 : undefined
|
|
594
|
+
value: item._extend.other
|
|
674
595
|
},
|
|
675
596
|
callback: function callback(e) {
|
|
676
|
-
var _cacheItem$_extend, _cacheItem$_extend$ot;
|
|
677
597
|
// 重新生成商品
|
|
678
598
|
var cacheItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
679
599
|
product_id: item.id,
|
|
@@ -689,12 +609,6 @@ var Info = function Info(_, ref) {
|
|
|
689
609
|
// 获取商品总价
|
|
690
610
|
var _total = getProductTotalPrice(cacheItem);
|
|
691
611
|
|
|
692
|
-
// 如果有多规格,则更新商品的单价
|
|
693
|
-
if (cacheItem !== null && cacheItem !== void 0 && (_cacheItem$_extend = cacheItem._extend) !== null && _cacheItem$_extend !== void 0 && (_cacheItem$_extend$ot = _cacheItem$_extend.other) !== null && _cacheItem$_extend$ot !== void 0 && _cacheItem$_extend$ot.product_variant_id) {
|
|
694
|
-
var _cacheItem$_extend2, _cacheItem$_extend2$o;
|
|
695
|
-
cacheItem._extend.price = Number((_cacheItem$_extend2 = cacheItem._extend) === null || _cacheItem$_extend2 === void 0 ? void 0 : (_cacheItem$_extend2$o = _cacheItem$_extend2.other) === null || _cacheItem$_extend2$o === void 0 ? void 0 : _cacheItem$_extend2$o.price);
|
|
696
|
-
}
|
|
697
|
-
|
|
698
612
|
// 用于折扣 可修改
|
|
699
613
|
cacheItem._extend.total = _total;
|
|
700
614
|
|
|
@@ -708,12 +622,11 @@ var Info = function Info(_, ref) {
|
|
|
708
622
|
cacheItem: cacheItem
|
|
709
623
|
}
|
|
710
624
|
});
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
}, 100);
|
|
625
|
+
|
|
626
|
+
// 更新表单内的商品价格
|
|
627
|
+
form.setFieldsValue({
|
|
628
|
+
total: _total
|
|
629
|
+
});
|
|
717
630
|
}
|
|
718
631
|
});
|
|
719
632
|
});
|
|
@@ -746,165 +659,8 @@ var Info = function Info(_, ref) {
|
|
|
746
659
|
};
|
|
747
660
|
});
|
|
748
661
|
var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
|
|
749
|
-
|
|
750
|
-
/**
|
|
751
|
-
* @title: 日期组件
|
|
752
|
-
* @description:
|
|
753
|
-
* @return {*}
|
|
754
|
-
* @Author: WangHan
|
|
755
|
-
* @Date: 2024-11-30 22:22
|
|
756
|
-
*/
|
|
757
|
-
var DateCom = function DateCom(position) {
|
|
758
|
-
return /*#__PURE__*/React.createElement(DatePicker, {
|
|
759
|
-
className: "pisell-lowcode__booking-service-select-date",
|
|
760
|
-
disabledDate: function disabledDate(current) {
|
|
761
|
-
return _disabledDate(current, position, useStartDate);
|
|
762
|
-
},
|
|
763
|
-
size: "large",
|
|
764
|
-
style: {
|
|
765
|
-
width: '100%'
|
|
766
|
-
},
|
|
767
|
-
format: state.locale === 'en' ? 'DD/MM/YYYY' : 'YYYY-MM-DD'
|
|
768
|
-
});
|
|
769
|
-
};
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* @title: 更新报价单价格
|
|
773
|
-
* @description:
|
|
774
|
-
* @param {any} param1
|
|
775
|
-
* @return {*}
|
|
776
|
-
* @Author: WangHan
|
|
777
|
-
* @Date: 2024-12-29 23:17
|
|
778
|
-
*/
|
|
779
|
-
var updateMultiDay = /*#__PURE__*/function () {
|
|
780
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref6) {
|
|
781
|
-
var start_date, end_date, duration, cacheItem, fieldsValues;
|
|
782
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
783
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
784
|
-
case 0:
|
|
785
|
-
start_date = _ref6.start_date, end_date = _ref6.end_date, duration = _ref6.duration;
|
|
786
|
-
_context4.next = 3;
|
|
787
|
-
return getMultiDay({
|
|
788
|
-
start_date: start_date,
|
|
789
|
-
end_date: end_date,
|
|
790
|
-
state: state,
|
|
791
|
-
cacheItem: getCurrentCacheItem()
|
|
792
|
-
});
|
|
793
|
-
case 3:
|
|
794
|
-
cacheItem = _context4.sent;
|
|
795
|
-
// 兼容时长为空的情况
|
|
796
|
-
if (duration !== undefined) {
|
|
797
|
-
cacheItem._extend.duration = duration;
|
|
798
|
-
}
|
|
799
|
-
cacheItem._extend.items = createBookingItemsByGroup(cacheItem);
|
|
800
|
-
cacheItem._extend = _objectSpread(_objectSpread({}, cacheItem._extend), getGroupTotalPrice(cacheItem._extend.items));
|
|
801
|
-
// 覆盖商品
|
|
802
|
-
dispatch({
|
|
803
|
-
type: 'setService',
|
|
804
|
-
payload: {
|
|
805
|
-
cacheItem: cacheItem
|
|
806
|
-
}
|
|
807
|
-
});
|
|
808
|
-
fieldsValues = {
|
|
809
|
-
total: cacheItem._extend.total
|
|
810
|
-
}; // 更新表单内的商品价格
|
|
811
|
-
form.setFieldsValue(fieldsValues);
|
|
812
|
-
case 10:
|
|
813
|
-
case "end":
|
|
814
|
-
return _context4.stop();
|
|
815
|
-
}
|
|
816
|
-
}, _callee4);
|
|
817
|
-
}));
|
|
818
|
-
return function updateMultiDay(_x5) {
|
|
819
|
-
return _ref7.apply(this, arguments);
|
|
820
|
-
};
|
|
821
|
-
}();
|
|
822
|
-
|
|
823
|
-
/**
|
|
824
|
-
* @title: 表单更新
|
|
825
|
-
* @description:
|
|
826
|
-
* @param {any} changedValues
|
|
827
|
-
* @return {*}
|
|
828
|
-
* @Author: WangHan
|
|
829
|
-
* @Date: 2024-12-04 14:39
|
|
830
|
-
*/
|
|
831
|
-
var onValuesChange = function onValuesChange(changedValues) {
|
|
832
|
-
// 跨日预约
|
|
833
|
-
if (isDayBookingMode) {
|
|
834
|
-
// 根据时长更新结束时间
|
|
835
|
-
if (changedValues !== null && changedValues !== void 0 && changedValues.duration) {
|
|
836
|
-
var end_date = dayjs(useStartDate).add(changedValues === null || changedValues === void 0 ? void 0 : changedValues.duration, 'day');
|
|
837
|
-
form.setFieldsValue({
|
|
838
|
-
end_date: end_date
|
|
839
|
-
});
|
|
840
|
-
|
|
841
|
-
// 跨日预约报价单
|
|
842
|
-
return updateMultiDay({
|
|
843
|
-
start_date: useStartDate,
|
|
844
|
-
end_date: end_date,
|
|
845
|
-
duration: changedValues === null || changedValues === void 0 ? void 0 : changedValues.duration
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
// 验证结束日期
|
|
850
|
-
if (changedValues !== null && changedValues !== void 0 && changedValues.start_date) {
|
|
851
|
-
var startDate = dayjs(changedValues === null || changedValues === void 0 ? void 0 : changedValues.start_date);
|
|
852
|
-
var endDate = dayjs(useEndDate);
|
|
853
|
-
// 如果开始日期大于结束日期,则清空数据
|
|
854
|
-
if (startDate.isAfter(endDate)) {
|
|
855
|
-
return form.setFieldsValue({
|
|
856
|
-
duration: undefined,
|
|
857
|
-
end_date: undefined
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
// 计算时长
|
|
863
|
-
if (changedValues !== null && changedValues !== void 0 && changedValues.start_date || changedValues !== null && changedValues !== void 0 && changedValues.end_date) {
|
|
864
|
-
var _cacheItem2 = getCurrentCacheItem();
|
|
865
|
-
var duration = getDays(_cacheItem2, 'days');
|
|
866
|
-
var start_date = (changedValues === null || changedValues === void 0 ? void 0 : changedValues.start_date) || useStartDate;
|
|
867
|
-
var _end_date = (changedValues === null || changedValues === void 0 ? void 0 : changedValues.end_date) || useEndDate;
|
|
868
|
-
updateMultiDay({
|
|
869
|
-
start_date: start_date,
|
|
870
|
-
end_date: _end_date,
|
|
871
|
-
duration: duration
|
|
872
|
-
});
|
|
873
|
-
return form.setFieldsValue({
|
|
874
|
-
duration: duration
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
};
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* @title: 是否显示资源和时长
|
|
882
|
-
* @description:
|
|
883
|
-
* @param {*} useMemo
|
|
884
|
-
* @return {*}
|
|
885
|
-
* @Author: WangHan
|
|
886
|
-
* @Date: 2024-12-09 15:59
|
|
887
|
-
*/
|
|
888
|
-
var showResource = useMemo(function () {
|
|
889
|
-
if (state.renderType === 'eventBooking') {
|
|
890
|
-
return false;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
// 跨日预约 预约商品才展示
|
|
894
|
-
if (isDayBookingMode) {
|
|
895
|
-
return isDayBookingProduct(state.service.cacheItem, state);
|
|
896
|
-
}
|
|
897
|
-
return true;
|
|
898
|
-
}, [state.service.cacheItem, state.renderType]);
|
|
899
|
-
var items = useMemo(function () {
|
|
900
|
-
var _getCurrentCacheItem, _getCurrentCacheItem$;
|
|
901
|
-
return ((_getCurrentCacheItem = getCurrentCacheItem()) === null || _getCurrentCacheItem === void 0 ? void 0 : (_getCurrentCacheItem$ = _getCurrentCacheItem._extend) === null || _getCurrentCacheItem$ === void 0 ? void 0 : _getCurrentCacheItem$.items) || [];
|
|
902
|
-
}, [getCurrentCacheItem(), state.service.cacheItem, useLikeStatus, currentResource, useTotal]);
|
|
903
|
-
var isEditGroup = useMemo(function () {
|
|
904
|
-
return items.length;
|
|
905
|
-
}, [items]);
|
|
906
662
|
return useMemo(function () {
|
|
907
|
-
var _state$service$cacheI10, _state$
|
|
663
|
+
var _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$service$cacheI15, _state$service$cacheI16, _state$service$cacheI17, _state$service$cacheI18, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
908
664
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
|
|
909
665
|
//通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
|
|
910
666
|
, {
|
|
@@ -912,7 +668,7 @@ var Info = function Info(_, ref) {
|
|
|
912
668
|
zIndex: state.service.changeService ? 999 : 1000,
|
|
913
669
|
forceRender: true,
|
|
914
670
|
open: state.service.editModal && !((_state$service$cacheI10 = state.service.cacheItem) !== null && _state$service$cacheI10 !== void 0 && _state$service$cacheI10.autoClose),
|
|
915
|
-
title:
|
|
671
|
+
title: locales.getText('pisell2.text.edit-service'),
|
|
916
672
|
onClose: function onClose() {
|
|
917
673
|
dispatch({
|
|
918
674
|
type: 'setService',
|
|
@@ -925,29 +681,10 @@ var Info = function Info(_, ref) {
|
|
|
925
681
|
}
|
|
926
682
|
}, /*#__PURE__*/React.createElement("div", {
|
|
927
683
|
className: "pisell-lowcode__booking-service-body-edit"
|
|
928
|
-
},
|
|
929
|
-
value: currentTab,
|
|
930
|
-
onChange: function onChange(e) {
|
|
931
|
-
console.log(e);
|
|
932
|
-
setCurrentTab(e);
|
|
933
|
-
}
|
|
934
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
935
|
-
className: "",
|
|
936
|
-
style: {
|
|
937
|
-
display: currentTab === 'booking_list' ? 'block' : 'none'
|
|
938
|
-
}
|
|
939
|
-
}, /*#__PURE__*/React.createElement(BookingList, {
|
|
940
|
-
items: items
|
|
941
|
-
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
942
|
-
className: "",
|
|
943
|
-
style: {
|
|
944
|
-
display: currentTab === 'batch_edit' ? 'block' : 'none'
|
|
945
|
-
}
|
|
946
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Form, {
|
|
684
|
+
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Form, {
|
|
947
685
|
layout: "vertical",
|
|
948
686
|
form: form,
|
|
949
|
-
onFinish: onFinish
|
|
950
|
-
onValuesChange: onValuesChange
|
|
687
|
+
onFinish: onFinish
|
|
951
688
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
952
689
|
style: {
|
|
953
690
|
width: '100%'
|
|
@@ -963,9 +700,9 @@ var Info = function Info(_, ref) {
|
|
|
963
700
|
className: "current-service-info-name-wrap"
|
|
964
701
|
}, /*#__PURE__*/React.createElement("div", {
|
|
965
702
|
className: "current-service-info-name"
|
|
966
|
-
}, ((_state$
|
|
703
|
+
}, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : (_state$service6$cache2 = _state$service6$cache._extend) === null || _state$service6$cache2 === void 0 ? void 0 : _state$service6$cache2.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
|
|
967
704
|
onClick: handleEdit
|
|
968
|
-
}, locales.getText('pisell2.text.edit')), !
|
|
705
|
+
}, locales.getText('pisell2.text.edit')), !state.isBookingCreatePage && /*#__PURE__*/React.createElement(Button, {
|
|
969
706
|
onClick: handleChange
|
|
970
707
|
}, locales.getText('pisell2.text.change'))), /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
971
708
|
style: {
|
|
@@ -1001,15 +738,15 @@ var Info = function Info(_, ref) {
|
|
|
1001
738
|
name: "discount_reason"
|
|
1002
739
|
}, /*#__PURE__*/React.createElement(Input.TextArea, {
|
|
1003
740
|
size: "large"
|
|
1004
|
-
}))) : null,
|
|
741
|
+
}))) : null, state.renderType !== 'eventBooking' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, {
|
|
1005
742
|
span: 12
|
|
1006
743
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
1007
|
-
label: locales.getText(
|
|
1008
|
-
name:
|
|
744
|
+
label: locales.getText('pisell2.text.start_time'),
|
|
745
|
+
name: "start_time",
|
|
1009
746
|
rules: [{
|
|
1010
747
|
required: true
|
|
1011
748
|
}]
|
|
1012
|
-
},
|
|
749
|
+
}, SelectTime ? /*#__PURE__*/React.createElement(SelectTime, {
|
|
1013
750
|
slice: (_state$bookingConfig5 = state.bookingConfig) === null || _state$bookingConfig5 === void 0 ? void 0 : (_state$bookingConfig6 = _state$bookingConfig5.config) === null || _state$bookingConfig6 === void 0 ? void 0 : (_state$bookingConfig7 = _state$bookingConfig6.basic) === null || _state$bookingConfig7 === void 0 ? void 0 : (_state$bookingConfig8 = _state$bookingConfig7.service_time) === null || _state$bookingConfig8 === void 0 ? void 0 : _state$bookingConfig8.value,
|
|
1014
751
|
timePickerProps: {
|
|
1015
752
|
style: {
|
|
@@ -1021,15 +758,7 @@ var Info = function Info(_, ref) {
|
|
|
1021
758
|
zoom: 0.8
|
|
1022
759
|
}
|
|
1023
760
|
}
|
|
1024
|
-
}) : null)),
|
|
1025
|
-
span: 12
|
|
1026
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
1027
|
-
label: locales.getText(isDayBookingMode ? 'pisell2.text.end_date' : 'pisell2.text.end_time'),
|
|
1028
|
-
name: "end_date",
|
|
1029
|
-
rules: [{
|
|
1030
|
-
required: true
|
|
1031
|
-
}]
|
|
1032
|
-
}, DateCom('end'))) : null, /*#__PURE__*/React.createElement(Col, {
|
|
761
|
+
}) : null)), /*#__PURE__*/React.createElement(Col, {
|
|
1033
762
|
span: 12
|
|
1034
763
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
1035
764
|
label: locales.getText('pisell2.text.duration'),
|
|
@@ -1039,17 +768,7 @@ var Info = function Info(_, ref) {
|
|
|
1039
768
|
}]
|
|
1040
769
|
}, /*#__PURE__*/React.createElement(Duration, _extends({}, durationProps, {
|
|
1041
770
|
timeObj: timeObj
|
|
1042
|
-
})))),
|
|
1043
|
-
span: 12
|
|
1044
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
1045
|
-
label: locales.getText('pisell2.text.holder'),
|
|
1046
|
-
name: "holder_id",
|
|
1047
|
-
rules: [{
|
|
1048
|
-
required: true
|
|
1049
|
-
}]
|
|
1050
|
-
}, /*#__PURE__*/React.createElement(Holder, {
|
|
1051
|
-
size: "large"
|
|
1052
|
-
}))) : null, /*#__PURE__*/React.createElement(Col, {
|
|
771
|
+
})))), /*#__PURE__*/React.createElement(Col, {
|
|
1053
772
|
span: 24
|
|
1054
773
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
1055
774
|
required: true,
|
|
@@ -1089,29 +808,7 @@ var Info = function Info(_, ref) {
|
|
|
1089
808
|
}, /*#__PURE__*/React.createElement(InputNumber, null)), /*#__PURE__*/React.createElement(Form.Item, {
|
|
1090
809
|
hidden: true,
|
|
1091
810
|
name: "like_status"
|
|
1092
|
-
}, /*#__PURE__*/React.createElement(Input, null))),
|
|
1093
|
-
span: 24
|
|
1094
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
1095
|
-
label: locales.getText('pisell2.text.quantity'),
|
|
1096
|
-
name: "quantity",
|
|
1097
|
-
rules: [{
|
|
1098
|
-
required: true
|
|
1099
|
-
}]
|
|
1100
|
-
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
1101
|
-
size: "large",
|
|
1102
|
-
style: {
|
|
1103
|
-
width: '100%'
|
|
1104
|
-
},
|
|
1105
|
-
min: 1,
|
|
1106
|
-
max: 999999,
|
|
1107
|
-
formatter: function formatter(value) {
|
|
1108
|
-
if (value !== undefined) {
|
|
1109
|
-
// 向下取整
|
|
1110
|
-
return Math.floor(value);
|
|
1111
|
-
}
|
|
1112
|
-
return value;
|
|
1113
|
-
}
|
|
1114
|
-
}))) : null))), showResource && errorList.map(function (d, i) {
|
|
811
|
+
}, /*#__PURE__*/React.createElement(Input, null)))))), state.renderType !== 'eventBooking' && errorList.map(function (d, i) {
|
|
1115
812
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
1116
813
|
key: d.type,
|
|
1117
814
|
message: d.label,
|
|
@@ -1121,7 +818,7 @@ var Info = function Info(_, ref) {
|
|
|
1121
818
|
marginBottom: 12
|
|
1122
819
|
}
|
|
1123
820
|
});
|
|
1124
|
-
})
|
|
821
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1125
822
|
className: "pisell-lowcode__booking-service-body-edit-footer"
|
|
1126
823
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1127
824
|
className: "pisell-lowcode__booking-service-delete-wrap",
|
|
@@ -1136,6 +833,6 @@ var Info = function Info(_, ref) {
|
|
|
1136
833
|
form.submit();
|
|
1137
834
|
}
|
|
1138
835
|
}, locales.getText('pisell2.text.apply'))))));
|
|
1139
|
-
}, [state.service.changeService, state.service.editModal, (_state$service$cacheI19 = state.service.cacheItem) === null || _state$service$cacheI19 === void 0 ? void 0 : _state$service$cacheI19.autoClose, locales, (_state$
|
|
836
|
+
}, [state.service.changeService, state.service.editModal, (_state$service$cacheI19 = state.service.cacheItem) === null || _state$service$cacheI19 === void 0 ? void 0 : _state$service$cacheI19.autoClose, locales, (_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : (_state$service7$cache2 = _state$service7$cache._extend) === null || _state$service7$cache2 === void 0 ? void 0 : _state$service7$cache2.product_name, bundles, state.amountSymbol, state.channelDisabledEdit, (_state$service$cacheI20 = state.service.cacheItem) === null || _state$service$cacheI20 === void 0 ? void 0 : (_state$service$cacheI21 = _state$service$cacheI20._extend) === null || _state$service$cacheI21 === void 0 ? void 0 : _state$service$cacheI21.origin_total, isDiscount, isReason, state.renderType, (_state$bookingConfig9 = state.bookingConfig) === null || _state$bookingConfig9 === void 0 ? void 0 : (_state$bookingConfig10 = _state$bookingConfig9.config) === null || _state$bookingConfig10 === void 0 ? void 0 : (_state$bookingConfig11 = _state$bookingConfig10.basic) === null || _state$bookingConfig11 === void 0 ? void 0 : (_state$bookingConfig12 = _state$bookingConfig11.service_time) === null || _state$bookingConfig12 === void 0 ? void 0 : _state$bookingConfig12.value, SelectTime, durationProps, timeObj, useResource, useLikeStatus, resourceLoading, selectOpen, state.service.resources, errorList, useTotal]);
|
|
1140
837
|
};
|
|
1141
838
|
export default /*#__PURE__*/forwardRef(Info);
|