เงินเดือน => เลื่อนค่าจ้างลูกจ้างประจำ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-20 15:18:31 +07:00
parent d5b5eec3e8
commit d0bbf5f68e
10 changed files with 60 additions and 75 deletions

View file

@ -148,11 +148,12 @@ function onClickAddPerson(data: DataPerson) {
dialogConfirm( dialogConfirm(
$q, $q,
() => { () => {
showLoader();
http http
.post(config.API.salaryPeriodProfileEmp, body) .post(config.API.salaryPeriodProfileEmp, body)
.then(() => { .then(async () => {
props.fetchData?.(); await props.fetchData?.();
success($q, "เพื่มรายชื่อสำเร็จ"); await success($q, "เพื่มรายชื่อสำเร็จ");
closeModal(); closeModal();
}) })
.catch((err) => { .catch((err) => {

View file

@ -13,7 +13,7 @@ import { useCounterMixin } from "@/stores/mixin";
/** use*/ /** use*/
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { dialogConfirm, success, messageError } = mixin; const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin;
/** props*/ /** props*/
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
@ -44,6 +44,7 @@ function close() {
function onSubmit() { function onSubmit() {
dialogConfirm($q, () => { dialogConfirm($q, () => {
if (amount.value !== null) { if (amount.value !== null) {
showLoader();
const amountString: string = amount.value.toString(); const amountString: string = amount.value.toString();
const body = { const body = {
profileId: profileId.value, profileId: profileId.value,
@ -54,15 +55,16 @@ function onSubmit() {
}; };
http http
.post(config.API.salaryPeriodEmp() + `/change/amount`, body) .post(config.API.salaryPeriodEmp() + `/change/amount`, body)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.fetchData?.();
props.fetchData?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
close();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
close(); hideLoader();
}); });
} }
}); });
@ -88,6 +90,7 @@ function onSubmit() {
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือนฐาน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกเงินเดือนฐาน'}`]"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
class="inputgreen"
/> />
</div> </div>
</q-card-section> </q-card-section>
@ -97,10 +100,7 @@ function onSubmit() {
<q-btn <q-btn
type="submit" type="submit"
for="#submitForm" for="#submitForm"
unelevated color="secondary"
dense
class="q-px-md items-center"
color="light-blue-10"
label="บันทึก" label="บันทึก"
/> />
</q-card-actions> </q-card-actions>

View file

@ -55,16 +55,16 @@ function onSubmit() {
}; };
http http
.post(config.API.salaryPeriod() + `/change/group`, body) .post(config.API.salaryPeriod() + `/change/group`, body)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.fetchData?.();
props.fetchData?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
close();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
close();
}); });
}); });
} }
@ -120,10 +120,7 @@ function inputEdit(val: boolean) {
<q-btn <q-btn
type="submit" type="submit"
for="#submitForm" for="#submitForm"
unelevated color="secondary"
dense
class="q-px-md items-center"
color="light-blue-10"
label="บันทึก" label="บันทึก"
/> />
</q-card-actions> </q-card-actions>

View file

@ -81,15 +81,15 @@ function onSubmit() {
}; };
http http
.post(config.API.salaryPeriodEmp() + `/change/type`, body) .post(config.API.salaryPeriodEmp() + `/change/type`, body)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.fetchData?.();
props.fetchData?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
close();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
close();
hideLoader(); hideLoader();
}); });
}); });
@ -168,15 +168,11 @@ function inputEdit(val: boolean) {
<q-separator /> <q-separator />
<form @submit.prevent="validateForm"> <form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn <q-btn
:disabled="!isChange" :disabled="!isChange"
type="submit" type="submit"
for="#submitForm" for="#submitForm"
unelevated color="secondary"
dense
class="q-px-md items-center"
color="light-blue-10"
label="บันทึก" label="บันทึก"
/> />
</q-card-actions> </q-card-actions>

View file

@ -66,15 +66,15 @@ function onSubmit() {
}; };
http http
.put(config.API.salaryPropertyEmp(profileId.value), body) .put(config.API.salaryPropertyEmp(profileId.value), body)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.fetchData?.();
props.fetchData?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
close();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
close();
hideLoader(); hideLoader();
}); });
}); });
@ -132,14 +132,10 @@ watch(
<q-separator /> <q-separator />
<form @submit.prevent="validateForm"> <form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal"> <q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn <q-btn
type="submit" type="submit"
for="#submitForm" for="#submitForm"
unelevated color="secondary"
dense
class="q-px-md items-center"
color="light-blue-10"
label="บันทึก" label="บันทึก"
/> />
</q-card-actions> </q-card-actions>

View file

@ -67,7 +67,7 @@ async function uploadFile(event: any) {
res.data[key]?.fileName !== "" res.data[key]?.fileName !== ""
); );
const link = res.data[foundKey]?.uploadUrl; const link = res.data[foundKey]?.uploadUrl;
fileUpLoad(link); await fileUpLoad(link);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -85,10 +85,10 @@ function fileUpLoad(url: string) {
headers: { "Content-Type": fileUpload.value?.type }, headers: { "Content-Type": fileUpload.value?.type },
onUploadProgress: (e) => console.log(e), onUploadProgress: (e) => console.log(e),
}) })
.then(() => { .then(async () => {
success($q, "อัปโหลดไฟล์สำเร็จ"); await fetchListFile();
await success($q, "อัปโหลดไฟล์สำเร็จ");
fileUpload.value = null; fileUpload.value = null;
fetchListFile();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -114,9 +114,10 @@ function saveReccommend(reason: string) {
titleRecommend: reason, titleRecommend: reason,
} }
) )
.then((res) => { .then(async () => {
console.log(res); await props.getData?.();
props.getData?.(); sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -124,8 +125,6 @@ function saveReccommend(reason: string) {
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
}, },
"ยืนยันการ" + titleRecommend.value, "ยืนยันการ" + titleRecommend.value,
"ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?" "ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?"
@ -145,9 +144,9 @@ function sendToDirector(msg: string, type: string) {
props.rootId ? props.rootId : "" props.rootId ? props.rootId : ""
) )
) )
.then((res) => { .then(async () => {
console.log(res); await props.getData?.();
props.getData?.(); sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -155,7 +154,6 @@ function sendToDirector(msg: string, type: string) {
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
}, },
"ยืนยันการ" + msg, "ยืนยันการ" + msg,
"ต้องการยืนยันการ" + msg + "หรือไม่?" "ต้องการยืนยันการ" + msg + "หรือไม่?"
@ -202,16 +200,16 @@ function onDeleteFile(fileName: string) {
) )
) )
.then(() => { .then(() => {
success($q, "ลบไฟล์สำเร็จ"); setTimeout(async () => {
setTimeout(() => { await fetchListFile();
fetchListFile(); await success($q, "ลบไฟล์สำเร็จ");
hideLoader(); await hideLoader();
}, 1000); }, 2000);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) hideLoader();
.finally(async () => {}); });
}); });
} }
@ -377,9 +375,8 @@ onMounted(() => {
dense dense
flat flat
round round
size="12px"
color="blue" color="blue"
icon="mdi-download-outline" icon="mdi-download"
@click="downloadFile(item.fileName)" @click="downloadFile(item.fileName)"
> >
<q-tooltip>ดาวนโหลดเอกสาร</q-tooltip> <q-tooltip>ดาวนโหลดเอกสาร</q-tooltip>
@ -391,9 +388,8 @@ onMounted(() => {
dense dense
flat flat
round round
size="12px"
color="red" color="red"
icon="mdi-delete-outline" icon="mdi-delete"
@click="onDeleteFile(item.fileName)" @click="onDeleteFile(item.fileName)"
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn ><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
> >

View file

@ -260,9 +260,9 @@ function onClickDelete(id: string) {
showLoader(); showLoader();
await http await http
.delete(config.API.salaryListPeriodProfileByIdEmp(id)) .delete(config.API.salaryListPeriodProfileByIdEmp(id))
.then(() => { .then(async () => {
success($q, "ลบข้อมูลสำเร็จ"); await props.fetchDataTable?.();
props.fetchDataTable?.(); await success($q, "ลบข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);

View file

@ -217,9 +217,9 @@ function onClickDelete(id: string) {
showLoader(); showLoader();
await http await http
.delete(config.API.salaryListPeriodProfileByIdEmp(id)) .delete(config.API.salaryListPeriodProfileByIdEmp(id))
.then(() => { .then(async () => {
success($q, "ลบข้อมูลสำเร็จ"); await props.fetchDataTable?.();
props.fetchDataTable?.(); await success($q, "ลบข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -289,7 +289,6 @@ function searchData() {
} }
function onProperties(data: any) { function onProperties(data: any) {
console.log(data);
modalDialogProperties.value = true; modalDialogProperties.value = true;
profileId.value = data.id; profileId.value = data.id;
isPunish.value = data.isPunish; isPunish.value = data.isPunish;
@ -382,7 +381,7 @@ function onClickViewInfo(type: string, id: string) {
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" > <q-tr :props="props">
<q-td> <q-td>
<q-btn <q-btn
v-if=" v-if="

View file

@ -146,8 +146,8 @@ function saveReccommend(reason: string) {
titleRecommend: reason, titleRecommend: reason,
} }
) )
.then(() => { .then(async () => {
props.getData?.(); await props.getData?.();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -204,9 +204,9 @@ function onClickDelete(id: string) {
showLoader(); showLoader();
await http await http
.delete(config.API.salaryListPeriodProfileById(id)) .delete(config.API.salaryListPeriodProfileById(id))
.then(() => { .then(async () => {
success($q, "ลบข้อมูลสำเร็จ"); await props.fetchDataTable?.();
props.fetchDataTable?.(); await success($q, "ลบข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);