Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-12-18 17:23:54 +07:00
commit 72c3ce8326
9 changed files with 218 additions and 25 deletions

View file

@ -1,5 +1,5 @@
VITE_API_URI_CONFIG=VITE_API_URI_CONFIG
VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL
VITE_MANUAL_URL=VITE_MANUAL_URL
VITE_URL_SSO: VITE_URL_SSO
VITE_URL_SSO=VITE_URL_SSO
VITE_API_REPORT_URL=VITE_API_REPORT_URL

View file

@ -26,8 +26,6 @@ const config = ref<any>({
production: {
API_URI: apiUrlConfig,
API_URL_SUPPORT: `${apiUrlConfig}/support`,
API_URI_ORG_TREE:
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json",
MEET_URI: "meet.frappet.com",
LINK_EVALUATE_PUBLISH: apiUrlConfigPublish,
API_REPORT_TEMPLATE_URI: apiUrlConfigReport,

View file

@ -40,7 +40,7 @@ export default {
dataUserSalary: `${profileOrg}/salary/user`,
dataUserSalaryByType: (type: string) => `${org}/profile${type}/salary/user`,
dataUserHonor: `${profileOrg}/honor/user`,
dataUserAssessments: `${profileOrg}/assessments/user`,
dataUserNopaid: `${profileOrg}/nopaid/user`,
dataUserNopaidByType: (type: string) => `${org}/profile${type}/nopaid/user`,

View file

@ -281,6 +281,17 @@ async function saveStep1() {
other: e.other,
startDate: e.startDate,
}));
const assessments = formDetail.value.assessments.map((e: any) => ({
date: e.date,
point1: e.point1,
point1Total: e.point1Total,
point2: e.point2,
point2Total: e.point2Total,
pointSum: e.pointSum,
pointSumTotal: e.pointSumTotal,
}));
const evaluateType = route.params.type.toString();
const form = {
userId: formDetail.value.id,
@ -308,7 +319,7 @@ async function saveStep1() {
certificates: [...formDetail.value.certificates],
salaries: [...salaries],
trainings: [...formDetail.value.trainings],
assessments: [...formDetail.value.assessments],
assessments: [...assessments],
};
await http

View file

@ -25,6 +25,23 @@ const props = defineProps({
class="row col-12"
:style="$q.screen.lt.sm ? 'width: 80vw' : 'width: 50vw;'"
>
<template v-slot:header="props">
<q-tr :props="props" class="bg-grey-2">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-body2 text-black">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div>
{{ !col.value ? "-" : col.value }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</template>

View file

@ -28,6 +28,7 @@ const {
columnSalaries,
columnTraining,
columnProjectsProposed,
columnAssessments,
} = store;
const props = defineProps({
@ -125,16 +126,17 @@ async function fetchDetail() {
}));
});
http.get(config.API.dataUserHonor).then((res) => {
formDetail.honor = res.data.result.map((e: any) => ({
receivedDate: e.createdAt,
authority: e.issuer,
detail: e.detail,
orderNumber: e.refCommandNo,
doce: e.refCommandDate,
}));
http.get(config.API.dataUserAssessments).then((res) => {
// formDetail.honor = res.data.result
// res.data.result.map((e: any) => ({
// receivedDate: e.createdAt,
// authority: e.issuer,
// detail: e.detail,
// orderNumber: e.refCommandNo,
// doce: e.refCommandDate,
formDetail.assessments = res.data.result;
});
// formDetail.assessments = data.assessments;
// }));
emit("update:formDeital", formDetail);
})
.catch((err) => {
@ -578,8 +580,8 @@ onMounted(async () => {
<div class="col-12"><q-separator /></div>
<div class="col-10">
<TableData
:columns="columnProjectsProposed"
:row="formDetail.honor"
:columns="columnAssessments"
:row="formDetail.assessments"
/>
</div>
</q-card>

View file

@ -222,7 +222,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
name: "receivedDate",
align: "center",
label: "วันที่ได้รับ",
sortable: true,
field: (value) => date2Thai(value),
headerStyle: "font-size: 14px",
@ -266,10 +265,125 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
},
]);
/** ผลงานที่เคยเสนอขอประเมิน (ถ้ามี)*/
const columnAssessments = ref<QTableProps["columns"]>([
{
name: "date",
align: "left",
label: "วันที่ได้รับ",
sortable: true,
field: "date",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
},
{
name: "point1Total",
align: "left",
label: "ส่วนที่1 (น้ำหนัก)",
sortable: true,
field: "point1Total",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "point1",
align: "left",
label: "ผลประเมินส่วนที่1 (คะแนน)",
sortable: true,
field: "point1",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "point2Total",
align: "left",
label: "ส่วนที่2 (น้ำหนัก)",
sortable: true,
field: "point2Total",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "point2",
align: "left",
label: "ผลประเมินส่วนที่2 (คะแนน)",
sortable: true,
field: "point2",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "pointSumTotal",
align: "left",
label: "ผลรวม (น้ำหนัก)",
sortable: true,
field: "pointSumTotal",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "pointSum",
align: "left",
label: "ผลประเมินรวม (คะแนน)",
sortable: true,
field: "pointSum",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "name",
align: "left",
label: "ผลประเมิน",
sortable: true,
field: "name",
format(val, row) {
return `${textPoint(row.pointSum)} ${textRangePoint(row.pointSum)}`;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
function textRangePoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "(คะแนนต่ำกว่าร้อยละ 60.00)";
if (val >= 60.0 && val <= 69.99) return "(คะแนนร้อยละ 60.00 - 69.99)";
if (val >= 70.0 && val <= 79.99) return "(คะแนนร้อยละ 70.00 - 79.99)";
if (val >= 80.0 && val <= 89.99) return " (คะแนนร้อยละ 80.00 - 89.99)";
if (val >= 90.0) return " (คะแนนร้อยละ 90.00 ขึ้นไป)";
else return "";
}
function textPoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val < 60.0) return "ต้องปรับปรุง";
if (val >= 60.0 && val <= 69.99) return "พอใช้";
if (val >= 70.0 && val <= 79.99) return "ดี";
if (val >= 80.0 && val <= 89.99) return "ดีมาก";
if (val >= 90.0) return "ดีเด่น";
else return "-";
}
return {
columnsCertificates,
columnSalaries,
columnTraining,
columnProjectsProposed,
columnAssessments,
};
});

View file

@ -157,10 +157,12 @@ function getDevelop() {
const data = res.data.result;
rows.value = data;
store.devScoreVal = rows.value.reduce(
const totalSummary = rows.value.reduce(
(sum: number, e: any) => sum + e.summary,
0
);
store.devScoreVal = totalSummary / rows.value.length;
});
}

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { ref, onMounted, nextTick, watch } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
@ -22,6 +22,7 @@ const rootOrgID = ref(); // org id ของ root ตัวปัจจุบั
const dataSource = ref(); // Chart
const idActive = ref<string>("");
const dataSourceLock = ref(); // Chart home
const scrollContainer = ref<HTMLElement | null>(null);
/**
* สราง Path Breadcrumbs
@ -87,12 +88,38 @@ function findPath(id: any) {
}
}
function savePNG() {
chartRef.value.savePNG();
/** function ดาวน์โหลดไฟล์โครงสร้าง PNG*/
async function savePNG() {
try {
showLoader();
await scrollToCenter();
await chartRef.value.savePNG();
} catch {
messageError($q);
} finally {
hideLoader();
}
}
function savePDF() {
chartRef.value.savePDF();
/** function ดาวน์โหลดไฟล์โครงสร้าง PDF*/
async function savePDF() {
try {
showLoader();
await scrollToCenter();
await chartRef.value.savePDF();
} catch {
messageError($q);
} finally {
hideLoader();
}
}
/** ฟังก์ชันเลื่อน scroll ไปที่กึ่งกลาง*/
async function scrollToCenter() {
const container = scrollContainer.value;
if (container) {
container.scrollLeft = (container.scrollWidth - container.clientWidth) / 2;
}
}
/**
@ -146,7 +173,7 @@ function searchAndReplace(data: any, id: string) {
}
}
function getActive() {
async function getActive() {
http
.get(config.API.orgActive)
.then(async (res) => {
@ -159,6 +186,19 @@ function getActive() {
})
.finally(() => {});
}
// Watch dataSource
watch(
dataSource,
() => {
// nextTick DOM scroll
nextTick(() => {
scrollToCenter();
});
},
{ deep: true } //
);
/** hook lifecycle*/
onMounted(async () => {
await getActive();
@ -223,7 +263,16 @@ onMounted(async () => {
<div class="col-12">
<q-separator />
</div>
<div style="overflow-x: auto; overflow-y: auto" class="q-pt-md">
<div
ref="scrollContainer"
style="
overflow-x: auto;
overflow-y: auto;
height: 70vh;
position: relative;
"
class="q-pt-md"
>
<StructChart
style="height: 70vh"
ref="chartRef"