เพิ่มฟิวอัพไฟล์เล่ม1

This commit is contained in:
Kittapath 2023-12-23 19:25:43 +07:00
parent 25bebeae4e
commit b74936f8db

View file

@ -17,7 +17,7 @@ const $q = useQuasar();
const store = useEvaluateStore();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = mixin;
const { showLoader, hideLoader, date2Thai, messageError, success } = mixin;
const fullName = ref<string>(
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
@ -76,6 +76,7 @@ const modalView = ref<boolean>(false);
const numOfPages = ref<number>(0);
const page = ref<number>(1);
const pdfSrc = ref<any>();
const profile = ref<any>();
function onClickViewPDF(file: any) {
// pdfSrc.value = file.webkitRelativePath;
@ -103,7 +104,14 @@ async function onClickDowloadFile(
) {
showLoader();
const data = Object.assign(
{ fullName: fullName.value },
{ fullName: profile.value == null ? "" : profile.value.fullName },
{ position: profile.value == null ? "" : profile.value.position },
{ positionLevel: profile.value == null ? "" : profile.value.positionLevel },
{ posNo: profile.value == null ? "" : profile.value.posNo },
{ oc: profile.value == null ? "" : profile.value.oc },
{ birthDate: profile.value == null ? "" : date2Thai(profile.value.birthDate) },
{ govAge: profile.value == null ? "" : profile.value.govAge },
{ positionLevelNew: profile.value == null ? "" : (profile.value.type == "EXPERT"? "ชำนาญการ":"ชำนาญการพิเศษ")},
tp === "EV1_005" || tp === "EV1_007" ? { organizationName: "-" } : null,
tp === "EV1_007" ? { positionName: "-" } : null,
tp === "EV1_007" ? { positionLeaveName: "-" } : null
@ -188,6 +196,23 @@ async function fetcheSigner(id: string) {
.finally(() => {
hideLoader();
});
fetchCheckSpec(id);
}
async function fetchCheckSpec(id: string) {
showLoader();
await http
.get(config.API.evaluationCheckspecByid(id))
.then((res) => {
const data = res.data.result;
profile.value =data
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
const downloadFile1 = ref<string>("");