พัฒนาบุคลากร ==> ปรับโครงสร้าง
This commit is contained in:
parent
0da3f425a7
commit
f912b7a353
3 changed files with 27 additions and 70 deletions
|
|
@ -1,9 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
|
||||
/** importType*/
|
||||
import type { FormBasicinfo } from "@/modules/15_development/interface/request/Main";
|
||||
|
|
@ -16,6 +18,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { fetchStructureTree } = useStructureTree();
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +45,7 @@ const formData = reactive<FormBasicinfo>({
|
|||
});
|
||||
|
||||
const orgName = ref<string>("");
|
||||
const node = ref<any>([]);
|
||||
const node = ref<any[]>([]);
|
||||
const filter = ref<string>("");
|
||||
const expanded = ref<string[]>([]);
|
||||
|
||||
|
|
@ -50,9 +53,9 @@ const expanded = ref<string[]>([]);
|
|||
* function fetch ข้อมูลเบื้องต้น
|
||||
* @param id ProjectId
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(config.API.developmentMainTab("tab1", id))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
|
|
@ -104,39 +107,14 @@ function onSubmit() {
|
|||
}
|
||||
|
||||
/**
|
||||
* function fetch หา Id หน่วยงานที่ Active
|
||||
*
|
||||
*/
|
||||
function fetchActive() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.activeOrganization)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
fetchTree(data.activeId);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch โครงสร้างปจุบัน
|
||||
* @param id โครงสร้างปจุบัน
|
||||
*/
|
||||
function fetchTree(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
fetchData(projectId.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
async function fetchActive() {
|
||||
const dataTree = await fetchStructureTree(route.meta.Key as string, true);
|
||||
if (dataTree) {
|
||||
node.value = dataTree;
|
||||
await fetchData(projectId.value);
|
||||
}
|
||||
}
|
||||
|
||||
/** function เลือกหน่วยงาน
|
||||
|
|
|
|||
|
|
@ -71,10 +71,9 @@ function getStatus(id: string) {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
// .finally(() => {});
|
||||
}
|
||||
|
||||
/** function ยืนยันการเสร็จสิ้นโครงการ*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
|
||||
/**importType*/
|
||||
import type {
|
||||
DataOption,
|
||||
|
|
@ -34,6 +37,7 @@ const $q = useQuasar();
|
|||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const store = useDevelopmentDataStore();
|
||||
const { fetchStructureTree } = useStructureTree();
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
|
|
@ -115,9 +119,9 @@ const formQuery = reactive<FormQueryListProject>({
|
|||
});
|
||||
|
||||
/** funciton fetch รายการโครงการ*/
|
||||
function fetchListProject() {
|
||||
async function fetchListProject() {
|
||||
showLoader();
|
||||
http
|
||||
await http
|
||||
.get(
|
||||
config.API.developmentMain +
|
||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}&status=${formQuery.status}&node=${formQuery.node}&nodeId=${formQuery.nodeId}`
|
||||
|
|
@ -217,36 +221,12 @@ function onSubmit() {
|
|||
}
|
||||
|
||||
/** function fetch หา Id หน่วยงานที่ Active*/
|
||||
function fetchActive() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.activeOrganization)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
fetchTree(data.activeId);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch โครงสร้างปจุบัน
|
||||
* @param id โครงสร้างปจุบัน
|
||||
*/
|
||||
function fetchTree(id: string) {
|
||||
http
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
fetchListProject();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
async function fetchActive() {
|
||||
const dataTree = await fetchStructureTree(route.meta.Key as string, true);
|
||||
if (dataTree) {
|
||||
await fetchListProject();
|
||||
node.value = dataTree;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue