Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-06-24 16:03:54 +07:00
commit dff282f0ef
11 changed files with 203 additions and 112 deletions

View file

@ -138,68 +138,99 @@ const API = {
};
const path = "http://localhost:3008";
const name = "";
const generatePopupPath = (routeName: any) => {
if (routeName.includes("metadata")) {
return `${path}/manual/chapter-2-admin-metadata`;
}
if (routeName.includes("KPI")) {
return `${path}/manual/chapter-3-admin-evaluate`;
}
if (routeName.includes("compete")) {
return `${path}/manual/chapter-10-admin-recruit`;
}
if (routeName.includes("registryNew")) {
return `${path}/manual/chapter-7-admin-registry`;
}
if (routeName.includes("registry")) {
return `${path}/manual/chapter-7-admin-registry`;
}
if (routeName.includes("registry-employee")) {
return `${path}/manual/chapter-8-admin-registry-employee`;
}
if (routeName.includes("qualify")) {
return `${path}/manual/chapter-10-admin-recruit`;
}
if (routeName.includes("insignia")) {
return `${path}/manual/chapter-14-admin-insignia`;
}
if (routeName.includes("resign")) {
return `${path}/manual/chapter-13-admin-retirement`;
}
if (routeName.includes("retirement")) {
return `${path}/manual/chapter-13-admin-retirement`;
}
if (routeName.includes("deceased")) {
return `${path}/manual/chapter-13-admin-retirement`;
}
if (routeName.includes("exit-Interview")) {
return `${path}/manual/chapter-13-admin-retirement`;
}
if (routeName.includes("expulsion")) {
return `${path}/manual/chapter-13-admin-retirement`;
}
if (routeName.includes("discharged")) {
return `${path}/manual/chapter-13-admin-retirement`;
}
if (routeName.includes("discipline")) {
return `${path}/manual/chapter-16-admin-discipline`;
}
if (routeName.includes("appeal")) {
return `${path}/manual/chapter-16-admin-discipline`;
}
if (routeName.includes("evaluate")) {
return `${path}/manual/chapter-17-admin-KPI`;
}
if (routeName.includes("salary")) {
return `${path}/manual/chapter-18-admin-salary`;
}
if (routeName.includes("development")) {
return `${path}/manual/chapter-20-admin-development`;
} else {
return manualConfig[routeName as keyof typeof manualConfig];
}
};
const manualConfig = {
"/": `${path}/`,
"/KPI-indicator-plan": `${path}/manual/chapter-3-admin-evaluate`,
"/KPI-indicator-role": `${path}/manual/chapter-3-admin-evaluate`,
"/assignment": `${path}/manual/chapter-3-admin-evaluate`,
"/KPI-competency": `${path}/manual/chapter-3-admin-evaluate`,
"/strategic": `${path}/manual/chapter-3-admin-evaluate`,
"/organization-new": `${path}/manual/chapter-4-admin-organization`,
"/registry-new": `${path}/manual/chapter-7-admin-registry`,
"/registry-employee": `${path}/manual/chapter-8-admin-registry-employee`,
"/order": `${path}/manual/chapter-9-admin-order`,
"/compete/period": `${path}/manual/chapter-10-admin-recruit`,
"/compete/period/stat": `${path}/manual/chapter-10-admin-recruit`,
"/qualify/period": `${path}/manual/chapter-10-admin-recruit`,
"/disable/period": `${path}/manual/chapter-10-admin-recruit`,
"/qualify/manage": `${path}/manual/chapter-10-admin-recruit`,
"/qualify/period/stat": `${path}/manual/chapter-10-admin-recruit`,
"/qualify/disable/stat": `${path}/manual/chapter-10-admin-recruit`,
"/placement": `${path}/manual/chapter-11-admin-appointment`,
"/transfer": `${path}/manual/chapter-11-admin-appointment`,
"/receive": `${path}/manual/chapter-11-admin-appointment`,
"/help-government": `${path}/manual/chapter-11-admin-appointment`,
"/repatriate": `${path}/manual/chapter-11-admin-appointment`,
"/appoint-promote": `${path}/manual/chapter-11-admin-appointment`,
"/appoint-employee": `${path}/manual/chapter-11-admin-appointment`,
"/other": `${path}/manual/chapter-11-admin-appointment`,
"/probation": `${path}/manual/chapter-12-admin-probation`,
"/retirement": `${path}/manual/chapter-13-admin-retirement`,
"/retirement/resign": `${path}/manual/chapter-13-admin-retirement`,
"/exit-Interview": `${path}/manual/chapter-13-admin-retirement`,
"/deceased": `${path}/manual/chapter-13-admin-retirement`,
"/dismiss-order": `${path}/manual/chapter-13-admin-retirement`,
"/insignia/round-proposals": `${path}/manual/chapter-14-admin-insignia`,
"/insignia/manage/list-manage": `${path}/manual/chapter-14-admin-insignia`,
"/insignia/record": `${path}/manual/chapter-14-admin-insignia`,
"/insignia/allocate": `${path}/manual/chapter-14-admin-insignia`,
"/insignia/borrow": `${path}/manual/chapter-14-admin-insignia`,
"/insignia/report": `${path}/manual/chapter-14-admin-insignia`,
"/discipline/complaints": `${path}/manual/chapter-16-admin-discipline`,
"/discipline/investigatefacts": `${path}/manual/chapter-16-admin-discipline`,
"/discipline/disciplinary": `${path}/manual/chapter-16-admin-discipline`,
"/discipline-result": `${path}/manual/chapter-16-admin-discipline`,
"/discipline-suspend": `${path}/manual/chapter-16-admin-discipline`,
"/discipline-appealcomplain": `${path}/manual/chapter-16-admin-discipline`,
"/discipline-order": `${path}/manual/chapter-16-admin-discipline`,
"/discipline/director": `${path}/manual/chapter-16-admin-discipline`,
"/discipline/channel": `${path}/manual/chapter-16-admin-discipline`,
"/evaluate": `${path}/manual/chapter-17-admin-KPI`,
"/evaluate/director": `${path}/manual/chapter-17-admin-KPI`,
"/evaluate/meeting": `${path}/manual/chapter-17-admin-KPI`,
"/salary": `${path}/manual/chapter-18-admin-salary`,
"/salary-employee": `${path}/manual/chapter-18-admin-salary`,
"/salary/round": `${path}/manual/chapter-18-admin-salary`,
"/salary/lists": `${path}/manual/chapter-18-admin-salary`,
"/salary-employee/lists": `${path}/manual/chapter-18-admin-salary`,
"/salary/command": `${path}/manual/chapter-18-admin-salary`,
"/development": `${path}/manual/chapter-20-admin-development`,
"/development/history": `${path}/manual/chapter-20-admin-development`,
"/development/employee-history": `${path}/manual/chapter-20-admin-development`,
"/development/scholarship": `${path}/manual/chapter-20-admin-development`,
dashboard: `${path}/`,
strategic: `${path}/manual/chapter-3-admin-evaluate`,
organizationNew: `${path}/manual/chapter-4-admin-organization`,
organization: `${path}/manual/chapter-7-admin-registry`,
order: `${path}/manual/chapter-9-admin-order`,
OrderDetail: `${path}/manual/chapter-9-admin-order`,
OrderAdd: `${path}/manual/chapter-9-admin-order`,
disableperiod: `${path}/manual/chapter-10-admin-recruit`,
manage: `${path}/manual/chapter-10-admin-recruit`,
editorweb: `${path}/manual/chapter-10-admin-recruit`,
manageDetaill: `${path}/manual/chapter-10-admin-recruit`,
ExamForm: `${path}/manual/chapter-10-admin-recruit`,
Payment: `${path}/manual/chapter-10-admin-recruit`,
placement: `${path}/manual/chapter-11-admin-appointment`,
transfer: `${path}/manual/chapter-11-admin-appointment`,
receive: `${path}/manual/chapter-11-admin-appointment`,
"help-government": `${path}/manual/chapter-11-admin-appointment`,
repatriate: `${path}/manual/chapter-11-admin-appointment`,
"appoint-promote": `${path}/manual/chapter-11-admin-appointment`,
"appoint-employee": `${path}/manual/chapter-11-admin-appointment`,
other: `${path}/manual/chapter-11-admin-appointment`,
probation: `${path}/manual/chapter-12-admin-probation`,
retirement: `${path}/manual/chapter-13-admin-retirement`,
resign: `${path}/manual/chapter-13-admin-retirement`,
ExitInterviewEditQuestion: `${path}/manual/chapter-13-admin-retirement`,
"dismiss-order": `${path}/manual/chapter-13-admin-retirement`,
"report-report": `${path}/manual/chapter-14-admin-insignia`,
"report-report-01": `${path}/manual/chapter-14-admin-insignia`,
appealComplain: `${path}/manual/chapter-16-admin-discipline`,
};
export default {
@ -209,4 +240,5 @@ export default {
qualifyExamPanel,
s3ClusterUrl,
manualConfig,
generatePopupPath,
};

View file

@ -344,8 +344,6 @@ async function getActive() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}

View file

@ -898,37 +898,6 @@ onMounted(async () => {
>
<q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 180px">
<q-item
v-if="
roleAdmin &&
props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM'
"
clickable
v-close-popup
@click="
openAppointModal(
props.row.personalId,
props.row,
'APPOINTED'
)
"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="primary"
size="xs"
name="mdi-bookmark-outline"
/>
</q-item-section>
<q-item-section
>เลอกหนวยงานทบบรรจและแตงต</q-item-section
>
</q-item>
<q-item
v-if="
props.row.nodeName !== null &&
@ -1010,6 +979,38 @@ onMounted(async () => {
<q-item-section>เลอกหนวยงานทบแตงต</q-item-section>
</q-item>
<q-item
v-if="
roleAdmin &&
props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM'
"
clickable
v-close-popup
@click="
openAppointModal(
props.row.personalId,
props.row,
'APPOINTED'
)
"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="primary"
size="xs"
name="mdi-bookmark-outline"
/>
</q-item-section>
<q-item-section
>เลอกหนวยงานทบบรรจและแตงต</q-item-section
>
</q-item>
<q-item
v-if="
props.row.bmaOfficer !== 'บุคคลภายนอก' &&

View file

@ -66,7 +66,7 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) {
return `${row.prefix}${row.firstName} ${row.lastName}`;
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
},
},
{
@ -78,7 +78,11 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return row.positionTypeOld + " (" + row.positionLevelOld + ")";
return row.positionTypeOld
? `${row.positionTypeOld}${
row.positionLevelOld ? `(${row.positionLevelOld})` : ""
}`
: "";
},
},
{
@ -257,6 +261,7 @@ onMounted(async () => {
</div>
<div v-else>
{{}}
{{
col.value == null ? "" : col.value == "" ? "-" : col.value
}}

View file

@ -222,7 +222,7 @@ onMounted(async () => {
<q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-select
class="col-10"
class="col-10 inputgreen"
dense
outlined
v-model="roundInsig"
@ -236,7 +236,7 @@ onMounted(async () => {
<datepicker
menu-class-name="modalfix"
v-model="yearly"
class="col-2"
class="col-2 inputgreen"
:locale="'th'"
autoApply
year-picker
@ -271,7 +271,7 @@ onMounted(async () => {
v-model="dateStart"
:locale="'th'"
autoApply
class="col-xs-12 col-sm-5"
class="col-xs-12 col-sm-5 inputgreen"
borderless
:enableTimePicker="false"
week-start="0"
@ -307,7 +307,7 @@ onMounted(async () => {
<datepicker
menu-class-name="modalfix"
v-model="dateEnd"
class="col-xs-12 col-sm-5"
class="col-xs-12 col-sm-5 inputgreen"
:locale="'th'"
autoApply
borderless
@ -344,7 +344,7 @@ onMounted(async () => {
</datepicker>
<q-input
class="col-xs-12 col-sm-2"
class="col-xs-12 col-sm-2 inputgreen"
dense
outlined
v-model="datelast"
@ -358,7 +358,7 @@ onMounted(async () => {
/>
<q-file
class="col-xs-12 col-sm-10"
class="col-xs-12 col-sm-10 inputgreen"
outlined
dense
v-model="files"

View file

@ -922,6 +922,7 @@ onMounted(async () => {
<q-space />
<div>
<q-btn
:disable="DataStore.employeeClass === 'all'|| DataStore.typeinsignia === 'all'"
size="md"
icon="mdi-download"
flat

View file

@ -90,6 +90,9 @@ async function fetchLeaveday(
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}

View file

@ -2,6 +2,8 @@ interface dataPost {
cardId: string;
firstName: string;
lastName: string;
page: number;
pageSize: number;
}
interface DataOption {

View file

@ -127,6 +127,10 @@ export const useChangeRoundDataStore = defineStore(
console.log(profileId);
profileId.value = id;
}
const maxPageMain = ref<number>(0);
const totalListMain = ref<number>(0);
function fetchDataForCardId(dataDetail: any) {
if (dataDetail) {
showLoader();
@ -141,6 +145,10 @@ export const useChangeRoundDataStore = defineStore(
})
.then((res) => {
const apiData = res.data.result.data;
totalListMain.value = res.data.result.total;
maxPageMain.value = Math.ceil(
totalListMain.value / dataDetail.pageSize
);
if (apiData.length > 0) {
checkCilck.value = false;
rows.value = apiData.map((e: any) => ({
@ -238,6 +246,9 @@ export const useChangeRoundDataStore = defineStore(
changePage,
total,
maxPage,
totalListMain,
maxPageMain,
};
}
);

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { ref, watch, reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -38,6 +38,8 @@ const formData = reactive<dataPost>({
cardId: "",
firstName: "",
lastName: "",
page: 1,
pageSize: 10,
});
/**
@ -88,7 +90,7 @@ function closeDialog() {
modalFix.value = false;
}
function save() {
function save() {
dialogConfirm($q, async () => {
showLoader();
await http
@ -102,12 +104,28 @@ function save() {
messageError($q, err);
})
.finally(() => {
hideLoader();
closeDialog();
hideLoader();
});
});
}
/**
* function updatePagination
* @param newPagination อม Pagination ใหม
*/
function updatePagination(newPagination: any) {
formData.page = 1;
formData.pageSize = newPagination.rowsPerPage;
}
watch(
() => formData.pageSize,
() => {
searchData();
}
);
/** Function ค้นหาข้อมูล */
function searchData() {
if (formData.cardId || formData.firstName || formData.lastName) {
@ -154,7 +172,7 @@ function searchData() {
hide-bottom-space
/>
<q-btn
@click="searchData"
@click="(formData.page = 1), searchData()"
for="#search"
dense
unelevated
@ -185,6 +203,8 @@ function searchData() {
dense
class="custom-header-table"
:visible-columns="dataStore.visibleColumns"
:rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination"
>
<!-- :paging="true" -->
<template v-slot:header="props">
@ -254,6 +274,20 @@ function searchData() {
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ dataStore.totalListMain }} รายการ
<q-pagination
v-model="formData.page"
active-color="primary"
color="dark"
:max="Number(dataStore.maxPageMain)"
size="sm"
boundary-links
direction-links
:max-pages="5"
@update:model-value="dataStore.fetchDataForCardId(formData)"
></q-pagination>
</template>
</d-table>
</div>
</q-card>

View file

@ -476,13 +476,15 @@ watch(
);
const handleButtonClick = () => {
const currentPath = route.path;
const popupPath =
config.manualConfig[currentPath as keyof typeof config.manualConfig];
const currentPath = route.name;
// const popupPath =
// config.manualConfig[currentPath as keyof typeof config.manualConfig];
const popupPath = config.generatePopupPath(currentPath);
if (popupPath) {
// console.log(currentPath);
window.open(popupPath);
} else {
alert("No mapping found for this route");
console.log("no manual in this page ", currentPath);
}
};
</script>
@ -529,11 +531,13 @@ const handleButtonClick = () => {
dense
flat
size="13px"
class="q-mx-md bg-grey-3"
class="bg-grey-3"
:color="totalNoti === 0 ? 'grey-6' : 'grey-8'"
@click="handleButtonClick()"
style="margin-right: 10px"
>
<q-icon name="mdi-book" size="18px" color="grey-7" />
<q-icon name="mdi-book-open-variant" size="18px" color="grey-7" />
<q-tooltip></q-tooltip>
</q-btn>
<!-- Notification -->
<q-btn
@ -541,7 +545,7 @@ const handleButtonClick = () => {
dense
flat
size="13px"
class="q-mx-md bg-grey-3"
class="bg-grey-3"
:color="totalNoti === 0 ? 'grey-6' : 'grey-8'"
>
<q-icon name="mdi-bell" size="18px" color="grey-7" />