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" >