feat(registry): add delete button for achievements

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-18 14:40:59 +07:00
parent ef0f879cf8
commit da79633e85
5 changed files with 177 additions and 6 deletions

View file

@ -360,6 +360,21 @@ function serchDataTable() {
);
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData(id.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
/**
* ทำงานเม Components กเรยกใชงาน
*/
@ -495,6 +510,17 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td
v-for="col in props.cols"
@ -552,6 +578,17 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -356,8 +356,8 @@ async function fetchData(id: string) {
await http
.get(config.API.profileNewTrainingByProfileId(id, empType.value))
.then(async (res) => {
rows.value = await res.data.result;
rowsMain.value = await res.data.result;
serchDataTable();
})
.catch((err) => {
messageError($q, err);
@ -567,7 +567,11 @@ onMounted(() => {
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
v-if="
isLeave == false &&
checkPermission($route)?.attrIsDelete &&
!props.row.developmentId
"
flat
dense
round
@ -614,7 +618,11 @@ onMounted(() => {
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
v-if="
isLeave == false &&
checkPermission($route)?.attrIsDelete &&
!props.row.developmentId
"
flat
round
color="red"

View file

@ -317,8 +317,8 @@ async function fetchData() {
const res = await http.get(
config.API.profileNewInsignByProfileId(profileId.value, empType.value)
);
rows.value = res.data.result;
rowsMain.value = res.data.result;
serchDataTable();
} catch (error) {
messageError($q, error);
} finally {
@ -646,6 +646,21 @@ function serchDataTable() {
);
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(async () => {
await fetchData();
@ -773,6 +788,18 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td
v-for="col in props.cols"
@ -824,6 +851,7 @@ onMounted(async () => {
>
<q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
flat
@ -834,6 +862,17 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
color="red"
flat
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -203,8 +203,8 @@ async function fetchData() {
const res = await http.get(
config.API.profileNewHonorByProfileId(profileId.value, empType.value)
);
rows.value = res.data.result;
rowsMain.value = res.data.result;
serchDataTable();
} catch (error) {
messageError($q, error);
} finally {
@ -445,6 +445,21 @@ function serchDataTable() {
);
}
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(() => {
fetchData();
@ -567,6 +582,18 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td
v-for="col in props.cols"
@ -628,6 +655,18 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>

View file

@ -356,8 +356,9 @@ async function fetchData() {
empType.value
)
);
rows.value = res.data.result;
rowsMain.value = res.data.result;
serchDataTable();
} catch (error) {
messageError($q, error);
} finally {
@ -517,6 +518,10 @@ function serchDataTable() {
);
}
/**
* ลบขอมลการพฒนารายบคคล (Individual Development Plan)
* @param rowId องการลบขอม
*/
function onDelete(rowId: string) {
dialogRemove($q, async () => {
showLoader();
@ -532,6 +537,25 @@ function onDelete(rowId: string) {
});
}
/**
* ผลการประเมนการปฏราชการ
* @param rowId องการลบขอม
*/
function handleDelete(rowId: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${rowId}`);
// await fetchData();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
onMounted(async () => {
await fetchData();
empType.value !== "-temp" && (await getDevelop());
@ -668,6 +692,18 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
@ -705,6 +741,18 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-card-actions>
<q-separator />
<q-list>