Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m31s

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-05-01 09:43:32 +07:00
commit b403054348
9 changed files with 122 additions and 36 deletions

View file

@ -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();

View file

@ -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);

View file

@ -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 : [],
);
}

View file

@ -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 : [],
);
}

View file

@ -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 : [],
);
}

View file

@ -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 : [],
);
}

View file

@ -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 : [],
);
}

View file

@ -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)"
>
<q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip>

View file

@ -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)"
>
<q-tooltip>ประวแกไขประกาศเกยรต</q-tooltip>