รักษาการในตำแหน่ง
This commit is contained in:
parent
93fd5012eb
commit
35422c6963
3 changed files with 47 additions and 22 deletions
|
|
@ -41,7 +41,7 @@ const {
|
|||
messageError,
|
||||
dialogMessageNotify,
|
||||
success,
|
||||
filterTableQuasar,
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
|
||||
/**
|
||||
|
|
@ -149,11 +149,11 @@ const pagination = ref({
|
|||
rowsPerPage: reqMaster.value.pageSize,
|
||||
});
|
||||
|
||||
function onSerachDataTable() {
|
||||
rows.value = filterTableQuasar(
|
||||
function onSearchTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
filterTable.value,
|
||||
dataMain.value,
|
||||
columns.value ?? []
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ watch(
|
|||
dense
|
||||
v-model="filterTable"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="onSerachDataTable"
|
||||
@keydown.enter="onSearchTable"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
|
|||
|
|
@ -25,8 +25,13 @@ const $q = useQuasar();
|
|||
const { fetchTreeActing } = useStructureTree();
|
||||
const storeTree = useStructureTree();
|
||||
const storeActing = useActingStore();
|
||||
const { showLoader, hideLoader, messageError, dialogRemove } =
|
||||
useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
dialogRemove,
|
||||
onSearchDataTable,
|
||||
} = useCounterMixin();
|
||||
|
||||
/** โครงสร้าง*/
|
||||
const expanded = ref<Array<string>>([]);
|
||||
|
|
@ -78,6 +83,7 @@ async function updateSelected(data: PosMaster) {
|
|||
|
||||
/** ตำแหน่ง*/
|
||||
const rowPosition = ref<ListPerson[]>([]);
|
||||
const dataPosition = ref<ListPerson[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -101,8 +107,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
field(row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
field: "name",
|
||||
format(val, row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
},
|
||||
sortable: false,
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -159,6 +166,7 @@ async function fetchPosMaster() {
|
|||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowPosition.value = data;
|
||||
dataPosition.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -198,6 +206,7 @@ function selectPosition(data: ListPerson) {
|
|||
|
||||
/********** รายชื่อคนรักษาการ **************/
|
||||
const rowListPerson = ref<ListPerson[]>([]);
|
||||
const dataListPerson = ref<ListPerson[]>([]);
|
||||
const keywordAct = ref<string>("");
|
||||
|
||||
/**
|
||||
|
|
@ -209,6 +218,7 @@ async function fetchListAct() {
|
|||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowListPerson.value = data;
|
||||
dataListPerson.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -274,6 +284,22 @@ function getWorkFlow() {
|
|||
.finally(() => {});
|
||||
}
|
||||
|
||||
function onSearchRowPosition() {
|
||||
rowPosition.value = onSearchDataTable(
|
||||
keyword.value,
|
||||
dataPosition.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
function onSearchListPerson() {
|
||||
rowListPerson.value = onSearchDataTable(
|
||||
keywordAct.value,
|
||||
dataListPerson.value,
|
||||
columns.value ? columns.value : []
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchOrganizationActive();
|
||||
if (storeActing.isOfficer == null && storeActing.isStaff == null) {
|
||||
|
|
@ -310,13 +336,7 @@ onMounted(() => {
|
|||
<div>
|
||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
|
@ -327,7 +347,7 @@ onMounted(() => {
|
|||
:nodes="nodeTree"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
:filter="filter"
|
||||
:filter="filter.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
v-model:expanded="expanded"
|
||||
|
|
@ -414,7 +434,13 @@ onMounted(() => {
|
|||
</q-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
<q-input outlined dense v-model="keyword" label="ค้นหา">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
v-model="keyword"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="onSearchRowPosition"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
|
|
@ -429,7 +455,6 @@ onMounted(() => {
|
|||
:columns="columns"
|
||||
:rows="rowPosition"
|
||||
:paging="true"
|
||||
:filter="keyword"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
|
|
@ -498,6 +523,7 @@ onMounted(() => {
|
|||
dense
|
||||
v-model="keywordAct"
|
||||
label="ค้นหา"
|
||||
@keydown.enter="onSearchListPerson"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
|
|
@ -513,7 +539,6 @@ onMounted(() => {
|
|||
:columns="columns"
|
||||
:rows="rowListPerson"
|
||||
:paging="true"
|
||||
:filter="keywordAct"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
|
|
|
|||
|
|
@ -1100,7 +1100,7 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
.catch((error) => console.error("ดาวน์โหลดไฟล์ไม่สำเร็จ:", error));
|
||||
}
|
||||
|
||||
function filterTableQuasar(keyword: string, data: any[], columns: any[]) {
|
||||
function onSearchDataTable(keyword: string, data: any[], columns: any[]) {
|
||||
const searchText = keyword.trim().toLowerCase();
|
||||
|
||||
if (!searchText) {
|
||||
|
|
@ -1164,6 +1164,6 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
pathRegistryEmp,
|
||||
downloadRenameFileByLink,
|
||||
|
||||
filterTableQuasar,
|
||||
onSearchDataTable,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue