历史附件下载

This commit is contained in:
zyn
2023-04-23 09:59:55 +08:00
parent b701c3b3ae
commit 0ed75aa5a1
2 changed files with 78 additions and 4 deletions
@@ -213,8 +213,12 @@
<div style="display: flex;justify-content: space-between">
<div style="width: 80%;margin-top: 13px">
<div v-for="(item,index) in LSBBBUSSFileList" :key="index"
@click="handleFilePreview(item)" style="color: #409eff;cursor:pointer"
class="fileClass">{{ item.name }}
style="color: #409eff;cursor:pointer"
class="fileClass">
<span style="" @click="handleFilePreview2(item,'preview')" :title="item.name"> {{ item.name }}</span>
<span style="margin-left: 7px;" v-if="item.id !== ''">
<i class="el-icon-download" title="下载" @click="handleFilePreview2(item,'down')"></i>
</span>
</div>
</div>
<div style="width: 20%;">
@@ -2919,6 +2923,39 @@
this.$preview(attId)
}
},
handleFilePreview2(file, type) {
let attId = ""
if (file && file.id) {
attId = file.id
} else {
attId = file.response.data.id
}
if (file.name == this.form.standName) {
let fileName = ""
let fileNam2 = ""
if (this.form.standName && this.form.standName !== '') {
fileName = this.form.standName + '-企业标准.docx'
fileNam2 = this.form.standName
} else {
fileName = '企业标准.docx'
fileNam2 = '企业标准'
}
let form = JSON.parse(JSON.stringify(this.form))
form.standCode = ''
form.issueDate = ''
this.$onlineEditPreview(file.id, fileNam2, this.$store.getters.userInfo.userId, this.$store.getters.userInfo.userName, form)
return
}
if (type === 'down') {
if (attId) {
window.open('/api/att/attFile/downloadFileForSarNew?fileId=' + attId)
} else {
this.$message.warning('文件不存在,下载失败')
}
} else {
this.$preview(attId)
}
},
handleFilePreviewOne(file, type) {
let id = ""
let fileName = ""
@@ -209,8 +209,12 @@
<div style="display: flex;justify-content: space-between">
<div style="width: 80%;margin-top: 13px">
<div v-for="(item,index) in LSBBBUSSFileList" :key="index"
@click="handleFilePreview(item)" style="color: #409eff;cursor:pointer"
class="fileClass">{{ item.name }}
@click="handleFilePreview(item)" style="color: #409eff;cursor:pointer;margin-left: 12px;"
class="fileClass">
<span style="" @click="handleFilePreview2(item,'preview')" :title="item.name"> {{ item.name }}</span>
<span style="margin-left: 7px;" v-if="item.id !== ''">
<i class="el-icon-download" title="下载" @click="handleFilePreview2(item,'down')"></i>
</span>
</div>
</div>
<div style="width: 20%;">
@@ -2889,6 +2893,39 @@
this.$preview(attId)
}
},
handleFilePreview2(file, type) {
let attId = ""
if (file && file.id) {
attId = file.id
} else {
attId = file.response.data.id
}
if (file.name == this.form.standName) {
let fileName = ""
let fileNam2 = ""
if (this.form.standName && this.form.standName !== '') {
fileName = this.form.standName + '-企业标准.docx'
fileNam2 = this.form.standName
} else {
fileName = '企业标准.docx'
fileNam2 = '企业标准'
}
let form = JSON.parse(JSON.stringify(this.form))
form.standCode = ''
form.issueDate = ''
this.$onlineEditPreview(file.id, fileNam2, this.$store.getters.userInfo.userId, this.$store.getters.userInfo.userName, form)
return
}
if (type === 'down') {
if (attId) {
window.open('/api/att/attFile/downloadFileForSarNew?fileId=' + attId)
} else {
this.$message.warning('文件不存在,下载失败')
}
} else {
this.$preview(attId)
}
},
// 导入标准数据成功后执行
importFileSuccess(response, file, fileList) {
// 上传成功后判断是否是两条数据是的话替换掉旧数据