เงินเดือน => permission ผังบัญชีค่าจ้างลูกจ้างประจำ
This commit is contained in:
parent
864b67fbe5
commit
38d5697a7c
9 changed files with 323 additions and 252 deletions
|
|
@ -26,6 +26,8 @@ const {
|
||||||
|
|
||||||
/** props*/
|
/** props*/
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
const activeType = defineModel<string>("activeType", { required: true });
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isStatusEdit: { type: Boolean, required: true },
|
isStatusEdit: { type: Boolean, required: true },
|
||||||
data: { type: Object, required: true },
|
data: { type: Object, required: true },
|
||||||
|
|
@ -65,7 +67,7 @@ function fetchSalaryDetail(id: string) {
|
||||||
formData.startDate = data.startDate;
|
formData.startDate = data.startDate;
|
||||||
formData.endDate = data.endDate;
|
formData.endDate = data.endDate;
|
||||||
formData.details = data.details;
|
formData.details = data.details;
|
||||||
isReadonly.value = data.isActive ? true : false;
|
isReadonly.value = activeType.value === "view" ? true : data.isActive;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -84,9 +86,9 @@ function onSubmit() {
|
||||||
? config.API.salaryEmployeeChart
|
? config.API.salaryEmployeeChart
|
||||||
: config.API.salaryEmployeeChartByid(props.data.id);
|
: config.API.salaryEmployeeChartByid(props.data.id);
|
||||||
await http[!props.isStatusEdit ? "post" : "put"](url, formData);
|
await http[!props.isStatusEdit ? "post" : "put"](url, formData);
|
||||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
await props.fetchData?.();
|
||||||
props.fetchData?.();
|
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -150,7 +152,9 @@ const getClass = (val: boolean) => {
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<Header
|
<Header
|
||||||
:tittle="
|
:tittle="
|
||||||
props.isStatusEdit
|
props.isStatusEdit && activeType === 'view'
|
||||||
|
? 'รายละเอียด'
|
||||||
|
: props.isStatusEdit
|
||||||
? 'แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ'
|
? 'แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ'
|
||||||
: 'เพิ่มผังบัญชีค่าจ้างลูกจ้างประจำ'
|
: 'เพิ่มผังบัญชีค่าจ้างลูกจ้างประจำ'
|
||||||
"
|
"
|
||||||
|
|
@ -359,12 +363,8 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
</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
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
label="บันทึก"
|
|
||||||
color="secondary"
|
|
||||||
type="submit"
|
|
||||||
:disable="isReadonly"
|
|
||||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</q-card-actions>
|
</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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -135,6 +148,8 @@ watch(
|
||||||
<div class="row col-xs-12 col-md-12 q-col-gutter-sm">
|
<div class="row col-xs-12 col-md-12 q-col-gutter-sm">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
:readonly="isReadonly"
|
||||||
|
:class="getClass(!isReadonly)"
|
||||||
ref="salaryNoRef"
|
ref="salaryNoRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -154,6 +169,8 @@ watch(
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
:readonly="isReadonly"
|
||||||
|
:class="getClass(!isReadonly)"
|
||||||
ref="salaryMonthRef"
|
ref="salaryMonthRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -172,6 +189,8 @@ watch(
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
:readonly="isReadonly"
|
||||||
|
:class="getClass(!isReadonly)"
|
||||||
ref="salaryDayRef"
|
ref="salaryDayRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, 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";
|
||||||
|
|
@ -207,7 +208,12 @@ watch(
|
||||||
<div class="col-xs-12 col-md-3">
|
<div class="col-xs-12 col-md-3">
|
||||||
<div class="row col-12 q-col-gutter-y-sm">
|
<div class="row col-12 q-col-gutter-y-sm">
|
||||||
<div class="col-12 row">
|
<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
|
<q-file
|
||||||
class="col-12"
|
class="col-12"
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -260,7 +266,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
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ const { dialogConfirm, showLoader, hideLoader, messageError, success } =
|
||||||
|
|
||||||
/** props*/
|
/** props*/
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
const actionsType = defineModel<string>("actionsType", { default: "" });
|
||||||
const isEdit = defineModel<boolean>("isStatusEdit", { required: true });
|
const isEdit = defineModel<boolean>("isStatusEdit", { required: true });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -39,6 +40,7 @@ const groupOldOp = ref<DataOptions[]>([]);
|
||||||
const groupOldOpMain = ref<DataOptions[]>([]);
|
const groupOldOpMain = ref<DataOptions[]>([]);
|
||||||
const posLevelOp = ref<any[]>([]);
|
const posLevelOp = ref<any[]>([]);
|
||||||
const posNameListOp = ref<DataListOptions[]>([]);
|
const posNameListOp = ref<DataListOptions[]>([]);
|
||||||
|
const isReadonly = ref<boolean>(false);
|
||||||
|
|
||||||
const formData = reactive<any>({
|
const formData = reactive<any>({
|
||||||
id: "",
|
id: "",
|
||||||
|
|
@ -104,10 +106,10 @@ function onSubmit() {
|
||||||
? config.API.salaryFormula()
|
? config.API.salaryFormula()
|
||||||
: config.API.salaryFormulaById(formData.id);
|
: config.API.salaryFormulaById(formData.id);
|
||||||
await http[!isEdit.value ? "post" : "put"](url, body)
|
await http[!isEdit.value ? "post" : "put"](url, body)
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
await props.getDataMain?.();
|
||||||
closeDialog();
|
closeDialog();
|
||||||
props.getDataMain?.();
|
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -120,7 +122,6 @@ function onSubmit() {
|
||||||
|
|
||||||
/** ดึงข้อมูล กลุ่มงาน */
|
/** ดึงข้อมูล กลุ่มงาน */
|
||||||
function getPosType() {
|
function getPosType() {
|
||||||
showLoader();
|
|
||||||
http
|
http
|
||||||
.get(config.API.salaryEmployeePosType())
|
.get(config.API.salaryEmployeePosType())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -134,9 +135,6 @@ function getPosType() {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,7 +143,6 @@ function getPosName() {
|
||||||
if (formData.posType) {
|
if (formData.posType) {
|
||||||
formData.posName = "";
|
formData.posName = "";
|
||||||
formData.posLevel = "";
|
formData.posLevel = "";
|
||||||
showLoader();
|
|
||||||
http
|
http
|
||||||
.get(config.API.salaryEmployeePositionType(formData.posType.name))
|
.get(config.API.salaryEmployeePositionType(formData.posType.name))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
@ -162,9 +159,6 @@ function getPosName() {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -238,26 +232,37 @@ function getSalaryGroup() {
|
||||||
|
|
||||||
/** function fetch ข้อมูลหลักเกณฑ์ */
|
/** function fetch ข้อมูลหลักเกณฑ์ */
|
||||||
function getDataEdit() {
|
function getDataEdit() {
|
||||||
http.get(config.API.salaryFormula() + `/${formData.id}`).then(async (res) => {
|
showLoader();
|
||||||
const data = res.data.result;
|
http
|
||||||
formData.posType = posTypeOp.value.find((a: any) => a.id == data.posTypeId);
|
.get(config.API.salaryFormula() + `/${formData.id}`)
|
||||||
formData.posName = data.position;
|
.then(async (res) => {
|
||||||
getPosNameEdit();
|
const data = res.data.result;
|
||||||
setTimeout(() => {
|
formData.posType = posTypeOp.value.find(
|
||||||
getPosLevelEdit();
|
(a: any) => a.id == data.posTypeId
|
||||||
formData.posLevel = posLevelOp.value.find(
|
|
||||||
(item: any) => item.id == data.posLevelId
|
|
||||||
);
|
);
|
||||||
formData.reson = data.details;
|
formData.posName = data.position;
|
||||||
formData.rateOldMin = data.salaryMin;
|
getPosNameEdit();
|
||||||
formData.groupOld = groupOldOp.value.filter((b: any) =>
|
setTimeout(() => {
|
||||||
data.salaryEmployeeMinIds.includes(b.id)
|
getPosLevelEdit();
|
||||||
);
|
formData.posLevel = posLevelOp.value.find(
|
||||||
formData.rateMaxOld = data.salary;
|
(item: any) => item.id == data.posLevelId
|
||||||
formData.groupRateHigh = data.salaryEmployeeId;
|
);
|
||||||
formData.rateHighMax = data.salaryMax;
|
formData.reson = data.details;
|
||||||
}, 200);
|
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(
|
watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
|
|
@ -267,8 +272,11 @@ watch(
|
||||||
getSalaryGroup();
|
getSalaryGroup();
|
||||||
|
|
||||||
if (isEdit.value) {
|
if (isEdit.value) {
|
||||||
|
isReadonly.value = actionsType.value === "view" ? true : false;
|
||||||
formData.id = props.data?.id ? props.data.id : null;
|
formData.id = props.data?.id ? props.data.id : null;
|
||||||
getDataEdit();
|
getDataEdit();
|
||||||
|
} else {
|
||||||
|
isReadonly.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -328,7 +336,13 @@ const getClass = (val: boolean) => {
|
||||||
<q-card class="col-12" style="width: 80%">
|
<q-card class="col-12" style="width: 80%">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<Header
|
<Header
|
||||||
:tittle="isEdit ? 'แก้ไขหลักเกณฑ์' : 'เพิ่มหลักเกณฑ์'"
|
:tittle="
|
||||||
|
isEdit && actionsType === 'view'
|
||||||
|
? 'รายละเอียด'
|
||||||
|
: isEdit
|
||||||
|
? 'แก้ไขหลักเกณฑ์'
|
||||||
|
: 'เพิ่มหลักเกณฑ์'
|
||||||
|
"
|
||||||
:close="closeDialog"
|
:close="closeDialog"
|
||||||
/>
|
/>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
@ -338,7 +352,8 @@ const getClass = (val: boolean) => {
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
ref="posTypeRef"
|
ref="posTypeRef"
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.posType"
|
v-model="formData.posType"
|
||||||
|
|
@ -366,9 +381,9 @@ const getClass = (val: boolean) => {
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
ref="posNameRef"
|
ref="posNameRef"
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly || formData.posType"
|
||||||
dense
|
dense
|
||||||
:readonly="formData.posType"
|
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.posName"
|
v-model="formData.posName"
|
||||||
label="ตำแหน่ง"
|
label="ตำแหน่ง"
|
||||||
|
|
@ -394,8 +409,8 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
:readonly="formData.posName"
|
:class="getClass(!isReadonly)"
|
||||||
:class="getClass(true)"
|
:readonly="isReadonly || formData.posName"
|
||||||
ref="posLevelRef"
|
ref="posLevelRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -419,20 +434,23 @@ const getClass = (val: boolean) => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-8">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.reson"
|
v-model="formData.reson"
|
||||||
label="หมายเหตุ"
|
label="หมายเหตุ"
|
||||||
|
type="textarea"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 text-bold">อัตราค่าจ้าง</div>
|
<div class="col-12 text-bold">อัตราค่าจ้าง</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
ref="rateOldMinRef"
|
ref="rateOldMinRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -449,7 +467,8 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
ref="groupOldRef"
|
ref="groupOldRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -481,7 +500,8 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
ref="rateMaxOldRef"
|
ref="rateMaxOldRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -503,7 +523,8 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
ref="groupRateHighRef"
|
ref="groupRateHighRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -533,7 +554,8 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(true)"
|
:class="getClass(!isReadonly)"
|
||||||
|
:readonly="isReadonly"
|
||||||
ref="rateHighMaxRef"
|
ref="rateHighMaxRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, watch } from "vue";
|
import { ref, reactive, onMounted, watch } from "vue";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
@ -142,6 +143,7 @@ const formFilter = reactive({
|
||||||
|
|
||||||
const modalForm = ref<boolean>(false);
|
const modalForm = ref<boolean>(false);
|
||||||
const isStatusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false);
|
||||||
|
const actionsType = ref<string>("");
|
||||||
const dataRow = ref<ListData>();
|
const dataRow = ref<ListData>();
|
||||||
|
|
||||||
const posTypeOpMain = ref<DataOption[]>([]);
|
const posTypeOpMain = ref<DataOption[]>([]);
|
||||||
|
|
@ -213,7 +215,8 @@ function getData() {
|
||||||
* เปิด dialog แก้ไขหลักเกณฑ์
|
* เปิด dialog แก้ไขหลักเกณฑ์
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
function editPopup(params: ListData) {
|
function editPopup(params: ListData, type: string) {
|
||||||
|
actionsType.value = type;
|
||||||
modalForm.value = true;
|
modalForm.value = true;
|
||||||
isStatusEdit.value = true;
|
isStatusEdit.value = true;
|
||||||
dataRow.value = params;
|
dataRow.value = params;
|
||||||
|
|
@ -330,7 +333,14 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</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-tooltip>เพิ่ม </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -388,39 +398,43 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td>
|
<q-td auto-width>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsGet"
|
||||||
flat
|
flat
|
||||||
|
round
|
||||||
dense
|
dense
|
||||||
icon="mdi-dots-vertical"
|
icon="mdi-eye"
|
||||||
class="q-pa-none q-ml-xs"
|
color="info"
|
||||||
color="grey-13"
|
@click="editPopup(props.row, 'view')"
|
||||||
size="12px"
|
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-tooltip>รายละเอียด</q-tooltip>
|
||||||
<q-list dense style="min-width: 200px">
|
</q-btn>
|
||||||
<q-item clickable v-close-popup>
|
<q-btn
|
||||||
<q-item-section>
|
v-if="
|
||||||
<div class="row items-center" @click="editPopup(props.row)">
|
checkPermission($route)?.attrIsGet &&
|
||||||
<q-icon color="edit" size="17px" name="edit" />
|
checkPermission($route)?.attrIsUpdate
|
||||||
<div class="q-pl-md">แก้ไขข้อมูล</div>
|
"
|
||||||
</div>
|
flat
|
||||||
</q-item-section>
|
round
|
||||||
</q-item>
|
dense
|
||||||
<q-item
|
icon="edit"
|
||||||
clickable
|
color="edit"
|
||||||
v-close-popup
|
@click="editPopup(props.row, 'edit')"
|
||||||
@click.stop="onClickDelete(props.row.id)"
|
>
|
||||||
>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
<q-item-section>
|
</q-btn>
|
||||||
<div class="row items-center">
|
|
||||||
<q-icon color="red" size="17px" name="delete" />
|
<q-btn
|
||||||
<div class="q-pl-md">ลบ</div>
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
</div>
|
flat
|
||||||
</q-item-section>
|
round
|
||||||
</q-item>
|
dense
|
||||||
</q-list>
|
icon="mdi-delete"
|
||||||
</q-menu>
|
color="red"
|
||||||
|
@click.stop="onClickDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
|
@ -447,8 +461,6 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{ col.value != "" ? col.value : "-" }}</div>
|
<div v-else>{{ col.value != "" ? col.value : "-" }}</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
|
@ -472,6 +484,7 @@ onMounted(() => {
|
||||||
v-model:isStatusEdit="isStatusEdit"
|
v-model:isStatusEdit="isStatusEdit"
|
||||||
:data="dataRow"
|
:data="dataRow"
|
||||||
:get-data-Main="getData"
|
:get-data-Main="getData"
|
||||||
|
:actionsType="actionsType"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, watch } from "vue";
|
import { ref, reactive, onMounted, 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";
|
||||||
ItemsMenu,
|
|
||||||
NewPagination,
|
|
||||||
} from "@/modules/13_salary/interface/index/Main";
|
|
||||||
import type { FormFilter } from "@/modules/13_salary/interface/request/EmployeeChart";
|
import type { FormFilter } from "@/modules/13_salary/interface/request/EmployeeChart";
|
||||||
import type { EmployeeSalary } from "@/modules/13_salary/interface/response/salaryEmployeeChart";
|
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 modalDialogEmployeeChart = ref<boolean>(false);
|
||||||
const isStatusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false);
|
||||||
|
const activeType = ref<string>("");
|
||||||
const dataRow = ref<EmployeeSalary>();
|
const dataRow = ref<EmployeeSalary>();
|
||||||
|
|
||||||
/** ข้อมูล Table*/
|
/** ข้อมูล Table*/
|
||||||
|
|
@ -92,34 +91,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",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
/** function fetch ข้แมูลรายาการผังบัญชีค่าจ้างลูกจ้างประจำ */
|
/** function fetch ข้แมูลรายาการผังบัญชีค่าจ้างลูกจ้างประจำ */
|
||||||
function fetchListChart() {
|
function fetchListChart() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -141,38 +112,39 @@ function fetchListChart() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* function เลือกเมนู
|
// * function เลือกเมนู
|
||||||
* @param type ประเทภเมนู
|
// * @param type ประเทภเมนู
|
||||||
* @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
// * @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||||
*/
|
// */
|
||||||
function onClickAction(type: string, data: EmployeeSalary) {
|
// function onClickAction(type: string, data: EmployeeSalary) {
|
||||||
switch (type) {
|
// switch (type) {
|
||||||
case "edit":
|
// case "edit":
|
||||||
onEdit(data);
|
// onEdit(data);
|
||||||
break;
|
// break;
|
||||||
case "upload":
|
// case "upload":
|
||||||
onUpload(data.id, data.isActive);
|
// onUpload(data.id, data.isActive);
|
||||||
break;
|
// break;
|
||||||
case "salaryRate":
|
// case "salaryRate":
|
||||||
onSalaryRate(data.id);
|
// onSalaryRate(data.id);
|
||||||
break;
|
// break;
|
||||||
case "copy":
|
// case "copy":
|
||||||
onCoppy(data.id);
|
// onCoppy(data.id);
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function openDialog แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ
|
* function openDialog แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||||
* @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
* @param data ข้อมูลผังบัญชีค่าจ้างลูกจ้างประจำ
|
||||||
*/
|
*/
|
||||||
function onEdit(data: EmployeeSalary) {
|
function onEdit(data: EmployeeSalary, type: string) {
|
||||||
modalDialogEmployeeChart.value = true;
|
activeType.value = type;
|
||||||
isStatusEdit.value = true;
|
isStatusEdit.value = true;
|
||||||
dataRow.value = data;
|
dataRow.value = data;
|
||||||
|
modalDialogEmployeeChart.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const modalDialogUpload = ref<boolean>(false);
|
const modalDialogUpload = ref<boolean>(false);
|
||||||
|
|
@ -205,9 +177,9 @@ function onSalaryRate(id: string) {
|
||||||
function onCoppy(id: string) {
|
function onCoppy(id: string) {
|
||||||
http
|
http
|
||||||
.post(config.API.salaryEmployeeChartCopy, { id: id })
|
.post(config.API.salaryEmployeeChartCopy, { id: id })
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
fetchListChart();
|
await fetchListChart();
|
||||||
success($q, "คัดลอกข้อมูลสำเร็จ");
|
await success($q, "คัดลอกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -222,9 +194,9 @@ function onClickDelete(id: string) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, () => {
|
||||||
http
|
http
|
||||||
.delete(config.API.salaryEmployeeChartByid(id))
|
.delete(config.API.salaryEmployeeChartByid(id))
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
fetchListChart();
|
await fetchListChart();
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
await success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -273,7 +245,14 @@ onMounted(() => {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-toolbar class="text-primary" style="padding: 0px">
|
<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-tooltip>เพิ่ม </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -330,43 +309,121 @@ onMounted(() => {
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<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
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click.stop="onClickAction(item.type, props.row)"
|
@click.stop="onSalaryRate(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
<q-icon
|
<q-icon
|
||||||
:color="item.color"
|
color="secondary"
|
||||||
size="17px"
|
size="xs"
|
||||||
:name="item.icon"
|
name="mdi-format-list-bulleted-triangle"
|
||||||
/>
|
/>
|
||||||
<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="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
|
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>
|
||||||
|
|
@ -390,7 +447,6 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{ col.value ? col.value : "-" }}</div>
|
<div v-else>{{ col.value ? col.value : "-" }}</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
|
@ -414,6 +470,7 @@ onMounted(() => {
|
||||||
:isStatusEdit="isStatusEdit"
|
:isStatusEdit="isStatusEdit"
|
||||||
:data="dataRow as EmployeeSalary"
|
:data="dataRow as EmployeeSalary"
|
||||||
:fetchData="fetchListChart"
|
:fetchData="fetchListChart"
|
||||||
|
:activeType="activeType"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DialogEmployeeUpload
|
<DialogEmployeeUpload
|
||||||
|
|
|
||||||
|
|
@ -32,14 +32,14 @@ const store = useSalaryEmployeeChartDataStore();
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-tab-panels v-model="store.mainTab" animated>
|
<q-tab-panels v-model="store.mainTab" animated>
|
||||||
<q-tab-panel name="structure">
|
<q-tab-panel name="structure" class="q-pt-none">
|
||||||
<div class="q-pa-sm">
|
<div class="q-pa-xs">
|
||||||
<TabStructure />
|
<TabStructure />
|
||||||
</div>
|
</div>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
||||||
<q-tab-panel name="criteria">
|
<q-tab-panel name="criteria" class="q-pt-none">
|
||||||
<div class="q-pa-sm">
|
<div class="q-pa-xs">
|
||||||
<TabCriteris />
|
<TabCriteris />
|
||||||
</div>
|
</div>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, watch } from "vue";
|
import { ref, reactive, onMounted, 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";
|
||||||
|
|
@ -145,20 +146,6 @@ const modalDialogEmployeeRate = ref<boolean>(false);
|
||||||
const isStatusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false);
|
||||||
const dataRow = ref<EmployeeRateSalary>();
|
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) {
|
function onEdit(data: EmployeeRateSalary) {
|
||||||
modalDialogEmployeeRate.value = true;
|
modalDialogEmployeeRate.value = true;
|
||||||
isStatusEdit.value = true;
|
isStatusEdit.value = true;
|
||||||
|
|
@ -186,11 +173,6 @@ function onClickAdd() {
|
||||||
isStatusEdit.value = false;
|
isStatusEdit.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterFn() {
|
|
||||||
formFilter.page = 1;
|
|
||||||
fetchSalalyEmployeeRate();
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatePage(val: number) {
|
function updatePage(val: number) {
|
||||||
formFilter.page = val;
|
formFilter.page = val;
|
||||||
fetchSalalyEmployeeRate();
|
fetchSalalyEmployeeRate();
|
||||||
|
|
@ -243,12 +225,19 @@ onMounted(async () => {
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
@click="router.go(-1)"
|
@click="router.go(-1)"
|
||||||
/>
|
/>
|
||||||
อัตราค่าจ้างของ กลุ่มที่ {{ groupSalary }}
|
อัตราค่าจ้างของกลุ่มที่ {{ groupSalary }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="q-pa-md">
|
<q-card flat bordered class="q-pa-md">
|
||||||
<q-toolbar class="text-primary" style="padding: 0px">
|
<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-tooltip>เพิ่ม </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -259,34 +248,6 @@ onMounted(async () => {
|
||||||
color="blue"
|
color="blue"
|
||||||
@click="clickDownload()"
|
@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>
|
</q-toolbar>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<d-table
|
<d-table
|
||||||
|
|
@ -314,41 +275,28 @@ onMounted(async () => {
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td v-if="!isActive">
|
<q-td v-if="!isActive">
|
||||||
<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'
|
||||||
|
? onEdit(props.row)
|
||||||
|
: item.type === 'delete'
|
||||||
|
? onDelete(props.row.id)
|
||||||
|
: null
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-tooltip>{{ item.label }}</q-tooltip>
|
||||||
<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-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
{{ col.value ? col.value : "-" }}
|
{{ col.value ? col.value : "-" }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
|
|
|
||||||
|
|
@ -176,17 +176,18 @@ function onClickSalaryRate(type: string, data: SalaryRate | null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickDelete(id: string) {
|
function onClickDelete(id: string) {
|
||||||
dialogRemove($q, async () => {
|
dialogRemove($q, () => {
|
||||||
await http
|
showLoader();
|
||||||
|
http
|
||||||
.delete(config.API.salaryRateListByid(id))
|
.delete(config.API.salaryRateListByid(id))
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
await fetchListSalalyRate();
|
||||||
|
await success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
fetchListSalalyRate();
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue