Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-02-07 10:22:42 +07:00
commit 85f71f1c27
20 changed files with 255 additions and 212 deletions

View file

@ -46,6 +46,7 @@ const {
messageError,
success,
dialogRemove,
dialogMessageNotify,
} = mixin;
const selected = ref<any>([]);
const search = ref<string>("");
@ -309,7 +310,11 @@ function validateForm() {
}
}
if (hasError.every((result) => result === true)) {
onSubmit();
if (rows.value.length !== 0) {
onSubmit();
} else {
dialogMessageNotify($q, "กรุณาเลือกตำแหน่งอย่างน้อย 1 ตำแหน่ง");
}
} else {
}
}

View file

@ -10,6 +10,7 @@ import type {
PosMaster2,
} from "@/modules/02_organizationalNew/interface/response/organizational";
import type { MovePos } from "@/modules/02_organizationalNew/interface/request/organizational";
import type { DataTree } from "@/modules/02_organizationalNew/interface/index/organizational";
import HeaderDialog from "@/components/DialogHeader.vue";
@ -61,8 +62,9 @@ function resetFilter() {
filterRef.value.focus();
}
function updateSelected(orgLevel: number) {
levelTree.value = orgLevel;
function updateSelected(data: DataTree) {
levelTree.value = data.orgLevel;
selectedTree.value = data.orgTreeId;
}
const isDisable = computed(() => {
@ -115,6 +117,10 @@ watch(
if (modal.value && props.type === "SINGER") {
const data = rows.value.filter((e: PosMaster2) => e.id === props.rowId);
selectedFilter.value = data;
selectedTree.value = "";
} else {
selectedFilter.value = [];
selectedTree.value = "";
}
}
);
@ -225,13 +231,16 @@ watch(
:filter="filterTree"
no-results-label="ไม่พบข้อมูลที่ค้นหา"
no-nodes-label="ไม่มีข้อมูล"
v-model:selected="selectedTree"
>
<template v-slot:default-header="prop">
<!--แสดงชอแผนก มพวหนา คลกแลวกาง/ Tree-->
<div
class="row items-center q-px-xs q-pt-xs q-gutter-sm"
@click="updateSelected(prop.node.orgLevel)"
<q-item
clickable
:active="selectedTree == prop.node.orgTreeId"
@click.stop="updateSelected(prop.node)"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<div>
<div class="text-weight-medium">
@ -246,7 +255,7 @@ watch(
}}
</div>
</div>
</div>
</q-item>
</template>
</q-tree>
</q-card>
@ -271,4 +280,12 @@ watch(
</q-dialog>
</template>
<style scoped></style>
<style scoped>
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -130,16 +130,20 @@ async function fetchOrgRevision() {
showLoader();
await http
.get(config.API.organizationHistoryNew)
.then((res) => {
.then(async (res) => {
const data = res.data.result.filter(
(e: HistoryType) => e.orgRevisionIsDraft === false
);
if (data) {
const listOption = data.map((e: HistoryType) => ({
id: e.orgRevisionId,
name: e.orgRevisionName,
}));
orgRevisionOpMain.value = listOption;
// const listOption = data.map((e: HistoryType) => ({
// id: e.orgRevisionId,
// name: e.orgRevisionName,
// }));
// orgRevisionOpMain.value = listOption;
const currentStr = await data.find(
(x: any) => x.orgRevisionIsCurrent === true
);
formData.orgRevisionId = currentStr ? currentStr.orgRevisionId : null;
}
})
.catch((err) => {
@ -150,19 +154,19 @@ async function fetchOrgRevision() {
});
}
function filterSelector(val: any, update: Function, refData: string) {
switch (refData) {
case "orgRevisionId":
update(() => {
orgRevisionOp.value = orgRevisionOpMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
default:
break;
}
}
// function filterSelector(val: any, update: Function, refData: string) {
// switch (refData) {
// case "orgRevisionId":
// update(() => {
// orgRevisionOp.value = orgRevisionOpMain.value.filter(
// (v: DataOption) => v.name.indexOf(val) > -1
// );
// });
// break;
// default:
// break;
// }
// }
watch(
() => modal.value,
@ -213,7 +217,7 @@ watch(
lazy-rules
/>
</div>
<div class="col-6" v-if="type !== 'NEW'">
<!-- <div class="col-6" v-if="type !== 'NEW'">
<q-select
for="#orgRevisionId"
ref="orgRevisionIdRef"
@ -242,7 +246,7 @@ watch(
</q-item>
</template>
</q-select>
</div>
</div> -->
</div>
</q-card-section>
<q-separator />

View file

@ -99,20 +99,21 @@ const orgId = ref<string>("");
function updateSelected(data: DataTree) {
store.treeId = data.orgTreeId;
store.level = data.orgLevel;
if (data.orgTreeId === nodeId.value) {
nodeId.value = "";
} else {
nodeId.value = data.orgTreeId ? data.orgTreeId : "";
data.orgTreeId &&
props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
store.getSumPosition({
totalPosition: data.totalPosition,
totalPositionCurrentUse: data.totalPositionCurrentUse,
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
totalPositionNextUse: data.totalPositionNextUse,
totalPositionNextVacant: data.totalPositionNextVacant,
});
}
// if (data.orgTreeId === nodeId.value) {
// nodeId.value = "";
// } else {
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
data.orgTreeId && props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
store.getSumPosition({
totalPosition: data.totalPosition,
totalPositionCurrentUse: data.totalPositionCurrentUse,
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
totalPositionNextUse: data.totalPositionNextUse,
totalPositionNextVacant: data.totalPositionNextVacant,
});
// }
}
const breakLoop = ref<boolean>(false);
@ -349,6 +350,8 @@ watch(
nodes.value = nodeTEST.value;
}
);
const modaeMenu = ref<boolean>(false);
</script>
<template>
@ -389,7 +392,6 @@ watch(
class="q-pa-sm q-gutter-sm"
dense
default-expand-all
selected-color="primary"
:nodes="lazy"
node-key="orgTreeId"
label-key="orgTreeName"
@ -397,16 +399,15 @@ watch(
:no-results-label="notFound"
:no-nodes-label="noData"
v-model:expanded="expanded"
v-model:selected="selected"
>
<template v-slot:default-header="prop">
<!-- {{ prop.node.orgTreeName }} -->
<div
class="row items-center q-px-xs q-pt-xs q-gutter-sm"
@click="updateSelected(prop.node)"
<q-item
clickable
:active="nodeId == prop.node.orgTreeId"
@click.stop="updateSelected(prop.node)"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
<!--แสดงชอแผนก มพวหนา คลกแลวกาง/ Tree-->
<div>
<div class="text-weight-medium">
{{ prop.node.orgTreeName }}
@ -420,132 +421,136 @@ watch(
}}
</div>
</div>
</div>
<!-- v-if="store.typeOrganizational === 'draft' && !store.isPublic" -->
<q-btn
v-if="store.typeOrganizational === 'draft'"
flat
dense
icon="mdi-dots-vertical"
class="q-ml-xs"
color="grey-13"
size="12px"
round
>
<q-menu>
<q-list
dense
v-for="(item, index) in prop.node.orgLevel === 4
? listAdd.slice(1, 6)
: listAdd"
:key="index"
style="min-width: 100px"
>
<q-item
clickable
v-close-popup
@click="
item.type === 'EDIT'
? onClickEdit(prop.node)
: item.type === 'ADD'
? onClickAgency(prop.node.orgLevel + 1, prop.node)
: item.type === 'DETAIL'
? onClickDetail(prop.node.orgTreeId, prop.node.orgLevel)
: item.type === 'DEL'
? onClickDel(
prop.node.orgLevel,
prop.node.orgTreeId,
prop.node.orgRootId
)
: item.type === 'SORT'
? onClickSort(prop.node.orgRootId, prop.node.orgLevel)
: item.type === 'HISTORY'
? onClickHistory(
prop.node.orgLevel,
prop.node.orgTreeId
)
: null
"
<q-btn
v-if="store.typeOrganizational === 'draft'"
flat
dense
icon="mdi-dots-vertical"
class="q-ml-xs"
color="grey-13"
size="12px"
round
>
<q-menu>
<q-list
dense
v-for="(item, index) in prop.node.orgLevel === 4
? listAdd.slice(1, 6)
: listAdd"
:key="index"
style="min-width: 100px"
>
<q-item-section avatar style="min-width: 20px">
<q-icon
size="17px"
:color="item.color"
:name="item.icon"
/>
</q-item-section>
<div v-if="prop.node.orgLevel === 0">
<q-item-section
v-if="
item.type === 'EDIT' ||
item.type === 'DEL' ||
item.type === 'HISTORY' ||
item.type === 'SORT'
"
>
{{ item.label }}หนวยงาน
<q-item
clickable
v-close-popup
@click="
item.type === 'EDIT'
? onClickEdit(prop.node)
: item.type === 'ADD'
? onClickAgency(prop.node.orgLevel + 1, prop.node)
: item.type === 'DETAIL'
? onClickDetail(
prop.node.orgTreeId,
prop.node.orgLevel
)
: item.type === 'DEL'
? onClickDel(
prop.node.orgLevel,
prop.node.orgTreeId,
prop.node.orgRootId
)
: item.type === 'SORT'
? onClickSort(prop.node.orgRootId, prop.node.orgLevel)
: item.type === 'HISTORY'
? onClickHistory(
prop.node.orgLevel,
prop.node.orgTreeId
)
: null
"
>
<q-item-section avatar style="min-width: 20px">
<q-icon
size="17px"
:color="item.color"
:name="item.icon"
/>
</q-item-section>
<q-item-section v-else-if="item.type === 'ADD'">
{{ item.label }}วนราชการ
</q-item-section>
<q-item-section v-else> {{ item.label }} </q-item-section>
</div>
<div v-if="prop.node.orgLevel === 0">
<q-item-section
v-if="
item.type === 'EDIT' ||
item.type === 'DEL' ||
item.type === 'HISTORY' ||
item.type === 'SORT'
"
>
{{ item.label }}หนวยงาน
</q-item-section>
<q-item-section v-else-if="item.type === 'ADD'">
{{ item.label }}วนราชการ
</q-item-section>
<q-item-section v-else>
{{ item.label }}
</q-item-section>
</div>
<div v-else>
<q-item-section
v-if="
item.type === 'ADD' ||
item.type === 'EDIT' ||
item.type === 'DEL' ||
item.type === 'HISTORY' ||
item.type === 'SORT'
"
>{{ item.label }}วนราชการ</q-item-section
>
<q-item-section v-else>{{ item.label }}</q-item-section>
</div>
</q-item>
</q-list>
</q-menu>
</q-btn>
<div v-else>
<q-item-section
v-if="
item.type === 'ADD' ||
item.type === 'EDIT' ||
item.type === 'DEL' ||
item.type === 'HISTORY' ||
item.type === 'SORT'
"
>{{ item.label }}วนราชการ</q-item-section
>
<q-item-section v-else>{{ item.label }}</q-item-section>
</div>
</q-item>
</q-list>
</q-menu>
</q-btn>
<q-btn
v-else
flat
dense
icon="mdi-dots-vertical"
class="q-pa-none q-ml-xs"
color="grey-13"
size="12px"
round
>
<q-menu>
<q-list
dense
v-for="(item, index) in listAdd.slice(5, 6)"
:key="index"
style="min-width: 100px"
>
<q-item
clickable
v-close-popup
@click="
onClickDetail(prop.node.orgTreeId, prop.node.orgLevel)
"
<q-btn
v-else
flat
dense
icon="mdi-dots-vertical"
class="q-pa-none q-ml-xs"
color="grey-13"
size="12px"
round
>
<q-menu>
<q-list
dense
v-for="(item, index) in listAdd.slice(5, 6)"
:key="index"
style="min-width: 100px"
>
<q-item-section avatar style="min-width: 20px">
<q-icon
size="17px"
:color="item.color"
:name="item.icon"
/>
</q-item-section>
<q-item-section>{{ item.label }}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
<q-item
clickable
v-close-popup
@click="
onClickDetail(prop.node.orgTreeId, prop.node.orgLevel)
"
>
<q-item-section avatar style="min-width: 20px">
<q-icon
size="17px"
:color="item.color"
:name="item.icon"
/>
</q-item-section>
<q-item-section>{{ item.label }}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item>
</template>
</q-tree>
</div>
@ -590,4 +595,12 @@ watch(
border: 1px solid #e6e6e7;
border-radius: 10px;
}
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -44,8 +44,8 @@
icon="mdi-history"
@click="clickHistory(props.row)"
>
<q-tooltip>ประวแกไขผลการประเมนการปฏราชการ</q-tooltip>
</q-btn>
<q-tooltip>ประวแกไขผลการประเมนการปฏราชการ</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
@ -62,9 +62,7 @@
/>
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12 col-sm-12 col-md-12">
<datepicker
menu-class-name="modalfix"
@ -626,7 +624,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
store.isLoad++
store.isLoad++;
});
}
};
@ -903,6 +901,7 @@ const clickEditRow = () => {
const clickHistory = async (row: RequestItemsObject) => {
tittleHistory.value = "ประวัติแก้ไขผลการประเมินการปฏิบัติราชการ";
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileAssessmentHisId(row.id))

View file

@ -781,6 +781,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขประกาศลูกจ้างดีเด่น"
: "ประวัติแก้ไขประกาศเกียรติคุณ";
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileHonorHisId(row.id))

View file

@ -43,8 +43,8 @@
icon="mdi-history"
@click="clickHistory(props.row)"
>
<q-tooltip>ประวแกไขว</q-tooltip>
</q-btn>
<q-tooltip>ประวแกไขว</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
@ -58,9 +58,7 @@
<DialogHeader tittle="วินัย" :close="clickClose" />
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
@ -617,7 +615,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
store.isLoad++
store.isLoad++;
});
}
};
@ -885,6 +883,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileDisHisId(row.id))

View file

@ -1495,6 +1495,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileEduHisId(row.id))

View file

@ -68,9 +68,7 @@
<DialogHeader tittle="เปลี่ยนชื่อ-นามสกุล" :close="clickClose" />
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6">
<selector
:hide-dropdown-icon="!edit"
@ -632,6 +630,7 @@ const clickNext = async () => {
* กดดอมลตอไป
*/
const getData = () => {
fileUpload.value = [];
const row = rows.value[rowIndex.value];
prefixId.value = row.prefixId;
firstName.value = row.firstName;
@ -669,6 +668,7 @@ const clickEdit = () => {
* กดปมเพมดานบน table
*/
const clickAdd = async () => {
fileUpload.value = [];
editRow.value = false;
await addData();
};

View file

@ -62,9 +62,9 @@
>
<q-tooltip>เพมขอม</q-tooltip>
</q-btn>
<q-btn size="12px" flat round color="add" @click="add" :icon="iconAdd">
<!-- <q-btn size="12px" flat round color="add" @click="add" :icon="iconAdd">
<q-tooltip>สรปวนลา</q-tooltip>
</q-btn>
</q-btn> -->
</div>
<div class="q-pl-sm" v-else>

View file

@ -1279,6 +1279,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileInsignHisId(row.id))

View file

@ -152,7 +152,7 @@
</template>
</datepicker>
</div>
<div class="col-xs-3 col-sm-3 col-md-3">
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
:outlined="edit"
@ -168,7 +168,7 @@
@update:modelValue="clickEditRow"
/>
</div>
<div class="col-xs-3 col-sm-3 col-md-3">
<!-- <div class="col-xs-3 col-sm-3 col-md-3">
<q-input
:class="getClass(false)"
:outlined="true"
@ -184,7 +184,7 @@
:label="`${'จำนวนวันที่ลามาแล้ว'}`"
@update:modelValue="clickEditRow"
/>
</div>
</div> -->
<div class="col-xs-6 col-sm-6 col-md-6">
<selector
:class="getClass(edit)"
@ -776,6 +776,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileLeaveHisId(row.id))

View file

@ -570,6 +570,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileOtherHisId(row.id))

View file

@ -43,8 +43,10 @@
icon="mdi-history"
@click="clickHistory(props.row)"
>
<q-tooltip>ประวแกไขวนทไดปฏหนาทอยในเขตทไดประกาศใชกฎอยการศ</q-tooltip>
</q-btn>
<q-tooltip
>ประวแกไขวนทไดปฏหนาทอยในเขตทไดประกาศใชกฎอยการศ</q-tooltip
>
</q-btn>
</q-td>
</q-tr>
</template>
@ -61,9 +63,7 @@
/>
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
@ -507,7 +507,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
store.isLoad++
store.isLoad++;
});
}
};
@ -770,6 +770,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileNopaidHisId(row.id))

View file

@ -2249,6 +2249,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))

View file

@ -1989,6 +1989,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileSalaryEmployeeHisId(row.id))

View file

@ -2017,6 +2017,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileSalaryEmployeeHisId(row.id))

View file

@ -37,9 +37,8 @@
icon="mdi-history"
@click="clickHistory(props.row)"
>
<q-tooltip>ประวแกไขความสามารถพเศษ
</q-tooltip>
</q-btn>
<q-tooltip>ประวแกไขความสามารถพเศษ </q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
@ -53,9 +52,7 @@
<DialogHeader tittle="ความสามารถพิเศษ" :close="clickClose" />
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-6">
<q-input
:class="getClass(edit)"
@ -380,7 +377,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
store.isLoad++
store.isLoad++;
});
}
};
@ -636,6 +633,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileAbiliHisId(row.id))

View file

@ -1069,6 +1069,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileTrainHisId(row.id))

View file

@ -47,9 +47,8 @@
icon="mdi-history"
@click="clickHistory(props.row)"
>
<q-tooltip>ประวแกไขปฏราชการพเศษ
</q-tooltip>
</q-btn>
<q-tooltip>ประวแกไขปฏราชการพเศษ </q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
@ -63,9 +62,7 @@
<DialogHeader tittle="ปฏิบัติราชการพิเศษ" :close="clickClose" />
<q-separator />
<q-card-section class="q-p-sm">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
@ -583,7 +580,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
store.isLoad++
store.isLoad++;
});
}
};
@ -851,6 +848,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
filterHistory.value = "";
showLoader();
await http
.get(config.API.profileDutyHisId(row.id))