From 6df41b98810cee6b7dcc5a7c8bdaab739a7da70a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 6 Jun 2024 14:59:08 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=AA=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B9=83=E0=B8=99=E0=B8=A3=E0=B8=AD=E0=B8=9A=20=20=3D?= =?UTF-8?q?>=20=E0=B8=A7=E0=B8=B1=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=95?= =?UTF-8?q?=E0=B8=B1=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/05_placement/api.placement.ts | 2 + .../PersonalList/DialogSelectOrg.vue | 7 +- .../components/PersonalList/Table.vue | 127 +++++++++++++++++- 3 files changed, 133 insertions(+), 3 deletions(-) diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index d0fb7b902..fe5009c44 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -60,6 +60,8 @@ export default { // clear Position clearPosition: (personalId: string) => `${placement}/position/clear/${personalId}`, + clearDate: (personalId: string) => + `${placement}/date/update/${personalId}`, // Document documentByid: (personalId: string) => `${placement}/doc/${personalId}`, documentDelid: (personalId: string, docid: string) => diff --git a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue index ba1c9ced8..dc65dbd93 100644 --- a/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue +++ b/src/modules/05_placement/components/PersonalList/DialogSelectOrg.vue @@ -198,11 +198,13 @@ async function fetchPosFind(level: number, id: string) { .post(config.API.orgPosFind, body) .then((res) => { const data = res.data.result; + console.log(data); + expanded.value = data; nodeId.value = id; positionId.value = props?.dataRow?.posmasterId; seletcId.value = props?.dataRow?.positionId; - datePos.value = props?.dataRow?.reportingDateFullDate; + datePos.value = props?.dataRow?.reportingDate; fetchDataTable(nodeId.value, level); }) @@ -277,7 +279,10 @@ watch( async () => { if (modal.value) { await fetchOrganizationActive(); + console.log(props?.dataRow); + if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) { + await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId); } else { expanded.value = []; diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 175963ea8..1ed9ec6c7 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -83,6 +83,7 @@ const { dateText, success, dialogConfirm, + date2Thai, } = mixin; const route = useRoute(); @@ -363,7 +364,10 @@ async function getTable() { : rowsAll.value.filter((x: any) => x.statusId !== "CONTAIN")); // รายชื่อไปยังหน่วยงาน rowsFilter.value = await rows.value.filter( - (e: any) => e.draft == "รอส่งตัว" + (e: any) => + e.draft == "รอส่งตัว" && + e.nodeName !== null && + e.reportingDate !== null ); insertAvatar(rows.value); @@ -621,6 +625,7 @@ async function clickClose() { modalDefermentDisclaim.value = false; modalwaitInfo.value = false; modal.value = false; + modalDate.value = false; } } @@ -699,6 +704,35 @@ function onRestorePos(id: string) { ); } +const modalDate = ref(false); +const reportingDate = ref(null); +const rowId = ref(""); +function onSelectDate(id: string, date: Date) { + modalDate.value = true; + rowId.value = id; + reportingDate.value = date; +} + +function onSubmitDate() { + dialogConfirm($q, () => { + showLoader(); + http + .put(config.API.clearDate(rowId.value), { date: reportingDate.value }) + .then(() => { + getTable(); + props.statCard(); + success($q, "บันทึกข้อมูลสำเร็จ"); + modalDate.value = false; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); + }); +} + onMounted(async () => { if (keycloak.tokenParsed != null) { roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); @@ -897,7 +931,35 @@ onMounted(async () => { v-if=" roleAdmin && props.row.draft === 'รอส่งตัว' && - props.row.orgName !== null + props.row.nodeName !== null + " + clickable + v-close-popup + @click=" + onSelectDate( + props.row.personalId, + props.row.reportingDate + ) + " + > + + + + เลือกวันรายงานตัว + + { :fetchStatCard="statCard" :typeCommand="typeCommand" /> + + + + + + + + + + + + + + + + + บันทึกข้อมูล + + + +