@pisell/private-materials 6.11.185 → 6.11.187
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/index.js +20 -2
- package/es/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +1 -0
- package/es/plus/pisellReservation/floorRoomCard/mapRowToFloorRoomCardData.d.ts +1 -1
- package/es/plus/pisellReservation/floorRoomCard/mapRowToFloorRoomCardData.js +41 -30
- package/es/plus/pisellReservation/floorRoomCard/views/RoomCardIcons.d.ts +1 -0
- package/es/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +1 -0
- package/es/plus/pisellSalesManagement/config/booking.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/index.js +18 -2
- package/lib/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +1 -0
- package/lib/plus/pisellReservation/floorRoomCard/mapRowToFloorRoomCardData.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/mapRowToFloorRoomCardData.js +27 -25
- package/lib/plus/pisellReservation/floorRoomCard/views/RoomCardIcons.d.ts +1 -0
- package/lib/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +1 -0
- package/lib/plus/pisellSalesManagement/config/booking.d.ts +1 -0
- package/package.json +1 -1
|
@@ -26,9 +26,11 @@ import "./index.less";
|
|
|
26
26
|
import CompensatedPisellContainer from "../../../pro/compensatedPisellContainer";
|
|
27
27
|
import { withResponsive } from "../../../responsive";
|
|
28
28
|
var AddClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
29
|
-
var _context$appHelper;
|
|
29
|
+
var _context$appHelper, _context$appHelper2;
|
|
30
30
|
var context = useEngineContext();
|
|
31
|
-
|
|
31
|
+
var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
32
|
+
sendWarningLog = _ref.sendWarningLog;
|
|
33
|
+
request.setRequest((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.request);
|
|
32
34
|
var onChange = props.onChange,
|
|
33
35
|
phone = props.phone,
|
|
34
36
|
containerProps = props.containerProps,
|
|
@@ -55,6 +57,22 @@ var AddClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
55
57
|
});
|
|
56
58
|
var _addClient = useRequest(addCustomer, {
|
|
57
59
|
manual: true,
|
|
60
|
+
onBefore: function onBefore(params) {
|
|
61
|
+
try {
|
|
62
|
+
sendWarningLog === null || sendWarningLog === void 0 || sendWarningLog({
|
|
63
|
+
title: 'Add Client',
|
|
64
|
+
content: [{
|
|
65
|
+
key: 'time',
|
|
66
|
+
value: Date.now()
|
|
67
|
+
}, {
|
|
68
|
+
key: 'data',
|
|
69
|
+
value: JSON.stringify(params)
|
|
70
|
+
}]
|
|
71
|
+
});
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error(error);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
58
76
|
onSuccess: function onSuccess(res, param) {
|
|
59
77
|
var _param$;
|
|
60
78
|
onChange(_objectSpread(_objectSpread({}, (_param$ = param[0]) === null || _param$ === void 0 ? void 0 : _param$.customer), {}, {
|
|
@@ -22,7 +22,7 @@ export declare function resolveFloorRoomCardContactTiers(b: Record<string, unkno
|
|
|
22
22
|
/**
|
|
23
23
|
* 平面图 / 详情弹窗 / 列表联系人:与 Pisell Reservation 统一规则。
|
|
24
24
|
* - **holder** / **contacts_info** 与 `customer_id` 无关;仅 **customer** 档案层在 id 为 0、1 时不采用。
|
|
25
|
-
* - 顺序:**holder**(`booking.holder` → `holder_data`)→ **contact**(`order.contacts_info`)→ **customer
|
|
25
|
+
* - 顺序:**holder**(`booking.holder` → `holder_data`)→ **contact**(`order.contacts_info`)→ **customer**(姓名:`customer_name` → `customer.display_name` → `nickname` → `first_name`+`last_name`;电话:`order.phone` → `customer.phone` → `customer.mobile`;二者独立短路后再合并)。
|
|
26
26
|
*/
|
|
27
27
|
export declare function resolveFloorRoomCardHolder(b: Record<string, unknown>): FloorRoomCardHolder | undefined;
|
|
28
28
|
/** 单条 floorMapSourceBookings → 与平面图 RoomCard 一致的 booking 模型 */
|
|
@@ -186,37 +186,48 @@ function holderFromBookingHolderField(b) {
|
|
|
186
186
|
return null;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
/**
|
|
190
|
-
|
|
189
|
+
/**
|
|
190
|
+
* customer 层姓名:自上而下短路。
|
|
191
|
+
* `customer_name` → `customer.display_name` → `nickname` → `first_name` + `last_name`
|
|
192
|
+
*/
|
|
193
|
+
function resolveCustomerTierName(ord) {
|
|
191
194
|
var cn = typeof ord.customer_name === 'string' ? ord.customer_name.trim() : '';
|
|
192
|
-
|
|
193
|
-
if (cn || topPhone) {
|
|
194
|
-
return _objectSpread({
|
|
195
|
-
name: cn
|
|
196
|
-
}, topPhone ? {
|
|
197
|
-
phone: topPhone
|
|
198
|
-
} : {});
|
|
199
|
-
}
|
|
195
|
+
if (cn) return cn;
|
|
200
196
|
var cust = ord.customer;
|
|
201
|
-
if (cust
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
197
|
+
if (!cust || _typeof(cust) !== 'object') return '';
|
|
198
|
+
var displayName = typeof cust.display_name === 'string' ? cust.display_name.trim() : '';
|
|
199
|
+
if (displayName) return displayName;
|
|
200
|
+
var nick = typeof cust.nickname === 'string' ? cust.nickname.trim() : '';
|
|
201
|
+
if (nick) return nick;
|
|
202
|
+
var fn = typeof cust.first_name === 'string' ? cust.first_name.trim() : '';
|
|
203
|
+
var ln = typeof cust.last_name === 'string' ? cust.last_name.trim() : '';
|
|
204
|
+
return [fn, ln].filter(Boolean).join(' ').trim();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* customer 层电话:自上而下短路。
|
|
209
|
+
* `order.phone` → `customer.phone` → `customer.mobile`
|
|
210
|
+
*/
|
|
211
|
+
function resolveCustomerTierPhone(ord) {
|
|
212
|
+
var _cust$phone;
|
|
213
|
+
var top = typeof ord.phone === 'string' && /\d/.test(ord.phone) ? ord.phone : undefined;
|
|
214
|
+
if (top) return top;
|
|
215
|
+
var cust = ord.customer;
|
|
216
|
+
if (!cust || _typeof(cust) !== 'object') return undefined;
|
|
217
|
+
var raw = (_cust$phone = cust.phone) !== null && _cust$phone !== void 0 ? _cust$phone : cust.mobile;
|
|
218
|
+
return typeof raw === 'string' && /\d/.test(raw) ? raw : undefined;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** customer 层级:姓名与电话各自优先级解析后再合并;任一有值即返回 */
|
|
222
|
+
function customerTierContact(ord) {
|
|
223
|
+
var name = resolveCustomerTierName(ord);
|
|
224
|
+
var phone = resolveCustomerTierPhone(ord);
|
|
225
|
+
if (!name && !phone) return null;
|
|
226
|
+
return _objectSpread({
|
|
227
|
+
name: name
|
|
228
|
+
}, phone ? {
|
|
229
|
+
phone: phone
|
|
230
|
+
} : {});
|
|
220
231
|
}
|
|
221
232
|
|
|
222
233
|
/** `order.contacts_info`:first_name / last_name / phone.phone */
|
|
@@ -281,7 +292,7 @@ export function resolveFloorRoomCardContactTiers(b) {
|
|
|
281
292
|
/**
|
|
282
293
|
* 平面图 / 详情弹窗 / 列表联系人:与 Pisell Reservation 统一规则。
|
|
283
294
|
* - **holder** / **contacts_info** 与 `customer_id` 无关;仅 **customer** 档案层在 id 为 0、1 时不采用。
|
|
284
|
-
* - 顺序:**holder**(`booking.holder` → `holder_data`)→ **contact**(`order.contacts_info`)→ **customer
|
|
295
|
+
* - 顺序:**holder**(`booking.holder` → `holder_data`)→ **contact**(`order.contacts_info`)→ **customer**(姓名:`customer_name` → `customer.display_name` → `nickname` → `first_name`+`last_name`;电话:`order.phone` → `customer.phone` → `customer.mobile`;二者独立短路后再合并)。
|
|
285
296
|
*/
|
|
286
297
|
export function resolveFloorRoomCardHolder(b) {
|
|
287
298
|
var ord = b.order;
|
|
@@ -45,9 +45,12 @@ var import_index = require("./index.less");
|
|
|
45
45
|
var import_compensatedPisellContainer = __toESM(require("../../../pro/compensatedPisellContainer"));
|
|
46
46
|
var import_responsive = require("../../../responsive");
|
|
47
47
|
var AddClient = (0, import_react.forwardRef)((props, ref) => {
|
|
48
|
-
var _a, _b;
|
|
48
|
+
var _a, _b, _c;
|
|
49
49
|
const context = (0, import_useEngineContext.default)();
|
|
50
|
-
|
|
50
|
+
const {
|
|
51
|
+
sendWarningLog
|
|
52
|
+
} = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
53
|
+
import_utils2.request.setRequest((_c = (_b = context.appHelper) == null ? void 0 : _b.utils) == null ? void 0 : _c.request);
|
|
51
54
|
const { onChange, phone, containerProps, variant } = props;
|
|
52
55
|
const isPhoneVariant = variant === "phone";
|
|
53
56
|
const [form] = import_antd.Form.useForm();
|
|
@@ -62,6 +65,19 @@ var AddClient = (0, import_react.forwardRef)((props, ref) => {
|
|
|
62
65
|
}));
|
|
63
66
|
const _addClient = (0, import_ahooks.useRequest)(import_serve.addCustomer, {
|
|
64
67
|
manual: true,
|
|
68
|
+
onBefore: (params) => {
|
|
69
|
+
try {
|
|
70
|
+
sendWarningLog == null ? void 0 : sendWarningLog({
|
|
71
|
+
title: "Add Client",
|
|
72
|
+
content: [
|
|
73
|
+
{ key: "time", value: Date.now() },
|
|
74
|
+
{ key: "data", value: JSON.stringify(params) }
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error(error);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
65
81
|
onSuccess: (res, param) => {
|
|
66
82
|
var _a2;
|
|
67
83
|
onChange({ ...(_a2 = param[0]) == null ? void 0 : _a2.customer, id: res.customer_id }, useIsChecked);
|
|
@@ -22,7 +22,7 @@ export declare function resolveFloorRoomCardContactTiers(b: Record<string, unkno
|
|
|
22
22
|
/**
|
|
23
23
|
* 平面图 / 详情弹窗 / 列表联系人:与 Pisell Reservation 统一规则。
|
|
24
24
|
* - **holder** / **contacts_info** 与 `customer_id` 无关;仅 **customer** 档案层在 id 为 0、1 时不采用。
|
|
25
|
-
* - 顺序:**holder**(`booking.holder` → `holder_data`)→ **contact**(`order.contacts_info`)→ **customer
|
|
25
|
+
* - 顺序:**holder**(`booking.holder` → `holder_data`)→ **contact**(`order.contacts_info`)→ **customer**(姓名:`customer_name` → `customer.display_name` → `nickname` → `first_name`+`last_name`;电话:`order.phone` → `customer.phone` → `customer.mobile`;二者独立短路后再合并)。
|
|
26
26
|
*/
|
|
27
27
|
export declare function resolveFloorRoomCardHolder(b: Record<string, unknown>): FloorRoomCardHolder | undefined;
|
|
28
28
|
/** 单条 floorMapSourceBookings → 与平面图 RoomCard 一致的 booking 模型 */
|
|
@@ -174,33 +174,35 @@ function holderFromBookingHolderField(b) {
|
|
|
174
174
|
}
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function resolveCustomerTierName(ord) {
|
|
178
178
|
const cn = typeof ord.customer_name === "string" ? ord.customer_name.trim() : "";
|
|
179
|
-
|
|
180
|
-
if (cn || topPhone) {
|
|
181
|
-
return {
|
|
182
|
-
name: cn,
|
|
183
|
-
...topPhone ? { phone: topPhone } : {}
|
|
184
|
-
};
|
|
185
|
-
}
|
|
179
|
+
if (cn) return cn;
|
|
186
180
|
const cust = ord.customer;
|
|
187
|
-
if (cust
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
181
|
+
if (!cust || typeof cust !== "object") return "";
|
|
182
|
+
const displayName = typeof cust.display_name === "string" ? cust.display_name.trim() : "";
|
|
183
|
+
if (displayName) return displayName;
|
|
184
|
+
const nick = typeof cust.nickname === "string" ? cust.nickname.trim() : "";
|
|
185
|
+
if (nick) return nick;
|
|
186
|
+
const fn = typeof cust.first_name === "string" ? cust.first_name.trim() : "";
|
|
187
|
+
const ln = typeof cust.last_name === "string" ? cust.last_name.trim() : "";
|
|
188
|
+
return [fn, ln].filter(Boolean).join(" ").trim();
|
|
189
|
+
}
|
|
190
|
+
function resolveCustomerTierPhone(ord) {
|
|
191
|
+
const top = typeof ord.phone === "string" && /\d/.test(ord.phone) ? ord.phone : void 0;
|
|
192
|
+
if (top) return top;
|
|
193
|
+
const cust = ord.customer;
|
|
194
|
+
if (!cust || typeof cust !== "object") return void 0;
|
|
195
|
+
const raw = cust.phone ?? cust.mobile;
|
|
196
|
+
return typeof raw === "string" && /\d/.test(raw) ? raw : void 0;
|
|
197
|
+
}
|
|
198
|
+
function customerTierContact(ord) {
|
|
199
|
+
const name = resolveCustomerTierName(ord);
|
|
200
|
+
const phone = resolveCustomerTierPhone(ord);
|
|
201
|
+
if (!name && !phone) return null;
|
|
202
|
+
return {
|
|
203
|
+
name,
|
|
204
|
+
...phone ? { phone } : {}
|
|
205
|
+
};
|
|
204
206
|
}
|
|
205
207
|
function contactsInfoContact(order) {
|
|
206
208
|
const ci = order.contacts_info;
|