From 7f8c866a30c80225cae03ad0efd8a6eed759c9bb Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 21 Aug 2023 16:57:05 +0700 Subject: [PATCH] =?UTF-8?q?put=20Edit=20=E0=B9=81=E0=B8=9A=E0=B8=9A?= =?UTF-8?q?=E0=B8=A1=E0=B8=AD=E0=B8=9A=E0=B8=AB=E0=B8=A1=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=87=E0=B8=B2=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=97?= =?UTF-8?q?=E0=B8=94=E0=B8=A5=E0=B8=AD=E0=B8=87=E0=B8=9B=E0=B8=8F=E0=B8=B4?= =?UTF-8?q?=E0=B8=9A=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=AB=E0=B8=99=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/FormAssign.vue | 24 +++++++++---------- .../components/probation/ProbationDetail.vue | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 513e14522..ca3f381be 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -1653,6 +1653,7 @@ const dataEdit = async (id:string) => { .catch((e) => {}) .finally(async () => { status.value = false + getAssign() hideLoader(); }); @@ -2053,17 +2054,17 @@ const putDataEdit = (id: string) => { { personal_id: caretaker1.value.personal_id, role: "mentor", - dated: date2.value instanceof Date ? dateToISO(date2.value) : null, + dated: date2.value instanceof Date ? dateToISO(date2.value) : dateToISO(new Date(date2.value)), }, { personal_id: caretaker2.value.personal_id, role: "mentor", - dated: date3.value instanceof Date ? dateToISO(date3.value) : null, + dated: date3.value instanceof Date ? dateToISO(date3.value) : dateToISO(new Date(date3.value)), }, { personal_id: commander.value.personal_id, role: "commander", - dated: date4.value instanceof Date ? dateToISO(date4.value) : null, + dated: date4.value instanceof Date ? dateToISO(date4.value) : dateToISO(new Date(date4.value)), }, { personal_id: chairman.value.personal_id, @@ -2097,8 +2098,7 @@ const putDataEdit = (id: string) => { assign_outputs: Productivity_assign.filter((item) => item !== null), // commander: commander.value, assign_director: assign_director, - experimenter_dated: - date1.value instanceof Date ? dateToISO(date1.value) : new Date(), + experimenter_dated:date1.value instanceof Date ? dateToISO(date1.value) : new Date(), // date_2: date2.value instanceof Date ? dateToISO(date2.value) : new Date(), // date_3: date3.value instanceof Date ? dateToISO(date3.value) : new Date(), // date_4: date4.value instanceof Date ? dateToISO(date4.value) : new Date(), @@ -2168,17 +2168,17 @@ const putData = (id: string) => { { personal_id: caretaker1.value.id, role: "mentor", - dated: date2.value instanceof Date ? dateToISO(date2.value) : null, + dated: date2.value instanceof Date ? dateToISO(date2.value) : dateToISO(new Date(date2.value)), }, { personal_id: caretaker2.value.id, role: "mentor", - dated: date3.value instanceof Date ? dateToISO(date3.value) : null, + dated: date3.value instanceof Date ? dateToISO(date3.value) : dateToISO(new Date(date3.value)), }, { personal_id: commander.value.id, role: "commander", - dated: date4.value instanceof Date ? dateToISO(date4.value) : null, + dated: date4.value instanceof Date ? dateToISO(date4.value) : dateToISO(new Date(date4.value)), }, { personal_id: chairman.value.id, @@ -2230,7 +2230,7 @@ const putData = (id: string) => { }; const saveData = (id: string) => { - dialogConfirm($q, () => DataSave(id)); + dialogConfirm($q, async () => await DataSave(id)); }; const DataSave = async (id: string) => { await myForm.value.validate().then((result: boolean) => { @@ -2308,8 +2308,8 @@ const getAssign = async () => { activityCount.value = data.jobs.length; caretaker1.value = data.mentors[0]; caretaker2.value = data.mentors[1]; - chairman.value = data.chairman.name; - commander.value = data.commander.name; + chairman.value = data.chairman; + commander.value = data.commander; knowledge.value = data.knowledges.map((id: any) => id.id); knowledgeCount.value = data.knowledges.length; other_desc.value = data.assign.other_desc; @@ -2340,7 +2340,7 @@ const getAssign = async () => { productivityCount.value = data.outputs.length; checkRule.value = data.laws.map((law: any) => ({ - id: law.law_id, + id: law.id, checked: law.selected, description: law.description, status_select: law.status_select, diff --git a/src/modules/05_placement/components/probation/ProbationDetail.vue b/src/modules/05_placement/components/probation/ProbationDetail.vue index adf848a96..d41a9bf6e 100644 --- a/src/modules/05_placement/components/probation/ProbationDetail.vue +++ b/src/modules/05_placement/components/probation/ProbationDetail.vue @@ -8,7 +8,7 @@ flat color="primary" class="q-mr-sm" - @click="router.go(-1)" + @click="router.push(`/probation/`)" /> รายละเอียดงานที่ได้รับมอบหมายของ {{ name }}