This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-01-20 14:45:28 +07:00
parent 46bced52a6
commit 53d786df4e

View file

@ -32,7 +32,6 @@ const { fetchStructureTree } = useStructureTree();
const { showLoader, hideLoader, messageError } = useCounterMixin(); const { showLoader, hideLoader, messageError } = useCounterMixin();
const route = useRoute(); const route = useRoute();
const mode = ref<"table" | "card">("table"); //
const empType = ref<string>("officer"); // officer / employee / perm const empType = ref<string>("officer"); // officer / employee / perm
const dataPersonMain = ref<DataPerson[]>([]); // const dataPersonMain = ref<DataPerson[]>([]); //
const maxPage = ref<number>(1); // const maxPage = ref<number>(1); //
@ -51,9 +50,7 @@ const nodeData = reactive<DataNodeData>({
node: null, node: null,
}); });
/** /** function เรียกข้อมูลตำแหน่งประเภท*/
* function เรยกขอมลตำแหนงประเภท
*/
function fetchType() { function fetchType() {
http http
.get(config.API.orgPosType) .get(config.API.orgPosType)
@ -65,9 +62,7 @@ function fetchType() {
}); });
} }
/** /** function เรียกข้อมูลกลุ่มงาน*/
* function เรยกขอมลกลมงาน
*/
function fetchOptionGroup() { function fetchOptionGroup() {
http http
.get(config.API.orgEmployeeType) .get(config.API.orgEmployeeType)
@ -79,9 +74,7 @@ function fetchOptionGroup() {
}); });
} }
/** /** function fetch รายชื่อข้อมูลทะเบียนประวัติ*/
* function fetch รายชอขอมลทะเบยนประว
*/
async function fetchDataPerson() { async function fetchDataPerson() {
showLoader(); showLoader();
dataPersonMain.value = []; dataPersonMain.value = [];
@ -137,10 +130,11 @@ async function fetchDataPerson() {
) )
.then(async (res) => { .then(async (res) => {
const dataList = await res.data.result.data; const dataList = await res.data.result.data;
dataPersonMain.value = dataList;
maxPage.value = Math.ceil( maxPage.value = Math.ceil(
res.data.result.total / store.formFilter.pageSize res.data.result.total / store.formFilter.pageSize
); );
dataPersonMain.value = dataList;
total.value = res.data.result.total; total.value = res.data.result.total;
isShowBtnFilter.value = true; isShowBtnFilter.value = true;
if (dataList) { if (dataList) {
@ -209,7 +203,6 @@ function onclickSearch() {
*/ */
function selectType() { function selectType() {
empType.value = route.name == "registryNew" ? "officer" : "perm"; empType.value = route.name == "registryNew" ? "officer" : "perm";
if (empType.value !== "officer") { if (empType.value !== "officer") {
store.formFilter.isShowRetire = null; store.formFilter.isShowRetire = null;
store.formFilter.isProbation = null; store.formFilter.isProbation = null;
@ -317,9 +310,7 @@ async function fetchTree() {
} }
} }
/** /** ค้นหาข้อมูลรายชื่อข้อมูลทะเบียนประวัติตามหน่วยงาน/ส่วนราชการ*/
* นหาขอมลรายชอขอมลทะเบยนประวตามหนวยงาน/วนราชการ
*/
function sendNode() { function sendNode() {
nodeData.node = store.formFilter.node; nodeData.node = store.formFilter.node;
nodeData.nodeId = store.formFilter.nodeId; nodeData.nodeId = store.formFilter.nodeId;
@ -331,7 +322,6 @@ function sendNode() {
/** /**
* งกนเลอกหนวยงาน/วนราชการ * งกนเลอกหนวยงาน/วนราชการ
* @param data อมลหนวยงาน/วนราชการทองการคนหาร * @param data อมลหนวยงาน/วนราชการทองการคนหาร
*
* เพอคนหาขอมลตามหนวยงาน/วนราชการ * เพอคนหาขอมลตามหนวยงาน/วนราชการ
*/ */
function updateSelectedTreeMain(data: DataStructureTree) { function updateSelectedTreeMain(data: DataStructureTree) {
@ -354,14 +344,12 @@ watch(selectNode, () => {
isLoad.value && hideLoader(); isLoad.value && hideLoader();
}); });
/** /** hook เมื่อมีการเรียกใช้ Components*/
* hook เมอมการเรยกใช Components
*/
function getSearch() { function getSearch() {
store.formFilter.page = 1; store.formFilter.page = 1;
fetchDataPerson(); fetchDataPerson();
} }
onMounted(async () => { onMounted(async () => {
await Promise.all([selectType(), fetchTree()]); await Promise.all([selectType(), fetchTree()]);
}); });