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
0e586f48
Commit
0e586f48
authored
Feb 28, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 发起新任务 -> 小接口都对完,只差最后一步
parent
3cb866af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
40 deletions
+115
-40
user.js
src/api/system/user.js
+9
-0
index.vue
src/views/task/new/index.vue
+106
-40
No files found.
src/api/system/user.js
View file @
0e586f48
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
import
{
parseStrEmpty
}
from
'@/utils/ruoyi'
import
{
parseStrEmpty
}
from
'@/utils/ruoyi'
// 通过角色名查询用户
export
function
getUserByRole
(
data
)
{
return
request
({
url
:
'/system/user/getUserByRole'
,
method
:
'post'
,
data
:
data
})
}
// 查询用户列表
// 查询用户列表
export
function
listUser
(
query
)
{
export
function
listUser
(
query
)
{
return
request
({
return
request
({
...
...
src/views/task/new/index.vue
View file @
0e586f48
...
@@ -210,20 +210,20 @@
...
@@ -210,20 +210,20 @@
border
border
:data=
"tableData"
:data=
"tableData"
>
>
<el-table-column
label=
"姓名"
align=
"left"
prop=
"name"
>
<el-table-column
label=
"姓名"
align=
"left"
prop=
"n
ickN
ame"
>
<template
slot-scope=
"
{ row }">
<template
slot-scope=
"
{ row }">
<span
v-if=
"row.
name !== ''"
>
{{
row
.
n
ame
}}
</span>
<span
v-if=
"row.
userId !== ''"
>
{{
row
.
nickN
ame
}}
</span>
<el-select
<el-select
v-else
v-else
v-model=
"
name
"
v-model=
"
userId
"
placeholder=
"请选择"
placeholder=
"请选择"
@
change=
"handleNameChange"
@
change=
"handleNameChange"
>
>
<el-option
<el-option
v-for=
"(item, index) in userList"
v-for=
"(item, index) in userList"
:key=
"index"
:key=
"index"
:label=
"item.name"
:label=
"item.n
ickN
ame"
:value=
"item.
name
"
:value=
"item.
userId
"
:disabled=
"item.disabled"
:disabled=
"item.disabled"
>
>
</el-option>
</el-option>
...
@@ -232,19 +232,21 @@
...
@@ -232,19 +232,21 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"组内角色"
align=
"left"
prop=
"role"
>
<el-table-column
label=
"组内角色"
align=
"left"
prop=
"role"
>
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<span
v-if=
"row.name === ''"
>
-
</span>
<span
v-if=
"row.userId === ''"
>
-
</span>
<span
v-else
>
{{
row
.
role
}}
</span>
<!--
<span
v-else
>
{{
row
.
dept
.
deptName
}}
</span>
-->
<span
v-else-if=
"row.isLeader === 1"
>
组长
</span>
<span
v-else-if=
"row.isLeader === 0"
>
组员
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"所属部门"
align=
"left"
prop=
"dept"
>
<el-table-column
label=
"所属部门"
align=
"left"
prop=
"dept"
>
<
template
slot-scope=
"{ row }"
>
<
template
slot-scope=
"{ row }"
>
<span
v-if=
"row.
name
=== ''"
>
-
</span>
<span
v-if=
"row.
userId
=== ''"
>
-
</span>
<span
v-else
>
{{
row
.
dept
}}
</span>
<span
v-else
>
{{
row
.
dept
.
deptName
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"orderIndex"
label=
"排序"
>
<el-table-column
prop=
"orderIndex"
label=
"排序"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.
role !== '组长'
"
class=
"sortable-handle"
>
<div
v-if=
"scope.row.
isLeader !== 2
"
class=
"sortable-handle"
>
{{
'拖动排序'
}}
{{
'拖动排序'
}}
</div>
</div>
</
template
>
</
template
>
...
@@ -256,7 +258,7 @@
...
@@ -256,7 +258,7 @@
>
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
v-show=
"scope.row.
name
!== ''"
v-show=
"scope.row.
userId
!== ''"
size=
"mini"
size=
"mini"
type=
"primary"
type=
"primary"
icon=
"el-icon-edit"
icon=
"el-icon-edit"
...
@@ -266,7 +268,7 @@
...
@@ -266,7 +268,7 @@
修改
修改
</el-button>
</el-button>
<el-button
<el-button
v-show=
"scope.row.
name
!== ''"
v-show=
"scope.row.
userId
!== ''"
size=
"mini"
size=
"mini"
type=
"danger"
type=
"danger"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
...
@@ -276,7 +278,7 @@
...
@@ -276,7 +278,7 @@
删除
删除
</el-button>
</el-button>
<el-button
<el-button
v-show=
"scope.row.
name
=== ''"
v-show=
"scope.row.
userId
=== ''"
size=
"mini"
size=
"mini"
type=
"primary"
type=
"primary"
icon=
"el-icon-edit"
icon=
"el-icon-edit"
...
@@ -286,7 +288,7 @@
...
@@ -286,7 +288,7 @@
保存
保存
</el-button>
</el-button>
<el-button
<el-button
v-show=
"scope.row.
name
=== ''"
v-show=
"scope.row.
userId
=== ''"
size=
"mini"
size=
"mini"
type=
"danger"
type=
"danger"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
...
@@ -473,6 +475,7 @@ import { manufacturerData } from '../../../api/task/new'
...
@@ -473,6 +475,7 @@ 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'
import
{
getUserByRole
}
from
'@/api/system/user'
export
default
{
export
default
{
dicts
:
[
dicts
:
[
'sys_task_status'
,
'sys_task_status'
,
...
@@ -486,6 +489,42 @@ export default {
...
@@ -486,6 +489,42 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
// 最终提交
taskCreateRequest
:
{
standardId
:
1
,
// 检验依据
taskNo
:
''
,
// 任务编号
taskName
:
''
,
// 任务名称
confidentialityLevel
:
''
,
// 保密等级
productName
:
''
,
// 产品名称
productModel
:
''
,
// 车辆型号
entrustedUnit
:
''
,
// 委托单位
entrustedUnitAddress
:
''
,
// 委托单位地址
entrustedUnitPhone
:
''
,
// 委托单位电话
entrustedUnitCode
:
''
,
// 委托单位邮政编码
// 小组成员
auditors
:
[
{
userId
:
''
,
// 审核人id
name
:
''
,
// 审核人姓名
isLeader
:
''
,
// 是否是组长
deptName
:
''
// 部门名称
}
],
// 整车样品信息
sample
:
[
{
sampleId
:
''
,
// 样品id
flag
:
0
}
],
// 零部件样品信息
partSample
:
[
{
sampleId
:
''
,
// 样品id
flag
:
1
}
]
},
carInfoArr
:
[
carInfoArr
:
[
{
{
identificationCode
:
''
,
// 车辆识别码(VIN)
identificationCode
:
''
,
// 车辆识别码(VIN)
...
@@ -504,7 +543,7 @@ export default {
...
@@ -504,7 +543,7 @@ export default {
// 零件样品信息结合
// 零件样品信息结合
partSampleInformationList
:
[],
partSampleInformationList
:
[],
websock
:
null
,
websock
:
null
,
name
:
''
,
userId
:
''
,
formType
:
'1'
,
formType
:
'1'
,
showTestScenario
:
false
,
showTestScenario
:
false
,
// 新增/保存 - 对象
// 新增/保存 - 对象
...
@@ -523,9 +562,9 @@ export default {
...
@@ -523,9 +562,9 @@ export default {
},
},
loading
:
false
,
loading
:
false
,
tableData
:
[
tableData
:
[
{
n
ame
:
'老二'
,
role
:
'组员'
,
dept
:
'第一部门'
,
disabled
:
true
},
// { nickN
ame: '老二', role: '组员', dept: '第一部门', disabled: true },
{
n
ame
:
'老三'
,
role
:
'组员'
,
dept
:
'第一部门'
,
disabled
:
true
},
// { nickN
ame: '老三', role: '组员', dept: '第一部门', disabled: true },
{
n
ame
:
'老大'
,
role
:
'组长'
,
dept
:
'第一部门'
,
disabled
:
true
}
// { nickN
ame: '老大', role: '组长', dept: '第一部门', disabled: true }
],
],
inspectionItemList
:
[
inspectionItemList
:
[
{
value
:
0
,
label
:
'汽车信息安全管理体系要求'
,
check
:
false
},
{
value
:
0
,
label
:
'汽车信息安全管理体系要求'
,
check
:
false
},
...
@@ -642,11 +681,11 @@ export default {
...
@@ -642,11 +681,11 @@ export default {
]
]
},
},
userList
:
[
userList
:
[
{
n
ame
:
'老大'
,
role
:
'组长'
,
dept
:
'第一部门'
,
disabled
:
true
},
// { nickN
ame: '老大', role: '组长', dept: '第一部门', disabled: true },
{
n
ame
:
'老二'
,
role
:
'组员'
,
dept
:
'第一部门'
,
disabled
:
true
},
// { nickN
ame: '老二', role: '组员', dept: '第一部门', disabled: true },
{
n
ame
:
'老三'
,
role
:
'组员'
,
dept
:
'第一部门'
,
disabled
:
true
},
// { nickN
ame: '老三', role: '组员', dept: '第一部门', disabled: true },
{
n
ame
:
'老四'
,
role
:
'组员'
,
dept
:
'第一部门'
,
disabled
:
false
},
// { nickN
ame: '老四', role: '组员', dept: '第一部门', disabled: false },
{
n
ame
:
'老五'
,
role
:
'组员'
,
dept
:
'第一部门'
,
disabled
:
false
}
// { nickN
ame: '老五', role: '组员', dept: '第一部门', disabled: false }
],
],
imageUrl
:
''
,
imageUrl
:
''
,
productionEnterpriseList
:
[
productionEnterpriseList
:
[
...
@@ -716,6 +755,7 @@ export default {
...
@@ -716,6 +755,7 @@ export default {
// this.initWebSocket()
// this.initWebSocket()
// 查询样品信息(整车、零件)
// 查询样品信息(整车、零件)
this
.
getSampleInformation
()
this
.
getSampleInformation
()
this
.
getUserByRole
()
this
.
getManufacturer
()
this
.
getManufacturer
()
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
leaderTop
()
this
.
leaderTop
()
...
@@ -726,6 +766,13 @@ export default {
...
@@ -726,6 +766,13 @@ export default {
this
.
websock
.
close
()
// 离开路由之后断开websocket连接
this
.
websock
.
close
()
// 离开路由之后断开websocket连接
},
},
methods
:
{
methods
:
{
getUserByRole
()
{
getUserByRole
({
roleName
:
'检验员'
}).
then
(
response
=>
{
this
.
userList
=
response
.
data
.
map
(
obj
=>
{
return
{
...
obj
,
disabled
:
false
}
})
})
},
handleCarsChange
(
cards
)
{
handleCarsChange
(
cards
)
{
console
.
log
(
'CarInfo组件传值'
,
cards
)
console
.
log
(
'CarInfo组件传值'
,
cards
)
},
},
...
@@ -789,12 +836,12 @@ export default {
...
@@ -789,12 +836,12 @@ export default {
if
(
this
.
tableData
.
length
!==
0
)
{
if
(
this
.
tableData
.
length
!==
0
)
{
this
.
tableData
.
findIndex
((
item
,
index
)
=>
{
this
.
tableData
.
findIndex
((
item
,
index
)
=>
{
// 循环遍历数组是否有组长
// 循环遍历数组是否有组长
if
(
item
.
role
===
'组长'
)
{
if
(
item
.
isLeader
===
1
)
{
let
obj
=
{}
let
obj
=
{}
this
.
tableData
.
length
&&
this
.
tableData
.
length
&&
this
.
tableData
.
forEach
((
item
,
index
)
=>
{
this
.
tableData
.
forEach
((
item
,
index
)
=>
{
// 在数组中循环遍历找到组长并置顶
// 在数组中循环遍历找到组长并置顶
if
(
item
.
role
===
'组长'
)
{
if
(
item
.
isLeader
===
1
)
{
obj
=
item
obj
=
item
this
.
tableData
.
splice
(
index
,
1
)
this
.
tableData
.
splice
(
index
,
1
)
return
return
...
@@ -829,6 +876,14 @@ export default {
...
@@ -829,6 +876,14 @@ export default {
_this
.
tableData
=
[]
_this
.
tableData
=
[]
_this
.
$nextTick
(()
=>
{
_this
.
$nextTick
(()
=>
{
_this
.
tableData
=
newArray
_this
.
tableData
=
newArray
// 把第一行的人员设定为组长
_this
.
tableData
=
_this
.
tableData
.
map
((
item
,
index
)
=>
{
if
(
index
===
0
)
{
return
{
...
item
,
isLeader
:
1
}
}
else
{
return
{
...
item
,
isLeader
:
0
}
}
})
console
.
log
(
'_this.tableData'
,
_this
.
tableData
)
console
.
log
(
'_this.tableData'
,
_this
.
tableData
)
})
})
}
}
...
@@ -841,8 +896,8 @@ export default {
...
@@ -841,8 +896,8 @@ export default {
handleUpdate
(
row
)
{
handleUpdate
(
row
)
{
console
.
log
(
'修改'
,
row
)
console
.
log
(
'修改'
,
row
)
// 取消禁用
// 取消禁用
this
.
userList
.
find
(
item
=>
item
.
name
===
row
.
name
).
disabled
=
false
this
.
userList
.
find
(
item
=>
item
.
userId
===
row
.
userId
).
disabled
=
false
this
.
tableData
.
find
(
item
=>
item
.
name
===
row
.
name
).
name
=
''
this
.
tableData
.
find
(
item
=>
item
.
userId
===
row
.
userId
).
userId
=
''
},
},
handleInspectionItem
(
item
)
{
handleInspectionItem
(
item
)
{
// 查看item.value在this.checkTestScenarioList里面存不存在
// 查看item.value在this.checkTestScenarioList里面存不存在
...
@@ -885,9 +940,11 @@ export default {
...
@@ -885,9 +940,11 @@ export default {
closeOnClickModal
:
false
,
closeOnClickModal
:
false
,
confirmButtonClass
:
'queryBtn'
confirmButtonClass
:
'queryBtn'
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
tableData
=
this
.
tableData
.
filter
(
item
=>
item
.
name
!==
row
.
name
)
this
.
tableData
=
this
.
tableData
.
filter
(
item
=>
item
.
userId
!==
row
.
userId
)
// 把当前人取消禁用
// 把当前人取消禁用
this
.
userList
.
find
(
item
=>
item
.
name
===
row
.
name
).
disabled
=
false
this
.
userList
.
find
(
item
=>
item
.
userId
===
row
.
userId
).
disabled
=
false
})
})
},
},
/**
/**
...
@@ -895,21 +952,29 @@ export default {
...
@@ -895,21 +952,29 @@ export default {
* @param row
* @param row
*/
*/
handleSavePeople
(
row
)
{
handleSavePeople
(
row
)
{
const
obj
=
this
.
userList
.
find
(
item
=>
item
.
name
===
this
.
name
)
const
obj
=
this
.
userList
.
find
(
item
=>
item
.
userId
===
this
.
userId
)
const
currentData
=
this
.
tableData
.
find
(
item
=>
item
.
name
===
row
.
name
)
const
currentData
=
this
.
tableData
.
find
(
currentData
.
name
=
this
.
name
item
=>
item
.
userId
===
row
.
userId
)
currentData
.
userId
=
this
.
userId
currentData
.
nickName
=
obj
.
nickName
currentData
.
dept
=
obj
.
dept
currentData
.
dept
=
obj
.
dept
currentData
.
role
=
obj
.
role
// 已被选择的人做禁用
// 已被选择的人做禁用
this
.
userList
.
find
(
item
=>
item
.
name
===
this
.
name
).
disabled
=
true
this
.
userList
.
find
(
item
=>
item
.
userId
===
this
.
userId
).
disabled
=
true
this
.
name
=
''
this
.
userId
=
''
this
.
leaderTop
()
this
.
leaderTop
()
if
(
this
.
tableData
.
length
===
1
)
{
currentData
.
isLeader
=
1
}
else
{
currentData
.
isLeader
=
0
}
console
.
log
(
'现在的对象'
,
this
.
tableData
)
},
},
/**
/**
* 取消人员
* 取消人员
*/
*/
handleCancelPeople
()
{
handleCancelPeople
()
{
this
.
name
=
''
this
.
userId
=
''
// 去掉一个数组最后一个对象
// 去掉一个数组最后一个对象
this
.
tableData
.
pop
()
this
.
tableData
.
pop
()
},
},
...
@@ -923,18 +988,18 @@ export default {
...
@@ -923,18 +988,18 @@ export default {
const
lastObj
=
this
.
tableData
[
this
.
tableData
.
length
-
1
]
const
lastObj
=
this
.
tableData
[
this
.
tableData
.
length
-
1
]
let
num
=
0
let
num
=
0
this
.
tableData
.
forEach
(
item
=>
{
this
.
tableData
.
forEach
(
item
=>
{
if
(
item
.
name
===
''
)
{
if
(
item
.
userId
===
''
)
{
num
++
num
++
}
}
})
})
if
(
lastObj
.
name
===
''
||
num
===
1
)
{
if
(
lastObj
.
userId
===
''
||
num
===
1
)
{
this
.
$message
.
error
(
'请填写完此成员信息'
)
this
.
$message
.
error
(
'请填写完此成员信息'
)
return
return
}
else
{
}
else
{
this
.
tableData
.
push
({
name
:
''
})
this
.
tableData
.
push
({
userId
:
''
})
}
}
}
else
{
}
else
{
this
.
tableData
.
push
({
name
:
''
})
this
.
tableData
.
push
({
userId
:
''
})
}
}
},
},
handleNameChange
(
value
)
{},
handleNameChange
(
value
)
{},
...
@@ -958,6 +1023,7 @@ export default {
...
@@ -958,6 +1023,7 @@ export default {
console
.
log
(
'a'
,
this
.
inspectionItemList
)
console
.
log
(
'a'
,
this
.
inspectionItemList
)
this
.
$refs
.
form
.
validate
(
valid
=>
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
// 开始窜数据
this
.
$modal
.
msgSuccess
(
'发布成功'
)
this
.
$modal
.
msgSuccess
(
'发布成功'
)
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
'/task/on'
path
:
'/task/on'
...
...
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