รายชื่อลูกจ้างชั่วคราว

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-27 18:08:50 +07:00
parent ee8138a576
commit b9f8be8dc0
5 changed files with 22 additions and 26 deletions

View file

@ -216,19 +216,17 @@ function calculateMaxDate() {
} }
function onSubmit() { function onSubmit() {
dialogConfirm($q, () => { dialogConfirm($q, async () => {
showLoader(); showLoader();
http await http
.post(config.API.registryNew("-employee"), formData) .post(config.API.registryNew("-employee"), formData)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.fetchData?.();
props.fetchData?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog(); closeDialog();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
}); });

View file

@ -378,9 +378,9 @@ async function onClickSubmit() {
await http await http
.put(config.API.positionEmployee(props?.dataRow?.id), body) .put(config.API.positionEmployee(props?.dataRow?.id), body)
.then(() => { .then(async () => {
success($q, "บันทึกข้อมูลสำเร็จ"); await props.fetchData?.();
props.fetchData?.(); await success($q, "บันทึกข้อมูลสำเร็จ");
closePopup(); closePopup();
}) })
.catch((err) => { .catch((err) => {

View file

@ -182,10 +182,10 @@ function onClickSendOrder() {
}; };
http http
.post(config.API.orgProfileReport, data) .post(config.API.orgProfileReport, data)
.then(() => { .then(async() => {
success($q, "บันทึกสำเร็จ"); await props?.fetchData?.();
await success($q, "บันทึกสำเร็จ");
closeDialog(); closeDialog();
props?.fetchData?.();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);

View file

@ -258,16 +258,16 @@ const sendToCommand = async () => {
showLoader(); showLoader();
await http await http
.post(config.API.organizationEmployeeSendOrder, data) .post(config.API.organizationEmployeeSendOrder, data)
.then((res: any) => { .then(async () => {
success($q, "บันทึกสำเร็จ"); await props.fetchNewList();
await success($q, "บันทึกสำเร็จ");
props.closeDialog();
selected.value = [];
}) })
.catch((e: any) => { .catch((e: any) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
props.fetchNewList();
props.closeDialog();
selected.value = [];
hideLoader(); hideLoader();
}); });
}; };

View file

@ -218,7 +218,7 @@ watch(
function fetchList() { function fetchList() {
showLoader(); showLoader();
http http
.get(config.API.registryNew("-employee"), { params: queryParams }) .get(config.API.registryNew("-temp"), { params: queryParams })
.then((res) => { .then((res) => {
maxPage.value = Math.ceil(res.data.result.total / queryParams.pageSize); maxPage.value = Math.ceil(res.data.result.total / queryParams.pageSize);
total.value = res.data.result.total; total.value = res.data.result.total;
@ -233,18 +233,16 @@ function fetchList() {
} }
function onClickDelete(id: string) { function onClickDelete(id: string) {
dialogRemove($q, () => { dialogRemove($q, async () => {
showLoader(); showLoader();
http await http
.delete(config.API.registryNew("-employee") + `/${id}`) .delete(config.API.registryNew("-employee") + `/${id}`)
.then(() => { .then(async () => {
success($q, "ลบข้อมูลสำเร็จ"); await fetchList();
fetchList(); await success($q, "ลบข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
}); });