Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-06-25 16:05:07 +07:00
commit 456a0d3e9f
13 changed files with 373 additions and 247 deletions

View file

@ -60,8 +60,7 @@ export default {
// clear Position
clearPosition: (personalId: string) =>
`${placement}/position/clear/${personalId}`,
clearDate: (personalId: string) =>
`${placement}/date/update/${personalId}`,
clearDate: (personalId: string) => `${placement}/date/update/${personalId}`,
// Document
documentByid: (personalId: string) => `${placement}/doc/${personalId}`,
documentDelid: (personalId: string, docid: string) =>
@ -69,7 +68,8 @@ export default {
// order
organizationsOrder: () => `${order}/order/organizations`,
approverOC: (id: string) => `${order}/order/approver/${id}`,
// approverOC: (id: string) => `${order}/order/approver/${id}`,
approverOC: (id: string) => `${order}/org/approver/${id}`,
yearOptionsOrder: () => `${order}/order/fiscal-year`,
listOrder: () => `${order}/order`,
detailOrder: (orderId: string) => `${order}/order/detail/${orderId}`,
@ -175,7 +175,4 @@ export default {
appointEmployeeOrder: (typeId: string) =>
`${placement}/appointment/temp/report/${typeId}`,
apppointmentPositionUse: () => `${placement}/appointment/temp/use`,
};

View file

@ -602,87 +602,87 @@ const menuList = readonly<any[]>([
},
],
},
{
key: 13,
icon: "o_note",
label: "ระบบเดิม",
path: "registry",
role: "organization",
children: [
{
key: 13.0,
icon: "o_person",
label: "ข้อมูลหลัก",
path: "metadata",
role: "metadata",
},
{
key: 13.1,
icon: "o_groups",
label: "โครงสร้างอัตรากำลัง",
path: "organizational",
role: "organization",
children: [
{
key: 3.1,
label: "จัดการตำแหน่ง",
path: "organizationalMapping",
},
{
key: 3.2,
label: "แผนภูมิโครงสร้าง",
path: "organizationalStructChart",
},
{
key: 3.3,
label: "แผนภูมิองค์กร",
path: "organizationalOrgChart",
},
{
key: 3.4,
label: "ผังโครงสร้าง",
path: "organizationalTree",
},
{
key: 3.5,
label: "ผังโครงสร้างลูกจ้าง",
path: "organizationalEmployee",
},
{
key: 3.6,
label: "จัดการบัญชี 2",
path: "manageReport2",
},
{
key: 3.7,
label: "รายงานบัญชี",
path: "organizationalReport",
},
],
},
{
key: 13.0,
icon: "o_contact_page",
label: "ทะเบียนประวัติ",
path: "registry",
role: "registry",
},
],
},
{
key: 4,
icon: "o_contact_page",
label: "ทะเบียนประวัติ",
path: "registry",
role: "registry",
},
{
key: 4,
icon: "verified",
label: "รายการรอตรวจสอบ",
path: "verified",
role: "registryverify",
},
// {
// key: 13,
// icon: "o_note",
// label: "ระบบเดิม",
// path: "registry",
// role: "organization",
// children: [
// {
// key: 13.0,
// icon: "o_person",
// label: "ข้อมูลหลัก",
// path: "metadata",
// role: "metadata",
// },
// {
// key: 13.1,
// icon: "o_groups",
// label: "โครงสร้างอัตรากำลัง",
// path: "organizational",
// role: "organization",
// children: [
// {
// key: 3.1,
// label: "จัดการตำแหน่ง",
// path: "organizationalMapping",
// },
// {
// key: 3.2,
// label: "แผนภูมิโครงสร้าง",
// path: "organizationalStructChart",
// },
// {
// key: 3.3,
// label: "แผนภูมิองค์กร",
// path: "organizationalOrgChart",
// },
// {
// key: 3.4,
// label: "ผังโครงสร้าง",
// path: "organizationalTree",
// },
// {
// key: 3.5,
// label: "ผังโครงสร้างลูกจ้าง",
// path: "organizationalEmployee",
// },
// {
// key: 3.6,
// label: "จัดการบัญชี 2",
// path: "manageReport2",
// },
// {
// key: 3.7,
// label: "รายงานบัญชี",
// path: "organizationalReport",
// },
// ],
// },
// {
// key: 13.0,
// icon: "o_contact_page",
// label: "ทะเบียนประวัติ",
// path: "registry",
// role: "registry",
// },
// ],
// },
// {
// key: 4,
// icon: "o_contact_page",
// label: "ทะเบียนประวัติ",
// path: "registry",
// role: "registry",
// },
// {
// key: 4,
// icon: "verified",
// label: "รายการรอตรวจสอบ",
// path: "verified",
// role: "registryverify",
// },
]);
const tabList = readonly<tabType[]>([

View file

@ -366,8 +366,42 @@ watch(
<q-card-section class="q-pa-sm">
<q-card bordered class="bg-grey-13">
<q-list dense class="q-py-sm">
<q-item dense>
<q-card-section>
<div class="text-grey">ตำแหนงเลขท</div>
<div class="text-subtitle2 text-black q-ml-sm">
{{ props.row.posNo ? props.row.posNo : "-" }}
</div>
<div class="text-grey">
{{ empType === "officer" ? `ตำแหน่งในสายงาน` : `ตำแหน่ง` }}
</div>
<div class="text-subtitle2 text-black q-ml-sm">
{{ props.row.position ? props.row.position : "-" }}
</div>
<div class="text-grey">
{{ empType === "officer" ? "ตำแหน่งประเภท" : "กลุ่มงาน" }}
</div>
<div class="text-subtitle2 text-black q-ml-sm">
{{ props.row.posType ? props.row.posType : "-" }}
</div>
<div class="text-grey">
{{ empType === "officer" ? "ระดับ" : "ระดับชั้นงาน" }}
</div>
<div class="text-subtitle2 text-black q-ml-sm">
{{
props.row.posLevel
? props.row.posTypeShortName
? `${props.row.posTypeShortName} ${props.row.posLevel}`
: props.row.posLevel
: "-"
}}
</div>
</q-card-section>
<!-- <q-list dense class="q-py-sm"> -->
<!-- <q-item dense>
<q-item-section>
<q-item-label caption>ตำแหนงเลขท</q-item-label>
</q-item-section>
@ -376,9 +410,9 @@ watch(
props.row.posNo ? props.row.posNo : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-item> -->
<q-item dense>
<!-- <q-item dense>
<q-item-section>
<q-item-label caption>{{
empType === "officer" ? `ตำแหน่งในสายงาน` : `ตำแหน่ง`
@ -391,9 +425,9 @@ watch(
}}</q-item-label
>
</q-item-section>
</q-item>
</q-item> -->
<q-item dense>
<!-- <q-item dense>
<q-item-section>
<q-item-label caption>
{{
@ -408,9 +442,9 @@ watch(
}}</q-item-label
>
</q-item-section>
</q-item>
</q-item> -->
<q-item dense>
<!-- <q-item dense>
<q-item-section>
<q-item-label caption>
{{
@ -429,8 +463,8 @@ watch(
}}</q-item-label
>
</q-item-section>
</q-item>
</q-list>
</q-item> -->
<!-- </q-list> -->
</q-card>
</q-card-section>
<q-separator inset />

View file

@ -23,7 +23,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
const posTypeMain = ref<DataType[]>([]);
const posLevelOps = ref<DataOption[]>([]);
const yearOps = ref<DataOption[]>([]);
const mode = ref<string>("card");
const mode = ref<string>("table");
function fetchType(data: DataType[]) {
posTypeMain.value = data;

View file

@ -137,7 +137,7 @@ function updateSelected(data: TreeMain) {
* @param level levelTree
*/
const isAll = ref<boolean>(false);
const isBlank = ref<boolean>(false);
const isBlank = ref<boolean>(true);
async function fetchDataTable(id: string, level: number = 0) {
showLoader();
const body = {

View file

@ -137,12 +137,10 @@ watch(props, () => {
<q-dialog v-model="props.Modal" persistent>
<q-card style="max-width: 100%; width: 80%">
<q-form ref="myForm">
<div class="row">
<DialogHeader
:tittle="`รายละเอียดของ ${personalForm.fullName}`"
@click="close"
/>
</div>
<DialogHeader
:tittle="`รายละเอียดของ ${personalForm.fullName}`"
:close="close"
/>
<q-separator />

View file

@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
// import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";

View file

@ -9,7 +9,14 @@ import { useRoute } from "vue-router";
/** Use */
const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
const {
messageError,
success,
showLoader,
hideLoader,
dialogConfirm,
findOrgName,
} = mixin;
const route = useRoute();
const retireld_params = route.params.id;
@ -82,7 +89,7 @@ watch(modal, () => {
}
});
function findOrgName(obj: any) {
function findOrgChildName(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
@ -112,7 +119,7 @@ function findOrgName(obj: any) {
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
return name == "" ? "" : name;
return name == "" ? "-" : name;
} else {
return "";
}
@ -120,36 +127,77 @@ function findOrgName(obj: any) {
const formPagePersonList = reactive({ keyword: "", pageSize: 10, page: 1 });
const maxPage = ref<number>(1);
const totalList = ref<number>(0);
// fecth profile
const fecthProfile = async () => {
showLoader();
await http
.post(config.API.orgProfileProbation, formPagePersonList)
.then((res) => {
maxPage.value = Math.ceil(
res.data.result.total / formPagePersonList.pageSize
);
rows.value = res.data.result.data.map((e: any) => ({
id: e.id,
prefix:e.prefix,
firstName:e.firstName,
lastName:e.lastName,
fullname: e.prefix + e.firstName + " " + e.lastName,
position: e.position,
level:
e.posTypeName && e.posLevelName
? e.posTypeName + " (" + e.posLevelName + ")"
: "",
organizationOrganization: findOrgName(e),
}));
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
if (props?.dataProfile?.type === "OFFICER") {
showLoader();
formPagePersonList.keyword =
formPagePersonList.keyword === null ? "" : formPagePersonList.keyword;
await http
.post(config.API.orgProfileProbation, formPagePersonList)
.then((res) => {
maxPage.value = Math.ceil(
res.data.result.total / formPagePersonList.pageSize
);
totalList.value = res.data.result.total;
rows.value = res.data.result.data.map((e: any) => ({
id: e.id,
prefix: e.prefix,
firstName: e.firstName,
lastName: e.lastName,
fullname: e.prefix + e.firstName + " " + e.lastName,
position: e.position,
level:
e.posTypeName && e.posLevelName
? e.posTypeName + " (" + e.posLevelName + ")"
: "-",
organizationOrganization: findOrgChildName(e),
}));
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
} else {
let queryParams: any = {
page: formPagePersonList.page,
pageSize: formPagePersonList.pageSize,
searchKeyword: formPagePersonList.keyword,
searchField: "fullName",
type: "perm",
};
http
.get(config.API.registryNew("-employee"), { params: queryParams })
.then((res) => {
maxPage.value = Math.ceil(
res.data.result.total / formPagePersonList.pageSize
);
totalList.value = res.data.result.total;
rows.value = res.data.result.data.map((e: any) => ({
id: e.id,
prefix: e.prefix,
firstName: e.firstName,
lastName: e.lastName,
fullname: e.prefix + e.firstName + " " + e.lastName,
position: e.position,
level:
e.posTypeName && e.posLevelName
? e.posTypeName + " (" + e.posLevelName + ")"
: "-",
organizationOrganization: findOrgName(e),
}));
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
};
//
@ -183,20 +231,17 @@ const updateListData = (retireld: string, pId: string) => {
props.UpdateListId(retireld, pId);
};
/**
* Setiting Pagination
*/
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "fullname",
descending: true,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
function updatePageSize(newPagination: any) {
formPagePersonList.page = 1;
formPagePersonList.pageSize = newPagination.rowsPerPage;
}
watch(
() => formPagePersonList.pageSize,
() => {
fecthProfile();
}
);
</script>
<template>
@ -232,17 +277,18 @@ const paginationLabel = (start: number, end: number, total: number) => {
borderless
outlined
dense
debounce="300"
v-model="filter"
clearable
v-model="formPagePersonList.keyword"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
@keyup.enter="(formPagePersonList.page = 1), fecthProfile()"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</q-toolbar>
<q-table
<d-table
flat
bordered
dense
@ -250,9 +296,8 @@ const paginationLabel = (start: number, end: number, total: number) => {
:columns="columns"
row-key="name"
class="custom-header-table"
:filter="filter"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
:rows-per-page-options="[10, 20, 50, 100]"
@update:pagination="updatePageSize"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -266,20 +311,27 @@ const paginationLabel = (start: number, end: number, total: number) => {
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td>{{ props.rowIndex + 1 }}</q-td>
<q-td>{{
(formPagePersonList.page - 1) *
Number(formPagePersonList.pageSize) +
props.rowIndex +
1
}}</q-td>
<q-td key="fullname" :props="props">
{{ props.row.prefix ? props.row.prefix:'' }}{{ props.row.firstName ? props.row.firstName:'' }} {{ props.row.lastName ? props.row.lastName:'' }}
{{ props.row.prefix ? props.row.prefix : ""
}}{{ props.row.firstName ? props.row.firstName : "" }}
{{ props.row.lastName ? props.row.lastName : "" }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position ? props.row.position:'-' }}
{{ props.row.position ? props.row.position : "-" }}
</q-td>
<q-td key="level" :props="props">{{ props.row.level ? props.row.level :'-' }}</q-td>
<q-td key="level" :props="props">{{ props.row.level }}</q-td>
<q-td
key="organizationOrganization"
:props="props"
class="table_ellipsis"
>
{{ props.row.organizationOrganization ? props.row.organizationOrganization:'-' }}
{{ props.row.organizationOrganization }}
</q-td>
<q-td>
<q-btn
@ -293,17 +345,19 @@ const paginationLabel = (start: number, end: number, total: number) => {
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ totalList }} รายการ
<q-pagination
v-model="pagination.page"
v-model="formPagePersonList.page"
color="primary"
:max="scope.pagesNumber"
:max="maxPage"
:max-pages="5"
size="sm"
boundary-links
direction-links
@update:model-value="fecthProfile"
></q-pagination>
</template>
</q-table>
</d-table>
</div>
</q-card>
</q-dialog>

View file

@ -731,11 +731,7 @@ function removeFile(fileName: string) {
</div>
</q-card>
<q-card
v-if="dataDetail.status == 'WAITTING'"
bordered
class="row col-12 text-dark q-mt-sm"
>
<q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">
รายการตรวจสอบเงอนไขตาง
@ -749,37 +745,40 @@ function removeFile(fileName: string) {
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark">เงอนไขตาง </div>
<q-space />
<div v-if="!conditions">
<q-btn
outline
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="conditions = !conditions"
/>
</div>
<div v-else class="q-gutter-x-sm">
<q-btn
outline
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
@click="onSubmitConditions"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="clickCancelConditions"
/>
<div v-if="dataDetail.status == 'WAITTING' && roleUser === 'admin'">
<div v-if="!conditions">
<q-btn
outline
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="conditions = !conditions"
/>
</div>
<div v-else class="q-gutter-x-sm">
<q-btn
outline
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
@click="onSubmitConditions"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="clickCancelConditions"
/>
</div>
</div>
</div>
<div class="col-12"><q-separator /></div>
@ -826,6 +825,7 @@ function removeFile(fileName: string) {
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
<div class="col-12 row">
<q-file
v-if="dataDetail.status == 'WAITTING' && roleUser === 'admin'"
class="col-12"
for="#evidenceFiles"
outlined
@ -879,6 +879,10 @@ function removeFile(fileName: string) {
</div>
<div>
<q-btn
v-if="
dataDetail.status == 'WAITTING' &&
roleUser === 'admin'
"
dense
flat
round
@ -1047,38 +1051,40 @@ function removeFile(fileName: string) {
</div>
<q-space />
<div class="q-gutter-sm" v-if="!edit">
<q-btn
outline
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
v-if="!(status == 'REPORT' || status == 'DONE')"
/>
</div>
<div class="q-gutter-sm" v-else>
<q-btn
outline
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
type="submit"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="clickCancel"
/>
<div v-if="roleUser === 'admin'">
<div class="q-gutter-sm" v-if="!edit">
<q-btn
outline
color="primary"
dense
icon-right="mdi-file-edit-outline"
class="q-px-sm"
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
v-if="!(status == 'REPORT' || status == 'DONE')"
/>
</div>
<div class="q-gutter-sm" v-else>
<q-btn
outline
color="public"
dense
class="q-px-sm"
label="บันทึก"
style="width: 80px"
type="submit"
/>
<q-btn
outline
color="red"
dense
class="q-px-sm"
label="ยกเลิก"
style="width: 80px"
@click="clickCancel"
/>
</div>
</div>
</div>
<div class="col-12"><q-separator /></div>

View file

@ -208,7 +208,7 @@ async function fecthInsigniaByOc(
}
})
.catch((err) => {
messageError($q, err);
// messageError($q, err);
})
.finally(() => {
hideLoader();

View file

@ -288,7 +288,7 @@ onMounted(() => {
}}
</div>
<div v-else>
<div v-else class="table_ellipsis">
{{ col.value }}
</div>
</q-td>

View file

@ -86,14 +86,14 @@ async function fetchLeaveday(
.then((res) => {
const data = res.data.result;
data && genReport(data);
!data && hideLoader();
detailReport.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
})
.finally(() => {});
}
/**
@ -114,18 +114,19 @@ async function genReport(data: any) {
const objectUrl = URL.createObjectURL(blob);
fileBlob.value = blob;
const pdfData = await usePDF(`${objectUrl}`);
showLoader();
setTimeout(() => {
pdfSrc.value = pdfData.pdf.value;
numOfPages.value = pdfData.pages.value;
hideLoader();
}, 1500);
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
setTimeout(() => {
hideLoader();
}, 2000);
});
}

View file

@ -12,7 +12,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import CurruncyInput from "@/components/CurruncyInput.vue";
// import CurruncyInput from "@/components/CurruncyInput.vue";
const props = defineProps({
next: {
@ -628,34 +628,70 @@ const pagination = ref({
<div class="col-xs-12">
<div class="col-12 row q-py-sm q-col-gutter-sm">
<div class="col-xs-6 col-sm-6 col-md-6">
<CurruncyInput
<q-input
v-model="modalData.salaryAmount"
:outlined="true"
dense
hide-bottom-space
:label="`${'เงินเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
reverse-fill-mask
/>
<!-- <CurruncyInput
:edit="true"
:dense="true"
v-model="modalData.salaryAmount"
:label="`${'เงินเดือน'}`"
:rules="[(val: any) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
hide-bottom-space
/>
/> -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<CurruncyInput
<q-input
v-model="modalData.positionSalaryAmount"
:outlined="true"
dense
hide-bottom-space
:label="`${'เงินประจำตำแหน่ง'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`]"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
reverse-fill-mask
/>
<!-- <CurruncyInput
:edit="true"
:dense="true"
v-model="modalData.positionSalaryAmount"
:label="`${'เงินประจำตำแหน่ง'}`"
hide-bottom-space
/>
/> -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<CurruncyInput
<q-input
v-model="modalData.monthSalaryAmount"
:outlined="true"
dense
hide-bottom-space
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`]"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
reverse-fill-mask
/>
<!-- <CurruncyInput
:edit="true"
:dense="true"
v-model="modalData.monthSalaryAmount"
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
hide-bottom-space
/>
/> -->
</div>
<div class="col-xs-6 col-sm-6 col-md-12" v-if="checkNote">
<q-input