|
|
|
@ -47,6 +47,7 @@ |
|
|
|
<el-form-item label="添加文件" v-loading="fileloading" prop="files" label-width="100px"> |
|
|
|
<el-upload |
|
|
|
class="upload-demo" |
|
|
|
ref="upload" |
|
|
|
:disabled="isAble" |
|
|
|
:action="uploadFileUrl" |
|
|
|
:before-remove="beforeFileRemove" |
|
|
|
@ -108,7 +109,8 @@ export default { |
|
|
|
dialogVisible: false, |
|
|
|
isAutoRemoveFile: true, |
|
|
|
fileloading: false, |
|
|
|
pageloading: true |
|
|
|
pageloading: true, |
|
|
|
isGoToInfo: '0' // 是否回到月报列表:0否;1是 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -155,6 +157,7 @@ export default { |
|
|
|
} |
|
|
|
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { |
|
|
|
this.dataForm.infoId = this.$route.query.infoId |
|
|
|
this.isGoToInfo = '1' |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -240,11 +243,22 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
handleErrorRemove (file) { |
|
|
|
// 实现缩略图模板时删除文件 |
|
|
|
let fileList = this.$refs.upload.uploadFiles |
|
|
|
for (var i = 0; i < fileList.length; i++) { |
|
|
|
let item = fileList[i] |
|
|
|
if (item.url === file.url) { |
|
|
|
fileList.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
handleAvatarFileSuccess (res, file) { |
|
|
|
this.fileloading = false |
|
|
|
this.isAble = false |
|
|
|
if (res === null || res.data === null || res.data.imgUrl === null) { |
|
|
|
this.$message.error('文件上传失败!') |
|
|
|
this.handleErrorRemove(file) |
|
|
|
return false |
|
|
|
} |
|
|
|
this.dataForm.files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, recordType: 3, fileName: res.data.fileName, name: res.data.fileName }) |
|
|
|
@ -252,7 +266,7 @@ export default { |
|
|
|
// 返回按钮点击事件 |
|
|
|
backToUserRelationList () { |
|
|
|
this.$emit('refreshDataList') |
|
|
|
if (this.$route.query.infoId !== '' && this.$route.query.infoId != null) { |
|
|
|
if (this.isGoToInfo === '1') { |
|
|
|
this.$parent.selectComponent = 'Monthrecordinfo' |
|
|
|
this.$router.push({ path: '/workRecord-Monthrecordinforoute' }) |
|
|
|
} else { |
|
|
|
|