Commit 1ce23e25 authored by jiaxu.yan's avatar jiaxu.yan

fix: 70609 70669

parent 18023e6a
......@@ -21,7 +21,7 @@ const standard = {
},
setStandardList({ commit }, name) {
getStandardList({
name: name ? name : '',
keyword: name ? name : '',
pageNum: 1,
pageSize: 9999
}).then(res => {
......
......@@ -185,14 +185,16 @@
type="primary"
plain
size="mini"
@click="downloadPdf(item.id)"
>报告</el-button
@click="goNext('/processing/report?id=' + item.id + '&type=0')"
>报告</el-button
>
<el-button
type="primary"
plain
size="mini"
@click="goNext('/processing/retention-file?id=' + item.id)"
@click="
goNext('/processing/retention-file?id=' + item.id + '&type=1')
"
>企业留档文件</el-button
>
<el-button
......@@ -271,47 +273,6 @@ export default {
this.$store.dispatch('standard/setStandardList')
},
methods: {
/**
* 检验报告
*/
downloadPdf(id) {
pdfDownload({
taskId: id,
type: 0
}).then(res => {
const fileUrl =
process.env.VUE_APP_IMAGE_API +
'/vehicle-quality-review-oss/' +
res.data
this.download(fileUrl)
})
},
/**
* 下载pdf
*/
download(fileUrl) {
// 根据pdf文件地址下载
// window.location.href = this.fileUrl
const xhr = new XMLHttpRequest()
xhr.open('GET', 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()
},
/* 跳转到问卷详情*/
goNext(url) {
this.$router.push({ path: url })
......
......@@ -160,7 +160,8 @@
@click="
goNext(
'/processing/carReview/source-record?id=' +
item.carReviewTaskId
item.carReviewTaskId +
'&type=1'
)
"
>车型审查原始记录</el-button
......@@ -183,14 +184,16 @@
type="primary"
plain
size="mini"
@click="downloadPdf(item.id)"
>报告</el-button
@click="goNext('/processing/report?id=' + item.id + '&type=0')"
>报告</el-button
>
<el-button
type="primary"
plain
size="mini"
@click="goNext('/processing/retention-file?id=' + item.id)"
@click="
goNext('/processing/retention-file?id=' + item.id + '&type=1')
"
>企业留档文件</el-button
>
<el-button
......@@ -241,18 +244,7 @@ export default {
/**
* 检验报告
*/
downloadPdf(id) {
pdfDownload({
taskId: id,
type: 0
}).then(res => {
const fileUrl =
process.env.VUE_APP_IMAGE_API +
'/vehicle-quality-review-oss/' +
res.data
this.download(fileUrl)
})
},
downloadPdf(id) {},
/**
* 下载pdf
*/
......@@ -270,7 +262,7 @@ export default {
const link = document.createElement('a')
link.href = url
link.download = '检报告.pdf'
link.download = '检报告.pdf'
link.click()
URL.revokeObjectURL(url)
......
......@@ -72,7 +72,7 @@ export default {
pdfDownload({
taskId: this.$route.query.id,
type: 1
type: this.$route.query.type
}).then(res => {
this.fileUrl =
process.env.VUE_APP_IMAGE_API +
......@@ -109,9 +109,9 @@ export default {
const link = document.createElement('a')
link.href = url
link.download = '企业留档文件.pdf'
link.download =
this.$route.query.type === 1 ? '企业留档文件.pdf' : '检验报告.pdf'
link.click()
URL.revokeObjectURL(url)
}
}
......
......@@ -448,14 +448,16 @@
type="primary"
plain
size="mini"
@click="downloadPdf(item.id)"
>报告</el-button
@click="goNext('/processing/report?id=' + item.id + '&type=0')"
>报告</el-button
>
<el-button
type="primary"
plain
size="mini"
@click="goNext('/processing/retention-file?id=' + item.id)"
@click="
goNext('/processing/retention-file?id=' + item.id + '&type=1')
"
>企业留档文件</el-button
>
<el-button
......@@ -541,21 +543,6 @@ export default {
this.$store.dispatch('standard/setStandardList')
},
methods: {
/**
* 检验报告
*/
downloadPdf(id) {
pdfDownload({
taskId: id,
type: 0
}).then(res => {
const fileUrl =
process.env.VUE_APP_IMAGE_API +
'/vehicle-quality-review-oss/' +
res.data
this.download(fileUrl)
})
},
/**
* 下载pdf
*/
......@@ -573,7 +560,7 @@ export default {
const link = document.createElement('a')
link.href = url
link.download = '检报告.pdf'
link.download = '检报告.pdf'
link.click()
URL.revokeObjectURL(url)
......
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