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

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(
$q,
() => {
showLoader();
http
.post(config.API.salaryPeriodProfileEmp, body)
.then(() => {
props.fetchData?.();
success($q, "เพื่มรายชื่อสำเร็จ");
.then(async () => {
await props.fetchData?.();
await success($q, "เพื่มรายชื่อสำเร็จ");
closeModal();
})
.catch((err) => {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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