@neutron.co.id/operasional-interfaces 1.14.1 → 1.14.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@office/common/providers/operasional/operasional.store.mjs +19 -2
- package/build/@office/config.mjs +1 -1
- package/build/@office/models/personalia/attendance/AttendanceCollection/AttendanceCollection.vue +7 -15
- package/build/@office/models/personalia/attendance/AttendanceStaff.vue +93 -7
- package/build/@office/models/personalia/attendance/AttendanceSupervisor.vue +81 -6
- package/build/@office/models/personalia/progressAccess/ProgressAccessSupervisor.vue +2 -10
- package/build/mock/index.cjs +193 -34
- package/build/mock/index.mjs +195 -36
- package/build/mock/style.css +3 -3
- package/build/module.json +1 -1
- package/build/nuxt.json +1 -1
- package/build/nuxt.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { defineStore } from "pinia";
|
|
2
|
-
import { ref } from "vue";
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
3
|
export const useOperasionalStore = defineStore("neu:operasional", () => {
|
|
4
4
|
const isLoading = ref(false);
|
|
5
5
|
const staff = ref(null);
|
|
6
6
|
const accesses = ref([]);
|
|
7
|
+
const supervisedStaffIds = computed(() => {
|
|
8
|
+
if (Array.isArray(accesses.value)) {
|
|
9
|
+
return accesses.value.reduce(
|
|
10
|
+
(ids, access) => {
|
|
11
|
+
return ids.concat(access.supervisedStaffIds || []);
|
|
12
|
+
},
|
|
13
|
+
[]
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
return [];
|
|
17
|
+
});
|
|
7
18
|
return {
|
|
8
19
|
isLoading,
|
|
9
20
|
staff,
|
|
10
21
|
accesses,
|
|
22
|
+
supervisedStaffIds,
|
|
11
23
|
setStaff,
|
|
12
24
|
getStaff,
|
|
13
25
|
getAllStoreValue
|
|
@@ -18,9 +30,14 @@ export const useOperasionalStore = defineStore("neu:operasional", () => {
|
|
|
18
30
|
function getStaff() {
|
|
19
31
|
return staff.value;
|
|
20
32
|
}
|
|
33
|
+
function getAccesses() {
|
|
34
|
+
return accesses.value;
|
|
35
|
+
}
|
|
21
36
|
function getAllStoreValue() {
|
|
22
37
|
return {
|
|
23
|
-
staff: getStaff()
|
|
38
|
+
staff: getStaff(),
|
|
39
|
+
supervisedStaffIds: getAccesses(),
|
|
40
|
+
accesses: getAccesses()
|
|
24
41
|
};
|
|
25
42
|
}
|
|
26
43
|
});
|
package/build/@office/config.mjs
CHANGED
|
@@ -38,7 +38,7 @@ export const config = OfficeInterfaces.define({
|
|
|
38
38
|
// Progress Access
|
|
39
39
|
"ProgressAccessCollection",
|
|
40
40
|
"ProgressAccessSingle",
|
|
41
|
-
"
|
|
41
|
+
"ProgressAccessSupervisor",
|
|
42
42
|
// Responsibility
|
|
43
43
|
"ResponsibilityCollection",
|
|
44
44
|
"ResponsibilitySingle",
|
package/build/@office/models/personalia/attendance/AttendanceCollection/AttendanceCollection.vue
CHANGED
|
@@ -43,21 +43,13 @@ function transformItem(item: any) {
|
|
|
43
43
|
return {
|
|
44
44
|
...item,
|
|
45
45
|
eventColor:
|
|
46
|
-
item.
|
|
47
|
-
? '
|
|
48
|
-
: item.
|
|
49
|
-
? '
|
|
50
|
-
: item.
|
|
51
|
-
? '
|
|
52
|
-
:
|
|
53
|
-
? '#DEECDC'
|
|
54
|
-
: item.type === 'homeEarly'
|
|
55
|
-
? '#EEF2FF'
|
|
56
|
-
: item.type === 'comeLate'
|
|
57
|
-
? '#F1F5FF'
|
|
58
|
-
: item.type === 'homeEarly'
|
|
59
|
-
? '#FDF2F8'
|
|
60
|
-
: 'base',
|
|
46
|
+
item.status === 'rejected'
|
|
47
|
+
? 'danger'
|
|
48
|
+
: item.status === 'notApproved'
|
|
49
|
+
? 'warning'
|
|
50
|
+
: item.status === 'approved'
|
|
51
|
+
? 'success'
|
|
52
|
+
: 'base',
|
|
61
53
|
}
|
|
62
54
|
}
|
|
63
55
|
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { NeonSingle, useSingle } from '@neon.id/context'
|
|
2
|
+
import { GraphUtil, NeonSingle, useSingle } from '@neon.id/context'
|
|
3
3
|
import { NeonField, NeonForm } from '@neon.id/form'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
NeonAlert,
|
|
6
|
+
NeonButton,
|
|
7
|
+
NeonDivider,
|
|
8
|
+
useToastStore,
|
|
9
|
+
} from '@neon.id/interfaces'
|
|
5
10
|
import { OfficeRelation, OfficeTab, OfficeTabs } from '@neon.id/office'
|
|
6
11
|
import { Query } from '@neon.id/query'
|
|
7
12
|
import { computed, ref, watch } from 'vue'
|
|
8
13
|
import { PromiseUtil } from '@neon.id/utils/promise'
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
import {
|
|
15
|
+
AttendanceModel,
|
|
16
|
+
type TPersonaliaAttendanceModel,
|
|
17
|
+
type Schema,
|
|
12
18
|
} from '@neutron.co.id/personalia-models'
|
|
13
19
|
import { DateUtil } from '../../../common/utils/util.date'
|
|
14
20
|
import { NeonTime, useOperasional } from '../../../common'
|
|
21
|
+
import { useClientHandle } from '@urql/vue'
|
|
15
22
|
|
|
16
23
|
const {
|
|
17
24
|
fields,
|
|
@@ -30,6 +37,9 @@ const {
|
|
|
30
37
|
} = useSingle<Schema.Attendance, TPersonaliaAttendanceModel>()
|
|
31
38
|
|
|
32
39
|
const key = ref(0)
|
|
40
|
+
const responseState = ref()
|
|
41
|
+
const toast = useToastStore()
|
|
42
|
+
|
|
33
43
|
const diff = computed(() => {
|
|
34
44
|
return DateUtil.day(values.value.endedAt).diff(values.value.startedAt)
|
|
35
45
|
})
|
|
@@ -129,6 +139,50 @@ const staffOptions = computed(() => {
|
|
|
129
139
|
],
|
|
130
140
|
}
|
|
131
141
|
})
|
|
142
|
+
|
|
143
|
+
//Generate Attendance
|
|
144
|
+
const { client } = useClientHandle()
|
|
145
|
+
|
|
146
|
+
function getNotified() {
|
|
147
|
+
if (responseState.value === 'attendanceGenerated') {
|
|
148
|
+
toast.push({
|
|
149
|
+
id: 'generate:attendance',
|
|
150
|
+
content: 'Successfully generated attendance.',
|
|
151
|
+
color: 'success',
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
async function generateAttendance() {
|
|
157
|
+
const responseGenerateAttendance = await client
|
|
158
|
+
.mutation(GraphUtil.executeOne(AttendanceModel, {}), {
|
|
159
|
+
action: 'generateAttendance',
|
|
160
|
+
input: {
|
|
161
|
+
attendanceId: values.value.id,
|
|
162
|
+
// Attendance input.
|
|
163
|
+
status: values.value.status,
|
|
164
|
+
submitStaffId: values.value.submitStaffId,
|
|
165
|
+
type: values.value.type,
|
|
166
|
+
decideStaffId: values.value.decideStaffId,
|
|
167
|
+
notes: values.value.notes,
|
|
168
|
+
submittedAt: values.value.submittedAt,
|
|
169
|
+
startedAt: values.value.startedAt,
|
|
170
|
+
endedAt: values.value.endedAt,
|
|
171
|
+
},
|
|
172
|
+
})
|
|
173
|
+
.toPromise()
|
|
174
|
+
|
|
175
|
+
const wrapper = responseGenerateAttendance.data?.executeAttendance
|
|
176
|
+
responseState.value = wrapper?.info?.state
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
console.log('decideStaffId', values.value.decideStaffId)
|
|
180
|
+
|
|
181
|
+
async function generate() {
|
|
182
|
+
await generateAttendance()
|
|
183
|
+
await getNotified()
|
|
184
|
+
await syncOne()
|
|
185
|
+
}
|
|
132
186
|
</script>
|
|
133
187
|
|
|
134
188
|
<template>
|
|
@@ -151,7 +205,6 @@ const staffOptions = computed(() => {
|
|
|
151
205
|
description="Untuk hari ini kamu sudah ada absensi yang diajukan, silahkan cari absensi yang telah diajukan dan ajukan kembali untuk pergantiannya."
|
|
152
206
|
color="#F7CF6D"
|
|
153
207
|
/>
|
|
154
|
-
|
|
155
208
|
<div v-if="!isNew && conflictAtt == false" class="flex flex-wrap">
|
|
156
209
|
<div class="mt-2">
|
|
157
210
|
<NeonField>
|
|
@@ -189,7 +242,6 @@ const staffOptions = computed(() => {
|
|
|
189
242
|
</NeonField>
|
|
190
243
|
</div>
|
|
191
244
|
</div>
|
|
192
|
-
|
|
193
245
|
<OfficeRelation
|
|
194
246
|
v-model="values"
|
|
195
247
|
:field="fields.submitStaff"
|
|
@@ -267,6 +319,40 @@ const staffOptions = computed(() => {
|
|
|
267
319
|
v-bind="fields.submittedAt"
|
|
268
320
|
is-disabled
|
|
269
321
|
/>
|
|
322
|
+
<NeonDivider
|
|
323
|
+
is-dashed
|
|
324
|
+
label="Tanggal ini digunakan hanya untuk Generate Absensi"
|
|
325
|
+
class="divider"
|
|
326
|
+
/>
|
|
327
|
+
<NeonFields md="grid-cols-3">
|
|
328
|
+
<NeonField
|
|
329
|
+
v-model="values.startedAt"
|
|
330
|
+
v-bind="fields.startedAt"
|
|
331
|
+
:is-disabled="
|
|
332
|
+
values.status == 'approved' || values.isGenerate === true
|
|
333
|
+
"
|
|
334
|
+
/>
|
|
335
|
+
<NeonField
|
|
336
|
+
v-model="values.endedAt"
|
|
337
|
+
v-bind="fields.endedAt"
|
|
338
|
+
:is-disabled="
|
|
339
|
+
values.status == 'approved' || values.isGenerate === true
|
|
340
|
+
"
|
|
341
|
+
/>
|
|
342
|
+
<NeonButton
|
|
343
|
+
icon-left="bolt"
|
|
344
|
+
label="Generate"
|
|
345
|
+
color="success"
|
|
346
|
+
class="mt-12"
|
|
347
|
+
size="xs"
|
|
348
|
+
:is-loading="isLoading"
|
|
349
|
+
:is-disabled="
|
|
350
|
+
values.status !== 'approved' || values.isGenerate === true
|
|
351
|
+
"
|
|
352
|
+
is-rounded
|
|
353
|
+
@click="generate"
|
|
354
|
+
/>
|
|
355
|
+
</NeonFields>
|
|
270
356
|
|
|
271
357
|
<!-- EARLY GO HOME -->
|
|
272
358
|
<div
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { NeonSingle, useSingle } from '@neon.id/context'
|
|
2
|
+
import { GraphUtil, NeonSingle, useSingle } from '@neon.id/context'
|
|
3
3
|
import { NeonField, NeonForm } from '@neon.id/form'
|
|
4
|
-
import { NeonButton, NeonDivider } from '@neon.id/interfaces'
|
|
4
|
+
import { NeonButton, NeonDivider, useToastStore } from '@neon.id/interfaces'
|
|
5
5
|
import { OfficeRelation, OfficeTab, OfficeTabs } from '@neon.id/office'
|
|
6
6
|
import { computed, ref, watch } from 'vue'
|
|
7
7
|
import { PromiseUtil } from '@neon.id/utils/promise'
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {
|
|
9
|
+
AttendanceModel,
|
|
10
|
+
type TPersonaliaAttendanceModel,
|
|
11
|
+
type Schema,
|
|
11
12
|
} from '@neutron.co.id/personalia-models'
|
|
12
13
|
import { DateUtil } from '../../../common/utils'
|
|
13
14
|
import { NeonTime, useOperasional } from '../../../common'
|
|
15
|
+
import { useClientHandle } from '@urql/vue'
|
|
14
16
|
|
|
15
17
|
const {
|
|
16
18
|
fields,
|
|
@@ -75,7 +77,8 @@ function onStartedAtUpdate(date: any) {
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
// OTHER
|
|
78
|
-
|
|
80
|
+
const responseState = ref()
|
|
81
|
+
const toast = useToastStore()
|
|
79
82
|
const { staff } = useOperasional()
|
|
80
83
|
const staffId = staff.value?.id || ''
|
|
81
84
|
|
|
@@ -108,6 +111,48 @@ const rejectedAbsensi = async () => {
|
|
|
108
111
|
await executeOne('rejectedAttendance', { attendanceId: id.value })
|
|
109
112
|
await syncOne()
|
|
110
113
|
}
|
|
114
|
+
|
|
115
|
+
//Generate Attendance
|
|
116
|
+
const { client } = useClientHandle()
|
|
117
|
+
|
|
118
|
+
function getNotified() {
|
|
119
|
+
if (responseState.value === 'attendanceGenerated') {
|
|
120
|
+
toast.push({
|
|
121
|
+
id: 'generate:attendance',
|
|
122
|
+
content: 'Successfully generated attendance.',
|
|
123
|
+
color: 'success',
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function generateAttendance() {
|
|
129
|
+
const responseGenerateAttendance = await client
|
|
130
|
+
.mutation(GraphUtil.executeOne(AttendanceModel, {}), {
|
|
131
|
+
action: 'generateAttendance',
|
|
132
|
+
input: {
|
|
133
|
+
attendanceId: values.value.id,
|
|
134
|
+
// Attendance input.
|
|
135
|
+
status: values.value.status,
|
|
136
|
+
submitStaffId: values.value.submitStaffId,
|
|
137
|
+
type: values.value.type,
|
|
138
|
+
decideStaffId: values.value.decideStaffId,
|
|
139
|
+
notes: values.value.notes,
|
|
140
|
+
submittedAt: values.value.submittedAt,
|
|
141
|
+
startedAt: values.value.startedAt,
|
|
142
|
+
endedAt: values.value.endedAt,
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
.toPromise()
|
|
146
|
+
|
|
147
|
+
const wrapper = responseGenerateAttendance.data?.executeAttendance
|
|
148
|
+
responseState.value = wrapper?.info?.state
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function generate() {
|
|
152
|
+
await generateAttendance()
|
|
153
|
+
await getNotified()
|
|
154
|
+
await syncOne()
|
|
155
|
+
}
|
|
111
156
|
</script>
|
|
112
157
|
|
|
113
158
|
<template>
|
|
@@ -242,6 +287,36 @@ const rejectedAbsensi = async () => {
|
|
|
242
287
|
is-disabled
|
|
243
288
|
/>
|
|
244
289
|
|
|
290
|
+
<NeonDivider
|
|
291
|
+
label="Tanggal ini digunakan hanya untuk Generate Absensi"
|
|
292
|
+
class="divider"
|
|
293
|
+
/>
|
|
294
|
+
<NeonFields md="grid-cols-3">
|
|
295
|
+
<NeonField
|
|
296
|
+
v-model="values.startedAt"
|
|
297
|
+
v-bind="fields.startedAt"
|
|
298
|
+
:is-disabled="values.isGenerate === true"
|
|
299
|
+
/>
|
|
300
|
+
<NeonField
|
|
301
|
+
v-model="values.endedAt"
|
|
302
|
+
v-bind="fields.endedAt"
|
|
303
|
+
:is-disabled="values.isGenerate === true"
|
|
304
|
+
/>
|
|
305
|
+
<NeonButton
|
|
306
|
+
icon-left="bolt"
|
|
307
|
+
label="Generate"
|
|
308
|
+
color="success"
|
|
309
|
+
class="mt-12"
|
|
310
|
+
size="xs"
|
|
311
|
+
:is-loading="isLoading"
|
|
312
|
+
:is-disabled="
|
|
313
|
+
values.status !== 'approved' || values.isGenerate === true
|
|
314
|
+
"
|
|
315
|
+
is-rounded
|
|
316
|
+
@click="generate"
|
|
317
|
+
/>
|
|
318
|
+
</NeonFields>
|
|
319
|
+
|
|
245
320
|
<!-- EARLY GO HOME -->
|
|
246
321
|
<div
|
|
247
322
|
v-if="values.type == 'homeEarly'"
|
|
@@ -32,16 +32,8 @@ const {
|
|
|
32
32
|
@cancel="discardChanges"
|
|
33
33
|
@submit="saveOne"
|
|
34
34
|
>
|
|
35
|
-
<OfficeRelation
|
|
36
|
-
|
|
37
|
-
:field="fields.superviseStaff"
|
|
38
|
-
is-disabled
|
|
39
|
-
/>
|
|
40
|
-
<OfficeRelation
|
|
41
|
-
v-model="values"
|
|
42
|
-
:field="fields.supervisedStaffs"
|
|
43
|
-
is-disabled
|
|
44
|
-
/>
|
|
35
|
+
<OfficeRelation v-model="values" :field="fields.superviseStaff" />
|
|
36
|
+
<OfficeRelation v-model="values" :field="fields.supervisedStaffs" />
|
|
45
37
|
</NeonForm>
|
|
46
38
|
</OfficeTab>
|
|
47
39
|
</OfficeTabs>
|