From bda83218d9a5eb5bfa6f0c9bd86a0ac9580e31a6 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Fri, 30 Aug 2024 17:42:22 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20save=20knowledges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_placement/components/probation/FormAssign.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index e3e46c6c4..9a773253f 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -533,6 +533,7 @@ function putDataEdit(id: string) { }); const know_ledge = knowledge.value.map((item) => ({ + id: item ? item.id : null, level: item ? item.level : null, })); @@ -684,6 +685,7 @@ function putData(id: string) { } }); const know_ledge = knowledge.value.map((item) => ({ + id: item ? item.id : null, level: item ? item.level : null, })); @@ -807,6 +809,7 @@ function putData(id: string) { * @param id personal id */ async function saveData(id: string) { + const data = putData(id); dialogConfirm($q, async () => await DataSave(id)); } @@ -857,7 +860,10 @@ async function getAssign() { chairman.value = data.chairman; commander.value = data.commander; - knowledge.value = data.knowledges + knowledge.value = data.knowledges.map((opItem: any) => { + return OPknowledge.value.find((dataItem: any) => dataItem.id === opItem.id); + }) + knowledgeCount.value = data.knowledges.length; other_desc.value = data.assign.other_desc; other4_desc.value = data.assign.other4_desc;