diff --git a/src/modules/06_evaluate/components/step/step2.vue b/src/modules/06_evaluate/components/step/step2.vue index 45d6aca..79b88c1 100644 --- a/src/modules/06_evaluate/components/step/step2.vue +++ b/src/modules/06_evaluate/components/step/step2.vue @@ -232,20 +232,21 @@ async function fetchPathUpload( showLoader(); await http .post(config.API.loadPathDocument(volume, id), body) - .then((res) => { + .then(async (res) => { const foundKey: string | undefined = Object.keys(res.data).find( (key) => res.data[key]?.fileName !== undefined && res.data[key]?.fileName !== "" ); - foundKey && uploadfile(res.data[foundKey]?.uploadUrl, file); + foundKey && (await uploadfile(res.data[foundKey]?.uploadUrl, file)); + await downloadFile(type); }) .catch((err) => { messageError($q, err); + hideLoader(); }) .finally(() => { - downloadFile(type); - hideLoader(); + // hideLoader(); }); } } @@ -256,7 +257,6 @@ async function fetchPathUpload( * @param file ไฟล์ */ async function uploadfile(uploadUrl: string, file: any) { - showLoader(); await axios .put(uploadUrl, file, { headers: { @@ -333,7 +333,7 @@ const downloadFile6 = ref(""); * @param fileName ชื่อไฟล์ */ async function downloadFile(fileName: string) { - showLoader(); + // showLoader(); await http .get(config.API.loadFileDocument("เล่ม 1", evaluateId.value, fileName)) .then((res) => { @@ -488,7 +488,7 @@ watch( label="ชื่อผลงาน" v-model="formCommand.subject" @update:model-value="updateInput(formCommand)" - :rules="[(val) => !!val || `${'กรุณากรอกชื่อผลงาน'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกชื่อผลงาน'}`]" lazy-rules hide-bottom-space /> @@ -501,7 +501,7 @@ watch( v-model="formCommand.author" @update:model-value="updateInput(formCommand)" label="เจ้าของผลงาน" - :rules="[(val) => !!val || `${'กรุณากรอกเจ้าของผลงาน'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกเจ้าของผลงาน'}`]" lazy-rules hide-bottom-space /> @@ -533,7 +533,7 @@ watch( label="ชื่อ-นามสกุล" v-model="formCommand.commanderFullname" @update:model-value="updateInput(formCommand)" - :rules="[(val) => !!val || `${'กรุณากรอกชื่อ-นามสกุล'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกชื่อ-นามสกุล'}`]" lazy-rules hide-bottom-space /> @@ -546,7 +546,7 @@ watch( v-model="formCommand.commanderPosition" @update:model-value="updateInput(formCommand)" label="ตำแหน่ง" - :rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" lazy-rules hide-bottom-space /> @@ -567,7 +567,7 @@ watch( outlined v-model="formCommand.commanderAboveFullname" label="ชื่อ-นามสกุล" - :rules="[(val) => !!val || `${'กรุณากรอกชื่อ-นามสกุล'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกชื่อ-นามสกุล'}`]" lazy-rules @update:model-value="updateInput(formCommand)" hide-bottom-space @@ -580,7 +580,7 @@ watch( outlined v-model="formCommand.commanderAbovePosition" label="ตำแหน่ง" - :rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" lazy-rules hide-bottom-space @update:model-value="updateInput(formCommand)" @@ -643,6 +643,7 @@ watch( v-model="fileEvaluation1" :disable="!store.statusUpload" class="col-xs-12 col-sm-12" + label="อัปโหลดไฟล์" outlined dense lazy-rules @@ -650,7 +651,7 @@ watch( accept=".pdf" :rules=" downloadFile1 === '' - ? [(val) => !!val || 'กรุณาเลือกไฟล์'] + ? [(val:any) => !!val || 'กรุณาเลือกไฟล์'] : [] " > @@ -734,12 +735,13 @@ watch( class="col-12" outlined dense + label="อัปโหลดไฟล์" lazy-rules accept=".pdf" hide-bottom-space :rules=" downloadFile2 === '' - ? [(val) => !!val || 'กรุณาเลือกไฟล์'] + ? [(val:any) => !!val || 'กรุณาเลือกไฟล์'] : [] " > @@ -829,9 +831,10 @@ watch( accept=".pdf" :rules=" downloadFile3 === '' - ? [(val) => !!val || 'กรุณาเลือกไฟล์'] + ? [(val:any) => !!val || 'กรุณาเลือกไฟล์'] : [] " + label="อัปโหลดไฟล์" > diff --git a/src/modules/06_evaluate/components/step/step8.vue b/src/modules/06_evaluate/components/step/step8.vue index 74e0d3c..8825faf 100644 --- a/src/modules/06_evaluate/components/step/step8.vue +++ b/src/modules/06_evaluate/components/step/step8.vue @@ -81,10 +81,10 @@ async function fetchPathUpload( }) .catch((err) => { messageError($q, err); - }) - .finally(() => { hideLoader(); }); + // .finally(() => { + // }); } } @@ -105,6 +105,9 @@ async function uploadfile(uploadUrl: string, file: any) { }) .catch((err) => { messageError($q, err); + }) + .finally(() => { + hideLoader(); }); } @@ -237,6 +240,7 @@ onMounted(async () => { hide-bottom-space lazy-rules accept=".pdf" + label="อัปโหลดไฟล์" >