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