Merge branch 'nice' into develop
This commit is contained in:
commit
60115401a0
26 changed files with 841 additions and 682 deletions
|
|
@ -25,6 +25,7 @@ const {
|
||||||
success,
|
success,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString());
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
@ -44,6 +45,7 @@ const editId = ref<string>(""); //id ที่ต้องการแก้ไ
|
||||||
|
|
||||||
//Table Main
|
//Table Main
|
||||||
const rows = ref<ResponseObject[]>([]); //รายการใบอนุญาตประกอบวิชาชีพ
|
const rows = ref<ResponseObject[]>([]); //รายการใบอนุญาตประกอบวิชาชีพ
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]); //รายการใบอนุญาตประกอบวิชาชีพ
|
||||||
const keyword = ref<string>(""); //คำค้นหา
|
const keyword = ref<string>(""); //คำค้นหา
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -118,6 +120,8 @@ const pagination = ref({
|
||||||
|
|
||||||
//Table ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ
|
//Table ประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ
|
||||||
const historyRows = ref<ResponseObject[]>([]); //รายการประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ
|
const historyRows = ref<ResponseObject[]>([]); //รายการประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ
|
||||||
|
const historyRowsMain = ref<ResponseObject[]>([]); //รายการประวัติแก้ไขใบอนุญาตประกอบวิชาชีพ
|
||||||
|
|
||||||
const historyKeyword = ref<string>(""); //คำค้นหาประวัติแก้ไข
|
const historyKeyword = ref<string>(""); //คำค้นหาประวัติแก้ไข
|
||||||
const historyColumns = ref<QTableProps["columns"]>([
|
const historyColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -224,9 +228,7 @@ const profesLicenseData = reactive<RequestItemsObject>({
|
||||||
profileId: id.value,
|
profileId: id.value,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** ยืนยันการบันทึกข้อมูล*/
|
||||||
* ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -238,31 +240,26 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด form ข้อมูลใบอนุญาตประกอบวิชาชีพ*/
|
||||||
* ปิด form ข้อมูลใบอนุญาตประกอบวิชาชีพ
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด popup ประวัติการแก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ*/
|
||||||
* ปิด popup ประวัติการแก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ
|
|
||||||
*/
|
|
||||||
function closeHistoryDialog() {
|
function closeHistoryDialog() {
|
||||||
historyDialog.value = false;
|
historyDialog.value = false;
|
||||||
historyRows.value = [];
|
historyRows.value = [];
|
||||||
historyKeyword.value = "";
|
historyKeyword.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ข้อมูลรายการใบอนุญาตประกอบวิชาชีพ*/
|
||||||
* fetch ข้อมูลรายการใบอนุญาตประกอบวิชาชีพ
|
|
||||||
*/
|
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewCertificateByProfileId(id, empType.value))
|
.get(config.API.profileNewCertificateByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -272,9 +269,7 @@ async function fetchData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เคลียร์ form ข้อมูลใบอนุญาตประกอบวิชาชีพ*/
|
||||||
* เคลียร์ form ข้อมูลใบอนุญาตประกอบวิชาชีพ
|
|
||||||
*/
|
|
||||||
function clearForm() {
|
function clearForm() {
|
||||||
profesLicenseData.expireDate = null;
|
profesLicenseData.expireDate = null;
|
||||||
profesLicenseData.issueDate = new Date();
|
profesLicenseData.issueDate = new Date();
|
||||||
|
|
@ -349,15 +344,14 @@ function editData(idData: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ข้อมูลประวัติการแก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ*/
|
||||||
* fetch ข้อมูลประวัติการแก้ไขข้อมูลใบอนุญาตประกอบวิชาชีพ
|
|
||||||
*/
|
|
||||||
function fetchHistoryData(id: string) {
|
function fetchHistoryData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.profileNewCertificateHisByCertificateId(id, empType.value))
|
.get(config.API.profileNewCertificateHisByCertificateId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
historyRows.value = res.data.result;
|
historyRows.value = res.data.result;
|
||||||
|
historyRowsMain.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -367,6 +361,22 @@ function fetchHistoryData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
historyRows.value = onSearchDataTable(
|
||||||
|
historyKeyword.value,
|
||||||
|
historyRowsMain.value,
|
||||||
|
historyColumns.value ? historyColumns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||||
*/
|
*/
|
||||||
|
|
@ -394,7 +404,13 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input dense outlined v-model="keyword" label="ค้นหา">
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="keyword"
|
||||||
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -456,7 +472,6 @@ onMounted(() => {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:filter="keyword.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
|
|
@ -730,6 +745,7 @@ onMounted(() => {
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
v-model="historyKeyword"
|
v-model="historyKeyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -757,7 +773,6 @@ onMounted(() => {
|
||||||
:rows="historyRows"
|
:rows="historyRows"
|
||||||
row-key="name"
|
row-key="name"
|
||||||
flat
|
flat
|
||||||
:filter="historyKeyword.trim()"
|
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
|
@ -771,7 +786,6 @@ onMounted(() => {
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width />
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,7 @@ import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/r
|
||||||
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Training";
|
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Training";
|
||||||
|
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
import dialogHeader from "@/components/DialogHeader.vue";
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -31,6 +29,7 @@ const {
|
||||||
success,
|
success,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString());
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
@ -62,6 +61,7 @@ const trainData = reactive<RequestItemsObject>({
|
||||||
|
|
||||||
//Table Main
|
//Table Main
|
||||||
const rows = ref<ResponseObject[]>([]);
|
const rows = ref<ResponseObject[]>([]);
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]);
|
||||||
const keyword = ref<string>("");
|
const keyword = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -91,10 +91,12 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันเริ่มต้นการฝึกอบรม/ดูงาน",
|
label: "วันเริ่มต้นการฝึกอบรม/ดูงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "startDate",
|
||||||
v.isDate
|
format(val, row) {
|
||||||
? date2Thai(v.startDate)
|
return row.isDate
|
||||||
: new Date(v.startDate).getFullYear() + 543,
|
? date2Thai(row.startDate)
|
||||||
|
: new Date(row.startDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -105,8 +107,12 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันสิ้นสุดการฝึกอบรม/ดูงาน",
|
label: "วันสิ้นสุดการฝึกอบรม/ดูงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "endDate",
|
||||||
v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543,
|
format(val, row) {
|
||||||
|
return row.isDate
|
||||||
|
? date2Thai(row.endDate)
|
||||||
|
: new Date(row.endDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -200,6 +206,7 @@ const pagination = ref({
|
||||||
|
|
||||||
//Table ประวัติแก้ไข
|
//Table ประวัติแก้ไข
|
||||||
const historyRows = ref<ResponseObject[]>([]);
|
const historyRows = ref<ResponseObject[]>([]);
|
||||||
|
const historyRowsMain = ref<ResponseObject[]>([]);
|
||||||
const historyKeyword = ref<string>("");
|
const historyKeyword = ref<string>("");
|
||||||
const historyColumns = ref<QTableProps["columns"]>([
|
const historyColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -229,10 +236,12 @@ const historyColumns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันเริ่มต้นการฝึกอบรม/ดูงาน",
|
label: "วันเริ่มต้นการฝึกอบรม/ดูงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "startDate",
|
||||||
v.isDate
|
format(val, row) {
|
||||||
? date2Thai(v.startDate)
|
return row.isDate
|
||||||
: new Date(v.startDate).getFullYear() + 543,
|
? date2Thai(row.startDate)
|
||||||
|
: new Date(row.startDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -243,8 +252,12 @@ const historyColumns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันสิ้นสุดการฝึกอบรม/ดูงาน",
|
label: "วันสิ้นสุดการฝึกอบรม/ดูงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "endDate",
|
||||||
v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543,
|
format(val, row) {
|
||||||
|
return row.isDate
|
||||||
|
? date2Thai(row.endDate)
|
||||||
|
: new Date(row.endDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -361,9 +374,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** ยืนยันการบันทึกข้อมูล*/
|
||||||
* ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -375,9 +386,7 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เคลียร์ form ฝึกอบรม/ดูงาน */
|
||||||
* เคลียร์ form ฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
function clearForm() {
|
function clearForm() {
|
||||||
isDate.value = "false";
|
isDate.value = "false";
|
||||||
trainData.name = "";
|
trainData.name = "";
|
||||||
|
|
@ -392,9 +401,7 @@ function clearForm() {
|
||||||
trainData.endDate = new Date();
|
trainData.endDate = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด popoup แก้ไขข้อมูลฝึกอบรม/ดูงาน */
|
||||||
* เปิด popoup แก้ไขข้อมูลฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
function editForm(row: any) {
|
function editForm(row: any) {
|
||||||
dialogStatus.value = "edit";
|
dialogStatus.value = "edit";
|
||||||
editId.value = row.id;
|
editId.value = row.id;
|
||||||
|
|
@ -414,9 +421,7 @@ function editForm(row: any) {
|
||||||
dialog.value = true;
|
dialog.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เพิ่มข้อมูลการฝึกอบรม/ดูงาน*/
|
||||||
* เพิ่มข้อมูลการฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
function addData() {
|
function addData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -468,32 +473,27 @@ function editData(idData: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด from การฝึกอบรม/ดูงาน*/
|
||||||
* ปิด from การฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
clearForm();
|
clearForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด ประวัติการแก่ไขการฝึกอบรม/ดูงาน */
|
||||||
* ปิด ประวัติการแก่ไขการฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
function closeHistoryDialog() {
|
function closeHistoryDialog() {
|
||||||
historyDialog.value = false;
|
historyDialog.value = false;
|
||||||
historyRows.value = [];
|
historyRows.value = [];
|
||||||
historyKeyword.value = "";
|
historyKeyword.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch รายการการฝึกอบรม/ดูงาน*/
|
||||||
* fetch รายการการฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewTrainingByProfileId(id, empType.value))
|
.get(config.API.profileNewTrainingByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -503,15 +503,14 @@ async function fetchData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ประวัติรายการแก้ไขการฝึกอบรม/ดูงาน*/
|
||||||
* fetch ประวัติรายการแก้ไขการฝึกอบรม/ดูงาน
|
|
||||||
*/
|
|
||||||
function fetchHistoryData(id: string) {
|
function fetchHistoryData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.profileNewTrainingHisByTrainingId(id, empType.value))
|
.get(config.API.profileNewTrainingHisByTrainingId(id, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
historyRows.value = res.data.result;
|
historyRows.value = res.data.result;
|
||||||
|
historyRowsMain.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -521,9 +520,23 @@ function fetchHistoryData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function serchDataTable() {
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
rows.value = onSearchDataTable(
|
||||||
*/
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
historyRows.value = onSearchDataTable(
|
||||||
|
historyKeyword.value,
|
||||||
|
historyRowsMain.value,
|
||||||
|
historyColumns.value ? historyColumns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
});
|
});
|
||||||
|
|
@ -550,7 +563,14 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input dense outlined v-model="keyword" label="ค้นหา">
|
|
||||||
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="keyword"
|
||||||
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -612,7 +632,6 @@ onMounted(() => {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:filter="keyword.trim()"
|
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
|
|
@ -1114,6 +1133,7 @@ onMounted(() => {
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
v-model="historyKeyword"
|
v-model="historyKeyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -1141,7 +1161,6 @@ onMounted(() => {
|
||||||
:rows="historyRows"
|
:rows="historyRows"
|
||||||
row-key="name"
|
row-key="name"
|
||||||
flat
|
flat
|
||||||
:filter="historyKeyword.trim()"
|
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
|
@ -1155,7 +1174,6 @@ onMounted(() => {
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width />
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,10 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -82,7 +81,8 @@ const Ops = ref<InsigniaOps>({
|
||||||
|
|
||||||
//Table Main
|
//Table Main
|
||||||
const rows = ref<ResponseObject[]>([]);
|
const rows = ref<ResponseObject[]>([]);
|
||||||
const filterSearch = ref("");
|
const rowsMain = ref<ResponseObject[]>([]);
|
||||||
|
const filterSearch = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "year",
|
name: "year",
|
||||||
|
|
@ -123,7 +123,10 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ลำดับชั้น",
|
label: "ลำดับชั้น",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) => v.insignia.insigniaType.name,
|
field: "insigniaType",
|
||||||
|
format(val, row) {
|
||||||
|
return row.insignia.insigniaType.name;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -265,6 +268,7 @@ const pagination = ref({
|
||||||
|
|
||||||
//Table ประวัติแก้ไข
|
//Table ประวัติแก้ไข
|
||||||
const rowsHistory = ref<RequestItemsObject[]>([]);
|
const rowsHistory = ref<RequestItemsObject[]>([]);
|
||||||
|
const rowsHistoryMain = ref<RequestItemsObject[]>([]);
|
||||||
const filterHistory = ref<string>("");
|
const filterHistory = ref<string>("");
|
||||||
const columnsHistory = ref<QTableProps["columns"]>([
|
const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -306,7 +310,10 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ลำดับชั้น",
|
label: "ลำดับชั้น",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) => v.insignia.insigniaType.name,
|
field: "insigniaType",
|
||||||
|
format(val, row) {
|
||||||
|
return row.insignia.insigniaType.name;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -459,9 +466,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** fetch ข้อมูลรายการเครื่องราชอิสริยาภรณ์*/
|
||||||
* fetch ข้อมูลรายการเครื่องราชอิสริยาภรณ์
|
|
||||||
*/
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -470,6 +475,7 @@ async function fetchData() {
|
||||||
config.API.profileNewInsignByProfileId(profileId.value, empType.value)
|
config.API.profileNewInsignByProfileId(profileId.value, empType.value)
|
||||||
);
|
);
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
messageError($q, error);
|
messageError($q, error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -477,9 +483,7 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ข้อมูลเครื่องราชอิสริยาภรณ์*/
|
||||||
* fetch ข้อมูลเครื่องราชอิสริยาภรณ์
|
|
||||||
*/
|
|
||||||
async function fetchInsignia() {
|
async function fetchInsignia() {
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
|
|
@ -523,9 +527,7 @@ async function addEditData(editStatus: boolean = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด form ข้อมูลเครื่องราชอิสริยาภรณ์*/
|
||||||
* เปิด form ข้อมูลเครื่องราชอิสริยาภรณ์
|
|
||||||
*/
|
|
||||||
function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
isEdit.value = editStatus;
|
isEdit.value = editStatus;
|
||||||
|
|
@ -551,17 +553,13 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด form ข้อมูลเครื่องราชอิสริยาภรณ์*/
|
||||||
* ปิด form ข้อมูลเครื่องราชอิสริยาภรณ์
|
|
||||||
*/
|
|
||||||
function clickClose() {
|
function clickClose() {
|
||||||
clearData();
|
clearData();
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลเครื่องราชอิสริยาภรณ์ */
|
||||||
* fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลเครื่องราชอิสริยาภรณ์
|
|
||||||
*/
|
|
||||||
async function clickHistory(row: ResponseObject) {
|
async function clickHistory(row: ResponseObject) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
filterSearch.value = "";
|
filterSearch.value = "";
|
||||||
|
|
@ -571,6 +569,7 @@ async function clickHistory(row: ResponseObject) {
|
||||||
config.API.profileNewInsignHisById(row.id, empType.value)
|
config.API.profileNewInsignHisById(row.id, empType.value)
|
||||||
);
|
);
|
||||||
rowsHistory.value = res.data.result;
|
rowsHistory.value = res.data.result;
|
||||||
|
rowsHistoryMain.value = res.data.result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -578,9 +577,7 @@ async function clickHistory(row: ResponseObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ยืนยีนการบันทึกข้อมูล*/
|
||||||
* ยืนยีนการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -612,9 +609,7 @@ function filterSelector(val: string, update: Function, refData: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ค้นหาลำดับชั้น*/
|
||||||
* ค้นหาลำดับชั้น
|
|
||||||
*/
|
|
||||||
function insigniaTypeSelection() {
|
function insigniaTypeSelection() {
|
||||||
const insigniaTypeFilter = Ops.value.insigniaOptions.filter(
|
const insigniaTypeFilter = Ops.value.insigniaOptions.filter(
|
||||||
(r: DataOptionInsignia) => r.id === insigniaForm.insigniaId
|
(r: DataOptionInsignia) => r.id === insigniaForm.insigniaId
|
||||||
|
|
@ -624,9 +619,7 @@ function insigniaTypeSelection() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เคลียร์ formData*/
|
||||||
* เคลียร์ formDฟta
|
|
||||||
*/
|
|
||||||
function clearData() {
|
function clearData() {
|
||||||
id.value = "";
|
id.value = "";
|
||||||
(insigniaType.value = ""), (insigniaForm.year = 0);
|
(insigniaType.value = ""), (insigniaForm.year = 0);
|
||||||
|
|
@ -644,9 +637,23 @@ function clearData() {
|
||||||
insigniaForm.note = "";
|
insigniaForm.note = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function serchDataTable() {
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
rows.value = onSearchDataTable(
|
||||||
*/
|
filterSearch.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columnsHistory.value ? columnsHistory.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchData();
|
await fetchData();
|
||||||
store.insigniaOption.length === 0 ? await fetchInsignia() : "";
|
store.insigniaOption.length === 0 ? await fetchInsignia() : "";
|
||||||
|
|
@ -677,7 +684,7 @@ onMounted(async () => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -736,7 +743,6 @@ onMounted(async () => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter="filterSearch.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:grid="modeView === 'card'"
|
:grid="modeView === 'card'"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
@ -1180,7 +1186,7 @@ onMounted(async () => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -1211,7 +1217,6 @@ onMounted(async () => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumnsHistory"
|
:visible-columns="visibleColumnsHistory"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -32,9 +33,7 @@ const profileId = ref<string>(
|
||||||
);
|
);
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -57,17 +56,20 @@ const modalHistory = ref<boolean>(false); //แสดง popup ประวั
|
||||||
|
|
||||||
//Table Main
|
//Table Main
|
||||||
const rows = ref<ResponseObject[]>([]);
|
const rows = ref<ResponseObject[]>([]);
|
||||||
const filterSearch = ref("");
|
const rowsMain = ref<ResponseObject[]>([]);
|
||||||
|
const filterSearch = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "issueDate",
|
name: "issueDate",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่ได้รับ",
|
label: "วันที่ได้รับ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "issueDate",
|
||||||
v.isDate
|
format(val, row) {
|
||||||
? date2Thai(v.issueDate)
|
return row.isDate
|
||||||
: new Date(v.issueDate).getFullYear() + 543,
|
? date2Thai(row.issueDate)
|
||||||
|
: new Date(row.issueDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -131,6 +133,7 @@ const pagination = ref({
|
||||||
|
|
||||||
//Table ประวัติแก้ไข
|
//Table ประวัติแก้ไข
|
||||||
const rowsHistory = ref<ResponseObject[]>([]);
|
const rowsHistory = ref<ResponseObject[]>([]);
|
||||||
|
const rowsHistoryMain = ref<ResponseObject[]>([]);
|
||||||
const filterHistory = ref<string>("");
|
const filterHistory = ref<string>("");
|
||||||
const columnsHistory = ref<QTableProps["columns"]>([
|
const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -138,10 +141,12 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่ได้รับ",
|
label: "วันที่ได้รับ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "issueDate",
|
||||||
v.isDate
|
format(val, row) {
|
||||||
? date2Thai(v.issueDate)
|
return row.isDate
|
||||||
: new Date(v.issueDate).getFullYear() + 543,
|
? date2Thai(row.issueDate)
|
||||||
|
: new Date(row.issueDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -228,9 +233,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** fetch รายการข้อมูลประกาศเกียรติคุณ*/
|
||||||
* fetch รายการข้อมูลประกาศเกียรติคุณ
|
|
||||||
*/
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
|
|
||||||
|
|
@ -240,6 +243,7 @@ async function fetchData() {
|
||||||
config.API.profileNewHonorByProfileId(profileId.value, empType.value)
|
config.API.profileNewHonorByProfileId(profileId.value, empType.value)
|
||||||
);
|
);
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
messageError($q, error);
|
messageError($q, error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -284,9 +288,7 @@ async function addEditData(editStatus: boolean = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด form ข้อมูลประกาศเกียรติคุณ*/
|
||||||
* เปิด form ข้อมูลประกาศเกียรติคุณ
|
|
||||||
*/
|
|
||||||
function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
isEdit.value = editStatus;
|
isEdit.value = editStatus;
|
||||||
|
|
@ -306,27 +308,23 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด form ข้อมูลประกาศเกียรติคุณ*/
|
||||||
* ปิด form ข้อมูลประกาศเกียรติคุณ
|
|
||||||
*/
|
|
||||||
async function clickClose() {
|
async function clickClose() {
|
||||||
clearData();
|
clearData();
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลประกาศเกียรติคุณ*/
|
||||||
* fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลประกาศเกียรติคุณ
|
|
||||||
*/
|
|
||||||
async function clickHistory(row: ResponseObject) {
|
async function clickHistory(row: ResponseObject) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
filterSearch.value = "";
|
filterSearch.value = "";
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(
|
const res = await http.get(
|
||||||
config.API.profileNewHonorHisById(row.id, empType.value)
|
config.API.profileNewHonorHisById(row.id, empType.value)
|
||||||
);
|
);
|
||||||
rowsHistory.value = res.data.result;
|
rowsHistory.value = res.data.result;
|
||||||
|
rowsHistoryMain.value = res.data.result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -334,9 +332,7 @@ async function clickHistory(row: ResponseObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ยืนยีนการบันทึกข้อมูล*/
|
||||||
* ยืนยีนการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -348,9 +344,7 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เคลียร์ formDฟta*/
|
||||||
* เคลียร์ formDฟta
|
|
||||||
*/
|
|
||||||
function clearData() {
|
function clearData() {
|
||||||
id.value = "";
|
id.value = "";
|
||||||
issueDateYear.value = new Date().getFullYear();
|
issueDateYear.value = new Date().getFullYear();
|
||||||
|
|
@ -362,9 +356,23 @@ function clearData() {
|
||||||
declHonorForm.isDate = "false";
|
declHonorForm.isDate = "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function serchDataTable() {
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
rows.value = onSearchDataTable(
|
||||||
*/
|
filterSearch.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columnsHistory.value ? columnsHistory.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
});
|
});
|
||||||
|
|
@ -390,7 +398,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -449,7 +457,6 @@ onMounted(() => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter="filterSearch.trim()"
|
|
||||||
:grid="modeView === 'card'"
|
:grid="modeView === 'card'"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
@ -785,7 +792,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -816,7 +823,6 @@ onMounted(() => {
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumnsHistory"
|
:visible-columns="visibleColumnsHistory"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -46,9 +47,7 @@ const modeViewPlan = ref<string>("table"); //การแสดงผล Table,C
|
||||||
const modalHistory = ref<boolean>(false); //แสดง popup ประวัติแก้ไข
|
const modalHistory = ref<boolean>(false); //แสดง popup ประวัติแก้ไข
|
||||||
const kpiDevelopmentId = ref<string>(""); // id การพัฒนารายบุคคล
|
const kpiDevelopmentId = ref<string>(""); // id การพัฒนารายบุคคล
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -75,6 +74,7 @@ const resPerformForm = reactive<RequestItemsObject>({
|
||||||
|
|
||||||
//Table ผลการประเมินการปฏิบัติราชการ
|
//Table ผลการประเมินการปฏิบัติราชการ
|
||||||
const rows = ref<ResponseObject[]>([]);
|
const rows = ref<ResponseObject[]>([]);
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]);
|
||||||
const filterSearch = ref<string>("");
|
const filterSearch = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -158,7 +158,10 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผลประเมิน",
|
label: "ผลประเมิน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) => `${textPoint(v.pointSum)} ${textRangePoint(v.pointSum)}`,
|
field: "name",
|
||||||
|
format(val, row) {
|
||||||
|
return `${textPoint(row.pointSum)} ${textRangePoint(row.pointSum)}`;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -261,6 +264,7 @@ const visibleColumnsPlan = ref<String[]>([
|
||||||
|
|
||||||
//Table ประวัติแก้ไข
|
//Table ประวัติแก้ไข
|
||||||
const rowsHistory = ref<ResponseObject[]>([]);
|
const rowsHistory = ref<ResponseObject[]>([]);
|
||||||
|
const rowsHistoryMain = ref<ResponseObject[]>([]);
|
||||||
const filterHistory = ref<string>("");
|
const filterHistory = ref<string>("");
|
||||||
const columnsHistory = ref<QTableProps["columns"]>([
|
const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -342,7 +346,10 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ผลประเมิน",
|
label: "ผลประเมิน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) => `${textPoint(v.pointSum)} ${textRangePoint(v.pointSum)}`,
|
field: "name",
|
||||||
|
format(val, row) {
|
||||||
|
return `${textPoint(row.pointSum)} ${textRangePoint(row.pointSum)}`;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -389,9 +396,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** fetch รายการข้อมูลผลการประเมินการปฏิบัติราชการ*/
|
||||||
* fetch รายการข้อมูลผลการประเมินการปฏิบัติราชการ
|
|
||||||
*/
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -403,6 +408,7 @@ async function fetchData() {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
messageError($q, error);
|
messageError($q, error);
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -410,9 +416,7 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch รายการการพัฒนารายบุคคล (Individual Development Plan)*/
|
||||||
* fetch รายการการพัฒนารายบุคคล (Individual Development Plan)
|
|
||||||
*/
|
|
||||||
async function getDevelop(isLoad?: boolean) {
|
async function getDevelop(isLoad?: boolean) {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
isLoad && showLoader();
|
isLoad && showLoader();
|
||||||
|
|
@ -473,9 +477,7 @@ async function addEditData(editStatus: boolean = false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด form ข้อมูลผลการประเมินการปฏิบัติราชการ*/
|
||||||
* เปิด form ข้อมูลผลการประเมินการปฏิบัติราชการ
|
|
||||||
*/
|
|
||||||
function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
isEdit.value = editStatus;
|
isEdit.value = editStatus;
|
||||||
|
|
@ -494,17 +496,13 @@ function onClickOpenDialog(editStatus: boolean = false, row?: ResponseObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด form ข้อมูลผลการประเมินการปฏิบัติราชการ*/
|
||||||
* ปิด form ข้อมูลผลการประเมินการปฏิบัติราชการ
|
|
||||||
*/
|
|
||||||
async function clickClose() {
|
async function clickClose() {
|
||||||
clearData();
|
clearData();
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลผลการประเมินการปฏิบัติราชการ*/
|
||||||
* fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลผลการประเมินการปฏิบัติราชการ
|
|
||||||
*/
|
|
||||||
async function clickHistory(row: ResponseObject) {
|
async function clickHistory(row: ResponseObject) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
filterSearch.value = "";
|
filterSearch.value = "";
|
||||||
|
|
@ -515,6 +513,7 @@ async function clickHistory(row: ResponseObject) {
|
||||||
);
|
);
|
||||||
|
|
||||||
rowsHistory.value = res.data.result;
|
rowsHistory.value = res.data.result;
|
||||||
|
rowsHistoryMain.value = res.data.result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -522,9 +521,7 @@ async function clickHistory(row: ResponseObject) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ยืนยีนการบันทึกข้อมูล*/
|
||||||
* ยืนยีนการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -536,9 +533,7 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เคลียร์ formDฟta */
|
||||||
* เคลียร์ formDฟta
|
|
||||||
*/
|
|
||||||
function clearData() {
|
function clearData() {
|
||||||
(id.value = ""),
|
(id.value = ""),
|
||||||
(resPerformForm.name = ""),
|
(resPerformForm.name = ""),
|
||||||
|
|
@ -565,6 +560,22 @@ function updatePaginationIdp(newPagination: any) {
|
||||||
paginationIdp.value.rowsPerPage = newPagination.rowsPerPage;
|
paginationIdp.value.rowsPerPage = newPagination.rowsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterSearch.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columnsHistory.value ? columnsHistory.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => paginationIdp.value.rowsPerPage,
|
() => paginationIdp.value.rowsPerPage,
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -608,7 +619,7 @@ onMounted(async () => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -669,7 +680,6 @@ onMounted(async () => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter="filterSearch.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:grid="modeView === 'card'"
|
:grid="modeView === 'card'"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
@ -1208,7 +1218,7 @@ onMounted(async () => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -1239,7 +1249,6 @@ onMounted(async () => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumnsHistory"
|
:visible-columns="visibleColumnsHistory"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -27,15 +27,14 @@ const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
messageError,
|
messageError,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
route.params.id ? route.params.id.toString() : ""
|
route.params.id ? route.params.id.toString() : ""
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -69,7 +68,7 @@ const formData = reactive<FormEmployee>({
|
||||||
});
|
});
|
||||||
|
|
||||||
/** function fetch ข้อมูลลูกจ้างชั่วคราว*/
|
/** function fetch ข้อมูลลูกจ้างชั่วคราว*/
|
||||||
function fetchData() {
|
async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.informationEmployee(profileId.value))
|
.get(config.API.informationEmployee(profileId.value))
|
||||||
|
|
@ -148,6 +147,7 @@ function onSubmit() {
|
||||||
const modalHistory = ref<boolean>(false);
|
const modalHistory = ref<boolean>(false);
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const rows = ref<EmployeeHistory[]>([]);
|
const rows = ref<EmployeeHistory[]>([]);
|
||||||
|
const rowsMain = ref<EmployeeHistory[]>([]);
|
||||||
const columns = ref<QTableColumn[]>([
|
const columns = ref<QTableColumn[]>([
|
||||||
{
|
{
|
||||||
name: "positionEmployeeGroupId",
|
name: "positionEmployeeGroupId",
|
||||||
|
|
@ -286,6 +286,7 @@ function onClickHistory() {
|
||||||
new Date(b.lastUpdatedAt).getTime() -
|
new Date(b.lastUpdatedAt).getTime() -
|
||||||
new Date(a.lastUpdatedAt).getTime()
|
new Date(a.lastUpdatedAt).getTime()
|
||||||
);
|
);
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -295,6 +296,14 @@ function onClickHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filter.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
profileId.value && fetchData();
|
profileId.value && fetchData();
|
||||||
});
|
});
|
||||||
|
|
@ -593,7 +602,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -623,7 +632,6 @@ onMounted(() => {
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filter.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -27,19 +27,19 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
showLoader,
|
showLoader,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(route.params.id.toString());
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** ข้อมูลการจ้าง*/
|
/** ข้อมูลการจ้าง*/
|
||||||
const rows = ref<Employment[]>([]);
|
const rows = ref<Employment[]>([]);
|
||||||
|
const rowsMain = ref<Employment[]>([]);
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -103,6 +103,7 @@ async function fetchListEmployment() {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
rows.value = data;
|
rows.value = data;
|
||||||
|
rowsMain.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -201,6 +202,7 @@ function onDeleteEmployment(id: string) {
|
||||||
/** ประวัติข้อมูลการจ้าง*/
|
/** ประวัติข้อมูลการจ้าง*/
|
||||||
const modalHistory = ref<boolean>(false);
|
const modalHistory = ref<boolean>(false);
|
||||||
const rowsHistory = ref<EmploymentHistory[]>([]);
|
const rowsHistory = ref<EmploymentHistory[]>([]);
|
||||||
|
const rowsHistoryMain = ref<EmploymentHistory[]>([]);
|
||||||
const filterHistory = ref<string>("");
|
const filterHistory = ref<string>("");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -215,6 +217,7 @@ function onClickHistory(id: string) {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
rowsHistory.value = data;
|
rowsHistory.value = data;
|
||||||
|
rowsHistoryMain.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -224,6 +227,22 @@ function onClickHistory(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filter.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value.slice(0, 2) : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
profileId.value && fetchListEmployment();
|
profileId.value && fetchListEmployment();
|
||||||
});
|
});
|
||||||
|
|
@ -247,7 +266,13 @@ onMounted(() => {
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="q-gutter-sm" style="display: flex">
|
<div class="q-gutter-sm" style="display: flex">
|
||||||
<q-input outlined dense v-model="filter" label="ค้นหา" debounce="300">
|
<q-input
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="filter"
|
||||||
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
<template v-slot:append> <q-icon name="search" /> </template
|
<template v-slot:append> <q-icon name="search" /> </template
|
||||||
></q-input>
|
></q-input>
|
||||||
|
|
||||||
|
|
@ -275,7 +300,6 @@ onMounted(() => {
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns?.slice(0, 2)"
|
:columns="columns?.slice(0, 2)"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:filter="filter.trim()"
|
|
||||||
row-key="dateEmployment"
|
row-key="dateEmployment"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
|
|
@ -436,7 +460,7 @@ onMounted(() => {
|
||||||
v-model="filterHistory"
|
v-model="filterHistory"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -466,7 +490,6 @@ onMounted(() => {
|
||||||
:rows="rowsHistory"
|
:rows="rowsHistory"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,10 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
success,
|
success,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -73,7 +72,9 @@ const reasonSameDateRef = ref<object | null>(null);
|
||||||
//ประวัติแก้ไขข้อมูลราชการ
|
//ประวัติแก้ไขข้อมูลราชการ
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const modalHistory = ref<boolean>(false); //แสดง popup ประวัติแก้ไขข้อมูลราชการ;
|
const modalHistory = ref<boolean>(false); //แสดง popup ประวัติแก้ไขข้อมูลราชการ;
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลราชการ
|
const rowsHistory = ref<RequestItemsHistoryObject[]>([]);
|
||||||
|
const rowsHistoryMain = ref<RequestItemsHistoryObject[]>([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลราชการ
|
||||||
|
//ข้อมูลรายการประวัติแก้ไขข้อมูลราชการ
|
||||||
const visibleColumnsHistory = ref<String[]>([
|
const visibleColumnsHistory = ref<String[]>([
|
||||||
"dateAppoint",
|
"dateAppoint",
|
||||||
"dateStart",
|
"dateStart",
|
||||||
|
|
@ -142,9 +143,7 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/** เปิด dialog */
|
||||||
* เปิด dialog *
|
|
||||||
*/
|
|
||||||
function openDialogEdit() {
|
function openDialogEdit() {
|
||||||
modalEdit.value = true;
|
modalEdit.value = true;
|
||||||
containDate.value = formMain.containDate ? formMain.containDate : null;
|
containDate.value = formMain.containDate ? formMain.containDate : null;
|
||||||
|
|
@ -154,18 +153,14 @@ function openDialogEdit() {
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด dialog ประวัติแก้ไขข้อมูลราชการ*/
|
||||||
* เปิด dialog ประวัติแก้ไขข้อมูลราชการ
|
|
||||||
*/
|
|
||||||
function openDialogHistory() {
|
function openDialogHistory() {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
filterKeyword.value = "";
|
filterKeyword.value = "";
|
||||||
getDataHistory();
|
getDataHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด dialog*/
|
||||||
* ปิด dialog
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modalEdit.value = false;
|
modalEdit.value = false;
|
||||||
containDate.value = null;
|
containDate.value = null;
|
||||||
|
|
@ -173,9 +168,7 @@ function closeDialog() {
|
||||||
reasonSameDate.value = null;
|
reasonSameDate.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ยืนยันการบันทึกข้อมูลราชการ*/
|
||||||
* function ยืนยันการบันทึกข้อมูลราชการ
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -206,16 +199,13 @@ function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ดึงข้อมูลราชการ*/
|
||||||
* ดึงข้อมูลราชการ
|
|
||||||
*/
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewGovernmentById(profileId.value, empType.value))
|
.get(config.API.profileNewGovernmentById(profileId.value, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = await res.data.result;
|
const data = await res.data.result;
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
formMain.ocId = data.org ?? "-"; //สังกัด
|
formMain.ocId = data.org ?? "-"; //สังกัด
|
||||||
formMain.positionId = data.position ?? "-"; //ตำแหน่ง
|
formMain.positionId = data.position ?? "-"; //ตำแหน่ง
|
||||||
|
|
@ -244,9 +234,7 @@ async function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ดึงข้อมูลประวัติ */
|
||||||
* ดึงข้อมูลประวัติ
|
|
||||||
*/
|
|
||||||
async function getDataHistory() {
|
async function getDataHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -279,6 +267,7 @@ async function getDataHistory() {
|
||||||
lastUpdateFullName: e.lastUpdateFullName,
|
lastUpdateFullName: e.lastUpdateFullName,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
rowsHistoryMain.value = rowsHistory.value;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -288,9 +277,16 @@ async function getDataHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติข้อมูลราชการ */
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTableHistory() {
|
||||||
*/
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columnsHistory.value ? columnsHistory.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
|
|
@ -656,7 +652,7 @@ onMounted(() => {
|
||||||
tittle="ประวัติแก้ไขข้อมูลราชการ"
|
tittle="ประวัติแก้ไขข้อมูลราชการ"
|
||||||
:close="() => (modalHistory = !modalHistory)"
|
:close="() => (modalHistory = !modalHistory)"
|
||||||
/>
|
/>
|
||||||
<q-separator color="grey-4" />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-section style="max-height: 50vh" class="scroll">
|
<q-card-section style="max-height: 50vh" class="scroll">
|
||||||
<div class="row q-pb-sm q-gutter-x-sm">
|
<div class="row q-pb-sm q-gutter-x-sm">
|
||||||
|
|
@ -668,8 +664,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
class="col-2"
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
debounce="300"
|
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -697,8 +692,6 @@ onMounted(() => {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
class="custom-header-table"
|
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
:visible-columns="visibleColumnsHistory"
|
:visible-columns="visibleColumnsHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
@ -711,7 +704,6 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width></q-th>
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
success,
|
success,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -36,9 +37,7 @@ const profileId = ref<string>(
|
||||||
);
|
);
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -55,6 +54,7 @@ const disciplineData = reactive<RequestItemsObject>({
|
||||||
});
|
});
|
||||||
|
|
||||||
const rows = ref<RequestItemsObject[]>([]); //รายการวินัย
|
const rows = ref<RequestItemsObject[]>([]); //รายการวินัย
|
||||||
|
const rowsMain = ref<RequestItemsObject[]>([]); //รายการวินัย
|
||||||
const mode = ref<string>("table"); //การแสดงผล Table card
|
const mode = ref<string>("table"); //การแสดงผล Table card
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -206,9 +206,7 @@ function filterSelector(val: string, update: Function, refData: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด dialog ข้อมูลวินัย*/
|
||||||
* ปิด dialog ข้อมูลวินัย
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
|
|
@ -220,15 +218,14 @@ function closeDialog() {
|
||||||
disciplineData.refCommandDate = null;
|
disciplineData.refCommandDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด dialog ข้อมูลวินัย*/
|
||||||
* เปิด dialog ข้อมูลวินัย
|
|
||||||
*/
|
|
||||||
function openDialogAdd() {
|
function openDialogAdd() {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function fetch ข้อมูลรายการวินัย
|
* function fetch ข้อมูลรายการวินัย
|
||||||
|
* @param id id Profile
|
||||||
*/
|
*/
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -236,6 +233,7 @@ async function fetchData(id: string) {
|
||||||
.get(config.API.profileNewDisciplineByProfileId(id, empType.value))
|
.get(config.API.profileNewDisciplineByProfileId(id, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -245,9 +243,7 @@ async function fetchData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** funciton เพิ่มช้อมูลวินัย*/
|
||||||
* funciton เพิ่มช้อมูลวินัย
|
|
||||||
*/
|
|
||||||
function addData() {
|
function addData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
|
|
@ -278,6 +274,7 @@ function addData() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* funciton บันทึกแก่ไขช้อมูลวินัย
|
* funciton บันทึกแก่ไขช้อมูลวินัย
|
||||||
|
* @param idData id ที่ต้องการแก้ไข
|
||||||
*/
|
*/
|
||||||
function editData(idData: string) {
|
function editData(idData: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -327,9 +324,7 @@ function openDialogHistory(idOrder: string) {
|
||||||
id.value = idOrder;
|
id.value = idOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ยืนยันการบันทึกข้อมูล*/
|
||||||
* function ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -341,9 +336,16 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการวินัย */
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTable() {
|
||||||
*/
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData(profileId.value);
|
fetchData(profileId.value);
|
||||||
});
|
});
|
||||||
|
|
@ -369,7 +371,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -432,7 +434,6 @@ onMounted(() => {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,14 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
const {
|
||||||
mixin;
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
date2Thai,
|
||||||
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* props
|
* props
|
||||||
|
|
@ -24,12 +30,10 @@ const modal = defineModel<boolean>("modal", { required: true }); //แสดง
|
||||||
const id = defineModel<string>("id", { required: true }); //id วินัยที่ต้องการดูประวัติแก้ไขวินัย
|
const id = defineModel<string>("id", { required: true }); //id วินัยที่ต้องการดูประวัติแก้ไขวินัย
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
/**
|
|
||||||
* props
|
|
||||||
*/
|
|
||||||
|
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const rows = ref<RequestItemsObject[]>([]); //รายการประวัติแก้ไขวินัย
|
const rows = ref<RequestItemsObject[]>([]); //รายการประวัติแก้ไขวินัย
|
||||||
|
const rowsMain = ref<RequestItemsObject[]>([]); //รายการประวัติแก้ไขวินัย
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "date",
|
name: "date",
|
||||||
|
|
@ -140,9 +144,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** fetch ข้อมูลประวัติการแก่ไขข้อมูลวินัย*/
|
||||||
* fetch ข้อมูลประวัติการแก่ไขข้อมูลวินัย
|
|
||||||
*/
|
|
||||||
async function getHistory() {
|
async function getHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -164,6 +166,7 @@ async function getHistory() {
|
||||||
e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -173,9 +176,17 @@ async function getHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ค้นหาข้อมูลรายการวินัย */
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ดูการเปลี่ยนแปลงของ modal
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
*
|
|
||||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไขวินัย
|
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไขวินัย
|
||||||
*/
|
*/
|
||||||
watch(modal, (status) => {
|
watch(modal, (status) => {
|
||||||
|
|
@ -207,7 +218,7 @@ watch(modal, (status) => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -238,7 +249,6 @@ watch(modal, (status) => {
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,7 @@ import type {
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/03_LeaveHistory.vue";
|
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/03_LeaveHistory.vue";
|
||||||
|
|
||||||
/**
|
/**props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -41,6 +39,7 @@ const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
dateToISO,
|
dateToISO,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -83,6 +82,7 @@ const statLeaveOptionFilter = ref<DataOption[]>([
|
||||||
|
|
||||||
//Table
|
//Table
|
||||||
const rows = ref<DetailData[]>([]);
|
const rows = ref<DetailData[]>([]);
|
||||||
|
const rowsMain = ref<DetailData[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
|
|
@ -112,6 +112,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
label: "วัน เดือน ปี ที่ลา",
|
label: "วัน เดือน ปี ที่ลา",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "dateLeave",
|
field: "dateLeave",
|
||||||
|
format(val, row) {
|
||||||
|
return dateThaiRange([row.dateStartLeave, row.dateEndLeave]);
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -134,6 +137,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "status",
|
field: "status",
|
||||||
|
format(val, row) {
|
||||||
|
return statusLeave(val);
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -184,9 +190,7 @@ const clickEditRowType = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** function เปิด dialog ข้อมูลการลา*/
|
||||||
* function เปิด dialog ข้อมูลการลา
|
|
||||||
*/
|
|
||||||
function openDialogAdd() {
|
function openDialogAdd() {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
|
|
@ -239,6 +243,7 @@ function clickTotal() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function เปิด dialog แก้ไขข้อมูลการลา
|
* function เปิด dialog แก้ไขข้อมูลการลา
|
||||||
|
* @param props ข้อมูลที่ต้องการแก้ไข
|
||||||
*/
|
*/
|
||||||
function openDialogEdit(props: DetailData) {
|
function openDialogEdit(props: DetailData) {
|
||||||
edit.value = true;
|
edit.value = true;
|
||||||
|
|
@ -271,9 +276,7 @@ function openDialogEdit(props: DetailData) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด dialog ข้อมูลการลา*/
|
||||||
* ปิด dialog ข้อมูลการลา
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
|
|
@ -330,16 +333,14 @@ function dateThaiRange(val: [Date, Date]) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
||||||
* @param row ข้อมูล row ที่ดูประวัติการแก้ไข
|
* @param id id รายการ
|
||||||
*/
|
*/
|
||||||
function openDialogHistory(idOrder: string) {
|
function openDialogHistory(idOrder: string) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
id.value = idOrder;
|
id.value = idOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ยืนยันการบันทึกข้อมูล*/
|
||||||
* function ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
if (edit.value == false) {
|
if (edit.value == false) {
|
||||||
|
|
@ -350,9 +351,7 @@ function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** บันทึกเพิ่มข้อมูล*/
|
||||||
* บันทึกเพิ่มข้อมูล
|
|
||||||
*/
|
|
||||||
function saveData() {
|
function saveData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -381,9 +380,7 @@ function saveData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** บันทึกแก้ไขข้อมูล*/
|
||||||
* บันทึกแก้ไขข้อมูล
|
|
||||||
*/
|
|
||||||
async function editData() {
|
async function editData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -410,9 +407,7 @@ async function editData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลรายการลา*/
|
||||||
* function fetch ข้อมูลรายการลา
|
|
||||||
*/
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -430,6 +425,7 @@ async function getData() {
|
||||||
reason: item.reason,
|
reason: item.reason,
|
||||||
typeLeaveId: item.leaveTypeId,
|
typeLeaveId: item.leaveTypeId,
|
||||||
}));
|
}));
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -439,6 +435,15 @@ async function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ค้นหาข้อมูลรายการวินัย */
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||||
*/
|
*/
|
||||||
|
|
@ -467,7 +472,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -532,7 +537,6 @@ onMounted(() => {
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
@ -573,14 +577,7 @@ onMounted(() => {
|
||||||
<div v-if="col.name === 'no'">
|
<div v-if="col.name === 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'dateLeave'">
|
|
||||||
{{
|
|
||||||
dateThaiRange([props.row.dateStartLeave, props.row.dateEndLeave])
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="col.name == 'status'">
|
|
||||||
{{ statusLeave(col.value) }}
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value ? col.value : "-" }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,21 @@ const id = defineModel<string>("id", { required: true });
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
const {
|
||||||
mixin;
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
date2Thai,
|
||||||
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const rows = ref<DetailData[]>([]); //data history
|
const rows = ref<DetailData[]>([]); //data history
|
||||||
|
const rowsMain = ref<DetailData[]>([]); //data history
|
||||||
|
|
||||||
const formFilter = reactive<FormFilter>({
|
const formFilter = reactive<FormFilter>({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 12,
|
pageSize: 12,
|
||||||
|
|
@ -71,6 +79,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "dateLeave",
|
field: "dateLeave",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
format(val, row) {
|
||||||
|
return dateThaiRange([row.dateStartLeave, row.dateEndLeave]);
|
||||||
|
},
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
|
|
@ -94,6 +105,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "status",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
format(val, row) {
|
||||||
|
return statusLeave(val);
|
||||||
|
},
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
|
@ -149,9 +163,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลประวัติการแก้ไขการลา */
|
||||||
* function fetch ข้อมูลประวัติการแก้ไขการลา
|
|
||||||
*/
|
|
||||||
async function getHistory() {
|
async function getHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -176,6 +188,7 @@ async function getHistory() {
|
||||||
: "",
|
: "",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -217,9 +230,17 @@ function statusLeave(val: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขการลา */
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ดูการเปลี่ยนแปลงของ modal
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
*
|
|
||||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||||
*/
|
*/
|
||||||
watch(modal, (status) => {
|
watch(modal, (status) => {
|
||||||
|
|
@ -250,7 +271,7 @@ watch(modal, (status) => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -281,7 +302,6 @@ watch(modal, (status) => {
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
@ -301,17 +321,7 @@ watch(modal, (status) => {
|
||||||
1
|
1
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'dateLeave'">
|
|
||||||
{{
|
|
||||||
dateThaiRange([
|
|
||||||
props.row.dateStartLeave,
|
|
||||||
props.row.dateEndLeave,
|
|
||||||
])
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="col.name == 'status'">
|
|
||||||
{{ statusLeave(col.value) }}
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value ? col.value : "-" }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
success,
|
success,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -32,9 +33,7 @@ const profileId = ref<string>(
|
||||||
);
|
);
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -56,6 +55,7 @@ const dutyData = reactive<RequestItemsObject>({
|
||||||
const mode = ref<string>("table"); //การแสดงผล Table card
|
const mode = ref<string>("table"); //การแสดงผล Table card
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const rows = ref<RequestItemsObject[]>([]); //รายการปฏิบัติราชการพิเศษ
|
const rows = ref<RequestItemsObject[]>([]); //รายการปฏิบัติราชการพิเศษ
|
||||||
|
const rowsMain = ref<RequestItemsObject[]>([]); //รายการปฏิบัติราชการพิเศษ
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "dateStart",
|
name: "dateStart",
|
||||||
|
|
@ -179,15 +179,14 @@ function closeDialog() {
|
||||||
dutyData.refCommandDate = null;
|
dutyData.refCommandDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** fetch ข้อมูลรายการพิเศษ*/
|
||||||
* fetch ข้อมูลรายการพิเศษ
|
|
||||||
*/
|
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewDutyByProfileId(id, empType.value))
|
.get(config.API.profileNewDutyByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -197,9 +196,7 @@ async function fetchData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** functoin บันทึกการเพิ่มข้อมูล*/
|
||||||
* functoin บันทึกการเพิ่มข้อมูล
|
|
||||||
*/
|
|
||||||
function addData() {
|
function addData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
|
|
@ -227,9 +224,7 @@ function addData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** functoin บันทึกการแก้ไขข้อมูล*/
|
||||||
* functoin บันทึกการแก้ไขข้อมูล
|
|
||||||
*/
|
|
||||||
function editData(idData: string) {
|
function editData(idData: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -250,9 +245,7 @@ function editData(idData: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ยืนยันการบันทึกข้อมูล*/
|
||||||
* ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -264,9 +257,15 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function serchDataTable() {
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
rows.value = onSearchDataTable(
|
||||||
*/
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งา*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData(profileId.value);
|
fetchData(profileId.value);
|
||||||
});
|
});
|
||||||
|
|
@ -292,7 +291,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -356,7 +355,6 @@ onMounted(() => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,20 @@ const id = defineModel<string>("id", { required: true });
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
const {
|
||||||
mixin;
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
date2Thai,
|
||||||
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
const filterKeyword = ref<string>(""); //คำค้นหา
|
const filterKeyword = ref<string>(""); //คำค้นหา
|
||||||
const rows = ref<ResponseObject[]>([]); //data history
|
const rows = ref<ResponseObject[]>([]); //data history
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]); //data history
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "dateStart",
|
name: "dateStart",
|
||||||
|
|
@ -132,9 +139,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลประวติการแก้ไขข้อมูล*/
|
||||||
* function fetch ข้อมูลประวติการแก้ไขข้อมูล
|
|
||||||
*/
|
|
||||||
function getHistory() {
|
function getHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -158,6 +163,7 @@ function getHistory() {
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -167,9 +173,16 @@ function getHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ดูการเปลี่ยนแปลงของ modal
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
*
|
|
||||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||||
*/
|
*/
|
||||||
watch(modal, (status) => {
|
watch(modal, (status) => {
|
||||||
|
|
@ -189,6 +202,7 @@ watch(modal, (status) => {
|
||||||
tittle="ประวัติแก้ไขปฏิบัติราชการพิเศษ"
|
tittle="ประวัติแก้ไขปฏิบัติราชการพิเศษ"
|
||||||
:close="() => ((modal = false), (rows = []))"
|
:close="() => ((modal = false), (rows = []))"
|
||||||
/>
|
/>
|
||||||
|
<q-separator />
|
||||||
<q-card-section style="max-height: 60vh" class="scroll">
|
<q-card-section style="max-height: 60vh" class="scroll">
|
||||||
<div class="row q-gutter-sm q-mb-sm">
|
<div class="row q-gutter-sm q-mb-sm">
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -199,7 +213,7 @@ watch(modal, (status) => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -230,7 +244,6 @@ watch(modal, (status) => {
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,12 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>("");
|
const id = ref<string>("");
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -50,6 +49,7 @@ const detail = ref<string>(""); //รายละเอียด
|
||||||
|
|
||||||
//Table
|
//Table
|
||||||
const rows = ref<RowList[]>([]);
|
const rows = ref<RowList[]>([]);
|
||||||
|
const rowsMain = ref<RowList[]>([]);
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -80,15 +80,14 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** fetch รายการข้อมูลอื่นๆ*/
|
||||||
* fetch รายการข้อมูลอื่นๆ
|
|
||||||
*/
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewOtherByProfileId(profileId.value, empType.value))
|
.get(config.API.profileNewOtherByProfileId(profileId.value, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -98,9 +97,7 @@ async function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** เปิด dialog ข้อมูลอื่นๆ*/
|
||||||
* เปิด dialog ข้อมูลอื่นๆ
|
|
||||||
*/
|
|
||||||
function openDialogAdd() {
|
function openDialogAdd() {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
}
|
}
|
||||||
|
|
@ -126,9 +123,7 @@ function openDialogHistory(idOrder: string) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ปิด dialog */
|
||||||
* ปิด dialog
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
|
|
@ -136,9 +131,7 @@ function closeDialog() {
|
||||||
detail.value = "";
|
detail.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** validate check*/
|
||||||
* validate check
|
|
||||||
*/
|
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -154,9 +147,7 @@ function validateForm() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** บันทึกเพิ่มข้อมูล*/
|
||||||
* บันทึกเพิ่มข้อมูล
|
|
||||||
*/
|
|
||||||
function saveData() {
|
function saveData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -179,9 +170,7 @@ function saveData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** บันทึกแก้ไขข้อมูล*/
|
||||||
* บันทึกแก้ไขข้อมูล
|
|
||||||
*/
|
|
||||||
function editData() {
|
function editData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -202,6 +191,14 @@ function editData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
|
|
@ -227,7 +224,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -290,7 +287,6 @@ onMounted(() => {
|
||||||
:grid="mode === 'card'"
|
:grid="mode === 'card'"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -14,18 +14,23 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
const {
|
||||||
mixin;
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
date2Thai,
|
||||||
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const id = defineModel<string>("id", { required: true });
|
const id = defineModel<string>("id", { required: true });
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
const rows = ref<RowList[]>([]); // data history
|
const rows = ref<RowList[]>([]); // data history
|
||||||
|
const rowsMain = ref<RowList[]>([]); // data history
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -80,9 +85,7 @@ const visibleColumns = ref<String[]>([
|
||||||
"lastUpdatedAt",
|
"lastUpdatedAt",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันดึงข้อมูลประวัติการแก่ไขข้อมูล*/
|
||||||
* ฟังก์ชันดึงข้อมูลประวัติการแก่ไขข้อมูล
|
|
||||||
*/
|
|
||||||
function getHistory() {
|
function getHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -99,6 +102,7 @@ function getHistory() {
|
||||||
lastUpdatedAt: new Date(e.lastUpdatedAt),
|
lastUpdatedAt: new Date(e.lastUpdatedAt),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -108,9 +112,16 @@ function getHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ดูการเปลี่ยนแปลงของ modal
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
*
|
|
||||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||||
*/
|
*/
|
||||||
watch(modal, (status) => {
|
watch(modal, (status) => {
|
||||||
|
|
@ -141,7 +152,7 @@ watch(modal, (status) => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -171,7 +182,6 @@ watch(modal, (status) => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -9,21 +9,15 @@ import { useProfileDataStore } from "@/modules/04_registryPerson/stores/profile"
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
/**
|
/** importType*/
|
||||||
* importType
|
|
||||||
*/
|
|
||||||
import type { QTableColumn } from "quasar";
|
import type { QTableColumn } from "quasar";
|
||||||
import type { RequestObject } from "@/modules/04_registryPerson/interface/request/Profile";
|
import type { RequestObject } from "@/modules/04_registryPerson/interface/request/Profile";
|
||||||
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
||||||
|
|
||||||
/**
|
/** importComponents*/
|
||||||
* importComponents
|
|
||||||
*/
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/**
|
/** use*/
|
||||||
* use
|
|
||||||
*/
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const store = useProfileDataStore();
|
const store = useProfileDataStore();
|
||||||
|
|
@ -36,11 +30,10 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
dialogMessageNotify,
|
dialogMessageNotify,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -63,6 +56,7 @@ const id = ref<string>("");
|
||||||
const modal = ref<boolean>(false); // แสดงฟอร์มแก้ไขประวัติส่วนตัว
|
const modal = ref<boolean>(false); // แสดงฟอร์มแก้ไขประวัติส่วนตัว
|
||||||
const informaData = ref<ResponseObject>(); // ข้อมูลส่วนคัว
|
const informaData = ref<ResponseObject>(); // ข้อมูลส่วนคัว
|
||||||
const rowsHistory = ref<ResponseObject[]>([]); // ช้อมูลรายการประวัติการแก้ไข
|
const rowsHistory = ref<ResponseObject[]>([]); // ช้อมูลรายการประวัติการแก้ไข
|
||||||
|
const rowsHistoryMain = ref<ResponseObject[]>([]); // ช้อมูลรายการประวัติการแก้ไข
|
||||||
const filterHistory = ref<string>(""); //คำค้นหาช้อมูลรายการประวัติการแก้ไข
|
const filterHistory = ref<string>(""); //คำค้นหาช้อมูลรายการประวัติการแก้ไข
|
||||||
const modalHistory = ref<boolean>(false); // แสดงช้อมูลรายการประวัติการแก้ไข
|
const modalHistory = ref<boolean>(false); // แสดงช้อมูลรายการประวัติการแก้ไข
|
||||||
const age = ref<string | null>(""); //อายุ
|
const age = ref<string | null>(""); //อายุ
|
||||||
|
|
@ -285,10 +279,7 @@ const pagination = ref({
|
||||||
descending: true,
|
descending: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function เรียกข้อมูลข้อมูลส่วนตัว*/
|
||||||
* function เรียกข้อมูลข้อมูลส่วนตัว
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -310,9 +301,7 @@ async function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function แก้ไขข้อมูลประวัติส่วนตัว*/
|
||||||
* function แก้ไขข้อมูลประวัติส่วนตัว
|
|
||||||
*/
|
|
||||||
function onClickOpenDialog() {
|
function onClickOpenDialog() {
|
||||||
if (!informaData.value) return;
|
if (!informaData.value) return;
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
|
|
@ -334,9 +323,7 @@ function onClickOpenDialog() {
|
||||||
formData.phone = informaData.value.phone;
|
formData.phone = informaData.value.phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ยืนยันการบันทึกข้อมูล*/
|
||||||
* function ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -366,9 +353,7 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ดูข้อมูลประวัติแก้ไขข้อมูลส่วนตัว*/
|
||||||
* function ดูข้อมูลประวัติแก้ไขข้อมูลส่วนตัว
|
|
||||||
*/
|
|
||||||
async function clickHistory() {
|
async function clickHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
|
|
@ -377,6 +362,7 @@ async function clickHistory() {
|
||||||
.get(config.API.profileNewProfileHisById(id.value, empType.value))
|
.get(config.API.profileNewProfileHisById(id.value, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rowsHistory.value = await res.data.result;
|
rowsHistory.value = await res.data.result;
|
||||||
|
rowsHistoryMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -409,18 +395,14 @@ function changeCardID(citizenId: string | number | null) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เช็คอายุไม่เกิน 18 ปี*/
|
||||||
* function เช็คอายุไม่เกิน 18 ปี
|
|
||||||
*/
|
|
||||||
function calculateMaxDate() {
|
function calculateMaxDate() {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
today.setFullYear(today.getFullYear() - 18);
|
today.setFullYear(today.getFullYear() - 18);
|
||||||
return today;
|
return today;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ดูการเปลี่ยนแปลงของวันเกิดเมื่อมีการเปลี่ยนแปลงจะคำนวนอายูใหม่*/
|
||||||
* ดูการเปลี่ยนแปลงของวันเกิดเมื่อมีการเปลี่ยนแปลงจะคำนวนอายูใหม่
|
|
||||||
*/
|
|
||||||
watch(
|
watch(
|
||||||
() => formData.birthDate,
|
() => formData.birthDate,
|
||||||
(v) => {
|
(v) => {
|
||||||
|
|
@ -430,9 +412,16 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูลส่วนตัว */
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTable() {
|
||||||
*/
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columnsHistory.value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
||||||
|
|
@ -556,7 +545,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- Edit Dialog -->
|
<!-- แก้ไขประวัติส่วนตัว -->
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
|
|
@ -866,11 +855,16 @@ onMounted(() => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
|
<!-- ประวัติแก้ไขข้อมูลส่วนตัว -->
|
||||||
<q-dialog v-model="modalHistory" persistent>
|
<q-dialog v-model="modalHistory" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
tittle="ประวัติแก้ไขข้อมูลส่วนตัว"
|
tittle="ประวัติแก้ไขข้อมูลส่วนตัว"
|
||||||
:close="() => ((modalHistory = false), (rowsHistory = []))"
|
:close="
|
||||||
|
() => (
|
||||||
|
(modalHistory = false), ((rowsHistory = []), (filterHistory = ''))
|
||||||
|
)
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
|
|
@ -883,7 +877,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -915,7 +909,6 @@ onMounted(() => {
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumnsHistory"
|
:visible-columns="visibleColumnsHistory"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -10,22 +10,16 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
/**
|
/** importType*/
|
||||||
* importType
|
|
||||||
*/
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { ResponseObject } from "@/components/information/interface/response/OldName";
|
import type { ResponseObject } from "@/components/information/interface/response/OldName";
|
||||||
import type { DataProfile } from "@/modules/04_registryPerson/interface/response/Main";
|
import type { DataProfile } from "@/modules/04_registryPerson/interface/response/Main";
|
||||||
import type { FormChangeName } from "@/modules/04_registryPerson/interface/request/Main";
|
import type { FormChangeName } from "@/modules/04_registryPerson/interface/request/Main";
|
||||||
|
|
||||||
/**
|
/** importComponents*/
|
||||||
* importComponents
|
|
||||||
*/
|
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
import dialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/**
|
/** use*/
|
||||||
* use
|
|
||||||
*/
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const store = useProfileDataStore();
|
const store = useProfileDataStore();
|
||||||
|
|
@ -39,11 +33,10 @@ const {
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -99,6 +92,7 @@ const alertUpload = ref<boolean>(false);
|
||||||
|
|
||||||
// Table
|
// Table
|
||||||
const rows = ref<ResponseObject[]>([]);
|
const rows = ref<ResponseObject[]>([]);
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "prefix",
|
name: "prefix",
|
||||||
|
|
@ -173,9 +167,7 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันดึงข้อมูลส่วนตัว*/
|
||||||
* ฟังก์ชันดึงข้อมูลส่วนตัว
|
|
||||||
*/
|
|
||||||
async function fetchDataPersonal() {
|
async function fetchDataPersonal() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -194,7 +186,6 @@ async function fetchDataPersonal() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชันดึงข้อมูลรายการประวัติการเปลี่ยนชื่อ-นามสกุล
|
* ฟังก์ชันดึงข้อมูลรายการประวัติการเปลี่ยนชื่อ-นามสกุล
|
||||||
*
|
|
||||||
* @param id id profile
|
* @param id id profile
|
||||||
*/
|
*/
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
|
|
@ -203,6 +194,7 @@ async function fetchData(id: string) {
|
||||||
.get(config.API.profileNewChangeNameByProfileId(id, empType.value))
|
.get(config.API.profileNewChangeNameByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -212,9 +204,7 @@ async function fetchData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันยืนยันการบันทึกข้อมูล*/
|
||||||
* ฟังก์ชันยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (!!fileUpload.value || dialogStatus.value === "edit") {
|
if (!!fileUpload.value || dialogStatus.value === "edit") {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
|
|
@ -307,9 +297,7 @@ async function onDownloadFile(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังกชันเพิ่มการเปลี่ยนชื่อ - นามสกุล */
|
||||||
* ฟังกชันเพิ่มการเปลี่ยนชื่อ - นามสกุล
|
|
||||||
*/
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -397,18 +385,23 @@ function filterSelector(val: string, update: Function, refData: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันปิด popup เปลี่ยนชื่อ-นามสกุล*/
|
||||||
* ฟังก์ชันปิด popup เปลี่ยนชื่อ-นามสกุล
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
alertUpload.value = false;
|
alertUpload.value = false;
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติการเปลีียนชื่อ-นามสกุล*/
|
||||||
* ดูการเปลี่ยนแปลงของข้อมูลฟอร์ท เปลี่ยนชื่อ-นามสกุล
|
function serchDataTable() {
|
||||||
*/
|
rows.value = onSearchDataTable(
|
||||||
|
filterSearch.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ดูการเปลี่ยนแปลงของข้อมูลฟอร์ท เปลี่ยนชื่อ-นามสกุล*/
|
||||||
watch(
|
watch(
|
||||||
() => [
|
() => [
|
||||||
changeNameData.prefix,
|
changeNameData.prefix,
|
||||||
|
|
@ -423,9 +416,7 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
|
||||||
*/
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// เช็ค ตัวเลือก ถ้าไม่มีให้ ดึงข้อมูลใหท่
|
// เช็ค ตัวเลือก ถ้าไม่มีให้ ดึงข้อมูลใหท่
|
||||||
if (
|
if (
|
||||||
|
|
@ -476,6 +467,7 @@ onMounted(async () => {
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
v-model="filterSearch"
|
v-model="filterSearch"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -507,7 +499,6 @@ onMounted(async () => {
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:filter="filterSearch.trim()"
|
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:virtual-scroll-sticky-size-start="48"
|
:virtual-scroll-sticky-size-start="48"
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,16 +81,19 @@ const dataLabel = {
|
||||||
|
|
||||||
const modalHistory = ref<boolean>(false); //แสดง Popup ประวัติแก้ไขข้อมูลที่อยู่
|
const modalHistory = ref<boolean>(false); //แสดง Popup ประวัติแก้ไขข้อมูลที่อยู่
|
||||||
const rowsHistory = ref<ResponseObject[]>([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่
|
const rowsHistory = ref<ResponseObject[]>([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่
|
||||||
|
const rowsHistoryMain = ref<ResponseObject[]>([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่
|
||||||
const filterHistory = ref<string>(""); //คำค้นหา
|
const filterHistory = ref<string>(""); //คำค้นหา
|
||||||
const visibleColumnsHistory = ref<String[]>([
|
const visibleColumnsHistory = ref<String[]>([
|
||||||
"currentAddress",
|
"currentAddress",
|
||||||
"currentDistrict",
|
"currentDistrict",
|
||||||
"currentSubDistrict",
|
"currentSubDistrict",
|
||||||
"currentZipCode",
|
"currentZipCode",
|
||||||
|
"currentProvince",
|
||||||
"registrationAddress",
|
"registrationAddress",
|
||||||
"registrationDistrict",
|
"registrationDistrict",
|
||||||
"registrationProvince",
|
"registrationProvince",
|
||||||
"registrationSame",
|
"registrationSame",
|
||||||
|
|
||||||
"registrationSubDistrict",
|
"registrationSubDistrict",
|
||||||
"registrationZipCode",
|
"registrationZipCode",
|
||||||
"lastUpdateFullName",
|
"lastUpdateFullName",
|
||||||
|
|
@ -251,7 +255,6 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชันดึงข้อมูลที่อยู่
|
* ฟังก์ชันดึงข้อมูลที่อยู่
|
||||||
*
|
|
||||||
* ดึงข้อมูลที่อยู่ ข้อมูลจังหวัด ข้อมูล เขต / อำเภอ และข้อมูล แขวง/ตำบล
|
* ดึงข้อมูลที่อยู่ ข้อมูลจังหวัด ข้อมูล เขต / อำเภอ และข้อมูล แขวง/ตำบล
|
||||||
*/
|
*/
|
||||||
async function getData() {
|
async function getData() {
|
||||||
|
|
@ -354,11 +357,7 @@ function selectSubDistrict(e: string | null, name: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันดึงข่้อมูลทั่งหมด*/
|
||||||
* ฟังก์ชันดึงข่้อมูลทั่งหมด
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
async function fetchAll() {
|
async function fetchAll() {
|
||||||
await getData();
|
await getData();
|
||||||
if (!store.profileIdBefore) {
|
if (!store.profileIdBefore) {
|
||||||
|
|
@ -392,9 +391,7 @@ async function fetchAll() {
|
||||||
).name;
|
).name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันบันทึกข้อมูลข้อมูลที่อยู่*/
|
||||||
* ฟังก์ชันบันทึกข้อมูลข้อมูลที่อยู่
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -434,9 +431,7 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันเปิด popup การแก้ไขข้อมูลข้อมูลที่อยู่*/
|
||||||
* ฟังก์ชันเปิด popup การแก้ไขข้อมูลข้อมูลที่อยู่
|
|
||||||
*/
|
|
||||||
async function onClickOpenDialog() {
|
async function onClickOpenDialog() {
|
||||||
if (!addressData) return;
|
if (!addressData) return;
|
||||||
Object.assign(formData, addressData);
|
Object.assign(formData, addressData);
|
||||||
|
|
@ -466,9 +461,7 @@ async function onClickOpenDialog() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันปิด Popup การแก้ไขข้อมูลที่อยู่ */
|
||||||
* ฟังก์ชันปิด Popup การแก้ไขข้อมูลที่อยู่
|
|
||||||
*/
|
|
||||||
function clickClose() {
|
function clickClose() {
|
||||||
Object.assign(formData, store.defaultAddressForm);
|
Object.assign(formData, store.defaultAddressForm);
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
|
|
@ -476,7 +469,6 @@ function clickClose() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชันเปิด popup ประวัติแก้ไขข้อมูลที่อยู่
|
* ฟังก์ชันเปิด popup ประวัติแก้ไขข้อมูลที่อยู่
|
||||||
*
|
|
||||||
* และดึงข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่
|
* และดึงข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่
|
||||||
*/
|
*/
|
||||||
async function clickHistory() {
|
async function clickHistory() {
|
||||||
|
|
@ -487,6 +479,7 @@ async function clickHistory() {
|
||||||
.get(config.API.profileNewAddressHisById(profileId.value, empType.value))
|
.get(config.API.profileNewAddressHisById(profileId.value, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rowsHistory.value = await res.data.result;
|
rowsHistory.value = await res.data.result;
|
||||||
|
rowsHistoryMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -512,9 +505,16 @@ function sameAddressToggle(v: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่ */
|
||||||
* ดูการเปลี่ยนแปลงที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน
|
function serchDataTable() {
|
||||||
*/
|
rowsHistory.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsHistoryMain.value,
|
||||||
|
columnsHistory.value ? columnsHistory.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ดูการเปลี่ยนแปลงที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้า*/
|
||||||
watch(
|
watch(
|
||||||
() => sameAddress.value,
|
() => sameAddress.value,
|
||||||
(v) => {
|
(v) => {
|
||||||
|
|
@ -522,9 +522,7 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
|
||||||
*/
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchAll();
|
await fetchAll();
|
||||||
});
|
});
|
||||||
|
|
@ -661,7 +659,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Edit Dialog -->
|
<!-- แก้ไขข้อมูลที่อยู่ -->
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
|
|
@ -902,6 +900,7 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
|
<!-- ประวัติแก้ไขข้อมูลที่อยู่ -->
|
||||||
<q-dialog v-model="modalHistory" persistent>
|
<q-dialog v-model="modalHistory" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
|
|
@ -919,7 +918,7 @@ onMounted(async () => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -949,7 +948,6 @@ onMounted(async () => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumnsHistory"
|
:visible-columns="visibleColumnsHistory"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,10 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
success,
|
success,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -147,10 +146,11 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "lastUpdatedAt",
|
field: "lastUpdatedAt",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
format: (val) => date2Thai(val),
|
format: (val) => date2Thai(val, false, true),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<any[]>([]);
|
||||||
|
const rowsMain = ref<any[]>([]);
|
||||||
|
|
||||||
/** ข้อมูล*/
|
/** ข้อมูล*/
|
||||||
const fatherData = reactive<FormPerson>({
|
const fatherData = reactive<FormPerson>({
|
||||||
|
|
@ -204,9 +204,7 @@ const fromData = reactive({
|
||||||
statusMarital: "",
|
statusMarital: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลบิดา*/
|
||||||
* function fetch ข้อมูลบิดา
|
|
||||||
*/
|
|
||||||
async function fetchDataFather() {
|
async function fetchDataFather() {
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
|
|
@ -229,9 +227,7 @@ async function fetchDataFather() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลมารดา*/
|
||||||
* function fetch ข้อมูลมารดา
|
|
||||||
*/
|
|
||||||
async function fetchDataMother() {
|
async function fetchDataMother() {
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
|
|
@ -254,9 +250,7 @@ async function fetchDataMother() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลคู่สมรส*/
|
||||||
* function fetch ข้อมูลคู่สมรส
|
|
||||||
*/
|
|
||||||
async function fetchDataCouple() {
|
async function fetchDataCouple() {
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
|
|
@ -280,9 +274,7 @@ async function fetchDataCouple() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลบุตร*/
|
||||||
* function fetch ข้อมูลบุตร
|
|
||||||
*/
|
|
||||||
async function fetchDataChildren() {
|
async function fetchDataChildren() {
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
|
|
@ -345,9 +337,7 @@ function onSubmit(type: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ปิด popup*/
|
||||||
* function ปิด popup
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
modalHistory.value = false;
|
modalHistory.value = false;
|
||||||
|
|
@ -431,9 +421,7 @@ async function onOpenDialogHistory(type: string, id: string = "") {
|
||||||
await fetchHistory(historyId, type);
|
await fetchHistory(historyId, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลความสัมพันธ์ */
|
||||||
* function fetch ข้อมูลความสัมพันธ์
|
|
||||||
*/
|
|
||||||
function fetchDataRelationship() {
|
function fetchDataRelationship() {
|
||||||
http
|
http
|
||||||
.get(config.API.orgRelationship)
|
.get(config.API.orgRelationship)
|
||||||
|
|
@ -454,10 +442,10 @@ function fetchDataRelationship() {
|
||||||
* @param val คำค้นหา
|
* @param val คำค้นหา
|
||||||
* @param update function
|
* @param update function
|
||||||
*/
|
*/
|
||||||
function filterSelectorRelation(val: any, update: Function) {
|
function filterSelectorRelation(val: string, update: Function) {
|
||||||
update(() => {
|
update(() => {
|
||||||
optionRelationship.value = optionRelationshipMain.value.filter(
|
optionRelationship.value = optionRelationshipMain.value.filter(
|
||||||
(v: any) => v.name.indexOf(val) > -1
|
(v: DataOption) => v.name.indexOf(val) > -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -490,6 +478,7 @@ async function fetchHistory(id: string, type: string) {
|
||||||
lastUpdatedAt: e.lastUpdatedAt,
|
lastUpdatedAt: e.lastUpdatedAt,
|
||||||
statusMarital: type === "couple" ? e.relationship : undefined,
|
statusMarital: type === "couple" ? e.relationship : undefined,
|
||||||
}));
|
}));
|
||||||
|
rowsMain.value = rows.value;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -499,9 +488,24 @@ async function fetchHistory(id: string, type: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูล */
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTable() {
|
||||||
*/
|
const baseColumns =
|
||||||
|
typeForm.value === "couple"
|
||||||
|
? columns.value
|
||||||
|
: typeForm.value === "mother"
|
||||||
|
? columns.value?.filter((e) => e.name !== "statusMarital")
|
||||||
|
: columns.value?.filter(
|
||||||
|
(e) => e.name !== "lastNameOld" && e.name !== "statusMarital"
|
||||||
|
);
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterHistory.value,
|
||||||
|
rowsMain.value,
|
||||||
|
baseColumns ? baseColumns : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|
@ -875,6 +879,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- แก้ไขข้อมูล -->
|
||||||
<q-dialog v-model="modal" class="dialog" persistent>
|
<q-dialog v-model="modal" class="dialog" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
|
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
|
||||||
|
|
@ -1063,6 +1068,7 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
|
<!-- ประวัติการแก้ไขข้อมูล -->
|
||||||
<q-dialog v-model="modalHistory" class="dialog" persistent>
|
<q-dialog v-model="modalHistory" class="dialog" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
|
|
@ -1087,7 +1093,7 @@ onMounted(async () => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -1105,7 +1111,12 @@ onMounted(async () => {
|
||||||
:options="
|
:options="
|
||||||
typeForm === 'couple'
|
typeForm === 'couple'
|
||||||
? columns
|
? columns
|
||||||
: columns?.filter((e) => e.name !== 'lastNameOld')
|
: typeForm === 'mother'
|
||||||
|
? columns?.filter((e) => e.name !== 'statusMarital')
|
||||||
|
: columns?.filter(
|
||||||
|
(e) =>
|
||||||
|
e.name !== 'lastNameOld' && e.name !== 'statusMarital'
|
||||||
|
)
|
||||||
"
|
"
|
||||||
option-value="name"
|
option-value="name"
|
||||||
style="min-width: 140px"
|
style="min-width: 140px"
|
||||||
|
|
@ -1130,7 +1141,6 @@ onMounted(async () => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filterHistory.trim()"
|
|
||||||
>
|
>
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ const {
|
||||||
success,
|
success,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString()); //id profile
|
const id = ref<string>(route.params.id.toString()); //id profile
|
||||||
|
|
@ -39,14 +40,15 @@ const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
const dialog = ref<boolean>(false); //แสดง popup ข้อมูลประวัติการศึกษา
|
const dialog = ref<boolean>(false); //แสดง popup ข้อมูลประวัติการศึกษา
|
||||||
const dialogStatus = ref<string>("create"); //สถานะข้อมูลประวัติการศึกษา
|
const dialogStatus = ref<string>("create"); //สถานะข้อมูลประวัติการศึกษา
|
||||||
const mode = ref<string>("table"); //การแสดงของ Table card
|
const mode = ref<string>("table"); //การแสดงของ Table card
|
||||||
/**
|
|
||||||
* props
|
/** props*/
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
//Table
|
/** Table*/
|
||||||
|
const keyword = ref<string>("");
|
||||||
const rows = ref<ResponseObject[]>([]);
|
const rows = ref<ResponseObject[]>([]);
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "educationLevel",
|
name: "educationLevel",
|
||||||
|
|
@ -75,10 +77,12 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตั้งแต่",
|
label: "ตั้งแต่",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "startDate",
|
||||||
v.isDate
|
format(val, row) {
|
||||||
? date2Thai(v.startDate)
|
return row.isDate
|
||||||
: new Date(v.startDate).getFullYear() + 543,
|
? date2Thai(row.startDate)
|
||||||
|
: new Date(row.startDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -89,8 +93,13 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ถึง",
|
label: "ถึง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "endDate",
|
||||||
v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543,
|
|
||||||
|
format(val, row) {
|
||||||
|
return row.isDate
|
||||||
|
? date2Thai(row.endDate)
|
||||||
|
: new Date(row.endDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -220,9 +229,32 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
const visibleColumns = ref<string[]>([
|
||||||
|
"educationLevel",
|
||||||
|
"institute",
|
||||||
|
"degree",
|
||||||
|
"field",
|
||||||
|
"gpa",
|
||||||
|
"country",
|
||||||
|
"duration",
|
||||||
|
"durationYear",
|
||||||
|
"other",
|
||||||
|
"fundName",
|
||||||
|
"isEducation",
|
||||||
|
"endDate",
|
||||||
|
"startDate",
|
||||||
|
"finishDate",
|
||||||
|
"note",
|
||||||
|
]);
|
||||||
|
const pagination = ref({
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 10,
|
||||||
|
});
|
||||||
|
|
||||||
//Table ประวัติแก้ไขประวัติการศึกษา
|
/** Table ประวัติแก้ไขประวัติการศึกษา*/
|
||||||
|
const historyKeyword = ref<string>("");
|
||||||
const historyRows = ref<ResponseObject[]>([]);
|
const historyRows = ref<ResponseObject[]>([]);
|
||||||
|
const historyRowsMain = ref<ResponseObject[]>([]);
|
||||||
const historyColumns = ref<QTableProps["columns"]>([
|
const historyColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "educationLevel",
|
name: "educationLevel",
|
||||||
|
|
@ -251,10 +283,12 @@ const historyColumns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตั้งแต่",
|
label: "ตั้งแต่",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "startDate",
|
||||||
v.isDate
|
format(val, row) {
|
||||||
? date2Thai(v.startDate)
|
return row.isDate
|
||||||
: new Date(v.startDate).getFullYear() + 543,
|
? date2Thai(row.startDate)
|
||||||
|
: new Date(row.startDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -265,8 +299,12 @@ const historyColumns = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ถึง",
|
label: "ถึง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: (v) =>
|
field: "endDate",
|
||||||
v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543,
|
format(val, row) {
|
||||||
|
row.isDate
|
||||||
|
? date2Thai(row.endDate)
|
||||||
|
: new Date(row.endDate).getFullYear() + 543;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -420,6 +458,30 @@ const historyColumns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const historyVisibleColumns = ref<string[]>([
|
||||||
|
"educationLevel",
|
||||||
|
"institute",
|
||||||
|
"degree",
|
||||||
|
"field",
|
||||||
|
"gpa",
|
||||||
|
"country",
|
||||||
|
"duration",
|
||||||
|
"durationYear",
|
||||||
|
"other",
|
||||||
|
"fundName",
|
||||||
|
"isEducation",
|
||||||
|
"endDate",
|
||||||
|
"startDate",
|
||||||
|
"finishDate",
|
||||||
|
"note",
|
||||||
|
"lastUpdateFullName",
|
||||||
|
"lastUpdatedAt",
|
||||||
|
]);
|
||||||
|
const historyPagination = ref({
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 10,
|
||||||
|
});
|
||||||
|
|
||||||
const editId = ref<string>(""); //id ที่ต้องการแก้ไข
|
const editId = ref<string>(""); //id ที่ต้องการแก้ไข
|
||||||
const isDate = ref<string>("false");
|
const isDate = ref<string>("false");
|
||||||
|
|
||||||
|
|
@ -461,59 +523,7 @@ const educationData = reactive<RequestItemsObject>({
|
||||||
positionPathId: "",
|
positionPathId: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const keyword = ref<string>("");
|
/** function ยืนยันการบันทึกข้อมูล*/
|
||||||
const historyKeyword = ref<string>("");
|
|
||||||
|
|
||||||
const pagination = ref({
|
|
||||||
page: 1,
|
|
||||||
rowsPerPage: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const historyPagination = ref({
|
|
||||||
page: 1,
|
|
||||||
rowsPerPage: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
|
||||||
"educationLevel",
|
|
||||||
"institute",
|
|
||||||
"degree",
|
|
||||||
"field",
|
|
||||||
"gpa",
|
|
||||||
"country",
|
|
||||||
"duration",
|
|
||||||
"durationYear",
|
|
||||||
"other",
|
|
||||||
"fundName",
|
|
||||||
"isEducation",
|
|
||||||
"endDate",
|
|
||||||
"startDate",
|
|
||||||
"finishDate",
|
|
||||||
"note",
|
|
||||||
]);
|
|
||||||
const historyVisibleColumns = ref<string[]>([
|
|
||||||
"educationLevel",
|
|
||||||
"institute",
|
|
||||||
"degree",
|
|
||||||
"field",
|
|
||||||
"gpa",
|
|
||||||
"country",
|
|
||||||
"duration",
|
|
||||||
"durationYear",
|
|
||||||
"other",
|
|
||||||
"fundName",
|
|
||||||
"isEducation",
|
|
||||||
"endDate",
|
|
||||||
"startDate",
|
|
||||||
"finishDate",
|
|
||||||
"note",
|
|
||||||
"lastUpdateFullName",
|
|
||||||
"lastUpdatedAt",
|
|
||||||
]);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -552,9 +562,7 @@ function filterSelector(val: string, update: Function, refData: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เคลียร์ formData*/
|
||||||
* function เคลียร์ formData
|
|
||||||
*/
|
|
||||||
function clearForm() {
|
function clearForm() {
|
||||||
isDate.value = "false";
|
isDate.value = "false";
|
||||||
educationData.educationLevel = "";
|
educationData.educationLevel = "";
|
||||||
|
|
@ -610,17 +618,13 @@ function editForm(row: any) {
|
||||||
dialog.value = true;
|
dialog.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ปิด popup มูลประวัติการศึกษา*/
|
||||||
* function ปิด popup มูลประวัติการศึกษา
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
clearForm();
|
clearForm();
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** funcitob ปิด popup ประวัติการศึกษา*/
|
||||||
* funcitob ปิด popup ประวัติการศึกษา
|
|
||||||
*/
|
|
||||||
function closeHistoryDialog() {
|
function closeHistoryDialog() {
|
||||||
historyDialog.value = false;
|
historyDialog.value = false;
|
||||||
historyKeyword.value = "";
|
historyKeyword.value = "";
|
||||||
|
|
@ -637,6 +641,7 @@ async function fetchData(id: string) {
|
||||||
.get(config.API.profileNewEducationByProfileId(id, empType.value))
|
.get(config.API.profileNewEducationByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -646,9 +651,7 @@ async function fetchData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลระดับการศึกษา*/
|
||||||
* function fetch ข้อมูลระดับการศึกษา
|
|
||||||
*/
|
|
||||||
function fetchEducationLevel() {
|
function fetchEducationLevel() {
|
||||||
http
|
http
|
||||||
.get(config.API.orgEducationLevel)
|
.get(config.API.orgEducationLevel)
|
||||||
|
|
@ -676,6 +679,7 @@ function fetchHistoryData(id: string) {
|
||||||
.get(config.API.profileNewEducationHisByEducationId(id, empType.value))
|
.get(config.API.profileNewEducationHisByEducationId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
historyRows.value = await res.data.result;
|
historyRows.value = await res.data.result;
|
||||||
|
historyRowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -685,9 +689,7 @@ function fetchHistoryData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เพิ่มข้อมูลประวัติการศึกษา*/
|
||||||
* function เพิ่มข้อมูลประวัติการศึกษา
|
|
||||||
*/
|
|
||||||
function addData() {
|
function addData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -741,9 +743,25 @@ function editData(idData: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติการศึกษา */
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTable() {
|
||||||
*/
|
rows.value = onSearchDataTable(
|
||||||
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติการศึกษา */
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
historyRows.value = onSearchDataTable(
|
||||||
|
historyKeyword.value,
|
||||||
|
historyRowsMain.value,
|
||||||
|
historyColumns.value ? historyColumns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
fetchEducationLevel();
|
fetchEducationLevel();
|
||||||
|
|
@ -771,7 +789,13 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input dense outlined v-model="keyword" label="ค้นหา">
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="keyword"
|
||||||
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -832,7 +856,6 @@ onMounted(async () => {
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:filter="keyword.trim()"
|
|
||||||
dense
|
dense
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
|
|
@ -998,6 +1021,7 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
|
<!-- แก้ไขข้อมูลประวัติการศึกษา -->
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
|
|
@ -1433,6 +1457,7 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
|
<!-- ประวัติแก้ไขประวัติการศึกษา -->
|
||||||
<q-dialog v-model="historyDialog" class="dialog" persistent>
|
<q-dialog v-model="historyDialog" class="dialog" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<dialog-header
|
<dialog-header
|
||||||
|
|
@ -1451,6 +1476,7 @@ onMounted(async () => {
|
||||||
v-model="historyKeyword"
|
v-model="historyKeyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -1481,7 +1507,6 @@ onMounted(async () => {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:filter="historyKeyword.trim()"
|
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ const {
|
||||||
success,
|
success,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString()); //id profile
|
const id = ref<string>(route.params.id.toString()); //id profile
|
||||||
|
|
@ -41,6 +42,7 @@ const isLeave = defineModel<boolean>("isLeave", {
|
||||||
//Table
|
//Table
|
||||||
const keyword = ref<string>(""); //คำต้นหา
|
const keyword = ref<string>(""); //คำต้นหา
|
||||||
const rows = ref<ResponseObject[]>([]); //รายการความสามารถ
|
const rows = ref<ResponseObject[]>([]); //รายการความสามารถ
|
||||||
|
const rowsMain = ref<ResponseObject[]>([]); //รายการความสามารถ
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "field",
|
name: "field",
|
||||||
|
|
@ -100,6 +102,7 @@ const editId = ref<string>(""); //idที่ต้องการแก้ไ
|
||||||
|
|
||||||
const historyDialog = ref<boolean>(false); //แสดง popup รายการประวัติ
|
const historyDialog = ref<boolean>(false); //แสดง popup รายการประวัติ
|
||||||
const historyRows = ref<ResponseObject[]>([]); //รายการประวัติ
|
const historyRows = ref<ResponseObject[]>([]); //รายการประวัติ
|
||||||
|
const historyRowsMain = ref<ResponseObject[]>([]); //รายการประวัติ
|
||||||
const historyKeyword = ref<string>(""); //คำต้นหาประวัติ
|
const historyKeyword = ref<string>(""); //คำต้นหาประวัติ
|
||||||
const historyColumns = ref<QTableProps["columns"]>([
|
const historyColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -200,9 +203,7 @@ const historyPagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function ยืนยันการบันทึกข้อมูล*/
|
||||||
* function ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -214,9 +215,7 @@ function onSubmit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เคลียร์ formData*/
|
||||||
* function เคลียร์ formData
|
|
||||||
*/
|
|
||||||
function clearForm() {
|
function clearForm() {
|
||||||
specialSkill.detail = "";
|
specialSkill.detail = "";
|
||||||
specialSkill.field = "";
|
specialSkill.field = "";
|
||||||
|
|
@ -238,15 +237,14 @@ function editForm(row: any) {
|
||||||
dialog.value = true;
|
dialog.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลความสามรรถพิเศษ*/
|
||||||
* function fetch ข้อมูลความสามรรถพิเศษ
|
|
||||||
*/
|
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewAbilityByProfileId(id, empType.value))
|
.get(config.API.profileNewAbilityByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -266,6 +264,7 @@ async function fetchHistoryData(id: string) {
|
||||||
.get(config.API.profileNewAbilityHisByAbilityId(id, empType.value))
|
.get(config.API.profileNewAbilityHisByAbilityId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
historyRows.value = await res.data.result;
|
historyRows.value = await res.data.result;
|
||||||
|
historyRowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -275,9 +274,7 @@ async function fetchHistoryData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เพิ่มข้อมูลความสามรรถพิเศษ*/
|
||||||
* function เพิ่มข้อมูลความสามรรถพิเศษ
|
|
||||||
*/
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -327,29 +324,42 @@ async function editData(idData: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ปิด popup ข้อมูลความสามารถพิเศษ*/
|
||||||
* function ปิด popup ข้อมูลความสามารถพิเศษ
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ปิด popup รายการประวัติ*/
|
||||||
* function ปิด popup รายการประวัติ
|
|
||||||
*/
|
|
||||||
function closeHistoryDialog() {
|
function closeHistoryDialog() {
|
||||||
historyDialog.value = false;
|
historyDialog.value = false;
|
||||||
historyKeyword.value = "";
|
historyKeyword.value = "";
|
||||||
historyRows.value = [];
|
historyRows.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ค้นหาข้อมูลรายการความสามาพิเศษ */
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTable() {
|
||||||
*/
|
rows.value = onSearchDataTable(
|
||||||
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขความสามารถพิเศษ */
|
||||||
|
function serchDataTableHistory() {
|
||||||
|
historyRows.value = onSearchDataTable(
|
||||||
|
historyKeyword.value,
|
||||||
|
historyRowsMain.value,
|
||||||
|
historyColumns.value ? historyColumns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -364,7 +374,13 @@ onMounted(() => {
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input dense outlined v-model="keyword" label="ค้นหา">
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="keyword"
|
||||||
|
label="ค้นหา"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -426,7 +442,6 @@ onMounted(() => {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:filter="keyword.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
@ -530,6 +545,7 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
|
<!-- แก้ไขข้อมูลความสามารถพิเศษ -->
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
|
|
@ -602,6 +618,7 @@ onMounted(() => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
||||||
|
<!-- ประวัติแก้ไขความสามารถพิเศษ -->
|
||||||
<q-dialog v-model="historyDialog" persistent>
|
<q-dialog v-model="historyDialog" persistent>
|
||||||
<q-card style="width: 900px; max-width: 80vw">
|
<q-card style="width: 900px; max-width: 80vw">
|
||||||
<dialog-header
|
<dialog-header
|
||||||
|
|
@ -619,6 +636,7 @@ onMounted(() => {
|
||||||
v-model="historyKeyword"
|
v-model="historyKeyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
|
@keydown.enter.pervent="serchDataTableHistory"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -649,7 +667,6 @@ onMounted(() => {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:filter="historyKeyword.trim()"
|
|
||||||
v-model:pagination="historyPagination"
|
v-model:pagination="historyPagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,7 @@ const profileId = ref<string>(
|
||||||
route.params.id ? route.params.id.toString() : ""
|
route.params.id ? route.params.id.toString() : ""
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -48,12 +46,14 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
success,
|
success,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
//Table
|
//Table
|
||||||
const rows = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
const rows = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
||||||
|
const rowsMain = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
||||||
const keyword = ref<string>(""); //คำค้นหา
|
const keyword = ref<string>(""); //คำค้นหา
|
||||||
const modalCommand = ref<boolean>(false);
|
const modalCommand = ref<boolean>(false);
|
||||||
const command = ref<string>("");
|
const command = ref<string>("");
|
||||||
|
|
@ -214,15 +214,14 @@ const posExecutiveOptionMain = ref<DataOption[]>([]);
|
||||||
|
|
||||||
const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
|
const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
|
||||||
|
|
||||||
/**
|
/** function fetch รายการ ตำแหน่งเงินเดือน*/
|
||||||
* function fetch รายการ ตำแหน่งเงินเดือน
|
|
||||||
*/
|
|
||||||
async function fetchListSalary() {
|
async function fetchListSalary() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileListSalaryNew(profileId.value, empType.value))
|
.get(config.API.profileListSalaryNew(profileId.value, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -232,9 +231,7 @@ async function fetchListSalary() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch รายการ ตำแหน่งเงินเดือน*/
|
||||||
* function fetch รายการ ตำแหน่งเงินเดือน
|
|
||||||
*/
|
|
||||||
function fetchType() {
|
function fetchType() {
|
||||||
http
|
http
|
||||||
.get(config.API.orgPosType)
|
.get(config.API.orgPosType)
|
||||||
|
|
@ -316,9 +313,7 @@ function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
||||||
formDataSalary.doc = statusEdit ? data.templateDoc : "";
|
formDataSalary.doc = statusEdit ? data.templateDoc : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ปิด dialog ตำแหน่งเงินเดือน*/
|
||||||
* function ปิด dialog ตำแหน่งเงินเดือน
|
|
||||||
*/
|
|
||||||
function onClickCloseDialog() {
|
function onClickCloseDialog() {
|
||||||
modalDialogSalary.value = false;
|
modalDialogSalary.value = false;
|
||||||
}
|
}
|
||||||
|
|
@ -403,9 +398,7 @@ function updateDoc(val: string) {
|
||||||
formDataSalary.doc = val;
|
formDataSalary.doc = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ยืนยันการบันทึกข้อมูล */
|
||||||
* function ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -511,9 +504,7 @@ function onClikcHistory(id: string) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลสายงาน*/
|
||||||
* function fetch ข้อมูลสายงาน
|
|
||||||
*/
|
|
||||||
function fetchDataOption() {
|
function fetchDataOption() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -563,9 +554,7 @@ function fetchDataOption() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลตำแหน่งข้อมูลทางการบริหาร*/
|
||||||
* function fetch ข้อมูลตำแหน่งข้อมูลทางการบริหาร
|
|
||||||
*/
|
|
||||||
function fetchDataOptionExecutive() {
|
function fetchDataOptionExecutive() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -585,9 +574,7 @@ function fetchDataOptionExecutive() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลปรเภทตำแหน่ง*/
|
||||||
* function fetch ข้อมูลปรเภทตำแหน่ง
|
|
||||||
*/
|
|
||||||
function fetchOptionGroup() {
|
function fetchOptionGroup() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -621,9 +608,16 @@ function onRefCommand(data: ResListSalary) {
|
||||||
commandId.value = data.commandId;
|
commandId.value = data.commandId;
|
||||||
// commandId.value = 'bdf9da91-ba45-497a-a2b7-cc49e2446d97'; //จำลอง
|
// commandId.value = 'bdf9da91-ba45-497a-a2b7-cc49e2446d97'; //จำลอง
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
function serchDataTable() {
|
||||||
*/
|
rows.value = onSearchDataTable(
|
||||||
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListSalary();
|
fetchListSalary();
|
||||||
});
|
});
|
||||||
|
|
@ -642,7 +636,14 @@ onMounted(() => {
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input dense outlined v-model="keyword" label="ค้นหา" class="q-mr-sm">
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="keyword"
|
||||||
|
label="ค้นหา"
|
||||||
|
class="q-mr-sm"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -668,12 +669,11 @@ onMounted(() => {
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
dense
|
dense
|
||||||
:filter="keyword.trim()"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[10, 20, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
|
|
|
||||||
|
|
@ -14,18 +14,23 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { date2Thai, showLoader, hideLoader, messageError, pathRegistryEmp } =
|
const {
|
||||||
useCounterMixin();
|
date2Thai,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const salaryId = defineModel<string>("salaryId", { required: true });
|
const salaryId = defineModel<string>("salaryId", { required: true });
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
const rows = ref<ResListSalary[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
const rows = ref<ResListSalary[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||||
|
const rowsMain = ref<ResListSalary[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||||
const keyword = ref<string>(""); //คำค้นหา
|
const keyword = ref<string>(""); //คำค้นหา
|
||||||
const baseColumns = ref<QTableProps["columns"]>([
|
const baseColumns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -233,15 +238,14 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลประวัติการแก้ไข*/
|
||||||
* function fetch ข้อมูลประวัติการแก้ไข
|
|
||||||
*/
|
|
||||||
function fetchListHistory() {
|
function fetchListHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.profileListSalaryHistoryNew(salaryId.value, empType.value))
|
.get(config.API.profileListSalaryHistoryNew(salaryId.value, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
|
rowsMain.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -251,18 +255,24 @@ function fetchListHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันปิด Popup*/
|
||||||
* ฟังก์ชันปิด Popup
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
keyword.value = "";
|
keyword.value = "";
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ค้นหาข้อมูลรายการวินัย */
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ดูการเปลี่ยนแปลงของ modal
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
*
|
|
||||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||||
*/
|
*/
|
||||||
watch(
|
watch(
|
||||||
|
|
@ -289,6 +299,7 @@ watch(
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -315,7 +326,6 @@ watch(
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
dense
|
dense
|
||||||
:filter="keyword.trim()"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ const {
|
||||||
messageError,
|
messageError,
|
||||||
success,
|
success,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
const id = ref<string>("");
|
const id = ref<string>("");
|
||||||
|
|
@ -33,9 +34,7 @@ const profileId = ref<string>(
|
||||||
);
|
);
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const isLeave = defineModel<boolean>("isLeave", {
|
const isLeave = defineModel<boolean>("isLeave", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
@ -55,6 +54,7 @@ const formData = reactive<RequestNoPaidObject>({
|
||||||
|
|
||||||
//Table
|
//Table
|
||||||
const rows = ref<RowList[]>([]); //รายการ
|
const rows = ref<RowList[]>([]); //รายการ
|
||||||
|
const rowsMain = ref<RowList[]>([]); //รายการ
|
||||||
const keyword = ref<string>(""); //คำค้นหา
|
const keyword = ref<string>(""); //คำค้นหา
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -128,9 +128,7 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** funciton ยืนยันการบันทึกข้อมูล*/
|
||||||
* funciton ยืนยันการบันทึกข้อมูล
|
|
||||||
*/
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
isStatusEdit.value ? editData() : saveData();
|
isStatusEdit.value ? editData() : saveData();
|
||||||
|
|
@ -153,23 +151,20 @@ function onClickOpenDialog(StatusEdit: boolean = false, data: any = []) {
|
||||||
modalDialog.value = true;
|
modalDialog.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function ปิด Didalig บันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||||
* function ปิด Didalig บันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
|
||||||
*/
|
|
||||||
function onClickCloseDialog() {
|
function onClickCloseDialog() {
|
||||||
modalDialog.value = false;
|
modalDialog.value = false;
|
||||||
isStatusEdit.value = false;
|
isStatusEdit.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch รายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||||
* function fetch รายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
|
||||||
*/
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
|
.get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -179,9 +174,7 @@ async function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เพิ่มข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||||
* function เพิ่มข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
|
||||||
*/
|
|
||||||
function saveData() {
|
function saveData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -203,9 +196,7 @@ function saveData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function แก้ไขข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||||
* function แก้ไขข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
|
||||||
*/
|
|
||||||
function editData() {
|
function editData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -226,17 +217,21 @@ function editData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เปิดข้อมูลประวัติการแก้ไช*/
|
||||||
* function เปิดข้อมูลประวัติการแก้ไช
|
|
||||||
*/
|
|
||||||
function onClickHistory(rowId: string) {
|
function onClickHistory(rowId: string) {
|
||||||
id.value = rowId;
|
id.value = rowId;
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function serchDataTable() {
|
||||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
rows.value = onSearchDataTable(
|
||||||
*/
|
keyword.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน */
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
|
|
@ -262,7 +257,7 @@ onMounted(() => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
debounce="300"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -323,7 +318,6 @@ onMounted(() => {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
:filter="keyword.trim()"
|
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[20, 50, 100]"
|
:rows-per-page-options="[20, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,14 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
const {
|
||||||
mixin;
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
date2Thai,
|
||||||
|
pathRegistryEmp,
|
||||||
|
onSearchDataTable,
|
||||||
|
} = mixin;
|
||||||
|
|
||||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||||
|
|
||||||
|
|
@ -25,6 +31,7 @@ const id = defineModel<string>("id", { required: true });
|
||||||
//Table
|
//Table
|
||||||
const filter = ref<string>(""); //คำค้นหา
|
const filter = ref<string>(""); //คำค้นหา
|
||||||
const rows = ref<RowList[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
const rows = ref<RowList[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||||
|
const rowsMain = ref<RowList[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "date",
|
name: "date",
|
||||||
|
|
@ -121,15 +128,14 @@ const pagination = ref({
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** fetch รายการข้อมูลประวัติการแก้ไช*/
|
||||||
* fetch รายการข้อมูลประวัติการแก้ไช
|
|
||||||
*/
|
|
||||||
async function getHistory() {
|
async function getHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewNoPaidHisById(id.value, empType.value))
|
.get(config.API.profileNewNoPaidHisById(id.value, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = await res.data.result;
|
rows.value = await res.data.result;
|
||||||
|
rowsMain.value = await res.data.result;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -139,17 +145,22 @@ async function getHistory() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันปิด Popup*/
|
||||||
* ฟังก์ชันปิด Popup
|
|
||||||
*/
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serchDataTable() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filter.value,
|
||||||
|
rowsMain.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ดูการเปลี่ยนแปลงของ modal
|
* ดูการเปลี่ยนแปลงของ modal
|
||||||
*
|
|
||||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||||
*/
|
*/
|
||||||
watch(modal, (status) => {
|
watch(modal, (status) => {
|
||||||
|
|
@ -162,7 +173,7 @@ watch(modal, (status) => {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent full-width>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="'ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ'"
|
:tittle="'ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ'"
|
||||||
|
|
@ -179,6 +190,7 @@ watch(modal, (status) => {
|
||||||
v-model="filter"
|
v-model="filter"
|
||||||
label="ค้นหา"
|
label="ค้นหา"
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -205,7 +217,6 @@ watch(modal, (status) => {
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
dense
|
dense
|
||||||
:filter="filter.trim()"
|
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue