diff --git a/src/modules/10_registry/01_Information/06_Ability.vue b/src/modules/10_registry/01_Information/06_Ability.vue index 806507c..a05e7ca 100644 --- a/src/modules/10_registry/01_Information/06_Ability.vue +++ b/src/modules/10_registry/01_Information/06_Ability.vue @@ -248,7 +248,7 @@ async function onDownloadFile(id: string, profileId: string) { .get( config.API.subFileByFileName( "ทะเบียนประวัติ", - "ประกาศเกียรติคุณ", + "เอกสารความสามารถพิเศษ", profileId, id, "เอกสารหลักฐาน" @@ -328,6 +328,7 @@ onMounted(async () => { {{ col.label }} + @@ -344,7 +345,6 @@ onMounted(async () => { {{ col.value ? col.value : "-" }} - { > ดาวน์โหลด + + + (""); const $q = useQuasar(); const mixin = useCounterMixin(); const dataStore = useDataStore(); +const { getPathUploadFlie } = useRegistryDataStore(); const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } = mixin; @@ -26,6 +28,8 @@ const rowsHistory = ref([]); const rowsHistoryData = ref([]); const mode = ref($q.screen.gt.xs); +const fileGroup = ref("เอกสารวินัย"); + const modalHistory = ref(false); /** ตัวแปรข้อมูล */ @@ -179,6 +183,11 @@ function getHistory() { }); } +async function onDownloadFile(id: string, profileId: string) { + const data = await getPathUploadFlie(fileGroup.value, profileId, id); + window.open(data.downloadUrl, "_blank"); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -247,6 +256,7 @@ onMounted(async () => { {{ col.label }} + @@ -263,6 +273,20 @@ onMounted(async () => { {{ col.value ? col.value : "-" }} + + + ดาวน์โหลด + + {
- - ประวัติแก้ไขวินัย - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขวินัย + +
{{ @@ -331,5 +368,6 @@ onMounted(async () => { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/02_Government/04_Duty.vue b/src/modules/10_registry/02_Government/04_Duty.vue index e1970fd..1ff8476 100644 --- a/src/modules/10_registry/02_Government/04_Duty.vue +++ b/src/modules/10_registry/02_Government/04_Duty.vue @@ -6,6 +6,7 @@ import { ref, reactive, onMounted } from "vue"; import http from "@/plugins/http"; import config from "@/app.config"; import { useDataStore } from "@/stores/data"; +import { useRegistryDataStore } from "@/modules/10_registry/store/Main"; import type { DutyFormType } from "@/modules/10_registry/interface/index/Main"; //history dialog @@ -22,6 +23,7 @@ const rowsHistoryData = ref([]); const $q = useQuasar(); const mode = ref($q.screen.gt.xs); const mixin = useCounterMixin(); +const { getPathUploadFlie } = useRegistryDataStore(); const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } = mixin; @@ -241,6 +243,8 @@ const columnsHistory = ref([ }, ]); +const fileGroup = ref("เอกสารปฏิบัติราชการพิเศษ"); + function onHistory(id: string) { modalHistory.value = true; idByRow.value = id; @@ -282,6 +286,11 @@ function getHistory() { }); } +async function onDownloadFile(id: string, profileId: string) { + const data = await getPathUploadFlie(fileGroup.value, profileId, id); + window.open(data.downloadUrl, "_blank"); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -352,6 +361,7 @@ onMounted(async () => { {{ col.label }} + @@ -368,6 +378,21 @@ onMounted(async () => { {{ col.value ? col.value : "-" }}
+ + + ดาวน์โหลด + + + {
- - ประวัติแก้ไขปฏิบัติราชการพิเศษ - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขปฏิบัติราชการพิเศษ + +
{{ @@ -417,6 +455,7 @@ onMounted(async () => {
+ { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/03_Salary/02_Nopaid.vue b/src/modules/10_registry/03_Salary/02_Nopaid.vue index 4a7fea2..ecdc9a4 100644 --- a/src/modules/10_registry/03_Salary/02_Nopaid.vue +++ b/src/modules/10_registry/03_Salary/02_Nopaid.vue @@ -6,6 +6,7 @@ import { ref, onMounted } from "vue"; import http from "@/plugins/http"; import config from "@/app.config"; import { useDataStore } from "@/stores/data"; +import { useRegistryDataStore } from "@/modules/10_registry/store/Main"; import type { NopaidFormType } from "@/modules/10_registry/interface/index/Main"; @@ -24,6 +25,7 @@ const mode = ref($q.screen.gt.xs); const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } = mixin; +const { getPathUploadFlie } = useRegistryDataStore(); const modalHistory = ref(false); /** ตัวแปรข้อมูล */ @@ -218,6 +220,8 @@ const columnsHistory = ref([ }, ]); +const fileGroup = ref("เอกสารบันทึกวันที่ไม่ได้รับเงินเดือน"); + function onHistory(id: string) { modalHistory.value = true; idByRow.value = id; @@ -261,6 +265,11 @@ function getHistory() { }); } +async function onDownloadFile(id: string, profileId: string) { + const data = await getPathUploadFlie(fileGroup.value, profileId, id); + window.open(data.downloadUrl, "_blank"); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -331,6 +340,7 @@ onMounted(async () => { {{ col.label }}
+ @@ -347,6 +357,20 @@ onMounted(async () => { {{ col.value ? col.value : "-" }} + + + ดาวน์โหลด + + {
- - ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ + - + ดาวน์โหลด + + + ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ + +
{{ @@ -398,6 +435,7 @@ onMounted(async () => { + { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/04_Achievement/01_Certificate.vue b/src/modules/10_registry/04_Achievement/01_Certificate.vue index 2234bdc..6ec2af0 100644 --- a/src/modules/10_registry/04_Achievement/01_Certificate.vue +++ b/src/modules/10_registry/04_Achievement/01_Certificate.vue @@ -6,6 +6,7 @@ import { ref, reactive, onMounted } from "vue"; import http from "@/plugins/http"; import config from "@/app.config"; import { useDataStore } from "@/stores/data"; +import { useRegistryDataStore } from "@/modules/10_registry/store/Main"; import type { CertificateDetail } from "@/modules/10_registry/interface/index/Main"; @@ -18,6 +19,7 @@ const dataPerson = useDataStore(); const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } = mixin; +const { getPathUploadFlie } = useRegistryDataStore(); const idByRow = ref(""); const rows = ref([]); @@ -216,6 +218,9 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); + +const fileGroup = ref("เอกสารใบอนุญาตประกอบวิชาชีพ"); + function onHistory(id: string) { modalHistory.value = true; idByRow.value = id; @@ -263,6 +268,11 @@ function getHistory() { }); } +async function onDownloadFile(id: string, profileId: string) { + const data = await getPathUploadFlie(fileGroup.value, profileId, id); + window.open(data.downloadUrl, "_blank"); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -333,6 +343,7 @@ onMounted(async () => { {{ col.label }}
+ @@ -349,6 +360,20 @@ onMounted(async () => { {{ col.value ? col.value : "-" }} + + + ดาวน์โหลด + + {
- - ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ + +
{{ @@ -398,6 +436,7 @@ onMounted(async () => {
+ { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/04_Achievement/03_Insignia.vue b/src/modules/10_registry/04_Achievement/03_Insignia.vue index 244e5af..d8b0323 100644 --- a/src/modules/10_registry/04_Achievement/03_Insignia.vue +++ b/src/modules/10_registry/04_Achievement/03_Insignia.vue @@ -6,6 +6,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useDataStore } from "@/stores/data"; +import { useRegistryDataStore } from "@/modules/10_registry/store/Main"; import type { InsigniaFormType } from "@/modules/10_registry/interface/index/Main"; @@ -25,6 +26,7 @@ const mode = ref($q.screen.gt.xs); const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } = mixin; +const { getPathUploadFlie } = useRegistryDataStore(); const modalHistory = ref(false); /** ตัวแปรข้อมูล */ @@ -432,6 +434,8 @@ const columnsHistory = ref([ }, ]); +const fileGroup = ref("เครื่องราชฯ"); + function onHistory(id: string) { modalHistory.value = true; idByRow.value = id; @@ -479,6 +483,11 @@ function getHistory() { }); } +async function onDownloadFile(id: string, profileId: string) { + const data = await getPathUploadFlie(fileGroup.value, profileId, id); + window.open(data.downloadUrl, "_blank"); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -549,6 +558,7 @@ onMounted(async () => { {{ col.label }}
+ @@ -567,6 +577,20 @@ onMounted(async () => { {{ col.value ? col.value : "-" }} + + + ดาวน์โหลด + + {
- - ประวัติแก้ไขเครื่องราชอิสริยาภรณ์ - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขเครื่องราชอิสริยาภรณ์ + +
{{ @@ -647,5 +685,6 @@ onMounted(async () => { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/04_Achievement/04_Honor.vue b/src/modules/10_registry/04_Achievement/04_Honor.vue index 6031f16..58035f2 100644 --- a/src/modules/10_registry/04_Achievement/04_Honor.vue +++ b/src/modules/10_registry/04_Achievement/04_Honor.vue @@ -7,6 +7,7 @@ import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useDataStore } from "@/stores/data"; import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry"; +import { useRegistryDataStore } from "@/modules/10_registry/store/Main"; import type { HonorFormData } from "@/modules/10_registry/interface/index/Main"; @@ -27,6 +28,7 @@ const mode = ref($q.screen.gt.xs); const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } = mixin; +const { getPathUploadFlie } = useRegistryDataStore(); const modalHistory = ref(false); /** ตัวแปรข้อมูล */ @@ -218,6 +220,8 @@ const columnsHistory = ref([ }, ]); +const fileGroup = ref("ประกาศเกียรติคุณ"); + function onHistory(id: string) { modalHistory.value = true; idByRow.value = id; @@ -263,6 +267,11 @@ function getHistory() { }); } +async function onDownloadFile(id: string, profileId: string) { + const data = await getPathUploadFlie(fileGroup.value, profileId, id); + window.open(data.downloadUrl, "_blank"); +} + function onSearch() { rows.value = onSearchDataTable( filter.value, @@ -333,6 +342,7 @@ onMounted(async () => { {{ col.label }} + @@ -349,6 +359,20 @@ onMounted(async () => { {{ col.value ? col.value : "-" }}
+ + + ดาวน์โหลด + + {
- - ประวัติแก้ไขประกาศเกียรติคุณ - +
+ + ดาวน์โหลด + + + ประวัติแก้ไขประกาศเกียรติคุณ + +
{{ @@ -398,6 +436,7 @@ onMounted(async () => {
+ { .fix_top { justify-content: start !important; + margin-top: 10px; } diff --git a/src/modules/10_registry/store/Main.ts b/src/modules/10_registry/store/Main.ts new file mode 100644 index 0000000..47c2ab6 --- /dev/null +++ b/src/modules/10_registry/store/Main.ts @@ -0,0 +1,38 @@ +import { defineStore } from "pinia"; +import { useQuasar } from "quasar"; + +import http from "@/plugins/http"; +import config from "@/app.config"; +import { useCounterMixin } from "@/stores/mixin"; + +const $q = useQuasar(); +const mixin = useCounterMixin(); +const { messageError } = mixin; + +export const useRegistryDataStore = defineStore("RegistryDataStoreMain", () => { + async function getPathUploadFlie( + group: string, + profileId: string, + id: string + ) { + try { + const res = await http.get( + config.API.subFileByFileName( + "ทะเบียนประวัติ", + group, + profileId, + id, + "เอกสารหลักฐาน" + ) + ); + return res.data; + } catch (err) { + messageError($q, err); + } + } + + return { + // Function + getPathUploadFlie, + }; +});