Merge branch 'nice' into develop

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

View file

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

View file

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

View file

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

View file

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

View file

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