|
|
|
|
@ -163,7 +163,7 @@ |
|
|
|
|
:limit="1" |
|
|
|
|
:file-list="filesList" |
|
|
|
|
> |
|
|
|
|
<el-button size="small" type="primary">选择附件</el-button> |
|
|
|
|
<el-button :disabled="filesList.length >= 1" size="small" type="primary">选择附件</el-button> |
|
|
|
|
<div slot="tip" class="el-upload__tip">请上传 .xls,.xlsx 标准格式文件且每次只能上传一个附件</div> |
|
|
|
|
</el-upload> |
|
|
|
|
</template> |
|
|
|
|
@ -1639,13 +1639,12 @@ export default { |
|
|
|
|
edditPro(row, index){ |
|
|
|
|
this.filesList = [] |
|
|
|
|
if(row.attachName !== '' && row.attach !== ''){ |
|
|
|
|
this.filesList.push({name:row.attachName,path:row.attach}) |
|
|
|
|
this.filesList.push({name:row.attachName,path:row.attach}) |
|
|
|
|
} |
|
|
|
|
this.$refs.crud.rowEdit(row, index) |
|
|
|
|
}, |
|
|
|
|
// 控制是否上传 |
|
|
|
|
fileSuccess(file, fileList) { |
|
|
|
|
console.log('filr ===================>') |
|
|
|
|
// 文件上传控制格式 |
|
|
|
|
let suffix = this.getFileType(file.name); //获取文件后缀名 |
|
|
|
|
let suffixArray = ["xls", "xlsx"]; //限制的文件类型,根据情况自己定义 |
|
|
|
|
@ -1659,7 +1658,6 @@ export default { |
|
|
|
|
this.assetsFlag = false; |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
console.log('limit ===============>') |
|
|
|
|
if(this.fileList.length > 1){ |
|
|
|
|
this.$message({ |
|
|
|
|
message: "每次只能上传一个文件", |
|
|
|
|
@ -1680,13 +1678,21 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
fileRemove(file, fileList) { |
|
|
|
|
if(file.response.code == 200){ |
|
|
|
|
let arr = fileList.filter(item => item.path !== file.response.data.path) |
|
|
|
|
this.fileList = arr |
|
|
|
|
if(file.status == 'success'){ |
|
|
|
|
if(file.response){ |
|
|
|
|
if(file.response.code == 200){ |
|
|
|
|
let arr = fileList.filter(item => item.path !== file.response.data.path) |
|
|
|
|
this.fileList = arr |
|
|
|
|
this.filesList = arr |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
let arr = fileList.filter(item => item.path !== file.path) |
|
|
|
|
this.fileList = arr |
|
|
|
|
this.filesList = arr |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadSuccess(response, file, fileList) { |
|
|
|
|
console.log('res ==============>',response) |
|
|
|
|
if (response.code == 200) { |
|
|
|
|
this.$message({ |
|
|
|
|
showClose: true, |
|
|
|
|
|