ทะเบียน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-13 17:30:07 +07:00
parent 6acdb4722e
commit 619f36212a
11 changed files with 257 additions and 74 deletions

View file

@ -390,7 +390,7 @@ const {
dateToISO,
showLoader,
hideLoader,
dialogConfirm
dialogConfirm,
} = mixin;
const route = useRoute();
@ -736,7 +736,10 @@ const fetchData = async () => {
totalLeave: e.totalLeave,
status: e.status,
reason: e.reason,
typeLeaveId: e.typeLeaveId,
typeLeaveId:
e.typeLeaveId !== "00000000-0000-0000-0000-000000000000"
? e.typeLeaveId
: "",
});
});
})
@ -791,7 +794,10 @@ const clickHistory = async (row: RequestItemsObject) => {
totalLeave: e.totalLeave,
status: e.status,
reason: e.reason,
typeLeaveId: e.typeLeaveId,
typeLeaveId:
e.typeLeaveId !== "00000000-0000-0000-0000-000000000000"
? e.typeLeaveId
: "",
});
});
})
@ -952,10 +958,10 @@ const clickCancel = async () => {
// * dialog
// */
const clickSave = () => {
dialogConfirm($q,() => SaveData())
}
dialogConfirm($q, () => SaveData());
};
const SaveData = async () => {
await myFormAdd.value.validate().then(async (result: boolean) => {
await myFormAdd.value.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
await editData();

View file

@ -1035,11 +1035,11 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posNo",
name: "posNoEmployee",
align: "left",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "posNo",
field: "posNoEmployee",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
@ -1286,7 +1286,7 @@ const visibleColumnsHistory = ref<String[]>([
"mouthSalaryAmount",
"oc",
"positionEmployeePosition",
"posNo",
"posNoEmployee",
"positionEmployeePositionSide",
"positionEmployeeLevel",
"positionEmployeeGroup",
@ -1710,18 +1710,33 @@ const templateDetail = async () => {
/**
* กดบนทกใน dialog
*/
const clickSave = () => {
dialogConfirm($q, () => SaveData());
};
const SaveData = async () => {
const clickSave = async () => {
// dialogConfirm($q, () => SaveData());
if (amount.value == 0) {
amount.value = null;
}
await myForm.value.validate().then(async (result: boolean) => {
if (result && agencyId.value) {
if (modalEdit.value) {
await editData();
dialogConfirm(
$q,
async () => {
await editData();
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
} else {
await saveData();
dialogConfirm(
$q,
async () => {
await saveData();
},
"ยืนยันการเพิ่มข้อมูล",
"ต้องการยืนยันการเพิ่มข้อมูลนี้หรือไม่ ?"
);
}
} else if (agencyId.value == "") {
} else if (result && agencyId.value == "") {
dialogMessageNotify($q, "กรุณาเลือกหน่วยงาน");
}
});
@ -1903,7 +1918,7 @@ const addData = () => {
modal.value = true;
edit.value = true;
date.value = new Date();
amount.value = null;
amount.value = 0;
positionSalaryAmount.value = null;
mouthSalaryAmount.value = null;
@ -1975,7 +1990,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.get(config.API.profileSalaryEmployeeHisId(row.id))
.then((res) => {
const data = res.data.result;
console.log("clickHistory", data);