Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
1333e53c63
24 changed files with 658 additions and 463 deletions
|
|
@ -16,6 +16,7 @@ const personId = ref<string>("");
|
|||
/** Use */
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "retirementidDetail");
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -455,6 +456,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
:profile-id="profileId"
|
||||
:UpdateListId="UpdateListId"
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
statusReport === false &&
|
||||
(typeReport == 'ADD' || typeReport == '' || typeReport == null) &&
|
||||
statusUpload !== true
|
||||
|
|
@ -471,7 +473,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
(modalUpload = true), (signDate = null), (fileUpload = null)
|
||||
"
|
||||
target="_blank"
|
||||
v-if="statusUpload !== true"
|
||||
v-if="statusUpload !== true && !checkRoutePermisson"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="attach_file"
|
||||
|
|
@ -479,6 +481,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
<q-item-section>อัปโหลดไฟล์ </q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="!checkRoutePermisson"
|
||||
clickable
|
||||
v-close-popup
|
||||
type="a"
|
||||
|
|
@ -490,7 +493,7 @@ function updatemodalPersonal(modal: boolean) {
|
|||
/></q-item-section>
|
||||
<q-item-section>แก้ไข มติ อ.ก.ก. </q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-separator v-if="!checkRoutePermisson" />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -591,26 +594,6 @@ function updatemodalPersonal(modal: boolean) {
|
|||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'EDIT' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false &&
|
||||
statusUpload !== true
|
||||
"
|
||||
/>
|
||||
<q-th
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'REMOVE' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false &&
|
||||
statusUpload !== true
|
||||
"
|
||||
/>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div class="text-grey-7 text-weight-medium">
|
||||
<span class="row">{{ col.title }}</span>
|
||||
|
|
@ -619,19 +602,20 @@ function updatemodalPersonal(modal: boolean) {
|
|||
}}</span>
|
||||
</div>
|
||||
</q-th>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
:style="props.row.profileId === profileId && 'color: #26a69a;'"
|
||||
@click.stop="onclickViewinfo(props.row.profileId)"
|
||||
|
||||
>
|
||||
<q-td auto-width>
|
||||
<q-td auto-width>
|
||||
<q-btn flat round dense icon="mdi-eye" color="info" @click.stop="onclickViewinfo(props.row.profileId)">
|
||||
<q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
v-if="!checkRoutePermisson&&
|
||||
(props.row.remove === 'EDIT' ||
|
||||
props.row.remove === 'REMOVE') &&
|
||||
statusUpload
|
||||
|
|
@ -649,18 +633,15 @@ function updatemodalPersonal(modal: boolean) {
|
|||
"
|
||||
><q-tooltip>ข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-td>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'EDIT' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false &&
|
||||
statusUpload !== true
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
(typeReport === 'EDIT' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false &&
|
||||
statusUpload !== true
|
||||
"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
|
|
@ -675,21 +656,18 @@ function updatemodalPersonal(modal: boolean) {
|
|||
>
|
||||
<q-tooltip>กรอกเหตุผล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="
|
||||
(typeReport === 'REMOVE' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false &&
|
||||
statusUpload !== true
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
(typeReport === 'REMOVE' ||
|
||||
typeReport === null ||
|
||||
typeReport === '') &&
|
||||
statusReport === false &&
|
||||
statusUpload !== true
|
||||
"
|
||||
flat
|
||||
round
|
||||
class="text-red-14"
|
||||
color="red"
|
||||
:icon="props.row.remove === 'REMOVE' ? 'info' : 'mdi-delete'"
|
||||
dense
|
||||
@click.stop="
|
||||
|
|
@ -727,8 +705,6 @@ function updatemodalPersonal(modal: boolean) {
|
|||
<q-td class="table_ellipsis" key="organization" :props="props">{{
|
||||
props.row.organization ? props.row.organization : "-"
|
||||
}}</q-td>
|
||||
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ const cerateRetirement = async (data: object) => {
|
|||
@click="clickAdd"
|
||||
:disable="checkjson"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 450px; max-width: 80vw">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
const Main = () => import("@/modules/06_retirement/views/Main.vue");
|
||||
const Listretirement = () =>
|
||||
import("@/modules/06_retirement/components/ListRetirement/TableList.vue");
|
||||
const ListretirementDetail = () =>
|
||||
import("@/modules/06_retirement/components/ListRetirement/TableList.vue");
|
||||
// const resignOrder = () =>
|
||||
// import("@/modules/06_retirement/components/resign/ResignOrder.vue");
|
||||
const resign = () =>
|
||||
|
|
@ -60,6 +62,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement-detail/:retirementId",
|
||||
name: "retirementidDetail",
|
||||
component: ListretirementDetail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RETIREMENT",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/listretire/:id/:type",
|
||||
name: "retirement/list/id/type",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import type { resMain } from "@/modules/06_retirement/interface/response/Main";
|
|||
import { storeToRefs } from "pinia";
|
||||
import popupAdd from "../components/ListRetirement/popupAdd.vue";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const useStoreRetire = useDataStoreRetirement();
|
||||
const { clickTab } = useStoreRetire;
|
||||
const { tab, type } = storeToRefs(useDataStoreRetirement());
|
||||
|
|
@ -195,6 +197,9 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
const nextPage = (prop: any) => {
|
||||
router.push(`/retirement/${prop.id}`);
|
||||
};
|
||||
const nextPageDetail = (prop: any) => {
|
||||
router.push(`/retirement-detail/${prop.id}`);
|
||||
};
|
||||
|
||||
watch(type, () => {
|
||||
fetchRetirement(type.value, currentYear);
|
||||
|
|
@ -278,7 +283,7 @@ const typeReportChangeName = (val: string) => {
|
|||
</q-select>
|
||||
|
||||
<!-- use-input -->
|
||||
<div>
|
||||
<div v-if="checkPermission($route)?.attrIsCreate">
|
||||
<popupAdd
|
||||
:type="useStoreRetire.type"
|
||||
:year="fiscalyear"
|
||||
|
|
@ -345,6 +350,7 @@ const typeReportChangeName = (val: string) => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width> </q-th>
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
|
|
@ -355,11 +361,34 @@ const typeReportChangeName = (val: string) => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-eye"
|
||||
color="info"
|
||||
@click="nextPageDetail(props.row)"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="edit"
|
||||
color="edit"
|
||||
@click="nextPage(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import moment from "moment";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
/** importType*/
|
||||
import type {
|
||||
DataDateMonthObject,
|
||||
|
|
@ -292,11 +292,11 @@ const monthYearThai = (val: DataDateMonthObject) => {
|
|||
<template v-slot:eventContent="arg">
|
||||
<div
|
||||
class="row col-12 items-center no-wrap"
|
||||
:style="`background: + ${arg.event.color}`"
|
||||
:style="checkPermission($route)?.attrIsGet ? `background: + ${arg.event.color}`:`background: + ${arg.event.color};pointer-events: none;cursor: auto;`"
|
||||
>
|
||||
<div
|
||||
class="textHover col-10"
|
||||
@click="redirectToDetail(arg.event.id)"
|
||||
@click="checkPermission($route)?.attrIsGet ? redirectToDetail(arg.event.id):''"
|
||||
>
|
||||
{{ arg.event.title }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -96,9 +96,7 @@ async function fetchOption() {
|
|||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
|
||||
});
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -109,7 +107,8 @@ onMounted(async () => {
|
|||
watch(
|
||||
() => leaveStore.tabView,
|
||||
async () => {
|
||||
leaveStore.tabView === "list" && (await fecthLeaveList());
|
||||
leaveStore.tabView === "list" &&
|
||||
(await fecthLeaveList(), await fetchOption());
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
import { ref, onMounted, watch } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** importStores*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -240,20 +241,19 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
|
||||
function convert(val: any) {
|
||||
const filtertype = props.dataToobar?.find(
|
||||
(e: any) => e.id === val.leaveTypeId
|
||||
);
|
||||
const type = filtertype?.code;
|
||||
if(type == 'LV-006'&&val.hajjDayStatus == false){
|
||||
return 'ลาอุปสมบท'
|
||||
}else if(type == 'LV-006'&&val.hajjDayStatus == true){
|
||||
return 'ลาประกอบพิธีฮัจญ์'
|
||||
}else{
|
||||
return val.leaveTypeName
|
||||
}
|
||||
(e: any) => e.id === val.leaveTypeId
|
||||
);
|
||||
const type = filtertype?.code;
|
||||
if (type == "LV-006" && val.hajjDayStatus == false) {
|
||||
return "ลาอุปสมบท";
|
||||
} else if (type == "LV-006" && val.hajjDayStatus == true) {
|
||||
return "ลาประกอบพิธีฮัจญ์";
|
||||
} else {
|
||||
return val.leaveTypeName;
|
||||
}
|
||||
}
|
||||
/** Hook*/
|
||||
onMounted(() => {
|
||||
|
||||
if (leaveStore.tabMenu === "1") {
|
||||
leaveStore.visibleColumns = visibleColumnsLeave.value;
|
||||
leaveStore.columns = columnsLeave.value;
|
||||
|
|
@ -282,19 +282,28 @@ onMounted(() => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width> </q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click.prevent="redirectToDetail(props.row.id)"
|
||||
>
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-eye"
|
||||
color="info"
|
||||
@click.prevent="redirectToDetail(props.row.id)"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{
|
||||
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
/** importType*/
|
||||
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<q-space />
|
||||
<div class="q-py-xs">
|
||||
<q-btn flat round color="primary" icon="download">
|
||||
<q-btn flat round color="primary" icon="download" v-if="checkPermission($route)?.attrIsGet">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import Dialogform from "@/modules/09_leave/components/4_ChangeRound/DialogForm.v
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useChangeRoundDataStore } from "@/modules/09_leave/stores/ChangeRoundStore";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** useStore */
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -147,6 +149,7 @@ function searchData() {
|
|||
</div>
|
||||
<div class="row justify-between q-gutter-y-sm">
|
||||
<q-input
|
||||
:readonly="!checkPermission($route)?.attrIsGet"
|
||||
v-model="formData.cardId"
|
||||
outlined
|
||||
label="เลขประจำตัวประชาชน"
|
||||
|
|
@ -156,6 +159,7 @@ function searchData() {
|
|||
maxlength="13"
|
||||
/>
|
||||
<q-input
|
||||
:readonly="!checkPermission($route)?.attrIsGet"
|
||||
v-model="formData.firstName"
|
||||
outlined
|
||||
label="ชื่อ"
|
||||
|
|
@ -164,6 +168,7 @@ function searchData() {
|
|||
hide-bottom-space
|
||||
/>
|
||||
<q-input
|
||||
:readonly="!checkPermission($route)?.attrIsGet"
|
||||
v-model="formData.lastName"
|
||||
outlined
|
||||
label="นามสกุล"
|
||||
|
|
@ -172,6 +177,7 @@ function searchData() {
|
|||
hide-bottom-space
|
||||
/>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
@click="(formData.page = 1), searchData()"
|
||||
for="#search"
|
||||
dense
|
||||
|
|
@ -221,47 +227,67 @@ function searchData() {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<div>
|
||||
<q-btn
|
||||
flat
|
||||
icon="mdi-dots-vertical"
|
||||
color="grey-8"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
color="secondary"
|
||||
for="#cancel"
|
||||
dense
|
||||
round
|
||||
unelevated
|
||||
>
|
||||
<q-menu>
|
||||
<q-list>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="Openmodal('edit', props.row)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-icon
|
||||
color="primary"
|
||||
name="mdi-shuffle-variant"
|
||||
size="xs"
|
||||
/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>เปลี่ยนรอบการลงเวลา</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="OpenmodalFix(props.row)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-icon color="edit" name="edit" size="xs" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>แก้ไขปฏิทินวันทำงาน</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="Openmodal('history', props.row)"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar>
|
||||
<q-icon
|
||||
color="deep-purple"
|
||||
name="mdi-history"
|
||||
size="xs"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>ประวัติการเปลี่ยนรอบ</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="OpenmodalFix(props.row)"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>แก้ไขปฏิทินวันทำงาน</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import DialogApprove from "@/modules/09_leave/components/4_specialTime/DialogApp
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useSpecialTimeStore } from "@/modules/09_leave/stores/SpecialTimeStore";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const dataSpecialTime = useSpecialTimeStore();
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -297,10 +299,14 @@ const monthYearThai = (val: any) => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width class="text-right">
|
||||
<q-btn
|
||||
v-if="props.row.status == 'PENDING'"
|
||||
v-if="
|
||||
props.row.status == 'PENDING' &&
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet
|
||||
"
|
||||
color="orange"
|
||||
class="q-px-md"
|
||||
dense
|
||||
|
|
@ -310,7 +316,11 @@ const monthYearThai = (val: any) => {
|
|||
>
|
||||
|
||||
<q-btn
|
||||
v-if="props.row.status == 'PENDING'"
|
||||
v-if="
|
||||
props.row.status == 'PENDING' &&
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet
|
||||
"
|
||||
color="primary"
|
||||
class="q-px-md q-ml-sm"
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ const title = computed(() => {
|
|||
? "เพิ่มผังบัญชีเงินเดือน"
|
||||
: props.typeAction === "edit"
|
||||
? "แก้ไขผังบัญชีเงินเดือน"
|
||||
: props.typeAction === "view"
|
||||
? "รายละเอียด"
|
||||
: "บัญชีเงินเดือน";
|
||||
|
||||
return name;
|
||||
|
|
@ -131,7 +133,7 @@ function fetchSalaryDetail(id: string) {
|
|||
formData.endDate = data.endDate;
|
||||
formData.details = data.details;
|
||||
formData.isSpecial = data.isSpecial;
|
||||
isReadonly.value = data.isActive;
|
||||
isReadonly.value = props.typeAction === 'view'? true: data.isActive;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -150,7 +152,7 @@ watch(
|
|||
if (modal.value) {
|
||||
await fetchPosType();
|
||||
|
||||
if (props.typeAction === "edit") {
|
||||
if (props.typeAction === "edit" || props.typeAction === "view") {
|
||||
showLoader();
|
||||
setTimeout(() => {
|
||||
if (props.data) {
|
||||
|
|
@ -522,7 +524,7 @@ const getClass = (val: boolean) => {
|
|||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-card-actions align="right" v-if="!isReadonly">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import Header from "@/components/DialogHeader.vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError, success } =
|
||||
|
|
@ -39,6 +38,7 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const isReadonly = ref<boolean>(false);
|
||||
const salaryId = ref<string>(route.params.id.toString());
|
||||
const formData = reactive<FormSalaryRate>({
|
||||
salaryId: "",
|
||||
|
|
@ -170,6 +170,17 @@ watch(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
||||
*/
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -184,6 +195,8 @@ watch(
|
|||
<div class="row col-xs-12 col-md-12 q-col-gutter-sm">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -201,6 +214,8 @@ watch(
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryHalfRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -215,6 +230,8 @@ watch(
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryHalfSpecialRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -228,6 +245,8 @@ watch(
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryFullRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -242,6 +261,8 @@ watch(
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryFullSpecialRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -255,6 +276,8 @@ watch(
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryFullHalfRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -269,6 +292,8 @@ watch(
|
|||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryFullHalfSpecialRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -238,7 +239,7 @@ watch(
|
|||
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card class="col-12" style="width: 80%">
|
||||
<q-card class="col-12" style="width: 40%">
|
||||
<Header :tittle="`อัปโหลดเอกสารอ้างอิง`" :close="closeDialog" />
|
||||
<q-separator />
|
||||
<q-card-section class="scroll" style="max-height: 70vh">
|
||||
|
|
@ -249,7 +250,10 @@ watch(
|
|||
<div class="col-12 row">
|
||||
<div v-if="!props.isActive" class="full-width">
|
||||
<q-file
|
||||
v-if="props.typeAction === 'edit'"
|
||||
v-if="
|
||||
props.typeAction === 'edit' &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -301,7 +305,12 @@ watch(
|
|||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-if="!props.isActive">
|
||||
<div
|
||||
v-if="
|
||||
!props.isActive &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ const {
|
|||
|
||||
/** props*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const activeType = defineModel<string>("activeType", { required: true });
|
||||
|
||||
const props = defineProps({
|
||||
isStatusEdit: { type: Boolean, required: true },
|
||||
data: { type: Object, required: true },
|
||||
|
|
@ -65,7 +67,7 @@ function fetchSalaryDetail(id: string) {
|
|||
formData.startDate = data.startDate;
|
||||
formData.endDate = data.endDate;
|
||||
formData.details = data.details;
|
||||
isReadonly.value = data.isActive ? true : false;
|
||||
isReadonly.value = activeType.value === "view" ? true : data.isActive;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -84,9 +86,9 @@ function onSubmit() {
|
|||
? config.API.salaryEmployeeChart
|
||||
: config.API.salaryEmployeeChartByid(props.data.id);
|
||||
await http[!props.isStatusEdit ? "post" : "put"](url, formData);
|
||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
props.fetchData?.();
|
||||
await props.fetchData?.();
|
||||
closeDialog();
|
||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
|
|
@ -150,7 +152,9 @@ const getClass = (val: boolean) => {
|
|||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<Header
|
||||
:tittle="
|
||||
props.isStatusEdit
|
||||
props.isStatusEdit && activeType === 'view'
|
||||
? 'รายละเอียด'
|
||||
: props.isStatusEdit
|
||||
? 'แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ'
|
||||
: 'เพิ่มผังบัญชีค่าจ้างลูกจ้างประจำ'
|
||||
"
|
||||
|
|
@ -359,12 +363,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="บันทึก"
|
||||
color="secondary"
|
||||
type="submit"
|
||||
:disable="isReadonly"
|
||||
<q-card-actions align="right" v-if="!isReadonly">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
|
|
|
|||
|
|
@ -117,6 +117,19 @@ watch(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
const isReadonly = ref<boolean>(false);
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
||||
*/
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -135,6 +148,8 @@ watch(
|
|||
<div class="row col-xs-12 col-md-12 q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryNoRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -154,6 +169,8 @@ watch(
|
|||
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryMonthRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -172,6 +189,8 @@ watch(
|
|||
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="isReadonly"
|
||||
:class="getClass(!isReadonly)"
|
||||
ref="salaryDayRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -207,7 +208,12 @@ watch(
|
|||
<div class="col-xs-12 col-md-3">
|
||||
<div class="row col-12 q-col-gutter-y-sm">
|
||||
<div class="col-12 row">
|
||||
<div v-if="!props.isActive" class="full-width">
|
||||
<div
|
||||
v-if="
|
||||
!props.isActive && checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
class="full-width"
|
||||
>
|
||||
<q-file
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -260,7 +266,12 @@ watch(
|
|||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-if="!props.isActive">
|
||||
<div
|
||||
v-if="
|
||||
!props.isActive &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ const { dialogConfirm, showLoader, hideLoader, messageError, success } =
|
|||
|
||||
/** props*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const actionsType = defineModel<string>("actionsType", { default: "" });
|
||||
const isEdit = defineModel<boolean>("isStatusEdit", { required: true });
|
||||
const props = defineProps({
|
||||
data: {
|
||||
|
|
@ -39,6 +40,7 @@ const groupOldOp = ref<DataOptions[]>([]);
|
|||
const groupOldOpMain = ref<DataOptions[]>([]);
|
||||
const posLevelOp = ref<any[]>([]);
|
||||
const posNameListOp = ref<DataListOptions[]>([]);
|
||||
const isReadonly = ref<boolean>(false);
|
||||
|
||||
const formData = reactive<any>({
|
||||
id: "",
|
||||
|
|
@ -104,10 +106,10 @@ function onSubmit() {
|
|||
? config.API.salaryFormula()
|
||||
: config.API.salaryFormulaById(formData.id);
|
||||
await http[!isEdit.value ? "post" : "put"](url, body)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await props.getDataMain?.();
|
||||
closeDialog();
|
||||
props.getDataMain?.();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -120,7 +122,6 @@ function onSubmit() {
|
|||
|
||||
/** ดึงข้อมูล กลุ่มงาน */
|
||||
function getPosType() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.salaryEmployeePosType())
|
||||
.then((res) => {
|
||||
|
|
@ -134,9 +135,6 @@ function getPosType() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +143,6 @@ function getPosName() {
|
|||
if (formData.posType) {
|
||||
formData.posName = "";
|
||||
formData.posLevel = "";
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.salaryEmployeePositionType(formData.posType.name))
|
||||
.then((res) => {
|
||||
|
|
@ -162,9 +159,6 @@ function getPosName() {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -238,26 +232,37 @@ function getSalaryGroup() {
|
|||
|
||||
/** function fetch ข้อมูลหลักเกณฑ์ */
|
||||
function getDataEdit() {
|
||||
http.get(config.API.salaryFormula() + `/${formData.id}`).then(async (res) => {
|
||||
const data = res.data.result;
|
||||
formData.posType = posTypeOp.value.find((a: any) => a.id == data.posTypeId);
|
||||
formData.posName = data.position;
|
||||
getPosNameEdit();
|
||||
setTimeout(() => {
|
||||
getPosLevelEdit();
|
||||
formData.posLevel = posLevelOp.value.find(
|
||||
(item: any) => item.id == data.posLevelId
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.salaryFormula() + `/${formData.id}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
formData.posType = posTypeOp.value.find(
|
||||
(a: any) => a.id == data.posTypeId
|
||||
);
|
||||
formData.reson = data.details;
|
||||
formData.rateOldMin = data.salaryMin;
|
||||
formData.groupOld = groupOldOp.value.filter((b: any) =>
|
||||
data.salaryEmployeeMinIds.includes(b.id)
|
||||
);
|
||||
formData.rateMaxOld = data.salary;
|
||||
formData.groupRateHigh = data.salaryEmployeeId;
|
||||
formData.rateHighMax = data.salaryMax;
|
||||
}, 200);
|
||||
});
|
||||
formData.posName = data.position;
|
||||
getPosNameEdit();
|
||||
setTimeout(() => {
|
||||
getPosLevelEdit();
|
||||
formData.posLevel = posLevelOp.value.find(
|
||||
(item: any) => item.id == data.posLevelId
|
||||
);
|
||||
formData.reson = data.details;
|
||||
formData.rateOldMin = data.salaryMin;
|
||||
formData.groupOld = groupOldOp.value.filter((b: any) =>
|
||||
data.salaryEmployeeMinIds.includes(b.id)
|
||||
);
|
||||
formData.rateMaxOld = data.salary;
|
||||
formData.groupRateHigh = data.salaryEmployeeId;
|
||||
formData.rateHighMax = data.salaryMax;
|
||||
}, 200);
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
hideLoader();
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
watch(
|
||||
() => modal.value,
|
||||
|
|
@ -267,8 +272,11 @@ watch(
|
|||
getSalaryGroup();
|
||||
|
||||
if (isEdit.value) {
|
||||
isReadonly.value = actionsType.value === "view" ? true : false;
|
||||
formData.id = props.data?.id ? props.data.id : null;
|
||||
getDataEdit();
|
||||
} else {
|
||||
isReadonly.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -328,7 +336,13 @@ const getClass = (val: boolean) => {
|
|||
<q-card class="col-12" style="width: 80%">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<Header
|
||||
:tittle="isEdit ? 'แก้ไขหลักเกณฑ์' : 'เพิ่มหลักเกณฑ์'"
|
||||
:tittle="
|
||||
isEdit && actionsType === 'view'
|
||||
? 'รายละเอียด'
|
||||
: isEdit
|
||||
? 'แก้ไขหลักเกณฑ์'
|
||||
: 'เพิ่มหลักเกณฑ์'
|
||||
"
|
||||
:close="closeDialog"
|
||||
/>
|
||||
<q-separator />
|
||||
|
|
@ -338,7 +352,8 @@ const getClass = (val: boolean) => {
|
|||
<div class="col-4">
|
||||
<q-select
|
||||
ref="posTypeRef"
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.posType"
|
||||
|
|
@ -366,9 +381,9 @@ const getClass = (val: boolean) => {
|
|||
<div class="col-4">
|
||||
<q-select
|
||||
ref="posNameRef"
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly || formData.posType"
|
||||
dense
|
||||
:readonly="formData.posType"
|
||||
outlined
|
||||
v-model="formData.posName"
|
||||
label="ตำแหน่ง"
|
||||
|
|
@ -394,8 +409,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
:readonly="formData.posName"
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly || formData.posName"
|
||||
ref="posLevelRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -419,20 +434,23 @@ const getClass = (val: boolean) => {
|
|||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.reson"
|
||||
label="หมายเหตุ"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 text-bold">อัตราค่าจ้าง</div>
|
||||
<div class="col-4">
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
ref="rateOldMinRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -449,7 +467,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
ref="groupOldRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -481,7 +500,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-4">
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
ref="rateMaxOldRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -503,7 +523,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
ref="groupRateHighRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -533,7 +554,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-4">
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
:class="getClass(!isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
ref="rateHighMaxRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -142,6 +143,7 @@ const formFilter = reactive({
|
|||
|
||||
const modalForm = ref<boolean>(false);
|
||||
const isStatusEdit = ref<boolean>(false);
|
||||
const actionsType = ref<string>("");
|
||||
const dataRow = ref<ListData>();
|
||||
|
||||
const posTypeOpMain = ref<DataOption[]>([]);
|
||||
|
|
@ -213,7 +215,8 @@ function getData() {
|
|||
* เปิด dialog แก้ไขหลักเกณฑ์
|
||||
* @param params
|
||||
*/
|
||||
function editPopup(params: ListData) {
|
||||
function editPopup(params: ListData, type: string) {
|
||||
actionsType.value = type;
|
||||
modalForm.value = true;
|
||||
isStatusEdit.value = true;
|
||||
dataRow.value = params;
|
||||
|
|
@ -330,7 +333,14 @@ onMounted(() => {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-btn flat round dense icon="add" @click="() => (modalForm = true)">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="add"
|
||||
@click="() => (modalForm = true)"
|
||||
>
|
||||
<q-tooltip>เพิ่ม </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -388,39 +398,43 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
size="12px"
|
||||
icon="mdi-eye"
|
||||
color="info"
|
||||
@click="editPopup(props.row, 'view')"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section>
|
||||
<div class="row items-center" @click="editPopup(props.row)">
|
||||
<q-icon color="edit" size="17px" name="edit" />
|
||||
<div class="q-pl-md">แก้ไขข้อมูล</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickDelete(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="red" size="17px" name="delete" />
|
||||
<div class="q-pl-md">ลบ</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="edit"
|
||||
color="edit"
|
||||
@click="editPopup(props.row, 'edit')"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-delete"
|
||||
color="red"
|
||||
@click.stop="onClickDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -447,8 +461,6 @@ onMounted(() => {
|
|||
</div>
|
||||
<div v-else>{{ col.value != "" ? col.value : "-" }}</div>
|
||||
</q-td>
|
||||
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
@ -472,6 +484,7 @@ onMounted(() => {
|
|||
v-model:isStatusEdit="isStatusEdit"
|
||||
:data="dataRow"
|
||||
:get-data-Main="getData"
|
||||
:actionsType="actionsType"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -7,10 +8,7 @@ import config from "@/app.config";
|
|||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
ItemsMenu,
|
||||
NewPagination,
|
||||
} from "@/modules/13_salary/interface/index/Main";
|
||||
import type { NewPagination } from "@/modules/13_salary/interface/index/Main";
|
||||
import type { FormFilter } from "@/modules/13_salary/interface/request/EmployeeChart";
|
||||
import type { EmployeeSalary } from "@/modules/13_salary/interface/response/salaryEmployeeChart";
|
||||
|
||||
|
|
@ -43,6 +41,7 @@ const totalList = ref<number>(0);
|
|||
|
||||
const modalDialogEmployeeChart = ref<boolean>(false);
|
||||
const isStatusEdit = ref<boolean>(false);
|
||||
const activeType = ref<string>("");
|
||||
const dataRow = ref<EmployeeSalary>();
|
||||
|
||||
/** ข้อมูล Table*/
|
||||
|
|
@ -92,34 +91,6 @@ const visibleColumns = ref<string[]>([
|
|||
"isActive",
|
||||
]);
|
||||
|
||||
/** List Mune*/
|
||||
const itemMenu = ref<ItemsMenu[]>([
|
||||
{
|
||||
label: "แก้ไข",
|
||||
icon: "edit",
|
||||
color: "edit",
|
||||
type: "edit",
|
||||
},
|
||||
{
|
||||
label: "เอกสารอ้างอิง",
|
||||
icon: "mdi-file-document-outline",
|
||||
color: "teal",
|
||||
type: "upload",
|
||||
},
|
||||
{
|
||||
label: "อัตราค่าจ้าง",
|
||||
icon: "mdi-format-list-bulleted-triangle",
|
||||
color: "secondary",
|
||||
type: "salaryRate",
|
||||
},
|
||||
{
|
||||
label: "คัดลอก",
|
||||
icon: "content_copy",
|
||||
color: "blue-6",
|
||||
type: "copy",
|
||||
},
|
||||
]);
|
||||
|
||||
/** function fetch ข้แมูลรายาการผังบัญชีค่าจ้างลูกจ้างประจำ */
|
||||
function fetchListChart() {
|
||||
showLoader();
|
||||
|
|
@ -141,38 +112,39 @@ function fetchListChart() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกเมนู
|
||||
* @param type ประเทภเมนู
|
||||
* @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||
*/
|
||||
function onClickAction(type: string, data: EmployeeSalary) {
|
||||
switch (type) {
|
||||
case "edit":
|
||||
onEdit(data);
|
||||
break;
|
||||
case "upload":
|
||||
onUpload(data.id, data.isActive);
|
||||
break;
|
||||
case "salaryRate":
|
||||
onSalaryRate(data.id);
|
||||
break;
|
||||
case "copy":
|
||||
onCoppy(data.id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * function เลือกเมนู
|
||||
// * @param type ประเทภเมนู
|
||||
// * @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||
// */
|
||||
// function onClickAction(type: string, data: EmployeeSalary) {
|
||||
// switch (type) {
|
||||
// case "edit":
|
||||
// onEdit(data);
|
||||
// break;
|
||||
// case "upload":
|
||||
// onUpload(data.id, data.isActive);
|
||||
// break;
|
||||
// case "salaryRate":
|
||||
// onSalaryRate(data.id);
|
||||
// break;
|
||||
// case "copy":
|
||||
// onCoppy(data.id);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* function openDialog แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||
* @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||
*/
|
||||
function onEdit(data: EmployeeSalary) {
|
||||
modalDialogEmployeeChart.value = true;
|
||||
function onEdit(data: EmployeeSalary, type: string) {
|
||||
activeType.value = type;
|
||||
isStatusEdit.value = true;
|
||||
dataRow.value = data;
|
||||
modalDialogEmployeeChart.value = true;
|
||||
}
|
||||
|
||||
const modalDialogUpload = ref<boolean>(false);
|
||||
|
|
@ -205,9 +177,9 @@ function onSalaryRate(id: string) {
|
|||
function onCoppy(id: string) {
|
||||
http
|
||||
.post(config.API.salaryEmployeeChartCopy, { id: id })
|
||||
.then(() => {
|
||||
fetchListChart();
|
||||
success($q, "คัดลอกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchListChart();
|
||||
await success($q, "คัดลอกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -222,9 +194,9 @@ function onClickDelete(id: string) {
|
|||
dialogRemove($q, () => {
|
||||
http
|
||||
.delete(config.API.salaryEmployeeChartByid(id))
|
||||
.then(() => {
|
||||
fetchListChart();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchListChart();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -273,7 +245,14 @@ onMounted(() => {
|
|||
</script>
|
||||
<template>
|
||||
<q-toolbar class="text-primary" style="padding: 0px">
|
||||
<q-btn flat round dense icon="add" @click="onClickAdd()">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="add"
|
||||
@click="onClickAdd()"
|
||||
>
|
||||
<q-tooltip>เพิ่ม </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -330,43 +309,121 @@ onMounted(() => {
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet ||
|
||||
checkPermission($route)?.attrIsCreate ||
|
||||
(checkPermission($route)?.attrIsDelete &&
|
||||
props.row.isActive == false)
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
size="12px"
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
round
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<!-- อัตราเงินเดือน -->
|
||||
<q-item
|
||||
v-for="(item, index) in itemMenu"
|
||||
:key="index"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickAction(item.type, props.row)"
|
||||
@click.stop="onSalaryRate(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
:color="item.color"
|
||||
size="17px"
|
||||
:name="item.icon"
|
||||
color="secondary"
|
||||
size="xs"
|
||||
name="mdi-format-list-bulleted-triangle"
|
||||
/>
|
||||
<div class="q-pl-md">{{ item.label }}</div>
|
||||
<div class="q-pl-md">อัตราเงินเดือน</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- เอกสารอ้างอิง -->
|
||||
<q-item
|
||||
v-if="props.row.isActive == false"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onUpload(props.row.id, props.row.isActive)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
color="teal"
|
||||
size="xs"
|
||||
name="mdi-file-document-outline"
|
||||
/>
|
||||
<div class="q-pl-md">เอกสารอ้างอิง</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- รายละเอียด -->
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onEdit(props.row, 'view')"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="info" size="xs" name="mdi-eye" />
|
||||
<div class="q-pl-md">รายละเอียด</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- แก้ไข -->
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
!props.row.isActive
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onEdit(props.row, 'edit')"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="edit" size="xs" name="edit" />
|
||||
<div class="q-pl-md">แก้ไข</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- คัดลอก -->
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onCoppy(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="blue-6" size="xs" name="content_copy" />
|
||||
<div class="q-pl-md">คัดลอก</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- ลบข้อมูล -->
|
||||
<q-item
|
||||
v-if="
|
||||
props.row.isActive == false &&
|
||||
checkPermission($route)?.attrIsDelete
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickDelete(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="red" size="17px" name="delete" />
|
||||
<div class="q-pl-md">ลบ</div>
|
||||
<q-icon color="red" size="xs" name="delete" />
|
||||
<div class="q-pl-md">ลบข้อมูล</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
|
@ -390,7 +447,6 @@ onMounted(() => {
|
|||
</div>
|
||||
<div v-else>{{ col.value ? col.value : "-" }}</div>
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
@ -414,6 +470,7 @@ onMounted(() => {
|
|||
:isStatusEdit="isStatusEdit"
|
||||
:data="dataRow as EmployeeSalary"
|
||||
:fetchData="fetchListChart"
|
||||
:activeType="activeType"
|
||||
/>
|
||||
|
||||
<DialogEmployeeUpload
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -7,10 +8,7 @@ import config from "@/app.config";
|
|||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
NewPagination,
|
||||
ItemsMenu,
|
||||
} from "@/modules/13_salary/interface/index/Main";
|
||||
import type { NewPagination } from "@/modules/13_salary/interface/index/Main";
|
||||
import type { Salary } from "@/modules/13_salary/interface/response/Main";
|
||||
import type { FormQuerySalary } from "@/modules/13_salary/interface/request/Main";
|
||||
import DialogFormUpload from "@/modules/13_salary/components/SalaryChart/DialogUpload.vue";
|
||||
|
|
@ -82,34 +80,6 @@ const visibleColumns = ref<string[]>([
|
|||
"isActive",
|
||||
]);
|
||||
|
||||
/** List Mune*/
|
||||
const itemMenu = ref<ItemsMenu[]>([
|
||||
{
|
||||
label: "แก้ไข",
|
||||
icon: "edit",
|
||||
color: "edit",
|
||||
type: "edit",
|
||||
},
|
||||
{
|
||||
label: "เอกสารอ้างอิง",
|
||||
icon: "mdi-file-document-outline",
|
||||
color: "teal",
|
||||
type: "upload",
|
||||
},
|
||||
{
|
||||
label: "อัตราเงินเดือน",
|
||||
icon: "mdi-format-list-bulleted-triangle",
|
||||
color: "secondary",
|
||||
type: "salaryRate",
|
||||
},
|
||||
{
|
||||
label: "คัดลอก",
|
||||
icon: "content_copy",
|
||||
color: "blue-6",
|
||||
type: "copy",
|
||||
},
|
||||
]);
|
||||
|
||||
/** queryString*/
|
||||
const formQuery = reactive<FormQuerySalary>({
|
||||
page: 1, //*หน้า
|
||||
|
|
@ -259,7 +229,14 @@ onMounted(() => {
|
|||
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<div class="col-12 row text-primary">
|
||||
<q-btn flat round dense icon="add" @click="onClickSalary('add', null)">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="add"
|
||||
@click="onClickSalary('add', null)"
|
||||
>
|
||||
<q-tooltip>เพิ่มผังบัญชีเงินเดือน </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -318,60 +295,130 @@ onMounted(() => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet ||
|
||||
checkPermission($route)?.attrIsCreate ||
|
||||
(checkPermission($route)?.attrIsDelete &&
|
||||
props.row.isActive == false)
|
||||
"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
size="12px"
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
round
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<!-- อัตราเงินเดือน -->
|
||||
<q-item
|
||||
v-for="(item, index) in itemMenu"
|
||||
:key="index"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickSalaryRate(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
color="secondary"
|
||||
size="xs"
|
||||
name="mdi-format-list-bulleted-triangle"
|
||||
/>
|
||||
<div class="q-pl-md">อัตราเงินเดือน</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- เอกสารอ้างอิง -->
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="
|
||||
item.type === 'edit'
|
||||
? onClickSalary('edit', props.row)
|
||||
: item.type === 'salaryRate'
|
||||
? onClickSalaryRate(props.row.id)
|
||||
: item.type === 'upload'
|
||||
? onClickUpload(
|
||||
'edit',
|
||||
props.row.id,
|
||||
props.row.isActive
|
||||
)
|
||||
: item.type === 'copy'
|
||||
? onClickCoppy(props.row.id)
|
||||
: null
|
||||
onClickUpload('edit', props.row.id, props.row.isActive)
|
||||
"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
:color="item.color"
|
||||
size="17px"
|
||||
:name="item.icon"
|
||||
color="teal"
|
||||
size="xs"
|
||||
name="mdi-file-document-outline"
|
||||
/>
|
||||
<div class="q-pl-md">{{ item.label }}</div>
|
||||
<div class="q-pl-md">เอกสารอ้างอิง</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- รายละเอียด -->
|
||||
<q-item
|
||||
v-if="props.row.isActive == false"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickSalary('view', props.row)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="info" size="xs" name="mdi-eye" />
|
||||
<div class="q-pl-md">รายละเอียด</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- แก้ไข -->
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
!props.row.isActive
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickSalary('edit', props.row)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="edit" size="xs" name="edit" />
|
||||
<div class="q-pl-md">แก้ไข</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- คัดลอก -->
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickCoppy(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
color="blue-6"
|
||||
size="xs"
|
||||
name="content_copy"
|
||||
/>
|
||||
<div class="q-pl-md">คัดลอก</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- ลบข้อมูล -->
|
||||
<q-item
|
||||
v-if="
|
||||
props.row.isActive == false &&
|
||||
checkPermission($route)?.attrIsDelete
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickDelete(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="red" size="17px" name="delete" />
|
||||
<div class="q-pl-md">ลบ</div>
|
||||
<q-icon color="red" size="xs" name="delete" />
|
||||
<div class="q-pl-md">ลบข้อมูล</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
|
@ -415,7 +462,6 @@ onMounted(() => {
|
|||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -32,14 +32,14 @@ const store = useSalaryEmployeeChartDataStore();
|
|||
<q-separator />
|
||||
|
||||
<q-tab-panels v-model="store.mainTab" animated>
|
||||
<q-tab-panel name="structure">
|
||||
<div class="q-pa-sm">
|
||||
<q-tab-panel name="structure" class="q-pt-none">
|
||||
<div class="q-pa-xs">
|
||||
<TabStructure />
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="criteria">
|
||||
<div class="q-pa-sm">
|
||||
<q-tab-panel name="criteria" class="q-pt-none">
|
||||
<div class="q-pa-xs">
|
||||
<TabCriteris />
|
||||
</div>
|
||||
</q-tab-panel>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -145,20 +146,6 @@ const modalDialogEmployeeRate = ref<boolean>(false);
|
|||
const isStatusEdit = ref<boolean>(false);
|
||||
const dataRow = ref<EmployeeRateSalary>();
|
||||
|
||||
function onClickAction(type: string, data: EmployeeRateSalary) {
|
||||
switch (type) {
|
||||
case "edit":
|
||||
onEdit(data);
|
||||
break;
|
||||
case "delete":
|
||||
onDelete(data.id);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function onEdit(data: EmployeeRateSalary) {
|
||||
modalDialogEmployeeRate.value = true;
|
||||
isStatusEdit.value = true;
|
||||
|
|
@ -186,11 +173,6 @@ function onClickAdd() {
|
|||
isStatusEdit.value = false;
|
||||
}
|
||||
|
||||
function filterFn() {
|
||||
formFilter.page = 1;
|
||||
fetchSalalyEmployeeRate();
|
||||
}
|
||||
|
||||
function updatePage(val: number) {
|
||||
formFilter.page = val;
|
||||
fetchSalalyEmployeeRate();
|
||||
|
|
@ -243,12 +225,19 @@ onMounted(async () => {
|
|||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
อัตราค่าจ้างของ กลุ่มที่ {{ groupSalary }}
|
||||
อัตราค่าจ้างของกลุ่มที่ {{ groupSalary }}
|
||||
</div>
|
||||
</div>
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<q-toolbar class="text-primary" style="padding: 0px">
|
||||
<q-btn v-if="!isActive" flat round dense icon="add" @click="onClickAdd">
|
||||
<q-btn
|
||||
v-if="!isActive && checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="add"
|
||||
@click="onClickAdd"
|
||||
>
|
||||
<q-tooltip>เพิ่ม </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -259,34 +248,6 @@ onMounted(async () => {
|
|||
color="blue"
|
||||
@click="clickDownload()"
|
||||
/>
|
||||
<!-- <q-input
|
||||
borderless
|
||||
dense
|
||||
outlined
|
||||
v-model="formFilter.keyword"
|
||||
@keydown.enter.pervrnt="filterFn"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
for="#select"
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/> -->
|
||||
</q-toolbar>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
|
|
@ -314,41 +275,28 @@ onMounted(async () => {
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-if="!isActive">
|
||||
<q-btn
|
||||
v-if="!isActive && checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
size="12px"
|
||||
v-for="(item, index) in itemMenu"
|
||||
:key="index"
|
||||
:color="item.color"
|
||||
:icon="item.icon"
|
||||
@click.stop="
|
||||
item.type === 'edit'
|
||||
? onEdit(props.row)
|
||||
: item.type === 'delete'
|
||||
? onDelete(props.row.id)
|
||||
: null
|
||||
"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item
|
||||
v-for="(item, index) in itemMenu"
|
||||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickAction(item.type, props.row)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
:color="item.color"
|
||||
size="17px"
|
||||
:name="item.icon"
|
||||
/>
|
||||
<div class="q-pl-md">{{ item.label }}</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-tooltip>{{ item.label }}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -175,17 +176,18 @@ function onClickSalaryRate(type: string, data: SalaryRate | null) {
|
|||
}
|
||||
|
||||
function onClickDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
await http
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.salaryRateListByid(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchListSalalyRate();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchListSalalyRate();
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
|
|
@ -240,13 +242,13 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
|||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
อัตราเงินเดือนของ {{ posType }}
|
||||
อัตราเงินเดือนของ{{ posType }}
|
||||
</div>
|
||||
</div>
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<div class="col-12 row">
|
||||
<q-btn
|
||||
v-if="!isActive"
|
||||
v-if="!isActive && checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
@ -283,52 +285,33 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width v-if="!isActive"></q-th>
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-if="!isActive">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
|
||||
v-if="!isActive && checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
size="12px"
|
||||
v-for="(item, index) in itemMenu"
|
||||
:key="index"
|
||||
:color="item.color"
|
||||
:icon="item.icon"
|
||||
@click.stop="
|
||||
item.type === 'edit'
|
||||
? onClickSalaryRate('edit', props.row)
|
||||
: item.type === 'delete'
|
||||
? onClickDelete(props.row.id)
|
||||
: null
|
||||
"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 150px">
|
||||
<q-item
|
||||
v-for="(item, index) in itemMenu"
|
||||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="
|
||||
item.type === 'edit'
|
||||
? onClickSalaryRate('edit', props.row)
|
||||
: item.type === 'delete'
|
||||
? onClickDelete(props.row.id)
|
||||
: null
|
||||
"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon
|
||||
:color="item.color"
|
||||
size="17px"
|
||||
:name="item.icon"
|
||||
/>
|
||||
<div class="q-pl-md">{{ item.label }}</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
<q-tooltip>{{ item.label }}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
|
|
@ -384,7 +367,6 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
|||
{{ col.value ? col.value.toLocaleString() : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -416,7 +416,8 @@ onMounted(async () => {
|
|||
<q-item
|
||||
v-if="
|
||||
props.row.isClose === false &&
|
||||
props.row.isActive === true
|
||||
props.row.isActive === true &&
|
||||
props.row.revisionId !== null
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -488,7 +489,6 @@ onMounted(async () => {
|
|||
{{ col.value ?? "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue