Commit b2064b35 authored by 盖献康's avatar 盖献康

Merge branch 'develop' of http://gitlab.91isoft.com:90/car-test/web into developer/gaixiankang

parents 5001a864 bbf1f10d
...@@ -77,6 +77,7 @@ tsno ...@@ -77,6 +77,7 @@ tsno
tuijian tuijian
unmatch unmatch
userinfo userinfo
varibles
vnode vnode
vnodes vnodes
vuedraggable vuedraggable
......
query GetSuiteList($offset: Int = 0, $limit: Int = 20, $search: String = "") { fragment CaseListItem on CaseCustomItemRep {
suiteList: getUserCustomCaseSuiteList( count
list: resultList {
id
serialNumber
name
description: caseDesc
remediation
submitUserName
submitTime
canModify
needDevice: isBind
classifyName
operatingSystemName
riskLevelName
testMethodName
}
}
# 查询用例列表
query GetCaseList(
$suiteId: ID
$offset: Int = 0
$limit: Int = 50
$search: String = ""
) {
caseList: getAllCaseList(
teamId: "team_items;1" teamId: "team_items;1"
search: {offset: {offset: $offset, limit: $limit}, searchField: "name", search: $search} suiteId: $suiteId
offset: { offset: $offset, limit: $limit }
search: {
retrieveData: [{ RetrieveColumn: "allName", RetrieveValue: $search }]
sortData: [{ SortColumn: "serialNumber", SortOrder: ASC }]
}
) { ) {
count ...CaseListItem
list: resultList { }
id }
name
lawType: layType fragment ProjectBasicObject on Project {
style id
descriptionInfo name
canModify description
caseCount status
updateTime }
createTime # 新建文件检测项目
createUser mutation NewFileTestProject(
createUserId $name: String!
$lawId: ID!
$principalUserId: ID!
$systemTypeId: ID!
$systemTypeName: String!
$systemId: ID!
$fileList: [ID!]!
) {
projectMutation: teamProject(id: "team_items;1") {
project: createProject(
input: {
testMethod: File
name: $name
lawId: $lawId
principalUserId: $principalUserId
autoPartsId: $systemTypeId
systemId: $systemId
systemType: $systemTypeName
fileList: $fileList
}
) {
...ProjectBasicObject
} }
} }
} }
...@@ -66,3 +66,11 @@ export function selectDataStatistics(data){ ...@@ -66,3 +66,11 @@ export function selectDataStatistics(data){
data: data data: data
}) })
} }
export function componentSelect(data){
return request({
url:'/system/enterprise/list',
method: 'post',
data: data
})
}
...@@ -197,3 +197,15 @@ export function getBySubtaskId(data) { ...@@ -197,3 +197,15 @@ export function getBySubtaskId(data) {
data data
}) })
} }
/**
* 下载pdf
*/
export function pdfDownload(data) {
return request({
url: '/pdf/download',
method: 'post',
data
})
}
...@@ -709,3 +709,11 @@ ...@@ -709,3 +709,11 @@
width: 120px !important; width: 120px !important;
// text-align: center !important; // text-align: center !important;
} }
.passed{
.el-form-item__label{
margin-left: -10px;
}
}
.el-progress{
display: flex;
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class="component-upload-image"> <div class="component-upload-image">
<el-upload <el-upload
multiple multiple
:auto-upload="true"
:action="uploadImgUrl" :action="uploadImgUrl"
list-type="picture-card" list-type="picture-card"
:on-success="handleUploadSuccess" :on-success="handleUploadSuccess"
...@@ -42,7 +43,7 @@ ...@@ -42,7 +43,7 @@
<template v-if="fileSize"> 且不得超过{{ fileSize }}MB </template> <template v-if="fileSize"> 且不得超过{{ fileSize }}MB </template>
</div> </div>
<el-dialog :visible.sync="dialogVisible" width="800" append-to-body> <el-dialog :visible.sync="dialogVisible" width="800" append-to-body :close-on-click-modal="false">
<img <img
:src="dialogImageUrl" :src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto" style="display: block; max-width: 100%; margin: 0 auto"
...@@ -128,36 +129,45 @@ export default { ...@@ -128,36 +129,45 @@ export default {
methods: { methods: {
// 上传前loading加载 // 上传前loading加载
handleBeforeUpload(file) { handleBeforeUpload(file) {
let isImg = false if (file.name) {
if (this.fileType.length) { const regex = /[\s~`!@#$%^&*()\-_=+[\]{}|;:'",<>/?]/
let fileExtension = '' const result = regex.test(file.name)
if (file.name.lastIndexOf('.') > -1) { if (result === true) {
fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1) this.fileList = []
} this.$modal.msgError('文件名称不正确,请上传不包含特殊字符名称的图片')
isImg = this.fileType.some(type => { } else if (result === false) {
if (file.type.indexOf(type) > -1) return true let isImg = false
if (fileExtension && fileExtension.indexOf(type) > -1) return true if (this.fileType.length) {
return false let fileExtension = ''
}) if (file.name.lastIndexOf('.') > -1) {
} else { fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1)
isImg = file.type.indexOf('image') > -1 }
} isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true
if (fileExtension && fileExtension.indexOf(type) > -1) return true
return false
})
} else {
isImg = file.type.indexOf('image') > -1
}
if (!isImg) { if (!isImg) {
this.$modal.msgError( this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join('/')}图片格式文件!` `文件格式不正确, 请上传${this.fileType.join('/')}图片格式文件!`
) )
return false return false
} }
if (this.fileSize) { if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize const isLt = file.size / 1024 / 1024 < this.fileSize
if (!isLt) { if (!isLt) {
this.$modal.msgError(`上传图片大小不能超过 ${this.fileSize} MB!`) this.$modal.msgError(`上传图片大小不能超过 ${this.fileSize} MB!`)
return false return false
}
}
this.$modal.loading('正在上传图片,请稍候...')
this.number++
} }
} }
this.$modal.loading('正在上传图片,请稍候...')
this.number++
}, },
// 文件个数超出 // 文件个数超出
handleExceed() { handleExceed() {
...@@ -168,6 +178,7 @@ export default { ...@@ -168,6 +178,7 @@ export default {
if (res.code === 200) { if (res.code === 200) {
// const Image = process.env.VUE_APP_IMAGE_API + res.url // const Image = process.env.VUE_APP_IMAGE_API + res.url
this.uploadList.push({ name: res.originalFilename, url: res.url }) this.uploadList.push({ name: res.originalFilename, url: res.url })
console.log(this.uploadList);
this.uploadedSuccessfully() this.uploadedSuccessfully()
} else { } else {
this.number-- this.number--
...@@ -247,14 +258,26 @@ export default { ...@@ -247,14 +258,26 @@ export default {
::v-deep .el-dialog { ::v-deep .el-dialog {
background: none; background: none;
width: 100%; width: 100%;
box-shadow: none;
} }
::v-deep .el-dialog__headerbtn { //::v-deep .el-dialog__headerbtn {
top: 8px !important; // top: 8px !important;
background: url('../../assets/icons/svg/guanbi.png') left no-repeat; // background: url('../../assets/icons/svg/guanbi.svg') left no-repeat;
background-size: cover; // background-size: cover;
} //}
::v-deep .el-dialog__headerbtn i { ::v-deep .el-dialog__headerbtn i {
font-size: 25px; font-size: 35px;
visibility: hidden; color: white;
//visibility: hidden;
}
// Dialog悬停样式
::v-deep .el-dialog__headerbtn:focus .el-dialog__close,
::v-deep .el-dialog__headerbtn:hover .el-dialog__close {
color: white !important;
}
// MessageBox悬停样式
::v-deep .el-message-box__headerbtn:focus .el-message-box__close,
::v-deep .el-message-box__headerbtn:hover .el-message-box__close {
color: white !important;
} }
</style> </style>
...@@ -129,6 +129,10 @@ import VueApollo from 'vue-apollo' ...@@ -129,6 +129,10 @@ import VueApollo from 'vue-apollo'
// 全局使用 // 全局使用
Vue.use(VueApollo); Vue.use(VueApollo);
// 全局导入Echarts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
// 请求graphql使用的apollo API // 请求graphql使用的apollo API
const apolloClient = new ApolloClient({ const apolloClient = new ApolloClient({
// 服务端Url // 服务端Url
......
<template>
<div
ref="chart"
style="width: 100%; height: 300px; display: flex; justify-content: center"
></div>
</template>
<script>
export default {
name: 'StandardClassification',
data() {
return {
chart: null
}
},
mounted() {
this.init()
},
methods: {
init() {
// 2.初始化
this.chart = this.$echarts.init(this.$refs.chart)
// 3.配置数据
const option = {
title: {
text: '标准分类占比',
left: 10,
top: 10,
textStyle: {
color: '#606266',
fontWeight: 700,
fontSize: 16
}
},
legend: {
top: 'bottom'
},
color: ['#F6B24B', '#1A6FD7', '#13BE24'],
series: [
{
name: 'Nightingale Chart',
type: 'pie',
radius: ['30%', '40%'],
roseType: 'area',
itemStyle: {
borderRadius: 10
},
label: {
formatter: `{b|{b}}\n\n{d}%`, // 自定义lable处展示那些数据及其格式
fontSize: 14, // 字体大小
rich: {
b: {
color: ' #606266',
fontSize: 14
}
},
color: 'inherit'
},
labelLine: {
length: 25, // 挨着图例的直线的长度
length2: 10 // 挨着文字的直线的长度
},
data: [
{ value: 40, name: 'rose 1' },
{ value: 38, name: 'rose 2' },
{ value: 32, name: 'rose 3' }
]
}
]
}
// 4.传入数据
this.chart.setOption(option)
}
}
}
</script>
<style lang="scss" scoped></style>
<template> <template>
<div>HomePage</div> <page-standard>
<el-row :gutter="20">
<el-col :span="8">
<div class="cardOne">
<div class="left">
<ul>
<li style="color: #278ce9">
<div class="textLayout">
<span class="cardOneTitle">支持标准数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #f96f21">
<div class="textLayout">
<span class="cardOneTitle">任务数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #13be24">
<div class="textLayout">
<span class="cardOneTitle">检验员数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #e88069">
<div class="textLayout">
<span class="cardOneTitle">整车样品数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #7f69e8">
<div class="textLayout">
<span class="cardOneTitle">测试类型数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
</ul>
</div>
<div class="right">
<ul>
<li style="color: #12cdaa">
<div class="textLayout">
<span class="cardOneTitle">测试用例数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #f9a221">
<div class="textLayout">
<span class="cardOneTitle">检验报告数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #e55868">
<div class="textLayout">
<span class="cardOneTitle">车企数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #278ce9">
<div class="textLayout">
<span class="cardOneTitle">零部件样品数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
<li style="color: #41d1ff">
<div class="textLayout">
<span class="cardOneTitle">测试场景数量</span
><span class="cardOneNumber">319</span>
</div>
</li>
</ul>
</div>
</div>
</el-col>
<el-col :span="5">
<div class="cardStyle">
<StandardClassification></StandardClassification>
</div>
</el-col>
<el-col :span="6">
<div>3</div>
</el-col>
<el-col :span="5">
<div>4</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="14">
<div>5</div>
</el-col>
<el-col :span="10">
<el-row>
<el-col :span="24">
<div>6</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div>7</div>
</el-col>
</el-row>
</el-col>
</el-row>
</page-standard>
</template> </template>
<script> <script>
import StandardClassification from './echartHome/standardClassification.vue'
export default { export default {
name: 'HomePage', name: 'HomePage',
components: { StandardClassification },
data() { data() {
return {} return {}
} }
} }
</script> </script>
<style lang="scss" scoped>
.cardStyle {
border: 1px solid #dcdfe3;
border-radius: 4px;
}
.cardOne {
height: 300px;
display: flex;
justify-content: space-between;
padding: 20px 30px;
border: 1px solid #dcdfe3;
border-radius: 4px;
.left {
}
.right {
}
}
.cardOneTitle {
font-size: 14px;
font-weight: 400;
color: #606266;
}
.cardOneNumber {
font-size: 18px;
font-weight: 400;
color: #303133;
}
.textLayout {
width: 180px;
display: flex;
justify-content: space-between;
margin: 20px 0;
}
</style>
...@@ -94,4 +94,7 @@ export default { ...@@ -94,4 +94,7 @@ export default {
.el-table { .el-table {
width: auto; width: auto;
} }
/deep/ .el-drawer__header {
margin-bottom: 0px !important;
}
</style> </style>
...@@ -98,4 +98,25 @@ export default { ...@@ -98,4 +98,25 @@ export default {
.table { .table {
width: auto; width: auto;
} }
.table thead {
background: none;
}
.table th {
color: #303133;
font-size: 14px;
font-weight: 700;
}
.table td {
color: #606266;
font-size: 14px;
font-weight: 400;
}
.custom_title {
color: #303133 !important;
font-size: 18px;
font-weight: 400;
}
/deep/ .el-drawer__header {
margin-bottom: 0px !important;
}
</style> </style>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="button-bar"> <div class="button-bar">
<page-button <page-button
v-hasPermi="['setting:standard:update']" v-hasPermi="['setting:standardTerms:content']"
icon="doc-search" icon="doc-search"
title="检验内容" title="检验内容"
@click.native="handleUpdate(scope.row)" @click.native="handleUpdate(scope.row)"
......
...@@ -74,24 +74,29 @@ ...@@ -74,24 +74,29 @@
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="测试场景" align="left" prop="testScenario" /> <el-table-column
<el-table-column label="测试类型" align="left" prop="testType" /> label="测试场景"
align="left"
sortable
prop="testScenario"
/>
<el-table-column label="测试类型" align="left" sortable prop="testType" />
<el-table-column label="用例编号" align="left" prop="usecaseNo" /> <el-table-column label="用例编号" align="left" prop="usecaseNo" />
<el-table-column label="用例名称" align="left" prop="name" /> <el-table-column label="用例名称" align="left" prop="name" />
<el-table-column label="工具" align="left" prop="tools" /> <el-table-column label="工具" align="left" prop="tools" />
<el-table-column label="对应输入" align="left" prop="input" /> <el-table-column label="对应输入" align="left" prop="input" />
<el-table-column label="用例描述" align="left" prop="description" /> <el-table-column label="用例描述" align="left" prop="description" />
<el-table-column label="更新人员" align="left" prop="updateBy" /> <!-- <el-table-column label="更新人员" align="left" prop="updateBy" />-->
<el-table-column <!-- <el-table-column-->
label="更新时间" <!-- label="更新时间"-->
align="center" <!-- align="center"-->
prop="updateTime" <!-- prop="updateTime"-->
width="180" <!-- width="180"-->
> <!-- >-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span> <!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
type="password" type="password"
auto-complete="off" auto-complete="off"
placeholder="密码" placeholder="密码"
maxlength="20"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
> >
<iconpark-icon slot="prefix" name="lock" size="20"></iconpark-icon> <iconpark-icon slot="prefix" name="lock" size="20"></iconpark-icon>
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
type="primary" type="primary"
plain plain
size="mini" size="mini"
@click="goNext(item.id)" @click="downloadPdf(item.id)"
>检查报告</el-button >检查报告</el-button
> >
<el-button <el-button
...@@ -249,6 +249,7 @@ ...@@ -249,6 +249,7 @@
</template> </template>
<script> <script>
import page from '@/mixins/page' import page from '@/mixins/page'
import { pdfDownload } from '@/api/task/task'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
dicts: ['sys_scene_type', 'task_type', 'inspection_item'], dicts: ['sys_scene_type', 'task_type', 'inspection_item'],
...@@ -270,6 +271,47 @@ export default { ...@@ -270,6 +271,47 @@ 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 })
......
...@@ -155,6 +155,8 @@ export default { ...@@ -155,6 +155,8 @@ export default {
watch: { watch: {
fileName(newValue) { fileName(newValue) {
this.model.fileName = newValue this.model.fileName = newValue
this.model.enterpriseName = this.enterpriseName
this.model.taskId = this.$route.query.taskId
}, },
'dialogManger.dialogEditId'(newValue) { 'dialogManger.dialogEditId'(newValue) {
this.model.fetch( this.model.fetch(
...@@ -165,12 +167,6 @@ export default { ...@@ -165,12 +167,6 @@ export default {
) )
} }
}, },
mounted() {
this.model.enterpriseName = this.enterpriseName
},
created() {
this.model.taskId = this.$route.query.taskId
},
methods: { methods: {
handleUpdateFile(newValue) { handleUpdateFile(newValue) {
this.$emit('fileNameUpdate', newValue) this.$emit('fileNameUpdate', newValue)
...@@ -201,6 +197,9 @@ export default { ...@@ -201,6 +197,9 @@ export default {
}) })
this.$emit('handleSave', res.data) this.$emit('handleSave', res.data)
this.$modal.msgSuccess('提交文件成功') this.$modal.msgSuccess('提交文件成功')
this.$nextTick(() => {
this.$refs.fileRef.clearValidate()
})
}, },
errors => {} errors => {}
) )
......
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
class="right-content-item" class="right-content-item passed"
label="审查结果" label="审查结果"
prop="passed" prop="passed"
> >
...@@ -211,23 +211,33 @@ ...@@ -211,23 +211,33 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<div> <div>
文件名称 <el-form-item
<el-autocomplete prop="fileName"
v-model="form.fileName" label-suffix=" "
style="width: 100%" label="文件名称"
:fetch-suggestions="querySearch" >
placeholder="请输入文件名称" <el-autocomplete
@select="querySelect" v-model="form.fileName"
></el-autocomplete> style="width: 100%"
:fetch-suggestions="querySearch"
placeholder="请输入文件名称"
@select="querySelect"
></el-autocomplete>
</el-form-item>
</div> </div>
</el-col> </el-col>
<el-col :span="8" :offset="1"> <el-col :span="8" :offset="1">
<div> <div>
章节条目或范围 <el-form-item
<el-input prop="catalogue"
v-model="form.catalogue" label-suffix=" "
placeholder="请输入具体章节条目或范围" label="章节条目或范围"
/> >
<el-input
v-model="form.catalogue"
placeholder="请输入具体章节条目或范围"
/>
</el-form-item>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -340,7 +350,23 @@ export default { ...@@ -340,7 +350,23 @@ export default {
checked: false, checked: false,
detailsList: [], detailsList: [],
rules: { rules: {
passed: [{ required: true, message: '请选择审查结果', trigger: 'blur' }] passed: [
{ required: true, message: '请选择审查结果', trigger: 'blur' }
],
fileName: [
{
required: true,
message: '请输入文件名称',
trigger: ['change']
}
],
catalogue: [
{
required: true,
message: '请输入具体章节条目或范围',
trigger: 'blur'
}
]
}, },
changeTask: [], changeTask: [],
changeTaskDetails: [], changeTaskDetails: [],
......
This diff is collapsed.
<!-- 测试用例详情 -->
<template>
<page-standard>
<div class="web-page">
<iframe
:src="url"
frameborder="0"
style="width: 100%; height: 100%"
></iframe>
</div>
</page-standard>
</template>
<script>
import { NewFileTestProject } from '@/api/graphql/client.graphql'
export default {
name: 'Index',
data() {
return {
id: this.$route.query,
url: ''
}
},
mounted() {
const id = this.$route.query.id
this.url = `http://10.12.48.78:8090/car/complianceTestingCenter/projectOverView/project_items;${id}`
},
methods: {}
}
</script>
<style scoped>
.web-page {
height: 90vh;
}
</style>
<template>
<!--查看试验方案页面-->
<task-standard v-loading="loading">
<div slot="header-right">
<header-button
icon="arrow-left"
class="back-btn"
type="no-line"
@click="goBack"
>
返回
</header-button>
</div>
<!--2-统计值-->
<div class="main-content-style">
<!--任务编号,名称,单位-->
<div class="task">
<div class="task-item">
<span class="task-label">任务编号:</span>
<span class="task-content">
{{ model.systemReviewTask.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.entrustedUnit }}
</span>
</div>
<div class="task-item">
<span class="task-label">任务状态:</span>
<span class="task-content">
{{
getDictData(
dict.type.task_test_status,
model.systemReviewTask.taskStatus
)
}}
</span>
</div>
</div>
<!--查看试验方案列表-->
<div>
<div class="form-review-questionnaire">
<!--查看试验方案列表-->
<table class="table">
<col style="width: 100px" />
<thead>
<tr>
<th>章节号</th>
<th>标准技术要求</th>
<th>标准测试方法</th>
<th>测试场景</th>
<th>测试类型</th>
<th>用例编号</th>
<th>用例名称</th>
<th>工具</th>
<th>对应输入</th>
<th>测试用例</th>
</tr>
</thead>
<tbody>
<!-- 循环遍历 keyPointList -->
<template v-for="(i, PointIndex) in tableData.keyPointList">
<tr :key="'PointIndex1' + PointIndex">
<td align="center" :rowspan="getRows(i)">
{{ '7.1.1' }}
</td>
<td align="center" :rowspan="getRows(i)">
{{ i.text }}
</td>
<td align="center" :rowspan="getRows(i)">
{{ i.text }}
</td>
</tr>
<!-- 循环遍历 reviewDetailsList -->
<template v-for="(v, reviewDetailIndex) in i.reviewDetailsList">
<tr
:key="'reviewDetailIndex' + PointIndex + reviewDetailIndex"
>
<td align="center">
{{ '测试场景' }}
</td>
<td align="center">
{{ '测试类型' }}
</td>
<td align="center">
{{ '用例编号' }}
</td>
<td align="center">
{{ '用例名称' }}
</td>
<td align="center">
{{ '工具' }}
</td>
<td align="center">
{{ v.text }}
</td>
<td align="center">
<template
v-for="(a, reviewSceneIndex) in v.reviewSceneList"
>
<div
:key="
'reviewSceneIndex' +
PointIndex +
reviewDetailIndex +
reviewSceneIndex
"
>
<span>{{
reviewSceneIndex + 1 + '、' + a.text
}}</span>
<br />
</div>
</template>
</td>
</tr>
</template>
</template>
</tbody>
</table>
</div>
<!--返回按钮-->
<div class="bottom-btn">
<footer-button
type="default"
icon="arrow-left"
@click="$router.go(-1)"
>
返回
</footer-button>
<!-- <el-button type="primary" @click="goToProcessedReview">
确认提交
</el-button> -->
</div>
</div>
</div>
</task-standard>
</template>
<!--js逻辑-->
<script>
import { getRows, getRows2 } from '../../../../utils/reviewDetailsTable'
import routerMixins from '@/mixins/router'
import { listInspection } from '../../../../api/setting/standardTerms'
export default {
name: 'Index',
mixins: [routerMixins],
dicts: ['task_test_status'],
data() {
return {
tableData: [],
model: {
systemReviewTask: {},
reviewSceneChangeTasks: {},
detailsList: []
},
task: {},
taskId: '',
loading: false
}
},
mounted() {
this.init()
},
methods: {
/**
* 获取任务详情
*/
async getTest() {
// this.loading = true
// const res = await reviewTaskDetail({
// taskId: '1767377960098127873'
// })
// this.loading = false
// if (res.code === 200) {
// await this.getTaskDetail()
// this.model = res.data
// } else {
// this.$modal.msgError(res.msg)
// }
},
// async getTaskDetail() {
// const result = await getBySubtaskId({
// id: '1767377960098127873'
// })
// if (result.code === 200) {
// this.task = result.data
// }
// }
getRows,
getRows2,
/** 获取体系审查、车型审查检验内容 */
init() {
this.loading = true
listInspection({ id: '1744181159757221888' }).then(res => {
this.tableData = res.data
this.loading = false
})
}
}
}
</script>
<style scoped>
.table th {
background-color: #f2f2f2 !important;
}
</style>
...@@ -138,12 +138,12 @@ ...@@ -138,12 +138,12 @@
align="left" align="left"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<img <el-image
style="width: 36px; height: 36px"
:src="baseUrl + scope.row.photo" :src="baseUrl + scope.row.photo"
alt="文件照片" :preview-src-list="[baseUrl + scope.row.photo]"
width="36" >
height="36" </el-image>
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
......
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
type="primary" type="primary"
plain plain
size="mini" size="mini"
@click="goNext(item.id)" @click="downloadPdf(item.id)"
>检查报告</el-button >检查报告</el-button
> >
<el-button <el-button
...@@ -220,6 +220,7 @@ ...@@ -220,6 +220,7 @@
<script> <script>
import page from '@/mixins/page' import page from '@/mixins/page'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { pdfDownload } from '@/api/task/task'
export default { export default {
mixins: [page], mixins: [page],
dicts: ['inspection_item'], dicts: ['inspection_item'],
...@@ -237,6 +238,47 @@ export default { ...@@ -237,6 +238,47 @@ 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 })
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<!-- table部分 --> <!-- table部分 -->
<div class="pdf-box"> <div class="pdf-box">
<iframe <iframe
v-loading="loading"
:src="fileUrl" :src="fileUrl"
frameborder="0" frameborder="0"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
...@@ -50,7 +51,7 @@ ...@@ -50,7 +51,7 @@
</template> </template>
<script> <script>
import { getTaskById } from '@/api/task/task' import { getTaskById, pdfDownload } from '@/api/task/task'
import routerMixins from '@/mixins/router' import routerMixins from '@/mixins/router'
export default { export default {
mixins: [routerMixins], mixins: [routerMixins],
...@@ -59,14 +60,26 @@ export default { ...@@ -59,14 +60,26 @@ export default {
task: {}, task: {},
taskId: 1, taskId: 1,
view: '', view: '',
fileUrl: fileUrl: '',
'http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf' loading: false
} }
}, },
async mounted() { async mounted() {
this.loading = true
if (this.$route.query.id) { if (this.$route.query.id) {
this.taskId = this.$route.query.id this.taskId = this.$route.query.id
this.getTaskDetail() await this.getTaskDetail()
pdfDownload({
taskId: this.$route.query.id,
type: 1
}).then(res => {
this.fileUrl =
process.env.VUE_APP_IMAGE_API +
'/vehicle-quality-review-oss/' +
res.data
this.loading = false
})
} }
this.view = this.$route.query.view this.view = this.$route.query.view
}, },
......
...@@ -155,6 +155,8 @@ export default { ...@@ -155,6 +155,8 @@ export default {
watch: { watch: {
fileName(newValue) { fileName(newValue) {
this.model.fileName = newValue this.model.fileName = newValue
this.model.enterpriseName = this.enterpriseName
this.model.taskId = this.$route.query.taskId
}, },
'dialogManger.dialogEditId'(newValue) { 'dialogManger.dialogEditId'(newValue) {
this.model.fetch( this.model.fetch(
...@@ -165,12 +167,6 @@ export default { ...@@ -165,12 +167,6 @@ export default {
) )
} }
}, },
mounted() {
this.model.enterpriseName = this.enterpriseName
},
created() {
this.model.taskId = this.$route.query.taskId
},
methods: { methods: {
handleUpdateFile(newValue) { handleUpdateFile(newValue) {
this.$emit('fileNameUpdate', newValue) this.$emit('fileNameUpdate', newValue)
...@@ -201,6 +197,9 @@ export default { ...@@ -201,6 +197,9 @@ export default {
}) })
this.$emit('handleSave', res.data) this.$emit('handleSave', res.data)
this.$modal.msgSuccess('提交文件成功') this.$modal.msgSuccess('提交文件成功')
this.$nextTick(() => {
this.$refs.fileRef.clearValidate()
})
}, },
errors => {} errors => {}
) )
......
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
class="right-content-item" class="right-content-item passed"
label="审查结果" label="审查结果"
prop="passed" prop="passed"
> >
...@@ -221,23 +221,33 @@ ...@@ -221,23 +221,33 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<div> <div>
文件名称 <el-form-item
<el-autocomplete prop="fileName"
v-model="form.fileName" label-suffix=" "
style="width: 100%" label="文件名称"
:fetch-suggestions="querySearch" >
placeholder="请输入文件名称" <el-autocomplete
@select="querySelect" v-model="form.fileName"
></el-autocomplete> style="width: 100%"
:fetch-suggestions="querySearch"
placeholder="请输入文件名称"
@select="querySelect"
></el-autocomplete>
</el-form-item>
</div> </div>
</el-col> </el-col>
<el-col :span="8" :offset="1"> <el-col :span="8" :offset="1">
<div> <div>
章节条目或范围 <el-form-item
<el-input prop="catalogue"
v-model="form.catalogue" label-suffix=" "
placeholder="请输入具体章节条目或范围" label="章节条目或范围"
/> >
<el-input
v-model="form.catalogue"
placeholder="请输入具体章节条目或范围"
/>
</el-form-item>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -350,7 +360,23 @@ export default { ...@@ -350,7 +360,23 @@ export default {
checked: false, checked: false,
detailsList: [], detailsList: [],
rules: { rules: {
passed: [{ required: true, message: '请选择审查结果', trigger: 'blur' }] passed: [
{ required: true, message: '请选择审查结果', trigger: 'blur' }
],
fileName: [
{
required: true,
message: '请输入文件名称',
trigger: ['change']
}
],
catalogue: [
{
required: true,
message: '请输入具体章节条目或范围',
trigger: 'blur'
}
]
}, },
// TODO 删除 // TODO 删除
checkedTwo: false, checkedTwo: false,
......
...@@ -189,7 +189,11 @@ ...@@ -189,7 +189,11 @@
type="primary" type="primary"
:underline="false" :underline="false"
@click=" @click="
handleCarTypeTestTaskContent(item.carTestStatus, item.id) handleCarTypeTestTaskContent(
item.carTestStatus,
item.carTestTaskId,
item.id
)
" "
> >
{{ {{
...@@ -534,26 +538,30 @@ export default { ...@@ -534,26 +538,30 @@ export default {
} }
}, },
// 车型测试 // 车型测试
handleCarTypeTestTaskContent(status, id) { handleCarTypeTestTaskContent(status, id, taskId) {
switch (status) { switch (status) {
// 查看试验方案 // 查看试验方案
case 'NEW': case 'NEW':
this.$router.push({ this.$router.push({
path: '/processing/review-form?type=3&id=' + id path: `/processing/carTest/review-form?id=${id}`
}) })
break break
// 执行试验方案 // 执行试验方案
case 'PENDING': case 'PENDING':
this.$router.push({ this.$router.push({
path: '/processing/vehicle-type' path: `/processing/carTest/execution-test-plan?id=${id}&taskId=${taskId}`
}) })
break break
// 确认测试结果 // 确认测试结果
case 'SIGNED': case 'SIGNED':
this.$router.push({ this.$router.push({
path: '/processing/vehicle-type' ath: `/processing/carTest/confirmation-test??id=${id}`
}) })
break break
case 'FINISH':
this.$router.push({
path: '/processing/carTest/source-record?id=' + id
})
} }
}, },
/* 跳转到问卷详情*/ /* 跳转到问卷详情*/
......
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
this.handleClose() this.handleClose()
}, },
errors => { errors => {
this.handleClose() // this.handleClose()
} }
) )
} else { } else {
......
...@@ -133,11 +133,15 @@ ...@@ -133,11 +133,15 @@
min-width="150" min-width="150"
/> />
<el-table-column <el-table-column
prop="manufacturingEnterprise" prop="enterpriseName"
label="生产企业" label="生产企业"
show-overflow-tooltip show-overflow-tooltip
min-width="200" min-width="200"
/> >
<template slot-scope="scope">
{{ scope.row.enterpriseName ? scope.row.enterpriseName : '--' }}
</template>
</el-table-column>
<el-table-column label="相关任务" width="300" :resizable="false"> <el-table-column label="相关任务" width="300" :resizable="false">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.taskSampleRelation.length > 0"> <div v-if="scope.row.taskSampleRelation.length > 0">
...@@ -274,14 +278,21 @@ ...@@ -274,14 +278,21 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="生产企业" prop="manufacturingEnterprise"> <el-form-item label="生产企业" prop="manufacturingEnterpriseId">
<el-input <el-select
v-model="editParamsForm.manufacturingEnterprise" v-model="editParamsForm.manufacturingEnterpriseId"
placeholder="请输入生产企业" placeholder="请选择"
clearable
maxlength="50"
style="width: 90%" style="width: 90%"
/> @change="selectComponent"
>
<el-option
v-for="item in componentSelect"
:key="item.id"
:label="item.enterpriseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="商标" prop="trademark"> <el-form-item label="商标" prop="trademark">
<image-upload <image-upload
...@@ -390,6 +401,7 @@ import { ...@@ -390,6 +401,7 @@ import {
import MaterialLibrary from '@/views/setting/materialLibrary/index.vue' import MaterialLibrary from '@/views/setting/materialLibrary/index.vue'
import materialLibrary from '@/views/setting/materialLibrary/index.vue' import materialLibrary from '@/views/setting/materialLibrary/index.vue'
import { isExternal } from '@/utils/validate' import { isExternal } from '@/utils/validate'
import { componentSelect } from '../../../api/system/sample'
export default { export default {
components: { MaterialLibrary }, components: { MaterialLibrary },
...@@ -425,8 +437,8 @@ export default { ...@@ -425,8 +437,8 @@ export default {
manufactureDate: [ manufactureDate: [
{ required: true, message: '请选择生产日期', trigger: 'change' } { required: true, message: '请选择生产日期', trigger: 'change' }
], ],
manufacturingEnterprise: [ manufacturingEnterpriseId: [
{ required: true, message: '请输入生产企业', trigger: 'blur' } { required: true, message: '请选择生产企业', trigger: 'change' }
] ]
}, },
editParamsForm: { editParamsForm: {
...@@ -454,7 +466,8 @@ export default { ...@@ -454,7 +466,8 @@ export default {
dialogVisible: false, dialogVisible: false,
trademarkDisplay: true, trademarkDisplay: true,
dialogTitle: '新建', dialogTitle: '新建',
samplePhotosDisplay: true samplePhotosDisplay: true,
componentSelect: []
} }
}, },
computed: { computed: {
...@@ -484,8 +497,25 @@ export default { ...@@ -484,8 +497,25 @@ export default {
}, },
created() { created() {
this.getList() this.getList()
this.getComponentSelect()
}, },
methods: { methods: {
selectComponent(val) {
const obj = this.componentSelect.find(item => item.id === val)
this.editParamsForm.manufacturingEnterprise = obj.enterpriseName
console.log(obj)
},
getComponentSelect() {
componentSelect({
pageNum: 1,
pageSize: 9999,
isAsc: 'desc',
orderByColumn: 'createTime'
}).then(res => {
this.componentSelect = res.rows
console.log('res', res)
})
},
closeMaterial(data) { closeMaterial(data) {
this.materialShow = data this.materialShow = data
}, },
...@@ -635,8 +665,18 @@ export default { ...@@ -635,8 +665,18 @@ export default {
} }
selectSampleInfo({ id: id }).then(res => { selectSampleInfo({ id: id }).then(res => {
this.editParamsForm = res.data this.editParamsForm = res.data
const foundObject = this.componentSelect.find(
item => item.id === this.editParamsForm.manufacturingEnterpriseId
)
if (foundObject) {
this.editParamsForm.manufacturingEnterpriseId =
res.data.manufacturingEnterpriseId
} else {
this.editParamsForm.manufacturingEnterpriseId = ''
}
this.dialogVisible = true this.dialogVisible = true
}) })
this.$refs.editForm.resetFields()
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm('是否确定删除该条数据?', '提示', { this.$confirm('是否确定删除该条数据?', '提示', {
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
<el-row :gutter="41"> <el-row :gutter="41">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检验依据:"> <el-form-item label="检验依据:">
<sapn class="card-contnet">{{ taskForm.name }}</sapn> <sapn class="card-contnet">{{
taskForm.standardNo + ' ' + taskForm.name
}}</sapn>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" class="card-title"> <el-col :span="8" class="card-title">
...@@ -53,10 +55,10 @@ ...@@ -53,10 +55,10 @@
</el-col> </el-col>
<el-col :span="8" class="card-title"> <el-col :span="8" class="card-title">
<el-form-item label="小组成员:"> <el-form-item label="小组成员:">
<sapn class="card-contnet" <sapn class="card-contnet">
>{{ taskForm.leader ? taskForm.leader + '(组长)、' : '' }}
<div v-for="(item, index) in taskForm.auditors" :key="index"> <div v-for="(item, index) in taskForm.auditors" :key="index">
{{ item.name }} {{ item.name }}
<span v-show="index === 0">(组长)</span>
<span v-show="index + 1 != taskForm.auditors.length"> <span v-show="index + 1 != taskForm.auditors.length">
</span> </span>
...@@ -834,7 +836,7 @@ import { selectDataStatistics, selectTaskInfo } from '@/api/system/sample' ...@@ -834,7 +836,7 @@ import { selectDataStatistics, selectTaskInfo } from '@/api/system/sample'
import dict from '@/utils/dict' import dict from '@/utils/dict'
export default { export default {
dicts: ['system_task_status', 'confidentiality_level'], dicts: ['system_task_status', 'confidentiality_level', 'inspection_item'],
data() { data() {
return { return {
taskList: [], taskList: [],
...@@ -853,6 +855,15 @@ export default { ...@@ -853,6 +855,15 @@ export default {
}, },
methods: { methods: {
dict, dict,
dictValueReturn(item) {
if (item === 'sraifv') {
return '汽车信息安全管理体系要求'
} else if (item === 'grfis') {
return '汽车信息安全一般要求'
} else {
return '汽车信息安全技术要求'
}
},
getDataStatistics() { getDataStatistics() {
selectDataStatistics({ id: this.taskId }).then(res => { selectDataStatistics({ id: this.taskId }).then(res => {
this.dataStatistic = res.data this.dataStatistic = res.data
...@@ -864,6 +875,9 @@ export default { ...@@ -864,6 +875,9 @@ export default {
this.taskForm = res.data this.taskForm = res.data
if (res.data.taskList) { if (res.data.taskList) {
this.taskList = this.taskForm.taskList.split(',') this.taskList = this.taskForm.taskList.split(',')
this.taskList.forEach((item, index) => {
this.taskList[index] = this.dictValueReturn(item)
})
} }
console.log('任务详情', res) console.log('任务详情', res)
}) })
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="button-bar"> <div class="button-bar">
<page-button <page-button
v-hasPermi="['setting:standard:update']" v-hasPermi="['setting:standardTerms:content']"
icon="doc-search" icon="doc-search"
title="检验内容" title="检验内容"
@click.native="handleUpdate(scope.row)" @click.native="handleUpdate(scope.row)"
......
...@@ -183,7 +183,8 @@ export default { ...@@ -183,7 +183,8 @@ export default {
}, },
/** 点击跳转详情 */ /** 点击跳转详情 */
viewDetail(row) { viewDetail(row) {
this.$message(row) console.log(row)
// this.$message(row)
this.$router.push({ this.$router.push({
path: '/setting/useCaseDetails', path: '/setting/useCaseDetails',
query: { id: row } query: { id: row }
......
...@@ -6,32 +6,42 @@ ...@@ -6,32 +6,42 @@
:src="url" :src="url"
frameborder="0" frameborder="0"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
></iframe ></iframe>
>Ï <el-button @click="newFileTest">新建任务</el-button>
</div> </div>
</page-standard> </page-standard>
</template> </template>
<script> <script>
import { GetSuiteList } from '@/api/graphql/client.graphql' import { NewFileTestProject } from '@/api/graphql/client.graphql'
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
return { return {
id: this.$route.query, id: this.$route.query,
url: 'http://10.12.48.78:8090/car/caseManage/case/casePublishDetail/case_items;375' url: ''
// http://10.12.48.80:1234/car/caseManage/case/casePublishDetail/case_items;375 // http://10.12.48.80:1234/car/caseManage/case/casePublishDetail/case_items;375
} }
}, },
mounted() { mounted() {
this.getSuiteList() const id = this.$route.query.id
this.url = `http://10.12.48.78:8090/car/caseManage/case/casePublishDetail/case_items;${id}`
}, },
methods: { methods: {
getSuiteList() { newFileTest() {
this.$apollo this.$apollo
.query({ .mutate({
fetchPolicy: 'no-cache', // fetchPolicy: 'no-cache',
query: GetSuiteList mutation: NewFileTestProject,
variables: {
name: 'test106',
lawId: 'law_items;106',
principalUserId: 'user_items;2',
systemTypeId: 'autoParts;1',
systemTypeName: 'Linux',
systemId: 'system;1',
fileList: ['file_management_items;2']
}
}) })
.then(res => { .then(res => {
console.log(res) console.log(res)
......
...@@ -85,18 +85,18 @@ ...@@ -85,18 +85,18 @@
<el-table-column label="工具" align="left" prop="tools" /> <el-table-column label="工具" align="left" prop="tools" />
<el-table-column label="对应输入" align="left" prop="input" /> <el-table-column label="对应输入" align="left" prop="input" />
<el-table-column label="用例描述" align="left" prop="description" /> <el-table-column label="用例描述" align="left" prop="description" />
<el-table-column label="更新人员" align="left" prop="updateBy" /> <!-- <el-table-column label="更新人员" align="left" prop="updateBy" />-->
<el-table-column <!-- <el-table-column-->
label="更新时间" <!-- label="更新时间"-->
sortable <!-- sortable-->
align="left" <!-- align="left"-->
prop="updateTime" <!-- prop="updateTime"-->
width="180" <!-- width="180"-->
> <!-- >-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span> <!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
......
...@@ -598,9 +598,9 @@ export default { ...@@ -598,9 +598,9 @@ export default {
password: [ password: [
{ required: true, message: '用户密码不能为空', trigger: 'blur' }, { required: true, message: '用户密码不能为空', trigger: 'blur' },
{ {
min: 5, min: 6,
max: 20, max: 20,
message: '用户密码长度必须介于 5 和 20 之间', message: '用户密码长度必须介于 6 和 20 之间',
trigger: 'blur' trigger: 'blur'
} }
], ],
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
v-for="(item, key) in standardList" v-for="(item, key) in standardList"
:key="key" :key="key"
:value="item.id" :value="item.id"
:label="item.standardNo + item.name" :label="item.standardNo + ' ' + item.name"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -448,7 +448,7 @@ ...@@ -448,7 +448,7 @@
type="primary" type="primary"
plain plain
size="mini" size="mini"
@click="goNext(item.id)" @click="downloadPdf(item.id)"
>检查报告</el-button >检查报告</el-button
> >
<el-button <el-button
...@@ -486,11 +486,7 @@ ...@@ -486,11 +486,7 @@
import page from '@/mixins/page' import page from '@/mixins/page'
import { getHourDiff } from '@/utils/diff' import { getHourDiff } from '@/utils/diff'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { import { reviewTaskStart, pdfDownload, removeTask } from '@/api/task/task'
reviewTaskStart,
reviewCarTaskStart,
removeTask
} from '@/api/task/task'
import request from '@/utils/request' import request from '@/utils/request'
export default { export default {
dicts: [ dicts: [
...@@ -545,6 +541,47 @@ export default { ...@@ -545,6 +541,47 @@ 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()
},
loadData() { loadData() {
this.loading = true this.loading = true
if (this.active === '0') { if (this.active === '0') {
......
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