Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
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
胡宝山
template_vue
Commits
0db3a86a
Commit
0db3a86a
authored
Jul 28, 2023
by
吴志坤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础信息和设备申请
parent
af25d5da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1112 additions
and
410 deletions
+1112
-410
draw.js
src/api/equipment/draw.js
+95
-0
basicInfo.vue
src/views/equipment/basicInfo.vue
+63
-105
draw.vue
src/views/equipment/draw.vue
+371
-305
draw.vue
src/views/processManagement/draw.vue
+583
-0
No files found.
src/api/equipment/draw.js
0 → 100644
View file @
0db3a86a
import
request
from
'@/utils/request'
import
Qs
from
'qs'
// 查询基础信息列表
export
function
listWbApply
(
query
)
{
return
request
({
url
:
'/wbapply/queryWbApplyByPagination'
,
method
:
'get'
,
params
:
query
})
}
export
function
getlistRole
()
{
return
request
({
url
:
'system/role/listAll'
,
method
:
'get'
})
}
// 查询角色详细
export
function
getRole
(
businessId
)
{
return
request
({
url
:
'/system/role/detail/'
+
businessId
,
method
:
'get'
})
}
// 新增角色
export
function
addRole
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/system/role/add'
,
method
:
'post'
,
data
:
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
// 修改角色
export
function
updateRole
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/system/role/update/'
+
businessId
,
method
:
'put'
,
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
// 角色数据权限
export
function
dataScope
(
data
)
{
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/system/role/dataScope'
,
method
:
'put'
,
data
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
})
}
// 角色状态修改
export
function
changeRoleStatus
(
businessId
,
flag
)
{
const
data
=
{
businessId
,
flag
}
return
request
({
url
:
'/system/role/changeStatus'
,
method
:
'put'
,
params
:
data
})
}
// 删除角色
export
function
delRole
(
roleId
)
{
return
request
({
url
:
'/system/role/deleteLogical/'
+
roleId
,
method
:
'delete'
})
}
// 导出角色
export
function
exportRole
(
query
)
{
return
request
({
url
:
'/system/role/export'
,
method
:
'get'
,
params
:
query
,
responseType
:
'blob'
})
}
src/views/equipment/basicInfo.vue
View file @
0db3a86a
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"pn"
prop=
"p
gx
"
>
<el-form-item
label=
"pn"
prop=
"p
n
"
>
<el-input
<el-input
v-model=
"queryParams.pn"
v-model=
"queryParams.pn"
placeholder=
"请输入pn"
placeholder=
"请输入pn"
...
@@ -25,36 +25,31 @@
...
@@ -25,36 +25,31 @@
<el-form-item
label=
"pgx"
prop=
"pgx"
>
<el-form-item
label=
"pgx"
prop=
"pgx"
>
<el-input
<el-input
v-model=
"queryParams.pgx"
v-model=
"queryParams.pgx"
placeholder=
"请输入p
type
"
placeholder=
"请输入p
gx
"
clearable
clearable
size=
"small"
size=
"small"
style=
"width: 150px"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
<el-form-item>
</el-form-item>
<el-button
type=
"primary"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-form-item>
</el-form-item>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<div
style=
"float: right"
>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
<el-form-item>
</el-form-item>
<el-button
<div
style=
"float: right;padding:3px 15px;"
>
type=
"primary"
<el-button
size=
"small"
style=
"padding: 8px 7px;"
@
click=
"handleAdd"
type=
"primary"
>
新增
</el-button>
size=
"small"
<el-button
icon=
"el-icon-plus"
style=
"padding: 8px 7px;"
@
click=
"handleAdd"
type=
"success"
>
新增
</el-button>
size=
"small"
</div>
icon=
"el-icon-download"
</el-form>
@
click=
"handleExport"
>
导出
</el-button>
</el-form-item>
</div>
</el-form-item></el-form>
<div
class=
"placeholder"
/>
<div
class=
"placeholder"
/>
<div
style=
"padding:5px 10px"
>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
设备基本信息列表
</div>
<div
class=
"mb12 font-small-bold"
>
设备基本信息列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"basicInfoList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
border
:data=
"basicInfoList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"pn"
prop=
"pn"
>
<el-table-column
label=
"pn"
prop=
"pn"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
...
@@ -96,12 +91,12 @@
...
@@ -96,12 +91,12 @@
{{
scope
.
row
.
createBy
||
'-'
}}
{{
scope
.
row
.
createBy
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
>
<el-table-column
label=
"操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"
24
0px"
>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"
15
0px"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
size=
"mini"
size=
"mini"
...
@@ -140,10 +135,23 @@
...
@@ -140,10 +135,23 @@
<el-input-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx"
/>
<el-input-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input-number
v-model=
"form.p
gx
"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank"
/>
<el-input-number
v-model=
"form.p
rank
"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-input-number
v-model=
"form.pissb"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pissb"
/>
<el-select
v-model=
"form.pissb"
placeholder=
"请选择pissb"
clearable
size=
"small"
style=
"width: 150px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"psm"
prop=
"psm"
>
<el-form-item
label=
"psm"
prop=
"psm"
>
<el-input-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm"
/>
<el-input-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm"
/>
...
@@ -151,9 +159,6 @@
...
@@ -151,9 +159,6 @@
<el-form-item
label=
"psy"
prop=
"psy"
>
<el-form-item
label=
"psy"
prop=
"psy"
>
<el-input-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy"
/>
<el-input-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
v-model
.
trim=
"form.remark"
maxlength=
"200"
show-word-limit
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
...
@@ -211,11 +216,11 @@ export default {
...
@@ -211,11 +216,11 @@ export default {
// 状态数据字典
// 状态数据字典
statusOptions
:
[
statusOptions
:
[
{
{
dictLabel
:
'
启用
'
,
dictLabel
:
'
是
'
,
dictValue
:
'1'
dictValue
:
'1'
},
},
{
{
dictLabel
:
'
停用
'
,
dictLabel
:
'
否
'
,
dictValue
:
'0'
dictValue
:
'0'
}
}
],
],
...
@@ -242,17 +247,15 @@ export default {
...
@@ -242,17 +247,15 @@ export default {
label
:
'仅本人数据权限'
label
:
'仅本人数据权限'
}
}
],
],
// 菜单列表
menuOptions
:
[],
// 部门列表
// 部门列表
tOptions
:
[],
tOptions
:
[],
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
page
:
1
,
page
:
1
,
rows
:
10
,
rows
:
10
,
roleName
:
undefined
,
pn
:
undefined
,
roleKey
:
undefined
,
ptype
:
undefined
,
flag
:
undefined
pgx
:
undefined
},
},
// 表单参数
// 表单参数
form
:
{},
form
:
{},
...
@@ -262,14 +265,26 @@ export default {
...
@@ -262,14 +265,26 @@ export default {
},
},
// 表单校验
// 表单校验
rules
:
{
rules
:
{
roleName
:
[
pn
:
[
{
required
:
true
,
message
:
'请输入角色名称'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
ptype
:
[
{
required
:
true
,
message
:
'请输入ptype'
,
trigger
:
'blur'
}
],
pgx
:
[
{
required
:
true
,
message
:
'请输入pgx'
,
trigger
:
'blur'
}
],
prank
:
[
{
required
:
true
,
message
:
'请输入prank'
,
trigger
:
'blur'
}
],
],
roleKey
:
[
pissb
:
[
{
required
:
true
,
message
:
'请输入
权限字符
'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入
pissb
'
,
trigger
:
'blur'
}
],
],
roleSort
:
[
psm
:
[
{
required
:
true
,
message
:
'请输入角色排序'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入psm'
,
trigger
:
'blur'
}
],
psy
:
[
{
required
:
true
,
message
:
'请输入psy'
,
trigger
:
'blur'
}
]
]
},
},
deptOptions
:
[]
deptOptions
:
[]
...
@@ -399,9 +414,9 @@ export default {
...
@@ -399,9 +414,9 @@ export default {
this
.
deptExpand
=
true
this
.
deptExpand
=
true
this
.
deptNodeAll
=
false
this
.
deptNodeAll
=
false
this
.
form
=
{
this
.
form
=
{
roleId
:
undefined
,
pn
:
undefined
,
businessId
:
undefined
,
ptype
:
undefined
,
roleName
:
undefined
,
pgx
:
undefined
,
roleKey
:
undefined
,
roleKey
:
undefined
,
roleSort
:
0
,
roleSort
:
0
,
flag
:
undefined
,
flag
:
undefined
,
...
@@ -485,38 +500,13 @@ export default {
...
@@ -485,38 +500,13 @@ export default {
this
.
title
=
'修改角色'
this
.
title
=
'修改角色'
})
})
},
},
/** 分配数据权限操作 选择菜单 */
handleMenu
(
row
)
{
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
this
.
getMenuList
(
roleId
)
// 查询菜单列表树形显示
getRole
(
roleId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
openDataScope
=
true
this
.
title
=
'分配数据权限'
})
},
/** 分配数据权限操作 */
handleDataScope
(
row
)
{
this
.
deptOptions
=
[]
this
.
form
.
dataScope
=
undefined
const
roleId
=
this
.
form
.
businessId
this
.
form
.
menuId
=
row
.
businessId
this
.
form
.
menuName
=
row
.
menuName
const
roleDeptTreeselect
=
this
.
getRoleDeptTreeselect
(
roleId
,
this
.
form
.
menuId
)
this
.
$nextTick
(()
=>
{
roleDeptTreeselect
.
then
(
res
=>
{
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'分配数据权限'
},
/** 提交按钮 */
/** 提交按钮 */
submitForm
:
function
()
{
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
this
.
open
=
false
...
@@ -524,6 +514,7 @@ export default {
...
@@ -524,6 +514,7 @@ export default {
})
})
}
else
{
}
else
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
this
.
open
=
false
...
@@ -533,17 +524,6 @@ export default {
...
@@ -533,17 +524,6 @@ export default {
}
}
})
})
},
},
/** 提交按钮(数据权限) */
submitDataScope
:
function
()
{
if
(
this
.
form
.
businessId
!==
undefined
&&
this
.
form
.
menuId
!==
undefined
)
{
this
.
form
.
deptIds
=
this
.
getDeptAllCheckedKeys
()
dataScope
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
openDataScope
=
false
this
.
getList
()
})
}
},
/** 删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
const
roleIds
=
row
.
businessId
||
this
.
ids
const
roleIds
=
row
.
businessId
||
this
.
ids
...
@@ -561,28 +541,6 @@ export default {
...
@@ -561,28 +541,6 @@ export default {
})
})
}).
catch
(
function
()
{
}).
catch
(
function
()
{
})
})
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
this
.
$confirm
(
'是否确认导出所有用户信息?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
exportRole
(
queryParams
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
downloadElement
=
document
.
createElement
(
'a'
)
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
downloadElement
.
href
=
href
downloadElement
.
download
=
'角色信息'
+
'.xls'
// 下载后文件名
document
.
body
.
appendChild
(
downloadElement
)
downloadElement
.
click
()
// 点击下载
document
.
body
.
removeChild
(
downloadElement
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉blob对象
// this.download(response.msg);
})
})
}
}
}
}
}
}
...
...
src/views/equipment/draw.vue
View file @
0db3a86a
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<!-- TODO: 基础设备管理-->
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"
设备名称"
prop=
"roleName
"
>
<el-form-item
label=
"
pn"
prop=
"pn
"
>
<el-input
<el-input
v-model=
"queryParams.
deviceName
"
v-model=
"queryParams.
pn
"
placeholder=
"请输入
设备名称
"
placeholder=
"请输入
pn
"
clearable
clearable
:maxlength=
"30"
:maxlength=
"30"
size=
"small"
size=
"small"
...
@@ -14,10 +12,20 @@
...
@@ -14,10 +12,20 @@
@
keyup
.
enter
.
native=
"handleQuery"
@
keyup
.
enter
.
native=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"设备编码"
prop=
"roleKey"
>
<el-form-item
label=
"phd"
prop=
"phd"
>
<el-input
v-model=
"queryParams.phd"
placeholder=
"请输入phd"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input
<el-input
v-model=
"queryParams.
deviceId
"
v-model=
"queryParams.
prank
"
placeholder=
"请输入
设备编码
"
placeholder=
"请输入
prank
"
clearable
clearable
size=
"small"
size=
"small"
style=
"width: 150px"
style=
"width: 150px"
...
@@ -25,110 +33,128 @@
...
@@ -25,110 +33,128 @@
/>
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
size=
"small"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<el-button
style=
"padding: 8px 7px;"
:type=
"typePrimary"
:size=
"smallSize"
:icon=
"addIcon"
@
click=
"handleAdd"
>
{{
application
}}
</el-button>
</el-form-item>
</div>
</el-form>
</el-form>
<div
class=
"placeholder"
/>
<div
class=
"placeholder"
/>
<!-- TODO: 中间的分隔符号 -->
<div
style=
"padding:5px 10px"
>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
设备领用信息列表
</div>
<!-- TODO: 以下为基础设备管理列表 -->
<el-table
v-loading=
"loading"
border
:data=
"equipmentapplyList"
@
selection-change=
"handleSelectionChange"
>
<div
class=
"mb12 font-small-bold"
>
设备领用列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"roleList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<
!--
<el-table-column
label=
"设备名称"
prop=
"deviceName"
:show-overflow-tooltip=
"true
"
>
<
el-table-column
label=
"pn"
prop=
"pn
"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
deviceName
||
'-'
}}
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
-->
</el-table-column>
<el-table-column
label=
"
设备编码"
prop=
"deviceId
"
>
<el-table-column
label=
"
phd"
prop=
"phd"
:show-overflow-tooltip=
"true
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
deviceI
d
||
'-'
}}
{{
scope
.
row
.
ph
d
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
LOT"
prop=
"LOT
"
>
<el-table-column
label=
"
prank"
prop=
"prank
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
deviceId
||
'-'
}}
{{
scope
.
row
.
prank
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
位置"
prop=
"location
"
>
<el-table-column
label=
"
pgx"
prop=
"pgx
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
location
||
'-'
}}
{{
scope
.
row
.
pgx
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
厚度"
prop=
"ply
"
>
<el-table-column
label=
"
pissb"
prop=
"pissb
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
p
ly
||
'-'
}}
{{
scope
.
row
.
p
issb
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
操作员"
prop=
"createBy
"
>
<el-table-column
label=
"
pstatus"
prop=
"pstatus
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createBy
||
'-'
}}
{{
scope
.
row
.
pstatus
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
创建时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTim
e"
>
<el-table-column
label=
"
ptype"
prop=
"ptyp
e"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
{{
scope
.
row
.
ptype
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
prop=
"pstatus"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.pstatus === '0'"
style=
"color: red"
>
未完成
</span>
<span
v-else
style=
"color: green"
>
已完成
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作员"
prop=
"createBy"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createBy
||
'-'
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"
状态"
prop=
"state
"
>
<el-table-column
label=
"
操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
width=
"200px
"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
:style=
"getFontColor(scope.row.state)"
>
{{
scope
.
row
.
state
||
'-'
}}
</span>
<span
>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"1
4
0px"
>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"1
5
0px"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
v-if=
"scope.row.state !== '已驳回'"
:type=
"typeParent"
:size=
"size"
@
click=
"handleDetail(scope.row)"
>
详情
</el-button>
<el-button
v-if=
"scope.row.state === '已驳回'"
:type=
"typeParent"
:size=
"size"
@
click=
"handleUpdate(scope.row)"
>
{{
updataName
}}
</el-button>
<el-button
<el-button
v-if=
"scope.row.state !== ' '"
size=
"mini"
:type=
"typeParent"
type=
"text"
:size=
"size"
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</div>
</div>
<el-pagination
<pagination
background
v-show=
"total>0"
layout=
"prev, pager, next"
:total=
"total"
:total=
"1000"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
/>
<!--
TODO: 添加或修改设备
配置对话框 -->
<!--
添加或修改设备基本信息
配置对话框 -->
<el-dialog
:title=
"title
"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-dialog
title=
"设备基本信息
"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"设备名称"
prop=
"deviceName"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.deviceName"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备名称"
/>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"ptype"
prop=
"ptype"
>
<el-input
v-model
.
trim=
"form.ptype"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入ptype"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
设备编码"
prop=
"deviceId
"
>
<el-form-item
label=
"
pgx"
prop=
"pgx
"
>
<el-input
v-model
.
trim=
"form.deviceId"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备编码
"
/>
<el-input
-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx
"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
LOT"
prop=
"LOT
"
>
<el-form-item
label=
"
prank"
prop=
"prank
"
>
<el-input
v-model
.
trim=
"form.LOT"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入LOT
"
/>
<el-input
-number
v-model=
"form.prank"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank
"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"位置"
prop=
"location"
>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-input
v-model
.
trim=
"form.location"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备编码"
/>
<el-select
v-model=
"form.pissb"
placeholder=
"请选择pissb"
clearable
size=
"small"
style=
"width: 150px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
厚度"
prop=
"ply
"
>
<el-form-item
label=
"
psm"
prop=
"psm
"
>
<el-input
v-model
.
trim=
"form.ply"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入设备编码
"
/>
<el-input
-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm
"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
操作员"
prop=
"createB
y"
>
<el-form-item
label=
"
psy"
prop=
"ps
y"
>
<el-input
v-model
.
trim=
"form.createBy"
:maxlength=
"30"
show-word-limit
placeholder=
"请输入创建人
"
/>
<el-input
-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy
"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
slot=
"footer"
class=
"dialog-footer"
>
...
@@ -136,78 +162,47 @@
...
@@ -136,78 +162,47 @@
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<!-- TODO: 单项详情信息表单配置 -->
<el-dialog
class=
"aboutSingleDetails"
:title=
"title"
:visible
.
sync=
"openDetails"
width=
"700px"
append-to-body
>
<el-form
ref=
"formDetails"
:model=
"singleDetails"
size=
"small"
label-width=
"90px"
>
<el-form-item
label=
"名称:"
prop=
"deviceName"
>
<el-input
v-model
.
trim=
"singleDetails.deviceName"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"设备编码:"
prop=
"deviceId"
>
<el-input
v-model
.
trim=
"singleDetails.deviceId"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"LOT: "
prop=
"LOT"
>
<el-input
v-model
.
trim=
"singleDetails.LOT"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"位置:"
prop=
"location"
>
<el-input
v-model
.
trim=
"singleDetails.location"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"位置:"
prop=
"ply"
>
<el-input
v-model
.
trim=
"singleDetails.ply"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"创建时间:"
prop=
"createTime"
>
<el-input
v-model
.
trim=
"singleDetails.createTime"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"创建人:"
prop=
"createBy"
>
<el-input
v-model
.
trim=
"singleDetails.createBy"
:readonly=
"isReadOnly"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"state"
>
<el-input
v-model
.
trim=
"singleDetails.state"
:readonly=
"isReadOnly"
/>
</el-form-item>
</el-form>
</el-dialog>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
// import {
// addRole,
// changeRoleStatus,
// dataScope,
// delRole,
// exportRole,
// getRole,
// listBasicInfo,
// updateRole
// } from '@/api/equipment/basicInfo'
import
{
roleMenuTreeselect
,
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
}
from
'@/api/system/menu'
import
{
roleDeptTreeselect
,
treeselect
as
deptTreeselect
}
from
'@/api/system/dept'
import
{
listBasicInfo
}
from
'@/api/equipment/basicInfo'
import
{
listWbApply
}
from
'@/api/equipment/draw'
// import { getRolesByInsId } from '../../../api/businessManage/template'
export
default
{
export
default
{
name
:
'Role'
,
name
:
'Role'
,
data
()
{
data
()
{
return
{
return
{
typeParent
:
'text'
,
typePrimary
:
'primary'
,
typeSuccess
:
'success'
,
nameParent
:
'删除'
,
resetName
:
'重置'
,
addName
:
'新增'
,
application
:
'申请领用'
,
updataName
:
'修改'
,
size
:
'mini'
,
smallSize
:
'small'
,
delicon
:
'el-icon-delete'
,
addIcon
:
'el-icon-plus'
,
exportIcon
:
'el-icon-download'
,
resetIcon
:
''
,
// TODO: 控制只读
isReadOnly
:
true
,
// 遮罩层
// 遮罩层
loading
:
true
,
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
// 非单个禁用
single
:
true
,
single
:
true
,
// 非多个禁用
// 非多个禁用
multiple
:
true
,
multiple
:
true
,
// 总条数
// 总条数
total
:
0
,
total
:
0
,
//
角色
表格数据
//
设备申请
表格数据
role
List
:
[],
equipmentapply
List
:
[],
// 弹出层标题
// 弹出层标题
title
:
''
,
title
:
''
,
// 是否显示弹出层
// 是否显示弹出层
open
:
false
,
open
:
false
,
// 是否显示弹出层(数据
详情
)
// 是否显示弹出层(数据
权限
)
openD
etails
:
false
,
openD
ataScope
:
false
,
// 日期范围
// 日期范围
// dateRange: [],
// dateRange: [],
// 菜单表格数据
// 菜单表格数据
...
@@ -216,97 +211,79 @@ export default {
...
@@ -216,97 +211,79 @@ export default {
menuNodeAll
:
false
,
menuNodeAll
:
false
,
deptExpand
:
true
,
deptExpand
:
true
,
deptNodeAll
:
false
,
deptNodeAll
:
false
,
// 状态数据字典
statusOptions
:
[
{
dictLabel
:
'是'
,
dictValue
:
'1'
},
{
dictLabel
:
'否'
,
dictValue
:
'0'
}
],
// 数据范围选项
dataScopeOptions
:
[
{
value
:
'1'
,
label
:
'全部数据权限'
},
{
value
:
'2'
,
label
:
'自定数据权限'
},
{
value
:
'3'
,
label
:
'本部门数据权限'
},
{
value
:
'4'
,
label
:
'本部门及以下数据权限'
},
{
value
:
'5'
,
label
:
'仅本人数据权限'
}
],
// 部门列表
tOptions
:
[],
// 查询参数
// 查询参数
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
page
:
1
,
pageSize
:
10
,
rows
:
10
,
deviceName
:
undefined
,
pn
:
undefined
,
deviceId
:
undefined
,
lot
:
undefined
,
LOT
:
undefined
,
plocation
:
undefined
,
location
:
undefined
,
ptype
:
1
ply
:
undefined
,
state
:
undefined
,
flag
:
undefined
},
defaultProps
:
{},
// TODO: 表单参数
form
:
{
deviceName
:
''
,
deviceId
:
''
,
LOT
:
''
,
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
remark
:
''
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
},
// TODO: 表单初始参数
formReset
:
{
deviceName
:
''
,
deviceId
:
''
,
LOT
:
''
,
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
},
},
// TODO: 表单里的单项详情参数
// 表单参数
singleDetails
:
{
form
:
{},
deviceName
:
''
,
defaultProps
:
{
deviceId
:
''
,
children
:
'children'
,
LOT
:
''
,
label
:
'label'
location
:
''
,
ply
:
''
,
state
:
''
,
flag
:
'1'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
''
},
},
// TODO: 模拟测试数据
simulateDeviceList
:
[{
deviceName
:
'设备1'
,
deviceId
:
'0001'
,
flag
:
1
,
LOT
:
'0001'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备2'
,
deviceId
:
'0002'
,
flag
:
2
,
LOT
:
'0002'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备3'
,
deviceId
:
'0003'
,
flag
:
2
,
LOT
:
'0003'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备4'
,
deviceId
:
'0004'
,
flag
:
2
,
LOT
:
'0004'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已驳回'
},
{
deviceName
:
'设备5'
,
deviceId
:
'0005'
,
flag
:
2
,
LOT
:
'0005'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备6'
,
deviceId
:
'0006'
,
flag
:
2
,
LOT
:
'0006'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备7'
,
deviceId
:
'0007'
,
flag
:
2
,
LOT
:
'0007'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备8'
,
deviceId
:
'0008'
,
flag
:
2
,
LOT
:
'0008'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'待审核'
},
{
deviceName
:
'设备9'
,
deviceId
:
'0009'
,
flag
:
2
,
LOT
:
'0009'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已通过'
},
{
deviceName
:
'设备10'
,
deviceId
:
'00010'
,
flag
:
2
,
LOT
:
'0010'
,
location
:
'XXX'
,
ply
:
'YYY'
,
createTime
:
new
Date
(),
updataTime
:
new
Date
(),
createBy
:
'admin'
,
state
:
'已通过'
}
],
// 表单校验
// 表单校验
rules
:
{
rules
:
{
deviceName
:
[
pn
:
[
{
required
:
true
,
message
:
'请输入设备名称'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
ptype
:
[
{
required
:
true
,
message
:
'请输入ptype'
,
trigger
:
'blur'
}
],
pgx
:
[
{
required
:
true
,
message
:
'请输入pgx'
,
trigger
:
'blur'
}
],
prank
:
[
{
required
:
true
,
message
:
'请输入prank'
,
trigger
:
'blur'
}
],
],
deviceId
:
[
pissb
:
[
{
required
:
true
,
message
:
'请输入
设备编码
'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入
pissb
'
,
trigger
:
'blur'
}
],
],
LOT
:
[
psm
:
[
{
required
:
true
,
message
:
'请输入
LOT
'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入
psm
'
,
trigger
:
'blur'
}
],
],
createB
y
:
[
ps
y
:
[
{
required
:
true
,
message
:
'请输入
申请人
'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入
psy
'
,
trigger
:
'blur'
}
]
]
},
},
deptOptions
:
[]
deptOptions
:
[]
...
@@ -329,11 +306,14 @@ export default {
...
@@ -329,11 +306,14 @@ export default {
this
.
queryParams
=
{
...
param
}
this
.
queryParams
=
{
...
param
}
}
}
this
.
getList
()
this
.
getList
()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// });
},
},
methods
:
{
methods
:
{
getFontColor
(
state
)
{
getFontColor
(
state
)
{
if
(
state
===
'已驳回'
)
{
if
(
state
===
1
)
{
return
'
color: red;
'
return
'
已完成
'
}
else
if
(
state
===
'待审核'
)
{
}
else
if
(
state
===
'待审核'
)
{
return
'color: orange;'
return
'color: orange;'
}
else
if
(
state
===
'已通过'
)
{
}
else
if
(
state
===
'已通过'
)
{
...
@@ -342,138 +322,240 @@ export default {
...
@@ -342,138 +322,240 @@ export default {
return
''
return
''
}
}
},
},
/** 查询
角色
列表 */
/** 查询
基础信息
列表 */
getList
()
{
getList
()
{
this
.
loading
=
true
this
.
loading
=
true
this
.
roleList
=
this
.
simulateDeviceList
listWbApply
(
this
.
queryParams
).
then
(
console
.
log
(
this
.
roleList
)
response
=>
{
this
.
loading
=
false
this
.
equipmentapplyList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
}
)
},
/** 查询菜单树结构 */
getMenuTreeselect
()
{
menuTreeselect
().
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
})
},
/** 查询菜单列表 */
getMenuList
(
roleId
)
{
roleMenuTreeselectMC
(
roleId
).
then
(
response
=>
{
this
.
menuList
=
this
.
handleTree
(
response
.
data
.
menus
,
'businessId'
)
this
.
loading
=
false
})
},
/** 查询部门树结构 */
getDeptTreeselect
()
{
deptTreeselect
().
then
(
response
=>
{
this
.
deptOptions
=
response
.
data
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys
()
{
// 目前被选中的菜单节点
const
checkedKeys
=
this
.
$refs
.
menu
.
getHalfCheckedKeys
()
// 半选中的菜单节点
const
halfCheckedKeys
=
this
.
$refs
.
menu
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys
()
{
// 目前被选中的部门节点
const
checkedKeys
=
this
.
$refs
.
dept
.
getHalfCheckedKeys
()
// // 半选中的部门节点
const
halfCheckedKeys
=
this
.
$refs
.
dept
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
this
.
$refs
.
dept
.
getCheckedKeys
()
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect
(
roleId
)
{
return
roleMenuTreeselect
(
roleId
).
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
.
menus
return
response
})
},
/** 根据角色ID和菜单ID查询部门树结构 */
getRoleDeptTreeselect
(
roleId
,
menuId
)
{
return
roleDeptTreeselect
(
roleId
,
menuId
).
then
(
response
=>
{
this
.
form
.
deptCheckStrictly
=
response
.
data
.
deptCheckStrictly
this
.
deptOptions
=
response
.
data
.
depts
this
.
form
.
dataScope
=
this
.
dataScopeOptions
[
response
.
data
.
dataScope
-
1
].
value
return
response
})
},
// 角色状态修改
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认要"'
+
text
+
'""'
+
row
.
roleName
+
'"角色吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
changeRoleStatus
(
row
.
businessId
,
row
.
flag
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
},
// 取消按钮
// 取消按钮
cancel
()
{
cancel
()
{
this
.
open
=
false
this
.
open
=
false
this
.
reset
()
this
.
reset
()
},
},
// 取消按钮(数据权限)
cancelDataScope
()
{
this
.
openDataScope
=
false
this
.
reset
()
},
// 表单重置
// 表单重置
reset
()
{
reset
()
{
// TODO: 将模拟数据的空对象赋值给表单对象,达成清空填写表单的效果
if
(
this
.
$refs
.
menu
!==
undefined
)
{
this
.
$refs
.
menu
.
setCheckedKeys
([])
}
this
.
menuExpand
=
false
this
.
menuNodeAll
=
false
this
.
deptExpand
=
true
this
.
deptNodeAll
=
false
this
.
form
=
{
this
.
form
=
{
deviceName
:
''
,
pn
:
undefined
,
deviceId
:
''
,
ptype
:
undefined
,
location
:
''
,
pgx
:
undefined
,
ply
:
''
,
roleKey
:
undefined
,
state
:
''
,
roleSort
:
0
,
flag
:
'1'
,
flag
:
undefined
,
createTime
:
new
Date
(),
menuIds
:
[],
updataTime
:
new
Date
(),
menuName
:
undefined
,
createBy
:
''
deptIds
:
[],
menuCheckStrictly
:
true
,
deptCheckStrictly
:
true
,
remark
:
undefined
}
}
this
.
resetForm
(
'form'
)
},
},
/**
TODO:
查询按钮操作 */
/** 查询按钮操作 */
handleQuery
()
{
handleQuery
()
{
this
.
queryParams
.
page
Num
=
1
this
.
queryParams
.
page
=
1
this
.
getList
()
this
.
getList
()
},
},
/** TODO: 重置按钮操作 */
/** 重置按钮操作 */
resetQuery
()
{},
resetQuery
()
{
// this.dateRange = []
this
.
resetForm
(
'queryForm'
)
this
.
handleQuery
()
},
// 多选框选中数据
// 多选框选中数据
handleSelectionChange
(
selection
)
{},
handleSelectionChange
(
selection
)
{
/** TODO: 新增按钮操作 */
this
.
ids
=
selection
.
map
(
item
=>
item
.
roleId
)
handleAdd
()
{
this
.
single
=
selection
.
length
!==
1
// TODO: 初始化新增对话框的状态
this
.
multiple
=
!
selection
.
length
this
.
reset
()
this
.
title
=
'申请领用设备'
this
.
open
=
!
this
.
open
},
},
// TODO: 获取所选行详情信息操作
// 树权限(父子联动)
handleDetail
(
row
)
{
handleCheckedTreeConnect
(
value
,
type
)
{
this
.
singleDetails
=
this
.
formReset
if
(
type
===
'menu'
)
{
this
.
singleDetails
=
row
this
.
form
.
menuCheckStrictly
=
!!
value
this
.
title
=
'详情信息'
}
else
if
(
type
===
'dept'
)
{
this
.
openDetails
=
!
this
.
openDetails
this
.
form
.
deptCheckStrictly
=
!!
value
}
},
},
/** TODO: 修改按钮操作 */
// 树权限(全选/全不选)
handleUpdate
(
row
)
{
handleCheckedTreeNodeAll
(
value
,
type
)
{
this
.
reset
()
if
(
type
===
'menu'
)
{
this
.
title
=
'修改申请'
this
.
$refs
.
menu
.
setCheckedNodes
(
value
?
this
.
menuOptions
:
[])
const
upddeviceName
=
row
.
deviceName
}
else
if
(
type
===
'dept'
)
{
for
(
const
pd
of
this
.
simulateDeviceList
)
{
this
.
$refs
.
dept
.
setCheckedNodes
(
value
?
this
.
deptOptions
:
[])
if
(
pd
.
deviceName
===
upddeviceName
)
{
}
this
.
form
=
pd
},
// 树权限(展开/折叠)
handleCheckedTreeExpand
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
const
treeList
=
this
.
menuOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
menu
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
else
if
(
type
===
'dept'
)
{
const
treeList
=
this
.
deptOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
dept
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
}
}
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
getMenuTreeselect
()
this
.
open
=
true
this
.
open
=
true
this
.
title
=
'添加角色'
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
const
roleMenu
=
this
.
getRoleMenuTreeselect
(
roleId
)
getRole
(
roleId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
this
.
getMenuTreeselect
(
roleId
)
this
.
$nextTick
(()
=>
{
roleMenu
.
then
(
res
=>
{
this
.
$refs
.
menu
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'修改角色'
})
},
},
/**
TODO: 修改或增加list列表里的数据
*/
/**
提交按钮
*/
submitForm
:
function
()
{
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
// TODO: 模拟测试数据的修改,可删除
if
(
this
.
form
.
businessId
!==
undefined
)
{
for
(
const
p
of
this
.
simulateDeviceList
)
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
if
(
p
.
deviceName
===
this
.
form
.
deviceName
)
{
// eslint-disable-next-line no-undef
this
.
simulateDeviceList
=
this
.
simulateDeviceList
.
map
(
obj
=>
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
obj
.
deviceName
===
this
.
form
.
deviceName
?
this
.
form
:
obj
this
.
msgSuccess
(
'修改成功'
)
)
this
.
open
=
false
this
.
msgSuccess
(
'申请成功'
)
this
.
getList
()
this
.
getList
()
this
.
reset
()
})
this
.
open
=
!
this
.
open
}
else
{
return
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
}
else
{
// eslint-disable-next-line no-undef
if
(
this
.
form
!==
undefined
&&
this
.
form
!==
null
)
{
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
simulateDeviceList
.
push
(
this
.
form
)
this
.
msgSuccess
(
'新增成功'
)
this
.
msgSuccess
(
'申请成功'
)
this
.
open
=
false
this
.
getList
()
this
.
getList
()
this
.
reset
()
})
this
.
open
=
!
this
.
open
return
}
}
}
}
}
}
})
})
},
},
/** 删除按钮操作 */
/** TODO: 关于模拟数据的 删除list数组所调用的删除方法,封装的函数如下 */
delDevice
(
delDeviceName
)
{
let
tip
=
false
for
(
const
pd0
of
this
.
simulateDeviceList
)
{
console
.
log
(
'This is pd0:'
,
pd0
)
if
(
pd0
.
deviceName
===
delDeviceName
)
{
this
.
simulateDeviceList
=
this
.
simulateDeviceList
.
filter
(
item
=>
item
.
deviceName
!==
delDeviceName
)
tip
=
true
break
}
}
return
tip
},
/** TODO:删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
this
.
$confirm
(
'是否确认操作?'
,
'提示'
,
{
const
roleIds
=
row
.
businessId
||
this
.
ids
this
.
$confirm
(
'所选择数据被删除后不可再恢复,是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(
()
=>
{
}).
then
(
function
()
{
return
this
.
delDevice
(
row
.
deviceName
)
return
delRole
(
roleIds
)
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
getList
()
this
.
getList
()
this
.
$message
({
this
.
$message
({
message
:
'删除成功'
,
message
:
'删除成功'
,
type
:
'success'
type
:
'success'
})
})
}).
catch
(()
=>
{
}).
catch
(
function
()
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消删除'
})
})
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.app-container
{
.app-container
{
font-size
:
18px
;
font-size
:
18px
;
padding
:
0
;
padding
:
0
;
...
@@ -498,20 +580,4 @@ export default {
...
@@ -498,20 +580,4 @@ export default {
height
:
12em
;
height
:
12em
;
width
:
4px
;
width
:
4px
;
}
}
.aboutSingleDetails
{
.el-form-item
{
.el-input
>>>
.el-input__inner
{
-webkit-appearance
:
none
;
background-color
:
#FFF
;
background-image
:
none
;
border-radius
:
4px
;
border
:
0
;
width
:
100%
;
}
}
}
</
style
>
</
style
>
src/views/processManagement/draw.vue
0 → 100644
View file @
0db3a86a
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model=
"queryParams.pn"
placeholder=
"请输入pn"
clearable
:maxlength=
"30"
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"phd"
prop=
"phd"
>
<el-input
v-model=
"queryParams.phd"
placeholder=
"请输入phd"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input
v-model=
"queryParams.prank"
placeholder=
"请输入prank"
clearable
size=
"small"
style=
"width: 150px"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-search"
size=
"small"
@
click=
"handleQuery"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"padding: 8px 7px;"
icon=
"el-icon-refresh"
size=
"small"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<div
class=
"placeholder"
/>
<div
style=
"padding:5px 10px"
>
<div
class=
"mb12 font-small-bold"
>
设备领用信息列表
</div>
<el-table
v-loading=
"loading"
border
:data=
"equipmentapplyList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"pn"
prop=
"pn"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
pn
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"phd"
prop=
"phd"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
phd
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"prank"
prop=
"prank"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
prank
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pgx"
prop=
"pgx"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pgx
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pissb"
prop=
"pissb"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pissb
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"pstatus"
prop=
"pstatus"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
pstatus
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"ptype"
prop=
"ptype"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
ptype
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
prop=
"pstatus"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.pstatus === '0'"
style=
"color: red"
>
未完成
</span>
<span
v-else
style=
"color: green"
>
已完成
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作员"
prop=
"createBy"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createBy
||
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作时间"
:show-overflow-tooltip=
"true"
align=
"center"
prop=
"createTime"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createTime
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"150px"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.page"
:limit
.
sync=
"queryParams.rows"
@
pagination=
"getList"
/>
<!-- 添加或修改设备基本信息配置对话框 -->
<el-dialog
title=
"设备基本信息"
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"80px"
>
<el-form-item
label=
"pn"
prop=
"pn"
>
<el-input
v-model
.
trim=
"form.pn"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入pn"
/>
</el-form-item>
<el-form-item
label=
"ptype"
prop=
"ptype"
>
<el-input
v-model
.
trim=
"form.ptype"
show-word-limit
:maxlength=
"30"
placeholder=
"请输入ptype"
/>
</el-form-item>
<el-form-item
label=
"pgx"
prop=
"pgx"
>
<el-input-number
v-model=
"form.pgx"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入pgx"
/>
</el-form-item>
<el-form-item
label=
"prank"
prop=
"prank"
>
<el-input-number
v-model=
"form.prank"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入prank"
/>
</el-form-item>
<el-form-item
label=
"pissb"
prop=
"pissb"
>
<el-select
v-model=
"form.pissb"
placeholder=
"请选择pissb"
clearable
size=
"small"
style=
"width: 150px"
>
<el-option
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"psm"
prop=
"psm"
>
<el-input-number
v-model=
"form.psm"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psm"
/>
</el-form-item>
<el-form-item
label=
"psy"
prop=
"psy"
>
<el-input-number
v-model=
"form.psy"
style=
"width: 100%"
controls-position=
"right"
:min=
"0"
placeholder=
"请输入psy"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
// import {
// addRole,
// changeRoleStatus,
// dataScope,
// delRole,
// exportRole,
// getRole,
// listBasicInfo,
// updateRole
// } from '@/api/equipment/basicInfo'
import
{
roleMenuTreeselect
,
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
}
from
'@/api/system/menu'
import
{
roleDeptTreeselect
,
treeselect
as
deptTreeselect
}
from
'@/api/system/dept'
import
{
listBasicInfo
}
from
'@/api/equipment/basicInfo'
import
{
listWbApply
}
from
'@/api/equipment/draw'
// import { getRolesByInsId } from '../../../api/businessManage/template'
export
default
{
name
:
'Role'
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 总条数
total
:
0
,
// 设备申请表格数据
equipmentapplyList
:
[],
// 弹出层标题
title
:
''
,
// 是否显示弹出层
open
:
false
,
// 是否显示弹出层(数据权限)
openDataScope
:
false
,
// 日期范围
// dateRange: [],
// 菜单表格数据
menuList
:
[],
menuExpand
:
false
,
menuNodeAll
:
false
,
deptExpand
:
true
,
deptNodeAll
:
false
,
// 状态数据字典
statusOptions
:
[
{
dictLabel
:
'是'
,
dictValue
:
'1'
},
{
dictLabel
:
'否'
,
dictValue
:
'0'
}
],
// 数据范围选项
dataScopeOptions
:
[
{
value
:
'1'
,
label
:
'全部数据权限'
},
{
value
:
'2'
,
label
:
'自定数据权限'
},
{
value
:
'3'
,
label
:
'本部门数据权限'
},
{
value
:
'4'
,
label
:
'本部门及以下数据权限'
},
{
value
:
'5'
,
label
:
'仅本人数据权限'
}
],
// 部门列表
tOptions
:
[],
// 查询参数
queryParams
:
{
page
:
1
,
rows
:
10
,
pn
:
undefined
,
lot
:
undefined
,
plocation
:
undefined
,
ptype
:
2
},
// 表单参数
form
:
{},
defaultProps
:
{
children
:
'children'
,
label
:
'label'
},
// 表单校验
rules
:
{
pn
:
[
{
required
:
true
,
message
:
'请输入pn'
,
trigger
:
'blur'
}
],
ptype
:
[
{
required
:
true
,
message
:
'请输入ptype'
,
trigger
:
'blur'
}
],
pgx
:
[
{
required
:
true
,
message
:
'请输入pgx'
,
trigger
:
'blur'
}
],
prank
:
[
{
required
:
true
,
message
:
'请输入prank'
,
trigger
:
'blur'
}
],
pissb
:
[
{
required
:
true
,
message
:
'请输入pissb'
,
trigger
:
'blur'
}
],
psm
:
[
{
required
:
true
,
message
:
'请输入psm'
,
trigger
:
'blur'
}
],
psy
:
[
{
required
:
true
,
message
:
'请输入psy'
,
trigger
:
'blur'
}
]
},
deptOptions
:
[]
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
this
.
$store
.
dispatch
(
'searchSave/searchParamsSet'
,
{
path
:
this
.
$route
.
path
,
param
:
{
...
this
.
queryParams
}
})
next
()
},
created
()
{
if
(
this
.
$store
.
getters
.
searchParams
[
this
.
$route
.
path
])
{
const
{
searchParams
}
=
this
.
$store
.
getters
;
const
{
path
}
=
this
.
$route
const
param
=
JSON
.
parse
(
searchParams
[
path
])
// 保留着的查询条件
this
.
queryParams
=
{
...
param
}
}
this
.
getList
()
// this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
// this.statusOptions = response.data;
// });
},
methods
:
{
getFontColor
(
state
)
{
if
(
state
===
1
)
{
return
'已完成'
}
else
if
(
state
===
'待审核'
)
{
return
'color: orange;'
}
else
if
(
state
===
'已通过'
)
{
return
'color: green;'
}
else
{
return
''
}
},
/** 查询基础信息列表 */
getList
()
{
this
.
loading
=
true
listWbApply
(
this
.
queryParams
).
then
(
response
=>
{
this
.
equipmentapplyList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
}
)
},
/** 查询菜单树结构 */
getMenuTreeselect
()
{
menuTreeselect
().
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
})
},
/** 查询菜单列表 */
getMenuList
(
roleId
)
{
roleMenuTreeselectMC
(
roleId
).
then
(
response
=>
{
this
.
menuList
=
this
.
handleTree
(
response
.
data
.
menus
,
'businessId'
)
this
.
loading
=
false
})
},
/** 查询部门树结构 */
getDeptTreeselect
()
{
deptTreeselect
().
then
(
response
=>
{
this
.
deptOptions
=
response
.
data
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys
()
{
// 目前被选中的菜单节点
const
checkedKeys
=
this
.
$refs
.
menu
.
getHalfCheckedKeys
()
// 半选中的菜单节点
const
halfCheckedKeys
=
this
.
$refs
.
menu
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys
()
{
// 目前被选中的部门节点
const
checkedKeys
=
this
.
$refs
.
dept
.
getHalfCheckedKeys
()
// // 半选中的部门节点
const
halfCheckedKeys
=
this
.
$refs
.
dept
.
getCheckedKeys
()
checkedKeys
.
unshift
.
apply
(
checkedKeys
,
halfCheckedKeys
)
return
this
.
$refs
.
dept
.
getCheckedKeys
()
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect
(
roleId
)
{
return
roleMenuTreeselect
(
roleId
).
then
(
response
=>
{
this
.
menuOptions
=
response
.
data
.
menus
return
response
})
},
/** 根据角色ID和菜单ID查询部门树结构 */
getRoleDeptTreeselect
(
roleId
,
menuId
)
{
return
roleDeptTreeselect
(
roleId
,
menuId
).
then
(
response
=>
{
this
.
form
.
deptCheckStrictly
=
response
.
data
.
deptCheckStrictly
this
.
deptOptions
=
response
.
data
.
depts
this
.
form
.
dataScope
=
this
.
dataScopeOptions
[
response
.
data
.
dataScope
-
1
].
value
return
response
})
},
// 角色状态修改
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
this
.
$confirm
(
'确认要"'
+
text
+
'""'
+
row
.
roleName
+
'"角色吗?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
changeRoleStatus
(
row
.
businessId
,
row
.
flag
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
// 取消按钮
cancel
()
{
this
.
open
=
false
this
.
reset
()
},
// 取消按钮(数据权限)
cancelDataScope
()
{
this
.
openDataScope
=
false
this
.
reset
()
},
// 表单重置
reset
()
{
if
(
this
.
$refs
.
menu
!==
undefined
)
{
this
.
$refs
.
menu
.
setCheckedKeys
([])
}
this
.
menuExpand
=
false
this
.
menuNodeAll
=
false
this
.
deptExpand
=
true
this
.
deptNodeAll
=
false
this
.
form
=
{
pn
:
undefined
,
ptype
:
undefined
,
pgx
:
undefined
,
roleKey
:
undefined
,
roleSort
:
0
,
flag
:
undefined
,
menuIds
:
[],
menuName
:
undefined
,
deptIds
:
[],
menuCheckStrictly
:
true
,
deptCheckStrictly
:
true
,
remark
:
undefined
}
this
.
resetForm
(
'form'
)
},
/** 查询按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
// this.dateRange = []
this
.
resetForm
(
'queryForm'
)
this
.
handleQuery
()
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
roleId
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
// 树权限(父子联动)
handleCheckedTreeConnect
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
this
.
form
.
menuCheckStrictly
=
!!
value
}
else
if
(
type
===
'dept'
)
{
this
.
form
.
deptCheckStrictly
=
!!
value
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
this
.
$refs
.
menu
.
setCheckedNodes
(
value
?
this
.
menuOptions
:
[])
}
else
if
(
type
===
'dept'
)
{
this
.
$refs
.
dept
.
setCheckedNodes
(
value
?
this
.
deptOptions
:
[])
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand
(
value
,
type
)
{
if
(
type
===
'menu'
)
{
const
treeList
=
this
.
menuOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
menu
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
else
if
(
type
===
'dept'
)
{
const
treeList
=
this
.
deptOptions
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
dept
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
}
}
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
()
this
.
getMenuTreeselect
()
this
.
open
=
true
this
.
title
=
'添加角色'
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
()
const
roleId
=
row
.
businessId
||
this
.
ids
const
roleMenu
=
this
.
getRoleMenuTreeselect
(
roleId
)
getRole
(
roleId
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
open
=
true
this
.
getMenuTreeselect
(
roleId
)
this
.
$nextTick
(()
=>
{
roleMenu
.
then
(
res
=>
{
this
.
$refs
.
menu
.
setCheckedKeys
(
res
.
data
.
checkedKeys
)
})
})
this
.
title
=
'修改角色'
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
businessId
!==
undefined
)
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
updateBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'修改成功'
)
this
.
open
=
false
this
.
getList
()
})
}
else
{
this
.
form
.
menuIds
=
this
.
getMenuAllCheckedKeys
()
// eslint-disable-next-line no-undef
addBasicInfo
(
this
.
form
).
then
(
response
=>
{
this
.
msgSuccess
(
'新增成功'
)
this
.
open
=
false
this
.
getList
()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
roleIds
=
row
.
businessId
||
this
.
ids
this
.
$confirm
(
'所选择数据被删除后不可再恢复,是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
delRole
(
roleIds
)
}).
then
(()
=>
{
this
.
getList
()
this
.
$message
({
message
:
'删除成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
font-size
:
18px
;
padding
:
0
;
.placeholder
{
height
:
1
.3vh
;
background-color
:
#F4F4F4
;
margin-bottom
:
10px
}
.table-drop
{
vertical-align
:
2px
;
line-height
:
20px
;
margin-left
:
15px
}
.el-switch
{
margin-left
:
15px
;
}
}
.el-divider--vertical
{
height
:
12em
;
width
:
4px
;
}
</
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