hrms-mgt/src/modules/06_retirement/components/ListRetirement/TableList.vue

900 lines
28 KiB
Vue
Raw Normal View History

2023-07-17 14:56:08 +07:00
<script setup lang="ts">
2023-07-25 18:04:11 +07:00
import { ref, onMounted, computed, watch } from "vue";
2023-07-17 14:56:08 +07:00
import AddList from "../ListRetirement/AddList.vue";
import { useCounterMixin } from "@/stores/mixin";
2023-10-06 13:32:54 +07:00
import { useQuasar, QForm } from "quasar";
2023-07-24 15:26:22 +07:00
import { useRoute } from "vue-router";
2023-08-07 11:06:04 +07:00
import { useRouter } from "vue-router";
2023-07-25 09:04:49 +07:00
import http from "@/plugins/http";
import config from "@/app.config";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
2023-07-17 14:56:08 +07:00
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
2023-11-17 14:21:53 +07:00
/** Use */
2023-07-24 15:26:22 +07:00
const route = useRoute();
2023-08-07 11:06:04 +07:00
const router = useRouter();
const checkRoutePermisson = ref<boolean>(route.name == "retirementidDetail");
2023-07-27 16:59:07 +07:00
const $q = useQuasar();
2023-07-17 14:56:08 +07:00
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
success,
dialogConfirm,
dialogRemove,
2023-10-06 13:32:54 +07:00
date2Thai,
dateToISO,
2024-05-30 17:05:07 +07:00
findOrgName,
} = mixin;
2023-10-06 13:32:54 +07:00
const myForm = ref<QForm | null>(null);
2023-09-15 15:42:23 +07:00
2023-11-17 14:21:53 +07:00
/** ตัวแปร */
2023-08-07 11:06:04 +07:00
const retireld_params = route.params.retirementId;
2023-07-24 15:26:22 +07:00
const modalNote = ref<boolean>(false);
const note = ref<string>("");
2023-07-25 14:11:16 +07:00
const retireProfileId = ref<string>("");
const retireld = ref<string>(retireld_params.toString());
const profileId = ref<string>("");
2023-07-27 16:59:07 +07:00
const filter = ref<string>("");
const statusUpload = ref<boolean>();
const modalEdit = ref<boolean>(false);
const textReport = ref<string>("");
2023-10-06 13:32:54 +07:00
const employeeType = ref<string>("OFFICER");
2023-11-17 14:21:53 +07:00
const action = ref<string>("");
const fileUpload = ref<any>(null);
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
2023-11-17 14:21:53 +07:00
/** คอลัมน์ที่แสดง */
2023-10-06 13:32:54 +07:00
const columns = ref<any["columns"]>([]);
2024-06-24 15:21:20 +07:00
const rows = ref<any[]>([]);
2023-07-27 16:59:07 +07:00
const visibleColumns = ref<string[]>([
2023-07-25 14:11:16 +07:00
"order",
2023-07-17 14:56:08 +07:00
"name",
2023-07-25 14:11:16 +07:00
"organizationOrganization",
2024-05-30 17:05:07 +07:00
"position",
"positionType",
// "organizationAgency",
// "organizationGovernmentAgency",
2023-07-17 14:56:08 +07:00
"positionNumber",
"govGroup",
"govOffice",
2024-05-30 17:05:07 +07:00
"organization",
// "bureau",
2023-07-17 14:56:08 +07:00
]);
2023-11-17 14:21:53 +07:00
/** Hook */
2023-07-27 16:59:07 +07:00
onMounted(() => {
2023-08-07 11:06:04 +07:00
retireld.value = retireld_params.toString();
fecthlistprofile(retireld.value);
2023-07-27 16:59:07 +07:00
});
2023-11-17 14:21:53 +07:00
/**
* งกนป Dialog
*/
const closeDialog = () => {
modalNote.value = false;
2023-10-06 13:32:54 +07:00
modalUpload.value = false;
};
2023-11-17 14:21:53 +07:00
2023-07-27 16:59:07 +07:00
// fecthlist
2023-08-07 11:06:04 +07:00
const fecthlistprofile = async (id: string) => {
2023-07-27 16:59:07 +07:00
showLoader();
await http
2023-08-07 11:06:04 +07:00
.get(config.API.listRetire(id))
.then((res) => {
2023-08-07 18:12:26 +07:00
dataProfile.value = res.data.result;
2023-08-07 11:06:04 +07:00
round.value = res.data.result.round;
statusReport.value = res.data.result.json;
2023-08-07 11:06:04 +07:00
typeReport.value = res.data.result.typeReport;
textReport.value = res.data.result.detail;
employeeType.value = res.data.result.type;
// รายชื่อผู้เกษียณอายุราชการ
2023-07-27 16:59:07 +07:00
rows.value = res.data.result.profile.map((e: any) => ({
id: e.id,
profileId: e.profileId,
order: e.order,
2024-06-24 15:21:20 +07:00
prefix: e.prefix,
firstName: e.firstName,
lastName: e.lastName,
2024-06-07 09:49:39 +07:00
name: e.prefix + e.firstName + " " + e.lastName,
2024-05-30 17:05:07 +07:00
organization: e.root,
position: e.position,
positionNumber: e.posNo,
2024-07-08 12:47:33 +07:00
positionType: e.posTypeName,
positionLevel: e.posLevelName,
2024-05-30 17:05:07 +07:00
// organizationAgency: e.organizationAgency,
// organizationGovernmentAgency: e.organizationGovernmentAgency,
// bureau: e.oc,
2023-08-07 11:06:04 +07:00
reason: e.reason,
remove: e.remove,
2024-05-30 17:05:07 +07:00
root: e.root,
rootId: e.rootId,
child1: e.child1,
child1Id: e.child1Id,
child2: e.child2,
child2Id: e.child2Id,
child3: e.child3,
child3Id: e.child3Id,
child4: e.child4,
child4Id: e.child4Id,
2023-07-27 16:59:07 +07:00
}));
2023-08-23 16:00:32 +07:00
if (statusReport.value == false) {
fecthCheck(retireld.value);
} else statusUpload.value = true;
2023-07-27 16:59:07 +07:00
})
2023-08-07 11:06:04 +07:00
.catch((e) => {
2023-07-27 16:59:07 +07:00
messageError($q, e);
})
.finally(() => {
2023-11-17 14:21:53 +07:00
//คอลัมน์
columns.value = [
{
name: "order",
label: "ลำดับ",
title: "ลำดับ",
field: "order",
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "name",
align: "left",
label: "ชื่อ - นามสกุล",
title: "ชื่อ - นามสกุล",
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
2024-05-30 17:05:07 +07:00
name: "position",
align: "left",
2024-05-30 17:05:07 +07:00
label: "ตำแหน่ง",
title: "ตำแหน่ง",
subtitle: employeeType.value == "OFFICER" ? "ในสายงาน" : "",
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
2024-05-30 17:05:07 +07:00
name: "positionType",
align: "left",
2024-05-30 17:05:07 +07:00
label: "ตำแหน่ง",
title: "ตำแหน่ง",
subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "กลุ่มงาน",
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionNumber",
align: "left",
label: "ตำแหน่ง (เลขที่) ",
title: "ตำแหน่ง",
subtitle: "เลขที่",
field: "positionNumber",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
2024-05-30 17:05:07 +07:00
// {
// name: "organizationAgency",
// align: "left",
// label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)",
// title: "ส่วนราชการ",
// subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน",
// field: "organizationAgency",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "organizationGovernmentAgency",
// align: "left",
// label: "ส่วนราชการ (ระดับสถาบัน/สำนักงาน/กอง)",
// title: "ส่วนราชการ",
// subtitle: "ระดับสถาบัน/สำนักงาน/กอง",
// field: "organizationGovernmentAgency",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
2024-05-30 17:05:07 +07:00
name: "organization",
align: "left",
2024-05-30 17:05:07 +07:00
label: "สังกัด",
title: "สังกัด",
field: "organization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
2024-05-30 17:05:07 +07:00
format(val: any, row: any) {
return findOrgName(row);
},
},
];
2023-07-27 16:59:07 +07:00
hideLoader();
});
};
// เช็คสถานะการอัพโหลด
const fecthCheck = async (id: string) => {
await http
.get(config.API.checkfileupload(id))
.then((res) => {
statusUpload.value = res.data.result;
})
.catch((err) => {
messageError($q, err);
});
};
2023-11-17 14:21:53 +07:00
2023-07-27 16:59:07 +07:00
// DelProfile
2023-08-07 11:06:04 +07:00
const clickDelete = () => {
dialogRemove(
$q,
async () => {
2023-07-25 09:04:49 +07:00
await http
2023-08-07 11:06:04 +07:00
.post(config.API.removeProfile(), {
retireProfileId: retireProfileId.value,
reason: note.value,
})
2023-07-25 09:04:49 +07:00
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
2023-07-27 16:59:07 +07:00
.finally(async () => {
2023-08-07 11:06:04 +07:00
retireld.value = retireld_params.toString();
await fecthlistprofile(retireld.value);
modalNote.value = false;
2023-07-25 09:04:49 +07:00
});
},
"ยืนยันการลบข้อมูล",
"ต้องการลบข้อมูลนี้ใช่หรือไม่ ?"
);
2023-07-17 14:56:08 +07:00
};
2023-11-17 14:21:53 +07:00
// แก้ไข้ข้อมูล
2023-07-24 15:26:22 +07:00
const saveNote = () => {
dialogConfirm(
$q,
async () => {
2023-07-25 09:04:49 +07:00
await http
2023-07-25 14:11:16 +07:00
.post(config.API.createnote(), {
retireProfileId: retireProfileId.value,
reason: note.value,
})
2023-07-25 09:04:49 +07:00
.then(() => {
2023-07-25 14:11:16 +07:00
success($q, "บันทึกข้อมูลสำเร็จ");
2023-07-25 09:04:49 +07:00
})
.catch((e) => {
messageError($q, e);
})
2023-07-27 16:59:07 +07:00
.finally(async () => {
2023-08-07 11:06:04 +07:00
retireld.value = retireld_params.toString();
fecthlistprofile(retireld.value);
2023-07-25 14:11:16 +07:00
modalNote.value = false;
2023-07-25 09:04:49 +07:00
});
},
"ยืนยันการบันทึกข้อมูล",
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?"
);
2023-07-24 15:26:22 +07:00
};
2023-07-27 16:59:07 +07:00
2023-11-17 14:21:53 +07:00
//อัพเดท ListId
2023-07-27 16:59:07 +07:00
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId;
2023-08-07 11:06:04 +07:00
fecthlistprofile(retireld);
2023-07-27 16:59:07 +07:00
};
2023-11-17 14:21:53 +07:00
// กลับหน้าเดิม
2023-07-27 16:59:07 +07:00
const backHistory = () => {
window.history.back();
};
2023-11-17 14:21:53 +07:00
2023-07-25 09:04:49 +07:00
const visibleNote = computed(() => {
if (note.value === "" || note.value === undefined) {
return true;
}
});
2023-11-17 14:21:53 +07:00
// อัปโหลดไฟล์
2023-10-06 13:32:54 +07:00
const modalUpload = ref<boolean>(false);
const signDate = ref<Date | null>(null);
const uploadFile = async (event: any, signDate: any) => {
if (myForm.value !== null) {
myForm.value.validate().then((successmyForm) => {
if (successmyForm) {
dialogConfirm(
$q,
async () => {
showLoader();
const selectedFile = event;
const formdata = new FormData();
formdata.append("file", selectedFile);
if (signDate != null)
formdata.append("signDate", dateToISO(signDate));
2023-10-06 13:32:54 +07:00
await http
.put(
config.API.fileRetirement(retireld.value.toString()),
formdata
)
.then(() => {
success($q, "เพิ่มไฟล์สำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
fileUpload.value = null;
signDate.value = null;
modalUpload.value = false;
fecthlistprofile(retireld.value);
fecthCheck(retireld.value);
hideLoader();
});
},
"ยืนยันการอัปโหลดเอกสาร",
"ต้องการยืนยันการอัปโหลดเอกสารนี้หรือไม่ ?"
);
}
});
2023-10-06 13:32:54 +07:00
}
};
2023-11-17 14:21:53 +07:00
// downloadAttachment
const downloadAttachment = async (type: string, id: string) => {
showLoader();
await http
.get(config.API.reportRetireList(type, id), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `${"รายชื่อผู้เกษียณอายุราชการ"}.${type}`);
})
2024-06-14 11:06:31 +07:00
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
});
};
2023-11-17 14:21:53 +07:00
// downloadFile
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
2023-11-17 14:21:53 +07:00
// ยืนยันการแก้ไขข้อมูล
const saveEdiitReport = (reason: string) => {
const formdata = new FormData();
formdata.append("Detail", reason);
dialogConfirm(
$q,
async () => {
await http
.put(config.API.editDetail(retireld.value), formdata)
.then(() => {
success($q, "แก้ไขข้อความสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
fecthlistprofile(retireld.value);
modalEdit.value = false;
});
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
};
2023-11-17 14:21:53 +07:00
// เปิด popup เหตุผล
const openmodalEditReport = () => {
modalEdit.value = true;
};
2023-11-17 14:21:53 +07:00
/** Setting Pagination */
2023-07-25 18:04:11 +07:00
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",
2023-07-26 00:57:05 +07:00
descending: false,
2023-07-25 18:04:11 +07:00
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
function onclickViewinfo(id: string) {
modalPersonal.value = true;
personId.value = id;
}
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
2023-07-17 14:56:08 +07:00
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
2023-10-06 13:32:54 +07:00
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="backHistory"
/>
2023-07-17 16:13:18 +07:00
รายชอผเกษยณอายราชการ
2023-07-17 14:56:08 +07:00
</div>
<div>
<q-card class="col-12 q-pa-md">
<div class="row col-12 q-pb-sm">
<div class="row">
2023-10-06 13:32:54 +07:00
<AddList
:dataProfile="dataProfile"
:retireld="retireld"
:profile-id="profileId"
:UpdateListId="UpdateListId"
v-if="
!checkRoutePermisson &&
2023-10-06 13:32:54 +07:00
statusReport === false &&
(typeReport == 'ADD' || typeReport == '' || typeReport == null) &&
statusUpload !== true
2023-10-06 13:32:54 +07:00
"
/>
<q-btn color="primary" flat round icon="mdi-dots-vertical">
<q-menu>
<q-list style="min-width: 100px">
2023-10-06 13:32:54 +07:00
<q-item
clickable
v-close-popup
type="a"
@click="
(modalUpload = true), (signDate = null), (fileUpload = null)
"
2023-10-06 13:32:54 +07:00
target="_blank"
v-if="statusUpload !== true && !checkRoutePermisson"
2023-10-06 13:32:54 +07:00
>
<q-item-section avatar
><q-icon color="blue" name="attach_file"
/></q-item-section>
<q-item-section>ปโหลดไฟล </q-item-section>
</q-item>
<q-item
v-if="!checkRoutePermisson"
2023-10-06 13:32:54 +07:00
clickable
v-close-popup
type="a"
@click="openmodalEditReport()"
target="_blank"
>
<q-item-section avatar
><q-icon color="primary" name="mdi-pencil"
/></q-item-section>
<q-item-section>แกไข มต ... </q-item-section>
</q-item>
<q-separator v-if="!checkRoutePermisson" />
2023-10-06 13:32:54 +07:00
<q-item
clickable
v-close-popup
type="a"
@click="downloadAttachment('pdf', retireld)"
target="_blank"
>
<q-item-section avatar
><q-icon color="red" name="mdi-file-pdf"
/></q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
2023-10-06 13:32:54 +07:00
<q-item
clickable
v-close-popup
type="a"
@click="downloadAttachment('docx', retireld)"
target="_blank"
>
<q-item-section avatar
><q-icon color="blue" name="mdi-file-word"
/></q-item-section>
<q-item-section>ไฟล .docx</q-item-section>
</q-item>
</q-list>
</q-menu>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn>
2023-10-06 13:32:54 +07:00
<!-- <q-file
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
:style="fileUpload === null ? 'width: 150px' : 'width: auto'"
label="อัปโหลดไฟล์"
v-if="statusUpload !== true"
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
2023-09-04 14:56:00 +07:00
<q-tooltip>ปโหลดไฟล</q-tooltip>
2023-07-17 14:56:08 +07:00
</template>
2023-10-06 13:32:54 +07:00
</q-file> -->
</div>
<q-space />
<div class="row">
<q-tabs shrink>
2023-10-06 13:32:54 +07:00
<q-input
borderless
outlined
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
2023-10-06 13:32:54 +07:00
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
>
</q-select>
</q-tabs>
</div>
</div>
2023-07-17 14:56:08 +07:00
<div>
2023-10-06 13:32:54 +07:00
<q-table
flat
dense
bordered
:rows="rows"
:columns="columns"
row-key="order"
class="custom-header-table"
:filter="filter"
:visible-columns="visibleColumns"
no-data-label="ไม่มีข้อมูล"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
2023-07-17 14:56:08 +07:00
<template v-slot:header="props">
<q-tr :props="props">
2023-07-27 16:59:07 +07:00
<q-th auto-width />
2024-07-26 17:00:34 +07:00
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<div class="text-grey-7 text-weight-medium">
<span class="row">{{ col.title }}</span>
<span class="row" style="font-size: 12px">{{
col.subtitle
}}</span>
</div>
</q-th>
2023-07-17 14:56:08 +07:00
</q-tr>
</template>
<template v-slot:body="props">
2023-10-06 13:32:54 +07:00
<q-tr
:props="props"
:style="props.row.profileId === profileId && 'color: #26a69a;'"
2023-10-06 13:32:54 +07:00
>
<q-td auto-width>
<q-btn flat round dense icon="mdi-eye" color="info" @click.stop="onclickViewinfo(props.row.profileId)">
<q-tooltip>อมลในทะเบยนประว</q-tooltip>
</q-btn>
<q-btn
v-if="!checkRoutePermisson&&
(props.row.remove === 'EDIT' ||
props.row.remove === 'REMOVE') &&
statusUpload
"
flat
round
:color="props.row.remove === 'EDIT' ? 'primary' : 'red-14'"
icon="info"
dense
@click.stop="
(modalNote = true),
(action = 'delete'),
(note = props.row.reason),
(retireProfileId = props.row.id)
"
><q-tooltip>อม</q-tooltip></q-btn
>
2023-10-06 13:32:54 +07:00
<q-btn
v-if="
!checkRoutePermisson &&
(typeReport === 'EDIT' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
"
2023-10-06 13:32:54 +07:00
flat
round
color="primary"
2024-07-11 13:17:08 +07:00
:icon="props.row.remove === 'EDIT' ? 'info' : 'mdi-pencil'"
2023-10-06 13:32:54 +07:00
dense
@click.stop="
(modalNote = true),
(note = props.row.reason),
(action = 'edit'),
(retireProfileId = props.row.id)
"
>
2023-08-07 11:06:04 +07:00
<q-tooltip>กรอกเหตผล</q-tooltip>
</q-btn>
2023-10-06 13:32:54 +07:00
<q-btn
v-if="
!checkRoutePermisson &&
(typeReport === 'REMOVE' ||
typeReport === null ||
typeReport === '') &&
statusReport === false &&
statusUpload !== true
"
2023-10-06 13:32:54 +07:00
flat
round
color="red"
2024-07-11 13:17:08 +07:00
:icon="props.row.remove === 'REMOVE' ? 'info' : 'mdi-delete'"
2023-10-06 13:32:54 +07:00
dense
@click.stop="
(modalNote = true),
(action = 'delete'),
(note = props.row.reason),
(retireProfileId = props.row.id)
"
><q-tooltip>ลบขอม</q-tooltip></q-btn
>
2023-07-17 14:56:08 +07:00
</q-td>
2024-07-26 17:00:34 +07:00
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
<q-td key="name" :props="props"
>{{ props.row.prefix ? props.row.prefix : ""
}}{{ props.row.firstName ? props.row.firstName : "" }}
{{ props.row.lastName ? props.row.lastName : "" }}</q-td
>
<q-td key="position" :props="props">{{
props.row.position ? props.row.position : "-"
}}</q-td>
<q-td key="positionType" :props="props"
>{{ props.row.positionType ? props.row.positionType : "-" }}
{{
props.row.positionLevel
? " (" + props.row.positionLevel + ")"
: ""
}}
</q-td>
<q-td key="positionNumber" :props="props">{{
props.row.positionNumber ? props.row.positionNumber : "-"
}}</q-td>
<q-td class="table_ellipsis" key="organization" :props="props">{{
props.row.organization ? props.row.organization : "-"
}}</q-td>
2023-07-17 14:56:08 +07:00
</q-tr>
</template>
2023-07-25 18:04:11 +07:00
<template v-slot:pagination="scope">
2023-10-06 13:32:54 +07:00
<q-pagination
v-model="pagination.page"
color="primary"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
2023-07-25 18:04:11 +07:00
</template>
2023-07-17 14:56:08 +07:00
</q-table>
</div>
</q-card>
</div>
2023-07-24 15:26:22 +07:00
<!-- note -->
<q-dialog v-model="modalNote" persistent>
2023-09-15 15:42:23 +07:00
<q-card style="width: 50vw">
2023-09-14 17:23:30 +07:00
<DialogHeader tittle="กรอกเหตุผล" :close="closeDialog" />
<q-separator />
<q-card-section>
2023-09-14 17:23:30 +07:00
<div class="row q-col-gutter-sm">
<div class="col-12">
2023-10-06 13:32:54 +07:00
<q-input
outlined
dense
lazy-rules
hide-bottom-space
2023-10-06 13:32:54 +07:00
v-model="note"
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
:label="`${'กรอกเหตุผล'}`"
type="textarea"
:readonly="statusUpload"
2023-10-06 13:32:54 +07:00
/>
2023-09-14 17:23:30 +07:00
</div>
</div>
2023-07-24 15:26:22 +07:00
</q-card-section>
<q-separator />
<q-card-actions align="right" v-if="!statusUpload">
2023-10-06 13:32:54 +07:00
<q-btn
v-if="action === 'delete'"
unelevated
2023-10-06 13:32:54 +07:00
label="บันทึก"
color="secondary"
:disable="visibleNote"
@click="clickDelete"
/>
<q-btn
v-else
unelevated
2023-10-06 13:32:54 +07:00
label="บักทึก"
color="secondary"
@click="saveNote"
:disable="visibleNote"
/>
</q-card-actions>
</q-card>
</q-dialog>
<!-- ปโหลดไฟล -->
<q-dialog v-model="modalUpload" persistent>
2023-10-06 13:32:54 +07:00
<q-card style="width: 50vw">
<DialogHeader tittle="อัปโหลดเอกสาร" :close="closeDialog" />
<q-separator />
<q-card-section>
<q-form ref="myForm">
<div class="row q-gutter-md">
<div class="col-12 q-pr-md">
2023-10-06 13:32:54 +07:00
<q-file
hide-bottom-space
2023-10-06 13:32:54 +07:00
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
label="อัปโหลดเอกสาร"
:rules="[(val) => !!val || `${'กรุณาเลือกเอกสารอัปโหลด'}`]"
lazy-rules
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>ปโหลดไฟล</q-tooltip>
</template>
</q-file>
</div>
<div class="col-12 q-pr-md">
2023-10-06 13:32:54 +07:00
<datepicker
menu-class-name="modalfix"
v-model="signDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"
:model-value="
signDate !== null ? date2Thai(signDate) : null
"
hide-bottom-space
:label="`${'ประกาศ ณ วันที่'}`"
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer text-primary">
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
</q-form>
</q-card-section>
2023-10-06 13:32:54 +07:00
<q-separator />
2023-10-06 13:32:54 +07:00
<q-card-actions align="right">
<q-btn
unelevated
label="บันทึก"
2023-10-06 13:32:54 +07:00
color="public"
@click="uploadFile(fileUpload, signDate)"
>
<q-tooltip>นท</q-tooltip>
</q-btn>
2023-07-24 15:26:22 +07:00
</q-card-actions>
</q-card>
</q-dialog>
2023-10-06 13:32:54 +07:00
<DialogPopupReason
v-model:modal="modalEdit"
2023-10-06 13:32:54 +07:00
title="แก้ไขมติ อ.ก.ก."
label="มติ อ.ก.ก."
:savaForm="saveEdiitReport"
:textReport="textReport"
/>
<PopupPersonal
:modal="modalPersonal"
:id="personId"
@update:modal="updatemodalPersonal"
2024-05-30 17:05:07 +07:00
v-model:is-employee="employeeType"
/>
2023-07-17 14:56:08 +07:00
</template>
<style lang="scss" scope>
.custom-header-table {
max-height: 64vh;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
z-index: 1;
}
2023-07-17 14:56:08 +07:00
.q-table thead tr:last-child th {
top: 48px;
}
2023-07-17 14:56:08 +07:00
.q-table thead tr:first-child th {
top: 0;
}
}
2023-07-24 15:26:22 +07:00
.q-btn-dropdown__arrow {
display: none;
}
2023-07-17 14:56:08 +07:00
</style>