{
{
()
+const total = ref();
const $q = useQuasar();
const router = useRouter();
-const { showLoader, hideLoader, dialogRemove, success } = useCounterMixin();
+const { showLoader, hideLoader, dialogRemove, success, messageError } =
+ useCounterMixin();
const positionOp = ref([]);
const positionMainOp = ref([]);
@@ -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"
diff --git a/src/modules/15_development/components/BasicInfo.vue b/src/modules/15_development/components/BasicInfo.vue
index 37fc6727b..dc44c614f 100644
--- a/src/modules/15_development/components/BasicInfo.vue
+++ b/src/modules/15_development/components/BasicInfo.vue
@@ -51,18 +51,27 @@ function fetchData(id: string) {
formData.objective = data.objective;
formData.nodeId = data.nodeId;
- if (node.value && formData?.nodeId) {
- const nodeTree = await searchAndReplace(node.value, formData?.nodeId);
- if (nodeTree) {
- expanded.value = [];
- const parts = nodeTree?.orgName.split("/");
- for (let i = 1; i < parts.length; i++) {
- const arrangedParts = parts[i];
- expanded.value.push(arrangedParts);
- }
- updateSelected(nodeTree);
- }
- }
+ const arrayExpanded = [
+ data.root,
+ data.child1,
+ data.child2,
+ data.child3,
+ data.child4,
+ ];
+ expanded.value = arrayExpanded.filter((e) => e !== null).slice(0, -1);
+
+ // if (node.value && formData?.nodeId) {
+ // const nodeTree = await searchAndReplace(node.value, formData?.nodeId);
+ // if (nodeTree) {
+ // expanded.value = [];
+ // const parts = nodeTree?.orgName.split("/");
+ // for (let i = 1; i < parts.length; i++) {
+ // const arrangedParts = parts[i];
+ // expanded.value.push(arrangedParts);
+ // }
+ // updateSelected(nodeTree);
+ // }
+ // }
})
.catch((err) => {
messageError($q, err);
@@ -182,7 +191,7 @@ onMounted(async () => {
class="tree-container"
dense
:nodes="node"
- node-key="orgTreeName"
+ node-key="orgTreeId"
label-key="labelName"
v-model:expanded="expanded"
:filter="filter"
@@ -259,7 +268,7 @@ onMounted(async () => {
- {
hide-bottom-space
lazy-rules
readonly
- />
+ /> -->
{
emit-value
map-options
multiple
+ class="inputgreen"
/>