เเก้get list ผู้ดูแล, ผู้บังคับบัญา และประธานกรรมการ || disable input ผู้บังคับบัญชา คณะกรรมการ
This commit is contained in:
parent
7dbbfd5fcf
commit
614356c063
4 changed files with 143 additions and 48 deletions
|
|
@ -161,7 +161,7 @@
|
|||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
option-value="personal_id"
|
||||
option-value="id"
|
||||
:options="filtermantor(OPcaretaker, [caretaker2])"
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
|
|
@ -171,13 +171,13 @@
|
|||
:outlined="routeName == 'probationWorkAdd'"
|
||||
v-model="caretaker1"
|
||||
:label="`ผู้ดูแลคนที่ 1`"
|
||||
option-label="name"
|
||||
option-label="fullName"
|
||||
/>
|
||||
<q-select
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
option-value="personal_id"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
hide-bottom-space
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
|
|
@ -1306,8 +1306,8 @@
|
|||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:options="filtermantor(OPcaretaker, [caretaker2])"
|
||||
option-value="personal_id"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
|
|
@ -1359,8 +1359,8 @@
|
|||
</div>
|
||||
<q-select
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
option-value="personal_id"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
|
|
@ -1421,8 +1421,8 @@
|
|||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:options="OPcommander"
|
||||
option-value="personal_id"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
|
|
@ -1482,8 +1482,8 @@
|
|||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:options="OPchairman"
|
||||
option-value="personal_id"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-label="fullName"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="routeName != 'probationWorkAdd'"
|
||||
dense
|
||||
|
|
@ -1551,7 +1551,7 @@ const filtermantor = (options: any[], excludedGroups: any[]) => {
|
|||
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<number | string>();
|
|||
const caretaker1 = ref<string>("");
|
||||
const caretaker2 = ref<string>("");
|
||||
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<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) => ({
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue