@pisell/private-materials 3.0.154 → 3.0.156
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 +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/booking/addons/index.js +10 -7
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/TabProduct/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +5 -1
- package/es/components/booking/components/drawer/index.d.ts +3 -3
- package/es/components/booking/components/drawer/index.js +15 -13
- package/es/components/booking/components/drawer/index.less +8 -6
- package/es/components/booking/components/footer/index.js +21 -7
- package/es/components/booking/deposit/EditDepositModal/index.less +3 -0
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/info/client/index.js +35 -15
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +4 -4
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +59 -32
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +3 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.js +14 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +3 -3
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +38 -34
- package/es/components/booking/info/clientVariant/vertical/index.d.ts +1 -1
- package/es/components/booking/info/clientVariant/vertical/index.js +30 -13
- package/es/components/booking/info/clientVariant/vertical/index.less +30 -12
- package/es/components/booking/info/date/index.js +1 -0
- package/es/components/booking/info/date/index.less +2 -0
- package/es/components/booking/info/header/index.js +13 -12
- package/es/components/booking/info/main.js +10 -1
- package/es/components/booking/info/service/addService/index.js +10 -8
- package/es/components/booking/info/service/addTimeModal/index.js +1 -0
- package/es/components/booking/info/service/addTimeModal/index.less +1 -1
- package/es/components/booking/info/service/editService/index.js +3 -2
- package/es/components/booking/info/service/serviceList/index.js +2 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/index.js +10 -1
- package/es/components/booking/info2/utilsByBooking.js +2 -3
- package/es/components/booking/model.d.ts +2 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/lib/components/booking/addons/index.js +2 -5
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/TabProduct/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +2 -1
- package/lib/components/booking/components/drawer/index.d.ts +3 -3
- package/lib/components/booking/components/drawer/index.js +13 -11
- package/lib/components/booking/components/drawer/index.less +8 -6
- package/lib/components/booking/components/footer/index.js +16 -12
- package/lib/components/booking/deposit/EditDepositModal/index.less +3 -0
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/info/client/index.js +33 -21
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +4 -4
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +33 -13
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +3 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.js +36 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +3 -3
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +39 -9
- package/lib/components/booking/info/clientVariant/vertical/index.d.ts +1 -1
- package/lib/components/booking/info/clientVariant/vertical/index.js +52 -31
- package/lib/components/booking/info/clientVariant/vertical/index.less +30 -12
- package/lib/components/booking/info/date/index.js +1 -0
- package/lib/components/booking/info/date/index.less +2 -0
- package/lib/components/booking/info/header/index.js +14 -12
- package/lib/components/booking/info/main.js +14 -1
- package/lib/components/booking/info/service/addService/index.js +3 -1
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.less +1 -1
- package/lib/components/booking/info/service/editService/index.js +8 -7
- package/lib/components/booking/info/service/serviceList/index.js +4 -3
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/index.js +14 -1
- package/lib/components/booking/info2/utilsByBooking.js +1 -2
- package/lib/components/booking/model.d.ts +2 -0
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/package.json +4 -4
|
@@ -38,15 +38,18 @@ var import_serve = require("../../client/serve");
|
|
|
38
38
|
var import_model = require("../../model");
|
|
39
39
|
var import_utils2 = require("@pisell/utils");
|
|
40
40
|
var import_antd = require("antd");
|
|
41
|
+
var import_useIsLowSpeedNetwork = __toESM(require("./useIsLowSpeedNetwork"));
|
|
42
|
+
var isLoadClient = false;
|
|
41
43
|
var useClientFn = (_params) => {
|
|
42
44
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
43
45
|
const { state, setGlobalState, modalRef, onRemoveClient } = _params;
|
|
44
46
|
const [loadLoading, setLoadLoading] = (0, import_react.useState)(false);
|
|
45
47
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
46
48
|
const [franchiseeLoading, setFranchiseeLoading] = (0, import_react.useState)(0);
|
|
49
|
+
const isLowSpeedNetwork = (0, import_useIsLowSpeedNetwork.default)();
|
|
47
50
|
const [params, setParams] = (0, import_react.useState)({
|
|
48
51
|
skip: 1,
|
|
49
|
-
num:
|
|
52
|
+
num: 5,
|
|
50
53
|
total: 0,
|
|
51
54
|
search: "",
|
|
52
55
|
with: ["formRecord"],
|
|
@@ -74,21 +77,33 @@ var useClientFn = (_params) => {
|
|
|
74
77
|
customer_ids,
|
|
75
78
|
...resetParams
|
|
76
79
|
}, returnResult) => {
|
|
77
|
-
|
|
80
|
+
var _a2, _b2;
|
|
81
|
+
let _setLoading;
|
|
82
|
+
if (resetParams.skip === 1) {
|
|
83
|
+
if (resetParams.search) {
|
|
84
|
+
_setLoading = setLoading;
|
|
85
|
+
} else {
|
|
86
|
+
_setLoading = isLoadClient || ((_b2 = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.clients) == null ? void 0 : _b2.length) ? () => {
|
|
87
|
+
} : setLoading;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
_setLoading = setLoadLoading;
|
|
91
|
+
}
|
|
78
92
|
_setLoading(true);
|
|
79
93
|
const api = state.isFranchisee ? import_serve.getFranchiseeCustomerList : state.apis.getClients;
|
|
80
94
|
const data = await api({
|
|
81
95
|
...resetParams,
|
|
96
|
+
...resetParams.search ? { num: 10 } : {},
|
|
82
97
|
...state.isFranchisee ? { franchisee_customer_ids: customer_ids } : { customer_ids },
|
|
83
98
|
...!state.isFranchisee && !returnResult ? { _config: { abort: true } } : {}
|
|
84
99
|
});
|
|
85
100
|
const list = ((data == null ? void 0 : data.list) || []).map((d) => {
|
|
86
|
-
var
|
|
101
|
+
var _a3;
|
|
87
102
|
return {
|
|
88
103
|
...d,
|
|
89
104
|
name: getNickname(d),
|
|
90
105
|
id: d.franchisee_customer_id || d.id,
|
|
91
|
-
form_record: ((
|
|
106
|
+
form_record: ((_a3 = d.form_record) == null ? void 0 : _a3.map((item) => ({
|
|
92
107
|
...item,
|
|
93
108
|
...item.data,
|
|
94
109
|
form_record_id: item.id
|
|
@@ -126,7 +141,9 @@ var useClientFn = (_params) => {
|
|
|
126
141
|
..._payload
|
|
127
142
|
}
|
|
128
143
|
});
|
|
129
|
-
|
|
144
|
+
isLoadClient = true;
|
|
145
|
+
setLoading(false);
|
|
146
|
+
setLoadLoading(false);
|
|
130
147
|
return {};
|
|
131
148
|
};
|
|
132
149
|
const handleOpenClientModal = (val) => {
|
|
@@ -215,7 +232,8 @@ var useClientFn = (_params) => {
|
|
|
215
232
|
if ((0, import_utils.isWalkIn)(item == null ? void 0 : item.id)) {
|
|
216
233
|
return import_utils2.locales.getText("pisell2.text.select-a-customer");
|
|
217
234
|
}
|
|
218
|
-
|
|
235
|
+
const firstLastName = item.first_name || item.last_name ? `${item.first_name} ${item.last_name}` : "";
|
|
236
|
+
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || firstLastName.trim() || "";
|
|
219
237
|
},
|
|
220
238
|
[import_utils2.locales.localeMap]
|
|
221
239
|
);
|
|
@@ -254,19 +272,21 @@ var useClientFn = (_params) => {
|
|
|
254
272
|
resolve(0);
|
|
255
273
|
});
|
|
256
274
|
};
|
|
257
|
-
const handleCreateItem = () => {
|
|
275
|
+
const handleCreateItem = (cb) => {
|
|
258
276
|
state.action({
|
|
259
277
|
type: "pisell1.handleOpenAddCustomerModal",
|
|
260
278
|
data: {
|
|
261
279
|
showReceiveAddress: false,
|
|
262
280
|
showAcceptsMarketing: false
|
|
263
281
|
},
|
|
264
|
-
callback: (customer_id) => {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
282
|
+
callback: (customer_id, params2) => {
|
|
283
|
+
var _a2, _b2, _c2;
|
|
284
|
+
cb == null ? void 0 : cb();
|
|
285
|
+
setClient({
|
|
286
|
+
clients: [
|
|
287
|
+
...((_a2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _a2.customer) ? [{ ...(_b2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _b2.customer, id: customer_id, form_record: [] }] : [],
|
|
288
|
+
...((_c2 = state.client) == null ? void 0 : _c2.clients) || []
|
|
289
|
+
]
|
|
270
290
|
});
|
|
271
291
|
}
|
|
272
292
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.ts
|
|
20
|
+
var useIsLowSpeedNetwork_exports = {};
|
|
21
|
+
__export(useIsLowSpeedNetwork_exports, {
|
|
22
|
+
default: () => useIsLowSpeedNetwork_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useIsLowSpeedNetwork_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_ahooks = require("ahooks");
|
|
27
|
+
var useIsLowSpeedNetwork = () => {
|
|
28
|
+
const networkState = (0, import_ahooks.useNetwork)();
|
|
29
|
+
const isLowSpeedNetwork = (0, import_react.useRef)(false);
|
|
30
|
+
const isLowSpeedNetworkMemo = (0, import_react.useMemo)(() => {
|
|
31
|
+
return ["slow-2g", "2g", "3g"].includes((networkState == null ? void 0 : networkState.effectiveType) || "") || ((networkState == null ? void 0 : networkState.downlink) || 20) <= 1 || ((networkState == null ? void 0 : networkState.rtt) || 0) > 500;
|
|
32
|
+
}, [networkState]);
|
|
33
|
+
isLowSpeedNetwork.current = isLowSpeedNetworkMemo;
|
|
34
|
+
return isLowSpeedNetwork;
|
|
35
|
+
};
|
|
36
|
+
var useIsLowSpeedNetwork_default = useIsLowSpeedNetwork;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './SelectDrawer.less';
|
|
3
3
|
interface SelectDrawerProps {
|
|
4
4
|
autoFocus?: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
handleSelectClient: (val: any) => void;
|
|
7
|
-
handleCreateItem: () => void;
|
|
7
|
+
handleCreateItem: (cb: () => void) => void;
|
|
8
8
|
handleSelectPet: (val: any) => void;
|
|
9
9
|
childrenValue: any[];
|
|
10
10
|
formData: any;
|
|
@@ -114,7 +114,12 @@ var SelectDrawer = (props, ref) => {
|
|
|
114
114
|
const [_value, setValue] = (0, import_react.useState)(valList);
|
|
115
115
|
const clientRef = (0, import_react.useRef)();
|
|
116
116
|
(0, import_react.useEffect)(() => {
|
|
117
|
-
setValue(
|
|
117
|
+
setValue(
|
|
118
|
+
valList.map((item) => ({
|
|
119
|
+
...item,
|
|
120
|
+
id: item.id || item.form_record_id
|
|
121
|
+
}))
|
|
122
|
+
);
|
|
118
123
|
}, [valList]);
|
|
119
124
|
const searchRef = (0, import_react.useRef)();
|
|
120
125
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
@@ -160,12 +165,15 @@ var SelectDrawer = (props, ref) => {
|
|
|
160
165
|
if ((0, import_utils2.isWalkIn)(item == null ? void 0 : item.id)) {
|
|
161
166
|
return import_utils.locales.getText("pisell2.text.select-a-customer");
|
|
162
167
|
}
|
|
163
|
-
|
|
168
|
+
const firstLastName = item.first_name || item.last_name ? `${item.first_name} ${item.last_name}` : "";
|
|
169
|
+
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || firstLastName.trim() || "";
|
|
164
170
|
},
|
|
165
171
|
[import_utils.locales.localeMap]
|
|
166
172
|
);
|
|
167
173
|
const handleAddClient = () => {
|
|
168
|
-
handleCreateItem()
|
|
174
|
+
handleCreateItem(() => {
|
|
175
|
+
setSearch("");
|
|
176
|
+
});
|
|
169
177
|
};
|
|
170
178
|
const handleChildrenValueChange = async (value, item) => {
|
|
171
179
|
var _a;
|
|
@@ -250,7 +258,10 @@ var SelectDrawer = (props, ref) => {
|
|
|
250
258
|
...isHasChildren ? [] : (0, import_format.formatAddFormValues)({
|
|
251
259
|
clientId: item.id,
|
|
252
260
|
data_range: holder.data_range,
|
|
253
|
-
value: (_a = item.form_record) == null ? void 0 : _a.map((f) => ({
|
|
261
|
+
value: (_a = item.form_record) == null ? void 0 : _a.map((f) => ({
|
|
262
|
+
...f,
|
|
263
|
+
customer: item
|
|
264
|
+
}))
|
|
254
265
|
})
|
|
255
266
|
],
|
|
256
267
|
"id"
|
|
@@ -287,9 +298,18 @@ var SelectDrawer = (props, ref) => {
|
|
|
287
298
|
getContainer: false,
|
|
288
299
|
destroyOnClose: true,
|
|
289
300
|
push: { distance: 180 },
|
|
290
|
-
footer: mode === "multiple" && /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
301
|
+
footer: mode === "multiple" && /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
302
|
+
import_antd.Button,
|
|
303
|
+
{
|
|
304
|
+
block: true,
|
|
305
|
+
type: "primary",
|
|
306
|
+
onClick: handleOk,
|
|
307
|
+
loading: !!franchiseeLoading
|
|
308
|
+
},
|
|
309
|
+
import_utils.locales.getText("pisell2.text.apply")
|
|
310
|
+
))
|
|
291
311
|
},
|
|
292
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
312
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "vertical-client-select-drawer-content-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "vertical-client-select-drawer-top" }, /* @__PURE__ */ import_react.default.createElement(
|
|
293
313
|
ActionItem,
|
|
294
314
|
{
|
|
295
315
|
title: import_utils.locales.getText("pisell2.text.create-new-customer"),
|
|
@@ -304,7 +324,7 @@ var SelectDrawer = (props, ref) => {
|
|
|
304
324
|
closeDrawer();
|
|
305
325
|
}
|
|
306
326
|
}
|
|
307
|
-
)), !!options.length ? options.map((item) => {
|
|
327
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: !!loading, delay: 500 }, !!options.length ? options.map((item) => {
|
|
308
328
|
var _a;
|
|
309
329
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
310
330
|
"div",
|
|
@@ -332,7 +352,10 @@ var SelectDrawer = (props, ref) => {
|
|
|
332
352
|
"div",
|
|
333
353
|
{
|
|
334
354
|
onClick: () => {
|
|
335
|
-
handleChildrenValueChange(
|
|
355
|
+
handleChildrenValueChange(
|
|
356
|
+
{ ...f, customer: item },
|
|
357
|
+
item
|
|
358
|
+
);
|
|
336
359
|
},
|
|
337
360
|
id: `${f.id}`,
|
|
338
361
|
key: f.id,
|
|
@@ -344,7 +367,14 @@ var SelectDrawer = (props, ref) => {
|
|
|
344
367
|
)
|
|
345
368
|
},
|
|
346
369
|
mode === "multiple" && /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { checked }),
|
|
347
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
370
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
371
|
+
Item,
|
|
372
|
+
{
|
|
373
|
+
coverSize: 48,
|
|
374
|
+
title: f.main_field,
|
|
375
|
+
loading: false
|
|
376
|
+
}
|
|
377
|
+
)
|
|
348
378
|
);
|
|
349
379
|
}), /* @__PURE__ */ import_react.default.createElement(
|
|
350
380
|
"div",
|
|
@@ -4,5 +4,5 @@ interface VerticalClientProps {
|
|
|
4
4
|
globalState: any;
|
|
5
5
|
setGlobalState: any;
|
|
6
6
|
}
|
|
7
|
-
declare const VerticalClient:
|
|
7
|
+
declare const VerticalClient: React.ForwardRefExoticComponent<VerticalClientProps & React.RefAttributes<unknown>>;
|
|
8
8
|
export default VerticalClient;
|
|
@@ -37,6 +37,8 @@ var import_User01 = __toESM(require("@pisell/icon/es/User01"));
|
|
|
37
37
|
var import_PlusCircle = __toESM(require("@pisell/icon/es/PlusCircle"));
|
|
38
38
|
var import_antd = require("antd");
|
|
39
39
|
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_ahooks = require("ahooks");
|
|
41
|
+
var import_classnames = __toESM(require("classnames"));
|
|
40
42
|
var import_useClientFn = __toESM(require("../hooks/useClientFn"));
|
|
41
43
|
var import_SelectDrawer = __toESM(require("./SelectDrawer"));
|
|
42
44
|
var import_pet = __toESM(require("../../pet"));
|
|
@@ -44,8 +46,8 @@ var import_index = require("./index.less");
|
|
|
44
46
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
45
47
|
var import_format = require("../../../forms/format");
|
|
46
48
|
var import_utils2 = require("../../utils");
|
|
47
|
-
var
|
|
48
|
-
var VerticalClient = (props) => {
|
|
49
|
+
var import_utils3 = require("../../../utils");
|
|
50
|
+
var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
|
|
49
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;
|
|
50
52
|
const { globalState, setGlobalState } = props;
|
|
51
53
|
const modalRef = (0, import_react.useRef)();
|
|
@@ -55,6 +57,7 @@ var VerticalClient = (props) => {
|
|
|
55
57
|
const context = (0, import_useEngineContext.default)();
|
|
56
58
|
const [isHasFormRecord, setIsHasFormRecord] = (0, import_react.useState)(true);
|
|
57
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");
|
|
60
|
+
import_utils3.request.setRequest(context.appHelper.utils.request);
|
|
58
61
|
state.isFranchisee = isFranchisee;
|
|
59
62
|
stateRef.current = state;
|
|
60
63
|
const {
|
|
@@ -175,21 +178,23 @@ var VerticalClient = (props) => {
|
|
|
175
178
|
}
|
|
176
179
|
});
|
|
177
180
|
};
|
|
178
|
-
const previewItemTitleRender = (0, import_ahooks.useMemoizedFn)(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
const previewItemTitleRender = (0, import_ahooks.useMemoizedFn)(
|
|
182
|
+
(value, index, values) => {
|
|
183
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
184
|
+
const title = getNickname(value.customer) || ((_a2 = value == null ? void 0 : value.customer) == null ? void 0 : _a2.email) || ((_b2 = value == null ? void 0 : value.customer) == null ? void 0 : _b2.phone) || "";
|
|
185
|
+
if (((_c2 = value == null ? void 0 : value.customer) == null ? void 0 : _c2.id) === prevCustomerId.current) {
|
|
186
|
+
if (values.length === index + 1) {
|
|
187
|
+
prevCustomerId.current = null;
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
prevCustomerId.current = (_d2 = value == null ? void 0 : value.customer) == null ? void 0 : _d2.id;
|
|
182
192
|
if (values.length === index + 1) {
|
|
183
193
|
prevCustomerId.current = null;
|
|
184
194
|
}
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
prevCustomerId.current = (_d2 = value == null ? void 0 : value.customer) == null ? void 0 : _d2.id;
|
|
188
|
-
if (values.length === index + 1) {
|
|
189
|
-
prevCustomerId.current = null;
|
|
195
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-pet-title" }, title, " ' ", ((_f2 = (_e2 = state.pet.formData) == null ? void 0 : _e2[0]) == null ? void 0 : _f2.title) || "");
|
|
190
196
|
}
|
|
191
|
-
|
|
192
|
-
});
|
|
197
|
+
);
|
|
193
198
|
const isShowAddBtn = (0, import_react.useMemo)(() => {
|
|
194
199
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
195
200
|
const formId2 = (_c2 = (_b2 = (_a2 = state.pet) == null ? void 0 : _a2.formData) == null ? void 0 : _b2[0]) == null ? void 0 : _c2.form_id;
|
|
@@ -251,13 +256,7 @@ var VerticalClient = (props) => {
|
|
|
251
256
|
};
|
|
252
257
|
getData();
|
|
253
258
|
}
|
|
254
|
-
}, [
|
|
255
|
-
isWalkIn,
|
|
256
|
-
formId,
|
|
257
|
-
(_q = state.client.value) == null ? void 0 : _q.id,
|
|
258
|
-
currentPetValue,
|
|
259
|
-
boardConfig
|
|
260
|
-
]);
|
|
259
|
+
}, [isWalkIn, formId, (_q = state.client.value) == null ? void 0 : _q.id, currentPetValue, boardConfig]);
|
|
261
260
|
const petRender = (0, import_react.useMemo)(() => {
|
|
262
261
|
var _a2, _b2, _c2;
|
|
263
262
|
if ((state == null ? void 0 : state.disabledEdit) || boardConfig.type !== "form") {
|
|
@@ -284,7 +283,9 @@ var VerticalClient = (props) => {
|
|
|
284
283
|
handleSelectPet({
|
|
285
284
|
[formId]: (0, import_format.formatAddFormValues)({
|
|
286
285
|
clientId: (_b3 = (_a4 = state == null ? void 0 : state.client) == null ? void 0 : _a4.value) == null ? void 0 : _b3.id,
|
|
287
|
-
value: [
|
|
286
|
+
value: [
|
|
287
|
+
{ ...addRecord, customer: (_c3 = state == null ? void 0 : state.client) == null ? void 0 : _c3.value }
|
|
288
|
+
],
|
|
288
289
|
data_range: (_e2 = (_d2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _d2.holder) == null ? void 0 : _e2.data_range
|
|
289
290
|
})
|
|
290
291
|
});
|
|
@@ -325,18 +326,29 @@ var VerticalClient = (props) => {
|
|
|
325
326
|
formId,
|
|
326
327
|
(_x = (_w = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _w.holder) == null ? void 0 : _x.data_range
|
|
327
328
|
]);
|
|
329
|
+
const handleOpenClient = () => {
|
|
330
|
+
if (!isWalkIn || (state == null ? void 0 : state.disableEventBookingEdit)) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
handleOpenClientModal();
|
|
334
|
+
};
|
|
335
|
+
(0, import_react.useImperativeHandle)(ref, () => {
|
|
336
|
+
return {
|
|
337
|
+
close: () => {
|
|
338
|
+
var _a2;
|
|
339
|
+
(_a2 = modalRef.current) == null ? void 0 : _a2.close();
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
});
|
|
328
343
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-vertical-client-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
329
344
|
"div",
|
|
330
345
|
{
|
|
331
|
-
className: "pisell-lowcode__booking-vertical-client",
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
handleOpenClientModal();
|
|
337
|
-
}
|
|
346
|
+
className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-client", {
|
|
347
|
+
"pisell-lowcode__booking-vertical-client-walkin": isWalkIn
|
|
348
|
+
}),
|
|
349
|
+
onClick: handleOpenClient
|
|
338
350
|
},
|
|
339
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading:
|
|
351
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: false, active: true, round: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
340
352
|
import_antd.Avatar,
|
|
341
353
|
{
|
|
342
354
|
className: "pisell-lowcode__booking-client-avatar",
|
|
@@ -365,7 +377,16 @@ var VerticalClient = (props) => {
|
|
|
365
377
|
},
|
|
366
378
|
import_utils.locales.getText("pisell2.text.view-profile")
|
|
367
379
|
)))
|
|
368
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
380
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
381
|
+
"div",
|
|
382
|
+
{
|
|
383
|
+
className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-pet", {
|
|
384
|
+
"pisell-lowcode__booking-vertical-pet-walkin": isWalkIn
|
|
385
|
+
}),
|
|
386
|
+
onClick: handleOpenClient
|
|
387
|
+
},
|
|
388
|
+
petRender
|
|
389
|
+
), isShowAddBtn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-vertical-footer" }, /* @__PURE__ */ import_react.default.createElement(
|
|
369
390
|
import_antd.Button,
|
|
370
391
|
{
|
|
371
392
|
onClick: () => {
|
|
@@ -400,5 +421,5 @@ var VerticalClient = (props) => {
|
|
|
400
421
|
franchiseeLoading
|
|
401
422
|
}
|
|
402
423
|
));
|
|
403
|
-
};
|
|
424
|
+
});
|
|
404
425
|
var vertical_default = VerticalClient;
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
overflow: hidden;
|
|
4
4
|
height: 100%;
|
|
5
5
|
width: 100%;
|
|
6
|
-
border-right: 1px solid var(--Gray-200, #
|
|
7
|
-
background: var(--Gray-50, #
|
|
6
|
+
border-right: 1px solid var(--Gray-200, #eaecf0);
|
|
7
|
+
background: var(--Gray-50, #f9fafb);
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
.pisell-lowcode-drawer-content {
|
|
11
|
-
border-right: 1px solid var(--Gray-200, #
|
|
11
|
+
border-right: 1px solid var(--Gray-200, #eaecf0);
|
|
12
12
|
}
|
|
13
13
|
.pisell-lowcode__booking-drawer-title-wrap {
|
|
14
14
|
padding: 24px 24px 0;
|
|
@@ -16,17 +16,21 @@
|
|
|
16
16
|
.pisell-lowcode__booking-drawer-back {
|
|
17
17
|
margin-right: 6px;
|
|
18
18
|
}
|
|
19
|
-
.pisell-lowcode__booking-drawer-back,
|
|
19
|
+
.pisell-lowcode__booking-drawer-back,
|
|
20
|
+
.pisell-lowcode__booking-drawer-title {
|
|
20
21
|
font-size: 18px;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
.pisell-lowcode__booking-vertical-client-walkin {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
23
27
|
.pisell-lowcode__booking-vertical-client {
|
|
24
28
|
padding: 24px 16px;
|
|
25
29
|
display: flex;
|
|
26
30
|
flex-direction: column;
|
|
27
31
|
align-items: center;
|
|
28
32
|
width: 100%;
|
|
29
|
-
border-bottom: 1px solid var(--Gray-200, #
|
|
33
|
+
border-bottom: 1px solid var(--Gray-200, #eaecf0);
|
|
30
34
|
.pisell-lowcode__booking-client-avatar {
|
|
31
35
|
margin-bottom: 16px;
|
|
32
36
|
}
|
|
@@ -37,16 +41,17 @@
|
|
|
37
41
|
font-weight: 600;
|
|
38
42
|
line-height: 24px; /* 150% */
|
|
39
43
|
text-align: center;
|
|
44
|
+
display: inline-block;
|
|
40
45
|
}
|
|
41
46
|
.pisell-lowcode__booking-client-desc-item {
|
|
42
|
-
color: var(--Gray-400, #
|
|
47
|
+
color: var(--Gray-400, #98a2b3);
|
|
43
48
|
font-size: 14px;
|
|
44
49
|
font-style: normal;
|
|
45
50
|
font-weight: 400;
|
|
46
51
|
line-height: 20px; /* 142.857% */
|
|
47
52
|
text-align: center;
|
|
48
53
|
max-width: 200px;
|
|
49
|
-
word-break:break-word
|
|
54
|
+
word-break: break-word;
|
|
50
55
|
}
|
|
51
56
|
.pisell-lowcode__booking-client-action-wrap {
|
|
52
57
|
display: flex;
|
|
@@ -56,11 +61,23 @@
|
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
|
|
64
|
+
.pisell-lowcode__booking-client-info-desc {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
div > span {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
59
73
|
.pisell-lowcode__booking-vertical-pet {
|
|
60
74
|
padding: 0 24px 24px;
|
|
61
|
-
flex:1;
|
|
75
|
+
flex: 1;
|
|
62
76
|
overflow: auto;
|
|
63
77
|
}
|
|
78
|
+
.pisell-lowcode__booking-vertical-pet-walkin {
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
64
81
|
.pisell-lowcode__booking-pet-title {
|
|
65
82
|
color: var(--Gray-700, #344054);
|
|
66
83
|
font-size: 14px;
|
|
@@ -77,9 +94,10 @@
|
|
|
77
94
|
flex-direction: column;
|
|
78
95
|
align-items: flex-start;
|
|
79
96
|
gap: 16px;
|
|
80
|
-
border-top: 1px solid var(--Gray-200, #
|
|
81
|
-
background: var(--Base-White, #
|
|
82
|
-
box-shadow: 0px -4px 8px -2px rgba(16, 24, 40, 0.
|
|
97
|
+
border-top: 1px solid var(--Gray-200, #eaecf0);
|
|
98
|
+
background: var(--Base-White, #fff);
|
|
99
|
+
box-shadow: 0px -4px 8px -2px rgba(16, 24, 40, 0.1),
|
|
100
|
+
0px -2px 4px -2px rgba(16, 24, 40, 0.06);
|
|
83
101
|
}
|
|
84
102
|
.pisell-lowcode__create-form-wrap {
|
|
85
103
|
display: flex;
|
|
@@ -98,4 +116,4 @@
|
|
|
98
116
|
font-weight: 400;
|
|
99
117
|
line-height: 24px;
|
|
100
118
|
}
|
|
101
|
-
}
|
|
119
|
+
}
|
|
@@ -113,6 +113,7 @@ var DateCom = () => {
|
|
|
113
113
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-body-select-date" }, /* @__PURE__ */ import_react.default.createElement(
|
|
114
114
|
import_antd.DatePicker,
|
|
115
115
|
{
|
|
116
|
+
inputReadOnly: true,
|
|
116
117
|
allowClear: false,
|
|
117
118
|
size: "large",
|
|
118
119
|
style: { width: "100%", padding: 0 },
|
|
@@ -40,7 +40,7 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
|
|
|
40
40
|
var import_index = require("./index.less");
|
|
41
41
|
var import_classnames = __toESM(require("classnames"));
|
|
42
42
|
var header = ({ state, dispatch }) => {
|
|
43
|
-
var _a, _b, _c
|
|
43
|
+
var _a, _b, _c;
|
|
44
44
|
const context = (0, import_useEngineContext.default)();
|
|
45
45
|
const [modalContent, setModalContent] = (0, import_react.useState)({
|
|
46
46
|
open: false,
|
|
@@ -49,6 +49,12 @@ var header = ({ state, dispatch }) => {
|
|
|
49
49
|
title: /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { height: 14 } })
|
|
50
50
|
});
|
|
51
51
|
const { isTerminal, interaction, store, storage } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
52
|
+
const bookingDetail = (0, import_react.useMemo)(() => {
|
|
53
|
+
return {
|
|
54
|
+
...state.preliminaryBookingDetail || {},
|
|
55
|
+
...state.bookingDetail || {}
|
|
56
|
+
};
|
|
57
|
+
}, [state.bookingDetail, state.preliminaryBookingDetail]);
|
|
52
58
|
const statusList = [
|
|
53
59
|
{
|
|
54
60
|
label: import_utils.locales.getText("pisell2.text.status.new"),
|
|
@@ -155,12 +161,9 @@ var header = ({ state, dispatch }) => {
|
|
|
155
161
|
};
|
|
156
162
|
const isPaid = (0, import_react.useMemo)(() => {
|
|
157
163
|
return ["partially_paid", "paid"].find(
|
|
158
|
-
(d) =>
|
|
159
|
-
var _a2;
|
|
160
|
-
return d === ((_a2 = state.bookingDetail) == null ? void 0 : _a2.payment_status);
|
|
161
|
-
}
|
|
164
|
+
(d) => d === (bookingDetail == null ? void 0 : bookingDetail.payment_status)
|
|
162
165
|
);
|
|
163
|
-
}, [
|
|
166
|
+
}, [bookingDetail == null ? void 0 : bookingDetail.payment_status]);
|
|
164
167
|
const isTicket = (0, import_react.useMemo)(() => {
|
|
165
168
|
var _a2;
|
|
166
169
|
return (((_a2 = state.service) == null ? void 0 : _a2.value) || []).some(
|
|
@@ -168,10 +171,9 @@ var header = ({ state, dispatch }) => {
|
|
|
168
171
|
d.extension_type
|
|
169
172
|
)
|
|
170
173
|
);
|
|
171
|
-
}, [(
|
|
174
|
+
}, [(_b = state.service) == null ? void 0 : _b.value]);
|
|
172
175
|
const paymentProcessingPayment = (type) => {
|
|
173
|
-
|
|
174
|
-
const payments = ((_a2 = state == null ? void 0 : state.bookingDetail) == null ? void 0 : _a2.payments) || [];
|
|
176
|
+
const payments = (bookingDetail == null ? void 0 : bookingDetail.payments) || [];
|
|
175
177
|
const status = ["payment_processing"];
|
|
176
178
|
const payment_method = ["BANK_DEPOSIT"];
|
|
177
179
|
if (type === "bank") {
|
|
@@ -361,12 +363,12 @@ var header = ({ state, dispatch }) => {
|
|
|
361
363
|
className: "booking-header",
|
|
362
364
|
style: { backgroundColor: currentStatus.color }
|
|
363
365
|
},
|
|
364
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-order-sales-channel" }, orderSalesChannel[
|
|
365
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-line-2" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-left" }, import_utils.locales.getText("pisell2.text.status.booking_id"), ":", " ", ((
|
|
366
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-order-sales-channel" }, orderSalesChannel[bookingDetail == null ? void 0 : bookingDetail.order_sales_channel] || ""),
|
|
367
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-line-2" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-left" }, import_utils.locales.getText("pisell2.text.status.booking_id"), ":", " ", ((_c = bookingDetail == null ? void 0 : bookingDetail.bookings) == null ? void 0 : _c.booking_id) || "-"), /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-right" }, /* @__PURE__ */ import_react.default.createElement(
|
|
366
368
|
import_antd.Dropdown,
|
|
367
369
|
{
|
|
368
370
|
menu: { items, onClick: onSelect },
|
|
369
|
-
disabled: state.appointment_status === "cancelled"
|
|
371
|
+
disabled: state.appointment_status === "cancelled" || !state.bookingDetail
|
|
370
372
|
},
|
|
371
373
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-header-right-status" }, currentStatus.label, state.appointment_status !== "cancelled" ? /* @__PURE__ */ import_react.default.createElement(import_icons.DownOutlined, { className: "booking-header-right-status-icon" }) : null)
|
|
372
374
|
)))
|
|
@@ -49,6 +49,7 @@ var import_date2 = require("./date");
|
|
|
49
49
|
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
50
50
|
var import_notes = __toESM(require("./notes"));
|
|
51
51
|
var import_index = require("./index.less");
|
|
52
|
+
var import_antd = require("antd");
|
|
52
53
|
var defaultModules = {
|
|
53
54
|
client: 1,
|
|
54
55
|
date: 1,
|
|
@@ -146,7 +147,19 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
146
147
|
},
|
|
147
148
|
bodyClassName: "booking-info-warp"
|
|
148
149
|
},
|
|
149
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, 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,
|
|
150
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, 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(
|
|
151
|
+
import_antd.Skeleton,
|
|
152
|
+
{
|
|
153
|
+
loading: globalState.loading,
|
|
154
|
+
round: true,
|
|
155
|
+
active: true,
|
|
156
|
+
avatar: false,
|
|
157
|
+
style: { paddingTop: 20 }
|
|
158
|
+
},
|
|
159
|
+
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,
|
|
160
|
+
notes,
|
|
161
|
+
slot ? slot : null
|
|
162
|
+
))
|
|
150
163
|
) : null);
|
|
151
164
|
});
|
|
152
165
|
var main_default = Info;
|