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
f19c80e2
Commit
f19c80e2
authored
Dec 29, 2018
by
xiaohai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增部门
parent
19869c27
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
284 additions
and
334 deletions
+284
-334
vueSelectEmployee.vue
src/components/common/vueSelectEmployee.vue
+100
-38
permissionSetting.vue
src/components/contacts/permissionSet/permissionSetting.vue
+1
-29
selectArea.vue
src/components/contacts/permissionSet/selectArea.vue
+67
-256
addDepartment.vue
src/views/contacts/addDepartment.vue
+115
-10
administrativeFrame.vue
src/views/contacts/administrativeFrame.vue
+1
-1
No files found.
src/components/common/vueSelectEmployee.vue
View file @
f19c80e2
...
@@ -74,10 +74,27 @@
...
@@ -74,10 +74,27 @@
type
:
Object
,
type
:
Object
,
default
()
{
default
()
{
return
{
return
{
isSelectPerson
:
false
,
isSelectPerson
:
true
,
dialogVisible
:
true
dialogVisible
:
false
,
isSingle
:
false
// 是否单选
}
}
}
}
},
treeData
:
{
type
:
Object
,
default
()
{
return
{};
}
},
onlyGroup
:
{
type
:
Array
,
default
()
{
return
[];
}
},
onlyPerson
:
{
type
:
Boolean
,
default
:
false
}
}
},
},
data
()
{
data
()
{
...
@@ -97,56 +114,92 @@
...
@@ -97,56 +114,92 @@
/**
/**
* 获取分组架构
* 获取分组架构
*/
*/
getGroupData
()
{
//
getGroupData() {
let
_this
=
this
;
//
let _this = this;
let
params
=
{
//
let params = {
isStoreGroup
:
0
//
isStoreGroup: 0
};
//
};
getRequest
(
"/haoban-manage-web/dept/deptListForCompany"
,
params
)
//
getRequest("/haoban-manage-web/dept/deptListForCompany", params)
.
then
(
res
=>
{
//
.then(res => {
let
treeData
=
[];
//
let treeData = [];
let
personData
=
[];
//
let personData = [];
if
(
res
.
data
.
errorCode
==
1
)
{
//
if (res.data.errorCode == 1) {
treeData
=
res
.
data
.
result
.
departmentList
||
[];
//
treeData = res.data.result.departmentList || [];
personData
=
res
.
data
.
result
.
searchList
||
[]
//
personData = res.data.result.searchList || []
}
//
}
_this
.
formatGroupData
(
treeData
,
personData
);
//
_this.formatGroupData(treeData, personData);
})
//
})
.
catch
(
e
=>
{
//
.catch(e => {
console
.
log
(
e
,
"error"
);
//
console.log(e, "error");
});
//
});
},
//
},
formatGroupData
(
data
,
employees
=
[])
{
formatGroupData
(
data
,
employees
=
[])
{
let
copyData
=
data
.
slice
(
0
);
let
copyData
=
data
.
slice
(
0
);
let
_this
=
this
;
let
_this
=
this
;
let
onlyGroup
=
_this
.
onlyGroup
;
data
.
forEach
(
group
=>
{
data
.
forEach
(
group
=>
{
group
.
label
=
group
.
name
||
""
;
group
.
label
=
group
.
name
||
""
;
group
.
id
=
group
.
groupId
||
""
;
group
.
id
=
group
.
groupId
||
""
;
group
.
disableOpen
=
group
.
hasPression
==
1
?
false
:
true
;
let
allClerks
=
[];
group
.
disabled
=
group
.
hasPression
==
1
?
false
:
true
;
let
arr
=
[];
let
arr
=
[];
if
(
onlyGroup
.
length
>
0
)
{
if
(
onlyGroup
.
indexOf
(
group
.
groupId
)
>
-
1
)
{
group
.
disableOpen
=
false
;
group
.
disabled
=
true
;
}
else
{
group
.
disabled
=
true
;
group
.
disableOpen
=
true
;
}
}
else
{
group
.
disabled
=
_this
.
onlyPerson
?
true
:
group
.
hasPression
==
1
?
false
:
true
;
}
copyData
.
forEach
(
cG
=>
{
copyData
.
forEach
(
cG
=>
{
cG
.
label
=
cG
.
name
||
""
;
cG
.
label
=
cG
.
name
||
""
;
cG
.
id
=
cG
.
groupId
||
""
;
cG
.
id
=
cG
.
groupId
||
""
;
cG
.
disableOpen
=
cG
.
hasPression
==
1
?
false
:
true
;
cG
.
disableOpen
=
false
;
cG
.
disabled
=
cG
.
hasPression
==
1
?
false
:
true
;
if
(
onlyGroup
.
length
>
0
)
{
if
(
cG
.
parentId
==
group
.
groupId
)
{
if
(
onlyGroup
.
indexOf
(
cG
.
groupId
)
>
-
1
)
{
arr
.
push
(
cG
);
cG
.
disableOpen
=
false
;
cG
.
disabled
=
true
;
if
(
cG
.
parentId
==
group
.
groupId
)
{
arr
.
push
(
cG
);
}
}
else
{
cG
.
disabled
=
true
;
cG
.
disableOpen
=
true
;
}
}
else
{
cG
.
disabled
=
_this
.
onlyPerson
?
true
:
cG
.
hasPression
==
1
?
false
:
true
;
if
(
cG
.
parentId
==
group
.
groupId
)
{
arr
.
push
(
cG
);
}
}
}
});
});
if
(
_this
.
treeSet
.
isSelectPerson
)
employees
.
forEach
(
person
=>
{
if
(
_this
.
treeSet
.
isSelectPerson
&&
group
.
hasPression
==
1
)
employees
.
forEach
(
person
=>
{
person
.
label
=
person
.
name
;
person
.
label
=
person
.
name
;
person
.
id
=
person
.
employeeClerkId
;
person
.
id
=
person
.
employeeClerkId
;
if
(
person
.
departmentId
==
group
.
groupId
)
{
if
(
person
.
departmentId
==
group
.
groupId
)
{
arr
.
push
(
person
);
arr
.
push
(
person
);
allClerks
.
push
(
person
);
}
}
});
});
if
(
arr
.
length
>
0
)
group
.
childrens
=
arr
;
if
(
arr
.
length
>
0
)
group
.
childrens
=
arr
;
if
(
group
.
level
==
0
)
{
group
.
allClerks
=
allClerks
;
group
.
disabled
=
true
;
if
(
onlyGroup
.
length
>
0
)
{
group
.
hasLoad
=
true
;
if
(
onlyGroup
.
indexOf
(
group
.
groupId
)
>
-
1
)
{
_this
.
menuData
=
[
group
];
group
.
hasLoad
=
true
;
_this
.
defaultOpen
.
push
(
group
.
id
);
_this
.
defaultOpen
.
push
(
group
.
id
);
if
(
onlyGroup
.
indexOf
(
group
.
parentId
)
<
0
)
{
_this
.
menuData
.
push
(
group
);
}
}
}
else
{
if
(
group
.
level
==
0
)
{
group
.
disabled
=
true
;
group
.
hasLoad
=
true
;
_this
.
menuData
=
[
group
];
_this
.
defaultOpen
.
push
(
group
.
id
);
}
}
}
});
});
},
},
...
@@ -162,6 +215,11 @@
...
@@ -162,6 +215,11 @@
getCurrentNode
(
data
,
ifChecked
)
{
getCurrentNode
(
data
,
ifChecked
)
{
data
.
disableOpen
=
ifChecked
;
data
.
disableOpen
=
ifChecked
;
this
.
selectedList
=
this
.
$refs
.
tree
.
getCheckedNodes
();
this
.
selectedList
=
this
.
$refs
.
tree
.
getCheckedNodes
();
if
(
this
.
treeSet
.
isSingle
&&
this
.
selectedList
.
length
>
1
)
{
let
index
=
this
.
selectedList
.
indexOf
(
data
);
this
.
selectedList
.
splice
(
1
-
index
,
1
);
this
.
$refs
.
tree
.
setCheckedNodes
(
this
.
selectedList
);
}
},
},
/**
/**
* 节点展开时,禁用复选框
* 节点展开时,禁用复选框
...
@@ -173,7 +231,7 @@
...
@@ -173,7 +231,7 @@
* 节点关闭时,取消复选框的禁用
* 节点关闭时,取消复选框的禁用
*/
*/
nodeClose
(
data
,
node
,
self
)
{
nodeClose
(
data
,
node
,
self
)
{
data
.
disabled
=
false
;
data
.
disabled
=
this
.
onlyPerson
?
true
:
data
.
hasPression
!=
1
;
},
},
/**
/**
* 关键词搜索
* 关键词搜索
...
@@ -199,15 +257,19 @@
...
@@ -199,15 +257,19 @@
* 外抛已选的数据
* 外抛已选的数据
*/
*/
submitSelected
()
{
submitSelected
()
{
this
.
$emit
(
"handleSelectedList"
,
this
.
selectedList
);
this
.
$emit
(
"handleSelectedList"
,
this
.
treeSet
.
isSingle
?
this
.
selectedList
[
0
]
:
this
.
selectedList
);
this
.
treeSet
.
dialogVisible
=
false
;
}
}
},
},
beforeMount
()
{
//
beforeMount() {
this
.
getGroupData
();
//
this.getGroupData();
},
//
},
watch
:
{
watch
:
{
searchText
(
newK
,
old
)
{
searchText
(
newK
,
old
)
{
this
.
$refs
.
tree
.
filter
(
newK
);
this
.
$refs
.
tree
.
filter
(
newK
);
},
treeData
(
newData
)
{
this
.
formatGroupData
(
newData
.
treeData
,
newData
.
personData
);
}
}
}
}
};
};
...
...
src/components/contacts/permissionSet/permissionSetting.vue
View file @
f19c80e2
...
@@ -9,34 +9,6 @@
...
@@ -9,34 +9,6 @@
inactive-color=
"#DCDFE6"
>
inactive-color=
"#DCDFE6"
>
</el-switch>
</el-switch>
<div
class=
"particular-setting"
v-if=
"visibleThere"
>
<div
class=
"particular-setting"
v-if=
"visibleThere"
>
<!--
<div>
<div
class=
"setting-name"
>
个别员工不设置该权限
<a
class=
"J_add a-href"
><i
class=
"el-icon-plus"
></i>
添加
</a>
<a
class=
"a-href J_check-detail"
>
查看详情
</a>
</div>
<ul
class=
"particular-list"
>
<li
class=
"item person-item"
v-for=
"(li, index) in visibleApartList"
:key=
"index+'_'+li.employeeClerkId"
v-if=
"index
<
14
"
>
<img
:src=
"li.headPic"
>
<p
class=
"name"
>
{{
li
.
name
}}
</p>
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'vaList')"
></i>
</li>
</ul>
<p
class=
"check-more"
v-if=
"vsList.length > 14"
>
查看更多
</p>
<div
class=
"setting-name"
>
允许指定部门/人员可见
<a
class=
"J_add a-href"
><i
class=
"el-icon-plus"
></i>
添加
</a>
<a
class=
"a-href J_check-detail"
>
查看详情
</a>
</div>
<ul
class=
"particular-list"
>
<li
class=
"item person-item"
v-for=
"(li, index) in visibleSpecialLsit"
:key=
"index+'_'+li.employeeClerkId"
v-if=
"index
<
14
"
>
<img
:src=
"li.headPic"
>
<p
class=
"name"
>
{{
index
}}{{
li
.
name
}}
</p>
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'vsList')"
></i>
</li>
</ul>
<p
class=
"check-more"
v-if=
"vsList.length > 14"
>
查看更多
</p>
</div>
-->
<select-area></select-area>
<select-area></select-area>
</div>
</div>
</div>
</div>
...
@@ -80,7 +52,7 @@
...
@@ -80,7 +52,7 @@
},
},
data
()
{
data
()
{
return
{
return
{
visibleThere
:
fals
e
,
visibleThere
:
tru
e
,
visibleSelf
:
false
visibleSelf
:
false
};
};
},
},
...
...
src/components/contacts/permissionSet/selectArea.vue
View file @
f19c80e2
...
@@ -2,280 +2,62 @@
...
@@ -2,280 +2,62 @@
<div
class=
"select-area"
>
<div
class=
"select-area"
>
<div
class=
"setting-name"
>
<div
class=
"setting-name"
>
个别员工不设置该权限
个别员工不设置该权限
<
a
class=
"J_add a-href
"
><i
class=
"el-icon-plus"
></i>
添加
</a>
<
!--
<a
class=
"J_add a-href"
@
click=
"treeSet.dialogVisible = true;
"
><i
class=
"el-icon-plus"
></i>
添加
</a>
<a
class=
"a-href J_check-detail"
>
查看详情
</a>
<a
class=
"a-href J_check-detail"
>
查看详情
</a>
-->
</div>
</div>
<ul
class=
"particular-list"
>
<ul
class=
"particular-list"
>
<li
class=
"item person-item"
v-for=
"(li, index) in testList"
:key=
"index+'_'+li.employeeClerkId"
v-if=
"index
<
14
"
>
<template
v-for=
"(li, index) in butList"
>
<img
:src=
"li.headPic"
>
<li
class=
"item person-item"
v-if=
"li.employeeClerkId"
:key=
"index+'_'+li.employeeClerkId"
>
<p
class=
"name"
>
{{
li
.
name
}}
</p>
<img
:src=
"li.headPic"
>
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'testList')"
></i>
<p
class=
"name"
>
{{
li
.
label
}}
</p>
</li>
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'butList')"
></i>
</li>
<li
class=
"item group-item"
v-else
:key=
"index+'_'+li.groupId"
>
{{
li
.
label
}}
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'butList')"
></i>
</li>
</
template
>
<li
class=
"item J_add-btn"
@
click=
"$refs.butSelector.treeSet.dialogVisible = true;"
><i
class=
"el-icon-plus"
></i></li>
</ul>
</ul>
<p
class=
"check-more"
v-if=
"testList.length > 14"
>
查看更多
</p>
<div
class=
"setting-name"
>
<div
class=
"setting-name"
>
允许指定部门/人员可见
允许指定部门/人员可见
<a
class=
"J_add a-href"
><i
class=
"el-icon-plus"
></i>
添加
</a>
<a
class=
"J_add a-href"
><i
class=
"el-icon-plus"
></i>
添加
</a>
<a
class=
"a-href J_check-detail"
>
查看详情
</a>
<a
class=
"a-href J_check-detail"
>
查看详情
</a>
</div>
</div>
<ul
class=
"particular-list"
>
<ul
class=
"particular-list"
>
<li
class=
"item person-item"
v-for=
"(li, index) in testList"
:key=
"index+'_'+li.employeeClerkId"
v-if=
"index
<
14
"
>
<
template
v-for=
"(li, index) in vipList"
>
<img
:src=
"li.headPic"
>
<li
class=
"item person-item"
v-if=
"li.employeeClerkId"
:key=
"index+'_'+li.employeeClerkId"
>
<p
class=
"name"
>
{{
index
}}{{
li
.
name
}}
</p>
<img
:src=
"li.headPic"
>
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'testList')"
></i>
<p
class=
"name"
>
{{
li
.
label
}}
</p>
</li>
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'vipList')"
></i>
</li>
<li
class=
"item group-item"
v-else
:key=
"index+'_'+li.groupId"
>
{{
li
.
label
}}
<i
class=
"el-icon-circle-close"
@
click=
"delCurrent(li, 'vipList')"
></i>
</li>
</
template
>
<li
class=
"item J_add-btn"
@
click=
"$refs.butSelector.treeSet.dialogVisible = true;"
><i
class=
"el-icon-plus"
></i></li>
</ul>
</ul>
<
p
class=
"check-more"
v-if=
"testList.length > 14"
>
查看更多
</p
>
<
vue-select-employee
ref=
"butSelector"
@
handleSelectedList=
"handleSelectedList"
></vue-select-employee
>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
deepCopy
}
from
'@/utils/index'
;
import
{
deepCopy
}
from
'@/utils/index'
;
import
vueSelectEmployee
from
"components/common/vueSelectEmployee"
export
default
{
export
default
{
name
:
"select-area"
,
name
:
"select-area"
,
components
:
{
vueSelectEmployee
},
data
()
{
data
()
{
return
{
return
{
testList
:
[
testList
:
[],
{
treeSet
:
{
activationStatus
:
0
,
isSelectPerson
:
true
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
dialogVisible
:
false
departmentName
:
"无"
,
},
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
butList
:
[],
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
vipList
:
[]
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus
:
0
,
departmentId
:
"8acdb364b1f649328b99cbac338098ad"
,
departmentName
:
"无"
,
employeeClerkId
:
"12a2ef3c642a412b989e8f1a29319231"
,
enterpriseId
:
"5cfbf45fe35d475ca9a59c41b70b114e"
,
headPic
:
"https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png"
,
hireDate
:
null
,
isManager
:
1
,
isManagerStr
:
"是"
,
name
:
"张0"
,
phoneNumber
:
"13588480000"
,
positionName
:
"公司老大0"
,
sort
:
0
,
userId
:
"2d92932d626b4058a11c8fb1b8c53956"
}
]
};
};
},
},
...
@@ -288,6 +70,13 @@ export default {
...
@@ -288,6 +70,13 @@ export default {
let
list
=
that
[
listName
];
let
list
=
that
[
listName
];
console
.
log
(
list
.
indexOf
(
person
));
console
.
log
(
list
.
indexOf
(
person
));
list
.
splice
(
list
.
indexOf
(
person
),
1
);
list
.
splice
(
list
.
indexOf
(
person
),
1
);
},
/**
* 处理树形控件选择的数据
*/
handleSelectedList
(
list
)
{
console
.
log
(
list
);
this
.
butList
=
list
;
}
}
}
}
};
};
...
@@ -326,6 +115,28 @@ export default {
...
@@ -326,6 +115,28 @@ export default {
text-align
:
center
;
text-align
:
center
;
margin-top
:
20px
;
margin-top
:
20px
;
}
}
&
.group-item
{
padding
:
0
10px
;
width
:
auto
;
height
:
30px
;
line-height
:
32px
;
background
:
rgba
(
236
,
245
,
255
,
1
);
border
:
1px
solid
rgba
(
217
,
236
,
255
,
1
);
border-radius
:
4px
;
font-size
:
12px
;
color
:
rgba
(
64
,
158
,
255
,
1
);
}
&
.J_add-btn
{
height
:
40px
;
background
:
rgba
(
251
,
253
,
255
,
1
);
border
:
1px
dashed
rgba
(
192
,
204
,
218
,
1
);
border-radius
:
50%
;
text-align
:
center
;
line-height
:
40px
;
font-size
:
16px
;
box-sizing
:
border-box
;
cursor
:
pointer
;
}
}
}
}
}
.check-more
{
.check-more
{
...
...
src/views/contacts/addDepartment.vue
View file @
f19c80e2
...
@@ -5,26 +5,35 @@
...
@@ -5,26 +5,35 @@
<el-form
<el-form
class=
"department-info-form"
class=
"department-info-form"
label-position=
"right"
label-position=
"right"
label-width=
"100px"
>
:rules=
"rules"
<el-form-item
label=
"部门名称"
required
>
:model=
"departInfo"
ref=
"departForm"
label-width=
"120px"
>
<el-form-item
label=
"部门名称"
prop=
"name"
>
<el-input
v-model=
"departInfo.name"
></el-input>
<el-input
v-model=
"departInfo.name"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"部门排序调整"
>
<el-form-item
label=
"部门排序调整"
prop=
"parentId"
>
<el-input
v-model=
"departInfo.name
"
></el-input>
<el-input
:disabled=
"disabled"
v-model=
"departInfo.parentName"
@
focus=
"callGroupSelector"
suffix-icon=
"el-icon-arrow-down
"
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<div
class=
"setting-cell"
>
<div
class=
"setting-cell"
v-if=
"$route.query.addnew != 1"
>
<p
class=
"title"
>
权限设置
</p>
<p
class=
"title"
>
权限设置
</p>
<permission-setting
:visibleApartList=
"testList"
:visibleSpecialLsit=
"testList"
:onlySelfApartList=
"testList"
></permission-setting>
<permission-setting
:visibleApartList=
"testList"
:visibleSpecialLsit=
"testList"
:onlySelfApartList=
"testList"
></permission-setting>
</div>
</div>
<div
class=
"setting-cell"
></div>
<div
class=
"setting-cell"
>
<vue-select-employee></vue-select-employee>
<div
class=
"btn-area"
>
<el-button
type=
"primary"
@
click=
"saveEdit"
>
保存
</el-button>
<!--
<el-button>
取消
</el-button>
-->
</div>
</div>
<vue-select-employee
:treeSet=
"treeSet"
@
handleSelectedList=
"handleSelectedList"
:treeData=
"treeData"
></vue-select-employee>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
permissionSetting
from
"components/contacts/permissionSet/permissionSetting"
;
import
permissionSetting
from
"components/contacts/permissionSet/permissionSetting"
;
import
vueSelectEmployee
from
"components/common/vueSelectEmployee"
import
vueSelectEmployee
from
"components/common/vueSelectEmployee"
;
import
{
getRequest
,
postRequest
,
postJsonRequest
}
from
'@/api/api'
;
export
default
{
export
default
{
name
:
"addDepartment"
,
name
:
"addDepartment"
,
components
:
{
components
:
{
...
@@ -34,10 +43,101 @@
...
@@ -34,10 +43,101 @@
data
()
{
data
()
{
return
{
return
{
departInfo
:
{
departInfo
:
{
name
:
""
name
:
""
,
parentName
:
""
,
parentId
:
""
},
testList
:
[],
treeSet
:
{
isSelectPerson
:
false
,
dialogVisible
:
false
,
isSingle
:
true
// 是否单选
},
rules
:
{
name
:
[
{
required
:
true
,
message
:
'请输入部门名称'
,
trigger
:
'blur'
},
{
min
:
1
,
max
:
20
,
message
:
'长度在 1 到 20 个字符'
,
trigger
:
'blur'
}
],
parentId
:
[
{
required
:
true
,
message
:
'请选择父级部门'
,
trigger
:
'change'
}
]
},
},
testList
:
[]
treeData
:
{},
disabled
:
true
};
};
},
methods
:
{
/**
* 唤起部门选择器
*/
callGroupSelector
()
{
this
.
treeSet
.
dialogVisible
=
true
;
},
/**
* 处理已选部门
*/
handleSelectedList
(
group
)
{
console
.
log
(
group
);
this
.
departInfo
.
parentId
=
group
?
group
.
id
:
""
;
this
.
departInfo
.
parentName
=
group
?
group
.
label
:
""
;
},
saveEdit
()
{
this
.
$refs
.
departForm
.
validate
(
valid
=>
{
if
(
!
valid
)
{
return
false
;
}
let
_this
=
this
;
let
params
=
{
parentId
:
_this
.
departInfo
.
parentId
,
name
:
_this
.
departInfo
.
name
}
getRequest
(
"/haoban-manage-web/dept/insert"
,
params
)
.
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
data
.
errorCode
==
1
)
{
}
else
{
_this
.
$message
.
error
({
duration
:
1000
,
message
:
res
.
data
.
message
});
}
})
.
catch
(
e
=>
{
_this
.
$message
.
error
({
duration
:
1000
,
message
:
e
.
message
});
});
});
},
getGroupData
()
{
let
_this
=
this
;
let
params
=
{
isStoreGroup
:
0
};
getRequest
(
"/haoban-manage-web/dept/deptListForCompany"
,
params
)
.
then
(
res
=>
{
let
treeData
=
[];
let
personData
=
[];
if
(
res
.
data
.
errorCode
==
1
)
{
treeData
=
res
.
data
.
result
.
departmentList
||
[];
personData
=
res
.
data
.
result
.
searchList
||
[]
}
// _this.formatGroupData(treeData, personData);
_this
.
treeData
=
{
treeData
,
personData
};
_this
.
disabled
=
false
;
})
.
catch
(
e
=>
{
console
.
log
(
e
,
"error"
);
});
}
},
beforeMount
()
{
this
.
getGroupData
();
}
}
};
};
</
script
>
</
script
>
...
@@ -61,6 +161,11 @@
...
@@ -61,6 +161,11 @@
width
:
380px
;
width
:
380px
;
}
}
}
}
.btn-area
{
width
:
100%
;
text-align
:
center
;
padding
:
12px
;
}
}
}
}
}
</
style
>
</
style
>
...
...
src/views/contacts/administrativeFrame.vue
View file @
f19c80e2
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<span
class=
"title-span"
>
{{
groupInfo
.
groupName
}}
(
{{
total
}}
人)
</span>
<span
class=
"title-span"
>
{{
groupInfo
.
groupName
}}
(
{{
total
}}
人)
</span>
<span
class=
"id-span"
>
部门ID:
{{
groupInfo
.
departmentId
}}
</span>
<span
class=
"id-span"
>
部门ID:
{{
groupInfo
.
departmentId
}}
</span>
<span
class=
"handle-area"
>
<span
class=
"handle-area"
>
<a
:href=
"'#/addDepartment?departmentId='+groupInfo.departmentId"
target=
"_blank"
class=
"J_add-child a-href"
>
添加子部门
</a>
<a
:href=
"'#/addDepartment?
addnew=1&
departmentId='+groupInfo.departmentId"
target=
"_blank"
class=
"J_add-child a-href"
>
添加子部门
</a>
<span
class=
"hurdle"
></span>
<span
class=
"hurdle"
></span>
<a
class=
"J_edit a-href"
>
编辑
</a>
<a
class=
"J_edit a-href"
>
编辑
</a>
</span>
</span>
...
...
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