no message

This commit is contained in:
Kittapath 2023-07-11 10:41:31 +07:00
parent dc05b4740c
commit cf343f7b8f
19 changed files with 2595 additions and 2416 deletions

View file

@ -909,7 +909,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<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]);
@ -1512,51 +1514,53 @@ const fetchPosition = async () => {
};
const fetchData = async () => {
loaderPage(true);
await http
.get(config.API.profileSalaryId(profileId.value))
.then((res) => {
let data = res.data.result;
rows.value = [];
data.map((e: ResponseObject) => {
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,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
if (profileId.value) {
loaderPage(true);
await http
.get(config.API.profileSalaryId(profileId.value))
.then((res) => {
let data = res.data.result;
rows.value = [];
data.map((e: ResponseObject) => {
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,
position: e.position,
positionId: e.positionId,
posNo: e.posNo,
posNoId: e.posNoId,
positionLine: e.positionLine,
positionLineId: e.positionLineId,
positionPathSide: e.positionPathSide,
positionPathSideId: e.positionPathSideId,
positionType: e.positionType,
positionTypeId: e.positionTypeId,
positionLevel: e.positionLevel,
positionLevelId: e.positionLevelId,
positionExecutive: e.positionExecutive,
positionExecutiveId: e.positionExecutiveId,
positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSideId: e.positionExecutiveSideId,
salaryClass: e.salaryClass,
salaryRef: e.salaryRef,
refCommandNo: e.refCommandNo,
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 onSelected = async (id: string) => {
@ -1762,36 +1766,38 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
await http
.post(config.API.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
amount: amount.value,
positionSalaryAmount: positionSalaryAmount.value,
mouthSalaryAmount: mouthSalaryAmount.value,
ocId: selected.value,
positionId: positionId.value,
posNoId: posNoId.value,
positionLineId: positionLineId.value,
positionPathSideId: positionPathSideId.value,
positionTypeId: positionTypeId.value,
positionLevelId: positionLevelId.value,
positionExecutiveId: positionExecutiveId.value,
positionExecutiveSideId: positionExecutiveSideId.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.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
amount: amount.value,
positionSalaryAmount: positionSalaryAmount.value,
mouthSalaryAmount: mouthSalaryAmount.value,
ocId: selected.value,
positionId: positionId.value,
posNoId: posNoId.value,
positionLineId: positionLineId.value,
positionPathSideId: positionPathSideId.value,
positionTypeId: positionTypeId.value,
positionLevelId: positionLevelId.value,
positionExecutiveId: positionExecutiveId.value,
positionExecutiveSideId: positionExecutiveSideId.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();
});
}
};
/**