fixing list tree registry by system
This commit is contained in:
parent
f8d7496b70
commit
f5ffae0d87
3 changed files with 22 additions and 8 deletions
|
|
@ -13,6 +13,7 @@ export default {
|
||||||
/** โครงสร้างอัตรากำลัง*/
|
/** โครงสร้างอัตรากำลัง*/
|
||||||
activeOrganization: `${organization}/active`,
|
activeOrganization: `${organization}/active`,
|
||||||
orgByid: (id: string) => `${organization}/${id}`,
|
orgByid: (id: string) => `${organization}/${id}`,
|
||||||
|
orgByIdSystem: (id: string, sys: string) => `${organization}/${id}/${sys}`,
|
||||||
createOrganization: `${organization}/draft`,
|
createOrganization: `${organization}/draft`,
|
||||||
createOrgLevel: (type: string) => `${organization}/${type}`,
|
createOrgLevel: (type: string) => `${organization}/${type}`,
|
||||||
orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`,
|
orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`,
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,10 @@ async function selectType() {
|
||||||
store.labelOption.posType = "ทั้งหมด";
|
store.labelOption.posType = "ทั้งหมด";
|
||||||
store.labelOption.posLevel = "ทั้งหมด";
|
store.labelOption.posLevel = "ทั้งหมด";
|
||||||
store.formFilter.type = empType.value;
|
store.formFilter.type = empType.value;
|
||||||
store.labelOption.node = empType.value === "officer" ? "เลือกหน่วยงาน/ส่วนราชการ":'เลือกหน่วยงาน';
|
store.labelOption.node =
|
||||||
|
empType.value === "officer"
|
||||||
|
? "เลือกหน่วยงาน/ส่วนราชการ"
|
||||||
|
: "เลือกหน่วยงาน";
|
||||||
} else {
|
} else {
|
||||||
// แต่ถ้าประเภทเดิมระบบจะใช้ filter เดิมที่เคยค้นหาไว้
|
// แต่ถ้าประเภทเดิมระบบจะใช้ filter เดิมที่เคยค้นหาไว้
|
||||||
if (
|
if (
|
||||||
|
|
@ -305,10 +307,13 @@ function clearSelect(t: string) {
|
||||||
} else if (t === "rangeYear") {
|
} else if (t === "rangeYear") {
|
||||||
store.formFilter.rangeYear.min = 0;
|
store.formFilter.rangeYear.min = 0;
|
||||||
store.formFilter.rangeYear.max = 60;
|
store.formFilter.rangeYear.max = 60;
|
||||||
}else if (t === "org") {
|
} else if (t === "org") {
|
||||||
nodeData.node = null;
|
nodeData.node = null;
|
||||||
nodeData.nodeId = null;
|
nodeData.nodeId = null;
|
||||||
store.labelOption.node = empType.value === "officer" ? "เลือกหน่วยงาน/ส่วนราชการ":'เลือกหน่วยงาน';
|
store.labelOption.node =
|
||||||
|
empType.value === "officer"
|
||||||
|
? "เลือกหน่วยงาน/ส่วนราชการ"
|
||||||
|
: "เลือกหน่วยงาน";
|
||||||
}
|
}
|
||||||
store.formFilter.page = 1;
|
store.formFilter.page = 1;
|
||||||
fetchDataPerson();
|
fetchDataPerson();
|
||||||
|
|
@ -317,7 +322,7 @@ function clearSelect(t: string) {
|
||||||
async function fetchTree(id: string) {
|
async function fetchTree(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.orgByid(id.toString()))
|
.get(config.API.orgByIdSystem(id.toString(), route.meta.Key))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
node.value = data;
|
node.value = data;
|
||||||
|
|
@ -367,7 +372,10 @@ function updateSelectedTreeMain(data: any) {
|
||||||
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
|
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
|
||||||
store.nodeData.node = null;
|
store.nodeData.node = null;
|
||||||
store.nodeData.nodeId = null;
|
store.nodeData.nodeId = null;
|
||||||
nodeData.name = empType.value === "officer" ? "เลือกหน่วยงาน/ส่วนราชการ":'เลือกหน่วยงาน';
|
nodeData.name =
|
||||||
|
empType.value === "officer"
|
||||||
|
? "เลือกหน่วยงาน/ส่วนราชการ"
|
||||||
|
: "เลือกหน่วยงาน";
|
||||||
} else {
|
} else {
|
||||||
store.nodeData.node = data.orgLevel;
|
store.nodeData.node = data.orgLevel;
|
||||||
store.nodeData.nodeId = data.orgTreeId;
|
store.nodeData.nodeId = data.orgTreeId;
|
||||||
|
|
@ -481,7 +489,10 @@ onMounted(async () => {
|
||||||
}`
|
}`
|
||||||
}}
|
}}
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="store.labelOption.node !== 'เลือกหน่วยงาน' && store.labelOption.node !== 'เลือกหน่วยงาน/ส่วนราชการ'"
|
v-if="
|
||||||
|
store.labelOption.node !== 'เลือกหน่วยงาน' &&
|
||||||
|
store.labelOption.node !== 'เลือกหน่วยงาน/ส่วนราชการ'
|
||||||
|
"
|
||||||
size="10px"
|
size="10px"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -31,6 +32,7 @@ const {
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
/**props*/
|
/**props*/
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -227,7 +229,7 @@ async function fetchOrganizationActive() {
|
||||||
async function fetchDataTree(id: string) {
|
async function fetchDataTree(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgByid(id.toString()))
|
.get(config.API.orgByIdSystem(id.toString(), route.meta.Key))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue