Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-24 17:18:29 +07:00
commit 8e58a7e3c7
4 changed files with 20 additions and 33 deletions

View file

@ -32,7 +32,6 @@ const { showLoader, hideLoader, messageError } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const tab = ref<string>("save1");
const dataArrayNumber = ref<number>();
const dataRole = ref<string>("mentor");
@ -52,7 +51,7 @@ async function fecthAssign(id: string) {
// messageError($q, e);
})
.finally(() => {
probationStore.checkLoad && hideLoader();
hideLoader();
});
}
@ -82,13 +81,13 @@ async function FileDownload(type: string) {
`แบบบันทึกผล(ผู้ดูเเล)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
} else {
//
showLoader();
@ -101,13 +100,13 @@ async function FileDownload(type: string) {
`แบบบันทึกผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
}

View file

@ -65,21 +65,10 @@ async function fecthAssign(id: string) {
// messageError($q, e);
})
.finally(() => {
probationStore.checkLoad && hideLoader();
hideLoader();
});
}
/** เปลี่ยน type file */
function 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);
}
/**
* download file
* @param type type
@ -96,13 +85,13 @@ async function FileDownload(type: string) {
`แบบประเมินผล(ผู้บังคับบัญชา)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/** เปลี่ยนหน้า เพิ่ม */

View file

@ -59,7 +59,7 @@ const fecthAssign = async (id: string) => {
// messageError($q, e);
})
.finally(() => {
probationStore.checkLoad && hideLoader();
hideLoader();
});
};
@ -75,13 +75,13 @@ const FileDownload = async (type: string) => {
`แบบประเมินผล(คณะกรรมการ)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
type
);
hideLoader();
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
};
const addData = () => {
router.push(

View file

@ -5,25 +5,24 @@ import type {
DataPermissions,
TabPermissions,
} from "@/modules/05_placement/interface/index/Main";
export const useProbationDataStore = defineStore("probationStore", () => {
const dataPermissions = ref<DataPermissions>();
const assign = ref<any>([]);
const evaluate = ref<any>([]);
const tabs = ref<any>([]);
const mainTab = ref<string>("");
const checkLoad = ref<boolean>(false)
const checkLoad = ref<boolean>(false);
const assignOutput = ref<any>([]);
const director = ref<any>([]);
const person = ref<any>([]);
const fecthdataAssign = async (data: any) => {
checkLoad.value = data.evaluate.length == 0 ? true:false
checkLoad.value = data.evaluate.length == 0 ? true : false;
assign.value = await data.assign;
evaluate.value = await data.evaluate;
tabs.value = await data.evaluate;
};
const fecthAssignoutput = (data: any) => {
assignOutput.value = data.assign_output;
@ -114,6 +113,6 @@ export const useProbationDataStore = defineStore("probationStore", () => {
behavior_no2,
behavior_no3,
dataPermissions,
checkLoad
checkLoad,
};
});