@pisell/private-materials 3.0.41 → 3.0.43
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 +3 -3
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +4 -4
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/index.js +16 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/TabProduct/productItem/index.js +11 -3
- package/es/components/booking/components/customSelect/index.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +12 -3
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/index.js +19 -12
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/client/index.js +3 -0
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +13 -5
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/info/notes/index.d.ts +1 -1
- package/es/components/booking/info/notes/index.js +5 -4
- package/es/components/booking/info/pet/index.js +16 -34
- package/es/components/booking/info/service/addService/index.js +82 -21
- package/es/components/booking/info/service/editService/index.js +28 -18
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +9 -6
- package/es/components/booking/model.d.ts +5 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/index.js +10 -8
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.js +3 -3
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/index.js +14 -0
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/TabProduct/productItem/index.js +7 -1
- package/lib/components/booking/components/customSelect/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +11 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/index.js +10 -4
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/client/index.js +3 -0
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +4 -2
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/info/notes/index.d.ts +1 -1
- package/lib/components/booking/info/notes/index.js +2 -1
- package/lib/components/booking/info/pet/index.js +10 -9
- package/lib/components/booking/info/service/addService/index.js +28 -9
- package/lib/components/booking/info/service/editService/index.js +20 -8
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +9 -6
- package/lib/components/booking/model.d.ts +5 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/index.js +3 -2
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.js +3 -3
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +3 -3
|
@@ -28,6 +28,7 @@ interface CustomSelectProps {
|
|
|
28
28
|
onVirtualListScroll?: any;
|
|
29
29
|
modalOpen?: boolean;
|
|
30
30
|
closeCallback?: () => any;
|
|
31
|
+
autoFocus?: boolean;
|
|
31
32
|
}
|
|
32
33
|
declare const _default: React.ForwardRefExoticComponent<CustomSelectProps & React.RefAttributes<unknown>>;
|
|
33
34
|
export default _default;
|
|
@@ -71,8 +71,10 @@ var CustomSelect = (props, ref) => {
|
|
|
71
71
|
onVirtualListScroll,
|
|
72
72
|
loadMore,
|
|
73
73
|
modalOpen,
|
|
74
|
-
closeCallback
|
|
74
|
+
closeCallback,
|
|
75
|
+
autoFocus
|
|
75
76
|
} = props;
|
|
77
|
+
const searchRef = (0, import_react.useRef)();
|
|
76
78
|
const [_value, set_value] = (0, import_react.useState)([]);
|
|
77
79
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
78
80
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
@@ -106,6 +108,12 @@ var CustomSelect = (props, ref) => {
|
|
|
106
108
|
}
|
|
107
109
|
setOpen(true);
|
|
108
110
|
initValue();
|
|
111
|
+
if (autoFocus) {
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
(_b = (_a = searchRef.current) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
115
|
+
}, 100);
|
|
116
|
+
}
|
|
109
117
|
};
|
|
110
118
|
const _onValueChange = (_val) => {
|
|
111
119
|
onValueChange(_val);
|
|
@@ -143,7 +151,7 @@ var CustomSelect = (props, ref) => {
|
|
|
143
151
|
if (filterItem) {
|
|
144
152
|
return filterItem(d, search);
|
|
145
153
|
}
|
|
146
|
-
return isIncludes(d.
|
|
154
|
+
return isIncludes(d.main_field || "");
|
|
147
155
|
});
|
|
148
156
|
}
|
|
149
157
|
return _list;
|
|
@@ -242,6 +250,7 @@ var CustomSelect = (props, ref) => {
|
|
|
242
250
|
header: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
243
251
|
import_antd.Input,
|
|
244
252
|
{
|
|
253
|
+
ref: searchRef,
|
|
245
254
|
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
246
255
|
style: { marginTop: 16, height: 44 },
|
|
247
256
|
placeholder: import_utils2.locales.getText("pisell2.text.search"),
|
|
@@ -41,22 +41,25 @@ var import_index = require("./index.less");
|
|
|
41
41
|
var import_utils = require("@pisell/utils");
|
|
42
42
|
var import_forms = __toESM(require("./forms"));
|
|
43
43
|
var import_utils2 = require("../utils");
|
|
44
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
44
45
|
var relation_type = "appointment_booking";
|
|
45
46
|
var Forms = (0, import_model.Provider)((props) => {
|
|
46
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
47
48
|
const { globalState } = props;
|
|
48
49
|
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
49
50
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
51
|
+
const context = (0, import_useEngineContext.default)();
|
|
52
|
+
const { isTerminal } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
50
53
|
const params = (0, import_react.useMemo)(() => {
|
|
51
54
|
var _a2, _b2, _c2;
|
|
52
55
|
return (_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject;
|
|
53
|
-
}, [(
|
|
56
|
+
}, [(_d = (_c = (_b = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
|
|
54
57
|
(0, import_react.useEffect)(() => {
|
|
55
58
|
var _a2, _b2;
|
|
56
59
|
if (!!((_b2 = (_a2 = state.bookingDetail) == null ? void 0 : _a2.bookings) == null ? void 0 : _b2.id)) {
|
|
57
60
|
geForms();
|
|
58
61
|
}
|
|
59
|
-
}, [(
|
|
62
|
+
}, [(_f = (_e = state.bookingDetail) == null ? void 0 : _e.bookings) == null ? void 0 : _f.id, (_h = (_g = state.client) == null ? void 0 : _g.value) == null ? void 0 : _h.id]);
|
|
60
63
|
const getFormDataById = async (item) => {
|
|
61
64
|
var _a2, _b2;
|
|
62
65
|
let _params = {
|
|
@@ -188,7 +191,10 @@ var Forms = (0, import_model.Provider)((props) => {
|
|
|
188
191
|
value: state.form.value,
|
|
189
192
|
onChange: onValueChange,
|
|
190
193
|
addCallback,
|
|
191
|
-
client: state.client.value
|
|
194
|
+
client: state.client.value,
|
|
195
|
+
customSelectProps: {
|
|
196
|
+
autoFocus: !state.isTerminal
|
|
197
|
+
}
|
|
192
198
|
}
|
|
193
199
|
)
|
|
194
200
|
) : null);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -42,6 +42,7 @@ var import_customSelect = __toESM(require("../../components/customSelect"));
|
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var import_utils = require("@pisell/utils");
|
|
44
44
|
var import_utils2 = require("../../utils");
|
|
45
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
45
46
|
var Info = () => {
|
|
46
47
|
var _a, _b, _c, _d, _e, _f;
|
|
47
48
|
const modalRef = (0, import_react.useRef)();
|
|
@@ -54,6 +55,7 @@ var Info = () => {
|
|
|
54
55
|
total: 0,
|
|
55
56
|
search: ""
|
|
56
57
|
});
|
|
58
|
+
const context = (0, import_useEngineContext.default)();
|
|
57
59
|
const menus = (0, import_react.useMemo)(() => {
|
|
58
60
|
let list = [
|
|
59
61
|
{ key: "view", label: import_utils.locales.getText("pisell2.text.view-profile") },
|
|
@@ -267,6 +269,7 @@ var Info = () => {
|
|
|
267
269
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
268
270
|
import_customSelect.default,
|
|
269
271
|
{
|
|
272
|
+
autoFocus: !state.isTerminal,
|
|
270
273
|
modalOpen: state.modalOpen,
|
|
271
274
|
ref: modalRef,
|
|
272
275
|
rowKey: "id",
|
|
@@ -82,11 +82,13 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
82
82
|
}
|
|
83
83
|
}, []);
|
|
84
84
|
(0, import_react.useEffect)(() => {
|
|
85
|
+
var _a2, _b2, _c2;
|
|
85
86
|
modal.dispatch({
|
|
86
87
|
type: "setState",
|
|
87
88
|
payload: {
|
|
88
89
|
setGlobalState: props.setGlobalState,
|
|
89
|
-
...globalState
|
|
90
|
+
...globalState,
|
|
91
|
+
isTerminal: (_c2 = (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.isTerminal) == null ? void 0 : _c2.call(_b2)
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
94
|
}, [globalState]);
|
|
@@ -103,7 +105,7 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
103
105
|
if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
|
|
104
106
|
return import_utils.locales.getText("pisell2.text.enroll");
|
|
105
107
|
}
|
|
106
|
-
return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) :
|
|
108
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { height: 20 } });
|
|
107
109
|
}, [
|
|
108
110
|
globalState == null ? void 0 : globalState.bookingId,
|
|
109
111
|
modal.state,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|
|
@@ -52,7 +52,7 @@ var Notes = () => {
|
|
|
52
52
|
];
|
|
53
53
|
}, [(_b = (_a = modal.state) == null ? void 0 : _a.notes) == null ? void 0 : _b.orderNote]);
|
|
54
54
|
const noteChange = ({ note, status, noteType }) => {
|
|
55
|
-
var _a2;
|
|
55
|
+
var _a2, _b2, _c2;
|
|
56
56
|
if (noteType === "internal") {
|
|
57
57
|
let _list = [...(_a2 = modal.state) == null ? void 0 : _a2.notes.internalNotes];
|
|
58
58
|
if (status == "add") {
|
|
@@ -75,6 +75,7 @@ var Notes = () => {
|
|
|
75
75
|
internalNotes: _list
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
(_c2 = (_b2 = modal.state) == null ? void 0 : _b2.refreshData) == null ? void 0 : _c2.call(_b2, {});
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
81
|
if (noteType === "order") {
|
|
@@ -41,15 +41,18 @@ var import_utils = require("@pisell/utils");
|
|
|
41
41
|
var import_forms = __toESM(require("../../forms/forms"));
|
|
42
42
|
var import_format = require("../../forms/format");
|
|
43
43
|
var import_utils2 = require("../../utils");
|
|
44
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
44
45
|
var Pet = () => {
|
|
45
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
46
47
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
47
48
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
48
49
|
const [valueLoading, setValueLoading] = (0, import_react.useState)(false);
|
|
50
|
+
const context = (0, import_useEngineContext.default)();
|
|
51
|
+
const { isTerminal } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
49
52
|
const params = (0, import_react.useMemo)(() => {
|
|
50
53
|
var _a2, _b2, _c2;
|
|
51
54
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.appointment_subject) || {};
|
|
52
|
-
}, [(
|
|
55
|
+
}, [(_d = (_c = (_b = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
|
|
53
56
|
const petForm = (0, import_react.useMemo)(() => {
|
|
54
57
|
return (state.pet.formData || [])[0];
|
|
55
58
|
}, [state.pet.formData]);
|
|
@@ -76,10 +79,7 @@ var Pet = () => {
|
|
|
76
79
|
formData: [
|
|
77
80
|
{
|
|
78
81
|
...formData,
|
|
79
|
-
// ...formData.form,
|
|
80
|
-
// form_id: formData.form.id,
|
|
81
82
|
options: _list
|
|
82
|
-
// type: formData.type,
|
|
83
83
|
}
|
|
84
84
|
],
|
|
85
85
|
pets: _list
|
|
@@ -204,7 +204,7 @@ var Pet = () => {
|
|
|
204
204
|
type: "setPet",
|
|
205
205
|
payload: { value: changeFormValuesData }
|
|
206
206
|
});
|
|
207
|
-
}, [(
|
|
207
|
+
}, [(_e = state.client.value) == null ? void 0 : _e.id]);
|
|
208
208
|
(0, import_react.useEffect)(() => {
|
|
209
209
|
if (state.bookingId) {
|
|
210
210
|
if (!state.bookingDetail) {
|
|
@@ -219,7 +219,7 @@ var Pet = () => {
|
|
|
219
219
|
state.bookingDetail,
|
|
220
220
|
params.form_id,
|
|
221
221
|
params.type,
|
|
222
|
-
(
|
|
222
|
+
(_g = (_f = state.client) == null ? void 0 : _f.value) == null ? void 0 : _g.id
|
|
223
223
|
]);
|
|
224
224
|
const addCallback = () => {
|
|
225
225
|
var _a2, _b2;
|
|
@@ -242,12 +242,13 @@ var Pet = () => {
|
|
|
242
242
|
modalOpen: state.modalOpen,
|
|
243
243
|
value: state.pet.value,
|
|
244
244
|
onChange: onValueChange,
|
|
245
|
-
client: (
|
|
245
|
+
client: (_h = state.client) == null ? void 0 : _h.value,
|
|
246
246
|
customSelectProps: {
|
|
247
247
|
loading,
|
|
248
248
|
handleViewItem,
|
|
249
249
|
virtualListHeight: window.innerHeight - 213 - 57 - 16,
|
|
250
|
-
disabled: state.disabledEdit
|
|
250
|
+
disabled: state.disabledEdit,
|
|
251
|
+
autoFocus: !state.isTerminal
|
|
251
252
|
},
|
|
252
253
|
optionRender: (item) => {
|
|
253
254
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -45,11 +45,18 @@ var import_serve = require("../serve");
|
|
|
45
45
|
var import_utils = require("../../utils");
|
|
46
46
|
var import_utils2 = require("../../../utils");
|
|
47
47
|
var import_utils3 = require("@pisell/utils");
|
|
48
|
+
var getCacheResourceId = () => {
|
|
49
|
+
const serviceParams = (0, import_utils2.getCacheParams)();
|
|
50
|
+
let resId = Number(serviceParams == null ? void 0 : serviceParams.resource_id);
|
|
51
|
+
console.log("resIdresIdresId", resId);
|
|
52
|
+
return resId;
|
|
53
|
+
};
|
|
48
54
|
var Info = () => {
|
|
49
|
-
var _a;
|
|
55
|
+
var _a, _b, _c;
|
|
50
56
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
51
57
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
52
58
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
59
|
+
const searchRef = (0, import_react.useRef)();
|
|
53
60
|
const context = (0, import_useEngineContext.default)();
|
|
54
61
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
55
62
|
const setDefaultService = async (list) => {
|
|
@@ -101,6 +108,11 @@ var Info = () => {
|
|
|
101
108
|
}
|
|
102
109
|
});
|
|
103
110
|
};
|
|
111
|
+
const autoAddProduct = async (cacheItem) => {
|
|
112
|
+
let resId = getCacheResourceId();
|
|
113
|
+
let _cacheItem = { ...cacheItem };
|
|
114
|
+
(0, import_utils2.deleteCacheParams)();
|
|
115
|
+
};
|
|
104
116
|
const getServices = async () => {
|
|
105
117
|
var _a2;
|
|
106
118
|
setLoading(true);
|
|
@@ -109,10 +121,6 @@ var Info = () => {
|
|
|
109
121
|
num: 500,
|
|
110
122
|
extension_type: state.renderType === "eventBooking" ? void 0 : ["product_appointment", "appointment_ticket"],
|
|
111
123
|
with: ["category"],
|
|
112
|
-
// include_formula: "no",
|
|
113
|
-
// include_bundle: "no",
|
|
114
|
-
// include_option: "no",
|
|
115
|
-
// include_variant: "no",
|
|
116
124
|
ids: state.renderType === "eventBooking" ? (_a2 = state.eventOtherParams) == null ? void 0 : _a2.productIds : void 0,
|
|
117
125
|
open_quotation: 1,
|
|
118
126
|
with_schedule: 1,
|
|
@@ -139,6 +147,12 @@ var Info = () => {
|
|
|
139
147
|
addModal: true
|
|
140
148
|
}
|
|
141
149
|
});
|
|
150
|
+
if (!state.isTerminal) {
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
var _a2, _b2;
|
|
153
|
+
(_b2 = (_a2 = searchRef.current) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
|
|
154
|
+
}, 100);
|
|
155
|
+
}
|
|
142
156
|
};
|
|
143
157
|
const handleSelectProduct = (item, type) => {
|
|
144
158
|
const isEject = type === "detail" || item.bundle_group_count > 0;
|
|
@@ -180,11 +194,14 @@ var Info = () => {
|
|
|
180
194
|
cacheItem.new = 0;
|
|
181
195
|
}
|
|
182
196
|
console.log("_total", cacheItem);
|
|
197
|
+
let resId = getCacheResourceId();
|
|
198
|
+
cacheItem.autoClose = !!resId;
|
|
183
199
|
dispatch({
|
|
184
200
|
type: "setService",
|
|
185
201
|
payload: {
|
|
186
202
|
editModal: true,
|
|
187
|
-
cacheItem
|
|
203
|
+
cacheItem,
|
|
204
|
+
addModal: !cacheItem.autoClose
|
|
188
205
|
}
|
|
189
206
|
});
|
|
190
207
|
}
|
|
@@ -205,9 +222,10 @@ var Info = () => {
|
|
|
205
222
|
return state.service.value.length > 0;
|
|
206
223
|
}, [state.service.value]);
|
|
207
224
|
(0, import_react.useEffect)(() => {
|
|
208
|
-
if (state.modalOpen) {
|
|
225
|
+
if (state.modalOpen && !state.bookingId) {
|
|
226
|
+
handleSelectService();
|
|
209
227
|
}
|
|
210
|
-
}, [state.modalOpen]);
|
|
228
|
+
}, [state.modalOpen, state.bookingId]);
|
|
211
229
|
const showAddButton = (0, import_react.useMemo)(() => {
|
|
212
230
|
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
213
231
|
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
@@ -240,7 +258,7 @@ var Info = () => {
|
|
|
240
258
|
state.service.value,
|
|
241
259
|
loading
|
|
242
260
|
]);
|
|
243
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, addButton, /* @__PURE__ */ import_react.default.createElement(
|
|
261
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_c = (_b = state.service) == null ? void 0 : _b.cacheItem) == null ? void 0 : _c.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
|
|
244
262
|
import_drawer.default,
|
|
245
263
|
{
|
|
246
264
|
open: state.service.addModal,
|
|
@@ -257,6 +275,7 @@ var Info = () => {
|
|
|
257
275
|
header: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
258
276
|
import_antd.Input,
|
|
259
277
|
{
|
|
278
|
+
ref: searchRef,
|
|
260
279
|
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
261
280
|
style: { marginTop: 16, height: 44 },
|
|
262
281
|
placeholder: import_utils3.locales.getText("pisell2.text.search"),
|
|
@@ -49,7 +49,7 @@ var import_utils3 = require("../../../utils");
|
|
|
49
49
|
var import_like = __toESM(require("../like"));
|
|
50
50
|
var import_mock = require("../../../mock");
|
|
51
51
|
var Info = () => {
|
|
52
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
53
53
|
const [form] = import_antd.Form.useForm();
|
|
54
54
|
const useTotal = import_antd.Form.useWatch("total", form);
|
|
55
55
|
const useLikeStatus = import_antd.Form.useWatch("like_status", form);
|
|
@@ -187,7 +187,7 @@ var Info = () => {
|
|
|
187
187
|
}
|
|
188
188
|
} else {
|
|
189
189
|
let _useResource = 0;
|
|
190
|
-
if (_list.length === 2) {
|
|
190
|
+
if (_list.length === 2 && useResource !== 0) {
|
|
191
191
|
_useResource = _list[1].form_record_id;
|
|
192
192
|
}
|
|
193
193
|
form.setFieldsValue({
|
|
@@ -200,6 +200,12 @@ var Info = () => {
|
|
|
200
200
|
resources: _list
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
|
+
setTimeout(() => {
|
|
204
|
+
var _a2;
|
|
205
|
+
if (((_a2 = state.service.cacheItem) == null ? void 0 : _a2.autoClose) || _list.length === 1 && useResource === 0) {
|
|
206
|
+
form.submit();
|
|
207
|
+
}
|
|
208
|
+
}, 200);
|
|
203
209
|
} catch (err) {
|
|
204
210
|
}
|
|
205
211
|
setResourceLoading(false);
|
|
@@ -269,7 +275,11 @@ var Info = () => {
|
|
|
269
275
|
const onFinish = (values) => {
|
|
270
276
|
var _a2;
|
|
271
277
|
let _list = [...state.service.value];
|
|
272
|
-
let _item = {
|
|
278
|
+
let _item = {
|
|
279
|
+
...state.service.cacheItem,
|
|
280
|
+
autoClose: false,
|
|
281
|
+
errorList
|
|
282
|
+
};
|
|
273
283
|
let _extend = {
|
|
274
284
|
..._item._extend,
|
|
275
285
|
...values
|
|
@@ -306,7 +316,8 @@ var Info = () => {
|
|
|
306
316
|
const setEditData = (0, import_ahooks.useMemoizedFn)(() => {
|
|
307
317
|
if (state.service.editModal) {
|
|
308
318
|
let cacheItem = state.service.cacheItem;
|
|
309
|
-
|
|
319
|
+
let values = (0, import_utils3.getServerItemExtend)(state, cacheItem, timeObj);
|
|
320
|
+
form.setFieldsValue(values);
|
|
310
321
|
if (state.renderType !== "eventBooking") {
|
|
311
322
|
getResources();
|
|
312
323
|
}
|
|
@@ -357,7 +368,8 @@ var Info = () => {
|
|
|
357
368
|
import_drawer.default,
|
|
358
369
|
{
|
|
359
370
|
zIndex: 1e3,
|
|
360
|
-
|
|
371
|
+
forceRender: true,
|
|
372
|
+
open: state.service.editModal && !((_j = state.service.cacheItem) == null ? void 0 : _j.autoClose),
|
|
361
373
|
title: import_utils.locales.getText("pisell2.text.edit-service"),
|
|
362
374
|
onClose: () => {
|
|
363
375
|
dispatch({
|
|
@@ -386,7 +398,7 @@ var Info = () => {
|
|
|
386
398
|
});
|
|
387
399
|
}
|
|
388
400
|
},
|
|
389
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((
|
|
401
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_m = (_l = (_k = state.service) == null ? void 0 : _k.cacheItem) == null ? void 0 : _l._extend) == null ? void 0 : _m.product_name) || "-"),
|
|
390
402
|
/* @__PURE__ */ import_react.default.createElement(
|
|
391
403
|
import_collapsibleList.default,
|
|
392
404
|
{
|
|
@@ -411,8 +423,8 @@ var Info = () => {
|
|
|
411
423
|
precision: 2,
|
|
412
424
|
style: { width: "100%" },
|
|
413
425
|
min: 0,
|
|
414
|
-
max: ((
|
|
415
|
-
placeholder: ((
|
|
426
|
+
max: ((_o = (_n = state.service.cacheItem) == null ? void 0 : _n._extend) == null ? void 0 : _o.origin_total) || 0,
|
|
427
|
+
placeholder: ((_q = (_p = state.service.cacheItem) == null ? void 0 : _p._extend) == null ? void 0 : _q.origin_total) || "0"
|
|
416
428
|
}
|
|
417
429
|
)
|
|
418
430
|
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -141,6 +141,7 @@ declare const _default: {
|
|
|
141
141
|
'pisell2.text.deposit-delete-message-title': string;
|
|
142
142
|
'pisell2.text.deposit-delete-message': string;
|
|
143
143
|
'pisell2.text.deposit-paid': string;
|
|
144
|
+
"pisell2.text.stock": string;
|
|
144
145
|
};
|
|
145
146
|
'zh-CN': {
|
|
146
147
|
'pisell2.text.refunded-amount': string;
|
|
@@ -284,6 +285,7 @@ declare const _default: {
|
|
|
284
285
|
'pisell2.text.deposit-delete-message-title': string;
|
|
285
286
|
'pisell2.text.deposit-delete-message': string;
|
|
286
287
|
'pisell2.text.deposit-paid': string;
|
|
288
|
+
"pisell2.text.stock": string;
|
|
287
289
|
};
|
|
288
290
|
'zh-HK': {
|
|
289
291
|
'pisell2.text.refunded-amount': string;
|
|
@@ -427,6 +429,7 @@ declare const _default: {
|
|
|
427
429
|
'pisell2.text.deposit-delete-message-title': string;
|
|
428
430
|
'pisell2.text.deposit-delete-message': string;
|
|
429
431
|
'pisell2.text.deposit-paid': string;
|
|
432
|
+
"pisell2.text.stock": string;
|
|
430
433
|
};
|
|
431
434
|
};
|
|
432
435
|
export default _default;
|
|
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(locales_exports);
|
|
|
25
25
|
var locales_default = {
|
|
26
26
|
"en": {
|
|
27
27
|
"pisell2.text.select-addons": "Select addons",
|
|
28
|
-
"pisell2.text.addons": "
|
|
28
|
+
"pisell2.text.addons": "Sales",
|
|
29
29
|
"pisell2.text.search": "Search",
|
|
30
30
|
"pisell2.text.view": "View",
|
|
31
31
|
"pisell2.text.edit": "Edit",
|
|
@@ -173,7 +173,8 @@ var locales_default = {
|
|
|
173
173
|
"pisell2.text.deposit-delete": "Delete deposit",
|
|
174
174
|
"pisell2.text.deposit-delete-message-title": "Prompt",
|
|
175
175
|
"pisell2.text.deposit-delete-message": "It cannot be restored after deletion. Please confirm the operation.",
|
|
176
|
-
"pisell2.text.deposit-paid": "Deposit paid"
|
|
176
|
+
"pisell2.text.deposit-paid": "Deposit paid",
|
|
177
|
+
"pisell2.text.stock": "Stock"
|
|
177
178
|
},
|
|
178
179
|
"zh-CN": {
|
|
179
180
|
"pisell2.text.refunded-amount": "已退金额",
|
|
@@ -181,7 +182,7 @@ var locales_default = {
|
|
|
181
182
|
"pisell2.text.amount-paid-on-order": "订单已付金额",
|
|
182
183
|
"pisell2.text.please-select-the-customer-first": "请先选择客户",
|
|
183
184
|
"pisell2.text.change": "更改",
|
|
184
|
-
"pisell2.text.addons": "
|
|
185
|
+
"pisell2.text.addons": "销售",
|
|
185
186
|
"pisell2.text.select-addons": "选择附加商品",
|
|
186
187
|
"pisell2.text.search": "搜索",
|
|
187
188
|
"pisell2.text.view": "查看",
|
|
@@ -330,7 +331,8 @@ var locales_default = {
|
|
|
330
331
|
"pisell2.text.deposit-delete": "删除定金",
|
|
331
332
|
"pisell2.text.deposit-delete-message-title": "提示",
|
|
332
333
|
"pisell2.text.deposit-delete-message": "删除后不可恢复,请确认操作",
|
|
333
|
-
"pisell2.text.deposit-paid": "已付定金"
|
|
334
|
+
"pisell2.text.deposit-paid": "已付定金",
|
|
335
|
+
"pisell2.text.stock": "库存"
|
|
334
336
|
},
|
|
335
337
|
"zh-HK": {
|
|
336
338
|
"pisell2.text.refunded-amount": "已退金額",
|
|
@@ -338,7 +340,7 @@ var locales_default = {
|
|
|
338
340
|
"pisell2.text.amount-paid-on-order": "訂單已付金額",
|
|
339
341
|
"pisell2.text.please-select-the-customer-first": "請先選擇客戶",
|
|
340
342
|
"pisell2.text.change": "更改",
|
|
341
|
-
"pisell2.text.addons": "
|
|
343
|
+
"pisell2.text.addons": "销售",
|
|
342
344
|
"pisell2.text.select-addons": "選擇附加商品",
|
|
343
345
|
"pisell2.text.search": "搜索",
|
|
344
346
|
"pisell2.text.view": "查看",
|
|
@@ -487,6 +489,7 @@ var locales_default = {
|
|
|
487
489
|
"pisell2.text.deposit-delete": "刪除定金",
|
|
488
490
|
"pisell2.text.deposit-delete-message-title": "提示",
|
|
489
491
|
"pisell2.text.deposit-delete-message": "刪除後不可恢復,請確認操作",
|
|
490
|
-
"pisell2.text.deposit-paid": "已付定金"
|
|
492
|
+
"pisell2.text.deposit-paid": "已付定金",
|
|
493
|
+
"pisell2.text.stock": "庫存"
|
|
491
494
|
}
|
|
492
495
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -71,11 +70,13 @@ export interface FormState {
|
|
|
71
70
|
bookingId: string | number;
|
|
72
71
|
bookingDetail: any;
|
|
73
72
|
channelDisabledEdit: boolean;
|
|
74
|
-
renderType?:
|
|
73
|
+
renderType?: "eventBooking";
|
|
74
|
+
modalOpen?: boolean;
|
|
75
|
+
isTerminal?: boolean;
|
|
75
76
|
eventOtherParams?: {
|
|
76
77
|
relation_id: number;
|
|
77
78
|
number: number;
|
|
78
|
-
registration_type:
|
|
79
|
+
registration_type: "single" | "all" | "extra_include";
|
|
79
80
|
start_date: string;
|
|
80
81
|
start_time: string;
|
|
81
82
|
end_date: string;
|
|
@@ -87,7 +88,7 @@ export declare const walkInData: {
|
|
|
87
88
|
id: number;
|
|
88
89
|
nickname: string;
|
|
89
90
|
};
|
|
90
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
91
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
91
92
|
state: FormState;
|
|
92
93
|
} & {
|
|
93
94
|
dispatch: (params: {
|
|
@@ -78,9 +78,10 @@ var Notes = (0, import_model.Provider)((props) => {
|
|
|
78
78
|
});
|
|
79
79
|
}, [globalState]);
|
|
80
80
|
const noteChange = ({ note, status, noteType }) => {
|
|
81
|
-
var _a2;
|
|
81
|
+
var _a2, _b2, _c2;
|
|
82
|
+
(_b2 = (_a2 = modal.state) == null ? void 0 : _a2.refreshData) == null ? void 0 : _b2.call(_a2, {});
|
|
82
83
|
if (noteType === "internal") {
|
|
83
|
-
let _list = [...(
|
|
84
|
+
let _list = [...(_c2 = modal.state) == null ? void 0 : _c2.notes.internalNotes];
|
|
84
85
|
if (status == "add") {
|
|
85
86
|
_list.push(note);
|
|
86
87
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -431,9 +431,9 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
|
431
431
|
if (str) {
|
|
432
432
|
findNextSliceProps.date = (0, import_dayjs.default)(str).format("HH:mm");
|
|
433
433
|
}
|
|
434
|
-
let resourceId = serviceParams.resource_id;
|
|
435
|
-
if (resourceId) {
|
|
436
|
-
_extend.resource =
|
|
434
|
+
let resourceId = Number(serviceParams.resource_id);
|
|
435
|
+
if (resourceId || resourceId === 0) {
|
|
436
|
+
_extend.resource = resourceId;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
console.log("_extend", findNextSliceProps);
|