เงินเดือน => permission รายการผังบัญชีเงินเดือน
This commit is contained in:
parent
ac40fb9674
commit
44a6ef192b
5 changed files with 146 additions and 108 deletions
|
|
@ -69,6 +69,8 @@ const title = computed(() => {
|
||||||
? "เพิ่มผังบัญชีเงินเดือน"
|
? "เพิ่มผังบัญชีเงินเดือน"
|
||||||
: props.typeAction === "edit"
|
: props.typeAction === "edit"
|
||||||
? "แก้ไขผังบัญชีเงินเดือน"
|
? "แก้ไขผังบัญชีเงินเดือน"
|
||||||
|
: props.typeAction === "view"
|
||||||
|
? "รายละเอียด"
|
||||||
: "บัญชีเงินเดือน";
|
: "บัญชีเงินเดือน";
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
|
@ -131,7 +133,7 @@ function fetchSalaryDetail(id: string) {
|
||||||
formData.endDate = data.endDate;
|
formData.endDate = data.endDate;
|
||||||
formData.details = data.details;
|
formData.details = data.details;
|
||||||
formData.isSpecial = data.isSpecial;
|
formData.isSpecial = data.isSpecial;
|
||||||
isReadonly.value = data.isActive;
|
isReadonly.value = props.typeAction === 'view'? true: data.isActive;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -150,7 +152,7 @@ watch(
|
||||||
if (modal.value) {
|
if (modal.value) {
|
||||||
await fetchPosType();
|
await fetchPosType();
|
||||||
|
|
||||||
if (props.typeAction === "edit") {
|
if (props.typeAction === "edit" || props.typeAction === "view") {
|
||||||
showLoader();
|
showLoader();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
|
|
@ -522,7 +524,7 @@ const getClass = (val: boolean) => {
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right" v-if="!isReadonly">
|
||||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -238,7 +239,7 @@ watch(
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent>
|
<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" />
|
<Header :tittle="`อัปโหลดเอกสารอ้างอิง`" :close="closeDialog" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section class="scroll" style="max-height: 70vh">
|
<q-card-section class="scroll" style="max-height: 70vh">
|
||||||
|
|
@ -249,7 +250,10 @@ watch(
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<div v-if="!props.isActive" class="full-width">
|
<div v-if="!props.isActive" class="full-width">
|
||||||
<q-file
|
<q-file
|
||||||
v-if="props.typeAction === 'edit'"
|
v-if="
|
||||||
|
props.typeAction === 'edit' &&
|
||||||
|
checkPermission($route)?.attrIsUpdate
|
||||||
|
"
|
||||||
class="col-12"
|
class="col-12"
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
@ -301,7 +305,12 @@ watch(
|
||||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!props.isActive">
|
<div
|
||||||
|
v-if="
|
||||||
|
!props.isActive &&
|
||||||
|
checkPermission($route)?.attrIsUpdate
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -7,10 +8,7 @@ import config from "@/app.config";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type {
|
import type { NewPagination } from "@/modules/13_salary/interface/index/Main";
|
||||||
NewPagination,
|
|
||||||
ItemsMenu,
|
|
||||||
} from "@/modules/13_salary/interface/index/Main";
|
|
||||||
import type { Salary } from "@/modules/13_salary/interface/response/Main";
|
import type { Salary } from "@/modules/13_salary/interface/response/Main";
|
||||||
import type { FormQuerySalary } from "@/modules/13_salary/interface/request/Main";
|
import type { FormQuerySalary } from "@/modules/13_salary/interface/request/Main";
|
||||||
import DialogFormUpload from "@/modules/13_salary/components/SalaryChart/DialogUpload.vue";
|
import DialogFormUpload from "@/modules/13_salary/components/SalaryChart/DialogUpload.vue";
|
||||||
|
|
@ -82,34 +80,6 @@ const visibleColumns = ref<string[]>([
|
||||||
"isActive",
|
"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*/
|
/** queryString*/
|
||||||
const formQuery = reactive<FormQuerySalary>({
|
const formQuery = reactive<FormQuerySalary>({
|
||||||
page: 1, //*หน้า
|
page: 1, //*หน้า
|
||||||
|
|
@ -259,7 +229,14 @@ onMounted(() => {
|
||||||
|
|
||||||
<q-card flat bordered class="q-pa-md">
|
<q-card flat bordered class="q-pa-md">
|
||||||
<div class="col-12 row text-primary">
|
<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-tooltip>เพิ่มผังบัญชีเงินเดือน </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -318,60 +295,130 @@ onMounted(() => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props">
|
||||||
<q-td>
|
<q-td>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsGet ||
|
||||||
|
checkPermission($route)?.attrIsCreate ||
|
||||||
|
(checkPermission($route)?.attrIsDelete &&
|
||||||
|
props.row.isActive == false)
|
||||||
|
"
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
icon="mdi-dots-vertical"
|
color="secondary"
|
||||||
class="q-pa-none q-ml-xs"
|
icon="mdi-dots-horizontal-circle-outline"
|
||||||
color="grey-13"
|
round
|
||||||
size="12px"
|
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list dense style="min-width: 200px">
|
<q-list dense style="min-width: 200px">
|
||||||
|
<!-- อัตราเงินเดือน -->
|
||||||
<q-item
|
<q-item
|
||||||
v-for="(item, index) in itemMenu"
|
v-if="checkPermission($route)?.attrIsGet"
|
||||||
:key="index"
|
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
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click.stop="
|
@click.stop="
|
||||||
item.type === 'edit'
|
onClickUpload('edit', props.row.id, props.row.isActive)
|
||||||
? 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
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
<q-icon
|
<q-icon
|
||||||
:color="item.color"
|
color="teal"
|
||||||
size="17px"
|
size="xs"
|
||||||
:name="item.icon"
|
name="mdi-file-document-outline"
|
||||||
/>
|
/>
|
||||||
<div class="q-pl-md">{{ item.label }}</div>
|
<div class="q-pl-md">เอกสารอ้างอิง</div>
|
||||||
</div>
|
</div>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
||||||
|
<!-- รายละเอียด -->
|
||||||
<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
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click.stop="onClickDelete(props.row.id)"
|
@click.stop="onClickDelete(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
<q-icon color="red" size="17px" name="delete" />
|
<q-icon color="red" size="xs" name="delete" />
|
||||||
<div class="q-pl-md">ลบ</div>
|
<div class="q-pl-md">ลบข้อมูล</div>
|
||||||
</div>
|
</div>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -415,7 +462,6 @@ onMounted(() => {
|
||||||
{{ col.value ? col.value : "-" }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -240,13 +241,13 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
@click="router.go(-1)"
|
@click="router.go(-1)"
|
||||||
/>
|
/>
|
||||||
อัตราเงินเดือนของ {{ posType }}
|
อัตราเงินเดือนของ{{ posType }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="q-pa-md">
|
<q-card flat bordered class="q-pa-md">
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="!isActive"
|
v-if="!isActive && checkPermission($route)?.attrIsUpdate"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
|
|
@ -283,52 +284,33 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="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">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props">
|
||||||
<q-td v-if="!isActive">
|
<q-td auto-width>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="!isActive && checkPermission($route)?.attrIsUpdate"
|
||||||
flat
|
flat
|
||||||
|
round
|
||||||
dense
|
dense
|
||||||
icon="mdi-dots-vertical"
|
v-for="(item, index) in itemMenu"
|
||||||
class="q-pa-none q-ml-xs"
|
:key="index"
|
||||||
color="grey-13"
|
:color="item.color"
|
||||||
size="12px"
|
:icon="item.icon"
|
||||||
|
@click.stop="
|
||||||
|
item.type === 'edit'
|
||||||
|
? onClickSalaryRate('edit', props.row)
|
||||||
|
: item.type === 'delete'
|
||||||
|
? onClickDelete(props.row.id)
|
||||||
|
: null
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-tooltip>{{ item.label }}</q-tooltip>
|
||||||
<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-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td
|
<q-td
|
||||||
|
|
@ -384,7 +366,6 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
|
||||||
{{ col.value ? col.value.toLocaleString() : "-" }}
|
{{ col.value ? col.value.toLocaleString() : "-" }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,8 @@ onMounted(async () => {
|
||||||
<q-item
|
<q-item
|
||||||
v-if="
|
v-if="
|
||||||
props.row.isClose === false &&
|
props.row.isClose === false &&
|
||||||
props.row.isActive === true
|
props.row.isActive === true &&
|
||||||
|
props.row.revisionId !== null
|
||||||
"
|
"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
|
@ -488,7 +489,6 @@ onMounted(async () => {
|
||||||
{{ col.value ?? "-" }}
|
{{ col.value ?? "-" }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue