diff --git a/src/api/org/api.org.ts b/src/api/org/api.org.ts index 465982b..ba33d4b 100644 --- a/src/api/org/api.org.ts +++ b/src/api/org/api.org.ts @@ -6,6 +6,8 @@ const profileOrg = `${env.API_URI}/org/profile`; const report = `${env.API_URI}/org`; const workflow = `${env.API_URI}/org/workflow`; export default { + orgCommandCode: `${metadata}commandCode`, + profilePosition: () => `${org}/profile/keycloak/position`, searchCommander: `${org}/profile/search/commander`, diff --git a/src/modules/10_registry/01_Information/05_Educations.vue b/src/modules/10_registry/01_Information/05_Educations.vue index 943a411..435c123 100644 --- a/src/modules/10_registry/01_Information/05_Educations.vue +++ b/src/modules/10_registry/01_Information/05_Educations.vue @@ -42,6 +42,7 @@ const visibleColumns = ref([ "other", "fundName", "isEducation", + "isHigh", "endDate", "startDate", "finishDate", @@ -120,6 +121,20 @@ const columns = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "isHigh", + align: "left", + label: "วุฒิการศึกษาสูงสุด", + sortable: true, + field: "isHigh", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => (v === true ? "ใช่" : v === false ? "ไม่ใช่" : "-"), + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "degree", align: "left", @@ -320,6 +335,20 @@ const columnsHistory = ref([ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, + { + name: "isHigh", + align: "left", + label: "วุฒิการศึกษาสูงสุด", + sortable: true, + field: "isHigh", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => (v === true ? "ใช่" : v === false ? "ไม่ใช่" : "-"), + sort: (a: string, b: string) => + a + .toString() + .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, { name: "degree", align: "left", @@ -455,6 +484,7 @@ const visibleColumnsHistory = ref([ "other", "fundName", "isEducation", + "isHigh", "endDate", "startDate", "finishDate", diff --git a/src/modules/10_registry/01_Information/06_Ability.vue b/src/modules/10_registry/01_Information/06_Ability.vue index 202e37b..806507c 100644 --- a/src/modules/10_registry/01_Information/06_Ability.vue +++ b/src/modules/10_registry/01_Information/06_Ability.vue @@ -238,6 +238,34 @@ function onSearch() { ); } +/** + * ฟังก์ชันโหลไฟลเอกสารหลักฐาน + * @param id รายการที่ต้องการโหลด + */ +async function onDownloadFile(id: string, profileId: string) { + showLoader(); + await http + .get( + config.API.subFileByFileName( + "ทะเบียนประวัติ", + "ประกาศเกียรติคุณ", + profileId, + id, + "เอกสารหลักฐาน" + ) + ) + .then(async (res) => { + const data = res.data; + window.open(data.downloadUrl, "_blank"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + onMounted(async () => { link.value = await dataStore.getProFileType(); await getData(); @@ -316,7 +344,19 @@ onMounted(async () => { {{ col.value ? col.value : "-" }} + + + ดาวน์โหลด + {
- - ประวัติแก้ไขความสามารถพิเศษ - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขความสามารถพิเศษ + +
{{ @@ -385,5 +438,6 @@ onMounted(async () => { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/02_Government/06_Assistance.vue b/src/modules/10_registry/02_Government/06_Assistance.vue index 44b0f48..a87f459 100644 --- a/src/modules/10_registry/02_Government/06_Assistance.vue +++ b/src/modules/10_registry/02_Government/06_Assistance.vue @@ -220,6 +220,34 @@ function getHistory() { }); } +/** + * ฟังก์ชันโหลไฟลเอกสารหลักฐาน + * @param id รายการที่ต้องการโหลด + */ +async function onDownloadFile(id: string, profileId: string) { + showLoader(); + await http + .get( + config.API.subFileByFileName( + "ทะเบียนประวัติ", + "ช่วยราชการ", + profileId, + id, + "เอกสารหลักฐาน" + ) + ) + .then(async (res) => { + const data = res.data; + window.open(data.downloadUrl, "_blank"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -302,6 +330,18 @@ onMounted(async () => {
+ + ดาวน์โหลด + {
- - ประวัติแก้ไขรายการช่วยราชการ - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขรายการช่วยราชการ + +
{{ @@ -369,5 +422,6 @@ onMounted(async () => { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/02_Government/07_Position.vue b/src/modules/10_registry/02_Government/07_Position.vue index 2e62377..a2fc877 100644 --- a/src/modules/10_registry/02_Government/07_Position.vue +++ b/src/modules/10_registry/02_Government/07_Position.vue @@ -1,16 +1,18 @@ diff --git a/src/modules/10_registry/05_Other/03_FileOther.vue b/src/modules/10_registry/05_Other/03_FileOther.vue new file mode 100644 index 0000000..4682422 --- /dev/null +++ b/src/modules/10_registry/05_Other/03_FileOther.vue @@ -0,0 +1,138 @@ + + + + + diff --git a/src/modules/10_registry/interface/response/Main.ts b/src/modules/10_registry/interface/response/Main.ts index 136aded..531e11c 100644 --- a/src/modules/10_registry/interface/response/Main.ts +++ b/src/modules/10_registry/interface/response/Main.ts @@ -11,4 +11,14 @@ interface DataRequest { topic: string; } -export type { DataRequest }; +interface DataCommandCode { + id: string; + createdAt: Date; + lastUpdatedAt: Date; + createdFullName: string; + lastUpdateFullName: string; + name: string; + code: number; +} + +export type { DataRequest, DataCommandCode }; diff --git a/src/modules/10_registry/store/Position.ts b/src/modules/10_registry/store/Position.ts new file mode 100644 index 0000000..7fee4f6 --- /dev/null +++ b/src/modules/10_registry/store/Position.ts @@ -0,0 +1,35 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; +import { useQuasar } from "quasar"; + +import { useCounterMixin } from "@/stores/mixin"; + +import type { DataOption } from "@/modules/10_registry/interface/index/Main"; + +const $q = useQuasar(); +const mixin = useCounterMixin(); +const {} = mixin; + +export const useGovernmentPosDataStore = defineStore("GovernmentPos", () => { + // commandCode ขอตำแหน่ง + const positionCode = ref([ + 0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16, + ]); + + const commandCodeData = ref([]); + + function convertCommandCodeName(val: string) { + return ( + commandCodeData.value.find((e: DataOption) => e.id === val)?.name ?? "-" + ); + } + + return { + // Data + commandCodeData, + positionCode, + + // Function + convertCommandCodeName, + }; +}); diff --git a/src/modules/10_registry/store/registry.ts b/src/modules/10_registry/store/registry.ts index 075e83f..8c7aa40 100644 --- a/src/modules/10_registry/store/registry.ts +++ b/src/modules/10_registry/store/registry.ts @@ -10,6 +10,7 @@ export const useRegistryInFormationStore = defineStore( () => { const typeProfile = ref("OFFICER"); const profileId = ref(""); + const citizenId = ref(""); function typeChangeName(val: string) { switch (val) { @@ -29,6 +30,6 @@ export const useRegistryInFormationStore = defineStore( return "-"; } } - return { typeChangeName, typeProfile, profileId }; + return { typeChangeName, typeProfile, profileId, citizenId }; } ); diff --git a/src/modules/10_registry/tabs/05_other.vue b/src/modules/10_registry/tabs/05_other.vue index 09b87e2..7dde665 100644 --- a/src/modules/10_registry/tabs/05_other.vue +++ b/src/modules/10_registry/tabs/05_other.vue @@ -4,6 +4,7 @@ import { useRouter } from "vue-router"; /** component */ import Other from "@/modules/10_registry/05_Other/01_Other.vue"; import File from "@/modules/10_registry/05_Other/02_File.vue"; +import FileOther from "@/modules/10_registry/05_Other/03_FileOther.vue"; const router = useRouter(); @@ -27,6 +28,7 @@ const router = useRouter();
+