fix(registry): add delete button for Table Card
This commit is contained in:
parent
505a932b88
commit
04a76b3025
15 changed files with 151 additions and 29 deletions
|
|
@ -860,7 +860,7 @@ onMounted(async () => {
|
|||
icon="edit"
|
||||
@click="onClickOpenDialog(true, props.row)"
|
||||
>
|
||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ async function fetchData() {
|
|||
|
||||
/**
|
||||
* บันทึกข้อมูลประกาศเกียรติคุณ
|
||||
* @param editStatus แก่ไข,เพิ่ม
|
||||
* @param editStatus แก้ไข,เพิ่ม
|
||||
*/
|
||||
async function addEditData(editStatus: boolean = false) {
|
||||
if (!profileId.value) return;
|
||||
|
|
@ -653,7 +653,7 @@ onMounted(() => {
|
|||
icon="edit"
|
||||
@click="onClickOpenDialog(true, props.row)"
|
||||
>
|
||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ function fetchDataEmployment(id: string) {
|
|||
|
||||
/**
|
||||
* function เปิด dialog Form ข้อมูลการจ้าง
|
||||
* @param statusEdit สถานะการ สร้าง หรือ แก่ไข
|
||||
* @param statusEdit สถานะการ สร้าง หรือ แก้ไข
|
||||
* @param id รายการการจ้าง
|
||||
*/
|
||||
function onOpenDialog(statusEdit: boolean = false, id: string = "") {
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ function openDialogHistory(idOrder: string) {
|
|||
id.value = idOrder;
|
||||
}
|
||||
|
||||
/** fetch ข้อมูลประวัติการแก่ไขข้อมูลวินัย*/
|
||||
/** fetch ข้อมูลประวัติการแก้ไขข้อมูลวินัย*/
|
||||
async function fetchDataHistory() {
|
||||
showLoader();
|
||||
|
||||
|
|
@ -602,7 +602,7 @@ onMounted(() => {
|
|||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -658,8 +658,9 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวิติแก้ไขวินัย</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>ประวิติแก้ไขวินัย</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
|
|
@ -667,8 +668,20 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไข</q-tooltip></q-btn
|
||||
>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ function clickEditRowType() {
|
|||
}
|
||||
}
|
||||
|
||||
function f(id: string) {
|
||||
function handleDelete(id: string) {
|
||||
// dialogRemove($q, async () => {
|
||||
// showLoader();
|
||||
// try {
|
||||
|
|
@ -615,7 +615,7 @@ onMounted(() => {
|
|||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -651,8 +651,9 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวิติแก้ไขการลา</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>ประวิติแก้ไขการลา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
|
|
@ -660,8 +661,20 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ const isLeave = defineModel<boolean>("isLeave", {
|
|||
const id = ref<string>(""); //id ที่ต้องการแก้ไข
|
||||
const modal = ref<boolean>(false); //แสดง popup ข้อมูลปฏิบัติราชการพิเศษ
|
||||
const modalHistory = ref<boolean>(false); //แสดง popup ประวัติการแก้ไขข้อมูลปฏิบัติราชการพิเศษ
|
||||
const edit = ref<boolean>(false); //สถานะการแก่ไข
|
||||
const edit = ref<boolean>(false); //สถานะการแก้ไข
|
||||
//ฟอร์มข้อมูลปฏิบัติราชการพิเศษ
|
||||
const dutyData = reactive<RequestItemsObject>({
|
||||
profileId: profileId.value,
|
||||
|
|
@ -588,7 +588,7 @@ onMounted(() => {
|
|||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -644,7 +644,8 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวัติแก้ไขปฏิบัติราชการพิเศษ</q-tooltip>
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขปฏิบัติราชการพิเศษ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
|
|
@ -653,7 +654,19 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
>
|
||||
<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>
|
||||
|
||||
|
|
|
|||
|
|
@ -224,8 +224,8 @@ async function fetchData() {
|
|||
.get(config.API.profileAssistance(empType.value, profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = data;
|
||||
rowsMain.value = data;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -600,7 +600,11 @@ onMounted(() => {
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete && !props.row.commandId"
|
||||
v-if="
|
||||
!isLeave &&
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
!props.row.commandId
|
||||
"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -694,6 +698,22 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>ส่งตัวกลับ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
!props.row.commandId
|
||||
"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ async function fetchDataTenure() {
|
|||
/**
|
||||
* function เลือกประเภทตำแหน่ง
|
||||
* @param val id ประเภทตำแหน่ง
|
||||
* @param status แก่ไข , เพิ่ม
|
||||
* @param status แก้ไข , เพิ่ม
|
||||
*/
|
||||
async function updateSelectType(val: string, status: boolean = false) {
|
||||
const listLevel = val
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ function openDialogHistory(idOrder: string) {
|
|||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลประวัติการแก่ไขข้อมูล*/
|
||||
/** ฟังก์ชันดึงข้อมูลประวัติการแก้ไขข้อมูล*/
|
||||
async function fetchDataHistory() {
|
||||
showLoader();
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const modal = ref<boolean>(false); // แสดงฟอร์มแก้ไข
|
|||
const informaData = ref<ResponseObject>(); // ข้อมูลส่วนคัว
|
||||
const modalHistory = ref<boolean>(false); // แสดงช้อมูลรายการประวัติการแก้ไข
|
||||
const age = ref<string | null>(""); //อายุ
|
||||
const formData = reactive<RequestObject>(store.defaultProfile); //ฟอร์มข้อมูลการแก่้ไข
|
||||
const formData = reactive<RequestObject>(store.defaultProfile); //ฟอร์มข้อมูลการแก้ไข
|
||||
const emailVerify = ref<string | null>("");
|
||||
|
||||
/** ข้อมูล Label*/
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ function closeDialog() {
|
|||
/**
|
||||
* function แก้ไขข้อมูล
|
||||
* @param type ประเภทของบุคคล
|
||||
* @param isStatusEdit สถานะแก่้ไข
|
||||
* @param isStatusEdit สถานะแก้ไข
|
||||
* @param data ข้อมูลเดิม
|
||||
*/
|
||||
function onOpenDialogForm(
|
||||
|
|
|
|||
|
|
@ -753,7 +753,7 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -790,7 +790,7 @@ onMounted(async () => {
|
|||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false"
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -800,6 +800,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>
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ onMounted(() => {
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -605,7 +605,7 @@ onMounted(() => {
|
|||
<q-tooltip>ประวัติแก้ไขความสามารถพิเศษ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false"
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -620,6 +620,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>
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ async function fetchDataOptionExecutive() {
|
|||
/**
|
||||
* function เลือกประเภทตำแหน่ง
|
||||
* @param val id ประเภทตำแหน่ง
|
||||
* @param status แก่ไข , เพิ่ม
|
||||
* @param status แก้ไข , เพิ่ม
|
||||
*/
|
||||
async function updateSelectType(val: string, status: boolean = false) {
|
||||
const listLevel = val
|
||||
|
|
|
|||
|
|
@ -295,8 +295,8 @@ async function getData() {
|
|||
await http
|
||||
.get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -335,6 +335,21 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
// dialogRemove($q, async () => {
|
||||
// showLoader();
|
||||
// try {
|
||||
// await http.delete(config.API.profileChangeNameUpdate + `${id}`);
|
||||
// await getData();
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// } catch (err) {
|
||||
// messageError($q, err);
|
||||
// } finally {
|
||||
// hideLoader();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน */
|
||||
onMounted(() => {
|
||||
getData();
|
||||
|
|
@ -460,6 +475,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"
|
||||
|
|
@ -517,7 +544,19 @@ onMounted(() => {
|
|||
icon="edit"
|
||||
@click="onClickOpenDialog(true, props.row)"
|
||||
>
|
||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||
<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 />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue