fixing list tree registry by system

This commit is contained in:
Warunee Tamkoo 2024-08-19 16:26:45 +07:00
parent f8d7496b70
commit f5ffae0d87
3 changed files with 22 additions and 8 deletions

View file

@ -13,6 +13,7 @@ export default {
/** โครงสร้างอัตรากำลัง*/
activeOrganization: `${organization}/active`,
orgByid: (id: string) => `${organization}/${id}`,
orgByIdSystem: (id: string, sys: string) => `${organization}/${id}/${sys}`,
createOrganization: `${organization}/draft`,
createOrgLevel: (type: string) => `${organization}/${type}`,
orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`,

View file

@ -250,8 +250,10 @@ async function selectType() {
store.labelOption.posType = "ทั้งหมด";
store.labelOption.posLevel = "ทั้งหมด";
store.formFilter.type = empType.value;
store.labelOption.node = empType.value === "officer" ? "เลือกหน่วยงาน/ส่วนราชการ":'เลือกหน่วยงาน';
store.labelOption.node =
empType.value === "officer"
? "เลือกหน่วยงาน/ส่วนราชการ"
: "เลือกหน่วยงาน";
} else {
// filter
if (
@ -305,10 +307,13 @@ function clearSelect(t: string) {
} else if (t === "rangeYear") {
store.formFilter.rangeYear.min = 0;
store.formFilter.rangeYear.max = 60;
}else if (t === "org") {
} else if (t === "org") {
nodeData.node = null;
nodeData.nodeId = null;
store.labelOption.node = empType.value === "officer" ? "เลือกหน่วยงาน/ส่วนราชการ":'เลือกหน่วยงาน';
store.labelOption.node =
empType.value === "officer"
? "เลือกหน่วยงาน/ส่วนราชการ"
: "เลือกหน่วยงาน";
}
store.formFilter.page = 1;
fetchDataPerson();
@ -317,7 +322,7 @@ function clearSelect(t: string) {
async function fetchTree(id: string) {
showLoader();
http
.get(config.API.orgByid(id.toString()))
.get(config.API.orgByIdSystem(id.toString(), route.meta.Key))
.then((res) => {
const data = res.data.result;
node.value = data;
@ -367,7 +372,10 @@ function updateSelectedTreeMain(data: any) {
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
store.nodeData.node = null;
store.nodeData.nodeId = null;
nodeData.name = empType.value === "officer" ? "เลือกหน่วยงาน/ส่วนราชการ":'เลือกหน่วยงาน';
nodeData.name =
empType.value === "officer"
? "เลือกหน่วยงาน/ส่วนราชการ"
: "เลือกหน่วยงาน";
} else {
store.nodeData.node = data.orgLevel;
store.nodeData.nodeId = data.orgTreeId;
@ -481,7 +489,10 @@ onMounted(async () => {
}`
}}
<q-btn
v-if="store.labelOption.node !== 'เลือกหน่วยงาน' && store.labelOption.node !== 'เลือกหน่วยงาน/ส่วนราชการ'"
v-if="
store.labelOption.node !== 'เลือกหน่วยงาน' &&
store.labelOption.node !== 'เลือกหน่วยงาน/ส่วนราชการ'
"
size="10px"
flat
round

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, reactive, watch } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
@ -31,6 +32,7 @@ const {
dialogConfirm,
} = useCounterMixin();
const route = useRoute();
/**props*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
@ -227,7 +229,7 @@ async function fetchOrganizationActive() {
async function fetchDataTree(id: string) {
showLoader();
await http
.get(config.API.orgByid(id.toString()))
.get(config.API.orgByIdSystem(id.toString(), route.meta.Key))
.then((res) => {
const data = res.data.result;
if (data) {