@pisell/private-materials 3.0.203 → 3.0.205
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 +27 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +33 -18
- package/es/components/booking/components/customSelect/index.d.ts +0 -1
- package/es/components/booking/components/customSelect/index.js +2 -6
- package/es/components/booking/components/footer/amount.js +22 -46
- package/es/components/booking/components/footer/index.js +40 -84
- package/es/components/booking/components/footer/utils.js +35 -266
- package/es/components/booking/forms/model.d.ts +1 -1
- package/es/components/booking/info/addServiceVariant/index.js +1 -8
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
- package/es/components/booking/info/clientVariant/vertical/index.js +9 -124
- package/es/components/booking/info/main.js +15 -28
- package/es/components/booking/info/model.js +0 -3
- package/es/components/booking/info/pet/index.js +5 -54
- package/es/components/booking/info/service/addService/index.js +96 -187
- package/es/components/booking/info/service/addService/index.less +3 -13
- package/es/components/booking/info/service/addService/utils.d.ts +2 -12
- package/es/components/booking/info/service/addService/utils.js +26 -103
- package/es/components/booking/info/service/editService/index.js +132 -435
- package/es/components/booking/info/service/editService/index.less +13 -18
- package/es/components/booking/info/service/serve.d.ts +0 -10
- package/es/components/booking/info/service/serve.js +0 -28
- package/es/components/booking/info/utils.d.ts +0 -20
- package/es/components/booking/info/utils.js +0 -37
- package/es/components/booking/locales.d.ts +0 -66
- package/es/components/booking/locales.js +3 -81
- package/es/components/booking/model.d.ts +1 -5
- package/es/components/booking/model.js +2 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -1
- package/es/components/booking/utils.d.ts +3 -12
- package/es/components/booking/utils.js +26 -143
- package/es/components/eftpos/form/index.js +12 -6
- package/es/components/eftpos/group/index.d.ts +1 -2
- package/es/components/eftpos/group/index.js +1 -2
- package/es/components/eftpos/hooks.d.ts +4 -4
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftpos/receipt/index.d.ts +24 -0
- package/es/components/eftpos/receipt/index.js +96 -0
- package/es/components/eftposPay/app.d.ts +11 -0
- package/es/components/eftposPay/app.js +173 -0
- package/es/components/eftposPay/component/fail/failCustom.js +1 -0
- package/es/components/eftposPay/component/fail/index.js +1 -0
- package/es/components/eftposPay/component/manual/index.js +4 -1
- package/es/components/eftposPay/component/step/index.d.ts +6 -6
- package/es/components/eftposPay/component/step/step.d.ts +4 -4
- package/es/components/eftposPay/const.d.ts +27 -1
- package/es/components/eftposPay/const.js +22 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/device.js +2 -2
- package/es/components/eftposPay/helper.d.ts +6 -0
- package/es/components/eftposPay/helper.js +24 -4
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +22 -16
- package/es/components/eftposPay/index.d.ts +1 -1
- package/es/components/eftposPay/index.js +130 -179
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +15 -0
- package/es/components/eftposPay/payo/config.js +20 -8
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +10 -0
- package/es/components/eftposPay/tip.js +177 -0
- package/es/components/eftposPay/tip.less +9 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/es/components/eftposPay/tyro/index.js +55 -22
- package/es/components/eftposPay/windcave/helper.d.ts +1 -1
- package/es/components/eftposPay/windcave/windcave.js +17 -6
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -1
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- package/lib/components/booking/components/customSelect/index.d.ts +0 -1
- package/lib/components/booking/components/customSelect/index.js +2 -6
- package/lib/components/booking/components/footer/amount.js +8 -27
- package/lib/components/booking/components/footer/index.js +4 -25
- package/lib/components/booking/components/footer/utils.js +35 -161
- package/lib/components/booking/forms/model.d.ts +1 -1
- package/lib/components/booking/info/addServiceVariant/index.js +0 -5
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
- package/lib/components/booking/info/clientVariant/vertical/index.js +11 -87
- package/lib/components/booking/info/main.js +9 -17
- package/lib/components/booking/info/model.js +0 -3
- package/lib/components/booking/info/pet/index.js +25 -61
- package/lib/components/booking/info/service/addService/index.js +84 -115
- package/lib/components/booking/info/service/addService/index.less +3 -13
- package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
- package/lib/components/booking/info/service/addService/utils.js +10 -58
- package/lib/components/booking/info/service/editService/index.js +182 -425
- package/lib/components/booking/info/service/editService/index.less +13 -18
- package/lib/components/booking/info/service/serve.d.ts +0 -10
- package/lib/components/booking/info/service/serve.js +2 -7
- package/lib/components/booking/info/utils.d.ts +0 -20
- package/lib/components/booking/info/utils.js +0 -41
- package/lib/components/booking/locales.d.ts +0 -66
- package/lib/components/booking/locales.js +3 -69
- package/lib/components/booking/model.d.ts +1 -5
- package/lib/components/booking/model.js +2 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +3 -12
- package/lib/components/booking/utils.js +18 -89
- package/lib/components/eftpos/form/index.js +12 -6
- package/lib/components/eftpos/group/index.d.ts +1 -2
- package/lib/components/eftpos/group/index.js +0 -1
- package/lib/components/eftpos/hooks.d.ts +4 -4
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftpos/receipt/index.d.ts +24 -0
- package/lib/components/eftpos/receipt/index.js +88 -0
- package/lib/components/eftposPay/app.d.ts +11 -0
- package/lib/components/eftposPay/app.js +166 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
- package/lib/components/eftposPay/component/fail/index.js +1 -1
- package/lib/components/eftposPay/component/manual/index.js +19 -5
- package/lib/components/eftposPay/component/step/index.d.ts +6 -6
- package/lib/components/eftposPay/component/step/step.d.ts +4 -4
- package/lib/components/eftposPay/const.d.ts +27 -1
- package/lib/components/eftposPay/const.js +18 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/device.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +6 -0
- package/lib/components/eftposPay/helper.js +29 -4
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +8 -2
- package/lib/components/eftposPay/index.d.ts +1 -1
- package/lib/components/eftposPay/index.js +106 -144
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +15 -0
- package/lib/components/eftposPay/payo/config.js +33 -9
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +10 -0
- package/lib/components/eftposPay/tip.js +159 -0
- package/lib/components/eftposPay/tip.less +9 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
- package/lib/components/eftposPay/tyro/index.js +40 -9
- package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
- package/lib/components/eftposPay/windcave/windcave.js +29 -6
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/package.json +5 -5
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/info/Provider.d.ts +0 -0
- package/es/components/booking/info/Provider.js +0 -54
- package/es/components/booking/info/dateRange/index.d.ts +0 -5
- package/es/components/booking/info/dateRange/index.js +0 -98
- package/es/components/booking/info/dateRange/index.less +0 -21
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/es/components/booking/info/pet/ChangePetModal/index.js +0 -134
- package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
- package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
- package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
- package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceManager/index.js +0 -277
- package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/es/components/booking/info/service/serviceManager/utils.js +0 -0
- package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/es/components/booking/info/service2/Group/utils.js +0 -146
- package/es/components/booking/info/service2/Lists.d.ts +0 -3
- package/es/components/booking/info/service2/Lists.js +0 -152
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
- package/es/components/booking/info/service2/index.d.ts +0 -6
- package/es/components/booking/info/service2/index.js +0 -57
- package/es/components/booking/info/service2/status.d.ts +0 -31
- package/es/components/booking/info/service2/status.js +0 -78
- package/es/components/booking/info/service2/utils.d.ts +0 -237
- package/es/components/booking/info/service2/utils.js +0 -1064
- package/es/components/booking/materiels/holder/index.d.ts +0 -7
- package/es/components/booking/materiels/holder/index.js +0 -51
- package/es/components/shoppingCart/Provider.d.ts +0 -3
- package/es/components/shoppingCart/Provider.js +0 -86
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +0 -68
- package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Cart/index.js +0 -72
- package/es/components/shoppingCart/components/Cart/index.less +0 -68
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Empty/index.js +0 -14
- package/es/components/shoppingCart/components/Empty/index.less +0 -19
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/es/components/shoppingCart/components/Render/index.js +0 -69
- package/es/components/shoppingCart/components/Render/index.less +0 -2
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -132
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useAddService.js +0 -23
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/es/components/shoppingCart/hooks/useClearCart.js +0 -59
- package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useContext.js +0 -5
- package/es/components/shoppingCart/index.d.ts +0 -4
- package/es/components/shoppingCart/index.js +0 -24
- package/es/components/shoppingCart/locales.d.ts +0 -33
- package/es/components/shoppingCart/locales.js +0 -38
- package/es/components/shoppingCart/mock.d.ts +0 -40
- package/es/components/shoppingCart/mock.js +0 -40
- package/es/components/shoppingCart/status.d.ts +0 -2
- package/es/components/shoppingCart/status.js +0 -22
- package/es/components/shoppingCart/type.d.ts +0 -39
- package/es/components/shoppingCart/type.js +0 -1
- package/es/components/shoppingCart/utils.d.ts +0 -63
- package/es/components/shoppingCart/utils.js +0 -116
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/info/Provider.d.ts +0 -0
- package/lib/components/booking/info/Provider.js +0 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -5
- package/lib/components/booking/info/dateRange/index.js +0 -111
- package/lib/components/booking/info/dateRange/index.less +0 -21
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
- package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -121
- package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
- package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
- package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
- package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
- package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
- package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceManager/index.js +0 -207
- package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
- package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
- package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
- package/lib/components/booking/info/service2/Group/utils.js +0 -142
- package/lib/components/booking/info/service2/Lists.d.ts +0 -3
- package/lib/components/booking/info/service2/Lists.js +0 -115
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
- package/lib/components/booking/info/service2/index.d.ts +0 -6
- package/lib/components/booking/info/service2/index.js +0 -75
- package/lib/components/booking/info/service2/status.d.ts +0 -31
- package/lib/components/booking/info/service2/status.js +0 -81
- package/lib/components/booking/info/service2/utils.d.ts +0 -237
- package/lib/components/booking/info/service2/utils.js +0 -678
- package/lib/components/booking/materiels/holder/index.d.ts +0 -7
- package/lib/components/booking/materiels/holder/index.js +0 -65
- package/lib/components/shoppingCart/Provider.d.ts +0 -3
- package/lib/components/shoppingCart/Provider.js +0 -110
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/Product.js +0 -73
- package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Cart/index.js +0 -77
- package/lib/components/shoppingCart/components/Cart/index.less +0 -68
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Empty/index.js +0 -43
- package/lib/components/shoppingCart/components/Empty/index.less +0 -19
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/Render/index.js +0 -75
- package/lib/components/shoppingCart/components/Render/index.less +0 -2
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
- package/lib/components/shoppingCart/hooks/useClearCart.js +0 -66
- package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useContext.js +0 -31
- package/lib/components/shoppingCart/index.d.ts +0 -4
- package/lib/components/shoppingCart/index.js +0 -60
- package/lib/components/shoppingCart/locales.d.ts +0 -33
- package/lib/components/shoppingCart/locales.js +0 -56
- package/lib/components/shoppingCart/mock.d.ts +0 -40
- package/lib/components/shoppingCart/mock.js +0 -76
- package/lib/components/shoppingCart/status.d.ts +0 -2
- package/lib/components/shoppingCart/status.js +0 -60
- package/lib/components/shoppingCart/type.d.ts +0 -39
- package/lib/components/shoppingCart/type.js +0 -17
- package/lib/components/shoppingCart/utils.d.ts +0 -63
- package/lib/components/shoppingCart/utils.js +0 -86
- package/lowcode/shopping-cart/meta.ts +0 -98
|
@@ -4,13 +4,9 @@ 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";
|
|
8
7
|
import { flexibleObj, isNowTime, getNowTime } from "../../utils";
|
|
9
8
|
import { isWalkIn } from "../../utils";
|
|
10
9
|
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";
|
|
14
10
|
var formatNote = function formatNote(data) {
|
|
15
11
|
var _data$notes;
|
|
16
12
|
return ((_data$notes = data.notes) === null || _data$notes === void 0 ? void 0 : _data$notes.orderNote) || "";
|
|
@@ -47,7 +43,6 @@ export var formatProductOption = function formatProductOption(option) {
|
|
|
47
43
|
"num": d.num,
|
|
48
44
|
"option_group_item_id": d.product_option_item_id,
|
|
49
45
|
"option_group_id": d.option_group_id
|
|
50
|
-
// "add_price": Number(d?.add_price),
|
|
51
46
|
};
|
|
52
47
|
});
|
|
53
48
|
};
|
|
@@ -73,8 +68,6 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
73
68
|
"num": d.num,
|
|
74
69
|
"extension_id": d.extension_id,
|
|
75
70
|
"extension_type": d.extension_type,
|
|
76
|
-
// "price": Number(d?.price),
|
|
77
|
-
// "price_type": d?.price_type,
|
|
78
71
|
"option": formatProductOption(d.option)
|
|
79
72
|
};
|
|
80
73
|
});
|
|
@@ -83,7 +76,7 @@ var getSubType = function getSubType(item) {
|
|
|
83
76
|
var _item$duration;
|
|
84
77
|
var _type = (_item$duration = item.duration) === null || _item$duration === void 0 ? void 0 : _item$duration.type;
|
|
85
78
|
// 目前不支持跨天
|
|
86
|
-
if (_type) {
|
|
79
|
+
if (_type && _type !== 'days') {
|
|
87
80
|
return _type;
|
|
88
81
|
}
|
|
89
82
|
return 'minutes';
|
|
@@ -124,179 +117,6 @@ var formatResource = function formatResource(service) {
|
|
|
124
117
|
}
|
|
125
118
|
};
|
|
126
119
|
|
|
127
|
-
/**
|
|
128
|
-
* @title: 格式化子预约的holder数据
|
|
129
|
-
* @description:
|
|
130
|
-
* @param {any} state
|
|
131
|
-
* @param {any} item
|
|
132
|
-
* @param {any} values
|
|
133
|
-
* @return {*}
|
|
134
|
-
* @Author: WangHan
|
|
135
|
-
* @Date: 2024-12-07 14:52
|
|
136
|
-
*/
|
|
137
|
-
var formatHolders = function formatHolders(state, item, values) {
|
|
138
|
-
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2, _state$bookingConfig$3, _item$_extend;
|
|
139
|
-
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;
|
|
140
|
-
var obj = {
|
|
141
|
-
customer_id: values.customer_id,
|
|
142
|
-
form_id: form_id,
|
|
143
|
-
form_record: [((_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.holder_id) || 0]
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// 连锁加盟子店铺 增加参数
|
|
147
|
-
if (state.isFranchisee) {
|
|
148
|
-
obj.is_source_shop = 1;
|
|
149
|
-
}
|
|
150
|
-
return obj;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @title: 格式化商品单价
|
|
155
|
-
* @description:
|
|
156
|
-
* @param {any} item
|
|
157
|
-
* @return {*}
|
|
158
|
-
* @Author: WangHan
|
|
159
|
-
* @Date: 2024-12-23 12:05
|
|
160
|
-
*/
|
|
161
|
-
var formatProductPrice = function formatProductPrice(item) {
|
|
162
|
-
var _item$_extend2, _item$_extend3;
|
|
163
|
-
var other = (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.other;
|
|
164
|
-
var price = Number((_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.price);
|
|
165
|
-
// 单规格, 单价 + 单规格价格
|
|
166
|
-
if (other !== null && other !== void 0 && other.option) {
|
|
167
|
-
var _other$option;
|
|
168
|
-
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) {
|
|
169
|
-
return pre + Number(cur.price) * Number(cur.num);
|
|
170
|
-
}, price);
|
|
171
|
-
}
|
|
172
|
-
return price;
|
|
173
|
-
};
|
|
174
|
-
var formatMetaData = function formatMetaData(item) {
|
|
175
|
-
var _item$_extend4, _item$_extend5, _item$_extend7;
|
|
176
|
-
var metadata = {};
|
|
177
|
-
if ((_item$_extend4 = item._extend) !== null && _item$_extend4 !== void 0 && _item$_extend4.capacity) {
|
|
178
|
-
metadata.capacity = item._extend.capacity;
|
|
179
|
-
}
|
|
180
|
-
if (item._extend.groupId) {
|
|
181
|
-
metadata.groupId = item._extend.groupId;
|
|
182
|
-
}
|
|
183
|
-
if ((_item$_extend5 = item._extend) !== null && _item$_extend5 !== void 0 && _item$_extend5.holder_id) {
|
|
184
|
-
var _item$_extend6;
|
|
185
|
-
metadata.holder_id = (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.holder_id;
|
|
186
|
-
}
|
|
187
|
-
if ((_item$_extend7 = item._extend) !== null && _item$_extend7 !== void 0 && _item$_extend7.multiDayPrices) {
|
|
188
|
-
var _item$_extend8;
|
|
189
|
-
metadata.multiDayPrices = (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.multiDayPrices;
|
|
190
|
-
}
|
|
191
|
-
return metadata;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* @title: 格式化商品数据
|
|
196
|
-
* @description:
|
|
197
|
-
* @param {any} item
|
|
198
|
-
* @return {*}
|
|
199
|
-
* @Author: WangHan
|
|
200
|
-
* @Date: 2024-12-07 14:21
|
|
201
|
-
*/
|
|
202
|
-
var formatProducts = function formatProducts(item) {
|
|
203
|
-
var _item$_extend9, _item$_extend9$other, _item$_extend10, _item$_extend10$other, _item$_extend11, _item$_extend11$other;
|
|
204
|
-
var total = Number(item._extend.total);
|
|
205
|
-
var origin_total = Number(item._extend.origin_total);
|
|
206
|
-
var discount_amount = origin_total - total;
|
|
207
|
-
|
|
208
|
-
// 加价时type使用change_price
|
|
209
|
-
var discount_type = discount_amount < 0 ? 'change_price' : 'discount';
|
|
210
|
-
return {
|
|
211
|
-
"num": item._extend.quantity,
|
|
212
|
-
"price": formatProductPrice(item),
|
|
213
|
-
"product_id": (item === null || item === void 0 ? void 0 : item.product_id) || item.id,
|
|
214
|
-
"discount_amount": discount_amount,
|
|
215
|
-
"product_discount_reason": item._extend.discount_reason || '',
|
|
216
|
-
"is_charge_tax": item.is_charge_tax,
|
|
217
|
-
"note": (item === null || item === void 0 ? void 0 : item.note) || '',
|
|
218
|
-
"discountway": item._extend.discountway || "num",
|
|
219
|
-
"discount_per": item._extend.discount_per,
|
|
220
|
-
"discount_type": item._extend.discount_type || discount_type,
|
|
221
|
-
"order_detail_id": item._extend.order_detail_id || 0,
|
|
222
|
-
"product_bundle": formatProductBundle((_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : (_item$_extend9$other = _item$_extend9.other) === null || _item$_extend9$other === void 0 ? void 0 : _item$_extend9$other.bundle),
|
|
223
|
-
"bundle_edit": item._extend.bundle_edit,
|
|
224
|
-
"product_option_item": formatProductOption((_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : (_item$_extend10$other = _item$_extend10.other) === null || _item$_extend10$other === void 0 ? void 0 : _item$_extend10$other.option),
|
|
225
|
-
"product_variant_id": ((_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 ? void 0 : (_item$_extend11$other = _item$_extend11.other) === null || _item$_extend11$other === void 0 ? void 0 : _item$_extend11$other.product_variant_id) || 0,
|
|
226
|
-
metadata: formatMetaData(item)
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @title: 格式化跨日预约下的普通商品
|
|
232
|
-
* @description:
|
|
233
|
-
* @param {any} data
|
|
234
|
-
* @param {any} booking_item
|
|
235
|
-
* @return {*}
|
|
236
|
-
* @Author: WangHan
|
|
237
|
-
* @Date: 2024-12-07 14:48
|
|
238
|
-
*/
|
|
239
|
-
var formatDayRelationProducts = function formatDayRelationProducts(data, booking_item) {
|
|
240
|
-
var list = data.service.value;
|
|
241
|
-
|
|
242
|
-
// 过滤出卡片中的普通商品
|
|
243
|
-
var relation_products = list === null || list === void 0 ? void 0 : list.filter(function (item) {
|
|
244
|
-
var _item$_extend12;
|
|
245
|
-
var holderId = (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.holder_id;
|
|
246
|
-
var bookingHolderId = booking_item._extend.holder_id;
|
|
247
|
-
var isDayBookingProduct = appointmentTypes.includes(item.extension_type);
|
|
248
|
-
return holderId && holderId === bookingHolderId && !isDayBookingProduct;
|
|
249
|
-
});
|
|
250
|
-
relation_products = relation_products.map(function (item) {
|
|
251
|
-
return formatProducts(item);
|
|
252
|
-
});
|
|
253
|
-
return relation_products || [];
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* @title: 格式化跨日预约商品列表
|
|
258
|
-
* @description:
|
|
259
|
-
* @param {any} data
|
|
260
|
-
* @return {*}
|
|
261
|
-
* @Author: WangHan
|
|
262
|
-
* @Date: 2024-12-17 11:06
|
|
263
|
-
*/
|
|
264
|
-
var formatAppointmentProductLists = function formatAppointmentProductLists(data) {
|
|
265
|
-
try {
|
|
266
|
-
var _Array$from;
|
|
267
|
-
var list = data.service.value;
|
|
268
|
-
|
|
269
|
-
// 找出预约商品
|
|
270
|
-
list = list.filter(function (item) {
|
|
271
|
-
var _item$_extend13;
|
|
272
|
-
return ((_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.holder_id) && appointmentTypes.includes(item.extension_type);
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
// 对预约商品列表根据holder_id进行分组
|
|
276
|
-
var groupMap = new Map();
|
|
277
|
-
list.forEach(function (item) {
|
|
278
|
-
var _item$_extend14;
|
|
279
|
-
var key = (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.holder_id; // 分组键
|
|
280
|
-
if (!groupMap.has(key)) {
|
|
281
|
-
groupMap.set(key, []);
|
|
282
|
-
}
|
|
283
|
-
groupMap.get(key).push(item);
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
// 处理每个分组
|
|
287
|
-
// groupMap.forEach(group => {
|
|
288
|
-
// // 只给第一个数据增加 relation_products
|
|
289
|
-
// group[0].relation_products = formatDayRelationProducts(data, group[0])
|
|
290
|
-
// });
|
|
291
|
-
|
|
292
|
-
// 将分组的结果还原为数组
|
|
293
|
-
var result = (_Array$from = Array.from(groupMap.values())) === null || _Array$from === void 0 ? void 0 : _Array$from.reduce(function (acc, group) {
|
|
294
|
-
return acc.concat(group);
|
|
295
|
-
}, []);
|
|
296
|
-
return list || [];
|
|
297
|
-
} catch (error) {}
|
|
298
|
-
};
|
|
299
|
-
|
|
300
120
|
/**
|
|
301
121
|
* @title: 预约商品信息
|
|
302
122
|
* @description:
|
|
@@ -305,59 +125,42 @@ var formatAppointmentProductLists = function formatAppointmentProductLists(data)
|
|
|
305
125
|
* @Author: zhiwei.Wang
|
|
306
126
|
* @Date: 2024-02-19 09:26
|
|
307
127
|
*/
|
|
308
|
-
var formatBookings = function formatBookings(data
|
|
309
|
-
// 是否是跨日预约
|
|
310
|
-
var isDay = isDayBooking(data);
|
|
128
|
+
var formatBookings = function formatBookings(data) {
|
|
311
129
|
var list = data.service.value;
|
|
312
|
-
|
|
313
|
-
// 格式化跨日预约商品列表
|
|
314
|
-
if (isDay) {
|
|
315
|
-
list = formatAppointmentProductLists(data);
|
|
316
|
-
}
|
|
317
|
-
var dayParams = {
|
|
318
|
-
relation_products: []
|
|
319
|
-
};
|
|
320
130
|
var eventOtherParams = data.eventOtherParams;
|
|
321
131
|
var bookings = [];
|
|
322
132
|
bookings = list.map(function (item) {
|
|
133
|
+
var _item$_extend, _item$_extend$other;
|
|
323
134
|
var start_date = item._extend.startDate.format('YYYY-MM-DD');
|
|
324
135
|
var end_date = item._extend.endDate.format('YYYY-MM-DD');
|
|
325
136
|
var end_time = item._extend.endDate.format("HH:mm");
|
|
326
137
|
var start_time = item._extend.startDate.format("HH:mm");
|
|
327
|
-
|
|
328
138
|
// 更新当前时间
|
|
329
139
|
if (isNowTime(item._extend.start_time)) {
|
|
330
140
|
start_time = getNowTime();
|
|
331
141
|
}
|
|
142
|
+
var total = Number(item._extend.total);
|
|
143
|
+
var origin_total = Number(item._extend.origin_total);
|
|
144
|
+
var discount_amount = origin_total - total;
|
|
332
145
|
|
|
333
|
-
//
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
dayParams.holder = formatHolders(data, item, values);
|
|
352
|
-
dayParams.duration = getDays({
|
|
353
|
-
_extend: {
|
|
354
|
-
start_date: startDateTime,
|
|
355
|
-
end_date: endDateTime
|
|
356
|
-
}
|
|
357
|
-
}, 'minutes');
|
|
358
|
-
}
|
|
359
|
-
return _objectSpread(_objectSpread({
|
|
360
|
-
"product": formatProducts(item),
|
|
146
|
+
// 加价时type使用change_price
|
|
147
|
+
var discount_type = discount_amount < 0 ? 'change_price' : 'discount';
|
|
148
|
+
return _objectSpread({
|
|
149
|
+
"product": {
|
|
150
|
+
"num": item._extend.quantity,
|
|
151
|
+
"price": item._extend.price,
|
|
152
|
+
"product_id": item.id,
|
|
153
|
+
"discount_amount": discount_amount,
|
|
154
|
+
"product_discount_reason": item._extend.discount_reason || '',
|
|
155
|
+
"is_charge_tax": item.is_charge_tax,
|
|
156
|
+
"note": "",
|
|
157
|
+
"discountway": item._extend.discountway || "num",
|
|
158
|
+
"discount_per": item._extend.discount_per,
|
|
159
|
+
"discount_type": item._extend.discount_type || discount_type,
|
|
160
|
+
"order_detail_id": item._extend.order_detail_id || 0,
|
|
161
|
+
"product_bundle": formatProductBundle((_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : (_item$_extend$other = _item$_extend.other) === null || _item$_extend$other === void 0 ? void 0 : _item$_extend$other.bundle),
|
|
162
|
+
"bundle_edit": item._extend.bundle_edit
|
|
163
|
+
},
|
|
361
164
|
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
362
165
|
'id': item.booking_id || 0,
|
|
363
166
|
"relation_id": item._extend.relation_id || 0,
|
|
@@ -366,44 +169,24 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
366
169
|
"is_all": false,
|
|
367
170
|
"schedule_id": item._extend.schedule_id || 0,
|
|
368
171
|
"end_time": end_time,
|
|
369
|
-
"sub_type":
|
|
172
|
+
"sub_type": getSubType(item),
|
|
370
173
|
"select_date": start_date,
|
|
371
174
|
"start_time": start_time,
|
|
372
175
|
"end_date": end_date,
|
|
373
176
|
"start_date": start_date,
|
|
374
|
-
"duration":
|
|
177
|
+
"duration": flexibleObj.getValue(item._extend.duration),
|
|
375
178
|
"number": item._extend.capacity ? getSumCapacity({
|
|
376
179
|
cacheItem: item
|
|
377
180
|
}) : item._extend.number || 1,
|
|
378
181
|
"resources": formatResource(item),
|
|
379
|
-
"metadata":
|
|
380
|
-
|
|
182
|
+
"metadata": item._extend.capacity ? {
|
|
183
|
+
capacity: item._extend.capacity
|
|
184
|
+
} : undefined
|
|
185
|
+
}, eventOtherParams || {});
|
|
381
186
|
});
|
|
382
187
|
return bookings;
|
|
383
188
|
};
|
|
384
189
|
|
|
385
|
-
/**
|
|
386
|
-
* @title: 普通商品
|
|
387
|
-
* @description:
|
|
388
|
-
* @param {any} data
|
|
389
|
-
* @return {*}
|
|
390
|
-
* @Author: WangHan
|
|
391
|
-
* @Date: 2024-12-06 21:26
|
|
392
|
-
*/
|
|
393
|
-
var formatRelationProducts = function formatRelationProducts(data) {
|
|
394
|
-
var _data$service;
|
|
395
|
-
var list = ((_data$service = data.service) === null || _data$service === void 0 ? void 0 : _data$service.value) || [];
|
|
396
|
-
// open items 下的商品
|
|
397
|
-
list = list.filter(function (item) {
|
|
398
|
-
return !appointmentTypes.includes(item.extension_type);
|
|
399
|
-
});
|
|
400
|
-
var relationProducts = [];
|
|
401
|
-
relationProducts = list.map(function (item) {
|
|
402
|
-
return formatProducts(item);
|
|
403
|
-
});
|
|
404
|
-
return relationProducts || [];
|
|
405
|
-
};
|
|
406
|
-
|
|
407
190
|
/**
|
|
408
191
|
* @title: 预约主体信息
|
|
409
192
|
* @description:
|
|
@@ -414,8 +197,8 @@ var formatRelationProducts = function formatRelationProducts(data) {
|
|
|
414
197
|
* @Date: 2024-02-19 09:26
|
|
415
198
|
*/
|
|
416
199
|
var formatHolder = function formatHolder(state, values) {
|
|
417
|
-
var _state$
|
|
418
|
-
var form_id = (state === null || state === void 0 ? void 0 : (_state$
|
|
200
|
+
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2, _state$bookingConfig$3, _state$pet$value, _state$pet, _state$pet$originValu, _state$pet$originValu2;
|
|
201
|
+
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;
|
|
419
202
|
var petValue = ((_state$pet$value = state.pet.value) === null || _state$pet$value === void 0 ? void 0 : _state$pet$value[form_id]) || [];
|
|
420
203
|
var obj = {
|
|
421
204
|
customer_id: values.customer_id,
|
|
@@ -447,12 +230,9 @@ export var formatValues = function formatValues(state) {
|
|
|
447
230
|
bookings: [],
|
|
448
231
|
customer_id: 1,
|
|
449
232
|
customer_name: "",
|
|
450
|
-
holder: {}
|
|
451
|
-
relation_products: [],
|
|
452
|
-
metadata: {}
|
|
233
|
+
holder: {}
|
|
453
234
|
};
|
|
454
|
-
|
|
455
|
-
if (!state.bookingId || isDay) {
|
|
235
|
+
if (!state.bookingId) {
|
|
456
236
|
// 备注
|
|
457
237
|
values.shop_note = formatNote(state);
|
|
458
238
|
}
|
|
@@ -471,12 +251,9 @@ export var formatValues = function formatValues(state) {
|
|
|
471
251
|
|
|
472
252
|
// 主体
|
|
473
253
|
values.holder = formatHolder(state, values);
|
|
474
|
-
if (isDay) {
|
|
475
|
-
values.relation_products = formatRelationProducts(state);
|
|
476
|
-
}
|
|
477
254
|
|
|
478
255
|
// 服务
|
|
479
|
-
values.bookings = formatBookings(state
|
|
256
|
+
values.bookings = formatBookings(state);
|
|
480
257
|
|
|
481
258
|
// 日期
|
|
482
259
|
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)) {
|
|
@@ -486,13 +263,5 @@ export var formatValues = function formatValues(state) {
|
|
|
486
263
|
startTime = "".concat(startTime || '00:00', ":00");
|
|
487
264
|
values.schedule_date = "".concat(values.bookings[0].select_date, " ").concat(startTime);
|
|
488
265
|
}
|
|
489
|
-
|
|
490
|
-
// 跨日预约增加多余参数区分
|
|
491
|
-
if (isDay) {
|
|
492
|
-
values.metadata.is_multiday_appointment = 1;
|
|
493
|
-
// is_bundle_price_calculated 用于区分商品的price是总价,还是商品的单价
|
|
494
|
-
values.is_bundle_price_calculated = 1;
|
|
495
|
-
}
|
|
496
|
-
debugger;
|
|
497
266
|
return values;
|
|
498
267
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
4
4
|
state: FormState;
|
|
5
5
|
} & {
|
|
6
6
|
dispatch: (params: {
|
|
@@ -24,20 +24,13 @@ 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
|
-
}
|
|
34
27
|
};
|
|
35
28
|
var Cpt = AddService;
|
|
36
29
|
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)) {
|
|
37
30
|
Cpt = AddService2;
|
|
38
31
|
}
|
|
39
32
|
return /*#__PURE__*/React.createElement(Cpt, {
|
|
40
|
-
renderMode:
|
|
33
|
+
renderMode: "current",
|
|
41
34
|
dispatch: dispatch,
|
|
42
35
|
state: globalState,
|
|
43
36
|
drawerProps: {
|
|
@@ -19,7 +19,6 @@ interface SelectDrawerProps {
|
|
|
19
19
|
modalOpen: boolean;
|
|
20
20
|
franchiseeLoading?: number;
|
|
21
21
|
showHeader?: boolean;
|
|
22
|
-
showWalkIn?: boolean;
|
|
23
22
|
}
|
|
24
23
|
declare const _default: React.ForwardRefExoticComponent<SelectDrawerProps & React.RefAttributes<unknown>>;
|
|
25
24
|
export default _default;
|
|
@@ -99,8 +99,7 @@ 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
|
|
103
|
-
showWalkIn = props.showWalkIn;
|
|
102
|
+
showHeader = props.showHeader;
|
|
104
103
|
var form = (formData === null || formData === void 0 ? void 0 : formData[0]) || {};
|
|
105
104
|
var valList = (childrenValue === null || childrenValue === void 0 ? void 0 : childrenValue[form.id]) || defaultArr;
|
|
106
105
|
var _useState = useState(valList),
|
|
@@ -108,6 +107,13 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
108
107
|
_value = _useState2[0],
|
|
109
108
|
setValue = _useState2[1];
|
|
110
109
|
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]);
|
|
111
117
|
var searchRef = useRef();
|
|
112
118
|
|
|
113
119
|
// 是否打开弹窗
|
|
@@ -119,13 +125,6 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
119
125
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
120
126
|
search = _useState6[0],
|
|
121
127
|
_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]);
|
|
129
128
|
useEffect(function () {
|
|
130
129
|
if (!modalOpen) {
|
|
131
130
|
setOpen(false);
|
|
@@ -169,12 +168,12 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
169
168
|
if (getIsWalkIn(item === null || item === void 0 ? void 0 : item.id)) {
|
|
170
169
|
return locales.getText('pisell2.text.select-a-customer');
|
|
171
170
|
}
|
|
172
|
-
var firstLastName = item.first_name || item.last_name ? "".concat(item.first_name, " ").concat(item.last_name) :
|
|
171
|
+
var firstLastName = item.first_name || item.last_name ? "".concat(item.first_name, " ").concat(item.last_name) : "";
|
|
173
172
|
return item.name || (item.display_name || '').trim() || (item.nickname || '').trim() || firstLastName.trim() || '';
|
|
174
173
|
}, [locales.localeMap]);
|
|
175
174
|
var handleAddClient = function handleAddClient() {
|
|
176
175
|
handleCreateItem(function () {
|
|
177
|
-
_setSearch(
|
|
176
|
+
_setSearch("");
|
|
178
177
|
});
|
|
179
178
|
};
|
|
180
179
|
var handleChildrenValueChange = /*#__PURE__*/function () {
|
|
@@ -312,7 +311,7 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
312
311
|
}();
|
|
313
312
|
return /*#__PURE__*/React.createElement(Drawer, {
|
|
314
313
|
showGoBack: showHeader,
|
|
315
|
-
title: showHeader && locales.getText(
|
|
314
|
+
title: showHeader && locales.getText("pisell2.text.select-customer"),
|
|
316
315
|
open: open,
|
|
317
316
|
onClose: closeDrawer,
|
|
318
317
|
header: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -352,13 +351,13 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
352
351
|
}, /*#__PURE__*/React.createElement(ActionItem, {
|
|
353
352
|
title: locales.getText('pisell2.text.create-new-customer'),
|
|
354
353
|
onClick: handleAddClient
|
|
355
|
-
}),
|
|
354
|
+
}), /*#__PURE__*/React.createElement(ActionItem, {
|
|
356
355
|
title: "Walk-In",
|
|
357
356
|
onClick: function onClick() {
|
|
358
357
|
handleSelectClient([]);
|
|
359
358
|
closeDrawer();
|
|
360
359
|
}
|
|
361
|
-
})
|
|
360
|
+
})), /*#__PURE__*/React.createElement(Spin, {
|
|
362
361
|
spinning: !!loading,
|
|
363
362
|
delay: 500
|
|
364
363
|
}, !!options.length ? options.map(function (item) {
|