fix load
This commit is contained in:
parent
f0313b959a
commit
b5829ec905
1 changed files with 17 additions and 19 deletions
|
|
@ -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">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue