diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue
index 3e9433e61..c38e6a3fe 100644
--- a/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue
+++ b/src/modules/12_evaluatePersonal/components/Detail/step/step3.vue
@@ -37,8 +37,8 @@ function handleItemClick(itemNumber: number) {
* @param volume index item
*/
function getFile(volume: number) {
- const fileText = numToThai(volume);
showLoader();
+ const fileText = numToThai(volume);
http
.get(config.API.evaluationFilebyId("เล่ม 1", id.value, fileText))
.then((res) => {
@@ -46,10 +46,8 @@ function getFile(volume: number) {
const type = res.data.fileType;
getPDF(link, type);
})
- .catch(() => {
- // messageError($q, e);
- })
- .finally(() => {
+ .catch((e) => {
+ messageError($q, e);
hideLoader();
});
}
@@ -76,7 +74,6 @@ function getPDF(url: string, type: string) {
const objectUrl = URL.createObjectURL(blob);
const pdfData = await usePDF(`${objectUrl}`);
- showLoader();
setTimeout(() => {
store.log = 1;
store.pdfSrcStore = pdfData.pdf.value;
@@ -84,8 +81,8 @@ function getPDF(url: string, type: string) {
hideLoader();
}, 1500);
})
- .catch(async (e) => {
- messageError($q, JSON.parse(await e.response.data.text()));
+ .catch(() => {
+ hideLoader();
})
.finally(() => {
store.log = 0;
diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue
index fae4b9eb2..97d6dec5a 100644
--- a/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue
+++ b/src/modules/12_evaluatePersonal/components/Detail/step/step4.vue
@@ -265,9 +265,10 @@ async function upLoadFile(file: any) {
})
.catch((e) => {
messageError($q, e);
+ hideLoader();
})
.finally(() => {
- hideLoader();
+ // hideLoader();
});
}
}
@@ -282,12 +283,13 @@ function fileUpLoad(url: string) {
headers: { "Content-Type": fileEvaluationUpload.value?.type },
onUploadProgress: (e) => console.log(e),
})
- .catch((e) => {
- messageError($q, e);
- })
- .finally(() => {
+ .then(() => {
checkDoc10();
success($q, "อัปโหลดไฟล์สำเร็จ");
+ })
+ .catch((e) => {
+ messageError($q, e);
+ hideLoader();
});
}
@@ -333,6 +335,7 @@ async function checkDoc10() {
)
.then((res: any) => {
download10Url.value = res.data.downloadUrl;
+ fetchProfile();
})
.catch(() => {
// messageError($q, e);
@@ -340,12 +343,11 @@ async function checkDoc10() {
.finally(() => {
hideLoader();
});
- fetchProfile();
}
/** function เรียกข้แมูลคุณสมบัติ*/
async function fetchProfile() {
- showLoader();
+ // showLoader();
await http
.get(config.API.evaluateGetDetail(id.value))
.then((res) => {
@@ -356,7 +358,7 @@ async function fetchProfile() {
messageError($q, err);
})
.finally(() => {
- hideLoader();
+ // hideLoader();
});
}
@@ -430,14 +432,14 @@ onMounted(async () => {
-
+
ประกาศผลการคัดเลือกบุคคล (เอกสารหมายเลข 10)
-
+
{
-
+
{
dense
hide-bottom-space
lazy-rules
+ label="อัปโหลดไฟล์"
accept=".pdf"
:rules="
download10Url === '' ? [(val) => !!val || 'กรุณาเลือกไฟล์'] : []
@@ -508,7 +516,10 @@ onMounted(async () => {
-
+
{
messageError($q, e);
- })
- .finally(() => {
hideLoader();
});
}
@@ -134,14 +132,15 @@ function fileUpLoad(url: string) {
headers: { "Content-Type": fileEvaluation5.value?.type },
onUploadProgress: (e) => console.log(e),
})
- .then(() => {
- success($q, "อัปโหลดไฟล์สำเร็จ");
+ .then(async () => {
+ await checkDocResult();
+ await success($q, "อัปโหลดไฟล์สำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
- checkDocResult();
+ hideLoader();
});
}
@@ -197,7 +196,7 @@ async function getDate() {
const download10Url = ref("");
/** function เช็คไฟล์อัปโหลด*/
async function checkDocResult() {
- showLoader();
+ // showLoader();
await http
.get(
config.API.evaluationPatchData(
@@ -213,7 +212,7 @@ async function checkDocResult() {
// messageError($q, e);
})
.finally(() => {
- hideLoader();
+ // hideLoader();
});
}
diff --git a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue
index 87a016704..7c745d7b9 100644
--- a/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue
+++ b/src/modules/12_evaluatePersonal/components/Detail/step/step8.vue
@@ -113,20 +113,18 @@ function upLoadFile(name: string, file: any) {
},
},
})
- .then((res) => {
+ .then(async (res) => {
const foundKey: any = Object.keys(res.data).find(
(key) =>
res.data[key]?.fileName !== undefined &&
res.data[key]?.fileName !== ""
);
const link = res.data[foundKey]?.uploadUrl;
- fileUpLoad(link, file);
+ await fileUpLoad(link, file);
+ await downloadFileList(name);
})
.catch((e) => {
messageError($q, e);
- })
- .finally(() => {
- downloadFileList(name);
hideLoader();
});
}
@@ -143,11 +141,14 @@ function fileUpLoad(url: string, file: any) {
headers: { "Content-Type": file?.type },
onUploadProgress: (e) => console.log(e),
})
+ .then(() => {
+ success($q, "อัปโหลดไฟล์สำเร็จ");
+ })
.catch((e) => {
messageError($q, e);
})
.finally(() => {
- success($q, "อัปโหลดไฟล์สำเร็จ");
+ hideLoader();
});
}
@@ -191,6 +192,7 @@ async function confirmApprove() {
dialogConfirm(
$q,
() => {
+ showLoader();
const data = {
metadata: {
additionalProp1: nameOfWork.value,
@@ -198,7 +200,6 @@ async function confirmApprove() {
additionalProp3: position.value,
},
};
- showLoader();
http
.patch(
config.API.evaluationPatchData(
@@ -208,13 +209,14 @@ async function confirmApprove() {
),
data
)
- .then(() => {})
+ .then(() => {
+ nextStep();
+ modalConfirm.value = false;
+ })
.catch((e) => {
messageError($q, e);
})
.finally(() => {
- nextStep();
- modalConfirm.value = false;
hideLoader();
});
},
@@ -294,7 +296,7 @@ const downloadFile6 = ref("");
* @param fileName ชื่อไฟล์
*/
async function downloadFileList(fileName: string) {
- showLoader();
+ // showLoader();
await http
.get(config.API.evaluationFilebyId("เล่ม 2", id.value, fileName))
.then((res) => {
@@ -314,10 +316,10 @@ async function downloadFileList(fileName: string) {
} else if (fileName === "แบบสรุปผลการประเมิน (เอกสารแบบ ง)") {
downloadFile6.value = res.data.downloadUrl;
}
- })
- .finally(() => {
- hideLoader();
});
+ // .finally(() => {
+ // hideLoader();
+ // });
}
const author = ref("");
diff --git a/src/modules/14_KPI/components/results/tableResults.vue b/src/modules/14_KPI/components/results/tableResults.vue
index d8b6e9d1e..e7a427b39 100644
--- a/src/modules/14_KPI/components/results/tableResults.vue
+++ b/src/modules/14_KPI/components/results/tableResults.vue
@@ -84,7 +84,7 @@ const columns = ref([
field: "createdAt",
headerStyle: "font-size: 14px",
format(val, row) {
- return date2Thai(val);
+ return date2Thai(val, false, true);
},
style: "font-size: 14px",
},
@@ -380,7 +380,7 @@ onMounted(() => {
:paging="true"
:visible-columns="visibleColumns"
>
-
+
([
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
- format: (v) => date2Thai(v),
+ format: (v) => date2Thai(v, false, true),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
diff --git a/src/modules/15_development/components/BasicInfo.vue b/src/modules/15_development/components/BasicInfo.vue
index 48ae1d24e..7e852d810 100644
--- a/src/modules/15_development/components/BasicInfo.vue
+++ b/src/modules/15_development/components/BasicInfo.vue
@@ -16,7 +16,7 @@ import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin();
-const { showLoader, hideLoader, messageError } = mixin;
+const { showLoader, hideLoader, messageError, success } = mixin;
/**
* props
@@ -93,6 +93,7 @@ function onSubmit() {
.then(() => {
fetchData(projectId.value);
isChangeData.value = false;
+ success($q, "บันทึกข้อมูลแล้ว");
})
.catch((err) => {
messageError($q, err);
diff --git a/src/modules/15_development/components/Budget.vue b/src/modules/15_development/components/Budget.vue
index 8258a8786..367c9c3e3 100644
--- a/src/modules/15_development/components/Budget.vue
+++ b/src/modules/15_development/components/Budget.vue
@@ -20,7 +20,7 @@ import { useCounterMixin } from "@/stores/mixin";
* use
*/
const $q = useQuasar();
-const { showLoader, hideLoader, messageError } = useCounterMixin();
+const { showLoader, hideLoader, messageError, success } = useCounterMixin();
const route = useRoute();
/**
@@ -123,7 +123,9 @@ function onSubmit() {
: formData.budgetPay;
http
.put(config.API.developmentMainTab("tab7", projectId.value), formData)
- .then(() => {})
+ .then(() => {
+ success($q, "บันทึกข้อมูลแล้ว");
+ })
.catch((err) => {
messageError($q, err);
})
diff --git a/src/modules/15_development/components/FollowResult.vue b/src/modules/15_development/components/FollowResult.vue
index d0ad9abad..649a4aad7 100644
--- a/src/modules/15_development/components/FollowResult.vue
+++ b/src/modules/15_development/components/FollowResult.vue
@@ -179,7 +179,9 @@ function onSubmit() {
progressTracking: progressTracking.value,
projectEvaluation: projectEvaluation.value,
})
- .then(() => {})
+ .then(() => {
+ !modalDialog.value && success($q, "บันทึกข้อมูลแล้ว");
+ })
.catch((err) => {
messageError($q, err);
})
@@ -199,6 +201,8 @@ function onClickAddIndicator(
data: DevelopmentEvaluations | null = null,
type: string = ""
) {
+ modalDialog.value = true;
+ isChangeData.value && onSubmit();
isEdit.value = statusEdit;
typeAction.value = type;
if (statusEdit) {
@@ -214,7 +218,6 @@ function onClickAddIndicator(
formIndicators.suggestions = data.suggestions;
}
}
- modalDialog.value = true;
}
/**
diff --git a/src/modules/15_development/components/Other.vue b/src/modules/15_development/components/Other.vue
index 25879a322..9dcf9ce1c 100644
--- a/src/modules/15_development/components/Other.vue
+++ b/src/modules/15_development/components/Other.vue
@@ -195,7 +195,9 @@ function onSubmit() {
http
.put(config.API.developmentMainTab("tab5", projectId.value), formData)
- .then(() => {})
+ .then(() => {
+ !modalAcademic.value && success($q, "บันทึกข้อมูลแล้ว");
+ })
.catch((err) => {
messageError($q, err);
})
@@ -207,6 +209,7 @@ function onSubmit() {
function onClickAddAcademic(status: boolean = false, data: any | null = null) {
modalAcademic.value = true;
+ isChangeData.value && onSubmit();
isEdit.value = status;
if (data && status) {
academicId.value = data.id;
@@ -272,7 +275,7 @@ defineExpose({
});
-
+
props.prevStep()"
>
(route.params.id.toLocaleString());
-const { showLoader, hideLoader, messageError, date2Thai, diffDay } =
+const { showLoader, hideLoader, messageError, date2Thai, diffDay, success } =
useCounterMixin();
const checkRoutePermission = ref(
route.name == "developmentDetailPage"
@@ -322,7 +322,9 @@ function onSubmit() {
reasonActual20: reasonActual20.value,
reasonActual10: reasonActual10.value,
})
- .then(() => {})
+ .then(() => {
+ success($q, "บันทึกข้อมูลแล้ว");
+ })
.catch((err) => {
messageError($q, err);
hideLoader();
@@ -567,7 +569,7 @@ defineExpose({
- เวลาและสถานที่ดำเนินการ
+ ระยะเวลาและสถานที่ดำเนินการ
diff --git a/src/modules/15_development/components/Risk.vue b/src/modules/15_development/components/Risk.vue
index 6afe1ca2c..146c60c89 100644
--- a/src/modules/15_development/components/Risk.vue
+++ b/src/modules/15_development/components/Risk.vue
@@ -173,7 +173,9 @@ function onSubmit() {
.put(config.API.developmentMainTab("tab8", projectId.value), {
expect: expect.value,
})
- .then(() => {})
+ .then(() => {
+ !modalRisk.value && success($q, "บันทึกข้อมูลแล้ว");
+ })
.catch((err) => {
messageError($q, err);
})
@@ -190,6 +192,7 @@ function onSubmit() {
*/
function onClickAddRisk(status: boolean = false, data: ResRisk | null = null) {
modalRisk.value = true;
+ isChangeData.value && onSubmit();
isEdit.value = status;
if (data) {
riskId.value = data.id;