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 กเรยกใชงาน * ทำงานเม Components กเรยกใชงาน
*/ */
@ -495,6 +510,17 @@ onMounted(() => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
@ -552,6 +578,17 @@ onMounted(() => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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-card-actions>
<q-separator /> <q-separator />
<q-list> <q-list>

View file

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

View file

@ -317,8 +317,8 @@ async function fetchData() {
const res = await http.get( const res = await http.get(
config.API.profileNewInsignByProfileId(profileId.value, empType.value) config.API.profileNewInsignByProfileId(profileId.value, empType.value)
); );
rows.value = res.data.result;
rowsMain.value = res.data.result; rowsMain.value = res.data.result;
serchDataTable();
} catch (error) { } catch (error) {
messageError($q, error); messageError($q, error);
} finally { } 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 ถูกเรียกใช้งาน*/ /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(async () => { onMounted(async () => {
await fetchData(); await fetchData();
@ -773,6 +788,18 @@ onMounted(async () => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
@ -824,6 +851,7 @@ onMounted(async () => {
> >
<q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip> <q-tooltip>ประวแกไขเครองราชอสรยาภรณ</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate" v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
flat flat
@ -834,6 +862,17 @@ onMounted(async () => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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-card-actions>
<q-separator /> <q-separator />
<q-list> <q-list>

View file

@ -203,8 +203,8 @@ async function fetchData() {
const res = await http.get( const res = await http.get(
config.API.profileNewHonorByProfileId(profileId.value, empType.value) config.API.profileNewHonorByProfileId(profileId.value, empType.value)
); );
rows.value = res.data.result;
rowsMain.value = res.data.result; rowsMain.value = res.data.result;
serchDataTable();
} catch (error) { } catch (error) {
messageError($q, error); messageError($q, error);
} finally { } 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 ถูกเรียกใช้งาน*/ /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(() => { onMounted(() => {
fetchData(); fetchData();
@ -567,6 +582,18 @@ onMounted(() => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
@ -628,6 +655,18 @@ onMounted(() => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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-card-actions>
<q-separator /> <q-separator />
<q-list> <q-list>

View file

@ -356,8 +356,9 @@ async function fetchData() {
empType.value empType.value
) )
); );
rows.value = res.data.result;
rowsMain.value = res.data.result; rowsMain.value = res.data.result;
serchDataTable();
} catch (error) { } catch (error) {
messageError($q, error); messageError($q, error);
} finally { } finally {
@ -517,6 +518,10 @@ function serchDataTable() {
); );
} }
/**
* ลบขอมลการพฒนารายบคคล (Individual Development Plan)
* @param rowId องการลบขอม
*/
function onDelete(rowId: string) { function onDelete(rowId: string) {
dialogRemove($q, async () => { dialogRemove($q, async () => {
showLoader(); 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 () => { onMounted(async () => {
await fetchData(); await fetchData();
empType.value !== "-temp" && (await getDevelop()); empType.value !== "-temp" && (await getDevelop());
@ -668,6 +692,18 @@ onMounted(async () => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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>
<q-td v-for="col in props.cols" :key="col.name" :props="props"> <q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis"> <div class="table_ellipsis">
@ -705,6 +741,18 @@ onMounted(async () => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </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-card-actions>
<q-separator /> <q-separator />
<q-list> <q-list>