Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
中汽测评-信息安全测评系统
web
Commits
6e1beeb5
Commit
6e1beeb5
authored
Mar 26, 2024
by
jiaxu.yan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into developer/yanjiaxu
parents
75d21f64
72eeefd5
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
506 additions
and
137 deletions
+506
-137
task.js
src/api/task/task.js
+12
-0
useCaseRisk.vue
src/views/echartHome/useCaseRisk.vue
+1
-1
index.vue
src/views/index.vue
+2
-2
index.vue
src/views/processing/carTest/confirmation-test/index.vue
+86
-116
index.vue
src/views/processing/carTest/review-form/index.vue
+2
-3
index.vue
src/views/setting/materialLibrary/index.vue
+2
-1
index.vue
src/views/setting/sample/index.vue
+7
-3
documentReviewDialog.vue
...setting/standardTerms/components/documentReviewDialog.vue
+1
-1
vehicleModelDialog.vue
...s/setting/standardTerms/components/vehicleModelDialog.vue
+1
-1
index.vue
src/views/task/edit/index.vue
+23
-6
DocumentInfo.vue
src/views/task/new/components/DocumentInfo.vue
+325
-0
index.vue
src/views/task/new/index.vue
+28
-3
index.vue
src/views/task/task-detail/index.vue
+16
-0
No files found.
src/api/task/task.js
View file @
6e1beeb5
...
...
@@ -217,4 +217,16 @@ export function geTaskCase(data) {
data
})
}
/**
*提交确认表单
*/
export
function
taskImageSubmit
(
data
)
{
return
request
({
url
:
'/car/test/task/submit'
,
method
:
'post'
,
data
})
}
src/views/echartHome/useCaseRisk.vue
View file @
6e1beeb5
...
...
@@ -19,7 +19,7 @@ export default {
// 3.配置数据
const
option
=
{
title
:
{
text
:
'
任务保密等级占比
'
,
text
:
'
用例风险程度概览
'
,
left
:
'left'
,
textStyle
:
{
color
:
'#606266'
,
...
...
src/views/index.vue
View file @
6e1beeb5
...
...
@@ -104,7 +104,7 @@
size=
"36"
></iconpark-icon>
</div>
<span>
已
完成 :43个
</span>
<span>
未
完成 :43个
</span>
<div>
<el-progress
:percentage=
"40"
...
...
@@ -205,7 +205,7 @@
<el-row>
<el-col
:span=
"24"
>
<div
class=
"cardStyle"
style=
"height: 500px"
>
<div
class=
"cardTitle"
>
任务完成情况占比
</div>
<div
class=
"cardTitle"
>
参与任务情况
</div>
<div
style=
"
display: flex;
...
...
src/views/processing/carTest/confirmation-test/index.vue
View file @
6e1beeb5
...
...
@@ -15,7 +15,7 @@
<div
class=
"task-item"
>
<span
class=
"task-label"
>
任务编号:
</span>
<span
class=
"task-content"
>
{{
model
.
carReviewT
ask
.
taskNo
}}
{{
t
ask
.
taskNo
}}
</span>
</div>
<div
class=
"task-item"
>
...
...
@@ -30,17 +30,12 @@
{{
task
.
entrustedUnit
}}
</span>
</div>
<div
class=
"task-item"
>
<span
class=
"task-label"
>
任务状态:
</span>
<span
class=
"task-content"
>
{{
getDictData
(
dict
.
type
.
test_cartype_type
,
model
.
carReviewTask
.
taskStatus
)
}}
</span>
</div>
<!--
<div
class=
"task-item"
>
-->
<!--
<span
class=
"task-label"
>
任务状态:
</span>
-->
<!--
<span
class=
"task-content"
>
-->
<!--
{{
getDictData
(
dict
.
type
.
task_test_status
,
task
.
taskStatus
)
}}
-->
<!--
</span>
-->
<!--
</div>
-->
</div>
<div
class=
"task-body"
>
<!--card统计值-->
...
...
@@ -131,46 +126,58 @@
<col
style=
"width: 100px"
/>
<thead>
<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
style=
"width: 370px"
>
测试用例
</th>
-->
</tr>
</thead>
<tbody>
<!-- 循环遍历 keyPointList -->
<template
v-for=
"(i, PointIndex) in tableData.keyPointList"
>
<template
v-for=
"(i, PointIndex) in tableData"
>
<tr
:key=
"'PointIndex1' + PointIndex"
>
<td
align=
"center"
:rowspan=
"getRows(i)"
>
{{
'7.1.1'
}}
<td
align=
"center"
:rowspan=
"getRows
3
(i)"
>
{{
i
.
chapter
}}
</td>
<td
align=
"center"
:rowspan=
"getRows(i)"
>
<td
align=
"center"
:rowspan=
"getRows
3
(i)"
>
{{
i
.
text
}}
</td>
<td
align=
"center"
:rowspan=
"getRows(i)"
>
{{
i
.
te
xt
}}
<td
align=
"center"
:rowspan=
"getRows
3
(i)"
>
{{
i
.
te
stMethod
}}
</td>
</tr>
<!-- 循环遍历 reviewDetailsList -->
<template
v-for=
"(v, reviewDetailIndex) in i.reviewDetailsList"
>
<tr
:key=
"'reviewDetailIndex' + PointIndex + reviewDetailIndex"
>
<td
align=
"center"
>
{{
'测试场景'
}}
<template
v-for=
"(v, testCaseIndex) in i.testCaseList"
>
<tr
:key=
"'testCaseIndex' + PointIndex + testCaseIndex"
>
<td
align=
"center"
rowspan=
"1"
>
{{
v
.
testScenario
}}
</td>
<td
align=
"center"
>
{{
'测试类型'
}}
<td
align=
"center"
rowspan=
"1"
>
{{
v
.
testType
}}
</td>
<td
align=
"center"
>
{{
'用例编号'
}}
<td
align=
"center"
rowspan=
"1"
>
{{
v
.
usecaseNo
}}
</td>
<td
align=
"center"
>
{{
'
测试结果
'
}}
<td
align=
"center"
rowspan=
"1"
>
{{
''
}}
</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>
</
template
>
</template>
...
...
@@ -209,6 +216,7 @@
返回
</footer-button>
<footer-button
v-if=
"this.isLeader !== false"
type=
"primary"
icon=
"hard-disk-one"
@
click=
"goToProcessedReview"
...
...
@@ -223,11 +231,12 @@
<!--js逻辑-->
<
script
>
import
routerMixins
from
'@/mixins/router'
import
{
getRows
,
getRows2
}
from
'../../../../utils/reviewDetailsTable'
import
{
listInspection
}
from
'../../../../api/setting/standardTerms'
import
{
getRows3
}
from
'../../../../utils/reviewDetailsTable'
import
{
testDetail
}
from
'../../../../api/task/test'
import
{
getBySubtaskId
,
taskImageSubmit
}
from
'../../../../api/task/task'
export
default
{
name
:
'Index'
,
dicts
:
[
't
est_cartype_type
'
],
dicts
:
[
't
ask_test_status
'
],
mixins
:
[
routerMixins
],
data
()
{
return
{
...
...
@@ -243,95 +252,56 @@ export default {
inspectionLeader
:
''
,
result
:
[]
},
rules
:
{
enterpriseLeader
:
[
{
required
:
true
,
message
:
'请输入车企负责人'
,
trigger
:
'blur'
}
],
inspectionLeader
:
[
{
required
:
true
,
message
:
'请输入检验负责人'
,
trigger
:
'blur'
}
]
},
taskId
:
''
,
loading
:
false
loading
:
false
,
isLeader
:
''
}
},
// async mounted() {
// if (this.$route.query.id) {
// this.taskId = this.$route.query.id
// }
// await this.getTask()
// this.openAll()
// },
mounted
()
{
this
.
init
()
this
.
getTest
()
this
.
getTestDetail
()
},
methods
:
{
getRows
,
getRows2
,
/** 获取体系审查、车型审查检验内容 */
init
()
{
getRows3
,
/* 返回跳转*/
goToProcessedReview
()
{
// this.ruleForm.taskId = '1771093631118106626'
const
formData
=
{
// imagesUrl: [
// this.ruleForm.enterpriseLeader,
// this.ruleForm.inspectionLeader
// ],
imagesUrl
:
[{}],
taskId
:
this
.
$route
.
query
.
id
}
console
.
log
(
'formData'
,
formData
)
taskImageSubmit
(
formData
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
$modal
.
msgSuccess
(
'确认提交成功'
)
this
.
$router
.
push
({
path
:
'/processing/unprocessed-review'
})
}
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
listInspection
({
id
:
'1744181159757221888'
}).
then
(
res
=>
{
testDetail
({
taskId
:
this
.
$route
.
query
.
id
}).
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
()
{
// this.ruleForm.taskId = this.taskId
// const formData = {
// imagesUrl: [
// this.ruleForm.enterpriseLeader,
// this.ruleForm.inspectionLeader
// ],
// taskId: this.taskId
// }
// carTaskSubmit(formData).then(res => {
// if (res.code === 200) {
// this.$modal.msgSuccess('确认提交成功')
// this.$router.push({
// path: '/processing/unprocessed-review'
// })
// } else {
// this.$modal.msgError(res.msg)
// }
// })
}
}
}
...
...
src/views/processing/carTest/review-form/index.vue
View file @
6e1beeb5
...
...
@@ -139,7 +139,6 @@ export default {
detailsList
:
[]
},
task
:
{},
taskId
:
''
,
loading
:
false
}
},
...
...
@@ -150,7 +149,7 @@ export default {
methods
:
{
getRows3
,
getTest
()
{
getBySubtaskId
({
id
:
'1768527384203460609'
}).
then
(
res
=>
{
getBySubtaskId
({
id
:
this
.
$route
.
query
.
id
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
this
.
task
=
res
.
data
}
...
...
@@ -159,7 +158,7 @@ export default {
/** 获取任务详情 */
getTestDetail
()
{
this
.
loading
=
true
testDetail
({
taskId
:
'1768527384203460609'
}).
then
(
res
=>
{
testDetail
({
taskId
:
this
.
$route
.
query
.
id
}).
then
(
res
=>
{
this
.
tableData
=
res
.
data
this
.
loading
=
false
})
...
...
src/views/setting/materialLibrary/index.vue
View file @
6e1beeb5
...
...
@@ -177,10 +177,11 @@ export default {
}
}
.submit-button
{
text-align
:
end
;
position
:
fixed
;
bottom
:
0px
;
background
:
#ffffff
;
width
:
10
0%
;
width
:
3
0%
;
padding
:
20px
;
}
</
style
>
src/views/setting/sample/index.vue
View file @
6e1beeb5
...
...
@@ -328,6 +328,7 @@
>
</el-input>
</el-form-item>
<div
style=
"height: 60px"
></div>
<div
class=
"dialog-button"
>
<el-button
v-loading=
"addLoading"
...
...
@@ -705,9 +706,12 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.dialog-button
{
display
:
flex
;
justify-content
:
flex-end
;
margin-right
:
20px
;
position
:
fixed
;
bottom
:
0px
;
background
:
#ffffff
;
width
:
39%
;
padding
:
20px
;
text-align
:
end
;
}
.custom-link
{
...
...
src/views/setting/standardTerms/components/documentReviewDialog.vue
View file @
6e1beeb5
...
...
@@ -3,7 +3,7 @@
title=
"检验内容"
:visible
.
sync=
"dialogManger.dialogVisible"
direction=
"rtl"
size=
"
4
0%"
size=
"
8
0%"
:before-close=
"handleClose"
>
<template
slot=
"title"
>
...
...
src/views/setting/standardTerms/components/vehicleModelDialog.vue
View file @
6e1beeb5
...
...
@@ -2,7 +2,7 @@
<el-drawer
:visible
.
sync=
"dialogManger.dialogVisible"
direction=
"rtl"
size=
"
4
0%"
size=
"
8
0%"
:before-close=
"handleClose"
>
<template
slot=
"title"
>
...
...
src/views/task/edit/index.vue
View file @
6e1beeb5
...
...
@@ -296,6 +296,16 @@
@
change=
"handleModChange"
/>
</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"
>
<footer-button
...
...
@@ -328,6 +338,7 @@ import {
}
from
'@/api/task/task'
import
{
mapGetters
}
from
'vuex'
import
{
getDicts
}
from
'@/api/system/dict/data'
import
DocumentInfo
from
'@/views/task/new/components/DocumentInfo.vue'
export
default
{
dicts
:
[
...
...
@@ -337,11 +348,14 @@ export default {
'inspection_item'
],
components
:
{
DocumentInfo
,
CarInfo
,
PartInfo
},
data
()
{
return
{
passDocumentInfoArr
:
[],
// 接详情、传入子组件
documentInfoArr
:
[],
// 调用新增接口,使用(拿取的子组件数据)
// 最终提交
taskCreateRequest
:
{
standardId
:
''
,
// 检验依据
...
...
@@ -609,6 +623,9 @@ export default {
...
mapGetters
([
'standard'
,
'standardList'
,
'testScenarioList'
])
},
methods
:
{
handleDocumentInfoChange
(
value
)
{
this
.
documentInfoArr
=
value
},
getTaskDetail
(
taskId
)
{
getTaskById
({
id
:
taskId
}).
then
(
response
=>
{
console
.
log
(
'response'
,
response
)
...
...
@@ -677,12 +694,8 @@ export default {
item
.
flag
=
1
})
}
console
.
log
(
'零件样品信息'
,
this
.
taskDetail
.
partVehicleSample
,
this
.
partInfoArr
)
console
.
log
(
'model'
,
this
.
model
)
// 文件
this
.
passDocumentInfoArr
=
this
.
taskDetail
.
fileList
})
},
selectAll
()
{
...
...
@@ -770,6 +783,8 @@ export default {
item
.
flag
=
1
})
}
// 文件信息
this
.
passDocumentInfoArr
=
this
.
taskTemporaryStorage
.
fileList
}
})
},
...
...
@@ -1058,6 +1073,8 @@ export default {
this
.
taskCreateRequest
.
partSample
.
forEach
(
item
=>
{
delete
item
.
id
})
// 文件
this
.
taskCreateRequest
.
fileList
=
this
.
documentInfoArr
console
.
log
(
'发布...'
,
this
.
taskCreateRequest
)
if
(
this
.
taskId
===
undefined
)
{
createTask
(
this
.
taskCreateRequest
).
then
(
response
=>
{
...
...
src/views/task/new/components/DocumentInfo.vue
0 → 100644
View file @
6e1beeb5
<
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
>
src/views/task/new/index.vue
View file @
6e1beeb5
...
...
@@ -295,6 +295,16 @@
@
change=
"handleModChange"
/>
</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"
>
<footer-button
...
...
@@ -313,7 +323,6 @@
</template>
<
script
>
import
Sortable
from
'sortablejs'
import
{
manufacturerData
}
from
'../../../api/task/new'
import
CarInfo
from
'./components/CarInfo'
import
PartInfo
from
'./components/PartInfo'
import
{
selectSamplePage
}
from
'@/api/system/sample'
...
...
@@ -328,6 +337,8 @@ import {
}
from
'@/api/task/task'
import
{
mapGetters
}
from
'vuex'
import
{
getDicts
}
from
'@/api/system/dict/data'
import
DocumentInfo
from
'@/views/task/new/components/DocumentInfo.vue'
export
default
{
dicts
:
[
'sys_task_status'
,
...
...
@@ -336,11 +347,15 @@ export default {
'inspection_item'
],
components
:
{
DocumentInfo
,
CarInfo
,
PartInfo
},
data
()
{
return
{
passDocumentInfoArr
:
[],
// 文件信息
documentInfoArr
:
[],
// 最终提交
taskCreateRequest
:
{
standardId
:
''
,
// 检验依据
...
...
@@ -377,7 +392,9 @@ export default {
sampleId
:
''
,
// 样品id
flag
:
1
}
]
],
// 文件
fileList
:
[]
},
// 当前填写的整车样品信息
currentVehicleSampleInformation
:
[],
...
...
@@ -781,6 +798,7 @@ export default {
item
.
flag
=
1
})
}
this
.
passDocumentInfoArr
=
this
.
taskTemporaryStorage
.
fileList
}
})
},
...
...
@@ -801,6 +819,9 @@ export default {
this
.
currentPartSampleInformation
=
cards
console
.
log
(
'PartInfo组件传值'
,
cards
)
},
handleDocumentChange
(
data
)
{
this
.
documentInfoArr
=
data
},
getSampleInformation
()
{
// 查询整车样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
0
}).
then
(
...
...
@@ -1115,6 +1136,8 @@ export default {
this
.
taskCreateRequest
.
partSample
.
forEach
(
item
=>
{
delete
item
.
id
})
// 文件
this
.
taskCreateRequest
.
fileList
=
this
.
documentInfoArr
console
.
log
(
'发布...'
,
this
.
taskCreateRequest
)
if
(
this
.
taskId
===
undefined
)
{
createTask
(
this
.
taskCreateRequest
).
then
(
response
=>
{
...
...
@@ -1156,7 +1179,8 @@ export default {
this
.
areAllPropertiesEmpty
(
this
.
model
)
&&
this
.
tableData
.
length
===
0
&&
this
.
currentVehicleSampleInformation
.
length
===
0
&&
this
.
currentPartSampleInformation
.
length
===
0
this
.
currentPartSampleInformation
.
length
===
0
&&
this
.
passDocumentInfoArr
.
length
===
0
)
{
this
.
$modal
.
msgError
(
'请填写部分内容再进行暂存'
)
return
...
...
@@ -1182,6 +1206,7 @@ export default {
this
.
taskCreateRequest
.
partSample
.
forEach
(
item
=>
{
delete
item
.
id
})
this
.
taskCreateRequest
.
fileList
=
this
.
documentInfoArr
console
.
log
(
'暂存'
,
this
.
taskCreateRequest
)
if
(
this
.
taskTemporaryStorage
!==
null
)
{
// 暂存有数据再次暂存走编辑
...
...
src/views/task/task-detail/index.vue
View file @
6e1beeb5
...
...
@@ -249,6 +249,16 @@
:part-sample-information=
"partSampleInformationList"
@
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>
</page-standard>
</template>
...
...
@@ -262,6 +272,7 @@ import { getUserByRole } from '@/api/system/user'
import
{
createTask
,
getTaskById
}
from
'@/api/task/task'
import
{
mapGetters
}
from
'vuex'
import
{
getDicts
}
from
'@/api/system/dict/data'
import
DocumentInfo
from
'@/views/task/new/components/DocumentInfo.vue'
export
default
{
dicts
:
[
'sys_task_status'
,
...
...
@@ -270,6 +281,7 @@ export default {
'inspection_item'
],
components
:
{
DocumentInfo
,
CarInfo
,
PartInfo
},
...
...
@@ -312,6 +324,8 @@ export default {
}
]
},
// 文件信息
passDocumentInfoArr
:
[],
// 当前填写的整车样品信息
currentVehicleSampleInformation
:
[],
// 当前填写的零部件样品信息
...
...
@@ -584,6 +598,8 @@ export default {
item
.
flag
=
1
})
}
// 文件信息
this
.
passDocumentInfoArr
=
this
.
taskDetail
.
fileList
const
taskList
=
this
.
taskDetail
.
taskList
.
split
(
','
)
if
(
(
taskList
.
length
===
1
&&
taskList
.
includes
(
'trfis'
))
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment