เพิ่มแก้ไข แบบรายงานการประเมินฯ
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 saveEdit = (id: string) => {
|
||||
dialogConfirm($q, () => console.log("save"));
|
||||
dialogConfirm($q, async () => {
|
||||
await postData("put");
|
||||
});
|
||||
};
|
||||
const edit = () => {
|
||||
status.value = true;
|
||||
|
|
@ -55,7 +57,7 @@ const fecthAssign = async (id: string) => {
|
|||
|
||||
director_id.value = res.data.data.chairman.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;
|
||||
}
|
||||
commander.value = res.data.data.commander;
|
||||
|
|
@ -127,7 +129,7 @@ const optionDirector = ref<any>([]);
|
|||
const savaForm = async () => {
|
||||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
dialogConfirm($q, async () => await postData());
|
||||
dialogConfirm($q, async () => await postData("post"));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -157,7 +159,7 @@ const clickdownloadFile = async (type: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const postData = async () => {
|
||||
const postData = async (action: string) => {
|
||||
const data = await {
|
||||
start_date: date_start.value,
|
||||
date_finish: date_finish.value,
|
||||
|
|
@ -169,15 +171,32 @@ const postData = async () => {
|
|||
director2_dated: director2_dated.value,
|
||||
expand_month: expand_month.value,
|
||||
};
|
||||
await http
|
||||
.post(config.API.createformReport(assignId.value), data)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
if (action === "post") {
|
||||
await http
|
||||
.post(config.API.createformReport(assignId.value), data)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
||||
})
|
||||
.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 = () => {
|
||||
if (result.value !== 3) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue