เพิ่มฟิล
This commit is contained in:
parent
d99676095f
commit
c0002e203c
2 changed files with 48 additions and 269 deletions
|
|
@ -301,88 +301,6 @@ function deleteProductivitys(item: number) {
|
|||
}
|
||||
}
|
||||
|
||||
/** get ข้อมูล */
|
||||
async function getUser() {
|
||||
await http
|
||||
.get(config.API.orgProfilePlacement(personalId))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
|
||||
OPcaretaker.value = data.caregiver.map((item: any) => ({
|
||||
id: item.id,
|
||||
name:
|
||||
(item.prefix == null ? "" : item.prefix) +
|
||||
item.firstName +
|
||||
" " +
|
||||
item.lastName,
|
||||
label: item.position
|
||||
? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||
item.lastName
|
||||
} (${item.position}${
|
||||
item.posLevel && item.posType
|
||||
? ", " + item.posType + ": " + item.posLevel
|
||||
: ""
|
||||
})`
|
||||
: `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||
item.lastName
|
||||
}`,
|
||||
citizenId: item.citizenId,
|
||||
isDirector: item.isDirector,
|
||||
posLevel: item.posLevel,
|
||||
posType: item.posType,
|
||||
position: item.position,
|
||||
}));
|
||||
|
||||
// OPcommander.value = data.commander.map((item: any) => ({
|
||||
// id: item.id,
|
||||
// name:
|
||||
// (item.prefix == null ? "" : item.prefix) +
|
||||
// item.firstName +
|
||||
// " " +
|
||||
// item.lastName,
|
||||
// label: item.position
|
||||
// ? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||
// item.lastName
|
||||
// } (${item.position}${
|
||||
// item.posLevel && item.posType
|
||||
// ? ", " + item.posType + ": " + item.posLevel
|
||||
// : ""
|
||||
// })`
|
||||
// : `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||
// item.lastName
|
||||
// }`,
|
||||
// citizenId: item.citizenId,
|
||||
// posLevel: item.posLevel,
|
||||
// posType: item.posType,
|
||||
// position: item.position,
|
||||
// }));
|
||||
|
||||
// OPchairman.value = data.chairman.map((item: any) => ({
|
||||
// id: item.id,
|
||||
// name:
|
||||
// (item.prefix == null ? "-" : item.prefix) +
|
||||
// item.firstName +
|
||||
// " " +
|
||||
// item.lastName,
|
||||
// label: item.position
|
||||
// ? `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${
|
||||
// item.lastName
|
||||
// } (${item.position}${
|
||||
// item.posLevel && item.posType
|
||||
// ? ", " + item.posType + ": " + item.posLevel
|
||||
// : ""
|
||||
// })`
|
||||
// : `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${
|
||||
// item.lastName
|
||||
// }`,
|
||||
// citizenId: item.citizenId,
|
||||
// posLevel: item.posLevel,
|
||||
// posType: item.posType,
|
||||
// position: item.position,
|
||||
// }));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*ดึงข้อมูลที่ได้รับมอบหมาย
|
||||
* @param id personal id
|
||||
|
|
@ -837,6 +755,7 @@ async function getAssign() {
|
|||
isEdit.value = false;
|
||||
const data = res.data.data;
|
||||
fullname.value = data.profile.name;
|
||||
appointTopic.value = data.assign.appointId
|
||||
position.value = data.profile.positionName;
|
||||
date_start.value = data.assign.date_start;
|
||||
date_finish.value = data.assign.date_finish;
|
||||
|
|
@ -1063,55 +982,48 @@ function updateAppointMent() {
|
|||
const dataFindChairman = data.find(
|
||||
(item: AppointTopic) => item.role === "chairman"
|
||||
);
|
||||
const dataFindCommittee = data
|
||||
.filter((item: AppointTopic) => item.role === "committee")
|
||||
.map((i: AppointTopic) => ({
|
||||
id: i.id,
|
||||
name: i.name,
|
||||
label: i.position
|
||||
? `${i.name} (${i.position}${
|
||||
i.positionLevel && i.positionType
|
||||
? ", " + i.positionType + ": " + i.positionLevel
|
||||
: ""
|
||||
})`
|
||||
: i.name,
|
||||
posLevel: i.positionLevel,
|
||||
posType: i.positionType,
|
||||
position: i.position,
|
||||
}));
|
||||
const createChairmanObject = (chairmanData: AppointTopic) => ({
|
||||
id: chairmanData.id,
|
||||
name: chairmanData.name,
|
||||
label: chairmanData.position
|
||||
? `${chairmanData.name} (${chairmanData.position}${
|
||||
chairmanData.positionLevel && chairmanData.positionType
|
||||
? ", " +
|
||||
chairmanData.positionType +
|
||||
": " +
|
||||
chairmanData.positionLevel
|
||||
const dataFindCommittee = data.find(
|
||||
(item: AppointTopic) => item.role === "committee"
|
||||
);
|
||||
const dataFindCaretaker1 = data.filter(
|
||||
(item: AppointTopic) => item.role === "caregiver"
|
||||
)[0];
|
||||
const dataFindCaretaker2 = data.filter(
|
||||
(item: AppointTopic) => item.role === "caregiver"
|
||||
)[1];
|
||||
|
||||
const createChairmanObject = (dataPerson: AppointTopic) => ({
|
||||
id: dataPerson.id,
|
||||
name: dataPerson.name,
|
||||
label: dataPerson.position
|
||||
? `${dataPerson.name} (${dataPerson.position}${
|
||||
dataPerson.positionLevel && dataPerson.positionType
|
||||
? ", " + dataPerson.positionType + ": " + dataPerson.positionLevel
|
||||
: ""
|
||||
})`
|
||||
: chairmanData.name,
|
||||
posLevel: chairmanData.positionLevel,
|
||||
posType: chairmanData.positionType,
|
||||
position: chairmanData.position,
|
||||
: dataPerson.name,
|
||||
posLevel: dataPerson.positionLevel,
|
||||
posType: dataPerson.positionType,
|
||||
position: dataPerson.position,
|
||||
});
|
||||
|
||||
OPcaretakerNew.value = dataFindCommittee;
|
||||
OPcommander.value = dataFindCommittee;
|
||||
|
||||
OPchairmanFn.value = dataFindChairman
|
||||
? createChairmanObject(dataFindChairman)
|
||||
caretaker1.value = dataFindCaretaker1
|
||||
? createChairmanObject(dataFindCaretaker1)
|
||||
: null;
|
||||
caretaker2.value = dataFindCaretaker2
|
||||
? createChairmanObject(dataFindCaretaker2)
|
||||
: null;
|
||||
chairman.value = dataFindChairman
|
||||
? createChairmanObject(dataFindChairman)
|
||||
: null;
|
||||
commander.value = dataFindCommittee
|
||||
? createChairmanObject(dataFindCommittee)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
/** เมื่อโหลดหน้า เรียกใช้งานฟังชั่น */
|
||||
onMounted(async () => {
|
||||
await getUser();
|
||||
await getAssignNew(personalId);
|
||||
await getLaw(personalId);
|
||||
await getSkill(personalId);
|
||||
|
|
@ -1396,13 +1308,14 @@ onMounted(async () => {
|
|||
<q-avatar class="bg-grey-2 q-mr-sm" size="28px">2</q-avatar>
|
||||
ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ (อาจมีได้มากกว่า 1 คน)
|
||||
</div>
|
||||
<div v-if="isEdit == true" class="col-12 row q-col-gutter-md">
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
option-value="id"
|
||||
hide-dropdown-icon
|
||||
readonly
|
||||
:options="OPcaretakerNew"
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="isEdit != true"
|
||||
dense
|
||||
hide-bottom-space
|
||||
outlined
|
||||
|
|
@ -1430,8 +1343,9 @@ onMounted(async () => {
|
|||
option-label="label"
|
||||
hide-bottom-space
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="isEdit != true"
|
||||
dense
|
||||
hide-dropdown-icon
|
||||
readonly
|
||||
borderless
|
||||
outlined
|
||||
v-model="caretaker2"
|
||||
|
|
@ -1450,40 +1364,6 @@ onMounted(async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div v-else class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
option-value="id"
|
||||
:options="filtermantor(OPcaretakerNew, [caretaker2])"
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="!isEdit && routeName !== 'probationWorkAdd'"
|
||||
dense
|
||||
bg-color="white"
|
||||
hide-bottom-space
|
||||
borderless
|
||||
outlined
|
||||
v-model="caretaker1"
|
||||
:label="`ผู้ดูแลคนที่ 1`"
|
||||
option-label="label"
|
||||
/>
|
||||
|
||||
<q-select
|
||||
clearable
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])"
|
||||
option-value="id"
|
||||
option-label="label"
|
||||
hide-bottom-space
|
||||
class="col-xs-12 col-sm-6"
|
||||
:readonly="!isEdit && routeName !== 'probationWorkAdd'"
|
||||
bg-color="white"
|
||||
dense
|
||||
borderless
|
||||
outlined
|
||||
v-model="caretaker2"
|
||||
:label="`ผู้ดูแลคนที่ 2`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator size="3px" color="grey-2" />
|
||||
|
|
@ -2666,38 +2546,12 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
v-if="isEdit == true"
|
||||
:options="optionCaretaker"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="isEdit != true"
|
||||
dense
|
||||
borderless
|
||||
outlined
|
||||
v-model="caretaker1"
|
||||
label="ผู้ดูแลคนที่ 1"
|
||||
@filter="filterFnCaretaker"
|
||||
use-input
|
||||
behavior="menu"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
v-else
|
||||
:options="optionCaretaker"
|
||||
option-value="id"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="!isEdit && routeName !== 'probationWorkAdd'"
|
||||
dense
|
||||
hide-dropdown-icon
|
||||
readonly
|
||||
borderless
|
||||
outlined
|
||||
v-model="caretaker1"
|
||||
|
|
@ -2761,13 +2615,13 @@ onMounted(async () => {
|
|||
|
||||
<q-select
|
||||
clearable
|
||||
v-if="isEdit == true"
|
||||
:options="optionCaretaker2"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="isEdit != true"
|
||||
dense
|
||||
borderless
|
||||
hide-dropdown-icon
|
||||
readonly
|
||||
outlined
|
||||
v-model="caretaker2"
|
||||
label="ผู้ดูแลคนที่ 2"
|
||||
|
|
@ -2784,35 +2638,6 @@ onMounted(async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
clearable
|
||||
v-else
|
||||
:options="optionCaretaker2"
|
||||
option-value="id"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="
|
||||
(!isEdit && routeName !== 'probationWorkAdd') || caretaker1
|
||||
"
|
||||
dense
|
||||
borderless
|
||||
outlined
|
||||
v-model="caretaker2"
|
||||
label="ผู้ดูแลคนที่ 2"
|
||||
@filter="filterFnCaretaker2"
|
||||
use-input
|
||||
behavior="menu"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
v-model="date3"
|
||||
|
|
@ -2874,11 +2699,11 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
v-if="isEdit == true"
|
||||
:options="OPcommanderFn"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="isEdit != true"
|
||||
hide-dropdown-icon
|
||||
readonly
|
||||
dense
|
||||
borderless
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกผู้บังคับบัญชา']"
|
||||
|
|
@ -2899,33 +2724,6 @@ onMounted(async () => {
|
|||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
v-else
|
||||
:options="OPcommanderFn"
|
||||
option-value="id"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
:readonly="!isEdit && routeName !== 'probationWorkAdd'"
|
||||
dense
|
||||
:rules="[(val:string) => !!val || 'กรุณาเลือกผู้บังคับบัญชา']"
|
||||
borderless
|
||||
outlined
|
||||
v-model="commander"
|
||||
label="ผู้บังคับบัญชา"
|
||||
use-input
|
||||
behavior="menu"
|
||||
@filter="filterFnCommander"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker
|
||||
v-model="date4"
|
||||
|
|
@ -2979,7 +2777,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<q-select
|
||||
v-if="isEdit == true"
|
||||
:options="OPchairmanFn"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
|
|
@ -2990,31 +2787,7 @@ onMounted(async () => {
|
|||
v-model="chairman"
|
||||
label="ประธานกรรมการ"
|
||||
use-input
|
||||
behavior="menu"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
v-else
|
||||
:options="OPchairmanFn"
|
||||
option-value="id"
|
||||
option-label="label"
|
||||
class="col-xs-12 col-sm-8"
|
||||
readonly
|
||||
dense
|
||||
borderless
|
||||
outlined
|
||||
v-model="chairman"
|
||||
label="ประธานกรรมการ"
|
||||
use-input
|
||||
hide-dropdown-icon
|
||||
behavior="menu"
|
||||
bg-color="white"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -321,6 +321,12 @@ function clickAdd(data: any) {
|
|||
orgChild2Name: data.orgChild2Name,
|
||||
orgChild3Name: data.orgChild3Name,
|
||||
orgChild4Name: data.orgChild4Name,
|
||||
|
||||
root: data.root,
|
||||
child1: data.orgChild1,
|
||||
child2: data.orgChild2,
|
||||
child3: data.orgChild3,
|
||||
child4: data.orgChild4,
|
||||
};
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue