Merge branch 'develop'
This commit is contained in:
commit
1901a225d0
14 changed files with 131 additions and 77 deletions
|
|
@ -15,7 +15,7 @@ const typeForm = defineModel<string>("type", { required: true });
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dateToISO, messageError } = mixin;
|
const { date2Thai, dateToISO, messageError, convertDateToAPI } = mixin;
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveDocumentRef = ref<any>(null);
|
const leaveDocumentRef = ref<any>(null);
|
||||||
|
|
||||||
|
|
@ -125,11 +125,11 @@ function onValidate() {
|
||||||
formData.append("leaveRange", formDataSick.leaveRange);
|
formData.append("leaveRange", formDataSick.leaveRange);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataSick.leaveStartDate))
|
convertDateToAPI(formDataSick.leaveStartDate) ?? ""
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataSick.leaveEndDate))
|
convertDateToAPI(formDataSick.leaveEndDate) ?? ""
|
||||||
);
|
);
|
||||||
formData.append("leaveWrote", formDataSick.leaveWrote);
|
formData.append("leaveWrote", formDataSick.leaveWrote);
|
||||||
formData.append("leaveAddress", formDataSick.leaveAddress);
|
formData.append("leaveAddress", formDataSick.leaveAddress);
|
||||||
|
|
@ -150,8 +150,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataSick.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataSick.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataSick.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataSick.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -375,6 +375,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type { FormRef } from "@/modules/05_leave/interface/request/BirthForm";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dateToISO, messageError } = mixin;
|
const { date2Thai, dateToISO, messageError, convertDateToAPI } = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
|
|
@ -106,11 +106,11 @@ function onValidate() {
|
||||||
formData.append("type", formDataBirth.type);
|
formData.append("type", formDataBirth.type);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataBirth.leaveStartDate))
|
convertDateToAPI(formDataBirth.leaveStartDate) ?? ""
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataBirth.leaveEndDate))
|
convertDateToAPI(formDataBirth.leaveEndDate) ?? ""
|
||||||
);
|
);
|
||||||
formData.append("leaveWrote", formDataBirth.leaveWrote);
|
formData.append("leaveWrote", formDataBirth.leaveWrote);
|
||||||
formData.append("leaveAddress", formDataBirth.leaveAddress);
|
formData.append("leaveAddress", formDataBirth.leaveAddress);
|
||||||
|
|
@ -132,8 +132,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataBirth.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataBirth.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataBirth.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataBirth.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -296,6 +296,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import type { FormRef } from "@/modules/05_leave/interface/request/HelpWifeForm"
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, calculateDurationYmd, dateToISO, messageError } = mixin;
|
const { date2Thai, calculateDurationYmd, dateToISO, messageError,convertDateToAPI } = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
|
|
@ -117,11 +117,11 @@ function onValidate() {
|
||||||
formData.append("type", formDataHelpWife.type);
|
formData.append("type", formDataHelpWife.type);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataHelpWife.leaveStartDate))
|
convertDateToAPI(formDataHelpWife.leaveStartDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataHelpWife.leaveEndDate))
|
convertDateToAPI(formDataHelpWife.leaveEndDate)??''
|
||||||
);
|
);
|
||||||
formData.append("leaveWrote", formDataHelpWife.leaveWrote);
|
formData.append("leaveWrote", formDataHelpWife.leaveWrote);
|
||||||
formData.append("leaveAddress", formDataHelpWife.leaveAddress);
|
formData.append("leaveAddress", formDataHelpWife.leaveAddress);
|
||||||
|
|
@ -130,7 +130,7 @@ function onValidate() {
|
||||||
formData.append("wifeDayName", formDataHelpWife.wifeDayName);
|
formData.append("wifeDayName", formDataHelpWife.wifeDayName);
|
||||||
formData.append(
|
formData.append(
|
||||||
"wifeDayDateBorn",
|
"wifeDayDateBorn",
|
||||||
dateToISO(new Date(formDataHelpWife.wifeDayDateBorn))
|
convertDateToAPI(formDataHelpWife.wifeDayDateBorn)??''
|
||||||
);
|
);
|
||||||
formData.append("leaveTotal", formDataHelpWife.leaveTotal);
|
formData.append("leaveTotal", formDataHelpWife.leaveTotal);
|
||||||
|
|
||||||
|
|
@ -159,8 +159,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataHelpWife.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataHelpWife.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataHelpWife.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataHelpWife.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -321,6 +321,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import type { FormRef } from "@/modules/05_leave/interface/request/VacationForm"
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dateToISO, messageError } = mixin;
|
const { date2Thai, dateToISO, messageError,convertDateToAPI } = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
|
|
@ -138,11 +138,11 @@ function onValidate() {
|
||||||
formData.append("leaveRange", formDataVacation.leaveRange);
|
formData.append("leaveRange", formDataVacation.leaveRange);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataVacation.leaveStartDate))
|
convertDateToAPI(formDataVacation.leaveStartDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataVacation.leaveEndDate))
|
convertDateToAPI(formDataVacation.leaveEndDate)??''
|
||||||
);
|
);
|
||||||
formData.append("leaveWrote", formDataVacation.leaveWrote);
|
formData.append("leaveWrote", formDataVacation.leaveWrote);
|
||||||
formData.append("leaveAddress", formDataVacation.leaveAddress);
|
formData.append("leaveAddress", formDataVacation.leaveAddress);
|
||||||
|
|
@ -164,8 +164,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataVacation.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataVacation.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataVacation.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataVacation.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -387,6 +387,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type { OrdinationForm } from "@/modules/05_leave/interface/request/AddAbs
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, calculateDurationYmd, dateToISO, messageError } = mixin;
|
const { date2Thai, calculateDurationYmd, dateToISO, messageError,convertDateToAPI } = mixin;
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
|
|
||||||
|
|
@ -122,15 +122,15 @@ function onValidate() {
|
||||||
formData.append("type", formDataOrdination.type);
|
formData.append("type", formDataOrdination.type);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataOrdination.leaveStartDate))
|
convertDateToAPI(formDataOrdination.leaveStartDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataOrdination.leaveEndDate))
|
convertDateToAPI(formDataOrdination.leaveEndDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"ordainDayOrdination",
|
"ordainDayOrdination",
|
||||||
dateToISO(new Date(formDataOrdination.ordainDayOrdination))
|
convertDateToAPI(formDataOrdination.ordainDayOrdination)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"ordainDayLocationName",
|
"ordainDayLocationName",
|
||||||
|
|
@ -170,8 +170,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataOrdination.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataOrdination.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataOrdination.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataOrdination.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -360,6 +360,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
:readonly="
|
:readonly="
|
||||||
!formDataOrdination.leaveStartDate || statusCheck === 'NEW'
|
!formDataOrdination.leaveStartDate || statusCheck === 'NEW'
|
||||||
"
|
"
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type { HajiForm } from "@/modules/05_leave/interface/request/AddAbsence";
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, calculateDurationYmd, messageError, dateToISO } = mixin;
|
const { date2Thai, calculateDurationYmd, messageError, dateToISO,convertDateToAPI } = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<any>("");
|
const leaveId = ref<any>("");
|
||||||
|
|
@ -99,11 +99,11 @@ function onValidate() {
|
||||||
formData.append("type", formDataHaji.type);
|
formData.append("type", formDataHaji.type);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataHaji.leaveStartDate))
|
convertDateToAPI(formDataHaji.leaveStartDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataHaji.leaveEndDate))
|
convertDateToAPI(formDataHaji.leaveEndDate)??''
|
||||||
);
|
);
|
||||||
formData.append("hajjDayStatus", formDataHaji.hajjDayStatus);
|
formData.append("hajjDayStatus", formDataHaji.hajjDayStatus);
|
||||||
formData.append("leaveWrote", formDataHaji.leaveWrote);
|
formData.append("leaveWrote", formDataHaji.leaveWrote);
|
||||||
|
|
@ -123,8 +123,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataHaji.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataHaji.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataHaji.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataHaji.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -298,6 +298,7 @@ onMounted(() => {
|
||||||
? date2Thai(formDataHaji.leaveEndDate)
|
? date2Thai(formDataHaji.leaveEndDate)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
@update:model-value="fetchCheck()"
|
@update:model-value="fetchCheck()"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type { MilitaryForm } from "@/modules/05_leave/interface/request/AddAbsen
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, calculateDurationYmd, dateToISO, messageError } = mixin;
|
const { date2Thai, calculateDurationYmd, dateToISO, messageError,convertDateToAPI } = mixin;
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
|
|
||||||
|
|
@ -117,17 +117,17 @@ function onValidate() {
|
||||||
formData.append("type", formDataMilitary.type);
|
formData.append("type", formDataMilitary.type);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataMilitary.leaveStartDate))
|
convertDateToAPI(formDataMilitary.leaveStartDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataMilitary.leaveEndDate))
|
convertDateToAPI(formDataMilitary.leaveEndDate)??''
|
||||||
);
|
);
|
||||||
formData.append("absentDaySummon", formDataMilitary.absentDaySummon);
|
formData.append("absentDaySummon", formDataMilitary.absentDaySummon);
|
||||||
formData.append("absentDayLocation", formDataMilitary.absentDayLocation);
|
formData.append("absentDayLocation", formDataMilitary.absentDayLocation);
|
||||||
formData.append(
|
formData.append(
|
||||||
"absentDayRegistorDate",
|
"absentDayRegistorDate",
|
||||||
dateToISO(new Date(formDataMilitary.absentDayRegistorDate))
|
convertDateToAPI(formDataMilitary.absentDayRegistorDate)??''
|
||||||
);
|
);
|
||||||
formData.append("absentDayGetIn", formDataMilitary.absentDayGetIn);
|
formData.append("absentDayGetIn", formDataMilitary.absentDayGetIn);
|
||||||
formData.append("absentDayAt", formDataMilitary.absentDayAt);
|
formData.append("absentDayAt", formDataMilitary.absentDayAt);
|
||||||
|
|
@ -147,8 +147,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataMilitary.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataMilitary.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataMilitary.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataMilitary.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -316,6 +316,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ const {
|
||||||
dateToISO,
|
dateToISO,
|
||||||
messageError,
|
messageError,
|
||||||
arabicNumberToText,
|
arabicNumberToText,
|
||||||
|
convertDateToAPI
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
|
|
@ -134,17 +135,17 @@ function onValidate() {
|
||||||
formData.append("type", formDataStudy.type); //
|
formData.append("type", formDataStudy.type); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataStudy.leaveStartDate))
|
convertDateToAPI(formDataStudy.leaveStartDate)??''
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataStudy.leaveEndDate))
|
convertDateToAPI(formDataStudy.leaveEndDate)??''
|
||||||
);
|
);
|
||||||
formData.append("studyDaySubject", formDataStudy.studyDaySubject);
|
formData.append("studyDaySubject", formDataStudy.studyDaySubject);
|
||||||
formData.append("studyDayDegreeLevel", formDataStudy.studyDayDegreeLevel);
|
formData.append("studyDayDegreeLevel", formDataStudy.studyDayDegreeLevel);
|
||||||
// formData.append(
|
// formData.append(
|
||||||
// "leavegovernmentDate",
|
// "leavegovernmentDate",
|
||||||
// dateToISO(new Date(formDataStudy.leavegovernmentDate))
|
// convertDateToAPI(formDataStudy.leavegovernmentDate)??''
|
||||||
// );
|
// );
|
||||||
formData.append(
|
formData.append(
|
||||||
"studyDayUniversityName",
|
"studyDayUniversityName",
|
||||||
|
|
@ -167,8 +168,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataStudy.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataStudy.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataStudy.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataStudy.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -354,6 +355,7 @@ onMounted(async () => {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
:readonly="!formDataStudy.leaveStartDate || statusCheck === 'NEW'"
|
:readonly="!formDataStudy.leaveStartDate || statusCheck === 'NEW'"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
:model-value="
|
:model-value="
|
||||||
formDataStudy.leaveEndDate != null
|
formDataStudy.leaveEndDate != null
|
||||||
? date2Thai(formDataStudy.leaveEndDate)
|
? date2Thai(formDataStudy.leaveEndDate)
|
||||||
|
|
@ -474,7 +476,6 @@ onMounted(async () => {
|
||||||
? date2Thai(dataStore.birthDate)
|
? date2Thai(dataStore.birthDate)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ const {
|
||||||
calculateDurationYmd,
|
calculateDurationYmd,
|
||||||
dateToISO,
|
dateToISO,
|
||||||
messageError,
|
messageError,
|
||||||
|
convertDateToAPI
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
|
|
@ -124,11 +125,11 @@ function onValidate() {
|
||||||
formData.append("type", formDataTrain.type); //
|
formData.append("type", formDataTrain.type); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataTrain.leaveStartDate))
|
convertDateToAPI(formDataTrain.leaveStartDate)??''
|
||||||
); //
|
); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataTrain.leaveEndDate))
|
convertDateToAPI(formDataTrain.leaveEndDate)??''
|
||||||
); //
|
); //
|
||||||
formData.append("studyDayCountry", formDataTrain.studyDayCountry);
|
formData.append("studyDayCountry", formDataTrain.studyDayCountry);
|
||||||
formData.append("studyDayTrainingName", formDataTrain.studyDayTrainingName);
|
formData.append("studyDayTrainingName", formDataTrain.studyDayTrainingName);
|
||||||
|
|
@ -154,8 +155,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataTrain.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataTrain.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataTrain.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataTrain.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -340,6 +341,7 @@ onMounted(async () => {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
:readonly="!formDataTrain.leaveStartDate || statusCheck === 'NEW'"
|
:readonly="!formDataTrain.leaveStartDate || statusCheck === 'NEW'"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
:model-value="
|
:model-value="
|
||||||
formDataTrain.leaveEndDate != null
|
formDataTrain.leaveEndDate != null
|
||||||
? date2Thai(formDataTrain.leaveEndDate)
|
? date2Thai(formDataTrain.leaveEndDate)
|
||||||
|
|
@ -462,7 +464,6 @@ onMounted(async () => {
|
||||||
? date2Thai(dataStore.birthDate)
|
? date2Thai(dataStore.birthDate)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import type { FormRef } from "@/modules/05_leave/interface/request/WorkInternati
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dateToISO, messageError, showLoader, hideLoader } = mixin;
|
const { date2Thai, dateToISO, messageError, showLoader, hideLoader,convertDateToAPI } = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const isSave = ref<boolean>(false);
|
const isSave = ref<boolean>(false);
|
||||||
|
|
@ -109,11 +109,11 @@ async function onValidate() {
|
||||||
formData.append("type", formDataWorkInternational.type); //
|
formData.append("type", formDataWorkInternational.type); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(formDataWorkInternational.leaveStartDate)
|
convertDateToAPI(formDataWorkInternational.leaveStartDate)??''
|
||||||
); //
|
); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(formDataWorkInternational.leaveEndDate)
|
convertDateToAPI(formDataWorkInternational.leaveEndDate)??''
|
||||||
); //
|
); //
|
||||||
formData.append("leaveWrote", formDataWorkInternational.leaveWrote); //
|
formData.append("leaveWrote", formDataWorkInternational.leaveWrote); //
|
||||||
formData.append("leaveDetail", formDataWorkInternational.leaveDetail);
|
formData.append("leaveDetail", formDataWorkInternational.leaveDetail);
|
||||||
|
|
@ -150,8 +150,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataWorkInternational.leaveStartDate ?? null,
|
StartLeaveDate: convertDateToAPI(formDataWorkInternational.leaveStartDate) ?? null,
|
||||||
EndLeaveDate: formDataWorkInternational.leaveEndDate ?? null,
|
EndLeaveDate: convertDateToAPI(formDataWorkInternational.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -332,6 +332,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
:bottom-slots="!isLeave ? true : false"
|
:bottom-slots="!isLeave ? true : false"
|
||||||
:color="!isLeave ? 'red' : 'black'"
|
:color="!isLeave ? 'red' : 'black'"
|
||||||
:bg-color="!isLeave ? 'red-2' : 'white'"
|
:bg-color="!isLeave ? 'red-2' : 'white'"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,13 @@ const dataStore = useLeaveStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
||||||
const { date2Thai, calculateDurationYmd, dateToISO, messageError } = mixin;
|
const {
|
||||||
|
date2Thai,
|
||||||
|
calculateDurationYmd,
|
||||||
|
dateToISO,
|
||||||
|
messageError,
|
||||||
|
convertDateToAPI,
|
||||||
|
} = mixin;
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
|
|
||||||
|
|
@ -131,23 +137,19 @@ function onValidate() {
|
||||||
formData.append("type", formDataFollowSpouse.type); //
|
formData.append("type", formDataFollowSpouse.type); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataFollowSpouse.leaveStartDate))
|
convertDateToAPI(formDataFollowSpouse.leaveStartDate) ?? ""
|
||||||
); //
|
); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataFollowSpouse.leaveEndDate))
|
convertDateToAPI(formDataFollowSpouse.leaveEndDate) ?? ""
|
||||||
); //
|
); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"coupleDayStartDateHistory",
|
"coupleDayStartDateHistory",
|
||||||
formDataFollowSpouse.coupleDayStartDateHistory
|
convertDateToAPI(formDataFollowSpouse.coupleDayStartDateHistory) ?? ""
|
||||||
? dateToISO(new Date(formDataFollowSpouse.coupleDayStartDateHistory))
|
|
||||||
: ""
|
|
||||||
); //
|
); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"coupleDayEndDateHistory",
|
"coupleDayEndDateHistory",
|
||||||
formDataFollowSpouse.coupleDayEndDateHistory
|
convertDateToAPI(formDataFollowSpouse.coupleDayEndDateHistory) ?? ""
|
||||||
? dateToISO(new Date(formDataFollowSpouse.coupleDayEndDateHistory))
|
|
||||||
: ""
|
|
||||||
); //
|
); //
|
||||||
formData.append("leaveWrote", formDataFollowSpouse.leaveWrote); //
|
formData.append("leaveWrote", formDataFollowSpouse.leaveWrote); //
|
||||||
formData.append("leaveDetail", formDataFollowSpouse.leaveDetail); //
|
formData.append("leaveDetail", formDataFollowSpouse.leaveDetail); //
|
||||||
|
|
@ -187,8 +189,9 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataFollowSpouse.leaveStartDate ?? null,
|
StartLeaveDate:
|
||||||
EndLeaveDate: formDataFollowSpouse.leaveEndDate ?? null,
|
convertDateToAPI(formDataFollowSpouse.leaveStartDate) ?? null,
|
||||||
|
EndLeaveDate: convertDateToAPI(formDataFollowSpouse.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -425,6 +428,7 @@ onMounted(async () => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,14 @@ import genReport from "@/plugins/genreport";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dateToISO, messageError, showLoader, hideLoader } = mixin;
|
const {
|
||||||
|
date2Thai,
|
||||||
|
dateToISO,
|
||||||
|
messageError,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
convertDateToAPI,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
const isSave = ref<boolean>(false);
|
const isSave = ref<boolean>(false);
|
||||||
|
|
@ -78,11 +85,11 @@ async function onValidate() {
|
||||||
formData.append("type", formDataRehabilitation.type); //
|
formData.append("type", formDataRehabilitation.type); //
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveStartDate",
|
"leaveStartDate",
|
||||||
dateToISO(new Date(formDataRehabilitation.leaveStartDate))
|
convertDateToAPI(formDataRehabilitation.leaveStartDate) ?? ""
|
||||||
);
|
);
|
||||||
formData.append(
|
formData.append(
|
||||||
"leaveEndDate",
|
"leaveEndDate",
|
||||||
dateToISO(new Date(formDataRehabilitation.leaveEndDate))
|
convertDateToAPI(formDataRehabilitation.leaveEndDate) ?? ""
|
||||||
);
|
);
|
||||||
formData.append("leaveWrote", formDataRehabilitation.leaveWrote); //
|
formData.append("leaveWrote", formDataRehabilitation.leaveWrote); //
|
||||||
formData.append("leaveDetail", formDataRehabilitation.leaveDetail); //
|
formData.append("leaveDetail", formDataRehabilitation.leaveDetail); //
|
||||||
|
|
@ -110,8 +117,10 @@ async function FetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataRehabilitation.leaveStartDate ?? null,
|
StartLeaveDate:
|
||||||
EndLeaveDate: formDataRehabilitation.leaveEndDate ?? null,
|
convertDateToAPI(formDataRehabilitation.leaveStartDate) ?? null,
|
||||||
|
EndLeaveDate:
|
||||||
|
convertDateToAPI(formDataRehabilitation.leaveEndDate) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -295,6 +304,7 @@ onMounted(() => {
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
:label="`${'ลาถึงวันที่'}`"
|
:label="`${'ลาถึงวันที่'}`"
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกลาถึงวันที่'}`]"
|
||||||
:bottom-slots="!isLeave ? true : false"
|
:bottom-slots="!isLeave ? true : false"
|
||||||
:color="!isLeave ? 'red' : 'black'"
|
:color="!isLeave ? 'red' : 'black'"
|
||||||
:bg-color="!isLeave ? 'red-2' : 'white'"
|
:bg-color="!isLeave ? 'red-2' : 'white'"
|
||||||
|
|
|
||||||
|
|
@ -508,6 +508,8 @@ function onSearch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchDataTenure() {
|
async function fetchDataTenure() {
|
||||||
|
console.log(link.value);
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.salaryTenurePosition(link.value))
|
.get(config.API.salaryTenurePosition(link.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -521,18 +523,26 @@ async function fetchDataTenure() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// แปลงข้อมูลจาก data
|
// แปลงข้อมูลจาก data
|
||||||
const position = formatData(data.position); //ระยะเวลาดำรงตำแหน่งในสายงาน
|
const position = data.position ? formatData(data.position) : []; //ระยะเวลาดำรงตำแหน่งในสายงาน
|
||||||
const posLevel = formatData(data.posLevel); //ระยะเวลาดำรงตำแหน่งตามระดับ
|
const posLevel = data.posLevel ? formatData(data.posLevel) : []; //ระยะเวลาดำรงตำแหน่งตามระดับ
|
||||||
const posExecutive = formatData(data.posExecutive); //ระยะเวลาดำรงตำแหน่งทางการบริหาร
|
const posExecutive = data.posExecutive
|
||||||
|
? formatData(data.posExecutive)
|
||||||
|
: []; //ระยะเวลาดำรงตำแหน่งทางการบริหาร
|
||||||
|
|
||||||
// นำข้อมูลไปใส่ใน cardData
|
// นำข้อมูลไปใส่ใน cardData
|
||||||
cardData.value[0].data = position;
|
cardData.value[0].data = position;
|
||||||
cardData.value[1].data = posLevel;
|
cardData.value[1].data = posLevel;
|
||||||
cardData.value[2].data = posExecutive;
|
if (link.value !== "-employee") {
|
||||||
|
cardData.value[2].data = posExecutive;
|
||||||
|
}
|
||||||
|
|
||||||
//เช็คค่า ระยะเวลาดำรงตำแหน่งทางการบริหาร ถ้าไม่มีให้ลบออกจาก cardData
|
//เช็คค่า ระยะเวลาดำรงตำแหน่งทางการบริหาร ถ้าไม่มีให้ลบออกจาก cardData
|
||||||
if (posExecutive.length === 0) {
|
if (
|
||||||
cardData.value.splice(2, 2);
|
posExecutive.length === 0 &&
|
||||||
|
link.value !== "-employee" &&
|
||||||
|
cardData.value.length > 2
|
||||||
|
) {
|
||||||
|
cardData.value.splice(2, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -543,6 +553,9 @@ async function fetchDataTenure() {
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
link.value = await dataPerson.getProFileType();
|
link.value = await dataPerson.getProFileType();
|
||||||
|
if (link.value === "-employee") {
|
||||||
|
cardData.value.splice(2, 1);
|
||||||
|
}
|
||||||
getData();
|
getData();
|
||||||
fetchDataTenure();
|
fetchDataTenure();
|
||||||
});
|
});
|
||||||
|
|
@ -555,7 +568,7 @@ onMounted(async () => {
|
||||||
<span class="text-blue-6 text-weight-bold text-body1">ตำแหน่ง</span>
|
<span class="text-blue-6 text-weight-bold text-body1">ตำแหน่ง</span>
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-pb-sm" v-if="link === ''">
|
<div class="row q-col-gutter-sm q-pb-sm">
|
||||||
<div class="col" v-for="(item, index) in cardData" :key="index">
|
<div class="col" v-for="(item, index) in cardData" :key="index">
|
||||||
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
||||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
|
<div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import moment from "moment";
|
||||||
import CustomComponent from "@/components/CustomDialog.vue";
|
import CustomComponent from "@/components/CustomDialog.vue";
|
||||||
import { Loading, QSpinnerCube } from "quasar";
|
import { Loading, QSpinnerCube } from "quasar";
|
||||||
import { logout } from "@/plugins/auth";
|
import { logout } from "@/plugins/auth";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
moment.locale("th");
|
moment.locale("th");
|
||||||
export const useCounterMixin = defineStore("mixin", () => {
|
export const useCounterMixin = defineStore("mixin", () => {
|
||||||
|
|
@ -1172,6 +1173,20 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
// return `${y} ปี ${m} เดือน ${d} วัน`;
|
// return `${y} ปี ${m} เดือน ${d} วัน`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// กรณีมีเฉพาะ date
|
||||||
|
function convertDateToAPI(date: Date | null) {
|
||||||
|
return date
|
||||||
|
? format(utcToZonedTime(date, "Asia/Bangkok"), "yyyy-MM-dd")
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// กรณี datetime
|
||||||
|
function convertDatetimeToAPI(date: Date | null) {
|
||||||
|
return date
|
||||||
|
? format(utcToZonedTime(date, "Asia/Bangkok"), "yyyy-MM-dd HH:mm:ss")
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
calAge,
|
calAge,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
|
|
@ -1212,5 +1227,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
||||||
findPosMasterNo,
|
findPosMasterNo,
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
formatDatePosition,
|
formatDatePosition,
|
||||||
|
convertDateToAPI,
|
||||||
|
convertDatetimeToAPI,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue