Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m11s

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-02-13 14:16:21 +07:00
commit fc4670728b

View file

@ -12,6 +12,7 @@ import {
import { useCounterMixin } from "@/stores/mixin";
import { useActingStore } from "@/modules/17_acting/store/Main";
import { useStructureTree } from "@/stores/structureTree";
import { usePagination } from "@/composables/usePagination";
/** importType*/
import type { QTableProps } from "quasar";
@ -39,6 +40,8 @@ const {
onSearchDataTable,
} = useCounterMixin();
const { pagination, params, onRequest } = usePagination("", fetchPosMaster);
/** โครงสร้าง*/
const expanded = ref<Array<string>>([]);
const filter = ref<string>("");
@ -46,6 +49,8 @@ const nodeTree = ref<DataTree[]>([]);
const posmasterId = ref<string>("");
const isAll = ref<boolean>(false);
const modalCommand = ref<boolean>(false);
const isAllRoot = ref<boolean>(false);
/**
* function เรยกขอมลโครงสราง แบบป
*/
@ -78,9 +83,11 @@ const isLaod = ref<boolean>(false);
* @param data อมลตำแหน
*/
async function updateSelected(data: PosMaster) {
isLaod.value = true;
posmasterId.value = data.posmasterId;
storeActing.rootId = data.orgTreeId;
isLaod.value = true;
pagination.value.page = 1;
pagination.value.rowsNumber = 10;
// function fetch ,fetch
await Promise.all([fetchPosMaster(), fetchListAct()]).finally(() => {
isLaod.value = false;
@ -164,13 +171,17 @@ const keyword = ref<string>("");
async function fetchPosMaster() {
await http
.post(config.API.orgPosAct + `/search`, {
...params.value,
// keyword: keyword.value.trim(),
posmasterId: posmasterId.value,
isAll: isAll.value,
isAllRoot: isAllRoot.value,
})
.then((res) => {
const data = res.data.result;
rowPosition.value = data;
dataPosition.value = data;
const result = res.data.result;
pagination.value.rowsNumber = result.total;
rowPosition.value = result.data;
dataPosition.value = result.data;
})
.catch((err) => {
messageError($q, err);
@ -183,6 +194,13 @@ async function fetchPosMaster() {
*/
function updateIsAll(val: boolean) {
isAll.value = val;
pagination.value.page = 1;
fetchPosMaster();
}
function updateIsAllRoot(val: boolean) {
pagination.value.page = 1;
isAllRoot.value = val;
fetchPosMaster();
}
@ -285,11 +303,8 @@ async function getWorkFlow() {
}
function onSearchRowPosition() {
rowPosition.value = onSearchDataTable(
keyword.value,
dataPosition.value,
columns.value ? columns.value : []
);
pagination.value.page = 1;
fetchPosMaster();
}
function onSearchListPerson() {
@ -475,6 +490,18 @@ onMounted(async () => {
<q-toolbar style="padding: 0">
<q-space />
<div class="row q-gutter-md">
<div>
<q-checkbox
@update:model-value="updateIsAllRoot"
keep-color
v-model="isAllRoot"
label="แสดงทั้งหมดภายใต้หน่วยงาน"
color="primary"
>
<q-tooltip>แสดงทงหมดภายใตหนวยงาน</q-tooltip>
</q-checkbox>
</div>
<div>
<q-checkbox
@update:model-value="updateIsAll"
@ -503,16 +530,19 @@ onMounted(async () => {
</q-toolbar>
</div>
<div class="col-12">
<d-table
<p-table
ref="table"
:columns="columns"
:rows="rowPosition"
:paging="true"
row-key="id"
flat
bordered
:paging="true"
dense
:rows-per-page-options="[10, 25, 50, 100]"
class="custom-header-table"
@request="onRequest"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -562,7 +592,7 @@ onMounted(async () => {
</q-td>
</q-tr>
</template>
</d-table>
</p-table>
</div>
</div>
</q-scroll-area>