Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m11s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m11s
This commit is contained in:
commit
fc4670728b
1 changed files with 42 additions and 12 deletions
|
|
@ -12,6 +12,7 @@ import {
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useActingStore } from "@/modules/17_acting/store/Main";
|
import { useActingStore } from "@/modules/17_acting/store/Main";
|
||||||
import { useStructureTree } from "@/stores/structureTree";
|
import { useStructureTree } from "@/stores/structureTree";
|
||||||
|
import { usePagination } from "@/composables/usePagination";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
@ -39,6 +40,8 @@ const {
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
|
const { pagination, params, onRequest } = usePagination("", fetchPosMaster);
|
||||||
|
|
||||||
/** โครงสร้าง*/
|
/** โครงสร้าง*/
|
||||||
const expanded = ref<Array<string>>([]);
|
const expanded = ref<Array<string>>([]);
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
|
|
@ -46,6 +49,8 @@ const nodeTree = ref<DataTree[]>([]);
|
||||||
const posmasterId = ref<string>("");
|
const posmasterId = ref<string>("");
|
||||||
const isAll = ref<boolean>(false);
|
const isAll = ref<boolean>(false);
|
||||||
const modalCommand = ref<boolean>(false);
|
const modalCommand = ref<boolean>(false);
|
||||||
|
|
||||||
|
const isAllRoot = ref<boolean>(false);
|
||||||
/**
|
/**
|
||||||
* function เรียกข้อมูลโครงสร้าง แบบปัจุบัน
|
* function เรียกข้อมูลโครงสร้าง แบบปัจุบัน
|
||||||
*/
|
*/
|
||||||
|
|
@ -78,9 +83,11 @@ const isLaod = ref<boolean>(false);
|
||||||
* @param data ข้อมูลตำแหน่ง
|
* @param data ข้อมูลตำแหน่ง
|
||||||
*/
|
*/
|
||||||
async function updateSelected(data: PosMaster) {
|
async function updateSelected(data: PosMaster) {
|
||||||
|
isLaod.value = true;
|
||||||
posmasterId.value = data.posmasterId;
|
posmasterId.value = data.posmasterId;
|
||||||
storeActing.rootId = data.orgTreeId;
|
storeActing.rootId = data.orgTreeId;
|
||||||
isLaod.value = true;
|
pagination.value.page = 1;
|
||||||
|
pagination.value.rowsNumber = 10;
|
||||||
// เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ
|
// เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ
|
||||||
await Promise.all([fetchPosMaster(), fetchListAct()]).finally(() => {
|
await Promise.all([fetchPosMaster(), fetchListAct()]).finally(() => {
|
||||||
isLaod.value = false;
|
isLaod.value = false;
|
||||||
|
|
@ -164,13 +171,17 @@ const keyword = ref<string>("");
|
||||||
async function fetchPosMaster() {
|
async function fetchPosMaster() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.orgPosAct + `/search`, {
|
.post(config.API.orgPosAct + `/search`, {
|
||||||
|
...params.value,
|
||||||
|
// keyword: keyword.value.trim(),
|
||||||
posmasterId: posmasterId.value,
|
posmasterId: posmasterId.value,
|
||||||
isAll: isAll.value,
|
isAll: isAll.value,
|
||||||
|
isAllRoot: isAllRoot.value,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const result = res.data.result;
|
||||||
rowPosition.value = data;
|
pagination.value.rowsNumber = result.total;
|
||||||
dataPosition.value = data;
|
rowPosition.value = result.data;
|
||||||
|
dataPosition.value = result.data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -183,6 +194,13 @@ async function fetchPosMaster() {
|
||||||
*/
|
*/
|
||||||
function updateIsAll(val: boolean) {
|
function updateIsAll(val: boolean) {
|
||||||
isAll.value = val;
|
isAll.value = val;
|
||||||
|
pagination.value.page = 1;
|
||||||
|
fetchPosMaster();
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateIsAllRoot(val: boolean) {
|
||||||
|
pagination.value.page = 1;
|
||||||
|
isAllRoot.value = val;
|
||||||
fetchPosMaster();
|
fetchPosMaster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,11 +303,8 @@ async function getWorkFlow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSearchRowPosition() {
|
function onSearchRowPosition() {
|
||||||
rowPosition.value = onSearchDataTable(
|
pagination.value.page = 1;
|
||||||
keyword.value,
|
fetchPosMaster();
|
||||||
dataPosition.value,
|
|
||||||
columns.value ? columns.value : []
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSearchListPerson() {
|
function onSearchListPerson() {
|
||||||
|
|
@ -475,6 +490,18 @@ onMounted(async () => {
|
||||||
<q-toolbar style="padding: 0">
|
<q-toolbar style="padding: 0">
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="row q-gutter-md">
|
<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>
|
<div>
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
@update:model-value="updateIsAll"
|
@update:model-value="updateIsAll"
|
||||||
|
|
@ -503,16 +530,19 @@ onMounted(async () => {
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<d-table
|
<p-table
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rowPosition"
|
:rows="rowPosition"
|
||||||
:paging="true"
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
class="custom-header-table"
|
||||||
|
@request="onRequest"
|
||||||
|
v-model:pagination="pagination"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
|
@ -562,7 +592,7 @@ onMounted(async () => {
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</p-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-scroll-area>
|
</q-scroll-area>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue