salary ==> ปรับ API

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-29 10:25:35 +07:00
parent 376a613b80
commit ac53080cec
7 changed files with 26 additions and 14 deletions

View file

@ -94,7 +94,8 @@ export default {
orgProfileEmp: `${orgEmployeePos}/profile`,
orgSearchProfileEmp: `${orgProfile}-employee/search`,
orgProfileById: (id: string, type: string) => `${orgProfile}${type}/${id}`,
orgProfileById: (id: string, type: string) =>
`${orgProfile}${type}/admin/${id}`,
orgDeceasedProfile: `${orgPos}/profile/search`,

View file

@ -128,6 +128,8 @@ export default {
`${registryNew}${type}/discipline/${disciplineId}`,
profileNewDisciplineHisByDisciplineId: (disciplineId: string, type: string) =>
`${registryNew}${type}/discipline/history/${disciplineId}`,
disciplineListCard: (profileId: string, type: string) =>
`${registryNew}${type}/discipline/admin/${profileId}`, // noPermission
// ปฏิบัติราชการพิเศษ
profileNewDuty: (type: string) => `${registryNew}${type}/duty`,
@ -153,6 +155,8 @@ export default {
`${registryNew}${type}/leave/history/${id}`,
profileCheckDate: () => `${env.API_URI}/leave/user/check`,
profileNewLeaveType: () => `${env.API_URI}/leave/type`,
leaveListCard: (id: string, type: string) =>
`${registryNew}${type}/leave/admin/${id}`, //noPermission
/** ตำแหน่งเงินเดือน*/
profileSalaryNew: (type: string) => `${registryNew}${type}/salary`,
@ -162,6 +166,8 @@ export default {
`${registryNew}${type}/salary/history/${profileId}`,
profileSalarySwapNew: (type: string, id: string, type2: string) =>
`${registryNew}${type2}/salary/swap/${type}/${id}`,
salaryListCard: (id: string, type: string) =>
`${registryNew}${type}/salary/admin/${id}`, //noPermission
// ประวัติการเปลี่ยนชื่อ-นามสกุล
profileNewChangeName: (type: string) => `${registryNew}${type}/changeName`,

View file

@ -4,6 +4,7 @@ import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermissionGet } from "@/utils/permissions";
/**
* importCOmponents
@ -48,12 +49,13 @@ function fetchInformation() {
showLoader();
http
.get(config.API.orgProfileById(profileId.value, props.employeeClass))
.then((res) => {
.then(async (res) => {
const data = res.data.result;
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
position.value = data.position;
if (data.avatarName) {
fetchProfile(data.id as string, data.avatarName);
await fetchProfile(data.id as string, data.avatarName);
}
})
.catch((err) => {
@ -133,7 +135,15 @@ watch(
<div class="q-mb-xs text-center text-grey" v-if="position">
{{ position }}
</div>
<div class="q-mt-md">
<div
class="q-mt-md"
v-if="
props.employeeClass === '-employee'
? checkPermissionGet('SYS_REGISTRY_EMP')
: checkPermissionGet('SYS_REGISTRY_OFFICER')
"
>
<q-btn
class="bg-white"
outline

View file

@ -103,12 +103,7 @@ const visibleColumns = ref<string[]>([
function fetchListDiscipline() {
showLoader();
http
.get(
config.API.profileNewDisciplineByProfileId(
profileId.value,
employeeClass.value
)
)
.get(config.API.disciplineListCard(profileId.value, employeeClass.value))
.then((res) => {
rows.value = res.data.result;
})

View file

@ -105,7 +105,7 @@ const visibleColumns = ref<string[]>([
function fetchListSalary() {
showLoader();
http
.get(config.API.profileNewLeaveById(profileId.value, employeeClass.value))
.get(config.API.leaveListCard(profileId.value, employeeClass.value))
.then((res) => {
rows.value = res.data.result;
})
@ -203,7 +203,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" >
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.id">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}

View file

@ -151,7 +151,7 @@ const visibleColumns = ref<string[]>([
function fetchListSalary() {
showLoader();
http
.get(config.API.profileListSalaryNew(profileId.value, employeeClass.value))
.get(config.API.salaryListCard(profileId.value, employeeClass.value))
.then((res) => {
rows.value = res.data.result;
})

View file

@ -43,7 +43,7 @@ export function checkPermissionList(sys: string[]) {
}
}
export function checkPermissionGet(sys: string[]) {
export function checkPermissionGet(sys: string ) {
if (storeMenu.permissions && sys) {
return (
storeMenu.permissions.roles.some(