dialog เพิ่ม ปุ่มดาวโหลด
This commit is contained in:
parent
fb6f358ed9
commit
9887bcb3b0
2 changed files with 22 additions and 9 deletions
|
|
@ -27,6 +27,7 @@ const isReadOnly = ref<boolean>(false);
|
|||
|
||||
const props = defineProps({
|
||||
getData: Function,
|
||||
onDownloadFile: Function,
|
||||
});
|
||||
|
||||
/** เช็ค true/false 70*/
|
||||
|
|
@ -180,7 +181,7 @@ async function createURLUpload(id: string, file: any) {
|
|||
const fileName = { fileName: file.name };
|
||||
await http
|
||||
.post(
|
||||
config.API.file("IDP", "ยื่นคำร้องขอเพิ่มข้อมูลการพัฒนารายบุคคล", id),
|
||||
config.API.file("IDP", "หลักฐาน", id),
|
||||
{
|
||||
replace: false,
|
||||
fileList: fileName,
|
||||
|
|
@ -268,11 +269,13 @@ function getDetail() {
|
|||
formData.otherPerson = data.reasonDevelopment20;
|
||||
formData.otherTraining = data.reasonDevelopment10;
|
||||
formData.development = data.developmentProjects;
|
||||
}).catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
hideLoader()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
@ -458,7 +461,7 @@ watch(
|
|||
<!-- รายงานผลการพัฒนา -->
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="isEdit"
|
||||
:readonly="isEdit"
|
||||
outlined
|
||||
v-model="formData.developmentReport"
|
||||
label="รายงานผลการพัฒนา"
|
||||
|
|
@ -469,6 +472,7 @@ watch(
|
|||
</div>
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-if="!isEdit"
|
||||
:class="classInput(isReadOnly)"
|
||||
v-model="formData.document"
|
||||
label="อัปโหลดเอกสารหลักฐาน"
|
||||
|
|
@ -479,13 +483,21 @@ watch(
|
|||
hide-bottom-space
|
||||
:rules="[(val:any) => !!val || `${'กรุณาเลือกไฟล์'}`]"
|
||||
/>
|
||||
<q-btn
|
||||
v-else
|
||||
label="หลักฐานอ้างอิง"
|
||||
color="primary"
|
||||
@click="props.onDownloadFile?.(idRow)"
|
||||
>
|
||||
<q-tooltip>หลักฐานอ้างอิง</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator v-if="!isEdit"/>
|
||||
<q-separator v-if="!isEdit" />
|
||||
|
||||
<q-card-actions align="right" v-if="!isEdit">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ async function getListData() {
|
|||
function onDownloadFile(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.file("IDP", "ยื่นคำร้องขอเพิ่มข้อมูลการพัฒนารายบุคคล", id))
|
||||
.get(config.API.file("IDP", "หลักฐาน", id))
|
||||
.then((res) => {
|
||||
if (res.data.length !== 0) {
|
||||
downloadUrl(id, res.data[0].fileName);
|
||||
|
|
@ -240,7 +240,7 @@ function downloadUrl(id: string, fileName: string) {
|
|||
.get(
|
||||
config.API.fileByFile(
|
||||
"IDP",
|
||||
"ยื่นคำร้องขอเพิ่มข้อมูลการพัฒนารายบุคคล",
|
||||
"หลักฐาน",
|
||||
id,
|
||||
fileName
|
||||
)
|
||||
|
|
@ -494,6 +494,7 @@ onMounted(async () => {
|
|||
:get-data="getListData"
|
||||
v-model:is-edit="isEdit"
|
||||
v-model:id-row="idRow"
|
||||
:on-download-file="onDownloadFile"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue