updated format code & eslint rule

This commit is contained in:
Warunee Tamkoo 2024-09-02 14:01:01 +07:00
parent 67c6810def
commit 8a31554f38
102 changed files with 6271 additions and 6164 deletions

21
.eslintrc.cjs Normal file
View file

@ -0,0 +1,21 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier/recommended",
],
overrides: [
{
files: ["cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}"],
extends: ["plugin:cypress/recommended"],
},
],
parserOptions: {
ecmaVersion: "latest",
},
};

View file

@ -11,7 +11,8 @@
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' :4173 'cypress open --e2e'", "test:e2e:dev": "start-server-and-test 'vite dev --port 4173' :4173 'cypress open --e2e'",
"build-only": "vite build", "build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier ./src --write"
}, },
"dependencies": { "dependencies": {
"@fullcalendar/core": "^6.0.1", "@fullcalendar/core": "^6.0.1",

View file

@ -1,44 +1,47 @@
/**config api */ /**config api */
import { ref } from "vue" import { ref } from "vue";
const env = ref<string>(process.env.NODE_ENV || "development") const env = ref<string>(process.env.NODE_ENV || "development");
export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG;
export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL;
// if (process.env.VUE_APP_TEST) { // if (process.env.VUE_APP_TEST) {
// env = "test"; // env = "test";
// } // }
const config = ref<any>({ const config = ref<any>({
development: { development: {
// API_URI: "https://localhost:7260/api", // API_URI: "https://localhost:7260/api",
API_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_URI: "https://bma-ehr.frappet.synology.me/api/v1",
API_URL_SUPPORT: "https://bma-ehr.frappet.synology.me/api/v1/support", API_URL_SUPPORT: "https://bma-ehr.frappet.synology.me/api/v1/support",
MEET_URI: "meet.frappet.com", MEET_URI: "meet.frappet.com",
LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me", LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me",
}, },
test: { test: {
API_URI: "http://localhost:5010/api/v1", API_URI: "http://localhost:5010/api/v1",
MEET_URI: "meet.frappet.com", MEET_URI: "meet.frappet.com",
}, },
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", API_URI_ORG_TREE:
MEET_URI: "meet.frappet.com", "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json",
LINK_EVALUATE_PUBLISH: apiUrlConfigPublish, MEET_URI: "meet.frappet.com",
}, LINK_EVALUATE_PUBLISH: apiUrlConfigPublish,
}) },
});
const API_URI = ref<string>(config.value[env.value].API_URI) const API_URI = ref<string>(config.value[env.value].API_URI);
const API_URL_SUPPORT = ref<string>(config.value[env.value].API_URL_SUPPORT) const API_URL_SUPPORT = ref<string>(config.value[env.value].API_URL_SUPPORT);
const MEET_URI = ref<string>(config.value[env.value].MEET_URI) const MEET_URI = ref<string>(config.value[env.value].MEET_URI);
const LINK_EVALUATE_PUBLISH = ref<string>(config.value[env.value].LINK_EVALUATE_PUBLISH) const LINK_EVALUATE_PUBLISH = ref<string>(
config.value[env.value].LINK_EVALUATE_PUBLISH
);
export default { export default {
env: env.value, env: env.value,
config: config.value, config: config.value,
API_URI: API_URI.value, API_URI: API_URI.value,
API_URL_SUPPORT: API_URL_SUPPORT.value, API_URL_SUPPORT: API_URL_SUPPORT.value,
MEET_URI: MEET_URI.value, MEET_URI: MEET_URI.value,
LINK_EVALUATE_PUBLISH: LINK_EVALUATE_PUBLISH.value, LINK_EVALUATE_PUBLISH: LINK_EVALUATE_PUBLISH.value,
} };

View file

@ -3,11 +3,10 @@ const probation = `${env.API_URI}/probation`;
const org = `${env.API_URI}/org`; const org = `${env.API_URI}/org`;
const kpiCapacity = `${env.API_URI}/kpi/capacity`; const kpiCapacity = `${env.API_URI}/kpi/capacity`;
const reportProbation = `${env.API_URI}/report/probation`; const reportProbation = `${env.API_URI}/report/probation`;
export default { export default {
probationMain:(id:string)=>`${probation}/assign/probation-assign-list?personal_id=${id}`, probationMain: (id: string) =>
`${probation}/assign/probation-assign-list?personal_id=${id}`,
orgProfilePlacement: (id: string) => `${org}/profile/placement/${id}`, orgProfilePlacement: (id: string) => `${org}/profile/placement/${id}`,
calculateDate: () => `${probation}/calculate/assign-finish`, calculateDate: () => `${probation}/calculate/assign-finish`,
@ -55,6 +54,6 @@ export default {
`${probation}/evaluate-record/create/commander?assign_id=${id}`, `${probation}/evaluate-record/create/commander?assign_id=${id}`,
reportEvaluateRecord1: (type: string, id: string) => reportEvaluateRecord1: (type: string, id: string) =>
`${reportProbation}/14/${type}/${id}`, `${reportProbation}/14/${type}/${id}`,
kpiCapacity kpiCapacity,
}; };

View file

@ -7,5 +7,6 @@ const developmentSalaryFile = `${env.API_URI}/salary/file`;
export default { export default {
developmentScholarshipReport, developmentScholarshipReport,
developmentScholarship: `${development}/scholarship`, developmentScholarship: `${development}/scholarship`,
developmentSalaryFile: (name: string, group: string, id: string) => `${developmentSalaryFile}/${name}/${group}/${id}`, developmentSalaryFile: (name: string, group: string, id: string) =>
`${developmentSalaryFile}/${name}/${group}/${id}`,
}; };

View file

@ -1,13 +1,11 @@
/** /**
* API Structure + Org Chart * API Structure + Org Chart
*/ */
import env from "../index" import env from "../index";
const tttt = `${env.API_URI}/test`
const tttt = `${env.API_URI}/test`;
export default { export default {
gettttt: `${tttt}`, gettttt: `${tttt}`,
puttttt: (id: string) => `${tttt}/${id}`, puttttt: (id: string) => `${tttt}/${id}`,
};
}

View file

@ -1,9 +1,9 @@
import env from "../index" import env from "../index";
const placementTransfer = `${env.API_URI}/placement` const placementTransfer = `${env.API_URI}/placement`;
export default { export default {
listUserTransfer: () => `${placementTransfer}/transfer/user`, listUserTransfer: () => `${placementTransfer}/transfer/user`,
listtransfer: () => `${placementTransfer}/transfer`, listtransfer: () => `${placementTransfer}/transfer`,
transferByid: (id: string) => `${placementTransfer}/transfer/user/${id}`, transferByid: (id: string) => `${placementTransfer}/transfer/user/${id}`,
} };

View file

@ -1,66 +1,77 @@
<template> <template>
<q-dialog ref="dialogRef" @hide="onDialogHide" persistent> <q-dialog ref="dialogRef" @hide="onDialogHide" persistent>
<q-card class="q-pa-sm"> <q-card class="q-pa-sm">
<q-card-section class="row"> <q-card-section class="row">
<div class="q-pr-md"> <div class="q-pr-md">
<q-avatar :icon="icon" size="lg" font-size="25px" color="blue-1" :text-color="color" /> <q-avatar
</div> :icon="icon"
<div class="col text-dark"> size="lg"
<span class="text-bold">{{ title }}</span> font-size="25px"
<br /> color="blue-1"
<span>{{ message }}</span> :text-color="color"
</div> />
</q-card-section> </div>
<div class="col text-dark">
<span class="text-bold">{{ title }}</span>
<br />
<span>{{ message }}</span>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal" v-if="onlycancel"> <q-card-actions
<q-btn label="ตกลง" flat color="grey-8" @click="onDialogCancel" /> align="right"
<!-- <q-btn :label="textOk" :color="color" @click="onOKClick" /> --> class="bg-white text-teal"
</q-card-actions> v-if="onlycancel"
<q-card-actions align="right" class="bg-white text-teal" v-else> >
<q-btn label="ยกเลิก" flat color="grey-8" @click="onDialogCancel" /> <q-btn label="ตกลง" flat color="grey-8" @click="onDialogCancel" />
<q-btn :label="textOk" :color="color" @click="onOKClick" /> <!-- <q-btn :label="textOk" :color="color" @click="onOKClick" /> -->
</q-card-actions> </q-card-actions>
</q-card> <q-card-actions align="right" class="bg-white text-teal" v-else>
</q-dialog> <q-btn label="ยกเลิก" flat color="grey-8" @click="onDialogCancel" />
<q-btn :label="textOk" :color="color" @click="onOKClick" />
</q-card-actions>
</q-card>
</q-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useDialogPluginComponent } from "quasar" import { useDialogPluginComponent } from "quasar";
const props = defineProps({ const props = defineProps({
color: { color: {
type: String, type: String,
default: "primary", default: "primary",
}, },
textOk: { textOk: {
type: String, type: String,
default: "ตกลง", default: "ตกลง",
}, },
title: { title: {
type: String, type: String,
default: "หัวข้อ?", default: "หัวข้อ?",
}, },
message: { message: {
type: String, type: String,
default: "ข้อความ", default: "ข้อความ",
}, },
icon: { icon: {
type: String, type: String,
default: "question_mark", default: "question_mark",
}, },
onlycancel: { onlycancel: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
}) });
defineEmits([ defineEmits([
// REQUIRED; need to specify some events that your // REQUIRED; need to specify some events that your
// component will emit through useDialogPluginComponent() // component will emit through useDialogPluginComponent()
...useDialogPluginComponent.emits, ...useDialogPluginComponent.emits,
]) ]);
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent() const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
useDialogPluginComponent();
// dialogRef - Vue ref to be applied to QDialog // dialogRef - Vue ref to be applied to QDialog
// onDialogHide - Function to be used as handler for @hide on QDialog // onDialogHide - Function to be used as handler for @hide on QDialog
// onDialogOK - Function to call to settle dialog with "ok" outcome // onDialogOK - Function to call to settle dialog with "ok" outcome
@ -70,10 +81,10 @@ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginC
// this is part of our example (so not required) // this is part of our example (so not required)
function onOKClick() { function onOKClick() {
// on OK, it is REQUIRED to // on OK, it is REQUIRED to
// call onDialogOK (with optional payload) // call onDialogOK (with optional payload)
onDialogOK() onDialogOK();
// or with payload: onDialogOK({ ... }) // or with payload: onDialogOK({ ... })
// ...and it will also hide the dialog automatically // ...and it will also hide the dialog automatically
} }
</script> </script>

View file

@ -108,9 +108,9 @@ const paginationLabel = (start: string, end: string, total: string) => {
.q-table thead tr:first-child th { .q-table thead tr:first-child th {
top: 0; top: 0;
} }
.q-table__middle{ .q-table__middle {
margin-bottom: 0!important; margin-bottom: 0 !important;
min-height: 0px!important; min-height: 0px !important;
} }
} }
</style> </style>

View file

@ -52,7 +52,10 @@ watch(searchData, () => {
<q-card bordered> <q-card bordered>
<div class="row" style="flex-wrap: nowrap"> <div class="row" style="flex-wrap: nowrap">
<!-- Left --> <!-- Left -->
<div v-if="!store.openChat || $q.screen.gt.xs" class="col-xs-12 col-sm-4 col-md-4"> <div
v-if="!store.openChat || $q.screen.gt.xs"
class="col-xs-12 col-sm-4 col-md-4"
>
<!-- New --> <!-- New -->
<div class="q-pt-md"> <div class="q-pt-md">
<div class="q-px-md q-pb-md"> <div class="q-px-md q-pb-md">
@ -105,7 +108,7 @@ watch(searchData, () => {
$q.screen.gt.xs ? '' : (store.openChat = true); $q.screen.gt.xs ? '' : (store.openChat = true);
store.currentIssue = item.id; store.currentIssue = item.id;
store.currentTitle = item.title; store.currentTitle = item.title;
store.currentIssueDate = item.createdAt store.currentIssueDate = item.createdAt;
store.issue store.issue
? (store.issue.result = store.issue.result.map( ? (store.issue.result = store.issue.result.map(
(v) => { (v) => {

View file

@ -1,27 +1,27 @@
import { defineStore } from "pinia" import { defineStore } from "pinia";
export const useTransferDataStore = defineStore("transfer", () => { export const useTransferDataStore = defineStore("transfer", () => {
const statusText = (val: string) => { const statusText = (val: string) => {
switch (val) { switch (val) {
case "WAITTING": case "WAITTING":
return "รอดำเนินการ" return "รอดำเนินการ";
case "PENDING": case "PENDING":
return "เลือกตำแหน่งแล้ว" return "เลือกตำแหน่งแล้ว";
case "APPROVE": case "APPROVE":
return "อนุมัติ" return "อนุมัติ";
case "REJECT": case "REJECT":
return "ไม่อนุมัติ" return "ไม่อนุมัติ";
case "REPORT": case "REPORT":
return "ส่งรายชื่อไปออกคำสั่ง" return "ส่งรายชื่อไปออกคำสั่ง";
case "DONE": case "DONE":
return "ออกคำสั่งเสร็จแล้ว" return "ออกคำสั่งเสร็จแล้ว";
default: default:
return "-" return "-";
} }
} };
return { return {
statusText, statusText,
} };
}) });

View file

@ -1,29 +1,24 @@
interface QuestionDescription { interface QuestionDescription {
question1Desc: string; question1Desc: string;
question2Desc: string; question2Desc: string;
question3Desc: string; question3Desc: string;
question4Desc: string; question4Desc: string;
question5Desc: string; question5Desc: string;
question6Desc: string; question6Desc: string;
question7Desc: string; question7Desc: string;
question8Desc: string; question8Desc: string;
question9Desc: string; question9Desc: string;
question10Desc: string; question10Desc: string;
[key: string]: string; [key: string]: string;
} }
interface OptionQuestions { interface OptionQuestions {
label: string; label: string;
value: number; value: number;
} }
interface OptionQuestions2 { interface OptionQuestions2 {
label: string; label: string;
value: boolean; value: boolean;
} }
export type { QuestionDescription, OptionQuestions, OptionQuestions2 };
export type {
QuestionDescription,
OptionQuestions,
OptionQuestions2
};

View file

@ -2,48 +2,48 @@
* Router * Router
*/ */
const MainRetire = () => import("@/modules/03_retire/views/main.vue") const MainRetire = () => import("@/modules/03_retire/views/main.vue");
const AddRetire = () => import("@/modules/03_retire/views/addRetire.vue") const AddRetire = () => import("@/modules/03_retire/views/addRetire.vue");
const ResultQuestionair = () => import("@/modules/03_retire/views/result.vue") const ResultQuestionair = () => import("@/modules/03_retire/views/result.vue");
export default [ export default [
{ {
path: "/retire", path: "/retire",
name: "Retire", name: "Retire",
component: MainRetire, component: MainRetire,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
{ {
path: "/retire/add", path: "/retire/add",
name: "AddRetire", name: "AddRetire",
component: AddRetire, component: AddRetire,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
{ {
path: "/retire/:id", path: "/retire/:id",
name: "detailRetire", name: "detailRetire",
component: AddRetire, component: AddRetire,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
{ {
path: "/retire/result/:id", path: "/retire/result/:id",
name: "resultRetire", name: "resultRetire",
component: ResultQuestionair, component: ResultQuestionair,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
] ];

File diff suppressed because it is too large Load diff

View file

@ -14,42 +14,42 @@ const mixin = useCounterMixin();
const router = useRouter(); const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const { date2Thai, dateToISO, dialogRemove, success, messageError, fails } = const { date2Thai, dateToISO, dialogRemove, success, messageError, fails } =
mixin; mixin;
const edit = ref<boolean>(true); const edit = ref<boolean>(true);
const leaveId = ref<any>(""); const leaveId = ref<any>("");
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: null, default: null,
}, },
onSubmit: { onSubmit: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
onConfirm: { onConfirm: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
clickDelete: { clickDelete: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
}); });
/** ข้อมูล v-model ของฟอร์ม */ /** ข้อมูล v-model ของฟอร์ม */
const formDataBirth = reactive<any>({ const formDataBirth = reactive<any>({
type: dataStore.typeId, type: dataStore.typeId,
leaveWrote: "", leaveWrote: "",
leaveStartDate: null, leaveStartDate: null,
leaveEndDate: null, leaveEndDate: null,
leaveTotal: "", leaveTotal: "",
leaveLast: "", leaveLast: "",
leaveNumber: "", leaveNumber: "",
leaveAddress: "", leaveAddress: "",
leaveDetail: "", leaveDetail: "",
leaveDocument: [], leaveDocument: [],
}); });
/** ตัวแปร ref สำหรับแสดง validate */ /** ตัวแปร ref สำหรับแสดง validate */
@ -64,62 +64,62 @@ const leaveDocumentRef = ref<object | null>(null);
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const FormRef: FormRef = { const FormRef: FormRef = {
leaveWrote: leaveWroteRef, leaveWrote: leaveWroteRef,
leaveStartDate: leaveStartDateRef, leaveStartDate: leaveStartDateRef,
leaveEndDate: leaveEndDateRef, leaveEndDate: leaveEndDateRef,
leaveTotal: leaveTotalRef, leaveTotal: leaveTotalRef,
leaveNumber: leaveNumberRef, leaveNumber: leaveNumberRef,
leaveAddress: leaveAddressRef, leaveAddress: leaveAddressRef,
leaveDetail: leaveDetailRef, leaveDetail: leaveDetailRef,
leaveDocument: leaveDocumentRef, leaveDocument: leaveDocumentRef,
}; };
/** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */ /** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */
const nameFile = ref<string>(""); const nameFile = ref<string>("");
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
async function fileUploadDoc(files: any) { async function fileUploadDoc(files: any) {
files.forEach((file: any) => { files.forEach((file: any) => {
fileDocDataUpload.value.push(file); fileDocDataUpload.value.push(file);
}); });
} }
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */ /** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
function onValidate() { function onValidate() {
const hasError = []; const hasError = [];
for (const key in FormRef) { for (const key in FormRef) {
if (Object.prototype.hasOwnProperty.call(FormRef, key)) { if (Object.prototype.hasOwnProperty.call(FormRef, key)) {
const property = FormRef[key]; const property = FormRef[key];
if (property.value && typeof property.value.validate === "function") { if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate(); const isValid = property.value.validate();
hasError.push(isValid); hasError.push(isValid);
} }
} }
} }
if (hasError.every((result) => result === true)) { if (hasError.every((result) => result === true)) {
const formData = new FormData(); const formData = new FormData();
if (formDataBirth.leaveDocument.length > 0) { if (formDataBirth.leaveDocument.length > 0) {
formDataBirth.leaveDocument.forEach((file: File) => { formDataBirth.leaveDocument.forEach((file: File) => {
formData.append("leaveDocument", file); formData.append("leaveDocument", file);
}); });
} }
// formData.append("leaveDocument", formDataBirth.leaveDocument); // formData.append("leaveDocument", formDataBirth.leaveDocument);
formData.append("type", formDataBirth.type); formData.append("type", formDataBirth.type);
formData.append( formData.append(
"leaveStartDate", "leaveStartDate",
dateToISO(new Date(formDataBirth.leaveStartDate)) dateToISO(new Date(formDataBirth.leaveStartDate))
); );
formData.append( formData.append(
"leaveEndDate", "leaveEndDate",
dateToISO(new Date(formDataBirth.leaveEndDate)) dateToISO(new Date(formDataBirth.leaveEndDate))
); );
formData.append("leaveWrote", formDataBirth.leaveWrote); formData.append("leaveWrote", formDataBirth.leaveWrote);
formData.append("leaveAddress", formDataBirth.leaveAddress); formData.append("leaveAddress", formDataBirth.leaveAddress);
formData.append("leaveNumber", formDataBirth.leaveNumber); formData.append("leaveNumber", formDataBirth.leaveNumber);
formData.append("leaveDetail", formDataBirth.leaveDetail); formData.append("leaveDetail", formDataBirth.leaveDetail);
formData.append("leaveTotal", formDataBirth.leaveTotal); formData.append("leaveTotal", formDataBirth.leaveTotal);
props.onSubmit(formData, isLeave.value); props.onSubmit(formData, isLeave.value);
} }
} }
/** /**
@ -128,368 +128,368 @@ function onValidate() {
*/ */
const isLeave = ref<boolean>(true); const isLeave = ref<boolean>(true);
async function fetchCheck() { async function fetchCheck() {
await http await http
.post(config.API.leaveCheck(), { .post(config.API.leaveCheck(), {
type: dataStore.typeId ?? null, type: dataStore.typeId ?? null,
StartLeaveDate: formDataBirth.leaveStartDate ?? null, StartLeaveDate: formDataBirth.leaveStartDate ?? null,
EndLeaveDate: formDataBirth.leaveEndDate ?? null, EndLeaveDate: formDataBirth.leaveEndDate ?? null,
}) })
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
isLeave.value = data.isLeave; isLeave.value = data.isLeave;
formDataBirth.leaveTotal = data.totalDate; formDataBirth.leaveTotal = data.totalDate;
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}); });
} }
/** แจ้งเมื่อวันลาไม่ถูกต้อง */ /** แจ้งเมื่อวันลาไม่ถูกต้อง */
const dateEndInputStyle = computed(() => { const dateEndInputStyle = computed(() => {
return !isLeave.value ? "input-alert" : ""; return !isLeave.value ? "input-alert" : "";
}); });
/** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */ /** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */
const leaveDocumentList = ref<any>(); const leaveDocumentList = ref<any>();
const statusCheck = ref<any>(""); const statusCheck = ref<any>("");
watch(props.data, () => { watch(props.data, () => {
if (props.data) { if (props.data) {
formDataBirth.leaveWrote = props.data.leaveWrote; formDataBirth.leaveWrote = props.data.leaveWrote;
formDataBirth.leaveStartDate = props.data.leaveStartDate; formDataBirth.leaveStartDate = props.data.leaveStartDate;
formDataBirth.leaveEndDate = props.data.leaveEndDate; formDataBirth.leaveEndDate = props.data.leaveEndDate;
formDataBirth.leaveTotal = props.data.leaveTotal; formDataBirth.leaveTotal = props.data.leaveTotal;
formDataBirth.leaveNumber = props.data.leaveNumber; formDataBirth.leaveNumber = props.data.leaveNumber;
formDataBirth.leaveAddress = props.data.leaveAddress; formDataBirth.leaveAddress = props.data.leaveAddress;
formDataBirth.leaveDetail = props.data.leaveDetail; formDataBirth.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
formDataBirth.leaveDocument = []; formDataBirth.leaveDocument = [];
} }
}); });
/** Hook */ /** Hook */
onMounted(() => { onMounted(() => {
if (props.data) { if (props.data) {
formDataBirth.leaveWrote = props.data.leaveWrote; formDataBirth.leaveWrote = props.data.leaveWrote;
formDataBirth.leaveStartDate = props.data.leaveStartDate; formDataBirth.leaveStartDate = props.data.leaveStartDate;
formDataBirth.leaveEndDate = props.data.leaveEndDate; formDataBirth.leaveEndDate = props.data.leaveEndDate;
formDataBirth.leaveTotal = props.data.leaveTotal; formDataBirth.leaveTotal = props.data.leaveTotal;
formDataBirth.leaveNumber = props.data.leaveNumber; formDataBirth.leaveNumber = props.data.leaveNumber;
formDataBirth.leaveAddress = props.data.leaveAddress; formDataBirth.leaveAddress = props.data.leaveAddress;
formDataBirth.leaveDetail = props.data.leaveDetail; formDataBirth.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
leaveId.value = props.data.id; leaveId.value = props.data.id;
} }
}); });
</script> </script>
<!-- ฟอรมลาคลอดบตร--> <!-- ฟอรมลาคลอดบตร-->
<template> <template>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
</div> </div>
<form @submit.prevent.stop="onValidate"> <form @submit.prevent.stop="onValidate">
<q-card bordered class="q-pa-md bg-grey-1"> <q-card bordered class="q-pa-md bg-grey-1">
<div class="col-12 row q-pa-sm q-col-gutter-sm"> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-input <q-input
class="col-12 col-sm-12 cursor-pointer inputgreen" class="col-12 col-sm-12 cursor-pointer inputgreen"
ref="leaveWroteRef" ref="leaveWroteRef"
for="leaveWroteRef" for="leaveWroteRef"
dense dense
outlined outlined
v-model="formDataBirth.leaveWrote" v-model="formDataBirth.leaveWrote"
label="เขียนที่" label="เขียนที่"
hide-bottom-space hide-bottom-space
bg-color="white" bg-color="white"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:rules="[(val) => !!val || `${'เขียนที่'}`]" :rules="[(val) => !!val || `${'เขียนที่'}`]"
/> />
<datepicker <datepicker
class="col-12 col-md-3 col-sm-12 cursor-pointer inputgreen" class="col-12 col-md-3 col-sm-12 cursor-pointer inputgreen"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formDataBirth.leaveStartDate" v-model="formDataBirth.leaveStartDate"
:locale="'th'" :locale="'th'"
autoApply autoApply
hide-bottom-space hide-bottom-space
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
@update:model-value="formDataBirth.leaveEndDate = null" @update:model-value="formDataBirth.leaveEndDate = null"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
outlined outlined
dense dense
ref="leaveStartDateRef" ref="leaveStartDateRef"
for="leaveStartDateRef" for="leaveStartDateRef"
hide-bottom-space hide-bottom-space
bg-color="white" bg-color="white"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
class="full-width datepicker" class="full-width datepicker"
:model-value=" :model-value="
formDataBirth.leaveStartDate != null formDataBirth.leaveStartDate != null
? date2Thai(formDataBirth.leaveStartDate) ? date2Thai(formDataBirth.leaveStartDate)
: null : null
" "
:label="`${'ลาตั้งแต่วันที่'}`" :label="`${'ลาตั้งแต่วันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]" :rules="[(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--q-primary)" style="color: var(--q-primary)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<datepicker <datepicker
class="col-12 col-md-3 col-sm-12 cursor-pointer inputgreen" class="col-12 col-md-3 col-sm-12 cursor-pointer inputgreen"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formDataBirth.leaveEndDate" v-model="formDataBirth.leaveEndDate"
:locale="'th'" :locale="'th'"
autoApply autoApply
@update:model-value="fetchCheck()" @update:model-value="fetchCheck()"
borderless borderless
hide-bottom-space hide-bottom-space
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="!formDataBirth.leaveStartDate" :readonly="!formDataBirth.leaveStartDate"
:min-date="formDataBirth.leaveStartDate" :min-date="formDataBirth.leaveStartDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
outlined outlined
dense dense
ref="leaveEndDateRef" ref="leaveEndDateRef"
for="leaveEndDateRef" for="leaveEndDateRef"
hide-bottom-space hide-bottom-space
:readonly="!formDataBirth.leaveStartDate" :readonly="!formDataBirth.leaveStartDate"
class="full-width datepicker" class="full-width datepicker"
bg-color="white" bg-color="white"
:model-value=" :model-value="
formDataBirth.leaveEndDate != null formDataBirth.leaveEndDate != null
? date2Thai(formDataBirth.leaveEndDate) ? date2Thai(formDataBirth.leaveEndDate)
: null : null
" "
:label="`${'ลาถึงวันที่'}`" :label="`${'ลาถึงวันที่'}`"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--q-primary)" style="color: var(--q-primary)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<q-input <q-input
class="col-12 col-md-3 col-sm-6" class="col-12 col-md-3 col-sm-6"
dense dense
outlined outlined
ref="leaveTotalRef" ref="leaveTotalRef"
for="leaveTotalRef" for="leaveTotalRef"
v-model="formDataBirth.leaveTotal" v-model="formDataBirth.leaveTotal"
label="จำนวนวันที่ลา" label="จำนวนวันที่ลา"
readonly readonly
:bottom-slots="!isLeave ? true : false" :bottom-slots="!isLeave ? true : false"
:color="!isLeave ? 'red' : 'black'" :color="!isLeave ? 'red' : 'black'"
:bg-color="!isLeave ? 'red-2' : 'white'" :bg-color="!isLeave ? 'red-2' : 'white'"
:border-color="!isLeave ? 'red' : 'gray'" :border-color="!isLeave ? 'red' : 'gray'"
:input-class="!isLeave ? dateEndInputStyle : ''" :input-class="!isLeave ? dateEndInputStyle : ''"
> >
<template v-slot:hint> <template v-slot:hint>
<span style="color: red"> <span style="color: red">
{{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }} {{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }}
</span> </span>
</template> </template>
</q-input> </q-input>
<q-input <q-input
class="col-12 col-md-3 col-sm-6" class="col-12 col-md-3 col-sm-6"
dense dense
outlined outlined
ref="leaveLastRef" ref="leaveLastRef"
for="leaveLastRef" for="leaveLastRef"
v-model="dataStore.leaveLast" v-model="dataStore.leaveLast"
label="ลาครั้งสุดท้ายเมื่อวันที่" label="ลาครั้งสุดท้ายเมื่อวันที่"
readonly readonly
hide-bottom-space hide-bottom-space
bg-color="white" bg-color="white"
/> />
<div class="full-width"> <div class="full-width">
<div class="q-col-gutter-sm row"> <div class="q-col-gutter-sm row">
<q-input <q-input
class="col-12 col-md-3 col-sm-12 cursor-pointer inputgreen" class="col-12 col-md-3 col-sm-12 cursor-pointer inputgreen"
dense dense
outlined outlined
hide-bottom-space hide-bottom-space
bg-color="white" bg-color="white"
ref="leaveNumberRef" ref="leaveNumberRef"
for="leaveNumberRef" for="leaveNumberRef"
v-model="formDataBirth.leaveNumber" v-model="formDataBirth.leaveNumber"
mask="(###)-###-####" mask="(###)-###-####"
unmasked-value unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้" label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:rules="[ :rules="[
(val) => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`, (val) => !!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อได้'}`,
]" ]"
/> />
<q-input <q-input
class="col-12 col-md-9 col-sm-12 cursor-pointer inputgreen" class="col-12 col-md-9 col-sm-12 cursor-pointer inputgreen"
dense dense
outlined outlined
hide-bottom-space hide-bottom-space
bg-color="white" bg-color="white"
ref="leaveAddressRef" ref="leaveAddressRef"
for="leaveAddressRef" for="leaveAddressRef"
v-model="formDataBirth.leaveAddress" v-model="formDataBirth.leaveAddress"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา" label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:rules="[ :rules="[
(val) => !!val || `${'กรุณากรอกที่อยู่ที่ติดต่อได้ระหว่างลา'}`, (val) => !!val || `${'กรุณากรอกที่อยู่ที่ติดต่อได้ระหว่างลา'}`,
]" ]"
/> />
</div> </div>
</div> </div>
<q-input <q-input
type="textarea" type="textarea"
class="col-12 col-md-12 col-sm-12 cursor-pointer inputgreen" class="col-12 col-md-12 col-sm-12 cursor-pointer inputgreen"
dense dense
outlined outlined
bg-color="white" bg-color="white"
ref="leaveDetailRef" ref="leaveDetailRef"
for="leaveDetailRef" for="leaveDetailRef"
v-model="formDataBirth.leaveDetail" v-model="formDataBirth.leaveDetail"
label="รายละเอียด" label="รายละเอียด"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
/> />
<div class="full-width" v-if="statusCheck != 'NEW'"> <div class="full-width" v-if="statusCheck != 'NEW'">
<div class="q-col-gutter-sm row"> <div class="q-col-gutter-sm row">
<!-- multiple --> <!-- multiple -->
<q-file <q-file
for="leaveDocumentRef" for="leaveDocumentRef"
hide-bottom-space hide-bottom-space
v-model="formDataBirth.leaveDocument" v-model="formDataBirth.leaveDocument"
@added="fileUploadDoc" @added="fileUploadDoc"
dense dense
bg-color="white" bg-color="white"
label="เอกสารประกอบ" label="เอกสารประกอบ"
outlined outlined
multiple multiple
use-chips use-chips
class="q-pl-sm col-12" class="q-pl-sm col-12"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
</q-file> </q-file>
</div> </div>
</div> </div>
<div class="col-12 row" v-if="data"> <div class="col-12 row" v-if="data">
<div class="col-12 col-md-12 col-sm-12"> <div class="col-12 col-md-12 col-sm-12">
<q-card> <q-card>
<q-list <q-list
separator separator
v-if="leaveDocumentList && leaveDocumentList.length > 0" v-if="leaveDocumentList && leaveDocumentList.length > 0"
> >
<q-item <q-item
v-for="(document, index) in leaveDocumentList" v-for="(document, index) in leaveDocumentList"
:key="index" :key="index"
class="q-my-xs" class="q-my-xs"
> >
<q-item-section> <q-item-section>
<q-item-label class="row items-baseline"> <q-item-label class="row items-baseline">
<div class="col"> <div class="col">
{{ "เอกสารแนบที่ " + (index + 1) }} {{ "เอกสารแนบที่ " + (index + 1) }}
</div> </div>
<div> <div>
<q-btn <q-btn
:href="document.path" :href="document.path"
target="_blank" target="_blank"
outline outline
flat flat
dense dense
color="blue" color="blue"
icon="mdi-download" icon="mdi-download"
size="12px" size="12px"
class="q-mr-md" class="q-mr-md"
> >
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<div> <div>
<q-btn <q-btn
@click="clickDelete(leaveId, document.docId)" @click="clickDelete(leaveId, document.docId)"
target="_blank" target="_blank"
outline outline
color="red" color="red"
flat flat
dense dense
icon="delete" icon="delete"
size="12px" size="12px"
> >
<q-tooltip>ลบไฟล</q-tooltip> <q-tooltip>ลบไฟล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
</div> </div>
</div> </div>
</q-card> </q-card>
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">
<q-space /> <q-space />
<q-btn <q-btn
v-if="!props.data || props.data.status == 'DRAFT'" v-if="!props.data || props.data.status == 'DRAFT'"
id="onSubmit" id="onSubmit"
type="submit" type="submit"
unelevated unelevated
dense dense
class="q-px-md items-center btnBlue" class="q-px-md items-center btnBlue"
label="บันทึก" label="บันทึก"
><q-tooltip>นทกแบบราง</q-tooltip></q-btn ><q-tooltip>นทกแบบราง</q-tooltip></q-btn
> >
<q-btn <q-btn
v-if="data && statusCheck != 'NEW'" v-if="data && statusCheck != 'NEW'"
id="onSubmit" id="onSubmit"
type="button" type="button"
unelevated unelevated
dense dense
class="q-px-md items-center q-ml-sm" class="q-px-md items-center q-ml-sm"
color="primary" color="primary"
label="ยื่นใบลา" label="ยื่นใบลา"
@click="onConfirm()" @click="onConfirm()"
><q-tooltip>นใบลา</q-tooltip></q-btn ><q-tooltip>นใบลา</q-tooltip></q-btn
> >
</div> </div>
</form> </form>
</template> </template>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -14,13 +14,13 @@ const dataStore = useLeaveStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
date2Thai, date2Thai,
dialogRemove, dialogRemove,
calculateDurationYmd, calculateDurationYmd,
fails, fails,
messageError, messageError,
success, success,
dateToISO, dateToISO,
} = mixin; } = mixin;
const edit = ref<boolean>(true); const edit = ref<boolean>(true);
const files = ref<any>(null); const files = ref<any>(null);
@ -35,90 +35,90 @@ const leaveDocumentRef = ref<object | null>(null);
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: null, default: null,
}, },
onSubmit: { onSubmit: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
onConfirm: { onConfirm: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
clickDelete: { clickDelete: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
}); });
/** ข้อมูล v-model ของฟอร์ม */ /** ข้อมูล v-model ของฟอร์ม */
const formDataHaji = reactive<any>({ const formDataHaji = reactive<any>({
type: dataStore.typeId, type: dataStore.typeId,
leaveWrote: "", leaveWrote: "",
leavegovernmentDate: null, leavegovernmentDate: null,
leaveStartDate: null, leaveStartDate: null,
leaveEndDate: null, leaveEndDate: null,
totalLeave: 0, totalLeave: 0,
hajjDayStatus: "true", hajjDayStatus: "true",
leaveDocument: [], leaveDocument: [],
leaveDetail: "", leaveDetail: "",
}); });
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const formRef: HajiForm = { const formRef: HajiForm = {
leaveWrote: leaveWroteRef, leaveWrote: leaveWroteRef,
leavegovernmentDate: leavegovernmentDateRef, leavegovernmentDate: leavegovernmentDateRef,
leaveStartDate: leaveStartDateRef, leaveStartDate: leaveStartDateRef,
leaveEndDate: leaveEndDateRef, leaveEndDate: leaveEndDateRef,
leaveDocument: leaveDocumentRef, leaveDocument: leaveDocumentRef,
}; };
/** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */ /** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */
const nameFile = ref<string>(""); const nameFile = ref<string>("");
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
const fileUploadDoc = async (files: any) => { const fileUploadDoc = async (files: any) => {
files.forEach((file: any) => { files.forEach((file: any) => {
fileDocDataUpload.value.push(file); fileDocDataUpload.value.push(file);
}); });
}; };
/** ฟังก์ชั่นตรวจสอบความถูกต้องก่อน บันทึก */ /** ฟังก์ชั่นตรวจสอบความถูกต้องก่อน บันทึก */
function onValidate() { function onValidate() {
const hasError = []; const hasError = [];
for (const key in formRef) { for (const key in formRef) {
if (Object.prototype.hasOwnProperty.call(formRef, key)) { if (Object.prototype.hasOwnProperty.call(formRef, key)) {
const property = formRef[key]; const property = formRef[key];
if (property.value && typeof property.value.validate === "function") { if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate(); const isValid = property.value.validate();
hasError.push(isValid); hasError.push(isValid);
} }
} }
} }
if (hasError.every((result) => result === true)) { if (hasError.every((result) => result === true)) {
const formData = new FormData(); const formData = new FormData();
if (formDataHaji.leaveDocument) { if (formDataHaji.leaveDocument) {
formDataHaji.leaveDocument.forEach((file: File) => { formDataHaji.leaveDocument.forEach((file: File) => {
formData.append("leaveDocument", file); formData.append("leaveDocument", file);
}); });
} }
// formData.append("leaveDocument", formDataHaji.leaveDocument); // formData.append("leaveDocument", formDataHaji.leaveDocument);
formData.append("type", formDataHaji.type); formData.append("type", formDataHaji.type);
formData.append( formData.append(
"leaveStartDate", "leaveStartDate",
dateToISO(new Date(formDataHaji.leaveStartDate)) dateToISO(new Date(formDataHaji.leaveStartDate))
); );
formData.append( formData.append(
"leaveEndDate", "leaveEndDate",
dateToISO(new Date(formDataHaji.leaveEndDate)) dateToISO(new Date(formDataHaji.leaveEndDate))
); );
formData.append("hajjDayStatus", formDataHaji.hajjDayStatus); formData.append("hajjDayStatus", formDataHaji.hajjDayStatus);
formData.append("leaveWrote", formDataHaji.leaveWrote); formData.append("leaveWrote", formDataHaji.leaveWrote);
formData.append("leaveDetail", formDataHaji.leaveDetail); formData.append("leaveDetail", formDataHaji.leaveDetail);
formData.append("leaveTotal", formDataHaji.leaveTotal); formData.append("leaveTotal", formDataHaji.leaveTotal);
props.onSubmit(formData, isLeave.value); props.onSubmit(formData, isLeave.value);
} }
} }
/** /**
@ -127,397 +127,397 @@ function onValidate() {
*/ */
const isLeave = ref<boolean>(true); const isLeave = ref<boolean>(true);
async function fetchCheck() { async function fetchCheck() {
console.log("check"); console.log("check");
await http await http
.post(config.API.leaveCheck(), { .post(config.API.leaveCheck(), {
type: dataStore.typeId ?? null, type: dataStore.typeId ?? null,
StartLeaveDate: formDataHaji.leaveStartDate ?? null, StartLeaveDate: formDataHaji.leaveStartDate ?? null,
EndLeaveDate: formDataHaji.leaveEndDate ?? null, EndLeaveDate: formDataHaji.leaveEndDate ?? null,
}) })
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
isLeave.value = data.isLeave; isLeave.value = data.isLeave;
formDataHaji.leaveTotal = data.totalDate; formDataHaji.leaveTotal = data.totalDate;
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}); });
} }
/** /**
* function พเดทค LeaveTotal * function พเดทค LeaveTotal
*/ */
function updateLeaveTotal() { function updateLeaveTotal() {
const newLeaveTotal = calculateDurationYmd( const newLeaveTotal = calculateDurationYmd(
formDataHaji.leaveStartDate, formDataHaji.leaveStartDate,
formDataHaji.leaveEndDate formDataHaji.leaveEndDate
); );
formDataHaji.leaveTotal = newLeaveTotal; formDataHaji.leaveTotal = newLeaveTotal;
} }
/** แจ้งเมื่อวันลาไม่ถูกต้อง */ /** แจ้งเมื่อวันลาไม่ถูกต้อง */
const dateEndInputStyle = computed(() => { const dateEndInputStyle = computed(() => {
return !isLeave.value ? "input-alert" : ""; return !isLeave.value ? "input-alert" : "";
}); });
/** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */ /** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */
const leaveDocumentList = ref<any>(); const leaveDocumentList = ref<any>();
const statusCheck = ref<any>(""); const statusCheck = ref<any>("");
watch(props.data, () => { watch(props.data, () => {
if (props.data) { if (props.data) {
formDataHaji.leaveWrote = props.data.leaveWrote; formDataHaji.leaveWrote = props.data.leaveWrote;
formDataHaji.leaveTotal = props.data.leaveTotal; formDataHaji.leaveTotal = props.data.leaveTotal;
formDataHaji.leaveStartDate = props.data.leaveStartDate; formDataHaji.leaveStartDate = props.data.leaveStartDate;
formDataHaji.leaveEndDate = props.data.leaveEndDate; formDataHaji.leaveEndDate = props.data.leaveEndDate;
formDataHaji.totalLeave = props.data.totalLeave; formDataHaji.totalLeave = props.data.totalLeave;
formDataHaji.hajjDayStatus = props.data.hajjDayStatus; formDataHaji.hajjDayStatus = props.data.hajjDayStatus;
formDataHaji.leaveDetail = props.data.leaveDetail; formDataHaji.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
formDataHaji.leaveDocument = []; formDataHaji.leaveDocument = [];
} }
}); });
/**Hook */ /**Hook */
onMounted(() => { onMounted(() => {
if (props.data) { if (props.data) {
formDataHaji.leaveWrote = props.data.leaveWrote; formDataHaji.leaveWrote = props.data.leaveWrote;
formDataHaji.leaveTotal = props.data.leaveTotal; formDataHaji.leaveTotal = props.data.leaveTotal;
formDataHaji.leaveStartDate = props.data.leaveStartDate; formDataHaji.leaveStartDate = props.data.leaveStartDate;
formDataHaji.leaveEndDate = props.data.leaveEndDate; formDataHaji.leaveEndDate = props.data.leaveEndDate;
formDataHaji.totalLeave = props.data.totalLeave; formDataHaji.totalLeave = props.data.totalLeave;
formDataHaji.hajjDayStatus = props.data.hajjDayStatus; formDataHaji.hajjDayStatus = props.data.hajjDayStatus;
formDataHaji.leaveDetail = props.data.leaveDetail; formDataHaji.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
// formDataHaji.leaveDocument = props.data.leaveDocument; // formDataHaji.leaveDocument = props.data.leaveDocument;
leaveId.value = props.data.id; leaveId.value = props.data.id;
} }
}); });
</script> </script>
<template> <template>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
</div> </div>
<form @submit.prevent="onValidate" class="full-width"> <form @submit.prevent="onValidate" class="full-width">
<q-card bordered class="q-pa-md bg-grey-1"> <q-card bordered class="q-pa-md bg-grey-1">
<div class="row q-pa-sm q-col-gutter-sm"> <div class="row q-pa-sm q-col-gutter-sm">
<q-input <q-input
v-model="formDataHaji.leaveWrote" v-model="formDataHaji.leaveWrote"
ref="leaveWroteRef" ref="leaveWroteRef"
class="col-12 col-sm-12 cursor-pointer inputgreen" class="col-12 col-sm-12 cursor-pointer inputgreen"
bg-color="white" bg-color="white"
dense dense
outlined outlined
label="เขียนที่" label="เขียนที่"
hide-bottom-space hide-bottom-space
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:rules="[(val) => !!val || `${'เขียนที่'}`]" :rules="[(val) => !!val || `${'เขียนที่'}`]"
/> />
<div class="full-width"> <div class="full-width">
<div class="q-col-gutter-sm row"> <div class="q-col-gutter-sm row">
<datepicker <datepicker
v-model="formDataHaji.leaveStartDate" v-model="formDataHaji.leaveStartDate"
class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen" class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen"
menu-class-name="modalfix" menu-class-name="modalfix"
autoApply autoApply
borderless borderless
week-start="0" week-start="0"
:enableTimePicker="false" :enableTimePicker="false"
:locale="'th'" :locale="'th'"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
@update:model-value="formDataHaji.leaveEndDate = null" @update:model-value="formDataHaji.leaveEndDate = null"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
ref="leaveStartDateRef" ref="leaveStartDateRef"
bg-color="white" bg-color="white"
class="full-width datepicker" class="full-width datepicker"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
:label="`${'ลาตั้งแต่วันที่'}`" :label="`${'ลาตั้งแต่วันที่'}`"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:rules="[(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]" :rules="[(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
:model-value=" :model-value="
formDataHaji.leaveStartDate != null formDataHaji.leaveStartDate != null
? date2Thai(formDataHaji.leaveStartDate) ? date2Thai(formDataHaji.leaveStartDate)
: null : null
" "
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--q-primary)" style="color: var(--q-primary)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<datepicker <datepicker
v-model="formDataHaji.leaveEndDate" v-model="formDataHaji.leaveEndDate"
class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen" class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen"
menu-class-name="modalfix" menu-class-name="modalfix"
autoApply autoApply
borderless borderless
week-start="0" week-start="0"
:enableTimePicker="false" :enableTimePicker="false"
:locale="'th'" :locale="'th'"
@update:model-value="updateLeaveTotal(), fetchCheck()" @update:model-value="updateLeaveTotal(), fetchCheck()"
:readonly="!formDataHaji.leaveStartDate || statusCheck === 'NEW'" :readonly="!formDataHaji.leaveStartDate || statusCheck === 'NEW'"
:min-date="formDataHaji.leaveStartDate" :min-date="formDataHaji.leaveStartDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
ref="leaveEndDateRef" ref="leaveEndDateRef"
class="full-width datepicker" class="full-width datepicker"
bg-color="white" bg-color="white"
outlined outlined
dense dense
:readonly=" :readonly="
!formDataHaji.leaveStartDate || statusCheck === 'NEW' !formDataHaji.leaveStartDate || statusCheck === 'NEW'
" "
hide-bottom-space hide-bottom-space
:label="`${'ลาถึงวันที่'}`" :label="`${'ลาถึงวันที่'}`"
:model-value=" :model-value="
formDataHaji.leaveEndDate != null formDataHaji.leaveEndDate != null
? date2Thai(formDataHaji.leaveEndDate) ? date2Thai(formDataHaji.leaveEndDate)
: null : null
" "
@update:model-value="fetchCheck()" @update:model-value="fetchCheck()"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--q-primary)" style="color: var(--q-primary)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<q-input <q-input
:bottom-slots="!isLeave ? true : false" :bottom-slots="!isLeave ? true : false"
:color="!isLeave ? 'red' : 'black'" :color="!isLeave ? 'red' : 'black'"
:bg-color="!isLeave ? 'red-2' : 'white'" :bg-color="!isLeave ? 'red-2' : 'white'"
:border-color="!isLeave ? 'red' : 'gray'" :border-color="!isLeave ? 'red' : 'gray'"
:input-class="!isLeave ? dateEndInputStyle : ''" :input-class="!isLeave ? dateEndInputStyle : ''"
class="col-12 col-md-2 col-sm-6" class="col-12 col-md-2 col-sm-6"
dense dense
outlined outlined
ref="leaveTotalRef" ref="leaveTotalRef"
for="leaveTotalRef" for="leaveTotalRef"
v-model="formDataHaji.leaveTotal" v-model="formDataHaji.leaveTotal"
label="จำนวนวันที่ลา" label="จำนวนวันที่ลา"
readonly readonly
> >
<template v-slot:hint> <template v-slot:hint>
<span style="color: red"> <span style="color: red">
{{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }} {{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }}
</span> </span>
</template> </template>
</q-input> </q-input>
<datepicker <datepicker
class="col-12 col-md-4 col-sm-6" class="col-12 col-md-4 col-sm-6"
menu-class-name="modalfix" menu-class-name="modalfix"
autoApply autoApply
borderless borderless
readonly readonly
week-start="0" week-start="0"
:locale="'th'" :locale="'th'"
:enableTimePicker="false" :enableTimePicker="false"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
ref="leavegovernmentDateRef" ref="leavegovernmentDateRef"
bg-color="white" bg-color="white"
class="full-width" class="full-width"
outlined outlined
dense dense
readonly readonly
hide-bottom-space hide-bottom-space
:label="`${'วันที่เข้ารับราชการ'}`" :label="`${'วันที่เข้ารับราชการ'}`"
:model-value=" :model-value="
dataStore.dateAppoint != null dataStore.dateAppoint != null
? date2Thai(dataStore.dateAppoint) ? date2Thai(dataStore.dateAppoint)
: null : null
" "
:rules="[ :rules="[
(val) => !!val || `${'กรุณาเลือกวันที่เข้ารับราชการ'}`, (val) => !!val || `${'กรุณาเลือกวันที่เข้ารับราชการ'}`,
]" ]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--black)" style="color: var(--black)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
</div> </div>
</div> </div>
<div class="q-pl-sm text-weight-bold text-dark col-12"> <div class="q-pl-sm text-weight-bold text-dark col-12">
เคยไปประกอบพจญหรอไม เคยไปประกอบพจญหรอไม
</div> </div>
<div class="col-12"> <div class="col-12">
<q-radio <q-radio
v-model="formDataHaji.hajjDayStatus" v-model="formDataHaji.hajjDayStatus"
:disable="statusCheck === 'NEW'" :disable="statusCheck === 'NEW'"
:val="true" :val="true"
checked-icon="task_alt" checked-icon="task_alt"
label="เคย" label="เคย"
/> />
<q-radio <q-radio
v-model="formDataHaji.hajjDayStatus" v-model="formDataHaji.hajjDayStatus"
:disable="statusCheck === 'NEW'" :disable="statusCheck === 'NEW'"
:val="false" :val="false"
checked-icon="task_alt" checked-icon="task_alt"
label="ไม่เคยไปประกอบพิธีฮัจญ์" label="ไม่เคยไปประกอบพิธีฮัจญ์"
/> />
</div> </div>
<q-input <q-input
v-model="formDataHaji.leaveDetail" v-model="formDataHaji.leaveDetail"
class="col-12 q-mt-sm cursor-pointer inputgreen" class="col-12 q-mt-sm cursor-pointer inputgreen"
bg-color="white" bg-color="white"
dense dense
outlined outlined
type="textarea" type="textarea"
label="รายละเอียด" label="รายละเอียด"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
/> />
<div class="full-width" v-if="statusCheck != 'NEW'"> <div class="full-width" v-if="statusCheck != 'NEW'">
<div class="q-col-gutter-sm row"> <div class="q-col-gutter-sm row">
<!-- multiple --> <!-- multiple -->
<q-file <q-file
v-model="formDataHaji.leaveDocument" v-model="formDataHaji.leaveDocument"
multiple multiple
bg-color="white" bg-color="white"
label="เอกสารประกอบ" label="เอกสารประกอบ"
use-chips use-chips
@added="fileUploadDoc" @added="fileUploadDoc"
dense dense
outlined outlined
hide-bottom-space hide-bottom-space
class="col-12 q-pl-sm col-12" class="col-12 q-pl-sm col-12"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
</q-file> </q-file>
</div> </div>
</div> </div>
<div class="col-12" v-if="data"> <div class="col-12" v-if="data">
<div class="col-12 col-md-12 col-sm-12"> <div class="col-12 col-md-12 col-sm-12">
<q-card> <q-card>
<q-list <q-list
separator separator
v-if="leaveDocumentList && leaveDocumentList.length > 0" v-if="leaveDocumentList && leaveDocumentList.length > 0"
> >
<q-item <q-item
v-for="(document, index) in leaveDocumentList" v-for="(document, index) in leaveDocumentList"
:key="index" :key="index"
class="q-my-xs" class="q-my-xs"
> >
<q-item-section> <q-item-section>
<q-item-label class="row items-baseline"> <q-item-label class="row items-baseline">
<div class="col"> <div class="col">
{{ "เอกสารแนบที่ " + (index + 1) }} {{ "เอกสารแนบที่ " + (index + 1) }}
</div> </div>
<div> <div>
<q-btn <q-btn
:href="document.path" :href="document.path"
target="_blank" target="_blank"
outline outline
flat flat
dense dense
color="blue" color="blue"
icon="mdi-download" icon="mdi-download"
size="12px" size="12px"
class="q-mr-md" class="q-mr-md"
> >
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<div> <div>
<q-btn <q-btn
@click="clickDelete(leaveId, document.docId)" @click="clickDelete(leaveId, document.docId)"
target="_blank" target="_blank"
outline outline
color="red" color="red"
flat flat
dense dense
icon="delete" icon="delete"
size="12px" size="12px"
> >
<q-tooltip>ลบไฟล</q-tooltip> <q-tooltip>ลบไฟล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
</div> </div>
</div> </div>
</q-card> </q-card>
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">
<q-space /> <q-space />
<q-btn <q-btn
v-if="!props.data || props.data.status == 'DRAFT'" v-if="!props.data || props.data.status == 'DRAFT'"
id="onSubmit" id="onSubmit"
type="submit" type="submit"
unelevated unelevated
dense dense
class="q-px-md items-center btnBlue" class="q-px-md items-center btnBlue"
label="บันทึก" label="บันทึก"
><q-tooltip>นทกแบบราง</q-tooltip></q-btn ><q-tooltip>นทกแบบราง</q-tooltip></q-btn
> >
<q-btn <q-btn
v-if="data && statusCheck != 'NEW'" v-if="data && statusCheck != 'NEW'"
id="onSubmit" id="onSubmit"
type="button" type="button"
unelevated unelevated
dense dense
class="q-px-md items-center q-ml-sm" class="q-px-md items-center q-ml-sm"
color="primary" color="primary"
label="ยื่นใบลา" label="ยื่นใบลา"
@click="onConfirm()" @click="onConfirm()"
><q-tooltip>นใบลา</q-tooltip></q-btn ><q-tooltip>นใบลา</q-tooltip></q-btn
> >
</div> </div>
</form> </form>
</template> </template>

File diff suppressed because it is too large Load diff

View file

@ -156,7 +156,7 @@ function onValidate() {
formData.append("studyDayScholarship", formDataStudy.studyDayScholarship); formData.append("studyDayScholarship", formDataStudy.studyDayScholarship);
formData.append("leaveAddress", formDataStudy.leaveAddress); // formData.append("leaveAddress", formDataStudy.leaveAddress); //
formData.append("leaveNumber", formDataStudy.leaveNumber); // formData.append("leaveNumber", formDataStudy.leaveNumber); //
formData.append("leaveTotal", formDataStudy.leaveTotalDay); // formData.append("leaveTotal", formDataStudy.leaveTotalDay); //
props.onSubmit(formData, isLeave.value); props.onSubmit(formData, isLeave.value);
} }
} }

View file

@ -438,7 +438,7 @@ onMounted(async () => {
hide-bottom-space hide-bottom-space
:label="`${'วันที่เข้ารับราชการ'}`" :label="`${'วันที่เข้ารับราชการ'}`"
:model-value=" :model-value="
dataStore.dateAppoint != null dataStore.dateAppoint != null
? date2Thai(dataStore.dateAppoint) ? date2Thai(dataStore.dateAppoint)
: null : null
" "
@ -486,7 +486,7 @@ onMounted(async () => {
hide-bottom-space hide-bottom-space
:label="`${'วันเดือนปีเกิด'}`" :label="`${'วันเดือนปีเกิด'}`"
:model-value=" :model-value="
dataStore.birthDate != null dataStore.birthDate != null
? date2Thai(dataStore.birthDate) ? date2Thai(dataStore.birthDate)
: null : null
" "

View file

@ -14,14 +14,14 @@ const dataStore = useLeaveStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
date2Thai, date2Thai,
dialogRemove, dialogRemove,
fails, fails,
dateToISO, dateToISO,
success, success,
messageError, messageError,
showLoader, showLoader,
hideLoader, hideLoader,
} = mixin; } = mixin;
const edit = ref<boolean>(true); const edit = ref<boolean>(true);
const router = useRouter(); const router = useRouter();
@ -30,33 +30,33 @@ const leaveId = ref<any>("");
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: null, default: null,
}, },
onSubmit: { onSubmit: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
onConfirm: { onConfirm: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
clickDelete: { clickDelete: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
}); });
/** ข้อมูล v-model ของฟอร์ม */ /** ข้อมูล v-model ของฟอร์ม */
const formDataWorkInternational = reactive<any>({ const formDataWorkInternational = reactive<any>({
type: dataStore.typeId, type: dataStore.typeId,
leaveWrote: "", leaveWrote: "",
leaveStartDate: null, leaveStartDate: null,
leaveEndDate: null, leaveEndDate: null,
leaveDetail: "", leaveDetail: "",
leaveDocument: [], leaveDocument: [],
leaveDraftDocument: null, leaveDraftDocument: null,
}); });
/** ตัวแปร ref สำหรับแสดง validate */ /** ตัวแปร ref สำหรับแสดง validate */
@ -68,11 +68,11 @@ const leaveDocumentRef = ref<object | null>(null);
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const FormRef: FormRef = { const FormRef: FormRef = {
leaveWrote: leaveWroteRef, leaveWrote: leaveWroteRef,
leaveStartDate: leaveStartDateRef, leaveStartDate: leaveStartDateRef,
leaveEndDate: leaveEndDateRef, leaveEndDate: leaveEndDateRef,
leaveDetail: leaveDetailRef, leaveDetail: leaveDetailRef,
leaveDocument: leaveDocumentRef, leaveDocument: leaveDocumentRef,
}; };
/** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */ /** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */
@ -80,72 +80,72 @@ const nameFile = ref<string>("");
const nameFileDraft = ref<string>(""); const nameFileDraft = ref<string>("");
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
const fileUploadDoc = async (files: any) => { const fileUploadDoc = async (files: any) => {
files.forEach((file: any) => { files.forEach((file: any) => {
fileDocDataUpload.value.push(file); fileDocDataUpload.value.push(file);
}); });
}; };
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */ /** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
async function onValidate() { async function onValidate() {
const hasError = []; const hasError = [];
for (const key in FormRef) { for (const key in FormRef) {
if (Object.prototype.hasOwnProperty.call(FormRef, key)) { if (Object.prototype.hasOwnProperty.call(FormRef, key)) {
const property = FormRef[key]; const property = FormRef[key];
if (property.value && typeof property.value.validate === "function") { if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate(); const isValid = property.value.validate();
hasError.push(isValid); hasError.push(isValid);
} }
} }
} }
// Validate // Validate
if (hasError.every((result) => result === true)) { if (hasError.every((result) => result === true)) {
const formData = new FormData(); const formData = new FormData();
if (formDataWorkInternational.leaveDocument.length > 0) { if (formDataWorkInternational.leaveDocument.length > 0) {
formDataWorkInternational.leaveDocument.forEach((file: File) => { formDataWorkInternational.leaveDocument.forEach((file: File) => {
formData.append("leaveDocument", file); formData.append("leaveDocument", file);
}); });
// formData.append("leaveDocument", formDataWorkInternational.leaveDocument) // formData.append("leaveDocument", formDataWorkInternational.leaveDocument)
} }
if (formDataWorkInternational.leaveDraftDocument) { if (formDataWorkInternational.leaveDraftDocument) {
formData.append( formData.append(
"leaveDraftDocument", "leaveDraftDocument",
formDataWorkInternational.leaveDraftDocument formDataWorkInternational.leaveDraftDocument
); );
} }
formData.append("type", formDataWorkInternational.type); // formData.append("type", formDataWorkInternational.type); //
formData.append( formData.append(
"leaveStartDate", "leaveStartDate",
dateToISO(formDataWorkInternational.leaveStartDate) dateToISO(formDataWorkInternational.leaveStartDate)
); // ); //
formData.append( formData.append(
"leaveEndDate", "leaveEndDate",
dateToISO(formDataWorkInternational.leaveEndDate) dateToISO(formDataWorkInternational.leaveEndDate)
); // ); //
formData.append("leaveWrote", formDataWorkInternational.leaveWrote); // formData.append("leaveWrote", formDataWorkInternational.leaveWrote); //
formData.append("leaveDetail", formDataWorkInternational.leaveDetail); formData.append("leaveDetail", formDataWorkInternational.leaveDetail);
formData.append("leaveTotal", formDataWorkInternational.leaveTotal); // formData.append("leaveTotal", formDataWorkInternational.leaveTotal); //
await props.onSubmit(formData, isLeave.value); await props.onSubmit(formData, isLeave.value);
} }
} }
//download function //download function
async function onClickDownloadFile(id: string, fileName: string) { async function onClickDownloadFile(id: string, fileName: string) {
showLoader(); showLoader();
await http await http
.get(config.API.leaveReport(id)) .get(config.API.leaveReport(id))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
await genReport(data, fileName); await genReport(data, fileName);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
/** /**
@ -154,25 +154,25 @@ async function onClickDownloadFile(id: string, fileName: string) {
*/ */
const isLeave = ref<boolean>(true); const isLeave = ref<boolean>(true);
async function fetchCheck() { async function fetchCheck() {
await http await http
.post(config.API.leaveCheck(), { .post(config.API.leaveCheck(), {
type: dataStore.typeId ?? null, type: dataStore.typeId ?? null,
StartLeaveDate: formDataWorkInternational.leaveStartDate ?? null, StartLeaveDate: formDataWorkInternational.leaveStartDate ?? null,
EndLeaveDate: formDataWorkInternational.leaveEndDate ?? null, EndLeaveDate: formDataWorkInternational.leaveEndDate ?? null,
}) })
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
isLeave.value = data.isLeave; isLeave.value = data.isLeave;
formDataWorkInternational.leaveTotal = data.totalDate; formDataWorkInternational.leaveTotal = data.totalDate;
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}); });
} }
/** แจ้งเมื่อวันลาไม่ถูกต้อง */ /** แจ้งเมื่อวันลาไม่ถูกต้อง */
const dateEndInputStyle = computed(() => { const dateEndInputStyle = computed(() => {
return !isLeave.value ? "input-alert" : ""; return !isLeave.value ? "input-alert" : "";
}); });
/** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */ /** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */
@ -180,41 +180,47 @@ const leaveDocumentList = ref<any>();
const leaveDraftDocument = ref<string>(); const leaveDraftDocument = ref<string>();
const statusCheck = ref<any>(""); const statusCheck = ref<any>("");
watch(props, () => { watch(props, () => {
if (props.data) { if (props.data) {
formDataWorkInternational.leaveWrote = props.data.leaveWrote; formDataWorkInternational.leaveWrote = props.data.leaveWrote;
formDataWorkInternational.leaveStartDate = new Date( formDataWorkInternational.leaveStartDate = new Date(
props.data.leaveStartDate props.data.leaveStartDate
); );
formDataWorkInternational.leaveEndDate = new Date(props.data.leaveEndDate); formDataWorkInternational.leaveEndDate = new Date(props.data.leaveEndDate);
formDataWorkInternational.leaveDetail = props.data.leaveDetail; formDataWorkInternational.leaveDetail = props.data.leaveDetail;
leaveDraftDocument.value = props.data.leaveDraftDocument; leaveDraftDocument.value = props.data.leaveDraftDocument;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
formDataWorkInternational.leaveDraftDocument = null; formDataWorkInternational.leaveDraftDocument = null;
formDataWorkInternational.leaveDocument = []; formDataWorkInternational.leaveDocument = [];
} }
}); });
watch(()=>formDataWorkInternational.leaveEndDate,()=>{ watch(
if(formDataWorkInternational.leaveStartDate !== null && formDataWorkInternational.leaveEndDate !== null){ () => formDataWorkInternational.leaveEndDate,
fetchCheck() () => {
} if (
}) formDataWorkInternational.leaveStartDate !== null &&
formDataWorkInternational.leaveEndDate !== null
) {
fetchCheck();
}
}
);
/**Hook */ /**Hook */
onMounted(() => { onMounted(() => {
if (props.data) { if (props.data) {
formDataWorkInternational.leaveWrote = props.data.leaveWrote; formDataWorkInternational.leaveWrote = props.data.leaveWrote;
formDataWorkInternational.leaveStartDate = new Date( formDataWorkInternational.leaveStartDate = new Date(
props.data.leaveStartDate props.data.leaveStartDate
); );
formDataWorkInternational.leaveEndDate = new Date(props.data.leaveEndDate); formDataWorkInternational.leaveEndDate = new Date(props.data.leaveEndDate);
formDataWorkInternational.leaveDetail = props.data.leaveDetail; formDataWorkInternational.leaveDetail = props.data.leaveDetail;
// formDataWorkInternational.leaveDocument = props.data.leaveDocument; // formDataWorkInternational.leaveDocument = props.data.leaveDocument;
leaveDraftDocument.value = props.data.leaveDraftDocument; leaveDraftDocument.value = props.data.leaveDraftDocument;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
leaveId.value = props.data.id; leaveId.value = props.data.id;
} }
}); });
</script> </script>

View file

@ -14,14 +14,14 @@ const dataStore = useLeaveStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
date2Thai, date2Thai,
dialogRemove, dialogRemove,
fails, fails,
dateToISO, dateToISO,
success, success,
messageError, messageError,
showLoader, showLoader,
hideLoader, hideLoader,
} = mixin; } = mixin;
const router = useRouter(); const router = useRouter();
const edit = ref<boolean>(true); const edit = ref<boolean>(true);
@ -36,85 +36,85 @@ const leaveWroteRef = ref<object | null>(null);
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
data: { data: {
type: Object, type: Object,
default: null, default: null,
}, },
onSubmit: { onSubmit: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
onConfirm: { onConfirm: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
clickDelete: { clickDelete: {
type: Function, type: Function,
default: () => "", default: () => "",
}, },
}); });
/** ข้อมูล v-model ของฟอร์ม */ /** ข้อมูล v-model ของฟอร์ม */
const formDataRehabilitation = reactive<any>({ const formDataRehabilitation = reactive<any>({
type: dataStore.typeId, type: dataStore.typeId,
leaveWrote: "", leaveWrote: "",
leaveStartDate: null, leaveStartDate: null,
leaveEndDate: null, leaveEndDate: null,
leaveDocument: [], leaveDocument: [],
leaveDetail: "", leaveDetail: "",
leaveDraftDocument: null, leaveDraftDocument: null,
}); });
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
const formRef: RehabilitationForm = { const formRef: RehabilitationForm = {
leaveStartDate: leaveStartDateRef, leaveStartDate: leaveStartDateRef,
leaveEndDate: leaveEndDateRef, leaveEndDate: leaveEndDateRef,
leaveWrote: leaveWroteRef, leaveWrote: leaveWroteRef,
}; };
/** ฟังก์ชั่นตรวจสอบความถูกต้องก่อน บันทึก */ /** ฟังก์ชั่นตรวจสอบความถูกต้องก่อน บันทึก */
function onValidate() { function onValidate() {
const hasError = []; const hasError = [];
for (const key in formRef) { for (const key in formRef) {
if (Object.prototype.hasOwnProperty.call(formRef, key)) { if (Object.prototype.hasOwnProperty.call(formRef, key)) {
const property = formRef[key]; const property = formRef[key];
if (property.value && typeof property.value.validate === "function") { if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate(); const isValid = property.value.validate();
hasError.push(isValid); hasError.push(isValid);
} }
} }
} }
if (hasError.every((result) => result === true)) { if (hasError.every((result) => result === true)) {
const formData = new FormData(); const formData = new FormData();
if (formDataRehabilitation.leaveDocument.length > 0) { if (formDataRehabilitation.leaveDocument.length > 0) {
formDataRehabilitation.leaveDocument.forEach((file: File) => { formDataRehabilitation.leaveDocument.forEach((file: File) => {
formData.append("leaveDocument", file); formData.append("leaveDocument", file);
}); });
// formData.append("leaveDocument", formDataRehabilitation.leaveDocument) // formData.append("leaveDocument", formDataRehabilitation.leaveDocument)
} }
if (formDataRehabilitation.leaveDraftDocument) { if (formDataRehabilitation.leaveDraftDocument) {
formData.append( formData.append(
"leaveDraftDocument", "leaveDraftDocument",
formDataRehabilitation.leaveDraftDocument formDataRehabilitation.leaveDraftDocument
); );
} }
formData.append("type", formDataRehabilitation.type); // formData.append("type", formDataRehabilitation.type); //
formData.append( formData.append(
"leaveStartDate", "leaveStartDate",
dateToISO(new Date(formDataRehabilitation.leaveStartDate)) dateToISO(new Date(formDataRehabilitation.leaveStartDate))
); // ); //
formData.append( formData.append(
"leaveEndDate", "leaveEndDate",
dateToISO(new Date(formDataRehabilitation.leaveEndDate)) dateToISO(new Date(formDataRehabilitation.leaveEndDate))
); );
formData.append("leaveWrote", formDataRehabilitation.leaveWrote); // formData.append("leaveWrote", formDataRehabilitation.leaveWrote); //
formData.append("leaveDetail", formDataRehabilitation.leaveDetail); // formData.append("leaveDetail", formDataRehabilitation.leaveDetail); //
formData.append("leaveTotal", formDataRehabilitation.leaveTotal); // formData.append("leaveTotal", formDataRehabilitation.leaveTotal); //
props.onSubmit(formData, isLeave.value); props.onSubmit(formData, isLeave.value);
} }
} }
/** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */ /** ส่วนของการประกาศและเลือกไฟล์เอกสารประกอบ */
@ -122,9 +122,9 @@ const nameFile = ref<string>("");
const nameFileDraft = ref<string>(""); const nameFileDraft = ref<string>("");
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
const fileUploadDoc = async (files: any) => { const fileUploadDoc = async (files: any) => {
files.forEach((file: any) => { files.forEach((file: any) => {
fileDocDataUpload.value.push(file); fileDocDataUpload.value.push(file);
}); });
}; };
/** /**
@ -133,42 +133,42 @@ const fileUploadDoc = async (files: any) => {
*/ */
const isLeave = ref<boolean>(true); const isLeave = ref<boolean>(true);
async function FetchCheck() { async function FetchCheck() {
await http await http
.post(config.API.leaveCheck(), { .post(config.API.leaveCheck(), {
type: dataStore.typeId ?? null, type: dataStore.typeId ?? null,
StartLeaveDate: formDataRehabilitation.leaveStartDate ?? null, StartLeaveDate: formDataRehabilitation.leaveStartDate ?? null,
EndLeaveDate: formDataRehabilitation.leaveEndDate ?? null, EndLeaveDate: formDataRehabilitation.leaveEndDate ?? null,
}) })
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
isLeave.value = data.isLeave; isLeave.value = data.isLeave;
formDataRehabilitation.leaveTotal = data.totalDate; formDataRehabilitation.leaveTotal = data.totalDate;
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}); });
} }
//download function //download function
async function onClickDownloadFile(id: string, fileName: string) { async function onClickDownloadFile(id: string, fileName: string) {
showLoader(); showLoader();
await http await http
.get(config.API.leaveReport(id)) .get(config.API.leaveReport(id))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
await genReport(data, fileName); await genReport(data, fileName);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
/** แจ้งเมื่อวันลาไม่ถูกต้อง */ /** แจ้งเมื่อวันลาไม่ถูกต้อง */
const dateEndInputStyle = computed(() => { const dateEndInputStyle = computed(() => {
return !isLeave.value ? "input-alert" : ""; return !isLeave.value ? "input-alert" : "";
}); });
/** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */ /** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาที่ฟอร์มไหม เมื่อมีการส่งจะ map ข้อมูลเข้า v-model ของฟอร์ม */
@ -176,334 +176,334 @@ const leaveDocumentList = ref<any>();
const leaveDraftDocument = ref<string>(); const leaveDraftDocument = ref<string>();
const statusCheck = ref<any>(""); const statusCheck = ref<any>("");
watch(props.data, () => { watch(props.data, () => {
if (props.data) { if (props.data) {
formDataRehabilitation.leaveWrote = props.data.leaveWrote; formDataRehabilitation.leaveWrote = props.data.leaveWrote;
formDataRehabilitation.leaveStartDate = new Date(props.data.leaveStartDate); formDataRehabilitation.leaveStartDate = new Date(props.data.leaveStartDate);
formDataRehabilitation.leaveEndDate = new Date(props.data.leaveEndDate); formDataRehabilitation.leaveEndDate = new Date(props.data.leaveEndDate);
formDataRehabilitation.leaveDetail = props.data.leaveDetail; formDataRehabilitation.leaveDetail = props.data.leaveDetail;
leaveDraftDocument.value = props.data.leaveDraftDocument; leaveDraftDocument.value = props.data.leaveDraftDocument;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
formDataRehabilitation.leaveDraftDocument = null; formDataRehabilitation.leaveDraftDocument = null;
formDataRehabilitation.leaveDocument = []; formDataRehabilitation.leaveDocument = [];
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
} }
}); });
/**Hook */ /**Hook */
onMounted(() => { onMounted(() => {
if (props.data) { if (props.data) {
formDataRehabilitation.leaveWrote = props.data.leaveWrote; formDataRehabilitation.leaveWrote = props.data.leaveWrote;
formDataRehabilitation.leaveStartDate = new Date(props.data.leaveStartDate); formDataRehabilitation.leaveStartDate = new Date(props.data.leaveStartDate);
formDataRehabilitation.leaveEndDate = new Date(props.data.leaveEndDate); formDataRehabilitation.leaveEndDate = new Date(props.data.leaveEndDate);
formDataRehabilitation.leaveDetail = props.data.leaveDetail; formDataRehabilitation.leaveDetail = props.data.leaveDetail;
// formDataRehabilitation.leaveDocument = props.data.leaveDocument; // formDataRehabilitation.leaveDocument = props.data.leaveDocument;
leaveDraftDocument.value = props.data.leaveDraftDocument; leaveDraftDocument.value = props.data.leaveDraftDocument;
leaveDocumentList.value = props.data.leaveDocument; leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status; statusCheck.value = props.data.status;
leaveId.value = props.data.id; leaveId.value = props.data.id;
} }
}); });
</script> </script>
<template> <template>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" /> <q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div> <div class="q-pl-sm text-weight-bold text-dark">กรอกขอม</div>
</div> </div>
<form @submit.prevent="onValidate"> <form @submit.prevent="onValidate">
<q-card bordered class="q-pa-md bg-grey-1"> <q-card bordered class="q-pa-md bg-grey-1">
<div class="row q-pa-sm q-col-gutter-sm"> <div class="row q-pa-sm q-col-gutter-sm">
<q-input <q-input
v-model="formDataRehabilitation.leaveWrote" v-model="formDataRehabilitation.leaveWrote"
class="col-12 col-sm-12 cursor-pointer inputgreen" class="col-12 col-sm-12 cursor-pointer inputgreen"
ref="leaveWroteRef" ref="leaveWroteRef"
dense dense
outlined outlined
bg-color="white" bg-color="white"
label="เขียนที่" label="เขียนที่"
hide-bottom-space hide-bottom-space
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:rules="[(val) => !!val || `${'เขียนที่'}`]" :rules="[(val) => !!val || `${'เขียนที่'}`]"
/> />
<datepicker <datepicker
v-model="formDataRehabilitation.leaveStartDate" v-model="formDataRehabilitation.leaveStartDate"
class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen" class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen"
menu-class-name="modalfix" menu-class-name="modalfix"
autoApply autoApply
borderless borderless
week-start="0" week-start="0"
:enableTimePicker="false" :enableTimePicker="false"
:locale="'th'" :locale="'th'"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
@update:model-value="formDataRehabilitation.leaveEndDate = null" @update:model-value="formDataRehabilitation.leaveEndDate = null"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
ref="leaveStartDateRef" ref="leaveStartDateRef"
class="full-width datepicker" class="full-width datepicker"
bg-color="white" bg-color="white"
outlined outlined
dense dense
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
:model-value=" :model-value="
formDataRehabilitation.leaveStartDate != null formDataRehabilitation.leaveStartDate != null
? date2Thai(formDataRehabilitation.leaveStartDate) ? date2Thai(formDataRehabilitation.leaveStartDate)
: null : null
" "
:label="`${'ลาตั้งแต่วันที่'}`" :label="`${'ลาตั้งแต่วันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]" :rules="[(val) => !!val || `${'กรุณาเลือกลาตั้งแต่วันที่'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--q-primary)" style="color: var(--q-primary)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<datepicker <datepicker
:class="!isLeave ? dateEndInputStyle : ''" :class="!isLeave ? dateEndInputStyle : ''"
v-model="formDataRehabilitation.leaveEndDate" v-model="formDataRehabilitation.leaveEndDate"
class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen" class="col-12 col-md-4 col-sm-6 cursor-pointer inputgreen"
menu-class-name="modalfix" menu-class-name="modalfix"
autoApply autoApply
borderless borderless
week-start="0" week-start="0"
:locale="'th'" :locale="'th'"
@update:model-value="FetchCheck()" @update:model-value="FetchCheck()"
:readonly=" :readonly="
!formDataRehabilitation.leaveStartDate || statusCheck === 'NEW' !formDataRehabilitation.leaveStartDate || statusCheck === 'NEW'
" "
:enableTimePicker="false" :enableTimePicker="false"
:min-date="formDataRehabilitation.leaveStartDate" :min-date="formDataRehabilitation.leaveStartDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
ref="leaveEndDateRef" ref="leaveEndDateRef"
class="full-width datepicker" class="full-width datepicker"
outlined outlined
dense dense
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
:readonly=" :readonly="
!formDataRehabilitation.leaveStartDate || statusCheck === 'NEW' !formDataRehabilitation.leaveStartDate || statusCheck === 'NEW'
" "
:model-value=" :model-value="
formDataRehabilitation.leaveEndDate != null formDataRehabilitation.leaveEndDate != null
? date2Thai(formDataRehabilitation.leaveEndDate) ? date2Thai(formDataRehabilitation.leaveEndDate)
: null : null
" "
:label="`${'ลาถึงวันที่'}`" :label="`${'ลาถึงวันที่'}`"
:bottom-slots="!isLeave ? true : false" :bottom-slots="!isLeave ? true : false"
:color="!isLeave ? 'red' : 'black'" :color="!isLeave ? 'red' : 'black'"
:bg-color="!isLeave ? 'red-2' : 'white'" :bg-color="!isLeave ? 'red-2' : 'white'"
:border-color="!isLeave ? 'red' : 'gray'" :border-color="!isLeave ? 'red' : 'gray'"
:input-class="!isLeave ? dateEndInputStyle : ''" :input-class="!isLeave ? dateEndInputStyle : ''"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
style="color: var(--q-primary)" style="color: var(--q-primary)"
> >
</q-icon> </q-icon>
</template> </template>
<template v-slot:hint> <template v-slot:hint>
<span style="color: red"> <span style="color: red">
{{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }} {{ !isLeave ? "จำนวนวันลาเกินที่กำหนด" : "" }}
</span> </span>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<q-input <q-input
v-model="formDataRehabilitation.leaveDetail" v-model="formDataRehabilitation.leaveDetail"
:readonly="!edit || statusCheck === 'NEW'" :readonly="!edit || statusCheck === 'NEW'"
class="col-12 col-md-12 col-sm-12 cursor-pointer inputgreen" class="col-12 col-md-12 col-sm-12 cursor-pointer inputgreen"
bg-color="white" bg-color="white"
dense dense
outlined outlined
type="textarea" type="textarea"
label="รายละเอียด" label="รายละเอียด"
/> />
<div class="col-12" v-if="statusCheck != 'NEW'"> <div class="col-12" v-if="statusCheck != 'NEW'">
<q-file <q-file
v-model="formDataRehabilitation.leaveDocument" v-model="formDataRehabilitation.leaveDocument"
@added="fileUploadDoc" @added="fileUploadDoc"
multiple multiple
use-chips use-chips
bg-color="white" bg-color="white"
dense dense
outlined outlined
label="เอกสารประกอบ" label="เอกสารประกอบ"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
</q-file> </q-file>
<div class="col-12 q-mt-sm" v-if="data"> <div class="col-12 q-mt-sm" v-if="data">
<div class="col-12 col-md-12 col-sm-12"> <div class="col-12 col-md-12 col-sm-12">
<q-card> <q-card>
<q-list separator> <q-list separator>
<q-item <q-item
v-for="(document, index) in leaveDocumentList" v-for="(document, index) in leaveDocumentList"
:key="index" :key="index"
class="q-my-xs" class="q-my-xs"
> >
<q-item-section> <q-item-section>
<q-item-label class="row items-baseline"> <q-item-label class="row items-baseline">
<div class="col"> <div class="col">
{{ "เอกสารแนบที่ " + (index + 1) }} {{ "เอกสารแนบที่ " + (index + 1) }}
</div> </div>
<div> <div>
<q-btn <q-btn
:href="document.path" :href="document.path"
target="_blank" target="_blank"
outline outline
flat flat
dense dense
color="blue" color="blue"
icon="mdi-download" icon="mdi-download"
size="12px" size="12px"
class="q-mr-md" class="q-mr-md"
> >
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<div> <div>
<q-btn <q-btn
@click="clickDelete(leaveId, document.docId)" @click="clickDelete(leaveId, document.docId)"
target="_blank" target="_blank"
outline outline
color="red" color="red"
flat flat
dense dense
icon="delete" icon="delete"
size="12px" size="12px"
> >
<q-tooltip>ลบไฟล</q-tooltip> <q-tooltip>ลบไฟล</q-tooltip>
</q-btn> </q-btn>
</div> </div>
</q-item-label> </q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-card> </q-card>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</q-card> </q-card>
<div v-if="data && data.id" class="q-mt-md"> <div v-if="data && data.id" class="q-mt-md">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<q-icon name="mdi-numeric-4-circle" size="20px" color="primary" /> <q-icon name="mdi-numeric-4-circle" size="20px" color="primary" />
<div class="q-pl-sm text-weight-bold text-dark"> <div class="q-pl-sm text-weight-bold text-dark">
ดาวนโหลด/ปโหลดแบบฟอร ดาวนโหลด/ปโหลดแบบฟอร
</div> </div>
</div> </div>
<q-card class="bg-grey-1 q-pa-sm" bordered> <q-card class="bg-grey-1 q-pa-sm" bordered>
<div class="row"> <div class="row">
<div class="col-sm-3 q-my-sm"> <div class="col-sm-3 q-my-sm">
<div class="column q-mx-xs"> <div class="column q-mx-xs">
<!-- <div class="q-pl-sm text-weight-bold text-dark text-center"> <!-- <div class="q-pl-sm text-weight-bold text-dark text-center">
ดาวนโหลด ดาวนโหลด
</div> --> </div> -->
<q-btn <q-btn
color="primary" color="primary"
icon="download" icon="download"
label="ดาวน์โหลดแบบฟอร์ม" label="ดาวน์โหลดแบบฟอร์ม"
@click=" @click="
onClickDownloadFile(data.id, `แบบฟอร์ม${data.leaveTypeName}`) onClickDownloadFile(data.id, `แบบฟอร์ม${data.leaveTypeName}`)
" "
/> />
</div> </div>
</div> </div>
<div class="col-sm-5 q-my-sm"> <div class="col-sm-5 q-my-sm">
<div class="column q-mx-xs"> <div class="column q-mx-xs">
<!-- <div class="q-pl-sm text-weight-bold text-dark text-center"> <!-- <div class="q-pl-sm text-weight-bold text-dark text-center">
ปโหลด ปโหลด
</div> --> </div> -->
<q-file <q-file
v-model="formDataRehabilitation.leaveDraftDocument" v-model="formDataRehabilitation.leaveDraftDocument"
use-chips use-chips
dense dense
label="อัปโหลดแบบฟอร์ม" label="อัปโหลดแบบฟอร์ม"
outlined outlined
bg-color="white" bg-color="white"
accept="application/pdf" accept="application/pdf"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
</template> </template>
</q-file> </q-file>
</div> </div>
</div> </div>
<div v-if="leaveDraftDocument" class="col-sm-2 q-my-sm"> <div v-if="leaveDraftDocument" class="col-sm-2 q-my-sm">
<div class="column q-mx-xs"> <div class="column q-mx-xs">
<q-btn <q-btn
icon="visibility" icon="visibility"
color="blue" color="blue"
label="ดาวน์โหลดไฟล์" label="ดาวน์โหลดไฟล์"
:href="leaveDraftDocument" :href="leaveDraftDocument"
target="_blank" target="_blank"
/> />
</div> </div>
</div> </div>
</div> </div>
</q-card> </q-card>
</div> </div>
<div v-if="!isSave"> <div v-if="!isSave">
<q-separator class="q-mt-sm" /> <q-separator class="q-mt-sm" />
<div class="row col-12 q-pt-md"> <div class="row col-12 q-pt-md">
<q-space /> <q-space />
<q-btn <q-btn
v-if="!props.data || props.data.status == 'DRAFT'" v-if="!props.data || props.data.status == 'DRAFT'"
id="onSubmit" id="onSubmit"
type="submit" type="submit"
unelevated unelevated
dense dense
class="q-px-md items-center btnBlue" class="q-px-md items-center btnBlue"
label="บันทึก" label="บันทึก"
><q-tooltip>นทกแบบราง</q-tooltip></q-btn ><q-tooltip>นทกแบบราง</q-tooltip></q-btn
> >
<q-btn <q-btn
v-if="data && statusCheck != 'NEW'" v-if="data && statusCheck != 'NEW'"
id="onSubmit" id="onSubmit"
type="button" type="button"
unelevated unelevated
dense dense
class="q-px-md items-center q-ml-sm" class="q-px-md items-center q-ml-sm"
color="primary" color="primary"
label="ยื่นใบลา" label="ยื่นใบลา"
@click="onConfirm()" @click="onConfirm()"
><q-tooltip>นใบลา</q-tooltip></q-btn ><q-tooltip>นใบลา</q-tooltip></q-btn
> >
</div> </div>
</div> </div>
</form> </form>
</template> </template>

View file

@ -12,162 +12,162 @@ const { date2Thai } = mixin;
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
model: { model: {
type: String, type: String,
default: "", default: "",
}, },
}); });
/** ข้อมูล v-model ของฟอร์ม */ /** ข้อมูล v-model ของฟอร์ม */
const formData = reactive<FormData>({ const formData = reactive<FormData>({
dateStart: new Date(), dateStart: new Date(),
subject: "เรื่อง", subject: "เรื่อง",
who: "เรียนผู้ใด", who: "เรียนผู้ใด",
requestName: "ชื่อผู้ยื่น", requestName: "ชื่อผู้ยื่น",
position: "ตำแหน่ง", position: "ตำแหน่ง",
level: "ระดับ", level: "ระดับ",
ocRequest: "สังกัด", ocRequest: "สังกัด",
leaveabsentDaySummon: "2", leaveabsentDaySummon: "2",
leaveUse: "1", leaveUse: "1",
leaveRemaining: "1", leaveRemaining: "1",
}); });
/**Hook */ /**Hook */
onMounted(() => { onMounted(() => {
dataStore.typeLeave = ""; dataStore.typeLeave = "";
}); });
</script> </script>
<template> <template>
<q-card bordered class="q-pa-md bg-grey-1"> <q-card bordered class="q-pa-md bg-grey-1">
<div class="col-12 row q-pa-sm q-col-gutter-sm"> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<datepicker <datepicker
class="col-12 col-sm-4" class="col-12 col-sm-4"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="dataStore.dateSendLeave" v-model="dataStore.dateSendLeave"
:locale="'th'" :locale="'th'"
autoApply autoApply
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
readonly readonly
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
outlined outlined
dense dense
bg-color="white" bg-color="white"
hide-bottom-space hide-bottom-space
readonly readonly
class="full-width" class="full-width"
:model-value=" :model-value="
dataStore.dateSendLeave != null dataStore.dateSendLeave != null
? date2Thai(dataStore.dateSendLeave) ? date2Thai(dataStore.dateSendLeave)
: null : null
" "
:label="`${'วันที่ยื่นใบลา'}`" :label="`${'วันที่ยื่นใบลา'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ยื่นใบลา'}`]" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่ยื่นใบลา'}`]"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer inputblack" class="cursor-pointer inputblack"
style="color: var(--black)" style="color: var(--black)"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
<q-input <q-input
class="col-12 col-sm-4" class="col-12 col-sm-4"
dense dense
bg-color="white" bg-color="white"
outlined outlined
readonly readonly
v-model="dataStore.typeLeave" v-model="dataStore.typeLeave"
label="เรื่อง" label="เรื่อง"
/> />
<q-input <q-input
class="col-12 col-sm-4" class="col-12 col-sm-4"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.dear" v-model="dataStore.dear"
label="เรียน" label="เรียน"
/> />
<q-input <q-input
class="col-12 col-sm-3" class="col-12 col-sm-3"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.fullName" v-model="dataStore.fullName"
label="ชื่อผู้ยื่นขอ" label="ชื่อผู้ยื่นขอ"
/> />
<q-input <q-input
class="col-12 col-sm-3" class="col-12 col-sm-3"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.positionName" v-model="dataStore.positionName"
label="ตำแหน่งผู้ยื่นขอ" label="ตำแหน่งผู้ยื่นขอ"
/> />
<q-input <q-input
class="col-12 col-sm-3" class="col-12 col-sm-3"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.positionLevelName" v-model="dataStore.positionLevelName"
label="ระดับผู้ยื่นขอ" label="ระดับผู้ยื่นขอ"
/> />
<q-input <q-input
class="col-12 col-sm-3" class="col-12 col-sm-3"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.organizationName" v-model="dataStore.organizationName"
label="สังกัดผู้ยื่นขอ" label="สังกัดผู้ยื่นขอ"
/> />
<q-input <q-input
v-if="props.model === 'LV-005'" v-if="props.model === 'LV-005'"
class="col-12 col-sm-4" class="col-12 col-sm-4"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.leaveLimit" v-model="dataStore.leaveLimit"
label="จำนวนสิทธิ์การลาที่ได้รับ" label="จำนวนสิทธิ์การลาที่ได้รับ"
/> />
<q-input <q-input
class="col-12 col-sm-4" class="col-12 col-sm-4"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.leaveTotal" v-model="dataStore.leaveTotal"
label="จำนวนสิทธิ์การลาที่ใช้ไป" label="จำนวนสิทธิ์การลาที่ใช้ไป"
/> />
<q-input <q-input
v-if="props.model === 'LV-005'" v-if="props.model === 'LV-005'"
class="col-12 col-sm-4" class="col-12 col-sm-4"
dense dense
outlined outlined
readonly readonly
bg-color="white" bg-color="white"
v-model="dataStore.leaveRemain" v-model="dataStore.leaveRemain"
label="จำนวนสิทธิ์การลาคงเหลือ" label="จำนวนสิทธิ์การลาคงเหลือ"
/> />
</div> </div>
</q-card> </q-card>
</template> </template>

View file

@ -1,48 +1,54 @@
interface OptionData { interface OptionData {
id: string | undefined id: string | undefined;
name: string | undefined name: string | undefined;
code: string | undefined code: string | undefined;
} }
interface FormLeavetMainData { interface FormLeavetMainData {
type: string type: string;
numDate: string numDate: string;
extend: string extend: string;
use: string use: string;
numAll: string numAll: string;
numDone: string numDone: string;
numNot: string numNot: string;
numCancel: string numCancel: string;
} }
interface formListLeaveData { interface formListLeaveData {
no: string no: string;
date: string | null date: string | null;
type: string type: string;
status: string status: string;
year: string year: string;
} }
interface TypeLeave { interface TypeLeave {
code: string code: string;
createdAt: Date createdAt: Date;
createdFullName: string createdFullName: string;
createdUserId: string createdUserId: string;
id: string id: string;
lastUpdateFullName: string lastUpdateFullName: string;
lastUpdateUserId: string lastUpdateUserId: string;
lastUpdatedAt: Date | null lastUpdatedAt: Date | null;
limit: number limit: number;
name: string name: string;
} }
interface LeaveItem { interface LeaveItem {
text: string text: string;
color: string color: string;
value: number value: number;
all: number all: number;
use: number use: number;
remain: number remain: number;
} }
export type { OptionData, FormLeavetMainData, formListLeaveData, TypeLeave, LeaveItem } export type {
OptionData,
FormLeavetMainData,
formListLeaveData,
TypeLeave,
LeaveItem,
};

View file

@ -1,83 +1,91 @@
interface FormData { interface FormData {
dateStart: Date dateStart: Date;
subject: string subject: string;
who: string who: string;
requestName: string requestName: string;
position: string position: string;
level: string level: string;
ocRequest: string ocRequest: string;
leaveabsentDaySummon: string leaveabsentDaySummon: string;
leaveUse: string leaveUse: string;
leaveRemaining: string leaveRemaining: string;
} }
interface OrdinationForm { interface OrdinationForm {
leaveWrote: object | null leaveWrote: object | null;
leavegovernmentDate: object | null leavegovernmentDate: object | null;
leavebirthDate: object | null leavebirthDate: object | null;
leaveStartDate: object | null leaveStartDate: object | null;
leaveEndDate: object | null leaveEndDate: object | null;
totalLeave: object | null totalLeave: object | null;
ordainDayOrdination: object | null ordainDayOrdination: object | null;
ordainDayLocationName: object | null ordainDayLocationName: object | null;
ordainDayLocationNumber: object | null ordainDayLocationNumber: object | null;
ordainDayLocationAddress: object | null ordainDayLocationAddress: object | null;
ordainDayBuddhistLentName: object | null ordainDayBuddhistLentName: object | null;
ordainDayBuddhistLentAddress: object | null ordainDayBuddhistLentAddress: object | null;
[key: string]: any [key: string]: any;
} }
interface HajiForm { interface HajiForm {
leaveWrote: object | null leaveWrote: object | null;
leavegovernmentDate: object | null leavegovernmentDate: object | null;
leaveStartDate: object | null leaveStartDate: object | null;
leaveEndDate: object | null leaveEndDate: object | null;
[key: string]: any [key: string]: any;
} }
interface MilitaryForm { interface MilitaryForm {
leaveStartDate: object | null leaveStartDate: object | null;
leaveEndDate: object | null leaveEndDate: object | null;
leaveWrote: object | null leaveWrote: object | null;
absentDaySummon: object | null absentDaySummon: object | null;
absentDayLocation: object | null absentDayLocation: object | null;
absentDayRegistorDate: object | null absentDayRegistorDate: object | null;
absentDayGetIn: object | null absentDayGetIn: object | null;
absentDayAt: object | null absentDayAt: object | null;
leaveDetail: object | null leaveDetail: object | null;
[key: string]: any [key: string]: any;
} }
interface studyDaySubjectForm { interface studyDaySubjectForm {
leaveStartDate: object | null leaveStartDate: object | null;
leaveEndDate: object | null leaveEndDate: object | null;
leavebirthDate: object | null leavebirthDate: object | null;
leavegovernmentDate: object | null leavegovernmentDate: object | null;
leaveSalary: object | null leaveSalary: object | null;
leaveNumber: object | null leaveNumber: object | null;
leaveAddress: object | null leaveAddress: object | null;
studyDayScholarship: object | null studyDayScholarship: object | null;
studyDayCountry: object | null studyDayCountry: object | null;
studyDayUniversityName: object | null studyDayUniversityName: object | null;
studyDayDegreeLevel: object | null studyDayDegreeLevel: object | null;
studyDaySubject: object | null studyDaySubject: object | null;
leaveWrote: object | null leaveWrote: object | null;
[key: string]: any [key: string]: any;
} }
interface TrainForm { interface TrainForm {
leaveStartDate: object | null leaveStartDate: object | null;
leaveEndDate: object | null leaveEndDate: object | null;
leavebirthDate: object | null leavebirthDate: object | null;
leavegovernmentDate: object | null leavegovernmentDate: object | null;
leaveNumber: object | null leaveNumber: object | null;
leaveAddress: object | null leaveAddress: object | null;
studyDayScholarship: object | null studyDayScholarship: object | null;
studyDayCountry: object | null studyDayCountry: object | null;
studyDayTrainingSubject: object | null studyDayTrainingSubject: object | null;
studyDayTrainingName: object | null studyDayTrainingName: object | null;
leaveWrote: object | null leaveWrote: object | null;
[key: string]: any [key: string]: any;
} }
interface RehabilitationForm { interface RehabilitationForm {
leaveStartDate: object | null leaveStartDate: object | null;
leaveEndDate: object | null leaveEndDate: object | null;
leaveWrote: object | null leaveWrote: object | null;
[key: string]: any [key: string]: any;
} }
export type { FormData, OrdinationForm, HajiForm, MilitaryForm, studyDaySubjectForm, TrainForm, RehabilitationForm } export type {
FormData,
OrdinationForm,
HajiForm,
MilitaryForm,
studyDaySubjectForm,
TrainForm,
RehabilitationForm,
};

View file

@ -1,25 +1,25 @@
interface FormData { interface FormData {
leaveWrote: string //เขียนที่*** leaveWrote: string; //เขียนที่***
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: string //จำนวนวันลา leaveTotal: string; //จำนวนวันลา
leaveNumber: string //หมายเลขที่ติดต่อขณะลา leaveNumber: string; //หมายเลขที่ติดต่อขณะลา
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveAddress: string //สถานที่ติดต่อขณะลา leaveAddress: string; //สถานที่ติดต่อขณะลา
leaveDocument: File[] | null //เอกสารปะกอบ leaveDocument: File[] | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
interface FormRef { interface FormRef {
leaveWrote: object | null //เขียนที่*** leaveWrote: object | null; //เขียนที่***
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: object | null //จำนวนวันลา leaveTotal: object | null; //จำนวนวันลา
leaveNumber: object | null //หมายเลขที่ติดต่อขณะลา leaveNumber: object | null; //หมายเลขที่ติดต่อขณะลา
leaveDetail: object | null //รายละเอียดการลา leaveDetail: object | null; //รายละเอียดการลา
leaveAddress: object | null //สถานที่ติดต่อขณะลา leaveAddress: object | null; //สถานที่ติดต่อขณะลา
leaveDocument: object | null //เอกสารปะกอบ leaveDocument: object | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
export type { FormData, FormRef } export type { FormData, FormRef };

View file

@ -1,40 +1,40 @@
interface FormData { interface FormData {
leaveWrote: string //เขียนที่*** leaveWrote: string; //เขียนที่***
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: string //จำนวนวันลา leaveTotal: string; //จำนวนวันลา
leaveSalary: number //เงินเดือนปัจจุบัน leaveSalary: number; //เงินเดือนปัจจุบัน
salaryText: number //เงินเดือนคำอ่าน salaryText: number; //เงินเดือนคำอ่าน
coupleDayName: string //ชื่อคู่สมรส coupleDayName: string; //ชื่อคู่สมรส
coupleDayPosition: string //ตำแหน่งคู่สมรส coupleDayPosition: string; //ตำแหน่งคู่สมรส
coupleDayLevel: string //ระดับคู่สมรส coupleDayLevel: string; //ระดับคู่สมรส
coupleDayLevelCountry: string //ไปปฏิบัติราชการ ณ ประเทศ coupleDayLevelCountry: string; //ไปปฏิบัติราชการ ณ ประเทศ
followHistoryCountry: string //ประวัติการลาติดตามคู่สมรสประเทศ followHistoryCountry: string; //ประวัติการลาติดตามคู่สมรสประเทศ
followHistoryTime: string //ประวัติการลาติดตามคู่สมรสประเทศ followHistoryTime: string; //ประวัติการลาติดตามคู่สมรสประเทศ
followHistoryStart: Date | null //ประวัติการลาติดตามคู่สมรสประเทศ followHistoryStart: Date | null; //ประวัติการลาติดตามคู่สมรสประเทศ
followHistoryEnd: Date | null //ประวัติการลาติดตามคู่สมรสประเทศ followHistoryEnd: Date | null; //ประวัติการลาติดตามคู่สมรสประเทศ
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveDocument: File[] | null //เอกสารปะกอบ leaveDocument: File[] | null; //เอกสารปะกอบ
} }
interface FormRef { interface FormRef {
leaveWrote: object | null //เขียนที่*** leaveWrote: object | null; //เขียนที่***
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: object | null //จำนวนวันลา leaveTotal: object | null; //จำนวนวันลา
leaveSalary: object | null //เงินเดือนปัจจุบัน leaveSalary: object | null; //เงินเดือนปัจจุบัน
coupleDayName: object | null //หมายเลขที่ติดต่อขณะลา coupleDayName: object | null; //หมายเลขที่ติดต่อขณะลา
coupleDayPosition: object | null //ตำแหน่งคู่สมรส coupleDayPosition: object | null; //ตำแหน่งคู่สมรส
coupleDayLevel: object | null //ระดับคู่สมรส coupleDayLevel: object | null; //ระดับคู่สมรส
coupleDayLevelCountry: object | null //ไปปฏิบัติราชการ ณ ประเทศ coupleDayLevelCountry: object | null; //ไปปฏิบัติราชการ ณ ประเทศ
// followHistoryCountry: object | null //ประวัติการลาติดตามคู่สมรสประเทศ // followHistoryCountry: object | null //ประวัติการลาติดตามคู่สมรสประเทศ
// followHistoryTime: object | null //ประวัติการลาติดตามคู่สมรสประเทศ // followHistoryTime: object | null //ประวัติการลาติดตามคู่สมรสประเทศ
// followHistoryStart: object | null //ประวัติการลาติดตามคู่สมรสประเทศ // followHistoryStart: object | null //ประวัติการลาติดตามคู่สมรสประเทศ
// followHistoryEnd: object | null //ประวัติการลาติดตามคู่สมรสประเทศ // followHistoryEnd: object | null //ประวัติการลาติดตามคู่สมรสประเทศ
leaveDetail: object | null //รายละเอียดการลา leaveDetail: object | null; //รายละเอียดการลา
leaveAddress: object | null //สถานที่ติดต่อขณะลา leaveAddress: object | null; //สถานที่ติดต่อขณะลา
leaveDocument: object | null //เอกสารปะกอบ leaveDocument: object | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
export type { FormData, FormRef } export type { FormData, FormRef };

View file

@ -1,29 +1,29 @@
interface FormData { interface FormData {
leaveWrote: string //เขียนที่*** leaveWrote: string; //เขียนที่***
wifeDayName: string //ชื่อภรรยา wifeDayName: string; //ชื่อภรรยา
wifeDayDateBorn: Date | null //วันที่คลอด wifeDayDateBorn: Date | null; //วันที่คลอด
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: string //จำนวนวันลา leaveTotal: string; //จำนวนวันลา
leaveNumber: string //หมายเลขที่ติดต่อขณะลา leaveNumber: string; //หมายเลขที่ติดต่อขณะลา
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveAddress: string //สถานที่ติดต่อขณะลา leaveAddress: string; //สถานที่ติดต่อขณะลา
leaveDocument: File[] | null //เอกสารปะกอบ leaveDocument: File[] | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
interface FormRef { interface FormRef {
leaveWrote: object | null //เขียนที่*** leaveWrote: object | null; //เขียนที่***
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
wifeDayName: object | null //ชื่อภรรยา wifeDayName: object | null; //ชื่อภรรยา
wifeDayDateBorn: object | null //วันที่คลอด wifeDayDateBorn: object | null; //วันที่คลอด
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: object | null //จำนวนวันลา leaveTotal: object | null; //จำนวนวันลา
leaveNumber: object | null //หมายเลขที่ติดต่อขณะลา leaveNumber: object | null; //หมายเลขที่ติดต่อขณะลา
leaveDetail: object | null //รายละเอียดการลา leaveDetail: object | null; //รายละเอียดการลา
leaveAddress: object | null //สถานที่ติดต่อขณะลา leaveAddress: object | null; //สถานที่ติดต่อขณะลา
leaveDocument: object | null //เอกสารปะกอบ leaveDocument: object | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
export type { FormData, FormRef } export type { FormData, FormRef };

View file

@ -1,28 +1,28 @@
interface FormData { interface FormData {
leaveWrote: string //เขียนที่*** leaveWrote: string; //เขียนที่***
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveRange: string leaveRange: string;
leaveTotal: string //จำนวนวันลา leaveTotal: string; //จำนวนวันลา
contractTel: string //หมายเลขโทรศัพท์ที่ติดต่อได้ contractTel: string; //หมายเลขโทรศัพท์ที่ติดต่อได้
leaveNumber: string //หมายเลขที่ติดต่อขณะลา leaveNumber: string; //หมายเลขที่ติดต่อขณะลา
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveAddress: string //สถานที่ติดต่อขณะลา leaveAddress: string; //สถานที่ติดต่อขณะลา
leaveDocument: File[] | null //เอกสารปะกอบ leaveDocument: File[] | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
interface FormRef { interface FormRef {
leaveWrote: object | null //เขียนที่*** leaveWrote: object | null; //เขียนที่***
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveRange: object | null leaveRange: object | null;
leaveTotal: object | null //จำนวนวันลา leaveTotal: object | null; //จำนวนวันลา
leaveNumber: object | null //หมายเลขที่ติดต่อขณะลา leaveNumber: object | null; //หมายเลขที่ติดต่อขณะลา
leaveDetail: object | null //รายละเอียดการลา leaveDetail: object | null; //รายละเอียดการลา
leaveAddress: object | null //สถานที่ติดต่อขณะลา leaveAddress: object | null; //สถานที่ติดต่อขณะลา
[key: string]: any [key: string]: any;
} }
export type { FormData, FormRef } export type { FormData, FormRef };

View file

@ -1,31 +1,31 @@
interface FormData { interface FormData {
leaveWrote: string //เขียนที่*** leaveWrote: string; //เขียนที่***
leaveRange: string leaveRange: string;
restDayOldTotal: string //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา restDayOldTotal: string; //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา
restDayCurrentTotal: string //จำนวนวันลาพักผ่อนประจำปีปัจจุบัน restDayCurrentTotal: string; //จำนวนวันลาพักผ่อนประจำปีปัจจุบัน
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: string //จำนวนวันลา leaveTotal: string; //จำนวนวันลา
leaveNumber: string //หมายเลขที่ติดต่อขณะลา leaveNumber: string; //หมายเลขที่ติดต่อขณะลา
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveAddress: string //สถานที่ติดต่อขณะลา leaveAddress: string; //สถานที่ติดต่อขณะลา
leaveDocument: File[] | null //เอกสารปะกอบ leaveDocument: File[] | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
interface FormRef { interface FormRef {
leaveWrote: object | null //เขียนที่*** leaveWrote: object | null; //เขียนที่***
leaveRange: object | null leaveRange: object | null;
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
restDayOldTotal: object | null //ชื่อภรรยา restDayOldTotal: object | null; //ชื่อภรรยา
restDayCurrentTotal: object | null //วันที่คลอด restDayCurrentTotal: object | null; //วันที่คลอด
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: object | null //จำนวนวันลา leaveTotal: object | null; //จำนวนวันลา
leaveNumber: object | null //หมายเลขที่ติดต่อขณะลา leaveNumber: object | null; //หมายเลขที่ติดต่อขณะลา
leaveDetail: object | null //รายละเอียดการลา leaveDetail: object | null; //รายละเอียดการลา
leaveAddress: object | null //สถานที่ติดต่อขณะลา leaveAddress: object | null; //สถานที่ติดต่อขณะลา
leaveDocument: object | null //เอกสารปะกอบ leaveDocument: object | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
export type { FormData, FormRef } export type { FormData, FormRef };

View file

@ -1,20 +1,20 @@
interface FormData { interface FormData {
type: string type: string;
leaveWrote: string //เขียนที่*** leaveWrote: string; //เขียนที่***
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveDocument: File[] | null //เอกสารปะกอบ leaveDocument: File[] | null; //เอกสารปะกอบ
leaveDraftDocument: File[] leaveDraftDocument: File[];
} }
interface FormRef { interface FormRef {
leaveWrote: object | null //เขียนที่*** leaveWrote: object | null; //เขียนที่***
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveDetail: object | null //รายละเอียดการลา leaveDetail: object | null; //รายละเอียดการลา
leaveDocument: object | null //เอกสารปะกอบ leaveDocument: object | null; //เอกสารปะกอบ
[key: string]: any [key: string]: any;
} }
export type { FormData, FormRef } export type { FormData, FormRef };

View file

@ -1,146 +1,156 @@
interface ListLeave { interface ListLeave {
id: string //*Id การยื่นขอลา id: string; //*Id การยื่นขอลา
leaveTypeName: string //Name ประเภทการลา leaveTypeName: string; //Name ประเภทการลา
leaveTypeId: string //Id ประเภทการลา leaveTypeId: string; //Id ประเภทการลา
leaveStartDate: Date leaveStartDate: Date;
leaveEndDate: Date leaveEndDate: Date;
fullName: string //คำนำหน้า ชื่อ นามสกุล คนขอลา fullName: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
dateSendLeave: Date | null //วันที่ยื่นใบลา dateSendLeave: Date | null; //วันที่ยื่นใบลา
status: string //สถานะการของลา status: string; //สถานะการของลา
isDelete: boolean //ขอยกเลิกคำขอลา ถ้าเคยขอแล้วจะเป็น true ไม่เคยเป็น false isDelete: boolean; //ขอยกเลิกคำขอลา ถ้าเคยขอแล้วจะเป็น true ไม่เคยเป็น false
hajjDayStatus: boolean hajjDayStatus: boolean;
} }
interface ListLeaveTable { interface ListLeaveTable {
id: string id: string;
leaveTypeName: string leaveTypeName: string;
leaveTypeId: string leaveTypeId: string;
fullName: string fullName: string;
dateSendLeave: string | null dateSendLeave: string | null;
status: string status: string;
isDelete: boolean isDelete: boolean;
hajjDayStatus: boolean hajjDayStatus: boolean;
} }
interface FremDetail { interface FremDetail {
id: string //Id การยื่นขอลา id: string; //Id การยื่นขอลา
leaveTypeName: string // Name ประเภทการลา leaveTypeName: string; // Name ประเภทการลา
leaveTypeId: string //Id ประเภทการลา leaveTypeId: string; //Id ประเภทการลา
fullname: string //คำนำหน้า ชื่อ นามสกุล คนขอลา fullname: string; //คำนำหน้า ชื่อ นามสกุล คนขอลา
dateSendLeave: Date // วันที่ยืนใบลา dateSendLeave: Date; // วันที่ยืนใบลา
status: string //สถานะการของลา status: string; //สถานะการของลา
leaveDateStart: Date //วันเริ่มการลา leaveDateStart: Date; //วันเริ่มการลา
leaveDateEnd: Date //วันสิ้นสุดการลา leaveDateEnd: Date; //วันสิ้นสุดการลา
leaveCount: string //จำนวนวันลา leaveCount: string; //จำนวนวันลา
leaveWrote: string //เขียนที่ leaveWrote: string; //เขียนที่
leaveAddress: string //สถานที่ติดต่อขณะลา leaveAddress: string; //สถานที่ติดต่อขณะลา
leaveNumber: string //หมายเลขที่ติดต่อขณะลา leaveNumber: string; //หมายเลขที่ติดต่อขณะลา
leaveDetail: string //รายละเอียดการลา leaveDetail: string; //รายละเอียดการลา
leaveDocument: string //อัปโหลดเอกสารประกอบรายละเอียด leaveDocument: string; //อัปโหลดเอกสารประกอบรายละเอียด
leaveDraftDocument: string //อัปโหลดแบบฟอร์มการลา leaveDraftDocument: string; //อัปโหลดแบบฟอร์มการลา
leaveLastStart: Date //ลาครั้งสุดท้ายในประเภทนั้น ๆ เริ่มเมื่อวันที่(ลาป่วย ลาคลอดบุตร และลากิจส่วนตัว)(Auto) leaveLastStart: Date; //ลาครั้งสุดท้ายในประเภทนั้น ๆ เริ่มเมื่อวันที่(ลาป่วย ลาคลอดบุตร และลากิจส่วนตัว)(Auto)
leaveLastEnd: Date //ลาครั้งสุดท้ายในประเภทนั้น ๆ สิ้นสุดเมื่อวันที่(ลาป่วย ลาคลอดบุตร และลากิจส่วนตัว)(Auto) leaveLastEnd: Date; //ลาครั้งสุดท้ายในประเภทนั้น ๆ สิ้นสุดเมื่อวันที่(ลาป่วย ลาคลอดบุตร และลากิจส่วนตัว)(Auto)
leaveTotal: string //จำนวนวันที่ลา(Auto) leaveTotal: string; //จำนวนวันที่ลา(Auto)
leavebirthDate: Date //วันเดือนปีเกิด(Auto) leavebirthDate: Date; //วันเดือนปีเกิด(Auto)
leavegovernmentDate: Date //วันที่เข้ารับราชการ(Auto) leavegovernmentDate: Date; //วันที่เข้ารับราชการ(Auto)
leaveSalary: number //เงินเดือนปัจจุบัน(Auto) leaveSalary: number; //เงินเดือนปัจจุบัน(Auto)
leaveSalaryText: string //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน) leaveSalaryText: string; //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน)
leaveTypeDay: string //ประเภทการลาในวันนั้นเช่น leaveTypeDay: string; //ประเภทการลาในวันนั้นเช่น
wifeDayName: string //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร) wifeDayName: string; //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร)
wifeDayDateBorn: Date //วันที่คลอด(ลาไปช่วยเหลือภริยาที่คลอดบุตร) wifeDayDateBorn: Date; //วันที่คลอด(ลาไปช่วยเหลือภริยาที่คลอดบุตร)
restDayOldTotal: number //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา(ลาพักผ่อน)(Auto) restDayOldTotal: number; //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา(ลาพักผ่อน)(Auto)
restDayCurrentTotal: number //จำนวนวันลาพักผ่อนประจำปีปัจจุบัน(ลาพักผ่อน)(Auto) restDayCurrentTotal: number; //จำนวนวันลาพักผ่อนประจำปีปัจจุบัน(ลาพักผ่อน)(Auto)
ordainDayStatus: string //เคย/ไม่เคยบวช (ให้เลือก) (ลาอุปสมบท) ordainDayStatus: string; //เคย/ไม่เคยบวช (ให้เลือก) (ลาอุปสมบท)
ordainDayLocationName: string //สถานที่บวช ชื่อวัด(ลาอุปสมบท) ordainDayLocationName: string; //สถานที่บวช ชื่อวัด(ลาอุปสมบท)
ordainDayLocationAddress: string //สถานที่บวช ที่อยู่(ลาอุปสมบท) ordainDayLocationAddress: string; //สถานที่บวช ที่อยู่(ลาอุปสมบท)
ordainDayLocationNumber: string //สถานที่บวช หมายเลขโทรศัพท์(ลาอุปสมบท) ordainDayLocationNumber: string; //สถานที่บวช หมายเลขโทรศัพท์(ลาอุปสมบท)
ordainDayOrdination: Date //สถานที่บวช วันอุปสมบท(ลาอุปสมบท) ordainDayOrdination: Date; //สถานที่บวช วันอุปสมบท(ลาอุปสมบท)
ordainDayBuddhistLentName: string //สถานที่จำพรรษา ชื่อวัด(ลาอุปสมบท) ordainDayBuddhistLentName: string; //สถานที่จำพรรษา ชื่อวัด(ลาอุปสมบท)
ordainDayBuddhistLentAddress: string //สถานที่จำพรรษา ที่อยู่(ลาอุปสมบท) ordainDayBuddhistLentAddress: string; //สถานที่จำพรรษา ที่อยู่(ลาอุปสมบท)
hajjDayStatus: string //เคย/ไม่เคยไปประกอบพิธีฮัจญ์ (ให้เลือก) (ลาประกอบพิธีฮัจญ์) hajjDayStatus: string; //เคย/ไม่เคยไปประกอบพิธีฮัจญ์ (ให้เลือก) (ลาประกอบพิธีฮัจญ์)
absentDaySummon: string //ได้รับหมายเรียกของ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล) absentDaySummon: string; //ได้รับหมายเรียกของ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
absentDayLocation: string //ที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล) absentDayLocation: string; //ที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
absentDayRegistorDate: Date //ลงวันที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล) absentDayRegistorDate: Date; //ลงวันที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
absentDayGetIn: string //ให้เข้ารับการ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล) absentDayGetIn: string; //ให้เข้ารับการ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
absentDayAt: string //ณ ที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล) absentDayAt: string; //ณ ที่ (ลาเข้ารับการตรวจเลือกหรือเข้ารับการเตรียมพล)
studyDaySubject: string //กรณีลาไปศึกษาต่อ ศึกษาวิชา (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDaySubject: string; //กรณีลาไปศึกษาต่อ ศึกษาวิชา (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
studyDayDegreeLevel: string //กรณีลาไปศึกษาต่อ ขั้นปริญญา (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDayDegreeLevel: string; //กรณีลาไปศึกษาต่อ ขั้นปริญญา (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
studyDayUniversityName: string //กรณีลาไปศึกษาต่อ ชื่อสถานศึกษา (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDayUniversityName: string; //กรณีลาไปศึกษาต่อ ชื่อสถานศึกษา (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
studyDayTrainingSubject: string //กรณีลาไปฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน ด้าน/หลักสูตร (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDayTrainingSubject: string; //กรณีลาไปฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน ด้าน/หลักสูตร (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
studyDayTrainingName: string //กรณีลาไปฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน ณ สถานที่ (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDayTrainingName: string; //กรณีลาไปฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน ณ สถานที่ (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
studyDayCountry: string //ประเทศ (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDayCountry: string; //ประเทศ (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
studyDayScholarship: string //ด้วยทุน (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน) studyDayScholarship: string; //ด้วยทุน (ลาไปศึกษา ฝึกอบรม ปฏิบัติการวิจัย หรือดูงาน)
coupleDayName: string //ชื่อคู่สมรส (ลาติดตามคู่สมรส) coupleDayName: string; //ชื่อคู่สมรส (ลาติดตามคู่สมรส)
coupleDayPosition: string //ตำแหน่งคู่สมรส (ลาติดตามคู่สมรส) coupleDayPosition: string; //ตำแหน่งคู่สมรส (ลาติดตามคู่สมรส)
coupleDayLevel: string //ระดับคู่สมรส (ลาติดตามคู่สมรส) coupleDayLevel: string; //ระดับคู่สมรส (ลาติดตามคู่สมรส)
coupleDayLevelCountry: string //ไปปฏิบัติราชการ ณ ประเทศ (ลาติดตามคู่สมรส) coupleDayLevelCountry: string; //ไปปฏิบัติราชการ ณ ประเทศ (ลาติดตามคู่สมรส)
coupleDayCountryHistory: string //ประวัติ ประเทศ (ลาติดตามคู่สมรส) coupleDayCountryHistory: string; //ประวัติ ประเทศ (ลาติดตามคู่สมรส)
coupleDayTotalHistory: string //ประวัติ เป็นเวลา กี่ปี กี่เดือน กี่วัน (ลาติดตามคู่สมรส) coupleDayTotalHistory: string; //ประวัติ เป็นเวลา กี่ปี กี่เดือน กี่วัน (ลาติดตามคู่สมรส)
coupleDayStartDateHistory: Date //ประวัติ ตั้งแต่วันที่ (ลาติดตามคู่สมรส) coupleDayStartDateHistory: Date; //ประวัติ ตั้งแต่วันที่ (ลาติดตามคู่สมรส)
coupleDayEndDateHistory: Date //ประวัติ ถึงวันที่ (ลาติดตามคู่สมรส) coupleDayEndDateHistory: Date; //ประวัติ ถึงวันที่ (ลาติดตามคู่สมรส)
coupleDaySumTotalHistory: string //ประวัติ ในกรณีลาติดต่อกับครั้งก่อน รวมทั้งนี้ด้วย เป็นเวลา กี่ปี กี่เดือน กี่วัน (ลาติดตามคู่สมรส) coupleDaySumTotalHistory: string; //ประวัติ ในกรณีลาติดต่อกับครั้งก่อน รวมทั้งนี้ด้วย เป็นเวลา กี่ปี กี่เดือน กี่วัน (ลาติดตามคู่สมรส)
approveStep: string approveStep: string;
dear: string dear: string;
leaveRange: string leaveRange: string;
} }
interface FromCancelDetail { interface FromCancelDetail {
id: string //*Id การยื่นขอลา id: string; //*Id การยื่นขอลา
leaveTypeName: String //Name ประเภทการลา leaveTypeName: String; //Name ประเภทการลา
fullname: String //คำนำหน้า ชื่อ นามสกุล คนขอลา fullname: String; //คำนำหน้า ชื่อ นามสกุล คนขอลา
status: String //สถานะการของลา status: String; //สถานะการของลา
leaveDocDelete: string //เอกสารการยกเลิกการลา leaveDocDelete: string; //เอกสารการยกเลิกการลา
leaveResonDelete: String //เหตุผลการยกเลิกการลา leaveResonDelete: String; //เหตุผลการยกเลิกการลา
leaveWrote: String //เขียนที่ leaveWrote: String; //เขียนที่
leaveAddress: String //สถานที่ติดต่อขณะลา leaveAddress: String; //สถานที่ติดต่อขณะลา
leaveNumber: String //หมายเลขที่ติดต่อขณะลา leaveNumber: String; //หมายเลขที่ติดต่อขณะลา
leaveDetail: String //รายละเอียดการลา leaveDetail: String; //รายละเอียดการลา
leaveTotal: number //จำนวนวันที่ลา leaveTotal: number; //จำนวนวันที่ลา
leaveStartDate: Date //วัน เดือน ปีเริ่มต้นลา leaveStartDate: Date; //วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date //วัน เดือน ปีสิ้นสุดลา leaveEndDate: Date; //วัน เดือน ปีสิ้นสุดลา
} }
interface FormDelete { interface FormDelete {
writeAt: string writeAt: string;
reason: string reason: string;
doc: any doc: any;
} }
interface FormDeleteRef { interface FormDeleteRef {
writeAt: object | null writeAt: object | null;
reason: object | null reason: object | null;
doc: object | null doc: object | null;
[key: string]: any [key: string]: any;
} }
interface DataCalendar { interface DataCalendar {
dateSendLeave: Date dateSendLeave: Date;
fullName: string fullName: string;
id: string id: string;
leaveEndDate: Date leaveEndDate: Date;
leaveStartDate: Date leaveStartDate: Date;
leaveTypeId: string leaveTypeId: string;
leaveTypeName: string leaveTypeName: string;
status: string status: string;
keycloakId: string keycloakId: string;
} }
interface LeaveType { interface LeaveType {
code: string code: string;
createdAt: Date createdAt: Date;
createdFullName: string createdFullName: string;
createdUserId: string createdUserId: string;
id: string id: string;
lastUpdateFullName: string lastUpdateFullName: string;
lastUpdateUserId: string lastUpdateUserId: string;
lastUpdatedAt: Date | null lastUpdatedAt: Date | null;
limit: Number limit: Number;
name: string name: string;
} }
interface FilterList { interface FilterList {
id: string id: string;
name: string | null name: string | null;
color: string color: string;
} }
export type { ListLeave, ListLeaveTable, FremDetail, FormDelete, FormDeleteRef, DataCalendar, LeaveType, FilterList, FromCancelDetail } export type {
ListLeave,
ListLeaveTable,
FremDetail,
FormDelete,
FormDeleteRef,
DataCalendar,
LeaveType,
FilterList,
FromCancelDetail,
};

View file

@ -1,40 +1,40 @@
/** /**
* Router leave * Router leave
*/ */
const leave = () => import("@/modules/05_leave/views/Main.vue") const leave = () => import("@/modules/05_leave/views/Main.vue");
const addAbsence = () => import("@/modules/05_leave/views/AddPage.vue") const addAbsence = () => import("@/modules/05_leave/views/AddPage.vue");
const editAbsence = () => import("@/modules/05_leave/views/EditPage.vue") const editAbsence = () => import("@/modules/05_leave/views/EditPage.vue");
/* const Checkout = () => import("@/modules/04_checkin/views/Checkout.vue"); /* const Checkout = () => import("@/modules/04_checkin/views/Checkout.vue");
*/ */
export default [ export default [
{ {
path: "/leave", path: "/leave",
name: "leave", name: "leave",
component: leave, component: leave,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
{ {
path: "/leave/add", path: "/leave/add",
name: "addAbsence", name: "addAbsence",
component: addAbsence, component: addAbsence,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
{ {
path: "/leave/edit/:id", path: "/leave/edit/:id",
name: "editAbsence", name: "editAbsence",
component: editAbsence, component: editAbsence,
meta: { meta: {
Auth: true, Auth: true,
Key: [7], Key: [7],
}, },
}, },
] ];

View file

@ -1,401 +1,424 @@
import { defineStore } from "pinia" import { defineStore } from "pinia";
import { ref } from "vue" import { ref } from "vue";
import { useQuasar } from "quasar" import { useQuasar } from "quasar";
import type { QTableProps } from "quasar" import type { QTableProps } from "quasar";
import type { OptionData, TypeLeave } from "@/modules/05_leave/interface/index/main" import type {
import type { ListLeave, ListLeaveTable } from "@/modules/05_leave/interface/response/leave" OptionData,
import http from "@/plugins/http" TypeLeave,
import config from "@/app.config" } from "@/modules/05_leave/interface/index/main";
import type {
ListLeave,
ListLeaveTable,
} from "@/modules/05_leave/interface/response/leave";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin" import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin() const mixin = useCounterMixin();
const { date2Thai, messageError } = mixin const { date2Thai, messageError } = mixin;
const $q = useQuasar() const $q = useQuasar();
const type = ref<string>("00000000-0000-0000-0000-000000000000"); const type = ref<string>("00000000-0000-0000-0000-000000000000");
const status = ref<string>("ALL"); const status = ref<string>("ALL");
export const useLeaveStore = defineStore("Leave", () => { export const useLeaveStore = defineStore("Leave", () => {
const tabValue = ref<string>("calendar") const tabValue = ref<string>("calendar");
const typeLeave = ref<string | undefined>("") const typeLeave = ref<string | undefined>("");
const LeaveType = ref<string | null>("0") const LeaveType = ref<string | null>("0");
const LeaveStatus = ref<string | null>("0") const LeaveStatus = ref<string | null>("0");
const fiscalYearyear = ref<Number | null>(new Date().getFullYear()) const fiscalYearyear = ref<Number | null>(new Date().getFullYear());
const rows = ref<ListLeaveTable[]>([]) const rows = ref<ListLeaveTable[]>([]);
/** /**
* function Table * function Table
* @param data Table * @param data Table
*/ */
async function fetchListLeave(data: ListLeave[]) { async function fetchListLeave(data: ListLeave[]) {
let datalist: ListLeaveTable[] = data.map((e: ListLeave) => ({ let datalist: ListLeaveTable[] = data.map((e: ListLeave) => ({
id: e.id, id: e.id,
leaveTypeName: e.leaveTypeName, leaveTypeName: e.leaveTypeName,
leaveTypeId: e.leaveTypeId, leaveTypeId: e.leaveTypeId,
fullName: e.fullName, fullName: e.fullName,
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave), dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
dateLeave: date2Thai(e.leaveStartDate) + " - " + date2Thai(e.leaveEndDate), dateLeave:
status: e.status, date2Thai(e.leaveStartDate) + " - " + date2Thai(e.leaveEndDate),
hajjDayStatus: e.hajjDayStatus, status: e.status,
statusConvert: convertStatud(e.status), hajjDayStatus: e.hajjDayStatus,
isDelete: e.isDelete, statusConvert: convertStatud(e.status),
})) isDelete: e.isDelete,
rows.value = datalist }));
} rows.value = datalist;
}
//ฟังก์ชั่นแปลง Status //ฟังก์ชั่นแปลง Status
function convertStatud(val: string) { function convertStatud(val: string) {
switch (val) { switch (val) {
case "DRAFT": case "DRAFT":
return "แบบร่าง" return "แบบร่าง";
case "NEW": case "NEW":
return "ใหม่" return "ใหม่";
case "PENDING": case "PENDING":
return "กำลังดำเนินการ" return "กำลังดำเนินการ";
case "APPROVE": case "APPROVE":
return "อนุมัติ" return "อนุมัติ";
case "REJECT": case "REJECT":
return "ไม่อนุมัติ" return "ไม่อนุมัติ";
case "DELETE": case "DELETE":
return "ยกเลิก" return "ยกเลิก";
} }
} }
/** ประเภทการลา */ /** ประเภทการลา */
const typeOptions = ref<OptionData[]>([]) const typeOptions = ref<OptionData[]>([]);
const typeId = ref<string | undefined>("") const typeId = ref<string | undefined>("");
const typeOptionsMain = ref<OptionData[]>([]) const typeOptionsMain = ref<OptionData[]>([]);
const typeOptionsAdd = ref<OptionData[]>([]) const typeOptionsAdd = ref<OptionData[]>([]);
/** รายการข้อมูลประเภทใบลา */ /** รายการข้อมูลประเภทใบลา */
const options = ref<OptionData[]>([]) const options = ref<OptionData[]>([]);
/** /**
* function * function
* @param data * @param data
*/ */
async function fetchLeaveType(data: TypeLeave[]) { async function fetchLeaveType(data: TypeLeave[]) {
typeOptionsMain.value = [ typeOptionsMain.value = [
{ {
id: "00000000-0000-0000-0000-000000000000", id: "00000000-0000-0000-0000-000000000000",
name: "ทั้งหมด", name: "ทั้งหมด",
code: "LV-000", code: "LV-000",
}, },
] ];
const optionType = data.map((e: TypeLeave) => ({ const optionType = data.map((e: TypeLeave) => ({
id: e.id, id: e.id,
name: e.name, name: e.name,
code: e.code, code: e.code,
})) }));
typeOptionsMain.value.push(...optionType) typeOptionsMain.value.push(...optionType);
typeOptions.value = typeOptionsMain.value typeOptions.value = typeOptionsMain.value;
typeOptionsAdd.value = [] typeOptionsAdd.value = [];
typeOptionsAdd.value.push(...optionType) typeOptionsAdd.value.push(...optionType);
options.value = typeOptionsAdd.value options.value = typeOptionsAdd.value;
} }
/** สถานะของการลา */ /** สถานะของการลา */
const statusOptionsMain = ref<any[]>([ const statusOptionsMain = ref<any[]>([
{ id: "ALL", name: "ทั้งหมด" }, { id: "ALL", name: "ทั้งหมด" },
{ id: "DRAFT", name: "แบบร่าง" }, { id: "DRAFT", name: "แบบร่าง" },
{ id: "NEW", name: "ใหม่" }, { id: "NEW", name: "ใหม่" },
{ id: "PENDING", name: "กำลังดำเนินการ" }, { id: "PENDING", name: "กำลังดำเนินการ" },
{ id: "APPROVE", name: "อนุมัติ " }, { id: "APPROVE", name: "อนุมัติ " },
{ id: "REJECT", name: "ไม่อนุมัติ" }, { id: "REJECT", name: "ไม่อนุมัติ" },
{ id: "DELETE", name: "ยกเลิก" }, { id: "DELETE", name: "ยกเลิก" },
]) ]);
const statusOptions = ref<any[]>(statusOptionsMain.value) const statusOptions = ref<any[]>(statusOptionsMain.value);
/** /**
* function Option * function Option
* @param val * @param val
* @param update * @param update
* @param refData * @param refData
*/ */
function filterOption(val: any, update: Function, refData: string) { function filterOption(val: any, update: Function, refData: string) {
switch (refData) { switch (refData) {
case "LeaveTypeOption": case "LeaveTypeOption":
type.value = '' type.value = "";
update(() => { update(() => {
typeOptions.value = typeOptionsMain.value.filter((v: any) => v.name.indexOf(val) > -1) typeOptions.value = typeOptionsMain.value.filter(
}) (v: any) => v.name.indexOf(val) > -1
break );
case "LeaveStatusOption": });
status.value = '' break;
update(() => { case "LeaveStatusOption":
statusOptions.value = statusOptionsMain.value.filter((v: any) => v.name.indexOf(val) > -1) status.value = "";
}) update(() => {
break statusOptions.value = statusOptionsMain.value.filter(
default: (v: any) => v.name.indexOf(val) > -1
break );
} });
} break;
default:
break;
}
}
/** รายการประเภทการลาของ ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน*/ /** รายการประเภทการลาของ ลาไปศึกษา ฝึกอบรม ปฎิบัติการวิจัย หรือดูงาน*/
const optionsSpecific = ref<OptionData[]>([ const optionsSpecific = ref<OptionData[]>([
{ id: "s1", name: "ลาไปศึกษาต่อ", code: "s1" }, { id: "s1", name: "ลาไปศึกษาต่อ", code: "s1" },
{ id: "s2", name: "ลาฝึกอบรม/ปฎิบัติการวิจัย/ดูงาน", code: "s2" }, { id: "s2", name: "ลาฝึกอบรม/ปฎิบัติการวิจัย/ดูงาน", code: "s2" },
]) ]);
/** รายการประเภทการลาของ ลาอุปสมบทหรือลาประกอบพิธีฮัจญ์*/ /** รายการประเภทการลาของ ลาอุปสมบทหรือลาประกอบพิธีฮัจญ์*/
const optionsOrdination = ref<OptionData[]>([ const optionsOrdination = ref<OptionData[]>([
{ id: "b1", name: "ลาอุปสมบท", code: "b1" }, { id: "b1", name: "ลาอุปสมบท", code: "b1" },
{ id: "b2", name: "ลาประกอบพิธีฮัจญ์", code: "b2" }, { id: "b2", name: "ลาประกอบพิธีฮัจญ์", code: "b2" },
]) ]);
/** data table filter & column ของรายการลา */ /** data table filter & column ของรายการลา */
const visibleColumns = ref<string[]>(["no", "leaveTypeName", "dateSendLeave", "status", "dateLeave"]) const visibleColumns = ref<string[]>([
"no",
"leaveTypeName",
"dateSendLeave",
"status",
"dateLeave",
]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "no", name: "no",
align: "left", align: "left",
label: "ลำดับ", label: "ลำดับ",
sortable: true, sortable: true,
field: "no", field: "no",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px; width:5%;", style: "font-size: 14px; width:5%;",
}, },
{ {
name: "leaveTypeName", name: "leaveTypeName",
align: "left", align: "left",
label: "ประเภทการลา", label: "ประเภทการลา",
sortable: true, sortable: true,
field: "leaveTypeName", field: "leaveTypeName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px; width:15%;", style: "font-size: 14px; width:15%;",
}, },
{ {
name: "dateLeave", name: "dateLeave",
align: "left", align: "left",
label: "วันที่ลา", label: "วันที่ลา",
sortable: true, sortable: true,
field: "dateLeave", field: "dateLeave",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px; width:15%;", style: "font-size: 14px; width:15%;",
}, },
{ {
name: "dateSendLeave", name: "dateSendLeave",
align: "left", align: "left",
label: "วันที่ยื่นใบลา", label: "วันที่ยื่นใบลา",
sortable: true, sortable: true,
field: "dateSendLeave", field: "dateSendLeave",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px; width:15%;", style: "font-size: 14px; width:15%;",
}, },
{ {
name: "status", name: "status",
align: "left", align: "left",
label: "สถานะ", label: "สถานะ",
sortable: true, sortable: true,
field: "status", field: "status",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px; width:10%;", style: "font-size: 14px; width:10%;",
}, },
]) ]);
/** /**
* *
* @param item * @param item
* @param subitem * @param subitem
*/ */
function typeConvert(item: string, subitem: any) { function typeConvert(item: string, subitem: any) {
// console.log('first',item) // console.log('first',item)
// if (item !== "LV-006" && item !== "LV-008") { // if (item !== "LV-006" && item !== "LV-008") {
typeLeave.value = convertSubtitle(item) typeLeave.value = convertSubtitle(item);
// } else if (item === "LV-006") { // } else if (item === "LV-006") {
// typeLeave.value = convertSubtitleInfo(subitem); // typeLeave.value = convertSubtitleInfo(subitem);
// } else if (item === "LV-008") { // } else if (item === "LV-008") {
// typeLeave.value = convertSubtitleInfo2(subitem); // typeLeave.value = convertSubtitleInfo2(subitem);
// } // }
typeId.value = convertId(item) typeId.value = convertId(item);
} }
/** /**
* / * /
* @param val string * @param val string
* @returns * @returns
*/ */
function convertSubtitle(val: string) { function convertSubtitle(val: string) {
return options.value.find(x => x.code == val)?.name return options.value.find((x) => x.code == val)?.name;
} }
/** /**
* / * /
* @param val string * @param val string
* @returns * @returns
*/ */
function convertSubtitleInfo(val: string) { function convertSubtitleInfo(val: string) {
return optionsOrdination.value.find(x => x.id == val)?.name return optionsOrdination.value.find((x) => x.id == val)?.name;
} }
/** /**
* *
* @param val string * @param val string
* @returns * @returns
*/ */
function convertSubtitleInfo2(val: string) { function convertSubtitleInfo2(val: string) {
return optionsSpecific.value.find(x => x.id == val)?.name return optionsSpecific.value.find((x) => x.id == val)?.name;
} }
/** /**
* id api * id api
* @param val string * @param val string
* @returns * @returns
*/ */
function convertId(val: string) { function convertId(val: string) {
return options.value.find(x => x.code == val)?.id return options.value.find((x) => x.code == val)?.id;
} }
/** /**
* profile * profile
*/ */
const dateSendLeave = ref<Date>() //วันที่ยื่นใบลา const dateSendLeave = ref<Date>(); //วันที่ยื่นใบลา
const leaveTypeName = ref<string>("") //Name ประเภทการลา const leaveTypeName = ref<string>(""); //Name ประเภทการลา
const dear = ref<string>("") //เรียน const dear = ref<string>(""); //เรียน
const fullName = ref<string>("") //คำนำหน้า ชื่อ นามสกุล ผู้ยื่นขอ const fullName = ref<string>(""); //คำนำหน้า ชื่อ นามสกุล ผู้ยื่นขอ
const positionName = ref<string>("") //ตำแหน่งผู้ยื่นขอ const positionName = ref<string>(""); //ตำแหน่งผู้ยื่นขอ
const positionLevelName = ref<string>("") //ระดับผู้ยื่นขอ const positionLevelName = ref<string>(""); //ระดับผู้ยื่นขอ
const organizationName = ref<string>("") //สังกัดผู้ยื่นขอ const organizationName = ref<string>(""); //สังกัดผู้ยื่นขอ
const leaveLimit = ref<number>(0) //โควต้าลา(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น) const leaveLimit = ref<number>(0); //โควต้าลา(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น)
const leaveTotal = ref<number>(0) //ลาไปแล้ว(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น) const leaveTotal = ref<number>(0); //ลาไปแล้ว(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น)
const leaveRemain = ref<number>(0) //คงเหลือโควต้า(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น) const leaveRemain = ref<number>(0); //คงเหลือโควต้า(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น)
const restDayTotalOld = ref<number>(0) //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา const restDayTotalOld = ref<number>(0); //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา
const birthDate = ref<Date>() //วันเกิด const birthDate = ref<Date>(); //วันเกิด
const dateAppoint = ref<Date>() //วันที่เข้ารับราชการ const dateAppoint = ref<Date>(); //วันที่เข้ารับราชการ
const salary = ref<number>(0) //เงินเดือนปัจจุบัน const salary = ref<number>(0); //เงินเดือนปัจจุบัน
const salaryText = ref<string>("") //เงินเดือนปัจจุบัน(ภาษาไทย) const salaryText = ref<string>(""); //เงินเดือนปัจจุบัน(ภาษาไทย)
const leaveLast = ref<any>() const leaveLast = ref<any>();
const restDayCurrentTotal = ref<number>(0) const restDayCurrentTotal = ref<number>(0);
//ดึงข้อมูล profile จาก API //ดึงข้อมูล profile จาก API
async function fetchProfile() { async function fetchProfile() {
await http await http
.post(config.API.leaveProfile(), { type: typeId.value }) .post(config.API.leaveProfile(), { type: typeId.value })
.then((res: any) => { .then((res: any) => {
const data = res.data.result const data = res.data.result;
dateSendLeave.value = data.dateSendLeave dateSendLeave.value = data.dateSendLeave;
leaveTypeName.value = data.leaveTypeName leaveTypeName.value = data.leaveTypeName;
dear.value = data.dear dear.value = data.dear;
fullName.value = data.fullName fullName.value = data.fullName;
positionName.value = data.positionName positionName.value = data.positionName;
positionLevelName.value = data.positionLevelName positionLevelName.value = data.positionLevelName;
organizationName.value = data.organizationName organizationName.value = data.organizationName;
leaveLimit.value = data.leaveLimit leaveLimit.value = data.leaveLimit;
leaveTotal.value = data.leaveTotal leaveTotal.value = data.leaveTotal;
leaveRemain.value = data.leaveRemain leaveRemain.value = data.leaveRemain;
restDayTotalOld.value = data.restDayTotalOld restDayTotalOld.value = data.restDayTotalOld;
birthDate.value = data.birthDate birthDate.value = data.birthDate;
dateAppoint.value = data.dateAppoint dateAppoint.value = data.dateAppoint;
salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "" salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "";
salaryText.value = data.salaryText salaryText.value = data.salaryText;
leaveLast.value = data.leaveLast != "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-" leaveLast.value =
restDayCurrentTotal.value = Number(data.leaveLimit) - Number(data.restDayTotalOld) data.leaveLast != "0001-01-01T00:00:00"
}) ? date2Thai(data.leaveLast)
.catch((e: any) => { : "-";
messageError($q, e) restDayCurrentTotal.value =
}) Number(data.leaveLimit) - Number(data.restDayTotalOld);
} })
.catch((e: any) => {
messageError($q, e);
});
}
async function fetchProfileOld(data: any) { async function fetchProfileOld(data: any) {
await http await http
.post(config.API.leaveProfile(), { type: typeId.value }) .post(config.API.leaveProfile(), { type: typeId.value })
.then((res: any) => { .then((res: any) => {
const data = res.data.result const data = res.data.result;
leaveLimit.value = data.leaveLimit leaveLimit.value = data.leaveLimit;
leaveTotal.value = data.leaveTotal leaveTotal.value = data.leaveTotal;
leaveRemain.value = data.leaveRemain leaveRemain.value = data.leaveRemain;
restDayTotalOld.value = data.restDayTotalOld //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา restDayTotalOld.value = data.restDayTotalOld; //จำนวนวันลาพักผ่อนสะสม จากปีที่ผ่านมา
birthDate.value = data.birthDate // วันเกิด birthDate.value = data.birthDate; // วันเกิด
dateAppoint.value = data.dateAppoint // วันที่รับราชการ dateAppoint.value = data.dateAppoint; // วันที่รับราชการ
salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "" salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "";
salaryText.value = data.salaryText salaryText.value = data.salaryText;
restDayCurrentTotal.value = Number(data.leaveLimit) - Number(data.restDayTotalOld) restDayCurrentTotal.value =
}) Number(data.leaveLimit) - Number(data.restDayTotalOld);
.catch((e: any) => { })
messageError($q, e) .catch((e: any) => {
}) messageError($q, e);
});
dateSendLeave.value = data.dateSendLeave dateSendLeave.value = data.dateSendLeave;
typeLeave.value = data.leaveTypeName typeLeave.value = data.leaveTypeName;
dear.value = data.dear dear.value = data.dear;
fullName.value = data.fullName fullName.value = data.fullName;
positionName.value = data.positionName positionName.value = data.positionName;
positionLevelName.value = data.positionLevelName positionLevelName.value = data.positionLevelName;
organizationName.value = data.organizationName organizationName.value = data.organizationName;
leaveLast.value = data.leaveLast != "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-" leaveLast.value =
restDayCurrentTotal.value = data.restDayCurrentTotal data.leaveLast != "0001-01-01T00:00:00" ? date2Thai(data.leaveLast) : "-";
} restDayCurrentTotal.value = data.restDayCurrentTotal;
}
function resetForm2() { function resetForm2() {
dateSendLeave.value = undefined dateSendLeave.value = undefined;
leaveTypeName.value = "" leaveTypeName.value = "";
dear.value = "" dear.value = "";
fullName.value = "" fullName.value = "";
positionName.value = "" positionName.value = "";
positionLevelName.value = "" positionLevelName.value = "";
organizationName.value = "" organizationName.value = "";
leaveLimit.value = 0 leaveLimit.value = 0;
leaveTotal.value = 0 leaveTotal.value = 0;
leaveRemain.value = 0 leaveRemain.value = 0;
restDayTotalOld.value = 0 restDayTotalOld.value = 0;
birthDate.value = undefined birthDate.value = undefined;
dateAppoint.value = undefined dateAppoint.value = undefined;
salary.value = 0 salary.value = 0;
salaryText.value = "" salaryText.value = "";
leaveLast.value = undefined leaveLast.value = undefined;
restDayCurrentTotal.value = 0 restDayCurrentTotal.value = 0;
} }
return { return {
tabValue, tabValue,
typeOptions, typeOptions,
optionsSpecific, optionsSpecific,
statusOptions, statusOptions,
visibleColumns, visibleColumns,
columns, columns,
rows, rows,
LeaveType, LeaveType,
LeaveStatus, LeaveStatus,
fiscalYearyear, fiscalYearyear,
options, options,
optionsOrdination, optionsOrdination,
typeConvert, typeConvert,
typeLeave, typeLeave,
typeId, typeId,
fetchListLeave, fetchListLeave,
fetchLeaveType, fetchLeaveType,
filterOption, filterOption,
fetchProfile, fetchProfile,
//ส่งออกตัวแปร profileที่ได้จาก Api //ส่งออกตัวแปร profileที่ได้จาก Api
dateSendLeave, dateSendLeave,
leaveTypeName, leaveTypeName,
dear, dear,
fullName, fullName,
positionName, positionName,
positionLevelName, positionLevelName,
organizationName, organizationName,
leaveLimit, //โควต้าลา(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น) leaveLimit, //โควต้าลา(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น)
leaveTotal, //ลาไปแล้ว(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น) leaveTotal, //ลาไปแล้ว(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น)
leaveRemain, //คงเหลือโควต้า(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น) leaveRemain, //คงเหลือโควต้า(แต่ละประเภท)หน่วยเป็นวัน(ภายในปีนั้น)
restDayTotalOld, restDayTotalOld,
birthDate, birthDate,
dateAppoint, dateAppoint,
salary, salary,
salaryText, salaryText,
leaveLast, leaveLast,
restDayCurrentTotal, restDayCurrentTotal,
convertStatud, convertStatud,
resetForm2, resetForm2,
fetchProfileOld, fetchProfileOld,
type, type,
typeOptionsMain, typeOptionsMain,
status, status,
statusOptionsMain statusOptionsMain,
} };
}) });

View file

@ -158,7 +158,8 @@ onMounted(async () => {
ไมอม ไมอม
</q-item-section> </q-item-section>
</q-item> </q-item>
</template></q-select> </template></q-select
>
</div> </div>
<div class="row q-mt-sm"> <div class="row q-mt-sm">

View file

@ -35,79 +35,79 @@ const dataStore = useLeaveStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
messageError, messageError,
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm, dialogConfirm,
success, success,
date2Thai, date2Thai,
dateToISO, dateToISO,
dialogRemove, dialogRemove,
} = mixin; } = mixin;
const titleName = ref<string>(""); const titleName = ref<string>("");
/** Form รายละเอียดข้อมูล*/ /** Form รายละเอียดข้อมูล*/
const formData = reactive<any>({ const formData = reactive<any>({
id: "", //Id id: "", //Id
leaveTypeName: "", // Name leaveTypeName: "", // Name
leaveTypeId: "", //Id leaveTypeId: "", //Id
fullname: "", // fullname: "", //
dateSendLeave: null, // dateSendLeave: null, //
status: "", // status: "", //
leaveDateStart: null, // leaveDateStart: null, //
leaveDateEnd: null, // leaveDateEnd: null, //
leaveCount: 0, // leaveCount: 0, //
leaveWrote: "", // leaveWrote: "", //
leaveAddress: "", // leaveAddress: "", //
leaveNumber: "", // leaveNumber: "", //
leaveDetail: "", // leaveDetail: "", //
leaveDocument: [], // leaveDocument: [], //
leaveDraftDocument: "", // leaveDraftDocument: "", //
leaveLastStart: null, // ( )(Auto) leaveLastStart: null, // ( )(Auto)
leaveLastEnd: null, // ( )(Auto) leaveLastEnd: null, // ( )(Auto)
leaveTotal: 0, //(Auto) leaveTotal: 0, //(Auto)
leavebirthDate: null, //(Auto) leavebirthDate: null, //(Auto)
leavegovernmentDate: null, //(Auto) leavegovernmentDate: null, //(Auto)
leaveSalary: 0, //(Auto) leaveSalary: 0, //(Auto)
leaveSalaryText: "", //() leaveSalaryText: "", //()
leaveTypeDay: "", // leaveTypeDay: "", //
wifeDayName: "", //() wifeDayName: "", //()
wifeDayDateBorn: null, //() wifeDayDateBorn: null, //()
restDayOldTotal: 0, // ()(Auto) restDayOldTotal: 0, // ()(Auto)
restDayCurrentTotal: 0, //()(Auto) restDayCurrentTotal: 0, //()(Auto)
ordainDayStatus: "", /// () () ordainDayStatus: "", /// () ()
ordainDayLocationName: "", // () ordainDayLocationName: "", // ()
ordainDayLocationAddress: "", // () ordainDayLocationAddress: "", // ()
ordainDayLocationNumber: "", // () ordainDayLocationNumber: "", // ()
ordainDayOrdination: null, // () ordainDayOrdination: null, // ()
ordainDayBuddhistLentName: "", // () ordainDayBuddhistLentName: "", // ()
ordainDayBuddhistLentAddress: "", // () ordainDayBuddhistLentAddress: "", // ()
hajjDayStatus: "", /// () () hajjDayStatus: "", /// () ()
absentDaySummon: "", // () absentDaySummon: "", // ()
absentDayLocation: "", // () absentDayLocation: "", // ()
absentDayRegistorDate: null, // () absentDayRegistorDate: null, // ()
absentDayGetIn: "", // () absentDayGetIn: "", // ()
absentDayAt: "", // () absentDayAt: "", // ()
studyDaySubject: "", // ( ) studyDaySubject: "", // ( )
studyDayDegreeLevel: "", // ( ) studyDayDegreeLevel: "", // ( )
studyDayUniversityName: "", // ( ) studyDayUniversityName: "", // ( )
studyDayTrainingSubject: "", // / ( ) studyDayTrainingSubject: "", // / ( )
studyDayTrainingName: "", // ( ) studyDayTrainingName: "", // ( )
studyDayCountry: "", // ( ) studyDayCountry: "", // ( )
studyDayScholarship: "", // ( ) studyDayScholarship: "", // ( )
coupleDayName: "", // () coupleDayName: "", // ()
coupleDayPosition: "", // () coupleDayPosition: "", // ()
coupleDayLevel: "", // () coupleDayLevel: "", // ()
coupleDayLevelCountry: "", // () coupleDayLevelCountry: "", // ()
coupleDayCountryHistory: "", // () coupleDayCountryHistory: "", // ()
coupleDayTotalHistory: "", // () coupleDayTotalHistory: "", // ()
coupleDayStartDateHistory: null, // () coupleDayStartDateHistory: null, // ()
coupleDayEndDateHistory: null, // () coupleDayEndDateHistory: null, // ()
coupleDaySumTotalHistory: "", // () coupleDaySumTotalHistory: "", // ()
approveStep: "", approveStep: "",
dear: "", dear: "",
leaveLast: "", leaveLast: "",
leaveRange: "", leaveRange: "",
}); });
/** /**
@ -115,117 +115,119 @@ const formData = reactive<any>({
* @param id การลา * @param id การลา
*/ */
async function fetchDataDetail(id: string) { async function fetchDataDetail(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.leaveUserId(id), {}) .get(config.API.leaveUserId(id), {})
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
dataStore.typeId = data.leaveTypeId; dataStore.typeId = data.leaveTypeId;
titleName.value = data.fullName ?? "-"; titleName.value = data.fullName ?? "-";
formData.id = data.id ?? "-"; formData.id = data.id ?? "-";
formData.leaveTypeName = data.leaveTypeName ?? "-"; formData.leaveTypeName = data.leaveTypeName ?? "-";
formData.leaveTypeId = data.leaveTypeId ?? "-"; formData.leaveTypeId = data.leaveTypeId ?? "-";
formData.fullname = data.fullName ?? "-"; formData.fullname = data.fullName ?? "-";
formData.dateSendLeave = formData.dateSendLeave =
data.dateSendLeave && date2Thai(data.dateSendLeave); data.dateSendLeave && date2Thai(data.dateSendLeave);
formData.status = data.status ?? "-"; formData.status = data.status ?? "-";
formData.leaveStartDate = data.leaveStartDate; formData.leaveStartDate = data.leaveStartDate;
formData.leaveEndDate = data.leaveEndDate; formData.leaveEndDate = data.leaveEndDate;
formData.leaveCount = data.leaveTotal ?? "-"; formData.leaveCount = data.leaveTotal ?? "-";
formData.leaveWrote = data.leaveWrote ?? "-"; formData.leaveWrote = data.leaveWrote ?? "-";
formData.leaveAddress = data.leaveAddress ?? "-"; formData.leaveAddress = data.leaveAddress ?? "-";
formData.leaveNumber = data.leaveNumber ?? "-"; formData.leaveNumber = data.leaveNumber ?? "-";
formData.leaveDetail = data.leaveDetail ?? "-"; formData.leaveDetail = data.leaveDetail ?? "-";
formData.leaveDocument = data.leaveDocument; formData.leaveDocument = data.leaveDocument;
formData.leaveDraftDocument = data.leaveDraftDocument; formData.leaveDraftDocument = data.leaveDraftDocument;
formData.leaveLastStart = formData.leaveLastStart =
data.leaveLastStart && date2Thai(data.leaveLastStart); data.leaveLastStart && date2Thai(data.leaveLastStart);
formData.leaveLastEnd = formData.leaveLastEnd =
data.leaveLastStart && date2Thai(data.leaveLastEnd); data.leaveLastStart && date2Thai(data.leaveLastEnd);
formData.leaveTotal = data.leaveTotal; formData.leaveTotal = data.leaveTotal;
formData.leavebirthDate = formData.leavebirthDate =
data.leaveBirthDate && date2Thai(data.leaveBirthDate); data.leaveBirthDate && date2Thai(data.leaveBirthDate);
formData.leavegovernmentDate = formData.leavegovernmentDate =
data.leaveGovernmentDate && date2Thai(data.leaveGovernmentDate); data.leaveGovernmentDate && date2Thai(data.leaveGovernmentDate);
formData.leaveSalary = data.leaveSalary ?? "-"; formData.leaveSalary = data.leaveSalary ?? "-";
formData.leaveSalaryText = data.leaveSalaryText ?? "-"; formData.leaveSalaryText = data.leaveSalaryText ?? "-";
formData.wifeDayName = data.wifeDayName ?? "-"; formData.wifeDayName = data.wifeDayName ?? "-";
formData.wifeDayDateBorn = data.wifeDayDateBorn ? data.wifeDayDateBorn:null; formData.wifeDayDateBorn = data.wifeDayDateBorn
formData.restDayOldTotal = data.restDayOldTotal ?? "-"; ? data.wifeDayDateBorn
formData.restDayCurrentTotal = data.restDayCurrentTotal ?? "-"; : null;
formData.ordainDayStatus = data.ordainDayStatus; formData.restDayOldTotal = data.restDayOldTotal ?? "-";
formData.ordainDayLocationName = data.ordainDayLocationName ?? "-"; formData.restDayCurrentTotal = data.restDayCurrentTotal ?? "-";
formData.ordainDayLocationAddress = data.ordainDayLocationAddress ?? "-"; formData.ordainDayStatus = data.ordainDayStatus;
formData.ordainDayLocationNumber = data.ordainDayLocationNumber ?? "-"; formData.ordainDayLocationName = data.ordainDayLocationName ?? "-";
formData.ordainDayOrdination = data.ordainDayOrdination; formData.ordainDayLocationAddress = data.ordainDayLocationAddress ?? "-";
formData.ordainDayBuddhistLentName = formData.ordainDayLocationNumber = data.ordainDayLocationNumber ?? "-";
data.ordainDayBuddhistLentName ?? "-"; formData.ordainDayOrdination = data.ordainDayOrdination;
formData.ordainDayBuddhistLentAddress = formData.ordainDayBuddhistLentName =
data.ordainDayBuddhistLentAddress ?? "-"; data.ordainDayBuddhistLentName ?? "-";
formData.hajjDayStatus = data.hajjDayStatus; formData.ordainDayBuddhistLentAddress =
formData.absentDaySummon = data.absentDaySummon ?? "-"; data.ordainDayBuddhistLentAddress ?? "-";
formData.absentDayLocation = data.absentDayLocation ?? "-"; formData.hajjDayStatus = data.hajjDayStatus;
formData.absentDayRegistorDate = data.absentDayRegistorDate; formData.absentDaySummon = data.absentDaySummon ?? "-";
formData.absentDayGetIn = data.absentDayGetIn ?? "-"; formData.absentDayLocation = data.absentDayLocation ?? "-";
formData.absentDayAt = data.absentDayAt ?? "-"; formData.absentDayRegistorDate = data.absentDayRegistorDate;
formData.studyDaySubject = data.studyDaySubject ?? "-"; formData.absentDayGetIn = data.absentDayGetIn ?? "-";
formData.studyDayDegreeLevel = data.studyDayDegreeLevel ?? "-"; formData.absentDayAt = data.absentDayAt ?? "-";
formData.studyDayUniversityName = data.studyDayUniversityName ?? "-"; formData.studyDaySubject = data.studyDaySubject ?? "-";
formData.studyDayTrainingSubject = formData.studyDayDegreeLevel = data.studyDayDegreeLevel ?? "-";
data.studyDayTrainingSubject ?? "-" ?? "-"; formData.studyDayUniversityName = data.studyDayUniversityName ?? "-";
formData.studyDayTrainingName = data.studyDayTrainingName ?? "-"; formData.studyDayTrainingSubject =
formData.studyDayCountry = data.studyDayCountry ?? "-"; data.studyDayTrainingSubject ?? "-" ?? "-";
formData.studyDayScholarship = data.studyDayScholarship ?? "-"; formData.studyDayTrainingName = data.studyDayTrainingName ?? "-";
formData.coupleDayName = data.coupleDayName ?? "-"; formData.studyDayCountry = data.studyDayCountry ?? "-";
formData.coupleDayPosition = data.coupleDayPosition ?? "-"; formData.studyDayScholarship = data.studyDayScholarship ?? "-";
formData.coupleDayLevel = data.coupleDayLevel ?? "-"; formData.coupleDayName = data.coupleDayName ?? "-";
formData.coupleDayLevelCountry = data.coupleDayLevelCountry ?? "-"; formData.coupleDayPosition = data.coupleDayPosition ?? "-";
formData.coupleDayCountryHistory = data.coupleDayCountryHistory ?? "-"; formData.coupleDayLevel = data.coupleDayLevel ?? "-";
formData.coupleDayTotalHistory = data.coupleDayTotalHistory ?? "-"; formData.coupleDayLevelCountry = data.coupleDayLevelCountry ?? "-";
formData.coupleDayStartDateHistory = data.coupleDayStartDateHistory; formData.coupleDayCountryHistory = data.coupleDayCountryHistory ?? "-";
formData.coupleDayEndDateHistory = data.coupleDayEndDateHistory; formData.coupleDayTotalHistory = data.coupleDayTotalHistory ?? "-";
formData.coupleDaySumTotalHistory = data.coupleDaySumTotalHistory ?? "-"; formData.coupleDayStartDateHistory = data.coupleDayStartDateHistory;
formData.approveStep = data.approveStep ?? "-"; formData.coupleDayEndDateHistory = data.coupleDayEndDateHistory;
formData.dear = data.dear ?? "-"; formData.coupleDaySumTotalHistory = data.coupleDaySumTotalHistory ?? "-";
formData.leaveLast = data.leaveLast ?? "-"; formData.approveStep = data.approveStep ?? "-";
formData.leaveRange = data.leaveRange; formData.dear = data.dear ?? "-";
formData.leaveLast = data.leaveLast ?? "-";
formData.leaveRange = data.leaveRange;
// checkLeaveType(formData.leaveTypeId, formData.leaveTypeName) // checkLeaveType(formData.leaveTypeId, formData.leaveTypeName)
dataStore.fetchProfileOld(data); dataStore.fetchProfileOld(data);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
/**modal */ /**modal */
const model = computed(() => { const model = computed(() => {
return ( return (
dataStore.options.find((x) => x.id == formData.leaveTypeId)?.code ?? "" dataStore.options.find((x) => x.id == formData.leaveTypeId)?.code ?? ""
); );
}); });
const modelSpecific = computed(() => { const modelSpecific = computed(() => {
const code = dataStore.options.find( const code = dataStore.options.find(
(x) => x.id == formData.leaveTypeId (x) => x.id == formData.leaveTypeId
)?.code; )?.code;
if (code == "LV-006" && formData.ordainDayLocationName != "") { if (code == "LV-006" && formData.ordainDayLocationName != "") {
return "b1"; return "b1";
} else if (code == "LV-006" && formData.ordainDayLocationName == "") { } else if (code == "LV-006" && formData.ordainDayLocationName == "") {
return "b2"; return "b2";
} else if (code == "LV-008" && formData.studyDayTrainingSubject == "") { } else if (code == "LV-008" && formData.studyDayTrainingSubject == "") {
return "s1"; return "s1";
} else if (code == "LV-008" && formData.studyDayTrainingSubject != "") { } else if (code == "LV-008" && formData.studyDayTrainingSubject != "") {
return "s2"; return "s2";
} else { } else {
return ""; return "";
} }
}); });
/** /**
@ -234,25 +236,25 @@ const modelSpecific = computed(() => {
* @param isLeave วแปรเชควาใชหน edit หรอไม * @param isLeave วแปรเชควาใชหน edit หรอไม
*/ */
function onSubmit(formData: FormData, isLeave: boolean = true) { function onSubmit(formData: FormData, isLeave: boolean = true) {
if (isLeave) { if (isLeave) {
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
showLoader(); showLoader();
await http await http
.put(config.API.leaveUserId(personalId.value), formData) .put(config.API.leaveUserId(personalId.value), formData)
.then(() => { .then(() => {
fetchDataDetail(personalId.value); fetchDataDetail(personalId.value);
success($q, "บันทึกสำเร็จ"); success($q, "บันทึกสำเร็จ");
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
}); });
} else { } else {
messageError($q, "", "ไม่มีสิทธิ์ลา"); messageError($q, "", "ไม่มีสิทธิ์ลา");
} }
} }
/** /**
@ -260,32 +262,32 @@ function onSubmit(formData: FormData, isLeave: boolean = true) {
* @param id id ของใบลา * @param id id ของใบลา
*/ */
function onConfirm(id: string) { function onConfirm(id: string) {
dialogConfirm( dialogConfirm(
$q, $q,
async () => { async () => {
showLoader(); showLoader();
await http await http
.put(config.API.leaveUserSendId(personalId.value), { reason: "" }) .put(config.API.leaveUserSendId(personalId.value), { reason: "" })
.then(() => { .then(() => {
router.push("/leave"); router.push("/leave");
success($q, "ยื่นใบลาสำเร็จ"); success($q, "ยื่นใบลาสำเร็จ");
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
// fetchDataDetail(personalId.value); // fetchDataDetail(personalId.value);
}); });
}, },
"ยืนยันการยื่นใบลา", "ยืนยันการยื่นใบลา",
"หากยืนยันแล้วจะไม่สามารถกลับมาแก้ไขได้ ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่" "หากยืนยันแล้วจะไม่สามารถกลับมาแก้ไขได้ ต้องการยืนยันการยื่นใบลานี้ใช่หรือไม่"
); );
} }
// //
const clickDelete = (id: string, docId: string) => { const clickDelete = (id: string, docId: string) => {
dialogRemove($q, () => onClickDelete(id, docId)); dialogRemove($q, () => onClickDelete(id, docId));
}; };
/** /**
@ -293,217 +295,217 @@ const clickDelete = (id: string, docId: string) => {
* @param id * @param id
*/ */
const onClickDelete = async (id: string, docId: string) => { const onClickDelete = async (id: string, docId: string) => {
await http await http
.delete(config.API.leaveDocumentId(id, docId)) .delete(config.API.leaveDocumentId(id, docId))
.then(async (res) => { .then(async (res) => {
success($q, "ลบไฟล์สำเร็จ"); success($q, "ลบไฟล์สำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
fetchDataDetail(personalId.value); fetchDataDetail(personalId.value);
hideLoader(); hideLoader();
}); });
}; };
/** /**
* เรยกใชงาน fetchData เพอดงขอม * เรยกใชงาน fetchData เพอดงขอม
*/ */
onMounted(() => { onMounted(() => {
fetchDataDetail(personalId.value); fetchDataDetail(personalId.value);
}); });
</script> </script>
<template> <template>
<div class="col-12 row justify-center"> <div class="col-12 row justify-center">
<div class="col-xs-12 col-sm-12 col-md-11"> <div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center"> <div class="toptitle text-white col-12 row items-center">
<q-btn <q-btn
to="/leave" to="/leave"
icon="mdi-arrow-left" icon="mdi-arrow-left"
unelevated unelevated
round round
dense dense
flat flat
color="primary" color="primary"
class="q-mr-sm" class="q-mr-sm"
/> />
<div> <div>
แกไขใบลา แกไขใบลา
{{ formData.leaveTypeName }} {{ formData.leaveTypeName }}
</div> </div>
</div> </div>
<q-form ref="myform" class="col-12"> <q-form ref="myform" class="col-12">
<q-card bordered> <q-card bordered>
<div class="col-12 row q-col-gutter-md q-pa-md"> <div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12"> <div class="col-xs-12 col-sm-12">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<q-icon <q-icon
name="mdi-numeric-1-circle" name="mdi-numeric-1-circle"
size="20px" size="20px"
color="primary" color="primary"
/> />
<div class="q-pl-sm text-weight-bold text-dark"> <div class="q-pl-sm text-weight-bold text-dark">
เลอกประเภทการลา เลอกประเภทการลา
</div> </div>
</div> </div>
<div class="q-py-sm q-px-lg"> <div class="q-py-sm q-px-lg">
<div class="row"> <div class="row">
<q-select <q-select
readonly readonly
dense dense
class="col-12 col-sm-6 col-md-4" class="col-12 col-sm-6 col-md-4"
outlined outlined
v-model="formData.leaveTypeName" v-model="formData.leaveTypeName"
option-value="code" option-value="code"
option-label="name" option-label="name"
emit-value emit-value
map-options map-options
prefix="ประเภทใบลา :" prefix="ประเภทใบลา :"
/> />
</div> </div>
<div class="row q-mt-sm"> <div class="row q-mt-sm">
<div <div
class="col-12 col-sm-6 col-md-3" class="col-12 col-sm-6 col-md-3"
v-if="model === 'LV-006' || model === 'LV-008'" v-if="model === 'LV-006' || model === 'LV-008'"
> >
<q-select <q-select
readonly readonly
dense dense
outlined outlined
v-model="modelSpecific" v-model="modelSpecific"
:options=" :options="
model === 'LV-006' model === 'LV-006'
? dataStore.optionsOrdination ? dataStore.optionsOrdination
: dataStore.optionsSpecific : dataStore.optionsSpecific
" "
option-value="code" option-value="code"
option-label="name" option-label="name"
emit-value emit-value
map-options map-options
prefix="ประเภทการลา :" prefix="ประเภทการลา :"
@update:model-value=" @update:model-value="
dataStore.typeConvert(model, modelSpecific) dataStore.typeConvert(model, modelSpecific)
" "
/> />
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<q-icon <q-icon
name="mdi-numeric-2-circle" name="mdi-numeric-2-circle"
size="20px" size="20px"
color="primary" color="primary"
/> />
<div class="q-pl-sm text-weight-bold text-dark"> <div class="q-pl-sm text-weight-bold text-dark">
อมลการลา อมลการลา
</div> </div>
</div> </div>
<FormPart2 <FormPart2
:model="model" :model="model"
:data="formData" :data="formData"
:leaveTypeId="formData.leaveTypeId" :leaveTypeId="formData.leaveTypeId"
/> />
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12">
<SickForm <SickForm
v-if="model === 'LV-001' || model === 'LV-002'" v-if="model === 'LV-001' || model === 'LV-002'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<FormBirth <FormBirth
v-if="model === 'LV-003'" v-if="model === 'LV-003'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<HelpWifeBirthForm <HelpWifeBirthForm
v-if="model === 'LV-004'" v-if="model === 'LV-004'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<VacationForm <VacationForm
v-if="model === 'LV-005'" v-if="model === 'LV-005'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<OrdinationForm <OrdinationForm
v-if="model === 'LV-006' && modelSpecific === 'b1'" v-if="model === 'LV-006' && modelSpecific === 'b1'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<HajjForm <HajjForm
v-if="model === 'LV-006' && modelSpecific === 'b2'" v-if="model === 'LV-006' && modelSpecific === 'b2'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<MilitaryForm <MilitaryForm
v-if="model === 'LV-007'" v-if="model === 'LV-007'"
style="width: 100%" style="width: 100%"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<StudyForm <StudyForm
v-if="model === 'LV-008' && modelSpecific === 's1'" v-if="model === 'LV-008' && modelSpecific === 's1'"
style="width: 100%" style="width: 100%"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<TrainForm <TrainForm
v-if=" v-if="
model === 'LV-008' && model === 'LV-008' &&
modelSpecific != 's1' && modelSpecific != 's1' &&
modelSpecific != '' modelSpecific != ''
" "
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<WorkInternationalForm <WorkInternationalForm
v-if="model === 'LV-009'" v-if="model === 'LV-009'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<FollowSpouseForm <FollowSpouseForm
v-if="model === 'LV-010'" v-if="model === 'LV-010'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
<RehabilitationForm <RehabilitationForm
v-if="model === 'LV-011'" v-if="model === 'LV-011'"
:data="formData" :data="formData"
:on-submit="onSubmit" :on-submit="onSubmit"
:on-confirm="onConfirm" :on-confirm="onConfirm"
:click-delete="clickDelete" :click-delete="clickDelete"
/> />
</div> </div>
</div> </div>
</q-card> </q-card>
</q-form> </q-form>
</div> </div>
</div> </div>
</template> </template>

View file

@ -261,8 +261,9 @@ watch(props, () => {
</div> </div>
</div> </div>
ประเมนทำการอปโหลดเอกสารเล 2 ประเมนทำการอปโหลดเอกสารเล 2
โดยมระยะเวลาการสงผลงานหลงจากประกาศบนเวบไซตแล 6 เดอน<br/> โดยมระยะเวลาการสงผลงานหลงจากประกาศบนเวบไซตแล 6 เดอน<br />
กรณจะเกษยณอายราชการใหงผลงาน อนวนทจะเกษยณอายราชการไมอยกว 90 กรณจะเกษยณอายราชการใหงผลงาน
อนวนทจะเกษยณอายราชการไมอยกว 90
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-carousel-slide> </q-carousel-slide>

View file

@ -103,7 +103,7 @@ onMounted(async () => {
:active="selectedItem === 1 ? true : false" :active="selectedItem === 1 ? true : false"
active-class="text-primary" active-class="text-primary"
@click="handleItemClick(1)" @click="handleItemClick(1)"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section>แบบพจารณาคณสมบคคล</q-item-section> <q-item-section>แบบพจารณาคณสมบคคล</q-item-section>
</q-item> </q-item>
@ -113,7 +113,7 @@ onMounted(async () => {
:active="selectedItem === 2 ? true : false" :active="selectedItem === 2 ? true : false"
active-class="text-primary" active-class="text-primary"
@click="handleItemClick(2)" @click="handleItemClick(2)"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section>แบบแสดงรายละเอยดการเสนอผลงาน</q-item-section> <q-item-section>แบบแสดงรายละเอยดการเสนอผลงาน</q-item-section>
</q-item> </q-item>
@ -123,7 +123,7 @@ onMounted(async () => {
:active="selectedItem === 3 ? true : false" :active="selectedItem === 3 ? true : false"
active-class="text-primary" active-class="text-primary"
@click="handleItemClick(3)" @click="handleItemClick(3)"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section <q-item-section
>แบบตรวจสอบความถกตองครบถวนของขอมลเพอประกอบการคดเลอกบคคล >แบบตรวจสอบความถกตองครบถวนของขอมลเพอประกอบการคดเลอกบคคล
@ -136,7 +136,7 @@ onMounted(async () => {
:active="selectedItem === 4 ? true : false" :active="selectedItem === 4 ? true : false"
active-class="text-primary" active-class="text-primary"
@click="handleItemClick(4)" @click="handleItemClick(4)"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section> แบบประเมนคณลกษณะบคคล </q-item-section> <q-item-section> แบบประเมนคณลกษณะบคคล </q-item-section>
</q-item> </q-item>
@ -146,7 +146,7 @@ onMounted(async () => {
:active="selectedItem === 5 ? true : false" :active="selectedItem === 5 ? true : false"
active-class="text-primary" active-class="text-primary"
@click="handleItemClick(5)" @click="handleItemClick(5)"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section> <q-item-section>
แบบสรปขอมลของผขอรบการคดเลอก (เอกสารหมายเลข 9) แบบสรปขอมลของผขอรบการคดเลอก (เอกสารหมายเลข 9)
@ -158,7 +158,7 @@ onMounted(async () => {
:active="selectedItem === 6 ? true : false" :active="selectedItem === 6 ? true : false"
active-class="text-primary" active-class="text-primary"
@click="handleItemClick(6)" @click="handleItemClick(6)"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section> ผลงานทจะสงประเม (เอกสารหมายเลข 11) </q-item-section> <q-item-section> ผลงานทจะสงประเม (เอกสารหมายเลข 11) </q-item-section>
</q-item> </q-item>

View file

@ -83,7 +83,7 @@ onMounted(async () => {
v-ripple v-ripple
:active="selectedItem === 1 ? true : false" :active="selectedItem === 1 ? true : false"
active-class="text-primary" active-class="text-primary"
class=" cursor-pointer" class="cursor-pointer"
> >
<q-item-section>เอกสารเล 2</q-item-section> <q-item-section>เอกสารเล 2</q-item-section>
</q-item> </q-item>

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import env from "@/api"; import env from "@/api";
/** importStore*/ /** importStore*/
@ -12,7 +12,7 @@ import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute(); const route = useRoute();
const router = useRouter() const router = useRouter();
const evaluateId = ref<string>(route.params.id.toString()); const evaluateId = ref<string>(route.params.id.toString());
@ -31,11 +31,13 @@ function copyLink() {
<template> <template>
<div class="row q-pa-md"> <div class="row q-pa-md">
<div class="col-12 row items-center justify-center"> <div class="col-12 row items-center justify-center">
<div class="row"><strong>Public URL : </strong> <div class="row">
<a :href="`${link}/${evaluateId}`" class="q-pl-sm"> {{link}}/{{ evaluateId }} <strong>Public URL : </strong>
<a :href="`${link}/${evaluateId}`" class="q-pl-sm">
{{ link }}/{{ evaluateId }}
</a> </a>
</div> </div>
<q-space/> <q-space />
<q-btn <q-btn
outline outline
icon="mdi-content-copy" icon="mdi-content-copy"
@ -43,7 +45,8 @@ function copyLink() {
color="primary" color="primary"
@click="copyLink" @click="copyLink"
> >
<q-tooltip> ดลอกลงก </q-tooltip></q-btn> <q-tooltip> ดลอกลงก </q-tooltip></q-btn
>
</div> </div>
</div> </div>
</template> </template>

View file

@ -123,7 +123,7 @@ watch(
<q-card style="width: 700px; max-width: 80vw"> <q-card style="width: 700px; max-width: 80vw">
<HeaderDialog :tittle="'ประวัติการประเมิน'" :close="props.close" /> <HeaderDialog :tittle="'ประวัติการประเมิน'" :close="props.close" />
<q-separator /> <q-separator />
<q-card-section > <q-card-section>
<div class="col-xs-12 col-sm-12 col-md-12 row q-col-gutter-md"> <div class="col-xs-12 col-sm-12 col-md-12 row q-col-gutter-md">
<div class="col-12"> <div class="col-12">
<q-table <q-table

View file

@ -163,7 +163,6 @@ function backPage() {
</div> </div>
</template> </template>
</q-splitter> </q-splitter>
</template> </template>
<style scoped></style> <style scoped></style>

View file

@ -16,13 +16,13 @@ const props = defineProps({
const modalPerview = ref<boolean>(false); const modalPerview = ref<boolean>(false);
const store = useEvaluateStore(); const store = useEvaluateStore();
const tabPanels = store.tabPanels const tabPanels = store.tabPanels;
</script> </script>
<template> <template>
<q-card bordered class="col-12 row shadow-0" > <q-card bordered class="col-12 row shadow-0">
<div class="col-12 row items-center q-pa-sm "> <div class="col-12 row items-center q-pa-sm">
<div class="q-pl-sm text-weight-medium" >เอกสารทปโหลด</div> <div class="q-pl-sm text-weight-medium">เอกสารทปโหลด</div>
<q-space /> <q-space />
<q-btn <q-btn
flat flat
@ -45,8 +45,14 @@ const tabPanels = store.tabPanels
> >
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<q-tab-panels v-model="store.tabPanels" animated swipeable vertical class="col-12 row"> <q-tab-panels
v-model="store.tabPanels"
animated
swipeable
vertical
class="col-12 row"
>
<q-tab-panel name="1"> <q-tab-panel name="1">
<ViewPDF :pdfSrc="props.pdfSrc" class="col-12" /> <ViewPDF :pdfSrc="props.pdfSrc" class="col-12" />
</q-tab-panel> </q-tab-panel>

View file

@ -16,9 +16,9 @@ const modalPerview = ref<boolean>(false);
</script> </script>
<template> <template>
<q-card bordered class="col-12 row shadow-0" > <q-card bordered class="col-12 row shadow-0">
<div class="col-12 row items-center q-pa-sm "> <div class="col-12 row items-center q-pa-sm">
<div class="q-pl-sm text-weight-medium" >เอกสารทปโหลด</div> <div class="q-pl-sm text-weight-medium">เอกสารทปโหลด</div>
<q-space /> <q-space />
<q-btn <q-btn
flat flat

View file

@ -98,7 +98,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
style: "font-size: 14px", style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(), format: (v) => Number(v).toLocaleString(),
}, },
{ {
name: "posNo", name: "posNo",
align: "left", align: "left",
@ -108,7 +108,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "positionType", name: "positionType",
align: "left", align: "left",
@ -127,7 +127,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "templateDoc", name: "templateDoc",
align: "left", align: "left",
@ -192,7 +192,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
sortable: true, sortable: true,
field: "yearly", field: "yearly",
format(val, row) { format(val, row) {
return row.yearly + 543 return row.yearly + 543;
}, },
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
@ -222,7 +222,7 @@ 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",

View file

@ -1,8 +1,6 @@
interface DataOption { interface DataOption {
id:string id: string;
name:string name: string;
} }
export type { export type { DataOption };
DataOption
}

View file

@ -1,14 +1,11 @@
interface MyObjectAppealRef { interface MyObjectAppealRef {
type: object | null; type: object | null;
title: object | null; title: object | null;
description: object | null; description: object | null;
caseType: object | null; caseType: object | null;
caseNumber: object | null; caseNumber: object | null;
[key: string]: any; [key: string]: any;
} }
export type { MyObjectAppealRef };
export type {
MyObjectAppealRef
}

View file

@ -1,68 +1,71 @@
interface FormType { interface FormType {
status: string status: string;
type: string type: string;
year: number year: number;
} }
interface RowList { interface RowList {
id: string id: string;
title: string title: string;
description: string description: string;
status: string status: string;
type: string type: string;
year: number year: number;
caseType: string caseType: string;
caseNumber: string caseNumber: string;
fullname: string fullname: string;
citizenId: string citizenId: string;
profileId: string profileId: string;
lastUpdatedAt: string | null lastUpdatedAt: string | null;
} }
interface MainList { interface MainList {
id: string id: string;
title: string title: string;
description: string description: string;
status: string status: string;
type: string type: string;
year: number year: number;
caseType: string caseType: string;
caseNumber: string caseNumber: string;
fullname: string fullname: string;
citizenId: string citizenId: string;
profileId: string profileId: string;
lastUpdatedAt: Date lastUpdatedAt: Date;
} }
interface EditDataList { interface EditDataList {
id: string id: string;
title: string title: string;
description: string description: string;
status: string status: string;
type: string type: string;
year: number year: number;
caseType: string caseType: string;
caseNumber: string caseNumber: string;
fullname: string fullname: string;
citizenId: string citizenId: string;
profileId: string profileId: string;
lastUpdatedAt: string lastUpdatedAt: string;
historyStatus: object | null historyStatus: object | null;
disciplineComplaint_Appeal_Docs: object | null disciplineComplaint_Appeal_Docs: object | null;
} }
interface HistoryStatusType { interface HistoryStatusType {
status: string status: string;
createdAt: string createdAt: string;
} }
interface FileObType { interface FileObType {
id: string id: string;
pathName: string pathName: string;
fileName: string fileName: string;
} }
export type { export type {
FormType, RowList, MainList, EditDataList, FormType,
RowList,
MainList,
EditDataList,
HistoryStatusType, HistoryStatusType,
FileObType FileObType,
} };

View file

@ -1,15 +1,16 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { ref } from 'vue' import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/07_appealComplain/interface/index/main"; import type { DataOption } from "@/modules/07_appealComplain/interface/index/main";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { RowList, MainList } from '@/modules/07_appealComplain/interface/response/mainType' import type {
RowList,
MainList,
} from "@/modules/07_appealComplain/interface/response/mainType";
export const useAppealComplainStore = defineStore("appealComplainStore", () => { export const useAppealComplainStore = defineStore("appealComplainStore", () => {
const mixin = useCounterMixin();
const { date2Thai } = mixin;
const mixin = useCounterMixin()
const { date2Thai } = mixin
const rows = ref<RowList[]>([]); const rows = ref<RowList[]>([]);
const visibleColumns = ref<string[]>([]); const visibleColumns = ref<string[]>([]);
@ -53,11 +54,11 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
rows.value = dataList; rows.value = dataList;
} }
/** /**
* text * text
* @param val status * @param val status
* @returns * @returns
*/ */
const typeConvert = (val: string) => { const typeConvert = (val: string) => {
switch (val) { switch (val) {
case "APPEAL": case "APPEAL":
@ -74,7 +75,7 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
* @param val status * @param val status
* @returns * @returns
*/ */
function statusTothai(val: string){ function statusTothai(val: string) {
switch (val) { switch (val) {
case "NEW": case "NEW":
return "ใหม่"; return "ใหม่";
@ -93,7 +94,7 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
default: default:
return "-"; return "-";
} }
}; }
return { return {
visibleColumns, visibleColumns,
@ -102,7 +103,6 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
rows, rows,
typeOptions, typeOptions,
statusOptions, statusOptions,
statusTothai statusTothai,
}; };
}); });

View file

@ -19,7 +19,7 @@ const route = useRoute();
const id = ref<string>(route.params.id as string); const id = ref<string>(route.params.id as string);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin; const { messageError, showLoader, hideLoader } = mixin;
const historyStatusOb = reactive<HistoryStatusType>({ const historyStatusOb = reactive<HistoryStatusType>({
status: "", status: "",

View file

@ -423,16 +423,15 @@ function onSubmit(data: any) {
</q-card> </q-card>
</div> </div>
</div> </div>
<q-separator v-if="!isReadOnly"/> <q-separator v-if="!isReadOnly" />
<q-card-actions align="right" class="bg-white text-teal" v-if="!isReadOnly"> <q-card-actions
<q-btn align="right"
id="onSubmit" class="bg-white text-teal"
type="submit" v-if="!isReadOnly"
label="บันทึก" >
color="secondary" <q-btn id="onSubmit" type="submit" label="บันทึก" color="secondary"
><q-tooltip>นท</q-tooltip></q-btn ><q-tooltip>นท</q-tooltip></q-btn
> >
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</form> </form>

View file

@ -479,7 +479,7 @@ const title = computed(() => {
<div class="col-12 fit"> <div class="col-12 fit">
<div class="row col-12" v-if="numpage !== 3"> <div class="row col-12" v-if="numpage !== 3">
<q-checkbox <q-checkbox
:disable="checkDetail" :disable="checkDetail"
v-model="formFilter.isAll" v-model="formFilter.isAll"
label="แสดงตัวชี้วัดภายใต้หน่วยงาน/ส่วนราชการทุกระดับ" label="แสดงตัวชี้วัดภายใต้หน่วยงาน/ส่วนราชการทุกระดับ"
@update:model-value="fetchNewList()" @update:model-value="fetchNewList()"
@ -488,7 +488,7 @@ const title = computed(() => {
<div class="row q-col-gutter-sm col-12"> <div class="row q-col-gutter-sm col-12">
<div class="col-5"> <div class="col-5">
<datepicker <datepicker
:readonly="checkDetail" :readonly="checkDetail"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="formFilter.year" v-model="formFilter.year"
:locale="'th'" :locale="'th'"
@ -593,7 +593,7 @@ const title = computed(() => {
:active="listCheckID === item.id" :active="listCheckID === item.id"
active-class="my-menu-link" active-class="my-menu-link"
@click="clickList(item.id)" @click="clickList(item.id)"
:style="checkDetail ? 'pointer-events: none;' : ''" :style="checkDetail ? 'pointer-events: none;' : ''"
> >
<q-item-section class="q-pa-none"> <q-item-section class="q-pa-none">
<div <div
@ -993,9 +993,13 @@ const title = computed(() => {
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator v-if="!checkDetail"/> <q-separator v-if="!checkDetail" />
<q-card-actions v-if="!checkDetail" align="right" class="bg-white text-teal"> <q-card-actions
v-if="!checkDetail"
align="right"
class="bg-white text-teal"
>
<q-btn label="บันทึก" color="secondary" type="submit" <q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn ><q-tooltip>นทกขอม</q-tooltip></q-btn
> >

View file

@ -574,9 +574,15 @@ watch(
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator v-if="competencyType !== 'HEAD' && competencyType !== 'GROUP'"/> <q-separator
v-if="competencyType !== 'HEAD' && competencyType !== 'GROUP'"
/>
<q-card-actions v-if="competencyType !== 'HEAD' && competencyType !== 'GROUP'" align="right" class="bg-white text-teal"> <q-card-actions
v-if="competencyType !== 'HEAD' && competencyType !== 'GROUP'"
align="right"
class="bg-white text-teal"
>
<q-btn label="บันทึก" color="secondary" type="submit" <q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn ><q-tooltip>นทกขอม</q-tooltip></q-btn
> >

View file

@ -53,7 +53,10 @@ watch(
<template> <template>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 85%"> <q-card class="col-12" style="width: 85%">
<DialogHeader :tittle="`พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`" :close="closeDialog" /> <DialogHeader
:tittle="`พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`"
:close="closeDialog"
/>
<q-separator /> <q-separator />
<q-card-section class="q-pa-sm scroll" style="max-height: 80vh"> <q-card-section class="q-pa-sm scroll" style="max-height: 80vh">

View file

@ -10,9 +10,8 @@ const modal = defineModel<boolean>("modal", { required: true });
const rows = defineModel<any>("rows", { required: true }); const rows = defineModel<any>("rows", { required: true });
const dataRows = ref<any[]>([]); const dataRows = ref<any[]>([]);
const visibleColumns = ref<String[]>([ "description"]); const visibleColumns = ref<String[]>(["description"]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "description", name: "description",
align: "left", align: "left",
@ -30,13 +29,15 @@ function closeDialog() {
rows.value = []; rows.value = [];
dataRows.value = []; dataRows.value = [];
} }
</script> </script>
<template> <template>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 85%"> <q-card class="col-12" style="width: 85%">
<DialogHeader :tittle="`ข้อมูลพฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`" :close="closeDialog" /> <DialogHeader
:tittle="`ข้อมูลพฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`"
:close="closeDialog"
/>
<q-separator /> <q-separator />
<q-card-section class="q-pa-sm scroll" style="max-height: 80vh"> <q-card-section class="q-pa-sm scroll" style="max-height: 80vh">

View file

@ -16,7 +16,9 @@ const $q = useQuasar();
const dataList = ref<ListCriteria[]>([]); const dataList = ref<ListCriteria[]>([]);
const { showLoader, hideLoader, messageError } = useCounterMixin(); const { showLoader, hideLoader, messageError } = useCounterMixin();
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", { required: true }); const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", {
required: true,
});
function close() { function close() {
modal.value = false; modal.value = false;
@ -38,9 +40,11 @@ function close() {
</div> </div>
<q-separator /> <q-separator />
<div v-for="(item, index) in dataListCriteria" :key="item.id"> <div v-for="(item, index) in dataListCriteria" :key="item.id">
<div :class="`row q-pa-sm ${index %2 !== 0 && 'bg-grey-2'}`"> <div :class="`row q-pa-sm ${index % 2 !== 0 && 'bg-grey-2'}`">
<div class="col-8"><span v-html="item.description"></span></div> <div class="col-8"><span v-html="item.description"></span></div>
<div class="col-4 text-center self-center text-body1 text-weight-bold"> <div
class="col-4 text-center self-center text-body1 text-weight-bold"
>
<span>{{ item.level }}</span> <span>{{ item.level }}</span>
</div> </div>
</div> </div>

View file

@ -38,7 +38,7 @@ function close() {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.orgPosition+`/${store.dataProfile.profileId}`) .get(config.API.orgPosition + `/${store.dataProfile.profileId}`)
.then((res) => { .then((res) => {
const data = res.data.result.isProbation; const data = res.data.result.isProbation;
work.value = data; work.value = data;

View file

@ -111,8 +111,8 @@ const columns = ref<QTableProps["columns"]>([
const visibleColumns = ref<string[]>( const visibleColumns = ref<string[]>(
store.tabOpen === 3 && store.tabMain === "3" store.tabOpen === 3 && store.tabMain === "3"
? ['no',"name", "develop", "target", "achievement", "summary"] ? ["no", "name", "develop", "target", "achievement", "summary"]
: ['no',"name", "develop", "target"] : ["no", "name", "develop", "target"]
); );
function onAdd() { function onAdd() {

View file

@ -20,4 +20,4 @@ interface ProjectYearOp {
projectName: string; projectName: string;
} }
export type { DataOptions, Pagination, DataOptionTechnique,ProjectYearOp }; export type { DataOptions, Pagination, DataOptionTechnique, ProjectYearOp };

View file

@ -58,7 +58,7 @@ interface FormCommentByRole {
topic: string; topic: string;
reason: string; reason: string;
createdFullName: string; createdFullName: string;
score:string score: string;
reasonEvaluator: string; reasonEvaluator: string;
reasonCommander: string; reasonCommander: string;
reasonCommanderHigh: string; reasonCommanderHigh: string;

View file

@ -4,7 +4,8 @@
const KPIPage = () => import("@/modules/08_KPI/views/main.vue"); const KPIPage = () => import("@/modules/08_KPI/views/main.vue");
const FormPage = () => import("@/modules/08_KPI/views/form.vue"); const FormPage = () => import("@/modules/08_KPI/views/form.vue");
const KPIMainEvaluator = () => import("@/modules/08_KPI/views/mainEvaluator.vue"); const KPIMainEvaluator = () =>
import("@/modules/08_KPI/views/mainEvaluator.vue");
export default [ export default [
{ {

View file

@ -1,8 +1,6 @@
interface DataOptions { interface DataOptions {
id:string id: string;
name:string name: string;
} }
export type { export type { DataOptions };
DataOptions
}

View file

@ -1,132 +1,131 @@
interface FormsSholarship { interface FormsSholarship {
profileId: string; profileId: string;
rank: string; //ยศ rank: string; //ยศ
prefix: string; //คำนำหน้าชื่อ prefix: string; //คำนำหน้าชื่อ
firstName: string; //ชื่อ firstName: string; //ชื่อ
lastName: string; //นามสกุล lastName: string; //นามสกุล
citizenId: string; //เลขประจำตัวประชาชน citizenId: string; //เลขประจำตัวประชาชน
position: string; //ตำแหน่ง position: string; //ตำแหน่ง
posExecutive: string; //ชื่อตำแหน่งทางการบริหาร posExecutive: string; //ชื่อตำแหน่งทางการบริหาร
posLevelId: string | null; //ไอดีระดับตำแหน่ง posLevelId: string | null; //ไอดีระดับตำแหน่ง
posTypeId: string | null; //ไอดีประเภทตำแหน่ง posTypeId: string | null; //ไอดีประเภทตำแหน่ง
org: string; org: string;
rootId: string | null; rootId: string | null;
root: string; root: string;
orgRootShortName: string; orgRootShortName: string;
orgRevisionId: string | null; orgRevisionId: string | null;
guarantorRank: string; //ยศ(ผู้ค้ำ) guarantorRank: string; //ยศ(ผู้ค้ำ)
guarantorPrefix: string; //คำนำหน้าชื่อ(ผู้ค้ำ) guarantorPrefix: string; //คำนำหน้าชื่อ(ผู้ค้ำ)
guarantorFirstName: string; //ชื่อ(ผู้ค้ำ) guarantorFirstName: string; //ชื่อ(ผู้ค้ำ)
guarantorLastName: string; //นามสกุล(ผู้ค้ำ) guarantorLastName: string; //นามสกุล(ผู้ค้ำ)
guarantorCitizenId: string; //เลขประจำตัวประชาชน(ผู้ค้ำ) guarantorCitizenId: string; //เลขประจำตัวประชาชน(ผู้ค้ำ)
guarantorPosition: string; //ตำแหน่ง(ผู้ค้ำ) guarantorPosition: string; //ตำแหน่ง(ผู้ค้ำ)
guarantorPosExecutive: string; //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ) guarantorPosExecutive: string; //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ)
guarantorOrg: string; guarantorOrg: string;
guarantorRootId: string | null; guarantorRootId: string | null;
guarantorRoot: string; guarantorRoot: string;
guarantorOrgRootShortName: string; guarantorOrgRootShortName: string;
guarantorOrgRevisionId: string | null; guarantorOrgRevisionId: string | null;
posLevelguarantorId: string | null; //ไอดีระดับตำแหน่ง(ผู้ค้ำ) posLevelguarantorId: string | null; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posTypeguarantorId: string | null; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ) posTypeguarantorId: string | null; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน
budgetSource: string; //แหล่งงบประมาณ budgetSource: string; //แหล่งงบประมาณ
budgetApprove: number | string | null; //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร budgetApprove: number | string | null; //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร
bookNo: string; //เลขที่หนังสืออนุมัติ bookNo: string; //เลขที่หนังสืออนุมัติ
bookNoDate: Date | null; //ลงวันที่(หนังสือ) bookNoDate: Date | null; //ลงวันที่(หนังสือ)
bookApproveDate: Date | null; //หนังสืออนุมัติเมื่อวันที่ bookApproveDate: Date | null; //หนังสืออนุมัติเมื่อวันที่
useOfficialTime: boolean; //ใช้เวลาราชการ useOfficialTime: boolean; //ใช้เวลาราชการ
changeDetail: string; //เปลี่ยนแปลงรายละเอียด changeDetail: string; //เปลี่ยนแปลงรายละเอียด
scholarshipType: string; //เลือกประเภททุน scholarshipType: string; //เลือกประเภททุน
fundType: string; //ประเภททุน fundType: string; //ประเภททุน
contractNo: string; //เลขที่สัญญา contractNo: string; //เลขที่สัญญา
contractDate: Date | null; //ลงวันที่(เลขที่สัญญา) contractDate: Date | null; //ลงวันที่(เลขที่สัญญา)
reportBackNo: string; //เลขที่หนังสือรายงานตัวกลับ reportBackNo: string; //เลขที่หนังสือรายงานตัวกลับ
reportBackNoDate: Date | null; //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ) reportBackNoDate: Date | null; //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ)
reportBackDate: Date | null; //รายงานตัวกลับวันที่ reportBackDate: Date | null; //รายงานตัวกลับวันที่
degreeLevel: string; //ระดับปริญญา degreeLevel: string; //ระดับปริญญา
course: string; //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม course: string; //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม
field: string; //สาขาวิชา/สาขา field: string; //สาขาวิชา/สาขา
faculty: string; //คณะ faculty: string; //คณะ
educationalInstitution: string; //สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ educationalInstitution: string; //สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ
startDate: Date | null; //วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ startDate: Date | null; //วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ
endDate: Date | null; //วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ endDate: Date | null; //วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ
studyPlace: string; //สถานที่ไปศึกษาดูงาน studyPlace: string; //สถานที่ไปศึกษาดูงาน
studyTopic: string; //หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ studyTopic: string; //หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ
studyStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงาน studyStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงาน
studyEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงาน studyEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงาน
studyCountry: string; //ประเทศที่เดินทางไปศึกษาดูงาน studyCountry: string; //ประเทศที่เดินทางไปศึกษาดูงาน
studyAbroadTopic: string; //หัวข้อการไปศึกษาดูงานต่างประเทศ studyAbroadTopic: string; //หัวข้อการไปศึกษาดูงานต่างประเทศ
studyAbroadStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงานต่างประเทศ studyAbroadStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงานต่างประเทศ
studyAbroadEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงานต่างประเทศ studyAbroadEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงานต่างประเทศ
totalPeriod: string; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม totalPeriod: string; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม
planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ
isNoUseBudget: boolean; // isNoUseBudget: boolean; //
} }
interface DataSholarship {
rank: string; //ยศ
prefix: string; //คำนำหน้าชื่อ
firstName: string; //ชื่อ
lastName: string; //นามสกุล
citizenId: string; //เลขประจำตัวประชาชน
position: string; //ตำแหน่ง
posExecutive: string; //ชื่อตำแหน่งทางการบริหาร
posLevelId: string; //ไอดีระดับตำแหน่ง
posTypeId: string; //ไอดีประเภทตำแหน่ง
posTypeName: string; //ไอดีระดับตำแหน่ง
posLevelName: string; //ไอดีประเภทตำแหน่ง
org: string;
guarantorRank: string; //ยศ(ผู้ค้ำ)
guarantorPrefix: string; //คำนำหน้าชื่อ(ผู้ค้ำ)
guarantorFirstName: string; //ชื่อ(ผู้ค้ำ)
guarantorLastName: string; //นามสกุล(ผู้ค้ำ)
guarantorCitizenId: string; //เลขประจำตัวประชาชน(ผู้ค้ำ)
guarantorPosition: string; //ตำแหน่ง(ผู้ค้ำ)
guarantorPosExecutive: string; //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ)
guarantorOrg: string;
guarantorRootId: string | null;
guarantorRoot: string;
guarantorOrgRootShortName: string;
guarantorOrgRevisionId: string | null;
posLevelguarantorId: string; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posTypeguarantorId: string; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
posTypeguarantorName: string; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posLevelguarantorName: string; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน
budgetSource: string; //แหล่งงบประมาณ
budgetApprove: number | null; //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร
bookNo: string; //เลขที่หนังสืออนุมัติ
bookNoDate: Date | null; //ลงวันที่(หนังสือ)
bookApproveDate: Date | null; //หนังสืออนุมัติเมื่อวันที่
useOfficialTime: boolean; //ใช้เวลาราชการ
changeDetail: string; //เปลี่ยนแปลงรายละเอียด
scholarshipType: string; //เลือกประเภททุน
fundType: string; //ประเภททุน
contractNo: string; //เลขที่สัญญา
contractDate: Date | null; //ลงวันที่(เลขที่สัญญา)
reportBackNo: string; //เลขที่หนังสือรายงานตัวกลับ
reportBackNoDate: Date | null; //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ)
reportBackDate: Date | null; //รายงานตัวกลับวันที่
degreeLevel: string; //ระดับปริญญา
course: string; //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม
field: string; //สาขาวิชา/สาขา
faculty: string; //คณะ
educationalInstitution: string; //สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ
startDate: Date | null; //วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ
endDate: Date | null; //วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ
studyPlace: string; //สถานที่ไปศึกษาดูงาน
studyTopic: string; //หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ
studyStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงาน
studyEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงาน
studyCountry: string; //ประเทศที่เดินทางไปศึกษาดูงาน
studyAbroadTopic: string; //หัวข้อการไปศึกษาดูงานต่างประเทศ
studyAbroadStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงานต่างประเทศ
studyAbroadEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงานต่างประเทศ
totalPeriod: string; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม
status: string;
planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ
isNoUseBudget: boolean; // ไม่ใช้งบประมาณ
}
export type { FormsSholarship,DataSholarship }; interface DataSholarship {
rank: string; //ยศ
prefix: string; //คำนำหน้าชื่อ
firstName: string; //ชื่อ
lastName: string; //นามสกุล
citizenId: string; //เลขประจำตัวประชาชน
position: string; //ตำแหน่ง
posExecutive: string; //ชื่อตำแหน่งทางการบริหาร
posLevelId: string; //ไอดีระดับตำแหน่ง
posTypeId: string; //ไอดีประเภทตำแหน่ง
posTypeName: string; //ไอดีระดับตำแหน่ง
posLevelName: string; //ไอดีประเภทตำแหน่ง
org: string;
guarantorRank: string; //ยศ(ผู้ค้ำ)
guarantorPrefix: string; //คำนำหน้าชื่อ(ผู้ค้ำ)
guarantorFirstName: string; //ชื่อ(ผู้ค้ำ)
guarantorLastName: string; //นามสกุล(ผู้ค้ำ)
guarantorCitizenId: string; //เลขประจำตัวประชาชน(ผู้ค้ำ)
guarantorPosition: string; //ตำแหน่ง(ผู้ค้ำ)
guarantorPosExecutive: string; //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ)
guarantorOrg: string;
guarantorRootId: string | null;
guarantorRoot: string;
guarantorOrgRootShortName: string;
guarantorOrgRevisionId: string | null;
posLevelguarantorId: string; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posTypeguarantorId: string; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
posTypeguarantorName: string; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posLevelguarantorName: string; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน
budgetSource: string; //แหล่งงบประมาณ
budgetApprove: number | null; //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร
bookNo: string; //เลขที่หนังสืออนุมัติ
bookNoDate: Date | null; //ลงวันที่(หนังสือ)
bookApproveDate: Date | null; //หนังสืออนุมัติเมื่อวันที่
useOfficialTime: boolean; //ใช้เวลาราชการ
changeDetail: string; //เปลี่ยนแปลงรายละเอียด
scholarshipType: string; //เลือกประเภททุน
fundType: string; //ประเภททุน
contractNo: string; //เลขที่สัญญา
contractDate: Date | null; //ลงวันที่(เลขที่สัญญา)
reportBackNo: string; //เลขที่หนังสือรายงานตัวกลับ
reportBackNoDate: Date | null; //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ)
reportBackDate: Date | null; //รายงานตัวกลับวันที่
degreeLevel: string; //ระดับปริญญา
course: string; //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม
field: string; //สาขาวิชา/สาขา
faculty: string; //คณะ
educationalInstitution: string; //สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ
startDate: Date | null; //วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ
endDate: Date | null; //วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ
studyPlace: string; //สถานที่ไปศึกษาดูงาน
studyTopic: string; //หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ
studyStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงาน
studyEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงาน
studyCountry: string; //ประเทศที่เดินทางไปศึกษาดูงาน
studyAbroadTopic: string; //หัวข้อการไปศึกษาดูงานต่างประเทศ
studyAbroadStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงานต่างประเทศ
studyAbroadEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงานต่างประเทศ
totalPeriod: string; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม
status: string;
planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ
isNoUseBudget: boolean; // ไม่ใช้งบประมาณ
}
export type { FormsSholarship, DataSholarship };

View file

@ -3,7 +3,8 @@
*/ */
const scholarshipPage = () => import("@/modules/09_scholarship/views/main.vue"); const scholarshipPage = () => import("@/modules/09_scholarship/views/main.vue");
const scholarshipDetail = () => import('@/modules/09_scholarship/views/detail.vue') const scholarshipDetail = () =>
import("@/modules/09_scholarship/views/detail.vue");
export default [ export default [
{ {
path: "/scholarship", path: "/scholarship",

View file

@ -10,4 +10,4 @@ interface NewPagination {
sortBy: string; sortBy: string;
} }
export type { DataOption,NewPagination }; export type { DataOption, NewPagination };

View file

@ -13,7 +13,8 @@ const registryOther = () => import("@/modules/10_registry/tabs/05_other.vue");
/** /**
* *
*/ */
const requestEditMain = () => import("@/modules/10_registry/views/requestEditMain.vue"); const requestEditMain = () =>
import("@/modules/10_registry/views/requestEditMain.vue");
export default [ export default [
{ {

View file

@ -1,14 +1,15 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import type { DataOptionInsignia, ResponseObject } from '@/modules/10_registry/interface/index/Achievement' import type {
DataOptionInsignia,
ResponseObject,
} from "@/modules/10_registry/interface/index/Achievement";
import { ref } from "vue"; import { ref } from "vue";
export const useRegistryInFormationStore = defineStore( export const useRegistryInFormationStore = defineStore(
"registryInFormationStore", "registryInFormationStore",
() => { () => {
const typeProfile = ref<string>("OFFICER"); const typeProfile = ref<string>("OFFICER");
const profileId = ref<string>('') const profileId = ref<string>("");
function typeChangeName(val: string) { function typeChangeName(val: string) {
switch (val) { switch (val) {
@ -28,6 +29,6 @@ export const useRegistryInFormationStore = defineStore(
return "-"; return "-";
} }
} }
return { typeChangeName, typeProfile,profileId}; return { typeChangeName, typeProfile, profileId };
} }
); );

View file

@ -10,7 +10,6 @@ import Educations from "@/modules/10_registry/01_Information/05_Educations.vue";
import Ability from "@/modules/10_registry/01_Information/06_Ability.vue"; import Ability from "@/modules/10_registry/01_Information/06_Ability.vue";
const router = useRouter(); const router = useRouter();
</script> </script>
<template> <template>
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11"> <div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">

View file

@ -7,9 +7,7 @@ import Discipline from "@/modules/10_registry/02_Government/02_Discipline.vue";
import Leave from "@/modules/10_registry/02_Government/03_Leave.vue"; import Leave from "@/modules/10_registry/02_Government/03_Leave.vue";
import Duty from "@/modules/10_registry/02_Government/04_Duty.vue"; import Duty from "@/modules/10_registry/02_Government/04_Duty.vue";
const router = useRouter(); const router = useRouter();
</script> </script>
<template> <template>
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11"> <div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">

View file

@ -5,9 +5,7 @@ import { useRouter } from "vue-router";
import Salary from "@/modules/10_registry/03_Salary/01_Salary.vue"; import Salary from "@/modules/10_registry/03_Salary/01_Salary.vue";
import Nopaid from "@/modules/10_registry/03_Salary/02_Nopaid.vue"; import Nopaid from "@/modules/10_registry/03_Salary/02_Nopaid.vue";
const router = useRouter(); const router = useRouter();
</script> </script>
<template> <template>
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11"> <div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">
@ -29,7 +27,6 @@ const router = useRouter();
<div :class="`row q-my-sm ${$q.screen.gt.xs ? '' : 'mobileClass'}`"> <div :class="`row q-my-sm ${$q.screen.gt.xs ? '' : 'mobileClass'}`">
<Salary /> <Salary />
<Nopaid /> <Nopaid />
</div> </div>
</template> </template>
<style scoped> <style scoped>

View file

@ -5,7 +5,6 @@ import { useRouter } from "vue-router";
import Other from "@/modules/10_registry/05_Other/01_Other.vue"; import Other from "@/modules/10_registry/05_Other/01_Other.vue";
import File from "@/modules/10_registry/05_Other/02_File.vue"; import File from "@/modules/10_registry/05_Other/02_File.vue";
const router = useRouter(); const router = useRouter();
</script> </script>
<template> <template>

View file

@ -345,7 +345,7 @@ onMounted(() => {
<q-tooltip>นคำรองขอแกไขขอม</q-tooltip> <q-tooltip>นคำรองขอแกไขขอม</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<q-space v-if="$q.screen.gt.sm"/> <q-space v-if="$q.screen.gt.sm" />
<div class="col-xs-12 col-md-2"> <div class="col-xs-12 col-md-2">
<q-input <q-input
v-model="keyword" v-model="keyword"
@ -358,20 +358,20 @@ onMounted(() => {
</q-input> </q-input>
</div> </div>
<div class="col-xs-12 col-md-2"> <div class="col-xs-12 col-md-2">
<q-select <q-select
v-model="visibleColumns" v-model="visibleColumns"
multiple multiple
outlined outlined
dense dense
options-dense options-dense
:display-value="$q.lang.table.columns" :display-value="$q.lang.table.columns"
emit-value emit-value
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
options-cover options-cover
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12">

View file

@ -24,7 +24,15 @@ const knowledge = ref<any[]>([]);
const commander = ref<any>(""); const commander = ref<any>("");
const chairman = ref<any>(""); const chairman = ref<any>("");
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { date2Thai, dateToISO, hideLoader, messageError,dialogConfirm,showLoader ,success} = mixin; const {
date2Thai,
dateToISO,
hideLoader,
messageError,
dialogConfirm,
showLoader,
success,
} = mixin;
const date_start = ref<Date>(); const date_start = ref<Date>();
const group = ref<any | null>(null); const group = ref<any | null>(null);
const group2 = ref<any | null>(null); const group2 = ref<any | null>(null);
@ -619,7 +627,7 @@ function filterFnChairman(val: string, update: any) {
* pop up confirm * pop up confirm
* @param id personal id * @param id personal id
*/ */
function saveEdit(id: string) { function saveEdit(id: string) {
dialogConfirm($q, async () => await dataEdit(id)); dialogConfirm($q, async () => await dataEdit(id));
} }
@ -627,39 +635,38 @@ function filterFnChairman(val: string, update: any) {
* เชคขอมลกอนบนท * เชคขอมลกอนบนท
* @param id personal id * @param id personal id
*/ */
async function saveData(id: string) { async function saveData(id: string) {
dialogConfirm($q, async () => await DataSave(id)); dialogConfirm($q, async () => await DataSave(id));
} }
/** /**
* update edit * update edit
* @param id personal id * @param id personal id
*/ */
async function dataEdit(id: string) { async function dataEdit(id: string) {
// await myForm.value.validate().then((result: boolean) => { // await myForm.value.validate().then((result: boolean) => {
// if (result) { // if (result) {
showLoader(); showLoader();
const data = putDataEdit(id); const data = putDataEdit(id);
http http
.put(config.API.saveEditAssign(id), data) .put(config.API.saveEditAssign(id), data)
.then(() => {}) .then(() => {})
.catch(() => {}) .catch(() => {})
.finally(async () => { .finally(async () => {
editStatus.value = false; editStatus.value = false;
getAssign(); getAssign();
hideLoader(); hideLoader();
}); });
// } else { // } else {
// dialogMessageNotify($q, ""); // dialogMessageNotify($q, "");
// } // }
// }); // });
} }
/** /**
* @param id personal * @param id personal
*/ */
function putDataEdit(id: string) { function putDataEdit(id: string) {
const GUID = profileId.value; const GUID = profileId.value;
const assign_job = activityArray.value.map((item, index) => { const assign_job = activityArray.value.map((item, index) => {
const activityDesc = activity_desc.value[index]?.trim(); const activityDesc = activity_desc.value[index]?.trim();
@ -811,7 +818,7 @@ function filterFnChairman(val: string, update: any) {
/** /**
* @param id personal * @param id personal
*/ */
function putData(id: string) { function putData(id: string) {
const GUID = profileId.value; const GUID = profileId.value;
const assign_job = activityArray.value.map((item, index) => { const assign_job = activityArray.value.map((item, index) => {
const activityDesc = activity_desc.value[index]?.trim(); const activityDesc = activity_desc.value[index]?.trim();
@ -949,7 +956,7 @@ function filterFnChairman(val: string, update: any) {
* นท * นท
* @param id personal id * @param id personal id
*/ */
async function DataSave(id: string) { async function DataSave(id: string) {
const data = putData(id); const data = putData(id);
await http await http
.post(config.API.saveFinish(id), data) .post(config.API.saveFinish(id), data)
@ -969,7 +976,7 @@ function filterFnChairman(val: string, update: any) {
* download file * download file
* @param type type file * @param type type file
*/ */
async function clickdownloadFile(type: string) { async function clickdownloadFile(type: string) {
showLoader(); showLoader();
await http await http
.get(config.API.reportAssign(type, id.value), { .get(config.API.reportAssign(type, id.value), {
@ -994,7 +1001,7 @@ function filterFnChairman(val: string, update: any) {
* @param response ไฟล * @param response ไฟล
* @param filename อไฟล * @param filename อไฟล
*/ */
function downloadFile(response: any, filename: string) { function downloadFile(response: any, filename: string) {
const link = document.createElement("a"); const link = document.createElement("a");
var fileName = filename; var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data])); link.href = window.URL.createObjectURL(new Blob([response.data]));
@ -1005,7 +1012,7 @@ function filterFnChairman(val: string, update: any) {
} }
onMounted(async () => { onMounted(async () => {
await showLoader() await showLoader();
await getUser(); await getUser();
await getAssignNew(profileId.value); await getAssignNew(profileId.value);
await getLaw(profileId.value); await getLaw(profileId.value);
@ -1016,7 +1023,7 @@ onMounted(async () => {
if (id.value !== undefined) { if (id.value !== undefined) {
await getAssign(); await getAssign();
} }
await hideLoader() await hideLoader();
}); });
</script> </script>
<template> <template>
@ -1038,7 +1045,11 @@ onMounted(async () => {
<div>แบบมอบหมายงาน </div> <div>แบบมอบหมายงาน </div>
</div> </div>
</div> </div>
<q-form greedy @submit.prevent @validation-success="id !== undefined ? saveEdit(id) : saveData(profileId)"> <q-form
greedy
@submit.prevent
@validation-success="id !== undefined ? saveEdit(id) : saveData(profileId)"
>
<div <div
:class=" :class="
$q.screen.gt.xs $q.screen.gt.xs
@ -1090,25 +1101,14 @@ onMounted(async () => {
</q-list> </q-list>
</q-menu> </q-menu>
</q-btn> </q-btn>
<q-btn <q-btn flat icon="edit" dense color="edit" round @click="edit">
flat <q-tooltip>แกไขขอม</q-tooltip></q-btn
icon="edit"
dense
color="edit"
round
@click="edit"
> >
<q-tooltip>แกไขขอม</q-tooltip></q-btn>
</div> </div>
<div v-else> <div v-else>
<q-btn <q-btn flat icon="mdi-undo" dense color="red" round @click="cancel"
flat ><q-tooltip>ยกเล</q-tooltip></q-btn
icon="mdi-undo" >
dense
color="red"
round
@click="cancel"
><q-tooltip>ยกเล</q-tooltip></q-btn>
<q-btn <q-btn
flat flat
icon="mdi-content-save-outline" icon="mdi-content-save-outline"
@ -1116,7 +1116,8 @@ onMounted(async () => {
color="public" color="public"
round round
type="submit" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn> ><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</div> </div>
</div> </div>
@ -2810,7 +2811,11 @@ onMounted(async () => {
</div> </div>
</div> </div>
</div> </div>
<div v-if="routeName == 'probationAdd'" class="full-width" align="right"> <div
v-if="routeName == 'probationAdd'"
class="full-width"
align="right"
>
<q-btn label="บันทึก" color="secondary" type="submit" <q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn ><q-tooltip>นทกขอม</q-tooltip></q-btn
> >

View file

@ -85,14 +85,12 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div v-else> <div v-else>
<ResultPage
<ResultPage :fullname="fullname"
:fullname="fullname" v-model:dataArrayNumber="dataArrayNumber"
v-model:dataArrayNumber="dataArrayNumber" :fecthAssign="fecthAssign"
:fecthAssign="fecthAssign" :data="evaluate.find((x: any) => x.no === dataArrayNumber)"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)" />
/>
</div> </div>
</div> </div>
</template> </template>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { ref,defineAsyncComponent,onMounted } from "vue"; import { ref, defineAsyncComponent, onMounted } from "vue";
import { useProbationStore } from "@/modules/11_probation/store/probation"; import { useProbationStore } from "@/modules/11_probation/store/probation";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
@ -9,12 +9,11 @@ import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin; const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
const Evaluacommander = defineAsyncComponent( const Evaluacommander = defineAsyncComponent(
() => import("@/modules/11_probation/component/editPage/02_evaluacommander.vue") () =>
import("@/modules/11_probation/component/editPage/02_evaluacommander.vue")
); );
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@ -28,16 +27,17 @@ const store = useProbationStore();
const $q = useQuasar(); const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs); const mode = ref<any>($q.screen.gt.xs);
function addData() { function addData() {
router.push(`/probation/detail/addevaluacommander/${profileId.value}/${id.value}`); router.push(
`/probation/detail/addevaluacommander/${profileId.value}/${id.value}`
);
} }
/** /**
* get data * get data
* @param id person id * @param id person id
*/ */
async function fecthAssign(id: string){ async function fecthAssign(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.formevaluateCommander(id)) .get(config.API.formevaluateCommander(id))
@ -54,15 +54,14 @@ function addData() {
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
}; }
onMounted(async () => { onMounted(async () => {
await fecthAssign(id.value); await fecthAssign(id.value);
}); });
</script> </script>
<template> <template>
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11"> <div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center"> <div class="toptitle text-white col-12 row items-center">
<q-btn <q-btn
icon="mdi-arrow-left" icon="mdi-arrow-left"
@ -89,11 +88,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div v-else> <div v-else>
<Evaluacommander />
<Evaluacommander
/>
</div> </div>
</div> </div>
</template> </template>
@ -102,4 +97,4 @@ onMounted(async () => {
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
} }
</style> </style>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { ref,defineAsyncComponent } from "vue"; import { ref, defineAsyncComponent } from "vue";
import { useProbationStore } from "@/modules/11_probation/store/probation"; import { useProbationStore } from "@/modules/11_probation/store/probation";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
@ -22,10 +22,9 @@ const mode = ref<any>($q.screen.gt.xs);
function addData() { function addData() {
router.push(`/probation/detail/addevalua/${profileId.value}/${id.value}`); router.push(`/probation/detail/addevalua/${profileId.value}/${id.value}`);
} }
</script> </script>
<template> <template>
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11"> <div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center"> <div class="toptitle text-white col-12 row items-center">
<q-btn <q-btn
icon="mdi-arrow-left" icon="mdi-arrow-left"
@ -52,11 +51,7 @@ function addData() {
</div> </div>
</div> </div>
<div v-else> <div v-else>
<Evalua />
<Evalua
/>
</div> </div>
</div> </div>
</template> </template>
@ -65,4 +60,4 @@ function addData() {
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
} }
</style> </style>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { ref,defineAsyncComponent } from "vue"; import { ref, defineAsyncComponent } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useProbationStore } from "@/modules/11_probation/store/probation"; import { useProbationStore } from "@/modules/11_probation/store/probation";
@ -19,11 +19,13 @@ const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs); const mode = ref<any>($q.screen.gt.xs);
function addData() { function addData() {
router.push(`/probation/detail/addevaluascore/${profileId.value}/${id.value}`); router.push(
`/probation/detail/addevaluascore/${profileId.value}/${id.value}`
);
} }
</script> </script>
<template> <template>
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11"> <div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center"> <div class="toptitle text-white col-12 row items-center">
<q-btn <q-btn
icon="mdi-arrow-left" icon="mdi-arrow-left"
@ -50,10 +52,7 @@ function addData() {
</div> </div>
</div> </div>
<div v-else> <div v-else>
<Evaluascore />
<Evaluascore
/>
</div> </div>
</div> </div>
</template> </template>
@ -62,4 +61,4 @@ function addData() {
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
} }
</style> </style>

View file

@ -64,11 +64,10 @@ function onSubmit() {
dialogConfirm($q, async () => await postData("post")); dialogConfirm($q, async () => await postData("post"));
} }
/** post/put data /** post/put data
* @param action post put * @param action post put
*/ */
async function postData(action: string) { async function postData(action: string) {
const data = await { const data = await {
start_date: date_start.value, start_date: date_start.value,
date_finish: date_finish.value, date_finish: date_finish.value,
@ -170,7 +169,7 @@ async function fecthAssign(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.evaluateReportcreate(id)) .get(config.API.evaluateReportcreate(id))
.then(async(res) => { .then(async (res) => {
assign.value = res.data.data.assign; assign.value = res.data.data.assign;
person.value = res.data.data.person; person.value = res.data.data.person;
mentors.value = res.data.data.mentors; mentors.value = res.data.data.mentors;
@ -259,7 +258,7 @@ onMounted(async () => {
<div>แบบรายงานการประเม </div> <div>แบบรายงานการประเม </div>
</div> </div>
</div> </div>
<div :class="`${$q.screen.gt.xs ? '' : 'mobileClass'}`"> <div :class="`${$q.screen.gt.xs ? '' : 'mobileClass'}`">
<div class="col-12"> <div class="col-12">
<span class="toptitle text-dark">แบบรายงานการประเมนฯ</span> <span class="toptitle text-dark">แบบรายงานการประเมนฯ</span>
@ -527,7 +526,9 @@ onMounted(async () => {
lazy-rules lazy-rules
label="ความเห็นของผู้มีอํานาจสั่งบรรจุตามมาตรา 52" label="ความเห็นของผู้มีอํานาจสั่งบรรจุตามมาตรา 52"
:rules="[ :rules="[
(val) => (!!val && val.length > 0) || 'กรุณาความเห็นของผู้มีอํานาจสั่งบรรจุตามมาตรา 52', (val) =>
(!!val && val.length > 0) ||
'กรุณาความเห็นของผู้มีอํานาจสั่งบรรจุตามมาตรา 52',
]" ]"
/> />
</div> </div>
@ -714,13 +715,12 @@ onMounted(async () => {
</div> </div>
</div> </div>
</div> </div>
<div class="col-12" align="right" v-if="action == 'add'">
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</div> <div class="col-12" align="right" v-if="action == 'add'">
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</div>
</div> </div>
</q-form> </q-form>
</div> </div>

View file

@ -16,7 +16,7 @@ const route = useRoute();
const status = ref<boolean>(false); const status = ref<boolean>(false);
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, dialogConfirm,success } = mixin; const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
const id = ref<string>(route.params.id as string); const id = ref<string>(route.params.id as string);
const $q = useQuasar(); const $q = useQuasar();
const mode = ref<any>($q.screen.gt.xs); const mode = ref<any>($q.screen.gt.xs);
@ -38,12 +38,12 @@ function onSubmit() {
}) })
.then((res) => { .then((res) => {
success($q, "บันทึกสำเร็จ"); success($q, "บันทึกสำเร็จ");
getData() getData();
}).catch((e)=>{
messageError($q,e)
}).finally(()=>{
}) })
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
}); });
} }
} }
@ -228,7 +228,7 @@ onMounted(() => {
<q-separator size="3px" color="grey-2" /> <q-separator size="3px" color="grey-2" />
</div> </div>
<Criterion /> <Criterion />
<div class="col-12" align="right"> <div class="col-12" align="right">
<q-btn label="บันทึก" color="secondary" type="submit" v-if="!status" <q-btn label="บันทึก" color="secondary" type="submit" v-if="!status"

View file

@ -128,7 +128,7 @@
<div v-else class="col-12"> <div v-else class="col-12">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-12">
<q-card bordered style="border-radius: 20px;"> <q-card bordered style="border-radius: 20px">
<div class="q-pa-sm text-center bg-blue-1"> <div class="q-pa-sm text-center bg-blue-1">
<span class="text-weight-medium"> <span class="text-weight-medium">
<i <i
@ -141,7 +141,7 @@
</div> </div>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none"> <q-card-section class="q-pa-none">
<q-list > <q-list>
<q-item class="q-pa-none text-center"> <q-item class="q-pa-none text-center">
<q-item-section> <q-item-section>
<q-item-label>ำกวาความคาดหวงมาก</q-item-label> <q-item-label>ำกวาความคาดหวงมาก</q-item-label>
@ -156,26 +156,26 @@
</q-card> </q-card>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-card bordered style="border-radius: 20px;"> <q-card bordered style="border-radius: 20px">
<div class="q-pa-sm text-center bg-blue-1"> <div class="q-pa-sm text-center bg-blue-1">
<span class="text-weight-medium"> <span class="text-weight-medium">
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
></span ></span
> >
</div> </div>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none"> <q-card-section class="q-pa-none">
<q-list > <q-list>
<q-item class="q-pa-none text-center"> <q-item class="q-pa-none text-center">
<q-item-section> <q-item-section>
<q-item-label>ำกวาความคาดหวงคอนขางมาก</q-item-label> <q-item-label>ำกวาความคาดหวงคอนขางมาก</q-item-label>
@ -190,32 +190,32 @@
</q-card> </q-card>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-card bordered style="border-radius: 20px;"> <q-card bordered style="border-radius: 20px">
<div class="q-pa-sm text-center bg-blue-1"> <div class="q-pa-sm text-center bg-blue-1">
<span class="text-weight-medium"> <span class="text-weight-medium">
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
></span ></span
> >
</div> </div>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none"> <q-card-section class="q-pa-none">
<q-list > <q-list>
<q-item class="q-pa-none text-center"> <q-item class="q-pa-none text-center">
<q-item-section> <q-item-section>
<q-item-label>เปนไปตามความคาดหว</q-item-label> <q-item-label>เปนไปตามความคาดหว</q-item-label>
@ -230,38 +230,38 @@
</q-card> </q-card>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-card bordered style="border-radius: 20px;"> <q-card bordered style="border-radius: 20px">
<div class="q-pa-sm text-center bg-blue-1"> <div class="q-pa-sm text-center bg-blue-1">
<span class="text-weight-medium"> <span class="text-weight-medium">
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
></span ></span
> >
</div> </div>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none"> <q-card-section class="q-pa-none">
<q-list > <q-list>
<q-item class="q-pa-none text-center"> <q-item class="q-pa-none text-center">
<q-item-section> <q-item-section>
<q-item-label>งวาความคาดหวงคอนขางมาก</q-item-label> <q-item-label>งวาความคาดหวงคอนขางมาก</q-item-label>
@ -276,44 +276,44 @@
</q-card> </q-card>
</div> </div>
<div class="col-12"> <div class="col-12">
<q-card bordered style="border-radius: 20px;"> <q-card bordered style="border-radius: 20px">
<div class="q-pa-sm text-center bg-blue-1"> <div class="q-pa-sm text-center bg-blue-1">
<span class="text-weight-medium"> <span class="text-weight-medium">
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
> >
<i <i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-10" class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-10"
aria-hidden="true" aria-hidden="true"
role="presentation" role="presentation"
>grade</i >grade</i
></span ></span
> >
</div> </div>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none"> <q-card-section class="q-pa-none">
<q-list > <q-list>
<q-item class="q-pa-none text-center"> <q-item class="q-pa-none text-center">
<q-item-section> <q-item-section>
<q-item-label>งกวาความคาดหวงมาก</q-item-label> <q-item-label>งกวาความคาดหวงมาก</q-item-label>

View file

@ -29,22 +29,22 @@ const props = defineProps({
}); });
/** เรียกใช้ฟังชั่นจากหน้าหลัก */ /** เรียกใช้ฟังชั่นจากหน้าหลัก */
function downloadFile(type: string){ function downloadFile(type: string) {
props.FileDownload(type); props.FileDownload(type);
}; }
watch(tabHead, () => { watch(tabHead, () => {
props.changeTab(tabHead.value); props.changeTab(tabHead.value);
}); });
/** ไปยัง step ต่อไป */ /** ไปยัง step ต่อไป */
function nextPage(){ function nextPage() {
if (props.loop !== undefined) { if (props.loop !== undefined) {
if (props.loop < 3) { if (props.loop < 3) {
props.addData(); props.addData();
} }
} }
}; }
</script> </script>
<template> <template>

View file

@ -2052,7 +2052,10 @@ onMounted(async () => {
</q-item> </q-item>
</q-list> </q-list>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-list dense :class="[getBordered(alerts[11].value), 'item-custom']"> <q-list
dense
:class="[getBordered(alerts[11].value), 'item-custom']"
>
<q-item dense> <q-item dense>
<q-item-section> <q-item-section>
<q-item-label>2. การเรยนรวยตนเอง</q-item-label> <q-item-label>2. การเรยนรวยตนเอง</q-item-label>
@ -2088,7 +2091,10 @@ onMounted(async () => {
</q-item> </q-item>
</q-list> </q-list>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-list dense :class="[getBordered(alerts[11].value), 'item-custom']"> <q-list
dense
:class="[getBordered(alerts[11].value), 'item-custom']"
>
<q-item dense> <q-item dense>
<q-item-section> <q-item-section>
<q-item-label>3. การอบรมสมนารวมก</q-item-label> <q-item-label>3. การอบรมสมนารวมก</q-item-label>

View file

@ -1465,7 +1465,7 @@ onMounted(async () => {
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-item <q-item
dense dense
@ -1552,9 +1552,7 @@ onMounted(async () => {
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
<div v-else class=""> <div v-else class=""></div>
</div>
<q-list dense> <q-list dense>
<q-item <q-item
dense dense
@ -1584,7 +1582,7 @@ onMounted(async () => {
</div> </div>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<q-item <q-item
dense dense
@ -1711,7 +1709,7 @@ onMounted(async () => {
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
class="full-width datepicker col-3" class="full-width datepicker col-3"

View file

@ -1,3 +1 @@
<template> <template>03</template>
03
</template>

View file

@ -1,3 +1 @@
<template> <template>04</template>
04
</template>

View file

@ -614,7 +614,8 @@ onMounted(async () => {
<div class="row text-weight-medium"> <div class="row text-weight-medium">
<div class="col-12 text-grey-7 text-bold"> <div class="col-12 text-grey-7 text-bold">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" /> <q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
ทดลองปฏหนาทราชการ {{ store.person.name ? store.person.name : "-" }} ทดลองปฏหนาทราชการ
{{ store.person.name ? store.person.name : "-" }}
</div> </div>
<div class="col-12"> <div class="col-12">
<span class="text-grey-7 text-weight-bold q-pl-lg" <span class="text-grey-7 text-weight-bold q-pl-lg"
@ -624,7 +625,9 @@ onMounted(async () => {
</div> </div>
<div class="col-12"> <div class="col-12">
<span class="text-grey-7 text-weight-bold q-pl-lg">ระดบตำแหน</span> <span class="text-grey-7 text-weight-bold q-pl-lg">ระดบตำแหน</span>
{{ store.person.positionLevelName ? store.person.positionLevelName : "-" }} {{
store.person.positionLevelName ? store.person.positionLevelName : "-"
}}
</div> </div>
<div class="col-12"> <div class="col-12">
<span class="text-grey-7 text-weight-bold q-pl-lg">งก</span> <span class="text-grey-7 text-weight-bold q-pl-lg">งก</span>

View file

@ -1,3 +1 @@
<template> <template>02</template>
02
</template>

View file

@ -1,3 +1 @@
<template> <template>03</template>
03
</template>

View file

@ -1,3 +1 @@
<template> <template>04</template>
04
</template>

View file

@ -1,13 +1,11 @@
interface ListMain { interface ListMain {
id: string id: string;
round_no: number; round_no: number;
date_start: string date_start: string;
date_finish: string date_finish: string;
mentors: string mentors: string;
commander: string commander: string;
chairman: string chairman: string;
} }
export type { export type { ListMain };
ListMain
}

View file

@ -2,11 +2,9 @@
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
/** component */ /** component */
import Assign from '@/modules/11_probation/component/01_Assign.vue' import Assign from "@/modules/11_probation/component/01_Assign.vue";
const router = useRouter(); const router = useRouter();
</script> </script>
<template> <template>
<div class="col-xs-12 col-sm-12 col-md-11"> <div class="col-xs-12 col-sm-12 col-md-11">
@ -24,10 +22,9 @@ const router = useRouter();
<div>เพมแบบมอบหมายงานการทดลองปฏหนาทราชการ</div> <div>เพมแบบมอบหมายงานการทดลองปฏหนาทราชการ</div>
</div> </div>
</div> </div>
<q-card class="q-pa-md"> <q-card class="q-pa-md">
<Assign/> <Assign />
</q-card> </q-card>
</template> </template>
<style scoped> <style scoped>
.mobileClass { .mobileClass {
@ -35,7 +32,4 @@ const router = useRouter();
border-radius: 10px; border-radius: 10px;
padding: 10px; padding: 10px;
} }
</style> </style>

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref,onMounted } from "vue"; import { ref, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useProbationStore } from "@/modules/11_probation/store/probation"; import { useProbationStore } from "@/modules/11_probation/store/probation";
@ -12,15 +12,14 @@ import EvaluateResult from "@/modules/11_probation/component/06_EvaluateResult.v
import EvaluateReport from "@/modules/11_probation/component/07_EvaluateReport.vue"; import EvaluateReport from "@/modules/11_probation/component/07_EvaluateReport.vue";
import SurveyComment from "@/modules/11_probation/component/08_SurveyComment.vue"; import SurveyComment from "@/modules/11_probation/component/08_SurveyComment.vue";
const drawer = ref<boolean>(true); const drawer = ref<boolean>(true);
const activeTab = ref<string>("tab1"); const activeTab = ref<string>("tab1");
const store = useProbationStore(); const store = useProbationStore();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id as string) const id = ref<string>(route.params.id as string);
const profileId = ref<string>(route.params.profileId as string) const profileId = ref<string>(route.params.profileId as string);
/** /**
* เปลยน tab เมน * เปลยน tab เมน
@ -36,10 +35,10 @@ function onMobile(type: string) {
} }
/** ปุ่มกลับ */ /** ปุ่มกลับ */
function clickBack(){ function clickBack() {
router.push(`/probation`); router.push(`/probation`);
store.mainTab = "tab1"; store.mainTab = "tab1";
}; }
/** เมื่อเริ่มโหลดหน้า ให้ tab เป็น tab1 */ /** เมื่อเริ่มโหลดหน้า ให้ tab เป็น tab1 */
onMounted(() => { onMounted(() => {
@ -64,7 +63,7 @@ onMounted(() => {
<div>การทดลองปฏหนาทราชการ</div> <div>การทดลองปฏหนาทราชการ</div>
</div> </div>
</div> </div>
<q-card bordered :class='!$q.screen.gt.xs ? `borderRadius`:``'> <q-card bordered :class="!$q.screen.gt.xs ? `borderRadius` : ``">
<q-layout <q-layout
v-if="$q.screen.gt.xs" v-if="$q.screen.gt.xs"
view="hHh Lpr lff" view="hHh Lpr lff"
@ -226,13 +225,17 @@ onMounted(() => {
<q-tab-panel name="tab8"> <q-tab-panel name="tab8">
<SurveyComment /> <SurveyComment />
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</q-layout> </q-layout>
</q-page-container> </q-page-container>
</q-layout> </q-layout>
<q-list v-else separator> <q-list v-else separator>
<q-item clickable v-ripple @click="onMobile('assign-work')" style="border-radius: 20px 20px 0 0;"> <q-item
clickable
v-ripple
@click="onMobile('assign-work')"
style="border-radius: 20px 20px 0 0"
>
<q-item-section>แบบมอบหมายงาน </q-item-section> <q-item-section>แบบมอบหมายงาน </q-item-section>
<q-item-section avatar> <q-item-section avatar>
<q-avatar text-color="info" icon="mdi-chevron-right" /> <q-avatar text-color="info" icon="mdi-chevron-right" />
@ -286,7 +289,12 @@ onMounted(() => {
<q-avatar text-color="info" icon="mdi-chevron-right" /> <q-avatar text-color="info" icon="mdi-chevron-right" />
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item clickable v-ripple @click="onMobile('survey-comment')" style="border-radius: 0 0 20px 20px;"> <q-item
clickable
v-ripple
@click="onMobile('survey-comment')"
style="border-radius: 0 0 20px 20px"
>
<q-item-section>แบบสารวจความคดเห</q-item-section> <q-item-section>แบบสารวจความคดเห</q-item-section>
<q-item-section avatar> <q-item-section avatar>
<q-avatar text-color="info" icon="mdi-chevron-right" /> <q-avatar text-color="info" icon="mdi-chevron-right" />
@ -301,9 +309,7 @@ onMounted(() => {
padding-left: 20px; padding-left: 20px;
} }
.borderRadius{ .borderRadius {
border-radius: 20px!important; border-radius: 20px !important;
} }
</style> </style>

View file

@ -1,23 +1,37 @@
// registry // registry
const probationPage = () => import("@/modules/11_probation/views/main.vue"); const probationPage = () => import("@/modules/11_probation/views/main.vue");
const probationDetail = () => import("@/modules/11_probation/views/mainDetail.vue"); const probationDetail = () =>
import("@/modules/11_probation/views/mainDetail.vue");
const probationAdd = () => import("@/modules/11_probation/pages/addPage.vue"); const probationAdd = () => import("@/modules/11_probation/pages/addPage.vue");
const probationDetailPage = () => import("@/modules/11_probation/pages/detailPage.vue"); const probationDetailPage = () =>
import("@/modules/11_probation/pages/detailPage.vue");
const probationAssign = () => import('@/modules/11_probation/component/01_Assign.vue') const probationAssign = () =>
const probationRecordCareker = () => import('@/modules/11_probation/component/02_RecordCareker.vue') import("@/modules/11_probation/component/01_Assign.vue");
const probationRecordCommander = () => import('@/modules/11_probation/component/03_RecordCommander.vue') const probationRecordCareker = () =>
const probationEvaluateCommander = () => import('@/modules/11_probation/component/04_EvaluateCommander.vue') import("@/modules/11_probation/component/02_RecordCareker.vue");
const probationEvaluateChairman = () => import('@/modules/11_probation/component/05_EvaluateChairman.vue') const probationRecordCommander = () =>
const probationEvaluateResult = () => import('@/modules/11_probation/component/06_EvaluateResult.vue') import("@/modules/11_probation/component/03_RecordCommander.vue");
const probationEvaluateReport = () => import('@/modules/11_probation/component/07_EvaluateReport.vue') const probationEvaluateCommander = () =>
const probationSurveyComment = () => import('@/modules/11_probation/component/08_SurveyComment.vue') import("@/modules/11_probation/component/04_EvaluateCommander.vue");
const probationEvaluateChairman = () =>
import("@/modules/11_probation/component/05_EvaluateChairman.vue");
const probationEvaluateResult = () =>
import("@/modules/11_probation/component/06_EvaluateResult.vue");
const probationEvaluateReport = () =>
import("@/modules/11_probation/component/07_EvaluateReport.vue");
const probationSurveyComment = () =>
import("@/modules/11_probation/component/08_SurveyComment.vue");
const probationAddresult = () => import('@/modules/11_probation/component/addPage/01_addresult.vue') const probationAddresult = () =>
const probationAddevaluacommander = () => import('@/modules/11_probation/component/addPage/02_addevaluacommander.vue') import("@/modules/11_probation/component/addPage/01_addresult.vue");
const probationAddevalua = () => import('@/modules/11_probation/component/addPage/03_addevalua.vue') const probationAddevaluacommander = () =>
const probationAddevaluascore = () => import('@/modules/11_probation/component/addPage/04_addevaluascore.vue') import("@/modules/11_probation/component/addPage/02_addevaluacommander.vue");
const probationAddevalua = () =>
import("@/modules/11_probation/component/addPage/03_addevalua.vue");
const probationAddevaluascore = () =>
import("@/modules/11_probation/component/addPage/04_addevaluascore.vue");
export default [ export default [
{ {
@ -65,7 +79,7 @@ export default [
Key: [11], Key: [11],
}, },
}, },
////////////////////////////////////////////////// //////////////////////////////////////////////////
{ {
path: "/probation/record-careker/:profileId/:id", path: "/probation/record-careker/:profileId/:id",
name: "probationRecordCareker", name: "probationRecordCareker",
@ -129,42 +143,42 @@ export default [
Key: [11], Key: [11],
}, },
}, },
///////////////////////////////////////////////// /////////////////////////////////////////////////
{ {
path: "/probation/detail/addresult/:profileId/:id", path: "/probation/detail/addresult/:profileId/:id",
name: "probationAddresult", name: "probationAddresult",
component: probationAddresult, component: probationAddresult,
meta: { meta: {
Auth: true, Auth: true,
Key: [11], Key: [11],
},
}, },
}, {
{ path: "/probation/detail/addevaluacommander/:profileId/:id",
path: "/probation/detail/addevaluacommander/:profileId/:id", name: "probationAddevaluacommander",
name: "probationAddevaluacommander", component: probationAddevaluacommander,
component: probationAddevaluacommander, meta: {
meta: { Auth: true,
Auth: true, Key: [11],
Key: [11], },
}, },
}, {
{ path: "/probation/detail/addevalua/:profileId/:id",
path: "/probation/detail/addevalua/:profileId/:id", name: "probationAddevalua",
name: "probationAddevalua", component: probationAddevalua,
component: probationAddevalua, meta: {
meta: { Auth: true,
Auth: true, Key: [11],
Key: [11], },
}, },
}, {
{ path: "/probation/detail/addevaluascore/:profileId/:id",
path: "/probation/detail/addevaluascore/:profileId/:id", name: "probationAddevaluascore",
name: "probationAddevaluascore", component: probationAddevaluascore,
component: probationAddevaluascore, meta: {
meta: { Auth: true,
Auth: true, Key: [11],
Key: [11], },
}, },
},
]; ];

View file

@ -221,10 +221,9 @@ onMounted(async () => {
</template> </template>
</q-breadcrumbs> </q-breadcrumbs>
</div> </div>
</div> </div>
<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 style="overflow-x: auto; overflow-y: auto" class="q-pt-md">
<StructChart <StructChart

View file

@ -163,9 +163,7 @@ function fetchFile() {
function fileOpen(fileName: string) { function fileOpen(fileName: string) {
showLoader(); showLoader();
http http
.get( .get(config.API.fileByFile("ระบบผลงาน", "เอกสารผลงาน", id.value, fileName))
config.API.fileByFile("ระบบผลงาน", "เอกสารผลงาน", id.value, fileName)
)
.then((res) => { .then((res) => {
const data = res.data.downloadUrl; const data = res.data.downloadUrl;
window.open(data, "_blank"); window.open(data, "_blank");

View file

@ -3,20 +3,18 @@
* - Helper Functions * - Helper Functions
*/ */
const filters = { const filters = {
/**
* compactNumber Social Media 1,000 1K 1,000,000 1M
* : {{ $filters.compactNumber(value) }}
*
* @param val
* @returns
*/
compactNumber(val: number) {
const formatter = Intl.NumberFormat("en", { notation: "compact" });
return formatter.format(val);
},
};
/** export default filters;
* compactNumber Social Media 1,000 1K 1,000,000 1M
* : {{ $filters.compactNumber(value) }}
*
* @param val
* @returns
*/
compactNumber (val: number) {
const formatter = Intl.NumberFormat('en', { notation: 'compact'})
return formatter.format(val)
}
}
export default filters;

View file

@ -1,11 +1,11 @@
// import "./styles/quasar.scss" // import "./styles/quasar.scss"
import "@quasar/extras/material-icons/material-icons.css" import "@quasar/extras/material-icons/material-icons.css";
import "@quasar/extras/material-icons-outlined/material-icons-outlined.css" import "@quasar/extras/material-icons-outlined/material-icons-outlined.css";
import "@quasar/extras/fontawesome-v5/fontawesome-v5.css" import "@quasar/extras/fontawesome-v5/fontawesome-v5.css";
import "@quasar/extras/mdi-v4/mdi-v4.css" import "@quasar/extras/mdi-v4/mdi-v4.css";
// To be used on app.use(Quasar, { ... }) // To be used on app.use(Quasar, { ... })
export default { export default {
config: {}, config: {},
plugins: {}, plugins: {},
} };

View file

@ -1,13 +1,12 @@
/** /**
***** DEPRECATED - Must be delete later ***** ***** DEPRECATED - Must be delete later *****
*/ */
/** async/await /** async/await
* @param view "ชี่อไฟล์".vue * @param view "ชี่อไฟล์".vue
* @param folder "folderในsrc" [Ex. /src/"folder"] default=views * @param folder "folderในsrc" [Ex. /src/"folder"] default=views
*/ */
export function load(view: string, folder: string = "views") { export function load(view: string, folder: string = "views") {
// console.log(`@/${folder}/${view}.vue`); // console.log(`@/${folder}/${view}.vue`);
return async () => await import(`@/${folder}/${view}.vue`); return async () => await import(`@/${folder}/${view}.vue`);
} }

Some files were not shown because too many files have changed in this diff Show more