Merge branch 'develop' into devTee
This commit is contained in:
commit
72c3ce8326
9 changed files with 218 additions and 25 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
VITE_API_URI_CONFIG=VITE_API_URI_CONFIG
|
VITE_API_URI_CONFIG=VITE_API_URI_CONFIG
|
||||||
VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL
|
VITE_API_PUBLISH_URL=VITE_API_PUBLISH_URL
|
||||||
VITE_MANUAL_URL=VITE_MANUAL_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
|
VITE_API_REPORT_URL=VITE_API_REPORT_URL
|
||||||
|
|
@ -26,8 +26,6 @@ const config = ref<any>({
|
||||||
production: {
|
production: {
|
||||||
API_URI: apiUrlConfig,
|
API_URI: apiUrlConfig,
|
||||||
API_URL_SUPPORT: `${apiUrlConfig}/support`,
|
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",
|
MEET_URI: "meet.frappet.com",
|
||||||
LINK_EVALUATE_PUBLISH: apiUrlConfigPublish,
|
LINK_EVALUATE_PUBLISH: apiUrlConfigPublish,
|
||||||
API_REPORT_TEMPLATE_URI: apiUrlConfigReport,
|
API_REPORT_TEMPLATE_URI: apiUrlConfigReport,
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ export default {
|
||||||
|
|
||||||
dataUserSalary: `${profileOrg}/salary/user`,
|
dataUserSalary: `${profileOrg}/salary/user`,
|
||||||
dataUserSalaryByType: (type: string) => `${org}/profile${type}/salary/user`,
|
dataUserSalaryByType: (type: string) => `${org}/profile${type}/salary/user`,
|
||||||
dataUserHonor: `${profileOrg}/honor/user`,
|
dataUserAssessments: `${profileOrg}/assessments/user`,
|
||||||
dataUserNopaid: `${profileOrg}/nopaid/user`,
|
dataUserNopaid: `${profileOrg}/nopaid/user`,
|
||||||
dataUserNopaidByType: (type: string) => `${org}/profile${type}/nopaid/user`,
|
dataUserNopaidByType: (type: string) => `${org}/profile${type}/nopaid/user`,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,17 @@ async function saveStep1() {
|
||||||
other: e.other,
|
other: e.other,
|
||||||
startDate: e.startDate,
|
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 evaluateType = route.params.type.toString();
|
||||||
const form = {
|
const form = {
|
||||||
userId: formDetail.value.id,
|
userId: formDetail.value.id,
|
||||||
|
|
@ -308,7 +319,7 @@ async function saveStep1() {
|
||||||
certificates: [...formDetail.value.certificates],
|
certificates: [...formDetail.value.certificates],
|
||||||
salaries: [...salaries],
|
salaries: [...salaries],
|
||||||
trainings: [...formDetail.value.trainings],
|
trainings: [...formDetail.value.trainings],
|
||||||
assessments: [...formDetail.value.assessments],
|
assessments: [...assessments],
|
||||||
};
|
};
|
||||||
|
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,23 @@ const props = defineProps({
|
||||||
class="row col-12"
|
class="row col-12"
|
||||||
:style="$q.screen.lt.sm ? 'width: 80vw' : 'width: 50vw;'"
|
: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>
|
</d-table>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ const {
|
||||||
columnSalaries,
|
columnSalaries,
|
||||||
columnTraining,
|
columnTraining,
|
||||||
columnProjectsProposed,
|
columnProjectsProposed,
|
||||||
|
columnAssessments,
|
||||||
} = store;
|
} = store;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -125,16 +126,17 @@ async function fetchDetail() {
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
http.get(config.API.dataUserHonor).then((res) => {
|
http.get(config.API.dataUserAssessments).then((res) => {
|
||||||
formDetail.honor = res.data.result.map((e: any) => ({
|
// formDetail.honor = res.data.result
|
||||||
receivedDate: e.createdAt,
|
// res.data.result.map((e: any) => ({
|
||||||
authority: e.issuer,
|
// receivedDate: e.createdAt,
|
||||||
detail: e.detail,
|
// authority: e.issuer,
|
||||||
orderNumber: e.refCommandNo,
|
// detail: e.detail,
|
||||||
doce: e.refCommandDate,
|
// orderNumber: e.refCommandNo,
|
||||||
}));
|
// doce: e.refCommandDate,
|
||||||
|
formDetail.assessments = res.data.result;
|
||||||
});
|
});
|
||||||
// formDetail.assessments = data.assessments;
|
// }));
|
||||||
emit("update:formDeital", formDetail);
|
emit("update:formDeital", formDetail);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -578,8 +580,8 @@ onMounted(async () => {
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="col-10">
|
<div class="col-10">
|
||||||
<TableData
|
<TableData
|
||||||
:columns="columnProjectsProposed"
|
:columns="columnAssessments"
|
||||||
:row="formDetail.honor"
|
:row="formDetail.assessments"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,6 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
|
||||||
name: "receivedDate",
|
name: "receivedDate",
|
||||||
align: "center",
|
align: "center",
|
||||||
label: "วันที่ได้รับ",
|
label: "วันที่ได้รับ",
|
||||||
|
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (value) => date2Thai(value),
|
field: (value) => date2Thai(value),
|
||||||
headerStyle: "font-size: 14px",
|
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 {
|
return {
|
||||||
columnsCertificates,
|
columnsCertificates,
|
||||||
columnSalaries,
|
columnSalaries,
|
||||||
columnTraining,
|
columnTraining,
|
||||||
columnProjectsProposed,
|
columnProjectsProposed,
|
||||||
|
columnAssessments,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -157,10 +157,12 @@ function getDevelop() {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
rows.value = data;
|
rows.value = data;
|
||||||
|
|
||||||
store.devScoreVal = rows.value.reduce(
|
const totalSummary = rows.value.reduce(
|
||||||
(sum: number, e: any) => sum + e.summary,
|
(sum: number, e: any) => sum + e.summary,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
store.devScoreVal = totalSummary / rows.value.length;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted, nextTick, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
|
@ -22,6 +22,7 @@ const rootOrgID = ref(); // org id ของ root ตัวปัจจุบั
|
||||||
const dataSource = ref(); // ข้อมูล Chart
|
const dataSource = ref(); // ข้อมูล Chart
|
||||||
const idActive = ref<string>("");
|
const idActive = ref<string>("");
|
||||||
const dataSourceLock = ref(); // ข้อมูลตั้งต้นของ Chart ใช้ให้กดกลับไปที่ home
|
const dataSourceLock = ref(); // ข้อมูลตั้งต้นของ Chart ใช้ให้กดกลับไปที่ home
|
||||||
|
const scrollContainer = ref<HTMLElement | null>(null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* สร้าง Path Breadcrumbs
|
* สร้าง Path Breadcrumbs
|
||||||
|
|
@ -87,12 +88,38 @@ function findPath(id: any) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function savePNG() {
|
/** function ดาวน์โหลดไฟล์โครงสร้าง PNG*/
|
||||||
chartRef.value.savePNG();
|
async function savePNG() {
|
||||||
|
try {
|
||||||
|
showLoader();
|
||||||
|
await scrollToCenter();
|
||||||
|
await chartRef.value.savePNG();
|
||||||
|
} catch {
|
||||||
|
messageError($q);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function savePDF() {
|
/** function ดาวน์โหลดไฟล์โครงสร้าง PDF*/
|
||||||
chartRef.value.savePDF();
|
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
|
http
|
||||||
.get(config.API.orgActive)
|
.get(config.API.orgActive)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -159,6 +186,19 @@ function getActive() {
|
||||||
})
|
})
|
||||||
.finally(() => {});
|
.finally(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Watch เมื่อข้อมูลใน dataSource เปลี่ยนแปลง
|
||||||
|
watch(
|
||||||
|
dataSource,
|
||||||
|
() => {
|
||||||
|
// ใช้ nextTick เพื่อให้ DOM อัปเดตเสร็จก่อนค่อยเลื่อน scroll
|
||||||
|
nextTick(() => {
|
||||||
|
scrollToCenter();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{ deep: true } // ตรวจจับการเปลี่ยนแปลงภายในข้อมูล
|
||||||
|
);
|
||||||
|
|
||||||
/** hook lifecycle*/
|
/** hook lifecycle*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getActive();
|
await getActive();
|
||||||
|
|
@ -223,7 +263,16 @@ onMounted(async () => {
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-separator />
|
<q-separator />
|
||||||
</div>
|
</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
|
<StructChart
|
||||||
style="height: 70vh"
|
style="height: 70vh"
|
||||||
ref="chartRef"
|
ref="chartRef"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue