no message
This commit is contained in:
parent
dc05b4740c
commit
cf343f7b8f
19 changed files with 2595 additions and 2416 deletions
|
|
@ -918,7 +918,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 ? 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[]>([]);
|
||||
|
|
@ -1466,48 +1468,50 @@ 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,
|
||||
refCommandNo: e.refCommandNo,
|
||||
// refCommandDate: new Date(e.refCommandDate),
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
if (profileId.value) {
|
||||
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,
|
||||
refCommandNo: e.refCommandNo,
|
||||
// refCommandDate: new Date(e.refCommandDate),
|
||||
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) => {
|
||||
|
|
@ -1691,34 +1695,36 @@ 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,
|
||||
refCommandNo: refCommandNo.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,
|
||||
refCommandNo: refCommandNo.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue