Commit 6e1beeb5 authored by jiaxu.yan's avatar jiaxu.yan

Merge branch 'develop' into developer/yanjiaxu

parents 75d21f64 72eeefd5
...@@ -217,4 +217,16 @@ export function geTaskCase(data) { ...@@ -217,4 +217,16 @@ export function geTaskCase(data) {
data data
}) })
} }
/**
*提交确认表单
*/
export function taskImageSubmit(data) {
return request({
url: '/car/test/task/submit',
method: 'post',
data
})
}
...@@ -19,7 +19,7 @@ export default { ...@@ -19,7 +19,7 @@ export default {
// 3.配置数据 // 3.配置数据
const option = { const option = {
title: { title: {
text: '任务保密等级占比', text: '用例风险程度概览',
left: 'left', left: 'left',
textStyle: { textStyle: {
color: '#606266', color: '#606266',
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
size="36" size="36"
></iconpark-icon> ></iconpark-icon>
</div> </div>
<span>完成 :43个</span> <span>完成 :43个</span>
<div> <div>
<el-progress <el-progress
:percentage="40" :percentage="40"
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<div class="cardStyle" style="height: 500px"> <div class="cardStyle" style="height: 500px">
<div class="cardTitle">任务完成情况占比</div> <div class="cardTitle">参与任务情况</div>
<div <div
style=" style="
display: flex; display: flex;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="task-item"> <div class="task-item">
<span class="task-label">任务编号:</span> <span class="task-label">任务编号:</span>
<span class="task-content"> <span class="task-content">
{{ model.carReviewTask.taskNo }} {{ task.taskNo }}
</span> </span>
</div> </div>
<div class="task-item"> <div class="task-item">
...@@ -30,17 +30,12 @@ ...@@ -30,17 +30,12 @@
{{ task.entrustedUnit }} {{ task.entrustedUnit }}
</span> </span>
</div> </div>
<div class="task-item"> <!-- <div class="task-item">-->
<span class="task-label">任务状态:</span> <!-- <span class="task-label">任务状态:</span>-->
<span class="task-content"> <!-- <span class="task-content">-->
{{ <!-- {{ getDictData(dict.type.task_test_status, task.taskStatus) }}-->
getDictData( <!-- </span>-->
dict.type.test_cartype_type, <!-- </div>-->
model.carReviewTask.taskStatus
)
}}
</span>
</div>
</div> </div>
<div class="task-body"> <div class="task-body">
<!--card统计值--> <!--card统计值-->
...@@ -131,46 +126,58 @@ ...@@ -131,46 +126,58 @@
<col style="width: 100px" /> <col style="width: 100px" />
<thead> <thead>
<tr> <tr>
<th>章节号</th> <th style="width: 100px">章节号</th>
<th>标准技术要求</th> <th>标准技术要求</th>
<th>标准测试方法</th> <th>标准测试方法</th>
<th>测试场景</th> <th>测试场景</th>
<th>测试类型</th> <th>测试类型</th>
<th>用例编号</th> <th>用例编号</th>
<th>测试结果</th> <th>测试结果</th>
<!-- <th>用例名称</th>-->
<!-- <th>工具</th>-->
<!-- <th>对应输入</th>-->
<!-- <th style="width: 370px">测试用例</th>-->
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<!-- 循环遍历 keyPointList --> <template v-for="(i, PointIndex) in tableData">
<template v-for="(i, PointIndex) in tableData.keyPointList">
<tr :key="'PointIndex1' + PointIndex"> <tr :key="'PointIndex1' + PointIndex">
<td align="center" :rowspan="getRows(i)"> <td align="center" :rowspan="getRows3(i)">
{{ '7.1.1' }} {{ i.chapter }}
</td> </td>
<td align="center" :rowspan="getRows(i)"> <td align="center" :rowspan="getRows3(i)">
{{ i.text }} {{ i.text }}
</td> </td>
<td align="center" :rowspan="getRows(i)"> <td align="center" :rowspan="getRows3(i)">
{{ i.text }} {{ i.testMethod }}
</td> </td>
</tr> </tr>
<!-- 循环遍历 reviewDetailsList --> <template v-for="(v, testCaseIndex) in i.testCaseList">
<template v-for="(v, reviewDetailIndex) in i.reviewDetailsList"> <tr :key="'testCaseIndex' + PointIndex + testCaseIndex">
<tr <td align="center" rowspan="1">
:key="'reviewDetailIndex' + PointIndex + reviewDetailIndex" {{ v.testScenario }}
>
<td align="center">
{{ '测试场景' }}
</td> </td>
<td align="center"> <td align="center" rowspan="1">
{{ '测试类型' }} {{ v.testType }}
</td> </td>
<td align="center"> <td align="center" rowspan="1">
{{ '用例编号' }} {{ v.usecaseNo }}
</td> </td>
<td align="center"> <td align="center" rowspan="1">
{{ '测试结果' }} {{ '' }}
</td> </td>
<!-- <td align="center" rowspan="1">-->
<!-- {{ v.name }}-->
<!-- </td>-->
<!-- <td align="center" rowspan="1">-->
<!-- {{ v.tools }}-->
<!-- </td>-->
<!-- <td align="center" rowspan="1">-->
<!-- {{ v.input }}-->
<!-- </td>-->
<!-- <td align="center" rowspan="1">-->
<!-- {{ v.description }}-->
<!-- </td>-->
</tr> </tr>
</template> </template>
</template> </template>
...@@ -209,6 +216,7 @@ ...@@ -209,6 +216,7 @@
返回 返回
</footer-button> </footer-button>
<footer-button <footer-button
v-if="this.isLeader !== false"
type="primary" type="primary"
icon="hard-disk-one" icon="hard-disk-one"
@click="goToProcessedReview" @click="goToProcessedReview"
...@@ -223,11 +231,12 @@ ...@@ -223,11 +231,12 @@
<!--js逻辑--> <!--js逻辑-->
<script> <script>
import routerMixins from '@/mixins/router' import routerMixins from '@/mixins/router'
import { getRows, getRows2 } from '../../../../utils/reviewDetailsTable' import { getRows3 } from '../../../../utils/reviewDetailsTable'
import { listInspection } from '../../../../api/setting/standardTerms' import { testDetail } from '../../../../api/task/test'
import { getBySubtaskId, taskImageSubmit } from '../../../../api/task/task'
export default { export default {
name: 'Index', name: 'Index',
dicts: ['test_cartype_type'], dicts: ['task_test_status'],
mixins: [routerMixins], mixins: [routerMixins],
data() { data() {
return { return {
...@@ -243,95 +252,56 @@ export default { ...@@ -243,95 +252,56 @@ export default {
inspectionLeader: '', inspectionLeader: '',
result: [] result: []
}, },
rules: { loading: false,
enterpriseLeader: [ isLeader: ''
{ required: true, message: '请输入车企负责人', trigger: 'blur' }
],
inspectionLeader: [
{ required: true, message: '请输入检验负责人', trigger: 'blur' }
]
},
taskId: '',
loading: false
} }
}, },
// async mounted() {
// if (this.$route.query.id) {
// this.taskId = this.$route.query.id
// }
// await this.getTask()
// this.openAll()
// },
mounted() { mounted() {
this.init() this.getTest()
this.getTestDetail()
}, },
methods: { methods: {
getRows, getRows3,
getRows2,
/** 获取体系审查、车型审查检验内容 */
init() {
this.loading = true
listInspection({ id: '1744181159757221888' }).then(res => {
this.tableData = res.data
this.loading = false
})
},
/**
* 获取任务详情
*/
// async getTask() {
// this.loading = true
// const res = await checkTaskDetail({
// taskId: this.taskId
// })
// this.loading = false
// if (res.code === 200) {
// this.model = res.data
// await this.getTaskDetail()
// if (this.model.carReviewTask.imagesUrl) {
// const imgs = this.model.carReviewTask.imagesUrl.split(',')
// this.ruleForm.enterpriseLeader
// ? process.env.VUE_APP_IMAGE_API + imgs[0]
// : ''
// this.ruleForm.inspectionLeader
// ? process.env.VUE_APP_IMAGE_API + imgs[1]
// : ''
// }
// } else {
// this.$modal.msgError(res.msg)
// }
// },
/**
* 获取任务详情
*/
// async getTaskDetail() {
// const result = await getBySubtaskId({
// id: this.taskId
// })
// if (result.code === 200) {
// this.task = result.data
// }
// },
/* 返回跳转*/ /* 返回跳转*/
goToProcessedReview() { goToProcessedReview() {
// this.ruleForm.taskId = this.taskId // this.ruleForm.taskId = '1771093631118106626'
// const formData = { const formData = {
// imagesUrl: [ // imagesUrl: [
// this.ruleForm.enterpriseLeader, // this.ruleForm.enterpriseLeader,
// this.ruleForm.inspectionLeader // this.ruleForm.inspectionLeader
// ], // ],
// taskId: this.taskId imagesUrl: [{}],
// } taskId: this.$route.query.id
// carTaskSubmit(formData).then(res => { }
// if (res.code === 200) { console.log('formData', formData)
// this.$modal.msgSuccess('确认提交成功') taskImageSubmit(formData).then(res => {
// this.$router.push({ if (res.code === 200) {
// path: '/processing/unprocessed-review' this.$modal.msgSuccess('确认提交成功')
// }) this.$router.push({
// } else { path: '/processing/unprocessed-review'
// this.$modal.msgError(res.msg) })
// } } else {
// }) this.$modal.msgError(res.msg)
}
})
},
/** 获取任务详情 */
getTest() {
getBySubtaskId({ id: this.$route.query.id }).then(res => {
if (res.code === 200) {
this.task = res.data
const auditors = res.data.auditors
this.isLeader = auditors.some(item => item.isLeader === 1)
console.log('found', this.isLeader) // 输出: true 如果找到,否则输出: false
}
})
},
getTestDetail() {
this.loading = true
testDetail({ taskId: this.$route.query.id }).then(res => {
this.tableData = res.data
this.loading = false
})
} }
} }
} }
......
...@@ -139,7 +139,6 @@ export default { ...@@ -139,7 +139,6 @@ export default {
detailsList: [] detailsList: []
}, },
task: {}, task: {},
taskId: '',
loading: false loading: false
} }
}, },
...@@ -150,7 +149,7 @@ export default { ...@@ -150,7 +149,7 @@ export default {
methods: { methods: {
getRows3, getRows3,
getTest() { getTest() {
getBySubtaskId({ id: '1768527384203460609' }).then(res => { getBySubtaskId({ id: this.$route.query.id }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.task = res.data this.task = res.data
} }
...@@ -159,7 +158,7 @@ export default { ...@@ -159,7 +158,7 @@ export default {
/** 获取任务详情 */ /** 获取任务详情 */
getTestDetail() { getTestDetail() {
this.loading = true this.loading = true
testDetail({ taskId: '1768527384203460609' }).then(res => { testDetail({ taskId: this.$route.query.id }).then(res => {
this.tableData = res.data this.tableData = res.data
this.loading = false this.loading = false
}) })
......
...@@ -177,10 +177,11 @@ export default { ...@@ -177,10 +177,11 @@ export default {
} }
} }
.submit-button { .submit-button {
text-align: end;
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
background: #ffffff; background: #ffffff;
width: 100%; width: 30%;
padding: 20px; padding: 20px;
} }
</style> </style>
...@@ -328,6 +328,7 @@ ...@@ -328,6 +328,7 @@
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
<div style="height: 60px"></div>
<div class="dialog-button"> <div class="dialog-button">
<el-button <el-button
v-loading="addLoading" v-loading="addLoading"
...@@ -705,9 +706,12 @@ export default { ...@@ -705,9 +706,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog-button { .dialog-button {
display: flex; position: fixed;
justify-content: flex-end; bottom: 0px;
margin-right: 20px; background: #ffffff;
width: 39%;
padding: 20px;
text-align: end;
} }
.custom-link { .custom-link {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
title="检验内容" title="检验内容"
:visible.sync="dialogManger.dialogVisible" :visible.sync="dialogManger.dialogVisible"
direction="rtl" direction="rtl"
size="40%" size="80%"
:before-close="handleClose" :before-close="handleClose"
> >
<template slot="title"> <template slot="title">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-drawer <el-drawer
:visible.sync="dialogManger.dialogVisible" :visible.sync="dialogManger.dialogVisible"
direction="rtl" direction="rtl"
size="40%" size="80%"
:before-close="handleClose" :before-close="handleClose"
> >
<template slot="title"> <template slot="title">
......
...@@ -296,6 +296,16 @@ ...@@ -296,6 +296,16 @@
@change="handleModChange" @change="handleModChange"
/> />
</el-form> </el-form>
<!-- 文件上传 -->
<div class="tip-navigation">
<div class="tip"></div>
<div class="tip-title">文件信息</div>
</div>
<DocumentInfo
class="global-left-margin"
:pass-data="passDocumentInfoArr"
@change="handleDocumentInfoChange"
/>
<!--返回按钮--> <!--返回按钮-->
<div class="bottom-btn"> <div class="bottom-btn">
<footer-button <footer-button
...@@ -328,6 +338,7 @@ import { ...@@ -328,6 +338,7 @@ import {
} from '@/api/task/task' } from '@/api/task/task'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getDicts } from '@/api/system/dict/data' import { getDicts } from '@/api/system/dict/data'
import DocumentInfo from '@/views/task/new/components/DocumentInfo.vue'
export default { export default {
dicts: [ dicts: [
...@@ -337,11 +348,14 @@ export default { ...@@ -337,11 +348,14 @@ export default {
'inspection_item' 'inspection_item'
], ],
components: { components: {
DocumentInfo,
CarInfo, CarInfo,
PartInfo PartInfo
}, },
data() { data() {
return { return {
passDocumentInfoArr: [], // 接详情、传入子组件
documentInfoArr: [], // 调用新增接口,使用(拿取的子组件数据)
// 最终提交 // 最终提交
taskCreateRequest: { taskCreateRequest: {
standardId: '', // 检验依据 standardId: '', // 检验依据
...@@ -609,6 +623,9 @@ export default { ...@@ -609,6 +623,9 @@ export default {
...mapGetters(['standard', 'standardList', 'testScenarioList']) ...mapGetters(['standard', 'standardList', 'testScenarioList'])
}, },
methods: { methods: {
handleDocumentInfoChange(value) {
this.documentInfoArr = value
},
getTaskDetail(taskId) { getTaskDetail(taskId) {
getTaskById({ id: taskId }).then(response => { getTaskById({ id: taskId }).then(response => {
console.log('response', response) console.log('response', response)
...@@ -677,12 +694,8 @@ export default { ...@@ -677,12 +694,8 @@ export default {
item.flag = 1 item.flag = 1
}) })
} }
console.log( // 文件
'零件样品信息', this.passDocumentInfoArr = this.taskDetail.fileList
this.taskDetail.partVehicleSample,
this.partInfoArr
)
console.log('model', this.model)
}) })
}, },
selectAll() { selectAll() {
...@@ -770,6 +783,8 @@ export default { ...@@ -770,6 +783,8 @@ export default {
item.flag = 1 item.flag = 1
}) })
} }
// 文件信息
this.passDocumentInfoArr = this.taskTemporaryStorage.fileList
} }
}) })
}, },
...@@ -1058,6 +1073,8 @@ export default { ...@@ -1058,6 +1073,8 @@ export default {
this.taskCreateRequest.partSample.forEach(item => { this.taskCreateRequest.partSample.forEach(item => {
delete item.id delete item.id
}) })
// 文件
this.taskCreateRequest.fileList = this.documentInfoArr
console.log('发布...', this.taskCreateRequest) console.log('发布...', this.taskCreateRequest)
if (this.taskId === undefined) { if (this.taskId === undefined) {
createTask(this.taskCreateRequest).then(response => { createTask(this.taskCreateRequest).then(response => {
......
<template>
<div class="upload-file">
<!-- 上传按钮 -->
<el-upload
v-if="!isDetail"
multiple
ref="fileUpload"
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileList"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:show-file-list="false"
:headers="headers"
class="upload-file-uploader"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
</el-upload>
<!-- 表格 -->
<el-table style="width: 100%" border :data="tableData">
<el-table-column label="文件名称" align="left" prop="name">
<template slot-scope="{ row }">
<span>{{ row.name }}</span>
</template>
</el-table-column>
<!-- <el-table-column v-if="isDetail" label="文件" align="left" prop="url">-->
<!-- <template slot-scope="{ row }">-->
<!-- <el-image-->
<!-- style="width: 36px; height: 36px"-->
<!-- :src="showUrl + row.url"-->
<!-- :preview-src-list="[showUrl + row.url]"-->
<!-- >-->
<!-- </el-image>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
v-if="!isDetail"
label="排序"
align="center"
prop="orderIndex"
width="200"
>
<template slot-scope="scope">
<div class="sortable-handle-table">
<icon-park type="sort-three" size="14" fill="#F9A221" />
</div>
</template>
</el-table-column>
<el-table-column
v-if="!isDetail"
width="240"
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<div class="actions-container">
<page-button
icon="delete"
title="删除"
class="button-item"
@click="handleDeleteFile(scope.row)"
></page-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import Sortable from 'sortablejs'
import { getToken } from '@/utils/auth'
export default {
name: 'DocumentInfo',
props: {
// 值
value: [String, Object, Array],
// 数量限制
limit: {
type: Number,
default: 5
},
// 大小限制(MB)
fileSize: {
type: Number,
default: 5
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ['doc', 'xls', 'ppt', 'txt', 'pdf', 'jpg', 'png', 'jpeg']
},
passData: {
type: Array,
default: () => []
},
isDetail: {
type: Boolean,
default: false
}
},
data() {
return {
number: 0,
uploadList: [],
showUrl: 'http://49.232.167.247:22038',
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/uploadMinio', // 上传文件服务器地址
headers: {
Authorization: 'Bearer ' + getToken()
},
fileList: [],
tableData: [],
currentFile: {} // 当前上传文件
}
},
watch: {
value: {
handler(val) {
if (val) {
let temp = 1
// 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(',')
// 然后将数组转为对象数组
this.fileList = list.map(item => {
if (typeof item === 'string') {
item = { name: item, url: item }
}
item.uid = item.uid || new Date().getTime() + temp++
return item
})
} else {
this.fileList = []
return []
}
},
deep: true,
immediate: true
},
tableData: {
handler(newValue, oldValue) {
console.log('new', newValue)
this.emitChange()
},
deep: true
},
passData: {
handler(newValue, oldValue) {
this.tableData = JSON.parse(JSON.stringify(newValue))
},
deep: true
}
},
created() {
// this.tableData = this.passTableData
this.$nextTick(() => {
this.rowDrop()
})
},
methods: {
handleDeleteFile(row) {
this.$confirm('是否确认删除此文件', '删除', {
confirmButtonText: '确定',
concelButtonText: '取消',
type: 'warning',
customClass: 'box-logout',
cancelButtonClass: 'resetBtn',
closeOnClickModal: false,
confirmButtonClass: 'queryBtn'
}).then(() => {
const index = this.tableData.findIndex(item => item === row)
if (index > -1) {
this.tableData.splice(index, 1)
}
})
},
emitChange() {
this.$emit('change', this.tableData)
},
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
if (this.fileType) {
const fileName = file.name.split('.')
const fileExt = fileName[fileName.length - 1]
const isTypeOk = this.fileType.indexOf(fileExt) >= 0
if (!isTypeOk) {
this.$modal.msgError(
`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`
)
return false
}
}
// 校检文件大小
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize
if (!isLt) {
this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`)
return false
}
}
this.$modal.loading('正在上传文件,请稍候...')
this.number++
return true
},
// 文件个数超出
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`)
},
// 上传失败
handleUploadError(err) {
console.log('err', err)
this.$modal.msgError('上传文件失败,请重试')
this.$modal.closeLoading()
},
// 上传成功回调
handleUploadSuccess(res, file) {
if (res.code === 200) {
console.log('res成功', res)
this.tableData.push({
name: res.originalFilename,
url: res.url,
edit: 1
})
this.uploadList.push({ name: res.fileName, url: res.fileName })
this.uploadedSuccessfully()
} else {
this.number--
this.$modal.closeLoading()
this.$modal.msgError(res.msg)
this.$refs.fileUpload.handleRemove(file)
this.uploadedSuccessfully()
}
},
// 删除文件
handleDelete(index) {
this.fileList.splice(index, 1)
this.$emit('input', this.listToString(this.fileList))
},
// 上传结束处理
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList)
this.uploadList = []
this.number = 0
this.$emit('input', this.listToString(this.fileList))
this.$modal.closeLoading()
}
},
// 获取文件名称
getFileName(name) {
// 如果是url那么取最后的名字 如果不是直接返回
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
},
// 对象转成指定字符串分隔
listToString(list, separator) {
let strs = ''
separator = separator || ','
for (const i in list) {
strs += list[i].url + separator
}
return strs !== '' ? strs.substr(0, strs.length - 1) : ''
},
/** 行-拖拽 */
rowDrop() {
const tbody = document.querySelector(
'.upload-file .el-table__body-wrapper tbody'
)
const _this = this
Sortable.create(tbody, {
handle: '.sortable-handle-table',
onEnd(evt) {
_this.tableData.splice(
evt.newIndex,
0,
_this.tableData.splice(evt.oldIndex, 1)[0]
)
const newArray = _this.tableData.slice(0)
_this.tableData = []
_this.$nextTick(() => {
_this.tableData = newArray
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
.actions-container {
display: flex;
justify-content: center;
}
.sortable-handle-table {
cursor: move;
}
</style>
...@@ -295,6 +295,16 @@ ...@@ -295,6 +295,16 @@
@change="handleModChange" @change="handleModChange"
/> />
</el-form> </el-form>
<!-- 文件上传 -->
<div class="tip-navigation">
<div class="tip"></div>
<div class="tip-title">文件信息</div>
</div>
<DocumentInfo
class="global-left-margin"
:pass-data="passDocumentInfoArr"
@change="handleDocumentChange"
/>
<!--返回按钮--> <!--返回按钮-->
<div class="bottom-btn"> <div class="bottom-btn">
<footer-button <footer-button
...@@ -313,7 +323,6 @@ ...@@ -313,7 +323,6 @@
</template> </template>
<script> <script>
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import { manufacturerData } from '../../../api/task/new'
import CarInfo from './components/CarInfo' import CarInfo from './components/CarInfo'
import PartInfo from './components/PartInfo' import PartInfo from './components/PartInfo'
import { selectSamplePage } from '@/api/system/sample' import { selectSamplePage } from '@/api/system/sample'
...@@ -328,6 +337,8 @@ import { ...@@ -328,6 +337,8 @@ import {
} from '@/api/task/task' } from '@/api/task/task'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getDicts } from '@/api/system/dict/data' import { getDicts } from '@/api/system/dict/data'
import DocumentInfo from '@/views/task/new/components/DocumentInfo.vue'
export default { export default {
dicts: [ dicts: [
'sys_task_status', 'sys_task_status',
...@@ -336,11 +347,15 @@ export default { ...@@ -336,11 +347,15 @@ export default {
'inspection_item' 'inspection_item'
], ],
components: { components: {
DocumentInfo,
CarInfo, CarInfo,
PartInfo PartInfo
}, },
data() { data() {
return { return {
passDocumentInfoArr: [],
// 文件信息
documentInfoArr: [],
// 最终提交 // 最终提交
taskCreateRequest: { taskCreateRequest: {
standardId: '', // 检验依据 standardId: '', // 检验依据
...@@ -377,7 +392,9 @@ export default { ...@@ -377,7 +392,9 @@ export default {
sampleId: '', // 样品id sampleId: '', // 样品id
flag: 1 flag: 1
} }
] ],
// 文件
fileList: []
}, },
// 当前填写的整车样品信息 // 当前填写的整车样品信息
currentVehicleSampleInformation: [], currentVehicleSampleInformation: [],
...@@ -781,6 +798,7 @@ export default { ...@@ -781,6 +798,7 @@ export default {
item.flag = 1 item.flag = 1
}) })
} }
this.passDocumentInfoArr = this.taskTemporaryStorage.fileList
} }
}) })
}, },
...@@ -801,6 +819,9 @@ export default { ...@@ -801,6 +819,9 @@ export default {
this.currentPartSampleInformation = cards this.currentPartSampleInformation = cards
console.log('PartInfo组件传值', cards) console.log('PartInfo组件传值', cards)
}, },
handleDocumentChange(data) {
this.documentInfoArr = data
},
getSampleInformation() { getSampleInformation() {
// 查询整车样品信息 // 查询整车样品信息
selectSamplePage({ pageNum: 1, pageSize: 999, flag: 0 }).then( selectSamplePage({ pageNum: 1, pageSize: 999, flag: 0 }).then(
...@@ -1115,6 +1136,8 @@ export default { ...@@ -1115,6 +1136,8 @@ export default {
this.taskCreateRequest.partSample.forEach(item => { this.taskCreateRequest.partSample.forEach(item => {
delete item.id delete item.id
}) })
// 文件
this.taskCreateRequest.fileList = this.documentInfoArr
console.log('发布...', this.taskCreateRequest) console.log('发布...', this.taskCreateRequest)
if (this.taskId === undefined) { if (this.taskId === undefined) {
createTask(this.taskCreateRequest).then(response => { createTask(this.taskCreateRequest).then(response => {
...@@ -1156,7 +1179,8 @@ export default { ...@@ -1156,7 +1179,8 @@ export default {
this.areAllPropertiesEmpty(this.model) && this.areAllPropertiesEmpty(this.model) &&
this.tableData.length === 0 && this.tableData.length === 0 &&
this.currentVehicleSampleInformation.length === 0 && this.currentVehicleSampleInformation.length === 0 &&
this.currentPartSampleInformation.length === 0 this.currentPartSampleInformation.length === 0 &&
this.passDocumentInfoArr.length === 0
) { ) {
this.$modal.msgError('请填写部分内容再进行暂存') this.$modal.msgError('请填写部分内容再进行暂存')
return return
...@@ -1182,6 +1206,7 @@ export default { ...@@ -1182,6 +1206,7 @@ export default {
this.taskCreateRequest.partSample.forEach(item => { this.taskCreateRequest.partSample.forEach(item => {
delete item.id delete item.id
}) })
this.taskCreateRequest.fileList = this.documentInfoArr
console.log('暂存', this.taskCreateRequest) console.log('暂存', this.taskCreateRequest)
if (this.taskTemporaryStorage !== null) { if (this.taskTemporaryStorage !== null) {
// 暂存有数据再次暂存走编辑 // 暂存有数据再次暂存走编辑
......
...@@ -249,6 +249,16 @@ ...@@ -249,6 +249,16 @@
:part-sample-information="partSampleInformationList" :part-sample-information="partSampleInformationList"
@change="handleModChange" @change="handleModChange"
/> />
<!-- 文件上传 -->
<div class="tip-navigation">
<div class="tip"></div>
<div class="tip-title">文件信息</div>
</div>
<DocumentInfo
class="global-left-margin"
:pass-data="passDocumentInfoArr"
:is-detail="true"
/>
</el-form> </el-form>
</page-standard> </page-standard>
</template> </template>
...@@ -262,6 +272,7 @@ import { getUserByRole } from '@/api/system/user' ...@@ -262,6 +272,7 @@ import { getUserByRole } from '@/api/system/user'
import { createTask, getTaskById } from '@/api/task/task' import { createTask, getTaskById } from '@/api/task/task'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { getDicts } from '@/api/system/dict/data' import { getDicts } from '@/api/system/dict/data'
import DocumentInfo from '@/views/task/new/components/DocumentInfo.vue'
export default { export default {
dicts: [ dicts: [
'sys_task_status', 'sys_task_status',
...@@ -270,6 +281,7 @@ export default { ...@@ -270,6 +281,7 @@ export default {
'inspection_item' 'inspection_item'
], ],
components: { components: {
DocumentInfo,
CarInfo, CarInfo,
PartInfo PartInfo
}, },
...@@ -312,6 +324,8 @@ export default { ...@@ -312,6 +324,8 @@ export default {
} }
] ]
}, },
// 文件信息
passDocumentInfoArr: [],
// 当前填写的整车样品信息 // 当前填写的整车样品信息
currentVehicleSampleInformation: [], currentVehicleSampleInformation: [],
// 当前填写的零部件样品信息 // 当前填写的零部件样品信息
...@@ -584,6 +598,8 @@ export default { ...@@ -584,6 +598,8 @@ export default {
item.flag = 1 item.flag = 1
}) })
} }
// 文件信息
this.passDocumentInfoArr = this.taskDetail.fileList
const taskList = this.taskDetail.taskList.split(',') const taskList = this.taskDetail.taskList.split(',')
if ( if (
(taskList.length === 1 && taskList.includes('trfis')) || (taskList.length === 1 && taskList.includes('trfis')) ||
......
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