@quoreadmin/ui 1.6.6 → 1.6.7
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/dist/index.css +1 -1
- package/dist/index139.js +332 -300
- package/dist/index141.js +1 -1
- package/dist/index143.js +4 -4
- package/dist/index153.js +1 -1
- package/dist/index157.js +7 -7
- package/dist/index170.js +14 -14
- package/dist/index171.js +3 -3
- package/dist/index174.js +4 -4
- package/dist/index181.js +10 -10
- package/dist/index182.js +2 -2
- package/dist/index183.js +10 -10
- package/dist/index185.js +1 -1
- package/dist/index186.js +44 -115
- package/dist/index187.js +1188 -42
- package/dist/index189.js +5940 -0
- package/dist/index190.js +99 -5830
- package/dist/index191.js +16 -188
- package/dist/index192.js +8 -25
- package/dist/index193.js +76 -16
- package/dist/index194.js +249 -74
- package/dist/index195.js +13660 -229
- package/dist/index196.js +27 -13684
- package/dist/index197.js +62 -26
- package/dist/index198.js +215 -40
- package/dist/index199.js +276 -206
- package/dist/index20.js +4 -4
- package/dist/index200.js +258 -278
- package/dist/index201.js +32 -287
- package/dist/index202.js +113 -30
- package/dist/index203.js +30 -110
- package/dist/index204.js +26 -36
- package/dist/index205.js +36 -26
- package/dist/index206.js +9 -36
- package/dist/index207.js +19 -9
- package/dist/index208.js +10 -19
- package/dist/index209.js +10 -10
- package/dist/index210.js +51 -10
- package/dist/index211.js +37 -45
- package/dist/index212.js +3 -42
- package/dist/index213.js +38 -3
- package/dist/index214.js +21 -39
- package/dist/index215.js +88 -21
- package/dist/index216.js +389 -70
- package/dist/index217.js +21 -406
- package/dist/index218.js +159 -20
- package/dist/index219.js +19 -160
- package/dist/index220.js +20 -228
- package/dist/index221.js +21 -36
- package/dist/index222.js +198 -9
- package/dist/index223.js +64 -121
- package/dist/index224.js +32 -36
- package/dist/index225.js +40 -80
- package/dist/index226.js +14 -12
- package/dist/index227.js +14 -12
- package/dist/index228.js +12 -12
- package/dist/index229.js +836 -20
- package/dist/index230.js +701 -19
- package/dist/index231.js +171 -156
- package/dist/index232.js +11 -11
- package/dist/index233.js +13 -15
- package/dist/index234.js +21 -198
- package/dist/index235.js +19 -69
- package/dist/index236.js +20 -34
- package/dist/index237.js +3 -40
- package/dist/index238.js +186 -21
- package/dist/index239.js +132 -21
- package/dist/index240.js +1223 -20
- package/dist/index241.js +114 -823
- package/dist/index242.js +19 -701
- package/dist/index243.js +22 -176
- package/dist/index244.js +8 -8
- package/dist/index245.js +37 -19
- package/dist/index246.js +22 -13
- package/dist/index247.js +20 -3
- package/dist/index248.js +19 -186
- package/dist/index249.js +2 -133
- package/dist/index250.js +2 -1223
- package/dist/index251.js +3632 -20
- package/dist/index252.js +55 -22
- package/dist/index253.js +77 -22
- package/dist/index254.js +52 -29
- package/dist/index255.js +215 -20
- package/dist/index256.js +10 -20
- package/dist/index257.js +57 -2
- package/dist/index258.js +61 -2
- package/dist/index259.js +39 -3617
- package/dist/index260.js +50 -30
- package/dist/index261.js +689 -43
- package/dist/index262.js +22 -35
- package/dist/index263.js +34 -185
- package/dist/index264.js +10 -9
- package/dist/index265.js +697 -49
- package/dist/index266.js +816 -57
- package/dist/index267.js +160 -53
- package/dist/index268.js +225 -72
- package/dist/index269.js +34 -720
- package/dist/index270.js +10 -39
- package/dist/index271.js +73 -57
- package/dist/index272.js +20 -11
- package/dist/index273.js +20 -705
- package/dist/index274.js +234 -801
- package/dist/index275.js +8 -253
- package/dist/index276.js +138 -8
- package/dist/index277.js +68 -123
- package/dist/index278.js +50 -79
- package/dist/index279.js +79 -3
- package/dist/index280.js +25 -26
- package/dist/index281.js +22 -2
- package/dist/index282.js +21 -78
- package/dist/index283.js +14 -52
- package/dist/index284.js +17 -26
- package/dist/index285.js +23 -22
- package/dist/index286.js +1518 -22
- package/dist/index287.js +386 -16
- package/dist/index288.js +2731 -17
- package/dist/index289.js +85 -22
- package/dist/index290.js +3770 -79
- package/dist/index291.js +59 -21
- package/dist/index292.js +14 -934
- package/dist/index293.js +83 -21
- package/dist/index294.js +202 -20
- package/dist/index295.js +246 -20
- package/dist/index296.js +77 -67
- package/dist/index297.js +21 -18
- package/dist/index298.js +934 -18
- package/dist/index299.js +16 -16
- package/dist/index300.js +11 -13
- package/dist/index301.js +19 -62
- package/dist/index302.js +69 -1518
- package/dist/index303.js +19 -386
- package/dist/index304.js +19 -2731
- package/dist/index305.js +21 -85
- package/dist/index306.js +22 -3770
- package/dist/index307.js +63 -60
- package/dist/index308.js +2 -15
- package/dist/index309.js +3 -84
- package/dist/index310.js +22 -197
- package/dist/index311.js +219 -230
- package/dist/index312.js +4 -233
- package/dist/index313.js +133 -5
- package/dist/index314.js +63 -129
- package/dist/index315.js +86 -67
- package/dist/index316.js +27 -85
- package/dist/index317.js +8 -28
- package/dist/index318.js +74 -8
- package/dist/index319.js +3 -74
- package/dist/index320.js +2 -4
- package/dist/index321.js +83 -2
- package/dist/index322.js +52 -81
- package/dist/index323.js +5 -53
- package/dist/index324.js +4 -5
- package/dist/index325.js +178 -4
- package/dist/index326.js +58 -174
- package/dist/index327.js +73 -61
- package/dist/index328.js +36 -74
- package/dist/index329.js +19 -8
- package/dist/index330.js +19 -12
- package/dist/index331.js +60 -51
- package/dist/index332.js +37 -12
- package/dist/index333.js +8 -13
- package/dist/index334.js +12 -57
- package/dist/index335.js +51 -48
- package/dist/index336.js +9 -28
- package/dist/index337.js +14 -2
- package/dist/index338.js +58 -5
- package/dist/index339.js +52 -2
- package/dist/index340.js +30 -22
- package/dist/index341.js +2 -41
- package/dist/index342.js +5 -2
- package/dist/index343.js +2 -11
- package/dist/index344.js +22 -19
- package/dist/index345.js +38 -14
- package/dist/index346.js +2 -10
- package/dist/index347.js +10 -9
- package/dist/index348.js +20 -2
- package/dist/index349.js +16 -8
- package/dist/index350.js +10 -10
- package/dist/index351.js +9 -13
- package/dist/index352.js +2 -37
- package/dist/index353.js +9 -20
- package/dist/index354.js +9 -19
- package/dist/index355.js +14 -64
- package/dist/index356.js +20 -36
- package/dist/index357.js +54 -19
- package/dist/index358.js +28 -55
- package/dist/index359.js +5 -27
- package/dist/index360.js +51 -6
- package/dist/index361.js +5 -51
- package/dist/index362.js +12 -6
- package/dist/index363.js +7 -12
- package/dist/index364.js +27 -6
- package/dist/index365.js +2 -28
- package/dist/index366.js +70 -2
- package/dist/index367.js +164 -67
- package/dist/index368.js +99 -165
- package/dist/index369.js +91 -17
- package/dist/index370.js +95 -98
- package/dist/index371.js +17 -91
- package/dist/index372.js +30 -97
- package/dist/index373.js +10 -30
- package/dist/index374.js +3 -10
- package/dist/index375.js +3 -3
- package/dist/index376.js +13 -4
- package/dist/index377.js +7 -13
- package/dist/index378.js +12 -7
- package/dist/index379.js +4 -11
- package/dist/index380.js +33 -5
- package/dist/index381.js +31 -33
- package/dist/index382.js +26 -29
- package/dist/index383.js +59 -26
- package/dist/index384.js +3 -61
- package/dist/index385.js +2 -3
- package/dist/index386.js +2 -2
- package/dist/index387.js +17 -2
- package/dist/index388.js +11 -15
- package/dist/index389.js +6 -13
- package/dist/index390.js +32 -6
- package/dist/index43.js +321 -314
- package/dist/index47.js +4 -4
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +91 -1
- package/dist/src/components/textarea/textarea.d.ts +1 -1
- package/dist/src/components/textarea/textarea.stories.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index188.js +0 -1192
- package/dist/index391.js +0 -34
package/dist/index139.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { DateTime as
|
|
1
|
+
import { defineComponent as Ve, ref as i, computed as h, watch as F, onMounted as Ze, onUnmounted as et } from "vue";
|
|
2
|
+
import { useI18n as tt } from "vue-i18n";
|
|
3
|
+
import { DateTime as y } from "./index162.js";
|
|
4
4
|
import "./index185.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
5
|
+
import at from "./index2.js";
|
|
6
|
+
import ot from "./index3.js";
|
|
7
|
+
import st from "./index13.js";
|
|
8
|
+
import nt from "./index21.js";
|
|
9
|
+
import rt from "./index28.js";
|
|
10
|
+
import lt from "./index39.js";
|
|
11
|
+
import ut from "./index20.js";
|
|
12
|
+
import it from "./index46.js";
|
|
13
|
+
import ct from "./index47.js";
|
|
14
|
+
import dt from "./index49.js";
|
|
15
|
+
import G from "./index186.js";
|
|
16
|
+
const Ct = Ve({
|
|
16
17
|
name: "QRoomDetailsPopover",
|
|
17
18
|
components: {
|
|
18
|
-
QAccordion:
|
|
19
|
-
QActivityItem:
|
|
20
|
-
QCommentSection:
|
|
21
|
-
QDatePicker:
|
|
22
|
-
QDivider:
|
|
23
|
-
QIcon:
|
|
24
|
-
QPopover:
|
|
25
|
-
QTag:
|
|
26
|
-
|
|
19
|
+
QAccordion: at,
|
|
20
|
+
QActivityItem: ot,
|
|
21
|
+
QCommentSection: st,
|
|
22
|
+
QDatePicker: ut,
|
|
23
|
+
QDivider: nt,
|
|
24
|
+
QIcon: rt,
|
|
25
|
+
QPopover: lt,
|
|
26
|
+
QTag: it,
|
|
27
|
+
QTextarea: ct,
|
|
28
|
+
QTooltip: dt
|
|
27
29
|
},
|
|
28
30
|
props: {
|
|
29
31
|
id: {
|
|
@@ -124,8 +126,8 @@ const _t = $e({
|
|
|
124
126
|
}
|
|
125
127
|
},
|
|
126
128
|
emits: ["create:callback", "create:todo", "refresh:pms", "toggle"],
|
|
127
|
-
setup(s, { emit:
|
|
128
|
-
const { t: v } =
|
|
129
|
+
setup(s, { emit: I }) {
|
|
130
|
+
const { t: v } = tt(), l = i(null), K = i(!1), V = i("left"), j = i([
|
|
129
131
|
{
|
|
130
132
|
id: 1,
|
|
131
133
|
label: v("HC_DEPARTMENT")
|
|
@@ -141,7 +143,7 @@ const _t = $e({
|
|
|
141
143
|
label: v("HC_ANYONE")
|
|
142
144
|
// need to localize
|
|
143
145
|
}
|
|
144
|
-
]),
|
|
146
|
+
]), T = i(""), p = i({
|
|
145
147
|
checkInDate: /* @__PURE__ */ new Date(),
|
|
146
148
|
checkOutDate: /* @__PURE__ */ new Date(),
|
|
147
149
|
guestEmail: "",
|
|
@@ -149,19 +151,19 @@ const _t = $e({
|
|
|
149
151
|
guestMood: null,
|
|
150
152
|
guestName: "",
|
|
151
153
|
guestPhone: "",
|
|
152
|
-
inHouse: !!
|
|
154
|
+
inHouse: !!l.value?.tokenId || !1,
|
|
153
155
|
problem: null,
|
|
154
156
|
notes: "",
|
|
155
|
-
tokenId:
|
|
156
|
-
}),
|
|
157
|
+
tokenId: l.value?.tokenId
|
|
158
|
+
}), H = i(250), P = i(290), C = i([]), de = i([]), Z = i(!0), U = i(!0), E = i({
|
|
157
159
|
info: !0,
|
|
158
160
|
tickets: !0,
|
|
159
161
|
comments: !0
|
|
160
|
-
}),
|
|
162
|
+
}), Q = i(!0), _e = i(s.guestDetails), w = i([]), b = i({
|
|
161
163
|
pms: !1,
|
|
162
164
|
roomNotices: !1,
|
|
163
165
|
tickets: !1
|
|
164
|
-
}),
|
|
166
|
+
}), ee = i([]), te = i([]), ae = i("bottom"), M = i(null), oe = i([]), R = i(!1), S = i(!1), O = i(null), u = i({
|
|
165
167
|
assignType: null,
|
|
166
168
|
department: null,
|
|
167
169
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -171,7 +173,7 @@ const _t = $e({
|
|
|
171
173
|
requestedBy: null,
|
|
172
174
|
when: null,
|
|
173
175
|
where: null
|
|
174
|
-
}),
|
|
176
|
+
}), B = i([
|
|
175
177
|
{
|
|
176
178
|
id: 0,
|
|
177
179
|
label: v("HC_STAFF_MEMBER")
|
|
@@ -182,12 +184,12 @@ const _t = $e({
|
|
|
182
184
|
label: v("HC_HOTEL_GUEST")
|
|
183
185
|
// need to localize
|
|
184
186
|
}
|
|
185
|
-
]),
|
|
187
|
+
]), ke = i(!1), k = i(null), g = i({
|
|
186
188
|
endDate: /* @__PURE__ */ new Date(),
|
|
187
189
|
issue: null,
|
|
188
190
|
notes: "",
|
|
189
191
|
startDate: /* @__PURE__ */ new Date()
|
|
190
|
-
}),
|
|
192
|
+
}), $ = i([]), J = i(!1), D = i([]), L = i([]), De = i([
|
|
191
193
|
{
|
|
192
194
|
label: v("HC_COMPLAINT"),
|
|
193
195
|
id: "complaint"
|
|
@@ -204,7 +206,7 @@ const _t = $e({
|
|
|
204
206
|
label: v("HC_WORK_ORDER"),
|
|
205
207
|
id: "work_order"
|
|
206
208
|
}
|
|
207
|
-
]),
|
|
209
|
+
]), x = i(), N = i(null), d = i({
|
|
208
210
|
assignType: null,
|
|
209
211
|
department: null,
|
|
210
212
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -213,8 +215,8 @@ const _t = $e({
|
|
|
213
215
|
notes: "",
|
|
214
216
|
person: null,
|
|
215
217
|
requestedBy: null
|
|
216
|
-
}),
|
|
217
|
-
switch (
|
|
218
|
+
}), se = i([]), q = i([]), A = i([]), ne = h(() => {
|
|
219
|
+
switch (l.value.cleaning?.name) {
|
|
218
220
|
case "CLEAN":
|
|
219
221
|
case "INSPECTED":
|
|
220
222
|
return "CLEAN";
|
|
@@ -226,14 +228,14 @@ const _t = $e({
|
|
|
226
228
|
default:
|
|
227
229
|
return "";
|
|
228
230
|
}
|
|
229
|
-
}),
|
|
230
|
-
const e =
|
|
231
|
-
return
|
|
232
|
-
}),
|
|
231
|
+
}), Ie = h(() => ne.value === "CLEAN" ? "blue-10" : ne.value === "DIRTY" ? "red-10" : "gray-30"), Te = h(() => v(`HC_${l.value.cleaning?.name}`) || ""), be = h(() => {
|
|
232
|
+
const e = T.value.toLowerCase();
|
|
233
|
+
return oe.value.filter((a) => a.toLowerCase().match(e));
|
|
234
|
+
}), me = h(() => D.value.length ? !!D.value.find(
|
|
233
235
|
(a) => a.type === "complaint"
|
|
234
|
-
) : !1),
|
|
236
|
+
) : !1), Oe = h(() => D.value.length ? !!D.value.find(
|
|
235
237
|
(a) => a.type === "callback"
|
|
236
|
-
) : !1),
|
|
238
|
+
) : !1), Ce = h(() => {
|
|
237
239
|
let e = [];
|
|
238
240
|
return w.value[0] && w.value[0].options === void 0 ? w.value.forEach((a) => {
|
|
239
241
|
e.push({
|
|
@@ -241,95 +243,109 @@ const _t = $e({
|
|
|
241
243
|
label: a.display_name
|
|
242
244
|
});
|
|
243
245
|
}) : e = w.value, e;
|
|
244
|
-
}),
|
|
245
|
-
switch (
|
|
246
|
+
}), pe = h(() => l.value.occupancy?.name === "OCCUPIED"), Ee = h(() => pe.value && me.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Me = h(() => {
|
|
247
|
+
switch (k.value?.id) {
|
|
246
248
|
case "request":
|
|
247
249
|
case "work_order":
|
|
248
|
-
return
|
|
250
|
+
return j.value[0];
|
|
249
251
|
default:
|
|
250
252
|
return null;
|
|
251
253
|
}
|
|
252
|
-
}),
|
|
253
|
-
if (
|
|
254
|
-
switch (
|
|
254
|
+
}), Re = h(() => {
|
|
255
|
+
if (C.value)
|
|
256
|
+
switch (k.value?.id) {
|
|
255
257
|
case "request":
|
|
256
|
-
return
|
|
258
|
+
return C.value.find((e) => parseInt(e.id) === 4);
|
|
257
259
|
case "work_order":
|
|
258
|
-
return
|
|
260
|
+
return C.value.find((e) => parseInt(e.id) === 2);
|
|
259
261
|
default:
|
|
260
262
|
return null;
|
|
261
263
|
}
|
|
262
264
|
return null;
|
|
263
|
-
}),
|
|
264
|
-
switch (
|
|
265
|
+
}), Se = h(() => {
|
|
266
|
+
switch (k.value?.id) {
|
|
265
267
|
case "request":
|
|
266
|
-
return
|
|
268
|
+
return B.value[1];
|
|
267
269
|
case "work_order":
|
|
268
|
-
return
|
|
270
|
+
return B.value[0];
|
|
269
271
|
default:
|
|
270
272
|
return null;
|
|
271
273
|
}
|
|
272
|
-
}),
|
|
274
|
+
}), Ne = h(() => {
|
|
273
275
|
let e = "";
|
|
274
|
-
if (
|
|
275
|
-
const a =
|
|
276
|
-
|
|
277
|
-
), t = a.toFormat("MMM"), o = a.day, n = a.year, r =
|
|
278
|
-
|
|
279
|
-
),
|
|
280
|
-
e += t + " " + o, n !== f && (e += ", " + n), t ===
|
|
276
|
+
if (l.value && l.value.reservations[0]) {
|
|
277
|
+
const a = y.fromISO(
|
|
278
|
+
l.value.reservations[0].arrivalDate
|
|
279
|
+
), t = a.toFormat("MMM"), o = a.day, n = a.year, r = y.fromISO(
|
|
280
|
+
l.value.reservations[0].departureDate
|
|
281
|
+
), c = r.toFormat("MMM"), m = r.day, f = r.year;
|
|
282
|
+
e += t + " " + o, n !== f && (e += ", " + n), t === c ? e += "-" + m : e += " - " + c + " " + m, e += ", " + f;
|
|
281
283
|
}
|
|
282
284
|
return e;
|
|
283
|
-
}),
|
|
284
|
-
let e =
|
|
285
|
+
}), qe = h(() => {
|
|
286
|
+
let e = $.value;
|
|
285
287
|
return e = [...new Set(e)], e;
|
|
286
|
-
}),
|
|
287
|
-
const e =
|
|
288
|
+
}), Ae = h(() => {
|
|
289
|
+
const e = k.value?.id;
|
|
288
290
|
if (!e)
|
|
289
291
|
return !1;
|
|
290
292
|
switch (e) {
|
|
291
293
|
case "room_notice":
|
|
292
|
-
return
|
|
294
|
+
return g.value.issue && g.value.startDate && g.value.endDate;
|
|
293
295
|
case "complaint":
|
|
294
296
|
return p.value.problem && p.value.guestName && p.value.guestMood;
|
|
295
297
|
case "work_order":
|
|
296
|
-
return
|
|
298
|
+
return d.value.item && d.value.issue && d.value.requestedBy && d.value.due && (d.value.assignType && d.value.assignType.id === 0 || d.value.assignType && d.value.assignType.id === 1 && d.value.department || d.value.assignType && d.value.assignType.id === 2 && d.value.person);
|
|
297
299
|
case "request": {
|
|
298
|
-
const a =
|
|
300
|
+
const a = u.value.item && u.value.requestedBy && u.value.due && (u.value.assignType && u.value.assignType.id === 0 || u.value.assignType && u.value.assignType.id === 1 && u.value.department || u.value.assignType && u.value.assignType.id === 2 && u.value.person), t = s.allowWhenWhere ? u.value.when && u.value.where : !0;
|
|
299
301
|
return a && t;
|
|
300
302
|
}
|
|
301
303
|
default:
|
|
302
304
|
return !1;
|
|
303
305
|
}
|
|
304
|
-
}),
|
|
305
|
-
|
|
306
|
-
},
|
|
307
|
-
|
|
308
|
-
},
|
|
306
|
+
}), ve = () => {
|
|
307
|
+
J.value = !1, R.value = !1, K.value = !1, w.value = [], te.value = [], se.value = [], q.value = [], A.value = [], k.value = null, g.value.issue = null, g.value.startDate = /* @__PURE__ */ new Date(), g.value.endDate = /* @__PURE__ */ new Date(), g.value.notes = "", p.value.guestName = "", p.value.guestEmail = "", p.value.guestPhone = "", p.value.guestMood = null, p.value.guestLoyalty = "", p.value.problem = null, p.value.checkInDate = /* @__PURE__ */ new Date(), p.value.checkOutDate = /* @__PURE__ */ new Date(), p.value.notes = "", d.value.assignType = null, d.value.department = null, d.value.person = null, d.value.due = /* @__PURE__ */ new Date(), d.value.item = null, d.value.issue = null, d.value.notes = "", u.value.assignType = null, u.value.department = null, u.value.person = null, u.value.due = /* @__PURE__ */ new Date(), u.value.item = null, u.value.notes = "", u.value.when = null, u.value.where = null;
|
|
308
|
+
}, He = async () => {
|
|
309
|
+
I("create:callback", l.value), I("toggle", !1);
|
|
310
|
+
}, Y = (e) => {
|
|
309
311
|
const a = [];
|
|
310
|
-
Object.values(e).forEach((
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
312
|
+
(Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
|
|
313
|
+
const n = o.senderType || o.sender_type, r = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, f = r ? r.split(" ") : ["", ""], X = o.user_first_name || o.guest_first_name || f[0] || "", Ke = o.user_last_name || o.guest_last_name || f.slice(1).join(" ") || "";
|
|
314
|
+
let _ = {
|
|
315
|
+
id: o.id,
|
|
316
|
+
isPropertyEmployee: n === "user",
|
|
317
|
+
isSent: !!o.sent,
|
|
318
|
+
isSystemMessage: n === "system",
|
|
319
|
+
message: o.content,
|
|
320
|
+
timestamp: o.sent || o.created,
|
|
318
321
|
user: {
|
|
319
|
-
firstName: "Auto-Reply",
|
|
322
|
+
firstName: X || "Auto-Reply",
|
|
320
323
|
icon: "",
|
|
321
|
-
id: "system-message",
|
|
324
|
+
id: c || "system-message",
|
|
322
325
|
initials: "",
|
|
323
|
-
lastName: "",
|
|
324
|
-
src: ""
|
|
326
|
+
lastName: Ke || "",
|
|
327
|
+
src: m || ""
|
|
325
328
|
}
|
|
326
329
|
};
|
|
327
|
-
|
|
328
|
-
}),
|
|
329
|
-
},
|
|
330
|
-
s.showComments &&
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
_.user.firstName && _.user.lastName ? _.user.initials = _.user.firstName[0] + _.user.lastName[0] : _.user.firstName && (_.user.initials = _.user.firstName[0]), _.isSystemMessage && (_.user.icon = "property-fill"), a.push(_);
|
|
331
|
+
}), ee.value = a;
|
|
332
|
+
}, fe = async () => {
|
|
333
|
+
if (s.showComments && l.value.tokenId)
|
|
334
|
+
try {
|
|
335
|
+
let e = `/api/client/connect/getMessages.php?tokenId=${l.value.tokenId}`;
|
|
336
|
+
O.value !== null && (e += `&lastMsgId=${O.value}`);
|
|
337
|
+
const t = await (await fetch(e, {
|
|
338
|
+
method: "GET",
|
|
339
|
+
credentials: "include"
|
|
340
|
+
})).json();
|
|
341
|
+
if (t.status === "error")
|
|
342
|
+
throw new Error(t.message || "Failed to get messages");
|
|
343
|
+
S.value = !t.closed, t.messages && t.messages.length > 0 && (O.value = t.messages[t.messages.length - 1].id), Y(t.messages || []);
|
|
344
|
+
} catch (e) {
|
|
345
|
+
console.error("getChatMessages error:", e);
|
|
346
|
+
}
|
|
347
|
+
}, Pe = (e) => {
|
|
348
|
+
const a = y.utc(), t = y.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = a.diff(
|
|
333
349
|
t,
|
|
334
350
|
[
|
|
335
351
|
"years",
|
|
@@ -338,26 +354,26 @@ const _t = $e({
|
|
|
338
354
|
"hours",
|
|
339
355
|
"minutes"
|
|
340
356
|
]
|
|
341
|
-
), n = Math.floor(o.years), r = Math.floor(o.months),
|
|
357
|
+
), n = Math.floor(o.years), r = Math.floor(o.months), c = Math.floor(o.days), m = Math.floor(o.hours), f = Math.floor(o.minutes);
|
|
342
358
|
if (n)
|
|
343
359
|
return n === 1 ? v("HC_ONE_YEAR_AGO") : v("HC_X_YEARS_AGO", { years: n });
|
|
344
360
|
if (r)
|
|
345
361
|
return r === 1 ? v("HC_ONE_MONTH_AGO") : v("HC_X_MONTHS_AGO", { months: r });
|
|
346
|
-
if (
|
|
347
|
-
return
|
|
362
|
+
if (c)
|
|
363
|
+
return c === 1 ? v("HC_ONE_DAY_AGO") : v("HC_X_DAYS_AGO", { days: c });
|
|
348
364
|
if (m)
|
|
349
365
|
return m === 1 ? v("HC_ONE_HOUR_AGO") : v("HC_X_HOURS_AGO", { hours: m });
|
|
350
366
|
if (f)
|
|
351
367
|
return f === 1 ? v("HC_ONE_MINUTE_AGO") : v("HC_X_MINUTES_AGO", { minutes: f });
|
|
352
368
|
if (f === 0)
|
|
353
369
|
return v("HC_A_MOMENT_AGO");
|
|
354
|
-
},
|
|
355
|
-
s.showGuestDetails &&
|
|
356
|
-
},
|
|
370
|
+
}, Be = async () => {
|
|
371
|
+
s.showGuestDetails && re(), z(), W(), I("refresh:pms", l.value);
|
|
372
|
+
}, re = async () => {
|
|
357
373
|
try {
|
|
358
|
-
|
|
374
|
+
b.value.pms = !0;
|
|
359
375
|
const e = new AbortController(), a = setTimeout(() => e.abort(), 45e3);
|
|
360
|
-
|
|
376
|
+
L.value.push(a);
|
|
361
377
|
const t = s.pmsBaseUrl;
|
|
362
378
|
if (!t)
|
|
363
379
|
throw new Error("PMS base URL is required");
|
|
@@ -375,30 +391,30 @@ const _t = $e({
|
|
|
375
391
|
signal: e.signal
|
|
376
392
|
}
|
|
377
393
|
);
|
|
378
|
-
clearTimeout(a), n.ok ||
|
|
394
|
+
clearTimeout(a), n.ok || ge(n);
|
|
379
395
|
const r = await n.json();
|
|
380
|
-
|
|
381
|
-
(
|
|
382
|
-
),
|
|
396
|
+
M.value = r.data.pmsRooms, l.value = M.value.find(
|
|
397
|
+
(c) => c.qv2Rooms.qRoomId === s.room.id
|
|
398
|
+
), l.value || (l.value = s.room), b.value.pms = !1;
|
|
383
399
|
} catch (e) {
|
|
384
|
-
return
|
|
400
|
+
return b.value.pms = !1, e;
|
|
385
401
|
}
|
|
386
|
-
},
|
|
402
|
+
}, z = async () => {
|
|
387
403
|
try {
|
|
388
|
-
|
|
404
|
+
b.value.roomNotices = !0;
|
|
389
405
|
const e = await fetch(
|
|
390
406
|
"/api/client/common/getRoomNotices.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
391
407
|
);
|
|
392
408
|
if (!e.ok)
|
|
393
409
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
394
410
|
const a = await e.json();
|
|
395
|
-
|
|
411
|
+
$.value = a.notices;
|
|
396
412
|
} catch (e) {
|
|
397
|
-
console.error("Error getting room notices:", e),
|
|
413
|
+
console.error("Error getting room notices:", e), $.value = [];
|
|
398
414
|
} finally {
|
|
399
|
-
|
|
415
|
+
b.value.roomNotices = !1;
|
|
400
416
|
}
|
|
401
|
-
},
|
|
417
|
+
}, le = async () => {
|
|
402
418
|
const e = new FormData();
|
|
403
419
|
e.append("property_id", s.propertyId), e.append("filter", "tasks_new");
|
|
404
420
|
const [a, t] = await Promise.all([
|
|
@@ -412,35 +428,35 @@ const _t = $e({
|
|
|
412
428
|
]), o = await a.json(), n = await t.json();
|
|
413
429
|
if (o.departments && (o.departments.forEach((r) => {
|
|
414
430
|
r.label = r.display_name;
|
|
415
|
-
}),
|
|
431
|
+
}), C.value = o.departments), n.users) {
|
|
416
432
|
const r = [];
|
|
417
|
-
let
|
|
433
|
+
let c = {
|
|
418
434
|
group: "",
|
|
419
435
|
options: []
|
|
420
436
|
};
|
|
421
437
|
n.users.forEach((m) => {
|
|
422
|
-
m.translated_department !==
|
|
423
|
-
}),
|
|
438
|
+
m.translated_department !== c.group && (c.group && r.push({ ...c }), c.group = m.translated_department, c.options = []), c.options.push(m);
|
|
439
|
+
}), c.group && r.push({ ...c }), de.value = r;
|
|
424
440
|
}
|
|
425
|
-
},
|
|
441
|
+
}, he = async () => {
|
|
426
442
|
try {
|
|
427
443
|
const e = new FormData();
|
|
428
|
-
e.append("funcname", "get_stay_details"), e.append("token_id",
|
|
429
|
-
const t = (await
|
|
444
|
+
e.append("funcname", "get_stay_details"), e.append("token_id", l.value.tokenId);
|
|
445
|
+
const t = (await G.post(
|
|
430
446
|
"/includes/chat_api.php",
|
|
431
447
|
e
|
|
432
448
|
)).data.result;
|
|
433
449
|
if (t !== void 0 && t.error_message)
|
|
434
450
|
throw new Error(t.error_message);
|
|
435
|
-
t && t.user_name && (p.value.guestName = t.user_name), t && t.cell_phone && (p.value.guestPhone = t.cell_phone), t && t.email && (p.value.guestEmail = t.email), t && t.check_in && (p.value.checkInDate =
|
|
451
|
+
t && t.user_name && (p.value.guestName = t.user_name), t && t.cell_phone && (p.value.guestPhone = t.cell_phone), t && t.email && (p.value.guestEmail = t.email), t && t.check_in && (p.value.checkInDate = y.fromISO(
|
|
436
452
|
t.check_in
|
|
437
|
-
).toJSDate()), t && t.check_out && (p.value.checkOutDate =
|
|
453
|
+
).toJSDate()), t && t.check_out && (p.value.checkOutDate = y.fromISO(
|
|
438
454
|
t.check_out
|
|
439
455
|
).toJSDate());
|
|
440
456
|
} catch (e) {
|
|
441
457
|
console.log(e);
|
|
442
458
|
}
|
|
443
|
-
},
|
|
459
|
+
}, Le = (e) => {
|
|
444
460
|
switch (e) {
|
|
445
461
|
case "complaint":
|
|
446
462
|
return "red-30";
|
|
@@ -453,7 +469,7 @@ const _t = $e({
|
|
|
453
469
|
case "task":
|
|
454
470
|
return "green-20";
|
|
455
471
|
}
|
|
456
|
-
},
|
|
472
|
+
}, xe = (e) => {
|
|
457
473
|
switch (e) {
|
|
458
474
|
case "complaint":
|
|
459
475
|
return "face-frown";
|
|
@@ -466,9 +482,9 @@ const _t = $e({
|
|
|
466
482
|
case "task":
|
|
467
483
|
return "check";
|
|
468
484
|
}
|
|
469
|
-
},
|
|
485
|
+
}, W = async () => {
|
|
470
486
|
try {
|
|
471
|
-
|
|
487
|
+
b.value.tickets = !0;
|
|
472
488
|
const e = await fetch(
|
|
473
489
|
"/api/client/common/getAllToDos.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
474
490
|
);
|
|
@@ -479,9 +495,9 @@ const _t = $e({
|
|
|
479
495
|
} catch (e) {
|
|
480
496
|
console.error("Error getting tickets:", e), D.value = [];
|
|
481
497
|
} finally {
|
|
482
|
-
|
|
498
|
+
b.value.tickets = !1;
|
|
483
499
|
}
|
|
484
|
-
},
|
|
500
|
+
}, ge = async (e) => {
|
|
485
501
|
const a = await e.text();
|
|
486
502
|
let t;
|
|
487
503
|
try {
|
|
@@ -490,10 +506,10 @@ const _t = $e({
|
|
|
490
506
|
t = { code: e.status, message: a };
|
|
491
507
|
}
|
|
492
508
|
return t.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: t }) : t;
|
|
493
|
-
},
|
|
509
|
+
}, We = (e) => {
|
|
494
510
|
const a = document.querySelectorAll(".pulse");
|
|
495
511
|
if (a && a.length) {
|
|
496
|
-
const t =
|
|
512
|
+
const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, o = document.getElementById("room-" + t), n = o?.classList;
|
|
497
513
|
switch (e) {
|
|
498
514
|
case "room_notice":
|
|
499
515
|
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
|
|
@@ -509,15 +525,15 @@ const _t = $e({
|
|
|
509
525
|
break;
|
|
510
526
|
}
|
|
511
527
|
const r = setTimeout(() => {
|
|
512
|
-
a.forEach((
|
|
513
|
-
|
|
528
|
+
a.forEach((c) => {
|
|
529
|
+
c.classList.remove("pulse");
|
|
514
530
|
});
|
|
515
531
|
}, 4500);
|
|
516
|
-
|
|
532
|
+
L.value.push(r);
|
|
517
533
|
}
|
|
518
|
-
},
|
|
534
|
+
}, Fe = () => {
|
|
519
535
|
window.location.href = "/guest/overview.php";
|
|
520
|
-
},
|
|
536
|
+
}, Ge = (e) => {
|
|
521
537
|
let a = "";
|
|
522
538
|
switch (e.type) {
|
|
523
539
|
case "complaint":
|
|
@@ -539,53 +555,53 @@ const _t = $e({
|
|
|
539
555
|
return "#";
|
|
540
556
|
}
|
|
541
557
|
window.open(a);
|
|
542
|
-
},
|
|
543
|
-
const e =
|
|
544
|
-
type:
|
|
558
|
+
}, je = async () => {
|
|
559
|
+
const e = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, a = l.value?.qv2Rooms?.qRoomName || l.value?.name || s.room?.name, t = {
|
|
560
|
+
type: k.value?.id,
|
|
545
561
|
propertyId: s.propertyId,
|
|
546
|
-
userId:
|
|
562
|
+
userId: N.value,
|
|
547
563
|
areaId: e,
|
|
548
564
|
areaName: a
|
|
549
565
|
};
|
|
550
|
-
switch (
|
|
566
|
+
switch (k.value?.id) {
|
|
551
567
|
case "complaint":
|
|
552
|
-
t.tokenId =
|
|
568
|
+
t.tokenId = l.value.tokenId, t.problemId = p.value.problem.id, t.guestName = p.value.guestName, t.guestPhone = p.value.guestPhone, t.guestEmail = p.value.guestEmail, t.guestLoyalty = p.value.guestLoyalty, t.guestMood = p.value.guestMood.id, t.checkInDate = y.fromJSDate(p.value.checkInDate).toFormat(
|
|
553
569
|
"yyyy-MM-dd"
|
|
554
|
-
), t.notes = p.value.notes, t.inHouse = "2", t.source = "dashboard",
|
|
570
|
+
), t.notes = p.value.notes, t.inHouse = "2", t.source = "dashboard", I("create:todo", t);
|
|
555
571
|
break;
|
|
556
572
|
case "request":
|
|
557
|
-
t.itemId =
|
|
573
|
+
t.itemId = u.value.item.id, t.assignType = u.value.assignType.id, t.occupied = u.value.requestedBy.id, t.notes = u.value.notes, t.dueDate = y.fromJSDate(u.value.due).toFormat("yyyy-MM-dd"), u.value.assignType.id === 1 && (t.department = u.value.department.id), u.value.assignType.id === 2 && (t.person = u.value.person.id), s.allowWhenWhere && (t.requestWhen = u.value.when ? u.value.when.id : "", t.requestWhere = u.value.where ? u.value.where.id : ""), I("create:todo", t);
|
|
558
574
|
break;
|
|
559
575
|
case "room_notice":
|
|
560
|
-
t.
|
|
576
|
+
t.issueId = g.value.issue.id, t.startDate = y.fromJSDate(g.value.startDate).toFormat("yyyy-MM-dd"), t.endDate = y.fromJSDate(g.value.endDate).toFormat("yyyy-MM-dd"), t.notes = g.value.notes, t.sendPush = "1", I("create:todo", t);
|
|
561
577
|
break;
|
|
562
578
|
case "work_order":
|
|
563
|
-
t.itemId =
|
|
579
|
+
t.itemId = d.value.item.id, t.issueId = d.value.issue.id, t.assignType = d.value.assignType.id, t.occupied = d.value.requestedBy.id, t.notes = d.value.notes, t.dueDate = y.fromJSDate(d.value.due).toFormat("yyyy-MM-dd"), d.value.assignType.id === 1 && (t.department = d.value.department.id), d.value.assignType.id === 2 && (t.person = d.value.person.id), I("create:todo", t);
|
|
564
580
|
break;
|
|
565
581
|
}
|
|
566
|
-
},
|
|
567
|
-
|
|
568
|
-
},
|
|
569
|
-
|
|
570
|
-
},
|
|
571
|
-
if (console.log("selected:", e),
|
|
582
|
+
}, Ue = (e) => {
|
|
583
|
+
ie(), ce(), s.hover && I("toggle", e);
|
|
584
|
+
}, Qe = (e) => {
|
|
585
|
+
we(), T.value = e;
|
|
586
|
+
}, $e = async (e) => {
|
|
587
|
+
if (console.log("selected:", e), k.value = e, w.value = [], g.value.issue = null, p.value.problem = null, d.value.item = null, d.value.issue = null, u.value.item = null, !k.value)
|
|
572
588
|
return;
|
|
573
|
-
const a =
|
|
589
|
+
const a = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, t = new FormData();
|
|
574
590
|
switch (t.append("property_id", s.propertyId), t.append("area_id", a), e.id) {
|
|
575
591
|
case "complaint":
|
|
576
592
|
try {
|
|
577
|
-
|
|
593
|
+
l.value.tokenId && await he();
|
|
578
594
|
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
579
595
|
method: "POST",
|
|
580
596
|
body: t
|
|
581
597
|
})).json();
|
|
582
598
|
n.items && (w.value = n.items);
|
|
583
|
-
const r = await
|
|
599
|
+
const r = await G.post(
|
|
584
600
|
"/api/client/common/getComplaintMoods.php"
|
|
585
601
|
);
|
|
586
|
-
r.data.items.forEach((
|
|
587
|
-
|
|
588
|
-
}),
|
|
602
|
+
r.data.items.forEach((c) => {
|
|
603
|
+
c.label = c.display_name;
|
|
604
|
+
}), te.value = r.data.items;
|
|
589
605
|
} catch (o) {
|
|
590
606
|
console.log(o);
|
|
591
607
|
}
|
|
@@ -603,12 +619,12 @@ const _t = $e({
|
|
|
603
619
|
break;
|
|
604
620
|
case "request":
|
|
605
621
|
try {
|
|
606
|
-
|
|
622
|
+
u.value.requestedBy = B.value[1], u.value.assignType = j.value[0];
|
|
607
623
|
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
608
624
|
method: "POST",
|
|
609
625
|
body: t
|
|
610
626
|
})).json();
|
|
611
|
-
if (n.items && (w.value = n.items), await
|
|
627
|
+
if (n.items && (w.value = n.items), await le(), u.value.department = C.value.find(
|
|
612
628
|
(r) => parseInt(r.id) === 4
|
|
613
629
|
), s.allowWhenWhere)
|
|
614
630
|
try {
|
|
@@ -621,17 +637,17 @@ const _t = $e({
|
|
|
621
637
|
body: r
|
|
622
638
|
}
|
|
623
639
|
)).json();
|
|
624
|
-
m.when && Array.isArray(m.when) ?
|
|
640
|
+
m.when && Array.isArray(m.when) ? q.value = m.when.map((f) => ({
|
|
625
641
|
id: f.id,
|
|
626
642
|
label: f.name,
|
|
627
643
|
value: f.id
|
|
628
|
-
})) :
|
|
644
|
+
})) : q.value = [], m.where && Array.isArray(m.where) ? A.value = m.where.map((f) => ({
|
|
629
645
|
id: f.id,
|
|
630
646
|
label: f.name,
|
|
631
647
|
value: f.id
|
|
632
|
-
})) :
|
|
648
|
+
})) : A.value = [];
|
|
633
649
|
} catch (r) {
|
|
634
|
-
console.log("Error loading When/Where options:", r),
|
|
650
|
+
console.log("Error loading When/Where options:", r), q.value = [], A.value = [];
|
|
635
651
|
}
|
|
636
652
|
} catch (o) {
|
|
637
653
|
console.log(o);
|
|
@@ -639,28 +655,28 @@ const _t = $e({
|
|
|
639
655
|
break;
|
|
640
656
|
case "work_order":
|
|
641
657
|
try {
|
|
642
|
-
|
|
658
|
+
d.value.requestedBy = B.value[0], d.value.assignType = j.value[0];
|
|
643
659
|
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
644
660
|
method: "POST",
|
|
645
661
|
body: t
|
|
646
662
|
})).json(), r = [];
|
|
647
|
-
let
|
|
663
|
+
let c = {
|
|
648
664
|
group: "",
|
|
649
665
|
options: []
|
|
650
666
|
};
|
|
651
667
|
n.items && (n.items.forEach((m) => {
|
|
652
|
-
m.section_name !==
|
|
653
|
-
}),
|
|
654
|
-
|
|
668
|
+
m.section_name !== c.group && (c.group && r.push({ ...c }), c.group = m.section_name, c.options = []), m.label && c.options.push(m);
|
|
669
|
+
}), c.group && r.push({ ...c })), w.value = r, await Promise.all([
|
|
670
|
+
G.post(
|
|
655
671
|
"/api/client/common/getWorkOrderIssues.php"
|
|
656
672
|
),
|
|
657
|
-
|
|
673
|
+
le()
|
|
658
674
|
]).then((m) => {
|
|
659
675
|
const f = m[0];
|
|
660
|
-
f.data.issues.forEach((
|
|
661
|
-
|
|
662
|
-
}),
|
|
663
|
-
}),
|
|
676
|
+
f.data.issues.forEach((X) => {
|
|
677
|
+
X.label = X.display_name;
|
|
678
|
+
}), se.value = f.data.issues;
|
|
679
|
+
}), d.value.department = C.value.find(
|
|
664
680
|
(m) => parseInt(m.id) === 2
|
|
665
681
|
);
|
|
666
682
|
} catch (o) {
|
|
@@ -670,53 +686,65 @@ const _t = $e({
|
|
|
670
686
|
default:
|
|
671
687
|
return;
|
|
672
688
|
}
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
},
|
|
689
|
+
}, Je = () => {
|
|
690
|
+
J.value = !J.value, K.value = !1;
|
|
691
|
+
}, ye = () => {
|
|
676
692
|
const e = document.getElementById("comment-field"), a = document.getElementById("hidden-text");
|
|
677
693
|
e.style.height = a?.offsetHeight + "px";
|
|
678
|
-
},
|
|
694
|
+
}, ue = () => {
|
|
679
695
|
const e = document.getElementById("comments-container");
|
|
680
696
|
e?.scroll({
|
|
681
697
|
top: e.scrollHeight,
|
|
682
698
|
behavior: "smooth"
|
|
683
699
|
});
|
|
684
|
-
},
|
|
685
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
700
|
+
}, Ye = async (e) => {
|
|
701
|
+
if (e && e.type === "keydown" && e.preventDefault(), l.value.tokenId && T.value && !R.value)
|
|
686
702
|
try {
|
|
687
703
|
const a = new FormData();
|
|
688
|
-
a.append("
|
|
689
|
-
const t = await
|
|
690
|
-
"/
|
|
704
|
+
a.append("tokenId", l.value.tokenId), a.append("content", T.value), a.append("senderId", N.value || "");
|
|
705
|
+
const t = await G.post(
|
|
706
|
+
"/api/client/connect/sendMessage.php",
|
|
691
707
|
a
|
|
692
708
|
);
|
|
693
|
-
if (t.data.
|
|
694
|
-
throw new Error(t.data.
|
|
695
|
-
|
|
709
|
+
if (t.data.status === "error")
|
|
710
|
+
throw new Error(t.data.message || "Failed to send message");
|
|
711
|
+
T.value = "", S.value = !t.data.closed, t.data.messages && (Y(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id)), ue();
|
|
696
712
|
} catch (a) {
|
|
697
|
-
console.
|
|
713
|
+
console.error("sendChatMessage error:", a);
|
|
714
|
+
}
|
|
715
|
+
}, ze = async () => {
|
|
716
|
+
if (!(!l.value.tokenId || !N.value))
|
|
717
|
+
try {
|
|
718
|
+
const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", a = new FormData();
|
|
719
|
+
a.append("tokenId", l.value.tokenId), a.append("userId", N.value), S.value && O.value !== null && a.append("lastMsgId", O.value.toString());
|
|
720
|
+
const t = await G.post(e, a);
|
|
721
|
+
if (t.data.status === "error")
|
|
722
|
+
throw new Error(t.data.message || "Failed to update conversation status");
|
|
723
|
+
S.value = !t.data.closed, t.data.messages && (Y(t.data.messages), t.data.messages.length > 0 && (O.value = t.data.messages[t.data.messages.length - 1].id));
|
|
724
|
+
} catch (e) {
|
|
725
|
+
console.error("toggleMarkOpenClose error:", e);
|
|
698
726
|
}
|
|
699
|
-
},
|
|
727
|
+
}, ie = () => {
|
|
700
728
|
if (s.align === "left" || s.align === "right") {
|
|
701
|
-
const e =
|
|
702
|
-
|
|
729
|
+
const e = x.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
730
|
+
V.value = a - e < P.value ? "right" : "left";
|
|
703
731
|
} else {
|
|
704
|
-
const e =
|
|
705
|
-
|
|
732
|
+
const e = x.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
733
|
+
V.value = a - e < H.value ? "bottom" : "top";
|
|
706
734
|
}
|
|
707
|
-
},
|
|
735
|
+
}, ce = () => {
|
|
708
736
|
if (s.position === "top" || s.position === "bottom") {
|
|
709
|
-
const e =
|
|
710
|
-
|
|
737
|
+
const e = x.value?.getBoundingClientRect().top, a = window.innerHeight;
|
|
738
|
+
ae.value = a - e < H.value ? "top" : "bottom";
|
|
711
739
|
} else {
|
|
712
|
-
const e =
|
|
713
|
-
|
|
740
|
+
const e = x.value?.getBoundingClientRect().left, a = window.innerWidth;
|
|
741
|
+
ae.value = a - e < P.value ? "left" : "right";
|
|
714
742
|
}
|
|
715
|
-
},
|
|
716
|
-
R.value = !R.value, R.value ? (
|
|
717
|
-
},
|
|
718
|
-
const t =
|
|
719
|
-
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([t])), await
|
|
743
|
+
}, we = () => {
|
|
744
|
+
R.value = !R.value, R.value ? (T.value = "", E.value.info = U.value, E.value.tickets = Q.value, E.value.comments = Z.value, U.value = !1, Q.value = !1, document.getElementById("comment-field")?.focus()) : (U.value = E.value.info, Q.value = E.value.tickets, Z.value = E.value.comments);
|
|
745
|
+
}, Xe = async (e, a) => {
|
|
746
|
+
const t = l.value?.qv2Rooms?.qRoomId || l.value?.id || s.room?.id, o = new FormData();
|
|
747
|
+
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([t])), await W(), D.value) {
|
|
720
748
|
const n = [];
|
|
721
749
|
D.value.forEach((r) => {
|
|
722
750
|
r.id === e && r.type === a ? n.unshift({
|
|
@@ -726,130 +754,134 @@ const _t = $e({
|
|
|
726
754
|
...r,
|
|
727
755
|
isNew: !1
|
|
728
756
|
});
|
|
729
|
-
}), n.sort((r,
|
|
757
|
+
}), n.sort((r, c) => r.id === e ? -1 : c.id === e ? 1 : 0), D.value = [...n];
|
|
730
758
|
}
|
|
731
759
|
};
|
|
732
|
-
return
|
|
733
|
-
if (s.open && s.showComments &&
|
|
734
|
-
const e = setTimeout(
|
|
735
|
-
|
|
760
|
+
return F(() => s.open, () => {
|
|
761
|
+
if (s.open && s.showComments && ee.value.length) {
|
|
762
|
+
const e = setTimeout(ue, 500);
|
|
763
|
+
L.value.push(e);
|
|
736
764
|
}
|
|
737
|
-
s.open ||
|
|
738
|
-
}),
|
|
739
|
-
const e = setTimeout(
|
|
740
|
-
|
|
741
|
-
}),
|
|
742
|
-
a === !0 && e === !1 && (
|
|
743
|
-
}),
|
|
744
|
-
e && !a && (s.showGuestDetails && !
|
|
745
|
-
}),
|
|
765
|
+
s.open || ve();
|
|
766
|
+
}), F(T, () => {
|
|
767
|
+
const e = setTimeout(ye, 100);
|
|
768
|
+
L.value.push(e);
|
|
769
|
+
}), F(() => s.allowWhenWhere, (e, a) => {
|
|
770
|
+
a === !0 && e === !1 && (u.value.when = null, u.value.where = null, q.value = [], A.value = []);
|
|
771
|
+
}), F(() => s.open, async (e, a) => {
|
|
772
|
+
e && !a && (s.showGuestDetails && !M.value ? await re() : l.value || (l.value = s.room), W(), z(), s.showComments && fe());
|
|
773
|
+
}), F(
|
|
746
774
|
() => s.room.id,
|
|
747
775
|
(e, a) => {
|
|
748
|
-
e !== a && (
|
|
776
|
+
e !== a && (M.value ? (l.value = M.value.find((t) => t.qv2Rooms.qRoomId === s.room.id), l.value || (l.value = s.room)) : l.value = s.room, s.open && (W(), z()));
|
|
749
777
|
}
|
|
750
|
-
),
|
|
778
|
+
), Ze(async () => {
|
|
751
779
|
const e = JSON.parse(
|
|
752
780
|
window.localStorage.getItem("authenticated")
|
|
753
781
|
);
|
|
754
|
-
|
|
782
|
+
N.value = e?.user?.id || "", l.value = s.room, s.size === "sm" && (H.value = 140, P.value = 160), s.size === "lg" && (H.value = 250, P.value = 440), ie(), ce();
|
|
755
783
|
const a = [], t = window.localStorage.getItem("quick-replies");
|
|
756
784
|
t && JSON.parse(t).forEach((o) => {
|
|
757
785
|
a.push(o.message);
|
|
758
|
-
}),
|
|
759
|
-
}),
|
|
760
|
-
|
|
786
|
+
}), oe.value = a;
|
|
787
|
+
}), et(() => {
|
|
788
|
+
L.value.forEach((e) => {
|
|
761
789
|
clearTimeout(e);
|
|
762
790
|
});
|
|
763
791
|
}), {
|
|
764
|
-
DateTime:
|
|
792
|
+
DateTime: y,
|
|
765
793
|
// Refs
|
|
766
|
-
actionMenuOpen:
|
|
767
|
-
alignment:
|
|
768
|
-
assignTypes:
|
|
769
|
-
comment:
|
|
794
|
+
actionMenuOpen: K,
|
|
795
|
+
alignment: V,
|
|
796
|
+
assignTypes: j,
|
|
797
|
+
comment: T,
|
|
770
798
|
complaint: p,
|
|
771
|
-
componentHeight:
|
|
772
|
-
componentWidth:
|
|
773
|
-
departments:
|
|
774
|
-
departmentUsers:
|
|
775
|
-
expandComments:
|
|
776
|
-
expandGuestInfo:
|
|
777
|
-
expandedStates:
|
|
778
|
-
expandTickets:
|
|
779
|
-
guestDetailsData:
|
|
799
|
+
componentHeight: H,
|
|
800
|
+
componentWidth: P,
|
|
801
|
+
departments: C,
|
|
802
|
+
departmentUsers: de,
|
|
803
|
+
expandComments: Z,
|
|
804
|
+
expandGuestInfo: U,
|
|
805
|
+
expandedStates: E,
|
|
806
|
+
expandTickets: Q,
|
|
807
|
+
guestDetailsData: _e,
|
|
780
808
|
itemOptions: w,
|
|
781
|
-
loading:
|
|
782
|
-
messages:
|
|
783
|
-
moodOptions:
|
|
784
|
-
pmsData:
|
|
785
|
-
positioning:
|
|
786
|
-
quickReplies:
|
|
809
|
+
loading: b,
|
|
810
|
+
messages: ee,
|
|
811
|
+
moodOptions: te,
|
|
812
|
+
pmsData: M,
|
|
813
|
+
positioning: ae,
|
|
814
|
+
quickReplies: oe,
|
|
787
815
|
quickReplyOpen: R,
|
|
788
|
-
request:
|
|
789
|
-
requestedByOptions:
|
|
790
|
-
requestLoading:
|
|
791
|
-
requestType:
|
|
792
|
-
roomDetailsData:
|
|
793
|
-
roomNotice:
|
|
794
|
-
roomNotices:
|
|
795
|
-
showCreateRequest:
|
|
816
|
+
request: u,
|
|
817
|
+
requestedByOptions: B,
|
|
818
|
+
requestLoading: ke,
|
|
819
|
+
requestType: k,
|
|
820
|
+
roomDetailsData: l,
|
|
821
|
+
roomNotice: g,
|
|
822
|
+
roomNotices: $,
|
|
823
|
+
showCreateRequest: J,
|
|
796
824
|
ticketsList: D,
|
|
797
|
-
todoOptions:
|
|
798
|
-
trigger:
|
|
799
|
-
userId:
|
|
800
|
-
workOrder:
|
|
801
|
-
workOrderIssues:
|
|
802
|
-
whenOptions:
|
|
803
|
-
whereOptions:
|
|
825
|
+
todoOptions: De,
|
|
826
|
+
trigger: x,
|
|
827
|
+
userId: N,
|
|
828
|
+
workOrder: d,
|
|
829
|
+
workOrderIssues: se,
|
|
830
|
+
whenOptions: q,
|
|
831
|
+
whereOptions: A,
|
|
832
|
+
// Guest Connect state
|
|
833
|
+
isConversationOpen: S,
|
|
834
|
+
lastMessageId: O,
|
|
804
835
|
// Computed
|
|
805
|
-
cleanliness:
|
|
806
|
-
cleanlinessColor:
|
|
807
|
-
cleanlinessTooltipContent:
|
|
808
|
-
filteredReplies:
|
|
809
|
-
hasGuestCallback:
|
|
810
|
-
hasComplaint:
|
|
811
|
-
itemOptionsList:
|
|
812
|
-
occupied:
|
|
813
|
-
occupancyTooltipContent:
|
|
814
|
-
selectedAssignType:
|
|
815
|
-
selectedDepartment:
|
|
816
|
-
selectedRequestedBy:
|
|
817
|
-
stayDetails:
|
|
818
|
-
tagsList:
|
|
819
|
-
validateToDo:
|
|
836
|
+
cleanliness: ne,
|
|
837
|
+
cleanlinessColor: Ie,
|
|
838
|
+
cleanlinessTooltipContent: Te,
|
|
839
|
+
filteredReplies: be,
|
|
840
|
+
hasGuestCallback: Oe,
|
|
841
|
+
hasComplaint: me,
|
|
842
|
+
itemOptionsList: Ce,
|
|
843
|
+
occupied: pe,
|
|
844
|
+
occupancyTooltipContent: Ee,
|
|
845
|
+
selectedAssignType: Me,
|
|
846
|
+
selectedDepartment: Re,
|
|
847
|
+
selectedRequestedBy: Se,
|
|
848
|
+
stayDetails: Ne,
|
|
849
|
+
tagsList: qe,
|
|
850
|
+
validateToDo: Ae,
|
|
820
851
|
// Methods
|
|
821
|
-
closeRequest:
|
|
822
|
-
createCallback:
|
|
823
|
-
createMessageList:
|
|
824
|
-
getChatMessages:
|
|
825
|
-
getHowLongAgo:
|
|
826
|
-
getPMSData:
|
|
827
|
-
getRoomNotices:
|
|
828
|
-
getSharedData:
|
|
829
|
-
getStayDetails:
|
|
830
|
-
getTicketColor:
|
|
831
|
-
getTicketIcon:
|
|
832
|
-
getTickets:
|
|
833
|
-
handleFailedResponse:
|
|
834
|
-
handlePulse:
|
|
835
|
-
onClickEditConnectGuest:
|
|
836
|
-
onClickTicket:
|
|
837
|
-
onCreateRequestSubmit:
|
|
838
|
-
onHoverToggle:
|
|
839
|
-
onSelectQuickReply:
|
|
840
|
-
onSelectToDo:
|
|
841
|
-
openRequest:
|
|
842
|
-
refreshPMSData:
|
|
843
|
-
resizeTextarea:
|
|
844
|
-
scrollToConnectBottom:
|
|
845
|
-
sendChatMessage:
|
|
846
|
-
setAlignment:
|
|
847
|
-
setPositioning:
|
|
848
|
-
|
|
849
|
-
|
|
852
|
+
closeRequest: ve,
|
|
853
|
+
createCallback: He,
|
|
854
|
+
createMessageList: Y,
|
|
855
|
+
getChatMessages: fe,
|
|
856
|
+
getHowLongAgo: Pe,
|
|
857
|
+
getPMSData: re,
|
|
858
|
+
getRoomNotices: z,
|
|
859
|
+
getSharedData: le,
|
|
860
|
+
getStayDetails: he,
|
|
861
|
+
getTicketColor: Le,
|
|
862
|
+
getTicketIcon: xe,
|
|
863
|
+
getTickets: W,
|
|
864
|
+
handleFailedResponse: ge,
|
|
865
|
+
handlePulse: We,
|
|
866
|
+
onClickEditConnectGuest: Fe,
|
|
867
|
+
onClickTicket: Ge,
|
|
868
|
+
onCreateRequestSubmit: je,
|
|
869
|
+
onHoverToggle: Ue,
|
|
870
|
+
onSelectQuickReply: Qe,
|
|
871
|
+
onSelectToDo: $e,
|
|
872
|
+
openRequest: Je,
|
|
873
|
+
refreshPMSData: Be,
|
|
874
|
+
resizeTextarea: ye,
|
|
875
|
+
scrollToConnectBottom: ue,
|
|
876
|
+
sendChatMessage: Ye,
|
|
877
|
+
setAlignment: ie,
|
|
878
|
+
setPositioning: ce,
|
|
879
|
+
toggleMarkOpenClose: ze,
|
|
880
|
+
toggleQuickReply: we,
|
|
881
|
+
updateTickets: Xe
|
|
850
882
|
};
|
|
851
883
|
}
|
|
852
884
|
});
|
|
853
885
|
export {
|
|
854
|
-
|
|
886
|
+
Ct as default
|
|
855
887
|
};
|