รายการเลื่อนเงินเดือนลูกจ้างประจำ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-19 13:30:19 +07:00
parent ee6603eaae
commit 90960dd551
12 changed files with 138 additions and 121 deletions

View file

@ -65,4 +65,14 @@ export default {
salaryListPeriodQuotaEmp: (id: string) => `${salaryPeriodEmp}/quota/${id}`,
salaryListPeriodORGEmp: (id: string) => `${salaryPeriodEmp}/org/${id}`,
salaryPeriodProfileEmp: `${salaryPeriodEmp}/org/profile`,
salaryListPersonEmp: `${env.API_URI}/org/profile-employee/salary/gen`,
salaryPeriodEmp: () => `${salaryPeriodEmp}`,
salaryPropertyEmp: (id: string) => `${salaryPeriodEmp}/org/property/${id}`,
salaryListPeriodProfileByIdEmp: (id: string) =>
`${salaryPeriodEmp}/profile/${id}`,
salaryPeriodStatusEmp: (type: string, periodId: string, rootId: string) =>
`${salaryPeriodEmp}/${type}/approve/${periodId}/${rootId}`,
salaryPeriodStatusCommentEmp: (type: string, periodId: string, rootId: string) =>
`${salaryPeriodEmp}/${type}/comment/${periodId}/${rootId}`,
};

View file

@ -112,19 +112,12 @@ function closeModal() {
/** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/
function fetchListPerson() {
showLoader();
// formFilter.rootId = store.rootId;
// formFilter.period = store.roundMainCode;
// formFilter.year = store.roundYear;
const reqBody = {
posTypeId: "", // id
posLevelId: "", // id
position: "", //
page: formFilter.page, //*
pageSize: formFilter.pageSize, //*
keyword: formFilter.keyword, //
};
formFilter.rootId = store.rootId;
formFilter.period = store.roundMainCode;
formFilter.year = store.roundYear;
http
.post(config.API.orgSearchProfileEmp, reqBody)
.post(config.API.salaryListPersonEmp, formFilter)
.then((res) => {
const data = res.data.result.data;
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);

View file

@ -53,7 +53,7 @@ function onSubmit() {
: Number(amountString.replace(/,/g, "")),
};
http
.post(config.API.salaryPeriod() + `/change/amount`, body)
.post(config.API.salaryPeriodEmp() + `/change/amount`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();

View file

@ -14,14 +14,8 @@ import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/Salar
/** use*/
const $q = useQuasar();
const store = useSalaryEmployeeListSDataStore();
const {
dialogConfirm,
success,
messageError,
showLoader,
hideLoader,
dialogMessageNotify,
} = useCounterMixin();
const { dialogConfirm, success, messageError, showLoader, hideLoader } =
useCounterMixin();
/**porps*/
const modal = defineModel<boolean>("modal", { required: true });
@ -41,32 +35,29 @@ const isChange = ref<boolean>(false); // มีการแก้ไขข้อ
const isReserve = ref<boolean>(false); //
const typeRangeOps = computed(() => {
return store.roundMainCode == "OCT"
return store.roundMainCode === "OCT"
? [
{ id: "NONE", name: "ไม่ได้เลื่อน" },
{ id: "HAFT", name: "0.5 ขั้น" },
{ id: "FULL", name: "1 ขั้น" },
{ id: "FULLHAFT", name: "1.5 ขั้น" },
]
: [
: store.roundMainCode === "APR"
? [
{ id: "NONE", name: "ไม่ได้เลื่อน" },
{ id: "HAFT", name: "0.5 ขั้น" },
{ id: "FULL", name: "1 ขั้น" },
]
: [
{ id: "HAFT", name: "0.5 ขั้น" },
{ id: "FULL", name: "1 ขั้น" },
];
});
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
if (typeRef.value.validate()) {
// if (
// store.roundMainCode === "APR" &&
// store.remaining === 0 &&
// type.value === "FULL"
// ) {
// dialogMessageNotify($q, "");
// } else {
onSubmit();
// }
}
}
@ -86,7 +77,7 @@ function onSubmit() {
isReserve: isReserve.value,
};
http
.post(config.API.salaryPeriod() + `/change/type`, body)
.post(config.API.salaryPeriodEmp() + `/change/type`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
@ -104,7 +95,7 @@ function onSubmit() {
watch(
() => modal.value,
() => {
type.value = props.typeLevel == 'PENDING' ? "" : props.typeLevel;
type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel;
isReserve.value = props.isReserve;
isChange.value = false;
}

View file

@ -37,34 +37,16 @@ const props = defineProps({
});
const type = ref<string>("");
const typeRef = ref<any>(null);
const isReadonly = ref<boolean>(false); //
const isPunish = ref<boolean>(false); //
const isSuspension = ref<boolean>(false); //
const isAbsent = ref<boolean>(false); //
const isLeave = ref<boolean>(false); //
const typeRangeOps = computed(() => {
return store.roundMainCode == "OCT"
? [
{ id: "NONE", name: "ไม่ได้เลื่อน" },
{ id: "HAFT", name: "0.5 ขั้น" },
{ id: "FULL", name: "1 ขั้น" },
{ id: "FULLHAFT", name: "1.5 ขั้น" },
]
: [
{ id: "NONE", name: "ไม่ได้เลื่อน" },
{ id: "HAFT", name: "0.5 ขั้น" },
{ id: "FULL", name: "1 ขั้น" },
];
});
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
onSubmit();
}
onSubmit();
}
/** function ปืด Popup */
function close() {
@ -77,13 +59,13 @@ function onSubmit() {
dialogConfirm($q, () => {
showLoader();
const body = {
isPunish: isPunish.value,
isSuspension: isSuspension.value,
isAbsent: isAbsent.value,
isLeave: isLeave.value,
isPunish: isPunish.value,
isSuspension: isSuspension.value,
isAbsent: isAbsent.value,
isLeave: isLeave.value,
};
http
.put(config.API.salaryProperty(profileId.value), body)
.put(config.API.salaryPropertyEmp(profileId.value), body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
@ -107,13 +89,6 @@ watch(
isLeave.value = props.isLeave;
}
);
function inputEdit(val: boolean) {
return {
"full-width cursor-pointer inputgreen ": val,
"full-width cursor-pointer inputgreen": !val,
};
}
</script>
<template>
@ -125,28 +100,28 @@ function inputEdit(val: boolean) {
<q-card-section class="scroll" style="max-height: 70vh">
<div class="q-gutter-y-sm column">
<q-checkbox
toggle-indeterminate
toggle-indeterminate
keep-color
label="ไม่ถูกลงโทษทางวินัย"
dense
v-model="isPunish"
/>
<q-checkbox
toggle-indeterminate
toggle-indeterminate
keep-color
label="ไม่ถูกพักราชการ"
dense
v-model="isSuspension"
/>
<q-checkbox
toggle-indeterminate
toggle-indeterminate
keep-color
label="ไม่ขาดราชการ"
dense
v-model="isAbsent"
/>
<q-checkbox
toggle-indeterminate
toggle-indeterminate
keep-color
label="วันลาไม่เกิน"
dense

View file

@ -12,9 +12,16 @@ const $q = useQuasar(); //ใช้ noti quasar
const mixin = useCounterMixin();
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
const props = defineProps({
rootId: String,
periodId: String,
getData: Function,
});
const sendStep = ref<number>(1);
const fileUpload = ref<any>(null);
const document = ref<string>("");
const type = ref<string>("");
/**
* function ปโหลดไฟลเจาหนาท
* @param event file
@ -47,10 +54,32 @@ async function uploadFile(event: any) {
);
}
function saveReccommend() {
function saveReccommend(reason: string) {
dialogConfirm(
$q,
async () => {
showLoader();
http
.put(
config.API.salaryPeriodStatusCommentEmp(
type.value,
props.periodId ? props.periodId : "",
props.rootId ? props.rootId : ""
),
{
titleRecommend: reason,
}
)
.then((res) => {
console.log(res);
props.getData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
},
@ -59,10 +88,29 @@ function saveReccommend() {
);
}
function sendToDirector(msg: string) {
function sendToDirector(msg: string, type: string) {
dialogConfirm(
$q,
async () => {
showLoader();
http
.get(
config.API.salaryPeriodStatusEmp(
type,
props.periodId ? props.periodId : "",
props.rootId ? props.rootId : ""
)
)
.then((res) => {
console.log(res);
props.getData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
},
"ยืนยันการ" + msg,
@ -72,9 +120,10 @@ function sendToDirector(msg: string) {
const modalRecommend = ref<boolean>(false);
const titleRecommend = ref<string>("");
function sendAndRecommend(title: string) {
function sendAndRecommend(title: string, typeOrder: string) {
modalRecommend.value = true;
titleRecommend.value = title;
type.value = typeOrder;
}
</script>
@ -128,7 +177,7 @@ function sendAndRecommend(title: string) {
unelevated
color="public"
label="ส่งเอกสารให้ ผอ. ตรวจสอบ"
@click="sendToDirector('ส่งเอกสารให้ ผอ. ตรวจสอบ')"
@click="sendToDirector('ส่งเอกสารให้ ผอ. ตรวจสอบ', 'officer')"
/>
<!-- ผอ. หนวยงานทำการยนยนและสงให สกจ. -->
@ -137,7 +186,7 @@ function sendAndRecommend(title: string) {
unelevated
color="public"
label="ยืนยันและส่งเอกสารให้ สกจ."
@click="sendToDirector('ยืนยันและส่งเอกสารให้ สกจ.')"
@click="sendToDirector('ยืนยันและส่งเอกสารให้ สกจ.', 'head')"
/>
<!-- สกจ. ตรวจสอบเอกสารและขอมลรายการเงนเดอนทแตละหนวยงานสงมา ไมปรบโควต -->
@ -146,7 +195,7 @@ function sendAndRecommend(title: string) {
unelevated
color="green"
label="ยืนยันการตรวจสอบ"
@click="sendToDirector('ยืนยันการตรวจสอบ')"
@click="sendToDirector('ยืนยันการตรวจสอบ', 'owner')"
/>
<!-- สกจ. ตรวจสอบเอกสารและขอมลรายการเงนเดอนทแตละหนวยงานสงมา ปรบโควต -->
@ -156,7 +205,7 @@ function sendAndRecommend(title: string) {
unelevated
color="warning"
label="ส่งคำแนะนำให้ ผอ. ตรวจสอบ"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ')"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ', 'owner')"
/>
<!-- ผอ.หนวยงานสงคำแนะนำใหการเจาหนาทหนวยงาน -->
@ -165,7 +214,7 @@ function sendAndRecommend(title: string) {
unelevated
color="public"
label="ส่งคำแนะนำให้การเจ้าหน้าที่หน่วยงาน"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ')"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ', 'head')"
/>
<q-btn

View file

@ -216,7 +216,6 @@ const maxPage = ref<number>(1);
* @param id กล
*/
function fetchDataQuota(id: string) {
// showLoader();
http
.get(config.API.salaryListPeriodQuotaEmp(id))
.then((res) => {
@ -240,9 +239,6 @@ function fetchDataQuota(id: string) {
.catch((err) => {
messageError($q, err);
});
// .finally(() => {
// hideLoader();
// });
}
/**

View file

@ -68,29 +68,29 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
{
name: "positionName",
name: "position",
align: "left",
label: "ตำแหน่ง",
sortable: true,
field: "positionName",
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posTypeName",
name: "posType",
align: "left",
label: "กลุ่มงาน",
sortable: false,
field: "posTypeName",
field: "posType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posLevelName",
name: "posLevel",
align: "left",
label: "ระดับชั้นงาน",
sortable: false,
field: "posLevelName",
field: "posLevel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
@ -137,9 +137,9 @@ const visibleColumns = ref<string[]>([
"no",
"posNo",
"fullName",
"positionName",
"posTypeName",
"posLevelName",
"position",
"posType",
"posLevel",
"amount",
"amountUse",
"positionSalaryAmount",
@ -204,7 +204,7 @@ function onClickDelete(id: string) {
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.salaryListPeriodProfileById(id))
.delete(config.API.salaryListPeriodProfileByIdEmp(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.();
@ -412,7 +412,7 @@ watch(
<q-menu>
<q-list dense style="min-width: 150px">
<q-item
v-for="(item, index) in store.roundCode !== 'SPECIAL' ? store.itemMenu.filter((x:any)=>x.type !== 'properties') :store.itemMenu.filter((x:any)=>x.type !== 'moveGroup' && x.type !== 'properties')"
v-for="(item, index) in store.itemMenu.filter((x:any)=>x.type !== 'moveGroup' && x.type !== 'properties')"
:key="index"
clickable
v-close-popup

View file

@ -63,28 +63,28 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
{
name: "posTypeName",
name: "posType",
align: "left",
label: "กลุ่มงาน",
sortable: true,
field: "posTypeName",
field: "posType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionName",
name: "position",
align: "left",
label: "ตำแหน่ง",
field: "positionName",
field: "position",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posLevelName",
name: "posLevel",
align: "left",
label: "ระดับชั้นงาน",
field: "posLevelName",
field: "posLevel",
sortable: true,
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -165,9 +165,9 @@ const columns = ref<QTableProps["columns"]>([
const visibleColumns = ref<string[]>([
"no",
"fullName",
"posTypeName",
"positionName",
"posLevelName",
"posType",
"position",
"posLevel",
"amount",
"organization",
"result",
@ -200,7 +200,7 @@ function onClickDelete(id: string) {
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.salaryListPeriodProfileById(id))
.delete(config.API.salaryListPeriodProfileByIdEmp(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.();
@ -492,7 +492,7 @@ watch(
<q-menu>
<q-list dense style="min-width: 150px">
<q-item
v-for="(item, index) in store.roundCode !== 'SPECIAL'? store.itemMenu :store.itemMenu.filter((x:any)=>x.type !== 'moveGroup')"
v-for="(item, index) in store.itemMenu.filter((x:any)=>x.type !== 'moveGroup')"
:key="index"
clickable
v-close-popup

View file

@ -48,7 +48,7 @@ const typeRangeOps = computed(() => {
{ id: "FULL", name: "1 ขั้น" },
{ id: "FULLHAFT", name: "1.5 ขั้น" },
]
: store.roundMainCode == "ARP"
: store.roundMainCode == "APR"
? [
{ id: "NONE", name: "ไม่ได้เลื่อน" },
{ id: "HAFT", name: "0.5 ขั้น" },

View file

@ -210,19 +210,9 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
.post(config.API.salaryListPeriodLatestEmp, body)
.then(async (res) => {
const data = res.data.result;
if (roundFilter.value.shortCode !== "SPECIAL") {
if (Object.values(data).includes(null)) {
isLoad.value = false;
} else {
data && store.fetchPeriodLatest(data, store.tabGroup);
periodLatest.value = data;
isLoad.value = true;
}
} else {
data && store.fetchPeriodLatest(data, store.tabGroup);
periodLatest.value = data;
isLoad.value = true;
}
data && store.fetchPeriodLatest(data, store.tabGroup);
periodLatest.value = data;
isLoad.value = true;
})
.catch((err) => {
messageError($q, err);
@ -301,8 +291,12 @@ function onScroll({ to, ref }: { to: number; ref: any }) {
}
}
onMounted(async () => {
await getRound();
function getQuota() {
fetchSalalyPeriod(agencyFilter.value, roundFilter.value.id, snapFilter.value);
}
onMounted(() => {
getRound();
});
</script>
@ -394,7 +388,11 @@ onMounted(async () => {
bordered
class="row col-12 q-mt-xs"
>
<ProcessStep />
<ProcessStep
:periodId="roundFilter.id"
:rootId="agencyFilter"
:get-data="getQuota"
/>
</q-card>
<!-- </q-card> -->

View file

@ -412,7 +412,12 @@ onMounted(async () => {
<q-separator /> -->
<q-card flat bordered>
<div v-if="agencyFilter !== 'ALL'">
<TabGroup v-if="isLoad" :periodLatest="periodLatest" />
<TabGroup
v-if="isLoad"
:periodLatest="periodLatest"
:periodId="roundFilter.id"
:rootId="agencyFilter"
/>
<q-card v-else class="q-pa-sm">
<div class="q-pa-sm">
<q-banner inline-actions rounded class="bg-grey-1 text-center">