Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
office-web
Overview
Overview
Details
Activity
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
office
office-web
Commits
2fbe23d0
Commit
2fbe23d0
authored
Jan 14, 2019
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 增加成员编辑
parent
96e4633f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
13 deletions
+44
-13
addAdmin.vue
src/views/setting/addAdmin.vue
+29
-10
setChildAdmin.vue
src/views/setting/setChildAdmin.vue
+15
-3
No files found.
src/views/setting/addAdmin.vue
View file @
2fbe23d0
...
@@ -7,16 +7,16 @@
...
@@ -7,16 +7,16 @@
<el-form-item
label=
"管理员角色"
prop=
"roleName"
class=
""
>
<el-form-item
label=
"管理员角色"
prop=
"roleName"
class=
""
>
<el-input
v-model=
"ruleForm.roleName"
disabled
placeholder=
""
class=
"w-380"
></el-input>
<el-input
v-model=
"ruleForm.roleName"
disabled
placeholder=
""
class=
"w-380"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"选择人员
"
prop=
"name"
class=
""
>
<el-form-item
:label=
"ruleForm.userId?'' : '选择人员'
"
prop=
"name"
class=
""
>
<div
class=
"flex w-380 flex-wrap"
>
<div
class=
"flex w-380 flex-wrap"
>
<template
v-for=
"(item,index) in ruleForm.peopleList"
>
<template
v-for=
"(item,index) in ruleForm.peopleList"
>
<div
class=
"people-cell"
>
<div
class=
"people-cell"
:key=
"index + item.name"
>
<img
:src=
"item.headPic"
/>
<img
:src=
"item.headPic"
/>
<p>
{{
item
.
name
}}
</p>
<p>
{{
item
.
name
}}
</p>
<i
class=
"el-icon-circle-close"
@
click
.
stop=
"delField(index,item,ruleForm.peopleList)"
></i>
<i
class=
"el-icon-circle-close"
v-if=
"!ruleForm.userId"
@
click
.
stop=
"delField(index,item,ruleForm.peopleList)"
></i>
</div>
</div>
</
template
>
</
template
>
<div
class=
"people-cell"
>
<div
class=
"people-cell"
v-if=
"!ruleForm.userId"
>
<span
class=
"add-icon"
@
click
.
stop=
"showDialogLayer('people',ruleForm.peopleList)"
><i
class=
"el-icon-plus"
></i></span>
<span
class=
"add-icon"
@
click
.
stop=
"showDialogLayer('people',ruleForm.peopleList)"
><i
class=
"el-icon-plus"
></i></span>
</div>
</div>
</div>
</div>
...
@@ -46,9 +46,9 @@
...
@@ -46,9 +46,9 @@
<el-select
v-model=
"ruleForm.brandValue"
multiple
placeholder=
"请选择"
>
<el-select
v-model=
"ruleForm.brandValue"
multiple
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"item in ruleForm.brandOptions"
v-for=
"item in ruleForm.brandOptions"
:key=
"item.
brand
Id"
:key=
"item.
group
Id"
:label=
"item.name"
:label=
"item.name"
:value=
"item.
brand
Id"
>
:value=
"item.
group
Id"
>
</el-option>
</el-option>
</el-select>
</el-select>
</div>
</div>
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
class=
"m-t-24"
>
<el-form-item
class=
"m-t-24"
>
<el-button
type=
"primary"
v-if=
"!ruleForm.userId"
@
click=
"submitForm('ruleForm')"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
保存
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
...
@@ -191,7 +191,13 @@ export default {
...
@@ -191,7 +191,13 @@ export default {
});
});
that
.
ruleForm
.
brandValue
.
forEach
(
function
(
item
){
that
.
ruleForm
.
brandValue
.
forEach
(
function
(
item
){
// 品牌只有 brandId 无 storeId , 如:['57b303dff06c4e758e26951f5e9c5e97']
// 品牌只有 brandId 无 storeId , 如:['57b303dff06c4e758e26951f5e9c5e97']
data
.
push
({
storeId
:
item
.
storeId
?
item
.
storeId
:
item
});
// 如果是企业管理员
if
(
that
.
ruleForm
.
roleCode
===
'admin'
)
{
data
.
push
({
groupId
:
item
});
}
else
{
// 如果是子管理员
item
.
storeId
?
data
.
push
({
storeId
:
item
.
storeId
})
:
data
.
push
({
groupId
:
item
.
groupId
});
}
});
});
let
clerks
=
(
that
.
ruleForm
.
peopleList
.
map
(
item
=>
item
.
employeeClerkId
)).
join
(
','
);
let
clerks
=
(
that
.
ruleForm
.
peopleList
.
map
(
item
=>
item
.
employeeClerkId
)).
join
(
','
);
that
.
postSave
(
data
,
clerks
);
that
.
postSave
(
data
,
clerks
);
...
@@ -426,7 +432,20 @@ export default {
...
@@ -426,7 +432,20 @@ export default {
let
resData
=
res
.
data
;
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
if
(
resData
.
errorCode
==
1
)
{
if
(
!!
resData
.
result
)
{
if
(
!!
resData
.
result
)
{
that
.
ruleForm
.
peopleList
=
[
resData
.
result
.
user
];
resData
.
result
.
admList
.
forEach
(
function
(
ele
,
index
){
ele
.
id
=
ele
.
groupId
;
ele
.
label
=
ele
.
name
;
})
that
.
ruleForm
.
departList
=
resData
.
result
.
admList
||
[];
resData
.
result
.
storeList
.
forEach
(
function
(
ele
,
index
){
ele
.
id
=
ele
.
groupId
?
ele
.
groupId
:
ele
.
storeId
;
ele
.
label
=
ele
.
name
;
})
that
.
ruleForm
.
brandValue
=
that
.
ruleForm
.
roleCode
===
'admin'
?
resData
.
result
.
storeList
.
map
(
item
=>
item
.
groupId
):
(
resData
.
result
.
storeList
||
[]);
console
.
log
(
that
.
ruleForm
)
}
else
{
}
else
{
that
.
$message
.
error
({
that
.
$message
.
error
({
duration
:
1000
,
duration
:
1000
,
...
@@ -473,11 +492,11 @@ export default {
...
@@ -473,11 +492,11 @@ export default {
path
:
'/setChildAdmin'
path
:
'/setChildAdmin'
},
},
{
{
name
:
'
查看
成员'
,
name
:
'
编辑
成员'
,
path
:
''
path
:
''
}
}
]
]
//
that.getUserData()
that
.
getUserData
()
}
}
},
},
components
:
{
components
:
{
...
...
src/views/setting/setChildAdmin.vue
View file @
2fbe23d0
...
@@ -49,8 +49,14 @@
...
@@ -49,8 +49,14 @@
<el-table-column
<el-table-column
label=
"操作"
>
label=
"操作"
>
<template
slot-scope=
"scope"
v-if=
"scope.row.canEdit == 1"
>
<template
slot-scope=
"scope"
v-if=
"scope.row.canEdit == 1"
>
<el-button
@
click=
"handleShow(scope.$index,scope.row,roleRightObj.roleCode)"
type=
"text"
size=
"small"
>
查看
</el-button>
<el-button
<el-button
@
click=
"handleDel(scope.$index,scope.row)"
type=
"text"
size=
"small"
>
删除
</el-button>
@
click=
"handleShow(scope.$index,scope.row,roleRightObj.roleCode)"
type=
"text"
size=
"small"
>
编辑
</el-button>
<el-button
@
click=
"handleDel(scope.$index,scope.row)"
type=
"text"
size=
"small"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -183,7 +189,13 @@ export default {
...
@@ -183,7 +189,13 @@ export default {
*/
*/
handleDel
(
index
,
item
)
{
handleDel
(
index
,
item
)
{
const
that
=
this
;
const
that
=
this
;
that
.
postDelUser
(
item
.
userId
,
index
);
that
.
$alert
(
'确定要删除?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
}).
then
(({
value
})
=>
{
that
.
postDelUser
(
item
.
userId
,
index
);
}).
catch
(()
=>
{
});
},
},
postDelUser
(
userId
,
index
)
{
postDelUser
(
userId
,
index
)
{
...
...
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