Commit dfb9548a authored by jiaxu.yan's avatar jiaxu.yan

fix: 70396

parent ae4db68d
......@@ -9,14 +9,39 @@
>
返回
</header-button>
<header-button class="back-btn" icon="to-bottom" type="default">
<header-button
class="back-btn"
icon="to-bottom"
type="default"
@click="download()"
>
下载文件
</header-button>
</div>
<div class="task">
<div class="task-item">
<span class="task-label">任务编号:</span>
<span class="task-content">
{{ task.taskNo }}
</span>
</div>
<div class="task-item">
<span class="task-label">任务名称:</span>
<span class="task-content">
{{ task.taskName }}
</span>
</div>
<div class="task-item">
<span class="task-label">委托单位:</span>
<span class="task-content">
{{ task.taskInitiatorDept }}
</span>
</div>
</div>
<!-- table部分 -->
<div class="pdf-box">
<iframe
:src="'http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf'"
:src="fileUrl"
frameborder="0"
style="width: 100%; height: 100%"
></iframe>
......@@ -25,13 +50,56 @@
</template>
<script>
import { getTaskById } from '@/api/task/task'
export default {
data() {
return {}
return {
task: {},
taskId: 1,
fileUrl:
'http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf'
}
},
async mounted() {
if (this.$route.query.id) {
this.taskId = this.$route.query.id
this.getTaskDetail()
}
},
methods: {
async getTaskDetail() {
const result = await getTaskById({
id: this.taskId
})
if (result.code === 200) {
this.task = result.data
}
},
handleBack() {
this.$router.go(-1)
},
download() {
// 根据pdf文件地址下载
// window.location.href = this.fileUrl
const xhr = new XMLHttpRequest()
xhr.open('GET', this.fileUrl, true)
xhr.responseType = 'blob'
xhr.onload = () => {
if (xhr.status === 200) {
const blob = new Blob([xhr.response], { type: 'application/pdf' })
const url = URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '企业留档文件.pdf'
link.click()
URL.revokeObjectURL(url)
}
}
xhr.send()
}
}
}
......
......@@ -430,7 +430,7 @@ export default {
handleRetentionFile(item) {
console.log(item)
this.$router.push({
path: '/processing/retention-file'
path: '/processing/retention-file?id=' + item.id
})
},
/**
......
......@@ -563,7 +563,7 @@ export default {
handleRetentionFile(item) {
console.log(item)
this.$router.push({
path: '/processing/retention-file'
path: '/processing/retention-file?id=' + item.id
})
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment