ปรับระบบพ้นจากราชการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-02 15:19:11 +07:00
parent d043396010
commit 615b280979
26 changed files with 577 additions and 733 deletions

View file

@ -252,14 +252,7 @@ watch(modal, () => {
</script>
<template>
<q-btn
flat
round
class="text-teal-5"
icon="mdi-plus"
size="md"
@click="modal = true"
>
<q-btn flat round class="primary" icon="mdi-plus" @click="modal = true">
<q-tooltip>เพมรายช</q-tooltip></q-btn
>

View file

@ -14,7 +14,7 @@ import type { RetirementList } from "@/modules/06_retirement/interface/index/Mai
import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
import AddList from "../ListRetirement/AddList.vue";
import AddList from "@/modules/06_retirement/components/01_retirement/AddList.vue";
/** Use */
const route = useRoute();
@ -542,15 +542,14 @@ onMounted(async () => {
</div>
<div>
<q-table
<d-table
flat
dense
bordered
:rows="rows"
:columns="columns"
row-key="order"
class="custom-header-table"
:filter="filter"
:filter="filter.trim()"
:visible-columns="visibleColumns"
no-data-label="ไม่มีข้อมูล"
:pagination-label="paginationLabel"
@ -678,7 +677,7 @@ onMounted(async () => {
}}</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<!-- <template v-slot:pagination="scope">
<q-pagination
v-model="pagination.page"
color="primary"
@ -688,8 +687,8 @@ onMounted(async () => {
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</template> -->
</d-table>
</div>
</q-card>
</div>
@ -841,35 +840,6 @@ onMounted(async () => {
</template>
<style lang="scss" scope>
.custom-header-table {
max-height: 64vh;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
.q-table thead tr:last-child th {
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
.q-btn-dropdown__arrow {
display: none;
}

View file

@ -182,91 +182,85 @@ watchEffect(() => {
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader tittle="ส่งไปออกคำสั่งลาออก" :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"
:model-value="filterKeyword2"
@update:model-value="updateInput"
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="Reset"
/>
</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"
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 row">
<q-space />
<q-input
borderless
outlined
dense
v-model="scope.selected"
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon name="search" />
</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"
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
</template>
</div>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td>
<div class="col-12">
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword2?.trim()"
row-key="id"
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
v-model="scope.selected"
/>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis2'
: ''
"
>
{{ col.value ? col.value : "" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</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 v-for="col in props.cols" :key="col.id">
<div
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis2'
: ''
"
>
{{ col.value ? col.value : "" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">

View file

@ -11,9 +11,10 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { DataStatus } from "@/modules/06_retirement/interface/index/Main";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogSendToCommand from "@/modules/06_retirement/components/resign/DialogSendToCommand.vue";
import DialogSendToCommand from "@/modules/06_retirement/components/02_resign/DialogSendToCommand.vue";
/** use */
const $q = useQuasar(); // noti quasar
@ -135,7 +136,7 @@ const filterKeyword2 = ref<string>("");
const filterKeyword = ref<string>("");
const status = ref<string>("");
const optionStatus = ref<any[]>([]);
const optionStatus = ref<DataStatus[]>([]);
/**Setting pagination */
const pagination = ref({
@ -175,7 +176,7 @@ async function openModalOrder() {
rowsSendToCommand.value = row;
modal.value = true;
})
.catch((e: any) => {
.catch((e) => {
messageError($q, e);
})
.finally(() => {
@ -196,7 +197,7 @@ async function fecthlist() {
const data = await res.data.result;
rows.value = data;
})
.catch((e: any) => {
.catch((e) => {
messageError($q, e);
})
.finally(() => {
@ -211,9 +212,8 @@ async function fecthlist() {
*/
function filterOption(val: string, update: Function) {
update(() => {
status.value = val ? "" : stroeResign.formQurey.status;
optionStatus.value = stroeResign.optionStatus.filter(
(v: any) => v.name.indexOf(val) > -1
(v: DataStatus) => v.name.indexOf(val) > -1
);
});
}
@ -249,6 +249,8 @@ onMounted(async () => {
hide-bottom-space
outlined
use-input
hide-selected
fill-input
@update:model-value="
(stroeResign.formQurey.status = status), fecthlist()
"
@ -283,13 +285,7 @@ onMounted(async () => {
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="filterKeyword = ''"
/>
<q-icon name="search" />
</template>
</q-input>
@ -313,7 +309,7 @@ onMounted(async () => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
:filter="filterKeyword.trim()"
row-key="id"
:visible-columns="visibleColumns"
v-model:pagination="pagination"

View file

@ -166,11 +166,6 @@ function updateInput(value: any) {
emit("update:filterKeyword2", value);
}
/** รีเซ็ตค่าในช่องค้นหา */
function Reset() {
emit("update:filterKeyword2", "");
}
watchEffect(() => {
if (props.modal === true) {
selected.value = [];
@ -182,91 +177,85 @@ watchEffect(() => {
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader tittle="ส่งไปออกคำสั่งลาออก" :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"
:model-value="filterKeyword2"
@update:model-value="updateInput"
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="Reset"
/>
</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"
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
</q-toolbar>
</div>
</div>
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword2"
row-key="id"
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="col-12 row">
<q-space />
<q-input
borderless
outlined
dense
v-model="scope.selected"
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon name="search" />
</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"
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
</template>
</div>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td>
<div class="col-12">
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword2?.trim()"
row-key="id"
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
v-model="scope.selected"
/>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis2'
: ''
"
>
{{ col.value ? col.value : "" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</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 v-for="col in props.cols" :key="col.id">
<div
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis2'
: ''
"
>
{{ col.value ? col.value : "" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">

View file

@ -11,9 +11,10 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { DataStatus } from "@/modules/06_retirement/interface/index/Main";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogSendToCommand from "@/modules/06_retirement/components/resignEMP/DialogSendToCommand.vue";
import DialogSendToCommand from "@/modules/06_retirement/components/03_resignEmp/DialogSendToCommand.vue";
/** use */
const $q = useQuasar(); // noti quasar
@ -134,7 +135,7 @@ const filterKeyword2 = ref<string>("");
const filterKeyword = ref<string>("");
const statusEMP = ref<string>("");
const optionStatus = ref<any[]>([]);
const optionStatus = ref<DataStatus[]>([]);
/**Setting pagination */
const pagination = ref({
@ -174,7 +175,7 @@ async function openModalOrder() {
rowsSendToCommand.value = row;
modal.value = true;
})
.catch((e: any) => {
.catch((e) => {
messageError($q, e);
})
.finally(() => {
@ -195,7 +196,7 @@ async function fecthlist() {
const data = await res.data.result;
rows.value = data;
})
.catch((e: any) => {
.catch((e) => {
messageError($q, e);
})
.finally(() => {
@ -212,7 +213,7 @@ function filterOption(val: string, update: Function) {
update(() => {
statusEMP.value = val ? "" : stroeResign.formQureyEMP.status;
optionStatus.value = stroeResign.optionStatusEMP.filter(
(v: any) => v.name.indexOf(val) > -1
(v: DataStatus) => v.name.indexOf(val) > -1
);
});
}
@ -248,6 +249,8 @@ onMounted(async () => {
hide-bottom-space
outlined
use-input
hide-selected
fill-input
@update:model-value="
(stroeResign.formQureyEMP.status = statusEMP), fecthlist()
"
@ -313,7 +316,7 @@ onMounted(async () => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
:filter="filterKeyword.trim()"
row-key="id"
:visible-columns="visibleColumns"
v-model:pagination="pagination"

View file

@ -269,7 +269,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 1',
@ -286,7 +286,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -308,7 +308,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -338,7 +338,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 2',
@ -355,7 +355,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -377,7 +377,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -407,7 +407,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 3',
@ -424,7 +424,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -446,7 +446,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -476,7 +476,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 4',
@ -493,7 +493,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -515,7 +515,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -545,7 +545,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 5',
@ -563,7 +563,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -592,7 +592,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 6',
@ -610,7 +610,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -639,7 +639,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 7',
@ -656,7 +656,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -678,7 +678,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -708,7 +708,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 8',
@ -726,7 +726,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -748,7 +748,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -778,7 +778,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 9',
@ -796,7 +796,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"
@ -818,7 +818,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคำตอบ',
]"
@ -848,7 +848,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) =>
(val && val.length > 0) || 'กรุณากรอกคำถามข้อที่ 10',
@ -866,7 +866,7 @@ onMounted(async () => {
autogrow
hide-bottom-space
outlined
class="bg-white"
class="inputgreen"
:rules="[
(val:string) => (val && val.length > 0) || 'กรุณากรอกคะแนน',
]"

View file

@ -307,7 +307,7 @@ onMounted(async () => {
class="q-mr-sm"
@click="router.go(-1)"
/>
รายละเอยด Exit interview ของ{{ fullname }}
รายละเอยด Exit interview {{ fullname }}
</div>
<CardProfile :data="dataProfile as DataProfile" />

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
import type { QInput, QForm } from "quasar";
@ -125,8 +125,8 @@ async function getData() {
showLoader();
await http
.get(config.API.detailByidDeceased(profileId.value))
.then((res) => {
const data = res.data.result;
.then(async (res) => {
const data = await res.data.result;
let list: DataCopyOrder[] = [];
data.map((r: any) => {
let selectCopyOrder = [];
@ -162,7 +162,7 @@ async function getData() {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
}
@ -178,8 +178,8 @@ async function saveData() {
const dataToSend = { Persons: persons };
await http
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
.then((res) => {
getData();
.then(async (res) => {
await getData();
})
.catch((e) => {
messageError($q, e);
@ -220,22 +220,21 @@ function clickAdd() {
* ลบขอม
*/
function clickDelete(id: string) {
dialogRemove($q, () => deleteData(id));
}
/**ลบข้อมูล */
async function deleteData(id: string) {
await http
.delete(config.API.detailByidDeceased(id))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
});
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.detailByidDeceased(id))
.then(async () => {
await getData();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
});
}
/**
@ -269,16 +268,16 @@ async function fetchSaveCopyOrder() {
showLoader();
await http
.put(config.API.notiDeceased(profileId.value), { Persons: list })
.then((res: any) => {
success($q, "บันทึกข้อมูลสำเร็จ");
.then(async () => {
await getData();
next();
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
getData();
});
}
@ -323,17 +322,10 @@ onMounted(async () => {
outlined
debounce="300"
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
>
<template v-slot:append>
<q-icon v-if="filter == ''" name="search" />
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
<q-icon name="search" />
</template>
</q-input>
<!-- แสดงคอลมนใน table -->
@ -358,7 +350,7 @@ onMounted(async () => {
:rows="rows"
:columns="columns"
:visible-columns="visibleColumns"
:filter="filter"
:filter="filter.trim()"
row-key="idCard"
>
<template v-slot:header="props">
@ -395,7 +387,7 @@ onMounted(async () => {
dense
lazy-rules
v-model="props.row.mutiselect"
:rules="[(val:any) => !!val || `${'กรุณาเลือกช่องทางการส่งสำเนา'}`,(val:any) => val.length > 0 || `${'กรุณาเลือกช่องทางการส่งสำเนา'}`]"
:rules="[(val:string) => !!val || `${'กรุณาเลือกช่องทางการส่งสำเนา'}`,(val:string) => val.length > 0 || `${'กรุณาเลือกช่องทางการส่งสำเนา'}`]"
:label="`${'เลือกช่องทางการส่งสำเนา'}`"
emit-value
map-options

View file

@ -167,6 +167,7 @@ function Reset() {
watchEffect(() => {
if (props.modal === true) {
selected.value = [];
updateInput("");
}
});
</script>
@ -175,89 +176,85 @@ watchEffect(() => {
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader tittle="ส่งไปออกคำสั่งให้ออก" :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"
:model-value="filterKeyword2"
@update:model-value="updateInput"
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="Reset"
/>
</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"
style="min-width: 140px"
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"
<q-card-section>
<div class="row col-12 q-col-gutter-sm">
<div class="row col-12">
<q-space />
<q-input
borderless
outlined
dense
v-model="scope.selected"
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon name="search" />
</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"
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
</template>
</div>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td>
<div class="col-12">
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2?.trim()"
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="props.selected"
v-model="scope.selected"
/>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
</template>
<div v-else :class="col.name === 'org' ? 'table_ellipsis' : ''">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
<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 v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else
:class="col.name === 'org' ? 'table_ellipsis' : ''"
>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">

View file

@ -1,284 +0,0 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
/** Use */
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, findOrgName } = mixin;
/** คอลัมน์ */
const rows = ref<any[]>([]);
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fullname",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.prefix ?? ""}${row.firstName} ${row.lastName}`;
},
},
{
name: "position",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionType",
align: "left",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.posTypeName && row.posLevelName) {
name = `${row.posTypeName} (${row.posLevelName})`;
} else if (row.posTypeName) {
name = `${row.posTypeName}`;
} else if (row.posLevelName) {
name = `(${row.posLevelName})`;
} else name = "-";
return name;
},
},
{
name: "org",
align: "left",
label: "สังกัด",
sortable: true,
field: "org",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return findOrgName(row);
},
},
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => date2Thai(val),
},
]);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"no",
"fullname",
"positionType",
"position",
"positionLevel",
"positionExecutive",
"org",
"createdAt",
]);
/**เรียกข้อมูลจาก APi */
async function fectListDecased() {
showLoader();
await http
.get(config.API.listDeceased())
.then((res) => {
const data = res.data.result;
rows.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
//
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
}
/** Setting Pagination */
function nextPage(id: string) {
router.push("/retirement/deceased/" + id);
}
/**Hook */
onMounted(() => {
fectListDecased();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการบนทกเวยนแจงการถงแกกรรม
</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-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"
style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2"
/>
</div>
<div class="col-12 q-pt-sm">
<d-table
ref="table"
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="fullname"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width></q-th>
<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">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
flat
dense
round
color="info"
icon="mdi-eye"
@click.stop.prevent="nextPage(props.row.id)"
>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else
:class="col.name === 'org' ? 'table_ellipsis' : ''"
>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</div>
</q-card>
</template>
<style scoped lang="scss">
.custom-header-table {
max-height: 64vh;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
/* this will be the loading indicator */
.q-table thead tr:last-child th {
/* height of all previous header rows */
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
</style>

View file

@ -1,368 +0,0 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { useTransferDataStore } from "@/modules/05_placement/store";
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
import DialogSendToCommand from "@/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue";
/** use */
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const transferStore = useTransferDataStore();
const {
date2Thai,
messageError,
showLoader,
hideLoader,
success,
dialogMessage,
} = mixin;
const { statusText } = transferStore;
const modal = ref<boolean>(false);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"no",
"fullname",
"positionLevel",
"organizationPositionOld",
"createdAt",
"status",
]);
//
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
//
const rows = ref<ResponseData[]>([]);
const rows2 = ref<ResponseData[]>([]);
const filters = ref<ResponseData[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "fullname",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.prefix}${row.firstName} ${row.lastName}`;
},
},
{
name: "positionLevel",
align: "left",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
let name = "";
if (row.positionTypeOld && row.positionLevelOld) {
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
} else if (row.positionTypeOld) {
name = `${row.positionTypeOld}`;
} else if (row.positionLevelOld) {
name = `(${row.positionLevelOld})`;
} else name = "-";
return name;
},
},
{
name: "organizationPositionOld",
align: "left",
label: "ตำแหน่ง/สังกัดเดิม",
sortable: true,
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdAt",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => date2Thai(val),
},
{
name: "status",
align: "left",
label: "สถานะ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val) => statusText(val),
},
]);
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
function openModalOrder() {
openModal();
const row = filters.value.filter(
(r: ResponseData) =>
(r.status == "WAITTING" ||
r.status == "PENDING" ||
r.status == "APPROVE") &&
r.organizationPositionOld &&
r.positionTypeOld &&
r.positionLevelOld &&
r.positionNumberOld &&
r.organization &&
r.date
);
rows2.value = row;
}
//
async function getData() {
showLoader();
await http
.get(config.API.retirementOut)
.then((res: any) => {
const data = res.data.result;
rows.value = data;
filters.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
async function clickDelete(id: string) {
dialogMessage(
$q,
`ลบข้อมูล`,
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
"delete",
"ยืนยัน",
"red",
async () => await deleteData(id),
async () => await getData()
);
}
async function deleteData(id: string) {
await http
.delete(config.API.outByid(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
});
}
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
}
onMounted(async () => {
await getData();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">รายการใหออก</div>
<q-card flat bordered class="col-12 q-mt-sm">
<q-separator />
<div class="row q-pa-md">
<div class="col-12">
<div class="row col-12">
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
@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"
style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
/>
</div>
<div class="col-12 q-pt-sm">
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width />
<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">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
flat
dense
round
color="info"
icon="mdi-eye"
@click="
router.push(
`/retirement/dismiss-order-detail/${props.row.id}`
)
"
>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
flat
dense
round
color="edit"
icon="edit"
@click="
router.push(`/retirement/dismiss-order/${props.row.id}`)
"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
dense
flat
round
:color="
props.row.status == 'REPORT' || props.row.status == 'DONE'
? 'grey'
: 'red-7'
"
@click="clickDelete(props.row.id)"
icon="mdi-delete"
:disable="
props.row.status == 'REPORT' || props.row.status == 'DONE'
"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else
:class="
col.name === 'organizationPositionOld'
? 'table_ellipsis'
: ''
"
>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</div>
</q-card>
<DialogSendToCommand
v-model:modal="modal"
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
:fecthlistRecevice="getData"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -1,520 +0,0 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar, QForm } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/exitInterview";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import DialogHeader from "@/components/DialogHeader.vue";
/** use */
const $q = useQuasar(); // noti quasar
const router = useRouter();
const mixin = useCounterMixin();
const myForm = ref<QForm>();
const {
messageError,
date2Thai,
showLoader,
hideLoader,
success,
dialogConfirm,
} = mixin;
/** คอลัมน์ */
const rows = ref<ResponseItems[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
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: "realReason",
align: "left",
label: "สาเหตุที่ลาออก",
sortable: true,
field: "realReason",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "notExitFactor",
align: "left",
label: "ปัจจัยที่ช่วยเปลี่ยนใจไม่อยากลาออก",
sortable: true,
field: "notExitFactor",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "futureWork",
align: "left",
label: "อนาคตกลับจะมาร่วมงานหรือไม่",
sortable: true,
field: "futureWork",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "futureWorkReason",
align: "left",
label: "เหตุผลที่อยากกลับมาร่วมงาน",
sortable: true,
field: "futureWorkReason",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "havejob",
align: "left",
label: "มีงานใหม่หรือไม่",
sortable: true,
field: "havejob",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "havejobReason",
align: "left",
label: "เหตุผลที่มีงานใหม่",
sortable: true,
field: "havejobReason",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "appointDate",
align: "left",
label: "วันนัดหมายเพื่อสัมภาษณ์",
sortable: true,
field: "appointDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "datetext",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "datetext",
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[]>([]);
/**
* วแปร
*/
const dateBreak = ref<Date | null>(null);
const daterow = ref<string | null>("");
const id = ref<string>("");
const filters = ref<ResponseItems[]>([]);
const modal = ref<boolean>(false);
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
// API
async function fecthlist() {
showLoader();
await http
.get(config.API.listExitInterview())
.then(async (res) => {
const data = await res.data.result;
let list: ResponseItems[] = [];
data.map((r: ResponseItems) => {
list.push({
datetext: r.createdAt !== null ? date2Thai(r.createdAt) : "-",
fullname: r.fullname ?? "",
createdAt: new Date(r.createdAt),
futureWork: !!r.futureWork,
futureWorkReason: r.futureWorkReason ?? "",
havejob: !!r.havejob,
havejobReason: r.havejobReason ?? "",
id: r.id ?? "",
lastUpdatedAt: new Date(r.lastUpdatedAt),
notExitFactor: r.notExitFactor ?? "",
realReason: r.realReason ?? "",
suggestFriends: !!r.suggestFriends,
suggestFriendsReason: r.suggestFriendsReason ?? "",
suggestion: r.suggestion ?? "",
status: r.status ?? "",
appointDate: date2Thai(r.appointDate),
});
});
rows.value = list;
filters.value = list;
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
//
async function saveAppoint() {
await myForm.value!.validate().then(async (result: boolean) => {
if (result) {
dialogConfirm($q, async () => {
const body = {
appointDate: dateBreak.value,
};
showLoader();
await http
.put(config.API.AppointInterview(id.value), body)
.then(async () => {
await fecthlist();
success($q, "วันนัดหมายเพื่อทําการสัมภาษณ์การลาออกสำเร็จ");
closeModal();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
});
}
});
}
/**
* งก validate DATE ไทย
* @param thaiDate นทไทย
*/
function validationDate(thaiDate: string | null) {
if (thaiDate && daterow.value) {
let a = convertThaiDateToNumeric(thaiDate);
let b = daterow.value;
if (a) {
return a > b;
}
}
}
//
function convertThaiDateToNumeric(thaiDate: string) {
const parts = thaiDate.split(" ");
if (parts.length !== 3) return null;
const [day, month, year] = parts;
const monthMap: any = {
"ม.ค.": "01",
"ก.พ.": "02",
"มี.ค.": "03",
"เม.ย.": "04",
"พ.ค.": "05",
"มิ.ย.": "06",
"ก.ค.": "07",
"ส.ค.": "08",
"ก.ย.": "09",
"ต.ค.": "10",
"พ.ย.": "11",
"ธ.ค.": "12",
};
if (!(month in monthMap)) return null;
const numericDate = `${year}${monthMap[month]}${day}`;
return numericDate;
}
/**
* modal Setting
*/
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
}
function openModalCalendar(rows: any) {
openModal();
dateBreak.value = null;
id.value = rows.id;
daterow.value = convertThaiDateToNumeric(rows.datetext);
}
/** HOOK */
onMounted(async () => {
await fecthlist();
if (columns.value) {
visibleColumns.value = columns.value.map((r: any) => r.name);
}
});
</script>
<template v-slot:body="props">
<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">
<div>
<q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
color="blue-9"
icon="mdi-square-edit-outline"
outline
@click="$router.push('/retirement/exit-interview/edit-question')"
><span class="q-pl-sm">แกไขคำถาม</span></q-btn
>
</div>
<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"
style="min-width: 140px"
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 auto-width />
<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">
<q-td auto-width>
<q-btn
flat
dense
round
v-if="checkPermission($route)?.attrIsGet"
color="info"
icon="mdi-eye"
@click="
router.push(
`/retirement/exit-interview/questionnair-detail/${props.row.id}`
)
"
>
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
flat
dense
round
color="edit"
icon="edit"
@click="
router.push(
`/retirement/exit-interview/questionnair/${props.row.id}`
)
"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="
!props.row.appointDate &&
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
icon="mdi-calendar"
color="blue-7"
flat
round
dense
@click="openModalCalendar(props.row)"
>
<q-tooltip>นนดหมายเพอทาการสมภาษณการลาออก</q-tooltip>
</q-btn>
</q-td>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="fullname" :props="props">
{{ props.row.fullname ? props.row.fullname : "-" }}
</q-td>
<q-td key="realReason" :props="props">
{{ props.row.realReason ? props.row.realReason : "-" }}
</q-td>
<q-td key="notExitFactor" :props="props">
{{ props.row.notExitFactor ? props.row.notExitFactor : "-" }}
</q-td>
<q-td key="futureWork" :props="props">
{{ props.row.futureWork ? "ใช่" : "ไม่" }}
</q-td>
<q-td key="futureWorkReason" :props="props">
{{
props.row.futureWorkReason
? props.row.futureWorkReason
: "-"
}}
</q-td>
<q-td key="havejob" :props="props">
{{ props.row.havejob ? "ใช่" : "ไม่" }}
</q-td>
<q-td key="havejobReason" :props="props">
<div class="table_ellipsis">
{{
props.row.havejobReason ? props.row.havejobReason : "-"
}}
</div>
</q-td>
<q-td key="appointDate" :props="props">
{{ props.row.appointDate ? props.row.appointDate : "-" }}
</q-td>
<q-td key="datetext" :props="props">
{{ props.row.datetext ? props.row.datetext : "-" }}
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</div>
</q-card>
<!-- dialog กำหนดวนหนดหมายสมภาษณ -->
<q-dialog v-model="modal" persistent>
<q-card style="width: 800px">
<q-form ref="myForm">
<DialogHeader
:tittle="'กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'"
:close="closeModal"
/>
<q-separator />
<q-card-section class="q-p-sm q-gutter-md">
<div class="col-xs-12 col-sm-12 col-md-12">
<datepicker
menu-class-name="modalfix"
v-model="dateBreak"
: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
outlined
dense
:model-value="
dateBreak !== null ? date2Thai(dateBreak) : null
"
hide-bottom-space
:label="`${' วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'}`"
:rules="[
(val:string) => !!val || `${'กรุณาเลือกลงวันที่'}`,
(val:string) =>
validationDate(val) ||
`${'วันที่นัดหมายต้องมากกว่าวันที่สร้าง'}`,
]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</q-card-section>
<q-separator />
<DialogFooter :editvisible="true" :save="saveAppoint" />
</q-form>
</q-card>
</q-dialog>
</template>
<style scoped lang="scss"></style>

View file

@ -1,38 +0,0 @@
<script setup lang="ts">
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
import Table from "@/modules/06_retirement/components/resign/Table.vue";
const stroe = useDataStore();
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">รายการลาออก</div>
<div>
<q-card flat bordered class="col-12">
<q-tabs
v-model="stroe.mainTabs"
dense
align="left"
inline-label
class="rounded-borders"
indicator-color="primary"
active-bg-color="teal-1"
active-class="text-primary"
>
<q-tab name="1" label="ขอลาออก" />
<q-tab name="2" label="ขอยกเลิกลาออก" />
</q-tabs>
<q-separator />
<div>
<q-tab-panels v-model="stroe.mainTabs" animated>
<q-tab-panel name="1"> <Table /> </q-tab-panel>
<q-tab-panel name="2"> <Table /> </q-tab-panel>
</q-tab-panels>
</div>
</q-card>
</div>
</template>
<style scoped></style>

View file

@ -1,40 +0,0 @@
<script setup lang="ts">
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
import Table from "@/modules/06_retirement/components/resignEMP/Table.vue";
const stroe = useDataStore();
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการลาออกลกจาง
</div>
<div>
<q-card flat bordered class="col-12">
<q-tabs
v-model="stroe.mainTabsEMP"
dense
align="left"
inline-label
class="rounded-borders"
indicator-color="primary"
active-bg-color="teal-1"
active-class="text-primary"
>
<q-tab name="1" label="ขอลาออก" />
<q-tab name="2" label="ขอยกเลิกลาออก" />
</q-tabs>
<q-separator />
<div>
<q-tab-panels v-model="stroe.mainTabsEMP" animated>
<q-tab-panel name="1"> <Table /> </q-tab-panel>
<q-tab-panel name="2"> <Table /> </q-tab-panel>
</q-tab-panels>
</div>
</q-card>
</div>
</template>
<style scoped></style>