ปรับ filte Table ข้อมูลทะเบียนประวัติ
This commit is contained in:
parent
7ab17d378f
commit
2b36b70715
26 changed files with 841 additions and 682 deletions
|
|
@ -32,9 +32,7 @@ const profileId = ref<string>(
|
|||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
/** props*/
|
||||
const isLeave = defineModel<boolean>("isLeave", {
|
||||
required: true,
|
||||
});
|
||||
|
|
@ -48,12 +46,14 @@ const {
|
|||
messageError,
|
||||
success,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
//Table
|
||||
const rows = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
||||
const rowsMain = ref<ResListSalary[]>([]); //รายการตำแหน่งเงินเดือน
|
||||
const keyword = ref<string>(""); //คำค้นหา
|
||||
const modalCommand = ref<boolean>(false);
|
||||
const command = ref<string>("");
|
||||
|
|
@ -214,15 +214,14 @@ const posExecutiveOptionMain = ref<DataOption[]>([]);
|
|||
|
||||
const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
|
||||
|
||||
/**
|
||||
* function fetch รายการ ตำแหน่งเงินเดือน
|
||||
*/
|
||||
/** function fetch รายการ ตำแหน่งเงินเดือน*/
|
||||
async function fetchListSalary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileListSalaryNew(profileId.value, empType.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsMain.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -232,9 +231,7 @@ async function fetchListSalary() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch รายการ ตำแหน่งเงินเดือน
|
||||
*/
|
||||
/** function fetch รายการ ตำแหน่งเงินเดือน*/
|
||||
function fetchType() {
|
||||
http
|
||||
.get(config.API.orgPosType)
|
||||
|
|
@ -316,9 +313,7 @@ function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
|||
formDataSalary.doc = statusEdit ? data.templateDoc : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด dialog ตำแหน่งเงินเดือน
|
||||
*/
|
||||
/** function ปิด dialog ตำแหน่งเงินเดือน*/
|
||||
function onClickCloseDialog() {
|
||||
modalDialogSalary.value = false;
|
||||
}
|
||||
|
|
@ -403,9 +398,7 @@ function updateDoc(val: string) {
|
|||
formDataSalary.doc = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
/** function ยืนยันการบันทึกข้อมูล */
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
|
@ -511,9 +504,7 @@ function onClikcHistory(id: string) {
|
|||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลสายงาน
|
||||
*/
|
||||
/** function fetch ข้อมูลสายงาน*/
|
||||
function fetchDataOption() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -563,9 +554,7 @@ function fetchDataOption() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลตำแหน่งข้อมูลทางการบริหาร
|
||||
*/
|
||||
/** function fetch ข้อมูลตำแหน่งข้อมูลทางการบริหาร*/
|
||||
function fetchDataOptionExecutive() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -585,9 +574,7 @@ function fetchDataOptionExecutive() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลปรเภทตำแหน่ง
|
||||
*/
|
||||
/** function fetch ข้อมูลปรเภทตำแหน่ง*/
|
||||
function fetchOptionGroup() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -621,9 +608,16 @@ function onRefCommand(data: ResListSalary) {
|
|||
commandId.value = data.commandId;
|
||||
// commandId.value = 'bdf9da91-ba45-497a-a2b7-cc49e2446d97'; //จำลอง
|
||||
}
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
*/
|
||||
|
||||
function serchDataTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
rowsMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(() => {
|
||||
fetchListSalary();
|
||||
});
|
||||
|
|
@ -642,7 +636,14 @@ onMounted(() => {
|
|||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<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>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
|
|
@ -668,12 +669,11 @@ onMounted(() => {
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="keyword.trim()"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:paging="true"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
:rows-per-page-options="[10, 20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
|
|
|
|||
|
|
@ -14,18 +14,23 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const { date2Thai, showLoader, hideLoader, messageError, pathRegistryEmp } =
|
||||
useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
/** props*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const salaryId = defineModel<string>("salaryId", { required: true });
|
||||
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const rows = ref<ResListSalary[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||
const rowsMain = ref<ResListSalary[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||
const keyword = ref<string>(""); //คำค้นหา
|
||||
const baseColumns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -233,15 +238,14 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลประวัติการแก้ไข
|
||||
*/
|
||||
/** function fetch ข้อมูลประวัติการแก้ไข*/
|
||||
function fetchListHistory() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profileListSalaryHistoryNew(salaryId.value, empType.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsMain.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -251,18 +255,24 @@ function fetchListHistory() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันปิด Popup
|
||||
*/
|
||||
/** ฟังก์ชันปิด Popup*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
keyword.value = "";
|
||||
rows.value = [];
|
||||
}
|
||||
|
||||
/** ฟังก์ค้นหาข้อมูลรายการวินัย */
|
||||
function serchDataTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
rowsMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลงของ modal
|
||||
*
|
||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||
*/
|
||||
watch(
|
||||
|
|
@ -289,6 +299,7 @@ watch(
|
|||
v-model="keyword"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
@keydown.enter.pervent="serchDataTable"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -315,7 +326,6 @@ watch(
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="keyword.trim()"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:paging="true"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const {
|
|||
messageError,
|
||||
success,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
|
||||
const id = ref<string>("");
|
||||
|
|
@ -33,9 +34,7 @@ const profileId = ref<string>(
|
|||
);
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
/** props*/
|
||||
const isLeave = defineModel<boolean>("isLeave", {
|
||||
required: true,
|
||||
});
|
||||
|
|
@ -55,6 +54,7 @@ const formData = reactive<RequestNoPaidObject>({
|
|||
|
||||
//Table
|
||||
const rows = ref<RowList[]>([]); //รายการ
|
||||
const rowsMain = ref<RowList[]>([]); //รายการ
|
||||
const keyword = ref<string>(""); //คำค้นหา
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -128,9 +128,7 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* funciton ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
/** funciton ยืนยันการบันทึกข้อมูล*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
isStatusEdit.value ? editData() : saveData();
|
||||
|
|
@ -153,23 +151,20 @@ function onClickOpenDialog(StatusEdit: boolean = false, data: any = []) {
|
|||
modalDialog.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด Didalig บันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
||||
*/
|
||||
/** function ปิด Didalig บันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||
function onClickCloseDialog() {
|
||||
modalDialog.value = false;
|
||||
isStatusEdit.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch รายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
||||
*/
|
||||
/** function fetch รายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -179,9 +174,7 @@ async function getData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เพิ่มข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
||||
*/
|
||||
/** function เพิ่มข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||
function saveData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -203,9 +196,7 @@ function saveData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function แก้ไขข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
||||
*/
|
||||
/** function แก้ไขข้อมูลรายการบันทึกวันที่ไม่ได้รับเงินเดือนฯ*/
|
||||
function editData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -226,17 +217,21 @@ function editData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เปิดข้อมูลประวัติการแก้ไช
|
||||
*/
|
||||
/** function เปิดข้อมูลประวัติการแก้ไช*/
|
||||
function onClickHistory(rowId: string) {
|
||||
id.value = rowId;
|
||||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
*/
|
||||
function serchDataTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
rowsMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน */
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
|
|
@ -262,7 +257,7 @@ onMounted(() => {
|
|||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
debounce="300"
|
||||
@keydown.enter.pervent="serchDataTable"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -323,7 +318,6 @@ onMounted(() => {
|
|||
:columns="columns"
|
||||
:rows="rows"
|
||||
:paging="true"
|
||||
:filter="keyword.trim()"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
|
|
|
|||
|
|
@ -14,8 +14,14 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
||||
mixin;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
date2Thai,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
} = mixin;
|
||||
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
|
|
@ -25,6 +31,7 @@ const id = defineModel<string>("id", { required: true });
|
|||
//Table
|
||||
const filter = ref<string>(""); //คำค้นหา
|
||||
const rows = ref<RowList[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||
const rowsMain = ref<RowList[]>([]); //รายการข้อมูลประวัติการแก้ไข
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
|
|
@ -121,15 +128,14 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* fetch รายการข้อมูลประวัติการแก้ไช
|
||||
*/
|
||||
/** fetch รายการข้อมูลประวัติการแก้ไช*/
|
||||
async function getHistory() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewNoPaidHisById(id.value, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -139,17 +145,22 @@ async function getHistory() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันปิด Popup
|
||||
*/
|
||||
/** ฟังก์ชันปิด Popup*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
rows.value = [];
|
||||
}
|
||||
|
||||
function serchDataTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
filter.value,
|
||||
rowsMain.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลงของ modal
|
||||
*
|
||||
* ถ้า modal เป็น true เรียก getHistory เพิ่อดึงข้อมูลประวัติการแก้ไข
|
||||
*/
|
||||
watch(modal, (status) => {
|
||||
|
|
@ -162,7 +173,7 @@ watch(modal, (status) => {
|
|||
});
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent full-width>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 80%">
|
||||
<DialogHeader
|
||||
:tittle="'ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ'"
|
||||
|
|
@ -179,6 +190,7 @@ watch(modal, (status) => {
|
|||
v-model="filter"
|
||||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
@keydown.enter.pervent="serchDataTable"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -205,7 +217,6 @@ watch(modal, (status) => {
|
|||
flat
|
||||
bordered
|
||||
dense
|
||||
:filter="filter.trim()"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:paging="true"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue