no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-29 15:22:27 +07:00
parent 162a161437
commit e58c87fc72

View file

@ -126,7 +126,6 @@ onMounted(async () => {
} else {
roleUser.value = "admin";
}
console.log(roleUser.value);
}
});
@ -181,6 +180,37 @@ const fetchData = async (id: string) => {
hideLoader();
});
};
const rowsFileDownload = ref<TypeFile[]>([
{ fileName: "หนังสือลาออกจากราขการ", pathName: "" },
]);
const downloadAttachment = async (type: string, id: string) => {
showLoader();
await http
.get(config.API.reportResignList(type, id), {
responseType: "blob",
})
.then(async (res) => {
const data = res.data.result;
console.log(data);
let list: TypeFile[] = [];
downloadFile(res, `หนังสือลาออกจากราขการ.${type}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const popUp = (action: "pass" | "passNot") => {
reasonReign.value = "";
@ -522,7 +552,9 @@ const statusOrder = (val: boolean) => {
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">แบบฟอรมหนงสอขอลาออกจากราชการ</div>
<div class="q-pl-sm text-weight-bold text-dark">
แบบฟอรมหนงสอขอลาออกจากราชการ
</div>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12">
@ -542,10 +574,24 @@ const statusOrder = (val: boolean) => {
{{ props.row.fileName }}
</q-td>
<q-td key="btnMicrosoft" :props="props">
<q-btn flat dense round color="red" icon="picture_as_pdf" @click="downloadAttachment('pdf',id)">
<q-btn
flat
dense
round
color="red"
icon="picture_as_pdf"
@click="downloadAttachment('pdf', id)"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn flat dense round color="blue" icon="mdi-file-word" @click="downloadAttachment('docx',id)">
<q-btn
flat
dense
round
color="blue"
icon="mdi-file-word"
@click="downloadAttachment('docx', id)"
>
<q-tooltip>ไฟล WORD</q-tooltip>
</q-btn>
</q-td>
@ -1069,7 +1115,7 @@ const statusOrder = (val: boolean) => {
</q-dialog>
</template>
import CurrencyInput from "@/components/CurruncyInput.vue";
<!-- import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
@ -1488,7 +1534,7 @@ const getClass = (val: boolean) => {
"full-width cursor-pointer": !val,
};
};
</script>
</script> -->
<style lang="scss" scope>
.q-img {
border-radius: 5px;