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
5ceee3ca
Commit
5ceee3ca
authored
Nov 01, 2024
by
jiaxu.yan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:任务新增新增产商
parent
4ba66bc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
230 additions
and
70 deletions
+230
-70
index.vue
src/views/task/edit/index.vue
+119
-27
index.vue
src/views/task/new/index.vue
+111
-43
No files found.
src/views/task/edit/index.vue
View file @
5ceee3ca
...
...
@@ -169,6 +169,24 @@
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"厂商"
prop=
"enterpriseId"
>
<el-select
v-model=
"model.enterpriseId"
placeholder=
"请选择"
filterable
style=
"width: 100%"
>
<el-option
v-for=
"item in componentSelect"
:key=
"item.id"
:label=
"item.enterpriseName"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</div>
<div
class=
"tip-navigation"
>
...
...
@@ -336,6 +354,7 @@ import CarInfo from '../new/components/CarInfo'
import
PartInfo
from
'../new/components/PartInfo'
import
{
selectSamplePage
}
from
'@/api/system/sample'
import
{
getUserByRole
}
from
'@/api/system/user'
import
{
componentSelect
}
from
'@/api/system/sample'
import
{
createTask
,
editTemporaryStorage
,
...
...
@@ -348,6 +367,7 @@ import { mapGetters } from 'vuex'
import
{
getDicts
}
from
'@/api/system/dict/data'
import
DocumentInfo
from
'@/views/task/new/components/DocumentInfo.vue'
import
{
getByStandardId
}
from
'@/api/task/new'
import
{
number
}
from
'echarts'
export
default
{
dicts
:
[
'sys_task_status'
,
...
...
@@ -361,6 +381,7 @@ export default {
},
data
()
{
return
{
componentSelect
:
[],
passDocumentInfoArr
:
[],
// 接详情、传入子组件
documentInfoArr
:
[],
// 调用新增接口,使用(拿取的子组件数据)
// 最终提交
...
...
@@ -440,7 +461,8 @@ export default {
entrustedUnitCode
:
''
,
// 委托单位邮政编码
testScenarioList
:
[],
inspectionItemList
:
[],
standardId
:
''
standardId
:
''
,
enterpriseId
:
''
},
loading
:
false
,
// 小组成员回显数据
...
...
@@ -497,6 +519,9 @@ export default {
vehicleType
:
[
{
required
:
true
,
message
:
'车辆类型不能为空'
,
trigger
:
'blur'
}
],
enterpriseId
:
[
{
required
:
true
,
message
:
'厂商上不能为空'
,
trigger
:
'blur'
}
],
vehicleIdentificationNumber
:
[
{
required
:
true
,
message
:
'车辆识别码不能为空'
,
trigger
:
'blur'
}
],
...
...
@@ -561,6 +586,37 @@ export default {
}
},
watch
:
{
'model.enterpriseId'
:
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
this
.
model
.
enterpriseName
=
this
.
componentSelect
.
filter
(
item
=>
item
.
id
===
newValue
)[
0
].
enterpriseName
// 查询整车样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
0
,
manufacturingEnterpriseId
:
newValue
}).
then
(
response
=>
{
this
.
vehicleSampleInformationList
=
response
.
rows
})
// 查询零件样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
1
,
manufacturingEnterpriseId
:
newValue
}).
then
(
response
=>
{
this
.
partSampleInformationList
=
response
.
rows
})
}
else
{
this
.
model
.
enterpriseName
=
''
this
.
vehicleSampleInformationList
=
[]
this
.
partSampleInformationList
=
[]
}
}
},
'model.trademark'
:
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
...
...
@@ -619,17 +675,29 @@ export default {
// 对字典:inspection_item, 做处理
this
.
getUserByRole
()
// 查询样品信息(整车、零件)
this
.
getSampleInformation
()
//
this.getSampleInformation()
this
.
$nextTick
(()
=>
{
this
.
leaderTop
()
this
.
rowDrop
()
})
this
.
getComponentSelect
()
this
.
$store
.
dispatch
(
'standard/setStandardList'
)
},
computed
:
{
...
mapGetters
([
'standard'
,
'standardList'
,
'testScenarioList'
])
},
methods
:
{
getComponentSelect
()
{
componentSelect
({
pageNum
:
1
,
pageSize
:
9999
,
isAsc
:
'desc'
,
orderByColumn
:
'createTime'
}).
then
(
res
=>
{
this
.
componentSelect
=
res
.
rows
console
.
log
(
'res'
,
res
)
})
},
changeStandard
(
e
)
{
this
.
taskDetail
.
taskList
=
[]
this
.
getInspectionItemDict
(
e
)
...
...
@@ -648,6 +716,27 @@ export default {
this
.
model
.
standardId
=
this
.
taskDetail
.
standardId
this
.
taskDetail
.
taskList
=
this
.
taskDetail
.
taskList
.
split
(
','
)
this
.
model
.
inspectionItemList
=
this
.
taskDetail
.
taskList
this
.
model
.
enterpriseId
=
this
.
taskDetail
.
enterpriseId
this
.
model
.
enterpriseName
=
this
.
taskDetail
.
enterpriseName
// 查询整车样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
0
,
manufacturingEnterpriseId
:
this
.
model
.
enterpriseId
}).
then
(
response
=>
{
this
.
vehicleSampleInformationList
=
response
.
rows
})
// 查询零件样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
1
,
manufacturingEnterpriseId
:
this
.
model
.
enterpriseId
}).
then
(
response
=>
{
this
.
partSampleInformationList
=
response
.
rows
})
this
.
getInspectionItemDict
(
this
.
taskDetail
.
standardId
)
// 把detail转到model里(任务信息)
for
(
const
key
in
this
.
taskDetail
)
{
...
...
@@ -822,28 +911,28 @@ export default {
this
.
currentPartSampleInformation
=
cards
console
.
log
(
'PartInfo组件传值'
,
cards
)
},
getSampleInformation
()
{
// 查询整车样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
0
}).
then
(
response
=>
{
this
.
vehicleSampleInformationList
=
response
.
rows
console
.
log
(
'vehicleSampleInformationList'
,
this
.
vehicleSampleInformationList
)
}
)
// 查询零件样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
1
}).
then
(
response
=>
{
this
.
partSampleInformationList
=
response
.
rows
console
.
log
(
'partSampleInformationList'
,
this
.
partSampleInformationList
)
}
)
},
//
getSampleInformation() {
//
// 查询整车样品信息
//
selectSamplePage({ pageNum: 1, pageSize: 999, flag: 0 }).then(
//
response => {
//
this.vehicleSampleInformationList = response.rows
//
console.log(
//
'vehicleSampleInformationList',
//
this.vehicleSampleInformationList
//
)
//
}
//
)
//
// 查询零件样品信息
//
selectSamplePage({ pageNum: 1, pageSize: 999, flag: 1 }).then(
//
response => {
//
this.partSampleInformationList = response.rows
//
console.log(
//
'partSampleInformationList',
//
this.partSampleInformationList
//
)
//
}
//
)
//
},
/** 主检角色置顶逻辑 */
leaderTop
()
{
if
(
this
.
tableData
.
length
!==
0
)
{
...
...
@@ -1057,10 +1146,11 @@ export default {
)
{
this
.
$message
.
error
(
'请保存小组成员信息'
)
return
}
else
if
(
this
.
currentVehicleSampleInformation
.
length
===
0
)
{
this
.
$message
.
error
(
'请填写整车样品信息'
)
return
}
// else if (this.currentVehicleSampleInformation.length === 0) {
// this.$message.error('请填写整车样品信息')
// return
// }
// else if (this.currentPartSampleInformation.length === 0) {
// this.$message.error('请填写零部件样品信息')
// return
...
...
@@ -1082,6 +1172,8 @@ export default {
}
}
this
.
taskCreateRequest
.
taskList
=
this
.
model
.
inspectionItemList
this
.
taskCreateRequest
.
enterpriseId
=
this
.
model
.
enterpriseId
this
.
taskCreateRequest
.
enterpriseName
=
this
.
model
.
enterpriseName
this
.
tableData
.
forEach
(
item
=>
{
if
(
item
.
dept
!==
null
)
{
item
.
deptName
=
item
.
dept
.
deptName
...
...
src/views/task/new/index.vue
View file @
5ceee3ca
...
...
@@ -24,7 +24,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row
v-show=
"model.standardId"
:gutter=
"20"
>
<el-row
v-show=
"model.standardId"
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"检验项目(可多选)"
prop=
"inspectionItemList"
>
<div
class=
"test-scenario-container"
>
...
...
@@ -160,6 +160,24 @@
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"厂商"
prop=
"enterpriseId"
>
<el-select
v-model=
"model.enterpriseId"
placeholder=
"请选择"
filterable
style=
"width: 100%"
>
<el-option
v-for=
"item in componentSelect"
:key=
"item.id"
:label=
"item.enterpriseName"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</div>
<div
class=
"tip-navigation"
>
...
...
@@ -232,8 +250,10 @@
<span
v-else-if=
"$index === 0"
>
{{
row
.
dept
.
deptName
||
row
.
dept
||
'-'
}}
</span>
<span
v-else-if=
"$index >= 1"
>
{{
row
.
dept
.
deptName
||
row
.
dept
||
'-'
}}
</span>
<span
v-else-if=
"$index >= 1"
>
{{
row
.
dept
.
deptName
||
row
.
dept
||
'-'
}}
</span
>
</
template
>
</el-table-column>
<!-- <el-table-column
...
...
@@ -250,7 +270,7 @@
<span>-</span>
</div>
</template>
</el-table-column> -->
</el-table-column> -->
<el-table-column
width=
"160"
label=
"操作"
...
...
@@ -355,6 +375,7 @@ import CarInfo from './components/CarInfo'
import
PartInfo
from
'./components/PartInfo'
import
{
selectSamplePage
}
from
'@/api/system/sample'
import
{
getUserByRole
}
from
'@/api/system/user'
import
{
componentSelect
}
from
'@/api/system/sample'
import
{
createTask
,
editTemporaryStorage
,
...
...
@@ -382,6 +403,7 @@ export default {
data
()
{
return
{
passDocumentInfoArr
:
[],
componentSelect
:
[],
// 文件信息
documentInfoArr
:
[],
// 最终提交
...
...
@@ -525,6 +547,9 @@ export default {
trigger
:
'blur'
}
],
enterpriseId
:
[
{
required
:
true
,
message
:
'厂商上不能为空'
,
trigger
:
'blur'
}
],
vehicleType
:
[
{
required
:
true
,
message
:
'车辆类型不能为空'
,
trigger
:
'blur'
}
],
...
...
@@ -602,6 +627,37 @@ export default {
...
mapGetters
([
'standard'
,
'standardList'
,
'testScenarioList'
])
},
watch
:
{
'model.enterpriseId'
:
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
this
.
model
.
enterpriseName
=
this
.
componentSelect
.
filter
(
item
=>
item
.
id
===
newValue
)[
0
].
enterpriseName
// 查询整车样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
0
,
manufacturingEnterpriseId
:
newValue
}).
then
(
response
=>
{
this
.
vehicleSampleInformationList
=
response
.
rows
})
// 查询零件样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
1
,
manufacturingEnterpriseId
:
newValue
}).
then
(
response
=>
{
this
.
partSampleInformationList
=
response
.
rows
})
}
else
{
this
.
model
.
enterpriseName
=
''
this
.
vehicleSampleInformationList
=
[]
this
.
partSampleInformationList
=
[]
}
}
},
'model.trademark'
:
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
...
...
@@ -664,7 +720,7 @@ export default {
// this.initWebSocket()
// 查询样品信息(整车、零件)
// await this.getTaskType(1)
this
.
getSampleInformation
()
//
this.getSampleInformation()
this
.
getTemporaryStorage
()
this
.
$nextTick
(()
=>
{
this
.
leaderTop
()
...
...
@@ -674,12 +730,24 @@ export default {
this
.
getTaskDetail
(
this
.
taskId
)
}
})
this
.
getComponentSelect
()
this
.
$store
.
dispatch
(
'standard/setStandardList'
)
},
// destroyed() {
// this.websock.close() // 离开路由之后断开websocket连接
// },
methods
:
{
getComponentSelect
()
{
componentSelect
({
pageNum
:
1
,
pageSize
:
9999
,
isAsc
:
'desc'
,
orderByColumn
:
'createTime'
}).
then
(
res
=>
{
this
.
componentSelect
=
res
.
rows
console
.
log
(
'res'
,
res
)
})
},
getTaskType
(
id
)
{
getByStandardId
({
id
...
...
@@ -739,22 +807,6 @@ export default {
}
})
})
// 整车样品信息
if
(
this
.
taskDetail
.
completeVehicleSample
!==
null
)
{
this
.
carInfoArr
=
this
.
taskDetail
.
completeVehicleSample
this
.
carInfoArr
.
forEach
(
item
=>
{
item
.
sampleId
=
item
.
id
item
.
flag
=
0
})
}
// 零件样品信息
if
(
this
.
taskDetail
.
partVehicleSample
!==
null
)
{
this
.
partInfoArr
=
this
.
taskDetail
.
partVehicleSample
this
.
partInfoArr
.
forEach
(
item
=>
{
item
.
sampleId
=
item
.
id
item
.
flag
=
1
})
}
})
},
// 全选
...
...
@@ -857,20 +909,20 @@ export default {
handleDocumentChange
(
data
)
{
this
.
documentInfoArr
=
data
},
getSampleInformation
()
{
// 查询整车样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
0
}).
then
(
response
=>
{
this
.
vehicleSampleInformationList
=
response
.
rows
}
)
// 查询零件样品信息
selectSamplePage
({
pageNum
:
1
,
pageSize
:
999
,
flag
:
1
}).
then
(
response
=>
{
this
.
partSampleInformationList
=
response
.
rows
}
)
},
//
getSampleInformation() {
//
// 查询整车样品信息
//
selectSamplePage({ pageNum: 1, pageSize: 999, flag: 0 }).then(
//
response => {
//
this.vehicleSampleInformationList = response.rows
//
}
//
)
//
// 查询零件样品信息
//
selectSamplePage({ pageNum: 1, pageSize: 999, flag: 1 }).then(
//
response => {
//
this.partSampleInformationList = response.rows
//
}
//
)
//
},
initWebSocket
()
{
// 初始化weosocket
const
wsuri
=
'ws://49.232.167.247:22032/websocket/1'
...
...
@@ -1007,13 +1059,15 @@ export default {
this
.
userList
.
find
(
item
=>
item
.
userId
.
toString
()
===
row
.
userId
.
toString
()
).
disabled
=
false
if
(
this
.
mainUserList
.
find
(
item
=>
item
.
userId
.
toString
()
===
row
.
userId
.
toString
()
)){
if
(
this
.
mainUserList
.
find
(
item
=>
item
.
userId
.
toString
()
===
row
.
userId
.
toString
()
).
disabled
=
false
item
=>
item
.
userId
.
toString
()
===
row
.
userId
.
toString
()
)
)
{
this
.
mainUserList
.
find
(
item
=>
item
.
userId
.
toString
()
===
row
.
userId
.
toString
()
).
disabled
=
false
}
// this.tableData = this.tableData.filter(
// item => item.userId !== row.userId
...
...
@@ -1138,7 +1192,11 @@ export default {
// 保存
handleAdd
()
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
console
.
log
(
this
.
model
.
inspectionItemList
.
find
(
item
=>
item
==
'grfis'
||
item
==
'trfis'
)
!=
undefined
)
console
.
log
(
this
.
model
.
inspectionItemList
.
find
(
item
=>
item
==
'grfis'
||
item
==
'trfis'
)
!=
undefined
)
console
.
log
(
this
.
currentVehicleSampleInformation
)
if
(
valid
)
{
// 判断小组信息、整车样品信息、零件样品信息有无数据
...
...
@@ -1151,7 +1209,15 @@ export default {
)
{
this
.
$message
.
error
(
'请保存小组成员信息'
)
return
}
else
if
(
this
.
model
.
inspectionItemList
.
find
(
item
=>
item
==
'grfis'
||
item
==
'trfis'
)
!=
undefined
&&
(
this
.
currentVehicleSampleInformation
.
length
==
0
||
this
.
currentVehicleSampleInformation
.
find
(
item
=>
item
.
sampleId
==
''
)
!=
undefined
))
{
}
else
if
(
this
.
model
.
inspectionItemList
.
find
(
item
=>
item
==
'grfis'
||
item
==
'trfis'
)
!=
undefined
&&
(
this
.
currentVehicleSampleInformation
.
length
==
0
||
this
.
currentVehicleSampleInformation
.
find
(
item
=>
item
.
sampleId
==
''
)
!=
undefined
)
)
{
this
.
$message
.
error
(
'请填写整车样品信息'
)
return
}
...
...
@@ -1199,6 +1265,8 @@ export default {
})
// 文件
this
.
taskCreateRequest
.
fileList
=
this
.
documentInfoArr
this
.
taskCreateRequest
.
enterpriseId
=
this
.
model
.
enterpriseId
this
.
taskCreateRequest
.
enterpriseName
=
this
.
model
.
enterpriseName
if
(
this
.
taskId
===
undefined
)
{
createTask
(
this
.
taskCreateRequest
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
...
...
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