Merge branch 'anandadev' into develop
This commit is contained in:
commit
085373593b
16 changed files with 1331 additions and 141 deletions
|
|
@ -3,6 +3,7 @@ import { onMounted, ref } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
|
||||
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
|
||||
|
||||
|
|
@ -61,8 +62,8 @@ const fecthappointmentByid = async () => {
|
|||
title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
|
||||
title.value.positionLevelOld = data.positionLevelOld ?? "-";
|
||||
title.value.positionTypeOld = data.positionTypeOld ?? "-";
|
||||
status.value = data.status,
|
||||
console.log("🚀 ~ file: Detail.vue:65 ~ .then ~ status:", status.value)
|
||||
(status.value = data.status),
|
||||
console.log("🚀 ~ file: Detail.vue:65 ~ .then ~ status:", status.value);
|
||||
educationOld.value = data.educationOld;
|
||||
organizationPositionOld.value = data.organizationPositionOld;
|
||||
positionTypeOld.value = data.positionTypeOld;
|
||||
|
|
@ -72,7 +73,6 @@ const fecthappointmentByid = async () => {
|
|||
// organization.value = data.organization; //ไม่มี
|
||||
reason.value = data.reason;
|
||||
date.value = data.positionDate;
|
||||
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -135,7 +135,16 @@ const getClass = (val: boolean) => {
|
|||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="router.go(-1)" />
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดการแต่งตั้ง-เลื่อน {{ title.fullname }}
|
||||
</div>
|
||||
<q-card bordered class="row col-12 text-dark">
|
||||
|
|
@ -144,8 +153,15 @@ const getClass = (val: boolean) => {
|
|||
{{ title.fullname }}
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn outline color="blue" dense icon-right="mdi-open-in-new" class="q-px-sm" label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="router.push(`/registry/${profileId}`)" />
|
||||
<q-btn
|
||||
outline
|
||||
color="blue"
|
||||
dense
|
||||
icon-right="mdi-open-in-new"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="router.push(`/registry/${profileId}`)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -191,19 +207,40 @@ const getClass = (val: boolean) => {
|
|||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||
</div>
|
||||
<q-space />
|
||||
<div v-if="status !== 'DONE' && status !== 'REPORT'" >
|
||||
<div v-if="status !== 'DONE' && status !== 'REPORT'">
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn outline color="primary" dense icon-right="mdi-file-edit-outline" class="q-px-sm" label="แก้ไข"
|
||||
style="width: 80px" @click="edit = !edit" />
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
@click="clickSave"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn outline color="public" dense class="q-px-sm" label="บันทึก" style="width: 80px" @click="clickSave" />
|
||||
<q-btn outline color="red" dense class="q-px-sm" label="ยกเลิก" style="width: 80px" @click="edit = !edit" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-form ref="myForm">
|
||||
|
|
@ -212,9 +249,19 @@ const getClass = (val: boolean) => {
|
|||
<div class="text-weight-bold text-grey">วุฒิการศึกษา</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :readonly="!edit" :borderless="!edit"
|
||||
v-model="educationOld" :rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]" hide-bottom-space
|
||||
:label="`${'วุฒิการศึกษา'}`" type="text" />
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วุฒิการศึกษา'}`"
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
|
|
@ -227,38 +274,83 @@ const getClass = (val: boolean) => {
|
|||
</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-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"
|
||||
/>
|
||||
</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="`${'ตำแหน่งประเภท'}`" />
|
||||
<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="`${'ระดับ'}`" />
|
||||
<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="`${'เลขที่'}`" />
|
||||
<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"
|
||||
<!-- <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" />
|
||||
:label="`${'เงินเดือน'}`" type="number" /> -->
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -280,22 +372,41 @@ const getClass = (val: boolean) => {
|
|||
</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">
|
||||
<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>
|
||||
<q-input :class="getClass(edit)" :outlined="edit" dense lazy-rules :borderless="!edit"
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]" hide-bottom-space
|
||||
:label="`${'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'}`">
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
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
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
edit
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -304,9 +415,19 @@ const getClass = (val: boolean) => {
|
|||
</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" />
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<q-input
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -546,6 +546,14 @@
|
|||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
|
|
@ -575,8 +583,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useProfileDataStore } from "@/modules/08_registryEmployee/store";
|
||||
import CurruncyInput from "@/components/CurruncyInput.vue";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
|
||||
import type { InformationOps } from "@/modules/04_registry/interface/index/Main";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
// import type {
|
||||
// TypeFile,
|
||||
|
|
@ -423,18 +423,13 @@ onMounted(async () => {
|
|||
</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"
|
||||
<CurrencyInput
|
||||
v-model="amountOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -461,7 +456,7 @@ onMounted(async () => {
|
|||
เงินเดือนตำแหน่งและหน่วยงานที่รับย้าย
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -473,6 +468,14 @@ onMounted(async () => {
|
|||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
<CurrencyInput
|
||||
v-model="amount"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -176,18 +176,16 @@
|
|||
</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"
|
||||
<!-- <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"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -278,6 +276,8 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -278,6 +278,14 @@
|
|||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -368,6 +376,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
<template>
|
||||
<input
|
||||
:class="
|
||||
edit == true
|
||||
? 'full-width inputgreen cursor-pointer'
|
||||
: 'full-width cursor-pointer'
|
||||
"
|
||||
:outlined="edit"
|
||||
dense
|
||||
ref="inputRef"
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="test"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
hide-bottom-space
|
||||
type="text"
|
||||
@update:modelValue="updateCoords(test)"
|
||||
/>
|
||||
{{ salary }}
|
||||
</template>
|
||||
<script>
|
||||
import { useCurrencyInput } from "vue-currency-input";
|
||||
|
||||
export default {
|
||||
name: "CurrencyInput",
|
||||
props: {
|
||||
salary: String,
|
||||
edit: Boolean,
|
||||
modelValue: Number,
|
||||
options: Object,
|
||||
},
|
||||
emits: ["update:salary"],
|
||||
setup(props) {
|
||||
const { inputRef } = useCurrencyInput(props.options);
|
||||
const test = "";
|
||||
return { inputRef };
|
||||
},
|
||||
methods: {
|
||||
updateCoords(title) {
|
||||
console.log("asd");
|
||||
this.$emit("update:salary", title); // previously was `this.$emit('input', title)`
|
||||
},
|
||||
},
|
||||
// watch(){}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -195,6 +195,14 @@
|
|||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -285,6 +293,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -199,6 +199,15 @@
|
|||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -290,6 +299,7 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
|
|
|||
562
src/modules/06_retirement/components/ExitInterview/exitMain.vue
Normal file
562
src/modules/06_retirement/components/ExitInterview/exitMain.vue
Normal file
|
|
@ -0,0 +1,562 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const RetirementData = useRetirementDataStore();
|
||||
|
||||
const { messageError, date2Thai, showLoader, hideLoader, success } = mixin;
|
||||
const { statusText } = RetirementData;
|
||||
|
||||
const rows = ref<ResponseItems[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
align: "left",
|
||||
label: "คำนำหน้า",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
||||
{
|
||||
name: "positionTypeOld",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
field: "positionTypeOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionLevelOld",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevelOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionNumberOld",
|
||||
align: "left",
|
||||
label: "เลขที่",
|
||||
sortable: true,
|
||||
field: "positionNumberOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "organizationPositionOld",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "statustext",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "statustext",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"positionTypeOld",
|
||||
"positionLevelOld",
|
||||
"positionNumberOld",
|
||||
"organizationPositionOld",
|
||||
"statustext",
|
||||
]);
|
||||
|
||||
const filters = ref<ResponseItems[]>([]);
|
||||
const rows2 = ref<ResponseItems[]>([]);
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
align: "left",
|
||||
label: "คำนำหน้า",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
||||
{
|
||||
name: "positionTypeOld",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
field: "positionTypeOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionLevelOld",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevelOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionNumberOld",
|
||||
align: "left",
|
||||
label: "เลขที่",
|
||||
sortable: true,
|
||||
field: "positionNumberOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "organizationPositionOld",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "statustext",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "statustext",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"positionTypeOld",
|
||||
"positionLevelOld",
|
||||
"positionNumberOld",
|
||||
"organizationPositionOld",
|
||||
"statustext",
|
||||
]);
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
|
||||
const selected = ref<ResponseItems[]>([]);
|
||||
const checkSelected = computed(() => {
|
||||
if (selected.value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = filters.value.filter(
|
||||
(r: ResponseItems) =>
|
||||
r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await fecthlist();
|
||||
});
|
||||
|
||||
const fecthlist = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listExitInterview())
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
let list: ResponseItems[] = [];
|
||||
|
||||
data.map((r: ResponseItems) => {
|
||||
list.push({
|
||||
activeDate: new Date(),
|
||||
createdAt: new Date(),
|
||||
firstName: r.firstName ?? "",
|
||||
id: r.id ?? "",
|
||||
isActive: r.isActive ? r.isActive : false,
|
||||
lastName: r.lastName ?? "",
|
||||
location: r.location ?? "",
|
||||
organizationPositionOld: r.organizationPositionOld ?? "",
|
||||
positionLevelOld: r.positionLevelOld ?? "",
|
||||
positionNumberOld: r.positionNumberOld ?? "",
|
||||
positionTypeOld: r.positionTypeOld ?? "",
|
||||
prefix: r.prefix ?? "",
|
||||
profileId: r.profileId ?? "",
|
||||
reason: r.reason ?? "",
|
||||
salary: r.salary ? r.salary : 0,
|
||||
sendDate: new Date(),
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
|
||||
rows.value = list;
|
||||
filters.value = list;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const saveOrder = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.ExitInterviewReport, body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
|
||||
closeModal();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fecthlist();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการ Exit interview
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<q-separator />
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<!-- <q-btn
|
||||
@click="openModalOrder"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งลาออก</q-tooltip>
|
||||
</q-btn> -->
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="router.push(`/retirement/resign/${props.row.id}`)"
|
||||
>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="prefix" :props="props">
|
||||
{{ props.row.prefix }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="positionTypeOld" :props="props">
|
||||
{{ props.row.positionTypeOld }}
|
||||
</q-td>
|
||||
<q-td key="positionLevelOld" :props="props">
|
||||
{{ props.row.positionLevelOld }}
|
||||
</q-td>
|
||||
<q-td key="positionNumberOld" :props="props">
|
||||
{{ props.row.positionNumberOld }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="organizationPositionOld" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statustext" :props="props">
|
||||
{{ props.row.statustext }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- <q-dialog v-model="modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader title="ส่งไปออกคำสั่งโอนออก" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="row justify-end">
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="prefix" :props="props">
|
||||
{{ props.row.prefix }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="positionTypeOld" :props="props">
|
||||
{{ props.row.positionTypeOld }}
|
||||
</q-td>
|
||||
<q-td key="positionLevelOld" :props="props">
|
||||
{{ props.row.positionLevelOld }}
|
||||
</q-td>
|
||||
<q-td key="positionNumberOld" :props="props">
|
||||
{{ props.row.positionNumberOld }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="organizationPositionOld" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="statustext" :props="props">
|
||||
{{ props.row.statustext }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="saveOrder"
|
||||
:disable="checkSelected"
|
||||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog> -->
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
@ -0,0 +1,492 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียด Exit interview ของ {{ responseData.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 }}
|
||||
</div>
|
||||
<q-space />
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<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="@/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 }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.positionLevelOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.organizationPositionOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ข้อมูลการตอบแบบสอบถาม
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- <div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
@click="conditionSave"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
/>
|
||||
</div> -->
|
||||
</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>
|
||||
</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"
|
||||
/>
|
||||
</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>
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
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>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import type {
|
||||
TypeFile,
|
||||
ResponseDataDetail,
|
||||
} from "@/modules/06_retirement/interface/response/expulsion";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const dataId = route.params.id.toString();
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
} = mixin;
|
||||
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
const edit = ref<boolean>(false);
|
||||
|
||||
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 responseData = ref<ResponseDataDetail>({
|
||||
personId: "",
|
||||
avataPath: "",
|
||||
createdAt: new Date(),
|
||||
date: new Date(),
|
||||
id: "",
|
||||
organization: "",
|
||||
organizationPositionOld: "",
|
||||
positionLevelOld: "",
|
||||
positionNumberOld: "",
|
||||
positionTypeOld: "",
|
||||
reason: "",
|
||||
salary: 0,
|
||||
status: "",
|
||||
fullname: "",
|
||||
});
|
||||
|
||||
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");
|
||||
console.log("roleAdmin===>", roleAdmin.value);
|
||||
}
|
||||
await getData();
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.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 ?? "";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const conditionSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success) => {
|
||||
if (success) {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||
"mdi-help-circle-outline",
|
||||
"ตกลง",
|
||||
"public",
|
||||
async () => await saveData(),
|
||||
undefined
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.ExitInterviewByid(dataId), body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
height: 70px;
|
||||
}
|
||||
.text-top {
|
||||
color: gray;
|
||||
font-weight: 400;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.text-detail {
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -204,7 +204,10 @@
|
|||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{ currency: 'THB' }"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -294,7 +297,7 @@ import { onMounted, ref } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import CurrencyInput from "@/modules/06_retirement/components/CurrencyInput.vue";
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -269,6 +269,15 @@
|
|||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
:options="{
|
||||
currency: 'THB',
|
||||
}"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -506,6 +515,7 @@ import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogH
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store";
|
||||
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ const expulsionMain = () =>
|
|||
const expulsionDetails = () =>
|
||||
import("@/modules/06_retirement/components/Expulsion/expulsionRegistry.vue");
|
||||
|
||||
const ExitInterviewMain = () =>
|
||||
import("@/modules/06_retirement/components/ExitInterview/exitMain.vue");
|
||||
|
||||
export default [
|
||||
{
|
||||
path: "/retirement",
|
||||
|
|
@ -42,6 +45,16 @@ export default [
|
|||
Role: "retirement",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/exit-Interview",
|
||||
name: "exit-Interview",
|
||||
component: ExitInterviewMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7.3],
|
||||
Role: "ExitInterviewMain",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/:retirementId",
|
||||
name: "retirementid",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue