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/api/05_placement/api.probation.ts b/src/api/05_placement/api.probation.ts index 6cf5144e4..db4aadfa1 100644 --- a/src/api/05_placement/api.probation.ts +++ b/src/api/05_placement/api.probation.ts @@ -41,17 +41,17 @@ export default { //แบบประเมินผล (ผู้บังคับบัญชา) evaluateCreate: (id: string) => `${evaluate}/evaluate/create?assign_id=${id}`, evaluatecommader: (id: string, no: string) => `${evaluate}/evaluate?assign_id=${id}&evaluate_no=${no}`, - createformCommader: (id: string) => `${evaluate}/evaluate?id=${id}`, + createformCommader: (id: string) => `${evaluate}/evaluate?assign_id=${id}`, //แบบประเมินผล (คณะกรรมการ) evaluateChairman: (id: string) => `${evaluate}/evaluate-chairman/create?assign_id=${id}`, evaluateRoundChairman: (id: string, no: string) => `${evaluate}/evaluate-chairman?assign_id=${id}&evaluate_no=${no}`, - createformChairman: (id: string) => `${evaluate}/evaluate-chairman?id=${id}`, + createformChairman: (id: string) => `${evaluate}/evaluate-chairman?assign_id=${id}`, //แบบรายงาน evaluateReportcreate: (id: string) => `${evaluate}/evaluate-result/create?assign_id=${id}`, evaluateReport: (id: string) => `${evaluate}/evaluate-result?assign_id=${id}`, - createformReport: (id: string) => `${evaluate}/evaluate-result?id=${id}`, + createformReport: (id: string) => `${evaluate}/evaluate-result?assign_id=${id}`, diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 35a649ead..d7d872e79 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -13,7 +13,7 @@ @click="router.go(-1)" v-if="routeName == 'probationWorkAdd'" /> -
+
เพิ่มแบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ
แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ
@@ -117,7 +117,9 @@ :locale="'th'" autoApply borderless - :readonly="isDatePicker2Readonly|| routeName !== 'probationWorkAdd'" + :readonly=" + isDatePicker2Readonly || routeName !== 'probationWorkAdd' + " :enableTimePicker="false" week-start="0" > @@ -158,10 +160,40 @@ ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ (อาจมีได้มากกว่า 1 คน)
-
+
+ +
+
+
2" + v-if="index > 2" class="col-xs-12 col-sm-1 flex justify-center items-center" >
@@ -371,13 +404,11 @@ v-if="item.status_select === 1" v-model="item.checked" dense - :disable="routeName != 'probationWorkAdd'" />
-
+
{{ item.description }} -
@@ -911,7 +942,6 @@ - @@ -1147,7 +1177,7 @@
  • อื่นๆ (ถ้ามี)
    +
    +
    +
    + -
    @@ -1529,7 +1614,7 @@ const val1 = ref([ checked: false, }, ]); - +const status = ref(true); const router = useRouter(); const mixin = useCounterMixin(); const { @@ -1540,7 +1625,7 @@ const { messageError, showLoader, hideLoader, - dialogConfirm + dialogConfirm, } = mixin; const filterData = (options: any[], excludedGroups: any[]) => { return options.filter( @@ -1549,10 +1634,7 @@ const filterData = (options: any[], excludedGroups: any[]) => { }; const filtermantor = (options: any[], excludedGroups: any[]) => { return options.filter( - (item) => - !excludedGroups.some( - (group) => group && group.personal_id === item.personal_id - ) + (item) => !excludedGroups.some((group) => group && group.id === item.id) ); }; const filterMain = (options: any[], excludedGroups: any[]) => { @@ -1636,35 +1718,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; @@ -1703,7 +1788,7 @@ const OPknowledge = ref< Array<{ id: number; title: number; - description:string; + description: string; level: string; }> >([]); @@ -1752,6 +1837,38 @@ 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, + })); + }); +}; const getAssignNew = async (id: string) => { await http.get(config.API.newAssign(id)).then((res: any) => { const data = res.data.data; @@ -1762,9 +1879,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; }); @@ -1810,7 +1927,6 @@ const getSkill = async (id: string) => { const getLaw = async (id: string) => { await http.get(config.API.lawOptions(id)).then((res: any) => { checkRule.value = res.data.data; - }); }; @@ -1883,23 +1999,23 @@ 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, - role: "chairman" + personal_id: chairman.value.id, + role: "chairman", }, ]; @@ -1947,22 +2063,22 @@ const putData = (id: string) => { return data; }; -const saveData = (id:string) => { - dialogConfirm($q,()=>DataSave(id)) -} +const saveData = (id: string) => { + dialogConfirm($q, () => DataSave(id)); +}; const DataSave = async (id: string) => { - await myForm.value.validate().then((result: boolean) => { + await myForm.value.validate().then((result: boolean) => { if (result) { - const data = putData(id); - http - .post(config.API.saveFinish(id), data) - .then((res) => { - router.push(`/probation/detail/${id}`); - }) - .catch((e) => {}) - .finally(() => { - hideLoader(); - }); + const data = putData(id); + http + .post(config.API.saveFinish(id), data) + .then((res) => { + router.push(`/probation/detail/${id}`); + }) + .catch((e) => {}) + .finally(() => { + hideLoader(); + }); } else { notifyError($q, "กรุณากรอกข้อมูลให้ครบ"); } @@ -2010,61 +2126,67 @@ const skillIds = [1, 2, 3, 4]; const getAssign = async () => { await http.get(config.API.probationsGetAssign(assignId.value)).then((res) => { + status.value = false; const data = res.data.data; console.log("ASSIGN-list ==>", data); - fullname.value = data.profile.name - position.value = data.profile.OrganizationOrganization - date_start.value = data.assign.date_start - date_finish.value = data.assign.date_finish - date1.value = data.assign.experimenter_dated - date2.value = data.mentors[0].dated - date3.value = data.mentors[1].dated - date4.value = data.commander.dated - activity_desc.value = data.jobs.map((job:any) => job.activity_desc); - goal_desc.value = data.jobs.map((job:any) => job.goal_desc); - activityCount.value = data.jobs.length + fullname.value = data.profile.name; + position.value = data.profile.OrganizationOrganization; + date_start.value = data.assign.date_start; + date_finish.value = data.assign.date_finish; + date1.value = data.assign.experimenter_dated; + date2.value = data.mentors[0].dated; + date3.value = data.mentors[1].dated; + date4.value = data.commander.dated; + activity_desc.value = data.jobs.map((job: any) => job.activity_desc); + goal_desc.value = data.jobs.map((job: any) => job.goal_desc); + 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 - knowledge.value = data.knowledges.map((id:any)=> id.id) - knowledgeCount.value = data.knowledges.length - other_desc.value = data.assign.other_desc - other4_desc.value = data.assign.other4_desc - other5_no1_desc.value = data.assign.other5_no1_desc + commander.value = data.commander.name; + knowledge.value = data.knowledges.map((id: any) => id.id); + knowledgeCount.value = data.knowledges.length; + other_desc.value = data.assign.other_desc; + other4_desc.value = data.assign.other4_desc; + other5_no1_desc.value = data.assign.other5_no1_desc; const skills = data.skills.map((skills: any) => ({ id: skills.id, title: skills.title, level: skills.level, level_description: skills.description, })); - [skill.value, skill2.value, skill3.value, skill4.value] = skills; + [skill.value, skill2.value, skill3.value, skill4.value] = skills; - main.value = data.competencys[0] - main2.value = data.competencys[1] - main3.value = data.competencys[2] - main4.value = data.competencys[3] - main5.value = data.competencys[4] + main.value = data.competencys[0]; + main2.value = data.competencys[1]; + main3.value = data.competencys[2]; + main4.value = data.competencys[3]; + main5.value = data.competencys[4]; - group.value = data.competency_groups[0] - group2.value = data.competency_groups[1] - group3.value = data.competency_groups[2] + group.value = data.competency_groups[0]; + group2.value = data.competency_groups[1]; + group3.value = data.competency_groups[2]; output_desc.value = data.outputs.map((output: any) => output.output_desc); - indicator_desc.value = data.outputs.map((output: any) => output.indicator_desc); + indicator_desc.value = data.outputs.map( + (output: any) => output.indicator_desc + ); productivityCount.value = data.outputs.length; checkRule.value = data.laws.map((law: any) => ({ - id: law.law_id, - checked: law.selected, - description: law.description, - status_select: law.status_select, - -})); - console.log("🚀 ~ file: FormAssign.vue:2009 ~ awaithttp.get ~ checkRule:", checkRule.value) - }) + id: law.law_id, + checked: law.selected, + description: law.description, + status_select: law.status_select, + })); + console.log( + "🚀 ~ file: FormAssign.vue:2009 ~ awaithttp.get ~ checkRule:", + checkRule.value + ); + }); }; -onMounted(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" >