แก้ไขทะเบียนประวัติ ตำแหน่ง/เงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-03-26 17:39:59 +07:00
parent 5fe741c35f
commit 3f9a677d9b
14 changed files with 539 additions and 74 deletions

View file

@ -33,6 +33,7 @@ const empType = ref<string>(route.params.type.toString());
const profileId = ref<string>(route.params.id.toString());
const tabs = defineModel<string>("tabs", { required: true });
const isConfirmEdit = defineModel<boolean>("isConfirmEdit", { required: true });
const statusCheckEdit = defineModel<string>("statusCheckEdit", {
required: true,
});
@ -322,6 +323,11 @@ function onEditData(index: number) {
modal.value = true;
}
/**
* function สลบตำแหนงของขอมลขนลง
* @param action up , down
* @param id id รายการทองการสลบตะแหน
*/
async function onSwapData(action: string, id: string) {
showLoader();
await http
@ -337,6 +343,11 @@ async function onSwapData(action: string, id: string) {
});
}
/**
* function ลบขอมลรายการตำแหนงเงนเดอน
* @param id id องการลบขอมลรายการตำแหนงเงนเดอน
* @param isDelete true ลบขอมลรานการตำแหนงเงนเดอน false นำขอมลรายการทลบไปกลบมา
*/
function onConfirmDeleteData(id: string, isDelete: boolean) {
isDelete
? dialogConfirm(
@ -352,6 +363,11 @@ function onConfirmDeleteData(id: string, isDelete: boolean) {
});
}
/**
* function ลบขอมลรายการตำแหนงเงนเดอน
* @param id id องการลบขอมลรายการตำแหนงเงนเดอน
* @param isDelete true ลบขอมลรานการตำแหนงเงนเดอน false นำขอมลรายการทลบไปกลบมา
*/
async function onDeleteData(id: string, isDelete: boolean) {
showLoader();
const path = isDelete ? "/delete-renew" : "/delete";
@ -372,6 +388,13 @@ async function onDeleteData(id: string, isDelete: boolean) {
});
}
/**
* class ของขอความ
* @param isDelete รายการทลบ
* @param isEdit รายการทแกไข
* @param isEntry รายการขอมลทมากจาก Entry
* @returns class
*/
function classColorRow(isDelete: boolean, isEdit: boolean, isEntry: boolean) {
return isDelete
? "text-red"
@ -437,7 +460,13 @@ onMounted(() => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-if="tabs === 'PENDING' && statusCheckEdit !== 'CHECKED'" />
<q-th
v-if="
tabs === 'PENDING' &&
statusCheckEdit == 'PENDING' &&
isConfirmEdit
"
/>
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
@ -445,7 +474,13 @@ onMounted(() => {
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td v-if="tabs === 'PENDING' && statusCheckEdit !== 'CHECKED'">
<q-td
v-if="
tabs === 'PENDING' &&
statusCheckEdit == 'PENDING' &&
isConfirmEdit
"
>
<q-btn
dense
flat