Commit 9fde894e authored by 盖献康's avatar 盖献康

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

parents 05ca67eb 04426623
......@@ -207,5 +207,14 @@ export function pdfDownload(data) {
data
})
}
/**
*获取车型实验任务下的测试用例
*/
export function geTaskCase(data) {
return request({
url: '/system/testCase/getCaseIdList',
method: 'post',
data
})
}
......@@ -10,7 +10,7 @@ empty
placeholder="输入标准关键词"
@keyup.enter.native="search()"
>
<i class="el-icon-search el-input__icon" slot="suffix"> </i>
<i class="el-icon-search el-input__icon" @click="search()" slot="suffix"> </i>
</el-input>
<ul class="select-list">
<template v-for="item in standardList">
......
......@@ -132,19 +132,20 @@ Vue.use(VueApollo);
// 全局导入Echarts
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
import { Message } from 'element-ui'
// 请求graphql使用的apollo API
const apolloClient = new ApolloClient({
// 服务端Url
uri: process.env.VUE_APP_CLIENT_API + "/query", //
onError(error) {
Message({ message: '车联网接口异常', type: 'error' })
// 处理错误
},
});
//创建apollo实例对象
const apolloProvider = new VueApollo({
defaultClient: apolloClient, //默认查询
})
new Vue({
el: '#app',
router,
......
......@@ -175,7 +175,7 @@
@click="
goNext(
'/processing/carReview/source-record?id=' +
item.carReviewTaskId
item.modelTestTaskId
)
"
>车型试验原始记录</el-button
......
......@@ -221,7 +221,10 @@
</collapse>
</div>
<!--确定车型试验范围-->
<div class="form-review-questionnaire">
<div
v-if="model.testScenarioList && model.testScenarioList.length > 0"
class="form-review-questionnaire"
>
<div class="title-display">
<span class="title-i"></span>
<span class="title-content">确定车型试验范围</span>
......@@ -230,10 +233,7 @@
<div class="img-label" style="margin-top: 20px">选择测试场景</div>
</div>
<!-- 测试场景 -->
<div
v-if="model.testScenarioList.length > 0"
class="test-scenario-container"
>
<div class="test-scenario-container">
<div
v-for="(item, index) in model.testScenarioList"
:key="index"
......@@ -379,7 +379,10 @@ export default {
? process.env.VUE_APP_IMAGE_API + imgs[1]
: ''
}
if (this.model.testScenarioList.length > 0) {
if (
this.model.testScenarioList &&
this.model.testScenarioList.length > 0
) {
this.model.testScenarioList = this.model.testScenarioList.map(
({ id, testScenario, ...rest }) => ({
label: testScenario,
......
......@@ -277,7 +277,11 @@
>
保存当前条目
</footer-button>
<footer-button type="primary" icon="check" @click="submitFrom()"
<footer-button
v-if="model.carReviewTask.leaderId == userId"
type="primary"
icon="check"
@click="submitFrom()"
>提交表单</footer-button
>
</div>
......@@ -406,7 +410,7 @@ export default {
})
return num
},
...mapGetters(['name', 'companyFiles'])
...mapGetters(['name', 'companyFiles', 'userId'])
},
watch: {
'form.fileName': function (newValue) {
......
......@@ -23,7 +23,7 @@ export default {
},
mounted() {
const id = this.$route.query.id
this.url = `http://10.12.48.80:1234/car/complianceTestingCenter/projectOverView/project_items;${id}`
this.url = `http://10.12.48.80:1234/car/complianceTestingCenter/projectOverView/${id}`
},
methods: {}
}
......
......@@ -64,6 +64,7 @@
:scroll-x="'1500px'"
:default-sort="{ prop: 'createTime', order: 'descending' }"
:data="tableData"
@sort-change="sort_change"
>
<el-table-column type="index" width="55" label="序号" align="center">
<template slot-scope="scope">
......@@ -242,12 +243,22 @@ export default {
this.queryParams.taskId = this.$route.query.id
},
methods: {
sort_change(column, prop, order) {
this.queryParams.pageNum = 1 // 排序后返回第一页
if (column.order) {
this.queryParams.isAsc = column.order === 'ascending' ? 'asc' : 'desc'
this.queryParams.orderByColumn = column.prop
this.loadData()
}
},
resetQuery() {
// this.refs.queryForm.restForm() this.resetForm("queryForm");
this.queryParams = {
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
taskId: this.$route.query.id
taskId: this.$route.query.id,
isAsc: this.queryParams.isAsc,
orderByColumn: this.queryParams.orderByColumn
}
this.handleQuery()
},
......
......@@ -167,14 +167,14 @@
>车型审查原始记录</el-button
>
<el-button
v-if="item.carReviewTaskId"
v-if="item.modelTestTaskId"
type="primary"
plain
size="mini"
@click="
goNext(
'/processing/carReview/source-record?id=' +
item.carReviewTaskId
item.modelTestTaskId
)
"
>车型试验原始记录</el-button
......
......@@ -287,7 +287,11 @@
>
保存当前条目
</footer-button>
<footer-button type="primary" icon="check" @click="submitFrom()"
<footer-button
v-if="model.systemReviewTask.leaderId == userId"
type="primary"
icon="check"
@click="submitFrom()"
>提交表单</footer-button
>
</div>
......@@ -425,7 +429,7 @@ export default {
})
return num
},
...mapGetters(['name', 'companyFiles'])
...mapGetters(['name', 'companyFiles', 'userId'])
},
watch: {
'form.fileName': function (newValue) {
......
......@@ -182,7 +182,7 @@
</el-link>
</div>
<div
v-if="item.carTestStatus && item.carTestStatus !== 'NONE'"
v-if="item.testStatus && item.testStatus !== 'NONE'"
class="cell-item"
>
<el-link
......@@ -190,16 +190,17 @@
:underline="false"
@click="
handleCarTypeTestTaskContent(
item.carTestStatus,
item.carTestTaskId,
item.id
item.testStatus,
item.modelTestTaskId,
item.id,
item.testSchemeId
)
"
>
{{
getDictData(
dict.type.test_cartype_task_btn,
item.carTestStatus
item.testStatus
)
}}
</el-link>
......@@ -273,14 +274,14 @@
</div>
</div>
<div
v-if="item.carTestStatus && item.carTestStatus !== 'NONE'"
v-if="item.testStatus && item.testStatus !== 'NONE'"
class="cell-item"
>
<div
:class="[
'cell-status',
item.carTestStatus !== 'FINISH'
? item.carTestStatus == 'NEW'
item.testStatus !== 'FINISH'
? item.testStatus == 'NEW'
? ''
: 'yellow'
: 'green'
......@@ -291,13 +292,12 @@
{{
getDictData(
dict.type.test_cartype_type,
item.carTestStatus
item.testStatus
)
}}</span
>
<span v-if="item.carTestStatus !== 'NEW'"
>{{
item.carTestStatus !== 'FINISH' ? '(共耗时' : '(已耗时'
<span v-if="item.testStatus !== 'NEW'"
>{{ item.testStatus !== 'FINISH' ? '(共耗时' : '(已耗时'
}}{{ getHourDiff(item.taskBeginTime) }})</span
>
</div>
......@@ -329,7 +329,7 @@
></el-progress>
</div>
<div
v-if="item.carTestStatus && item.carTestStatus !== 'NONE'"
v-if="item.testStatus && item.testStatus !== 'NONE'"
class="cell-item"
>
<el-progress
......@@ -392,8 +392,8 @@ import page from '@/mixins/page'
import taskDialog from './components/dialog'
import { getHourDiff } from '@/utils/diff'
import { mapGetters } from 'vuex'
import { reviewTaskStart } from '@/api/task/task'
import request from '@/utils/request'
import { geTaskCase, reviewTaskStart } from '@/api/task/task'
import { FastTestProject } from '@/api/graphql/client.graphql'
export default {
dicts: [
'inspection_item',
......@@ -463,19 +463,39 @@ export default {
closeOnClickModal: false
})
.then(async () => {
const res = await reviewTaskStart({
// if(item)
console.log(item)
const params = {
id: item.id
})
if (res.code === 200) {
this.loadData()
} else {
if (res.msg) {
this.$message.error(res.msg)
}
if (item.nextSubTask === 'trfis') {
const res = await geTaskCase({
modelTestId: item.modelTestTaskId
})
if (res.code === 200) {
const resp = await this.newFileTest({
name: item.taskName,
caseIdList: res.data
})
params.testSchemeId = resp.data.projectMutation.project.id
this.startTaskModel(params)
}
} else {
this.startTaskModel(params)
}
})
.catch(() => {})
},
async startTaskModel(params) {
const res = await reviewTaskStart(params)
if (res.code === 200) {
this.loadData()
} else {
if (res.msg) {
this.$message.error(res.msg)
}
}
},
goDetail(id) {
this.$router.push({
path: '/task/task-detail?id=' + id
......@@ -544,8 +564,26 @@ export default {
})
}
},
/**
* 对接车联网新建测试项目
*/
async newFileTest(task) {
const res = await this.$apollo.mutate({
// fetchPolicy: 'no-cache',
mutation: FastTestProject,
variables: {
name: task.name,
lawId: 'law_items;106',
principalUserId: 'user_items;2',
systemId: 'system;1',
caseIdList: task.caseIdList,
fileList: ['file_management_items;2']
}
})
return res
},
// 车型测试
handleCarTypeTestTaskContent(status, id, taskId) {
handleCarTypeTestTaskContent(status, id, taskId, testSchemeId) {
switch (status) {
// 查看试验方案
case 'NEW':
......@@ -556,7 +594,7 @@ export default {
// 执行试验方案
case 'PENDING':
this.$router.push({
path: `/processing/carTest/execution-test-plan?id=${id}&taskId=${taskId}`
path: `/processing/carTest/execution-test-plan?id=${testSchemeId}`
})
break
// 确认测试结果
......
......@@ -7,46 +7,25 @@
frameborder="0"
style="width: 100%; height: 100%"
></iframe>
<el-button @click="newFileTest">新建任务</el-button>
</div>
</page-standard>
</template>
<script>
import { FastTestProject } from '@/api/graphql/client.graphql'
export default {
name: 'Index',
data() {
return {
id: this.$route.query,
url: ''
// http://10.12.48.80:1234/car/caseManage/case/casePublishDetail/case_items;375
// http://10.12.48.78:8090/car/caseManage/case/casePublishDetail/case_items;375
}
},
mounted() {
const id = this.$route.query.id
this.url = `http://10.12.48.80:1234/car/caseManage/case/casePublishDetail/case_items;${id}`
this.url = `http://10.12.48.78:8090/car/caseManage/case/casePublishDetail/${id}`
},
methods: {
newFileTest() {
this.$apollo
.mutate({
// fetchPolicy: 'no-cache',
mutation: FastTestProject,
variables: {
name: 'test122',
lawId: 'law_items;106',
principalUserId: 'user_items;2',
systemId: 'system;1',
caseIdList: ['case_items;391'],
fileList: ['file_management_items;2']
}
})
.then(res => {
console.log(res)
})
}
}
methods: {}
}
</script>
......
......@@ -408,6 +408,8 @@ export default {
const configIds = row.configId || this.ids
this.$modal
.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -418,6 +418,8 @@ export default {
handleDelete(row) {
this.$modal
.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -473,6 +473,8 @@ export default {
const dictCodes = row.dictCode || this.ids
this.$modal
.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -403,6 +403,8 @@ export default {
const dictIds = row.dictId || this.ids
this.$modal
.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -379,6 +379,8 @@ export default {
const noticeIds = row.noticeId || this.ids
this.$modal
.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(() => {
......
......@@ -360,6 +360,8 @@ export default {
const postIds = row.postId || this.ids
this.$modal
.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -531,6 +531,7 @@ export default {
.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', {
closeOnClickModal: false
})
.then(function () {
return changeRoleStatus(row.roleId, row.status)
})
......@@ -726,6 +727,8 @@ export default {
const roleIds = row.roleId || this.ids
this.$modal
.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -817,6 +817,8 @@ export default {
const userIds = row.userId || this.ids
this.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', {
type: 'warning',
title: '删除',
closeOnClickModal: false
})
.then(function () {
......
......@@ -181,13 +181,19 @@
</el-link>
</div>
<div
v-if="item.carTestStatus && item.carTestStatus !== 'NONE'"
v-if="item.testStatus && item.testStatus !== 'NONE'"
class="cell-item"
>
<el-link
type="primary"
:underline="false"
@click="handleCarTypeTestTaskContent('NEW', item.id)"
@click="
handleCarTypeTestTaskContent(
'NEW',
item.modelTestTaskId,
item.id
)
"
>
{{ getDictData(dict.type.test_cartype_task_btn, 'NEW') }}
</el-link>
......@@ -261,14 +267,14 @@
</div>
</div>
<div
v-if="item.carTestStatus && item.carTestStatus !== 'NONE'"
v-if="item.testStatus && item.testStatus !== 'NONE'"
class="cell-item"
>
<div
:class="[
'cell-status',
item.carTestStatus !== 'FINISH'
? item.carTestStatus == 'NEW'
item.testStatus !== 'FINISH'
? item.testStatus == 'NEW'
? ''
: 'yellow'
: 'green'
......@@ -279,13 +285,12 @@
{{
getDictData(
dict.type.test_cartype_type,
item.carTestStatus
item.testStatus
)
}}</span
>
<span v-if="item.carTestStatus !== 'NEW'"
>{{
item.carTestStatus !== 'FINISH' ? '(共耗时' : '(已耗时'
<span v-if="item.testStatus !== 'NEW'"
>{{ item.testStatus !== 'FINISH' ? '(共耗时' : '(已耗时'
}}{{ getHourDiff(item.taskBeginTime) }})</span
>
</div>
......@@ -317,7 +322,7 @@
></el-progress>
</div>
<div
v-if="item.carTestStatus && item.carTestStatus !== 'NONE'"
v-if="item.testStatus && item.testStatus !== 'NONE'"
class="cell-item"
>
<el-progress
......@@ -431,14 +436,14 @@
>车型审查原始记录</el-button
>
<el-button
v-if="item.carReviewTaskId"
v-if="item.modelTestTaskId"
type="primary"
plain
size="mini"
@click="
goNext(
'/processing/carReview/source-record?id=' +
item.carReviewTaskId
item.modelTestTaskId
)
"
>车型试验原始记录</el-button
......@@ -719,26 +724,30 @@ export default {
}
},
// 车型测试
handleCarTypeTestTaskContent(status, id) {
handleCarTypeTestTaskContent(status, id, taskId) {
switch (status) {
// 查看试验方案
case 'NEW':
this.$router.push({
path: '/processing/review-form?type=3&id=' + id
path: `/processing/carTest/review-form?id=${id}`
})
break
// 执行试验方案
case 'PENDING':
this.$router.push({
path: '/processing/vehicle-type'
path: `/processing/carTest/execution-test-plan?id=${id}&taskId=${taskId}`
})
break
// 确认测试结果
case 'SIGNED':
this.$router.push({
path: '/processing/vehicle-type'
ath: `/processing/carTest/confirmation-test??id=${id}`
})
break
case 'FINISH':
this.$router.push({
path: '/processing/carTest/source-record?id=' + id
})
}
}
}
......
......@@ -42,7 +42,7 @@ module.exports = {
}
},
[process.env.VUE_APP_CLIENT_API]: {
target: `http://10.12.48.80:1234`,
target: `http://10.12.48.78:8090`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_CLIENT_API]: ''
......
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