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