เพิ่มแก้ไข แบบรายงานการประเมินฯ
This commit is contained in:
parent
0b5779c79d
commit
98d305ee48
1 changed files with 32 additions and 13 deletions
|
|
@ -29,7 +29,9 @@ const commander = ref<any>([]);
|
||||||
const status = ref<boolean>(true);
|
const status = ref<boolean>(true);
|
||||||
|
|
||||||
const saveEdit = (id: string) => {
|
const saveEdit = (id: string) => {
|
||||||
dialogConfirm($q, () => console.log("save"));
|
dialogConfirm($q, async () => {
|
||||||
|
await postData("put");
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const edit = () => {
|
const edit = () => {
|
||||||
status.value = true;
|
status.value = true;
|
||||||
|
|
@ -55,7 +57,7 @@ const fecthAssign = async (id: string) => {
|
||||||
|
|
||||||
director_id.value = res.data.data.chairman.name;
|
director_id.value = res.data.data.chairman.name;
|
||||||
director_id2.value = res.data.data.commander.name;
|
director_id2.value = res.data.data.commander.name;
|
||||||
if(mentors.value.length != 0){
|
if (mentors.value.length != 0) {
|
||||||
director_id3.value = mentors.value[0].name;
|
director_id3.value = mentors.value[0].name;
|
||||||
}
|
}
|
||||||
commander.value = res.data.data.commander;
|
commander.value = res.data.data.commander;
|
||||||
|
|
@ -127,7 +129,7 @@ const optionDirector = ref<any>([]);
|
||||||
const savaForm = async () => {
|
const savaForm = async () => {
|
||||||
await myForm.value!.validate().then((result: boolean) => {
|
await myForm.value!.validate().then((result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
dialogConfirm($q, async () => await postData());
|
dialogConfirm($q, async () => await postData("post"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -157,7 +159,7 @@ const clickdownloadFile = async (type: string) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const postData = async () => {
|
const postData = async (action: string) => {
|
||||||
const data = await {
|
const data = await {
|
||||||
start_date: date_start.value,
|
start_date: date_start.value,
|
||||||
date_finish: date_finish.value,
|
date_finish: date_finish.value,
|
||||||
|
|
@ -169,15 +171,32 @@ const postData = async () => {
|
||||||
director2_dated: director2_dated.value,
|
director2_dated: director2_dated.value,
|
||||||
expand_month: expand_month.value,
|
expand_month: expand_month.value,
|
||||||
};
|
};
|
||||||
await http
|
if (action === "post") {
|
||||||
.post(config.API.createformReport(assignId.value), data)
|
await http
|
||||||
.then(() => {
|
.post(config.API.createformReport(assignId.value), data)
|
||||||
success($q, "บันทึกสำเร็จ");
|
.then(() => {
|
||||||
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
||||||
.catch((e: any) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e: any) => {
|
||||||
});
|
messageError($q, e);
|
||||||
|
});
|
||||||
|
} else if (action === "put") {
|
||||||
|
await http
|
||||||
|
.put(config.API.createformReport(assignId.value), data)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "บันทึกสำเร็จ");
|
||||||
|
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
||||||
|
})
|
||||||
|
.catch((e: any) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
status.value = false;
|
||||||
|
// fecthAssign(assignId.value);
|
||||||
|
fecthResult(assignId.value);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const selectRuslt = () => {
|
const selectRuslt = () => {
|
||||||
if (result.value !== 3) {
|
if (result.value !== 3) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue