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

fix: 70609 70669

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