Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
79d574f4
Commit
79d574f4
authored
Nov 19, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
534e9667
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
253 additions
and
29 deletions
+253
-29
index.js
src/api/system/index.js
+48
-0
dept-form.vue
src/components/system/dept-form.vue
+113
-20
manager.vue
src/pages/school/manager.vue
+1
-0
dept.vue
src/pages/system/dept.vue
+91
-9
No files found.
src/api/system/index.js
View file @
79d574f4
...
...
@@ -52,6 +52,54 @@ export function getMenuLevelList() {
return
MenuLevelOpts
;
}
/**
* 获取部门层级列表
*/
export
function
getDeptTierList
()
{
var
deptTierOpts
=
[{
label
:
'1级'
,
value
:
1
},
{
label
:
'2级'
,
value
:
2
},
{
label
:
'3级'
,
value
:
3
},
{
label
:
'4级'
,
value
:
4
},
{
label
:
'5级'
,
value
:
5
},
{
label
:
'6级'
,
value
:
6
},
{
label
:
'7级'
,
value
:
7
},
{
label
:
'8级'
,
value
:
8
},
{
label
:
'9级'
,
value
:
9
},
{
label
:
'10级'
,
value
:
10
},
];
return
deptTierOpts
;
}
/**
* 获取菜单分页列表
*
...
...
src/components/system/dept-form.vue
View file @
79d574f4
...
...
@@ -7,16 +7,32 @@
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
部门信息
</div>
<div
class=
"row wrap"
>
<q-select
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"objOption.School_Id"
ref=
"School_Id"
:options=
"schoolList"
label=
"所属校区"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '请选择所属校区']"
/>
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.DeptName"
ref=
"DeptName"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"部门名称"
:rules=
"[val => !!val || '请填写部门名称']"
/>
<q-input
filled
stack-label
maxlength=
"50"
:dense=
"false"
v-model=
"objOption.DeptTel"
ref=
"DeptTel"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"部门电话"
/>
<q-select
filled
stack-label
option-value=
"value"
option-label=
"label"
v-model=
"objOption.DeptTier"
ref=
"DeptTier"
:options=
"DeptTierList"
label=
"部门层级"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
:rules=
"[val => !!val || '部门层级']"
/>
<selectTree
v-if=
"DeptTreeList&&DeptTreeList.length>0"
:treeData=
'DeptTreeList'
:defaultArray=
"returnString"
nodeKey=
"DeptId"
:multiple=
"false"
labelKey=
"DeptName"
childrenKey=
"ChildList"
tipText=
"选择上级部门"
@
getChild=
"getChild"
classStr=
"col-6 q-pr-lg q-pb-lg"
></selectTree>
<q-select
:option-value=
"(item) => item === null ? null : item.MenuId"
option-label=
"MenuName"
v-model=
"objOption.ParentId"
:options=
"PersionList"
label=
"部门负责人"
:dense=
"false"
emit-value
map-options
class=
"col-6 q-pr-lg q-pb-lg"
/>
<q-select
class=
"col-6 q-pb-lg q-pr-lg"
multiple
clearable
filled
stack-label
use-input
use-chips
option-value=
"Id"
option-label=
"EmployeeName"
v-model=
"tempManager"
ref=
"ManagerId"
:options=
"PersionList"
label=
"部门负责人"
:dense=
"false"
emit-value
map-options
@
filter=
"filterFn"
>
<template
v-slot:no-option
>
<q-item>
<q-item-section
class=
"text-grey"
>
未找到相关数据
</q-item-section>
</q-item>
</
template
>
</q-select>
<q-input
filled
stack-label
maxlength=
"50"
:dense=
"false"
v-model=
"objOption.DeptTel"
ref=
"DeptTel"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"部门电话"
/>
<q-input
filled
stack-label
maxlength=
"50"
:dense=
"false"
v-model=
"objOption.DeptSort"
ref=
"DeptSort"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"排序"
/>
<div
class=
"col-6 q-pr-lg q-pb-lg q-pt-lg"
>
<q-toggle
size=
"md"
label=
"状态"
color=
"primary"
:false-value=
"1"
:true-value=
"0"
v-model=
"objOption.Status"
/>
...
...
@@ -41,6 +57,15 @@
saveDeptInfo
,
getDeptInfo
}
from
'../../api/system/dept'
import
{
getSchoolDropdown
,
}
from
'../../api/school/index'
import
{
getDeptTierList
}
from
'../../api/system/index'
import
{
queryEmployee
}
from
'../../api/users/user'
export
default
{
props
:
{
saveObj
:
{
...
...
@@ -61,24 +86,71 @@
DeptTel
:
""
,
//部门联系电话
ManagerIds
:
""
,
//部门负责人编号
Status
:
0
,
//状态(0-正常,1-禁用),
School_Id
:
0
,
//校区编号
DeptTier
:
0
,
//部门层级
DeptSort
:
0
,
//部门排序
},
optionTitle
:
""
,
returnString
:
[],
//部门树形列表
DeptTreeList
:
[],
returnString
:
[],
//部门树默认值
DeptTreeList
:
[],
//部门树形列表
saveLoading
:
false
,
PersionList
:
[],
PersionList
:
[],
//员工列表
AllemployeeList
:
[],
//所有员工
DeptTierList
:
[],
//部门层级列表
schoolList
:
[],
//校区列表
tempManager
:
[],
//负责人编号数组
}
},
created
()
{
this
.
queryDeptTier
();
this
.
queryDeptTree
();
this
.
getEmployee
();
this
.
getSchool
();
},
mounted
()
{
this
.
initObj
()
},
methods
:
{
//筛选员工
filterFn
(
val
,
update
)
{
update
(()
=>
{
if
(
val
===
''
)
{
this
.
PersionList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
AllemployeeList
))
}
else
{
const
needle
=
val
.
toLowerCase
()
this
.
PersionList
=
this
.
AllemployeeList
.
filter
(
v
=>
v
.
EmployeeName
.
toLowerCase
().
indexOf
(
needle
)
>
-
1
)
}
})
},
//获取员工列表
getEmployee
()
{
var
qMsg
=
{
EmployeeName
:
""
}
queryEmployee
(
qMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
var
jsonData
=
res
.
Data
;
if
(
jsonData
&&
jsonData
.
length
>
0
)
{
this
.
AllemployeeList
=
JSON
.
parse
(
JSON
.
stringify
(
jsonData
));
this
.
PersionList
=
JSON
.
parse
(
JSON
.
stringify
(
jsonData
));;
}
}
})
},
//部门层级列表
queryDeptTier
()
{
this
.
DeptTierList
=
getDeptTierList
();
},
//获取校区
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
;
this
.
$forceUpdate
();
})
},
//获取选中的部门
getChild
(
menuArray
)
{
var
tempStr
=
""
;
var
tempStr
=
"
0
"
;
if
(
menuArray
&&
menuArray
!=
''
)
{
tempStr
=
menuArray
;
}
...
...
@@ -105,6 +177,10 @@
this
.
objOption
.
DeptTel
=
res
.
Data
.
DeptTel
;
this
.
objOption
.
ManagerIds
=
res
.
Data
.
ManagerIds
;
this
.
objOption
.
Status
=
res
.
Data
.
Status
;
this
.
objOption
.
DeptSort
=
res
.
Data
.
DeptSort
;
this
.
objOption
.
DeptTier
=
res
.
Data
.
DeptTier
;
this
.
objOption
.
School_Id
=
res
.
Data
.
School_Id
;
this
.
tempManager
=
res
.
Data
.
ManagerList
;
})
this
.
optionTitle
=
"修改部门信息"
}
else
{
...
...
@@ -115,26 +191,43 @@
this
.
objOption
.
DeptTel
=
""
;
this
.
objOption
.
ManagerIds
=
""
;
this
.
objOption
.
Status
=
0
;
this
.
objOption
.
DeptSort
=
0
;
this
.
objOption
.
DeptTier
=
0
;
this
.
objOption
.
School_Id
=
0
;
this
.
tempManager
=
[];
}
},
//关闭弹窗
closeSaveForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
this
.
persistent
=
false
;
},
//保存部门
saveDept
()
{
this
.
saveLoading
=
true
this
.
saveLoading
=
true
;
var
tempStr
=
""
;
if
(
this
.
tempManager
&&
this
.
tempManager
.
length
>
0
)
{
this
.
tempManager
.
forEach
(
item
=>
{
tempStr
+=
","
+
item
;
});
}
if
(
tempStr
&&
tempStr
!=
''
)
{
//去掉第一个字符
tempStr
=
tempStr
.
substr
(
1
);
}
this
.
objOption
.
ManagerIds
=
tempStr
;
saveDeptInfo
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
if
(
res
.
Code
==
1
)
{
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
}
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveLoading
=
false
...
...
src/pages/school/manager.vue
View file @
79d574f4
...
...
@@ -253,6 +253,7 @@
this
.
getSchool
()
},
methods
:
{
//筛选员工
filterFn
(
val
,
update
)
{
update
(()
=>
{
if
(
val
===
''
)
{
...
...
src/pages/system/dept.vue
View file @
79d574f4
...
...
@@ -2,10 +2,25 @@
<div
class=
"page-body"
>
<div
class=
"page-search row items-center"
>
<div
class=
"col row wrap q-mr-lg q-col-gutter-md"
>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
filled
stack-label
option-value=
"SId"
option-label=
"SName"
v-model=
"msg.School_Id"
:options=
"schoolList"
label=
"校区"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
clearable
@
clear=
"resetSearch"
/>
</div>
<div
class=
"col-3"
>
<q-input
@
change=
"resetSearch"
clearable
standout=
"bg-primary text-white"
v-model=
"msg.DeptName"
label=
"部门名称"
/>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
filled
stack-label
option-value=
"value"
option-label=
"label"
v-model=
"msg.DeptTier"
ref=
"DeptTier"
:options=
"DeptTierList"
label=
"部门层级"
:dense=
"false"
class=
"col-6 q-pr-lg q-pb-lg"
emit-value
map-options
clearable
@
clear=
"resetSearch"
/>
</div>
<div
class=
"col-3"
>
<selectTree
v-if=
"DeptTreeList&&DeptTreeList.length>0"
:treeData=
'DeptTreeList'
:defaultArray=
"returnString"
nodeKey=
"DeptId"
:multiple=
"false"
labelKey=
"DeptName"
childrenKey=
"ChildList"
tipText=
"选择上级部门"
@
getChild=
"getChild"
classStr=
"col-6 q-pr-lg q-pb-lg"
></selectTree>
</div>
<div
class=
"col-3"
>
<q-select
@
input=
"resetSearch"
standout=
"bg-primary text-white"
v-model=
"msg.Status"
:options=
"ShowOpts"
emit-value
map-options
label=
"状态"
/>
...
...
@@ -46,22 +61,31 @@
import
{
getDeptPage
,
setDeptStatusInfo
,
getDeptTree
}
from
'../../api/system/dept'
import
{
getSchoolDropdown
,
}
from
'../../api/school/index'
import
{
getDeptTierList
}
from
'../../api/system/index'
import
deptForm
from
'../../components/system/dept-form'
import
selectTree
from
'../../components/common/select-tree'
export
default
{
meta
:
{
title
:
"部门管理"
},
components
:
{
deptForm
,
selectTree
},
data
()
{
return
{
currentUrl
:
""
,
columns
:
[{
name
:
'
DeptId
'
,
label
:
'
部门编号
'
,
field
:
'
DeptId
'
,
name
:
'
SchoolName
'
,
label
:
'
校区
'
,
field
:
'
SchoolName
'
,
align
:
'left'
},
{
...
...
@@ -72,9 +96,9 @@
field
:
row
=>
row
.
DeptName
},
{
name
:
'
ParentDeptName
'
,
label
:
'
上级部门
'
,
field
:
'
ParentDeptName
'
,
name
:
'
DeptTier
'
,
label
:
'
部门层级
'
,
field
:
'
DeptTier
'
,
align
:
'left'
},
{
...
...
@@ -90,9 +114,9 @@
align
:
'left'
},
{
name
:
'
CreateTimeStr
'
,
label
:
'
创建时间
'
,
field
:
'
CreateTimeStr
'
,
name
:
'
DeptSort
'
,
label
:
'
排序
'
,
field
:
'
DeptSort
'
,
align
:
'left'
},
{
...
...
@@ -129,17 +153,57 @@
DeptName
:
""
,
//部门名称
DeptId
:
0
,
//部门编号
Status
:
"-1"
,
School_Id
:
""
,
DeptTier
:
""
,
ParentId
:
""
,
},
pageCount
:
0
,
returnString
:
[],
//树形结构初始化数组
isShowDeptForm
:
false
,
deptObjOption
:
null
,
schoolList
:
[],
//校区列表
DeptTierList
:
[],
//部门层级
DeptTreeList
:
[],
//部门树形结构列表
}
},
created
()
{
this
.
queryDeptTier
();
this
.
queryDeptTree
();
this
.
getSchool
();
},
mounted
()
{
this
.
currentUrl
=
this
.
$route
.
path
;
this
.
queryDeptPage
();
},
methods
:
{
//获取部门树形结构
queryDeptTree
()
{
getDeptTree
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
DeptTreeList
=
res
.
Data
;
}
})
},
//获取选中的部门
getChild
(
menuArray
)
{
var
tempStr
=
"0"
;
if
(
menuArray
&&
menuArray
!=
''
)
{
tempStr
=
menuArray
;
}
this
.
msg
.
ParentId
=
tempStr
;
this
.
resetSearch
();
},
//部门层级列表
queryDeptTier
()
{
this
.
DeptTierList
=
getDeptTierList
();
},
//获取校区
getSchool
()
{
getSchoolDropdown
({}).
then
(
res
=>
{
this
.
schoolList
=
res
.
Data
;
this
.
$forceUpdate
();
})
},
gotoRelation
()
{
var
tempStr
=
'/system/deptrelation'
;
this
.
$router
.
push
({
...
...
@@ -158,11 +222,29 @@
},
//获取部门分页列表
queryDeptPage
()
{
if
(
this
.
msg
.
School_Id
==
""
||
this
.
msg
.
School_Id
==
null
)
{
this
.
msg
.
School_Id
=
"0"
;
}
if
(
this
.
msg
.
DeptTier
==
""
||
this
.
msg
.
DeptTier
==
null
)
{
this
.
msg
.
DeptTier
=
"0"
}
if
(
this
.
msg
.
ParentId
==
""
||
this
.
msg
.
ParentId
==
null
)
{
this
.
msg
.
ParentId
=
"0"
}
this
.
loading
=
true
;
getDeptPage
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
;
this
.
data
=
res
.
Data
.
PageData
;
this
.
pageCount
=
res
.
Data
.
PageCount
;
if
(
this
.
msg
.
School_Id
==
"0"
)
{
this
.
msg
.
School_Id
=
""
;
}
if
(
this
.
msg
.
DeptTier
==
"0"
)
{
this
.
msg
.
DeptTier
=
""
}
if
(
this
.
msg
.
ParentId
==
"0"
)
{
this
.
msg
.
ParentId
=
""
}
}).
catch
(()
=>
{
this
.
loading
=
false
;
})
...
...
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