บรรจุ => รายชื่อผู้สอบในรอบ
This commit is contained in:
parent
6f168f0c8a
commit
f560099626
1 changed files with 28 additions and 1 deletions
|
|
@ -62,6 +62,7 @@ const positionId = ref<string>("");
|
|||
const seletcId = ref<string>("");
|
||||
const selectedPos = ref<any[]>([]);
|
||||
const datePos = ref<Date>(new Date());
|
||||
const posMasterMain = ref<any>([]);
|
||||
|
||||
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
||||
async function fetchOrganizationActive() {
|
||||
|
|
@ -140,6 +141,7 @@ async function fetchDataTable(id: string, level: number = 0) {
|
|||
.post(config.API.orgPosPlacement, body)
|
||||
.then((res) => {
|
||||
const dataMain: PositionMaim[] = [];
|
||||
posMasterMain.value = res.data.result.data;
|
||||
res.data.result.data.forEach((e: PositionNo) => {
|
||||
const p = e.positions;
|
||||
if (p.length !== 0) {
|
||||
|
|
@ -149,6 +151,7 @@ async function fetchDataTable(id: string, level: number = 0) {
|
|||
dataMain.push(data);
|
||||
}
|
||||
});
|
||||
|
||||
positionNo.value = store.fetchPosNo(dataMain);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -190,7 +193,12 @@ async function fetchPosFind(level: number, id: string) {
|
|||
}
|
||||
|
||||
/** function บันทึกข้อมูลตำแหน่ง*/
|
||||
function onClickSubmit() {
|
||||
async function onClickSubmit() {
|
||||
const dataPosMaster = await posMasterMain.value?.find(
|
||||
(e: any) => e.id === positionId.value
|
||||
);
|
||||
const dataNode = await filterNodeFn(nodes.value, nodeId.value);
|
||||
|
||||
if (selectedPos.value.length === 0) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกตำแหน่ง");
|
||||
} else {
|
||||
|
|
@ -203,7 +211,12 @@ function onClickSubmit() {
|
|||
posmasterId: positionId.value,
|
||||
positionId: selectedPos.value[0].id,
|
||||
reportingDate: datePos.value,
|
||||
organizationName: dataNode.orgTreeName, //ชื่อหน่วยงาน
|
||||
orgTreeShortName: dataNode.orgTreeShortName, //ชื่อย่อ
|
||||
posPath: selectedPos.value[0].positionName, //ชื่อตำแหน่ง
|
||||
posNumber: dataPosMaster.posMasterNo, //เลขที่ตำแหน่ง(เลขอย่่างเดียว)
|
||||
};
|
||||
|
||||
await http
|
||||
.post(config.API.placementPass(), body)
|
||||
.then(() => {
|
||||
|
|
@ -261,6 +274,20 @@ function filterItemsTaps(data: TreeMain[]) {
|
|||
itemTaps.value = orgTreeIds;
|
||||
return orgTreeIds;
|
||||
}
|
||||
|
||||
function filterNodeFn(data: any, id: string) {
|
||||
for (const child of data) {
|
||||
if (child.orgTreeId === id) {
|
||||
return child;
|
||||
} else if (child.children) {
|
||||
const result: any = filterNodeFn(child.children, id);
|
||||
if (result !== null) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="modal" full-width persistent>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue