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