Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-03-26 17:22:52 +07:00
commit f10b5253f4
9 changed files with 149 additions and 64 deletions

View file

@ -285,8 +285,6 @@ function onClickDetail(id: string, level: number) {
* @param node อม โครงสราง * @param node อม โครงสราง
*/ */
async function onClickEdit(node: OrgTree) { async function onClickEdit(node: OrgTree) {
console.log(node);
dialogAgency.value = !dialogAgency.value; dialogAgency.value = !dialogAgency.value;
actionType.value = "EDIT"; actionType.value = "EDIT";
orgLevel.value = node.orgLevel; orgLevel.value = node.orgLevel;

View file

@ -433,6 +433,11 @@ async function onClickDownloadReport(val: string, name: string) {
messageError($q, err); messageError($q, err);
}); });
} }
const pagination = ref({
page: 1,
rowsPerPage: 10,
});
</script> </script>
<template> <template>
@ -537,14 +542,14 @@ async function onClickDownloadReport(val: string, name: string) {
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="posMaster" :rows="posMaster"
:paging="true"
row-key="id" row-key="id"
flat flat
bordered bordered
:paging="true"
dense dense
:rows-per-page-options="[10, 25, 50, 100]" :rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination" @update:pagination="updatePagination"
class="tableTb" v-model:pagination="pagination"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
@ -773,6 +778,7 @@ async function onClickDownloadReport(val: string, name: string) {
active-color="primary" active-color="primary"
color="dark" color="dark"
:max="totalPage" :max="totalPage"
:max-pages="5"
size="sm" size="sm"
boundary-links boundary-links
direction-links direction-links

View file

@ -84,7 +84,6 @@ async function fetchDataTree(id: string) {
*/ */
async function fetchDataTable(id: string, level: number, action: boolean) { async function fetchDataTable(id: string, level: number, action: boolean) {
searchAndReplaceOrgName(nodeTree.value, id); searchAndReplaceOrgName(nodeTree.value, id);
orgLevel.value = level; orgLevel.value = level;
reqMaster.id = id; reqMaster.id = id;
reqMaster.type = level; reqMaster.type = level;
@ -103,14 +102,12 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
: store.typeOrganizational == "current" : store.typeOrganizational == "current"
? store.activeId ? store.activeId
: store.historyId; : store.historyId;
}
if (action === true) {
isLoad.value = true; isLoad.value = true;
} }
await http await http
.post(config.API.orgPosMasterList, reqMaster) .post(config.API.orgPosMasterList, reqMaster)
.then((res) => { .then(async (res) => {
posMaster.value = []; posMaster.value = [];
const dataMain: PosMaster[] = []; const dataMain: PosMaster[] = [];
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize); totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
@ -123,7 +120,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
dataMain.push(test); dataMain.push(test);
} }
}); });
posMaster.value = store.fetchPosMaster(dataMain); posMaster.value = await store.fetchPosMaster(dataMain);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -132,7 +129,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
.finally(() => { .finally(() => {
setTimeout(() => { setTimeout(() => {
isLoad.value = false; isLoad.value = false;
}, 500); }, 1000);
}); });
} }

View file

@ -673,6 +673,7 @@ onMounted(async () => {
:options="Ops.levelOptions" :options="Ops.levelOptions"
option-value="id" option-value="id"
use-input use-input
clearable
input-debounce="0" input-debounce="0"
@filter="(inputValue:string, @filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'levelOptions' doneFn:Function) => filterSelector(inputValue, doneFn,'levelOptions'

View file

@ -210,6 +210,13 @@ const educationOption = ref([
{ label: "ไม่ใช่", value: false }, { label: "ไม่ใช่", value: false },
]); ]);
const educationOptionFilter = ref([
{ label: "ใช่", value: true },
{ label: "ไม่ใช่", value: false },
]);
let educationLevelOption: any = [];
const historyDialog = ref<boolean>(false); const historyDialog = ref<boolean>(false);
const educationData = reactive<RequestItemsObject>({ const educationData = reactive<RequestItemsObject>({
isDate: isDate.value === "false" ? false : true, isDate: isDate.value === "false" ? false : true,
@ -291,6 +298,20 @@ async function onSubmit() {
); );
} }
function filterSelector(val: string, update: Function, refData: string) {
switch (refData) {
case "options":
update(() => {
educationOption.value = educationOptionFilter.value.filter(
(v: any) => v.label.indexOf(val) > -1
);
});
break;
default:
break;
}
}
function clearForm() { function clearForm() {
isDate.value = "false"; isDate.value = "false";
educationData.educationLevel = ""; educationData.educationLevel = "";
@ -350,7 +371,23 @@ async function fetchData(id: string) {
.get(config.API.profileNewEducationByProfileId(id)) .get(config.API.profileNewEducationByProfileId(id))
.then(async (res) => { .then(async (res) => {
rows.value = res.data.result; rows.value = res.data.result;
console.log(rows.value); })
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
async function fetchEducationLevel() {
showLoader();
await http
.get(config.API.orgEducationLevel)
.then(async (res) => {
res.data.result.map((r: any) => {
educationLevelOption.push(r.name);
});
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -433,6 +470,7 @@ function deleteData(idData: string) {
onMounted(async () => { onMounted(async () => {
await fetchData(id.value); await fetchData(id.value);
fetchEducationLevel();
}); });
</script> </script>
@ -619,7 +657,6 @@ onMounted(async () => {
</q-card-actions> </q-card-actions>
<q-separator /> <q-separator />
<div class="row"> <div class="row">
{{ console.log(props) }}
<div class="col-3 q-pa-sm label-color">ระดบการศกษา</div> <div class="col-3 q-pa-sm label-color">ระดบการศกษา</div>
<div class="col-4 q-pa-sm">{{ props.cols[0].value }}</div> <div class="col-4 q-pa-sm">{{ props.cols[0].value }}</div>
<div class="col-2 q-pa-sm label-color">สถานศกษา</div> <div class="col-2 q-pa-sm label-color">สถานศกษา</div>
@ -714,14 +751,22 @@ onMounted(async () => {
<div class="col"> <div class="col">
<div class="row q-pa-md q-col-gutter-sm"> <div class="row q-pa-md q-col-gutter-sm">
<div class="col-6"> <div class="col-6">
<q-input <q-select
outlined outlined
v-model="educationData.educationLevel"
label="ระดับการศึกษา"
bg-color="white"
dense dense
:rules="[(val) => !!val || `${'กรุณากรอกระดับการศึกษา'}`]" emit-value
hide-bottom-space map-options
bg-color="white"
v-model="educationData.educationLevel"
:options="educationLevelOption"
input-debounce="0"
use-input
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'options'
) "
:rules="[(val) => !!val || `${'กรุณาเลือกระดับการศึกษา'}`]"
label="ระดับการศึกษา"
clearable
/> />
</div> </div>
<div class="col-6"> <div class="col-6">
@ -981,11 +1026,17 @@ onMounted(async () => {
dense dense
emit-value emit-value
map-options map-options
clearable
bg-color="white" bg-color="white"
v-model="educationData.isEducation" v-model="educationData.isEducation"
:options="educationOption" :options="educationOption"
option-value="value" option-value="value"
option-label="label" option-label="label"
input-debounce="0"
use-input
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'options'
) "
:rules="[ :rules="[
(val) => (val) =>
val !== null || `${'กรุณาเลือกวุฒิการศึกษาในตำแหน่ง'}`, val !== null || `${'กรุณาเลือกวุฒิการศึกษาในตำแหน่ง'}`,

View file

@ -11,6 +11,7 @@ import type { DataPerson } from "@/modules/04_registryNew/interface/response/Mai
import avatar from "@/assets/avatar_user.jpg"; import avatar from "@/assets/avatar_user.jpg";
import TabMain from "@/modules/04_registryNew/components/detail/TabMain.vue"; import TabMain from "@/modules/04_registryNew/components/detail/TabMain.vue";
import UploadFile from "@/modules/11_discipline/components/UploadFile.vue"; import UploadFile from "@/modules/11_discipline/components/UploadFile.vue";
import { ResponseObject } from "../interface/response/Profile";
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const $q = useQuasar(); const $q = useQuasar();
const router = useRouter(); const router = useRouter();
@ -26,7 +27,7 @@ const {
} = mixin; } = mixin;
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id.toString());
const formDetail = ref<any>(); const formDetail = ref<ResponseObject>();
const itemsMenu = ref<DataOption[]>([ const itemsMenu = ref<DataOption[]>([
{ {
id: "1", id: "1",
@ -217,7 +218,10 @@ onMounted(async () => {
<div class="col-sm-3 col-md-2"></div> <div class="col-sm-3 col-md-2"></div>
<div class="col"> <div class="col">
<div class="col-12 text-primary"> <div class="col-12 text-primary">
<h2 class="title q-ma-none q-pa-none"> <h2
class="title q-ma-none q-pa-none"
v-if="formDetail && formDetail.firstName && formDetail.lastName"
>
{{ {{
`${formDetail?.prefix}${formDetail?.firstName} ${formDetail?.lastName}` `${formDetail?.prefix}${formDetail?.firstName} ${formDetail?.lastName}`
}} }}
@ -249,19 +253,23 @@ onMounted(async () => {
<div class="col-2"> <div class="col-2">
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<div class="col text-grey-6">ตำแหนงในสายงาน</div> <div class="col text-grey-6">ตำแหนงในสายงาน</div>
<div class="col">{{ formDetail?.position }}</div> <div class="col">{{ formDetail?.position || "-" }}</div>
</div> </div>
</div> </div>
<div class="col-2"> <div class="col-2">
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<div class="col text-grey-6">ประเภทตำแหน</div> <div class="col text-grey-6">ประเภทตำแหน</div>
<div class="col">{{ formDetail?.posType.posTypeName }}</div> <div class="col">
{{ formDetail?.posType?.posTypeName || "-" }}
</div>
</div> </div>
</div> </div>
<div class="col-2"> <div class="col-2">
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<div class="col text-grey-6">ระดบตำแหน</div> <div class="col text-grey-6">ระดบตำแหน</div>
<div class="col">{{ formDetail?.posLevel.posLevelName }}</div> <div class="col">
{{ formDetail?.posLevel?.posLevelName || "-" }}
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -60,11 +60,11 @@ const itemsTabType = computed(() => {
name: "tab1", name: "tab1",
type: "PENDING", type: "PENDING",
}, },
{ // {
lable: "รายชื่อผู้เกษียณอายุราชการ", // lable: "",
name: "tab5", // name: "tab5",
type: "RETIRE", // type: "RETIRE",
}, // },
{ {
lable: "1 ขั้น", lable: "1 ขั้น",
name: "tab2", name: "tab2",
@ -251,12 +251,12 @@ function fetchDataQuota(id: string) {
*/ */
function fetchDataPeriod(id: string) { function fetchDataPeriod(id: string) {
rows.value = []; rows.value = [];
const formData = { let formData = {
page: formFilter.page.toString(), page: formFilter.page.toString(),
pageSize: formFilter.pageSize.toString(), pageSize: formFilter.pageSize.toString(),
keyword: formFilter.keyword, keyword: formFilter.keyword,
type: store.tabType === "RETIRE" ? "" : store.tabType, type: store.tabType,
isRetire: store.tabType === "RETIRE" ? "1" : null, isRetire: isRetire.value === true ? "1" : "0",
}; };
http http
@ -354,6 +354,12 @@ onMounted(() => {
fetchDataPeriod(store.groupId); fetchDataPeriod(store.groupId);
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
}); });
const isRetire = ref<boolean | string>(false);
const updateIsShowRetire = async () => {
isRetire.value = await !isRetire.value;
fetchDataPeriodNew();
};
</script> </script>
<template> <template>
@ -455,7 +461,19 @@ onMounted(() => {
<!-- Tab --> <!-- Tab -->
<q-card flat bordered> <q-card flat bordered>
<q-splitter v-model="splitterModel" disable> <div v-if="store.roundMainCode === 'OCT'" class="row col-12 q-pa-sm">
<q-toggle
dense
:model-value="isRetire"
color="primary"
@update:model-value="updateIsShowRetire"
class="q-pr-md"
>
เฉพาะผเกษยณอายราชการ
</q-toggle>
</div>
<q-splitter v-model="splitterModel" disable class="border-top">
<template v-slot:before> <template v-slot:before>
<q-tabs <q-tabs
v-model="store.tabType" v-model="store.tabType"
@ -471,13 +489,7 @@ onMounted(() => {
v-for="(item, index) in itemsTabType" v-for="(item, index) in itemsTabType"
:key="index" :key="index"
class="row" class="row"
:style=" :style="index === 0 ? 'border-bottom: 1px solid #c8d3db;' : ''"
store.roundMainCode === 'OCT'
? index === 1
? 'border-bottom: 1px solid #c8d3db;'
: ''
: ''
"
> >
<q-tab <q-tab
class="col-12" class="col-12"
@ -536,8 +548,10 @@ onMounted(() => {
width: 100%; width: 100%;
max-width: 200px; max-width: 200px;
} }
.q-tabs--vertical .q-tab { .q-tabs--vertical .q-tab {
padding: 0 20px; padding: 0 20px;
} }
.border-top {
border-top: 1px solid #ededed;
}
</style> </style>

View file

@ -65,11 +65,11 @@ const itemsTabType = computed(() => {
name: "tab1", name: "tab1",
type: "PENDING", type: "PENDING",
}, },
{ // {
lable: "รายชื่อผู้เกษียณอายุราชการ", // lable: "",
name: "tab5", // name: "tab5",
type: "RETIRE", // type: "RETIRE",
}, // },
{ {
lable: "1 ขั้น", lable: "1 ขั้น",
name: "tab2", name: "tab2",
@ -261,12 +261,12 @@ function fetchDataQuota(id: string) {
*/ */
function fetchDataPeriod(id: string) { function fetchDataPeriod(id: string) {
rows.value = []; rows.value = [];
const formData = { let formData = {
page: formFilter.page.toString(), page: formFilter.page.toString(),
pageSize: formFilter.pageSize.toString(), pageSize: formFilter.pageSize.toString(),
keyword: formFilter.keyword, keyword: formFilter.keyword,
type: store.tabType === "RETIRE" ? "" : store.tabType, type: store.tabType,
isRetire: store.tabType === "RETIRE" ? "1" : null, isRetire: isRetire.value === true ? "1" : "0",
}; };
http http
@ -336,10 +336,6 @@ function onClickDownload(data: DataOption) {
}); });
} else { } else {
if (props.rootId && props.periodId) { if (props.rootId && props.periodId) {
console.log("id==>", data.id);
console.log("rootId==>", props.rootId);
console.log("periodId==>", props.periodId);
http http
.get( .get(
config.API.salaryReportListsByid( config.API.salaryReportListsByid(
@ -368,6 +364,12 @@ onMounted(() => {
fetchDataPeriod(store.groupId); fetchDataPeriod(store.groupId);
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
}); });
const isRetire = ref<boolean>(false);
const updateIsShowRetire = async () => {
isRetire.value = await !isRetire.value;
fetchDataPeriodNew();
};
</script> </script>
<template> <template>
@ -538,7 +540,19 @@ onMounted(() => {
<!-- Tab --> <!-- Tab -->
<q-card flat bordered> <q-card flat bordered>
<q-splitter v-model="splitterModel" disable> <div v-if="store.roundMainCode === 'OCT'" class="row col-12 q-pa-sm">
<q-toggle
dense
:model-value="isRetire"
color="primary"
@update:model-value="updateIsShowRetire"
class="q-pr-md"
>
เฉพาะผเกษยณอายราชการ
</q-toggle>
</div>
<q-splitter v-model="splitterModel" disable class="border-top">
<template v-slot:before> <template v-slot:before>
<q-tabs <q-tabs
v-model="store.tabType" v-model="store.tabType"
@ -554,13 +568,7 @@ onMounted(() => {
v-for="(item, index) in itemsTabType" v-for="(item, index) in itemsTabType"
:key="index" :key="index"
class="row" class="row"
:style=" :style="index === 0 ? 'border-bottom: 1px solid #c8d3db;' : ''"
store.roundMainCode === 'OCT'
? index === 1
? 'border-bottom: 1px solid #c8d3db;'
: ''
: ''
"
> >
<q-tab <q-tab
class="col-12" class="col-12"
@ -619,11 +627,13 @@ onMounted(() => {
width: 100%; width: 100%;
max-width: 200px; max-width: 200px;
} }
.q-tabs--vertical .q-tab { .q-tabs--vertical .q-tab {
padding: 0 20px; padding: 0 20px;
} }
.tootip-txt-normal { .tootip-txt-normal {
font-size: 0.8rem; font-size: 0.8rem;
} }
.border-top {
border-top: 1px solid #ededed;
}
</style> </style>

View file

@ -101,7 +101,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
} }
await http await http
.post(config.API.orgPosMasterListEmp, reqMaster) .post(config.API.orgPosMasterListEmp, reqMaster)
.then((res) => { .then(async (res) => {
posMaster.value = []; posMaster.value = [];
const dataMain: PosMaster[] = []; const dataMain: PosMaster[] = [];
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize); totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
@ -114,7 +114,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
dataMain.push(test); dataMain.push(test);
} }
}); });
posMaster.value = store.fetchPosMaster(dataMain); posMaster.value = await store.fetchPosMaster(dataMain);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);