diff --git a/src/api/05_placement/api.probation.ts b/src/api/05_placement/api.probation.ts index e9d5c6e4d..7254dc5f9 100644 --- a/src/api/05_placement/api.probation.ts +++ b/src/api/05_placement/api.probation.ts @@ -60,7 +60,7 @@ export default { - + summarySurveyDetail:(id:string) => `${evaluate}/survey?assign_id=${id}` diff --git a/src/modules/05_placement/components/probation/SummarySurvey.vue b/src/modules/05_placement/components/probation/SummarySurvey.vue index d5b5867a1..8f1a2e4d9 100644 --- a/src/modules/05_placement/components/probation/SummarySurvey.vue +++ b/src/modules/05_placement/components/probation/SummarySurvey.vue @@ -32,8 +32,9 @@ const score2 = ref(0); const score3 = ref(0); const Allscore = ref(0); -const comment_1 = ref(""); -const comment_2 = ref(""); +const answer1 = ref(""); +const answer2 = ref(""); +const answer3 = ref(0); const result = ref(); const result_option = ref([ @@ -55,68 +56,47 @@ const cancel = () => { status.value = false; }; +const getSurveyData = async () => { + await http + .get(config.API.summarySurveyDetail(assignId.value)) + .then((res: any) => { + const data = res.data.data; + answer1.value = data.answer1, + answer2.value = data.answer2, + answer3.value = data.answer3 + status.value = false +}) + .catch((e) => { + console.log(e); + }); +}; +const save = () => { + const data = { + answer1: answer1.value, + answer2: answer2.value, + answer3: answer3.value, + }; + dialogConfirm($q, async () => { + await http + .post(config.API.summarySurveyDetail(assignId.value), data) + .then((res: any) => { + // console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + messageError($q, e); + }); + }); +}; onMounted(() => { - // fecthResult(assignId.value); + getSurveyData(); }); - -// const fecthResult = async (id: string) => { -// await http -// .get(config.API.createformReport(id)) -// .then((res: any) => { -// let data = res.data.data.evaluate; -// console.log(data); -// date_start.value = data.date_start; -// date_finish.value = data.date_finish; -// develop.value = Number(data.develop_complete); -// result.value = Number(data.pass_result); -// reson.value = data.reson; -// chairman_dated.value = data.chairman_dated; -// director1_dated.value = data.director1_dated; -// director2_dated.value = data.director2_dated; -// status.value = false; -// action.value = 'edit'; -// }) -// .catch((e) => { -// console.log(e); -// }); -// }; +
+ +
+ +
+ + +