diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 341971cc2..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,7 +160,7 @@ ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ (อาจมีได้มากกว่า 1 คน)
-
+
+
+ + +
@@ -300,7 +332,9 @@ >
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.id === item.id - ) + (item) => !excludedGroups.some((group) => group && group.id === item.id) ); }; const filterMain = (options: any[], excludedGroups: any[]) => { @@ -1637,36 +1719,36 @@ const caretaker1 = ref(""); const caretaker2 = ref(""); const OPcaretaker = ref< Array<{ - id: string, - prefix: string, - firstName: string, - lastName: string, - fullName:string, - citizenId: number, - isDirector: boolean + id: string; + prefix: string; + firstName: string; + lastName: string; + fullName: string; + citizenId: number; + isDirector: boolean; }>[] >([]); const OPcommander = ref< Array<{ - id: string, - prefix: string, - firstName: string, - lastName: string, - fullName:string, - citizenId: number, - isDirector: boolean + id: string; + prefix: string; + firstName: string; + lastName: string; + fullName: string; + citizenId: number; + isDirector: boolean; }>[] >([]); const OPchairman = ref< Array<{ - id: string, - prefix: string, - firstName: string, - lastName: string, - fullName:string, - citizenId: number, - isDirector: boolean + id: string; + prefix: string; + firstName: string; + lastName: string; + fullName: string; + citizenId: number; + isDirector: boolean; }>[] >([]); interface MonthOption { @@ -1706,7 +1788,7 @@ const OPknowledge = ref< Array<{ id: number; title: number; - description:string; + description: string; level: string; }> >([]); @@ -1756,42 +1838,37 @@ 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) => ({ + 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 - + 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) => ({ + 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 - + 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) => ({ + 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 - + 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; @@ -1850,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; - }); }; @@ -1939,7 +2015,7 @@ const putData = (id: string) => { }, { personal_id: chairman.value.id, - role: "chairman" + role: "chairman", }, ]; @@ -1987,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, "กรุณากรอกข้อมูลให้ครบ"); } @@ -2050,61 +2126,66 @@ 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);