เพิ่ม status แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ option-label
This commit is contained in:
parent
de439c931d
commit
6823876fa4
1 changed files with 206 additions and 125 deletions
|
|
@ -13,7 +13,7 @@
|
|||
@click="router.go(-1)"
|
||||
v-if="routeName == 'probationWorkAdd'"
|
||||
/>
|
||||
<div v-if="routeName == 'probationWorkAdd'">
|
||||
<div v-if="routeName !== 'probationWorkAdd'">
|
||||
เพิ่มแบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ
|
||||
</div>
|
||||
<div v-else>แบบมอบหมายงานการทดลองปฏิบัติหน้าที่ราชการ</div>
|
||||
|
|
@ -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 คน)
|
||||
</div>
|
||||
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<div v-if="status == true" class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
option-value="id"
|
||||
|
|
@ -188,6 +190,36 @@
|
|||
:label="`ผู้ดูแลคนที่ 2`"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
option-value="id"
|
||||
:options="filtermantor(OPcaretaker, [caretaker2])"
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
hide-bottom-space
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretaker1"
|
||||
:label="`ผู้ดูแลคนที่ 1`"
|
||||
option-label="name"
|
||||
/>
|
||||
<q-select
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-bottom-space
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretaker2"
|
||||
:label="`ผู้ดูแลคนที่ 2`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator size="3px" color="grey-2" />
|
||||
|
|
@ -300,7 +332,9 @@
|
|||
>
|
||||
<div class="col-11 q-my-xs">
|
||||
<q-select
|
||||
:option-label="(item) => `${item.title}-${item.description}`"
|
||||
:option-label="
|
||||
(item) => `${item.title}-${item.description}`
|
||||
"
|
||||
option-value="id"
|
||||
map-options
|
||||
:rules="
|
||||
|
|
@ -322,17 +356,16 @@
|
|||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="index > 2"
|
||||
v-if="index > 2"
|
||||
class="col-xs-12 col-sm-1 flex justify-center items-center"
|
||||
>
|
||||
<q-btn
|
||||
v-if="routeName == 'probationWorkAdd'"
|
||||
v-if="routeName == 'probationWorkAdd'"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-trash-can-outline"
|
||||
@click="deleteknowledge(index)"
|
||||
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -371,13 +404,11 @@
|
|||
v-if="item.status_select === 1"
|
||||
v-model="item.checked"
|
||||
dense
|
||||
|
||||
:disable="routeName != 'probationWorkAdd'"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="index === 0" class="col-11" >
|
||||
<div v-if="index === 0" class="col-11">
|
||||
{{ item.description }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -911,7 +942,6 @@
|
|||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1147,7 +1177,7 @@
|
|||
<li>
|
||||
อื่นๆ (ถ้ามี)
|
||||
<q-input
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
|
|
@ -1305,7 +1335,8 @@
|
|||
</div>
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:options="filtermantor(OPcaretaker, [caretaker2])"
|
||||
v-if="status == true"
|
||||
:options="filtermantor(OPcaretaker, [caretaker2])"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
class="col-xs-12 col-sm-8"
|
||||
|
|
@ -1316,6 +1347,19 @@
|
|||
v-model="caretaker1"
|
||||
label="ผู้ดูแลคนที่ 1"
|
||||
/>
|
||||
<q-select
|
||||
v-else
|
||||
:options="filtermantor(OPcaretaker, [caretaker2])"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretaker1"
|
||||
label="ผู้ดูแลคนที่ 1"
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -1358,7 +1402,8 @@
|
|||
</datepicker>
|
||||
</div>
|
||||
<q-select
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
v-if="status == true"
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
class="col-xs-12 col-sm-8"
|
||||
|
|
@ -1369,6 +1414,19 @@
|
|||
v-model="caretaker2"
|
||||
label="ผู้ดูแลคนที่ 2"
|
||||
/>
|
||||
<q-select
|
||||
v-else
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretaker2"
|
||||
label="ผู้ดูแลคนที่ 2"
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -1420,6 +1478,7 @@
|
|||
</div>
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
v-if="status == true"
|
||||
:options="OPcommander"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
|
|
@ -1431,6 +1490,19 @@
|
|||
v-model="commander"
|
||||
label="ผู้บังคับบัญชา"
|
||||
/>
|
||||
<q-select
|
||||
v-else
|
||||
:options="OPcommander"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="commander"
|
||||
label="ผู้บังคับบัญชา"
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -1481,6 +1553,7 @@
|
|||
</div>
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
v-if="status == true"
|
||||
:options="OPchairman"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
|
|
@ -1492,7 +1565,19 @@
|
|||
v-model="chairman"
|
||||
label="ประธานกรรมการ"
|
||||
/>
|
||||
|
||||
<q-select
|
||||
v-else
|
||||
:options="OPchairman"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
borderless
|
||||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="chairman"
|
||||
label="ประธานกรรมการ"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1529,7 +1614,7 @@ const val1 = ref([
|
|||
checked: false,
|
||||
},
|
||||
]);
|
||||
|
||||
const status = ref<boolean>(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<string>("");
|
|||
const caretaker2 = ref<string>("");
|
||||
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<CheckboxItem[]>([]);
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue