From 77c4a9886c456e6541b38333d8fe66d26c26016d Mon Sep 17 00:00:00 2001 From: zhoulingpo Date: Thu, 25 May 2023 13:40:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E9=99=90?= =?UTF-8?q?=E5=88=B6=E9=82=AE=E7=AE=B1=E6=9C=80=E5=A4=9A50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportProcess/components/reportForm.vue | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/views/reportProcess/components/reportForm.vue b/src/views/reportProcess/components/reportForm.vue index 7942050..4f72fe9 100644 --- a/src/views/reportProcess/components/reportForm.vue +++ b/src/views/reportProcess/components/reportForm.vue @@ -92,7 +92,7 @@ - {{fileList.length>0?'查看文件':'选择文件'}} + {{fileList.length>0?('上传文件(已上传'+fileList.length+'个文件)'):'上传文件'}} @@ -117,9 +117,9 @@ }" :workNumFlag="true" :isOrg="true" :maxSelected="1" @confirm="isTreeOk"> -
点击或拖拽上传文件
@@ -478,11 +478,26 @@ export default { }) this.$forceUpdate() }, + onSuccess(res, file,fileList){ + if(res.ok){ + // this.fileList.push({url:res.data.fullurl})//以前的错误代码 + this.fileList=fileList + this.form.fileList = this.fileList.map(item=>{ + return { + fileId:item.id, + fileName:item.name + } + }) + this.$refs.processFormRef.clearValidate(['fileList']) + } + console.log( res," this.fileList3") + }, // 上传文件 uploadFile(params) { let fd = new FormData(); fd.append('file', params.file); this.$api.report.reportUploadFile(fd).then(({data}) => { + console.log( this.fileList," this.fileList") this.fileList.push(data) this.form.fileList = this.fileList.map(item=>{ return { @@ -492,6 +507,7 @@ export default { }) this.$refs.processFormRef.clearValidate(['fileList']) }) + console.log( this.fileList," this.fileList22222") }, // 上传文件前 beforeUploadFile(file) {