This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-30 17:26:20 +07:00
parent f0313b959a
commit b5829ec905

View file

@ -2,12 +2,11 @@
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions"; import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree"; import { useStructureTree } from "@/stores/structureTree";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/ /** importType*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -17,7 +16,7 @@ import type {
ListPerson, ListPerson,
} from "@/modules/17_acting/interface/response/Main"; } from "@/modules/17_acting/interface/response/Main";
/** importStore*/ import LoadView from "@/components/LoadView.vue";
/** use*/ /** use*/
const $q = useQuasar(); const $q = useQuasar();
@ -59,14 +58,20 @@ async function fetchOrganizationActive() {
} }
} }
const isLaod = ref<boolean>(false);
/** /**
* function เลอกตำแหนงทจะใหกษาการ * function เลอกตำแหนงทจะใหษาการ
* @param data อมลตำแหน * @param data อมลตำแหน
*/ */
async function updateSelected(data: PosMaster) { async function updateSelected(data: PosMaster) {
posmasterId.value = data.posmasterId; posmasterId.value = data.posmasterId;
isLaod.value = true;
// function fetch ,fetch // function fetch ,fetch
await Promise.all([fetchPosMaster(), fetchListAct()]); await Promise.all([fetchPosMaster(), fetchListAct()]).finally(() => {
isLaod.value = false;
console.log("test");
});
} }
/** ตำแหน่ง*/ /** ตำแหน่ง*/
@ -143,9 +148,8 @@ const keyword = ref<string>("");
/** /**
* function fetch รายช * function fetch รายช
*/ */
function fetchPosMaster() { async function fetchPosMaster() {
showLoader(); await http
http
.post(config.API.orgPosAct + `/search`, { .post(config.API.orgPosAct + `/search`, {
posmasterId: posmasterId.value, posmasterId: posmasterId.value,
isAll: isAll.value, isAll: isAll.value,
@ -156,9 +160,6 @@ function fetchPosMaster() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader();
}); });
} }
@ -198,9 +199,8 @@ const keywordAct = ref<string>("");
/** /**
* function fetch รายชอรกษาการ * function fetch รายชอรกษาการ
*/ */
function fetchListAct() { async function fetchListAct() {
showLoader(); await http
http
.get(config.API.orgPosAct + `/${posmasterId.value}`) .get(config.API.orgPosAct + `/${posmasterId.value}`)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
@ -208,9 +208,6 @@ function fetchListAct() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader();
}); });
} }
@ -341,7 +338,8 @@ onMounted(() => {
class="col-lg-9 col-md-8 col-xs-12 scroll" class="col-lg-9 col-md-8 col-xs-12 scroll"
style="height: 80vh" style="height: 80vh"
> >
<div class="column q-col-gutter-sm"> <LoadView v-if="isLaod" />
<div class="column q-col-gutter-sm" v-else>
<div class="col"> <div class="col">
<q-card bordered style="height: 100%; border: 1px solid #d6dee1"> <q-card bordered style="height: 100%; border: 1px solid #d6dee1">
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"> <div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">