แก้คำ

This commit is contained in:
setthawutttty 2025-02-04 15:13:46 +07:00
parent 3b1c883c8e
commit 00cd6e18f2
6 changed files with 167 additions and 24 deletions

View file

@ -75,14 +75,14 @@ watch(modal, (val) => {
</div> </div>
<div class="row q-mt-md text-grey-6"> <div class="row q-mt-md text-grey-6">
<div class="col-12">สาเหต /เหตผล</div> <div class="col-12">สาเหต/เหตผล</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12">{{ data.reson ? data.reson : "-" }}</div> <div class="col-12">{{ data.reson ? data.reson : "-" }}</div>
</div> </div>
<div class="row q-mt-md text-grey-6"> <div class="row q-mt-md text-grey-6">
<div class="col-12">คำส /เอกสารอางอ</div> <div class="col-12">คำส/เอกสารอางอ</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">

View file

@ -10,7 +10,10 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/request/ResultsPerformance"; import type {
RequestItemsObject,
DataOptions,
} from "@/modules/04_registryPerson/interface/request/ResultsPerformance";
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/ResultsPerformance"; import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/ResultsPerformance";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
@ -36,9 +39,9 @@ const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? "")); const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const year = ref<number | null>(new Date().getFullYear()); //
const id = ref<string>(""); //id const id = ref<string>(""); //id
const typeIDP = ref<string>('') const typeIDP = ref<string>("");
const isEdit = ref<boolean>(false); // const isEdit = ref<boolean>(false); //
const modal = ref<boolean>(false); // popup const modal = ref<boolean>(false); // popup
const modalDevelop = ref<boolean>(false); // popup const modalDevelop = ref<boolean>(false); // popup
@ -46,7 +49,11 @@ const modeView = ref<string>("table"); //การแสดงผล Table,Card
const modeViewPlan = ref<string>("table"); // Table,Card const modeViewPlan = ref<string>("table"); // Table,Card
const modalHistory = ref<boolean>(false); // popup const modalHistory = ref<boolean>(false); // popup
const kpiDevelopmentId = ref<string>(""); // id const kpiDevelopmentId = ref<string>(""); // id
const period = ref<string | null>(null);
const periodOp = ref<DataOptions[]>([
{ id: "OCT", name: "ตุลาคม" },
{ id: "APR", name: "เมษายน" },
]);
/** props*/ /** props*/
const isLeave = defineModel<boolean>("isLeave", { const isLeave = defineModel<boolean>("isLeave", {
required: true, required: true,
@ -87,6 +94,32 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
format: (v) => date2Thai(v), format: (v) => date2Thai(v),
}, },
{
name: "year",
align: "left",
label: "ปีงบประมาณ",
sortable: true,
field: "year",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => {
return `${v ? Number(v) + 543 : "-"}`;
},
},
{
name: "period",
align: "left",
label: "รอบการประเมิน",
sortable: true,
field: "period",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => {
return (
periodOp.value.find((item: DataOptions) => item.id === v)?.name || "-"
);
},
},
{ {
name: "point1Total", name: "point1Total",
align: "left", align: "left",
@ -170,6 +203,8 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
"point1Total", "point1Total",
"year",
"period",
"point1", "point1",
"point2Total", "point2Total",
"point2", "point2",
@ -277,6 +312,32 @@ const columnsHistory = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
format: (v) => date2Thai(v), format: (v) => date2Thai(v),
}, },
{
name: "year",
align: "left",
label: "ปีงบประมาณ",
sortable: true,
field: "year",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => {
return `${v ? Number(v) + 543 : "-"}`;
},
},
{
name: "period",
align: "left",
label: "รอบการประเมิน",
sortable: true,
field: "period",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => {
return (
periodOp.value.find((item: DataOptions) => item.id === v)?.name || "-"
);
},
},
{ {
name: "point1Total", name: "point1Total",
align: "left", align: "left",
@ -381,6 +442,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
]); ]);
const visibleColumnsHistory = ref<String[]>([ const visibleColumnsHistory = ref<String[]>([
"point1Total", "point1Total",
"year",
"period",
"point1", "point1",
"point2Total", "point2Total",
"point2", "point2",
@ -459,6 +522,8 @@ async function addEditData(editStatus: boolean = false) {
const method = editStatus ? "patch" : "post"; const method = editStatus ? "patch" : "post";
const reqBody: RequestItemsObject = { const reqBody: RequestItemsObject = {
...resPerformForm, ...resPerformForm,
period: period.value,
year: year.value,
profileEmployeeId: profileEmployeeId:
!editStatus && empType.value !== "" ? profileId.value : undefined, !editStatus && empType.value !== "" ? profileId.value : undefined,
profileId: profileId:
@ -491,6 +556,8 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
resPerformForm.pointSumTotal = row.pointSumTotal; resPerformForm.pointSumTotal = row.pointSumTotal;
resPerformForm.pointSum = row.pointSum; resPerformForm.pointSum = row.pointSum;
resPerformForm.date = row.date; resPerformForm.date = row.date;
year.value = row.year ? row.year : null;
period.value = row.period ? row.period : null;
} else { } else {
clearData(); clearData();
} }
@ -535,15 +602,16 @@ function onSubmit() {
/** เคลียร์ formDฟta */ /** เคลียร์ formDฟta */
function clearData() { function clearData() {
(id.value = ""), id.value = "";
(resPerformForm.name = ""), resPerformForm.name = "";
(resPerformForm.point1Total = 0), resPerformForm.point1Total = 0;
(resPerformForm.point1 = 0), resPerformForm.point1 = 0;
(resPerformForm.point2Total = 0), resPerformForm.point2Total = 0;
(resPerformForm.point2 = 0), resPerformForm.point2 = 0;
(resPerformForm.pointSumTotal = 0), resPerformForm.pointSumTotal = 0;
(resPerformForm.pointSum = 0), resPerformForm.pointSum = 0;
(resPerformForm.date = null); resPerformForm.date = null;
year.value = new Date().getFullYear();
} }
/** /**
@ -553,7 +621,7 @@ function clearData() {
function openDialogDevelop(data: any) { function openDialogDevelop(data: any) {
modalDevelop.value = true; modalDevelop.value = true;
kpiDevelopmentId.value = data.kpiDevelopmentId; kpiDevelopmentId.value = data.kpiDevelopmentId;
typeIDP.value = data.type typeIDP.value = data.type;
} }
function updatePaginationIdp(newPagination: any) { function updatePaginationIdp(newPagination: any) {
@ -1094,6 +1162,69 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-6">
<datepicker
menu-class-name="modalfix"
v-model="year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
class="inputgreen"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
hide-bottom-space
:model-value="year === null ? null : Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
>
<template v-if="year !== null" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="year = null"
class="cursor-pointer"
/>
</template>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-6">
<q-select
outlined
dense
label="รอบการประเมิน"
v-model="period"
:options="periodOp"
option-value="id"
option-label="name"
emit-value
map-options
class="inputgreen"
>
<template v-if="period" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="period = null"
class="cursor-pointer"
/> </template
></q-select>
</div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
dense dense
@ -1273,7 +1404,11 @@ onMounted(async () => {
</q-card> </q-card>
</q-dialog> </q-dialog>
<DialogDevelop v-model:modal="modalDevelop" v-model:id="kpiDevelopmentId" :type="typeIDP"/> <DialogDevelop
v-model:modal="modalDevelop"
v-model:id="kpiDevelopmentId"
:type="typeIDP"
/>
</template> </template>
<style scoped> <style scoped>

View file

@ -311,7 +311,7 @@ onMounted(() => {
icon="mdi-history" icon="mdi-history"
@click.stop.prevent="showHistoryDialog(props.row.id)" @click.stop.prevent="showHistoryDialog(props.row.id)"
> >
<q-tooltip>ประวแกไข</q-tooltip> <q-tooltip>ประวแกไขกษาการในตำแหน</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
v-if="!isLeave && checkPermission($route)?.attrIsUpdate" v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
@ -345,7 +345,7 @@ onMounted(() => {
round round
@click.stop.prevent="showHistoryDialog(props.row.id)" @click.stop.prevent="showHistoryDialog(props.row.id)"
> >
<q-tooltip>ประวแกไขว</q-tooltip> <q-tooltip>ประวแกไขรกษาการในตำแหน</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
@ -358,7 +358,7 @@ onMounted(() => {
round round
@click.stop.prevent="openEditDialog(props.row)" @click.stop.prevent="openEditDialog(props.row)"
> >
<q-tooltip>แกไข</q-tooltip> <q-tooltip>แกไขอม</q-tooltip>
</q-btn> </q-btn>
</div> </div>
</div> </div>

View file

@ -427,7 +427,7 @@ onMounted(() => {
icon="mdi-history" icon="mdi-history"
@click.stop.prevent="showHistoryDialog(props.row.id)" @click.stop.prevent="showHistoryDialog(props.row.id)"
> >
<q-tooltip>ประวแกไข</q-tooltip> <q-tooltip>ประวแกไขรายการชวยราชการ</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
v-if="!isLeave && checkPermission($route)?.attrIsUpdate" v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
@ -474,7 +474,7 @@ onMounted(() => {
round round
@click.stop.prevent="showHistoryDialog(props.row.id)" @click.stop.prevent="showHistoryDialog(props.row.id)"
> >
<q-tooltip>ประวแกไขว</q-tooltip> <q-tooltip>ประวแกไขรายการชวยราชการ</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
v-if="!isLeave && checkPermission($route)?.attrIsUpdate" v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
@ -484,7 +484,7 @@ onMounted(() => {
round round
@click.stop.prevent="openEditDialog(props.row)" @click.stop.prevent="openEditDialog(props.row)"
> >
<q-tooltip>แกไข</q-tooltip> <q-tooltip>แกไขอม</q-tooltip>
</q-btn> </q-btn>
</div> </div>
</div> </div>

View file

@ -1,6 +1,8 @@
interface RequestItemsObject { interface RequestItemsObject {
profileId?: string; profileId?: string;
profileEmployeeId?: string; profileEmployeeId?: string;
period?: string|null;
year?: number|null;
name: string; name: string;
date: Date | null; date: Date | null;
point1: number; point1: number;
@ -11,4 +13,8 @@ interface RequestItemsObject {
pointSumTotal: number; pointSumTotal: number;
} }
export type { RequestItemsObject }; interface DataOptions{
id:string
name:string
}
export type { RequestItemsObject,DataOptions };

View file

@ -16,6 +16,8 @@ interface ResponseObject {
pointSum: number; pointSum: number;
pointSumTotal: number; pointSumTotal: number;
profileId: string; profileId: string;
year: number|null;
period: string|null;
} }
export type { ResponseObject }; export type { ResponseObject };