From 614356c063fe915b5c30a321351c09f5037c1e03 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 21 Aug 2023 11:34:56 +0700 Subject: [PATCH 1/4] =?UTF-8?q?=E0=B9=80=E0=B9=80=E0=B8=81=E0=B9=89get=20l?= =?UTF-8?q?ist=20=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=94=E0=B8=B9=E0=B9=81?= =?UTF-8?q?=E0=B8=A5,=20=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=87=E0=B8=84=E0=B8=B1=E0=B8=9A=E0=B8=9A=E0=B8=B1=E0=B8=8D?= =?UTF-8?q?=E0=B8=B2=20=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=98=E0=B8=B2=E0=B8=99=E0=B8=81=E0=B8=A3=E0=B8=A3?= =?UTF-8?q?=E0=B8=A1=E0=B8=81=E0=B8=B2=E0=B8=A3=20||=20disable=20input=20?= =?UTF-8?q?=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=9A=E0=B8=B1=E0=B8=87=E0=B8=84?= =?UTF-8?q?=E0=B8=B1=E0=B8=9A=E0=B8=9A=E0=B8=B1=E0=B8=8D=E0=B8=8A=E0=B8=B2?= =?UTF-8?q?=20=E0=B8=84=E0=B8=93=E0=B8=B0=E0=B8=81=E0=B8=A3=E0=B8=A3?= =?UTF-8?q?=E0=B8=A1=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/05_placement/api.placement.ts | 1 + .../components/probation/FormAssign.vue | 130 ++++++++++++------ .../FormEvaluation/FormEvaluateAdd.vue | 27 ++++ .../FormEvaluation/FormEvaluateScoreAdd.vue | 33 ++++- 4 files changed, 143 insertions(+), 48 deletions(-) diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index 775d8d572..f83d400c7 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -150,4 +150,5 @@ export default { otherReport: (id: string) => `${placemenOther}/report/${id}`, otherByid: (id: string) => `${placemenOther}/${id}`, + userPlacement:(id:string) => `${placement}/user/${id}` }; diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 35a649ead..70da27e01 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -161,7 +161,7 @@
{ return options.filter( (item) => !excludedGroups.some( - (group) => group && group.personal_id === item.personal_id + (group) => group && group.id === item.id ) ); }; @@ -1636,35 +1636,38 @@ const monthSelect = ref(); const caretaker1 = ref(""); const caretaker2 = ref(""); const OPcaretaker = ref< - { - personal_id: string; - name: string; - PositionId: string; - PositionLevelId: string; - PositionLineId: string; - OrganizationOrganization: string; - }[] + Array<{ + id: string, + prefix: string, + firstName: string, + lastName: string, + fullName:string, + citizenId: number, + isDirector: boolean + }>[] >([]); const OPcommander = ref< - { - personal_id: string; - name: string; - PositionId: string; - PositionLevelId: string; - PositionLineId: string; - OrganizationOrganization: string; - }[] + Array<{ + id: string, + prefix: string, + firstName: string, + lastName: string, + fullName:string, + citizenId: number, + isDirector: boolean + }>[] >([]); const OPchairman = ref< - { - personal_id: string; - name: string; - PositionId: string; - PositionLevelId: string; - PositionLineId: string; - OrganizationOrganization: string; - }[] + Array<{ + id: string, + prefix: string, + firstName: string, + lastName: string, + fullName:string, + citizenId: number, + isDirector: boolean + }>[] >([]); interface MonthOption { value: number; @@ -1752,6 +1755,44 @@ interface CheckboxItem { } const checkRule = ref([]); +const getUser = async () => { +await http.get(config.API.userPlacement(personalId)) +.then((res:any) => { + const data = res.data.result + OPcaretaker.value = data.caregiver.map((item:any) => ({ + id: item.id, + prefix:item.prefix, + firstName:item.firstName, + lastName:item.lastName, + fullName:item.prefix + "" + item.firstName + " " + item.lastName, + citizenId:item.citizenId, + isDirector:item.isDirector + + })); + OPcommander.value = data.commander.map((item:any) => ({ + id: item.id, + prefix:item.prefix, + firstName:item.firstName, + lastName:item.lastName, + fullName:item.prefix + "" + item.firstName + " " + item.lastName, + citizenId:item.citizenId, + isDirector:item.isDirector + + })); + OPchairman.value = data.chairman.map((item:any) => ({ + id: item.id, + prefix:item.prefix, + firstName:item.firstName, + lastName:item.lastName, + fullName:item.prefix + "" + item.firstName + " " + item.lastName, + citizenId:item.citizenId, + isDirector:item.isDirector + + })); + console.log("🚀 ~ file: FormAssign.vue:1760 ~ .then ~ OPcaretaker:", OPcaretaker.value) + console.log("user==",data) +}) +} const getAssignNew = async (id: string) => { await http.get(config.API.newAssign(id)).then((res: any) => { const data = res.data.data; @@ -1762,9 +1803,9 @@ const getAssignNew = async (id: string) => { console.log("Assign-New", data); monthOp.push(monthOption); monthSelect.value = `${data.assign_month} เดือน`; - OPcaretaker.value = data.mentors; - OPcommander.value = [data.commander]; - OPchairman.value = [data.chairman]; + // OPcaretaker.value = data.mentors; + // OPcommander.value = [data.commander]; + // OPchairman.value = [data.chairman]; fullname.value = data.person.name; position.value = data.person.OrganizationOrganization; }); @@ -1883,22 +1924,22 @@ const putData = (id: string) => { const assign_director = [ { - personal_id: caretaker1.value.personal_id, + personal_id: caretaker1.value.id, role: "mentor", dated: date2.value instanceof Date ? dateToISO(date2.value) : null, }, { - personal_id: caretaker2.value.personal_id, + personal_id: caretaker2.value.id, role: "mentor", dated: date3.value instanceof Date ? dateToISO(date3.value) : null, }, { - personal_id: commander.value.personal_id, + personal_id: commander.value.id, role: "commander", dated: date4.value instanceof Date ? dateToISO(date4.value) : null, }, { - personal_id: chairman.value.personal_id, + personal_id: chairman.value.id, role: "chairman" }, ]; @@ -2065,6 +2106,7 @@ const getAssign = async () => { }) }; onMounted(async() => { + await getUser(); await getLaw(personalId); await getcompetency(personalId); await getCompetencyGroup(personalId); diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue index e565c6aaa..e386ac007 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue @@ -334,6 +334,7 @@ const putformData = () => { { { { { { { 1.7 อื่นๆ { { { { { { 2.4 อื่นๆ { { { จุดเด่น (ไม่เกิน 5 บรรทัด)
{ สิ่งที่ควรปรับปรุง (ไม่เกิน 5 บรรทัด) {
{ label="ดำเนินการเเล้ว" /> {
{ label="ดำเนินการเเล้ว" /> {
{ label="ดำเนินการเเล้ว" /> {
{ label="ดำเนินการเเล้ว" /> { borderless :enableTimePicker="false" week-start="0" + :readonly="!status" >