ทะเบียนประวัติ: แก้ไขตาราง

This commit is contained in:
puriphatt 2024-03-29 16:49:33 +07:00
parent e998b9a372
commit 4cf44a656e
22 changed files with 110 additions and 699 deletions

View file

@ -276,22 +276,22 @@ async function editData(idData: string) {
});
}
function deleteData(idData: string) {
dialogRemove($q, () =>
http
.delete(config.API.profileNewDisciplineByDisciplineId(idData))
.then(() => {
fetchData(profileId.value);
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
})
);
}
// function deleteData(idData: string) {
// dialogRemove($q, () =>
// http
// .delete(config.API.profileNewDisciplineByDisciplineId(idData))
// .then(() => {
// fetchData(profileId.value);
// success($q, "");
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// hideLoader();
// })
// );
// }
/**
* กดเลอกขอมลทจะแกไข
* @param props props ใน row เลอก
@ -467,7 +467,7 @@ onMounted(async () => {
>
<q-tooltip>ประวแกไขว</q-tooltip>
</q-btn>
<q-btn
<!-- <q-btn
color="red"
flat
dense
@ -479,7 +479,7 @@ onMounted(async () => {
v-close-popup
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-btn> -->
</q-td>
</q-tr>
</template>
@ -573,26 +573,6 @@ onMounted(async () => {
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
<!-- dialog add edit -->

View file

@ -280,26 +280,6 @@ watch(modal, (status) => {
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
</q-card-section>
</q-card>

View file

@ -55,7 +55,6 @@ const formFilter = reactive<FormFilter>({
isProbation: false,
});
const modal = ref<boolean>(false);
const edit = ref<boolean>(false);
const modalHistory = ref<boolean>(false);
@ -252,7 +251,11 @@ function openDialogEdit(props: DetailData) {
edit.value = true;
modal.value = true;
id.value = props.id;
typeLeave.value = {id:props.typeLeaveId,name:props.typeLeave,code:props.code};
typeLeave.value = {
id: props.typeLeaveId,
name: props.typeLeave,
code: props.code,
};
statLeave.value = props.status;
reason.value = props.reason;
dateRange.value = [
@ -392,7 +395,7 @@ const editData = async () => {
http
.patch(config.API.profileNewLeaveById(id.value), {
leaveTypeId: typeLeave.value.id,
dateLeaveStart : dateToISO(dateRange.value[0]),
dateLeaveStart: dateToISO(dateRange.value[0]),
dateLeaveEnd: dateToISO(dateRange.value[1]),
leaveDays: numLeave.value,
leaveCount: 0,
@ -545,11 +548,7 @@ onMounted(() => {
</template>
<template v-slot:body="props" v-if="mode === 'table'">
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.id"
@click="openDialogEdit(props.row)"
>
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{
(formFilter.page - 1) * formFilter.pageSize + props.rowIndex + 1
@ -568,6 +567,19 @@ onMounted(() => {
</div>
</q-td>
<q-td auto-width>
<q-btn
color="primary"
flat
dense
round
class="q-mr-xs"
size="14px"
icon="mdi-pencil-outline"
clickable
@click="openDialogEdit(props.row)"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
<q-btn
color="info"
flat
@ -594,7 +606,7 @@ onMounted(() => {
flat
round
@click="openDialogEdit(props.row)"
><q-tooltip>แกไข</q-tooltip></q-btn
><q-tooltip>แกไขอม</q-tooltip></q-btn
>
<q-btn
color="info"
@ -659,26 +671,6 @@ onMounted(() => {
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
<!-- dialog add edit -->
@ -760,7 +752,6 @@ onMounted(() => {
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
ref="numLeaveRef"
class="full-width inputgreen cursor-pointer"
outlined

View file

@ -322,26 +322,6 @@ watch(modal, (status) => {
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
</q-card-section>
</q-card>

View file

@ -247,22 +247,22 @@ async function editData(idData: string) {
/** ลบข้อมูล */
function deleteData(idData: string) {
dialogRemove($q, () =>
http
.delete(config.API.profileNewDutyByDutyId(idData))
.then(() => {
fetchData(profileId.value);
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
})
);
}
// function deleteData(idData: string) {
// dialogRemove($q, () =>
// http
// .delete(config.API.profileNewDutyByDutyId(idData))
// .then(() => {
// fetchData(profileId.value);
// success($q, "");
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// hideLoader();
// })
// );
// }
/** กด Submit */
@ -421,7 +421,7 @@ onMounted(async () => {
>
<q-tooltip>ประวแกไขปฏราชการพเศษ</q-tooltip>
</q-btn>
<q-btn
<!-- <q-btn
color="red"
flat
dense
@ -433,7 +433,7 @@ onMounted(async () => {
v-close-popup
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-btn> -->
</q-td>
</q-tr>
</template>
@ -521,26 +521,6 @@ onMounted(async () => {
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
<q-dialog v-model="modal" persistent>

View file

@ -281,26 +281,6 @@ watch(modal, (status) => {
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
</q-card-section>
</q-card>