Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop

This commit is contained in:
Warunee Tamkoo 2024-08-20 15:48:24 +07:00
commit 46e7fa3088
24 changed files with 175 additions and 199 deletions

View file

@ -144,8 +144,8 @@ function onSubmit() {
httpMethod(url, formData)
.then(async () => {
await props.fetchList();
onCloseDialog();
await success($q, "บันทึกข้อมูลสำเร็จ");
onCloseDialog();
})
.catch((err) => {
messageError($q, err);

View file

@ -130,11 +130,6 @@ async function fetchData() {
});
}
/** Function redirect หน้าข้อมูลรอบการเสนอข้อ */
function clickEdit(col: ColId) {
router.push(`/insignia/round/${col.period_id}`);
}
/**
* Function นยนการลบรอบการเสนอขอ
* @param id รอบการเสนขอ
@ -157,38 +152,33 @@ function clickDelete(id: string) {
});
}
/** Fnction เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ */
function clickAdd() {
router.push({ name: "roundAdd" });
}
/** Fnction คำนวณรายชื่อผู้ได้รับเครื่องราช */
async function clickListInsignia(propsId: string) {
dialogConfirm(
$q,
async () => {
await getRequest(propsId);
},
"ยืนยันการคำนวณรายชื่อผู้ได้รับเครื่องราชฯ",
"ต้องการยืนยันการคำนวณรายชื่อผู้ได้รับเครื่องราชฯนี้หรือไม่?"
);
}
// async function clickListInsignia(propsId: string) {
// dialogConfirm(
// $q,
// async () => {
// await getRequest(propsId);
// },
// "",
// "?"
// );
// }
/** Fnction เรียกจาก API ข้อมูลผู้ได้รับเครื่องราชฯ */
async function getRequest(id: string) {
showLoader();
await http
.get(config.API.requestInsignia(id))
.then(() => {
success($q, "ยืนยันสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(async () => {
await fetchData();
});
}
// async function getRequest(id: string) {
// showLoader();
// await http
// .get(config.API.requestInsignia(id))
// .then(() => {
// success($q, "");
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(async () => {
// await fetchData();
// });
// }
/** ค้นหาในตาราง */
const filterKeyword = ref<string>("");

View file

@ -178,7 +178,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.id">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}

View file

@ -36,7 +36,7 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
field: (row) => rows.value.indexOf(row) + 1,
@ -46,7 +46,7 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "ประเภทการลา",
sortable: true,
field: "leaveType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
field: (row) => row.leaveType.name,
@ -56,7 +56,7 @@ const columns = ref<QTableProps["columns"]>([
align: "left",
label: "วัน เดือน ปี ที่ลา",
sortable: true,
field: "dateLeave",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
field: (row) => dateThaiRange([row.dateLeaveStart, row.dateLeaveEnd]),
@ -203,7 +203,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props" >
<q-td v-for="col in props.cols" :key="col.id">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}

View file

@ -221,7 +221,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.id">
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}

View file

@ -148,11 +148,12 @@ function onClickAddPerson(data: DataPerson) {
dialogConfirm(
$q,
() => {
showLoader();
http
.post(config.API.salaryPeriodProfileEmp, body)
.then(() => {
props.fetchData?.();
success($q, "เพื่มรายชื่อสำเร็จ");
.then(async () => {
await props.fetchData?.();
await success($q, "เพื่มรายชื่อสำเร็จ");
closeModal();
})
.catch((err) => {

View file

@ -13,7 +13,7 @@ import { useCounterMixin } from "@/stores/mixin";
/** use*/
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm, success, messageError } = mixin;
const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin;
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
@ -44,6 +44,7 @@ function close() {
function onSubmit() {
dialogConfirm($q, () => {
if (amount.value !== null) {
showLoader();
const amountString: string = amount.value.toString();
const body = {
profileId: profileId.value,
@ -54,15 +55,16 @@ function onSubmit() {
};
http
.post(config.API.salaryPeriodEmp() + `/change/amount`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
close();
hideLoader();
});
}
});
@ -88,6 +90,7 @@ function onSubmit() {
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือนฐาน'}`]"
lazy-rules
hide-bottom-space
class="inputgreen"
/>
</div>
</q-card-section>
@ -97,10 +100,7 @@ function onSubmit() {
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -55,16 +55,16 @@ function onSubmit() {
};
http
.post(config.API.salaryPeriod() + `/change/group`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
close();
});
});
}
@ -120,10 +120,7 @@ function inputEdit(val: boolean) {
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -81,15 +81,15 @@ function onSubmit() {
};
http
.post(config.API.salaryPeriodEmp() + `/change/type`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
close();
hideLoader();
});
});
@ -168,15 +168,11 @@ function inputEdit(val: boolean) {
<q-separator />
<form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn
:disabled="!isChange"
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -66,15 +66,15 @@ function onSubmit() {
};
http
.put(config.API.salaryPropertyEmp(profileId.value), body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
close();
hideLoader();
});
});
@ -132,14 +132,10 @@ watch(
<q-separator />
<form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -67,7 +67,7 @@ async function uploadFile(event: any) {
res.data[key]?.fileName !== ""
);
const link = res.data[foundKey]?.uploadUrl;
fileUpLoad(link);
await fileUpLoad(link);
})
.catch((err) => {
messageError($q, err);
@ -85,10 +85,10 @@ function fileUpLoad(url: string) {
headers: { "Content-Type": fileUpload.value?.type },
onUploadProgress: (e) => console.log(e),
})
.then(() => {
success($q, "อัปโหลดไฟล์สำเร็จ");
.then(async () => {
await fetchListFile();
await success($q, "อัปโหลดไฟล์สำเร็จ");
fileUpload.value = null;
fetchListFile();
})
.catch((e) => {
messageError($q, e);
@ -114,9 +114,10 @@ function saveReccommend(reason: string) {
titleRecommend: reason,
}
)
.then((res) => {
console.log(res);
props.getData?.();
.then(async () => {
await props.getData?.();
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
})
.catch((e) => {
messageError($q, e);
@ -124,8 +125,6 @@ function saveReccommend(reason: string) {
.finally(() => {
hideLoader();
});
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
},
"ยืนยันการ" + titleRecommend.value,
"ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?"
@ -145,9 +144,9 @@ function sendToDirector(msg: string, type: string) {
props.rootId ? props.rootId : ""
)
)
.then((res) => {
console.log(res);
props.getData?.();
.then(async () => {
await props.getData?.();
sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
})
.catch((e) => {
messageError($q, e);
@ -155,7 +154,6 @@ function sendToDirector(msg: string, type: string) {
.finally(() => {
hideLoader();
});
sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
},
"ยืนยันการ" + msg,
"ต้องการยืนยันการ" + msg + "หรือไม่?"
@ -202,16 +200,16 @@ function onDeleteFile(fileName: string) {
)
)
.then(() => {
success($q, "ลบไฟล์สำเร็จ");
setTimeout(() => {
fetchListFile();
hideLoader();
}, 1000);
setTimeout(async () => {
await fetchListFile();
await success($q, "ลบไฟล์สำเร็จ");
await hideLoader();
}, 2000);
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {});
hideLoader();
});
});
}
@ -377,9 +375,8 @@ onMounted(() => {
dense
flat
round
size="12px"
color="blue"
icon="mdi-download-outline"
icon="mdi-download"
@click="downloadFile(item.fileName)"
>
<q-tooltip>ดาวนโหลดเอกสาร</q-tooltip>
@ -391,9 +388,8 @@ onMounted(() => {
dense
flat
round
size="12px"
color="red"
icon="mdi-delete-outline"
icon="mdi-delete"
@click="onDeleteFile(item.fileName)"
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
>

View file

@ -260,9 +260,9 @@ function onClickDelete(id: string) {
showLoader();
await http
.delete(config.API.salaryListPeriodProfileByIdEmp(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.();
.then(async () => {
await props.fetchDataTable?.();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);

View file

@ -217,9 +217,9 @@ function onClickDelete(id: string) {
showLoader();
await http
.delete(config.API.salaryListPeriodProfileByIdEmp(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.();
.then(async () => {
await props.fetchDataTable?.();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
@ -289,7 +289,6 @@ function searchData() {
}
function onProperties(data: any) {
console.log(data);
modalDialogProperties.value = true;
profileId.value = data.id;
isPunish.value = data.isPunish;
@ -382,7 +381,7 @@ function onClickViewInfo(type: string, id: string) {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" >
<q-tr :props="props">
<q-td>
<q-btn
v-if="

View file

@ -144,11 +144,12 @@ function onClickAddPerson(data: DataPerson) {
dialogConfirm(
$q,
() => {
showLoader();
http
.post(config.API.salaryPeriodProfile, body)
.then(() => {
props.fetchData?.();
success($q, "เพื่มรายชื่อสำเร็จ");
.then(async () => {
await props.fetchData?.();
await success($q, "เพื่มรายชื่อสำเร็จ");
closeModal();
})
.catch((err) => {
@ -244,11 +245,10 @@ watch(
>
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props">
<q-td>
<q-btn
outline
@ -278,7 +278,6 @@ watch(
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">

View file

@ -13,7 +13,7 @@ import { useCounterMixin } from "@/stores/mixin";
/** use*/
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm, success, messageError } = mixin;
const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin;
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
@ -44,6 +44,7 @@ function close() {
function onSubmit() {
dialogConfirm($q, () => {
if (amount.value !== null) {
showLoader();
const amountString: string = amount.value.toString();
const body = {
profileId: profileId.value,
@ -54,15 +55,16 @@ function onSubmit() {
};
http
.post(config.API.salaryPeriod() + `/change/amount`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
close();
hideLoader();
});
}
});
@ -88,6 +90,7 @@ function onSubmit() {
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือนฐาน'}`]"
lazy-rules
hide-bottom-space
class="inputgreen"
/>
</div>
</q-card-section>
@ -97,10 +100,7 @@ function onSubmit() {
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -55,16 +55,16 @@ function onSubmit() {
};
http
.post(config.API.salaryPeriod() + `/change/group`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
close();
});
});
}
@ -116,14 +116,10 @@ function inputEdit(val: boolean) {
<q-separator />
<form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -87,15 +87,15 @@ function onSubmit() {
};
http
.post(config.API.salaryPeriod() + `/change/type`, body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
close();
hideLoader();
});
});
@ -179,10 +179,7 @@ function inputEdit(val: boolean) {
:disabled="!isChange"
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -81,15 +81,15 @@ function onSubmit() {
};
http
.put(config.API.salaryProperty(profileId.value), body)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
close();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
close();
hideLoader();
});
});
@ -143,10 +143,7 @@ watch(
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
color="secondary"
label="บันทึก"
/>
</q-card-actions>

View file

@ -49,6 +49,7 @@ async function uploadFile(event: any) {
dialogConfirm(
$q,
async () => {
showLoader();
const selectedFile = event;
const formdata = new FormData();
formdata.append("Document", selectedFile);
@ -72,10 +73,11 @@ async function uploadFile(event: any) {
res.data[key]?.fileName !== ""
);
foundKey &&
uploadfile(res.data[foundKey]?.uploadUrl, fileUpload.value);
(await uploadfile(res.data[foundKey]?.uploadUrl, fileUpload.value));
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
},
"ยืนยันการอัปโหลดไฟล์",
@ -88,17 +90,18 @@ async function uploadFile(event: any) {
* @param uploadUrl link ปโหลด
* @param file ไฟล
*/
async function uploadfile(uploadUrl: string, file: any) {
function uploadfile(uploadUrl: string, file: any) {
showLoader();
await axios
axios
.put(uploadUrl, file, {
headers: {
"Content-Type": file.type,
},
})
.then(() => {
getListFile();
.then(async () => {
await getListFile();
success($q, "อัปโหลไฟล์สำเร็จ");
fileUpload.value = null;
})
.catch((err) => {
messageError($q, err);
@ -143,8 +146,8 @@ function saveReccommend(reason: string) {
titleRecommend: reason,
}
)
.then(() => {
props.getData?.();
.then(async () => {
await props.getData?.();
})
.catch((e) => {
messageError($q, e);
@ -234,16 +237,16 @@ function deleteFile(fileName: string) {
)
)
.then(() => {
success($q, "ลบไฟล์สำเร็จ");
setTimeout(() => {
getListFile();
setTimeout(async () => {
await getListFile();
await success($q, "ลบไฟล์สำเร็จ");
hideLoader();
}, 1000);
}, 2000);
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {});
hideLoader();
});
});
}
@ -407,9 +410,8 @@ onMounted(() => {
dense
flat
round
size="12px"
color="blue"
icon="mdi-download-outline"
icon="mdi-download"
@click="downloadFile(item.fileName)"
>
<q-tooltip>ดาวนโหลดเอกสาร</q-tooltip>
@ -421,9 +423,8 @@ onMounted(() => {
dense
flat
round
size="12px"
color="red"
icon="mdi-delete-outline"
icon="delete"
@click="deleteFile(item.fileName)"
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
>

View file

@ -248,9 +248,9 @@ function onClickDelete(id: string) {
showLoader();
await http
.delete(config.API.salaryListPeriodProfileById(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.();
.then(async () => {
await props.fetchDataTable?.();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);

View file

@ -9,11 +9,11 @@ import type { NewPagination } from "@/modules/13_salary/interface/index/Main";
import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList";
/** importComponents*/
import DialogAddPerson from "@/modules/13_salary/components/SalaryLists//DialogAddPerson.vue";
import DialogFormEdit from "@/modules/13_salary/components/SalaryLists/DialogFormEdit.vue";
import DialogMoveGroup from "@/modules/13_salary/components/SalaryLists/DialogMoveGroup.vue";
import DialogMoveLevel from "@/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue";
import DialogProperties from "@/modules/13_salary/components/SalaryLists/DialogProperties.vue";
import DialogAddPerson from "@/modules/13_salary/components/SalaryLists//DialogAddPerson.vue"; //
import DialogFormEdit from "@/modules/13_salary/components/SalaryLists/DialogFormEdit.vue"; //
import DialogMoveGroup from "@/modules/13_salary/components/SalaryLists/DialogMoveGroup.vue"; //
import DialogMoveLevel from "@/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue"; //
import DialogProperties from "@/modules/13_salary/components/SalaryLists/DialogProperties.vue"; //
import DialogInfo from "@/modules/13_salary/components/DialogInfoMain.vue";
/** importStore*/
@ -204,9 +204,9 @@ function onClickDelete(id: string) {
showLoader();
await http
.delete(config.API.salaryListPeriodProfileById(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
props.fetchDataTable?.();
.then(async () => {
await props.fetchDataTable?.();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
@ -416,11 +416,7 @@ function onClickViewInfo(type: string, id: string) {
>
<q-item-section>
<div class="row items-center">
<q-icon
:color="item.color"
size="xs"
:name="item.icon"
/>
<q-icon :color="item.color" size="xs" :name="item.icon" />
<div class="q-pl-md">{{ item.label }}</div>
</div>
</q-item-section>
@ -514,23 +510,29 @@ function onClickViewInfo(type: string, id: string) {
</template>
</d-table>
<!-- เพมคนเลอนเงนเดอน -->
<DialogAddPerson
v-model:modal="modalDialogAddPerson"
:fetchData="props.fetchDataTable"
/>
<!-- แกไขเงนเดอน -->
<DialogFormEdit
v-model:modal="modalDialogForm"
v-model:profileId="profileId"
v-model:amount="amount"
:fetchData="props.fetchDataTable"
/>
<!-- ายกล -->
<DialogMoveGroup
v-model:modal="modalDialogMoveGroup"
v-model:profileId="profileId"
:group="store.tabGroup === 'group1' ? 'กลุ่ม1' : 'กลุ่ม2'"
:fetchData="props.fetchDataTable"
/>
<!-- เลอนข -->
<DialogMoveLevel
:typeLevel="typeLevel"
:isReserve="isReserve"
@ -539,6 +541,8 @@ function onClickViewInfo(type: string, id: string) {
:fetchData="props.fetchDataTable"
:remark="''"
/>
<!-- แกไขคณสมบ -->
<DialogProperties
v-model:modal="modalDialogProperties"
v-model:id="profileId"

View file

@ -42,7 +42,6 @@ const props = defineProps({
});
const period = ref<string>("");
const isReadonly = ref<boolean>(false); //
const isActive = ref<boolean>(false);
const effectiveDate = ref<Date | null>(null);
const typeOptions = ref<DataOption[]>([
@ -81,10 +80,10 @@ function onSubmit() {
? config.API.salaryPeriod()
: config.API.salaryPeriod() + `/${props.idRound}`;
await http[!props.edit ? "post" : "put"](url, body);
await props.getData?.();
await success($q, "บันทีกข้อมูลสำเร็จ");
modal.value = false;
props.getData?.();
clearForm();
success($q, "บันทีกข้อมูลสำเร็จ");
} catch (err) {
messageError($q, err);
} finally {

View file

@ -145,9 +145,9 @@ function getSnap(code: string) {
* function เรยกขอมลหนยวงาน
* @param id revisionId
*/
async function getAgency(id: string) {
function getAgency(id: string) {
if (id) {
await http
http
.get(config.API.activeOrganizationRootById(id))
.then(async (res) => {
const data = res.data.result;
@ -179,9 +179,9 @@ async function getAgency(id: string) {
* function เรยกขอมลหนยวงานปจ
* @param id revisionId
*/
async function getAgencyPosition(id: string) {
function getAgencyPosition(id: string) {
if (id) {
await http
http
.get(config.API.keycloakPositionByid(id))
.then(async (res) => {
const data = await res.data.result;

View file

@ -124,7 +124,9 @@ function clickAdd() {
editCheck.value = false;
}
/** ดึงข้อมูลเริ่มต้น */
/**
* fetch รายการรอบการขนเงนเดอน
*/
function getData() {
showLoader();
http
@ -165,9 +167,9 @@ function deleteData(id: string) {
showLoader();
http
.delete(config.API.salaryPeriod() + `/${id}`)
.then(() => {
getData();
success($q, "ลบข้อมูลสำเร็จ");
.then(async () => {
await getData();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
@ -204,15 +206,19 @@ function dialogClose(id: string) {
dialogConfirm(
$q,
() => {
showLoader();
http
.get(config.API.salaryPeriod() + `/close/${id}`)
.then((res) => {
.then(() => {
getData();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
},
"ยืนยันการปิดรอบ",
"หากปิดรอบแล้วจะไม่สามารถแก้ไขรายการเงินเดือนของรอบนี้ได้ ต้องการยืนยันการปิดรอบนี้ใช่หรือไม่?"
@ -406,14 +412,16 @@ onMounted(async () => {
color="edit"
size="17px"
:name="
props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate
props.row.revisionId !== null ||
!checkPermission($route)?.attrIsUpdate
? 'mdi-eye-outline'
: 'edit'
"
/>
<div class="q-pl-md">
{{
props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate
props.row.revisionId !== null ||
!checkPermission($route)?.attrIsUpdate
? "ดูข้อมูล"
: "แก้ไขข้อมูล"
}}