@pisell/private-materials 3.0.151 → 3.0.152
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 +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/booking/components/footer/index.js +48 -33
- package/es/components/booking/components/footer/utils.js +35 -4
- package/es/components/booking/index.js +1 -1
- package/es/components/booking/info/index.d.ts +4 -12
- package/es/components/booking/info/index.js +12 -122
- package/es/components/booking/info/main.d.ts +12 -0
- package/es/components/booking/info/main.js +124 -0
- package/es/components/booking/info/model.js +0 -1
- package/es/components/booking/info/service/addTimeModal/index.js +4 -4
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +7 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/info2/index.js +216 -0
- package/es/components/booking/info2/serve.d.ts +6 -0
- package/es/components/booking/info2/serve.js +79 -0
- package/es/components/booking/info2/service/actions/index.d.ts +6 -0
- package/es/components/booking/info2/service/actions/index.js +86 -0
- package/es/components/booking/info2/service/addService/index.d.ts +6 -0
- package/es/components/booking/info2/service/addService/index.js +404 -0
- package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/es/components/booking/info2/service/addService/mock.js +332 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/es/components/booking/info2/service/addService/utils.js +510 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
- package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/es/components/booking/info2/service/addTimeModal/serve.js +73 -0
- package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
- package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
- package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
- package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/index.js +617 -0
- package/es/components/booking/info2/service/editService/index.less +99 -0
- package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/es/components/booking/info2/service/editService/utils.js +37 -0
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/service/index.js +55 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info2/service/serviceItem/index.js +176 -0
- package/es/components/booking/info2/service/serviceItem/index.less +125 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/es/components/booking/info2/service/serviceList/index.js +106 -0
- package/es/components/booking/info2/service/serviceList/index.less +0 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/es/components/booking/info2/utilsByBooking.js +349 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +12 -3
- package/es/components/booking/materiels/resources/index.d.ts +2 -2
- package/es/components/booking/materiels/resources/index.js +11 -11
- package/es/components/booking/mock.d.ts +1 -0
- package/es/components/booking/mock.js +66 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +28 -5
- package/lib/components/booking/components/footer/utils.js +29 -4
- package/lib/components/booking/index.js +2 -2
- package/lib/components/booking/info/index.d.ts +4 -12
- package/lib/components/booking/info/index.js +14 -115
- package/lib/components/booking/info/main.d.ts +12 -0
- package/lib/components/booking/info/main.js +152 -0
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +9 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/index.js +202 -0
- package/lib/components/booking/info2/serve.d.ts +6 -0
- package/lib/components/booking/info2/serve.js +53 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info2/service/actions/index.js +102 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
- package/lib/components/booking/info2/service/addService/index.js +356 -0
- package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/lib/components/booking/info2/service/addService/mock.js +398 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/lib/components/booking/info2/service/addService/utils.js +377 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
- package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/index.js +483 -0
- package/lib/components/booking/info2/service/editService/index.less +99 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/lib/components/booking/info2/service/editService/utils.js +0 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/service/index.js +75 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
- package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/lib/components/booking/info2/service/serviceList/index.js +130 -0
- package/lib/components/booking/info2/service/serviceList/index.less +0 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/lib/components/booking/info2/utilsByBooking.js +257 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/materiels/resources/index.d.ts +2 -2
- package/lib/components/booking/mock.d.ts +1 -0
- package/lib/components/booking/mock.js +67 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +3 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info2/service/serviceItem/index.tsx
|
|
30
|
+
var serviceItem_exports = {};
|
|
31
|
+
__export(serviceItem_exports, {
|
|
32
|
+
default: () => serviceItem_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(serviceItem_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_like = __toESM(require("../../../info/service/like"));
|
|
37
|
+
var import_utils = require("../../../utils");
|
|
38
|
+
var import_utils2 = require("@pisell/utils");
|
|
39
|
+
var import_collapsibleList = __toESM(require("../../../components/collapsibleList"));
|
|
40
|
+
var import_utils3 = require("../../../components/collapsibleList/utils");
|
|
41
|
+
var import_antd = require("antd");
|
|
42
|
+
var import_actions = __toESM(require("../actions"));
|
|
43
|
+
var import_index = require("./index.less");
|
|
44
|
+
var getName = (name, locale) => {
|
|
45
|
+
return name[locale] || name["original"] || name["en"] || "";
|
|
46
|
+
};
|
|
47
|
+
var sortResources = (service) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
let origin = ((_a = service.product_resource) == null ? void 0 : _a.resources) || [];
|
|
50
|
+
let list = ((_b = service._extend) == null ? void 0 : _b.resource) || {};
|
|
51
|
+
let processedKeys = /* @__PURE__ */ new Set();
|
|
52
|
+
let res = [];
|
|
53
|
+
origin.forEach((item) => {
|
|
54
|
+
const key = item.id;
|
|
55
|
+
if (list[key]) {
|
|
56
|
+
res.push(list[key]);
|
|
57
|
+
processedKeys.add(key);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.keys(list).forEach((key) => {
|
|
61
|
+
const keyNum = Number(key);
|
|
62
|
+
if (!processedKeys.has(keyNum)) {
|
|
63
|
+
res.push(list[keyNum]);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return res;
|
|
67
|
+
};
|
|
68
|
+
var ServiceItem = ({
|
|
69
|
+
d,
|
|
70
|
+
handleEditService,
|
|
71
|
+
state,
|
|
72
|
+
handleLike,
|
|
73
|
+
errorMessage
|
|
74
|
+
}) => {
|
|
75
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
76
|
+
const isDiscount = (0, import_react.useMemo)(() => {
|
|
77
|
+
var _a2, _b2;
|
|
78
|
+
return Number((_a2 = d._extend) == null ? void 0 : _a2.total) != Number((_b2 = d._extend) == null ? void 0 : _b2.origin_total);
|
|
79
|
+
}, [(_a = d._extend) == null ? void 0 : _a.total, (_b = d._extend) == null ? void 0 : _b.origin_total]);
|
|
80
|
+
const renderResources = (0, import_react.useMemo)(() => {
|
|
81
|
+
if (state.renderType == "eventBooking") {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const resourcesOriginMap = state.service.resourcesOriginMap || {};
|
|
85
|
+
const list = sortResources(d);
|
|
86
|
+
return list.filter((item) => item.length).map((item) => {
|
|
87
|
+
var _a2, _b2, _c2, _d2;
|
|
88
|
+
let resourceGroupName = "";
|
|
89
|
+
let resourceNames = "";
|
|
90
|
+
let first = item == null ? void 0 : item[0];
|
|
91
|
+
let resourceGroup = (_b2 = (_a2 = d.product_resource) == null ? void 0 : _a2.resources) == null ? void 0 : _b2.find(
|
|
92
|
+
(t) => t.id === (first == null ? void 0 : first.form_id)
|
|
93
|
+
);
|
|
94
|
+
let showLike = (resourceGroup == null ? void 0 : resourceGroup.select_type.min) === 1 && (resourceGroup == null ? void 0 : resourceGroup.select_type.max) === 1 && (resourceGroup == null ? void 0 : resourceGroup.type) === "single";
|
|
95
|
+
if ((_c2 = first == null ? void 0 : first.metadata) == null ? void 0 : _c2.form_name) {
|
|
96
|
+
resourceGroupName = (_d2 = first == null ? void 0 : first.metadata) == null ? void 0 : _d2.form_name;
|
|
97
|
+
resourceNames = item.map((v) => {
|
|
98
|
+
var _a3;
|
|
99
|
+
return (_a3 = v == null ? void 0 : v.metadata) == null ? void 0 : _a3.resource_name;
|
|
100
|
+
}).join(", ");
|
|
101
|
+
} else {
|
|
102
|
+
resourceGroupName = resourceGroup == null ? void 0 : resourceGroup.title;
|
|
103
|
+
resourceNames = item.map((v) => {
|
|
104
|
+
var _a3;
|
|
105
|
+
return (_a3 = resourcesOriginMap[v.relation_id]) == null ? void 0 : _a3.main_field;
|
|
106
|
+
}).join(", ");
|
|
107
|
+
}
|
|
108
|
+
const showGroupName = (list == null ? void 0 : list.length) > 1;
|
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-technician" }, showGroupName ? /* @__PURE__ */ import_react.default.createElement("span", { style: { marginRight: "4px" } }, resourceGroupName, ":") : null, showLike ? /* @__PURE__ */ import_react.default.createElement(
|
|
110
|
+
import_like.default,
|
|
111
|
+
{
|
|
112
|
+
style: { margin: "0 4px 0 0" },
|
|
113
|
+
status: item[0].like_status,
|
|
114
|
+
onChange: (e) => {
|
|
115
|
+
handleLike(e, d, item[0]);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
) : null, resourceNames);
|
|
119
|
+
});
|
|
120
|
+
}, [d, state.service.resourcesOriginMap, state.renderType]);
|
|
121
|
+
const renderUser = (0, import_react.useMemo)(() => {
|
|
122
|
+
var _a2, _b2;
|
|
123
|
+
let list = ((_a2 = d._extend) == null ? void 0 : _a2.capacity) || [];
|
|
124
|
+
if (((_b2 = d.capacity) == null ? void 0 : _b2.type) === "custom") {
|
|
125
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, list.map((user) => {
|
|
126
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: "pisell-lowcode__booking-service-item-technician",
|
|
130
|
+
key: user.id
|
|
131
|
+
},
|
|
132
|
+
/* @__PURE__ */ import_react.default.createElement("span", { style: { marginRight: "4px" } }, getName(user.name, state.locale), ":"),
|
|
133
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, user.value || 0)
|
|
134
|
+
);
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}, [d, state.locale]);
|
|
139
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
key: d._id,
|
|
143
|
+
className: "pisell-lowcode__booking-service-item",
|
|
144
|
+
onClick: () => {
|
|
145
|
+
handleEditService(d);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
d.id ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-title" }, d.title) : null,
|
|
149
|
+
d._extend && state.renderType !== "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-date" }, (0, import_utils.getServiceTime)(d, state.date.value)), renderResources) : null,
|
|
150
|
+
(((_d = (_c = d._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.bundle) || []).length ? /* @__PURE__ */ import_react.default.createElement(
|
|
151
|
+
import_collapsibleList.default,
|
|
152
|
+
{
|
|
153
|
+
border: true,
|
|
154
|
+
list: ((_f = (_e = d._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.bundle) || [],
|
|
155
|
+
renderItem: (item) => (0, import_utils3.renderBundles)(item, state.amountSymbol)
|
|
156
|
+
}
|
|
157
|
+
) : null,
|
|
158
|
+
d.id ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-price-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-price" }, (0, import_utils2.formatAmount)((_g = d._extend) == null ? void 0 : _g.total, 2, state.amountSymbol)), isDiscount ? /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-original-price" }, (0, import_utils2.formatAmount)(d._extend.origin_total, 2, state.amountSymbol)) : null)) : null,
|
|
159
|
+
isDiscount && ((_h = d._extend) == null ? void 0 : _h.discount_reason) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-discount-reason" }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils2.locales.getText("pisell2.text.discount-reason"), ":"), " ", (_i = d._extend) == null ? void 0 : _i.discount_reason) : null,
|
|
160
|
+
renderUser,
|
|
161
|
+
((_j = d._extend.relation_details) == null ? void 0 : _j.length) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-relation-details" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-title" }, import_utils2.locales.getText("page.booking.text.sales")), d._extend.relation_details.map((item, index) => {
|
|
162
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: "pisell-lowcode__booking-service-item-relation-detail",
|
|
166
|
+
key: item.id
|
|
167
|
+
},
|
|
168
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-relation-detail-title" }, item.product_title),
|
|
169
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-relation-detail-info" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-relation-detail-info-price" }, (0, import_utils2.formatAmount)(item.payment_price, 2, state.amountSymbol)), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-relation-detail-info-unit" }, "x"), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-relation-detail-info-quantity" }, item.product_quantity))
|
|
170
|
+
);
|
|
171
|
+
})) : null,
|
|
172
|
+
/* @__PURE__ */ import_react.default.createElement(import_actions.default, { currentService: d }),
|
|
173
|
+
errorMessage ? /* @__PURE__ */ import_react.default.createElement(
|
|
174
|
+
import_antd.Alert,
|
|
175
|
+
{
|
|
176
|
+
message: errorMessage,
|
|
177
|
+
type: "warning",
|
|
178
|
+
showIcon: true,
|
|
179
|
+
className: "pisell-lowcode__booking-service-item-error"
|
|
180
|
+
}
|
|
181
|
+
) : null
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
var serviceItem_default = ServiceItem;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.pisell-lowcode__booking-service-item {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
border: 1px solid #D5D7DA;
|
|
5
|
+
margin-bottom: 16px;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
padding: 16px 20px;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
background-color: #fff;
|
|
15
|
+
|
|
16
|
+
&:last-child {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&::before {
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 6px;
|
|
26
|
+
height: 100%;
|
|
27
|
+
background: #80BCFE;
|
|
28
|
+
z-index: 2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pisell-lowcode__booking-service-item-title {
|
|
32
|
+
color: var(--gray-900, #101828);
|
|
33
|
+
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
line-height: 24px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pisell-lowcode__booking-service-item-date {
|
|
41
|
+
color: var(--gray-500, #667085);
|
|
42
|
+
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pisell-lowcode__booking-service-item-technician {
|
|
50
|
+
color: var(--gray-500, #667085);
|
|
51
|
+
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
font-style: normal;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
line-height: 20px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.pisell-lowcode__booking-service-item-price-wrap {
|
|
59
|
+
.pisell-lowcode__booking-service-item-price {
|
|
60
|
+
color: var(--gray-500, #667085);
|
|
61
|
+
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
line-height: 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pisell-lowcode__booking-service-item-original-price {
|
|
69
|
+
color: var(--gray-500, #667085);
|
|
70
|
+
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
line-height: 20px;
|
|
75
|
+
margin-left: 8px;
|
|
76
|
+
text-decoration: line-through;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pisell-lowcode__booking-service-item-discount-reason {
|
|
83
|
+
color: var(--gray-500, #667085);
|
|
84
|
+
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
line-height: 20px;
|
|
89
|
+
white-space: break-spaces;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pisell-lowcode__booking-service-item-error {
|
|
93
|
+
border: none;
|
|
94
|
+
margin: 0 -20px -16px;
|
|
95
|
+
border-radius: 0 0 8px 8px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pisell-lowcode__booking-service-item-relation-details {
|
|
100
|
+
padding-top: 6px;
|
|
101
|
+
margin-top: 6px;
|
|
102
|
+
border-top: 1px solid #d5d7da;
|
|
103
|
+
margin-bottom: 6px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.pisell-lowcode__booking-service-item-relation-detail {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: flex-start;
|
|
109
|
+
justify-content: space-between;
|
|
110
|
+
margin-top: 4px;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
|
|
113
|
+
.pisell-lowcode__booking-service-item-relation-detail-title {}
|
|
114
|
+
|
|
115
|
+
.pisell-lowcode__booking-service-item-relation-detail-info {
|
|
116
|
+
.pisell-lowcode__booking-service-item-relation-detail-info-quantity {}
|
|
117
|
+
|
|
118
|
+
.pisell-lowcode__booking-service-item-relation-detail-info-unit {
|
|
119
|
+
padding: 0 4px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.pisell-lowcode__booking-service-item-relation-detail-info-price {}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info2/service/serviceList/index.tsx
|
|
30
|
+
var serviceList_exports = {};
|
|
31
|
+
__export(serviceList_exports, {
|
|
32
|
+
default: () => serviceList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(serviceList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_index = require("./index.less");
|
|
38
|
+
var import_model = require("../../../info/model");
|
|
39
|
+
var import_utils2 = require("../addService/utils");
|
|
40
|
+
var import_serviceItem = __toESM(require("../serviceItem"));
|
|
41
|
+
var ServiceList = ({ onEdit }) => {
|
|
42
|
+
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
43
|
+
const handleEditService = (item) => {
|
|
44
|
+
if (state.disabledEdit || state.disableEventBookingEdit) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let cacheItem = (0, import_utils2.getProductExtend)({
|
|
48
|
+
cacheItem: { ...item, new: 0 },
|
|
49
|
+
state
|
|
50
|
+
});
|
|
51
|
+
dispatch({
|
|
52
|
+
type: "setService",
|
|
53
|
+
payload: {
|
|
54
|
+
editModal: true,
|
|
55
|
+
cacheItem
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
onEdit == null ? void 0 : onEdit(cacheItem);
|
|
59
|
+
};
|
|
60
|
+
const getErrorMessage = (0, import_react.useCallback)((service) => {
|
|
61
|
+
let errorList = [];
|
|
62
|
+
const list = Object.values(service._extend.resource || []);
|
|
63
|
+
errorList = list.reduce((pre, cur) => {
|
|
64
|
+
return pre.concat(
|
|
65
|
+
(cur || []).reduce((preItem, curItem) => {
|
|
66
|
+
return preItem.concat(curItem.errors || []);
|
|
67
|
+
}, [])
|
|
68
|
+
);
|
|
69
|
+
}, []);
|
|
70
|
+
let errorMessage = "";
|
|
71
|
+
console.log(errorList, list, "cur.errors");
|
|
72
|
+
if (errorList == null ? void 0 : errorList.length) {
|
|
73
|
+
errorMessage = `${errorList.length} ${import_utils.locales.getText(
|
|
74
|
+
"pisell2.text.warnings"
|
|
75
|
+
)}`;
|
|
76
|
+
}
|
|
77
|
+
return errorMessage;
|
|
78
|
+
}, []);
|
|
79
|
+
const handleLike = (status, item, resource) => {
|
|
80
|
+
if (state.disabledEdit) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
let _list = [...state.service.value];
|
|
84
|
+
let _id = item == null ? void 0 : item._id;
|
|
85
|
+
_list = _list.map(
|
|
86
|
+
(d) => d._id === _id ? {
|
|
87
|
+
...d,
|
|
88
|
+
_extend: {
|
|
89
|
+
...d._extend,
|
|
90
|
+
resource: {
|
|
91
|
+
...d._extend.resource,
|
|
92
|
+
[resource.form_id]: d._extend.resource[resource.form_id].map(
|
|
93
|
+
(d2, i) => {
|
|
94
|
+
if (d2.relation_id === resource.relation_id) {
|
|
95
|
+
return {
|
|
96
|
+
...d2,
|
|
97
|
+
like_status: status
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return d2;
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} : d
|
|
106
|
+
);
|
|
107
|
+
dispatch({
|
|
108
|
+
type: "setService",
|
|
109
|
+
payload: {
|
|
110
|
+
value: _list,
|
|
111
|
+
edit: true
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, state.service.value.map((d) => {
|
|
116
|
+
let errorMessage = getErrorMessage(d);
|
|
117
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
118
|
+
import_serviceItem.default,
|
|
119
|
+
{
|
|
120
|
+
key: d._id,
|
|
121
|
+
errorMessage,
|
|
122
|
+
d,
|
|
123
|
+
handleEditService,
|
|
124
|
+
state,
|
|
125
|
+
handleLike
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}));
|
|
129
|
+
};
|
|
130
|
+
var serviceList_default = ServiceList;
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const getResourceTimeIsUsable: (item: any, cacheItem: any, resourceItem: any) => any;
|
|
2
|
+
export declare const getSumCapacity: ({ cacheItem }: any) => number;
|
|
3
|
+
/**
|
|
4
|
+
* @title: 查找是否有可用的time
|
|
5
|
+
* @description:
|
|
6
|
+
* @param {any} resourceItem
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: zhiwei.Wang
|
|
9
|
+
* @Date: 2024-01-09 13:57
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatTimes: (resourceItem: any, cacheItem: any) => any;
|
|
12
|
+
export declare const getErrorList: (resource: any, cacheItem: any) => {
|
|
13
|
+
label: any;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
/**
|
|
17
|
+
* @title: 格式化资源, 添加自定义参数
|
|
18
|
+
* @description:
|
|
19
|
+
* @param {any} resourceItem
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @Author: zhiwei.Wang
|
|
22
|
+
* @Date: 2024-01-09 13:40
|
|
23
|
+
*/
|
|
24
|
+
export declare const formatResource: (resourceItem: any, cacheItem?: any, formatLabel?: any) => any;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 创建服务的开始时间和结束时间
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {any} state
|
|
29
|
+
* @param {any} item
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: zhiwei.Wang
|
|
32
|
+
* @Date: 2024-01-26 14:09
|
|
33
|
+
*/
|
|
34
|
+
export declare const getServiceStartTimeAndEndTime: (state: any, cacheItem: any, timeObj: any) => any;
|