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'",
"build-only": "vite build",
"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": {
"@fullcalendar/core": "^6.0.1",

View file

@ -1,44 +1,47 @@
/**config api */
import { ref } from "vue"
import { ref } from "vue";
const env = ref<string>(process.env.NODE_ENV || "development")
export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG
export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL
const env = ref<string>(process.env.NODE_ENV || "development");
export const apiUrlConfig = import.meta.env.VITE_API_URI_CONFIG;
export const apiUrlConfigPublish = import.meta.env.VITE_API_PUBLISH_URL;
// if (process.env.VUE_APP_TEST) {
// env = "test";
// }
const config = ref<any>({
development: {
// API_URI: "https://localhost:7260/api",
API_URI: "https://bma-ehr.frappet.synology.me/api/v1",
API_URL_SUPPORT: "https://bma-ehr.frappet.synology.me/api/v1/support",
MEET_URI: "meet.frappet.com",
LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me",
},
test: {
API_URI: "http://localhost:5010/api/v1",
MEET_URI: "meet.frappet.com",
},
production: {
API_URI: apiUrlConfig,
API_URL_SUPPORT: `${apiUrlConfig}/support`,
API_URI_ORG_TREE: "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json",
MEET_URI: "meet.frappet.com",
LINK_EVALUATE_PUBLISH: apiUrlConfigPublish,
},
})
development: {
// API_URI: "https://localhost:7260/api",
API_URI: "https://bma-ehr.frappet.synology.me/api/v1",
API_URL_SUPPORT: "https://bma-ehr.frappet.synology.me/api/v1/support",
MEET_URI: "meet.frappet.com",
LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me",
},
test: {
API_URI: "http://localhost:5010/api/v1",
MEET_URI: "meet.frappet.com",
},
production: {
API_URI: apiUrlConfig,
API_URL_SUPPORT: `${apiUrlConfig}/support`,
API_URI_ORG_TREE:
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230707_115124.json",
MEET_URI: "meet.frappet.com",
LINK_EVALUATE_PUBLISH: apiUrlConfigPublish,
},
});
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 MEET_URI = ref<string>(config.value[env.value].MEET_URI)
const LINK_EVALUATE_PUBLISH = ref<string>(config.value[env.value].LINK_EVALUATE_PUBLISH)
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 MEET_URI = ref<string>(config.value[env.value].MEET_URI);
const LINK_EVALUATE_PUBLISH = ref<string>(
config.value[env.value].LINK_EVALUATE_PUBLISH
);
export default {
env: env.value,
config: config.value,
API_URI: API_URI.value,
API_URL_SUPPORT: API_URL_SUPPORT.value,
MEET_URI: MEET_URI.value,
LINK_EVALUATE_PUBLISH: LINK_EVALUATE_PUBLISH.value,
}
env: env.value,
config: config.value,
API_URI: API_URI.value,
API_URL_SUPPORT: API_URL_SUPPORT.value,
MEET_URI: MEET_URI.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 kpiCapacity = `${env.API_URI}/kpi/capacity`;
const reportProbation = `${env.API_URI}/report/probation`;
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}`,
calculateDate: () => `${probation}/calculate/assign-finish`,
@ -55,6 +54,6 @@ export default {
`${probation}/evaluate-record/create/commander?assign_id=${id}`,
reportEvaluateRecord1: (type: string, id: string) =>
`${reportProbation}/14/${type}/${id}`,
kpiCapacity
kpiCapacity,
};

View file

@ -7,5 +7,6 @@ const developmentSalaryFile = `${env.API_URI}/salary/file`;
export default {
developmentScholarshipReport,
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
*/
import env from "../index"
const tttt = `${env.API_URI}/test`
import env from "../index";
const tttt = `${env.API_URI}/test`;
export default {
gettttt: `${tttt}`,
puttttt: (id: string) => `${tttt}/${id}`,
}
gettttt: `${tttt}`,
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 {
listUserTransfer: () => `${placementTransfer}/transfer/user`,
listtransfer: () => `${placementTransfer}/transfer`,
transferByid: (id: string) => `${placementTransfer}/transfer/user/${id}`,
}
listUserTransfer: () => `${placementTransfer}/transfer/user`,
listtransfer: () => `${placementTransfer}/transfer`,
transferByid: (id: string) => `${placementTransfer}/transfer/user/${id}`,
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,48 +1,54 @@
interface OptionData {
id: string | undefined
name: string | undefined
code: string | undefined
id: string | undefined;
name: string | undefined;
code: string | undefined;
}
interface FormLeavetMainData {
type: string
numDate: string
extend: string
use: string
numAll: string
numDone: string
numNot: string
numCancel: string
type: string;
numDate: string;
extend: string;
use: string;
numAll: string;
numDone: string;
numNot: string;
numCancel: string;
}
interface formListLeaveData {
no: string
date: string | null
type: string
status: string
year: string
no: string;
date: string | null;
type: string;
status: string;
year: string;
}
interface TypeLeave {
code: string
createdAt: Date
createdFullName: string
createdUserId: string
id: string
lastUpdateFullName: string
lastUpdateUserId: string
lastUpdatedAt: Date | null
limit: number
name: string
code: string;
createdAt: Date;
createdFullName: string;
createdUserId: string;
id: string;
lastUpdateFullName: string;
lastUpdateUserId: string;
lastUpdatedAt: Date | null;
limit: number;
name: string;
}
interface LeaveItem {
text: string
color: string
value: number
all: number
use: number
remain: number
text: string;
color: string;
value: number;
all: number;
use: 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 {
dateStart: Date
subject: string
who: string
requestName: string
position: string
level: string
ocRequest: string
leaveabsentDaySummon: string
leaveUse: string
leaveRemaining: string
dateStart: Date;
subject: string;
who: string;
requestName: string;
position: string;
level: string;
ocRequest: string;
leaveabsentDaySummon: string;
leaveUse: string;
leaveRemaining: string;
}
interface OrdinationForm {
leaveWrote: object | null
leavegovernmentDate: object | null
leavebirthDate: object | null
leaveStartDate: object | null
leaveEndDate: object | null
totalLeave: object | null
ordainDayOrdination: object | null
ordainDayLocationName: object | null
ordainDayLocationNumber: object | null
ordainDayLocationAddress: object | null
ordainDayBuddhistLentName: object | null
ordainDayBuddhistLentAddress: object | null
[key: string]: any
leaveWrote: object | null;
leavegovernmentDate: object | null;
leavebirthDate: object | null;
leaveStartDate: object | null;
leaveEndDate: object | null;
totalLeave: object | null;
ordainDayOrdination: object | null;
ordainDayLocationName: object | null;
ordainDayLocationNumber: object | null;
ordainDayLocationAddress: object | null;
ordainDayBuddhistLentName: object | null;
ordainDayBuddhistLentAddress: object | null;
[key: string]: any;
}
interface HajiForm {
leaveWrote: object | null
leavegovernmentDate: object | null
leaveStartDate: object | null
leaveEndDate: object | null
[key: string]: any
leaveWrote: object | null;
leavegovernmentDate: object | null;
leaveStartDate: object | null;
leaveEndDate: object | null;
[key: string]: any;
}
interface MilitaryForm {
leaveStartDate: object | null
leaveEndDate: object | null
leaveWrote: object | null
absentDaySummon: object | null
absentDayLocation: object | null
absentDayRegistorDate: object | null
absentDayGetIn: object | null
absentDayAt: object | null
leaveDetail: object | null
[key: string]: any
leaveStartDate: object | null;
leaveEndDate: object | null;
leaveWrote: object | null;
absentDaySummon: object | null;
absentDayLocation: object | null;
absentDayRegistorDate: object | null;
absentDayGetIn: object | null;
absentDayAt: object | null;
leaveDetail: object | null;
[key: string]: any;
}
interface studyDaySubjectForm {
leaveStartDate: object | null
leaveEndDate: object | null
leavebirthDate: object | null
leavegovernmentDate: object | null
leaveSalary: object | null
leaveNumber: object | null
leaveAddress: object | null
studyDayScholarship: object | null
studyDayCountry: object | null
studyDayUniversityName: object | null
studyDayDegreeLevel: object | null
studyDaySubject: object | null
leaveWrote: object | null
[key: string]: any
leaveStartDate: object | null;
leaveEndDate: object | null;
leavebirthDate: object | null;
leavegovernmentDate: object | null;
leaveSalary: object | null;
leaveNumber: object | null;
leaveAddress: object | null;
studyDayScholarship: object | null;
studyDayCountry: object | null;
studyDayUniversityName: object | null;
studyDayDegreeLevel: object | null;
studyDaySubject: object | null;
leaveWrote: object | null;
[key: string]: any;
}
interface TrainForm {
leaveStartDate: object | null
leaveEndDate: object | null
leavebirthDate: object | null
leavegovernmentDate: object | null
leaveNumber: object | null
leaveAddress: object | null
studyDayScholarship: object | null
studyDayCountry: object | null
studyDayTrainingSubject: object | null
studyDayTrainingName: object | null
leaveWrote: object | null
[key: string]: any
leaveStartDate: object | null;
leaveEndDate: object | null;
leavebirthDate: object | null;
leavegovernmentDate: object | null;
leaveNumber: object | null;
leaveAddress: object | null;
studyDayScholarship: object | null;
studyDayCountry: object | null;
studyDayTrainingSubject: object | null;
studyDayTrainingName: object | null;
leaveWrote: object | null;
[key: string]: any;
}
interface RehabilitationForm {
leaveStartDate: object | null
leaveEndDate: object | null
leaveWrote: object | null
[key: string]: any
leaveStartDate: object | null;
leaveEndDate: object | null;
leaveWrote: object | null;
[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 {
leaveWrote: string //เขียนที่***
leaveStartDate: Date | null //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: string //จำนวนวันลา
leaveNumber: string //หมายเลขที่ติดต่อขณะลา
leaveDetail: string //รายละเอียดการลา
leaveAddress: string //สถานที่ติดต่อขณะลา
leaveDocument: File[] | null //เอกสารปะกอบ
[key: string]: any
leaveWrote: string; //เขียนที่***
leaveStartDate: Date | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: Date | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: string; //จำนวนวันลา
leaveNumber: string; //หมายเลขที่ติดต่อขณะลา
leaveDetail: string; //รายละเอียดการลา
leaveAddress: string; //สถานที่ติดต่อขณะลา
leaveDocument: File[] | null; //เอกสารปะกอบ
[key: string]: any;
}
interface FormRef {
leaveWrote: object | null //เขียนที่***
leaveStartDate: object | null //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: object | null //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: object | null //จำนวนวันลา
leaveNumber: object | null //หมายเลขที่ติดต่อขณะลา
leaveDetail: object | null //รายละเอียดการลา
leaveAddress: object | null //สถานที่ติดต่อขณะลา
leaveDocument: object | null //เอกสารปะกอบ
[key: string]: any
leaveWrote: object | null; //เขียนที่***
leaveStartDate: object | null; //*วัน เดือน ปีเริ่มต้นลา
leaveEndDate: object | null; //*วัน เดือน ปีสิ้นสุดลา
leaveTotal: object | null; //จำนวนวันลา
leaveNumber: object | null; //หมายเลขที่ติดต่อขณะลา
leaveDetail: object | null; //รายละเอียดการลา
leaveAddress: object | null; //สถานที่ติดต่อขณะลา
leaveDocument: object | null; //เอกสารปะกอบ
[key: string]: any;
}
export type { FormData, FormRef }
export type { FormData, FormRef };

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -123,7 +123,7 @@ watch(
<q-card style="width: 700px; max-width: 80vw">
<HeaderDialog :tittle="'ประวัติการประเมิน'" :close="props.close" />
<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-12">
<q-table

View file

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

View file

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

View file

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

View file

@ -98,7 +98,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
},
{
name: "posNo",
align: "left",
@ -108,7 +108,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionType",
align: "left",
@ -127,7 +127,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "templateDoc",
align: "left",
@ -192,7 +192,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
sortable: true,
field: "yearly",
format(val, row) {
return row.yearly + 543
return row.yearly + 543;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -222,7 +222,7 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
name: "receivedDate",
align: "center",
label: "วันที่ได้รับ",
sortable: true,
field: (value) => date2Thai(value),
headerStyle: "font-size: 14px",

View file

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

View file

@ -1,14 +1,11 @@
interface MyObjectAppealRef {
type: object | null;
title: object | null;
description: object | null;
caseType: object | null;
caseNumber: object | null;
type: object | null;
title: object | null;
description: object | null;
caseType: 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 {
status: string
type: string
year: number
status: string;
type: string;
year: number;
}
interface RowList {
id: string
title: string
description: string
status: string
type: string
year: number
caseType: string
caseNumber: string
fullname: string
citizenId: string
profileId: string
lastUpdatedAt: string | null
id: string;
title: string;
description: string;
status: string;
type: string;
year: number;
caseType: string;
caseNumber: string;
fullname: string;
citizenId: string;
profileId: string;
lastUpdatedAt: string | null;
}
interface MainList {
id: string
title: string
description: string
status: string
type: string
year: number
caseType: string
caseNumber: string
fullname: string
citizenId: string
profileId: string
lastUpdatedAt: Date
id: string;
title: string;
description: string;
status: string;
type: string;
year: number;
caseType: string;
caseNumber: string;
fullname: string;
citizenId: string;
profileId: string;
lastUpdatedAt: Date;
}
interface EditDataList {
id: string
title: string
description: string
status: string
type: string
year: number
caseType: string
caseNumber: string
fullname: string
citizenId: string
profileId: string
lastUpdatedAt: string
historyStatus: object | null
disciplineComplaint_Appeal_Docs: object | null
id: string;
title: string;
description: string;
status: string;
type: string;
year: number;
caseType: string;
caseNumber: string;
fullname: string;
citizenId: string;
profileId: string;
lastUpdatedAt: string;
historyStatus: object | null;
disciplineComplaint_Appeal_Docs: object | null;
}
interface HistoryStatusType {
status: string
createdAt: string
status: string;
createdAt: string;
}
interface FileObType {
id: string
pathName: string
fileName: string
id: string;
pathName: string;
fileName: string;
}
export type {
FormType, RowList, MainList, EditDataList,
FormType,
RowList,
MainList,
EditDataList,
HistoryStatusType,
FileObType
}
FileObType,
};

View file

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

View file

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

View file

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

View file

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

View file

@ -574,9 +574,15 @@ watch(
</div>
</div>
</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-tooltip>นทกขอม</q-tooltip></q-btn
>

View file

@ -53,7 +53,10 @@ watch(
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 85%">
<DialogHeader :tittle="`พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`" :close="closeDialog" />
<DialogHeader
:tittle="`พฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`"
:close="closeDialog"
/>
<q-separator />
<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 dataRows = ref<any[]>([]);
const visibleColumns = ref<String[]>([ "description"]);
const visibleColumns = ref<String[]>(["description"]);
const columns = ref<QTableProps["columns"]>([
{
name: "description",
align: "left",
@ -30,13 +29,15 @@ function closeDialog() {
rows.value = [];
dataRows.value = [];
}
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 85%">
<DialogHeader :tittle="`ข้อมูลพฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`" :close="closeDialog" />
<DialogHeader
:tittle="`ข้อมูลพฤติกรรมที่คาดหวัง/พฤติกรรมย่อย`"
:close="closeDialog"
/>
<q-separator />
<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 { showLoader, hideLoader, messageError } = useCounterMixin();
const modal = defineModel<boolean>("modal", { required: true });
const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", { required: true });
const dataListCriteria = defineModel<ListCriteria[]>("dataListCriteria", {
required: true,
});
function close() {
modal.value = false;
@ -38,9 +40,11 @@ function close() {
</div>
<q-separator />
<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-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>
</div>
</div>

View file

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

View file

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

View file

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

View file

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

View file

@ -4,7 +4,8 @@
const KPIPage = () => import("@/modules/08_KPI/views/main.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 [
{

View file

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

View file

@ -1,132 +1,131 @@
interface FormsSholarship {
profileId: string;
rank: string; //ยศ
prefix: string; //คำนำหน้าชื่อ
firstName: string; //ชื่อ
lastName: string; //นามสกุล
citizenId: string; //เลขประจำตัวประชาชน
position: string; //ตำแหน่ง
posExecutive: string; //ชื่อตำแหน่งทางการบริหาร
posLevelId: string | null; //ไอดีระดับตำแหน่ง
posTypeId: string | null; //ไอดีประเภทตำแหน่ง
org: string;
rootId: string | null;
root: string;
orgRootShortName: string;
orgRevisionId: string | null;
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 | null; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posTypeguarantorId: string | null; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน
budgetSource: string; //แหล่งงบประมาณ
budgetApprove: number | string | 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; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม
planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ
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; // ไม่ใช้งบประมาณ
}
profileId: string;
rank: string; //ยศ
prefix: string; //คำนำหน้าชื่อ
firstName: string; //ชื่อ
lastName: string; //นามสกุล
citizenId: string; //เลขประจำตัวประชาชน
position: string; //ตำแหน่ง
posExecutive: string; //ชื่อตำแหน่งทางการบริหาร
posLevelId: string | null; //ไอดีระดับตำแหน่ง
posTypeId: string | null; //ไอดีประเภทตำแหน่ง
org: string;
rootId: string | null;
root: string;
orgRootShortName: string;
orgRevisionId: string | null;
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 | null; //ไอดีระดับตำแหน่ง(ผู้ค้ำ)
posTypeguarantorId: string | null; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ)
scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน
budgetSource: string; //แหล่งงบประมาณ
budgetApprove: number | string | 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; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม
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 scholarshipDetail = () => import('@/modules/09_scholarship/views/detail.vue')
const scholarshipDetail = () =>
import("@/modules/09_scholarship/views/detail.vue");
export default [
{
path: "/scholarship",

View file

@ -10,4 +10,4 @@ interface NewPagination {
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 [
{

View file

@ -1,14 +1,15 @@
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";
export const useRegistryInFormationStore = defineStore(
"registryInFormationStore",
() => {
const typeProfile = ref<string>("OFFICER");
const profileId = ref<string>('')
const profileId = ref<string>("");
function typeChangeName(val: string) {
switch (val) {
@ -28,6 +29,6 @@ export const useRegistryInFormationStore = defineStore(
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";
const router = useRouter();
</script>
<template>
<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 Duty from "@/modules/10_registry/02_Government/04_Duty.vue";
const router = useRouter();
</script>
<template>
<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 Nopaid from "@/modules/10_registry/03_Salary/02_Nopaid.vue";
const router = useRouter();
</script>
<template>
<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'}`">
<Salary />
<Nopaid />
</div>
</template>
<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 File from "@/modules/10_registry/05_Other/02_File.vue";
const router = useRouter();
</script>
<template>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -128,7 +128,7 @@
<div v-else class="col-12">
<div class="row q-col-gutter-sm">
<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">
<span class="text-weight-medium">
<i
@ -141,7 +141,7 @@
</div>
<q-separator />
<q-card-section class="q-pa-none">
<q-list >
<q-list>
<q-item class="q-pa-none text-center">
<q-item-section>
<q-item-label>ำกวาความคาดหวงมาก</q-item-label>
@ -156,26 +156,26 @@
</q-card>
</div>
<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">
<span class="text-weight-medium">
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
></span
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
></span
>
</div>
<q-separator />
<q-card-section class="q-pa-none">
<q-list >
<q-list>
<q-item class="q-pa-none text-center">
<q-item-section>
<q-item-label>ำกวาความคาดหวงคอนขางมาก</q-item-label>
@ -190,32 +190,32 @@
</q-card>
</div>
<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">
<span class="text-weight-medium">
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true"
role="presentation"
>grade</i
></span
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true"
role="presentation"
>grade</i
></span
>
</div>
<q-separator />
<q-card-section class="q-pa-none">
<q-list >
<q-list>
<q-item class="q-pa-none text-center">
<q-item-section>
<q-item-label>เปนไปตามความคาดหว</q-item-label>
@ -230,38 +230,38 @@
</q-card>
</div>
<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">
<span class="text-weight-medium">
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9"
aria-hidden="true"
role="presentation"
>grade</i
></span
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9"
aria-hidden="true"
role="presentation"
>grade</i
></span
>
</div>
<q-separator />
<q-card-section class="q-pa-none">
<q-list >
<q-list>
<q-item class="q-pa-none text-center">
<q-item-section>
<q-item-label>งวาความคาดหวงคอนขางมาก</q-item-label>
@ -276,44 +276,44 @@
</q-card>
</div>
<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">
<span class="text-weight-medium">
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-10"
aria-hidden="true"
role="presentation"
>grade</i
></span
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-3"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-light-blue-6"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-9"
aria-hidden="true"
role="presentation"
>grade</i
>
<i
class="q-icon notranslate material-icons q-rating__icon q-rating__icon--active text-blue-10"
aria-hidden="true"
role="presentation"
>grade</i
></span
>
</div>
<q-separator />
<q-card-section class="q-pa-none">
<q-list >
<q-list>
<q-item class="q-pa-none text-center">
<q-item-section>
<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);
};
}
watch(tabHead, () => {
props.changeTab(tabHead.value);
});
/** ไปยัง step ต่อไป */
function nextPage(){
function nextPage() {
if (props.loop !== undefined) {
if (props.loop < 3) {
props.addData();
}
}
};
}
</script>
<template>

View file

@ -2052,7 +2052,10 @@ onMounted(async () => {
</q-item>
</q-list>
<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-section>
<q-item-label>2. การเรยนรวยตนเอง</q-item-label>
@ -2088,7 +2091,10 @@ onMounted(async () => {
</q-item>
</q-list>
<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-section>
<q-item-label>3. การอบรมสมนารวมก</q-item-label>

View file

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

View file

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

View file

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

View file

@ -614,7 +614,8 @@ onMounted(async () => {
<div class="row text-weight-medium">
<div class="col-12 text-grey-7 text-bold">
<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 class="col-12">
<span class="text-grey-7 text-weight-bold q-pl-lg"
@ -624,7 +625,9 @@ onMounted(async () => {
</div>
<div class="col-12">
<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 class="col-12">
<span class="text-grey-7 text-weight-bold q-pl-lg">งก</span>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,23 +1,37 @@
// registry
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 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 probationRecordCareker = () => import('@/modules/11_probation/component/02_RecordCareker.vue')
const probationRecordCommander = () => import('@/modules/11_probation/component/03_RecordCommander.vue')
const probationEvaluateCommander = () => 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 probationAssign = () =>
import("@/modules/11_probation/component/01_Assign.vue");
const probationRecordCareker = () =>
import("@/modules/11_probation/component/02_RecordCareker.vue");
const probationRecordCommander = () =>
import("@/modules/11_probation/component/03_RecordCommander.vue");
const probationEvaluateCommander = () =>
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 probationAddevaluacommander = () => 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')
const probationAddresult = () =>
import("@/modules/11_probation/component/addPage/01_addresult.vue");
const probationAddevaluacommander = () =>
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 [
{
@ -65,7 +79,7 @@ export default [
Key: [11],
},
},
//////////////////////////////////////////////////
//////////////////////////////////////////////////
{
path: "/probation/record-careker/:profileId/:id",
name: "probationRecordCareker",
@ -129,42 +143,42 @@ export default [
Key: [11],
},
},
/////////////////////////////////////////////////
/////////////////////////////////////////////////
{
path: "/probation/detail/addresult/:profileId/:id",
name: "probationAddresult",
component: probationAddresult,
meta: {
Auth: true,
Key: [11],
{
path: "/probation/detail/addresult/:profileId/:id",
name: "probationAddresult",
component: probationAddresult,
meta: {
Auth: true,
Key: [11],
},
},
},
{
path: "/probation/detail/addevaluacommander/:profileId/:id",
name: "probationAddevaluacommander",
component: probationAddevaluacommander,
meta: {
Auth: true,
Key: [11],
{
path: "/probation/detail/addevaluacommander/:profileId/:id",
name: "probationAddevaluacommander",
component: probationAddevaluacommander,
meta: {
Auth: true,
Key: [11],
},
},
},
{
path: "/probation/detail/addevalua/:profileId/:id",
name: "probationAddevalua",
component: probationAddevalua,
meta: {
Auth: true,
Key: [11],
{
path: "/probation/detail/addevalua/:profileId/:id",
name: "probationAddevalua",
component: probationAddevalua,
meta: {
Auth: true,
Key: [11],
},
},
},
{
path: "/probation/detail/addevaluascore/:profileId/:id",
name: "probationAddevaluascore",
component: probationAddevaluascore,
meta: {
Auth: true,
Key: [11],
{
path: "/probation/detail/addevaluascore/:profileId/:id",
name: "probationAddevaluascore",
component: probationAddevaluascore,
meta: {
Auth: true,
Key: [11],
},
},
},
];

View file

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

View file

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

View file

@ -3,20 +3,18 @@
* - Helper Functions
*/
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);
},
};
/**
* 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;
export default filters;

View file

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

View file

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