diff --git a/src/modules/10_registry/01_Information/02_ChangeName.vue b/src/modules/10_registry/01_Information/02_ChangeName.vue
index 5a140b4..7d8074f 100644
--- a/src/modules/10_registry/01_Information/02_ChangeName.vue
+++ b/src/modules/10_registry/01_Information/02_ChangeName.vue
@@ -136,10 +136,6 @@ async function onDownloadFile(id: string, profileId: string) {
),
)
.then(async (res) => {
- // const data = res.data.downloadUrl;
- // window.open(data, "_blank");
- console.log(res.data);
-
const downloadUrl = res.data.downloadUrl;
const response = await fetch(downloadUrl);
const blob = await response.blob();
diff --git a/src/modules/10_registry/01_Information/06_Ability.vue b/src/modules/10_registry/01_Information/06_Ability.vue
index bc77c5b..5254633 100644
--- a/src/modules/10_registry/01_Information/06_Ability.vue
+++ b/src/modules/10_registry/01_Information/06_Ability.vue
@@ -240,7 +240,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
@@ -258,12 +258,23 @@ async function onDownloadFile(id: string, profileId: string) {
"เอกสารความสามารถพิเศษ",
profileId,
id,
- "เอกสารหลักฐาน"
- )
+ "เอกสารหลักฐาน",
+ ),
)
.then(async (res) => {
- const data = res.data;
- window.open(data.downloadUrl, "_blank");
+ const downloadUrl = res.data.downloadUrl;
+ const response = await fetch(downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารความสามารถพิเศษ_`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
})
.catch((err) => {
messageError($q, err);
diff --git a/src/modules/10_registry/02_Government/02_Discipline.vue b/src/modules/10_registry/02_Government/02_Discipline.vue
index 7ac9611..21dc522 100644
--- a/src/modules/10_registry/02_Government/02_Discipline.vue
+++ b/src/modules/10_registry/02_Government/02_Discipline.vue
@@ -194,8 +194,20 @@ async function getHistory() {
async function onDownloadFile(id: string, profileId: string) {
showLoader();
try {
- const data = await getPathUploadFlie(fileGroup.value, profileId, id);
- window.open(data.downloadUrl, "_blank");
+ const res = await getPathUploadFlie(fileGroup.value, profileId, id);
+ const downloadUrl = res.downloadUrl;
+ const response = await fetch(downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารวินัย`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
} catch (e) {
messageError($q, e);
} finally {
@@ -208,7 +220,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
diff --git a/src/modules/10_registry/02_Government/04_Duty.vue b/src/modules/10_registry/02_Government/04_Duty.vue
index 4a6ff94..7b2c1e7 100644
--- a/src/modules/10_registry/02_Government/04_Duty.vue
+++ b/src/modules/10_registry/02_Government/04_Duty.vue
@@ -297,8 +297,20 @@ async function getHistory() {
async function onDownloadFile(id: string, profileId: string) {
showLoader();
try {
- const data = await getPathUploadFlie(fileGroup.value, profileId, id);
- window.open(data.downloadUrl, "_blank");
+ const res = await getPathUploadFlie(fileGroup.value, profileId, id);
+ const downloadUrl = res.downloadUrl;
+ const response = await fetch(downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารปฏิบัติราชการพิเศษ`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
} catch (e) {
messageError($q, e);
} finally {
@@ -311,7 +323,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
diff --git a/src/modules/10_registry/02_Government/06_Assistance.vue b/src/modules/10_registry/02_Government/06_Assistance.vue
index ac7adc5..02ad925 100644
--- a/src/modules/10_registry/02_Government/06_Assistance.vue
+++ b/src/modules/10_registry/02_Government/06_Assistance.vue
@@ -302,12 +302,23 @@ async function onDownloadFile(id: string, profileId: string) {
"ช่วยราชการ",
profileId,
id,
- "เอกสารหลักฐาน"
- )
+ "เอกสารหลักฐาน",
+ ),
)
.then(async (res) => {
- const data = res.data;
- window.open(data.downloadUrl, "_blank");
+ const downloadUrl = res.data.downloadUrl;
+ const response = await fetch(downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารช่วยราชการ`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
})
.catch((err) => {
messageError($q, err);
@@ -322,7 +333,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
diff --git a/src/modules/10_registry/03_Salary/02_Nopaid.vue b/src/modules/10_registry/03_Salary/02_Nopaid.vue
index a74d946..8d81c30 100644
--- a/src/modules/10_registry/03_Salary/02_Nopaid.vue
+++ b/src/modules/10_registry/03_Salary/02_Nopaid.vue
@@ -255,7 +255,7 @@ async function getHistory() {
rowsHistoryData.value = [];
await http
.get(
- config.API.dataUserSalaryNopaidHistoryByType(link.value, idByRow.value)
+ config.API.dataUserSalaryNopaidHistoryByType(link.value, idByRow.value),
)
.then((res) => {
const data = res.data.result;
@@ -278,8 +278,20 @@ async function getHistory() {
async function onDownloadFile(id: string, profileId: string) {
showLoader();
try {
- const data = await getPathUploadFlie(fileGroup.value, profileId, id);
- window.open(data.downloadUrl, "_blank");
+ const res = await getPathUploadFlie(fileGroup.value, profileId, id);
+ const downloadUrl = res.downloadUrl;
+ const response = await fetch(downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `บันทึกวันที่ไม่ได้รับ${salaryText.value}ฯ`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
} catch (e) {
messageError($q, e);
} finally {
@@ -292,7 +304,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
diff --git a/src/modules/10_registry/04_Achievement/01_Certificate.vue b/src/modules/10_registry/04_Achievement/01_Certificate.vue
index 6266c34..21a6eeb 100644
--- a/src/modules/10_registry/04_Achievement/01_Certificate.vue
+++ b/src/modules/10_registry/04_Achievement/01_Certificate.vue
@@ -253,8 +253,8 @@ async function getHistory() {
config.API.dataUserCertificateHistoryByType(
link.value,
"certificate",
- idByRow.value
- )
+ idByRow.value,
+ ),
)
.then((res) => {
const data = res.data.result;
@@ -278,7 +278,19 @@ async function onDownloadFile(id: string, profileId: string) {
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
- window.open(data.downloadUrl, "_blank");
+ const downloadUrl = data.downloadUrl;
+ const response = await fetch(downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารใบอนุญาตประกอบวิชาชีพ`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
} catch (error) {
messageError($q, error);
} finally {
@@ -291,7 +303,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
diff --git a/src/modules/10_registry/04_Achievement/03_Insignia.vue b/src/modules/10_registry/04_Achievement/03_Insignia.vue
index e2dadc0..8db5851 100644
--- a/src/modules/10_registry/04_Achievement/03_Insignia.vue
+++ b/src/modules/10_registry/04_Achievement/03_Insignia.vue
@@ -469,8 +469,8 @@ async function getHistory() {
config.API.dataUserCertificateHistoryByType(
link.value,
"insignia",
- idByRow.value
- )
+ idByRow.value,
+ ),
)
.then((res) => {
const data = res.data.result;
@@ -494,7 +494,18 @@ async function onDownloadFile(id: string, profileId: string) {
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
- window.open(data.downloadUrl, "_blank");
+ const response = await fetch(data.downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารเครื่องราชอิสริยาภรณ์`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
} catch (error) {
messageError($q, error);
} finally {
@@ -507,7 +518,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
@@ -647,7 +658,6 @@ onMounted(async () => {
dense
round
size="14px"
- class="absolute_button"
@click="onHistory(props.row.id)"
>
ประวัติแก้ไขเครื่องราชอิสริยาภรณ์
diff --git a/src/modules/10_registry/04_Achievement/04_Honor.vue b/src/modules/10_registry/04_Achievement/04_Honor.vue
index 6801fd2..dee78b9 100644
--- a/src/modules/10_registry/04_Achievement/04_Honor.vue
+++ b/src/modules/10_registry/04_Achievement/04_Honor.vue
@@ -278,7 +278,18 @@ async function onDownloadFile(id: string, profileId: string) {
showLoader();
try {
const data = await getPathUploadFlie(fileGroup.value, profileId, id);
- window.open(data.downloadUrl, "_blank");
+ const response = await fetch(data.downloadUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = `เอกสารประกาศเกียรติคุณ`;
+ document.body.appendChild(link);
+ link.click();
+ setTimeout(() => {
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ }, 100);
} catch (error) {
messageError($q, error);
} finally {
@@ -291,7 +302,7 @@ function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
- columns.value ? columns.value : []
+ columns.value ? columns.value : [],
);
}
@@ -429,7 +440,6 @@ onMounted(async () => {
dense
round
size="14px"
- class="absolute_button"
@click="onHistory(props.row.id)"
>
ประวัติแก้ไขประกาศเกียรติคุณ