Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop

This commit is contained in:
Kittapath 2024-07-09 14:53:31 +07:00
commit 3437c7c2af
22 changed files with 746 additions and 431 deletions

View file

@ -83,4 +83,10 @@ export default {
kpiSendToGet: (id: string) => `${kpiEvaluationUser}/reason/${id}`,
openPoint: (id: string) => `${kpiEvaluationUser}/open/${id}`,
/**
*
*/
evaluationUser: `${KpiUser}/evaluation/list`,
evaluationUserDone: `${KpiUser}/evaluation/done/kp7`,
};

View file

@ -567,6 +567,11 @@ const menuList = readonly<any[]>([
path: "KPIList",
role: "evaluateKPI",
},
{
label: "ประกาศผล",
path: "KPIResults",
role: "evaluateKPI",
},
{
label: "รายงาน",
path: "KPIReport",

View file

@ -1,21 +1,44 @@
<script setup lang="ts">
import { ref, computed, watch } from "vue";
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/**
* import Type
*/
import type { QTableProps } from "quasar";
import type { HistoryPos } from "@/modules/02_organizationalNew/interface/response/organizational";
/**
* import Components
*/
import Header from "@/components/DialogHeader.vue";
/**
* import Store
*/
import { useCounterMixin } from "@/stores/mixin";
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
/** Use*/
const store = useOrganizational();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
const $q = useQuasar();
const modal = defineModel<boolean>("modal", { required: true });
/**
* props
*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
rowId: {
type: String,
},
});
/**
* Table
*/
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -26,6 +49,15 @@ const columns = ref<QTableProps["columns"]>([
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",
},
{
name: "orgShortName",
align: "left",
@ -35,14 +67,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posMasterNoPrefix",
align: "left",
@ -70,29 +94,66 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const rows = ref<any>([]);
const props = defineProps({
rowId: {
type: String,
{
name: "position",
align: "left",
label: "ตำแแหน่ง",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posType",
align: "left",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "posType",
format(val, row) {
let name = "";
if (row.posType && row.position) {
name = `${row.posType} (${row.position})`;
} else if (row.posType) {
name = `${row.posType}`;
} else if (row.position) {
name = `(${row.position})`;
} else name = "-";
return name;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
});
async function fetchHistoryPos(id: string) {
{
name: "posExecutive",
align: "left",
label: "ตำแหน่งทางการบริหาร",
sortable: true,
field: "posExecutive",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
field: "lastUpdatedAt",
format(val, row) {
return date2Thai(val);
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const rows = ref<HistoryPos[]>([]);
function fetchHistoryPos(id: string) {
showLoader();
await http
http
.get(config.API.orgPosHistory(id))
.then((res) => {
const data: HistoryPos[] = res.data.result;
const list = data.map((e: HistoryPos) => ({
...e,
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "-",
posMasterNoPrefix: e.posMasterNoPrefix ?? "-",
posMasterNo: e.posMasterNo ?? "-",
posMasterNoSuffix: e.posMasterNoSuffix ?? "-",
}));
rows.value = list;
rows.value = data;
})
.catch((err) => {
messageError($q, err);
@ -102,6 +163,9 @@ async function fetchHistoryPos(id: string) {
});
}
/**
* callback function ทำงานเม modal === true
*/
watch(
() => modal.value,
() => {
@ -111,7 +175,7 @@ watch(
</script>
<template>
<q-dialog v-model="modal">
<q-card style="width: 700px; max-width: 80vw">
<q-card style="width: 1000px; max-width: 100vw">
<Header
:tittle="'ประวัติตำแหน่ง'"
:close="
@ -153,7 +217,7 @@ watch(
</div>
<div v-else>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>

View file

@ -1706,52 +1706,50 @@ const fetchData = async () => {
.then((res) => {
let data = res.data.result;
rows.value = [];
data.map((e: any) => {
rows.value.push({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionName: e.positionName,
positionId:
e.positionId !== "00000000-0000-0000-0000-000000000000"
? e.positionId
: "",
posNo: e.posNo,
posNoId:
e.posNoId !== "00000000-0000-0000-0000-000000000000"
? e.posNoId
: "",
positionLine: e.positionLine,
positionLineName: e.positionLineName,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionPathSideName: e.positionPathSideName,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevelId: e.positionLevelId,
positionLevel: e.positionLevel,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveName: e.positionExecutiveName,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
salaryStatus: e.salaryStatus,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
orgName: e.orgName,
agencyName: e.agencyName,
cLevel: e.cLevel,
createdAt: new Date(e.createdAt),
});
});
rows.value = data.map((e: any) => ({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionName: e.positionName,
positionId:
e.positionId !== "00000000-0000-0000-0000-000000000000"
? e.positionId
: "",
posNo: e.posNo,
posNoId:
e.posNoId !== "00000000-0000-0000-0000-000000000000"
? e.posNoId
: "",
positionLine: e.positionLine,
positionLineName: e.positionLineName,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionPathSideName: e.positionPathSideName,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevelId: e.positionLevelId,
positionLevel: e.positionLevel,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveName: e.positionExecutiveName,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
salaryStatus: e.salaryStatus,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
orgName: e.orgName,
agencyName: e.agencyName,
cLevel: e.cLevel,
createdAt: new Date(e.createdAt),
}));
})
.catch((e) => {
messageError($q, e);
@ -2257,46 +2255,44 @@ const clickHistory = async (row: RequestItemsObject) => {
.then((res) => {
let data = res.data.result;
rowsHistory.value = [];
data.map((e: any) => {
rowsHistory.value.push({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
positionName: e.positionName,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineName: e.positionLineName,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionPathSideName: e.positionPathSideName,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveName: e.positionExecutiveName,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryStatus: e.salaryStatus,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
orgName: e.orgName,
agencyName: e.agencyName,
cLevel: e.cLevel,
createdAt: new Date(e.createdAt),
});
});
rowsHistory.value = data.map((e: any) => ({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
positionName: e.positionName,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineName: e.positionLineName,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionPathSideName: e.positionPathSideName,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveName: e.positionExecutiveName,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryStatus: e.salaryStatus,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
orgName: e.orgName,
agencyName: e.agencyName,
cLevel: e.cLevel,
createdAt: new Date(e.createdAt),
}));
})
.catch((e) => {
messageError($q, e);

View file

@ -5,23 +5,43 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
/**
* importType*
*/
import type { QTableProps } from "quasar";
import type { QForm } from "quasar";
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
import type {
HistoryPos,
Position,
} from "@/modules/04_registryNew/interface/response/History";
/** importStore*/
/**
* import components
*/
import DialogHeader from "@/components/DialogHeader.vue";
/**
* importStore
*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
/**
* use
*/
const myForm = ref<QForm>();
const router = useRouter();
const $q = useQuasar();
const { showLoader, hideLoader, messageError, date2Thai, dialogMessageNotify } =
useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
/**props*/
/**
* props
*/
const modal = defineModel<boolean>("modal", { required: true });
/**
* วแปร
*/
const employeeClass = ref<string>("");
const typeKeyword = ref<string>("");
const Keyword = ref<string>("");
@ -35,7 +55,12 @@ const typeKeywordOps = ref<DataOption[]>([
{ id: "position", name: "ตำแหน่ง" },
]);
const positionOps = ref<DataOption[]>([]);
const columns = ref<any["columns"]>([
const options = ref<DataOption[]>([]);
/**
* Table
*/
const columns = ref<QTableProps["columns"]>([
{
name: "no",
label: "ลำดับ",
@ -81,18 +106,26 @@ const columns = ref<any["columns"]>([
align: "left",
label: "วันที่ถือครอง",
field: "date",
format: (val, row) => `${date2Thai(val)}`,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const rows = ref<any>([]);
const rows = ref<HistoryPos[]>([]);
/**
* function fetch อมลตำแหน าราชการ
*/
function fecthPositionOfficer() {
http
.get(config.API.listPositionPathHistory)
.then((res) => {
let data = res.data.result.items;
positionOps.value = data.map((e: any) => ({ id: e.id, name: e.name }));
positionOps.value = data.map((e: Position) => ({
id: e.id,
name: e.name,
}));
options.value = positionOps.value;
})
.catch((err) => {
@ -100,12 +133,20 @@ function fecthPositionOfficer() {
});
}
/**
* function fetch อมลตำแหน กจางประจำ
*/
function fetchPositionPerm() {
http
.get(config.API.listPositionEmployeePositionHistory)
.then((res) => {
let data = res.data.result.items;
positionOps.value = data.map((e: any) => ({ id: e.id, name: e.name }));
console.log(data);
positionOps.value = data.map((e: Position) => ({
id: e.id,
name: e.name,
}));
options.value = positionOps.value;
})
.catch((err) => {
@ -113,12 +154,20 @@ function fetchPositionPerm() {
});
}
/**
* function เปลยนประเภท
*/
function changeEmployeeClass() {
typeKeyword.value = "";
Keyword.value = "";
positionKeyword.value = "";
rows.value = [];
}
/**
* function เลอกฟลดจะคนหา
* @param typeKeyword ประเภทฟลด
*/
function selectTypeKeyword(typeKeyword: string) {
positionOps.value = [];
positionKeyword.value = "";
@ -131,6 +180,10 @@ function selectTypeKeyword(typeKeyword: string) {
}
}
/**
* function นหาประวอครองตำแหน
* @param type ประเภทขาราชการ
*/
function clickSearch(type: string) {
myForm.value!.validate().then((result: boolean) => {
if (result) {
@ -151,16 +204,15 @@ function clickSearch(type: string) {
.then((res) => {
let data = res.data.result;
if (data.length !== 0) {
rows.value = data.map((e: any) => ({
rows.value = data.map((e: HistoryPos) => ({
id: e.id,
citizenId: e.citizenId,
name: e.fullName,
posNo: e.posNo,
position: e.position,
date: date2Thai(e.date),
date: e.date,
}));
} else {
dialogMessageNotify($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
rows.value = [];
}
})
@ -174,8 +226,13 @@ function clickSearch(type: string) {
}
});
}
const options = ref<any>([]);
function filterFn(val: string, update: any) {
/**
* function นหาขอม Optiion
* @param val คำคนหา
* @param update function
*/
function filterFn(val: string, update: Function) {
if (val === "") {
update(() => {
options.value = positionOps.value;
@ -189,6 +246,11 @@ function filterFn(val: string, update: any) {
});
}
}
/**
* function redirect ไปทะเบยนประว
* @param id
*/
function clickRedirect(id: string) {
const url =
employeeClass.value === "officer"
@ -197,42 +259,32 @@ function clickRedirect(id: string) {
router.push(`${url}/${id}`);
}
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",
descending: false,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
/**
* function popup
*/
function closeDialog() {
modal.value = false;
employeeClass.value = "";
typeKeyword.value = "";
Keyword.value = "";
positionKeyword.value = "";
rows.value = [];
}
</script>
<template>
<q-dialog v-model="modal">
<q-card style="width: 850px; max-width: 80vw">
<q-toolbar>
<q-toolbar-title class="text-subtitle2 text-bold"
>ประวอครองตำแหน</q-toolbar-title
>
<q-btn
icon="close"
unelevated
round
dense
v-close-popup
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<DialogHeader :tittle="'ประวัติถือครองตำแหน่ง'" :close="closeDialog" />
<q-separator />
<div class="dialog-card-contain">
<q-card-section class="q-pa-sm">
<q-form ref="myForm">
<div class="col-12 bg-grey-2 q-pa-sm">
<div class="q-col-gutter-xs row no-wrap">
<q-card-section class="q-pa-sm">
<q-form ref="myForm">
<div class="col-12 bg-grey-2 q-pa-sm">
<div class="col-12 row q-pb-sm q-col-gutter-sm items-center"></div>
<div class="q-col-gutter-xs row no-wrap">
<div class="col-4">
<q-select
hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภท'}`]"
@ -250,6 +302,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
input-debounce="0"
@update:model-value="changeEmployeeClass"
/>
</div>
<div class="col-3">
<q-select
hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ฟิลด์ที่จะค้น'}`]"
@ -267,8 +321,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
input-debounce="0"
@update:model-value="selectTypeKeyword(typeKeyword)"
/>
</div>
<div class="col" v-if="typeKeyword === 'no'">
<q-input
v-if="typeKeyword === 'no'"
borderless
outlined
dense
@ -278,8 +334,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
:rules="[(val:string) => !!val || `${'กรุณากรอก ตำแหน่งเลขที่'}`]"
hide-bottom-space
/>
</div>
<div class="col" v-if="typeKeyword === 'position'">
<q-select
v-if="typeKeyword === 'position'"
hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณาเลือก ตำแหน่ง'}`]"
outlined
@ -304,119 +362,78 @@ const paginationLabel = (start: number, end: number, total: number) => {
</q-item>
</template></q-select
>
<q-space />
<div class="col-2 row">
<q-btn
dense
color="primary"
icon="mdi-magnify"
label="ค้นหา"
class="col-12"
@click="clickSearch(employeeClass)"
/>
</div>
</div>
<q-space />
<q-btn
color="primary"
icon="mdi-magnify"
label="ค้นหา"
@click="clickSearch(employeeClass)"
/>
</div>
</q-form>
</q-card-section>
</div>
</div>
<div class="col-12 q-px-sm q-pb-sm">
<q-table
flat
dense
bordered
:rows="rows"
:columns="columns"
row-key="order"
class="custom-header-table"
no-data-label="ไม่มีข้อมูล"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<div class="text-grey-7 text-weight-medium">
<span class="row">{{ col.label }}</span>
</div>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
<q-td
key="citizenId"
class="text-primary"
@click="clickRedirect(props.row.id)"
:props="props"
>{{ props.row.citizenId }}</q-td
>
<q-td
key="name"
class="text-primary"
@click="clickRedirect(props.row.id)"
:props="props"
>{{ props.row.name }}</q-td
>
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
<q-td key="position" :props="props">{{
props.row.position
}}</q-td>
<q-td key="date" :props="props">{{ props.row.date }}</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<q-pagination
v-model="pagination.page"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
</q-table>
</div>
<!-- <q-card-actions align="right">
<q-btn flat label="OK" color="primary" v-close-popup />
</q-card-actions> -->
<div class="col-12 q-mt-sm">
<d-table
flat
dense
bordered
:rows="rows"
:columns="columns"
row-key="order"
no-data-label="ไม่มีข้อมูล"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div class="text-grey-7 text-weight-medium">
<span class="row">{{ col.label }}</span>
</div>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else-if="col.name === 'citizenId'"
class="text-primary"
@click="clickRedirect(props.row.id)"
>
{{ props.row.citizenId ?? "-" }}
</div>
<div
v-else-if="col.name === 'name'"
class="text-primary"
@click="clickRedirect(props.row.id)"
>
{{ props.row.name ?? "-" }}
</div>
<div v-else class="table_ellipsis2">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</q-form>
</q-card-section>
</q-card>
</q-dialog>
</template>
<style scoped>
.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;
}
}
</style>
<style scoped></style>

View file

@ -0,0 +1,23 @@
interface HistoryPos {
citizenId: string;
date: string | Date;
fullName: string;
id: string;
posNo: string;
position: string;
}
interface Position {
createdAt: string;
createdFullName: string;
createdUserId: string;
id: string;
isActive: boolean;
lastUpdateFullName: string;
lastUpdateUserId: "";
lastUpdatedAt: string;
name: string;
note: string;
}
export type { HistoryPos, Position };

View file

@ -299,6 +299,8 @@ function deleteProductivitys(item: number) {
}
}
/** get ข้อมูล */
async function getUser() {
await http
@ -980,17 +982,18 @@ watch(knowledge.value, () => {
* @param update fn
*/
function filterFnCaretaker(val: string, update: any) {
const dataFilter = filtermantor(OPcaretaker.value, [caretaker2.value]).filter(
(i: any) => i.id !== chairman.value.id
);
if (val == "") {
update(() => {
optionCaretaker.value = filtermantor(OPcaretaker.value, [
caretaker2.value,
]);
optionCaretaker.value = dataFilter;
});
} else {
update(() => {
optionCaretaker.value = filtermantor(OPcaretaker.value, [
caretaker2.value,
]).filter((e: any) => e.name.search(val) !== -1);
optionCaretaker.value = dataFilter.filter(
(e: any) => e.name.search(val) !== -1
);
});
}
}
@ -1002,17 +1005,18 @@ function filterFnCaretaker(val: string, update: any) {
*/
function filterFnCaretaker2(val: string, update: any) {
const dataFilter = filtermantor(OPcaretaker.value, [caretaker1.value]).filter(
(i: any) => i.id !== chairman.value.id
);
if (val == "") {
update(() => {
optionCaretaker2.value = filtermantor(OPcaretaker.value, [
caretaker1.value,
]);
optionCaretaker2.value = dataFilter;
});
} else {
update(() => {
optionCaretaker2.value = filtermantor(OPcaretaker.value, [
caretaker1.value,
]).filter((e: any) => e.name.search(val) !== -1);
optionCaretaker2.value = dataFilter.filter(
(e: any) => e.name.search(val) !== -1
);
});
}
}
@ -1024,13 +1028,16 @@ function filterFnCaretaker2(val: string, update: any) {
*/
function filterFnCommander(val: string, update: any) {
const dataFilter = OPcommander.value.filter(
(i: any) => i.id !== chairman.value.id
);
if (val == "") {
update(() => {
OPcommanderFn.value = OPcommander.value;
OPcommanderFn.value = dataFilter;
});
} else {
update(() => {
OPcommanderFn.value = OPcommander.value.filter(
OPcommanderFn.value = dataFilter.filter(
(e: any) => e.name.search(val) !== -1
);
});
@ -1044,13 +1051,19 @@ function filterFnCommander(val: string, update: any) {
*/
function filterFnChairman(val: string, update: any) {
const dataFilter = OPchairman.value.filter(
(i: any) =>
i.id !== caretaker1.value.id &&
i.id !== caretaker2.value.id &&
i.id !== commander.value.id
);
if (val == "") {
update(() => {
OPchairmanFn.value = OPchairman.value;
OPchairmanFn.value = dataFilter;
});
} else {
update(() => {
OPchairmanFn.value = OPchairman.value.filter(
OPchairmanFn.value = dataFilter.filter(
(e: any) => e.name.search(val) !== -1
);
});

View file

@ -972,39 +972,37 @@ const fetchData = async () => {
.then((res) => {
let data = res.data.result;
rows.value = [];
data.map((e: ResponseObject) => {
rows.value.push({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
salaryStatus: e.salaryStatus,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
rows.value = data.map((e: ResponseObject) => ({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
salaryStatus: e.salaryStatus,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
}));
})
.catch((e) => {
messageError($q, e);
@ -1450,39 +1448,37 @@ const clickHistory = async (row: RequestItemsObject) => {
.then((res) => {
let data = res.data.result;
rowsHistory.value = [];
data.map((e: ResponseObject) => {
rowsHistory.value.push({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
salaryStatus: e.salaryStatus,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
rowsHistory.value = data.map((e: ResponseObject) => ({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
salaryStatus: e.salaryStatus,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
}));
})
.catch((e) => {
messageError($q, e);

View file

@ -899,6 +899,7 @@ const getClass = (val: boolean) => {
:rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
:label="`${'พ.ศ.'}`"
dense
hide-bottom-space
outlined
>
</q-input>
@ -927,6 +928,7 @@ const getClass = (val: boolean) => {
:class="getClass(true)"
outlined
dense
hide-bottom-space
class="full-width datepicker"
:model-value="
dateCommand != null ? date2Thai(dateCommand) : null

View file

@ -243,7 +243,7 @@ onMounted(async () => {
class="q-mr-sm"
@click="router.go(-1)"
/>
ตราคาจาง กลมท{{ groupSalary }}
ตราคาจางของ กลมท {{ groupSalary }}
</div>
</div>
<q-card flat bordered class="q-pa-md">

View file

@ -240,7 +240,7 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
class="q-mr-sm"
@click="router.go(-1)"
/>
ตราเงนเดอน ของ{{ posType }}
ตราเงนเดอนของ {{ posType }}
</div>
</div>
<q-card flat bordered class="q-pa-md">

View file

@ -171,11 +171,17 @@ function getData() {
developmentMethod.value = data.developEvaluator;
developmentPeriod.value = data.timeEvaluator;
evaluatorComment.value = data.reasonEvaluator;
superiorCommentCheck.value = data.isReasonCommander.toString();
superiorCommentCheck.value =
data.isReasonCommander != null
? data.isReasonCommander.toString()
: null;
superiorComment.value = data.reasonCommander;
additionalSuperiorCheck.value = data.isReasonCommanderHigh.toString();
additionalSuperiorCheck.value =
data.isReasonCommanderHigh != null
? data.isReasonCommanderHigh.toString()
: null;
additionalSuperiorComment.value = data.reasonCommanderHigh;
result1.value = data.totalPoint1;
result2.value = data.totalPoint2_1 + data.totalPoint2_2;

View file

@ -863,6 +863,7 @@ const title = computed(() => {
autoApply
:enableTimePicker="false"
week-start="0"
@update:model-value="formDetail.endDate = null"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -906,6 +907,7 @@ const title = computed(() => {
autoApply
:enableTimePicker="false"
week-start="0"
:min-date="formDetail.startDate"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{

View file

@ -349,7 +349,7 @@ onMounted(() => {
<d-table
ref="table"
:columns="columns"
:rows="rows.length !== 0 ? rows[item.id]:[]"
:rows="rows[item.id].length !== 0 ? rows[item.id]:[]"
row-key="id"
flat
bordered

View file

@ -0,0 +1,12 @@
<script setup lang="ts">
/**
* props
*/
const tab = defineModel<string>("tab", { required: true });
</script>
<template>
{{ tab }}
</template>
<style scoped></style>

View file

@ -14,6 +14,7 @@ const listPage = () => import("@/modules/14_KPI/views/list.vue");
const detailPage = () => import("@/modules/14_KPI/views/detail.vue");
const reportPage = () => import("@/modules/14_KPI/views/report.vue");
const detailView = () => import("@/modules/14_KPI/views/detailView.vue");
const ResultsView = () => import("@/modules/14_KPI/views/resultsMain.vue");
export default [
{
@ -68,4 +69,15 @@ export default [
Role: "evaluateKPI",
},
},
{
path: "/KPI/results",
name: "KPIResults",
component: ResultsView,
meta: {
Auth: true,
Key: [1.1],
Role: "evaluateKPI",
},
},
];

View file

@ -0,0 +1,99 @@
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/**
* import type
*/
import type { ItemsTab } from "@/modules/14_KPI/interface/index/Main";
/**
* import components
*/
import TableResults from "@/modules/14_KPI/components/results/tableResults.vue";
/**
* importStore
*/
import { useCounterMixin } from "@/stores/mixin";
/**
* use
*/
const $q = useQuasar();
const { dialogRemove, messageError, showLoader, hideLoader, success } =
useCounterMixin();
/**
* วแปร
*/
const tab = ref<string>("COMPLETE");
const tabItems = ref<ItemsTab[]>([
{ name: "COMPLETE", label: " รอประกาศผล" },
{ name: "KP7", label: "ประกาศผลแล้ว" },
]);
const page = ref<number>(1);
const pageSize = ref<number>(10);
function fetcDatahList() {
showLoader();
http
.post(config.API.evaluationUser, {
status: tab.value,
page: page.value,
pageSize: pageSize.value,
})
.then((res) => {})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
watch(tab, () => {
page.value = 1;
pageSize.value = 10;
fetcDatahList();
});
onMounted(() => {
fetcDatahList();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">ประกาศผล</div>
<q-card flast bordered>
<q-tabs
v-model="tab"
dense
align="left"
inline-label
class="bg-white text-grey"
active-color="primary"
indicator-color="primary"
>
<div v-for="item in tabItems">
<q-tab :name="item.name" :label="item.label" />
</div>
</q-tabs>
<q-separator />
<q-tab-panels v-model="tab" animated class="shadow-2 rounded-borders">
<q-tab-panel name="COMPLETE">
<TableResults :tab="tab" />
</q-tab-panel>
<q-tab-panel name="KP7">
<TableResults :tab="tab" />
</q-tab-panel>
</q-tab-panels>
</q-card>
</template>
<style scoped></style>

View file

@ -441,6 +441,21 @@ onMounted(() => {
<q-separator />
<q-card-section >
<div class="row q-col-gutter-sm">
<div class="col-12">
<q-input
dense
outlined
class="inputgreen"
label="ชื่อตัวชี้วัด"
v-model="formIndicators.indicators"
hide-bottom-space
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกชื่อตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-6">
<q-select
dense
@ -461,23 +476,9 @@ onMounted(() => {
]"
/>
</div>
<div class="col-4">
<q-input
dense
outlined
class="inputgreen"
label="ชื่อตัวชี้วัด"
v-model="formIndicators.indicators"
hide-bottom-space
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกชื่อตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-2">
<div class="col-6">
<q-input
dense
outlined

View file

@ -133,7 +133,7 @@ onMounted(() => {
<q-tab-panel name="Target"> <Target /></q-tab-panel>
<q-tab-panel name="ProjectDetail" style="padding: 0px"> <ProjectDetail /> </q-tab-panel>
<q-tab-panel name="FollowResult"> <FollowResult /> </q-tab-panel>
<q-tab-panel name="Other" style="padding: 0px"> <Other /> </q-tab-panel>
<q-tab-panel name="Other" style="padding: 0px"> <Other :status="status"/> </q-tab-panel>
<q-tab-panel name="Record"> <Record /> </q-tab-panel>
</q-tab-panels>
</div>

View file

@ -23,6 +23,7 @@ const {
const route = useRoute();
const projectId = ref<string>(route.params.id.toLocaleString());
const status = defineModel<string>('status',{required:true})
const provinceOp = ref<DataOption[]>([]);
const provinceOpMain = ref<DataOption[]>([]);
const budgetOp = ref<DataOption[]>([
@ -475,7 +476,7 @@ onMounted(() => {
reverse-fill-mask
/>
</div>
<div class="col-3">
<div class="col-3" v-if="status == 'FINISH'">
<q-input
outlined
dense

View file

@ -15,6 +15,11 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
import http from "@/plugins/http";
import config from "@/app.config";
const other1 = ref<boolean>(false);
const other2 = ref<boolean>(false);
const otherInput1 = ref<string>("");
const otherInput2 = ref<string>("");
const $q = useQuasar();
const store = useDevelopmentDataStore();
const route = useRoute();
@ -161,7 +166,9 @@ async function onSubmit() {
projectModal: formData.projectModal,
isBackPlanned: formData.isBackPlanned,
isHoldPlanned: formData.isHoldPlanned,
projectDayBackPlanned: formData.isBackPlanned ? formData.projectDayBackPlanned:null,
projectDayBackPlanned: formData.isBackPlanned
? formData.projectDayBackPlanned
: null,
projectDayHoldPlanned: formData.projectDayHoldPlanned,
projectNigthHoldPlanned: formData.projectNigthHoldPlanned,
developmentProjectTechniquePlanneds:
@ -206,6 +213,15 @@ function updateSelected(data: DataStrategic, type: string) {
}
}
function checkOther(type: number, val: boolean) {
if(val == false){
if(type == 1){
otherInput1.value = ''
}else if(type == 2){
otherInput2.value = ''
}
}
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
fetchData();
@ -232,7 +248,6 @@ onMounted(() => {
/>
</div>
<q-card bordered class="col-12 q-my-sm">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
@ -285,7 +300,9 @@ onMounted(() => {
<q-item
clickable
@click.stop="updateSelected(prop.node, '1')"
:active="formData.strategyChildPlannedId == prop.node.id"
:active="
formData.strategyChildPlannedId == prop.node.id
"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
@ -448,7 +465,29 @@ onMounted(() => {
type="checkbox"
/>
</div>
<div class="col-12 q-mb-lg">
<div class="row">
<div class="col-4 relative-position">
<div class="other_custom">
<q-checkbox
v-model="other1"
label="อื่นๆ"
size="sm"
color="primary"
keep-color
:disable="store.projectStatus === 'FINISH'"
@update:model-value="checkOther(1, other1)"
/>
</div>
</div>
<div class="col-8 relative-position">
<div class="other_custom_input" v-if="other1 == true">
<q-input v-model="otherInput1" dense outlined label="กรุณากรอก อื่นๆ"></q-input>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
:disable="store.projectStatus === 'FINISH'"
@ -534,6 +573,28 @@ onMounted(() => {
type="checkbox"
/>
</div>
<div class="col-12 q-mb-lg">
<div class="row">
<div class="col-4 relative-position">
<div class="other_custom">
<q-checkbox
v-model="other2"
label="อื่นๆ"
size="sm"
color="primary"
keep-color
@update:model-value="checkOther(2, other2)"
/>
</div>
</div>
<div class="col-8 relative-position">
<div class="other_custom_input" v-if="other2 == true">
<q-input v-model="otherInput2" dense outlined label="กรุณากรอก อื่นๆ"></q-input>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
@ -573,4 +634,14 @@ onMounted(() => {
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
.other_custom {
position: absolute;
left: -7px;
top: -29px;
}
.other_custom_input {
position: absolute;
top: -25px;
width: 100%;
}
</style>

View file

@ -1104,6 +1104,47 @@ onMounted(() => {
v-for="(items, index) in formGroupTarget.positions"
class="col-12 row q-col-gutter-sm"
>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
class="inputgreen"
v-model="items.posTypeId"
:options="posTypeOp"
option-label="name"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ประเภทตำแหน่ง"
@update:model-value="updatePosTypeName"
/>
</div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
class="inputgreen"
v-model="items.posLevelId"
:options="
posTypeMain.find((v) => items.posTypeId === v.id)
?.posLevels || []
"
option-label="posLevelName"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ระดับตำแหน่ง"
/>
</div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
@ -1121,58 +1162,6 @@ onMounted(() => {
]"
/>
</div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
hide-bottom-space
lazy-rules
class="inputgreen"
v-model="items.posTypeId"
:options="posTypeOp"
option-label="name"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ประเภทตำแหน่ง"
@update:model-value="updatePosTypeName"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกประเภทตำแหน่ง'}`,
]"
/>
</div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
hide-bottom-space
lazy-rules
class="inputgreen"
v-model="items.posLevelId"
:options="
posTypeMain.find((v) => items.posTypeId === v.id)
?.posLevels || []
"
option-label="posLevelName"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ระดับตำแหน่ง"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกระดับ'}`,
]"
/>
</div>
<div
class="col-1 q-mt-sm"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"