@neutron.co.id/operasional-modules 1.12.27 → 1.12.29

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.
@@ -1,3 +1,6 @@
1
1
  import { Resource } from '@neon.id/context';
2
2
  import { type Schema } from '@neutron.co.id/personalia-models';
3
- export declare const SubmissionResource: Resource<Schema.Submission, import("@neon.id/model").Model<"neu:personalia:submission", "type" | "image" | "nameStaff" | "status" | "title" | "branches" | "statusStaff" | "agreedStaffs" | "approvedAt" | "brand" | "decideStaffs" | "decidedAt" | "delayAt" | "delayStaffs" | "department" | "detailDecide" | "detailDecideOther" | "detailProcess" | "detailRaise" | "document" | "followUpStaffs" | "hasProcessStaffs" | "hasRaiseStaffs" | "nominal" | "preparedAt" | "processedAt" | "raiseStaffs" | "raisedAt" | "specifications" | "submissionStaffs" | "virtualFollowUpStaffs" | "workingHours" | "yetProcessStaffs" | "yetRaiseStaffs", Schema.Submission>>;
3
+ export declare function renderSubmissionStatus(item: Schema.Submission, staffId?: string): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
+ [key: string]: any;
5
+ }>;
6
+ export declare const SubmissionResource: Resource<Schema.Submission, import("@neon.id/model").Model<"neu:personalia:submission", "type" | "image" | "nameStaff" | "status" | "title" | "branches" | "statusStaff" | "agreedStaffs" | "approvedAt" | "brand" | "deadline" | "decideStaffs" | "decidedAt" | "delayAt" | "delayStaffs" | "department" | "detailDecide" | "detailDecideOther" | "detailProcess" | "detailRaise" | "document" | "followUpStaffs" | "hasProcessStaffs" | "hasRaiseStaffs" | "nominal" | "preparedAt" | "processedAt" | "raiseStaffs" | "raisedAt" | "specifications" | "submissionStaffs" | "virtualFollowUpStaffs" | "workingHours" | "yetProcessStaffs" | "yetRaiseStaffs", Schema.Submission>>;
@@ -2,6 +2,8 @@ import { Resource } from "@neon.id/context";
2
2
  import {
3
3
  SubmissionModel
4
4
  } from "@neutron.co.id/personalia-models";
5
+ import { computed, h } from "vue";
6
+ import { NeonLabel } from "@neon.id/interfaces";
5
7
  function formatRupiah(money) {
6
8
  return new Intl.NumberFormat("id-ID", {
7
9
  style: "currency",
@@ -9,6 +11,73 @@ function formatRupiah(money) {
9
11
  minimumFractionDigits: 0
10
12
  }).format(money);
11
13
  }
14
+ function formatStatus(status, yetProcessStaffIds, staffId) {
15
+ const actions = {
16
+ prepared: {
17
+ iconLeft: "pen-line",
18
+ label: "Disiapkan",
19
+ color: "base"
20
+ },
21
+ raised: {
22
+ iconLeft: "arrow-up-from-line",
23
+ label: "Dinaikkan",
24
+ color: "dark"
25
+ },
26
+ processed: {
27
+ iconLeft: "spinner",
28
+ label: "Diproses",
29
+ color: "warning"
30
+ },
31
+ waitForAudit: {
32
+ label: "Menunggu Pengawas Lain",
33
+ color: "#57452fff",
34
+ iconLeft: "hourglass"
35
+ },
36
+ delay: {
37
+ iconLeft: "circle-stop",
38
+ label: "Ditunda",
39
+ color: "danger"
40
+ },
41
+ approved: {
42
+ iconLeft: "list-check",
43
+ label: "Disetujui",
44
+ color: "success"
45
+ },
46
+ monitored: {
47
+ iconLeft: "binoculars",
48
+ label: "Dipantau",
49
+ color: "info"
50
+ },
51
+ discontinued: {
52
+ iconLeft: "ban",
53
+ label: "Dihentikan",
54
+ color: "danger"
55
+ },
56
+ resolved: {
57
+ iconLeft: "file-check",
58
+ label: "Diselesaikan",
59
+ color: "success"
60
+ }
61
+ };
62
+ let customStatus = status;
63
+ if (status === "waitForAudit" && yetProcessStaffIds.includes(staffId)) {
64
+ customStatus = "raised";
65
+ }
66
+ const action = computed(() => actions[customStatus]);
67
+ return h(NeonLabel, {
68
+ icon: action.value?.iconLeft,
69
+ text: action.value?.label,
70
+ size: "md",
71
+ color: action.value?.color
72
+ });
73
+ }
74
+ export function renderSubmissionStatus(item, staffId) {
75
+ return formatStatus(
76
+ item?.status || "",
77
+ item.yetProcessStaffIds || [],
78
+ staffId || ""
79
+ );
80
+ }
12
81
  export const SubmissionResource = Resource.define({
13
82
  model: SubmissionModel,
14
83
  collection: {
@@ -89,6 +158,7 @@ export const SubmissionResource = Resource.define({
89
158
  },
90
159
  fragments: SubmissionModel.fragments,
91
160
  renders: {
92
- nominal: (item) => `${item.nominal ? formatRupiah(item.nominal) : "-"}`
161
+ nominal: (item) => item.nominal ? formatRupiah(item.nominal) : "-"
162
+ // status: item => renderSubmissionStatus(item),
93
163
  }
94
164
  });
@@ -1,12 +1,12 @@
1
1
  import { useSingle } from "@neon.id/context";
2
- import { NeonButton, NeonLabel } from "@neon.id/interfaces";
2
+ import { NeonLabel } from "@neon.id/interfaces";
3
3
  import { ResourceUtil } from "@neon.id/office";
4
4
  import { Query } from "@neon.id/query";
5
5
  import {
6
- useOperasional,
7
6
  useOperasionalStore
8
7
  } from "@neutron.co.id/operasional-interfaces/office";
9
- import { computed, h } from "vue";
8
+ import { computed, h, resolveComponent } from "vue";
9
+ import { renderSubmissionStatus } from "./submission.resource.mjs";
10
10
  export const SubmissionCollectionView = ResourceUtil.createCollection({
11
11
  name: "default",
12
12
  definition: "neu:personalia:submission",
@@ -44,6 +44,7 @@ export const SubmissionCollectionStaffView = ResourceUtil.createCollection({
44
44
  "type",
45
45
  // 'specifications',
46
46
  "title",
47
+ "deadline",
47
48
  "raisedAt",
48
49
  "branches",
49
50
  "submissionStaffs",
@@ -63,10 +64,12 @@ export const SubmissionCollectionStaffView = ResourceUtil.createCollection({
63
64
  "submissionStaffs",
64
65
  "raiseStaffs",
65
66
  "decideStaffs",
66
- "followUpStaffs"
67
+ "followUpStaffs",
68
+ "deadline"
67
69
  ],
68
70
  sorts: [
69
71
  "type",
72
+ "deadline",
70
73
  "preparedAt",
71
74
  "raisedAt",
72
75
  "processedAt",
@@ -84,7 +87,7 @@ export const SubmissionCollectionStaffView = ResourceUtil.createCollection({
84
87
  value: staff?.id
85
88
  }
86
89
  ],
87
- sort: [{ handle: "createdAt", direction: "descending" }]
90
+ sort: [{ handle: "preparedAt", direction: "descending" }]
88
91
  });
89
92
  }
90
93
  });
@@ -117,6 +120,7 @@ export const SubmissionCollectionFollowUpView = ResourceUtil.createCollection({
117
120
  "type",
118
121
  // 'specifications',
119
122
  "title",
123
+ "deadline",
120
124
  "updatedAt",
121
125
  "branches",
122
126
  "submissionStaffs",
@@ -136,9 +140,10 @@ export const SubmissionCollectionFollowUpView = ResourceUtil.createCollection({
136
140
  "submissionStaffs",
137
141
  "raiseStaffs",
138
142
  "decideStaffs",
139
- "followUpStaffs"
143
+ "followUpStaffs",
144
+ "deadline"
140
145
  ],
141
- sorts: ["type", "updatedAt", "createdAt", "updater"],
146
+ sorts: ["type", "deadline", "updatedAt", "createdAt", "updater"],
142
147
  query: () => {
143
148
  const state = useOperasionalStore();
144
149
  const { staff } = state.getAllStoreValue();
@@ -189,6 +194,7 @@ export const SubmissionCollectionAuditView = ResourceUtil.createCollection({
189
194
  "type",
190
195
  // 'specifications',
191
196
  "title",
197
+ "deadline",
192
198
  "raisedAt",
193
199
  "branches",
194
200
  "submissionStaffs",
@@ -198,6 +204,12 @@ export const SubmissionCollectionAuditView = ResourceUtil.createCollection({
198
204
  "nominal"
199
205
  // 'areas',
200
206
  ],
207
+ renders: {
208
+ status: (item) => {
209
+ const { staff } = useOperasionalStore().getAllStoreValue();
210
+ return renderSubmissionStatus(item, staff?.id);
211
+ }
212
+ },
201
213
  filters: [
202
214
  "status",
203
215
  "department",
@@ -208,11 +220,13 @@ export const SubmissionCollectionAuditView = ResourceUtil.createCollection({
208
220
  "submissionStaffs",
209
221
  "raiseStaffs",
210
222
  "decideStaffs",
211
- "followUpStaffs"
223
+ "followUpStaffs",
224
+ "deadline"
212
225
  ],
213
226
  sorts: [
214
227
  "type",
215
228
  "preparedAt",
229
+ "deadline",
216
230
  "raisedAt",
217
231
  "processedAt",
218
232
  "createdAt",
@@ -229,7 +243,7 @@ export const SubmissionCollectionAuditView = ResourceUtil.createCollection({
229
243
  value: staff?.id
230
244
  }
231
245
  ],
232
- sort: [{ handle: "createdAt", direction: "descending" }]
246
+ sort: [{ handle: "raisedAt", direction: "descending" }]
233
247
  });
234
248
  }
235
249
  });
@@ -239,9 +253,7 @@ export const SubmissionSingleAuditView = ResourceUtil.createSingle({
239
253
  title: "Pengajuan",
240
254
  slots: {
241
255
  default: "audit",
242
- actions: {
243
- setup: getLabel
244
- }
256
+ actions: () => h(resolveComponent("SubmissionAction"))
245
257
  },
246
258
  path: "/pengajuan/audit-submission"
247
259
  });
@@ -398,9 +410,7 @@ export const SubmissionSingleWaitingDecisionView = ResourceUtil.createSingle({
398
410
  title: "Menunggu Keputusan",
399
411
  slots: {
400
412
  default: "waiting-decision",
401
- actions: {
402
- setup: getLabel
403
- }
413
+ actions: () => h(resolveComponent("SubmissionAction"))
404
414
  },
405
415
  path: "/pengajuan/waiting-decision-submission"
406
416
  });
@@ -465,9 +475,7 @@ export const SubmissionSingleForDecisionView = ResourceUtil.createSingle({
465
475
  title: "Pengajuan",
466
476
  slots: {
467
477
  default: "for-decision",
468
- actions: {
469
- setup: getForDecisionActions
470
- }
478
+ actions: () => h(resolveComponent("SubmissionActionDecision"))
471
479
  },
472
480
  path: "/pengajuan/for-decision-submission"
473
481
  });
@@ -607,65 +615,6 @@ function getLabel() {
607
615
  ]);
608
616
  };
609
617
  }
610
- function getForDecisionActions() {
611
- const { isNew, isChanged, values, isLoading, id, executeOne, syncOne } = useSingle();
612
- const { staff } = useOperasional();
613
- const isDelayDisabled = computed(() => {
614
- return isNew.value || isChanged.value || values.value.status === "prepared" || values.value.status === "raised" || (values.value.delayStaffIds?.includes(staff.value?.id || "") ?? false);
615
- });
616
- const isApproveDisabled = computed(() => {
617
- return isNew.value || isChanged.value || values.value.status === "prepared" || values.value.status === "raised" || (values.value.agreedStaffIds?.includes(staff.value?.id || "") ?? false);
618
- });
619
- const goBack = () => {
620
- window.location.reload();
621
- };
622
- const syncDelay = async () => {
623
- await executeOne("delaySubmission", {
624
- submissionId: id.value,
625
- staffId: staff.value?.id
626
- });
627
- await syncOne();
628
- goBack();
629
- };
630
- const syncApproved = async () => {
631
- await executeOne("approvedSubmission", {
632
- submissionId: id.value,
633
- staffId: staff.value?.id
634
- });
635
- await syncOne();
636
- goBack();
637
- };
638
- return () => {
639
- if (isNew.value)
640
- return null;
641
- return h("div", { class: "flex gap-2 px-1 pt-0.5 pb-1" }, [
642
- h(
643
- NeonButton,
644
- {
645
- size: "xs",
646
- color: "success",
647
- iconLeft: "list-check",
648
- isDisabled: isApproveDisabled.value,
649
- isLoading: isLoading.value,
650
- onClick: syncApproved
651
- },
652
- () => "Disetujui"
653
- ),
654
- h(
655
- NeonButton,
656
- {
657
- size: "xs",
658
- color: "danger",
659
- iconLeft: "circle-stop",
660
- isDisabled: isDelayDisabled.value,
661
- isLoading: isLoading.value,
662
- onClick: syncDelay
663
- },
664
- () => "Ditunda"
665
- )
666
- ]);
667
- };
668
- }
669
618
  function getLabelStaff() {
670
619
  const { isNew, values, isLoading } = useSingle();
671
620
  const actions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neutron.co.id/operasional-modules",
3
- "version": "1.12.27",
3
+ "version": "1.12.29",
4
4
  "description": "Modules of Neutron Operasional.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "contributors": [
@@ -48,13 +48,13 @@
48
48
  "@neon.id/interfaces": "^1.57.0",
49
49
  "@neon.id/office": "1.46.0",
50
50
  "@neon.id/query": "^1.12.0",
51
- "@neutron.co.id/personalia-models": "1.13.23",
51
+ "@neutron.co.id/personalia-models": "1.13.29",
52
52
  "pretty-bytes": "^6.1.1",
53
53
  "vue": "^3.4.31"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@antfu/eslint-config": "2.22.3",
57
- "@neon.id/cli": "0.22.0",
57
+ "@neon.co.id/cli": "0.1.0",
58
58
  "@neon.id/eslint": "0.3.0",
59
59
  "@neon.id/module-builder": "1.8.0",
60
60
  "@neon.id/types": "1.69.0",
@@ -78,12 +78,12 @@
78
78
  "@neon.id/interfaces": "^1.57.0",
79
79
  "@neon.id/office": "1.46.0",
80
80
  "@neon.id/query": "^1.12.0",
81
- "@neutron.co.id/personalia-models": "1.13.23",
81
+ "@neutron.co.id/personalia-models": "1.13.29",
82
82
  "@nuxt/kit": "^3.12.3",
83
83
  "pretty-bytes": "^6.1.1"
84
84
  },
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "build": 125
88
+ "build": 127
89
89
  }