fix ทดลองงาน
This commit is contained in:
parent
bb1048830f
commit
f6e49ec2b1
7 changed files with 37 additions and 8 deletions
|
|
@ -1085,7 +1085,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormUploadFile
|
<FormUploadFile
|
||||||
:group="`ประเมินผลผู้บังคับบัญชาครั้งที่${props.tab?.charAt(4)}`"
|
:group="`ประเมินผลผู้บังคับบัญชาครั้งที่ ${props.tab?.charAt(4)}`"
|
||||||
v-model:is-check-file="isCheckFile"
|
v-model:is-check-file="isCheckFile"
|
||||||
:check-route-permisson="checkRoutePermisson"
|
:check-route-permisson="checkRoutePermisson"
|
||||||
:data-permissions="
|
:data-permissions="
|
||||||
|
|
|
||||||
|
|
@ -1405,7 +1405,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormUploadFile
|
<FormUploadFile
|
||||||
:group="`ประเมินผลคณะกรรมการครั้งที่${props.tab?.charAt(4)}`"
|
:group="`ประเมินผลคณะกรรมการครั้งที่ ${props.tab?.charAt(4)}`"
|
||||||
:check-route-permisson="checkRoutePermisson"
|
:check-route-permisson="checkRoutePermisson"
|
||||||
:data-permissions="
|
:data-permissions="
|
||||||
probationStore.dataPermissions?.tab5.isEdit
|
probationStore.dataPermissions?.tab5.isEdit
|
||||||
|
|
|
||||||
|
|
@ -894,7 +894,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
<FormUploadFile
|
<FormUploadFile
|
||||||
v-else
|
v-else
|
||||||
:group="`รายงานผลครั้งที่${props.tab?.charAt(4)}`"
|
:group="`รายงานผลครั้งที่ ${props.tab?.charAt(4)}`"
|
||||||
v-model:is-check-file="isCheckFile"
|
v-model:is-check-file="isCheckFile"
|
||||||
:check-route-permisson="checkRoutePermisson"
|
:check-route-permisson="checkRoutePermisson"
|
||||||
:data-permissions="
|
:data-permissions="
|
||||||
|
|
|
||||||
|
|
@ -1261,7 +1261,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormUploadFile
|
<FormUploadFile
|
||||||
:group="`บันทึกผลผู้ดูแลครั้งที่${props.tab?.charAt(4)}`"
|
:group="`บันทึกผลผู้ดูแลครั้งที่ ${props.tab?.charAt(4)}`"
|
||||||
v-model:is-check-file="isCheckFile"
|
v-model:is-check-file="isCheckFile"
|
||||||
:check-route-permisson="checkRoutePermisson"
|
:check-route-permisson="checkRoutePermisson"
|
||||||
:data-permissions="
|
:data-permissions="
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,9 @@ onMounted(async () => {
|
||||||
<div v-if="status == false">
|
<div v-if="status == false">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
!checkRoutePermisson && probationStore.dataPermissions?.tab3.isEdit && !isCheckFile
|
!checkRoutePermisson &&
|
||||||
|
probationStore.dataPermissions?.tab3.isEdit &&
|
||||||
|
!isCheckFile
|
||||||
"
|
"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
|
|
@ -1271,7 +1273,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<FormUploadFile
|
<FormUploadFile
|
||||||
:group="`บันทึกผลผู้บังคับบัญชาครั้งที่${props.tab?.charAt(4)}`"
|
:group="`บันทึกผลผู้บังคับบัญชาครั้งที่ ${props.tab?.charAt(4)}`"
|
||||||
v-model:is-check-file="isCheckFile"
|
v-model:is-check-file="isCheckFile"
|
||||||
:check-route-permisson="checkRoutePermisson"
|
:check-route-permisson="checkRoutePermisson"
|
||||||
:data-permissions="
|
:data-permissions="
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ const dataPermissions = defineModel<boolean>("dataPermissions", {
|
||||||
|
|
||||||
const assignId = ref<string>(route.params.form as string);
|
const assignId = ref<string>(route.params.form as string);
|
||||||
const file = ref<any>();
|
const file = ref<any>();
|
||||||
|
const dataDownload = ref<any>();
|
||||||
|
|
||||||
function onUploadFiles() {
|
function onUploadFiles() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -72,6 +73,7 @@ async function uploadFileURL(uploadUrl: string) {
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await success($q, "อัปโหลดไฟล์สำเร็จ");
|
await success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||||
|
file.value = null;
|
||||||
await fetchCheckfile();
|
await fetchCheckfile();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -79,7 +81,6 @@ async function uploadFileURL(uploadUrl: string) {
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
file.value = null;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,6 +92,7 @@ async function fetchCheckfile() {
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
if (res.data.length >= 1) {
|
if (res.data.length >= 1) {
|
||||||
isCheckFile.value = true;
|
isCheckFile.value = true;
|
||||||
|
dataDownload.value = res.data[0];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -98,6 +100,22 @@ async function fetchCheckfile() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function onDownloadFile() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.filefullPath(`${dataDownload.value.pathname}`))
|
||||||
|
.then(async (res) => {
|
||||||
|
const data = res.data.downloadUrl;
|
||||||
|
window.open(data, "_blank");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchCheckfile();
|
fetchCheckfile();
|
||||||
});
|
});
|
||||||
|
|
@ -141,6 +159,15 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12" v-if="isCheckFile">
|
||||||
|
<q-btn
|
||||||
|
color="primary"
|
||||||
|
icon="mdi-download"
|
||||||
|
label="ดาวน์โหลดไฟล์"
|
||||||
|
@click="onDownloadFile"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ function nextPage() {
|
||||||
>
|
>
|
||||||
<q-tab v-for="(i, j) in loop" :name="`save${i}`" :key="j">
|
<q-tab v-for="(i, j) in loop" :name="`save${i}`" :key="j">
|
||||||
<div class="row col-12 items-center">
|
<div class="row col-12 items-center">
|
||||||
<div class="q-mr-sm">ครั้งที่{{ i }}</div>
|
<div class="q-mr-sm">ครั้งที่ {{ i }}</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
size="12px"
|
size="12px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue