แก้เช็คและ loading สรรหา
This commit is contained in:
parent
d9f5661ac3
commit
8a87f084c9
6 changed files with 98 additions and 92 deletions
|
|
@ -170,12 +170,12 @@ async function addData() {
|
|||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data;
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
success($q, "บันทึกรอบการสอบคนพิการสำเร็จ");
|
||||
setTimeout(() => {
|
||||
clickBack();
|
||||
}, 1200);
|
||||
const imgUpload = await uploadImgData();
|
||||
const docUpload = await uploadDocData();
|
||||
if (imgUpload && docUpload) {
|
||||
success($q, "บันทึกรอบการสอบคัดเลือกคนพิการสำเร็จ");
|
||||
await clickBack();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -194,9 +194,12 @@ async function editData(id: string) {
|
|||
await http
|
||||
.put(config.API.editDisablePeriod(id), sendData())
|
||||
.then(async () => {
|
||||
success($q, "แก้ไขรอบการสอบคนพิการสำเร็จ");
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
const imgUpload = await uploadImgData();
|
||||
const docUpload = await uploadDocData();
|
||||
if (imgUpload && docUpload) {
|
||||
success($q, "แก้ไขรอบการสอบคัดเลือกคนพิการสำเร็จ");
|
||||
await clickBack();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -238,17 +241,17 @@ async function uploadImgData() {
|
|||
fileImgDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.periodExamImg(id.value), formData)
|
||||
.then((res) => {})
|
||||
.then(() => {
|
||||
return true;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -316,24 +319,18 @@ async function uploadDocData() {
|
|||
fileDocDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
showLoader();
|
||||
|
||||
await http
|
||||
.put(config.API.periodExamDoc(id.value), formData)
|
||||
.then(() => {})
|
||||
.then(() => {
|
||||
return true;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
setTimeout(() => {
|
||||
clickBack();
|
||||
}, 1200);
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
clickBack();
|
||||
}, 1200);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue