รายละเอียดทะเบียนประวัติลูกจ้าง

This commit is contained in:
Thanit Konmek 2023-07-07 15:29:37 +07:00
parent bdc7ab8df3
commit 1e02f42b58
26 changed files with 2419 additions and 1031 deletions

View file

@ -500,6 +500,10 @@ const props = defineProps({
type: Boolean,
required: true,
},
statusAdd: {
type: Boolean,
default: false,
},
});
const $q = useQuasar();
@ -822,7 +826,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขตำแ
const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString());
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<ResponseObjectEmployee[]>([]);
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]);
@ -1328,45 +1334,47 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const fetchData = async () => {
loaderPage(true);
await http
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
const data = res.data.result;
// console.log(data);
rows.value = [];
data.map((e: ResponseObjectEmployee) => {
rows.value.push({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
posNo: e.posNo,
posNoId: e.posNoId,
posNoEmployee: e.posNoEmployee,
positionEmployeeGroup: e.positionEmployeeGroup,
positionEmployeeGroupId: e.positionEmployeeGroupId,
positionEmployeeLevel: e.positionEmployeeLevel,
positionEmployeeLevelId: e.positionEmployeeLevelId,
positionEmployeePosition: e.positionEmployeePosition,
positionEmployeePositionId: e.positionEmployeePositionId,
positionEmployeePositionSide: e.positionEmployeePositionSide,
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
if (profileId.value !== "") {
await http
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
const data = res.data.result;
// console.log(data);
rows.value = [];
data.map((e: ResponseObjectEmployee) => {
rows.value.push({
id: e.id,
date: new Date(e.date),
amount: e.amount,
positionSalaryAmount: e.positionSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount,
oc: e.oc,
ocId: e.ocId,
posNo: e.posNo,
posNoId: e.posNoId,
posNoEmployee: e.posNoEmployee,
positionEmployeeGroup: e.positionEmployeeGroup,
positionEmployeeGroupId: e.positionEmployeeGroupId,
positionEmployeeLevel: e.positionEmployeeLevel,
positionEmployeeLevelId: e.positionEmployeeLevelId,
positionEmployeePosition: e.positionEmployeePosition,
positionEmployeePositionId: e.positionEmployeePositionId,
positionEmployeePositionSide: e.positionEmployeePositionSide,
positionEmployeePositionSideId: e.positionEmployeePositionSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
}
};
const fetchPositionNumber = async (id: string) => {
@ -1548,33 +1556,35 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
await http
.post(config.API.profileSalaryEmployeeId(profileId.value), {
amount: amount.value,
date: dateToISO(date.value),
positionSalaryAmount: positionSalaryAmount.value,
mouthSalaryAmount: mouthSalaryAmount.value,
ocId: agencyId.value,
// posNoId: posNoId.value,
posNoEmployee: posNoEmployee.value,
positionEmployeeGroupId: employeeGroupId.value,
positionEmployeeLevelId: employeeLevelId.value,
positionEmployeePositionId: employeePositionId.value,
positionEmployeePositionSideId: employeePositionSideId.value,
salaryClass: salaryClass.value,
salaryRef: salaryRef.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
if (profileId.value !== "") {
loaderPage(true);
await http
.post(config.API.profileSalaryEmployeeId(profileId.value), {
amount: amount.value,
date: dateToISO(date.value),
positionSalaryAmount: positionSalaryAmount.value,
mouthSalaryAmount: mouthSalaryAmount.value,
ocId: agencyId.value,
// posNoId: posNoId.value,
posNoEmployee: posNoEmployee.value,
positionEmployeeGroupId: employeeGroupId.value,
positionEmployeeLevelId: employeeLevelId.value,
positionEmployeePositionId: employeePositionId.value,
positionEmployeePositionSideId: employeePositionSideId.value,
salaryClass: salaryClass.value,
salaryRef: salaryRef.value,
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await fetchData();
});
}
};
/**