feat: add btn delete PersonalInformation

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-13 16:57:12 +07:00
parent 3cdbba6cc0
commit 41c11f6913
4 changed files with 84 additions and 4 deletions

View file

@ -371,7 +371,7 @@ function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.API + `/${id}`);
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData(profileId.value);
// success($q, "");
// } catch (err) {

View file

@ -375,8 +375,6 @@ function onOpenDialogForm(
isStatusEdit: boolean = false,
data: any = undefined
) {
console.log(data);
modal.value = true;
typeForm.value = type;
isEdit.value = isStatusEdit;
@ -509,6 +507,21 @@ async function fetchDataHistory() {
}
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchDataCouple();
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(async () => {
showLoader();
@ -830,6 +843,19 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip></q-btn
>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
color="red"
flat
dense
round
icon="delete"
@click="handleDelete(item.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
<q-btn
round
flat

View file

@ -576,6 +576,21 @@ async function fetchDataHistory() {
}
}
function handleDelete(id: string) {
// dialogRemove($q, async () => {
// showLoader();
// try {
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
// await fetchData(profileId.value);
// success($q, "");
// } catch (err) {
// messageError($q, err);
// } finally {
// hideLoader();
// }
// });
}
/** ฟังก์ค้นหาข้อมูลรายการประวัติการศึกษา */
function serchDataTable() {
rows.value = onSearchDataTable(
@ -736,6 +751,18 @@ onMounted(async () => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="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"

View file

@ -252,8 +252,8 @@ async function fetchData(id: string) {
await http
.get(config.API.profileNewAbilityByProfileId(id, empType.value))
.then(async (res) => {
rows.value = await res.data.result;
rowsMain.value = await res.data.result;
serchDataTable();
})
.catch((err) => {
messageError($q, err);
@ -403,6 +403,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 ถูกเรียกใช้งาน*/
onMounted(() => {
fetchData(id.value);
@ -529,6 +544,18 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
v-if="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"