ปรับ ข้อมูลเงินเดือน/ค่าจ้าง
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) =>
|
profileNewProfileByProfileId: (profileId: string) =>
|
||||||
`${registryNew}${profileId}`,
|
`${registryNew}${profileId}`,
|
||||||
profileNewProfileById: (dataId: string) =>
|
profileNewProfileById: (dataId: string) => `${registryNew}${dataId}`,
|
||||||
`${registryNew}${dataId}`,
|
|
||||||
profileNewProfileHisById: (dataId: string) =>
|
profileNewProfileHisById: (dataId: string) =>
|
||||||
`${registryNew}history/${dataId}`,
|
`${registryNew}history/${dataId}`,
|
||||||
|
|
||||||
// บันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
// บันทึกวันที่ไม่ได้รับเงินเดือนฯ
|
||||||
profileNewNoPaid: `${registryNew}nopaid`,
|
profileNewNoPaid: `${registryNew}nopaid`,
|
||||||
|
|
@ -98,30 +97,34 @@ export default {
|
||||||
profileNewOtherHisById: (dataId: string) =>
|
profileNewOtherHisById: (dataId: string) =>
|
||||||
`${registryNew}other/history/${dataId}`,
|
`${registryNew}other/history/${dataId}`,
|
||||||
|
|
||||||
// ข้อมูลครอบครัว
|
// ข้อมูลครอบครัว
|
||||||
profileNewFamily: `${registryNew}family`,
|
profileNewFamily: `${registryNew}family`,
|
||||||
profileNewFamilyByProfileId: (profileId: string) =>
|
profileNewFamilyByProfileId: (profileId: string) =>
|
||||||
`${registryNew}family/${profileId}`,
|
`${registryNew}family/${profileId}`,
|
||||||
profileNewFamilyByFamilyId: (familyId: string) =>
|
profileNewFamilyByFamilyId: (familyId: string) =>
|
||||||
`${registryNew}family/${familyId}`,
|
`${registryNew}family/${familyId}`,
|
||||||
profileNewFamilyeHisByFamilyId: (familyId: string) =>
|
profileNewFamilyeHisByFamilyId: (familyId: string) =>
|
||||||
`${registryNew}family/history/${familyId}`,
|
`${registryNew}family/history/${familyId}`,
|
||||||
|
|
||||||
// วินัย
|
// วินัย
|
||||||
profileNewDiscipline: `${registryNew}discipline`,
|
profileNewDiscipline: `${registryNew}discipline`,
|
||||||
profileNewDisciplineByProfileId: (profileId: string) =>
|
profileNewDisciplineByProfileId: (profileId: string) =>
|
||||||
`${registryNew}discipline/${profileId}`,
|
`${registryNew}discipline/${profileId}`,
|
||||||
profileNewDisciplineByDisciplineId: (disciplineId: string) =>
|
profileNewDisciplineByDisciplineId: (disciplineId: string) =>
|
||||||
`${registryNew}discipline/${disciplineId}`,
|
`${registryNew}discipline/${disciplineId}`,
|
||||||
profileNewDisciplineHisByDisciplineId: (disciplineId: string) =>
|
profileNewDisciplineHisByDisciplineId: (disciplineId: string) =>
|
||||||
`${registryNew}discipline/history/${disciplineId}`,
|
`${registryNew}discipline/history/${disciplineId}`,
|
||||||
|
|
||||||
// ปฏิบัติราชการพิเศษ
|
// ปฏิบัติราชการพิเศษ
|
||||||
profileNewDuty: `${registryNew}duty`,
|
profileNewDuty: `${registryNew}duty`,
|
||||||
profileNewDutyByProfileId: (profileId: string) =>
|
profileNewDutyByProfileId: (profileId: string) =>
|
||||||
`${registryNew}duty/${profileId}`,
|
`${registryNew}duty/${profileId}`,
|
||||||
profileNewDutyByDutyId: (dutyId: string) =>
|
profileNewDutyByDutyId: (dutyId: string) => `${registryNew}duty/${dutyId}`,
|
||||||
`${registryNew}duty/${dutyId}`,
|
profileNewDutyHisByDutyId: (dutyId: string) =>
|
||||||
profileNewDutyHisByDutyId: (dutyId: string) =>
|
`${registryNew}duty/history/${dutyId}`,
|
||||||
`${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: [],
|
insigniaOptions: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
const note = ref<string>();
|
const note = ref<string | null>();
|
||||||
const insigniaType = ref<string>();
|
const insigniaType = ref<string>();
|
||||||
const year = ref<number | null>(0);
|
const year = ref<number | null>(0);
|
||||||
const no = ref<string>();
|
const no = ref<string>();
|
||||||
|
|
@ -1356,7 +1356,7 @@ const selectData = async (props: DataProps) => {
|
||||||
refCommandDateInput.value = props.row.refCommandDate
|
refCommandDateInput.value = props.row.refCommandDate
|
||||||
? convertDateDisplay(props.row.refCommandDate as Date)
|
? convertDateDisplay(props.row.refCommandDate as Date)
|
||||||
: "";
|
: "";
|
||||||
note.value = props.row.note;
|
note.value = props?.row?.note;
|
||||||
await checkRowPage();
|
await checkRowPage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1451,6 +1451,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
||||||
e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
||||||
createdFullName: e.createdFullName,
|
createdFullName: e.createdFullName,
|
||||||
createdAt: new Date(e.createdAt),
|
createdAt: new Date(e.createdAt),
|
||||||
|
note: e.note,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,12 @@ interface RequestItemsObject {
|
||||||
section: string;
|
section: string;
|
||||||
page: string;
|
page: string;
|
||||||
receiveDate: Date;
|
receiveDate: Date;
|
||||||
dateAnnounce: Date|string|null;
|
dateAnnounce: Date | string | null;
|
||||||
refCommandNo: string;
|
refCommandNo: string;
|
||||||
refCommandDate: Date | null|string;
|
refCommandDate: Date | null | string;
|
||||||
createdFullName: string;
|
createdFullName: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
note: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//columns
|
//columns
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ interface ResponseObject {
|
||||||
refCommandDate: Date | null;
|
refCommandDate: Date | null;
|
||||||
createdFullName: string;
|
createdFullName: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
note: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { ResponseObject };
|
export type { ResponseObject };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
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 { QTableProps } from "quasar";
|
||||||
import type { DataOption2 } from "@/modules/04_registryNew/interface/index/Main";
|
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";
|
import { useSalaryDataStore } from "@/modules/04_registryNew/stores/salary";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const route = useRoute();
|
||||||
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
const store = useSalaryDataStore();
|
const store = useSalaryDataStore();
|
||||||
const { date2Thai, dialogConfirm, showLoader, hideLoader, messageError } =
|
const {
|
||||||
useCounterMixin();
|
date2Thai,
|
||||||
|
dialogConfirm,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "date",
|
name: "date",
|
||||||
|
|
@ -132,7 +146,6 @@ const visibleColumns = ref<string[]>([
|
||||||
"salaryRef",
|
"salaryRef",
|
||||||
"refCommandNo",
|
"refCommandNo",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const formFilter = reactive({
|
const formFilter = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -227,8 +240,28 @@ const posTypeOptions = ref<DataOption2[]>(store.optionTemplatePos);
|
||||||
const posLevelOption = ref<DataOption2[]>(store.optionTemplatePos);
|
const posLevelOption = ref<DataOption2[]>(store.optionTemplatePos);
|
||||||
const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
|
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 = []) {
|
function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
||||||
|
isStatusEdit.value = statusEdit;
|
||||||
modalDialogSalary.value = true;
|
modalDialogSalary.value = true;
|
||||||
|
|
||||||
formDataSalary.date = statusEdit ? data.date : null;
|
formDataSalary.date = statusEdit ? data.date : null;
|
||||||
formDataSalary.posNo = statusEdit ? data.posNo : "";
|
formDataSalary.posNo = statusEdit ? data.posNo : "";
|
||||||
// formDataSalary.templatePos = statusEdit ? data.templatePos : "";
|
// formDataSalary.templatePos = statusEdit ? data.templatePos : "";
|
||||||
|
|
@ -249,11 +282,12 @@ function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
||||||
// formDataSalary.templateDoc = statusEdit ? data.templateDoc : "";
|
// formDataSalary.templateDoc = statusEdit ? data.templateDoc : "";
|
||||||
formDataSalary.doc = statusEdit ? data.salaryRef : "";
|
formDataSalary.doc = statusEdit ? data.salaryRef : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickCloseDialog() {
|
function onClickCloseDialog() {
|
||||||
modalDialogSalary.value = false;
|
modalDialogSalary.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterSelector = (val: any, update: Function, filtername: string) => {
|
function filterSelector(val: any, update: Function, filtername: string) {
|
||||||
switch (filtername) {
|
switch (filtername) {
|
||||||
case "pos":
|
case "pos":
|
||||||
update(() => {
|
update(() => {
|
||||||
|
|
@ -294,7 +328,8 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function updatePos(val: string) {
|
function updatePos(val: string) {
|
||||||
formDataSalary.position = val;
|
formDataSalary.position = val;
|
||||||
}
|
}
|
||||||
|
|
@ -316,23 +351,38 @@ function onSubmit() {
|
||||||
}
|
}
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
dialogConfirm($q, () => {
|
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);
|
const modalHistory = ref<boolean>(false);
|
||||||
function ocClikcHistory() {
|
function ocClikcHistory() {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchListSalary();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<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-toolbar style="padding: 0px" class="text-primary">
|
||||||
<q-btn flat round dense icon="add" @click="onClickOpenDialog()">
|
<q-btn flat round dense icon="add" @click="onClickOpenDialog()">
|
||||||
<q-tooltip>เพิ่ม</q-tooltip>
|
<q-tooltip>เพิ่ม</q-tooltip>
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,16 @@ interface RowList {
|
||||||
refCommandNo: string;
|
refCommandNo: string;
|
||||||
refCommandDate: Date | null;
|
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