@neutron.co.id/operasional-modules 1.12.28 → 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 function renderSubmissionStatus(item: Schema.Submission, staffId?: string): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}>;
|
|
3
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) =>
|
|
161
|
+
nominal: (item) => item.nominal ? formatRupiah(item.nominal) : "-"
|
|
162
|
+
// status: item => renderSubmissionStatus(item),
|
|
93
163
|
}
|
|
94
164
|
});
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useOperasionalStore
|
|
7
7
|
} from "@neutron.co.id/operasional-interfaces/office";
|
|
8
8
|
import { computed, h, resolveComponent } from "vue";
|
|
9
|
+
import { renderSubmissionStatus } from "./submission.resource.mjs";
|
|
9
10
|
export const SubmissionCollectionView = ResourceUtil.createCollection({
|
|
10
11
|
name: "default",
|
|
11
12
|
definition: "neu:personalia:submission",
|
|
@@ -203,6 +204,12 @@ export const SubmissionCollectionAuditView = ResourceUtil.createCollection({
|
|
|
203
204
|
"nominal"
|
|
204
205
|
// 'areas',
|
|
205
206
|
],
|
|
207
|
+
renders: {
|
|
208
|
+
status: (item) => {
|
|
209
|
+
const { staff } = useOperasionalStore().getAllStoreValue();
|
|
210
|
+
return renderSubmissionStatus(item, staff?.id);
|
|
211
|
+
}
|
|
212
|
+
},
|
|
206
213
|
filters: [
|
|
207
214
|
"status",
|
|
208
215
|
"department",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neutron.co.id/operasional-modules",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.29",
|
|
4
4
|
"description": "Modules of Neutron Operasional.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"contributors": [
|
|
@@ -48,7 +48,7 @@
|
|
|
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.
|
|
51
|
+
"@neutron.co.id/personalia-models": "1.13.29",
|
|
52
52
|
"pretty-bytes": "^6.1.1",
|
|
53
53
|
"vue": "^3.4.31"
|
|
54
54
|
},
|
|
@@ -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.
|
|
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":
|
|
88
|
+
"build": 127
|
|
89
89
|
}
|