Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rongtong-pc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
融通安全管理系统
rongtong-pc
Commits
474c04a5
Commit
474c04a5
authored
Dec 08, 2023
by
dlkong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
岗位清单配置
parent
0a982eb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
336 additions
and
19 deletions
+336
-19
src/api/system/currentRiskPost.js
src/api/system/currentRiskPost.js
+17
-0
src/views/risk/currentProject/projectPost.vue
src/views/risk/currentProject/projectPost.vue
+319
-19
No files found.
src/api/system/currentRiskPost.js
View file @
474c04a5
...
...
@@ -58,3 +58,20 @@ export function saveCurrentPost(data) {
data
:
data
})
}
// 隐患清单库
export
function
getlibraryListFun
(
query
)
{
return
request
({
url
:
'
/system/risk/existing/list
'
,
method
:
'
get
'
,
params
:
query
})
}
// 岗位用户巡查清单列表
export
function
getCurrentRiskPatrol
(
query
)
{
return
request
({
url
:
'
/risk/riskPostList/list
'
,
method
:
'
get
'
,
params
:
query
})
}
src/views/risk/currentProject/projectPost.vue
View file @
474c04a5
...
...
@@ -78,7 +78,7 @@
</div>
<!-- 添加或修改现状风险岗位对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"60%"
append-to-body
>
<el-tabs
v-model=
"activeName"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"tabChange"
>
<el-tab-pane
label=
"基础信息"
name=
"first"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"84px"
>
<el-form-item
label=
"岗位名称"
prop=
"riskPostName"
>
...
...
@@ -112,49 +112,135 @@
<el-tab-pane
label=
"清单匹配"
name=
"second"
>
<el-form
ref=
"listForm"
:model=
"listForm"
:rules=
"listRules"
label-width=
"120px"
label-position=
"top"
>
<el-form-item
label=
"匹配模式"
prop=
"postState"
>
<el-radio-group
v-model=
"listForm.postState"
@
change
=
"radioChange"
>
<el-radio
label=
"
1
"
>
一岗一人巡查模式
</el-radio>
<el-radio
label=
"
0
"
>
一岗多人巡查模式
</el-radio>
<el-radio-group
v-model=
"listForm.postState"
@
input
=
"radioChange"
>
<el-radio
label=
"
0
"
>
一岗一人巡查模式
</el-radio>
<el-radio
label=
"
1
"
>
一岗多人巡查模式
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"岗位清单配置"
prop=
"hdType"
v-if=
"listForm.postState == '1'"
>
<el-input
v-model=
"listForm.hdType"
style=
"width:80%;margin-right:20px"
></el-input>
<el-button
type=
"primary"
>
隐患清单库
</el-button>
<el-form-item
label=
"岗位清单配置"
prop=
"currentRiskTypeList"
v-if=
"listForm.postState == '0'"
id=
"currentRiskTypeList"
>
<!--
<el-input
v-model=
"listForm.currentRiskTypeList"
style=
"width:80%;margin-right:20px"
></el-input>
-->
<div
style=
"display:inline-block;width:80%;margin-right:20px;border:1px solid #eee;padding:5px 10px;min-height:40px"
>
<span
style=
"display:inline-block;margin-right:10px;line-height:15px;background-color:#1890FF;padding:5px 10px;color:#fff;"
v-for=
"(item, index) in listForm.currentRiskTypeList"
:key=
"index"
>
{{
item
.
type
||
item
.
currentRiskType
}}
</span>
</div>
<el-button
type=
"primary"
@
click=
"getPatrolLibrary"
style=
"height:35px"
>
隐患清单库
</el-button>
</el-form-item>
<el-form-item
label=
"岗位清单配置"
prop=
"hdType"
v-if=
"listForm.postState == '
0
'"
>
<el-table
:data=
"listUserTabel"
>
<el-form-item
label=
"岗位清单配置"
prop=
"hdType"
v-if=
"listForm.postState == '
1
'"
>
<el-table
:data=
"listUserTabel"
empty-text=
"暂无数据,请先在‘基础信息’中选择岗位成员!"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"姓名"
align=
"center"
prop=
"userName"
width=
"140"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"工号"
align=
"center"
prop=
"nickName"
width=
"140"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"postName"
width=
"140"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"巡查清单"
align=
"center"
prop=
"postName"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
width=
"140"
>
<template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.status"
@
change=
"statusChange(scope.$index, $event)"
>
</el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"巡查清单"
align=
"center"
prop=
"postNameShow"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
v-for=
"(item, index) in scope.row.postNameShow"
:key=
"index"
>
{{
item
.
type
||
item
.
currentRiskType
}}
</el-button>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
width=
"140"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"selectList(scope.row)"
@
click=
"selectList(scope.row
, scope.$index
)"
>
清单库选择
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-form-item>
<p>
<span
style=
"color: red;"
>
系统提示:可根据
工程进度调整巡查类型及
内容。
</span></p>
<p>
<span
style=
"color: red;"
>
系统提示:可根据
实际情况任意增加或减少巡查类型及巡查
内容。
</span></p>
</el-form>
</el-tab-pane>
</el-tabs>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
<el-dialog
title=
"选择隐患清单库"
:visible.sync=
"patrolLibraryOpen"
width=
"60%"
append-to-body
>
<el-table
:data=
"libraryList"
@
selection-change=
"handleSelectionChange"
ref=
"libraryListTabel"
:key=
"isUpdate"
>
<el-table-column
type=
"selection"
width=
"55"
>
</el-table-column>
<el-table-column
label=
"场所位置"
width=
"200"
show-overflow-tooltip
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
buildingName
}}{{
scope
.
row
.
floorName
}}{{
scope
.
row
.
roomName
}}
</
template
>
</el-table-column>
<el-table-column
label=
"风险源"
width=
"120"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
}}
</
template
>
</el-table-column>
<el-table-column
label=
"辨识标准"
width=
"120"
show-overflow-tooltip
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
referenceBasis
}}
</
template
>
</el-table-column>
<el-table-column
label=
"存在部位"
width=
"120"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
presenceLocation
}}
</
template
>
</el-table-column>
<el-table-column
label=
"风险类型(GB6441)"
width=
"120"
show-overflow-tooltip
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
type
}}
</
template
>
</el-table-column>
<el-table-column
label=
"风险等级"
width=
"120"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
level
}}
</
template
>
</el-table-column>
<el-table-column
label=
"周期"
width=
"120"
align=
"center"
prop=
"cycle"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.cycle"
placeholder=
"请选择"
@
change=
"cycleSelChange"
>
<el-option
v-for=
"(item, index) in cycleList"
:key=
"index"
:label=
"item.name"
:value=
"item.cycle"
>
</el-option>
</el-select>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"libraryTotal > 0"
:total=
"libraryTotal"
:page.sync=
"libraryParams.pageNum"
:limit.sync=
"libraryParams.pageSize"
@
pagination=
"getlibraryList"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"patrolLibrarySubmit"
>
确 定
</el-button>
<el-button
@
click=
"patrolLibraryOpen = false"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listCurrentRiskPost
,
userCurrentRiskPost
,
saveCurrentPost
,
getCurrentRiskPost
,
delCurrentRiskPost
,
addCurrentRiskPost
,
updateCurrentRiskPost
}
from
"
@/api/system/currentRiskPost
"
;
import
{
listCurrentRiskPost
,
userCurrentRiskPost
,
getlibraryListFun
,
saveCurrentPost
,
delCurrentRiskPost
,
getCurrentRiskPatrol
}
from
"
@/api/system/currentRiskPost
"
;
export
default
{
name
:
"
projectPost
"
,
...
...
@@ -178,12 +264,17 @@ export default {
title
:
""
,
// 是否显示弹出层
open
:
false
,
patrolLibraryOpen
:
false
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
9999
,
riskPostName
:
null
,
},
libraryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
},
form
:{},
patrolTypeList
:[],
// 岗位类型
userList
:[],
...
...
@@ -195,9 +286,40 @@ export default {
postState
:[{
required
:
true
,
message
:
'
请选择匹配模式
'
,
trigger
:
'
change
'
}]
},
listForm
:{
//清单匹配
postState
:
'
1
'
postState
:
'
0
'
,
currentRiskTypeList
:[]
}
,
listUserTabel
:[]
listUserTabel
:[],
libraryList
:[],
libraryTotal
:
0
,
currentRiskList
:[],
multipleSelection
:[],
cycleList
:[
{
name
:
'
日查
'
,
cycle
:
'
0
'
},
{
name
:
'
周查
'
,
cycle
:
'
1
'
},
{
name
:
'
月查
'
,
cycle
:
'
2
'
},
{
name
:
'
季查
'
,
cycle
:
'
3
'
},
{
name
:
'
年查
'
,
cycle
:
'
4
'
},
],
isUpdate
:
false
,
postList
:[],
userId
:
''
,
userIndex
:
''
};
},
created
()
{
...
...
@@ -227,11 +349,18 @@ export default {
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
this
.
postList
=
[]
this
.
listForm
.
currentRiskTypeList
=
[]
},
// 表单重置
reset
()
{
this
.
form
=
{}
this
.
activeName
=
'
first
'
this
.
listForm
=
{
//清单匹配
postState
:
'
0
'
,
currentRiskTypeList
:[]
}
this
.
listUserTabel
=
[]
},
/** 搜索按钮操作 */
handleQuery
()
{
...
...
@@ -263,6 +392,7 @@ export default {
row
.
userId
=
arr2
}
this
.
form
=
row
this
.
listForm
.
postState
=
this
.
form
.
patrolType
this
.
getUserList
()
this
.
open
=
true
;
this
.
title
=
"
修改现状风险岗位
"
;
...
...
@@ -275,10 +405,21 @@ export default {
"
projectId
"
:
this
.
$route
.
params
.
id
,
"
riskPostCode
"
:
this
.
form
.
riskPostCode
,
"
riskPostName
"
:
this
.
form
.
riskPostName
,
"
patrolType
"
:
this
.
form
.
patrolType
,
"
riskPostDesc
"
:
this
.
form
.
riskPostDesc
,
"
userId
"
:
this
.
form
.
userId
.
join
(),
"
patrolType
"
:
this
.
listForm
.
postState
,
"
list
"
:
this
.
postList
}
if
(
this
.
listForm
.
postState
==
'
0
'
)
{
// 一岗一人巡查模式
params
.
list
=
this
.
postList
}
else
{
let
arr
=
[]
this
.
listUserTabel
.
forEach
((
item
)
=>
{
arr
=
[...
item
.
postName
,
...
arr
]
})
params
.
list
=
arr
}
console
.
log
(
'
params==>>
'
,
params
)
if
(
this
.
form
.
id
!=
null
)
{
params
.
id
=
this
.
form
.
id
saveCurrentPost
(
params
).
then
(
response
=>
{
...
...
@@ -305,6 +446,160 @@ export default {
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{});
},
// 匹配模式radio
radioChange
(
e
){
if
(
e
==
'
1
'
)
{
this
.
listUserTabel
=
[]
let
arr
=
this
.
form
.
userId
arr
.
forEach
((
item
,
index
)
=>
{
let
data
=
{
userName
:
this
.
userList
.
find
(
i
=>
i
.
userId
==
item
).
nickName
,
postName
:[],
postNameShow
:[],
userId
:
item
,
status
:
true
}
this
.
listUserTabel
.
push
(
data
)
})
console
.
log
(
'
this.listUserTabel==>>
'
,
this
.
listUserTabel
)
}
},
// 一岗一人巡查模式 清单库
getPatrolLibrary
(){
this
.
patrolLibraryOpen
=
true
this
.
getlibraryList
()
},
getlibraryList
(){
getlibraryListFun
(
this
.
libraryParams
).
then
(
response
=>
{
this
.
libraryList
=
response
.
rows
;
this
.
libraryList
.
forEach
((
item
)
=>
{
item
.
cycle
=
'
0
'
})
this
.
libraryTotal
=
response
.
total
;
});
},
// 选择清单库确定
patrolLibrarySubmit
(){
this
.
postList
=
[]
this
.
listForm
.
currentRiskTypeList
=
[]
this
.
patrolLibraryOpen
=
false
this
.
multipleSelection
.
forEach
((
item
)
=>
{
if
(
this
.
listForm
.
postState
==
'
0
'
)
{
// 一岗一人巡查模式
let
data
=
{
id
:
item
.
id
,
patrolType
:
item
.
cycle
,
}
this
.
postList
.
push
(
data
)
if
(
!
this
.
listForm
.
currentRiskTypeList
.
some
(
items
=>
items
.
type
===
item
.
type
)){
this
.
listForm
.
currentRiskTypeList
.
push
(
item
)
}
}
else
{
// 一岗多人巡查模式
let
data
=
{
id
:
item
.
id
,
patrolType
:
item
.
cycle
,
userId
:
this
.
userId
,
status
:
this
.
userStatus
?
'
0
'
:
'
1
'
}
this
.
listUserTabel
[
this
.
userIndex
].
postName
.
push
(
data
)
if
(
!
this
.
listUserTabel
[
this
.
userIndex
].
postNameShow
.
some
(
items
=>
items
.
type
===
item
.
type
)){
this
.
listUserTabel
[
this
.
userIndex
].
postNameShow
.
push
(
item
)
}
}
})
// console.log('listUserTabel==>>',this.listUserTabel)
},
// 状态切换
statusChange
(
num
,
e
){
// console.log('num==>>', num)
this
.
listUserTabel
.
forEach
((
item
,
index
)
=>
{
if
(
index
==
num
)
{
item
.
postName
.
forEach
((
items
)
=>
{
items
.
status
=
e
?
'
0
'
:
'
1
'
})
}
})
console
.
log
(
'
,this.listUserTabel==>>
'
,
this
.
listUserTabel
)
},
// 一岗多人巡查模式 清单库
selectList
(
row
,
index
){
// console.log('row==>>',row)
this
.
patrolLibraryOpen
=
true
this
.
userId
=
row
.
userId
this
.
userIndex
=
index
this
.
userStatus
=
row
.
status
this
.
getlibraryList
()
},
// tabs切换
tabChange
(
tab
,
event
){
// console.log('tab==>>',tab.name)
if
(
tab
.
name
==
'
second
'
&&
this
.
title
==
'
修改现状风险岗位
'
)
{
//清单匹配
// 岗位用户巡查清单列表
this
.
listUserTabel
=
[]
this
.
getCurrentRiskPatrol
()
}
else
{
this
.
listForm
.
postState
=
'
0
'
}
},
getCurrentRiskPatrol
(){
this
.
listForm
.
currentRiskTypeList
=
[]
let
params
=
{
postId
:
this
.
form
.
id
,
pageNum
:
1
,
pageSize
:
9999
,
}
getCurrentRiskPatrol
(
params
).
then
(
response
=>
{
if
(
this
.
listForm
.
postState
==
'
0
'
)
{
// 一岗一人巡查模式
response
.
rows
.
forEach
((
item
)
=>
{
let
data
=
{
id
:
item
.
currentRiskId
,
patrolType
:
item
.
patrolType
,
}
this
.
postList
.
push
(
data
)
if
(
!
this
.
listForm
.
currentRiskTypeList
.
some
(
items
=>
items
.
currentRiskType
===
item
.
currentRiskType
)){
this
.
listForm
.
currentRiskTypeList
.
push
(
item
)
}
})
console
.
log
(
'
==>>
'
,
this
.
listForm
.
currentRiskTypeList
)
}
else
{
// 一岗多人巡查模式
let
arr
=
this
.
form
.
nickName
.
split
(
'
,
'
)
arr
.
forEach
((
item
,
index
)
=>
{
let
data
=
{
userName
:
item
,
postName
:[],
postNameShow
:[],
userId
:
this
.
userList
.
find
(
i
=>
i
.
nickName
==
item
).
userId
,
status
:
''
}
this
.
listUserTabel
.
push
(
data
)
})
for
(
const
val
of
response
.
rows
)
{
this
.
listUserTabel
.
forEach
((
item
)
=>
{
if
(
item
.
userId
==
val
.
userId
)
{
item
.
status
=
val
.
status
==
'
0
'
?
true
:
false
if
(
!
item
.
postNameShow
.
some
(
items
=>
items
.
currentRiskType
===
val
.
currentRiskType
))
{
item
.
postNameShow
.
push
(
val
)
}
let
data
=
{
id
:
val
.
currentRiskId
,
patrolType
:
val
.
patrolType
,
userId
:
val
.
userId
,
status
:
val
.
status
}
item
.
postName
.
push
(
data
)
}
})
}
// console.log('this.listUserTabel==>>',this.listUserTabel)
}
})
},
handleSelectionChange
(
val
){
this
.
multipleSelection
=
val
;
},
cycleSelChange
(){
this
.
isUpdate
=
!
this
.
isUpdate
}
}
};
</
script
>
...
...
@@ -399,4 +694,9 @@ export default {
::v-deep
.el-form-item--medium
.el-form-item__content
{
margin-left
:
20px
;
}
#
currentRiskTypeList
:
:
v-deep
.
el-form-item__content
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
</
style
>
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