ปรับ ข้อมูลเงินเดือน/ค่าจ้าง
This commit is contained in:
parent
4364bd26aa
commit
179a2b395e
6 changed files with 114 additions and 46 deletions
|
|
@ -15,11 +15,10 @@ export default {
|
|||
|
||||
// ประวัติส่วนตัว
|
||||
profileNewProfileByProfileId: (profileId: string) =>
|
||||
`${registryNew}${profileId}`,
|
||||
profileNewProfileById: (dataId: string) =>
|
||||
`${registryNew}${dataId}`,
|
||||
`${registryNew}${profileId}`,
|
||||
profileNewProfileById: (dataId: string) => `${registryNew}${dataId}`,
|
||||
profileNewProfileHisById: (dataId: string) =>
|
||||
`${registryNew}history/${dataId}`,
|
||||
`${registryNew}history/${dataId}`,
|
||||
|
||||
// บันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
||||
profileNewNoPaid: `${registryNew}nopaid`,
|
||||
|
|
@ -98,30 +97,34 @@ export default {
|
|||
profileNewOtherHisById: (dataId: string) =>
|
||||
`${registryNew}other/history/${dataId}`,
|
||||
|
||||
// ข้อมูลครอบครัว
|
||||
profileNewFamily: `${registryNew}family`,
|
||||
profileNewFamilyByProfileId: (profileId: string) =>
|
||||
`${registryNew}family/${profileId}`,
|
||||
profileNewFamilyByFamilyId: (familyId: string) =>
|
||||
`${registryNew}family/${familyId}`,
|
||||
profileNewFamilyeHisByFamilyId: (familyId: string) =>
|
||||
`${registryNew}family/history/${familyId}`,
|
||||
// ข้อมูลครอบครัว
|
||||
profileNewFamily: `${registryNew}family`,
|
||||
profileNewFamilyByProfileId: (profileId: string) =>
|
||||
`${registryNew}family/${profileId}`,
|
||||
profileNewFamilyByFamilyId: (familyId: string) =>
|
||||
`${registryNew}family/${familyId}`,
|
||||
profileNewFamilyeHisByFamilyId: (familyId: string) =>
|
||||
`${registryNew}family/history/${familyId}`,
|
||||
|
||||
// วินัย
|
||||
profileNewDiscipline: `${registryNew}discipline`,
|
||||
profileNewDisciplineByProfileId: (profileId: string) =>
|
||||
`${registryNew}discipline/${profileId}`,
|
||||
profileNewDisciplineByDisciplineId: (disciplineId: string) =>
|
||||
`${registryNew}discipline/${disciplineId}`,
|
||||
profileNewDisciplineHisByDisciplineId: (disciplineId: string) =>
|
||||
`${registryNew}discipline/history/${disciplineId}`,
|
||||
// วินัย
|
||||
profileNewDiscipline: `${registryNew}discipline`,
|
||||
profileNewDisciplineByProfileId: (profileId: string) =>
|
||||
`${registryNew}discipline/${profileId}`,
|
||||
profileNewDisciplineByDisciplineId: (disciplineId: string) =>
|
||||
`${registryNew}discipline/${disciplineId}`,
|
||||
profileNewDisciplineHisByDisciplineId: (disciplineId: string) =>
|
||||
`${registryNew}discipline/history/${disciplineId}`,
|
||||
|
||||
// ปฏิบัติราชการพิเศษ
|
||||
profileNewDuty: `${registryNew}duty`,
|
||||
profileNewDutyByProfileId: (profileId: string) =>
|
||||
`${registryNew}duty/${profileId}`,
|
||||
profileNewDutyByDutyId: (dutyId: string) =>
|
||||
`${registryNew}duty/${dutyId}`,
|
||||
profileNewDutyHisByDutyId: (dutyId: string) =>
|
||||
`${registryNew}duty/history/${dutyId}`,
|
||||
// ปฏิบัติราชการพิเศษ
|
||||
profileNewDuty: `${registryNew}duty`,
|
||||
profileNewDutyByProfileId: (profileId: string) =>
|
||||
`${registryNew}duty/${profileId}`,
|
||||
profileNewDutyByDutyId: (dutyId: string) => `${registryNew}duty/${dutyId}`,
|
||||
profileNewDutyHisByDutyId: (dutyId: string) =>
|
||||
`${registryNew}duty/history/${dutyId}`,
|
||||
|
||||
/** ตำแหน่งเงินเดือน*/
|
||||
profileSalaryNew: `${env.API_URI}/org/profileSalary`,
|
||||
profileSalaryNewById: (id: string) =>
|
||||
`${env.API_URI}/org/profileSalary/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ const OpsFilter = ref<InsigniaOps>({
|
|||
insigniaOptions: [],
|
||||
});
|
||||
|
||||
const note = ref<string>();
|
||||
const note = ref<string | null>();
|
||||
const insigniaType = ref<string>();
|
||||
const year = ref<number | null>(0);
|
||||
const no = ref<string>();
|
||||
|
|
@ -1356,7 +1356,7 @@ const selectData = async (props: DataProps) => {
|
|||
refCommandDateInput.value = props.row.refCommandDate
|
||||
? convertDateDisplay(props.row.refCommandDate as Date)
|
||||
: "";
|
||||
note.value = props.row.note;
|
||||
note.value = props?.row?.note;
|
||||
await checkRowPage();
|
||||
};
|
||||
|
||||
|
|
@ -1451,6 +1451,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
note: e.note,
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
|
|||
|
|
@ -17,11 +17,12 @@ interface RequestItemsObject {
|
|||
section: string;
|
||||
page: string;
|
||||
receiveDate: Date;
|
||||
dateAnnounce: Date|string|null;
|
||||
dateAnnounce: Date | string | null;
|
||||
refCommandNo: string;
|
||||
refCommandDate: Date | null|string;
|
||||
refCommandDate: Date | null | string;
|
||||
createdFullName: string;
|
||||
createdAt: Date;
|
||||
note: string | null;
|
||||
}
|
||||
|
||||
//columns
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ interface ResponseObject {
|
|||
refCommandDate: Date | null;
|
||||
createdFullName: string;
|
||||
createdAt: Date;
|
||||
note: string;
|
||||
}
|
||||
|
||||
export type { ResponseObject };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataOption2 } from "@/modules/04_registryNew/interface/index/Main";
|
||||
|
|
@ -14,9 +17,20 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useSalaryDataStore } from "@/modules/04_registryNew/stores/salary";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const store = useSalaryDataStore();
|
||||
const { date2Thai, dialogConfirm, showLoader, hideLoader, messageError } =
|
||||
useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
} = useCounterMixin();
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
|
|
@ -132,7 +146,6 @@ const visibleColumns = ref<string[]>([
|
|||
"salaryRef",
|
||||
"refCommandNo",
|
||||
]);
|
||||
|
||||
const formFilter = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -227,8 +240,28 @@ const posTypeOptions = ref<DataOption2[]>(store.optionTemplatePos);
|
|||
const posLevelOption = ref<DataOption2[]>(store.optionTemplatePos);
|
||||
const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
|
||||
|
||||
function fetchListSalary() {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.profileSalaryNewById("59134ef9-9e62-41d0-aac5-339be727f2b1")
|
||||
)
|
||||
.then((res) => {
|
||||
// console.log(res);
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
||||
isStatusEdit.value = statusEdit;
|
||||
modalDialogSalary.value = true;
|
||||
|
||||
formDataSalary.date = statusEdit ? data.date : null;
|
||||
formDataSalary.posNo = statusEdit ? data.posNo : "";
|
||||
// formDataSalary.templatePos = statusEdit ? data.templatePos : "";
|
||||
|
|
@ -249,11 +282,12 @@ function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
|||
// formDataSalary.templateDoc = statusEdit ? data.templateDoc : "";
|
||||
formDataSalary.doc = statusEdit ? data.salaryRef : "";
|
||||
}
|
||||
|
||||
function onClickCloseDialog() {
|
||||
modalDialogSalary.value = false;
|
||||
}
|
||||
|
||||
const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||
function filterSelector(val: any, update: Function, filtername: string) {
|
||||
switch (filtername) {
|
||||
case "pos":
|
||||
update(() => {
|
||||
|
|
@ -294,7 +328,8 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function updatePos(val: string) {
|
||||
formDataSalary.position = val;
|
||||
}
|
||||
|
|
@ -316,23 +351,38 @@ function onSubmit() {
|
|||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
dialogConfirm($q, () => {
|
||||
onClickCloseDialog();
|
||||
submit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
try {
|
||||
const url = isStatusEdit.value
|
||||
? config.API.profileSalaryNewById("12312")
|
||||
: config.API.profileSalaryNew;
|
||||
const method = isStatusEdit.value ? "put" : "post";
|
||||
await http[method](url, formDataSalary);
|
||||
fetchListSalary();
|
||||
onClickCloseDialog();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
} catch (e) {
|
||||
messageError($q, e);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
}
|
||||
|
||||
const modalHistory = ref<boolean>(false);
|
||||
function ocClikcHistory() {
|
||||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchListSalary();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<!-- <div class="row items-center q-gutter-sm">
|
||||
<div class="toptitle text-dark row items-center q-py-xs">
|
||||
ตำแหน่งเงินเดือน
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<q-toolbar style="padding: 0px" class="text-primary">
|
||||
<q-btn flat round dense icon="add" @click="onClickOpenDialog()">
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
|
|
|
|||
|
|
@ -6,4 +6,16 @@ interface RowList {
|
|||
refCommandNo: string;
|
||||
refCommandDate: Date | null;
|
||||
}
|
||||
export type { RowList };
|
||||
|
||||
interface ObjectSalaryRef {
|
||||
date: object | null;
|
||||
posNo: object | null;
|
||||
position: object | null;
|
||||
typePosition: object | null;
|
||||
levelPosition: object | null;
|
||||
salary: object | null;
|
||||
doc: object | null;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
export type { RowList, ObjectSalaryRef };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue