@pisell/private-materials 3.0.197 → 3.0.199
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- 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 -45
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +32 -218
- 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 +4 -33
- package/es/components/booking/info/main.js +8 -20
- 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 +20 -127
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -11
- package/es/components/booking/info/service/addService/utils.js +24 -49
- package/es/components/booking/info/service/editService/index.js +41 -232
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/utils.d.ts +0 -9
- package/es/components/booking/info/utils.js +0 -13
- package/es/components/booking/locales.d.ts +0 -60
- package/es/components/booking/locales.js +3 -75
- package/es/components/booking/model.d.ts +1 -4
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +22 -126
- 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/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/helper.d.ts +1 -0
- package/es/components/eftposPay/helper.js +14 -0
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/tyro/index.js +51 -20
- 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 -26
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +31 -144
- 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 +10 -36
- package/lib/components/booking/info/main.js +4 -11
- 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 +28 -95
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -11
- package/lib/components/booking/info/service/addService/utils.js +10 -31
- package/lib/components/booking/info/service/editService/index.js +122 -271
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/utils.d.ts +0 -9
- package/lib/components/booking/info/utils.js +0 -6
- package/lib/components/booking/locales.d.ts +0 -60
- package/lib/components/booking/locales.js +3 -63
- package/lib/components/booking/model.d.ts +1 -4
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +15 -79
- 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/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/helper.d.ts +1 -0
- package/lib/components/eftposPay/helper.js +21 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +36 -7
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +3 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -37
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- 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 -118
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -158
- 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 -3
- package/es/components/booking/info/service2/index.js +0 -58
- 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 -145
- package/es/components/booking/info/service2/utils.js +0 -436
- 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 -96
- 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 -68
- 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 -124
- 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 -54
- 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 -119
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -59
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +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 -110
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -113
- 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 -3
- 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 -145
- package/lib/components/booking/info/service2/utils.js +0 -320
- 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 -89
- 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 -79
- 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 -116
- 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 -71
- 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 -92
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -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) || "";
|
|
@@ -91,7 +77,7 @@ var formatProductBundle = (bundle) => {
|
|
|
91
77
|
var getSubType = (item) => {
|
|
92
78
|
var _a;
|
|
93
79
|
const _type = (_a = item.duration) == null ? void 0 : _a.type;
|
|
94
|
-
if (_type) {
|
|
80
|
+
if (_type && _type !== "days") {
|
|
95
81
|
return _type;
|
|
96
82
|
}
|
|
97
83
|
return "minutes";
|
|
@@ -127,115 +113,39 @@ var formatResource = (service) => {
|
|
|
127
113
|
return void 0;
|
|
128
114
|
}
|
|
129
115
|
};
|
|
130
|
-
var
|
|
131
|
-
var _a, _b, _c, _d, _e;
|
|
132
|
-
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;
|
|
133
|
-
let obj = {
|
|
134
|
-
customer_id: values.customer_id,
|
|
135
|
-
form_id,
|
|
136
|
-
form_record: [((_e = item._extend) == null ? void 0 : _e.holder_id) || 0]
|
|
137
|
-
};
|
|
138
|
-
if (state.isFranchisee) {
|
|
139
|
-
obj.is_source_shop = 1;
|
|
140
|
-
}
|
|
141
|
-
return obj;
|
|
142
|
-
};
|
|
143
|
-
var formatProducts = (item) => {
|
|
144
|
-
var _a, _b;
|
|
145
|
-
const total = Number(item._extend.total);
|
|
146
|
-
const origin_total = Number(item._extend.origin_total);
|
|
147
|
-
const discount_amount = origin_total - total;
|
|
148
|
-
const discount_type = discount_amount < 0 ? "change_price" : "discount";
|
|
149
|
-
return {
|
|
150
|
-
"num": item._extend.quantity,
|
|
151
|
-
"price": item._extend.price,
|
|
152
|
-
"product_id": (item == null ? void 0 : item.product_id) || item.id,
|
|
153
|
-
"discount_amount": discount_amount,
|
|
154
|
-
"product_discount_reason": item._extend.discount_reason || "",
|
|
155
|
-
"is_charge_tax": item.is_charge_tax,
|
|
156
|
-
"note": (item == null ? void 0 : item.note) || "",
|
|
157
|
-
"discountway": item._extend.discountway || "num",
|
|
158
|
-
"discount_per": item._extend.discount_per,
|
|
159
|
-
"discount_type": item._extend.discount_type || discount_type,
|
|
160
|
-
"order_detail_id": item._extend.order_detail_id || 0,
|
|
161
|
-
"product_bundle": formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
|
|
162
|
-
"bundle_edit": item._extend.bundle_edit
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
var formatDayRelationProducts = (data, booking_item) => {
|
|
116
|
+
var formatBookings = (data) => {
|
|
166
117
|
const list = data.service.value;
|
|
167
|
-
let relation_products = list == null ? void 0 : list.filter((item) => {
|
|
168
|
-
var _a;
|
|
169
|
-
const holderId = (_a = item._extend) == null ? void 0 : _a.holder_id;
|
|
170
|
-
const bookingHolderId = booking_item._extend.holder_id;
|
|
171
|
-
const isAppointment = import_status.appointmentTypes.includes(item.extension_type);
|
|
172
|
-
return holderId && holderId === bookingHolderId && !isAppointment;
|
|
173
|
-
});
|
|
174
|
-
relation_products = relation_products.map((item) => {
|
|
175
|
-
return formatProducts(item);
|
|
176
|
-
});
|
|
177
|
-
return relation_products || [];
|
|
178
|
-
};
|
|
179
|
-
var formatAppointmentProductLists = (data) => {
|
|
180
|
-
var _a;
|
|
181
|
-
try {
|
|
182
|
-
let list = data.service.value;
|
|
183
|
-
list = list.filter((item) => {
|
|
184
|
-
var _a2;
|
|
185
|
-
return ((_a2 = item._extend) == null ? void 0 : _a2.holder_id) && import_status.appointmentTypes.includes(item.extension_type);
|
|
186
|
-
});
|
|
187
|
-
const groupMap = /* @__PURE__ */ new Map();
|
|
188
|
-
list.forEach((item) => {
|
|
189
|
-
var _a2;
|
|
190
|
-
const key = (_a2 = item._extend) == null ? void 0 : _a2.holder_id;
|
|
191
|
-
if (!groupMap.has(key)) {
|
|
192
|
-
groupMap.set(key, []);
|
|
193
|
-
}
|
|
194
|
-
groupMap.get(key).push(item);
|
|
195
|
-
});
|
|
196
|
-
groupMap.forEach((group) => {
|
|
197
|
-
group[0].relation_products = formatDayRelationProducts(data, group[0]);
|
|
198
|
-
});
|
|
199
|
-
const result = (_a = Array.from(groupMap.values())) == null ? void 0 : _a.reduce((acc, group) => acc.concat(group), []);
|
|
200
|
-
return result || [];
|
|
201
|
-
} catch (error) {
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
var formatBookings = (data, values) => {
|
|
205
|
-
const isDay = (0, import_utils4.isDayBooking)(data);
|
|
206
|
-
let list = data.service.value;
|
|
207
|
-
if (isDay) {
|
|
208
|
-
list = formatAppointmentProductLists(data);
|
|
209
|
-
}
|
|
210
|
-
let dayParams = {
|
|
211
|
-
relation_products: []
|
|
212
|
-
};
|
|
213
118
|
const eventOtherParams = data.eventOtherParams;
|
|
214
119
|
let bookings = [];
|
|
215
|
-
console.log(list, "wh_result11");
|
|
216
120
|
bookings = list.map((item) => {
|
|
217
|
-
var _a, _b
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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");
|
|
221
125
|
let start_time = item._extend.startDate.format("HH:mm");
|
|
222
126
|
if ((0, import_utils.isNowTime)(item._extend.start_time)) {
|
|
223
127
|
start_time = (0, import_utils.getNowTime)();
|
|
224
128
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
start_date = (0, import_dayjs.default)(startDateTime).format("YYYY-MM-DD");
|
|
230
|
-
start_time = (0, import_dayjs.default)(startDateTime).format("HH:mm");
|
|
231
|
-
end_date = (0, import_dayjs.default)(endDateTime).format("YYYY-MM-DD");
|
|
232
|
-
end_time = (0, import_dayjs.default)(endDateTime).format("HH:mm");
|
|
233
|
-
dayParams.relation_products = (item == null ? void 0 : item.relation_products) || [];
|
|
234
|
-
dayParams.holder = formatHolders(data, item, values);
|
|
235
|
-
dayParams.duration = (0, import_utils3.getDays)({ _extend: { start_date: startDateTime, end_date: endDateTime } }, "minutes");
|
|
236
|
-
}
|
|
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";
|
|
237
133
|
return {
|
|
238
|
-
"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
|
+
},
|
|
239
149
|
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
240
150
|
"id": item.booking_id || 0,
|
|
241
151
|
"relation_id": item._extend.relation_id || 0,
|
|
@@ -244,36 +154,22 @@ var formatBookings = (data, values) => {
|
|
|
244
154
|
"is_all": false,
|
|
245
155
|
"schedule_id": item._extend.schedule_id || 0,
|
|
246
156
|
"end_time": end_time,
|
|
247
|
-
"sub_type":
|
|
157
|
+
"sub_type": getSubType(item),
|
|
248
158
|
"select_date": start_date,
|
|
249
159
|
"start_time": start_time,
|
|
250
160
|
"end_date": end_date,
|
|
251
161
|
"start_date": start_date,
|
|
252
|
-
"duration":
|
|
162
|
+
"duration": import_utils.flexibleObj.getValue(item._extend.duration),
|
|
253
163
|
"number": item._extend.capacity ? (0, import_utilsByBooking.getSumCapacity)({ cacheItem: item }) : item._extend.number || 1,
|
|
254
164
|
"resources": formatResource(item),
|
|
255
165
|
"metadata": item._extend.capacity ? {
|
|
256
166
|
capacity: item._extend.capacity
|
|
257
167
|
} : void 0,
|
|
258
|
-
...eventOtherParams || {}
|
|
259
|
-
...dayParams
|
|
168
|
+
...eventOtherParams || {}
|
|
260
169
|
};
|
|
261
170
|
});
|
|
262
171
|
return bookings;
|
|
263
172
|
};
|
|
264
|
-
var formatRelationProducts = (data) => {
|
|
265
|
-
var _a;
|
|
266
|
-
let list = ((_a = data.service) == null ? void 0 : _a.value) || [];
|
|
267
|
-
list = list.filter((item) => {
|
|
268
|
-
var _a2;
|
|
269
|
-
return !((_a2 = item._extend) == null ? void 0 : _a2.holder_id);
|
|
270
|
-
});
|
|
271
|
-
let relationProducts = [];
|
|
272
|
-
relationProducts = list.map((item) => {
|
|
273
|
-
return formatProducts(item);
|
|
274
|
-
});
|
|
275
|
-
return relationProducts;
|
|
276
|
-
};
|
|
277
173
|
var formatHolder = (state, values) => {
|
|
278
174
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
279
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;
|
|
@@ -300,12 +196,9 @@ var formatValues = (state) => {
|
|
|
300
196
|
bookings: [],
|
|
301
197
|
customer_id: 1,
|
|
302
198
|
customer_name: "",
|
|
303
|
-
holder: {}
|
|
304
|
-
relation_products: [],
|
|
305
|
-
metadata: {}
|
|
199
|
+
holder: {}
|
|
306
200
|
};
|
|
307
|
-
|
|
308
|
-
if (!state.bookingId || isDay) {
|
|
201
|
+
if (!state.bookingId) {
|
|
309
202
|
values.shop_note = formatNote(state);
|
|
310
203
|
}
|
|
311
204
|
if (state.bookingId) {
|
|
@@ -321,18 +214,12 @@ var formatValues = (state) => {
|
|
|
321
214
|
...customer
|
|
322
215
|
};
|
|
323
216
|
values.holder = formatHolder(state, values);
|
|
324
|
-
|
|
325
|
-
values.relation_products = formatRelationProducts(state);
|
|
326
|
-
}
|
|
327
|
-
values.bookings = formatBookings(state, values);
|
|
217
|
+
values.bookings = formatBookings(state);
|
|
328
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)) {
|
|
329
219
|
let startTime = `${(_e = (_d = values == null ? void 0 : values.bookings) == null ? void 0 : _d[0]) == null ? void 0 : _e.start_time}`;
|
|
330
220
|
startTime = `${startTime || "00:00"}:00`;
|
|
331
221
|
values.schedule_date = `${values.bookings[0].select_date} ${startTime}`;
|
|
332
222
|
}
|
|
333
|
-
if (isDay) {
|
|
334
|
-
values.metadata.is_multiday_appointment = 1;
|
|
335
|
-
}
|
|
336
223
|
return values;
|
|
337
224
|
};
|
|
338
225
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -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,16 +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
50
|
var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
53
|
-
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;
|
|
54
52
|
const { globalState, setGlobalState } = props;
|
|
55
53
|
const modalRef = (0, import_react.useRef)();
|
|
56
54
|
const state = globalState;
|
|
57
55
|
const stateRef = (0, import_react.useRef)(state);
|
|
58
56
|
const prevCustomerId = (0, import_react.useRef)(null);
|
|
59
|
-
const changePetRef = (0, import_react.useRef)(null);
|
|
60
57
|
const context = (0, import_useEngineContext.default)();
|
|
61
58
|
const [isHasFormRecord, setIsHasFormRecord] = (0, import_react.useState)(true);
|
|
62
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");
|
|
@@ -111,14 +108,6 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
111
108
|
}
|
|
112
109
|
});
|
|
113
110
|
}
|
|
114
|
-
if (type === "setService") {
|
|
115
|
-
setGlobalState({
|
|
116
|
-
service: {
|
|
117
|
-
...stateRef.current.service,
|
|
118
|
-
...payload
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
111
|
};
|
|
123
112
|
const boardConfig = (0, import_react.useMemo)(() => {
|
|
124
113
|
var _a2, _b2, _c2;
|
|
@@ -139,18 +128,6 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
139
128
|
state == null ? void 0 : state.modalOpen
|
|
140
129
|
]);
|
|
141
130
|
const handleSelectPet = (val) => {
|
|
142
|
-
var _a2, _b2;
|
|
143
|
-
if ((0, import_utils4.isDayBooking)(state)) {
|
|
144
|
-
const { ids, lists } = (0, import_utils4.isOpenDeletePet)(state, val);
|
|
145
|
-
if ((ids == null ? void 0 : ids.length) > 0 && (lists == null ? void 0 : lists.length) > 0) {
|
|
146
|
-
(_b2 = changePetRef.current) == null ? void 0 : _b2.open({
|
|
147
|
-
ids,
|
|
148
|
-
setGlobalState,
|
|
149
|
-
service: ((_a2 = state.service) == null ? void 0 : _a2.value) || [],
|
|
150
|
-
state
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
131
|
setGlobalState({
|
|
155
132
|
pet: {
|
|
156
133
|
...state.pet,
|
|
@@ -282,7 +259,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
282
259
|
}, [isWalkIn, formId, (_q = state.client.value) == null ? void 0 : _q.id, currentPetValue, boardConfig]);
|
|
283
260
|
const petRender = (0, import_react.useMemo)(() => {
|
|
284
261
|
var _a2, _b2, _c2;
|
|
285
|
-
if ((
|
|
262
|
+
if ((state == null ? void 0 : state.disabledEdit) || boardConfig.type !== "form") {
|
|
286
263
|
return null;
|
|
287
264
|
}
|
|
288
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(
|
|
@@ -347,8 +324,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
347
324
|
handleAddPet,
|
|
348
325
|
currentPetValue,
|
|
349
326
|
formId,
|
|
350
|
-
(_x = (_w = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _w.holder) == null ? void 0 : _x.data_range
|
|
351
|
-
(_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
|
|
352
328
|
]);
|
|
353
329
|
const handleOpenClient = () => {
|
|
354
330
|
if (!isWalkIn || (state == null ? void 0 : state.disableEventBookingEdit)) {
|
|
@@ -383,11 +359,11 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
383
359
|
import_antd.Avatar,
|
|
384
360
|
{
|
|
385
361
|
className: "pisell-lowcode__booking-client-avatar",
|
|
386
|
-
src: import_utils.image.ali((
|
|
362
|
+
src: import_utils.image.ali((_y = state.client.value) == null ? void 0 : _y.cover, 100),
|
|
387
363
|
size: 64,
|
|
388
364
|
icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
|
|
389
365
|
}
|
|
390
|
-
), 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(
|
|
391
367
|
import_antd.Dropdown.Button,
|
|
392
368
|
{
|
|
393
369
|
menu: {
|
|
@@ -438,7 +414,7 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
438
414
|
showHeader: !state.isBookingCreatePage,
|
|
439
415
|
modalOpen: state.modalOpen,
|
|
440
416
|
loading,
|
|
441
|
-
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)),
|
|
442
418
|
ref: modalRef,
|
|
443
419
|
onClose: handleClose,
|
|
444
420
|
handleSelectClient,
|
|
@@ -448,16 +424,14 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
448
424
|
formData: state.pet.formData,
|
|
449
425
|
searchChange,
|
|
450
426
|
options: renderList,
|
|
451
|
-
holder: (
|
|
452
|
-
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,
|
|
453
429
|
loadMore,
|
|
454
430
|
showPet: (boardConfig == null ? void 0 : boardConfig.type) === "form",
|
|
455
431
|
handleAddPet,
|
|
456
|
-
franchiseeLoading
|
|
457
|
-
showWalkIn: !(0, import_utils4.isDayBooking)(state)
|
|
432
|
+
franchiseeLoading
|
|
458
433
|
}
|
|
459
|
-
)
|
|
460
|
-
/* @__PURE__ */ import_react.default.createElement(import_ChangePetModal.default, { ref: changePetRef })
|
|
434
|
+
)
|
|
461
435
|
);
|
|
462
436
|
});
|
|
463
437
|
var vertical_default = VerticalClient;
|
|
@@ -51,16 +51,13 @@ var import_notes = __toESM(require("./notes"));
|
|
|
51
51
|
var import_index = require("./index.less");
|
|
52
52
|
var import_classnames = __toESM(require("classnames"));
|
|
53
53
|
var import_antd = require("antd");
|
|
54
|
-
var import_service2 = require("./service2");
|
|
55
|
-
var import_utils3 = require("./service2/utils");
|
|
56
54
|
var import_useCreateBookingPageHeader = __toESM(require("../hooks/useCreateBookingPageHeader"));
|
|
57
55
|
var defaultModules = {
|
|
58
56
|
client: 1,
|
|
59
57
|
date: 1,
|
|
60
58
|
service: 1,
|
|
61
59
|
holder: 1,
|
|
62
|
-
note: 1
|
|
63
|
-
service2: 0
|
|
60
|
+
note: 1
|
|
64
61
|
};
|
|
65
62
|
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
66
63
|
var Info = (0, import_model.Provider)((props) => {
|
|
@@ -124,14 +121,11 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
124
121
|
globalState == null ? void 0 : globalState.renderType
|
|
125
122
|
]);
|
|
126
123
|
const notes = (0, import_react.useMemo)(() => {
|
|
127
|
-
var _a2, _b2
|
|
124
|
+
var _a2, _b2;
|
|
128
125
|
if (!modules.note) {
|
|
129
126
|
return null;
|
|
130
127
|
}
|
|
131
|
-
|
|
132
|
-
return /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
|
|
133
|
-
}
|
|
134
|
-
return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" || globalState.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_d2 = (_c2 = modal.state) == null ? void 0 : _c2.notes) == null ? void 0 : _d2.orderNote, onChange: addNote });
|
|
128
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" || globalState.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
|
|
135
129
|
}, [
|
|
136
130
|
modules.note,
|
|
137
131
|
globalState == null ? void 0 : globalState.bookingId,
|
|
@@ -156,7 +150,7 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
156
150
|
},
|
|
157
151
|
bodyClassName: (0, import_classnames.default)("booking-info-warp", {
|
|
158
152
|
["create-booking-page-info-wrap"]: isBookingCreatePage,
|
|
159
|
-
["create-booking-page-info-wrap-create"]: isBookingCreatePageCreateMode
|
|
153
|
+
["create-booking-page-info-wrap-create"]: isBookingCreatePageCreateMode
|
|
160
154
|
})
|
|
161
155
|
},
|
|
162
156
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, createHeader, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_i = modal.state) == null ? void 0 : _i.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -169,7 +163,6 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
169
163
|
style: { paddingTop: 20 }
|
|
170
164
|
},
|
|
171
165
|
modules.service ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service.default, null) : null) : null,
|
|
172
|
-
modules.service2 ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service2.Service2Cart, null) : null) : null,
|
|
173
166
|
notes,
|
|
174
167
|
slot ? slot : null
|
|
175
168
|
))
|
|
@@ -43,8 +43,6 @@ var import_format = require("../../forms/format");
|
|
|
43
43
|
var import_utils2 = require("../../utils");
|
|
44
44
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
45
45
|
var import_ahooks = require("ahooks");
|
|
46
|
-
var import_utils3 = require("../../info/service2/utils");
|
|
47
|
-
var import_ChangePetModal = __toESM(require("./ChangePetModal"));
|
|
48
46
|
var defaultParams = {
|
|
49
47
|
skip: 1,
|
|
50
48
|
num: 20,
|
|
@@ -67,7 +65,6 @@ var Pet = (props) => {
|
|
|
67
65
|
const context = (0, import_useEngineContext.default)();
|
|
68
66
|
const { isTerminal } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
69
67
|
const [params, setParams] = (0, import_react.useState)(defaultParams);
|
|
70
|
-
const changePetRef = (0, import_react.useRef)(null);
|
|
71
68
|
state = state || (props == null ? void 0 : props.state);
|
|
72
69
|
dispatch = dispatch || (props == null ? void 0 : props.dispatch);
|
|
73
70
|
const boardParams = (0, import_react.useMemo)(() => {
|
|
@@ -211,14 +208,10 @@ var Pet = (props) => {
|
|
|
211
208
|
let cur = [...state.pet.value[petForm.form_id] || []];
|
|
212
209
|
let options = ((_c2 = (_b2 = (_a2 = state.pet) == null ? void 0 : _a2.formData) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.options) || [];
|
|
213
210
|
if (res.type === "delete") {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
cur = cur.filter((d) => d.form_record_id !== item.form_record_id);
|
|
211
|
+
cur = cur.filter(
|
|
212
|
+
(d) => d.form_record_id !== item.form_record_id
|
|
213
|
+
);
|
|
218
214
|
addCallback();
|
|
219
|
-
if (isDay) {
|
|
220
|
-
handleDayChange(item);
|
|
221
|
-
}
|
|
222
215
|
} else {
|
|
223
216
|
let obj = {
|
|
224
217
|
customer: item == null ? void 0 : item.customer,
|
|
@@ -279,29 +272,27 @@ var Pet = (props) => {
|
|
|
279
272
|
}
|
|
280
273
|
});
|
|
281
274
|
});
|
|
282
|
-
const onValueChange = (0, import_ahooks.useMemoizedFn)(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
options
|
|
291
|
-
}
|
|
292
|
-
];
|
|
293
|
-
updateObj.pets = options;
|
|
294
|
-
}
|
|
295
|
-
dispatch({
|
|
296
|
-
type: "setPet",
|
|
297
|
-
payload: {
|
|
298
|
-
edit,
|
|
299
|
-
value: values,
|
|
300
|
-
...updateObj
|
|
275
|
+
const onValueChange = (0, import_ahooks.useMemoizedFn)(({ values, edit = true, options }) => {
|
|
276
|
+
var _a2, _b2;
|
|
277
|
+
const updateObj = {};
|
|
278
|
+
if (options) {
|
|
279
|
+
updateObj.formData = [
|
|
280
|
+
{
|
|
281
|
+
...(_b2 = (_a2 = state.pet) == null ? void 0 : _a2.formData) == null ? void 0 : _b2[0],
|
|
282
|
+
options
|
|
301
283
|
}
|
|
302
|
-
|
|
284
|
+
];
|
|
285
|
+
updateObj.pets = options;
|
|
303
286
|
}
|
|
304
|
-
|
|
287
|
+
dispatch({
|
|
288
|
+
type: "setPet",
|
|
289
|
+
payload: {
|
|
290
|
+
edit,
|
|
291
|
+
value: values,
|
|
292
|
+
...updateObj
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
});
|
|
305
296
|
(0, import_react.useEffect)(() => {
|
|
306
297
|
var _a2, _b2, _c2, _d2;
|
|
307
298
|
if (clientChangeNotSetPet)
|
|
@@ -372,29 +363,6 @@ var Pet = (props) => {
|
|
|
372
363
|
import_utils.locales.getText("pisell2.text.load-more")
|
|
373
364
|
)) : null;
|
|
374
365
|
}, [loadLoading, params, (_l = (_k = (_j = (_i = state.pet) == null ? void 0 : _i.formData) == null ? void 0 : _j[0]) == null ? void 0 : _k.options) == null ? void 0 : _l.length]);
|
|
375
|
-
const handleDayChange = (e) => {
|
|
376
|
-
var _a2, _b2;
|
|
377
|
-
const id = e == null ? void 0 : e.form_record_id;
|
|
378
|
-
const service = (_a2 = state.service.value) == null ? void 0 : _a2.filter(
|
|
379
|
-
(item) => item._extend.holder_id === id
|
|
380
|
-
);
|
|
381
|
-
if (id && (service == null ? void 0 : service.length)) {
|
|
382
|
-
changePetRef == null ? void 0 : changePetRef.current.open({
|
|
383
|
-
ids: [id],
|
|
384
|
-
dispatch,
|
|
385
|
-
service: ((_b2 = state.service) == null ? void 0 : _b2.value) || []
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
const dayCustomSelect = (0, import_react.useMemo)(() => {
|
|
390
|
-
const isDay = (0, import_utils3.isDayBooking)(state);
|
|
391
|
-
if (isDay) {
|
|
392
|
-
return {
|
|
393
|
-
handleDayChange
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
return {};
|
|
397
|
-
}, [state.renderType, state.service.value]);
|
|
398
366
|
return (0, import_react.useMemo)(() => {
|
|
399
367
|
var _a2;
|
|
400
368
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-wraps" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: valueLoading, active: true, round: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -404,10 +372,7 @@ var Pet = (props) => {
|
|
|
404
372
|
watch: { value: state.pet.value },
|
|
405
373
|
addCallback: (formDataConfig, data) => {
|
|
406
374
|
var _a3, _b2, _c2;
|
|
407
|
-
setPetOptions([
|
|
408
|
-
{ ...data, form_id: formDataConfig == null ? void 0 : formDataConfig.form_id },
|
|
409
|
-
...((_c2 = (_b2 = (_a3 = state.pet) == null ? void 0 : _a3.formData) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.options) || []
|
|
410
|
-
]);
|
|
375
|
+
setPetOptions([{ ...data, form_id: formDataConfig == null ? void 0 : formDataConfig.form_id }, ...((_c2 = (_b2 = (_a3 = state.pet) == null ? void 0 : _a3.formData) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.options) || []]);
|
|
411
376
|
},
|
|
412
377
|
loading: valueLoading,
|
|
413
378
|
forms: state.pet.formData,
|
|
@@ -433,8 +398,7 @@ var Pet = (props) => {
|
|
|
433
398
|
return true;
|
|
434
399
|
},
|
|
435
400
|
handleOpenModal,
|
|
436
|
-
previewItemTitleRender
|
|
437
|
-
...dayCustomSelect
|
|
401
|
+
previewItemTitleRender
|
|
438
402
|
},
|
|
439
403
|
optionRender: (item) => {
|
|
440
404
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -478,7 +442,7 @@ var Pet = (props) => {
|
|
|
478
442
|
...addButtonProps
|
|
479
443
|
}
|
|
480
444
|
}
|
|
481
|
-
))
|
|
445
|
+
)));
|
|
482
446
|
}, [
|
|
483
447
|
valueLoading,
|
|
484
448
|
hideTitle,
|