เเก้ไข UI detailLeave
comment code retirement
This commit is contained in:
parent
b0cd3af1ad
commit
ee2eba56a1
13 changed files with 470 additions and 266 deletions
|
|
@ -5,17 +5,18 @@ import { useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**Import type */
|
||||
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 "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const myForm = ref<QForm>();
|
||||
|
||||
const {
|
||||
messageError,
|
||||
date2Thai,
|
||||
|
|
@ -25,6 +26,7 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
/** คอลัมน์ */
|
||||
const rows = ref<ResponseItems[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -139,8 +141,12 @@ const columns = ref<QTableProps["columns"]>([
|
|||
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>("");
|
||||
|
|
@ -149,6 +155,7 @@ const modal = ref<boolean>(false);
|
|||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
||||
/** HOOK */
|
||||
onMounted(async () => {
|
||||
await fecthlist();
|
||||
if (columns.value) {
|
||||
|
|
@ -222,6 +229,10 @@ const saveAppoint = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่น validate DATE ไทย
|
||||
* @param thaiDate วันที่ไทย
|
||||
*/
|
||||
const validationDate = (thaiDate: string | null) => {
|
||||
if (thaiDate && daterow.value) {
|
||||
let a = convertThaiDateToNumeric(thaiDate);
|
||||
|
|
@ -255,6 +266,9 @@ const convertThaiDateToNumeric = (thaiDate: string) => {
|
|||
const numericDate = `${year}${monthMap[month]}${day}`;
|
||||
return numericDate;
|
||||
};
|
||||
/**
|
||||
* modal Setting
|
||||
*/
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
const resetFilter = () => {
|
||||
|
|
@ -278,22 +292,59 @@ const openModalCalendar = (rows: any) => {
|
|||
<div class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<q-btn color="blue-9" icon="mdi-square-edit-outline" outline @click="$router.push('/exit-Interview/edit-question')"><span class="q-pl-sm">แก้ไขคำถาม</span></q-btn>
|
||||
<q-btn
|
||||
color="blue-9"
|
||||
icon="mdi-square-edit-outline"
|
||||
outline
|
||||
@click="$router.push('/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="ค้นหา">
|
||||
<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" />
|
||||
<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" />
|
||||
<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">
|
||||
<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">
|
||||
|
|
@ -304,64 +355,112 @@ const openModalCalendar = (rows: any) => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="no"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="realReason" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="realReason"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.realReason }}
|
||||
</q-td>
|
||||
<q-td key="notExitFactor" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="notExitFactor"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.notExitFactor }}
|
||||
</q-td>
|
||||
<q-td key="futureWork" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="futureWork"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.futureWork ? "ใช่" : "ไม่" }}
|
||||
</q-td>
|
||||
<q-td key="futureWorkReason" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="futureWorkReason"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.futureWorkReason }}
|
||||
</q-td>
|
||||
<q-td key="havejob" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="havejob"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.havejob ? "ใช่" : "ไม่" }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="havejobReason" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="havejobReason"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.havejobReason }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="appointDate" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="appointDate"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{
|
||||
props.row.appointDate == null ? "-" : props.row.appointDate
|
||||
}}
|
||||
</q-td>
|
||||
<q-td key="datetext" :props="props" @click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
">
|
||||
<q-td
|
||||
key="datetext"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.datetext }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn v-if="props.row.appointDate == null" icon="mdi-calendar" size="12px" color="blue-7" flat round
|
||||
dense @click="openModalCalendar(props.row)">
|
||||
<q-btn
|
||||
v-if="props.row.appointDate == null"
|
||||
icon="mdi-calendar"
|
||||
size="12px"
|
||||
color="blue-7"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
@click="openModalCalendar(props.row)"
|
||||
>
|
||||
<q-tooltip>วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
|
|
@ -377,26 +476,48 @@ const openModalCalendar = (rows: any) => {
|
|||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader title="กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก" :close="closeModal" />
|
||||
<DialogHeader
|
||||
title="กําหนดวันนัดหมายเพื่อทําการสัมภาษณ์การลาออก"
|
||||
:close="closeModal"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm q-gutter-md bg-grey-1">
|
||||
<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">
|
||||
<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 lazy-rules :model-value="dateBreak !== null ? date2Thai(dateBreak) : null
|
||||
" hide-bottom-space :label="`${' วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'}`" :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกลงวันที่'}`,
|
||||
(val) =>
|
||||
validationDate(val) ||
|
||||
`${'วันที่นัดหมายต้องมากกว่าวันที่สร้าง'}`,
|
||||
]">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
:model-value="
|
||||
dateBreak !== null ? date2Thai(dateBreak) : null
|
||||
"
|
||||
hide-bottom-space
|
||||
:label="`${' วันนัดหมายเพื่อทําการสัมภาษณ์การลาออก'}`"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกลงวันที่'}`,
|
||||
(val) =>
|
||||
validationDate(val) ||
|
||||
`${'วันที่นัดหมายต้องมากกว่าวันที่สร้าง'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue