feat(registry): add delete button for achievements
This commit is contained in:
parent
ef0f879cf8
commit
da79633e85
5 changed files with 177 additions and 6 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue