diff --git a/src/modules/05_placement/views/08_otherMain.vue b/src/modules/05_placement/views/08_otherMain.vue index 1b02d73a9..d4b89a424 100644 --- a/src/modules/05_placement/views/08_otherMain.vue +++ b/src/modules/05_placement/views/08_otherMain.vue @@ -15,6 +15,7 @@ import type { listMain } from "@/modules/05_placement/interface/response/OhterMa /** importcomopnents*/ import Dialogbody from "@/modules/05_placement/components/Other/DialogOrders.vue"; +import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue"; /** use*/ const $q = useQuasar(); @@ -44,6 +45,7 @@ const filterKeyword2 = ref(""); //คำค้นหารายกา const visibleColumns = ref([ "no", "fullname", + "organizationPositionReturn", "positionLevel", "organizationPositionOld", "createdAt", @@ -73,6 +75,19 @@ const columns = ref([ }`; }, }, + + { + name: "organizationPositionReturn", + align: "left", + label: "ตำแหน่ง/หน่วยงานที่บรรจุกลับ", + sortable: true, + field: "organizationPositionReturn", + format(val, row) { + return row.organizationPositionOld.replace(/\n/g, " "); + }, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "positionLevel", align: "left", @@ -198,6 +213,65 @@ function clickDelete(id: string) { }); } +const modalSelectOrg = ref(false); +const type = ref(null); +const personalId = ref(""); + +const posType = ref(""); //ประเภทตำแหน่ง +const posLevel = ref(""); //ระดับตำแหน่ง +const position = ref(""); //ตำแหน่ง +const dataRows = ref(); //ข้อมูลที่ต้องการเลือกหน่วยงานที่รับโอน + +/** + * ฟังก์ชันเปิด popup เลือกหน่วยงานที่รับโอน + * @param id id รายการรับโอนที่เลือกหน่วยงานที่รับโอน + * @param data ข้อมูลรายการรับโอน + */ +function onSelectOrg(data: any) { + personalId.value = data.id; + // personal.value = dataRecevice.value.filter((e: ResponseData) => e.id === id); + dataRows.value = data; + posType.value = data.posTypeId; + posLevel.value = data.posLevelId; + position.value = data.positionId; + type.value = null; + modalSelectOrg.value = true; +} + +async function onSaveSelectOrg(data: any) { + const body = { + node: data.node, + nodeId: data.nodeId, + orgRevisionId: data.orgRevisionId, + positionId: data.positionId, + posMasterNo: data.posMasterNo, + positionName: data.positionName, + posTypeId: data.posTypeId, + posTypeName: data.posTypeName, + posLevelId: data.posLevelId, + posLevelName: data.posLevelName, + posExecutiveName: data.posExecutiveName, + reportingDate: data.reportingDate, + posmasterId: data.posmasterId, + typeCommand: data.typeCommand, + }; + + showLoader(); + await http + .put(config.API.otherPosition(personalId.value), body) + .then(async () => { + await fecthlistOthet(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + modalSelectOrg.value = false; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + /** * redialect รายละเอียดรายการอื่นๆ * @param id รายการอื่นๆ @@ -220,6 +294,7 @@ onMounted(() => { fecthlistOthet(); }); +