Merge branch 'develop'

This commit is contained in:
Warunee Tamkoo 2025-03-31 18:06:41 +07:00
commit 21b9daac89
42 changed files with 584 additions and 185 deletions

View file

@ -432,7 +432,7 @@ watch(
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh;">
<q-card-section class="scroll" style="max-height: 60vh;">
<div class="row">
<div
flat

View file

@ -48,8 +48,6 @@ const formDataSick = reactive<any>({
leaveRange: "ALL",
leaveTotal: "",
leaveLast: null,
leaveNumber: "",
leaveAddress: "",
leaveDetail: "",
leaveDocument: [],
});
@ -132,8 +130,8 @@ function onValidate() {
convertDateToAPI(formDataSick.leaveEndDate) ?? ""
);
formData.append("leaveWrote", formDataSick.leaveWrote);
formData.append("leaveAddress", formDataSick.leaveAddress);
formData.append("leaveNumber", formDataSick.leaveNumber);
formData.append("leaveAddress", dataStore.currentAddress);
formData.append("leaveNumber", dataStore.telephoneNumber);
formData.append("leaveDetail", formDataSick.leaveDetail);
formData.append("leaveTotal", formDataSick.leaveTotal);
props.onSubmit(formData, isLeave.value);
@ -212,11 +210,9 @@ watch(props.data, () => {
formDataSick.leaveEndDate = new Date(props.data.leaveEndDate);
formDataSick.contractTel = props.data.contractTel;
formDataSick.leaveTotal = props.data.leaveTotal;
formDataSick.leaveNumber = props.data.leaveNumber;
formDataSick.leaveDetail = props.data.leaveDetail;
formDataSick.leaveRange = props.data.leaveRange;
leaveDocumentList.value = props.data.leaveDocument;
formDataSick.leaveAddress = props.data.leaveAddress;
statusCheck.value = props.data.status;
formDataSick.leaveDocument = [];
}
@ -230,11 +226,9 @@ onMounted(() => {
formDataSick.leaveEndDate = new Date(props.data.leaveEndDate);
formDataSick.contractTel = props.data.contractTel;
formDataSick.leaveTotal = props.data.leaveTotal;
formDataSick.leaveNumber = props.data.leaveNumber;
formDataSick.leaveDetail = props.data.leaveDetail;
formDataSick.leaveRange = props.data.leaveRange;
leaveDocumentList.value = props.data.leaveDocument;
formDataSick.leaveAddress = props.data.leaveAddress;
statusCheck.value = props.data.status;
leaveId.value = props.data.id;
}
@ -432,10 +426,11 @@ onMounted(() => {
outlined
ref="leaveNumberRef"
for="leaveNumberRef"
v-model="formDataSick.leaveNumber"
v-model="dataStore.telephoneNumber"
mask="(###)-###-####"
hide-bottom-space
bg-color="white"
lazy-rules
unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit || statusCheck === 'NEW'"
@ -450,7 +445,7 @@ onMounted(() => {
outlined
ref="leaveAddressRef"
for="leaveAddressRef"
v-model="formDataSick.leaveAddress"
v-model="dataStore.currentAddress"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit || statusCheck === 'NEW'"
:rules="[
@ -469,7 +464,7 @@ onMounted(() => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataSick.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
bg-color="white"
/>

View file

@ -46,8 +46,6 @@ const formDataBirth = reactive<any>({
leaveEndDate: null,
leaveTotal: "",
leaveLast: "",
leaveNumber: "",
leaveAddress: "",
leaveDetail: "",
leaveDocument: [],
});
@ -113,8 +111,8 @@ function onValidate() {
convertDateToAPI(formDataBirth.leaveEndDate) ?? ""
);
formData.append("leaveWrote", formDataBirth.leaveWrote);
formData.append("leaveAddress", formDataBirth.leaveAddress);
formData.append("leaveNumber", formDataBirth.leaveNumber);
formData.append("leaveAddress", dataStore.currentAddress);
formData.append("leaveNumber", dataStore.telephoneNumber);
formData.append("leaveDetail", formDataBirth.leaveDetail);
formData.append("leaveTotal", formDataBirth.leaveTotal);
@ -162,8 +160,6 @@ watch(props.data, () => {
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;
@ -178,8 +174,6 @@ onMounted(() => {
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;
@ -352,9 +346,10 @@ onMounted(() => {
bg-color="white"
ref="leaveNumberRef"
for="leaveNumberRef"
v-model="formDataBirth.leaveNumber"
v-model="dataStore.telephoneNumber"
mask="(###)-###-####"
unmasked-value
lazy-rules
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit || statusCheck === 'NEW'"
:rules="[
@ -370,7 +365,7 @@ onMounted(() => {
bg-color="white"
ref="leaveAddressRef"
for="leaveAddressRef"
v-model="formDataBirth.leaveAddress"
v-model="dataStore.currentAddress"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit || statusCheck === 'NEW'"
:rules="[
@ -388,7 +383,7 @@ onMounted(() => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataBirth.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -48,8 +48,6 @@ const formDataHelpWife = reactive<any>({
leaveStartDate: null,
leaveEndDate: null,
leaveTotal: "",
leaveNumber: "",
leaveAddress: "",
leaveDetail: "",
leaveDocument: [],
});
@ -124,8 +122,8 @@ function onValidate() {
convertDateToAPI(formDataHelpWife.leaveEndDate)??''
);
formData.append("leaveWrote", formDataHelpWife.leaveWrote);
formData.append("leaveAddress", formDataHelpWife.leaveAddress);
formData.append("leaveNumber", formDataHelpWife.leaveNumber);
formData.append("leaveAddress", dataStore.currentAddress);
formData.append("leaveNumber", dataStore.telephoneNumber);
formData.append("leaveDetail", formDataHelpWife.leaveDetail);
formData.append("wifeDayName", formDataHelpWife.wifeDayName);
formData.append(
@ -187,8 +185,6 @@ watch(props.data, () => {
formDataHelpWife.leaveStartDate = props.data.leaveStartDate;
formDataHelpWife.leaveEndDate = props.data.leaveEndDate;
formDataHelpWife.leaveTotal = props.data.leaveTotal;
formDataHelpWife.leaveNumber = props.data.leaveNumber;
formDataHelpWife.leaveAddress = props.data.leaveAddress;
formDataHelpWife.leaveDetail = props.data.leaveDetail;
formDataHelpWife.leaveDocument = [];
leaveDocumentList.value = props.data.leaveDocument;
@ -205,8 +201,6 @@ onMounted(() => {
formDataHelpWife.leaveStartDate = props.data.leaveStartDate;
formDataHelpWife.leaveEndDate = props.data.leaveEndDate;
formDataHelpWife.leaveTotal = props.data.leaveTotal;
formDataHelpWife.leaveNumber = props.data.leaveNumber;
formDataHelpWife.leaveAddress = props.data.leaveAddress;
formDataHelpWife.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status;
@ -426,10 +420,11 @@ onMounted(() => {
outlined
ref="leaveNumberRef"
for="leaveNumberRef"
v-model="formDataHelpWife.leaveNumber"
v-model="dataStore.telephoneNumber"
mask="(###)-###-####"
unmasked-value
hide-bottom-space
lazy-rules
bg-color="white"
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit || statusCheck === 'NEW'"
@ -446,7 +441,7 @@ onMounted(() => {
bg-color="white"
ref="leaveAddressRef"
for="leaveAddressRef"
v-model="formDataHelpWife.leaveAddress"
v-model="dataStore.currentAddress"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit || statusCheck === 'NEW'"
:rules="[
@ -465,7 +460,7 @@ onMounted(() => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataHelpWife.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -49,8 +49,6 @@ const formDataVacation = reactive<any>({
leaveStartDate: null,
leaveEndDate: null,
leaveTotal: "",
leaveNumber: "",
leaveAddress: "",
leaveDetail: "",
leaveDocument: [],
});
@ -145,8 +143,8 @@ function onValidate() {
convertDateToAPI(formDataVacation.leaveEndDate)??''
);
formData.append("leaveWrote", formDataVacation.leaveWrote);
formData.append("leaveAddress", formDataVacation.leaveAddress);
formData.append("leaveNumber", formDataVacation.leaveNumber);
formData.append("leaveAddress", dataStore.currentAddress);
formData.append("leaveNumber", dataStore.telephoneNumber);
formData.append("leaveDetail", formDataVacation.leaveDetail);
formData.append("leaveTotal", formDataVacation.leaveTotal);
props.onSubmit(formData, isLeave.value);
@ -203,8 +201,7 @@ watch(props.data, () => {
formDataVacation.leaveStartDate = props.data.leaveStartDate;
formDataVacation.leaveEndDate = props.data.leaveEndDate;
formDataVacation.leaveTotal = props.data.leaveTotal;
formDataVacation.leaveNumber = props.data.leaveNumber;
formDataVacation.leaveAddress = props.data.leaveAddress;
formDataVacation.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status;
@ -222,8 +219,7 @@ onMounted(() => {
formDataVacation.leaveStartDate = props.data.leaveStartDate;
formDataVacation.leaveEndDate = props.data.leaveEndDate;
formDataVacation.leaveTotal = props.data.leaveTotal;
formDataVacation.leaveNumber = props.data.leaveNumber;
formDataVacation.leaveAddress = props.data.leaveAddress;
formDataVacation.leaveDetail = props.data.leaveDetail;
leaveDocumentList.value = props.data.leaveDocument;
statusCheck.value = props.data.status;
@ -431,8 +427,9 @@ onMounted(() => {
bg-color="white"
ref="leaveNumberRef"
for="leaveNumberRef"
v-model="formDataVacation.leaveNumber"
v-model="dataStore.telephoneNumber"
mask="(###)-###-####"
lazy-rules
unmasked-value
label="หมายเลขโทรศัพท์ที่ติดต่อได้"
:readonly="!edit || statusCheck === 'NEW'"
@ -449,7 +446,7 @@ onMounted(() => {
bg-color="white"
ref="leaveAddressRef"
for="leaveAddressRef"
v-model="formDataVacation.leaveAddress"
v-model="dataStore.currentAddress"
label="ที่อยู่ที่ติดต่อได้ระหว่างลา"
:readonly="!edit || statusCheck === 'NEW'"
:rules="[
@ -468,7 +465,7 @@ onMounted(() => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataVacation.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -138,7 +138,7 @@ function onValidate() {
);
formData.append(
"ordainDayLocationNumber",
formDataOrdination.ordainDayLocationNumber
dataStore.telephoneNumber
);
formData.append(
"ordainDayLocationAddress",
@ -214,8 +214,7 @@ watch(props.data, () => {
formDataOrdination.leaveTotal = props.data.leaveTotal;
formDataOrdination.ordainDayOrdination = props.data.ordainDayOrdination;
formDataOrdination.ordainDayLocationName = props.data.ordainDayLocationName;
formDataOrdination.ordainDayLocationNumber =
props.data.ordainDayLocationNumber;
formDataOrdination.ordainDayLocationAddress =
props.data.ordainDayLocationAddress;
formDataOrdination.ordainDayBuddhistLentName =
@ -239,8 +238,7 @@ onMounted(() => {
formDataOrdination.leaveTotal = props.data.leaveTotal;
formDataOrdination.ordainDayOrdination = props.data.ordainDayOrdination;
formDataOrdination.ordainDayLocationName = props.data.ordainDayLocationName;
formDataOrdination.ordainDayLocationNumber =
props.data.ordainDayLocationNumber;
formDataOrdination.ordainDayLocationAddress =
props.data.ordainDayLocationAddress;
formDataOrdination.ordainDayBuddhistLentName =
@ -583,9 +581,10 @@ onMounted(() => {
dense
full-width
outlined
v-model="formDataOrdination.ordainDayLocationNumber"
v-model="dataStore.telephoneNumber"
bg-color="white"
mask="(###)-###-####"
lazy-rules
unmasked-value
:readonly="!edit || statusCheck === 'NEW'"
hide-bottom-space
@ -644,7 +643,7 @@ onMounted(() => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataOrdination.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -411,7 +411,7 @@ onMounted(() => {
dense
outlined
type="textarea"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -466,7 +466,7 @@ onMounted(() => {
outlined
v-model="formDataMilitary.leaveDetail"
type="textarea"
label="รายละเอียด"
label="สาเหตุการลา"
/>
<div class="col-12" v-if="statusCheck != 'NEW'">

View file

@ -68,8 +68,6 @@ const formDataStudy = reactive<any>({
leavegovernmentDate: new Date(),
leaveSalary: 10000,
leaveSalaryText: arabicNumberToText(10000),
leaveNumber: "",
leaveAddress: "",
studyDayScholarship: "",
studyDayCountry: "",
studyDayUniversityName: "", //
@ -155,8 +153,8 @@ function onValidate() {
formData.append("leaveWrote", formDataStudy.leaveWrote); //
formData.append("leaveDetail", formDataStudy.leaveDetail); //
formData.append("studyDayScholarship", formDataStudy.studyDayScholarship);
formData.append("leaveAddress", formDataStudy.leaveAddress); //
formData.append("leaveNumber", formDataStudy.leaveNumber); //
formData.append("leaveAddress", dataStore.currentAddress); //
formData.append("leaveNumber", dataStore.telephoneNumber); //
formData.append("leaveTotal", formDataStudy.leaveTotalDay); //
props.onSubmit(formData, isLeave.value);
}
@ -206,8 +204,7 @@ watch(props.data, async () => {
formDataStudy.leavegovernmentDate = props.data.leavegovernmentDate;
formDataStudy.leaveSalary = props.data.leaveSalary;
formDataStudy.leaveSalaryText = props.data.leaveSalaryText;
formDataStudy.leaveNumber = props.data.leaveNumber;
formDataStudy.leaveAddress = props.data.leaveAddress;
formDataStudy.studyDayScholarship = props.data.studyDayScholarship;
formDataStudy.studyDayCountry = props.data.studyDayCountry;
formDataStudy.studyDayUniversityName = props.data.studyDayUniversityName;
@ -236,8 +233,7 @@ onMounted(async () => {
formDataStudy.leavegovernmentDate = props.data.leavegovernmentDate;
formDataStudy.leaveSalary = props.data.leaveSalary;
formDataStudy.leaveSalaryText = props.data.leaveSalaryText;
formDataStudy.leaveNumber = props.data.leaveNumber;
formDataStudy.leaveAddress = props.data.leaveAddress;
formDataStudy.studyDayScholarship = props.data.studyDayScholarship;
formDataStudy.studyDayCountry = props.data.studyDayCountry;
formDataStudy.studyDayUniversityName = props.data.studyDayUniversityName;
@ -583,7 +579,7 @@ onMounted(async () => {
/>
<q-input
v-model="formDataStudy.leaveNumber"
v-model="dataStore.telephoneNumber"
ref="leaveNumberRef"
class="col-12 col-sm-6 col-md-4 cursor-pointer inputgreen"
bg-color="white"
@ -600,7 +596,7 @@ onMounted(async () => {
/>
<q-input
v-model="formDataStudy.leaveAddress"
v-model="dataStore.currentAddress"
ref="leaveAddressRef"
class="col-12 cursor-pointer inputgreen"
bg-color="white"
@ -624,7 +620,7 @@ onMounted(async () => {
dense
outlined
type="textarea"
label="รายละเอียด"
label="สาเหตุการลา"
/>
<div class="col-12" v-if="statusCheck != 'NEW'">

View file

@ -55,8 +55,6 @@ const formDataTrain = reactive<any>({
leavegovernmentDate: new Date(),
leaveSalary: 10000,
leaveSalaryText: arabicNumberToText(10000),
leaveNumber: "",
leaveAddress: "",
studyDayScholarship: "",
studyDayCountry: "",
studyDayTrainingSubject: "",
@ -140,8 +138,8 @@ function onValidate() {
formData.append("leaveWrote", formDataTrain.leaveWrote); //
formData.append("leaveDetail", formDataTrain.leaveDetail); //
formData.append("studyDayScholarship", formDataTrain.studyDayScholarship);
formData.append("leaveAddress", formDataTrain.leaveAddress); //
formData.append("leaveNumber", formDataTrain.leaveNumber); //
formData.append("leaveAddress", dataStore.currentAddress); //
formData.append("leaveNumber", dataStore.telephoneNumber); //
formData.append("leaveSalaryText", formDataTrain.leaveSalaryText); //
formData.append("leaveSalary", formDataTrain.leaveSalary); //
formData.append("leaveTotal", formDataTrain.leaveTotalDay); //
@ -193,8 +191,6 @@ watch(props.data, async () => {
formDataTrain.leavegovernmentDate = props.data.leavegovernmentDate;
formDataTrain.leaveSalary = props.data.leaveSalary;
formDataTrain.leaveSalaryText = props.data.leaveSalaryText;
formDataTrain.leaveNumber = props.data.leaveNumber;
formDataTrain.leaveAddress = props.data.leaveAddress;
formDataTrain.studyDayScholarship = props.data.studyDayScholarship;
formDataTrain.studyDayCountry = props.data.studyDayCountry;
formDataTrain.studyDayTrainingSubject = props.data.studyDayTrainingSubject;
@ -222,8 +218,6 @@ onMounted(async () => {
formDataTrain.leavegovernmentDate = props.data.leavegovernmentDate;
formDataTrain.leaveSalary = props.data.leaveSalary;
formDataTrain.leaveSalaryText = props.data.leaveSalaryText;
formDataTrain.leaveNumber = props.data.leaveNumber;
formDataTrain.leaveAddress = props.data.leaveAddress;
formDataTrain.studyDayScholarship = props.data.studyDayScholarship;
formDataTrain.studyDayCountry = props.data.studyDayCountry;
formDataTrain.studyDayTrainingSubject = props.data.studyDayTrainingSubject;
@ -554,7 +548,7 @@ onMounted(async () => {
/>
<q-input
v-model="formDataTrain.leaveNumber"
v-model="dataStore.telephoneNumber"
class="col-12 col-sm-6 col-md-4 cursor-pointer inputgreen"
ref="leaveNumberRef"
dense
@ -571,7 +565,7 @@ onMounted(async () => {
/>
<q-input
v-model="formDataTrain.leaveAddress"
v-model="dataStore.currentAddress"
ref="leaveAddressRef"
class="col-12 cursor-pointer inputgreen"
bg-color="white"
@ -595,7 +589,7 @@ onMounted(async () => {
dense
outlined
type="textarea"
label="รายละเอียด"
label="สาเหตุการลา"
/>
<div class="col-12" v-if="statusCheck != 'NEW'">

View file

@ -362,7 +362,7 @@ onMounted(() => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataWorkInternational.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -688,7 +688,7 @@ onMounted(async () => {
ref="leaveDetailRef"
for="leaveDetailRef"
v-model="formDataFollowSpouse.leaveDetail"
label="รายละเอียด"
label="สาเหตุการลา"
:readonly="!edit || statusCheck === 'NEW'"
/>
<div class="full-width" v-if="statusCheck != 'NEW'">

View file

@ -350,7 +350,7 @@ onMounted(() => {
dense
outlined
type="textarea"
label="รายละเอียด"
label="สาเหตุการลา"
/>
<div class="col-12" v-if="statusCheck != 'NEW'">

View file

@ -88,7 +88,7 @@ onMounted(() => {
label="เรียน"
/>
<q-input
class="col-12 col-sm-3"
class="col-12 col-sm-4"
dense
outlined
readonly
@ -97,7 +97,7 @@ onMounted(() => {
label="ชื่อผู้ยื่นขอ"
/>
<q-input
class="col-12 col-sm-3"
class="col-12 col-sm-4"
dense
outlined
readonly
@ -106,7 +106,7 @@ onMounted(() => {
label="ตำแหน่งผู้ยื่นขอ"
/>
<q-input
class="col-12 col-sm-3"
class="col-12 col-sm-4"
dense
outlined
readonly
@ -115,10 +115,11 @@ onMounted(() => {
label="ระดับผู้ยื่นขอ"
/>
<q-input
class="col-12 col-sm-3"
class="col-12 text-html"
dense
outlined
readonly
type="textarea"
bg-color="white"
v-model="dataStore.organizationName"
label="สังกัดผู้ยื่นขอ"

View file

@ -52,8 +52,8 @@ const table = ref<any>(null);
*/
const currentPage = ref<number>(1);
const pagination = ref({
sortBy: "desc",
descending: false,
sortBy: "dateSendLeave",
descending: true,
page: 1,
rowsPerPage: Number(props.pageSize),
});

View file

@ -67,7 +67,7 @@ const props = defineProps({
<div class="col-xs-12 col-md-6">{{ props.data.leaveAddress }}</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -56,7 +56,7 @@ const props = defineProps({
<div class="col-xs-12 col-md-6">{{ props.data.leaveAddress }}</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -71,7 +71,7 @@ const props = defineProps({
<div class="col-xs-12 col-md-6">{{ props.data.leaveAddress }}</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -72,7 +72,7 @@ const props = defineProps({
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -51,7 +51,7 @@ const props = defineProps({
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -61,7 +61,7 @@ const props = defineProps({
<div class="col-xs-12 col-md-6">{{ props.data.absentDayAt }}</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -85,7 +85,7 @@ const props = defineProps({
<div class="col-xs-12 col-md-6">{{ props.data.leaveAddress }}</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -84,7 +84,7 @@ const props = defineProps({
<div class="col-xs-12 col-md-6">{{ props.data.leaveAddress }}</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -38,7 +38,7 @@ const props = defineProps({
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">รายละสาเหตการลาเอยด</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -119,7 +119,7 @@ const props = defineProps({
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -38,7 +38,7 @@ const props = defineProps({
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6 text-grey-8">รายละเอยด</div>
<div class="col-xs-12 col-md-6 text-grey-8">สาเหตการลา</div>
<div class="col-xs-12 col-md-6">
{{ props.data.leaveDetail ? props.data.leaveDetail : "-" }}
</div>

View file

@ -39,7 +39,7 @@ export const useLeaveStore = defineStore("Leave", () => {
leaveTypeName: e.leaveTypeName,
leaveTypeId: e.leaveTypeId,
fullName: e.fullName,
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave),
dateSendLeave: e.dateSendLeave && date2Thai(e.dateSendLeave, false, true),
dateLeave:
date2Thai(e.leaveStartDate) + " - " + date2Thai(e.leaveEndDate),
status: e.status,
@ -281,6 +281,9 @@ export const useLeaveStore = defineStore("Leave", () => {
const leaveLast = ref<any>();
const restDayCurrentTotal = ref<number>(0);
const telephoneNumber = ref<string>("");
const currentAddress = ref<string>("");
//ดึงข้อมูล profile จาก API
async function fetchProfile() {
showLoader();
@ -301,6 +304,14 @@ export const useLeaveStore = defineStore("Leave", () => {
restDayTotalOld.value = data.restDayTotalOld;
birthDate.value = data.birthDate;
dateAppoint.value = data.dateAppoint;
telephoneNumber.value =
data.telephoneNumber && data.telephoneNumber !== "-"
? data.telephoneNumber
: null;
currentAddress.value = data.currentSubDistrict
? `${data.currentAddress} ${data.currentSubDistrict} ${data.currentDistrict} ${data.currentProvince} ${data.currentZipCode}`
: "";
salary.value = data.salary ? data.salary.toLocaleString("th-TH") : "";
salaryText.value = data.salaryText;
leaveLast.value =
@ -419,5 +430,7 @@ export const useLeaveStore = defineStore("Leave", () => {
typeOptionsMain,
status,
statusOptionsMain,
telephoneNumber,
currentAddress,
};
});

View file

@ -208,6 +208,11 @@ async function fetchDataDetail(id: string) {
formData.dear = data.dear ?? "-";
formData.leaveLast = data.leaveLast ?? "-";
formData.leaveRange = data.leaveRange;
dataStore.telephoneNumber =
data.leaveNumber && data.leaveNumber !== "-" ? data.leaveNumber : null;
dataStore.currentAddress = data.leaveAddress ? data.leaveAddress : "";
await dataStore.fetchProfileOld(data);
})
.catch((err) => {

View file

@ -22,7 +22,8 @@ const mixin = useCounterMixin();
const store = useEvaluateDetailStore();
const $q = useQuasar();
const route = useRoute();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai, findOrgNameHtml } =
mixin;
const {
columnsCertificates,
columnSalaries,
@ -183,8 +184,6 @@ async function fetchCheckSpec(data: any) {
position: e.position,
positionSalaryAmount: e.positionSalaryAmount ? e.positionSalaryAmount : 0,
refCommandDate: e.refCommandDate ? e.refCommandDate : "",
refCommandNo: e.refCommandNo ? e.refCommandNo : "",
salaryClass: e.salaryClass ? e.salaryClass : "",
salaryRef: e.salaryRef ? e.salaryRef : "",
salaryStatus: e.salaryStatus ? e.salariesStatus : "",
@ -360,7 +359,7 @@ onMounted(async () => {
label="อายุราชการ"
/>
</div>
<div class="col-xs-12 col-sm-9">
<div class="col-xs-12 col-sm-9 text-html">
<q-input
borderless
readonly
@ -548,7 +547,20 @@ onMounted(async () => {
:key="col.id"
class="vertical-top"
>
<div class="table_ellipsis">
<div v-if="col.name == 'organization'" class="text-html">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}
</div>
<div v-else class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>

View file

@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
/** columns TableViewStep1*/
const mixin = useCounterMixin();
const { date2Thai } = mixin;
const { date2Thai, findOrgNameHtml } = mixin;
const columnsCertificates = ref<QTableProps["columns"]>([
{
@ -59,14 +59,163 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
const columnSalaries = ref<QTableProps["columns"]>([
{
name: "date",
name: "commandDateAffect",
align: "left",
label: "วัน เดือน ปี",
label: "วันที่คำสั่งมีผล",
sortable: true,
field: "date",
field: "commandDateAffect",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandDateSign",
align: "left",
label: "วันที่ลงนาม",
sortable: true,
field: "commandDateSign",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNumCodeSit",
align: "left",
label: "หน่วยงานที่ออกคำสั่ง",
sortable: false,
field: "posNumCodeSit",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNumCodeSitAbb && row.posNumCodeSit
? `${row.posNumCodeSit} (${row.posNumCodeSitAbb})`
: row.posNumCodeSit
? row.posNumCodeSit
: "-";
},
},
{
name: "posNo",
align: "left",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNoAbb && row.posNo
? `${row.posNoAbb}${row.posNo}`
: row.posNo
? row.posNo
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionName",
align: "left",
label: "ตำแหน่งในสายงาน",
sortable: true,
field: "positionName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionType",
align: "left",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
format(val, row) {
return `${
row.positionLevel
? row.positionLevel
: row.positionCee
? row.positionCee
: "-"
}`;
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionExecutive",
align: "left",
label: "ตำแหน่งทางการบริหาร",
sortable: true,
field: "positionExecutive",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "commandNo",
format(val, row) {
return row.commandNo && row.commandYear
? `${row.commandNo}/${Number(row.commandYear) + 543}`
: "";
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "commandCode",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandCode",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organization",
align: "left",
label: "สังกัด",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px;min-width:280px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "amount",
@ -76,17 +225,19 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
field: "amount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
format(v, row) {
return row.amount
? `${row.amount.toLocaleString()}${
row.amountSpecial !== 0 && row.amountSpecial
? ` (${row.amountSpecial.toLocaleString()})`
: ""
}`
: "-";
},
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "mouthSalaryAmount",
@ -97,54 +248,38 @@ export const useEvaluateDetailStore = defineStore("evaluateDetailStore", () => {
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionSalaryAmount",
align: "left",
label: "เงินประจำตำแหน่ง",
sortable: true,
field: "positionSalaryAmount",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => Number(v).toLocaleString(),
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
name: "remark",
align: "left",
label: "เลขที่ตำแหน่ง",
label: "หมายเหตุ",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionType",
align: "left",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLevel",
align: "left",
label: "ระดับ",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "templateDoc",
align: "left",
label: "เอกสารอ้างอิง",
sortable: true,
field: "templateDoc",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "refCommandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "refCommandNo",
field: "remark",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);

View file

@ -19,6 +19,7 @@ const {
messageError,
findPosMasterNoOld,
findOrgNameOld,
findOrgNameOldHtml,
date2Thai,
} = mixin;
@ -113,7 +114,6 @@ const columns = ref<QTableProps["columns"]>([
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val, row) => findOrgNameOld(row),
},
{
name: "organization",
@ -172,7 +172,6 @@ const columns = ref<QTableProps["columns"]>([
field: "commandNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
@ -266,6 +265,12 @@ watch(
<div v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else-if="col.name == 'organizationPositionOld'"
class="text-html"
>
{{ props.row ? findOrgNameOldHtml(props.row) : "-" }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { ref, onMounted, reactive, computed } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useQuasar } from "quasar";
import genReport from "@/plugins/genreport";
@ -37,6 +37,7 @@ const {
dialogConfirm,
success,
findOrgName,
findOrgNameHtml,
dialogRemove,
} = mixin;
const route = useRoute();
@ -462,7 +463,7 @@ async function fetchProfileEvaluator(id: string) {
evaluator.value.posLevelName = data.posLevelName;
evaluator.value.isPosmasterAct = data.isPosmasterAct;
evaluator.value.posmasterAct = data.posmasterAct;
evaluator.value.org = await findOrgName(data);
evaluator.value.org = await findOrgNameHtml(data);
})
.catch((e) => {
messageError($q, e);
@ -637,6 +638,16 @@ function downloadFile(fileName: string) {
});
}
const sizeImg = ref<any>();
function onResize(size: { width: any; height: any }) {
if (size.height <= 156) {
sizeImg.value = "80px";
} else if (size.height > 156) {
sizeImg.value = "120px";
}
}
onMounted(async () => {
showLoader();
store.isUpdate = false;
@ -672,7 +683,7 @@ onMounted(async () => {
<div class="col-12">
<q-card bordered flat class="relative-position">
<div class="row justify-center q-pa-md" v-if="!$q.screen.gt.xs">
<q-avatar size="80px">
<q-avatar :size="sizeImg">
<q-img
:src="store.dataEvaluation.avartar"
v-if="store.dataEvaluation.avartar !== undefined"
@ -680,13 +691,12 @@ onMounted(async () => {
<q-img src="@/assets/avatar_user.jpg" v-else />
</q-avatar>
</div>
<div
v-if="$q.screen.gt.xs"
class="absolute-center-left"
style="left: 2%; top: 50%; transform: translateY(-50%)"
>
<q-avatar size="80px">
<q-avatar :size="sizeImg">
<q-img
:src="store.dataEvaluation.avartar"
v-if="store.dataEvaluation.avartar !== undefined"
@ -695,6 +705,8 @@ onMounted(async () => {
</q-avatar>
</div>
<div class="row col-12">
<q-resize-observer @resize="onResize" />
<div class="row items-center col-12 q-pa-sm">
<div
class="col-12"
@ -707,8 +719,8 @@ onMounted(async () => {
? `${store.dataEvaluation.prefix}${store.dataEvaluation.firstName} ${store.dataEvaluation.lastName}`
: ""
}}</span>
<p class="q-mb-none">
{{ findOrgName(store.dataEvaluation) }}
<p class="q-mb-none text-html">
{{ findOrgNameHtml(store.dataEvaluation) }}
</p>
</div>
<q-space v-if="$q.screen.gt.xs" />
@ -1187,7 +1199,7 @@ onMounted(async () => {
</q-dialog>
<q-dialog v-model="modalEvaluatorDetail" persistent>
<q-card style="width: 700px; max-width: 80vw; min-height: 40vh">
<q-card style="width: 60vw; max-width: 70vw; min-height: 40vh">
<DialogHeader
:tittle="topic"
:close="() => (modalEvaluatorDetail = false)"
@ -1223,7 +1235,7 @@ onMounted(async () => {
evaluator.posExecutiveName ? evaluator.posExecutiveName : "-"
}}
</div>
<div class="col-3">
<div class="col-3 text-html">
{{ evaluator.org ? evaluator.org : "-" }}
</div>
</div>

View file

@ -431,7 +431,7 @@ onMounted(async () => {
<div class="col-12 col-sm-12 col-md-6">
<div class="row q-col-gutter-y-sm">
<div class="col-5 text-grey-6 text-weight-medium">งก</div>
<div class="col-7">
<div class="col-7 text-html">
{{ formData.org ? formData.org : "-" }}
</div>
<div class="col-5 text-grey-6 text-weight-medium">

View file

@ -30,6 +30,7 @@ const {
onSearchDataTable,
formatDatePosition,
findOrgName,
findOrgNameHtml,
} = mixin;
const idByRow = ref<string>("");
@ -87,6 +88,22 @@ const baseColumns = ref<QTableColumn[]>([
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNumCodeSit",
align: "left",
label: "หน่วยงานที่ออกคำสั่ง",
sortable: false,
field: "posNumCodeSit",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNumCodeSitAbb && row.posNumCodeSit
? `${row.posNumCodeSit} (${row.posNumCodeSitAbb})`
: row.posNumCodeSit
? row.posNumCodeSit
: "-";
},
},
{
name: "posNo",
align: "left",
@ -276,6 +293,7 @@ const baseColumns = ref<QTableColumn[]>([
]);
const baseVisibleColumns = ref<string[]>([
"commandDateAffect",
"posNumCodeSit",
"posNo",
"positionName",
"positionType",
@ -543,9 +561,20 @@ onMounted(async () => {
</div>
<div
v-else-if="col.name == 'organization'"
class="table_ellipsis"
class="text-html"
style="width: 300px"
>
{{ col.value ? col.value : "-" }}
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
@ -588,7 +617,25 @@ onMounted(async () => {
col.label
}}</q-item-label>
</q-item-section>
<q-item-section class="fix_top">
<q-item-section
v-if="col.name == 'organization'"
class="fix_top text-html"
>
<q-item-label class="text-dark text-weight-medium">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}</q-item-label
>
</q-item-section>
<q-item-section v-else class="fix_top">
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>

View file

@ -23,6 +23,7 @@ const {
date2Thai,
onSearchDataTable,
findOrgName,
findOrgNameHtml,
} = mixin;
const idByRow = ref<string>("");
@ -71,6 +72,22 @@ const baseColumns = ref<QTableColumn[]>([
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNumCodeSit",
align: "left",
label: "หน่วยงานที่ออกคำสั่ง",
sortable: false,
field: "posNumCodeSit",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNumCodeSitAbb && row.posNumCodeSit
? `${row.posNumCodeSit} (${row.posNumCodeSitAbb})`
: row.posNumCodeSit
? row.posNumCodeSit
: "-";
},
},
{
name: "posNo",
align: "left",
@ -289,6 +306,7 @@ const baseColumns = ref<QTableColumn[]>([
]);
const visibleColumns = ref<string[]>([
"commandDateAffect",
"posNumCodeSit",
"posNo",
"positionName",
"positionType",
@ -321,6 +339,7 @@ const columns = computed(() => {
const visibleColumnsHistory = ref<string[]>([
"commandDateAffect",
"posNumCodeSit",
"posNo",
"positionName",
"positionType",
@ -380,6 +399,22 @@ const baseColumnsHistory = ref<QTableColumn[]>([
.toString()
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNumCodeSit",
align: "left",
label: "หน่วยงานที่ออกคำสั่ง",
sortable: false,
field: "posNumCodeSit",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.posNumCodeSitAbb && row.posNumCodeSit
? `${row.posNumCodeSit} (${row.posNumCodeSitAbb})`
: row.posNumCodeSit
? row.posNumCodeSit
: "-";
},
},
{
name: "posNo",
align: "left",
@ -724,8 +759,18 @@ onMounted(async () => {
<div v-else-if="col.name == 'status'">
{{ props.row.status ? props.row.status : "-" }}
</div>
<div v-else-if="col.name == 'organization'" class="table_ellipsis">
{{ col.value ? col.value : "-" }}
<div v-else-if="col.name == 'organization'" class="text-html">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
@ -768,7 +813,26 @@ onMounted(async () => {
col.label
}}</q-item-label>
</q-item-section>
<q-item-section class="fix_top">
<q-item-section
v-if="col.name == 'organization'"
class="fix_top text-html"
>
<q-item-label class="text-dark text-weight-medium">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}</q-item-label
>
</q-item-section>
<q-item-section v-else class="fix_top">
<q-item-label class="text-dark text-weight-medium">{{
col.value ? col.value : "-"
}}</q-item-label>

View file

@ -7,7 +7,7 @@ import { useCounterMixin } from "@/stores/mixin";
const type = ref<string>("");
const mixin = useCounterMixin();
const { date2Thai, onSearchDataTable } = mixin;
const { date2Thai, onSearchDataTable, findOrgNameHtml } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
const title = defineModel<string>("title", { required: true });
@ -158,6 +158,19 @@ watch(
<div v-else-if="col.name == 'status' && type == 'Leave'">
{{ props.row.status ? statusLeave(props.row.status) : "-" }}
</div>
<div v-else-if="col.name == 'organization'">
{{
props.row
? findOrgNameHtml({
root: props.row.orgRoot,
child1: props.row.orgChild1,
child2: props.row.orgChild2,
child3: props.row.orgChild3,
child4: props.row.orgChild4,
})
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>

View file

@ -10,8 +10,9 @@ interface AuthResponse {
const authenticated = async () => ((await getToken()) ? true : false);
async function setAuthen(r: AuthResponse) {
async function setAuthen(r: AuthResponse, val: string) {
await setCookie(ACCESS_TOKEN, r.access_token, r.expires_in);
setCookie("SSO", val, r.expires_in);
window.location.href = "/";
}
@ -70,4 +71,4 @@ async function tokenParsed() {
return JSON.parse(jsonPayload);
}
export { getToken, authenticated, logout, setAuthen, tokenParsed };
export { getToken, authenticated, logout, setAuthen, tokenParsed, getCookie };

View file

@ -1102,7 +1102,6 @@ export const useCounterMixin = defineStore("mixin", () => {
return "";
}
}
function findOrgNameOld(obj: any) {
if (obj) {
let name =
@ -1139,6 +1138,114 @@ export const useCounterMixin = defineStore("mixin", () => {
}
}
function findOrgNameHtml(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
? obj.child4 + (obj.child3 ? "\n" : "")
: obj.child4 != null
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
? obj.child3 + (obj.child2 ? "\n" : "")
: obj.child3 !== null
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
? obj.child2 + (obj.child1 ? "\n" : "")
: obj.child2 != null
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
? obj.child1 + (obj.root ? "\n" : "")
: obj.child1 != null
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findOrgNameOldHtml(obj: any) {
if (obj) {
let name =
obj.child4Old != null && obj.child3Old != null
? obj.child4Old + (obj.child3Old ? "\n" : "")
: obj.child4Old != null
? obj.child4Old
: "";
name +=
obj.child3Old != null && obj.child2Old != null
? obj.child3Old + (obj.child2Old ? "\n" : "")
: obj.child3Old !== null
? obj.child3Old
: "";
name +=
obj.child2Old != null && obj.child1Old != null
? obj.child2Old + (obj.child1Old ? "\n" : "")
: obj.child2Old != null
? obj.child2Old
: "";
name +=
obj.child1Old != null && obj.rootOld != null
? obj.child1Old + (obj.rootOld ? "\n" : "")
: obj.child1Old != null
? obj.child1Old
: "";
name += obj.rootOld != null ? obj.rootOld : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findOrgChildNameHtml(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
? obj.orgChild4Name + (obj.orgChild3Name ? "\n" : "")
: obj.orgChild4Name != null
? obj.orgChild4Name
: "";
name +=
obj.orgChild3Name != null && obj.orgChild2Name != null
? obj.orgChild3Name + (obj.orgChild2Name ? "\n" : "")
: obj.orgChild3Name !== null
? obj.orgChild3Name
: "";
name +=
obj.orgChild2Name != null && obj.orgChild1Name != null
? obj.orgChild2Name + (obj.orgChild1Name ? "\n" : "")
: obj.orgChild2Name != null
? obj.orgChild2Name
: "";
name +=
obj.orgChild1Name != null && obj.orgRootName != null
? obj.orgChild1Name + (obj.orgRootName ? "\n" : "")
: obj.orgChild1Name != null
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function onSearchDataTable(keyword: string, data: any[], columns: any[]) {
const searchText = keyword.trim().toLowerCase();
@ -1229,5 +1336,9 @@ export const useCounterMixin = defineStore("mixin", () => {
formatDatePosition,
convertDateToAPI,
convertDatetimeToAPI,
findOrgNameHtml,
findOrgNameOldHtml,
findOrgChildNameHtml,
};
});

View file

@ -49,7 +49,8 @@ $activetab: #4a5568
background: $activetab !important
.bg-white-btn
background: #ffffff20 !important
.text-html
white-space: pre-line
.inputgreen .q-field__prefix,
.inputgreen .q-field__suffix,
.inputgreen .q-field__input,

View file

@ -7,7 +7,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import CustomComponent from "@/components/CustomDialog.vue";
import avatar from "@/assets/avatar_user.jpg";
import { tokenParsed, logout } from "@/plugins/auth";
import { tokenParsed, logout, getCookie } from "@/plugins/auth";
import { useDataStore } from "@/stores/data";
@ -39,6 +39,7 @@ const notiTrigger = ref(false);
const currentRouteName = router.currentRoute.value.name;
const tab = ref<any>(currentRouteName);
const link = ref<string>("");
const isSsoToken = ref(false);
/**
* เรยกฟงกนทงหมดตอนเรยกใชไฟล
@ -47,6 +48,8 @@ onMounted(async () => {
await checkUser();
await fetchTotolNotificate();
const user = await tokenParsed();
const SSO_TOKEN = await getCookie("SSO");
isSsoToken.value = SSO_TOKEN === "y" ? true : false;
fullname.value = user?.name;
});
@ -496,7 +499,12 @@ function onViewDetailNoti(url: string) {
</q-item>
</template>
<q-list>
<q-item clickable v-close-popup :href="landingPageUrl">
<q-item
clickable
v-close-popup
:href="landingPageUrl"
v-if="isSsoToken"
>
<q-item-section avatar style="min-width: 30px">
<q-avatar
color="blue"

View file

@ -12,7 +12,7 @@ onMounted(async () => {
expires_in: route.query.expires ? route.query.expires : 36000,
refresh_token: route.query.accessToken,
};
setAuthen(params);
setAuthen(params, "y");
}
});
</script>

View file

@ -29,7 +29,7 @@ async function onSubmit() {
},
})
.then(async (res) => {
setAuthen(res.data.result);
setAuthen(res.data.result,'n');
})
.catch((err) => {
$q.dialog({