ปรับ ระบบ บรรจุ

This commit is contained in:
STW_TTTY\stwtt 2024-05-07 17:06:34 +07:00
parent ad66cacc1e
commit 94afaca07b
13 changed files with 770 additions and 734 deletions

View file

@ -67,8 +67,8 @@ const fecthappointmentByid = async () => {
const data = res.data.result; const data = res.data.result;
profileId.value = data.profileId; profileId.value = data.profileId;
title.value.fullname = `${data.prefix}${data.firstname ?? "-"} ${ title.value.fullname = `${data.prefix}${data.firstName ?? "-"} ${
data.lastname ?? "-" data.lastName ?? "-"
}`; }`;
title.value.organizationPositionOld = data.organizationPositionOld ?? "-"; title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
title.value.positionLevelOld = data.positionLevelOld ?? "-"; title.value.positionLevelOld = data.positionLevelOld ?? "-";
@ -92,47 +92,39 @@ const fecthappointmentByid = async () => {
}); });
}; };
//
const clickSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success: any) => {
if (success) {
dialogConfirm(
$q,
async () => await putAppointment(),
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
});
}
};
// //
const putAppointment = async () => { function putAppointment() {
let data = { dialogConfirm(
educationOld: educationOld.value, $q,
organizationPositionOld: organizationPositionOld.value, () => {
positionTypeOld: positionTypeOld.value, let data = {
positionLevelOld: positionLevelOld.value, educationOld: educationOld.value,
positionNumberOld: posNo.value, organizationPositionOld: organizationPositionOld.value,
amountOld: Number(salary.value), positionTypeOld: positionTypeOld.value,
reason: reason.value, positionLevelOld: positionLevelOld.value,
positionDate: date.value, positionNumberOld: posNo.value,
}; amountOld: Number(salary.value),
showLoader(); reason: reason.value,
await http positionDate: date.value,
.put(config.API.appointmentByid(paramsId.toString()), data) };
.then(() => { showLoader();
success($q, "บันทึกข้อมูลสำเร็จ"); http
}) .put(config.API.appointmentByid(paramsId.toString()), data)
.catch((e) => { .then(() => {
messageError($q, e); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.finally(() => { .catch((e) => {
fecthappointmentByid(); messageError($q, e);
edit.value = false; })
}); .finally(() => {
}; fecthappointmentByid();
edit.value = false;
});
},
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
const cancel = () => { const cancel = () => {
edit.value = false; edit.value = false;
fecthappointmentByid(); fecthappointmentByid();
@ -175,48 +167,54 @@ onMounted(async () => {
<CardProfile :data="dataProfile as DataProfile" /> <CardProfile :data="dataProfile as DataProfile" />
<q-card bordered class="row col-12 text-dark q-mt-sm"> <q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> <q-form
<div class="q-pl-sm text-weight-bold text-dark"> greedy
แกไขขอมลเพอลงบญชแนบทาย @submit.prevent
</div> @validation-success="putAppointment"
<q-space /> ref="myForm"
<div v-if="status !== 'DONE' && status !== 'REPORT'"> >
<div class="q-gutter-sm" v-if="!edit"> <div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<q-btn <div class="q-pl-sm text-weight-bold text-dark">
outline แกไขขอมลเพอลงบญชแนบทาย
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
/>
</div> </div>
<div class="q-gutter-sm" v-else> <q-space />
<q-btn <div v-if="status !== 'DONE' && status !== 'REPORT'">
outline <div class="q-gutter-sm" v-if="!edit">
color="public" <q-btn
dense outline
class="q-px-sm" color="primary"
label="บันทึก" dense
style="width: 80px" icon-right="mdi-file-edit-outline"
@click="clickSave" class="q-px-sm"
/> label="แก้ไข"
<q-btn style="width: 80px"
outline @click="edit = !edit"
color="red" />
dense </div>
class="q-px-sm" <div class="q-gutter-sm" v-else>
label="ยกเลิก" <q-btn
style="width: 80px" outline
@click="cancel()" type="submit"
/> color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="cancel()"
/>
</div>
</div> </div>
</div> </div>
</div> <div class="col-12"><q-separator /></div>
<div class="col-12"><q-separator /></div>
<q-form ref="myForm">
<div class="row col-12 q-pa-md"> <div class="row col-12 q-pa-md">
<div class="col-12"> <div class="col-12">
<div class="text-weight-bold">การศกษา</div> <div class="text-weight-bold">การศกษา</div>
@ -311,12 +309,19 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-3 row"> <div class="col-xs-6 col-sm-3 row">
<div class="col-12"> <div class="col-12">
<CurrencyInput <q-input
v-model="salary" v-model="salary"
label="เงินเดือน" :outlined="edit"
:edit="edit" dense
:readonly="!edit"
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
mask="###,###,###,###"
reverse-fill-mask
class="inputgreen"
/> />
</div> </div>
</div> </div>

View file

@ -304,12 +304,19 @@ onMounted(async () => {
</div> </div>
<div class="col-xs-6 col-sm-3 row"> <div class="col-xs-6 col-sm-3 row">
<div class="col-12"> <div class="col-12">
<CurruncyInput <q-input
v-model="salary" v-model="salary"
label="เงินเดือน" :outlined="edit"
:edit="edit" dense
:readonly="!edit"
class="inputgreen"
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
mask="###,###,###,###"
reverse-fill-mask
/> />
</div> </div>
</div> </div>

View file

@ -126,7 +126,7 @@ const clickPrevious = async () => {
unelevated unelevated
:disabled="!editvisible" :disabled="!editvisible"
:color="!editvisible ? 'grey-7' : 'public'" :color="!editvisible ? 'grey-7' : 'public'"
@click="checkSave" type="submit"
label="บันทึก" label="บันทึก"
><!-- icon="mdi-content-save-outline" ><!-- icon="mdi-content-save-outline"
<q-tooltip>นท</q-tooltip> --> <q-tooltip>นท</q-tooltip> -->

View file

@ -448,15 +448,11 @@ const clickAdd = async () => {
* กดบนทกใน dialog * กดบนทกใน dialog
*/ */
const clickSave = async () => { const clickSave = async () => {
myForm.value.validate().then(async (result: boolean) => { if (modalEdit.value) {
if (result) { await dialogConfirm($q, () => editData());
if (modalEdit.value) { } else {
await editData(); await dialogConfirm($q, () => saveData());
} else { }
await saveData();
}
}
});
}; };
/** /**
@ -662,10 +658,12 @@ const addData = () => {
* งกนปมยกเลกการแกไขขอม * งกนปมยกเลกการแกไขขอม
*/ */
const clickCancel = async () => { const clickCancel = async () => {
myForm.value.resetValidation()
if (editRow.value == true) { if (editRow.value == true) {
dialogConfirm( dialogConfirm(
$q, $q,
async () => { async () => {
edit.value = false;
await checkRowPage(); await checkRowPage();
await getData(); await getData();
}, },
@ -778,12 +776,12 @@ const getClass = (val: boolean) => {
</q-card> </q-card>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-form ref="myForm"> <q-form ref="myForm" greedy @submit.prevent @validation-success="clickSave">
<DialogHeader tittle="ประวัติการศึกษา" :close="clickClose" /> <DialogHeader tittle="ประวัติการศึกษา" :close="clickClose" />
<q-separator /> <q-separator />
<q-card-section class="q-p-sm"> <q-card-section class="q-p-sm">
<div <div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs" class="row col-12 items-top q-col-gutter-x-xs q-col-gutter-y-xs"
> >
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<selector <selector
@ -1227,7 +1225,6 @@ const getClass = (val: boolean) => {
<DialogFooter <DialogFooter
:cancel="clickCancel" :cancel="clickCancel"
:edit="clickEdit" :edit="clickEdit"
:save="clickSave"
:validate="validateData" :validate="validateData"
:clickNext="clickNext" :clickNext="clickNext"
:clickPrevious="clickPrevious" :clickPrevious="clickPrevious"

View file

@ -43,7 +43,14 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute(); const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin; const {
date2Thai,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const addressData = ref<AddressType>(props.data); const addressData = ref<AddressType>(props.data);
const myform = ref<any>(); const myform = ref<any>();
@ -138,61 +145,54 @@ const getNewData = async () => {
// //
const editData = async () => { const editData = async () => {
const body = { dialogConfirm($q, async() => {
registrationSame: addressData.value.registSame == "1", const body = {
registrationAddress: addressData.value.registAddress, registrationSame: addressData.value.registSame == "1",
registrationSubDistrictId: registAddress.subDistrictId, registrationAddress: addressData.value.registAddress,
registrationDistrictId: registAddress.districtId, registrationSubDistrictId: registAddress.subDistrictId,
registrationProvinceId: registAddress.provinceId, registrationDistrictId: registAddress.districtId,
registrationZipCode: registAddress.provinceId, registrationProvinceId: registAddress.provinceId,
currentAddress: registrationZipCode: registAddress.provinceId,
addressData.value.registSame == "1" currentAddress:
? addressData.value.registAddress addressData.value.registSame == "1"
: addressData.value.currentAddress, ? addressData.value.registAddress
currentSubDistrictId: : addressData.value.currentAddress,
addressData.value.registSame == "1" currentSubDistrictId:
? registAddress.subDistrictId addressData.value.registSame == "1"
: currentAddress.subDistrictId, ? registAddress.subDistrictId
currentDistrictId: : currentAddress.subDistrictId,
addressData.value.registSame == "1" currentDistrictId:
? registAddress.districtId addressData.value.registSame == "1"
: currentAddress.districtId, ? registAddress.districtId
currentProvinceId: : currentAddress.districtId,
addressData.value.registSame == "1" currentProvinceId:
? registAddress.provinceId addressData.value.registSame == "1"
: currentAddress.provinceId, ? registAddress.provinceId
currentZipCode: : currentAddress.provinceId,
addressData.value.registSame == "1" currentZipCode:
? registAddress.zipCode addressData.value.registSame == "1"
: currentAddress.zipCode, ? registAddress.zipCode
}; : currentAddress.zipCode,
showLoader(); };
await http showLoader();
.put( await http
config.API.placementAddressId(route.params.personalId.toString()), .put(
body config.API.placementAddressId(route.params.personalId.toString()),
) body
.then(() => { )
success($q, "แก้ไขข้อมูลสำเร็จ"); .then(() => {
}) success($q, "แก้ไขข้อมูลสำเร็จ");
.catch((e) => { })
messageError($q, e); .catch((e) => {
}) messageError($q, e);
.finally(async () => { })
edit.value = false; .finally(async () => {
emit("update:statusEdit", false); edit.value = false;
await getNewData(); emit("update:statusEdit", false);
await props.fetch(); await getNewData();
// await fetchProvince(); await props.fetch();
}); // await fetchProvince();
}; });
//
const saveData = async () => {
myform.value.validate().then((success: boolean) => {
if (success) {
editData();
}
}); });
}; };
@ -440,18 +440,18 @@ const getClass = (val: boolean) => {
<template> <template>
<q-card class="col-12 q-px-lg q-py-md q-mt-md no-border"> <q-card class="col-12 q-px-lg q-py-md q-mt-md no-border">
<HeaderTop <q-form ref="myform" greedy @submit.prevent @validation-success="editData">
v-model:edit="edit" <HeaderTop
header="ข้อมูลที่อยู่" v-model:edit="edit"
icon="mdi-map-marker" header="ข้อมูลที่อยู่"
:save="saveData" icon="mdi-map-marker"
:history="false" :history="false"
:changeBtn="changeBtn" :changeBtn="changeBtn"
:disable="statusEdit" :disable="statusEdit"
:cancel="refreshData" :cancel="refreshData"
/> />
<q-form ref="myform">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="row col-12 items-top q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12"> <div class="col-xs-12">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"

View file

@ -45,8 +45,15 @@ const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store; const { profileData, changeProfileColumns } = store;
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } = const {
mixin; date2Thai,
success,
dateToISO,
messageError,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const route = useRoute(); const route = useRoute();
const id = ref<string>(""); const id = ref<string>("");
const certificateNo = ref<string>(); const certificateNo = ref<string>();
@ -313,15 +320,11 @@ const clickAdd = async () => {
* กดบนทกใน dialog * กดบนทกใน dialog
*/ */
const clickSave = async () => { const clickSave = async () => {
myForm.value.validate().then(async (result: boolean) => { if (modalEdit.value) {
if (result) { await dialogConfirm($q, () => editData());
if (modalEdit.value) { } else {
await editData(); await dialogConfirm($q, () => saveData());
} else { }
await saveData();
}
}
});
}; };
/** /**
@ -476,6 +479,7 @@ const addData = () => {
* งกนปมยกเลกการแกไขขอม * งกนปมยกเลกการแกไขขอม
*/ */
const clickCancel = async () => { const clickCancel = async () => {
myForm.value.resetValidation()
if (editRow.value == true) { if (editRow.value == true) {
$q.dialog({ $q.dialog({
title: `ข้อมูลมีการแก้ไข`, title: `ข้อมูลมีการแก้ไข`,
@ -618,7 +622,12 @@ const getClass = (val: boolean) => {
<!-- popup Edit window--> <!-- popup Edit window-->
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-form ref="myForm"> <q-form
ref="myForm"
greedy
@submit.prevent
@validation-success="clickSave"
>
<DialogHeader <DialogHeader
:tittle=" :tittle="
profileType == 'employee' profileType == 'employee'
@ -630,7 +639,7 @@ const getClass = (val: boolean) => {
<q-separator /> <q-separator />
<q-card-section class="q-p-sm"> <q-card-section class="q-p-sm">
<div <div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs" class="row col-12 items-top q-col-gutter-x-xs q-col-gutter-y-xs"
> >
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
@ -772,8 +781,6 @@ const getClass = (val: boolean) => {
<DialogFooter <DialogFooter
:cancel="clickCancel" :cancel="clickCancel"
:edit="clickEdit" :edit="clickEdit"
:save="clickSave"
:validate="validateData"
:clickNext="clickNext" :clickNext="clickNext"
:clickPrevious="clickPrevious" :clickPrevious="clickPrevious"
:clickDelete="clickDelete" :clickDelete="clickDelete"

View file

@ -36,7 +36,14 @@ const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin; const {
date2Thai,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
} = mixin;
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const myform = ref<QForm | null>(null); const myform = ref<QForm | null>(null);
@ -93,57 +100,62 @@ const fetchPrefix = async () => {
}; };
const editData = async () => { const editData = async () => {
showLoader(); dialogConfirm($q, async () => {
// const body: ResponseObject = { showLoader();
// couple: familyData.value.couple == "1", // const body: ResponseObject = {
// couplePrefixId: familyData.value.marryPrefixId, // couple: familyData.value.couple == "1",
// coupleFirstName: familyData.value.marryFirstName, // couplePrefixId: familyData.value.marryPrefixId,
// coupleLastName: familyData.value.marryLastName, // coupleFirstName: familyData.value.marryFirstName,
// coupleLastNameOld: familyData.value.lastnameCOld, // coupleLastName: familyData.value.marryLastName,
// coupleCareer: familyData.value.marryOccupation, // coupleLastNameOld: familyData.value.lastnameCOld,
// fatherPrefixId: familyData.value.fatherPrefixId, // coupleCareer: familyData.value.marryOccupation,
// fatherFirstName: familyData.value.fatherFirstName, // fatherPrefixId: familyData.value.fatherPrefixId,
// fatherLastName: familyData.value.fatherLastName, // fatherFirstName: familyData.value.fatherFirstName,
// fatherCareer: familyData.value.fatherOccupation, // fatherLastName: familyData.value.fatherLastName,
// motherPrefixId: familyData.value.motherPrefixId, // fatherCareer: familyData.value.fatherOccupation,
// motherFirstName: familyData.value.motherFirstName, // motherPrefixId: familyData.value.motherPrefixId,
// motherLastName: familyData.value.motherLastName, // motherFirstName: familyData.value.motherFirstName,
// motherCareer: familyData.value.motherOccupation, // motherLastName: familyData.value.motherLastName,
// // childrens: familyData.value.childrens, // motherCareer: familyData.value.motherOccupation,
// createdFullName: "-", // // childrens: familyData.value.childrens,
// createdAt: new Date(), // createdFullName: "-",
// }; // createdAt: new Date(),
// };
const body = { const body = {
couple: familyData.value.couple == "1", couple: familyData.value.couple == "1",
couplePrefixId: familyData.value.marryPrefixId, couplePrefixId: familyData.value.marryPrefixId,
coupleFirstName: familyData.value.marryFirstName, coupleFirstName: familyData.value.marryFirstName,
coupleLastName: familyData.value.marryLastName, coupleLastName: familyData.value.marryLastName,
coupleLastNameOld: "", coupleLastNameOld: "",
coupleCareer: familyData.value.marryOccupation, coupleCareer: familyData.value.marryOccupation,
fatherPrefixId: familyData.value.fatherPrefixId, fatherPrefixId: familyData.value.fatherPrefixId,
fatherFirstName: familyData.value.fatherFirstName, fatherFirstName: familyData.value.fatherFirstName,
fatherLastName: familyData.value.fatherLastName, fatherLastName: familyData.value.fatherLastName,
fatherCareer: familyData.value.fatherOccupation, fatherCareer: familyData.value.fatherOccupation,
motherPrefixId: familyData.value.motherPrefixId, motherPrefixId: familyData.value.motherPrefixId,
motherFirstName: familyData.value.motherFirstName, motherFirstName: familyData.value.motherFirstName,
motherLastName: familyData.value.motherLastName, motherLastName: familyData.value.motherLastName,
motherCareer: familyData.value.motherOccupation, motherCareer: familyData.value.motherOccupation,
}; };
await http await http
.put(config.API.placementFamilyId(route.params.personalId.toString()), body) .put(
.then(() => { config.API.placementFamilyId(route.params.personalId.toString()),
success($q, "บันทึกข้อมูลสำเร็จ"); body
}) )
.catch((e) => { .then(() => {
messageError($q, e); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.finally(async () => { .catch((e) => {
hideLoader(); messageError($q, e);
edit.value = false; })
emit("update:statusEdit", false); .finally(async () => {
await props.fetch(); hideLoader();
}); edit.value = false;
emit("update:statusEdit", false);
await props.fetch();
});
});
}; };
const saveData = async () => { const saveData = async () => {
@ -188,18 +200,18 @@ const getClass = (val: boolean) => {
<template> <template>
<q-card flat class="col-12 q-px-lg q-py-md q-mt-md text-dark"> <q-card flat class="col-12 q-px-lg q-py-md q-mt-md text-dark">
<HeaderTop <q-form ref="myform" greedy @submit.prevent @validation-success="editData">
v-model:edit="edit" <HeaderTop
header="ข้อมูลครอบครัว" v-model:edit="edit"
icon="mdi-account-group" header="ข้อมูลครอบครัว"
:save="saveData" icon="mdi-account-group"
:history="false" :history="false"
:changeBtn="changeBtn" :changeBtn="changeBtn"
:disable="statusEdit" :disable="statusEdit"
:cancel="refreshData" :cancel="refreshData"
/> />
<q-form ref="myform" class="col-12">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="row col-12 items-top q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12 text-weight-bold"> ดา</div> <div class="col-xs-12 text-weight-bold"> ดา</div>
<div class="col-xs-12 col-sm-3 col-md-3"> <div class="col-xs-12 col-sm-3 col-md-3">
<selector <selector

View file

@ -54,6 +54,7 @@ const {
modalError, modalError,
showLoader, showLoader,
hideLoader, hideLoader,
dialogConfirm,
} = mixin; } = mixin;
const profileStore = useProfileDataStore(); const profileStore = useProfileDataStore();
@ -257,43 +258,45 @@ const calRetire = async (birth: Date) => {
}; };
const editData = async () => { const editData = async () => {
if (age.value == false) { dialogConfirm($q, async () => {
modalError($q, "พบข้อผิดพลาด", "วันเกิดไม่ถูกต้อง"); if (age.value == false) {
return; modalError($q, "พบข้อผิดพลาด", "วันเกิดไม่ถูกต้อง");
} return;
}
const body: any = { const body: any = {
citizenId: informaData.value.idCard, citizenId: informaData.value.idCard,
prefixId: informaData.value.prefixId, prefixId: informaData.value.prefixId,
firstName: informaData.value.firstname, firstName: informaData.value.firstname,
lastName: informaData.value.lastname, lastName: informaData.value.lastname,
genderId: informaData.value.genderId, genderId: informaData.value.genderId,
nationality: informaData.value.nationality, nationality: informaData.value.nationality,
race: informaData.value.race, race: informaData.value.race,
religionId: informaData.value.religionId, religionId: informaData.value.religionId,
birthDate: informaData.value.dateOfBirth, birthDate: informaData.value.dateOfBirth,
bloodGroupId: informaData.value.bloodGroupId, bloodGroupId: informaData.value.bloodGroupId,
relationshipId: informaData.value.relationshipId, relationshipId: informaData.value.relationshipId,
telephoneNumber: informaData.value.telephone, telephoneNumber: informaData.value.telephone,
}; };
showLoader(); showLoader();
await http await http
.put( .put(
config.API.placementInformationId(route.params.personalId.toString()), config.API.placementInformationId(route.params.personalId.toString()),
body body
) )
.then((res) => { .then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
edit.value = false; edit.value = false;
emit("update:statusEdit", false); emit("update:statusEdit", false);
await props.fetch(); await props.fetch();
await changeBirth(informaData.value.dateOfBirth ?? new Date()); await changeBirth(informaData.value.dateOfBirth ?? new Date());
}); });
});
}; };
const saveData = async () => { const saveData = async () => {
@ -328,18 +331,18 @@ const getClass = (val: boolean) => {
</script> </script>
<template> <template>
<q-card flat bordered class="col-12 q-px-lg q-py-md no-border"> <q-card flat bordered class="col-12 q-px-lg q-py-md no-border">
<HeaderTop <q-form ref="myform" greedy @submit.prevent @validation-success="editData">
v-model:edit="edit" <HeaderTop
header="ข้อมูลส่วนตัว" v-model:edit="edit"
icon="mdi-account" header="ข้อมูลส่วนตัว"
:save="saveData" icon="mdi-account"
:history="false" :history="false"
:changeBtn="changeBtn" :changeBtn="changeBtn"
:disable="statusEdit" :disable="statusEdit"
:cancel="onCancel" :cancel="onCancel"
/> />
<q-form ref="myform" class="col-12">
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-sm"> <div class="row col-12 items-top q-col-gutter-x-sm q-col-gutter-y-sm">
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"

View file

@ -131,7 +131,7 @@ const add = () => {
round round
v-if="edit" v-if="edit"
:color="!edit ? 'grey-7' : 'public'" :color="!edit ? 'grey-7' : 'public'"
@click="save" type="submit"
icon="mdi-content-save-outline" icon="mdi-content-save-outline"
> >
<q-tooltip>นทกขอม</q-tooltip> <q-tooltip>นทกขอม</q-tooltip>

View file

@ -1,4 +1,4 @@
<script setup lang="ts"> divdivdiv<script setup lang="ts">
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
@ -422,7 +422,7 @@ const conditionSave = async () => {
} }
}; };
function saveData(){ function saveData() {
dialogConfirm( dialogConfirm(
$q, $q,
() => { () => {
@ -469,7 +469,7 @@ function saveData(){
"ต้องการแก้ไขข้อมูลหรือไม่?", "ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
); );
}; }
const getClass = (val: boolean) => { const getClass = (val: boolean) => {
return { return {
@ -501,7 +501,7 @@ onMounted(async () => {
<CardProfile :data="dataProfile as DataProfile" /> <CardProfile :data="dataProfile as DataProfile" />
<q-card bordered class="row col-12 text-dark q-mt-sm"> <q-card bordered class="row col-12 text-dark q-mt-sm">
<q-form greedy @submit.prevent @validation-success="saveData"> <q-form greedy @submit.prevent @validation-success="saveData" ref="myForm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> <div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark"> <div class="q-pl-sm text-weight-bold text-dark">
แกไขขอมลเพอลงบญชแนบทาย แกไขขอมลเพอลงบญชแนบทาย
@ -543,430 +543,432 @@ onMounted(async () => {
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md"> <div class="row col-12 q-pa-md">
<div class="col-12 row bg-white"> <div class="col-12 row bg-white">
<div class="col-xs-12 row q-col-gutter-md"> <div class="col-xs-12 row q-col-gutter-md">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="text-weight-bold text-grey">อมลสวนต</div> <div class="text-weight-bold text-grey">อมลสวนต</div>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
v-model="informaData.cardid" v-model="informaData.cardid"
dense dense
@update:model-value="changeCardID" @update:model-value="changeCardID"
lazy-rules lazy-rules
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
label="เลขประจำตัวประชาชน" label="เลขประจำตัวประชาชน"
maxlength="13" maxlength="13"
mask="#############" mask="#############"
/> />
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.prefixId" v-model="informaData.prefixId"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.prefixOps" :options="Ops.prefixOps"
option-value="id" option-value="id"
:label="`${'คำนำหน้าชื่อ'}`" :label="`${'คำนำหน้าชื่อ'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps' ) " @filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps' ) "
/> />
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="informaData.firstname" v-model="informaData.firstname"
:label="`${'ชื่อ'}`" :label="`${'ชื่อ'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="informaData.lastname" v-model="informaData.lastname"
lazy-rules lazy-rules
:label="`${'นามสกุล'}`" :label="`${'นามสกุล'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<datepicker <datepicker
v-model="informaData.birthDate" v-model="informaData.birthDate"
:locale="'th'" :locale="'th'"
autoApply autoApply
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:max-date="new Date()" :max-date="new Date()"
:disabled="!edit" :disabled="!edit"
@update:model-value="handleDate" @update:model-value="handleDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
</template> </template>
<template #year-overlay-value="{ value }"> <template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }} {{ parseInt(value + 543) }}
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:model-value=" :model-value="
informaData.birthDate == null informaData.birthDate == null
? null ? null
: date2Thai(informaData.birthDate) : date2Thai(informaData.birthDate)
" "
:label="`${'วัน/เดือน/ปี เกิด'}`" :label="`${'วัน/เดือน/ปี เกิด'}`"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
:style=" :style="
edit edit
? 'color: var(--q-primary)' ? 'color: var(--q-primary)'
: 'color: var(--q-grey)' : 'color: var(--q-grey)'
" "
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<q-input <q-input
:class="getClass(false)" :class="getClass(false)"
hide-bottom-space hide-bottom-space
dense dense
lazy-rules lazy-rules
readonly readonly
borderless borderless
:style="!edit ? '' : 'padding:0 12px;'" :style="!edit ? '' : 'padding:0 12px;'"
:model-value="informaData.age" :model-value="informaData.age"
:label="`${'อายุ'}`" :label="`${'อายุ'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.genderId" v-model="informaData.genderId"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.genderOps" :options="Ops.genderOps"
option-value="id" option-value="id"
:label="`${'เพศ'}`" :label="`${'เพศ'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any,doneFn:Function) => filterSelector(inputValue, doneFn,'genderOps') " @filter="(inputValue:any,doneFn:Function) => filterSelector(inputValue, doneFn,'genderOps') "
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.statusId" v-model="informaData.statusId"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.statusOps" :options="Ops.statusOps"
option-value="id" option-value="id"
:label="`${'สถานภาพ'}`" :label="`${'สถานภาพ'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'statusOps' ) " @filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'statusOps' ) "
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="informaData.nationality" v-model="informaData.nationality"
:label="`${'สัญชาติ'}`" :label="`${'สัญชาติ'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="informaData.ethnicity" v-model="informaData.ethnicity"
:label="`${'เชื้อชาติ'}`" :label="`${'เชื้อชาติ'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.religionId" v-model="informaData.religionId"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.religionOps" :options="Ops.religionOps"
option-value="id" option-value="id"
:label="`${'ศาสนา'}`" :label="`${'ศาสนา'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'religionOps' doneFn:Function) => filterSelector(inputValue, doneFn,'religionOps'
) " ) "
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.bloodId" v-model="informaData.bloodId"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.bloodOps" :options="Ops.bloodOps"
option-value="id" option-value="id"
:label="`${'หมู่เลือด'}`" :label="`${'หมู่เลือด'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any, @filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'bloodOps' doneFn:Function) => filterSelector(inputValue, doneFn,'bloodOps'
) " ) "
clearable clearable
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2"> <div class="col-xs-6 col-sm-2 col-md-2">
<q-input <q-input
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
type="tel" type="tel"
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="informaData.tel" v-model="informaData.tel"
:label="`${'เบอร์โทร'}`" :label="`${'เบอร์โทร'}`"
mask="##########" mask="##########"
/> />
</div> </div>
<div <div
class="col-xs-6 col-sm-3 col-md-3" class="col-xs-6 col-sm-3 col-md-3"
v-if="informaData.profileType == 'employee'" v-if="informaData.profileType == 'employee'"
> >
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภทการจ้าง'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภทการจ้าง'}`]"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.employeeType" v-model="informaData.employeeType"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.employeeTypeOps" :options="Ops.employeeTypeOps"
option-value="id" option-value="id"
:label="`${'ประเภทการจ้าง'}`" :label="`${'ประเภทการจ้าง'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'employeeTypeOps' ) " @filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'employeeTypeOps' ) "
/> />
</div> </div>
<div <div
class="col-xs-6 col-sm-3 col-md-3" class="col-xs-6 col-sm-3 col-md-3"
v-if="informaData.profileType == 'employee'" v-if="informaData.profileType == 'employee'"
> >
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
:rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภทลูกจ้าง'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือก ประเภทลูกจ้าง'}`]"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
v-model="informaData.employeeClass" v-model="informaData.employeeClass"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="Ops.employeeClassOps" :options="Ops.employeeClassOps"
option-value="id" option-value="id"
:label="`${'ประเภทลูกจ้าง'}`" :label="`${'ประเภทลูกจ้าง'}`"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'employeeClassOps' ) " @filter="(inputValue:any, doneFn:Function) => filterSelector(inputValue, doneFn,'employeeClassOps' ) "
/> />
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="text-weight-bold">ตำแหนงและหนวยงานเด</div> <div class="text-weight-bold">ตำแหนงและหนวยงานเด</div>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules
:readonly="!edit" :readonly="!edit"
:borderless="!edit" :borderless="!edit"
v-model="educationOld" v-model="educationOld"
:rules="[(val:string) => !!val || `${'กรุณากรอกวุฒิ/สาขา'}`,]" :rules="[(val:string) => !!val || `${'กรุณากรอกวุฒิ/สาขา'}`,]"
hide-bottom-space hide-bottom-space
:label="`${'วุฒิ/สาขา'}`" :label="`${'วุฒิ/สาขา'}`"
type="textarea" type="textarea"
autogrow
autogrow />
/> </div>
</div> <div class="col-xs-12">
<div class="col-xs-12"> <q-input
<q-input :class="getClass(edit)"
:class="getClass(edit)" :outlined="edit"
:outlined="edit" dense
dense lazy-rules
lazy-rules :readonly="!edit"
:readonly="!edit" :borderless="!edit"
:borderless="!edit" v-model="organizationPositionOld"
v-model="organizationPositionOld" :rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]" hide-bottom-space
hide-bottom-space :label="`${'ตำแหน่ง/สังกัด'}`"
:label="`${'ตำแหน่ง/สังกัด'}`" type="textarea"
type="textarea" />
/> </div>
</div> <div class="col-xs-6 col-sm-3">
<div class="col-xs-6 col-sm-3"> <q-input
<q-input :class="getClass(edit)"
:class="getClass(edit)" :outlined="edit"
:outlined="edit" dense
dense lazy-rules
lazy-rules :readonly="!edit"
:readonly="!edit" :borderless="!edit"
:borderless="!edit" v-model="positionTypeOld"
v-model="positionTypeOld" :rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]" hide-bottom-space
hide-bottom-space :label="`${'ตำแหน่งประเภท'}`"
:label="`${'ตำแหน่งประเภท'}`" />
/> </div>
</div> <div class="col-xs-6 col-sm-3">
<div class="col-xs-6 col-sm-3"> <q-input
<q-input :class="getClass(edit)"
:class="getClass(edit)" :outlined="edit"
:outlined="edit" dense
dense lazy-rules
lazy-rules :readonly="!edit"
:readonly="!edit" :borderless="!edit"
:borderless="!edit" v-model="positionLevelOld"
v-model="positionLevelOld" :rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]" hide-bottom-space
hide-bottom-space :label="`${'ระดับ'}`"
:label="`${'ระดับ'}`" />
/> </div>
</div> <div class="col-xs-6 col-sm-3">
<div class="col-xs-6 col-sm-3"> <q-input
<q-input :class="getClass(edit)"
:class="getClass(edit)" :outlined="edit"
:outlined="edit" dense
dense lazy-rules
lazy-rules :readonly="!edit"
:readonly="!edit" :borderless="!edit"
:borderless="!edit" v-model="posNo"
v-model="posNo" :rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]" hide-bottom-space
hide-bottom-space :label="`${'เลขที่'}`"
:label="`${'เลขที่'}`" />
/> </div>
</div> <div class="col-xs-6 col-sm-3">
<div class="col-xs-6 col-sm-3"> <q-input
<CurrencyInput v-model="salary"
v-model="salary" :outlined="edit"
:edit="edit" dense
:options="{ :readonly="!edit"
currency: 'THB', hide-bottom-space
}" :borderless="!edit"
:label="`${'เงินเดือน'}`" :label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
/> mask="###,###,###,###"
</div> class="inputgreen"
<div class="col-xs-12"> reverse-fill-mask
<q-input />
:class="getClass(edit)" </div>
:outlined="edit" <div class="col-xs-12">
dense <q-input
lazy-rules :class="getClass(edit)"
:readonly="!edit" :outlined="edit"
:borderless="!edit" dense
v-model="reason" lazy-rules
hide-bottom-space :readonly="!edit"
:label="`${'หมายเหตุ '}`" :borderless="!edit"
type="textarea" v-model="reason"
/> hide-bottom-space
</div> :label="`${'หมายเหตุ '}`"
type="textarea"
/>
</div> </div>
</div> </div>
</div> </div>
</div>
</q-form> </q-form>
</q-card> </q-card>
<q-card v-if="rows.length > 0" bordered class="row col-12 text-dark q-my-sm"> <q-card v-if="rows.length > 0" bordered class="row col-12 text-dark q-my-sm">

View file

@ -822,15 +822,9 @@ onMounted(() => {
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<div class="row q-px-sm q-py-xs"> <div class="row q-pa-sm">
<q-space /> <q-space />
<q-btn <q-btn label="บันทึก" color="secondary" @click="SaveData()">
flat
round
color="public"
@click="SaveData()"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip> <q-tooltip>นท</q-tooltip>
</q-btn> </q-btn>
</div> </div>

View file

@ -272,13 +272,19 @@ onMounted(() => {
</div> </div>
<div class="col-xs-6 col-sm-3 row"> <div class="col-xs-6 col-sm-3 row">
<div class="col-12"> <div class="col-12">
<CurrencyInput <q-input
v-model="salary" v-model="salary"
:edit="edit" :outlined="edit"
:options="{ currency: 'THB' }" dense
:readonly="!edit"
hide-bottom-space
:borderless="!edit"
:label="`${'เงินเดือน'}`" :label="`${'เงินเดือน'}`"
class="inputgreen"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
mask="###,###,###,###"
reverse-fill-mask
/> />
</div> </div>
</div> </div>

View file

@ -16,7 +16,7 @@ import type {
rowFile, rowFile,
} from "@/modules/05_placement/interface/response/Transfer"; } from "@/modules/05_placement/interface/response/Transfer";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue"; import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
const modalPersonal = ref<boolean>(false); const modalPersonal = ref<boolean>(false);
const personId = ref<string>(""); const personId = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
@ -613,15 +613,19 @@ onMounted(async () => {
/> />
</div> </div>
<div class="col-xs-6 col-sm-3"> <div class="col-xs-6 col-sm-3">
<CurrencyInput <q-input
v-model="salary" v-model="salary"
:edit="edit" :outlined="edit"
:options="{ dense
currency: 'THB', :readonly="!edit"
}" :borderless="!edit"
hide-bottom-space
:label="`${'เงินเดือน'}`" :label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
class="inputgreen"
mask="###,###,###,###"
reverse-fill-mask
/> />
</div> </div>
</div> </div>
@ -664,7 +668,6 @@ onMounted(async () => {
:class="getClass(edit)" :class="getClass(edit)"
:outlined="edit" :outlined="edit"
dense dense
:borderless="!edit" :borderless="!edit"
:readonly="!edit" :readonly="!edit"
:model-value="date !== null ? date2Thai(date) : null" :model-value="date !== null ? date2Thai(date) : null"