Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
2b179a73
Commit
2b179a73
authored
May 11, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
00ded4f2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
3 deletions
+105
-3
bpo-admin/app/base/controller/impl/departmentCtl.js
+4
-0
bpo-admin/app/base/controller/impl/userCtl.js
+24
-0
bpo-admin/app/base/service/impl/userSve.js
+8
-1
bpo-admin/app/front/vues/pages/usercenter/usercenter.html
+30
-0
bpo-admin/app/front/vues/pages/usercenter/usercenter.js
+39
-2
No files found.
bpo-admin/app/base/controller/impl/departmentCtl.js
View file @
2b179a73
...
@@ -7,6 +7,10 @@ class DepartmentCtl extends CtlBase {
...
@@ -7,6 +7,10 @@ class DepartmentCtl extends CtlBase {
super
(
CtlBase
.
getServiceName
(
DepartmentCtl
));
super
(
CtlBase
.
getServiceName
(
DepartmentCtl
));
}
}
async
dict
(
queryobj
,
qobj
,
req
)
{
let
list
=
await
this
.
service
.
dict
();
return
system
.
getResult2
(
list
);
}
}
}
module
.
exports
=
DepartmentCtl
;
module
.
exports
=
DepartmentCtl
;
bpo-admin/app/base/controller/impl/userCtl.js
View file @
2b179a73
...
@@ -212,6 +212,8 @@ class UserCtl extends CtlBase {
...
@@ -212,6 +212,8 @@ class UserCtl extends CtlBase {
isAdmin
:
req
.
session
.
user
.
isAdmin
,
isAdmin
:
req
.
session
.
user
.
isAdmin
,
statAuth
:
req
.
session
.
user
.
isBpoManager
||
req
.
session
.
user
.
isAdmin
,
statAuth
:
req
.
session
.
user
.
isBpoManager
||
req
.
session
.
user
.
isAdmin
,
roles
:
req
.
session
.
user
.
Roles
,
roles
:
req
.
session
.
user
.
Roles
,
utype
:
req
.
session
.
user
.
utype
,
department_id
:
req
.
session
.
user
.
department_id
,
}
}
return
system
.
getResult2
(
tmp
,
req
);
return
system
.
getResult2
(
tmp
,
req
);
}
else
{
}
else
{
...
@@ -251,6 +253,8 @@ class UserCtl extends CtlBase {
...
@@ -251,6 +253,8 @@ class UserCtl extends CtlBase {
isAdmin
:
existedUser
.
isAdmin
,
isAdmin
:
existedUser
.
isAdmin
,
statAuth
:
existedUser
.
isBpoManager
||
existedUser
.
isAdmin
,
statAuth
:
existedUser
.
isBpoManager
||
existedUser
.
isAdmin
,
roles
:
existedUser
.
Roles
,
roles
:
existedUser
.
Roles
,
utype
:
existedUser
.
utype
,
department_id
:
existedUser
.
department_id
,
}
}
return
system
.
getResult2
(
tmp
,
req
);
return
system
.
getResult2
(
tmp
,
req
);
}
}
...
@@ -325,6 +329,26 @@ class UserCtl extends CtlBase {
...
@@ -325,6 +329,26 @@ class UserCtl extends CtlBase {
return
system
.
getResult2
(
user
);
return
system
.
getResult2
(
user
);
}
}
async
setDepartment
(
qobj
,
pobj
,
req
)
{
let
loginUser
=
req
.
session
.
user
;
let
user
=
await
this
.
service
.
findById
(
loginUser
.
id
);
if
(
user
.
department_id
)
{
return
system
.
getErrResult2
(
"您已经设置过,不允许重复设置"
);
}
let
departmentId
=
Number
(
pobj
.
department_id
||
0
);
let
department
=
await
this
.
departmentSve
.
findById
(
departmentId
);
if
(
!
department
)
{
return
system
.
getErrResult2
(
"部门不存在"
);
}
user
.
department_id
=
departmentId
;
await
user
.
save
();
loginUser
.
department_id
=
departmentId
;
loginUser
.
department
=
department
;
req
.
session
.
user
=
loginUser
;
return
system
.
getResult2
(
1
);
}
async
login
(
qobj
,
pobj
,
req
)
{
async
login
(
qobj
,
pobj
,
req
)
{
//state为p_app表中appkey
//state为p_app表中appkey
pobj
.
u
.
password
=
super
.
encryptPasswd
(
pobj
.
u
.
password
);
pobj
.
u
.
password
=
super
.
encryptPasswd
(
pobj
.
u
.
password
);
...
...
bpo-admin/app/base/service/impl/userSve.js
View file @
2b179a73
...
@@ -9,6 +9,7 @@ class UserService extends ServiceBase {
...
@@ -9,6 +9,7 @@ class UserService extends ServiceBase {
this
.
pConfigDao
=
system
.
getObject
(
"db.pconfigDao"
);
this
.
pConfigDao
=
system
.
getObject
(
"db.pconfigDao"
);
this
.
roleDao
=
system
.
getObject
(
"db.roleDao"
);
this
.
roleDao
=
system
.
getObject
(
"db.roleDao"
);
this
.
usereaccountDao
=
system
.
getObject
(
"db.usereaccountDao"
);
this
.
usereaccountDao
=
system
.
getObject
(
"db.usereaccountDao"
);
this
.
departmentDao
=
system
.
getObject
(
"db.departmentDao"
);
}
}
async
aftercreate
(
result
,
u
,
t
)
{
async
aftercreate
(
result
,
u
,
t
)
{
...
@@ -315,6 +316,8 @@ class UserService extends ServiceBase {
...
@@ -315,6 +316,8 @@ class UserService extends ServiceBase {
});
});
}
}
async
getUserByUserNamePwd
(
idobj
)
{
async
getUserByUserNamePwd
(
idobj
)
{
return
await
this
.
model
.
findOne
({
where
:{
id
:
id
},
include
:[],
raw
:
true
});
var
u
=
await
this
.
dao
.
model
.
findOne
({
var
u
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
where
:
{
userName
:
idobj
.
userName
,
userName
:
idobj
.
userName
,
...
@@ -324,8 +327,12 @@ class UserService extends ServiceBase {
...
@@ -324,8 +327,12 @@ class UserService extends ServiceBase {
model
:
this
.
db
.
models
.
role
,
model
:
this
.
db
.
models
.
role
,
as
:
"Roles"
,
as
:
"Roles"
,
attributes
:
[
"id"
,
"code"
]
attributes
:
[
"id"
,
"code"
]
},
]
},],
raw
:
true
});
});
if
(
u
&&
u
.
department_id
)
{
u
.
department
=
await
this
.
departmentDao
.
findById
(
u
.
department_id
);
}
return
u
;
return
u
;
}
}
async
findPartnerUser
(
userName
)
{
async
findPartnerUser
(
userName
)
{
...
...
bpo-admin/app/front/vues/pages/usercenter/usercenter.html
View file @
2b179a73
...
@@ -26,6 +26,18 @@
...
@@ -26,6 +26,18 @@
</span>
</span>
<a
@
click=
"dialogFormVisible = true"
href=
"javascript:;"
style=
"float: left;text-decoration: none;color:#59C1A6;font-size: 16px;"
>
修改
</a>
<a
@
click=
"dialogFormVisible = true"
href=
"javascript:;"
style=
"float: left;text-decoration: none;color:#59C1A6;font-size: 16px;"
>
修改
</a>
</div>
</div>
<div
v-if=
"companyForm.user.utype == 1"
style=
"clear:both;line-height: 30px;padding-top: 40px;"
>
<span
style=
"float:left;color: #38404B;font-size: 16px;width:80px;"
>
所属部门
</span>
<span
v-if=
"companyForm.user.department"
style=
"float:left;padding-left: 80px;color: #38404B;font-size: 16px;width: 350px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
>
{{companyForm.user.department.name}}
</span>
<span
v-if=
"!companyForm.user.department"
style=
"float:left;padding-left: 80px;color: #38404B;font-size: 16px;width: 350px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
>
无
</span>
<a
v-if=
"!companyForm.user.department"
@
click=
"show_department = true"
href=
"javascript:;"
style=
"float: left;text-decoration: none;color:#59C1A6;font-size: 16px;"
>
填写
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -53,4 +65,21 @@
...
@@ -53,4 +65,21 @@
<el-button
type=
"primary"
@
click=
"save()"
>
保存修改
</el-button>
<el-button
type=
"primary"
@
click=
"save()"
>
保存修改
</el-button>
</div>
</div>
</el-dialog>
</el-dialog>
<el-dialog
width=
"524px"
:visible
.
sync=
"show_department"
>
<div
slot=
"title"
>
<span
style=
"margin-left:9px;margin-top:-3px;;width:72px; height:25px; font-size:18px; font-family:PingFangSC-Regular; font-weight:400; color:rgba(51,51,51,1); line-height:25px;"
>
部门设置
</span>
<div
style=
"width: 100%; height: 1px;background-color: #E3E3E3;margin: 17px 20px 0px -20px"
></div>
</div>
<el-form
label-width=
"100px"
label=
"right"
style=
"padding:0px 55px;"
>
<el-form-item
label=
"所属部门:"
prop=
"department_id"
>
<el-select
v-model=
"department_id"
filterable
>
<el-option
v-for=
"item in departments"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div
style=
"margin-left: 200px;"
>
<el-button
:loading=
"saveLoading"
@
click=
"saveDepartment"
style=
"width:120px;height:36px; background:#54C4A7; border-radius:4px;color: #FFFFFF;font-size: 16px;padding-top: 10px;"
>
保存
</el-button>
</div>
</el-dialog>
</gsb-pcpage>
</gsb-pcpage>
\ No newline at end of file
bpo-admin/app/front/vues/pages/usercenter/usercenter.js
View file @
2b179a73
...
@@ -29,12 +29,17 @@
...
@@ -29,12 +29,17 @@
dialogTableVisible
:
false
,
dialogTableVisible
:
false
,
dialogFormVisible
:
false
,
dialogFormVisible
:
false
,
pwdSaveLoading
:
false
,
pwdSaveLoading
:
false
,
department_id
:
null
,
departments
:
null
,
show_department
:
null
,
saveLoading
:
false
,
companyForm
:
{
companyForm
:
{
name
:
''
,
name
:
''
,
account
:
''
,
account
:
''
,
password
:
''
,
password
:
''
,
partnerType
:
''
,
partnerType
:
''
,
partnerLevel
:
''
partnerLevel
:
''
,
user
:
{}
},
},
pwdForm
:
{
pwdForm
:
{
oldPassword
:
''
,
oldPassword
:
''
,
...
@@ -57,6 +62,7 @@
...
@@ -57,6 +62,7 @@
},
},
mounted
:
function
()
{
mounted
:
function
()
{
this
.
getUserInfo
();
this
.
getUserInfo
();
},
},
created
:
function
()
{
created
:
function
()
{
...
@@ -68,10 +74,41 @@
...
@@ -68,10 +74,41 @@
if
(
d
.
status
==
0
)
{
if
(
d
.
status
==
0
)
{
var
user
=
d
.
data
.
user
||
{};
var
user
=
d
.
data
.
user
||
{};
var
epartner
=
d
.
data
.
epartner
||
{};
var
epartner
=
d
.
data
.
epartner
||
{};
self
.
companyForm
.
account
=
user
.
userName
||
""
;
self
.
companyForm
.
account
=
user
.
userName
||
""
;
self
.
companyForm
.
user
=
user
;
self
.
companyForm
.
partnerType
=
epartner
.
partnerTypeName
||
""
;
self
.
companyForm
.
partnerType
=
epartner
.
partnerTypeName
||
""
;
self
.
companyForm
.
partnerLevel
=
epartner
.
partnerLevelName
||
""
;
self
.
companyForm
.
partnerLevel
=
epartner
.
partnerLevelName
||
""
;
if
(
!
user
.
department
)
{
self
.
getDepartments
();
}
}
});
},
getDepartments
()
{
var
self
=
this
;
self
.
$root
.
postReq
(
"/web/departmentCtl/dict"
,
{}).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
departments
=
d
.
data
||
[];
console
.
log
(
self
.
departments
);
}
});
},
saveDepartment
()
{
this
.
saveLoading
=
true
;
var
self
=
this
;
let
department_id
=
this
.
department_id
;
if
(
!
department_id
)
{
self
.
$message
.
error
(
'请选择部门!'
);
this
.
saveLoading
=
false
;
return
;
}
self
.
$root
.
postReq
(
"/web/userCtl/setDepartment"
,
{
department_id
:
department_id
}).
then
(
function
(
d
)
{
if
(
d
.
status
==
0
)
{
self
.
getUserInfo
();
self
.
saveLoading
=
false
;
self
.
show_department
=
false
;
}
else
{
self
.
$message
.
error
(
d
.
msg
||
"操作失败"
);
}
}
});
});
},
},
...
...
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