Merge branch 'develop' into devTee
This commit is contained in:
commit
d2eca5cbe1
11 changed files with 266 additions and 84 deletions
|
|
@ -97,7 +97,7 @@ const formData = reactive<FremData>({
|
||||||
leaveTotal: 0, //จำนวนวันที่ลา(Auto)
|
leaveTotal: 0, //จำนวนวันที่ลา(Auto)
|
||||||
leavebirthDate: new Date(), //วันเดือนปีเกิด(Auto)
|
leavebirthDate: new Date(), //วันเดือนปีเกิด(Auto)
|
||||||
leavegovernmentDate: new Date(), //วันที่เข้ารับราชการ(Auto)
|
leavegovernmentDate: new Date(), //วันที่เข้ารับราชการ(Auto)
|
||||||
leaveSalary: 0, //เงินเดือนปัจจุบัน(Auto)
|
leaveSalary: "", //เงินเดือนปัจจุบัน(Auto)
|
||||||
leaveSalaryText: "", //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน)
|
leaveSalaryText: "", //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน)
|
||||||
leaveTypeDay: "", //ประเภทการลาในวันนั้นเช่น
|
leaveTypeDay: "", //ประเภทการลาในวันนั้นเช่น
|
||||||
wifeDayName: "", //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร)
|
wifeDayName: "", //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร)
|
||||||
|
|
@ -196,7 +196,9 @@ async function fetchDetailLeave(paramsId: string) {
|
||||||
data.leaveBirthDate && date2Thai(data.leaveBirthDate);
|
data.leaveBirthDate && date2Thai(data.leaveBirthDate);
|
||||||
formData.leavegovernmentDate =
|
formData.leavegovernmentDate =
|
||||||
data.leaveGovernmentDate && date2Thai(data.leaveGovernmentDate);
|
data.leaveGovernmentDate && date2Thai(data.leaveGovernmentDate);
|
||||||
formData.leaveSalary = data.leaveSalary ? data.leaveSalary : "-";
|
formData.leaveSalary = data.leaveSalary
|
||||||
|
? formattedNumber(data.leaveSalary)
|
||||||
|
: "-";
|
||||||
formData.leaveSalaryText = data.leaveSalaryText
|
formData.leaveSalaryText = data.leaveSalaryText
|
||||||
? data.leaveSalaryText
|
? data.leaveSalaryText
|
||||||
: "-";
|
: "-";
|
||||||
|
|
@ -307,7 +309,7 @@ async function fectOptionType() {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
leaveType.value = res.data.result;
|
leaveType.value = res.data.result;
|
||||||
checkLeaveType(formData.leaveTypeId, formData.leaveTypeName);
|
checkLeaveType(formData.leaveTypeId, formData);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -319,7 +321,7 @@ const checkForm = ref<string>("");
|
||||||
* Function เช็คประเภทการลา
|
* Function เช็คประเภทการลา
|
||||||
* @param type รับค่า
|
* @param type รับค่า
|
||||||
*/
|
*/
|
||||||
function checkLeaveType(leaveTypeId: string, leaveTypeName: string) {
|
function checkLeaveType(leaveTypeId: string, formData: FremData) {
|
||||||
if (leaveType.value) {
|
if (leaveType.value) {
|
||||||
const filtertype: LeaveType | undefined = leaveType.value.find(
|
const filtertype: LeaveType | undefined = leaveType.value.find(
|
||||||
(e: any) => e.id === leaveTypeId
|
(e: any) => e.id === leaveTypeId
|
||||||
|
|
@ -331,13 +333,13 @@ function checkLeaveType(leaveTypeId: string, leaveTypeName: string) {
|
||||||
checkForm.value = "FormChildbirth";
|
checkForm.value = "FormChildbirth";
|
||||||
} else if (type === "LV-005") {
|
} else if (type === "LV-005") {
|
||||||
checkForm.value = "FormHoliday";
|
checkForm.value = "FormHoliday";
|
||||||
} else if (type === "LV-006") {
|
} else if (type === "LV-006" && formData.ordainDayLocationName !== "-") {
|
||||||
checkForm.value = "FormUpasom";
|
checkForm.value = "FormUpasom";
|
||||||
} else if (type === "LV-006" && leaveTypeName === "พิธีฮัจญ์ฯ") {
|
} else if (type === "LV-006") {
|
||||||
checkForm.value = "FormHajj";
|
checkForm.value = "FormHajj";
|
||||||
} else if (type === "LV-007") {
|
} else if (type === "LV-007") {
|
||||||
checkForm.value = "FormCheckSelect";
|
checkForm.value = "FormCheckSelect";
|
||||||
} else if (type === "LV-008" && leaveTypeName === "ลาไปศีกษา") {
|
} else if (type === "LV-008" && formData.studyDayTrainingSubject === "-") {
|
||||||
checkForm.value = "FormStudy";
|
checkForm.value = "FormStudy";
|
||||||
} else if (type === "LV-008") {
|
} else if (type === "LV-008") {
|
||||||
checkForm.value = "FormLeaveToTraining";
|
checkForm.value = "FormLeaveToTraining";
|
||||||
|
|
@ -481,6 +483,10 @@ async function onClickDownloadFile(id: string, fileName: string, type: string) {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formattedNumber(x: number) {
|
||||||
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,43 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
/** importStore */
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { calculateDurationYmd } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function convertDateToEng(dataThia: string) {
|
||||||
|
const thaiDateParts: string[] = dataThia.split(" ");
|
||||||
|
const thaiMonthAbbreviation: string = thaiDateParts[1];
|
||||||
|
|
||||||
|
const thaiMonths: { [key: string]: string } = {
|
||||||
|
"ม.ค.": "Jan",
|
||||||
|
"ก.พ.": "Feb",
|
||||||
|
"มี.ค.": "Mar",
|
||||||
|
"เม.ย.": "Apr",
|
||||||
|
"พ.ค.": "May",
|
||||||
|
"มิ.ย.": "Jun",
|
||||||
|
"ก.ค.": "Jul",
|
||||||
|
"ส.ค.": "Aug",
|
||||||
|
"ก.ย.": "Sep",
|
||||||
|
"ต.ค.": "Oct",
|
||||||
|
"พ.ย.": "Nov",
|
||||||
|
"ธ.ค.": "Dec",
|
||||||
|
};
|
||||||
|
const englishMonth: string = thaiMonths[thaiMonthAbbreviation];
|
||||||
|
|
||||||
|
if (englishMonth) {
|
||||||
|
const englishDateString: string = `${englishMonth} ${thaiDateParts[0]} ${thaiDateParts[2]}`;
|
||||||
|
const dateObject: Date = new Date(englishDateString);
|
||||||
|
return dateObject.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
|
@ -23,7 +56,14 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveTotal }}</div>
|
<div class="col">
|
||||||
|
{{
|
||||||
|
calculateDurationYmd(
|
||||||
|
convertDateToEng(props.data.leaveDateStart),
|
||||||
|
convertDateToEng(props.data.leaveDateEnd)
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ const props = defineProps({
|
||||||
<div class="col">{{ props.data.leaveDetail }}</div>
|
<div class="col">{{ props.data.leaveDetail }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">เอกสารแนบ</div>
|
<div class="col text-grey-8">เอกสารประกอบ</div>
|
||||||
<div class="col" v-if="props.data.leaveDocument">
|
<div class="col" v-if="props.data.leaveDocument">
|
||||||
<q-btn
|
<q-btn
|
||||||
:href="props.data.leaveDocument"
|
:href="props.data.leaveDocument"
|
||||||
|
|
@ -41,6 +41,22 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="col" v-else>-</div>
|
<div class="col" v-else>-</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col text-grey-8">เอกสารแบบฟอร์ม</div>
|
||||||
|
<div class="col" v-if="props.data.leaveDraftDocument">
|
||||||
|
<q-btn
|
||||||
|
:href="props.data.leaveDraftDocument"
|
||||||
|
target="_blank"
|
||||||
|
outline
|
||||||
|
color="blue"
|
||||||
|
label="ดาวน์โหลด"
|
||||||
|
size="12px"
|
||||||
|
>
|
||||||
|
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="col" v-else>-</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,43 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
/** importStore */
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { calculateDurationYmd } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function convertDateToEng(dataThia: string) {
|
||||||
|
const thaiDateParts: string[] = dataThia.split(" ");
|
||||||
|
const thaiMonthAbbreviation: string = thaiDateParts[1];
|
||||||
|
|
||||||
|
const thaiMonths: { [key: string]: string } = {
|
||||||
|
"ม.ค.": "Jan",
|
||||||
|
"ก.พ.": "Feb",
|
||||||
|
"มี.ค.": "Mar",
|
||||||
|
"เม.ย.": "Apr",
|
||||||
|
"พ.ค.": "May",
|
||||||
|
"มิ.ย.": "Jun",
|
||||||
|
"ก.ค.": "Jul",
|
||||||
|
"ส.ค.": "Aug",
|
||||||
|
"ก.ย.": "Sep",
|
||||||
|
"ต.ค.": "Oct",
|
||||||
|
"พ.ย.": "Nov",
|
||||||
|
"ธ.ค.": "Dec",
|
||||||
|
};
|
||||||
|
const englishMonth: string = thaiMonths[thaiMonthAbbreviation];
|
||||||
|
|
||||||
|
if (englishMonth) {
|
||||||
|
const englishDateString: string = `${englishMonth} ${thaiDateParts[0]} ${thaiDateParts[2]}`;
|
||||||
|
const dateObject: Date = new Date(englishDateString);
|
||||||
|
return dateObject.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
|
|
@ -23,7 +56,14 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveTotal }}</div>
|
<div class="col">
|
||||||
|
{{
|
||||||
|
calculateDurationYmd(
|
||||||
|
convertDateToEng(props.data.leaveDateStart),
|
||||||
|
convertDateToEng(props.data.leaveDateEnd)
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,43 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
/** importStore */
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { calculateDurationYmd } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function convertDateToEng(dataThia: string) {
|
||||||
|
const thaiDateParts: string[] = dataThia.split(" ");
|
||||||
|
const thaiMonthAbbreviation: string = thaiDateParts[1];
|
||||||
|
|
||||||
|
const thaiMonths: { [key: string]: string } = {
|
||||||
|
"ม.ค.": "Jan",
|
||||||
|
"ก.พ.": "Feb",
|
||||||
|
"มี.ค.": "Mar",
|
||||||
|
"เม.ย.": "Apr",
|
||||||
|
"พ.ค.": "May",
|
||||||
|
"มิ.ย.": "Jun",
|
||||||
|
"ก.ค.": "Jul",
|
||||||
|
"ส.ค.": "Aug",
|
||||||
|
"ก.ย.": "Sep",
|
||||||
|
"ต.ค.": "Oct",
|
||||||
|
"พ.ย.": "Nov",
|
||||||
|
"ธ.ค.": "Dec",
|
||||||
|
};
|
||||||
|
const englishMonth: string = thaiMonths[thaiMonthAbbreviation];
|
||||||
|
|
||||||
|
if (englishMonth) {
|
||||||
|
const englishDateString: string = `${englishMonth} ${thaiDateParts[0]} ${thaiDateParts[2]}`;
|
||||||
|
const dateObject: Date = new Date(englishDateString);
|
||||||
|
return dateObject.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -24,7 +57,14 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
<div class="col text-grey-8">จำนวนวันที่ลา</div>
|
||||||
<div class="col">{{ props.data.leaveTotal }}</div>
|
<div class="col">
|
||||||
|
{{
|
||||||
|
calculateDurationYmd(
|
||||||
|
convertDateToEng(props.data.leaveDateStart),
|
||||||
|
convertDateToEng(props.data.leaveDateEnd)
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
<div class="col text-grey-8">วันเดือนปีเกิด</div>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ const props = defineProps({
|
||||||
<div class="col">{{ props.data.leaveDetail }}</div>
|
<div class="col">{{ props.data.leaveDetail }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col text-grey-8">เอกสารแนบ</div>
|
<div class="col text-grey-8">เอกสารประกอบ</div>
|
||||||
<div class="col" v-if="props.data.leaveDocument">
|
<div class="col" v-if="props.data.leaveDocument">
|
||||||
<q-btn
|
<q-btn
|
||||||
:href="props.data.leaveDocument"
|
:href="props.data.leaveDocument"
|
||||||
|
|
@ -41,6 +41,22 @@ const props = defineProps({
|
||||||
</div>
|
</div>
|
||||||
<div class="col" v-else>-</div>
|
<div class="col" v-else>-</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col text-grey-8">เอกสารแบบฟอร์ม</div>
|
||||||
|
<div class="col" v-if="props.data.leaveDraftDocument">
|
||||||
|
<q-btn
|
||||||
|
:href="props.data.leaveDraftDocument"
|
||||||
|
target="_blank"
|
||||||
|
outline
|
||||||
|
color="blue"
|
||||||
|
label="ดาวน์โหลด"
|
||||||
|
size="12px"
|
||||||
|
>
|
||||||
|
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="col" v-else>-</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ interface FremData {
|
||||||
leaveTotal: number; //จำนวนวันที่ลา(Auto)
|
leaveTotal: number; //จำนวนวันที่ลา(Auto)
|
||||||
leavebirthDate: Date | null; //วันเดือนปีเกิด(Auto)
|
leavebirthDate: Date | null; //วันเดือนปีเกิด(Auto)
|
||||||
leavegovernmentDate: Date | null; //วันที่เข้ารับราชการ(Auto)
|
leavegovernmentDate: Date | null; //วันที่เข้ารับราชการ(Auto)
|
||||||
leaveSalary: Number; //เงินเดือนปัจจุบัน(Auto)
|
leaveSalary: string; //เงินเดือนปัจจุบัน(Auto)
|
||||||
leaveSalaryText: String; //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน)
|
leaveSalaryText: String; //เงินเดือนปัจจุบัน(เขียนเป็นคำอ่าน)
|
||||||
leaveTypeDay: string; //ประเภทการลาในวันนั้นเช่น
|
leaveTypeDay: string; //ประเภทการลาในวันนั้นเช่น
|
||||||
wifeDayName: String; //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร)
|
wifeDayName: String; //ชื่อภรรยา(ลาไปช่วยเหลือภริยาที่คลอดบุตร)
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,30 @@ onMounted(async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// เช็คว่าต้องมีแนบท้ายไหม code ที่เพิ่มคืออันที่ไม่มีแนบท้าย
|
||||||
|
const attachmentStatus = computed(() => {
|
||||||
|
return code.value != "c-pm-10" &&
|
||||||
|
code.value != "c-pm-11" &&
|
||||||
|
code.value != "c-pm-12" &&
|
||||||
|
code.value != "c-pm-16" &&
|
||||||
|
code.value != "c-pm-18" &&
|
||||||
|
code.value != "c-pm-19" &&
|
||||||
|
code.value != "c-pm-20" &&
|
||||||
|
code.value != "c-pm-21" &&
|
||||||
|
code.value != "c-pm-23" &&
|
||||||
|
code.value != "c-pm-25" &&
|
||||||
|
code.value != "c-pm-26" &&
|
||||||
|
code.value != "c-pm-27" &&
|
||||||
|
code.value != "c-pm-28" &&
|
||||||
|
code.value != "c-pm-29" &&
|
||||||
|
code.value != "c-pm-30" &&
|
||||||
|
code.value != "c-pm-31" &&
|
||||||
|
code.value != "c-pm-32"
|
||||||
|
? true
|
||||||
|
: false;
|
||||||
|
});
|
||||||
|
|
||||||
// เรียกข้อมูลคำสั่ง
|
// เรียกข้อมูลคำสั่ง
|
||||||
const getCommandDetail = async () => {
|
const getCommandDetail = async () => {
|
||||||
await http
|
await http
|
||||||
|
|
@ -68,17 +92,7 @@ const getCommandDetail = async () => {
|
||||||
|
|
||||||
fetchReportCover("pdf", orderId.value);
|
fetchReportCover("pdf", orderId.value);
|
||||||
|
|
||||||
if (
|
if (attachmentStatus.value) {
|
||||||
code.value != "c-pm-10" &&
|
|
||||||
code.value != "c-pm-11" &&
|
|
||||||
code.value != "c-pm-12" &&
|
|
||||||
code.value != "c-pm-16" &&
|
|
||||||
code.value != "c-pm-18" &&
|
|
||||||
code.value != "c-pm-19" &&
|
|
||||||
code.value != "c-pm-20" &&
|
|
||||||
code.value != "c-pm-21" &&
|
|
||||||
code.value != "c-pm-23"
|
|
||||||
) {
|
|
||||||
fetchReportAttachment("pdf", orderId.value);
|
fetchReportAttachment("pdf", orderId.value);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -265,17 +279,7 @@ const saveUpload = () => {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await postfileOrder();
|
await postfileOrder();
|
||||||
if (
|
if (attachmentStatus.value) {
|
||||||
code.value != "c-pm-10" &&
|
|
||||||
code.value != "c-pm-11" &&
|
|
||||||
code.value != "c-pm-12" &&
|
|
||||||
code.value != "c-pm-16" &&
|
|
||||||
code.value != "c-pm-18" &&
|
|
||||||
code.value != "c-pm-19" &&
|
|
||||||
code.value != "c-pm-20" &&
|
|
||||||
code.value != "c-pm-21" &&
|
|
||||||
code.value != "c-pm-23"
|
|
||||||
) {
|
|
||||||
await postfileTailer();
|
await postfileTailer();
|
||||||
}
|
}
|
||||||
await fetchAttachment(orderId.value);
|
await fetchAttachment(orderId.value);
|
||||||
|
|
@ -300,17 +304,7 @@ const saveDetail = () => {
|
||||||
await fetchReportCover("pdf", orderId.value); // ดึงรายงานคำสั่งใหม่
|
await fetchReportCover("pdf", orderId.value); // ดึงรายงานคำสั่งใหม่
|
||||||
|
|
||||||
// เช็คประเภทคำสั่งถ้าไม่ใช่ type เหล่านี้จะมีแนบท้าย
|
// เช็คประเภทคำสั่งถ้าไม่ใช่ type เหล่านี้จะมีแนบท้าย
|
||||||
if (
|
if (attachmentStatus.value) {
|
||||||
code.value != "c-pm-10" &&
|
|
||||||
code.value != "c-pm-11" &&
|
|
||||||
code.value != "c-pm-12" &&
|
|
||||||
code.value != "c-pm-16" &&
|
|
||||||
code.value != "c-pm-18" &&
|
|
||||||
code.value != "c-pm-19" &&
|
|
||||||
code.value != "c-pm-20" &&
|
|
||||||
code.value != "c-pm-21" &&
|
|
||||||
code.value != "c-pm-23"
|
|
||||||
) {
|
|
||||||
// ดึงรายงานในส่วนของแนบท้ายมาใหม่
|
// ดึงรายงานในส่วนของแนบท้ายมาใหม่
|
||||||
await fetchReportAttachment("pdf", orderId.value);
|
await fetchReportAttachment("pdf", orderId.value);
|
||||||
|
|
||||||
|
|
@ -399,15 +393,7 @@ const clickExecute = async (id: string) => {
|
||||||
};
|
};
|
||||||
const validateFormUpload = () => {
|
const validateFormUpload = () => {
|
||||||
if (
|
if (
|
||||||
code.value != "c-pm-10" &&
|
attachmentStatus.value &&
|
||||||
code.value != "c-pm-11" &&
|
|
||||||
code.value != "c-pm-12" &&
|
|
||||||
code.value != "c-pm-16" &&
|
|
||||||
code.value != "c-pm-18" &&
|
|
||||||
code.value != "c-pm-19" &&
|
|
||||||
code.value != "c-pm-20" &&
|
|
||||||
code.value != "c-pm-21" &&
|
|
||||||
code.value != "c-pm-23" &&
|
|
||||||
fileOrder.value !== null &&
|
fileOrder.value !== null &&
|
||||||
fileTailer.value !== null
|
fileTailer.value !== null
|
||||||
) {
|
) {
|
||||||
|
|
@ -499,17 +485,7 @@ const viewFileUpload = async (url: string) => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="attachmentStatus"
|
||||||
code != 'c-pm-10' &&
|
|
||||||
code != 'c-pm-11' &&
|
|
||||||
code != 'c-pm-12' &&
|
|
||||||
code != 'c-pm-16' &&
|
|
||||||
code != 'c-pm-18' &&
|
|
||||||
code != 'c-pm-19' &&
|
|
||||||
code != 'c-pm-20' &&
|
|
||||||
code != 'c-pm-21' &&
|
|
||||||
code != 'c-pm-23'
|
|
||||||
"
|
|
||||||
@click="setTab('second')"
|
@click="setTab('second')"
|
||||||
:class="getClass(tab == 'second')"
|
:class="getClass(tab == 'second')"
|
||||||
>
|
>
|
||||||
|
|
@ -678,19 +654,7 @@ const viewFileUpload = async (url: string) => {
|
||||||
</template>
|
</template>
|
||||||
</q-file>
|
</q-file>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="attachmentStatus">
|
||||||
v-if="
|
|
||||||
code != 'c-pm-10' &&
|
|
||||||
code != 'c-pm-11' &&
|
|
||||||
code != 'c-pm-12' &&
|
|
||||||
code != 'c-pm-16' &&
|
|
||||||
code != 'c-pm-18' &&
|
|
||||||
code != 'c-pm-19' &&
|
|
||||||
code != 'c-pm-20' &&
|
|
||||||
code != 'c-pm-21' &&
|
|
||||||
code != 'c-pm-23'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<label class="text-file">เอกสารแนบท้าย</label>
|
<label class="text-file">เอกสารแนบท้าย</label>
|
||||||
<div v-if="TailerPDFUpload != ''" class="text-right">
|
<div v-if="TailerPDFUpload != ''" class="text-right">
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,7 @@ const formData = reactive<any>({
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label
|
<q-item-label
|
||||||
>มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งหรือเคย
|
>มีระยะเวลาขั้นต่ำในการดำรงตำแหน่งหรือเคยดำรงตำแหน่งในสายงานที่จะคัดเลือกตามคุณวุฒิของบุคคลและระดับตำแหน่งที่จะคัดเลือก</q-item-label
|
||||||
ดำรงตำแหน่งในสายงานที่จะคัดเลือก
|
|
||||||
ตามคุณวุฒิของบุคคลและระดับตำแหน่งที่จะคัดเลือก</q-item-label
|
|
||||||
>
|
>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
|
||||||
|
|
@ -284,7 +284,7 @@ function formattedNumber(x: number) {
|
||||||
borderless
|
borderless
|
||||||
:model-value="date2Thai(education.finishDate)"
|
:model-value="date2Thai(education.finishDate)"
|
||||||
readonly
|
readonly
|
||||||
label="วันทราสำเร็จการศึกษา"
|
label="วันที่สำเร็จการศึกษา"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon class="size-icon" name="o_calendar_today" />
|
<q-icon class="size-icon" name="o_calendar_today" />
|
||||||
|
|
@ -410,7 +410,7 @@ function formattedNumber(x: number) {
|
||||||
|
|
||||||
<q-card bordered style="border: 1px solid #d6dee1">
|
<q-card bordered style="border: 1px solid #d6dee1">
|
||||||
<div class="text-weight-bold row items-center bg-grey-2">
|
<div class="text-weight-bold row items-center bg-grey-2">
|
||||||
<span class="q-ml-lg q-my-sm">ผลงานทีเคยเสนอขอประเมิน (ถ้ามี)</span>
|
<span class="q-ml-lg q-my-sm">ผลงานที่เคยเสนอขอประเมิน (ถ้ามี)</span>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="row q-pa-sm">
|
<div class="row q-pa-sm">
|
||||||
|
|
|
||||||
|
|
@ -858,6 +858,67 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชั่นคำนวนจำนวน ปี เดือน วัน
|
||||||
|
* @param startDate วันเริ่มต้น format MM-DD-YYYY"
|
||||||
|
* @param endDate วันสิ้นสุด format MM-DD-YYYY"
|
||||||
|
* @returns ผลการคำนวน ปี เดือน วัน ในรูปแบบ 1 ปี 10 เดือน 5 วัน
|
||||||
|
*/
|
||||||
|
function calculateDurationYmd(startDate: any, endDate: any) {
|
||||||
|
if (startDate && endDate) {
|
||||||
|
const start = new Date(startDate);
|
||||||
|
const end = new Date(endDate);
|
||||||
|
|
||||||
|
//Get the Timestamp
|
||||||
|
const date1_time_stamp = start.getTime();
|
||||||
|
const date2_time_stamp = end.getTime();
|
||||||
|
|
||||||
|
let calc;
|
||||||
|
|
||||||
|
//Check which timestamp is greater
|
||||||
|
if (date1_time_stamp > date2_time_stamp) {
|
||||||
|
calc = new Date(date1_time_stamp - date2_time_stamp);
|
||||||
|
} else {
|
||||||
|
calc = new Date(date2_time_stamp - date1_time_stamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//retrieve the date, month and year
|
||||||
|
const calcFormatTmp =
|
||||||
|
calc.getDate() + "-" + (calc.getMonth() + 1) + "-" + calc.getFullYear();
|
||||||
|
//Convert to an array and store
|
||||||
|
const calcFormat = calcFormatTmp.split("-");
|
||||||
|
//Subtract each member of our array from the default date
|
||||||
|
const days_passed = Number(Math.abs(Number(calcFormat[0])) - 1);
|
||||||
|
const months_passed = Number(Math.abs(Number(calcFormat[1])) - 1);
|
||||||
|
const years_passed = Number(Math.abs(Number(calcFormat[2])) - 1970);
|
||||||
|
|
||||||
|
//Set up custom text
|
||||||
|
const yrsTxt = "ปี";
|
||||||
|
const mnthsTxt = "เดือน";
|
||||||
|
const daysTxt = "วัน";
|
||||||
|
|
||||||
|
//display result with custom text
|
||||||
|
const result =
|
||||||
|
(years_passed > 0 && (months_passed > 0 || days_passed > 0)
|
||||||
|
? years_passed + " " + yrsTxt + ", "
|
||||||
|
: "") +
|
||||||
|
(years_passed > 0 && months_passed == 0 && days_passed == 0
|
||||||
|
? years_passed + " " + yrsTxt + " "
|
||||||
|
: "") +
|
||||||
|
(months_passed > 0 && days_passed > 0
|
||||||
|
? months_passed + " " + mnthsTxt + ", "
|
||||||
|
: "") +
|
||||||
|
(months_passed > 0 && days_passed == 0
|
||||||
|
? months_passed + " " + mnthsTxt + " "
|
||||||
|
: "") +
|
||||||
|
(days_passed > 0 ? days_passed + " " + daysTxt : "");
|
||||||
|
|
||||||
|
return result.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
calAge,
|
calAge,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
|
|
@ -886,6 +947,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
typeChangeName,
|
typeChangeName,
|
||||||
statusLeave,
|
statusLeave,
|
||||||
modalWarning,
|
modalWarning,
|
||||||
|
calculateDurationYmd,
|
||||||
// common dialog
|
// common dialog
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
dialogRemove,
|
dialogRemove,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue