Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 95d23b6c
authored
May 18, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改批量员工接口
1 parent
68839c5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
src/api/modules/employee.js
src/views/employee/index.vue
src/api/modules/employee.js
View file @
95d23b6
...
@@ -125,8 +125,8 @@ const updateStatusApi = params => {
...
@@ -125,8 +125,8 @@ const updateStatusApi = params => {
}
}
// 批量更新员工角色
// 批量更新员工角色
const
update
StaffRoleBatch
=
params
=>
{
const
add
StaffRoleBatch
=
params
=>
{
params
.
method
=
`
${
defaultPath
}
staff.
update
StaffRoleBatch`
params
.
method
=
`
${
defaultPath
}
staff.
add
StaffRoleBatch`
return
http
({
return
http
({
url
:
'rop-merchants/router'
,
url
:
'rop-merchants/router'
,
method
:
'POST'
,
method
:
'POST'
,
...
@@ -146,4 +146,4 @@ const updateStatusBatch = params => {
...
@@ -146,4 +146,4 @@ const updateStatusBatch = params => {
})
})
}
}
export
default
{
getListApi
,
getAllMerchantListApi
,
getRoleListApi
,
getAllDictApi
,
getMerchantTreeApi
,
getDetailInfoApi
,
getDetailLogApi
,
addEmployeeApi
,
updateEmployeeApi
,
deleteEmployeeApi
,
exportEmployeeApi
,
updateStatusApi
,
update
StaffRoleBatch
,
updateStatusBatch
}
export
default
{
getListApi
,
getAllMerchantListApi
,
getRoleListApi
,
getAllDictApi
,
getMerchantTreeApi
,
getDetailInfoApi
,
getDetailLogApi
,
addEmployeeApi
,
updateEmployeeApi
,
deleteEmployeeApi
,
exportEmployeeApi
,
updateStatusApi
,
add
StaffRoleBatch
,
updateStatusBatch
}
src/views/employee/index.vue
View file @
95d23b6
...
@@ -530,7 +530,6 @@ export default {
...
@@ -530,7 +530,6 @@ export default {
})
})
},
},
batch
(
type
)
{
batch
(
type
)
{
console
.
log
(
handleObj
[
type
]);
const
name
=
handleObj
[
type
]
const
name
=
handleObj
[
type
]
const
selectArr
=
this
.
$refs
.
employeeRef
.
mutiSelectArr
[
this
.
tableParams1
.
mutiSelectName
]
const
selectArr
=
this
.
$refs
.
employeeRef
.
mutiSelectArr
[
this
.
tableParams1
.
mutiSelectName
]
if
(
!
selectArr
.
length
)
{
if
(
!
selectArr
.
length
)
{
...
@@ -548,12 +547,15 @@ export default {
...
@@ -548,12 +547,15 @@ export default {
this
.
roleVisible
=
true
this
.
roleVisible
=
true
}
}
}
else
if
(
name
==
'启用'
)
{
}
else
if
(
name
==
'启用'
)
{
this
.
$confirm
(
`是否将选中的账号批量进行启用?`
,
''
,
{
const
hasNoRole
=
selectArr
.
some
(
item
=>
!
item
.
roleName
)
if
(
hasNoRole
)
{
this
.
$message
.
error
(
'您选中的员工中包含未设置“角色”账号,请去除选中未设置“角色”员工账号。'
)
}
else
{
this
.
$confirm
(
`是否将选中的账号批量进行启用?`
,
''
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
console
.
log
(
'点击了确定'
)
const
list
=
selectArr
.
map
(
item
=>
{
const
list
=
selectArr
.
map
(
item
=>
{
return
{
return
{
staffId
:
item
.
id
,
staffId
:
item
.
id
,
...
@@ -574,6 +576,7 @@ export default {
...
@@ -574,6 +576,7 @@ export default {
}).
catch
(()
=>
{
}).
catch
(()
=>
{
console
.
log
(
'点击了取消'
)
console
.
log
(
'点击了取消'
)
})
})
}
}
}
},
},
...
@@ -582,18 +585,20 @@ export default {
...
@@ -582,18 +585,20 @@ export default {
this
.
$refs
.
roleForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
roleForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
const
{
roleId
}
=
this
.
roleForm
const
{
roleId
}
=
this
.
roleForm
let
list
=
this
.
$refs
.
employeeRef
.
mutiSelectArr
[
this
.
tableParams1
.
mutiSelectName
]
let
staffIds
=
this
.
$refs
.
employeeRef
.
mutiSelectArr
[
this
.
tableParams1
.
mutiSelectName
]
list
=
list
.
map
(
item
=>
{
staffIds
=
staffIds
.
map
(
item
=>
item
.
id
)
return
{
// list = list.map(item => {
staffId
:
item
.
id
,
// return {
roleId
// staffId: item.id
}
// roleId,
})
// }
// })
const
param
=
{
const
param
=
{
list
roleId
,
staffIds
}
}
console
.
log
(
param
)
console
.
log
(
param
)
this
.
$apis
.
employee
.
update
StaffRoleBatch
(
param
).
then
(
res
=>
{
this
.
$apis
.
employee
.
add
StaffRoleBatch
(
param
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
)
{
if
(
res
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
$message
.
success
(
'操作成功'
)
...
@@ -609,6 +614,8 @@ export default {
...
@@ -609,6 +614,8 @@ export default {
},
},
handleClose
()
{
handleClose
()
{
this
.
roleVisible
=
false
this
.
roleVisible
=
false
this
.
roleForm
=
{}
this
.
$refs
.
roleForm
.
resetFields
()
},
},
// 表格分页穿透事件
// 表格分页穿透事件
paginationlisteners
(
val
)
{
paginationlisteners
(
val
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment