-
-
-
+
-
+
+
{{
formData.firstName
? `${formData.prefix}${formData.firstName} ${formData.lastName}`
@@ -66,29 +151,45 @@ function onMobile(type: string) {
- ตำแหน่งในสายงาน
- {{ formData.posName }}
+ {{
+ store.typeProfile == "OFFICER" ? "ตำแหน่งในสายงาน" : "ตำแหน่ง"
+ }}
+ {{ formData.posExecutiveName }}
- ประเภท
- {{ formData.posType }}
+ {{
+ store.typeProfile == "OFFICER" ? "ประเภทตำแหน่ง" : "กลุ่มงาน"
+ }}
+ {{
+ formData.posTypeName ? formData.posTypeName : "-"
+ }}
- ระดับชั้นงาน
- {{ formData.posLevel }}
+ {{
+ store.typeProfile == "OFFICER"
+ ? "ระดับตำแหน่ง"
+ : "ระดับชั้นงาน"
+ }}
+ {{
+ formData.posLevelName ? formData.posLevelName : "-"
+ }}
-
ดาวน์โหลดประวัติแบบย่อ
-
ดาวน์โหลด ก.พ.7/ก.ก. 1
@@ -104,10 +205,14 @@ function onMobile(type: string) {
class="bg-grey-1 text-grey-6 shadow-2"
align="left"
>
-
+
-
+
@@ -129,7 +234,7 @@ function onMobile(type: string) {
-
+
@@ -144,10 +249,10 @@ function onMobile(type: string) {
-
+
@@ -171,6 +276,7 @@ function onMobile(type: string) {
text-color="light-blue-5"
size="14px"
icon="mdi-file-download-outline"
+ @click="onClickDownloadKp7('FULL')"
>
@@ -212,7 +320,7 @@ function onMobile(type: string) {
-
+
ข้อมูลผลงาน
@@ -229,4 +337,4 @@ function onMobile(type: string) {
-
\ No newline at end of file
+
diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts
index a715fa8..a1bfb6e 100644
--- a/src/stores/mixin.ts
+++ b/src/stores/mixin.ts
@@ -1,8 +1,10 @@
import { defineStore } from "pinia";
+import "moment/dist/locale/th";
import moment from "moment";
import CustomComponent from "@/components/CustomDialog.vue";
import { Loading, QSpinnerCube } from "quasar";
+moment.locale("th");
export const useCounterMixin = defineStore("mixin", () => {
/**
* ฟังก์ชันกลาง
@@ -76,75 +78,19 @@ export const useCounterMixin = defineStore("mixin", () => {
* @returns
*/
function date2Thai(
- srcDate: Date,
+ srcDate: Date | null,
isFullMonth: boolean = false,
isTime: boolean = false
) {
- if (srcDate == null) {
- return null;
- `
- `;
- }
- const date = new Date(srcDate);
- const isValidDate = Boolean(+date);
- if (!isValidDate) return srcDate.toString();
- if (isValidDate && date.getFullYear() < 1000) return srcDate.toString();
- const fullMonthThai = [
- "มกราคม",
- "กุมภาพันธ์",
- "มีนาคม",
- "เมษายน",
- "พฤษภาคม",
- "มิถุนายน",
- "กรกฎาคม",
- "สิงหาคม",
- "กันยายน",
- "ตุลาคม",
- "พฤศจิกายน",
- "ธันวาคม",
- ];
- const abbrMonthThai = [
- "ม.ค.",
- "ก.พ.",
- "มี.ค.",
- "เม.ย.",
- "พ.ค.",
- "มิ.ย.",
- "ก.ค.",
- "ส.ค.",
- "ก.ย.",
- "ต.ค.",
- "พ.ย.",
- "ธ.ค.",
- ];
- let dstYear = 0;
- if (date.getFullYear() > 2500) {
- dstYear = date.getFullYear();
- } else {
- dstYear = date.getFullYear() + 543;
- }
- let dstMonth = "";
- if (isFullMonth) {
- dstMonth = fullMonthThai[date.getMonth()];
- } else {
- dstMonth = abbrMonthThai[date.getMonth()];
- }
- let dstTime = "";
- if (isTime) {
- const H = date.getHours().toString().padStart(2, "0");
- const M = date.getMinutes().toString().padStart(2, "0");
- // const S = date.getSeconds().toString().padStart(2, "0")
- // dstTime = " " + H + ":" + M + ":" + S + " น."
- dstTime = " " + H + ":" + M + " น.";
- }
- return (
- date.getDate().toString().padStart(2, "0") +
- " " +
- dstMonth +
- " " +
- dstYear +
- dstTime
- );
+ if (srcDate == null || !moment(srcDate).isValid()) return "";
+
+ const dateMoment = moment(srcDate);
+ const day = dateMoment.format("DD");
+ const month = dateMoment.format(isFullMonth ? "MMMM" : "MMM");
+ const year = +dateMoment.format("YYYY") + 543;
+ return `${day} ${month} ${year}${
+ isTime ? dateMoment.format(" HH:mm น.") : ""
+ }`;
}
function dateThai(
@@ -322,13 +268,19 @@ export const useCounterMixin = defineStore("mixin", () => {
}
function dateToISO(date: Date) {
- return (
- date.getFullYear() +
- "-" +
- appendLeadingZeroes(date.getMonth() + 1) +
- "-" +
- appendLeadingZeroes(date.getDate())
- );
+ if (date != null) {
+ const srcDate = new Date(date);
+
+ return (
+ srcDate.getFullYear() +
+ "-" +
+ appendLeadingZeroes(srcDate.getMonth() + 1) +
+ "-" +
+ appendLeadingZeroes(srcDate.getDate())
+ );
+ } else {
+ return "";
+ }
}
function appendLeadingZeroes(n: number) {