ui / api exitinterview detail

This commit is contained in:
AnandaTon 2023-08-25 10:53:40 +07:00
parent 955e651dae
commit a948ad280d
2 changed files with 402 additions and 267 deletions

View file

@ -10,12 +10,12 @@
class="q-mr-sm"
@click="router.go(-1)"
/>
รายละเอยด Exit interview ของ {{ responseData.fullname }}
รายละเอยด Exit interview ของ {{ fullname }}
</div>
<q-card bordered class="row col-12 text-dark">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-subtitle2">
{{ responseData.fullname }}
{{ fullname }}
</div>
<q-space />
</div>
@ -23,17 +23,14 @@
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-3 col-sm-2 col-md-1 row">
<q-img
:src="responseData.avataPath"
v-if="responseData.avataPath !== ''"
/>
<q-img :src="avata" v-if="avata !== ''" />
<q-img src="@/assets/avatar_user.jpg" v-else />
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div>
<div class="col-12 text-detail">
{{ responseData.positionTypeOld }}
{{ Position }}
</div>
</div>
</div>
@ -41,7 +38,7 @@
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-detail">
{{ responseData.positionLevelOld }}
{{ PositionLevel }}
</div>
</div>
</div>
@ -49,7 +46,7 @@
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">
{{ responseData.organizationPositionOld }}
{{ Org }}
</div>
</div>
</div>
@ -98,180 +95,257 @@
</div>
<div class="col-12"><q-separator /></div>
<q-form ref="myForm">
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-12 row items-center">
<div class="col-12">
<div class="text-weight-bold text-grey">
แสดงขอมลแบบสอบถามเปนคำถามเเละคำตอบ
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12">
<q-card bordered flat>
<div
class="q-pa-xs bg-grey-2 row items-center q-py-sm q-px-md justify-center text-bold"
>
แบบสอบถาม
</div>
<q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-12 text-top0 items-center">
1. เหตใดทานจงตดสนใจรวมงานกบกรงเทพมหานคร (เลอกไดมากกว
1 )
</div>
</div>
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="organizationPositionOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
hide-bottom-space
:label="`${'ตำแหน่ง/สังกัด'}`"
type="textarea"
<q-option-group
:options="reasonWork_option"
type="checkbox"
v-model="reasonWork"
disable
/>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="positionTypeOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
hide-bottom-space
:label="`${'ตำแหน่งประเภท'}`"
/>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="positionLevelOld"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
hide-bottom-space
:label="`${'ระดับ'}`"
/>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="posNo"
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
hide-bottom-space
:label="`${'เลขที่'}`"
/>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<!-- <q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="salary"
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
hide-bottom-space
:label="`${'เงินเดือน'}`"
type="number"
/> -->
<CurrencyInput
v-model="salary"
:edit="edit"
:options="{
currency: 'THB',
}"
:label="`${'เงินเดือน'}`"
/>
</div>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-xs-6 col-sm-6 row items-center">
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="organization"
:rules="[(val) => !!val || `${'กรุณากรอกการให้ออกสังกัด'}`]"
hide-bottom-space
:label="`${'การให้ออกสังกัด'}`"
/>
</div>
</div>
<div class="col-xs-6 col-sm-6 row items-center">
<div class="col-12">
<datepicker
menu-class-name="modalfix"
:readonly="!edit"
v-model="date"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<div class="col-12 text-top0 items-center">
<q-item-label>
<q-input
:class="getClass(edit)"
:outlined="edit"
v-if="reasonWork.includes(12)"
v-model="reasonWorkOther"
disable
label="กรอกข้อความ"
dense
lazy-rules
:borderless="!edit"
:model-value="date !== null ? date2Thai(date) : null"
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
type="text"
autogrow
hide-bottom-space
:label="`${'ตั้งแต่วัน'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
outlined
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</div>
<div class="col-12 text-top0 items-center">
2. สำหรบการลาออกในครงน
านไดดทบทวนอยางจรงจงเปนระยะเวลานานเทาใด
</div>
<q-option-group
:options="timeThink_option"
type="radio"
v-model="timeThink"
disable
/>
<div class="col-12 text-top0 items-center">
3. จจยใดททำใหานตดสนใจลาออกจากราชการ (เลอกไดมากกว 1
)
</div>
<q-option-group
:options="exitFactor_option"
type="checkbox"
v-model="exitFactor"
disable
/>
<div class="col-12 text-top0 items-center">
<q-item-label>
<q-input
v-if="exitFactor.includes(15)"
v-model="exitFactorOther"
label="กรอกข้อความ"
dense
disable
lazy-rules
type="text"
autogrow
hide-bottom-space
outlined
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</div>
<div class="col-12 text-top0 items-center">
4. อะไรคอสงทานเหนวาควรปรบปร (เลอกไดมากกว 1 )
</div>
<q-list>
<q-option-group
:options="adjust_option"
type="checkbox"
v-model="adjust"
disable
/>
</q-list>
<div class="col-12 text-top0 items-center">
<q-item-label>
<q-input
v-if="adjust.includes(15)"
v-model="adjustOther"
label="กรอกอื่นๆ"
dense
disable
lazy-rules
type="text"
autogrow
hide-bottom-space
outlined
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</div>
<div class="col-12 text-top0 items-center">
5. โปรดระบสาเหตแทจร
ทำใหานตดสนใจลาออกจากการปฏราชการกบกรงเทพมหานคร ?
</div>
<q-input
class="col-12"
dense
disable
outlined
v-model="realReason"
label=" "
type="textarea"
/>
<div class="col-12 text-top0 items-center">
6. จจยใดทจะชวยทำใหานเปลยนใจ
ไมอยากลาออกจากการปฏราชการกบกรงเทพมหานคร
</div>
<q-input
class="col-12"
dense
outlined
disable
v-model="notExitFactor"
label=" "
type="textarea"
/>
<div class="col-12 text-top0 items-center">
7. านมงานใหมหรอไม าม (โปรดระบ
อบรทเอกชน/หนวยงานภาคร)
และอะไรคอสงททำงานใหมใหบทาน
งทานรกวาเปนทาพอใจมากกวาการปฏราชการกบกรงเทพมหานคร
</div>
<q-option-group
:options="haveJob_option"
type="radio"
v-model="haveJob"
disable
/>
<div class="col-12 text-top0 items-center">
<q-item-label>
<q-input
v-if="haveJob === true"
v-model="haveJobReason"
label="กรอกอื่นๆ"
dense
disable
lazy-rules
type="text"
autogrow
hide-bottom-space
outlined
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</div>
<div class="col-12 text-top0 items-center">
8. านจะแนะนำเพอนใหมารวมงานกบกรงเทพมหานครหรอไม (าไม
โปรดระบเหตผล)
</div>
<q-option-group
:options="suggestFriends_option"
type="radio"
v-model="suggestFriends"
disable
/>
<div class="col-12 text-top0 items-center">
<q-item-label>
<q-input
v-if="suggestFriends === false"
v-model="suggestFriendsReason"
label="กรอกอื่นๆ"
dense
lazy-rules
disable
type="text"
autogrow
hide-bottom-space
outlined
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</div>
<div class="col-12 text-top0 items-center">
9. หากทานมโอกาสในอนาคต
านอยากกลบมารวมงานกบกรงเทพมหานครหรอไม (าไม
โปรดระบเหตผล)
</div>
<q-option-group
:options="futureWork_option"
type="radio"
v-model="futureWork"
disable
/>
<div class="col-12 text-top0 items-center">
<q-item-label>
<q-input
v-if="futureWork === false"
v-model="futureWorkReason"
label="กรอกข้อความ"
dense
lazy-rules
type="text"
autogrow
hide-bottom-space
outlined
disable
class="bg-white"
:rules="[
(val) => (val && val.length > 0) || 'กรุณากรอกข้อความ',
]"
/>
</q-item-label>
</div>
<div class="col-12 text-top0 items-center">
10. ความคดเหนและขอเสนอแนะอ
</div>
<q-input
class="col-12"
dense
disable
outlined
v-model="suggestion"
label=" "
type="textarea"
/>
<q-separator />
</div>
</div>
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="reason"
:rules="[(val) => !!val || `${'กรุณากรอกหมายเหตุ '}`]"
hide-bottom-space
:label="`${'หมายเหตุ '}`"
type="textarea"
/>
</div>
</q-card>
</div>
</div>
</q-form>
@ -292,7 +366,9 @@ import type { QTableProps, QForm } from "quasar";
import type {
TypeFile,
ResponseDataDetail,
} from "@/modules/06_retirement/interface/response/expulsion";
} from "@/modules/06_retirement/interface/response/exit";
import PositionSide from "@/modules/01_metadata/components/positionEmployee/PositionSide.vue";
import FullCalendarComponent from "@fullcalendar/vue3";
const $q = useQuasar();
const route = useRoute();
@ -312,64 +388,126 @@ const {
const myForm = ref<QForm | null>(null);
const roleAdmin = ref<boolean>(false);
const edit = ref<boolean>(false);
const Org = ref<string>("");
const PositionLevel = ref<string>("");
const Position = ref<string>("");
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
const posNo = ref<string>("");
const salary = ref<number>(0);
const organization = ref<string>("");
const date = ref<Date | null>(null);
const reason = ref<string>("");
const exitFactor = ref<any>([]);
const reasonWork = ref<any>([]);
const adjust = ref<any>([]);
const timeThink = ref<any>([]);
const fullname = ref<any>("");
const avata = ref<any>("");
const realReason = ref<any>("");
const notExitFactor = ref<any>("");
const haveJob = ref<any>("");
const suggestFriends = ref<any>([]);
const futureWork = ref<any>([]);
const suggestion = ref<any>("");
const responseData = ref<ResponseDataDetail>({
personId: "",
avataPath: "",
createdAt: new Date(),
date: new Date(),
id: "",
organization: "",
organizationPositionOld: "",
positionLevelOld: "",
positionNumberOld: "",
positionTypeOld: "",
const reasonWorkOther = ref("");
const reasonWork_option = ref<any>([
{ label: "ความมั่นคงในการทำงาน ", value: 0 },
{ label: "สิทธิประโยชน์/สวัสดิการ", value: 1 },
{ label: "อัตราเงินเดือน ", value: 2 },
{ label: "ลักษณะงาน ", value: 3 },
{ label: "วัฒนธรรมการทำงานของข้าราชการ ", value: 4 },
{ label: "นโยบายของหน่วยงาน ", value: 5 },
{ label: "ระบบการทำงาน", value: 6 },
{ label: "สมดุลชีวิตการทำงาน ", value: 7 },
{ label: "บรรยากาศในการทำงาน ", value: 8 },
{ label: "การพัฒนาในสายอาชีพ ", value: 9 },
{ label: "โอกาสความก้าวหน้า ", value: 10 },
{ label: "การได้รับการยอมรับจากสังคม ", value: 11 },
{ label: "อื่น ๆ (ระบุ) ", value: 12 },
]);
const exitFactorOther = ref("");
const exitFactor_option = ref<any>([
{ label: "อัตราเงินเดือน ", value: 0 },
{ label: "สวัสดิการ", value: 1 },
{ label: "ลักษณะงาน ", value: 2 },
{ label: "ระบบการทำงาน ", value: 3 },
{ label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
{ label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
{ label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
{ label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
{ label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
{ label: "บรรยากาศในการทำงาน ", value: 9 },
{ label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
{ label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
{ label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
{ label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
{ label: "โอกาสความก้าวหน้า ", value: 14 },
{ label: "อื่น ๆ (ระบุ) ", value: 15 },
]);
const suggestFriendsReason = ref("");
const suggestFriends_option = ref<any>([
{ label: "แนะนำ ", value: true },
{ label: "ไม่แนะนำ (ระบุ)", value: false },
]);
const timeThink_option = ref<any>([
{ label: "น้อยกว่า 2 สัปดาห์ ", value: 0 },
{ label: "1 เดือน - 3 เดือน", value: 1 },
{ label: "3 เดือน - 6 เดือน ", value: 2 },
{ label: "6 เดือนขึ้นไป ", value: 3 },
]);
const haveJobReason = ref<any>("");
const haveJob_option = ref<any>([
{ label: "มี (ระบุ) ", value: true },
{ label: "ไม่มี", value: false },
]);
const futureWorkReason = ref<any>("");
const futureWork_option = ref<any>([
{ label: "อยาก ", value: true },
{ label: "ไม่อยาก (ระบุ)", value: false },
]);
const adjustOther = ref("");
const adjust_option = ref<any>([
{ label: "อัตราเงินเดือน ", value: 0 },
{ label: "สวัสดิการ", value: 1 },
{ label: "ลักษณะงาน ", value: 2 },
{ label: "ระบบการทำงาน ", value: 3 },
{ label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
{ label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
{ label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
{ label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
{ label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
{ label: "บรรยากาศในการทำงาน ", value: 9 },
{ label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
{ label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
{ label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
{ label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
{ label: "โอกาสความก้าวหน้า ", value: 14 },
{ label: "อื่น ๆ (ระบุ) ", value: 15 },
]);
const responseData = ref<any>({
Position: "",
PositionLevel: "",
Org: "",
Prefix: "",
Avatar: "",
reason: "",
salary: 0,
status: "",
fullname: "",
ReasonWork: 0,
ReasonWorkOther: "",
TimeThink: 0,
ExitFactor: 0,
ExitFactorOther: "",
Adjust: 0,
AdjustOther: "",
RealReason: "",
NotExitFactor: "",
Havejob: null,
HavejobReason: "",
SuggestFriends: null,
SuggestFriendsReason: "",
FutureWork: null,
FutureWorkReason: "",
});
const rows = ref<TypeFile[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: true,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fileName",
align: "left",
label: "ชื่อไฟล์",
sortable: true,
field: "fileName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "btnMicrosoft",
align: "right",
label: "ปุ่ม",
sortable: true,
field: "btnMicrosoft",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
@ -384,34 +522,28 @@ const getData = async () => {
.get(config.API.ExitInterviewByid(dataId))
.then((res: any) => {
const data = res.data.result;
responseData.value.personId = data.profileId;
responseData.value.createdAt = data.createdAt;
responseData.value.date =
data.date !== null ? new Date(data.date) : new Date();
responseData.value.id = data.id ?? "";
responseData.value.organization = data.organization ?? "";
responseData.value.organizationPositionOld =
data.organizationPositionOld ?? "";
responseData.value.positionLevelOld = data.positionLevelOld ?? "";
responseData.value.positionNumberOld = data.positionNumberOld ?? "";
responseData.value.positionTypeOld = data.positionTypeOld ?? "";
responseData.value.reason = data.reason ?? "";
responseData.value.salary = data.salary !== null ? data.salary : 0;
responseData.value.status = data.status ?? "";
responseData.value.avataPath = data.avataPath ?? "";
responseData.value.fullname = `${data.firstName ?? "-"} ${
data.lastName ?? "-"
}`;
organizationPositionOld.value = data.organizationPositionOld ?? "";
positionTypeOld.value = data.positionTypeOld ?? "";
positionLevelOld.value = data.positionLevelOld ?? "";
posNo.value = data.posNo ?? "";
salary.value = data.salary ?? "";
organization.value = data.organization ?? "";
date.value = data.date !== null ? new Date(data.date) : null;
reason.value = data.reason ?? "";
avata.value = data.avatar ?? "";
Position.value = data.position ?? "";
PositionLevel.value = data.positionLevel ?? "";
Org.value = data.org ?? "";
fullname.value = data.fullname ?? "";
reasonWork.value = data.reasonWork ?? [];
reasonWorkOther.value = data.ReasonWorkOther ?? "";
timeThink.value = data.TimeThink ?? 0;
exitFactor.value = data.exitFactor ?? [];
exitFactorOther.value = data.exitFactorOther ?? 0;
adjust.value = data.adjust ?? [];
adjustOther.value = data.adjustOther ?? "";
realReason.value = data.realReason ?? "";
notExitFactor.value = data.notExitFactor ?? "";
haveJob.value = data.havejob ?? null;
haveJobReason.value = data.havejobReason ?? "";
suggestFriends.value = data.suggestFriends ?? null;
suggestFriendsReason.value = data.suggestFriendsReason ?? "";
futureWork.value = data.futureWork ?? null;
futureWorkReason.value = data.futureWorkReason ?? "";
suggestion.value = data.suggestion ?? "";
// console.log(data.value);
})
.catch((e) => {
messageError($q, e);
@ -441,16 +573,7 @@ const conditionSave = async () => {
};
const saveData = async () => {
const body = {
organization: organization.value,
reason: reason.value,
organizationPositionOld: organizationPositionOld.value,
date: date.value,
positionTypeOld: positionTypeOld.value,
positionLevelOld: positionLevelOld.value,
positionNumberOld: posNo.value,
amountOld: salary.value,
};
const body = {};
showLoader();
await http
.put(config.API.ExitInterviewByid(dataId), body)

View file

@ -31,8 +31,10 @@ const expulsionMain = () =>
const expulsionDetails = () =>
import("@/modules/06_retirement/components/Expulsion/expulsionRegistry.vue");
const ExitInterviewMain = () =>
const exitInterviewMain = () =>
import("@/modules/06_retirement/components/ExitInterview/exitMain.vue");
const exitInterviewDetails = () =>
import("@/modules/06_retirement/components/ExitInterview/exitRegistry.vue");
export default [
{
@ -48,7 +50,17 @@ export default [
{
path: "/exit-Interview",
name: "exit-Interview",
component: ExitInterviewMain,
component: exitInterviewMain,
meta: {
Auth: true,
Key: [7.3],
Role: "retirement",
},
},
{
path: "/exit-Interview/questionnair/:id",
name: "exit-Interview-details",
component: exitInterviewDetails,
meta: {
Auth: true,
Key: [7.3],