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) {