แก้คำ
This commit is contained in:
parent
3b1c883c8e
commit
00cd6e18f2
6 changed files with 167 additions and 24 deletions
|
|
@ -75,14 +75,14 @@ watch(modal, (val) => {
|
|||
</div>
|
||||
|
||||
<div class="row q-mt-md text-grey-6">
|
||||
<div class="col-12">สาเหตุ /เหตุผล</div>
|
||||
<div class="col-12">สาเหตุ/เหตุผล</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">{{ data.reson ? data.reson : "-" }}</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-mt-md text-grey-6">
|
||||
<div class="col-12">คำสั่ง /เอกสารอ้างอิง</div>
|
||||
<div class="col-12">คำสั่ง/เอกสารอ้างอิง</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
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 DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
|
@ -36,9 +39,9 @@ const profileId = ref<string>(
|
|||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const year = ref<number | null>(new Date().getFullYear()); //ปีงบประมาณ
|
||||
const id = ref<string>(""); //id ที่ต้องการแก้ไข
|
||||
const typeIDP = ref<string>('')
|
||||
const typeIDP = ref<string>("");
|
||||
const isEdit = ref<boolean>(false); //สถานะการแก้ไขข้อมูล
|
||||
const modal = 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 modalHistory = ref<boolean>(false); //แสดง popup ประวัติแก้ไข
|
||||
const kpiDevelopmentId = ref<string>(""); // id การพัฒนารายบุคคล
|
||||
|
||||
const period = ref<string | null>(null);
|
||||
const periodOp = ref<DataOptions[]>([
|
||||
{ id: "OCT", name: "ตุลาคม" },
|
||||
{ id: "APR", name: "เมษายน" },
|
||||
]);
|
||||
/** props*/
|
||||
const isLeave = defineModel<boolean>("isLeave", {
|
||||
required: true,
|
||||
|
|
@ -87,6 +94,32 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
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",
|
||||
align: "left",
|
||||
|
|
@ -170,6 +203,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumns = ref<String[]>([
|
||||
"point1Total",
|
||||
"year",
|
||||
"period",
|
||||
"point1",
|
||||
"point2Total",
|
||||
"point2",
|
||||
|
|
@ -277,6 +312,32 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
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",
|
||||
align: "left",
|
||||
|
|
@ -381,6 +442,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumnsHistory = ref<String[]>([
|
||||
"point1Total",
|
||||
"year",
|
||||
"period",
|
||||
"point1",
|
||||
"point2Total",
|
||||
"point2",
|
||||
|
|
@ -459,6 +522,8 @@ async function addEditData(editStatus: boolean = false) {
|
|||
const method = editStatus ? "patch" : "post";
|
||||
const reqBody: RequestItemsObject = {
|
||||
...resPerformForm,
|
||||
period: period.value,
|
||||
year: year.value,
|
||||
profileEmployeeId:
|
||||
!editStatus && empType.value !== "" ? profileId.value : undefined,
|
||||
profileId:
|
||||
|
|
@ -491,6 +556,8 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
|||
resPerformForm.pointSumTotal = row.pointSumTotal;
|
||||
resPerformForm.pointSum = row.pointSum;
|
||||
resPerformForm.date = row.date;
|
||||
year.value = row.year ? row.year : null;
|
||||
period.value = row.period ? row.period : null;
|
||||
} else {
|
||||
clearData();
|
||||
}
|
||||
|
|
@ -535,15 +602,16 @@ function onSubmit() {
|
|||
|
||||
/** เคลียร์ formDฟta */
|
||||
function clearData() {
|
||||
(id.value = ""),
|
||||
(resPerformForm.name = ""),
|
||||
(resPerformForm.point1Total = 0),
|
||||
(resPerformForm.point1 = 0),
|
||||
(resPerformForm.point2Total = 0),
|
||||
(resPerformForm.point2 = 0),
|
||||
(resPerformForm.pointSumTotal = 0),
|
||||
(resPerformForm.pointSum = 0),
|
||||
(resPerformForm.date = null);
|
||||
id.value = "";
|
||||
resPerformForm.name = "";
|
||||
resPerformForm.point1Total = 0;
|
||||
resPerformForm.point1 = 0;
|
||||
resPerformForm.point2Total = 0;
|
||||
resPerformForm.point2 = 0;
|
||||
resPerformForm.pointSumTotal = 0;
|
||||
resPerformForm.pointSum = 0;
|
||||
resPerformForm.date = null;
|
||||
year.value = new Date().getFullYear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -553,7 +621,7 @@ function clearData() {
|
|||
function openDialogDevelop(data: any) {
|
||||
modalDevelop.value = true;
|
||||
kpiDevelopmentId.value = data.kpiDevelopmentId;
|
||||
typeIDP.value = data.type
|
||||
typeIDP.value = data.type;
|
||||
}
|
||||
|
||||
function updatePaginationIdp(newPagination: any) {
|
||||
|
|
@ -1094,6 +1162,69 @@ onMounted(async () => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</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">
|
||||
<q-input
|
||||
dense
|
||||
|
|
@ -1273,7 +1404,11 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</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>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ onMounted(() => {
|
|||
icon="mdi-history"
|
||||
@click.stop.prevent="showHistoryDialog(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขวินัย</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขรักษาการในตำแหน่ง</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
|
||||
|
|
@ -345,7 +345,7 @@ onMounted(() => {
|
|||
round
|
||||
@click.stop.prevent="showHistoryDialog(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวิติแก้ไขวินัย</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขรักษาการในตำแหน่ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
|
|
@ -358,7 +358,7 @@ onMounted(() => {
|
|||
round
|
||||
@click.stop.prevent="openEditDialog(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ onMounted(() => {
|
|||
icon="mdi-history"
|
||||
@click.stop.prevent="showHistoryDialog(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขวินัย</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขรายการช่วยราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
|
||||
|
|
@ -474,7 +474,7 @@ onMounted(() => {
|
|||
round
|
||||
@click.stop.prevent="showHistoryDialog(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวิติแก้ไขวินัย</q-tooltip>
|
||||
<q-tooltip>ประวัติแก้ไขรายการช่วยราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
|
||||
|
|
@ -484,7 +484,7 @@ onMounted(() => {
|
|||
round
|
||||
@click.stop.prevent="openEditDialog(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
interface RequestItemsObject {
|
||||
profileId?: string;
|
||||
profileEmployeeId?: string;
|
||||
period?: string|null;
|
||||
year?: number|null;
|
||||
name: string;
|
||||
date: Date | null;
|
||||
point1: number;
|
||||
|
|
@ -11,4 +13,8 @@ interface RequestItemsObject {
|
|||
pointSumTotal: number;
|
||||
}
|
||||
|
||||
export type { RequestItemsObject };
|
||||
interface DataOptions{
|
||||
id:string
|
||||
name:string
|
||||
}
|
||||
export type { RequestItemsObject,DataOptions };
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ interface ResponseObject {
|
|||
pointSum: number;
|
||||
pointSumTotal: number;
|
||||
profileId: string;
|
||||
year: number|null;
|
||||
period: string|null;
|
||||
}
|
||||
|
||||
export type { ResponseObject };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue