Commit 0e912000 authored by 高滢's avatar 高滢

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

parents 57d8d96c 8c3e0824
......@@ -21,12 +21,14 @@ const standard = {
},
setStandardList({ commit }, name) {
getStandardList({
name: name ? name : '',
keyWord: name ? name : '',
pageNum: 1,
pageSize: 9999
}).then(res => {
if (res.code === 200) {
standard.state.standard = res.rows[0].id
if (res.rows.length) {
standard.state.standard = res.rows[0].id
}
commit('SET_STANDARD_LIST', res.rows)
}
})
......
......@@ -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 })
......
......@@ -230,9 +230,12 @@
<div class="img-label" style="margin-top: 20px">选择测试场景</div>
</div>
<!-- 测试场景 -->
<div class="test-scenario-container">
<div
v-if="model.testScenarioList.length > 0"
class="test-scenario-container"
>
<div
v-for="(item, index) in testScenarioList"
v-for="(item, index) in model.testScenarioList"
:key="index"
:class="{
'test-scenario': item.check === false,
......@@ -242,7 +245,6 @@
>
<div>{{ item.label }}</div>
</div>
<!-- </div> -->
</div>
</div>
<!--签字确认-->
......@@ -319,36 +321,13 @@ export default {
return {
isShow: true,
task: {},
auditRequirement: 0,
testScenarioList: [
{ value: 0, label: 'TBOX-蜂窝以太网接口', check: false },
{ value: 1, label: 'WiFi AP接口', check: false },
{ value: 2, label: 'WiFi Client接口', check: false },
{ value: 3, label: '充电以太网接口', check: false },
{ value: 4, label: 'CAN 诊断接口(OBD)', check: false },
{ value: 5, label: '以太网诊断接口(OBD)', check: false },
{ value: 6, label: '车载摄像头以太网接口(无线)', check: false },
{ value: 7, label: '第三方应用软件', check: false },
{ value: 8, label: '远程控车应用', check: false },
{ value: 9, label: 'USB接口', check: false },
{ value: 10, label: 'XCB标定', check: false },
{ value: 11, label: 'CCP标定', check: false },
{ value: 12, label: '安全启动', check: false },
{ value: 13, label: '远程控车', check: false },
{ value: 14, label: 'V2X', check: false },
{ value: 15, label: 'BT', check: false },
{ value: 16, label: 'BLE', check: false },
{ value: 17, label: 'NFC', check: false },
{ value: 18, label: '射频钥匙', check: false },
{ value: 19, label: '软件升级', check: false },
{ value: 20, label: 'ECU固体', check: false }
],
checkTestScenarioList: [],
model: {
carReviewTask: {},
reviewSceneChangeTasks: {},
detailsList: []
detailsList: [],
testScenarioList: []
},
selectedScenario: [],
columns: [],
ruleForm: {
enterpriseLeader: '',
......@@ -400,6 +379,16 @@ export default {
? process.env.VUE_APP_IMAGE_API + imgs[1]
: ''
}
if (this.model.testScenarioList.length > 0) {
this.model.testScenarioList = this.model.testScenarioList.map(
({ id, testScenario, ...rest }) => ({
label: testScenario,
value: parseInt(id),
check: false,
...rest
})
)
}
} else {
this.$modal.msgError(res.msg)
}
......@@ -433,6 +422,7 @@ export default {
],
taskId: this.taskId
}
formData.testScenarioList = this.selectedScenario
carTaskSubmit(formData).then(res => {
if (res.code === 200) {
this.$modal.msgSuccess('确认提交成功')
......@@ -444,21 +434,17 @@ export default {
}
})
},
handleTestScenario(item) {
// 查看item.value在this.checkTestScenarioList里面存不存在
// 存在则删除
if (this.checkTestScenarioList.includes(item.value)) {
this.checkTestScenarioList.splice(
this.checkTestScenarioList.indexOf(item.label),
if (this.selectedScenario.includes(item.value)) {
this.selectedScenario.splice(
this.selectedScenario.indexOf(item.value),
1
)
item.check = false
} else {
item.check = true
this.checkTestScenarioList.push(item.value)
this.selectedScenario.push(item.value)
}
console.log('李斯特', this.checkTestScenarioList)
},
openAll() {
this.activeNames = this.model.carReviewTask.standard.map(i => {
......
......@@ -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)
}
}
......
......@@ -214,7 +214,14 @@
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog
:title="title"
:visible.sync="open"
width="500px"
:close-on-click-modal="false"
:close-on-press-escape="false"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="参数名称" prop="configName">
<el-input v-model="form.configName" placeholder="请输入参数名称" />
......
......@@ -145,7 +145,14 @@
</el-table>
<!-- 添加或修改部门对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-dialog
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="open"
width="600px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col v-if="form.parentId !== 0" :span="24">
......
......@@ -204,7 +204,14 @@
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="open"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典类型">
<el-input v-model="form.dictType" :disabled="true" />
......
......@@ -217,7 +217,14 @@
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="open"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
......
......@@ -157,7 +157,14 @@
</el-table>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-dialog
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="open"
width="680px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="24">
......
......@@ -183,7 +183,14 @@
/>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
<el-dialog
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="open"
width="780px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
......
......@@ -169,7 +169,14 @@
/>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog
:title="title"
:visible.sync="open"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="岗位名称" prop="postName">
<el-input v-model="form.postName" placeholder="请输入岗位名称" />
......
......@@ -224,7 +224,14 @@
/>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog
:title="title"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="open"
width="500px"
append-to-body
>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="form.roleName" placeholder="请输入角色名称" />
......@@ -303,6 +310,8 @@
<el-dialog
:title="title"
:visible.sync="openDataScope"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="500px"
append-to-body
>
......
......@@ -3,6 +3,8 @@
<el-dialog
title="选择用户"
:visible.sync="visible"
:close-on-click-modal="false"
:close-on-press-escape="false"
width="800px"
top="5vh"
append-to-body
......
......@@ -571,7 +571,12 @@ export default {
}
console.log('model.inspectionItemList', newValue)
this.rules.inspectionItemList[0].required = true
if (newValue.length === 1 && newValue.includes('trfis')) {
if (
(newValue.length === 1 && newValue.includes('trfis')) ||
(newValue.length === 2 &&
newValue.includes('trfis') &&
newValue.includes('sraif'))
) {
this.rules.testScenarioList[0].required = true
this.testScenarioShow = true
} else {
......@@ -604,7 +609,6 @@ export default {
this.$store.dispatch('testScenario/setTestScenarioList')
// 对字典:inspection_item, 做处理
this.getUserByRole()
// this.initWebSocket()
// 查询样品信息(整车、零件)
this.getSampleInformation()
this.$nextTick(() => {
......@@ -616,9 +620,6 @@ export default {
computed: {
...mapGetters(['standard', 'standardList', 'testScenarioList'])
},
// destroyed() {
// this.websock.close() // 离开路由之后断开websocket连接
// },
methods: {
getTaskDetail(taskId) {
getTaskById({ id: taskId }).then(response => {
......@@ -705,7 +706,6 @@ export default {
this.rules.inspectionItemList[0].required = false
this.rules.testScenarioList[0].required = false
} else {
// this.$route.meta.title = '发起新任务'
this.getTemporaryStorage()
}
})
......@@ -806,36 +806,6 @@ export default {
}
)
},
initWebSocket() {
// 初始化weosocket
const wsuri = 'ws://49.232.167.247:22032/websocket/1'
this.websock = new WebSocket(wsuri)
this.websock.onmessage = this.websocketonmessage
// this.websock.onopen = this.websocketonopen
this.websock.onerror = this.websocketonerror
this.websock.onclose = this.websocketclose
},
// websocketonopen() {
// // 连接建立之后执行send方法发送数据
// const actions = { test: '12345' }
// this.websocketsend(JSON.stringify(actions))
// },
websocketonerror() {
// 连接建立失败重连
this.initWebSocket()
},
websocketonmessage(e) {
// 数据接收
console.log('后端返回数据', e)
},
// websocketsend(Data) {
// // 数据发送
// this.websock.send(Data)
// },
websocketclose(e) {
// 关闭
console.log('断开连接', e)
},
/** 组长角色置顶逻辑 */
leaderTop() {
if (this.tableData.length !== 0) {
......@@ -987,22 +957,6 @@ export default {
*/
handleSavePeople(row) {
console.log('保存小组有', row)
// const obj = this.userList.find(item => item.userId === this.userId)
// const currentData = this.tableData.find(
// item => item.userId === row.userId
// )
// currentData.userId = this.userId
// currentData.nickName = obj.nickName
// currentData.dept = obj.dept
// // 已被选择的人做禁用
// this.userList.find(item => item.userId === this.userId).disabled = true
// this.userId = ''
// this.leaderTop()
// if (this.tableData.length === 1) {
// currentData.isLeader = 1
// } else {
// currentData.isLeader = 0
// }
console.log('现在的对象', this.tableData)
},
/**
......@@ -1058,10 +1012,11 @@ export default {
} else if (this.currentVehicleSampleInformation.length === 0) {
this.$message.error('请填写整车样品信息')
return
} else if (this.currentPartSampleInformation.length === 0) {
this.$message.error('请填写零件样品信息')
return
}
// else if (this.currentPartSampleInformation.length === 0) {
// this.$message.error('请填写零部件样品信息')
// return
// }
this.$confirm('是否确认进行发布功能', '发布', {
confirmButtonText: '确定',
concelButtonText: '取消',
......@@ -1194,13 +1149,6 @@ export default {
})
}
})
// 假装跳转详情页
// this.$router.push({
// path: '/task/task-detail',
// query: {
// taskId: '1763404524439060481'
// }
// })
},
// 判断一个对象里的数据是否为空
areAllPropertiesEmpty(obj) {
......
......@@ -566,7 +566,12 @@ export default {
}
console.log('model.inspectionItemList', newValue)
this.rules.inspectionItemList[0].required = true
if (newValue.length === 1 && newValue.includes('trfis')) {
if (
(newValue.length === 1 && newValue.includes('trfis')) ||
(newValue.length === 2 &&
newValue.includes('trfis') &&
newValue.includes('sraif'))
) {
this.rules.testScenarioList[0].required = true
this.testScenarioShow = true
} else {
......@@ -1051,10 +1056,11 @@ export default {
} else if (this.currentVehicleSampleInformation.length === 0) {
this.$message.error('请填写整车样品信息')
return
} else if (this.currentPartSampleInformation.length === 0) {
this.$message.error('请填写零件样品信息')
return
}
// else if (this.currentPartSampleInformation.length === 0) {
// this.$message.error('请填写零部件样品信息')
// return
// }
this.$confirm('是否确认进行发布功能', '发布', {
confirmButtonText: '确定',
concelButtonText: '取消',
......@@ -1143,53 +1149,43 @@ export default {
this.$modal.msgError('请填写部分内容再进行暂存')
return
}
this.$confirm('是否确认进行暂存功能', '暂存', {
confirmButtonText: '确定',
concelButtonText: '取消',
type: 'warning',
customClass: 'box-logout',
cancelButtonClass: 'resetBtn',
closeOnClickModal: false,
confirmButtonClass: 'queryBtn'
}).then(() => {
// 窜数据
for (const key in this.model) {
// eslint-disable-next-line no-prototype-builtins
if (this.taskCreateRequest.hasOwnProperty(key)) {
this.taskCreateRequest[key] = this.model[key]
}
// 窜数据
for (const key in this.model) {
// eslint-disable-next-line no-prototype-builtins
if (this.taskCreateRequest.hasOwnProperty(key)) {
this.taskCreateRequest[key] = this.model[key]
}
this.taskCreateRequest.taskList = this.model.inspectionItemList
this.tableData.forEach(item => {
item.deptName = item.dept.deptName
item.name = item.nickName
})
this.taskCreateRequest.auditors = this.tableData
this.taskCreateRequest.sample = this.currentVehicleSampleInformation
this.taskCreateRequest.sample.forEach(item => {
delete item.id
}
this.taskCreateRequest.taskList = this.model.inspectionItemList
this.tableData.forEach(item => {
item.deptName = item.dept.deptName
item.name = item.nickName
})
this.taskCreateRequest.auditors = this.tableData
this.taskCreateRequest.sample = this.currentVehicleSampleInformation
this.taskCreateRequest.sample.forEach(item => {
delete item.id
})
this.taskCreateRequest.partSample = this.currentPartSampleInformation
this.taskCreateRequest.partSample.forEach(item => {
delete item.id
})
console.log('暂存', this.taskCreateRequest)
if (this.taskTemporaryStorage !== null) {
// 暂存有数据再次暂存走编辑
this.taskCreateRequest.id = this.taskTemporaryStorage.id
editTemporaryStorage(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('保存成功')
}
})
this.taskCreateRequest.partSample = this.currentPartSampleInformation
this.taskCreateRequest.partSample.forEach(item => {
delete item.id
} else {
temporaryTask(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('保存成功')
}
})
console.log('暂存', this.taskCreateRequest)
if (this.taskTemporaryStorage !== null) {
// 暂存有数据再次暂存走编辑
this.taskCreateRequest.id = this.taskTemporaryStorage.id
editTemporaryStorage(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('暂存成功')
}
})
} else {
temporaryTask(this.taskCreateRequest).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('暂存成功')
}
})
}
})
}
},
// 判断一个对象里的数据是否为空
areAllPropertiesEmpty(obj) {
......
......@@ -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)
......
......@@ -487,10 +487,17 @@ export default {
} else {
this.$refs.form.validateField('inspectionItemList')
}
console.log('model.inspectionItemList', newValue)
if (newValue.includes(2)) {
console.log('aaaa', newValue)
if (
(newValue.length === 1 && newValue.includes('trfis')) ||
(newValue.length === 2 &&
newValue.includes('trfis') &&
newValue.includes('sraif'))
) {
this.rules.testScenarioList[0].required = true
this.testScenarioShow = true
} else {
this.testScenarioShow = false
this.rules.testScenarioList[0].required = false
}
}
......@@ -570,18 +577,17 @@ export default {
item.flag = 1
})
}
const taskList = this.taskDetail.taskList.split(',')
if (
this.taskDetail.taskList.split(',').length === 1 &&
this.taskDetail.taskList.split(',').includes('trfis')
(taskList.length === 1 && taskList.includes('trfis')) ||
(taskList.length === 2 &&
taskList.includes('trfis') &&
taskList.includes('sraif'))
) {
this.testScenarioShow = true
} else {
this.testScenarioShow = false
}
console.log('哈哈哈', this.testScenarioShow)
console.log('零件样品信息', this.partInfoArr)
console.log('model', this.model)
})
},
getInspectionItemDict() {
......
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