@pisell/private-materials 3.0.199 → 3.0.201
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/booking/addons/model.d.ts +1 -1
- package/es/components/booking/components/customSelect/index.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +6 -2
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +38 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/components/footer/amount.js +45 -22
- package/es/components/booking/components/footer/index.js +84 -40
- package/es/components/booking/components/footer/utils.js +243 -32
- package/es/components/booking/info/addServiceVariant/index.js +8 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
- package/es/components/booking/info/clientVariant/vertical/index.js +33 -4
- package/es/components/booking/info/dateRange/index.d.ts +5 -0
- package/es/components/booking/info/dateRange/index.js +98 -0
- package/es/components/booking/info/dateRange/index.less +21 -0
- package/es/components/booking/info/main.js +20 -8
- package/es/components/booking/info/model.js +3 -0
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/es/components/booking/info/pet/ChangePetModal/index.js +119 -0
- package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/es/components/booking/info/pet/index.js +54 -5
- package/es/components/booking/info/service/addService/index.js +142 -22
- package/es/components/booking/info/service/addService/index.less +13 -3
- package/es/components/booking/info/service/addService/utils.d.ts +11 -2
- package/es/components/booking/info/service/addService/utils.js +49 -24
- package/es/components/booking/info/service/editService/index.js +255 -44
- package/es/components/booking/info/service/editService/index.less +18 -13
- package/es/components/booking/info/service2/Lists.d.ts +3 -0
- package/es/components/booking/info/service2/Lists.js +158 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
- package/es/components/booking/info/service2/index.d.ts +3 -0
- package/es/components/booking/info/service2/index.js +58 -0
- package/es/components/booking/info/service2/status.d.ts +31 -0
- package/es/components/booking/info/service2/status.js +78 -0
- package/es/components/booking/info/service2/utils.d.ts +145 -0
- package/es/components/booking/info/service2/utils.js +438 -0
- package/es/components/booking/info/utils.d.ts +9 -0
- package/es/components/booking/info/utils.js +13 -0
- package/es/components/booking/locales.d.ts +60 -0
- package/es/components/booking/locales.js +75 -3
- package/es/components/booking/materiels/holder/index.d.ts +7 -0
- package/es/components/booking/materiels/holder/index.js +51 -0
- package/es/components/booking/model.d.ts +4 -1
- package/es/components/booking/model.js +4 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/utils.d.ts +12 -3
- package/es/components/booking/utils.js +139 -23
- package/es/components/eftpos/form/index.js +6 -12
- package/es/components/eftpos/group/index.d.ts +2 -1
- package/es/components/eftpos/group/index.js +2 -1
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftposPay/helper.d.ts +0 -1
- package/es/components/eftposPay/helper.js +0 -14
- package/es/components/eftposPay/tyro/index.js +20 -51
- package/es/components/shoppingCart/Provider.d.ts +3 -0
- package/es/components/shoppingCart/Provider.js +86 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/Product.js +96 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/index.js +72 -0
- package/es/components/shoppingCart/components/Cart/index.less +68 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Empty/index.js +14 -0
- package/es/components/shoppingCart/components/Empty/index.less +19 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Render/index.js +68 -0
- package/es/components/shoppingCart/components/Render/index.less +2 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useAddService.js +23 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +54 -0
- package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useContext.js +5 -0
- package/es/components/shoppingCart/index.d.ts +4 -0
- package/es/components/shoppingCart/index.js +24 -0
- package/es/components/shoppingCart/locales.d.ts +33 -0
- package/es/components/shoppingCart/locales.js +38 -0
- package/es/components/shoppingCart/mock.d.ts +40 -0
- package/es/components/shoppingCart/mock.js +40 -0
- package/es/components/shoppingCart/status.d.ts +2 -0
- package/es/components/shoppingCart/status.js +22 -0
- package/es/components/shoppingCart/type.d.ts +39 -0
- package/es/components/shoppingCart/type.js +1 -0
- package/es/components/shoppingCart/utils.d.ts +63 -0
- package/es/components/shoppingCart/utils.js +119 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/model.d.ts +1 -1
- package/lib/components/booking/components/customSelect/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +6 -2
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +60 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/components/footer/amount.js +26 -8
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.js +157 -31
- package/lib/components/booking/info/addServiceVariant/index.js +5 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
- package/lib/components/booking/info/clientVariant/vertical/index.js +36 -10
- package/lib/components/booking/info/dateRange/index.d.ts +5 -0
- package/lib/components/booking/info/dateRange/index.js +111 -0
- package/lib/components/booking/info/dateRange/index.less +21 -0
- package/lib/components/booking/info/main.js +11 -4
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.js +111 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/lib/components/booking/info/pet/index.js +61 -25
- package/lib/components/booking/info/service/addService/index.js +107 -34
- package/lib/components/booking/info/service/addService/index.less +13 -3
- package/lib/components/booking/info/service/addService/utils.d.ts +11 -2
- package/lib/components/booking/info/service/addService/utils.js +31 -10
- package/lib/components/booking/info/service/editService/index.js +293 -125
- package/lib/components/booking/info/service/editService/index.less +18 -13
- package/lib/components/booking/info/service2/Lists.d.ts +3 -0
- package/lib/components/booking/info/service2/Lists.js +113 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +50 -0
- package/lib/components/booking/info/service2/index.d.ts +3 -0
- package/lib/components/booking/info/service2/index.js +75 -0
- package/lib/components/booking/info/service2/status.d.ts +31 -0
- package/lib/components/booking/info/service2/status.js +81 -0
- package/lib/components/booking/info/service2/utils.d.ts +145 -0
- package/lib/components/booking/info/service2/utils.js +322 -0
- package/lib/components/booking/info/utils.d.ts +9 -0
- package/lib/components/booking/info/utils.js +6 -0
- package/lib/components/booking/locales.d.ts +60 -0
- package/lib/components/booking/locales.js +63 -3
- package/lib/components/booking/materiels/holder/index.d.ts +7 -0
- package/lib/components/booking/materiels/holder/index.js +65 -0
- package/lib/components/booking/model.d.ts +4 -1
- package/lib/components/booking/model.js +4 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +12 -3
- package/lib/components/booking/utils.js +87 -15
- package/lib/components/eftpos/form/index.js +6 -12
- package/lib/components/eftpos/group/index.d.ts +2 -1
- package/lib/components/eftpos/group/index.js +1 -0
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +0 -1
- package/lib/components/eftposPay/helper.js +0 -21
- package/lib/components/eftposPay/tyro/index.js +7 -36
- package/lib/components/shoppingCart/Provider.d.ts +3 -0
- package/lib/components/shoppingCart/Provider.js +110 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +89 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/index.js +77 -0
- package/lib/components/shoppingCart/components/Cart/index.less +68 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Empty/index.js +43 -0
- package/lib/components/shoppingCart/components/Empty/index.less +19 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Render/index.js +79 -0
- package/lib/components/shoppingCart/components/Render/index.less +2 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +116 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +71 -0
- package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useContext.js +31 -0
- package/lib/components/shoppingCart/index.d.ts +4 -0
- package/lib/components/shoppingCart/index.js +60 -0
- package/lib/components/shoppingCart/locales.d.ts +33 -0
- package/lib/components/shoppingCart/locales.js +56 -0
- package/lib/components/shoppingCart/mock.d.ts +40 -0
- package/lib/components/shoppingCart/mock.js +76 -0
- package/lib/components/shoppingCart/status.d.ts +2 -0
- package/lib/components/shoppingCart/status.js +60 -0
- package/lib/components/shoppingCart/type.d.ts +39 -0
- package/lib/components/shoppingCart/type.js +17 -0
- package/lib/components/shoppingCart/utils.d.ts +63 -0
- package/lib/components/shoppingCart/utils.js +92 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/shopping-cart/meta.ts +98 -0
- package/package.json +4 -4
- package/es/components/eftpos/receipt/index.d.ts +0 -24
- package/es/components/eftpos/receipt/index.js +0 -96
- package/lib/components/eftpos/receipt/index.d.ts +0 -24
- package/lib/components/eftpos/receipt/index.js +0 -88
|
@@ -4,9 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import dayjs from "dayjs";
|
|
7
8
|
import { flexibleObj, isNowTime, getNowTime } from "../../utils";
|
|
8
9
|
import { isWalkIn } from "../../utils";
|
|
9
10
|
import { getSumCapacity } from "../../info2/utilsByBooking";
|
|
11
|
+
import { getDays } from "../../utils";
|
|
12
|
+
import { appointmentTypes } from "../../info/service2/status";
|
|
13
|
+
import { isDayBooking, formatDayTime } from "../../info/service2/utils";
|
|
10
14
|
var formatNote = function formatNote(data) {
|
|
11
15
|
var _data$notes;
|
|
12
16
|
return ((_data$notes = data.notes) === null || _data$notes === void 0 ? void 0 : _data$notes.orderNote) || "";
|
|
@@ -76,7 +80,7 @@ var getSubType = function getSubType(item) {
|
|
|
76
80
|
var _item$duration;
|
|
77
81
|
var _type = (_item$duration = item.duration) === null || _item$duration === void 0 ? void 0 : _item$duration.type;
|
|
78
82
|
// 目前不支持跨天
|
|
79
|
-
if (_type
|
|
83
|
+
if (_type) {
|
|
80
84
|
return _type;
|
|
81
85
|
}
|
|
82
86
|
return 'minutes';
|
|
@@ -117,6 +121,160 @@ var formatResource = function formatResource(service) {
|
|
|
117
121
|
}
|
|
118
122
|
};
|
|
119
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @title: 格式化子预约的holder数据
|
|
126
|
+
* @description:
|
|
127
|
+
* @param {any} state
|
|
128
|
+
* @param {any} item
|
|
129
|
+
* @param {any} values
|
|
130
|
+
* @return {*}
|
|
131
|
+
* @Author: WangHan
|
|
132
|
+
* @Date: 2024-12-07 14:52
|
|
133
|
+
*/
|
|
134
|
+
var formatHolders = function formatHolders(state, item, values) {
|
|
135
|
+
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2, _state$bookingConfig$3, _item$_extend;
|
|
136
|
+
var form_id = (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.basic) === null || _state$bookingConfig$2 === void 0 ? void 0 : (_state$bookingConfig$3 = _state$bookingConfig$2.appointment_subject) === null || _state$bookingConfig$3 === void 0 ? void 0 : _state$bookingConfig$3.form_id) || 0;
|
|
137
|
+
var obj = {
|
|
138
|
+
customer_id: values.customer_id,
|
|
139
|
+
form_id: form_id,
|
|
140
|
+
form_record: [((_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.holder_id) || 0]
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// 连锁加盟子店铺 增加参数
|
|
144
|
+
if (state.isFranchisee) {
|
|
145
|
+
obj.is_source_shop = 1;
|
|
146
|
+
}
|
|
147
|
+
return obj;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @title: 格式化商品单价
|
|
152
|
+
* @description:
|
|
153
|
+
* @param {any} item
|
|
154
|
+
* @return {*}
|
|
155
|
+
* @Author: WangHan
|
|
156
|
+
* @Date: 2024-12-23 12:05
|
|
157
|
+
*/
|
|
158
|
+
var formatProductPrice = function formatProductPrice(item) {
|
|
159
|
+
var _item$_extend2, _item$_extend3;
|
|
160
|
+
var other = (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.other;
|
|
161
|
+
var price = Number((_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.price);
|
|
162
|
+
|
|
163
|
+
// 单规格, 单价 + 单规格价格
|
|
164
|
+
if (other !== null && other !== void 0 && other.option) {
|
|
165
|
+
var _other$option;
|
|
166
|
+
price = other === null || other === void 0 ? void 0 : (_other$option = other.option) === null || _other$option === void 0 ? void 0 : _other$option.reduce(function (pre, cur) {
|
|
167
|
+
return pre + Number(cur.price) * Number(cur.num);
|
|
168
|
+
}, price);
|
|
169
|
+
}
|
|
170
|
+
return price;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @title: 格式化商品数据
|
|
175
|
+
* @description:
|
|
176
|
+
* @param {any} item
|
|
177
|
+
* @return {*}
|
|
178
|
+
* @Author: WangHan
|
|
179
|
+
* @Date: 2024-12-07 14:21
|
|
180
|
+
*/
|
|
181
|
+
var formatProducts = function formatProducts(item) {
|
|
182
|
+
var _item$_extend4, _item$_extend4$other, _item$_extend5, _item$_extend5$other, _item$_extend6, _item$_extend6$other;
|
|
183
|
+
var total = Number(item._extend.total);
|
|
184
|
+
var origin_total = Number(item._extend.origin_total);
|
|
185
|
+
var discount_amount = origin_total - total;
|
|
186
|
+
|
|
187
|
+
// 加价时type使用change_price
|
|
188
|
+
var discount_type = discount_amount < 0 ? 'change_price' : 'discount';
|
|
189
|
+
return {
|
|
190
|
+
"num": item._extend.quantity,
|
|
191
|
+
"price": formatProductPrice(item),
|
|
192
|
+
"product_id": (item === null || item === void 0 ? void 0 : item.product_id) || item.id,
|
|
193
|
+
"discount_amount": discount_amount,
|
|
194
|
+
"product_discount_reason": item._extend.discount_reason || '',
|
|
195
|
+
"is_charge_tax": item.is_charge_tax,
|
|
196
|
+
"note": (item === null || item === void 0 ? void 0 : item.note) || '',
|
|
197
|
+
"discountway": item._extend.discountway || "num",
|
|
198
|
+
"discount_per": item._extend.discount_per,
|
|
199
|
+
"discount_type": item._extend.discount_type || discount_type,
|
|
200
|
+
"order_detail_id": item._extend.order_detail_id || 0,
|
|
201
|
+
"product_bundle": formatProductBundle((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : (_item$_extend4$other = _item$_extend4.other) === null || _item$_extend4$other === void 0 ? void 0 : _item$_extend4$other.bundle),
|
|
202
|
+
"bundle_edit": item._extend.bundle_edit,
|
|
203
|
+
"product_option_item": formatProductOption((_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : (_item$_extend5$other = _item$_extend5.other) === null || _item$_extend5$other === void 0 ? void 0 : _item$_extend5$other.option),
|
|
204
|
+
"product_variant_id": ((_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : (_item$_extend6$other = _item$_extend6.other) === null || _item$_extend6$other === void 0 ? void 0 : _item$_extend6$other.product_variant_id) || 0
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @title: 格式化跨日预约下的普通商品
|
|
210
|
+
* @description:
|
|
211
|
+
* @param {any} data
|
|
212
|
+
* @param {any} booking_item
|
|
213
|
+
* @return {*}
|
|
214
|
+
* @Author: WangHan
|
|
215
|
+
* @Date: 2024-12-07 14:48
|
|
216
|
+
*/
|
|
217
|
+
var formatDayRelationProducts = function formatDayRelationProducts(data, booking_item) {
|
|
218
|
+
var list = data.service.value;
|
|
219
|
+
|
|
220
|
+
// 过滤出卡片中的普通商品
|
|
221
|
+
var relation_products = list === null || list === void 0 ? void 0 : list.filter(function (item) {
|
|
222
|
+
var _item$_extend7;
|
|
223
|
+
var holderId = (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.holder_id;
|
|
224
|
+
var bookingHolderId = booking_item._extend.holder_id;
|
|
225
|
+
var isAppointment = appointmentTypes.includes(item.extension_type);
|
|
226
|
+
return holderId && holderId === bookingHolderId && !isAppointment;
|
|
227
|
+
});
|
|
228
|
+
relation_products = relation_products.map(function (item) {
|
|
229
|
+
return formatProducts(item);
|
|
230
|
+
});
|
|
231
|
+
return relation_products || [];
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @title: 格式化跨日预约商品列表
|
|
236
|
+
* @description:
|
|
237
|
+
* @param {any} data
|
|
238
|
+
* @return {*}
|
|
239
|
+
* @Author: WangHan
|
|
240
|
+
* @Date: 2024-12-17 11:06
|
|
241
|
+
*/
|
|
242
|
+
var formatAppointmentProductLists = function formatAppointmentProductLists(data) {
|
|
243
|
+
try {
|
|
244
|
+
var _Array$from;
|
|
245
|
+
var list = data.service.value;
|
|
246
|
+
|
|
247
|
+
// 找出预约商品
|
|
248
|
+
list = list.filter(function (item) {
|
|
249
|
+
var _item$_extend8;
|
|
250
|
+
return ((_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.holder_id) && appointmentTypes.includes(item.extension_type);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// 对预约商品列表根据holder_id进行分组
|
|
254
|
+
var groupMap = new Map();
|
|
255
|
+
list.forEach(function (item) {
|
|
256
|
+
var _item$_extend9;
|
|
257
|
+
var key = (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.holder_id; // 分组键
|
|
258
|
+
if (!groupMap.has(key)) {
|
|
259
|
+
groupMap.set(key, []);
|
|
260
|
+
}
|
|
261
|
+
groupMap.get(key).push(item);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// 处理每个分组
|
|
265
|
+
groupMap.forEach(function (group) {
|
|
266
|
+
// 只给第一个数据增加 relation_products
|
|
267
|
+
group[0].relation_products = formatDayRelationProducts(data, group[0]);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// 将分组的结果还原为数组
|
|
271
|
+
var result = (_Array$from = Array.from(groupMap.values())) === null || _Array$from === void 0 ? void 0 : _Array$from.reduce(function (acc, group) {
|
|
272
|
+
return acc.concat(group);
|
|
273
|
+
}, []);
|
|
274
|
+
return result || [];
|
|
275
|
+
} catch (error) {}
|
|
276
|
+
};
|
|
277
|
+
|
|
120
278
|
/**
|
|
121
279
|
* @title: 预约商品信息
|
|
122
280
|
* @description:
|
|
@@ -125,42 +283,60 @@ var formatResource = function formatResource(service) {
|
|
|
125
283
|
* @Author: zhiwei.Wang
|
|
126
284
|
* @Date: 2024-02-19 09:26
|
|
127
285
|
*/
|
|
128
|
-
var formatBookings = function formatBookings(data) {
|
|
286
|
+
var formatBookings = function formatBookings(data, values) {
|
|
287
|
+
// 是否是跨日预约
|
|
288
|
+
var isDay = isDayBooking(data);
|
|
129
289
|
var list = data.service.value;
|
|
290
|
+
|
|
291
|
+
// 格式化跨日预约商品列表
|
|
292
|
+
if (isDay) {
|
|
293
|
+
list = formatAppointmentProductLists(data);
|
|
294
|
+
}
|
|
295
|
+
var dayParams = {
|
|
296
|
+
relation_products: []
|
|
297
|
+
};
|
|
130
298
|
var eventOtherParams = data.eventOtherParams;
|
|
131
299
|
var bookings = [];
|
|
300
|
+
console.log(list, 'wh_result11');
|
|
132
301
|
bookings = list.map(function (item) {
|
|
133
|
-
var _item$_extend, _item$_extend$other;
|
|
134
302
|
var start_date = item._extend.startDate.format('YYYY-MM-DD');
|
|
135
303
|
var end_date = item._extend.endDate.format('YYYY-MM-DD');
|
|
136
304
|
var end_time = item._extend.endDate.format("HH:mm");
|
|
137
305
|
var start_time = item._extend.startDate.format("HH:mm");
|
|
306
|
+
|
|
138
307
|
// 更新当前时间
|
|
139
308
|
if (isNowTime(item._extend.start_time)) {
|
|
140
309
|
start_time = getNowTime();
|
|
141
310
|
}
|
|
142
|
-
var total = Number(item._extend.total);
|
|
143
|
-
var origin_total = Number(item._extend.origin_total);
|
|
144
|
-
var discount_amount = origin_total - total;
|
|
145
311
|
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
312
|
+
// 跨日预约下的普通商品
|
|
313
|
+
if (isDay) {
|
|
314
|
+
var _item$_extend10, _item$_extend11, _item$_extend12, _item$_extend13;
|
|
315
|
+
var startDate = ((_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.startDate) || ((_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.start_date);
|
|
316
|
+
var endDate = ((_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.endDate) || ((_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.end_date);
|
|
317
|
+
var _formatDayTime = formatDayTime({
|
|
318
|
+
startDate: startDate,
|
|
319
|
+
endDate: endDate
|
|
320
|
+
}),
|
|
321
|
+
startDateTime = _formatDayTime.startDateTime,
|
|
322
|
+
endDateTime = _formatDayTime.endDateTime;
|
|
323
|
+
|
|
324
|
+
// 根据营业日时间更新时间
|
|
325
|
+
start_date = dayjs(startDateTime).format('YYYY-MM-DD');
|
|
326
|
+
start_time = dayjs(startDateTime).format('HH:mm');
|
|
327
|
+
end_date = dayjs(endDateTime).format('YYYY-MM-DD');
|
|
328
|
+
end_time = dayjs(endDateTime).format('HH:mm');
|
|
329
|
+
dayParams.relation_products = (item === null || item === void 0 ? void 0 : item.relation_products) || [];
|
|
330
|
+
dayParams.holder = formatHolders(data, item, values);
|
|
331
|
+
dayParams.duration = getDays({
|
|
332
|
+
_extend: {
|
|
333
|
+
start_date: startDateTime,
|
|
334
|
+
end_date: endDateTime
|
|
335
|
+
}
|
|
336
|
+
}, 'minutes');
|
|
337
|
+
}
|
|
338
|
+
return _objectSpread(_objectSpread({
|
|
339
|
+
"product": formatProducts(item),
|
|
164
340
|
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
165
341
|
'id': item.booking_id || 0,
|
|
166
342
|
"relation_id": item._extend.relation_id || 0,
|
|
@@ -169,12 +345,12 @@ var formatBookings = function formatBookings(data) {
|
|
|
169
345
|
"is_all": false,
|
|
170
346
|
"schedule_id": item._extend.schedule_id || 0,
|
|
171
347
|
"end_time": end_time,
|
|
172
|
-
"sub_type": getSubType(item),
|
|
348
|
+
"sub_type": isDay ? 'days' : getSubType(item),
|
|
173
349
|
"select_date": start_date,
|
|
174
350
|
"start_time": start_time,
|
|
175
351
|
"end_date": end_date,
|
|
176
352
|
"start_date": start_date,
|
|
177
|
-
"duration": flexibleObj.getValue(item._extend.duration),
|
|
353
|
+
"duration": isDay ? 0 : flexibleObj.getValue(item._extend.duration),
|
|
178
354
|
"number": item._extend.capacity ? getSumCapacity({
|
|
179
355
|
cacheItem: item
|
|
180
356
|
}) : item._extend.number || 1,
|
|
@@ -182,11 +358,34 @@ var formatBookings = function formatBookings(data) {
|
|
|
182
358
|
"metadata": item._extend.capacity ? {
|
|
183
359
|
capacity: item._extend.capacity
|
|
184
360
|
} : undefined
|
|
185
|
-
}, eventOtherParams || {});
|
|
361
|
+
}, eventOtherParams || {}), dayParams);
|
|
186
362
|
});
|
|
187
363
|
return bookings;
|
|
188
364
|
};
|
|
189
365
|
|
|
366
|
+
/**
|
|
367
|
+
* @title: 普通商品
|
|
368
|
+
* @description:
|
|
369
|
+
* @param {any} data
|
|
370
|
+
* @return {*}
|
|
371
|
+
* @Author: WangHan
|
|
372
|
+
* @Date: 2024-12-06 21:26
|
|
373
|
+
*/
|
|
374
|
+
var formatRelationProducts = function formatRelationProducts(data) {
|
|
375
|
+
var _data$service;
|
|
376
|
+
var list = ((_data$service = data.service) === null || _data$service === void 0 ? void 0 : _data$service.value) || [];
|
|
377
|
+
// open items 下的商品
|
|
378
|
+
list = list.filter(function (item) {
|
|
379
|
+
var _item$_extend14;
|
|
380
|
+
return !((_item$_extend14 = item._extend) !== null && _item$_extend14 !== void 0 && _item$_extend14.holder_id);
|
|
381
|
+
});
|
|
382
|
+
var relationProducts = [];
|
|
383
|
+
relationProducts = list.map(function (item) {
|
|
384
|
+
return formatProducts(item);
|
|
385
|
+
});
|
|
386
|
+
return relationProducts;
|
|
387
|
+
};
|
|
388
|
+
|
|
190
389
|
/**
|
|
191
390
|
* @title: 预约主体信息
|
|
192
391
|
* @description:
|
|
@@ -197,8 +396,8 @@ var formatBookings = function formatBookings(data) {
|
|
|
197
396
|
* @Date: 2024-02-19 09:26
|
|
198
397
|
*/
|
|
199
398
|
var formatHolder = function formatHolder(state, values) {
|
|
200
|
-
var _state$
|
|
201
|
-
var form_id = (state === null || state === void 0 ? void 0 : (_state$
|
|
399
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$bookingConfig5, _state$pet$value, _state$pet, _state$pet$originValu, _state$pet$originValu2;
|
|
400
|
+
var form_id = (state === null || state === void 0 ? void 0 : (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : (_state$bookingConfig3 = _state$bookingConfig2.config) === null || _state$bookingConfig3 === void 0 ? void 0 : (_state$bookingConfig4 = _state$bookingConfig3.basic) === null || _state$bookingConfig4 === void 0 ? void 0 : (_state$bookingConfig5 = _state$bookingConfig4.appointment_subject) === null || _state$bookingConfig5 === void 0 ? void 0 : _state$bookingConfig5.form_id) || 0;
|
|
202
401
|
var petValue = ((_state$pet$value = state.pet.value) === null || _state$pet$value === void 0 ? void 0 : _state$pet$value[form_id]) || [];
|
|
203
402
|
var obj = {
|
|
204
403
|
customer_id: values.customer_id,
|
|
@@ -230,9 +429,12 @@ export var formatValues = function formatValues(state) {
|
|
|
230
429
|
bookings: [],
|
|
231
430
|
customer_id: 1,
|
|
232
431
|
customer_name: "",
|
|
233
|
-
holder: {}
|
|
432
|
+
holder: {},
|
|
433
|
+
relation_products: [],
|
|
434
|
+
metadata: {}
|
|
234
435
|
};
|
|
235
|
-
|
|
436
|
+
var isDay = isDayBooking(state);
|
|
437
|
+
if (!state.bookingId || isDay) {
|
|
236
438
|
// 备注
|
|
237
439
|
values.shop_note = formatNote(state);
|
|
238
440
|
}
|
|
@@ -251,9 +453,13 @@ export var formatValues = function formatValues(state) {
|
|
|
251
453
|
|
|
252
454
|
// 主体
|
|
253
455
|
values.holder = formatHolder(state, values);
|
|
456
|
+
if (isDay) {
|
|
457
|
+
// 父预约商品
|
|
458
|
+
values.relation_products = formatRelationProducts(state);
|
|
459
|
+
}
|
|
254
460
|
|
|
255
461
|
// 服务
|
|
256
|
-
values.bookings = formatBookings(state);
|
|
462
|
+
values.bookings = formatBookings(state, values);
|
|
257
463
|
|
|
258
464
|
// 日期
|
|
259
465
|
if ((_values = values) !== null && _values !== void 0 && (_values$bookings = _values.bookings) !== null && _values$bookings !== void 0 && (_values$bookings$ = _values$bookings[0]) !== null && _values$bookings$ !== void 0 && _values$bookings$.select_date && !(state !== null && state !== void 0 && state.bookingId)) {
|
|
@@ -263,5 +469,10 @@ export var formatValues = function formatValues(state) {
|
|
|
263
469
|
startTime = "".concat(startTime || '00:00', ":00");
|
|
264
470
|
values.schedule_date = "".concat(values.bookings[0].select_date, " ").concat(startTime);
|
|
265
471
|
}
|
|
472
|
+
|
|
473
|
+
// 跨日预约增加多余参数区分
|
|
474
|
+
if (isDay) {
|
|
475
|
+
values.metadata.is_multiday_appointment = 1;
|
|
476
|
+
}
|
|
266
477
|
return values;
|
|
267
478
|
};
|
|
@@ -24,13 +24,20 @@ var AddServiceVariant = function AddServiceVariant(props) {
|
|
|
24
24
|
service: _objectSpread(_objectSpread({}, stateRef.current.service), payload)
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
// 更新日期
|
|
29
|
+
if (type === 'setDate') {
|
|
30
|
+
setGlobalState({
|
|
31
|
+
date: _objectSpread(_objectSpread({}, stateRef.current.date), payload)
|
|
32
|
+
});
|
|
33
|
+
}
|
|
27
34
|
};
|
|
28
35
|
var Cpt = AddService;
|
|
29
36
|
if (isBooking4Shop((_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, props === null || props === void 0 ? void 0 : (_props$globalState = props.globalState) === null || _props$globalState === void 0 ? void 0 : _props$globalState.renderType)) {
|
|
30
37
|
Cpt = AddService2;
|
|
31
38
|
}
|
|
32
39
|
return /*#__PURE__*/React.createElement(Cpt, {
|
|
33
|
-
renderMode:
|
|
40
|
+
renderMode: 'current',
|
|
34
41
|
dispatch: dispatch,
|
|
35
42
|
state: globalState,
|
|
36
43
|
drawerProps: {
|
|
@@ -19,6 +19,7 @@ interface SelectDrawerProps {
|
|
|
19
19
|
modalOpen: boolean;
|
|
20
20
|
franchiseeLoading?: number;
|
|
21
21
|
showHeader?: boolean;
|
|
22
|
+
showWalkIn?: boolean;
|
|
22
23
|
}
|
|
23
24
|
declare const _default: React.ForwardRefExoticComponent<SelectDrawerProps & React.RefAttributes<unknown>>;
|
|
24
25
|
export default _default;
|
|
@@ -99,7 +99,8 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
99
99
|
handleAddPet = props.handleAddPet,
|
|
100
100
|
modalOpen = props.modalOpen,
|
|
101
101
|
franchiseeLoading = props.franchiseeLoading,
|
|
102
|
-
showHeader = props.showHeader
|
|
102
|
+
showHeader = props.showHeader,
|
|
103
|
+
showWalkIn = props.showWalkIn;
|
|
103
104
|
var form = (formData === null || formData === void 0 ? void 0 : formData[0]) || {};
|
|
104
105
|
var valList = (childrenValue === null || childrenValue === void 0 ? void 0 : childrenValue[form.id]) || defaultArr;
|
|
105
106
|
var _useState = useState(valList),
|
|
@@ -107,13 +108,6 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
107
108
|
_value = _useState2[0],
|
|
108
109
|
setValue = _useState2[1];
|
|
109
110
|
var clientRef = useRef();
|
|
110
|
-
useEffect(function () {
|
|
111
|
-
setValue(valList.map(function (item) {
|
|
112
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
113
|
-
id: item.id || item.form_record_id
|
|
114
|
-
});
|
|
115
|
-
}));
|
|
116
|
-
}, [valList]);
|
|
117
111
|
var searchRef = useRef();
|
|
118
112
|
|
|
119
113
|
// 是否打开弹窗
|
|
@@ -125,6 +119,13 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
125
119
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
126
120
|
search = _useState6[0],
|
|
127
121
|
_setSearch = _useState6[1];
|
|
122
|
+
useEffect(function () {
|
|
123
|
+
setValue(valList.map(function (item) {
|
|
124
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
125
|
+
id: item.id || item.form_record_id
|
|
126
|
+
});
|
|
127
|
+
}));
|
|
128
|
+
}, [valList, open]);
|
|
128
129
|
useEffect(function () {
|
|
129
130
|
if (!modalOpen) {
|
|
130
131
|
setOpen(false);
|
|
@@ -168,12 +169,12 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
168
169
|
if (getIsWalkIn(item === null || item === void 0 ? void 0 : item.id)) {
|
|
169
170
|
return locales.getText('pisell2.text.select-a-customer');
|
|
170
171
|
}
|
|
171
|
-
var firstLastName = item.first_name || item.last_name ? "".concat(item.first_name, " ").concat(item.last_name) :
|
|
172
|
+
var firstLastName = item.first_name || item.last_name ? "".concat(item.first_name, " ").concat(item.last_name) : '';
|
|
172
173
|
return item.name || (item.display_name || '').trim() || (item.nickname || '').trim() || firstLastName.trim() || '';
|
|
173
174
|
}, [locales.localeMap]);
|
|
174
175
|
var handleAddClient = function handleAddClient() {
|
|
175
176
|
handleCreateItem(function () {
|
|
176
|
-
_setSearch(
|
|
177
|
+
_setSearch('');
|
|
177
178
|
});
|
|
178
179
|
};
|
|
179
180
|
var handleChildrenValueChange = /*#__PURE__*/function () {
|
|
@@ -311,7 +312,7 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
311
312
|
}();
|
|
312
313
|
return /*#__PURE__*/React.createElement(Drawer, {
|
|
313
314
|
showGoBack: showHeader,
|
|
314
|
-
title: showHeader && locales.getText(
|
|
315
|
+
title: showHeader && locales.getText('pisell2.text.select-customer'),
|
|
315
316
|
open: open,
|
|
316
317
|
onClose: closeDrawer,
|
|
317
318
|
header: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -351,13 +352,13 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
351
352
|
}, /*#__PURE__*/React.createElement(ActionItem, {
|
|
352
353
|
title: locales.getText('pisell2.text.create-new-customer'),
|
|
353
354
|
onClick: handleAddClient
|
|
354
|
-
}), /*#__PURE__*/React.createElement(ActionItem, {
|
|
355
|
+
}), showWalkIn ? /*#__PURE__*/React.createElement(ActionItem, {
|
|
355
356
|
title: "Walk-In",
|
|
356
357
|
onClick: function onClick() {
|
|
357
358
|
handleSelectClient([]);
|
|
358
359
|
closeDrawer();
|
|
359
360
|
}
|
|
360
|
-
})), /*#__PURE__*/React.createElement(Spin, {
|
|
361
|
+
}) : null), /*#__PURE__*/React.createElement(Spin, {
|
|
361
362
|
spinning: !!loading,
|
|
362
363
|
delay: 500
|
|
363
364
|
}, !!options.length ? options.map(function (item) {
|
|
@@ -32,14 +32,17 @@ import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
|
32
32
|
import { formatAddFormValues } from "../../../forms/format";
|
|
33
33
|
import { moveItemToFront } from "../../utils";
|
|
34
34
|
import { request } from "../../../utils";
|
|
35
|
+
import { isDayBooking, isOpenDeletePet } from "../../service2/utils";
|
|
36
|
+
import ChangePetModal from "../../pet/ChangePetModal";
|
|
35
37
|
var VerticalClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
|
-
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig8, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$pet3, _state$pet4, _state$pet6, _state$pet6$formData, _state$pet6$formData$, _state$pet8, _state$client$value4, _state$bookingConfig17, _state$bookingConfig18, _state$bookingConfig19, _state$pet9, _state$pet9$formData, _state$bookingConfig20, _state$bookingConfig21, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2, _state$bookingConfig22, _state$client6;
|
|
38
|
+
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig8, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$pet3, _state$pet4, _state$pet6, _state$pet6$formData, _state$pet6$formData$, _state$pet8, _state$client$value4, _state$bookingConfig17, _state$bookingConfig18, _state$bookingConfig19, _state$pet9, _state$pet9$formData, _state$bookingConfig20, _state$bookingConfig21, _state$service2, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2, _state$bookingConfig22, _state$client6;
|
|
37
39
|
var globalState = props.globalState,
|
|
38
40
|
setGlobalState = props.setGlobalState;
|
|
39
41
|
var modalRef = useRef();
|
|
40
42
|
var state = globalState;
|
|
41
43
|
var stateRef = useRef(state);
|
|
42
44
|
var prevCustomerId = useRef(null);
|
|
45
|
+
var changePetRef = useRef(null);
|
|
43
46
|
var context = useEngineContext();
|
|
44
47
|
var _useState = useState(true),
|
|
45
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -93,6 +96,13 @@ var VerticalClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
93
96
|
pet: _objectSpread(_objectSpread({}, stateRef.current.pet), payload)
|
|
94
97
|
});
|
|
95
98
|
}
|
|
99
|
+
|
|
100
|
+
// 设置服务
|
|
101
|
+
if (type === 'setService') {
|
|
102
|
+
setGlobalState({
|
|
103
|
+
service: _objectSpread(_objectSpread({}, stateRef.current.service), payload)
|
|
104
|
+
});
|
|
105
|
+
}
|
|
96
106
|
};
|
|
97
107
|
var boardConfig = useMemo(function () {
|
|
98
108
|
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
|
|
@@ -110,6 +120,21 @@ var VerticalClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
110
120
|
}
|
|
111
121
|
}, [state === null || state === void 0 ? void 0 : (_state$bookingConfig8 = state.bookingConfig) === null || _state$bookingConfig8 === void 0 ? void 0 : (_state$bookingConfig9 = _state$bookingConfig8.config) === null || _state$bookingConfig9 === void 0 ? void 0 : (_state$bookingConfig10 = _state$bookingConfig9.basic) === null || _state$bookingConfig10 === void 0 ? void 0 : (_state$bookingConfig11 = _state$bookingConfig10.appointment_customer) === null || _state$bookingConfig11 === void 0 ? void 0 : _state$bookingConfig11.type, state === null || state === void 0 ? void 0 : state.modalOpen]);
|
|
112
122
|
var handleSelectPet = function handleSelectPet(val) {
|
|
123
|
+
// 跨日预约,更改表单的时候打开弹窗提示
|
|
124
|
+
if (isDayBooking(state)) {
|
|
125
|
+
var _isOpenDeletePet = isOpenDeletePet(state, val),
|
|
126
|
+
ids = _isOpenDeletePet.ids,
|
|
127
|
+
lists = _isOpenDeletePet.lists;
|
|
128
|
+
if ((ids === null || ids === void 0 ? void 0 : ids.length) > 0 && (lists === null || lists === void 0 ? void 0 : lists.length) > 0) {
|
|
129
|
+
var _changePetRef$current, _state$service;
|
|
130
|
+
(_changePetRef$current = changePetRef.current) === null || _changePetRef$current === void 0 ? void 0 : _changePetRef$current.open({
|
|
131
|
+
ids: ids,
|
|
132
|
+
setGlobalState: setGlobalState,
|
|
133
|
+
service: ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [],
|
|
134
|
+
state: state
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
113
138
|
setGlobalState({
|
|
114
139
|
pet: _objectSpread(_objectSpread({}, state.pet), {}, {
|
|
115
140
|
edit: true,
|
|
@@ -246,7 +271,8 @@ var VerticalClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
246
271
|
}, [isWalkIn, formId, (_state$client$value4 = state.client.value) === null || _state$client$value4 === void 0 ? void 0 : _state$client$value4.id, currentPetValue, boardConfig]);
|
|
247
272
|
var petRender = useMemo(function () {
|
|
248
273
|
var _state$bookingConfig14, _state$bookingConfig15, _state$bookingConfig16;
|
|
249
|
-
|
|
274
|
+
// 跨日预约需要显示pet
|
|
275
|
+
if ((state !== null && state !== void 0 && state.disabledEdit || boardConfig.type !== 'form') && !isDayBooking(state)) {
|
|
250
276
|
return null;
|
|
251
277
|
}
|
|
252
278
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !(currentPetValue !== null && currentPetValue !== void 0 && currentPetValue.length) && !isHasFormRecord && !isWalkIn && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Empty, {
|
|
@@ -291,7 +317,7 @@ var VerticalClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
291
317
|
},
|
|
292
318
|
previewItemTitleRender: previewItemTitleRender
|
|
293
319
|
}));
|
|
294
|
-
}, [isWalkIn, isHasFormRecord, state === null || state === void 0 ? void 0 : state.disabledEdit, boardConfig.type, state === null || state === void 0 ? void 0 : (_state$bookingConfig17 = state.bookingConfig) === null || _state$bookingConfig17 === void 0 ? void 0 : (_state$bookingConfig18 = _state$bookingConfig17.holder) === null || _state$bookingConfig18 === void 0 ? void 0 : (_state$bookingConfig19 = _state$bookingConfig18.form) === null || _state$bookingConfig19 === void 0 ? void 0 : _state$bookingConfig19.title, (_state$pet9 = state.pet) === null || _state$pet9 === void 0 ? void 0 : (_state$pet9$formData = _state$pet9.formData) === null || _state$pet9$formData === void 0 ? void 0 : _state$pet9$formData[0], state, petDispatch, handleOpenModal, handleOpenClientModal, previewItemTitleRender, handleAddPet, currentPetValue, formId, state === null || state === void 0 ? void 0 : (_state$bookingConfig20 = state.bookingConfig) === null || _state$bookingConfig20 === void 0 ? void 0 : (_state$bookingConfig21 = _state$bookingConfig20.holder) === null || _state$bookingConfig21 === void 0 ? void 0 : _state$bookingConfig21.data_range]);
|
|
320
|
+
}, [isWalkIn, isHasFormRecord, state === null || state === void 0 ? void 0 : state.disabledEdit, boardConfig.type, state === null || state === void 0 ? void 0 : (_state$bookingConfig17 = state.bookingConfig) === null || _state$bookingConfig17 === void 0 ? void 0 : (_state$bookingConfig18 = _state$bookingConfig17.holder) === null || _state$bookingConfig18 === void 0 ? void 0 : (_state$bookingConfig19 = _state$bookingConfig18.form) === null || _state$bookingConfig19 === void 0 ? void 0 : _state$bookingConfig19.title, (_state$pet9 = state.pet) === null || _state$pet9 === void 0 ? void 0 : (_state$pet9$formData = _state$pet9.formData) === null || _state$pet9$formData === void 0 ? void 0 : _state$pet9$formData[0], state, petDispatch, handleOpenModal, handleOpenClientModal, previewItemTitleRender, handleAddPet, currentPetValue, formId, state === null || state === void 0 ? void 0 : (_state$bookingConfig20 = state.bookingConfig) === null || _state$bookingConfig20 === void 0 ? void 0 : (_state$bookingConfig21 = _state$bookingConfig20.holder) === null || _state$bookingConfig21 === void 0 ? void 0 : _state$bookingConfig21.data_range, (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value]);
|
|
295
321
|
var handleOpenClient = function handleOpenClient() {
|
|
296
322
|
if (!isWalkIn || state !== null && state !== void 0 && state.disableEventBookingEdit) {
|
|
297
323
|
return;
|
|
@@ -386,7 +412,10 @@ var VerticalClient = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
386
412
|
loadMore: loadMore,
|
|
387
413
|
showPet: (boardConfig === null || boardConfig === void 0 ? void 0 : boardConfig.type) === 'form',
|
|
388
414
|
handleAddPet: handleAddPet,
|
|
389
|
-
franchiseeLoading: franchiseeLoading
|
|
415
|
+
franchiseeLoading: franchiseeLoading,
|
|
416
|
+
showWalkIn: !isDayBooking(state)
|
|
417
|
+
}), /*#__PURE__*/React.createElement(ChangePetModal, {
|
|
418
|
+
ref: changePetRef
|
|
390
419
|
}));
|
|
391
420
|
});
|
|
392
421
|
export default VerticalClient;
|