From c0002e203c5eff07e5d0aa354bd70416ab50fddf Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 25 Oct 2024 15:57:17 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=9F=E0=B8=B4=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/FormAssign.vue | 311 +++--------------- .../components/probation/MainProbation.vue | 6 + 2 files changed, 48 insertions(+), 269 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 2a7c323bf..a86256448 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -301,88 +301,6 @@ function deleteProductivitys(item: number) { } } -/** get ข้อมูล */ -async function getUser() { - await http - .get(config.API.orgProfilePlacement(personalId)) - .then((res: any) => { - const data = res.data.result; - - OPcaretaker.value = data.caregiver.map((item: any) => ({ - id: item.id, - name: - (item.prefix == null ? "" : item.prefix) + - item.firstName + - " " + - item.lastName, - label: item.position - ? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ - item.lastName - } (${item.position}${ - item.posLevel && item.posType - ? ", " + item.posType + ": " + item.posLevel - : "" - })` - : `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ - item.lastName - }`, - citizenId: item.citizenId, - isDirector: item.isDirector, - posLevel: item.posLevel, - posType: item.posType, - position: item.position, - })); - - // OPcommander.value = data.commander.map((item: any) => ({ - // id: item.id, - // name: - // (item.prefix == null ? "" : item.prefix) + - // item.firstName + - // " " + - // item.lastName, - // label: item.position - // ? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ - // item.lastName - // } (${item.position}${ - // item.posLevel && item.posType - // ? ", " + item.posType + ": " + item.posLevel - // : "" - // })` - // : `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ - // item.lastName - // }`, - // citizenId: item.citizenId, - // posLevel: item.posLevel, - // posType: item.posType, - // position: item.position, - // })); - - // OPchairman.value = data.chairman.map((item: any) => ({ - // id: item.id, - // name: - // (item.prefix == null ? "-" : item.prefix) + - // item.firstName + - // " " + - // item.lastName, - // label: item.position - // ? `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${ - // item.lastName - // } (${item.position}${ - // item.posLevel && item.posType - // ? ", " + item.posType + ": " + item.posLevel - // : "" - // })` - // : `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${ - // item.lastName - // }`, - // citizenId: item.citizenId, - // posLevel: item.posLevel, - // posType: item.posType, - // position: item.position, - // })); - }); -} - /** *ดึงข้อมูลที่ได้รับมอบหมาย * @param id personal id @@ -837,6 +755,7 @@ async function getAssign() { isEdit.value = false; const data = res.data.data; fullname.value = data.profile.name; + appointTopic.value = data.assign.appointId position.value = data.profile.positionName; date_start.value = data.assign.date_start; date_finish.value = data.assign.date_finish; @@ -1063,55 +982,48 @@ function updateAppointMent() { const dataFindChairman = data.find( (item: AppointTopic) => item.role === "chairman" ); - const dataFindCommittee = data - .filter((item: AppointTopic) => item.role === "committee") - .map((i: AppointTopic) => ({ - id: i.id, - name: i.name, - label: i.position - ? `${i.name} (${i.position}${ - i.positionLevel && i.positionType - ? ", " + i.positionType + ": " + i.positionLevel - : "" - })` - : i.name, - posLevel: i.positionLevel, - posType: i.positionType, - position: i.position, - })); - const createChairmanObject = (chairmanData: AppointTopic) => ({ - id: chairmanData.id, - name: chairmanData.name, - label: chairmanData.position - ? `${chairmanData.name} (${chairmanData.position}${ - chairmanData.positionLevel && chairmanData.positionType - ? ", " + - chairmanData.positionType + - ": " + - chairmanData.positionLevel + const dataFindCommittee = data.find( + (item: AppointTopic) => item.role === "committee" + ); + const dataFindCaretaker1 = data.filter( + (item: AppointTopic) => item.role === "caregiver" + )[0]; + const dataFindCaretaker2 = data.filter( + (item: AppointTopic) => item.role === "caregiver" + )[1]; + + const createChairmanObject = (dataPerson: AppointTopic) => ({ + id: dataPerson.id, + name: dataPerson.name, + label: dataPerson.position + ? `${dataPerson.name} (${dataPerson.position}${ + dataPerson.positionLevel && dataPerson.positionType + ? ", " + dataPerson.positionType + ": " + dataPerson.positionLevel : "" })` - : chairmanData.name, - posLevel: chairmanData.positionLevel, - posType: chairmanData.positionType, - position: chairmanData.position, + : dataPerson.name, + posLevel: dataPerson.positionLevel, + posType: dataPerson.positionType, + position: dataPerson.position, }); - OPcaretakerNew.value = dataFindCommittee; - OPcommander.value = dataFindCommittee; - - OPchairmanFn.value = dataFindChairman - ? createChairmanObject(dataFindChairman) + caretaker1.value = dataFindCaretaker1 + ? createChairmanObject(dataFindCaretaker1) + : null; + caretaker2.value = dataFindCaretaker2 + ? createChairmanObject(dataFindCaretaker2) : null; chairman.value = dataFindChairman ? createChairmanObject(dataFindChairman) : null; + commander.value = dataFindCommittee + ? createChairmanObject(dataFindCommittee) + : null; } } /** เมื่อโหลดหน้า เรียกใช้งานฟังชั่น */ onMounted(async () => { - await getUser(); await getAssignNew(personalId); await getLaw(personalId); await getSkill(personalId); @@ -1396,13 +1308,14 @@ onMounted(async () => { 2 ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ (อาจมีได้มากกว่า 1 คน) -
+
{ option-label="label" hide-bottom-space class="col-xs-12 col-sm-6" - :readonly="isEdit != true" dense + hide-dropdown-icon + readonly borderless outlined v-model="caretaker2" @@ -1450,40 +1364,6 @@ onMounted(async () => {
- -
- - - -
@@ -2666,38 +2546,12 @@ onMounted(async () => {
- - - - { { - - - -
{
{ - - - -
{
{ v-model="chairman" label="ประธานกรรมการ" use-input - behavior="menu" - bg-color="white" - > - - - - diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 2a1493ee2..356301b9a 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -321,6 +321,12 @@ function clickAdd(data: any) { orgChild2Name: data.orgChild2Name, orgChild3Name: data.orgChild3Name, orgChild4Name: data.orgChild4Name, + + root: data.root, + child1: data.orgChild1, + child2: data.orgChild2, + child3: data.orgChild3, + child4: data.orgChild4, }; dialogConfirm( $q,