Merge branch 'nice_dev' into develop
This commit is contained in:
commit
540ff0da32
5 changed files with 138 additions and 85 deletions
|
|
@ -133,22 +133,6 @@ function fetchTreeAgency(id: string) {
|
|||
const data = res.data.result;
|
||||
nodeAgency.value = data;
|
||||
store.treeId = "";
|
||||
|
||||
if (nodeAgency.value && planData.nodeId) {
|
||||
const nodeTree = await searchAndReplace(
|
||||
nodeAgency.value,
|
||||
planData.nodeId
|
||||
);
|
||||
if (nodeTree) {
|
||||
expandedAgency.value = [];
|
||||
const parts = nodeTree?.orgName.split("/");
|
||||
for (let i = 1; i < parts.length; i++) {
|
||||
const arrangedParts = parts[i];
|
||||
expandedAgency.value.push(arrangedParts);
|
||||
}
|
||||
updateSelectedAgency(nodeTree, true);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -182,6 +166,30 @@ function fetchDataById(id: string) {
|
|||
planData.strategy = data.strategy;
|
||||
planData.strategyId = data.strategyId;
|
||||
|
||||
// หน่วยงาน/ส่วนราชการ
|
||||
const arrayexpandedAgency = [
|
||||
data.root,
|
||||
data.child1,
|
||||
data.child2,
|
||||
data.child3,
|
||||
data.child4,
|
||||
];
|
||||
expandedAgency.value = arrayexpandedAgency
|
||||
.filter((e) => e !== null)
|
||||
.slice(0, -1);
|
||||
|
||||
// ยุทธศาสตร์ / แผน
|
||||
const arrayexpandedPlan = [
|
||||
data.strategyChild1,
|
||||
data.strategyChild2,
|
||||
data.strategyChild3,
|
||||
data.strategyChild4,
|
||||
data.strategyChild5,
|
||||
];
|
||||
expandedPlan.value = arrayexpandedPlan
|
||||
.filter((e) => e !== null)
|
||||
.slice(0, -1);
|
||||
|
||||
fetchRoundOption();
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -251,26 +259,6 @@ function onSubmit() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function หาหน่วยงานที่รับผิดชอบ
|
||||
* @param orgTreeData ข้อมูล nodeTree
|
||||
* @param treeId tree ID
|
||||
*/
|
||||
async function searchAndReplace(orgTreeData: any, treeId: string | null) {
|
||||
if (orgTreeData) {
|
||||
for (let orgTree of orgTreeData) {
|
||||
if (orgTree.orgTreeId === treeId) {
|
||||
return orgTree;
|
||||
}
|
||||
let foundOrg: any = await searchAndReplace(orgTree.children, treeId);
|
||||
if (foundOrg) {
|
||||
return foundOrg;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchOrganizationActive();
|
||||
if (id.value) {
|
||||
|
|
@ -539,7 +527,13 @@ onMounted(() => {
|
|||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-sm">
|
||||
<q-input dense outlined v-model="filterAgency" label="ค้นหา">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterAgency"
|
||||
label="ค้นหา"
|
||||
class="inputgreen"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterAgency !== ''"
|
||||
|
|
@ -554,8 +548,8 @@ onMounted(() => {
|
|||
style="height: 350px; overflow: scroll"
|
||||
dense
|
||||
:nodes="nodeAgency"
|
||||
node-key="orgTreeName"
|
||||
label-key="labelName"
|
||||
node-key="orgTreeId"
|
||||
label-key="orgTreeName"
|
||||
selected-color="primary"
|
||||
:filter="filterAgency"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
|
|
@ -602,7 +596,13 @@ onMounted(() => {
|
|||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-sm">
|
||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filter"
|
||||
label="ค้นหา"
|
||||
class="inputgreen"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
|
|
@ -619,7 +619,7 @@ onMounted(() => {
|
|||
:nodes="nodeplan"
|
||||
selected-color="primary"
|
||||
node-key="id"
|
||||
label-key="id"
|
||||
label-key="name"
|
||||
:filter="filter"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ import { ref, reactive, onMounted } from "vue";
|
|||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
|
@ -40,10 +43,7 @@ const expanded = ref<any>([]);
|
|||
const filterMain = ref<string>("");
|
||||
const visibleColumns = ref<string[]>(["including", "includingName"]);
|
||||
|
||||
const roundOp = ref<any[]>([
|
||||
{ id: "APR", name: "รอบเมษายน" },
|
||||
{ id: "OCT", name: "รอบตุลาคม" },
|
||||
]);
|
||||
const roundOp = ref<DataOption[]>([]);
|
||||
|
||||
const totalList = ref<number>(1);
|
||||
|
||||
|
|
@ -192,7 +192,14 @@ onMounted(() => {
|
|||
<div class="col-12 q-py-sm q-px-sm">
|
||||
<div class="q-gutter-sm">
|
||||
<div class="text-subtitle2 text-bold">หน่วยงาน/ส่วนราชการ</div>
|
||||
<q-input dense outlined v-model="filterMain" label="ค้นหา">
|
||||
|
||||
<q-input
|
||||
class="inputgreen"
|
||||
dense
|
||||
outlined
|
||||
v-model="filterMain"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterMain !== ''"
|
||||
|
|
@ -266,6 +273,7 @@ onMounted(() => {
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="inputgreen"
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
|
|
@ -284,6 +292,7 @@ onMounted(() => {
|
|||
</template>
|
||||
</datepicker>
|
||||
<q-select
|
||||
class="inputgreen"
|
||||
dense
|
||||
outlined
|
||||
v-model="nodeData.round"
|
||||
|
|
@ -312,6 +321,7 @@ onMounted(() => {
|
|||
<q-space />
|
||||
<div class="row q-gutter-sm">
|
||||
<q-input
|
||||
class="inputgreen"
|
||||
standout
|
||||
dense
|
||||
v-model="nodeData.keyword"
|
||||
|
|
@ -330,6 +340,7 @@ onMounted(() => {
|
|||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
class="inputgreen"
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -11,10 +11,11 @@ import type { NewPagination } from "@/modules/14_KPI/interface/request/Main";
|
|||
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
|
||||
|
||||
/** use*/
|
||||
const total = ref<number>()
|
||||
const total = ref<number>();
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const { showLoader, hideLoader, dialogRemove, success } = useCounterMixin();
|
||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
||||
useCounterMixin();
|
||||
|
||||
const positionOp = ref<DataOption[]>([]);
|
||||
const positionMainOp = ref<DataOption[]>([]);
|
||||
|
|
@ -79,10 +80,13 @@ function fetchList() {
|
|||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
total.value = res.data.result.total
|
||||
total.value = res.data.result.total;
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
rows.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
|
@ -140,24 +144,32 @@ function filterOption(val: any, update: Function) {
|
|||
/** ดึงข้อมูลตำแหน่ง */
|
||||
function getOptions() {
|
||||
showLoader();
|
||||
http.get(config.API.orgSalaryPosition).then((res) => {
|
||||
const dataOp = res.data.result;
|
||||
const uniqueNames = new Set();
|
||||
const filteredData = dataOp
|
||||
.filter((item: any) => {
|
||||
if (!uniqueNames.has(item.positionName)) {
|
||||
uniqueNames.add(item.positionName);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.map((item: any) => ({
|
||||
id: item.positionName,
|
||||
name: item.positionName,
|
||||
}));
|
||||
http
|
||||
.get(config.API.orgSalaryPosition)
|
||||
.then((res) => {
|
||||
const dataOp = res.data.result;
|
||||
const uniqueNames = new Set();
|
||||
const filteredData = dataOp
|
||||
.filter((item: any) => {
|
||||
if (!uniqueNames.has(item.positionName)) {
|
||||
uniqueNames.add(item.positionName);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.map((item: any) => ({
|
||||
id: item.positionName,
|
||||
name: item.positionName,
|
||||
}));
|
||||
|
||||
positionMainOp.value = filteredData;
|
||||
});
|
||||
positionMainOp.value = filteredData;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function getRound() {
|
||||
|
|
@ -174,6 +186,9 @@ function getRound() {
|
|||
name: statusTothai(item.durationKPI),
|
||||
}));
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
|
@ -314,6 +329,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
v-model="formFilter.round"
|
||||
class="inputgreen"
|
||||
:options="roundOp"
|
||||
label="รอบการประเมิน"
|
||||
option-label="name"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue