This commit is contained in:
bb_pan 2025-12-17 11:19:14 +08:00
parent f760c90592
commit 0854f6b21f
3 changed files with 24 additions and 9 deletions

View File

@ -75,7 +75,7 @@
</el-select>
</template>
</el-table-column>
<el-table-column align="center" label="报废附件" width="140">
<el-table-column align="center" label="报废附件" width="180">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;">
<el-upload
@ -87,13 +87,17 @@
accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"
:on-success="(res) => handleFileSuccess(res, scope.row)"
:auto-upload="true"
:disabled="!canEdit"
:disabled="!canEdit || scope.row.bmFileInfos.length > 0"
:file-list="scope.row.bmFileInfos"
>
<el-button type="primary" size="mini" :disabled="!canEdit">上传附件</el-button>
</el-upload>
<el-button v-if="scope.row.bmFileInfos && scope.row.bmFileInfos.length > 0" type="text" size="mini" @click="picturePreview(scope.row)">
查看
</el-button>
<el-button v-if="scope.row.bmFileInfos && scope.row.bmFileInfos.length > 0" type="text" size="mini" style="color: red" @click="deleteFile(scope.row)">
删除附件
</el-button>
</div>
</template>
</el-table-column>
@ -341,6 +345,7 @@ export default {
url: response.data.url
}
row.bmFileInfos = [fileObj]
console.log('🚀 ~ row.bmFileInfos:', row.bmFileInfos)
this.$message.success('文件上传成功')
} else {
this.$message.error('文件上传失败')
@ -353,14 +358,18 @@ export default {
const file = row.bmFileInfos[0]
const parts = file.name.split('.')
const extension = parts.pop()
if (extension === 'doc' || extension === 'docx' || extension === 'pdf') {
window.open(file.url, file.name)
} else {
this.$message.info('预览图片: ' + file.name)
}
}
// if (extension === 'doc' || extension === 'docx' || extension === 'pdf') {
// window.open(file.url, file.name)
// } else {
// this.$message.info(': ' + file.name)
// }
}
},
deleteFile(row) {
row.bmFileInfos = []
},
},
created() {
if (this.$route.params.id) {

View File

@ -511,12 +511,14 @@ export default {
.card-box {
width: 100%;
border-radius: 15px;
height: 380px;
min-height: 380px;
height: calc(45vh - 36px);
}
.card-box2 {
width: 100%;
border-radius: 15px;
min-height: 430px;
height: calc(45vh - 36px);
}
.title-tip-tip {
font-weight: 900;

View File

@ -2905,6 +2905,10 @@ export default {
background-size: 100% 100%;
margin-top: 88px;
height: calc(100vh - 172px);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.flowchart-title {
text-align: center;