@7365admin1/layer-common 1.10.9 → 1.10.10

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.
@@ -25,158 +25,178 @@
25
25
  >
26
26
  </v-data-table>
27
27
  </v-col>
28
+ <div class="w-100 my-8 mx-2">
29
+ <v-table class="responsive-table border elevation-0">
30
+ <thead>
31
+ <tr>
32
+ <th
33
+ v-for="(item, index) in concernHeader"
34
+ :key="index"
35
+ class="text-left font-weight-bold text-black border-e"
36
+ >
37
+ {{ item }}
38
+ </th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ <!-- 1 -->
43
+ <tr>
44
+ <td class="border-e">1.</td>
45
+ <td class="border-e">
46
+ What was done to address the incident thereafter?
47
+ </td>
48
+ <td class="border-e pa-2">
49
+ {{ authorities?.incidentThereAfter.actionTaken }}
50
+ </td>
51
+ <td class="border-e pa-2">
52
+ {{ authorities?.incidentThereAfter.status }}
53
+ </td>
54
+ <td class="pa-2">
55
+ {{ authorities?.incidentThereAfter.time }}
56
+ </td>
57
+ </tr>
28
58
 
29
- <!-- Input lists -->
30
- <v-col cols="12" class="pb-3 mb-5 mt-1">
31
- <v-row no-gutters>
32
- <v-col cols="12" class="px-1 mb-7">
33
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
34
- What was done to address the incident thereafter?
35
- </p>
36
- <p class="mt-2 text-h6 text-capitalize">
37
- {{ authorities?.incidentThereAfter }}
38
- </p>
39
- </v-col>
40
-
41
- <v-col cols="12" class="px-1 mb-7">
42
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
43
- Were the management notified and who was notified?
44
- </p>
45
- <v-row no-gutters>
46
- <v-col cols="12" sm="6" class="px-1">
47
- <InputLabel class="text-capitalize" title="Action Taken" />
48
- <p class="mt-2 text-h6 text-capitalize">
49
- {{ authorities?.managementNotified?.actionTaken }}
50
- </p>
51
- </v-col>
52
- <v-col cols="12" sm="6" class="px-1">
53
- <InputLabel
54
- class="text-capitalize"
55
- title="Management Notified Time"
56
- />
57
- <p class="mt-2 text-h6 text-capitalize">
58
- {{ authorities?.managementNotified?.time }}
59
- </p>
60
- </v-col>
61
- </v-row>
62
- </v-col>
63
-
64
- <v-col cols="12" class="px-1 mb-7">
65
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
66
- How the incident resolved?
67
- </p>
68
- <p class="mt-2 text-h6 text-capitalize">
69
- {{ authorities?.incidentResolved }}
70
- </p>
71
- </v-col>
72
-
73
- <v-col cols="12" class="px-1 mb-7">
74
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
75
- What was the cause of the incident?
76
- </p>
77
- <p class="mt-2 text-h6 text-capitalize">
78
- {{ authorities?.causeOfIncident }}
79
- </p>
80
- </v-col>
81
-
82
- <v-col cols="12" class="px-1 mb-6">
83
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
84
- Any system used to verify incident?
85
- </p>
86
- <p class="mt-2 text-h6 text-capitalize">
87
- {{ authorities?.systemUsed }}
88
- </p>
89
- </v-col>
90
-
91
- <v-col cols="12" class="px-1 mb-6">
92
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
93
- Any cctv records or picture taken?
94
- </p>
95
- <p class="mt-2 text-h6 text-capitalize">
96
- {{ authorities?.cctvRecord }}
97
- </p>
98
- </v-col>
99
-
100
- <v-col cols="12" class="px-1 mb-6">
101
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
102
- Particulars of tenant/Owner (if any)
103
- </p>
104
- <p class="mt-2 text-h6 text-capitalize">
105
- {{ authorities?.particularsOwner }}
106
- </p>
107
- </v-col>
108
-
109
- <v-col cols="12" class="px-1 mb-6">
110
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
111
- When was the incident resolved?
112
- </p>
113
- <v-row no-gutters>
114
- <v-col cols="12" sm="6" class="px-1">
115
- <InputLabel class="text-capitalize" title="Action Taken" />
116
- <p class="mt-2 text-h6 text-capitalize">
117
- {{ authorities?.whenIncidentResolve?.actionTaken }}
118
- </p>
119
- </v-col>
120
- <v-col cols="12" sm="6" class="px-1">
121
- <InputLabel
122
- class="text-capitalize"
123
- title="Incident Resolve Time"
124
- />
125
- <p class="mt-2 text-h6 text-capitalize">
126
- {{ authorities?.whenIncidentResolve?.time }}
127
- </p>
128
- </v-col>
129
- </v-row>
130
- </v-col>
131
-
132
- <v-col cols="12" class="px-1 mb-6">
133
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
134
- Name of shift in charge?
135
- </p>
136
- <v-row no-gutters>
137
- <v-col cols="12" sm="6" class="px-1">
138
- <InputLabel class="text-capitalize" title="Person in Charge" />
139
- <p class="mt-2 text-h6 text-capitalize">
140
- {{ authorities?.nameOfShiftIncharge?.personInCharge }}
141
- </p>
142
- </v-col>
143
- <v-col cols="12" sm="6" class="px-1">
144
- <InputLabel class="text-capitalize" title="Action Taken" />
145
- <p class="mt-2 text-h6 text-capitalize">
146
- {{ authorities?.nameOfShiftIncharge?.actionTaken }}
147
- </p>
148
- </v-col>
149
- </v-row>
150
- </v-col>
151
-
152
- <v-col cols="12" class="px-1 mb-6">
153
- <p class="mb-2" style="font-size: 17px; font-weight: 600"></p>
154
- <v-row no-gutters>
155
- <v-col cols="12" sm="6" class="px-1">
156
- <InputLabel class="text-capitalize" title="Shift Start" />
157
- <p class="mt-2 text-h6 text-capitalize">
158
- {{ authorities?.nameOfShiftIncharge?.shiftStart }}
159
- </p>
160
- </v-col>
161
- <v-col cols="12" sm="6" class="px-1">
162
- <InputLabel class="text-capitalize" title="Shift End" />
163
- <p class="mt-2 text-h6 text-capitalize">
164
- {{ authorities?.nameOfShiftIncharge?.shiftEnd }}
165
- </p>
166
- </v-col>
167
- </v-row>
168
- </v-col>
169
-
170
- <v-col cols="12" class="px-1">
171
- <p class="mb-2" style="font-size: 17px; font-weight: 600">
172
- Any security implication due to the incident?
173
- </p>
174
- <p class="mt-2 text-h6 text-capitalize">
175
- {{ authorities?.securityImplication }}
176
- </p>
177
- </v-col>
178
- </v-row>
179
- </v-col>
59
+ <!-- 2 -->
60
+ <tr>
61
+ <td class="border-e">2.</td>
62
+ <td class="border-e">
63
+ Were the management notified and who was notified?
64
+ </td>
65
+ <td class="border-e pa-2">
66
+ {{ authorities?.managementNotified.actionTaken }}
67
+ </td>
68
+ <td class="border-e pa-2">
69
+ {{ authorities?.managementNotified.status }}
70
+ </td>
71
+ <td class="pa-2">
72
+ {{ authorities?.managementNotified.time }}
73
+ </td>
74
+ </tr>
75
+
76
+ <!-- 3 -->
77
+ <tr>
78
+ <td class="border-e">3.</td>
79
+ <td class="border-e">How was the incident resolved?</td>
80
+ <td class="border-e pa-2">
81
+ {{ authorities?.incidentResolved.actionTaken }}
82
+ </td>
83
+ <td class="border-e pa-2">
84
+ {{ authorities?.incidentResolved.status }}
85
+ </td>
86
+ <td class="pa-2">
87
+ {{ formatDate(authorities?.incidentResolved.time) }}
88
+ </td>
89
+ </tr>
90
+
91
+ <!-- 4 -->
92
+ <tr>
93
+ <td class="border-e">4.</td>
94
+ <td class="border-e">What was the cause of the incident?</td>
95
+ <td class="border-e pa-2">
96
+ {{ authorities?.causeOfIncident.actionTaken }}
97
+ </td>
98
+ <td class="border-e pa-2">
99
+ {{ authorities?.causeOfIncident.status }}
100
+ </td>
101
+ <td class="pa-2">
102
+ {{ authorities?.causeOfIncident.time }}
103
+ </td>
104
+ </tr>
105
+
106
+ <!-- 5 -->
107
+ <tr>
108
+ <td class="border-e">5.</td>
109
+ <td class="border-e">Any systems used to verify the incident?</td>
110
+ <td class="border-e pa-2">
111
+ {{ authorities?.systemUsed.actionTaken }}
112
+ </td>
113
+ <td class="border-e pa-2">
114
+ {{ authorities?.systemUsed.status }}
115
+ </td>
116
+ <td class="pa-2">
117
+ {{ formatDate(authorities?.systemUsed.time) }}
118
+ </td>
119
+ </tr>
120
+
121
+ <!-- 6 -->
122
+ <tr>
123
+ <td class="border-e">6.</td>
124
+ <td class="border-e">Any CCTV records or pictures taken?</td>
125
+ <td class="border-e pa-2">
126
+ {{ authorities?.cctvRecord.actionTaken }}
127
+ </td>
128
+ <td class="border-e pa-2">
129
+ {{ authorities?.cctvRecord.status }}
130
+ </td>
131
+ <td class="pa-2">
132
+ {{ formatDate(authorities?.cctvRecord.time) }}
133
+ </td>
134
+ </tr>
135
+
136
+ <!-- 7 -->
137
+ <tr>
138
+ <td class="border-e">7.</td>
139
+ <td class="border-e">Particulars of tenant / owner (if any)</td>
140
+ <td class="border-e pa-2">
141
+ {{ authorities?.particularsOwner.actionTaken }}
142
+ </td>
143
+ <td class="border-e pa-2">
144
+ {{ authorities?.particularsOwner.status }}
145
+ </td>
146
+ <td class="pa-2">
147
+ {{ authorities?.particularsOwner.time }}
148
+ </td>
149
+ </tr>
150
+
151
+ <!-- 8 -->
152
+ <tr>
153
+ <td class="border-e">8.</td>
154
+ <td class="border-e">When was the incident resolved?</td>
155
+ <td class="border-e pa-2">
156
+ {{ authorities?.whenIncidentResolve.actionTaken }}
157
+ </td>
158
+ <td class="border-e pa-2">
159
+ {{ authorities?.whenIncidentResolve.status }}
160
+ </td>
161
+ <td class="pa-2">
162
+ {{ authorities?.whenIncidentResolve.time }}
163
+ </td>
164
+ </tr>
165
+
166
+ <!-- 9 -->
167
+ <tr>
168
+ <td class="border-e">9.</td>
169
+ <td class="border-e">Name of Shift In charge</td>
170
+ <td class="border-e pa-2">
171
+ {{ authorities?.nameOfShiftIncharge.actionTaken }}
172
+ </td>
173
+ <td class="border-e pa-2">
174
+ {{ authorities?.nameOfShiftIncharge.status }}
175
+ </td>
176
+ <td class="pa-2">
177
+ {{ authorities?.nameOfShiftIncharge.time }}
178
+ </td>
179
+ </tr>
180
+
181
+ <!-- 10 -->
182
+ <tr>
183
+ <td class="border-e">10.</td>
184
+ <td class="border-e">
185
+ Any security implication due to the incident?
186
+ </td>
187
+ <td class="border-e pa-2">
188
+ {{ authorities?.securityImplication.actionTaken }}
189
+ </td>
190
+ <td class="border-e pa-2">
191
+ {{ authorities?.securityImplication.status }}
192
+ </td>
193
+ <td class="pa-2">
194
+ {{ formatDate(authorities?.securityImplication.time) }}
195
+ </td>
196
+ </tr>
197
+ </tbody>
198
+ </v-table>
199
+ </div>
180
200
  </v-row>
181
201
  </template>
182
202
 
@@ -223,4 +243,22 @@ const authoritiesTableHeader = [
223
243
  value: "description",
224
244
  },
225
245
  ];
246
+
247
+ const concernHeader = [
248
+ "S/No",
249
+ "Areas of Concern",
250
+ "Actions Taken",
251
+ "Status",
252
+ "Time",
253
+ ];
254
+
255
+ const formatDate = (date: Date | string | null) => {
256
+ if (!date) return "";
257
+
258
+ const d = typeof date === "string" ? new Date(date) : date;
259
+
260
+ if (isNaN(d.getTime())) return ""; // safeguard for invalid date
261
+
262
+ return new Intl.DateTimeFormat("en-GB").format(d);
263
+ };
226
264
  </script>
@@ -89,6 +89,19 @@
89
89
  </v-row>
90
90
  </v-col>
91
91
  </v-row>
92
+ <v-row no-gutters class="mt-5">
93
+ <v-col cols="12" sm="3" md="3">
94
+ <InputLabel
95
+ class="text-capitalize"
96
+ title="Time of Response (1st Contact)"
97
+ />
98
+ <p class="my-1 text-h6">
99
+ {{
100
+ incidentInformation?.incidentTypeAndTime?.timeOfResponse || "NA"
101
+ }}
102
+ </p>
103
+ </v-col>
104
+ </v-row>
92
105
  </v-col>
93
106
 
94
107
  <!-- Response/Submission From (1st Contact) -->
@@ -103,15 +116,6 @@
103
116
  {{ incidentInformation?.submissionForm?.time || "NA" }}
104
117
  </p>
105
118
  </v-col>
106
- <v-col cols="12" sm="4" md="3">
107
- <InputLabel
108
- class="text-capitalize"
109
- title="Time of Report Submission"
110
- />
111
- <p class="my-1 text-h6">
112
- {{ incidentInformation?.submissionForm?.timeOfResponse || "NA" }}
113
- </p>
114
- </v-col>
115
119
  <v-col cols="12" sm="4" md="3">
116
120
  <InputLabel class="text-capitalize" title="Date" />
117
121
  <p class="my-1 text-h6">
@@ -140,7 +144,7 @@
140
144
  <div>
141
145
  <InputLabel class="text-capitalize mr-1" title="NRIC/WP Number" />
142
146
  <v-icon
143
- v-if="incidentInformation?.complaintInfo?.nric"
147
+ v-if="incidentInformation?.complaintInfo?.nric"
144
148
  size="small"
145
149
  color="blue"
146
150
  class="cursor-pointer"
@@ -0,0 +1,212 @@
1
+ <template>
2
+ <v-row no-gutters class="px-5 pt-4">
3
+ <!-- Site Information -->
4
+ <p
5
+ class="text-uppercase text-center w-100 text-h6"
6
+ style="background: #aa212a; color: #fff; padding: 10px"
7
+ >
8
+ Incident Report
9
+ </p>
10
+ <v-row no-gutters class="mt-5 border pb-5">
11
+ <p
12
+ class="w-100 text-h6 pa-2 text-white text-center"
13
+ style="background: #fcbf49"
14
+ >
15
+ Incident Information
16
+ </p>
17
+
18
+ <v-col cols="6" class="pa-3 border-b border-e">
19
+ <p class="font-weight-bold">Site</p>
20
+ <p>{{ siteName || "-" }}</p>
21
+ </v-col>
22
+ <v-col cols="6" class="pa-3 border-b">
23
+ <p class="font-weight-bold">Reference</p>
24
+ <p>{{ incidentInformation?.siteInfo?.irNumber || "-" }}</p>
25
+ </v-col>
26
+
27
+ <v-col cols="6" class="pa-3 border-b border-e">
28
+ <p class="font-weight-bold">Place of Incident</p>
29
+ <p>
30
+ {{ incidentInformation?.placeOfIncident?.incidentLocation || "-" }}
31
+ </p>
32
+ </v-col>
33
+ <v-col cols="6" class="pa-3 border-b">
34
+ <p class="font-weight-bold">Type of Incident</p>
35
+ <p>
36
+ {{ incidentInformation?.incidentTypeAndTime?.typeOfIncident || "-" }}
37
+ </p>
38
+ </v-col>
39
+
40
+ <v-col cols="6" class="pa-3 border-b border-e">
41
+ <p class="font-weight-bold">Date of Incident</p>
42
+ <p>
43
+ {{
44
+ toLocalDate(
45
+ incidentInformation?.incidentTypeAndTime?.dateOfIncident
46
+ ) || "NA"
47
+ }}
48
+ </p>
49
+ </v-col>
50
+ <v-col cols="6" class="pa-3 border-b">
51
+ <p class="font-weight-bold">Incident Start Time</p>
52
+ <p>
53
+ {{ incidentInformation?.incidentTypeAndTime?.incidentStart || "-" }}
54
+ </p>
55
+ </v-col>
56
+
57
+ <v-col cols="6" class="pa-3 border-b border-e">
58
+ <p class="font-weight-bold">Time of Response (From 1st Contact)</p>
59
+ <p>
60
+ {{ incidentInformation?.incidentTypeAndTime?.timeOfResponse || "-" }}
61
+ </p>
62
+ </v-col>
63
+ <v-col cols="6" class="pa-3 border-b">
64
+ <p class="font-weight-bold">Incident End Time</p>
65
+ <p>
66
+ {{ incidentInformation?.incidentTypeAndTime?.incidentEnd || "-" }}
67
+ </p>
68
+ </v-col>
69
+
70
+ <v-col cols="6" class="pa-3 border-b border-e">
71
+ <p class="font-weight-bold">Date of Report Submission</p>
72
+ {{
73
+ toLocalDate(incidentInformation?.submissionForm?.dateOfReport) || "NA"
74
+ }}
75
+ </v-col>
76
+ <v-col cols="6" class="pa-3 border-b">
77
+ <p class="font-weight-bold">Time of Report Submission</p>
78
+ <p>{{ incidentInformation?.submissionForm?.time || "-" }}</p>
79
+ </v-col>
80
+
81
+ <v-col cols="6" class="pa-3 border-b border-e">
82
+ <p class="font-weight-bold">Report Submitted By</p>
83
+ <p>{{ incidentInformation?.siteInfo?.submittedBy || "-" }}</p>
84
+ </v-col>
85
+ <v-col cols="6" class="pa-3 border-b">
86
+ <p class="font-weight-bold">Designation</p>
87
+ <p>{{ incidentInformation?.siteInfo?.designation || "-" }}</p>
88
+ </v-col>
89
+
90
+ <v-col cols="4" class="pa-3 border-b border-e">
91
+ <p class="font-weight-bold">Name of Informant/Complainant</p>
92
+ <p>{{ incidentInformation?.complaintInfo?.complainant || "-" }}</p>
93
+ </v-col>
94
+ <v-col cols="4" class="pa-3 border-b border-e">
95
+ <p class="font-weight-bold">Contact No.</p>
96
+ <p>{{ incidentInformation?.complaintInfo?.contact || "-" }}</p>
97
+ </v-col>
98
+ <v-col cols="4" class="pa-3 border-b">
99
+ <p class="font-weight-bold">NRIC/WP No.</p>
100
+ <p>
101
+ <v-icon
102
+ v-if="incidentInformation?.complaintInfo?.nric"
103
+ size="small"
104
+ color="blue"
105
+ class="cursor-pointer"
106
+ @click="showNRICComplainant = !showNRICComplainant"
107
+ >
108
+ {{ showNRICComplainant ? "mdi-eye-off" : "mdi-eye" }}
109
+ </v-icon>
110
+ </p>
111
+ </v-col>
112
+
113
+ <v-col cols="4" class="pa-3 border-b border-e">
114
+ <p class="font-weight-bold">
115
+ Name of Recipient of Complaint (1st Contact)
116
+ </p>
117
+ <p>{{ incidentInformation?.recipientOfComplaint?.recipient || "-" }}</p>
118
+ </v-col>
119
+ <v-col cols="4" class="pa-3 border-b border-e">
120
+ <p class="font-weight-bold">Contact No.</p>
121
+ <p>{{ incidentInformation?.recipientOfComplaint?.contact || "-" }}</p>
122
+ </v-col>
123
+ <v-col cols="4" class="pa-3 border-b">
124
+ <p class="font-weight-bold">NRIC/WP No.</p>
125
+ <p>
126
+ {{
127
+ showNRICRecipient
128
+ ? incidentInformation?.recipientOfComplaint?.nric || "-"
129
+ : maskNRIC(incidentInformation?.recipientOfComplaint?.nric)
130
+ }}
131
+ </p>
132
+ </v-col>
133
+
134
+ <v-col cols="12" class="pa-3 border-b border-e">
135
+ <p class="font-weight-bold">Complaint Received through</p>
136
+ <p
137
+ v-if="
138
+ incidentInformation?.complaintReceivedTo?.receivedVia != 'others'
139
+ "
140
+ >
141
+ {{ incidentInformation?.complaintReceivedTo?.receivedVia || "-" }}
142
+ </p>
143
+
144
+ <p v-else>
145
+ {{
146
+ incidentInformation?.complaintReceivedTo?.otherDescription || "-"
147
+ }}
148
+ </p>
149
+ </v-col>
150
+ <v-col cols="6" class="pa-3">
151
+ <p class="font-weight-bold">Brief Description</p>
152
+ <p>
153
+ {{
154
+ incidentInformation?.complaintReceivedTo?.briefDescription || "-"
155
+ }}
156
+ </p>
157
+ </v-col>
158
+ </v-row>
159
+ </v-row>
160
+ </template>
161
+
162
+ <script lang="ts" setup>
163
+ definePageMeta({
164
+ middleware: ["01-auth", "02-org"],
165
+ memberOnly: true,
166
+ });
167
+
168
+ // props
169
+ const props = defineProps({
170
+ incidentInformation: {
171
+ type: Object as PropType<Record<string, any> | null>,
172
+ required: true,
173
+ },
174
+ });
175
+
176
+ // utilities
177
+ const { getSiteById } = useSiteSettings();
178
+
179
+ // state
180
+ const siteName = ref("");
181
+
182
+ const siteId = computed(() => props.incidentInformation?.siteInfo?.site);
183
+
184
+ const showNRICComplainant = ref(false);
185
+ const showNRICRecipient = ref(false);
186
+
187
+ watch(
188
+ siteId,
189
+ async (newSiteId) => {
190
+ if (!newSiteId) return;
191
+
192
+ const siteDataValue = await getSiteById(newSiteId);
193
+
194
+ siteName.value = siteDataValue?.name ?? "";
195
+ },
196
+ { immediate: true }
197
+ );
198
+
199
+ function toLocalDate(utcString: string) {
200
+ return new Date(utcString).toLocaleString("en-US", {
201
+ year: "numeric",
202
+ month: "2-digit",
203
+ day: "2-digit",
204
+ });
205
+ }
206
+
207
+ const maskNRIC = (value: any) => {
208
+ if (!value) return "NA";
209
+
210
+ return value.replace(/.(?=.{3})/g, "*");
211
+ };
212
+ </script>