diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 2bee16193..441bd5dad 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -250,12 +250,12 @@ const menuList = readonly([ path: "appoint-promote", role: "placement", }, - { - key: 6.9, - label: "รายการย้าย" /* */, - path: "relocation", - role: "placement", - }, + // { + // key: 6.9, + // label: "รายการย้าย" /* */, + // path: "relocation", + // role: "placement", + // }, { key: 6.1, label: "รายการอื่นๆ" /* */, diff --git a/src/modules/05_placement/components/AppointMent/Main.vue b/src/modules/05_placement/components/AppointMent/Main.vue index 2c136721f..24638d437 100644 --- a/src/modules/05_placement/components/AppointMent/Main.vue +++ b/src/modules/05_placement/components/AppointMent/Main.vue @@ -93,7 +93,7 @@ const fecthlistappointment = async () => { rows.value = response.map((e: any) => ({ personalId: e.id, citizenId: e.citizenId, - fullname: e.prefix+e.firstname + " " + e.lastname, + fullname: e.prefix + e.firstname + " " + e.lastname, organizationName: e.organizationName + " " + @@ -107,12 +107,17 @@ const fecthlistappointment = async () => { positionNumber: e.positionNumber, positionPath: e.positionPath, status: status(e.status), - createdAt:date2Thai(e.createdAt), - + createdAt: date2Thai(e.createdAt), + birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth), })); // console.log(rows.value); - rows2.value = rows.value.filter((e: any) => e.orgName !== null && e.status !== 'ส่งรายชื่อไปออกคำสั่ง'&& e.status !== 'ออกคำสั่งเสร็จแล้ว'); + rows2.value = rows.value.filter( + (e: any) => + e.orgName !== null && + e.status !== "ส่งรายชื่อไปออกคำสั่ง" && + e.status !== "ออกคำสั่งเสร็จแล้ว" + ); }) .catch((e) => { console.log(typeof e); @@ -127,7 +132,10 @@ const fecthTypeOption = async () => { .get(config.API.typeOrder()) .then((res) => { optionsType.value = res.data.result.filter( - (e: any) => e.commandCode === "C-PM-05" || e.commandCode === "C-PM-06" + (e: any) => + e.commandCode === "C-PM-05" || + e.commandCode === "C-PM-06" || + e.commandCode === "C-PM-07" ); }) .catch((e) => { @@ -173,7 +181,6 @@ const columns = ref([ field: "organizationName", headerStyle: "font-size: 14px", style: "font-size: 14px", - }, { name: "birthday", @@ -252,7 +259,6 @@ const columns2 = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - ]); const openModalTree = (id: string) => { @@ -279,35 +285,64 @@ const deleteAppoint = async (id: string) => { hideLoader(); }); }; + const clickAddlist = () => { dialogConfirm($q, () => createdAppoint()); }; const createdAppoint = async () => { - let pId: string[] = []; - selected.value.forEach((e: any) => { - pId.push(e.personalId); - }); - let data = { - id: pId, - }; - console.log(data); - showLoader(); - await http - .put(config.API.apppointmentReport(type.value), data) - .then((res: any) => { - console.log(res); - success($q, "บันทึกสำเร็จ"); - }) - .catch((e: any) => { - console.log(e); - messageError($q, e); - }) - .finally(() => { - hideLoader(); - fecthlistappointment(); - selected.value = []; - modal.value = false; + if (type.value == "c6de09ef-c1f8-4a39-aa31-c7ed88df01d9") { + let pId: string[] = []; + selected.value.forEach((e: any) => { + pId.push(e.personalId); }); + let data = { + id: pId, + }; + console.log(data); + showLoader(); + await http + .post(config.API.relocationMainReport(), data) + .then((res: any) => { + console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e) => { + console.log(e); + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + fecthlistappointment(); + selected.value = []; + modal.value = false; + }); + } else { + let pId: string[] = []; + selected.value.forEach((e: any) => { + pId.push(e.personalId); + }); + let data = { + id: pId, + }; + console.log(data); + showLoader(); + await http + .put(config.API.apppointmentReport(type.value), data) + .then((res: any) => { + console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + console.log(e); + messageError($q, e); + }) + .finally(() => { + hideLoader(); + fecthlistappointment(); + selected.value = []; + modal.value = false; + }); + } }; const closeModalTree = async () => { @@ -340,11 +375,10 @@ const pagination = ref({ page: 1, rowsPerPage: 10, }); -