@pisell/private-materials 3.0.42 → 3.0.44
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.js +9 -1
- 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/index.js +19 -12
- package/es/components/booking/info/client/index.js +3 -0
- package/es/components/booking/info/index.js +13 -5
- 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 +89 -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 +4 -2
- package/es/components/booking/notes/index.js +10 -8
- package/es/components/booking/utils.js +3 -3
- package/lib/components/booking/addons/index.js +8 -0
- 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/index.js +10 -4
- package/lib/components/booking/info/client/index.js +3 -0
- package/lib/components/booking/info/index.js +4 -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 +35 -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 +4 -2
- package/lib/components/booking/notes/index.js +3 -2
- package/lib/components/booking/utils.js +3 -3
- package/package.json +3 -3
|
@@ -17,21 +17,28 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
18
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
import React, { useContext, useEffect, useMemo, useState } from "react";
|
|
20
|
+
import React, { useContext, useEffect, useMemo, useState, useRef } from "react";
|
|
21
21
|
import SearchLg from "@pisell/icon/es/SearchLg";
|
|
22
22
|
import Drawer from "../../../components/drawer";
|
|
23
23
|
import TabProduct from "../../../components/TabProduct";
|
|
24
24
|
import { Context } from "../../model";
|
|
25
25
|
import AddButton from "../../../components/addButton";
|
|
26
|
-
import { Input } from "antd";
|
|
26
|
+
import { Input, Skeleton } from "antd";
|
|
27
27
|
import "./index.less";
|
|
28
28
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
29
29
|
import { getProductDetail } from "../serve";
|
|
30
30
|
import { getIsBundleOrCombination } from "../../utils";
|
|
31
|
-
import { formatProductListByCategory, getProductTotalPrice, request } from "../../../utils";
|
|
31
|
+
import { formatProductListByCategory, getProductTotalPrice, request, getCacheParams, deleteCacheParams } from "../../../utils";
|
|
32
32
|
import { locales, getUniqueId } from "@pisell/utils";
|
|
33
|
+
var shopList = [2886, 4422, 5538];
|
|
34
|
+
var getCacheResourceId = function getCacheResourceId() {
|
|
35
|
+
var serviceParams = getCacheParams();
|
|
36
|
+
var resId = Number(serviceParams === null || serviceParams === void 0 ? void 0 : serviceParams.resource_id);
|
|
37
|
+
console.log("resIdresIdresId", resId);
|
|
38
|
+
return resId;
|
|
39
|
+
};
|
|
33
40
|
var Info = function Info() {
|
|
34
|
-
var _state$service2;
|
|
41
|
+
var _state$service2, _state$service3, _state$service3$cache;
|
|
35
42
|
var _useState = useState(""),
|
|
36
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
44
|
search = _useState2[0],
|
|
@@ -43,8 +50,18 @@ var Info = function Info() {
|
|
|
43
50
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
51
|
loading = _useState4[0],
|
|
45
52
|
setLoading = _useState4[1];
|
|
53
|
+
var searchRef = useRef();
|
|
46
54
|
var context = useEngineContext();
|
|
47
55
|
request.setRequest(context.appHelper.utils.request);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @title: 如果商品只有一个, 则自动设置默认商品
|
|
59
|
+
* @description:
|
|
60
|
+
* @param {any} list
|
|
61
|
+
* @return {*}
|
|
62
|
+
* @Author: zhiwei.Wang
|
|
63
|
+
* @Date: 2024-05-14 13:55
|
|
64
|
+
*/
|
|
48
65
|
var setDefaultService = /*#__PURE__*/function () {
|
|
49
66
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {
|
|
50
67
|
var _list, product, detail, isBundleOrCombination, _item;
|
|
@@ -129,24 +146,48 @@ var Info = function Info() {
|
|
|
129
146
|
return _ref.apply(this, arguments);
|
|
130
147
|
};
|
|
131
148
|
}();
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @title: 如果选择了资源, 则直接添加商品
|
|
152
|
+
* @description:
|
|
153
|
+
* @param {any} cacheItem
|
|
154
|
+
* @return {*}
|
|
155
|
+
* @Author: zhiwei.Wang
|
|
156
|
+
* @Date: 2024-05-14 14:02
|
|
157
|
+
*/
|
|
158
|
+
var autoAddProduct = /*#__PURE__*/function () {
|
|
159
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(cacheItem) {
|
|
160
|
+
var resId, _cacheItem;
|
|
161
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
162
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
163
|
+
case 0:
|
|
164
|
+
resId = getCacheResourceId();
|
|
165
|
+
_cacheItem = _objectSpread({}, cacheItem);
|
|
166
|
+
deleteCacheParams();
|
|
167
|
+
case 3:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context2.stop();
|
|
170
|
+
}
|
|
171
|
+
}, _callee2);
|
|
172
|
+
}));
|
|
173
|
+
return function autoAddProduct(_x3) {
|
|
174
|
+
return _ref2.apply(this, arguments);
|
|
175
|
+
};
|
|
176
|
+
}();
|
|
132
177
|
var getServices = /*#__PURE__*/function () {
|
|
133
|
-
var
|
|
178
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
134
179
|
var _state$eventOtherPara;
|
|
135
180
|
var data;
|
|
136
|
-
return _regeneratorRuntime().wrap(function
|
|
137
|
-
while (1) switch (
|
|
181
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
182
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
138
183
|
case 0:
|
|
139
184
|
setLoading(true);
|
|
140
|
-
|
|
185
|
+
_context3.next = 3;
|
|
141
186
|
return state.apis.getServices({
|
|
142
187
|
skip: 1,
|
|
143
188
|
num: 500,
|
|
144
189
|
extension_type: state.renderType === "eventBooking" ? undefined : ["product_appointment", "appointment_ticket"],
|
|
145
190
|
with: ["category"],
|
|
146
|
-
// include_formula: "no",
|
|
147
|
-
// include_bundle: "no",
|
|
148
|
-
// include_option: "no",
|
|
149
|
-
// include_variant: "no",
|
|
150
191
|
ids: state.renderType === "eventBooking" ? (_state$eventOtherPara = state.eventOtherParams) === null || _state$eventOtherPara === void 0 ? void 0 : _state$eventOtherPara.productIds : undefined,
|
|
151
192
|
open_quotation: 1,
|
|
152
193
|
with_schedule: 1,
|
|
@@ -156,7 +197,7 @@ var Info = function Info() {
|
|
|
156
197
|
}
|
|
157
198
|
});
|
|
158
199
|
case 3:
|
|
159
|
-
data =
|
|
200
|
+
data = _context3.sent;
|
|
160
201
|
setLoading(false);
|
|
161
202
|
setDefaultService(data === null || data === void 0 ? void 0 : data.list);
|
|
162
203
|
dispatch({
|
|
@@ -167,12 +208,12 @@ var Info = function Info() {
|
|
|
167
208
|
});
|
|
168
209
|
case 7:
|
|
169
210
|
case "end":
|
|
170
|
-
return
|
|
211
|
+
return _context3.stop();
|
|
171
212
|
}
|
|
172
|
-
},
|
|
213
|
+
}, _callee3);
|
|
173
214
|
}));
|
|
174
215
|
return function getServices() {
|
|
175
|
-
return
|
|
216
|
+
return _ref3.apply(this, arguments);
|
|
176
217
|
};
|
|
177
218
|
}();
|
|
178
219
|
var handleSelectService = function handleSelectService() {
|
|
@@ -184,6 +225,12 @@ var Info = function Info() {
|
|
|
184
225
|
addModal: true
|
|
185
226
|
}
|
|
186
227
|
});
|
|
228
|
+
if (!state.isTerminal) {
|
|
229
|
+
setTimeout(function () {
|
|
230
|
+
var _searchRef$current, _searchRef$current$fo;
|
|
231
|
+
(_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : (_searchRef$current$fo = _searchRef$current.focus) === null || _searchRef$current$fo === void 0 ? void 0 : _searchRef$current$fo.call(_searchRef$current);
|
|
232
|
+
}, 100);
|
|
233
|
+
}
|
|
187
234
|
};
|
|
188
235
|
var handleSelectProduct = function handleSelectProduct(item, type) {
|
|
189
236
|
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
@@ -227,11 +274,20 @@ var Info = function Info() {
|
|
|
227
274
|
cacheItem.new = 0;
|
|
228
275
|
}
|
|
229
276
|
console.log("_total", cacheItem);
|
|
277
|
+
|
|
278
|
+
// 如果已经有资源id,则不跳转详情页, 直接返回
|
|
279
|
+
// if (getCacheResourceId()) {
|
|
280
|
+
// autoAddProduct(cacheItem);
|
|
281
|
+
// return;
|
|
282
|
+
// }
|
|
283
|
+
var resId = getCacheResourceId();
|
|
284
|
+
cacheItem.autoClose = !!resId;
|
|
230
285
|
dispatch({
|
|
231
286
|
type: "setService",
|
|
232
287
|
payload: {
|
|
233
288
|
editModal: true,
|
|
234
|
-
cacheItem: cacheItem
|
|
289
|
+
cacheItem: cacheItem,
|
|
290
|
+
addModal: !cacheItem.autoClose
|
|
235
291
|
}
|
|
236
292
|
});
|
|
237
293
|
}
|
|
@@ -251,10 +307,17 @@ var Info = function Info() {
|
|
|
251
307
|
return state.service.value.length > 0;
|
|
252
308
|
}, [state.service.value]);
|
|
253
309
|
useEffect(function () {
|
|
254
|
-
|
|
255
|
-
|
|
310
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5;
|
|
311
|
+
// Salonip 不要这个
|
|
312
|
+
|
|
313
|
+
if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id)) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
// 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
|
|
317
|
+
if (state.modalOpen && !state.bookingId) {
|
|
318
|
+
handleSelectService();
|
|
256
319
|
}
|
|
257
|
-
}, [state.modalOpen]);
|
|
320
|
+
}, [state.modalOpen, state.bookingId]);
|
|
258
321
|
var showAddButton = useMemo(function () {
|
|
259
322
|
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
260
323
|
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
@@ -283,7 +346,11 @@ var Info = function Info() {
|
|
|
283
346
|
}
|
|
284
347
|
});
|
|
285
348
|
}, [state.renderType, showAddButton, isService, state.service.value, loading]);
|
|
286
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
349
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : (_state$service3$cache = _state$service3.cacheItem) === null || _state$service3$cache === void 0 ? void 0 : _state$service3$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
|
|
350
|
+
loading: true,
|
|
351
|
+
active: true,
|
|
352
|
+
round: true
|
|
353
|
+
}), addButton, /*#__PURE__*/React.createElement(Drawer, {
|
|
287
354
|
open: state.service.addModal,
|
|
288
355
|
title: locales.getText("pisell2.text.select-service"),
|
|
289
356
|
rootClassName: "booking-server-wrap",
|
|
@@ -298,6 +365,7 @@ var Info = function Info() {
|
|
|
298
365
|
header: /*#__PURE__*/React.createElement("div", {
|
|
299
366
|
className: "pisell-lowcode__booking-service-header"
|
|
300
367
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
368
|
+
ref: searchRef,
|
|
301
369
|
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
302
370
|
style: {
|
|
303
371
|
marginTop: 16,
|
|
@@ -35,7 +35,7 @@ import { sliceDayIntoFiveMinutes, formatResource, getErrorList, getServiceTimes,
|
|
|
35
35
|
import Like from "../like";
|
|
36
36
|
import { getNoResource } from "../../../mock";
|
|
37
37
|
var Info = function Info() {
|
|
38
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$
|
|
38
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$service$cacheI5, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI6, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9;
|
|
39
39
|
var _Form$useForm = Form.useForm(),
|
|
40
40
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
41
41
|
form = _Form$useForm2[0];
|
|
@@ -252,7 +252,7 @@ var Info = function Info() {
|
|
|
252
252
|
} else {
|
|
253
253
|
// 如果只有一个资源,并且当前未选择, 则默认选中
|
|
254
254
|
_useResource = 0;
|
|
255
|
-
if (_list.length === 2) {
|
|
255
|
+
if (_list.length === 2 && useResource !== 0) {
|
|
256
256
|
_useResource = _list[1].form_record_id;
|
|
257
257
|
}
|
|
258
258
|
form.setFieldsValue({
|
|
@@ -265,18 +265,25 @@ var Info = function Info() {
|
|
|
265
265
|
resources: _list
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
|
-
|
|
268
|
+
setTimeout(function () {
|
|
269
|
+
var _state$service$cacheI;
|
|
270
|
+
// 当选中资源 或者 列表只有无资源的时候 那么直接返回
|
|
271
|
+
if ((_state$service$cacheI = state.service.cacheItem) !== null && _state$service$cacheI !== void 0 && _state$service$cacheI.autoClose || _list.length === 1 && useResource === 0) {
|
|
272
|
+
form.submit();
|
|
273
|
+
}
|
|
274
|
+
}, 200);
|
|
275
|
+
_context.next = 18;
|
|
269
276
|
break;
|
|
270
|
-
case
|
|
271
|
-
_context.prev =
|
|
277
|
+
case 16:
|
|
278
|
+
_context.prev = 16;
|
|
272
279
|
_context.t0 = _context["catch"](0);
|
|
273
|
-
case 17:
|
|
274
|
-
setResourceLoading(false);
|
|
275
280
|
case 18:
|
|
281
|
+
setResourceLoading(false);
|
|
282
|
+
case 19:
|
|
276
283
|
case "end":
|
|
277
284
|
return _context.stop();
|
|
278
285
|
}
|
|
279
|
-
}, _callee, null, [[0,
|
|
286
|
+
}, _callee, null, [[0, 16]]);
|
|
280
287
|
}));
|
|
281
288
|
return function getResources(_x2) {
|
|
282
289
|
return _ref.apply(this, arguments);
|
|
@@ -291,12 +298,12 @@ var Info = function Info() {
|
|
|
291
298
|
* @Date: 2024-01-09 13:59
|
|
292
299
|
*/
|
|
293
300
|
var handleDeleteProduct = function handleDeleteProduct() {
|
|
294
|
-
var _state$service$
|
|
301
|
+
var _state$service$cacheI2;
|
|
295
302
|
if (state.channelDisabledEdit) {
|
|
296
303
|
return;
|
|
297
304
|
}
|
|
298
305
|
var _list = _toConsumableArray(state.service.value);
|
|
299
|
-
var _id = (_state$service$
|
|
306
|
+
var _id = (_state$service$cacheI2 = state.service.cacheItem) === null || _state$service$cacheI2 === void 0 ? void 0 : _state$service$cacheI2._id;
|
|
300
307
|
_list = _list.filter(function (d) {
|
|
301
308
|
return d._id !== _id;
|
|
302
309
|
});
|
|
@@ -377,8 +384,8 @@ var Info = function Info() {
|
|
|
377
384
|
* @Date: 2024-01-09 14:03
|
|
378
385
|
*/
|
|
379
386
|
var getDiscount = function getDiscount() {
|
|
380
|
-
var _state$service$
|
|
381
|
-
var oPrice = Number(((_state$service$
|
|
387
|
+
var _state$service$cacheI3;
|
|
388
|
+
var oPrice = Number(((_state$service$cacheI3 = state.service.cacheItem) === null || _state$service$cacheI3 === void 0 ? void 0 : _state$service$cacheI3._extend.origin_total) || 0);
|
|
382
389
|
var cPrice = Number(useTotal || 0);
|
|
383
390
|
var discount = "";
|
|
384
391
|
// 原价 = 现价 为无折扣
|
|
@@ -410,6 +417,7 @@ var Info = function Info() {
|
|
|
410
417
|
var _currentResource$_ext2;
|
|
411
418
|
var _list = _toConsumableArray(state.service.value);
|
|
412
419
|
var _item = _objectSpread(_objectSpread({}, state.service.cacheItem), {}, {
|
|
420
|
+
autoClose: false,
|
|
413
421
|
errorList: errorList
|
|
414
422
|
});
|
|
415
423
|
var _extend = _objectSpread(_objectSpread({}, _item._extend), values);
|
|
@@ -460,7 +468,8 @@ var Info = function Info() {
|
|
|
460
468
|
var setEditData = useMemoizedFn(function () {
|
|
461
469
|
if (state.service.editModal) {
|
|
462
470
|
var cacheItem = state.service.cacheItem;
|
|
463
|
-
|
|
471
|
+
var values = getServerItemExtend(state, cacheItem, timeObj);
|
|
472
|
+
form.setFieldsValue(values);
|
|
464
473
|
if (state.renderType !== "eventBooking") {
|
|
465
474
|
// 获取资源列表
|
|
466
475
|
getResources();
|
|
@@ -479,8 +488,8 @@ var Info = function Info() {
|
|
|
479
488
|
* @Date: 2024-01-09 14:06
|
|
480
489
|
*/
|
|
481
490
|
var isReason = useMemo(function () {
|
|
482
|
-
var _state$service$
|
|
483
|
-
var oPrice = Number(((_state$service$
|
|
491
|
+
var _state$service$cacheI4;
|
|
492
|
+
var oPrice = Number(((_state$service$cacheI4 = state.service.cacheItem) === null || _state$service$cacheI4 === void 0 ? void 0 : _state$service$cacheI4._extend.origin_total) || 0);
|
|
484
493
|
var cPrice = Number(useTotal || 0);
|
|
485
494
|
// 原价 !== 现价
|
|
486
495
|
return cPrice !== oPrice;
|
|
@@ -565,7 +574,8 @@ var Info = function Info() {
|
|
|
565
574
|
}, [(_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : (_state$service5$cache = _state$service5.cacheItem) === null || _state$service5$cache === void 0 ? void 0 : (_state$service5$cache2 = _state$service5$cache._extend) === null || _state$service5$cache2 === void 0 ? void 0 : (_state$service5$cache3 = _state$service5$cache2.other) === null || _state$service5$cache3 === void 0 ? void 0 : _state$service5$cache3.bundle]);
|
|
566
575
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
|
|
567
576
|
zIndex: 1000,
|
|
568
|
-
|
|
577
|
+
forceRender: true,
|
|
578
|
+
open: state.service.editModal && !((_state$service$cacheI5 = state.service.cacheItem) !== null && _state$service$cacheI5 !== void 0 && _state$service$cacheI5.autoClose),
|
|
569
579
|
title: locales.getText("pisell2.text.edit-service"),
|
|
570
580
|
onClose: function onClose() {
|
|
571
581
|
dispatch({
|
|
@@ -632,8 +642,8 @@ var Info = function Info() {
|
|
|
632
642
|
width: "100%"
|
|
633
643
|
},
|
|
634
644
|
min: 0,
|
|
635
|
-
max: ((_state$service$
|
|
636
|
-
placeholder: ((_state$service$
|
|
645
|
+
max: ((_state$service$cacheI6 = state.service.cacheItem) === null || _state$service$cacheI6 === void 0 ? void 0 : (_state$service$cacheI7 = _state$service$cacheI6._extend) === null || _state$service$cacheI7 === void 0 ? void 0 : _state$service$cacheI7.origin_total) || 0,
|
|
646
|
+
placeholder: ((_state$service$cacheI8 = state.service.cacheItem) === null || _state$service$cacheI8 === void 0 ? void 0 : (_state$service$cacheI9 = _state$service$cacheI8._extend) === null || _state$service$cacheI9 === void 0 ? void 0 : _state$service$cacheI9.origin_total) || "0"
|
|
637
647
|
}))), /*#__PURE__*/React.createElement(Col, {
|
|
638
648
|
span: 12
|
|
639
649
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"en": {
|
|
3
3
|
'pisell2.text.select-addons': "Select addons",
|
|
4
|
-
'pisell2.text.addons': "
|
|
4
|
+
'pisell2.text.addons': "Sales",
|
|
5
5
|
'pisell2.text.search': 'Search',
|
|
6
6
|
'pisell2.text.view': 'View',
|
|
7
7
|
'pisell2.text.edit': 'Edit',
|
|
@@ -155,7 +155,8 @@ export default {
|
|
|
155
155
|
'pisell2.text.deposit-delete': "Delete deposit",
|
|
156
156
|
'pisell2.text.deposit-delete-message-title': "Prompt",
|
|
157
157
|
'pisell2.text.deposit-delete-message': "It cannot be restored after deletion. Please confirm the operation.",
|
|
158
|
-
'pisell2.text.deposit-paid': "Deposit paid"
|
|
158
|
+
'pisell2.text.deposit-paid': "Deposit paid",
|
|
159
|
+
"pisell2.text.stock": "Stock"
|
|
159
160
|
},
|
|
160
161
|
'zh-CN': {
|
|
161
162
|
'pisell2.text.refunded-amount': '已退金额',
|
|
@@ -163,7 +164,7 @@ export default {
|
|
|
163
164
|
'pisell2.text.amount-paid-on-order': '订单已付金额',
|
|
164
165
|
'pisell2.text.please-select-the-customer-first': '请先选择客户',
|
|
165
166
|
'pisell2.text.change': "更改",
|
|
166
|
-
'pisell2.text.addons': "
|
|
167
|
+
'pisell2.text.addons': "销售",
|
|
167
168
|
'pisell2.text.select-addons': "选择附加商品",
|
|
168
169
|
'pisell2.text.search': '搜索',
|
|
169
170
|
'pisell2.text.view': '查看',
|
|
@@ -318,7 +319,8 @@ export default {
|
|
|
318
319
|
'pisell2.text.deposit-delete': "删除定金",
|
|
319
320
|
'pisell2.text.deposit-delete-message-title': "提示",
|
|
320
321
|
'pisell2.text.deposit-delete-message': "删除后不可恢复,请确认操作",
|
|
321
|
-
'pisell2.text.deposit-paid': "已付定金"
|
|
322
|
+
'pisell2.text.deposit-paid': "已付定金",
|
|
323
|
+
"pisell2.text.stock": "库存"
|
|
322
324
|
},
|
|
323
325
|
'zh-HK': {
|
|
324
326
|
'pisell2.text.refunded-amount': '已退金額',
|
|
@@ -326,7 +328,7 @@ export default {
|
|
|
326
328
|
'pisell2.text.amount-paid-on-order': '訂單已付金額',
|
|
327
329
|
'pisell2.text.please-select-the-customer-first': '請先選擇客戶',
|
|
328
330
|
'pisell2.text.change': '更改',
|
|
329
|
-
'pisell2.text.addons': "
|
|
331
|
+
'pisell2.text.addons': "销售",
|
|
330
332
|
'pisell2.text.select-addons': "選擇附加商品",
|
|
331
333
|
'pisell2.text.search': '搜索',
|
|
332
334
|
'pisell2.text.view': '查看',
|
|
@@ -481,6 +483,7 @@ export default {
|
|
|
481
483
|
'pisell2.text.deposit-delete': "刪除定金",
|
|
482
484
|
'pisell2.text.deposit-delete-message-title': "提示",
|
|
483
485
|
'pisell2.text.deposit-delete-message': "刪除後不可恢復,請確認操作",
|
|
484
|
-
'pisell2.text.deposit-paid': "已付定金"
|
|
486
|
+
'pisell2.text.deposit-paid': "已付定金",
|
|
487
|
+
"pisell2.text.stock": "庫存"
|
|
485
488
|
}
|
|
486
489
|
};
|
|
@@ -70,11 +70,13 @@ export interface FormState {
|
|
|
70
70
|
bookingId: string | number;
|
|
71
71
|
bookingDetail: any;
|
|
72
72
|
channelDisabledEdit: boolean;
|
|
73
|
-
renderType?:
|
|
73
|
+
renderType?: "eventBooking";
|
|
74
|
+
modalOpen?: boolean;
|
|
75
|
+
isTerminal?: boolean;
|
|
74
76
|
eventOtherParams?: {
|
|
75
77
|
relation_id: number;
|
|
76
78
|
number: number;
|
|
77
|
-
registration_type:
|
|
79
|
+
registration_type: "single" | "all" | "extra_include";
|
|
78
80
|
start_date: string;
|
|
79
81
|
start_time: string;
|
|
80
82
|
end_date: string;
|
|
@@ -25,7 +25,7 @@ import EmptyBooking from "../components/emptyBooking";
|
|
|
25
25
|
import "./index.less";
|
|
26
26
|
import { locales } from "@pisell/utils";
|
|
27
27
|
var Notes = Provider(function (props) {
|
|
28
|
-
var _modal$
|
|
28
|
+
var _modal$state5, _modal$state5$notes, _modal$state6, _modal$state$bookingD3, _modal$state$bookingD4;
|
|
29
29
|
var globalState = props.globalState;
|
|
30
30
|
var modal = useContext(Context);
|
|
31
31
|
var _useState = useState(false),
|
|
@@ -82,12 +82,14 @@ var Notes = Provider(function (props) {
|
|
|
82
82
|
});
|
|
83
83
|
}, [globalState]);
|
|
84
84
|
var noteChange = function noteChange(_ref2) {
|
|
85
|
+
var _modal$state, _modal$state$refreshD;
|
|
85
86
|
var note = _ref2.note,
|
|
86
87
|
status = _ref2.status,
|
|
87
88
|
noteType = _ref2.noteType;
|
|
89
|
+
(_modal$state = modal.state) === null || _modal$state === void 0 ? void 0 : (_modal$state$refreshD = _modal$state.refreshData) === null || _modal$state$refreshD === void 0 ? void 0 : _modal$state$refreshD.call(_modal$state, {});
|
|
88
90
|
if (noteType === "internal") {
|
|
89
|
-
var _modal$
|
|
90
|
-
var _list = _toConsumableArray((_modal$
|
|
91
|
+
var _modal$state2;
|
|
92
|
+
var _list = _toConsumableArray((_modal$state2 = modal.state) === null || _modal$state2 === void 0 ? void 0 : _modal$state2.notes.internalNotes);
|
|
91
93
|
if (status == "add") {
|
|
92
94
|
_list.push(note);
|
|
93
95
|
}
|
|
@@ -131,15 +133,15 @@ var Notes = Provider(function (props) {
|
|
|
131
133
|
}];
|
|
132
134
|
}, [modal.state.bookingDetail]);
|
|
133
135
|
var orderNote = useMemo(function () {
|
|
134
|
-
var _modal$
|
|
135
|
-
if (!((_modal$
|
|
136
|
+
var _modal$state3, _modal$state3$notes, _modal$state4, _modal$state4$notes;
|
|
137
|
+
if (!((_modal$state3 = modal.state) !== null && _modal$state3 !== void 0 && (_modal$state3$notes = _modal$state3.notes) !== null && _modal$state3$notes !== void 0 && _modal$state3$notes.orderNote)) {
|
|
136
138
|
return [];
|
|
137
139
|
}
|
|
138
140
|
return [{
|
|
139
141
|
id: 0,
|
|
140
|
-
content: ((_modal$
|
|
142
|
+
content: ((_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : (_modal$state4$notes = _modal$state4.notes) === null || _modal$state4$notes === void 0 ? void 0 : _modal$state4$notes.orderNote) || ""
|
|
141
143
|
}];
|
|
142
|
-
}, [(_modal$
|
|
144
|
+
}, [(_modal$state5 = modal.state) === null || _modal$state5 === void 0 ? void 0 : (_modal$state5$notes = _modal$state5.notes) === null || _modal$state5$notes === void 0 ? void 0 : _modal$state5$notes.orderNote]);
|
|
143
145
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState && /*#__PURE__*/React.createElement(TabPane, {
|
|
144
146
|
header: locales.getText("pisell2.text.notes")
|
|
145
147
|
}, !globalState.bookingId ? /*#__PURE__*/React.createElement(EmptyBooking, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NoteBlock, {
|
|
@@ -172,7 +174,7 @@ var Notes = Provider(function (props) {
|
|
|
172
174
|
title: "".concat(locales.getText("pisell2.text.status.internal-notes"), ":"),
|
|
173
175
|
describe: locales.getText("pisell2.text.status.visible-only-to-your-team-members"),
|
|
174
176
|
placeholder: locales.getText("pisell2.text.add-internal-notes"),
|
|
175
|
-
notes: ((_modal$
|
|
177
|
+
notes: ((_modal$state6 = modal.state) === null || _modal$state6 === void 0 ? void 0 : _modal$state6.notes.internalNotes) || [],
|
|
176
178
|
isEdit: true,
|
|
177
179
|
apis: modal.state.apis,
|
|
178
180
|
bookingId: (_modal$state$bookingD3 = modal.state.bookingDetail) === null || _modal$state$bookingD3 === void 0 ? void 0 : (_modal$state$bookingD4 = _modal$state$bookingD3.bookings) === null || _modal$state$bookingD4 === void 0 ? void 0 : _modal$state$bookingD4.id,
|
|
@@ -564,9 +564,9 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
564
564
|
findNextSliceProps.date = dayjs(str).format('HH:mm');
|
|
565
565
|
}
|
|
566
566
|
// 选中资源
|
|
567
|
-
var resourceId = serviceParams.resource_id;
|
|
568
|
-
if (resourceId) {
|
|
569
|
-
_extend.resource =
|
|
567
|
+
var resourceId = Number(serviceParams.resource_id);
|
|
568
|
+
if (resourceId || resourceId === 0) {
|
|
569
|
+
_extend.resource = resourceId;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
console.log("_extend", findNextSliceProps);
|
|
@@ -125,6 +125,7 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
125
125
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
126
126
|
const [listLoading, setListLoading] = (0, import_react.useState)(false);
|
|
127
127
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
128
|
+
const searchRef = (0, import_react.useRef)();
|
|
128
129
|
const context = (0, import_useEngineContext.default)();
|
|
129
130
|
const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
130
131
|
(0, import_react.useEffect)(() => {
|
|
@@ -319,6 +320,12 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
319
320
|
showModal: true
|
|
320
321
|
}
|
|
321
322
|
});
|
|
323
|
+
if (!state.isTerminal) {
|
|
324
|
+
setTimeout(() => {
|
|
325
|
+
var _a3, _b3;
|
|
326
|
+
(_b3 = (_a3 = searchRef.current) == null ? void 0 : _a3.focus) == null ? void 0 : _b3.call(_a3);
|
|
327
|
+
}, 100);
|
|
328
|
+
}
|
|
322
329
|
};
|
|
323
330
|
const _footer = (0, import_react.useMemo)(() => {
|
|
324
331
|
if (state.disabledEdit) {
|
|
@@ -439,6 +446,7 @@ var Addons = (0, import_model.Provider)((props) => {
|
|
|
439
446
|
header: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
440
447
|
import_antd.Input,
|
|
441
448
|
{
|
|
449
|
+
ref: searchRef,
|
|
442
450
|
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
443
451
|
style: { marginTop: 16, height: 44 },
|
|
444
452
|
placeholder: import_utils3.locales.getText("pisell2.text.search"),
|
|
@@ -44,6 +44,12 @@ var ProductItem = ({
|
|
|
44
44
|
style,
|
|
45
45
|
className
|
|
46
46
|
}) => {
|
|
47
|
+
const stockText = (0, import_react.useMemo)(() => {
|
|
48
|
+
if (item.is_track === 0) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return `${item.stock_quantity} ${import_utils.locales.getText("pisell2.text.stock")}`;
|
|
52
|
+
}, [item.stock_quantity, item.is_track]);
|
|
47
53
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
48
54
|
"div",
|
|
49
55
|
{
|
|
@@ -66,7 +72,7 @@ var ProductItem = ({
|
|
|
66
72
|
className: "server-product-title"
|
|
67
73
|
},
|
|
68
74
|
item.title
|
|
69
|
-
), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" }, (0, import_utils.formatAmount)(item.price, 2, amountSymbol)))
|
|
75
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, (0, import_utils2.getDiscountTime)(item.service_times)), stockText && /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-time" }, stockText), /* @__PURE__ */ import_react.default.createElement("div", { className: "server-product-price" }, (0, import_utils.formatAmount)(item.price, 2, amountSymbol)))
|
|
70
76
|
);
|
|
71
77
|
};
|
|
72
78
|
var productItem_default = ProductItem;
|
|
@@ -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);
|