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
6557b918
Commit
6557b918
authored
Dec 04, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fb889a1f
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
3149 additions
and
87 deletions
+3149
-87
administration.js
src/api/administration/administration.js
+80
-0
user.js
src/api/users/user.js
+17
-6
auditprocess.png
src/assets/images/administration/auditprocess.png
+0
-0
Approval.vue
src/pages/administration/Approval.vue
+92
-81
ApprovalProcess.vue
src/pages/administration/ApprovalProcess.vue
+999
-0
processDesign.vue
src/pages/administration/processDesign.vue
+968
-0
updateProcessDesign.vue
src/pages/administration/updateProcessDesign.vue
+978
-0
routes.js
src/router/routes.js
+15
-0
No files found.
src/api/administration/administration.js
View file @
6557b918
...
...
@@ -10,3 +10,83 @@ export function getTemplateList(data) {
});
}
/**
* 获取审批启用和停用
*/
export
function
setTemplate
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/SetTemplate'
,
method
:
'post'
,
data
});
}
/**
*
*/
export
function
getDefaultCondition
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/GetDefaultCondition'
,
method
:
'post'
,
data
});
}
/**
*
*/
export
function
getOtherConditionList
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/GetOtherConditionList'
,
method
:
'post'
,
data
});
}
/**
*请假类型
*/
export
function
getAskForLeaveType
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/GetAskForLeaveType'
,
method
:
'post'
,
data
});
}
/**
*条件审批保存
*/
export
function
setOtherCondition
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/SetOtherCondition'
,
method
:
'post'
,
data
});
}
/**
*条件审批删除
*/
export
function
delOtherCondition
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/DelOtherCondition'
,
method
:
'post'
,
data
});
}
/**
*审核的保存
*/
export
function
setDefaultCondition
(
data
)
{
return
request
({
url
:
'/WorkFlowManagement/SetDefaultCondition'
,
method
:
'post'
,
data
});
}
src/api/users/user.js
View file @
6557b918
...
...
@@ -76,3 +76,14 @@ export function BatchResetUserPassword(data)
data
})
}
/**
* 获取部门Id
*/
export
function
getEmployeeAddrBook
(
data
)
{
return
request
({
url
:
'/User/GetEmployeeAddrBook'
,
method
:
'post'
,
data
})
}
src/assets/images/administration/auditprocess.png
0 → 100644
View file @
6557b918
1.01 KB
src/pages/administration/Approval.vue
View file @
6557b918
<
template
>
<div>
<div
class=
"query-box
appProval
"
>
<div
class=
"appProval"
>
<div
class=
"query-box "
>
<ul>
<li><span><em>
所属
公司
</em>
<li><span><em>
所属
校区
</em>
<el-select
:disabled=
"IsParentCompany!=1"
v-model=
"QueryMsg.BranchId"
@
change=
"getList()"
>
<el-option
v-for=
"item in companyList"
...
...
@@ -12,47 +12,47 @@
</el-option>
</el-select>
</span></li>
<li>
<!--
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"查询"
@
click=
"getList()"
/>
-->
</li>
<li></li>
</ul>
</div>
<div
class=
"flexOne"
>
<div
class=
"approval_title"
>
出勤休假(4)
</div>
<div
class=
"approval_list"
v-loading=
'loading'
>
<div
class=
"approval_item"
v-for=
"(item,index) in dataList"
>
<img
:src=
"item.Icon"
width=
"86"
style=
"float: left;margin: 17px 20px 0 0;"
/>
<div
class=
"approval_desDiv"
>
<p
class=
"tit"
>
{{
item
.
Name
}}
</p>
<div
class=
"row"
>
<div
class=
"approval_item col shadow-1"
v-for=
"(item,index) in dataList"
:style=
"
{'margin-right':dataList.length!=index+1?'40px':'0' }">
<img
:src=
"item.Icon"
width=
"86"
style=
""
/>
<span
class=
"tit"
>
{{
item
.
Name
}}
</span>
<p
class=
"updateP"
>
全部可见
</p>
<div
style=
"width: 36px;height: 2px;background: #E2E2E2;margin: 8px;"
></div>
<p
class=
"des"
v-html=
"item.describe"
></p>
<p
class=
"des"
v-html=
"item.describe2"
></p>
<p
class=
"tim"
>
{{
item
.
UpdateTime
}}
</p>
<div
class=
"row"
style=
"margin-top: 50px;justify-content: space-around;width: 100%"
v-if=
'item.Status==1'
>
<q-btn
color=
"primary"
label=
"审批流程"
style=
"padding: 0 20px"
@
click=
"workflow(item.Id)"
></q-btn>
<q-btn
outline
style=
"color: #2961FE;padding: 0 10px"
label=
"停用"
@
click=
"updateTempStatus(item.Id,item.TemplateType,item.Status)"
></q-btn>
</div>
<div
class=
"approval_fwDiv"
>
<p>
可见范围
</p>
<p
class=
"updateP"
>
全部可见
</p>
<div
class=
"row"
style=
"margin-top: 50px;justify-content: center;"
v-if=
'item.Status==2'
>
<q-btn
outline
style=
"color: #2961FE;padding: 0 10px"
label=
"启用"
@
click=
"updateTempStatus(item.Id,item.TemplateType,item.Status)"
></q-btn>
</div>
<div
class=
"approval_doDiv"
>
<p>
<button
v-if=
'item.Status==1'
class=
"normalBtn"
@
click=
"goUrl('ApprovalProcess',item.Id)"
>
审批流程
</button>
<button
v-if=
'item.Status==1'
@
click=
"updateTempStatus(item.Id,item.TemplateType,item.Status)"
class=
"hollowFixedBtn"
>
{{
$t
(
'fnc.tingyong'
)
}}
</button>
<button
v-if=
'item.Status==2'
@
click=
"updateTempStatus(item.Id,item.TemplateType,item.Status)"
class=
"hollowFixedBtn"
>
{{
$t
(
'fnc.qiyong'
)
}}
</button>
</p>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
import
{
getTemplateList
getTemplateList
,
setTemplate
}
from
'../../api/administration/administration'
;
import
{
getSchoolDropdown
//校区下拉
}
from
'../../api/school/index'
export
default
{
data
()
{
return
{
loading
:
true
,
...
...
@@ -63,30 +63,33 @@
//返回数据
dataList
:
[],
companyList
:
[],
IsParentCompany
:
2
IsParentCompany
:
2
,
drawer
:
false
,
SpId
:
0
}
},
methods
:
{
workflow
(
Id
){
this
.
$router
.
push
({
path
:
'/administration/ApprovalProcess?Id='
+
Id
+
'&Bid='
+
this
.
QueryMsg
.
BranchId
});
},
getList
()
{
let
describe
=
[
'适用于请假申请,<br/>精确扣减出勤时间,并同步考勤报表'
,
'适用于出差申请,<br/>精确汇总至考勤报表'
,
'适用于外出申请,<br/>精确汇总至考勤报表'
,
'当员工考勤出现缺卡时,可发起补卡审批,<br/>审批通过后考勤报表中的缺卡记录改为正常'
]
// this.apipost('WorkFlow_get_GetTemplateList', {BranchId:this.QueryMsg.BranchId}, res => {
// if(res.data.resultCode == 1) {
// this.loading=false;
// this.dataList = res.data.data[0].List;
// this.dataList.forEach((item, index) => {
// item.describe = describe[index]
// })
//
// }
// }, err => {})
let
describe
=
[
'适用于请假申请'
,
'适用于出差申请'
,
'适用于外出申请'
,
'当员工考勤出现缺卡时,可发起补卡审批'
]
let
describe2
=
[
'精确扣减出勤时间,并同步考勤报表'
,
'精确汇总至考勤报表'
,
'精确汇总至考勤报表'
,
'审批通过后考勤报表中的缺卡记录改为正常'
]
getTemplateList
({
BranchId
:
this
.
QueryMsg
.
BranchId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
loading
=
false
;
this
.
dataList
=
res
.
Data
[
0
].
List
;
this
.
dataList
.
forEach
((
item
,
index
)
=>
{
item
.
describe
=
describe
[
index
]
item
.
describe2
=
describe2
[
index
]
})
}
}).
catch
(()
=>
{
})
},
getCompanyList
()
{
...
...
@@ -114,19 +117,21 @@
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
apipost
(
'WorkFlow_post_SetTemplate'
,
{
setTemplate
(
{
Id
:
id
,
TemplateType
:
type
,
Status
:
2
,
BranchId
:
this
.
QueryMsg
.
BranchId
}
,
res
=>
{
if
(
res
.
data
.
result
Code
==
1
)
{
}
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$message
.
success
(
"已经停用"
)
this
.
getList
()
}
else
{
}
else
{
this
.
$message
.
error
(
"操作失败"
)
}
},
err
=>
{})
}).
catch
(()
=>
{
})
}).
catch
(()
=>
{
this
.
$message
.
info
(
'已取消停用'
)
});
...
...
@@ -137,19 +142,21 @@
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
this
.
apipost
(
'WorkFlow_post_SetTemplate'
,
{
setTemplate
(
{
Id
:
id
,
TemplateType
:
type
,
Status
:
1
,
BranchId
:
this
.
QueryMsg
.
BranchId
}
,
res
=>
{
if
(
res
.
data
.
result
Code
==
1
)
{
}
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$message
.
success
(
"启用成功"
)
this
.
getList
()
}
else
{
this
.
$message
.
error
(
"操作失败"
)
}
},
err
=>
{})
}).
catch
(()
=>
{
})
}).
catch
(()
=>
{
this
.
$message
.
info
(
'已取消启用'
)
...
...
@@ -183,7 +190,11 @@
border-left
:
3px
solid
#E95252
;
margin
:
30px
0
;
}
.appProval
{
background
:
white
;
height
:
90%
;
padding
:
0
20px
;
}
.appProval
.el-input__inner
{
height
:
34px
!important
;
}
...
...
@@ -197,58 +208,58 @@
}
.approval_item
{
height
:
160px
;
padding
:
20px
;
background
:
#fff
;
overflow
:
auto
;
border-radius
:
8px
;
margin-bottom
:
10px
;
background
:
white
;
/*border: 1px solid rgba(2, 44, 66, 0.15);*/
border-radius
:
4px
;
padding
:
40px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.approval_item
p
.tit
{
font-size
:
18px
;
color
:
#333
;
.approval_item
.tit
{
font-size
:
32px
;
color
:
#111111
;
font-weight
:
bold
;
margin-top
:
30px
;
}
.approval_item
p
.des
{
.approval_item
.des
{
font-size
:
14px
;
color
:
#
666
;
color
:
#
999999
;
line-height
:
22px
;
}
.approval_item
p
.tim
{
font-size
:
1
4
px
;
color
:
#
999
;
.approval_item
.tim
{
font-size
:
1
2
px
;
color
:
#
A6A6A6
;
line-height
:
22px
;
}
.approval_fwDiv
{
float
:
left
;
width
:
520px
;
height
:
120px
;
padding
:
50px
0
;
border-right
:
1px
dotted
#DCDFE6
;
}
.approval_fwDiv
>
p
{
text-align
:
center
;
font-size
:
16px
;
color
:
#333
;
}
.approval_
fwDiv
>
p
.updateP
{
.approval_
item
.updateP
{
font-size
:
14px
;
color
:
#
666
;
color
:
#
999999
;
line-height
:
24px
;
}
.approval_doDiv
{
float
:
left
;
width
:
500px
;
.appProval
.drawerTop
{
width
:
100%
;
height
:
50px
;
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
background-color
:
#F0F5FB
;
padding
:
5px
10px
;
align-items
:
center
;
}
.approval_doDiv
>
p
{
text-align
:
center
;
line-height
:
120px
;
.el-drawer__body
{
overflow
:
auto
;
}
/*2.隐藏滚动条,太丑了*/
.el-drawer__container
::-webkit-scrollbar
{
display
:
none
;
}
</
style
>
src/pages/administration/ApprovalProcess.vue
0 → 100644
View file @
6557b918
<
template
>
<div
class=
"flexOne"
style=
"overflow-y: auto"
>
<div
:class=
"
{approval_page_layer:showlayer}" @click="closeLayer">
<div
:class=
"
{approval_person_set:true,approval_person_set_right:isTransition}" @click.stop>
<p
class=
"setTitle"
>
审批人设置
</p>
<div
class=
"approval_person_layerContent"
>
<div
class=
"approval_page_title"
>
审批人类别
</div>
<p
style=
"padding-left: 20px;"
>
<el-radio-group
v-model=
"approvalType"
@
change=
'clearValue'
>
<el-radio
:label=
"1"
>
主管
</el-radio>
<el-radio
:label=
"2"
>
指定成员
</el-radio>
<el-radio
:label=
"3"
>
岗位
</el-radio>
</el-radio-group>
</p>
<div
class=
"approval_layer_info"
v-if=
"approvalType==1"
>
发起人的
<el-select
v-model=
'zgObj.RoleOrInitiator'
@
change=
"changeValue"
>
<el-option
v-for=
'item in zgList'
:label=
'item.label'
:value=
'item.value'
:key=
'item.value'
>
</el-option>
</el-select>
</div>
<div
class=
"approval_layer_info"
v-if=
"approvalType==2"
>
<div
class=
"normalMember"
>
<ul>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
</li>
<!-- @click="mySetCheckedKeys(item.DeptId)"-->
</ul>
</div>
<input
type=
"button"
class=
"normalBtn"
@
click=
"getMember(),mySetCheckedKeys(-1)"
value=
"添加成员"
/>
<div
style=
"margin: 10px 0;"
v-if=
"showMember.length>1"
>
<el-radio-group
v-model=
"zgObj.AuditWay"
>
<el-radio
:label=
"2"
>
会签(须所有审批人同意)
</el-radio>
<el-radio
:label=
"3"
>
或签(一名审批人同意或拒绝即可)
</el-radio>
</el-radio-group>
</div>
</div>
<div
class=
"approval_layer_info"
v-if=
"approvalType==3"
>
<div
class=
"normalMember"
>
<ul>
<li
v-for=
"item in showRole"
>
{{
item
.
DeptName
}}
</li>
<!-- @click="deleteRole()-->
</ul>
</div>
<input
type=
"button"
class=
"normalBtn"
@
click=
"getRole()"
value=
"添加岗位"
/>
<div
style=
"margin: 10px 0;"
>
<el-radio-group
v-model=
"zgObj.AuditWay"
>
<el-radio
:label=
"2"
>
会签(须所有审批人同意)
</el-radio>
<el-radio
:label=
"3"
>
或签(一名审批人同意或拒绝即可)
</el-radio>
</el-radio-group>
</div>
</div>
</div>
<div
class=
"approval_page_layer_bottom"
>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"取消"
@
click=
"closeLayer"
/>
<input
type=
"button"
class=
"normalBtn"
v-if=
'addBtn'
value=
"确定"
@
click=
"addNode"
/>
<input
type=
"button"
class=
"normalBtn"
v-if=
'!addBtn'
value=
"修改节点"
@
click=
"saveUpdateNode"
/>
</div>
</div>
</div>
<input
type=
"button"
class=
"hollowFixedBtn approval_back_btn"
value=
"返回"
@
click=
"goback"
/>
<div
class=
"approval_page_content"
v-loading=
"loading"
>
<p
style=
"text-align: center; border-bottom:1px solid #f1f1f1; padding: 15px 0 10px 0;font-size: 16px;"
>
{{
TemplateTypeName
}}
流程设置
</p>
<div
class=
"approval_page_title"
>
默认审批流程
</div>
<div
class=
"approval_person_content"
>
<span
class=
"approval_span_type"
>
默认审批人
</span>
<div
class=
"approval_person_list fl"
>
<div
class=
"approval_process_item"
draggable=
"true"
v-for=
"(item,index) in myAuditList"
@
click=
"getItemValue(item,index)"
>
<span
style=
"position: relative;"
@
mouseenter=
"itemIndex=index"
@
mouseleave=
"itemIndex='-1'"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
AuditDescription
}}
<b
class=
"bnotice"
v-if=
"item.AuditWay!=1"
>
(
{{
item
.
AuditWay
==
"2"
?
'会签'
:
'或签'
}}
)
</b>
<em
v-if=
'index==itemIndex'
class=
"iconfont icon-guanbi approval_process_item_delete"
@
click
.
stop=
'deleteItem(item.Sort)'
></em>
</span>
<i
class=
"iconfont icon-jiantouyou"
></i>
</div>
<input
type=
"button"
class=
"hollowFixedBtn"
@
click=
"addAppPerson"
value=
"添加"
/>
</div>
</div>
<div
class=
"approval_person_content"
>
<span
class=
"approval_span_type"
>
默认抄送人
</span>
<div
class=
"approval_person_list fl"
>
<div
class=
"approval_process_item"
v-for=
"(item,index) in myAuditUserList"
>
<span
style=
"position: relative;"
@
mouseenter=
"itemIndex1=index"
@
mouseleave=
"itemIndex1='-1'"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
EmName
}}
<em
v-if=
'index==itemIndex1'
@
click=
"deleteUser(item.EmployeeId)"
class=
"iconfont icon-guanbi approval_process_item_delete"
></em>
</span>
</div>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"添加"
@
click=
'addAuditUser'
/>
</div>
</div>
<div
v-if=
'TemplateType!=4'
>
<div
class=
"approval_page_title"
>
分条件审批
</div>
<p>
<input
type=
"button"
value=
"添加"
@
click=
"goUrl(1,TemplateId)"
class=
"hollowFixedBtn"
/>
<span
style=
"font-size: 12px; color: #666; margin-left: 15px;"
>
审批单首先匹配优先级高的条件
</span>
</p>
<div>
<!--
<div
class=
"processOtherDiv"
v-for=
"(item,index) in otherList"
@
click=
"goUrl('updateProcessDesign',item.Id)"
>
-->
<div
class=
"processOtherDiv"
v-for=
"(item,index) in otherList"
@
click=
"goUrl(2,item.Id)"
>
<p
style=
"background: #f1f1f1; padding: 10px 30px;"
>
{{
item
.
Description
}}
<span
class=
"fr processOtherdelSpan"
style=
"margin-left: 10px;"
@
click
.
stop=
"deleteOtherProcess(item.Id)"
>
删除
</span>
<span
class=
"fr processOtherdelSpan"
>
修改
</span>
</p>
<div
style=
"padding: 0 30px;"
>
<p
style=
"padding: 10px 0 0 0;"
>
审批人:
</p>
<div
class=
"approval_process_item"
v-for=
"(item,index) in otherList[index].AuditList"
>
<span
style=
"position: relative;"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
AuditDescription
}}
<b
class=
"bnotice"
v-if=
"item.AuditWay!=1"
>
(
{{
item
.
AuditWay
==
"2"
?
'会签'
:
'或签'
}}
)
</b>
</span>
<i
class=
"iconfont icon-jiantouyou"
></i>
</div>
<p
style=
"padding: 10px 0 0 0;"
>
抄送人:
</p>
<div
class=
"approval_process_item"
v-for=
"(item,index) in otherList[index].AuditUserList"
>
<span
style=
"position: relative;"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
EmName
}}
</span>
</div>
</div>
</div>
</div>
</div>
<div
style=
"margin: 30px 0;"
>
<input
type=
"button"
value=
"取消"
class=
"hollowFixedBtn"
@
click=
"goback"
/>
<input
type=
"button"
value=
"保存"
class=
"normalBtn"
@
click=
"saveApproval"
/>
</div>
</div>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible"
center
:modal=
"false"
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:data=
"memberList"
show-checkbox
:filter-node-method=
"filterNode"
ref=
"tree"
:props=
"defaultProps"
:render-after-expand=
"false"
node-key=
"DeptId"
@
check-change=
"handleNodeChange"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
<i
@
click=
"mySetCheckedKeys(item.DeptId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible = false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"outerVisible = false"
>
确定
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible1"
center
:modal=
"false"
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择岗位:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText1"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:data=
"roleList"
ref=
"treeRole"
show-checkbox
:filter-node-method=
"filterNode1"
:props=
"defaultProps1"
@
check-change=
"checkedRole"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选岗位:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showRole"
>
{{
item
.
DeptName
}}
<i
@
click=
"deleteRole()"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible1= false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"outerVisible1 = false"
>
确定
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible2"
center
:modal=
"false"
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择抄送人:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText2"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:data=
"userList"
show-checkbox
:filter-node-method=
"filterNode2"
ref=
"treeUser"
:props=
"defaultProps2"
:render-after-expand=
"false"
node-key=
"DeptId"
@
check-change=
"handleNodeChange1"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in myAuditUserList1"
>
{{
item
.
EmName
}}
<i
@
click=
"deleteUser(item.EmployeeId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible2 = false"
>
取消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"saveAuditUser"
>
确定
</button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
getDefaultCondition
,
getOtherConditionList
,
delOtherCondition
,
setDefaultCondition
}
from
'../../api/administration/administration'
;
import
{
getEmployeeAddrBook
}
from
'../../api/users/user'
export
default
{
data
()
{
return
{
filterText
:
""
,
filterText1
:
""
,
filterText2
:
""
,
defaultProps
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
defaultProps1
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
disabled
:
"Disabled"
},
defaultProps2
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
zgList
:
[{
value
:
'1'
,
label
:
'直接主管'
},
{
value
:
'2'
,
label
:
'第2级主管'
},
{
value
:
'3'
,
label
:
'第3级主管'
},
{
value
:
'4'
,
label
:
'第4级主管'
},
{
value
:
'5'
,
label
:
'第5级主管'
},
{
value
:
'6'
,
label
:
'第6级主管'
},
],
TemplateType
:
''
,
addBtn
:
true
,
loading
:
true
,
dialogTitle
:
''
,
outerVisible
:
false
,
outerVisible1
:
false
,
outerVisible2
:
false
,
itemIndex
:
-
1
,
itemIndex1
:
-
1
,
approvalType
:
1
,
showlayer
:
false
,
isTransition
:
false
,
updateItem
:[],
updateItemIndex
:
-
1
,
//修改节点
TemplateId
:
''
,
addMsg
:{
Id
:
''
,
TemplateId
:
''
,
AuditList
:[],
AuditUserList
:[],
ConditionSortList
:[],
Sort
:
''
,
},
zgObj
:
{
AuditDescription
:
''
,
RoleOrInitiator
:
'1'
,
AuditType
:
''
,
AuditUserList
:
[],
AuditWay
:
2
,
Sort
:
''
,
},
tempChosenId
:
-
1
,
//返回数据
TemplateTypeName
:
''
,
myAuditList
:
[],
myAuditUserList
:
[],
myAuditUserList1
:[],
memberList
:
[],
sysUserKeys
:[],
userList
:[],
roleList
:
[],
checkedMember
:
[],
showMember
:
[],
showRole
:[],
memberSetCheckedKeys
:
[],
memberSetCheckedUserKeys
:[],
normalMember
:
[],
otherList
:[],
otherListSpr
:[],
otherListCsr
:[],
}
},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
},
filterText1
(
val
)
{
this
.
$refs
.
treeRole
.
filter
(
val
);
},
filterText2
(
val
)
{
this
.
$refs
.
treeUser
.
filter
(
val
);
}
},
methods
:
{
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
filterNode1
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
filterNode2
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
deleteOtherProcess
(
id
){
this
.
$confirm
(
'是否删除?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
delOtherCondition
({
ConditionId
:
id
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
$message
.
success
(
'删除成功!'
);
this
.
getOtherList
()
}
}).
catch
(()
=>
{
})
}).
catch
(()
=>
{
this
.
$message
.
info
(
'已取消删除!'
);
});
},
addAppPerson
(){
this
.
approvalType
=
1
;
this
.
addBtn
=
true
;
this
.
showLayer
();
},
deleteUser
(
id
){
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
id
)
!=-
1
){
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
}
if
(
this
.
myAuditUserList
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
)
!=-
1
)
{
this
.
myAuditUserList
.
splice
(
this
.
myAuditUserList
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
),
1
)
}
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
)
!=-
1
)
{
this
.
myAuditUserList1
.
splice
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
),
1
)
}
},
addAuditUser
(){
let
_arr
=
this
.
sysUserKeys
.
concat
(
this
.
memberSetCheckedUserKeys
)
this
.
dialogTitle
=
'选择人员'
;
this
.
outerVisible2
=
true
;
let
_this
=
this
;
getEmployeeAddrBook
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
userList
=
res
.
Data
_this
.
$refs
.
treeUser
.
setCheckedKeys
(
_arr
);
}
}).
catch
(()
=>
{
})
},
saveAuditUser
(){
if
(
this
.
myAuditUserList1
.
length
<=
10
){
this
.
myAuditUserList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
myAuditUserList1
))
this
.
outerVisible2
=
false
}
else
{
this
.
$message
.
error
(
'人数不能超过10人'
)
return
false
;
}
},
clearValue
(
value
){
if
(
value
==
'1'
){
this
.
zgObj
.
RoleOrInitiator
=
'1'
}
if
(
value
==
'2'
){
this
.
showMember
=
[];
this
.
memberSetCheckedKeys
=
[];
}
if
(
value
==
'3'
){
this
.
showRole
=
[]
this
.
zgObj
.
AuditWay
=
2
}
},
getList
()
{
getDefaultCondition
({
TemplateId
:
this
.
TemplateId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
loading
=
false
this
.
addMsg
.
Id
=
res
.
Data
.
Id
this
.
myAuditList
=
res
.
Data
.
AuditList
==
null
?[]:
res
.
Data
.
AuditList
this
.
myAuditUserList
=
res
.
Data
.
AuditUserList
==
null
?[]:
res
.
Data
.
AuditUserList
this
.
myAuditUserList1
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
myAuditUserList
))
this
.
myAuditUserList1
.
forEach
(
item
=>
{
this
.
sysUserKeys
.
push
(
item
.
EmployeeId
)
})
this
.
TemplateTypeName
=
res
.
Data
.
TemplateTypeName
this
.
TemplateType
=
res
.
Data
.
TemplateType
;
}
else
{}
}).
catch
(()
=>
{
})
},
getOtherList
(){
getOtherConditionList
({
TemplateId
:
this
.
TemplateId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
otherList
=
res
.
Data
this
.
otherListSpr
=
res
.
Data
.
AuditList
}
}).
catch
(()
=>
{
})
},
getMember
()
{
this
.
outerVisible
=
true
;
this
.
dialogTitle
=
'选择人员'
;
getEmployeeAddrBook
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
memberList
=
res
.
Data
}
}).
catch
(()
=>
{
})
},
getRole
()
{
this
.
outerVisible1
=
true
;
this
.
dialogTitle
=
'选择岗位'
;
this
.
apipost
(
'WorkFlow_get_GetDepartMentPost'
,
{},
res
=>
{
this
.
roleList
=
res
.
data
.
data
},
err
=>
{})
},
handleNodeChange1
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
DataType
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
myAuditUserList1
.
forEach
(
x
=>
{
if
(
x
.
EmployeeId
==
data
.
DeptId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
myAuditUserList1
.
push
({
EmName
:
data
.
DeptName
,
EmployeeId
:
data
.
DeptId
,
Sort
:
'1'
})
this
.
memberSetCheckedUserKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
DeptId
)
!=
-
1
)
{
this
.
myAuditUserList1
.
splice
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
DeptId
),
1
)
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
DataType
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
==
-
1
)
{
this
.
memberSetCheckedUserKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
handleNodeChange
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
DataType
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
showMember
.
forEach
(
x
=>
{
if
(
x
.
DeptId
==
data
.
DeptId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
showMember
.
push
({
DeptName
:
data
.
DeptName
,
DeptId
:
data
.
DeptId
})
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
)
!=
-
1
)
{
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
DataType
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
==
-
1
)
{
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
mySetCheckedKeys
(
id
)
{
if
(
this
.
memberSetCheckedKeys
.
length
==
0
)
return
if
(
id
==
-
1
)
{
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
)
return
}
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
id
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
);
},
mySetCheckedUsersKeys
(){
},
checkedRole
(
data
,
checked
){
data
.
IsCheck
=
checked
;
if
(
data
.
Disabled
==
false
&&
data
.
IsCheck
){
this
.
showRole
=
[];
this
.
showRole
.
push
({
DeptName
:
data
.
DeptName
,
Id
:
data
.
DeptId
})
}
},
deleteItem
(
sort
)
{
this
.
myAuditList
.
splice
(
this
.
myAuditList
.
findIndex
(
item
=>
item
.
Sort
===
sort
),
1
)
},
getItemValue
(
obj
,
index
){
this
.
addBtn
=
false
;
this
.
updateItemIndex
=
index
;
this
.
updateItem
=
obj
;
this
.
showLayer
();
this
.
approvalType
=
obj
.
AuditType
;
if
(
obj
.
AuditType
==
1
){
this
.
zgObj
.
RoleOrInitiator
=
obj
.
RoleOrInitiator
.
toString
();
}
if
(
obj
.
AuditType
==
2
){
this
.
showMember
=
[];
this
.
memberSetCheckedKeys
=
[];
this
.
zgObj
.
AuditWay
=
obj
.
AuditWay
;
obj
.
AuditUserList
.
forEach
((
item
,
index
)
=>
{
this
.
showMember
.
push
({
DeptName
:
item
.
EmName
,
DeptId
:
item
.
EmployeeId
})
this
.
memberSetCheckedKeys
.
push
(
item
.
EmployeeId
)
})
}
if
(
obj
.
AuditType
==
3
){
this
.
zgObj
.
AuditWay
=
obj
.
AuditWay
;
this
.
showRole
=
[];
this
.
showRole
.
push
({
DeptName
:
obj
.
AuditDescription
})
}
},
saveUpdateNode
(){
let
zg
=
{}
if
(
this
.
approvalType
==
1
)
{
zg
.
AuditType
=
1
;
zg
.
AuditWay
=
1
;
zg
.
AuditUserList
=
[],
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
RoleOrInitiator
=
this
.
zgObj
.
RoleOrInitiator
let
obj
=
{}
if
(
this
.
tempChosenId
!=
-
1
)
{
obj
=
this
.
zgList
.
find
((
item
)
=>
{
return
item
.
value
===
this
.
tempChosenId
;
})
zg
.
AuditDescription
=
obj
.
label
}
else
{
zg
.
AuditDescription
=
'直接主管'
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
if
(
this
.
approvalType
==
2
)
{
//指定成员
let
Au
=
this
.
showMember
;
let
Auu
=
[];
Au
.
forEach
((
item
,
index
)
=>
{
Auu
.
push
({
EmployeeId
:
item
.
DeptId
,
EmName
:
item
.
DeptName
,
Sort
:
index
})
})
if
(
Auu
.
length
==
1
){
zg
.
AuditWay
=
1
zg
.
AuditDescription
=
Auu
[
0
].
EmName
}
else
if
(
Auu
.
length
>
1
){
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
AuditDescription
=
'指定'
+
this
.
showMember
.
length
+
'人'
}
zg
.
AuditType
=
2
;
zg
.
RoleOrInitiator
=
'-1'
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
Auu
;
if
(
Auu
.
length
==
0
)
{
this
.
$message
.
error
(
"成员不能为空"
)
return
}
else
if
(
Auu
.
length
>
10
){
this
.
$message
.
error
(
"人数不能超过10人!"
)
return
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
if
(
this
.
approvalType
==
3
)
{
//岗位
zg
.
AuditType
=
3
;
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
''
;
if
(
this
.
showRole
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择岗位"
)
return
}
else
{
zg
.
RoleOrInitiator
=
this
.
showRole
[
0
].
Id
;
zg
.
AuditDescription
=
this
.
showRole
[
0
].
DeptName
;
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
this
.
closeLayer
()
},
deleteRole
(){
this
.
showRole
=
[];
},
changeValue
(
value
)
{
this
.
tempChosenId
=
value
},
addNode
()
{
//data>>AuditList>>AuditType 核人类型 1主管(指定一级) 2 指定成员 3角色
let
zg
=
{}
if
(
this
.
approvalType
==
1
)
//主管
{
zg
.
AuditType
=
1
;
zg
.
AuditWay
=
1
;
zg
.
AuditUserList
=
[],
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
RoleOrInitiator
=
this
.
zgObj
.
RoleOrInitiator
let
obj
=
{}
if
(
this
.
tempChosenId
!=
-
1
)
{
obj
=
this
.
zgList
.
find
((
item
)
=>
{
return
item
.
value
===
this
.
tempChosenId
;
})
zg
.
AuditDescription
=
obj
.
label
}
else
{
zg
.
AuditDescription
=
'直接主管'
}
this
.
myAuditList
.
push
(
zg
);
}
if
(
this
.
approvalType
==
2
)
{
//指定成员
let
Au
=
this
.
showMember
;
let
Auu
=
[];
Au
.
forEach
((
item
,
index
)
=>
{
Auu
.
push
({
EmployeeId
:
item
.
DeptId
,
EmName
:
item
.
DeptName
,
Sort
:
index
})
})
if
(
Auu
.
length
==
1
){
zg
.
AuditWay
=
1
zg
.
AuditDescription
=
Auu
[
0
].
EmName
}
else
if
(
Auu
.
length
>
1
){
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
AuditDescription
=
'指定'
+
this
.
showMember
.
length
+
'人'
}
zg
.
AuditType
=
2
;
zg
.
RoleOrInitiator
=
'-1'
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
Auu
;
if
(
Auu
.
length
==
0
)
{
this
.
$message
.
error
(
"成员不能为空"
)
return
}
else
if
(
Auu
.
length
>
10
){
this
.
$message
.
error
(
"人数不能超过10人!"
)
return
}
this
.
myAuditList
.
push
(
zg
);
}
if
(
this
.
approvalType
==
3
)
{
//岗位
zg
.
AuditType
=
3
;
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
''
;
if
(
this
.
showRole
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择部门"
)
return
}
else
{
zg
.
RoleOrInitiator
=
this
.
showRole
[
0
].
Id
;
zg
.
AuditDescription
=
this
.
showRole
[
0
].
DeptName
;
}
this
.
myAuditList
.
push
(
zg
);
}
this
.
closeLayer
()
},
showLayer
()
{
this
.
showlayer
=
true
;
this
.
isTransition
=
true
;
},
closeLayer
()
{
let
_this
=
this
;
setTimeout
(
function
()
{
_this
.
showlayer
=
false
;
},
300
)
this
.
isTransition
=
false
;
},
saveApproval
(){
this
.
addMsg
.
AuditList
=
this
.
myAuditList
;
this
.
addMsg
.
AuditUserList
=
this
.
myAuditUserList
;
this
.
ConditionSortList
=
[],
this
.
addMsg
.
Sort
=
0
,
this
.
loading
=
true
;
setDefaultCondition
(
this
.
addMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
loading
=
false
;
this
.
$message
.
success
(
"操作成功!"
)
}
}).
catch
(()
=>
{
})
},
goUrl
(
tyep
,
id
)
{
if
(
tyep
==
1
){
this
.
$router
.
push
({
path
:
'/administration/processDesign'
,
query
:{
"Id"
:
id
}
})
}
else
if
(
tyep
==
2
){
this
.
$router
.
push
({
path
:
'/administration/updateProcessDesign'
,
query
:{
"Id"
:
id
}
})
}
},
fatherMethodOther
(
type
=
0
){
if
(
type
==
2
){
this
.
getOtherList
()
}
this
.
processshow
=
false
;
},
goback
(){
this
.
$router
.
push
({
path
:
'/administration/Approval?Bid='
+
this
.
$route
.
query
.
Bid
});
},
},
mounted
()
{
this
.
TemplateId
=
this
.
addMsg
.
TemplateId
=
this
.
$route
.
query
.
Id
this
.
getList
()
this
.
getOtherList
()
}
}
</
script
>
<
style
>
.processOtherdelSpan
{
color
:
#E95252
;
}
.processOtherdelSpan
:hover
{
text-decoration
:
underline
;
}
.processOtherDiv
{
font-size
:
12px
;
min-height
:
80px
;
border
:
1px
solid
#D2D2D2
;
margin-top
:
20px
;
cursor
:
pointer
;
}
.showMemberIcon
{
float
:
right
;
font-size
:
20px
;
margin
:
10px
20px
0
0
;
color
:
#999
;
cursor
:
pointer
;
}
.normalMember
{
margin
:
10px
0
;
width
:
700px
;
max-height
:
500px
;
overflow
:
auto
}
.normalMember
li
{
display
:
inline-block
;
margin
:
10px
;
padding
:
5px
10px
;
background
:
#f8f8f8
;
border-radius
:
4px
;
text-align
:
center
;
font-size
:
14px
;
color
:
#333
;
}
.approval_layer_info
{
padding
:
20px
0
0
30px
;
}
.ApprovalProcessBg
{
background
:
#f8f8f8
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.Approval_yxList
{
width
:
300px
;
background
:
#f8f8f8
;
min-height
:
400px
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.Approval_yxList
li
{
line-height
:
40px
;
text-indent
:
15px
;
border-bottom
:
1px
dotted
#eee
;
}
.approval_page_content
i
{
color
:
#999
!important
;
}
.approval_page_layer_bottom
{
position
:
absolute
;
bottom
:
20px
;
padding-left
:
20px
;
}
.approval_span_type
{
float
:
left
;
width
:
120px
;
margin-bottom
:
10px
;
}
.approval_process_item_delete
{
position
:
absolute
;
right
:
2px
;
top
:
-11px
;
font-size
:
5px
;
}
.approval_process_item
{
display
:
inline-block
;
margin
:
10px
5px
10px
0
;
cursor
:
pointer
;
}
.approval_process_item
b
.bnotice
{
color
:
#E95252
;
}
.approval_process_item
>
span
{
padding
:
0
10px
;
min-width
:
100px
;
height
:
40px
;
line-height
:
40px
;
text-align
:
center
;
font-size
:
12px
;
background
:
#f8f8f8
;
border-radius
:
4px
;
display
:
inline-block
;
}
.approval_page_layer
{
position
:
fixed
;
width
:
100%
;
left
:
0
;
top
:
0
;
z-index
:
99
;
height
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
.2
);
}
.approval_page_title
{
height
:
14px
;
line-height
:
14px
;
padding-left
:
15px
;
border-left
:
3px
solid
#E95252
;
margin
:
20px
0
;
}
.approval_back_btn
{
margin
:
20px
0
;
}
.approval_page_content
{
width
:
680px
;
min-height
:
480px
;
overflow
:
hidden
;
padding
:
0
20px
;
background
:
#fff
;
border-radius
:
4px
;
}
.approval_person_content
{
padding
:
0
30px
;
overflow
:
hidden
;
margin-bottom
:
30px
;
}
.approval_person_content
>
span
{
font-size
:
12px
;
color
:
#666
;
margin-right
:
30px
;
}
.approval_person_list
{
float
:
left
;
width
:
550px
;
max-height
:
400px
;
overflow
:
auto
;
}
.approval_person_set
{
width
:
800px
;
height
:
100%
;
transition
:
right
.3s
;
background
:
#fff
;
position
:
fixed
;
top
:
0
;
right
:
-800px
;
box-shadow
:
4px
0px
10px
rgba
(
0
,
0
,
0
,
0.1
)
}
.approval_person_set_right
{
right
:
0
;
}
.approval_person_set
.setTitle
{
height
:
48px
;
line-height
:
48px
;
background
:
#EDEEF0
;
font-size
:
16px
;
color
:
#333
;
text-indent
:
20px
;
}
.approval_person_layerContent
{
padding-left
:
20px
;
overflow
:
hidden
;
}
</
style
>
src/pages/administration/processDesign.vue
0 → 100644
View file @
6557b918
<
template
>
<div
class=
"flexOne"
>
<div
:class=
"
{approval_page_layer:showlayer}" @click="closeLayer">
<div
:class=
"
{approval_person_set:true,approval_person_set_right:isTransition}" @click.stop>
<p
class=
"setTitle"
>
审批人设置
</p>
<div
class=
"approval_person_layerContent"
>
<div
class=
"approval_page_title"
>
审批人类别
</div>
<p
style=
"padding-left: 20px;"
>
<el-radio-group
v-model=
"approvalType"
@
change=
'clearValue'
>
<el-radio
:label=
"1"
>
主管
</el-radio>
<el-radio
:label=
"2"
>
指定成员
</el-radio>
<el-radio
:label=
"3"
>
岗位
</el-radio>
</el-radio-group>
</p>
<div
class=
"approval_layer_info"
v-if=
"approvalType==1"
>
发起人的
<el-select
v-model=
'zgObj.RoleOrInitiator'
@
change=
"changeValue"
>
<el-option
v-for=
'item in zgList'
:label=
'item.label'
:value=
'item.value'
:key=
'item.value'
>
</el-option>
</el-select>
</div>
<div
class=
"approval_layer_info"
v-if=
"approvalType==2"
>
<div
class=
"normalMember"
>
<ul>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
</li>
<!-- @click="mySetCheckedKeys(item.DeptId)"-->
</ul>
</div>
<input
type=
"button"
class=
"normalBtn"
@
click=
"getMember(),mySetCheckedKeys(-1)"
value=
"添加成员"
/>
<div
style=
"margin: 10px 0;"
v-if=
"showMember.length>1"
>
<el-radio-group
v-model=
"zgObj.AuditWay"
>
<el-radio
:label=
"2"
>
会签(须所有审批人同意)
</el-radio>
<el-radio
:label=
"3"
>
或签(一名审批人同意或拒绝即可)
</el-radio>
</el-radio-group>
</div>
</div>
<div
class=
"approval_layer_info"
v-if=
"approvalType==3"
>
<div
class=
"normalMember"
>
<ul>
<li
v-for=
"item in showRole"
>
{{
item
.
DeptName
}}
</li>
</ul>
</div>
<input
type=
"button"
class=
"normalBtn"
@
click=
"getRole()"
value=
"添加岗位"
/>
<div
style=
"margin: 10px 0;"
>
<el-radio-group
v-model=
"zgObj.AuditWay"
>
<el-radio
:label=
"2"
>
会签(须所有审批人同意)
</el-radio>
<el-radio
:label=
"3"
>
或签(一名审批人同意或拒绝即可)
</el-radio>
</el-radio-group>
</div>
</div>
</div>
<div
class=
"approval_page_layer_bottom"
>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"取消"
@
click=
"closeLayer"
/>
<input
type=
"button"
class=
"normalBtn"
v-if=
'addBtn'
value=
"确定"
@
click=
"addNode"
/>
<input
type=
"button"
class=
"normalBtn"
v-if=
'!addBtn'
value=
"修改节点"
@
click=
"saveUpdateNode"
/>
</div>
</div>
</div>
<input
type=
"button"
class=
"hollowFixedBtn approval_back_btn"
value=
"返回"
@
click=
"goback"
/>
<div
class=
"approval_page_content"
v-loading=
"loading"
>
<div>
<p
style=
"text-align: center; border-bottom:1px solid #f1f1f1; padding: 15px 0 10px 0;font-size: 16px;"
>
{{
TemplateTypeName
}}
流程设置
</p>
<p
style=
"padding: 10px; font-size: 14px; overflow: hidden;"
>
当审批同时满足以下条件时
</p>
<p
v-if=
'askListType==1'
class=
"processTimeP"
style=
"overflow: hidden"
>
<span
style=
"padding: 10px; font-size: 14px; float: left;"
>
请假类型:
</span>
<el-checkbox-group
class=
'fl'
v-model=
"AskforleaveTypeArr"
>
<el-checkbox
v-for=
"item in askList"
:label=
"item.Id"
:key=
'item.Id'
>
{{
item
.
Name
}}
</el-checkbox>
</el-checkbox-group>
</p>
<p
class=
"processTime"
>
<span>
时长
<em
v-if=
"askListType==2"
>
(天)
</em><em
v-else
>
(小时)
</em></span>
:
<el-select
class=
'w120'
v-model=
'addMsg.ConditionType'
>
<el-option
label=
'小于'
value=
'1'
></el-option>
<el-option
label=
'大于'
value=
'2'
></el-option>
<el-option
label=
'等于'
value=
'3'
></el-option>
<el-option
label=
'小于等于'
value=
'4'
></el-option>
<el-option
label=
'大于等于'
value=
'5'
></el-option>
<el-option
label=
'介于(两个数之间)'
value=
'6'
></el-option>
</el-select>
<el-input-number
v-if=
"addMsg.ConditionType!=6"
class=
'w80'
v-model=
"addMsg.StartValue"
:controls=
"false"
:min=
"0"
:max=
"1000"
></el-input-number>
<span
v-if=
"addMsg.ConditionType==6"
>
<el-input-number
class=
'w80'
v-model=
"addMsg.StartValue"
:controls=
"false"
:min=
"0"
:max=
"1000"
></el-input-number>
<el-select
class=
'w80'
v-model=
'addMsg.StartType'
>
<el-option
label=
'
<
'
value=
'1'
></el-option>
<el-option
label=
'≤'
value=
'2'
></el-option>
</el-select>
时长
<el-select
class=
'w80'
v-model=
'addMsg.EndType'
>
<el-option
label=
'
<
'
value=
'1'
></el-option>
<el-option
label=
'≤'
value=
'2'
></el-option>
</el-select>
<el-input-number
class=
'w80'
v-model=
"addMsg.EndValue"
:controls=
"false"
:min=
"0"
:max=
"1000"
></el-input-number>
</span>
</p>
</div>
<div
class=
"approval_person_content"
>
<span
class=
"approval_span_type"
style=
"display: inline-block; margin: 10px 0;"
>
审批人
</span>
<div
class=
"approval_person_list fl"
>
<div
class=
"approval_process_item"
draggable=
"true"
v-for=
"(item,index) in myAuditList"
@
click=
"getItemValue(item,index)"
>
<span
style=
"position: relative;"
@
mouseenter=
"itemIndex=index"
@
mouseleave=
"itemIndex='-1'"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
AuditDescription
}}
<b
class=
"bnotice"
v-if=
"item.AuditWay!=1"
>
(
{{
item
.
AuditWay
==
"2"
?
'会签'
:
'或签'
}}
)
</b>
<em
v-if=
'index==itemIndex'
class=
"iconfont icon-guanbi approval_process_item_delete"
@
click
.
stop=
'deleteItem(item.Sort)'
></em>
</span>
<i
class=
"iconfont icon-jiantouyou"
></i>
</div>
<input
type=
"button"
class=
"hollowFixedBtn"
@
click=
"addAppPerson"
value=
"添加"
/>
</div>
</div>
<div
class=
"approval_person_content"
>
<span
class=
"approval_span_type"
style=
"display: inline-block; margin: 10px 0;"
>
抄送人
</span>
<div
class=
"approval_person_list fl"
>
<div
class=
"approval_process_item"
v-for=
"(item,index) in myAuditUserList"
>
<span
style=
"position: relative;"
@
mouseenter=
"itemIndex1=index"
@
mouseleave=
"itemIndex1='-1'"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
EmName
}}
<em
v-if=
'index==itemIndex1'
@
click=
"deleteUser(item.EmployeeId)"
class=
"iconfont icon-guanbi approval_process_item_delete"
></em>
</span>
</div>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"添加"
@
click=
'addAuditUser'
/>
</div>
</div>
<div
style=
"margin: 30px 0;"
>
<input
type=
"button"
value=
"取消"
class=
"hollowFixedBtn"
@
click=
"goback"
/>
<input
type=
"button"
value=
"保存"
class=
"normalBtn"
@
click=
"saveApproval"
/>
</div>
</div>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible"
center
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode"
:data=
"memberList"
show-checkbox
ref=
"tree"
:props=
"defaultProps"
:render-after-expand=
"false"
node-key=
"DeptId"
@
check-change=
"handleNodeChange"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showMember"
>
{{
item
.
DeptName
}}
<i
@
click=
"mySetCheckedKeys(item.DeptId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible = false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"outerVisible = false"
>
确定
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible1"
center
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择岗位:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText1"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode1"
:data=
"roleList"
ref=
"treeRole"
show-checkbox
:props=
"defaultProps1"
@
check-change=
"checkedRole"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选岗位:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showRole"
>
{{
item
.
DeptName
}}
<i
@
click=
"deleteRole()"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible1= false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"outerVisible1 = false"
>
确定
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible2"
center
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择抄送人:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText2"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode2"
:data=
"userList"
show-checkbox
ref=
"treeUser"
:props=
"defaultProps2"
:render-after-expand=
"false"
node-key=
"DeptId"
@
check-change=
"handleNodeChange1"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in myAuditUserList1"
>
{{
item
.
EmName
}}
<i
@
click=
"deleteUser(item.EmployeeId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible2 = false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"saveAuditUser"
>
确定
</button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
getAskForLeaveType
,
setOtherCondition
}
from
'../../api/administration/administration'
;
import
{
getEmployeeAddrBook
}
from
'../../api/users/user'
export
default
{
data
()
{
return
{
filterText
:
""
,
filterText1
:
""
,
filterText2
:
""
,
defaultProps
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
defaultProps1
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
disabled
:
"Disabled"
},
defaultProps2
:
{
children
:
'ChildList'
,
label
:
'DeptName'
,
},
zgList
:
[{
value
:
'1'
,
label
:
'直接主管'
},
{
value
:
'2'
,
label
:
'第2级主管'
},
{
value
:
'3'
,
label
:
'第3级主管'
},
{
value
:
'4'
,
label
:
'第4级主管'
},
{
value
:
'5'
,
label
:
'第5级主管'
},
{
value
:
'6'
,
label
:
'第6级主管'
},
],
askListType
:
''
,
askList
:
[],
addBtn
:
true
,
loading
:
true
,
dialogTitle
:
''
,
outerVisible
:
false
,
outerVisible1
:
false
,
outerVisible2
:
false
,
itemIndex
:
-
1
,
itemIndex1
:
-
1
,
approvalType
:
1
,
showlayer
:
false
,
isTransition
:
false
,
updateItem
:
[],
updateItemIndex
:
-
1
,
//修改节点
TemplateId
:
''
,
AskforleaveTypeArr
:
[],
addMsg
:
{
Id
:
'-1'
,
TemplateId
:
''
,
AuditList
:
[],
AuditUserList
:
[],
AskforleaveType
:
[],
DayHour
:
1
,
ConditionType
:
'1'
,
StartValue
:
''
,
StartType
:
'1'
,
EndValue
:
''
,
EndType
:
'1'
,
Sort
:
''
,
},
zgObj
:
{
AuditDescription
:
''
,
RoleOrInitiator
:
'1'
,
AuditType
:
''
,
AuditUserList
:
[],
AuditWay
:
2
,
Sort
:
''
,
},
tempChosenId
:
-
1
,
//返回数据
TemplateTypeName
:
''
,
myAuditList
:
[],
myAuditUserList
:
[],
myAuditUserList1
:
[],
memberList
:
[],
sysUserKeys
:
[],
userList
:
[],
roleList
:
[],
checkedMember
:
[],
showMember
:
[],
showRole
:
[],
memberSetCheckedKeys
:
[],
memberSetCheckedUserKeys
:
[],
normalMember
:
[],
}
},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
},
filterText1
(
val
)
{
this
.
$refs
.
treeRole
.
filter
(
val
);
},
filterText2
(
val
)
{
this
.
$refs
.
treeUser
.
filter
(
val
);
}
},
methods
:
{
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
filterNode1
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
filterNode2
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DeptName
.
indexOf
(
value
)
!==
-
1
;
},
getAppType
()
{
getAskForLeaveType
({
TemplateId
:
this
.
TemplateId
}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
loading
=
false
;
this
.
askListType
=
res
.
Data
.
TemplateType
this
.
TemplateTypeName
=
res
.
Data
.
TemplateTypeName
this
.
askList
=
res
.
Data
.
askList
}
}).
catch
(()
=>
{
})
},
addAppPerson
()
{
this
.
approvalType
=
1
;
this
.
addBtn
=
true
;
this
.
showLayer
();
},
deleteUser
(
id
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
id
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
}
if
(
this
.
myAuditUserList
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
)
!=
-
1
)
{
this
.
myAuditUserList
.
splice
(
this
.
myAuditUserList
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
),
1
)
}
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
)
!=
-
1
)
{
this
.
myAuditUserList1
.
splice
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
),
1
)
}
},
addAuditUser
()
{
let
_arr
=
this
.
sysUserKeys
.
concat
(
this
.
memberSetCheckedUserKeys
)
this
.
dialogTitle
=
'选择人员'
;
this
.
outerVisible2
=
true
;
let
_this
=
this
;
getEmployeeAddrBook
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
userList
=
res
.
Data
_this
.
$refs
.
treeUser
.
setCheckedKeys
(
_arr
);
}
}).
catch
(()
=>
{
})
//
},
saveAuditUser
()
{
if
(
this
.
myAuditUserList1
.
length
<=
10
)
{
this
.
myAuditUserList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
myAuditUserList1
))
this
.
outerVisible2
=
false
}
else
{
this
.
$message
.
error
(
'人数不能超过10人'
)
return
false
;
}
},
clearValue
(
value
)
{
if
(
value
==
'1'
)
{
this
.
zgObj
.
RoleOrInitiator
=
'1'
}
if
(
value
==
'2'
)
{
this
.
showMember
=
[];
this
.
memberSetCheckedKeys
=
[];
}
if
(
value
==
'3'
)
{
this
.
showRole
=
[]
this
.
zgObj
.
AuditWay
=
2
}
},
getMember
()
{
this
.
outerVisible
=
true
;
this
.
dialogTitle
=
'选择人员'
;
getEmployeeAddrBook
({}).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
memberList
=
res
.
Data
}
}).
catch
(()
=>
{
})
},
getRole
()
{
this
.
outerVisible1
=
true
;
this
.
dialogTitle
=
'选择岗位'
;
this
.
apipost
(
'WorkFlow_get_GetDepartMentPost'
,
{},
res
=>
{
this
.
roleList
=
res
.
data
.
data
},
err
=>
{})
},
handleNodeChange1
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
DataType
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
myAuditUserList1
.
forEach
(
x
=>
{
if
(
x
.
EmployeeId
==
data
.
DeptId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
myAuditUserList1
.
push
({
EmName
:
data
.
DeptName
,
EmployeeId
:
data
.
DeptId
,
Sort
:
'1'
})
this
.
memberSetCheckedUserKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
DeptId
)
!=
-
1
)
{
this
.
myAuditUserList1
.
splice
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
DeptId
),
1
)
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
DataType
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
==
-
1
)
{
this
.
memberSetCheckedUserKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
handleNodeChange
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
DataType
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
showMember
.
forEach
(
x
=>
{
if
(
x
.
DeptId
==
data
.
DeptId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
showMember
.
push
({
DeptName
:
data
.
DeptName
,
DeptId
:
data
.
DeptId
})
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
)
!=
-
1
)
{
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
DeptId
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
DataType
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
==
-
1
)
{
this
.
memberSetCheckedKeys
.
push
(
data
.
DeptId
)
}
}
else
if
(
data
.
DataType
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DeptId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
mySetCheckedKeys
(
id
)
{
if
(
this
.
memberSetCheckedKeys
.
length
==
0
)
return
if
(
id
==
-
1
)
{
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
)
return
}
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DeptId
===
id
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
);
},
mySetCheckedUsersKeys
()
{
},
checkedRole
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
Disabled
==
false
&&
data
.
IsCheck
)
{
this
.
showRole
=
[];
this
.
showRole
.
push
({
DeptName
:
data
.
DeptName
,
Id
:
data
.
DeptId
})
}
},
deleteItem
(
sort
)
{
this
.
myAuditList
.
splice
(
this
.
myAuditList
.
findIndex
(
item
=>
item
.
Sort
===
sort
),
1
)
},
getItemValue
(
obj
,
index
)
{
this
.
addBtn
=
false
;
this
.
updateItemIndex
=
index
;
this
.
updateItem
=
obj
;
this
.
showLayer
();
this
.
approvalType
=
obj
.
AuditType
;
if
(
obj
.
AuditType
==
1
)
{
this
.
zgObj
.
RoleOrInitiator
=
obj
.
RoleOrInitiator
.
toString
();
}
if
(
obj
.
AuditType
==
2
)
{
this
.
showMember
=
[];
this
.
memberSetCheckedKeys
=
[];
this
.
zgObj
.
AuditWay
=
obj
.
AuditWay
;
obj
.
AuditUserList
.
forEach
((
item
,
index
)
=>
{
this
.
showMember
.
push
({
DeptName
:
item
.
EmName
,
DeptId
:
item
.
EmployeeId
})
this
.
memberSetCheckedKeys
.
push
(
item
.
EmployeeId
)
})
}
if
(
obj
.
AuditType
==
3
)
{
this
.
zgObj
.
AuditWay
=
obj
.
AuditWay
;
this
.
showRole
=
[];
this
.
showRole
.
push
({
DeptName
:
obj
.
AuditDescription
})
}
},
saveUpdateNode
()
{
let
zg
=
{}
if
(
this
.
approvalType
==
1
)
{
zg
.
AuditType
=
1
;
zg
.
AuditWay
=
1
;
zg
.
AuditUserList
=
null
,
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
RoleOrInitiator
=
this
.
zgObj
.
RoleOrInitiator
let
obj
=
{}
if
(
this
.
tempChosenId
!=
-
1
)
{
obj
=
this
.
zgList
.
find
((
item
)
=>
{
return
item
.
value
===
this
.
tempChosenId
;
})
zg
.
AuditDescription
=
obj
.
label
}
else
{
zg
.
AuditDescription
=
'直接主管'
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
if
(
this
.
approvalType
==
2
)
{
//指定成员
let
Au
=
this
.
showMember
;
let
Auu
=
[];
Au
.
forEach
((
item
,
index
)
=>
{
Auu
.
push
({
EmployeeId
:
item
.
DeptId
,
EmName
:
item
.
DeptName
,
Sort
:
index
})
})
if
(
Auu
.
length
==
1
){
zg
.
AuditWay
=
1
zg
.
AuditDescription
=
Auu
[
0
].
EmName
}
else
if
(
Auu
.
length
>
1
){
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
AuditDescription
=
'指定'
+
this
.
showMember
.
length
+
'人'
}
zg
.
AuditType
=
2
;
zg
.
RoleOrInitiator
=
'-1'
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
Auu
;
if
(
Auu
.
length
==
0
)
{
this
.
$message
.
error
(
"成员不能为空"
)
return
}
else
if
(
Auu
.
length
>
10
)
{
this
.
$message
.
error
(
"人数不能超过10人!"
)
return
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
if
(
this
.
approvalType
==
3
)
{
//岗位
zg
.
AuditType
=
3
;
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
''
;
if
(
this
.
showRole
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择岗位"
)
return
}
else
{
zg
.
RoleOrInitiator
=
this
.
showRole
[
0
].
Id
;
zg
.
AuditDescription
=
this
.
showRole
[
0
].
DeptName
;
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
this
.
closeLayer
()
},
deleteRole
()
{
this
.
showRole
=
[];
},
changeValue
(
value
)
{
this
.
tempChosenId
=
value
},
addNode
()
{
//data>>AuditList>>AuditType 核人类型 1主管(指定一级) 2 指定成员 3角色
let
zg
=
{}
if
(
this
.
approvalType
==
1
)
//主管
{
zg
.
AuditType
=
1
;
zg
.
AuditWay
=
1
;
zg
.
AuditUserList
=
null
,
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
RoleOrInitiator
=
this
.
zgObj
.
RoleOrInitiator
let
obj
=
{}
if
(
this
.
tempChosenId
!=
-
1
)
{
obj
=
this
.
zgList
.
find
((
item
)
=>
{
return
item
.
value
===
this
.
tempChosenId
;
})
zg
.
AuditDescription
=
obj
.
label
}
else
{
zg
.
AuditDescription
=
'直接主管'
}
this
.
myAuditList
.
push
(
zg
);
}
if
(
this
.
approvalType
==
2
)
{
//指定成员
let
Au
=
this
.
showMember
;
let
Auu
=
[];
Au
.
forEach
((
item
,
index
)
=>
{
Auu
.
push
({
EmployeeId
:
item
.
DeptId
,
EmName
:
item
.
DeptName
,
Sort
:
index
})
})
if
(
Auu
.
length
==
1
){
zg
.
AuditWay
=
1
zg
.
AuditDescription
=
Auu
[
0
].
EmName
}
else
if
(
Auu
.
length
>
1
){
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
AuditDescription
=
'指定'
+
this
.
showMember
.
length
+
'人'
}
zg
.
AuditType
=
2
;
zg
.
RoleOrInitiator
=
'-1'
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
Auu
;
if
(
Auu
.
length
==
0
)
{
this
.
$message
.
error
(
"成员不能为空"
)
return
}
else
if
(
Auu
.
length
>
10
)
{
this
.
$message
.
error
(
"人数不能超过10人!"
)
return
}
this
.
myAuditList
.
push
(
zg
);
}
if
(
this
.
approvalType
==
3
)
{
//岗位
zg
.
AuditType
=
3
;
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
''
;
if
(
this
.
showRole
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择岗位"
)
return
}
else
{
zg
.
RoleOrInitiator
=
this
.
showRole
[
0
].
Id
;
zg
.
AuditDescription
=
this
.
showRole
[
0
].
DeptName
;
}
this
.
myAuditList
.
push
(
zg
);
}
this
.
closeLayer
()
},
showLayer
()
{
this
.
showlayer
=
true
;
this
.
isTransition
=
true
;
},
closeLayer
()
{
let
_this
=
this
;
setTimeout
(
function
()
{
_this
.
showlayer
=
false
;
},
300
)
this
.
isTransition
=
false
;
},
saveApproval
()
{
if
(
this
.
askListType
==
1
)
{
if
(
this
.
AskforleaveTypeArr
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择请假类型!"
)
return
}
}
if
(
this
.
addMsg
.
ConditionType
!=
6
&&
this
.
addMsg
.
StartValue
==
''
){
this
.
$message
.
error
(
"请输入时长!"
)
return
}
if
(
this
.
addMsg
.
ConditionType
==
6
)
{
if
(
this
.
addMsg
.
StartValue
==
''
||
this
.
addMsg
.
EndValue
==
''
){
this
.
$message
.
error
(
"请输入时长!"
)
return
}
}
this
.
addMsg
.
AuditList
=
this
.
myAuditList
;
this
.
addMsg
.
AuditUserList
=
this
.
myAuditUserList
;
this
.
ConditionSortList
=
[],
this
.
addMsg
.
AskforleaveType
=
'['
+
this
.
AskforleaveTypeArr
.
toString
()
+
']'
this
.
loading
=
true
;
setOtherCondition
(
this
.
addMsg
).
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
loading
=
false
;
this
.
$message
.
success
(
"操作成功!"
)
this
.
goback
()
}
else
{
this
.
$message
.
success
(
res
.
Message
)
}
}).
catch
(()
=>
{
})
},
goback
()
{
history
.
back
(
-
1
)
},
},
mounted
()
{
this
.
TemplateId
=
this
.
addMsg
.
TemplateId
=
this
.
$route
.
query
.
Id
this
.
getAppType
()
}
}
</
script
>
<
style
>
.processTimeP
.el-checkbox
+
.el-checkbox
{
margin-left
:
10px
;
margin-top
:
10px
;
}
.processTime
{
margin
:
10px
0
;
font-size
:
14px
;
padding-left
:
10px
;
}
.processTime
.el-input
{
height
:
38px
;
}
.processTime
em
{
font-style
:
normal
;
}
.processTime
.el-input
.el-input__inner
{
border-radius
:
4px
!important
;
}
.showMemberIcon
{
float
:
right
;
font-size
:
20px
;
margin
:
10px
20px
0
0
;
color
:
#999
;
cursor
:
pointer
;
}
.normalMember
{
margin
:
10px
0
;
width
:
700px
;
max-height
:
500px
;
overflow
:
auto
}
.normalMember
li
{
display
:
inline-block
;
margin
:
10px
;
padding
:
5px
10px
;
background
:
#f8f8f8
;
border-radius
:
4px
;
text-align
:
center
;
font-size
:
14px
;
color
:
#333
;
}
.approval_layer_info
{
padding
:
20px
0
0
30px
;
}
.ApprovalProcessBg
{
background
:
#f8f8f8
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.Approval_yxList
{
width
:
300px
;
background
:
#f8f8f8
;
min-height
:
400px
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.Approval_yxList
li
{
line-height
:
40px
;
text-indent
:
15px
;
border-bottom
:
1px
dotted
#eee
;
}
.approval_page_content
i
{
color
:
#999
!important
;
}
.approval_page_layer_bottom
{
position
:
absolute
;
bottom
:
20px
;
padding-left
:
20px
;
}
.approval_span_type
{
float
:
left
;
width
:
120px
;
margin-bottom
:
10px
;
}
.approval_process_item_delete
{
position
:
absolute
;
right
:
2px
;
top
:
-11px
;
font-size
:
5px
;
}
.approval_process_item
{
display
:
inline-block
;
margin
:
10px
5px
10px
0
;
cursor
:
pointer
;
}
.approval_process_item
b
.bnotice
{
color
:
#E95252
;
}
.approval_process_item
>
span
{
padding
:
0
10px
;
min-width
:
100px
;
height
:
40px
;
line-height
:
40px
;
text-align
:
center
;
font-size
:
12px
;
background
:
#f8f8f8
;
border-radius
:
4px
;
display
:
inline-block
;
}
.approval_page_layer
{
position
:
fixed
;
width
:
100%
;
left
:
0
;
top
:
0
;
z-index
:
99
;
height
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
.2
);
}
.approval_page_title
{
height
:
14px
;
line-height
:
14px
;
padding-left
:
15px
;
border-left
:
3px
solid
#E95252
;
margin
:
20px
0
20px
0
;
}
.approval_back_btn
{
margin
:
20px
0
;
}
.approval_page_content
{
width
:
680px
;
min-height
:
480px
;
overflow
:
hidden
;
padding
:
0
20px
;
background
:
#fff
;
border-radius
:
4px
;
}
.approval_person_content
{
padding
:
0
30px
;
overflow
:
hidden
;
margin-bottom
:
30px
;
}
.approval_person_content
>
span
{
font-size
:
12px
;
color
:
#666
;
margin-right
:
30px
;
}
.approval_person_list
{
float
:
left
;
width
:
550px
;
max-height
:
400px
;
overflow
:
auto
;
}
.approval_person_set
{
width
:
800px
;
height
:
100%
;
transition
:
right
.3s
;
background
:
#fff
;
position
:
absolute
;
top
:
0
;
right
:
-800px
;
box-shadow
:
4px
0px
10px
rgba
(
0
,
0
,
0
,
0.1
)
}
.approval_person_set_right
{
right
:
0
;
}
.approval_person_set
.setTitle
{
height
:
48px
;
line-height
:
48px
;
background
:
#EDEEF0
;
font-size
:
16px
;
color
:
#333
;
text-indent
:
20px
;
}
.approval_person_layerContent
{
padding-left
:
20px
;
overflow
:
hidden
;
}
</
style
>
src/pages/administration/updateProcessDesign.vue
0 → 100644
View file @
6557b918
<
template
>
<div
class=
"flexOne"
>
<div
:class=
"
{approval_page_layer:showlayer}" @click="closeLayer">
<div
:class=
"
{approval_person_set:true,approval_person_set_right:isTransition}" @click.stop>
<p
class=
"setTitle"
>
审批人设置
</p>
<div
class=
"approval_person_layerContent"
>
<div
class=
"approval_page_title"
>
审批人类别
</div>
<p
style=
"padding-left: 20px;"
>
<el-radio-group
v-model=
"approvalType"
@
change=
'clearValue'
>
<el-radio
:label=
"1"
>
主管
</el-radio>
<el-radio
:label=
"2"
>
指定成员
</el-radio>
<el-radio
:label=
"3"
>
岗位
</el-radio>
</el-radio-group>
</p>
<div
class=
"approval_layer_info"
v-if=
"approvalType==1"
>
发起人的
<el-select
v-model=
'zgObj.RoleOrInitiator'
@
change=
"changeValue"
>
<el-option
v-for=
'item in zgList'
:label=
'item.label'
:value=
'item.value'
:key=
'item.value'
>
</el-option>
</el-select>
</div>
<div
class=
"approval_layer_info"
v-if=
"approvalType==2"
>
<div
class=
"normalMember"
>
<ul>
<li
v-for=
"item in showMember"
>
{{
item
.
DepartmentName
}}
</li>
<!-- @click="mySetCheckedKeys(item.DepartmentId)"-->
</ul>
</div>
<input
type=
"button"
class=
"normalBtn"
@
click=
"getMember(),mySetCheckedKeys(-1)"
value=
"添加成员"
/>
<div
style=
"margin: 10px 0;"
v-if=
"showMember.length>1"
>
<el-radio-group
v-model=
"zgObj.AuditWay"
>
<el-radio
:label=
"2"
>
会签(须所有审批人同意)
</el-radio>
<el-radio
:label=
"3"
>
或签(一名审批人同意或拒绝即可)
</el-radio>
</el-radio-group>
</div>
</div>
<div
class=
"approval_layer_info"
v-if=
"approvalType==3"
>
<div
class=
"normalMember"
>
<ul>
<li
v-for=
"item in showRole"
>
{{
item
.
DepartmentName
}}
</li>
</ul>
</div>
<input
type=
"button"
class=
"normalBtn"
@
click=
"getRole()"
value=
"添加岗位"
/>
<div
style=
"margin: 10px 0;"
>
<el-radio-group
v-model=
"zgObj.AuditWay"
>
<el-radio
:label=
"2"
>
会签(须所有审批人同意)
</el-radio>
<el-radio
:label=
"3"
>
或签(一名审批人同意或拒绝即可)
</el-radio>
</el-radio-group>
</div>
</div>
</div>
<div
class=
"approval_page_layer_bottom"
>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"取消"
@
click=
"closeLayer"
/>
<input
type=
"button"
class=
"normalBtn"
v-if=
'addBtn'
value=
"确定"
@
click=
"addNode"
/>
<input
type=
"button"
class=
"normalBtn"
v-if=
'!addBtn'
value=
"修改节点"
@
click=
"saveUpdateNode"
/>
</div>
</div>
</div>
<input
type=
"button"
class=
"hollowFixedBtn approval_back_btn"
value=
"返回"
@
click=
"goback"
/>
<div
class=
"approval_page_content"
v-loading=
"loading"
>
<div>
<p
style=
"text-align: center; border-bottom:1px solid #f1f1f1; padding: 15px 0 10px 0;font-size: 16px;"
>
{{
TemplateTypeName
}}
流程设置
</p>
<p
style=
"padding: 10px; font-size: 14px; overflow: hidden;"
>
当审批同时满足以下条件时
</p>
<p
v-if=
'askListType==1'
class=
"processTimeP"
style=
"overflow: hidden"
>
<span
style=
"padding: 10px; font-size: 14px; float: left;"
>
请假类型:
</span>
<el-checkbox-group
class=
'fl'
v-model=
"AskforleaveTypeArr"
>
<el-checkbox
v-for=
"item in askList"
:label=
"item.Id"
:key=
'item.Id'
>
{{
item
.
Name
}}
</el-checkbox>
</el-checkbox-group>
</p>
<p
class=
"processTime"
>
<span>
时长
<em
v-if=
"askListType==2"
>
(天)
</em><em
v-else
>
(小时)
</em></span>
:
<el-select
class=
'w120'
v-model=
'addMsg.ConditionType'
>
<el-option
label=
'小于'
value=
'1'
></el-option>
<el-option
label=
'大于'
value=
'2'
></el-option>
<el-option
label=
'等于'
value=
'3'
></el-option>
<el-option
label=
'小于等于'
value=
'4'
></el-option>
<el-option
label=
'大于等于'
value=
'5'
></el-option>
<el-option
label=
'介于(两个数之间)'
value=
'6'
></el-option>
</el-select>
<el-input-number
v-if=
"addMsg.ConditionType!=6"
class=
'w80'
v-model=
"addMsg.StartValue"
:controls=
"false"
:min=
"0"
:max=
"1000"
></el-input-number>
<span
v-if=
"addMsg.ConditionType==6"
>
<el-input-number
class=
'w80'
v-model=
"addMsg.StartValue"
:controls=
"false"
:min=
"0"
:max=
"1000"
></el-input-number>
<el-select
class=
'w80'
v-model=
'addMsg.StartType'
>
<el-option
label=
'
<
'
value=
'1'
></el-option>
<el-option
label=
'≤'
value=
'2'
></el-option>
</el-select>
时长
<el-select
class=
'w80'
v-model=
'addMsg.EndType'
>
<el-option
label=
'
<
'
value=
'1'
></el-option>
<el-option
label=
'≤'
value=
'2'
></el-option>
</el-select>
<el-input-number
class=
'w80'
v-model=
"addMsg.EndValue"
:controls=
"false"
:min=
"0"
:max=
"1000"
></el-input-number>
</span>
</p>
</div>
<div
class=
"approval_person_content"
>
<span
class=
"approval_span_type"
style=
"display: inline-block; margin: 10px 0;"
>
审批人
</span>
<div
class=
"approval_person_list fl"
>
<div
class=
"approval_process_item"
draggable=
"true"
v-for=
"(item,index) in myAuditList"
@
click=
"getItemValue(item,index)"
>
<span
style=
"position: relative;"
@
mouseenter=
"itemIndex=index"
@
mouseleave=
"itemIndex='-1'"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
AuditDescription
}}
<b
class=
"bnotice"
v-if=
"item.AuditWay!=1"
>
(
{{
item
.
AuditWay
==
"2"
?
'会签'
:
'或签'
}}
)
</b>
<em
v-if=
'index==itemIndex'
class=
"iconfont icon-guanbi approval_process_item_delete"
@
click
.
stop=
'deleteItem(item.Sort)'
></em>
</span>
<i
class=
"iconfont icon-jiantouyou"
></i>
</div>
<input
type=
"button"
class=
"hollowFixedBtn"
@
click=
"addAppPerson"
value=
"添加"
/>
</div>
</div>
<div
class=
"approval_person_content"
>
<span
class=
"approval_span_type"
style=
"display: inline-block; margin: 10px 0;"
>
抄送人
</span>
<div
class=
"approval_person_list fl"
>
<div
class=
"approval_process_item"
v-for=
"(item,index) in myAuditUserList"
>
<span
style=
"position: relative;"
@
mouseenter=
"itemIndex1=index"
@
mouseleave=
"itemIndex1='-1'"
>
<i
class=
"iconfont icon-user11"
></i>
{{
item
.
EmName
}}
<em
v-if=
'index==itemIndex1'
@
click=
"deleteUser(item.EmployeeId)"
class=
"iconfont icon-guanbi approval_process_item_delete"
></em>
</span>
</div>
<input
type=
"button"
class=
"hollowFixedBtn"
value=
"添加"
@
click=
'addAuditUser'
/>
</div>
</div>
<div
style=
"margin: 30px 0;"
>
<input
type=
"button"
value=
"取消"
class=
"hollowFixedBtn"
@
click=
"goback"
/>
<input
type=
"button"
value=
"保存"
class=
"normalBtn"
@
click=
"saveApproval"
/>
</div>
</div>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible"
center
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode"
:data=
"memberList"
show-checkbox
ref=
"tree"
:props=
"defaultProps"
:render-after-expand=
"false"
node-key=
"DepartmentId"
@
check-change=
"handleNodeChange"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showMember"
>
{{
item
.
DepartmentName
}}
<i
@
click=
"mySetCheckedKeys(item.DepartmentId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible = false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"outerVisible = false"
>
确定
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible1"
center
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择岗位:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText1"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode1"
:data=
"roleList"
ref=
"treeRole"
show-checkbox
:props=
"defaultProps1"
@
check-change=
"checkedRole"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选岗位:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in showRole"
>
{{
item
.
DepartmentName
}}
<i
@
click=
"deleteRole()"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible1= false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"outerVisible1 = false"
>
确定
</button>
</div>
</el-dialog>
<el-dialog
custom-class=
'w700'
:title=
"dialogTitle"
:visible
.
sync=
"outerVisible2"
center
>
<div
class=
"fl"
style=
"width: 300px; margin: 0 20px;"
>
<p
style=
"margin: 0 0 10px 0;"
>
选择抄送人:
<el-input
class=
'w200'
placeholder=
"输入关键字进行过滤"
v-model=
"filterText2"
>
</el-input>
</p>
<el-tree
class=
'ApprovalProcessBg'
:filter-node-method=
"filterNode2"
:data=
"userList"
show-checkbox
ref=
"treeUser"
:props=
"defaultProps2"
:render-after-expand=
"false"
node-key=
"DepartmentId"
@
check-change=
"handleNodeChange1"
>
</el-tree>
</div>
<div
class=
"fl"
>
<p
style=
"margin: 0 0 20px 0;"
>
已选:
</p>
<div
class=
"Approval_yxList"
>
<li
v-for=
"item in myAuditUserList1"
>
{{
item
.
EmName
}}
<i
@
click=
"deleteUser(item.EmployeeId)"
class=
"el-icon-circle-close showMemberIcon"
></i>
</li>
</div>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<button
class=
"hollowFixedBtn"
@
click=
"outerVisible2 = false"
>
取 消
</button>
<button
class=
"normalBtn"
type=
"primary"
@
click=
"saveAuditUser"
>
确定
</button>
</div>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
getAskForLeaveType
,
setOtherCondition
}
from
'../../api/administration/administration'
;
import
{
getEmployeeAddrBook
}
from
'../../api/users/user'
export
default
{
data
()
{
return
{
filterText
:
""
,
filterText1
:
""
,
filterText2
:
""
,
defaultProps
:
{
children
:
'ChildList'
,
label
:
'DepartmentName'
,
},
defaultProps1
:
{
children
:
'ChildList'
,
label
:
'DepartmentName'
,
disabled
:
"Disabled"
},
defaultProps2
:
{
children
:
'ChildList'
,
label
:
'DepartmentName'
,
},
zgList
:
[{
value
:
'1'
,
label
:
'直接主管'
},
{
value
:
'2'
,
label
:
'第2级主管'
},
{
value
:
'3'
,
label
:
'第3级主管'
},
{
value
:
'4'
,
label
:
'第4级主管'
},
{
value
:
'5'
,
label
:
'第5级主管'
},
{
value
:
'6'
,
label
:
'第6级主管'
},
],
aass
:
[],
askListType
:
''
,
askList
:
[],
addBtn
:
true
,
loading
:
true
,
dialogTitle
:
''
,
outerVisible
:
false
,
outerVisible1
:
false
,
outerVisible2
:
false
,
itemIndex
:
-
1
,
itemIndex1
:
-
1
,
approvalType
:
1
,
showlayer
:
false
,
isTransition
:
false
,
updateItem
:
[],
updateItemIndex
:
-
1
,
//修改节点
TemplateId
:
''
,
AskforleaveTypeArr
:
[],
addMsg
:
{
Id
:
'-1'
,
TemplateId
:
''
,
AuditList
:
[],
AuditUserList
:
[],
AskforleaveType
:
[],
DayHour
:
1
,
ConditionType
:
'1'
,
StartValue
:
''
,
StartType
:
'1'
,
EndValue
:
''
,
EndType
:
'1'
,
Sort
:
''
,
},
zgObj
:
{
AuditDescription
:
''
,
RoleOrInitiator
:
'1'
,
AuditType
:
''
,
AuditUserList
:
[],
AuditWay
:
2
,
Sort
:
''
,
},
tempChosenId
:
-
1
,
//返回数据
TemplateTypeName
:
''
,
myAuditList
:
[],
myAuditUserList
:
[],
myAuditUserList1
:
[],
memberList
:
[],
sysUserKeys
:
[],
userList
:
[],
roleList
:
[],
checkedMember
:
[],
showMember
:
[],
showRole
:
[],
memberSetCheckedKeys
:
[],
memberSetCheckedUserKeys
:
[],
normalMember
:
[],
}
},
watch
:
{
filterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
},
filterText1
(
val
)
{
this
.
$refs
.
treeRole
.
filter
(
val
);
},
filterText2
(
val
)
{
this
.
$refs
.
treeUser
.
filter
(
val
);
}
},
methods
:
{
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DepartmentName
.
indexOf
(
value
)
!==
-
1
;
},
filterNode1
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DepartmentName
.
indexOf
(
value
)
!==
-
1
;
},
filterNode2
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
DepartmentName
.
indexOf
(
value
)
!==
-
1
;
},
addAppPerson
()
{
this
.
approvalType
=
1
;
this
.
addBtn
=
true
;
this
.
showLayer
();
},
deleteUser
(
id
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
id
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
}
if
(
this
.
myAuditUserList
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
)
!=
-
1
)
{
this
.
myAuditUserList
.
splice
(
this
.
myAuditUserList
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
),
1
)
}
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
)
!=
-
1
)
{
this
.
myAuditUserList1
.
splice
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
id
),
1
)
}
},
addAuditUser
()
{
let
_arr
=
this
.
sysUserKeys
.
concat
(
this
.
memberSetCheckedUserKeys
)
this
.
dialogTitle
=
'选择人员'
;
this
.
outerVisible2
=
true
;
let
_this
=
this
;
this
.
apipost
(
'WorkFlow_get_GetDepartMentEmployee'
,
{},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
userList
=
res
.
data
.
data
_this
.
$refs
.
treeUser
.
setCheckedKeys
(
_arr
);
}
},
err
=>
{})
//
},
saveAuditUser
()
{
if
(
this
.
myAuditUserList1
.
length
<=
10
)
{
this
.
myAuditUserList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
myAuditUserList1
))
this
.
outerVisible2
=
false
}
else
{
this
.
$message
.
error
(
'人数不能超过10人'
)
return
false
;
}
},
clearValue
(
value
)
{
if
(
value
==
'1'
)
{
this
.
zgObj
.
RoleOrInitiator
=
'1'
}
if
(
value
==
'2'
)
{
this
.
showMember
=
[];
this
.
memberSetCheckedKeys
=
[];
}
if
(
value
==
'3'
)
{
this
.
showRole
=
[]
this
.
zgObj
.
AuditWay
=
2
}
},
getList
()
{
this
.
apipost
(
'WorkFlow_get_GetConditionAndAuditInfo'
,
{
ConditionId
:
this
.
TemplateId
},
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
loading
=
false
this
.
TemplateTypeName
=
res
.
data
.
data
.
TemplateTypeName
this
.
addMsg
.
TemplateId
=
res
.
data
.
data
.
TemplateId
this
.
addMsg
.
Id
=
res
.
data
.
data
.
Id
this
.
askList
=
res
.
data
.
data
.
aftList
;
this
.
askListType
=
res
.
data
.
data
.
TemplateType
this
.
addMsg
.
Sort
=
res
.
data
.
data
.
Sort
let
_arr
=
res
.
data
.
data
.
AskforleaveType
.
substring
(
1
,
res
.
data
.
data
.
AskforleaveType
.
length
-
1
).
split
(
","
)
let
_arr1
=
[]
_arr
.
forEach
(
item
=>
{
_arr1
.
push
(
parseInt
(
item
))
})
this
.
addMsg
.
ConditionType
=
res
.
data
.
data
.
ConditionType
.
toString
()
this
.
addMsg
.
StartValue
=
res
.
data
.
data
.
StartValue
if
(
res
.
data
.
data
.
StartType
!=
null
&&
res
.
data
.
data
.
StartType
!=
''
)
{
this
.
addMsg
.
StartType
=
res
.
data
.
data
.
StartType
.
toString
()
}
if
(
res
.
data
.
data
.
EndValue
!=
null
&&
res
.
data
.
data
.
EndValue
!=
''
)
{
this
.
addMsg
.
EndValue
=
res
.
data
.
data
.
EndValue
}
if
(
res
.
data
.
data
.
EndType
!=
null
&&
res
.
data
.
data
.
EndType
!=
''
)
{
this
.
addMsg
.
EndType
=
res
.
data
.
data
.
EndType
.
toString
()
}
this
.
AskforleaveTypeArr
=
_arr1
this
.
myAuditList
=
res
.
data
.
data
.
AuditList
this
.
myAuditUserList
=
res
.
data
.
data
.
AuditUserList
this
.
myAuditUserList1
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
myAuditUserList
))
this
.
myAuditUserList1
.
forEach
(
item
=>
{
this
.
sysUserKeys
.
push
(
item
.
EmployeeId
)
})
}
else
{}
},
error
=>
{})
},
getMember
()
{
this
.
outerVisible
=
true
;
this
.
dialogTitle
=
'选择人员'
;
this
.
apipost
(
'WorkFlow_get_GetDepartMentEmployee'
,
{},
res
=>
{
this
.
memberList
=
res
.
data
.
data
},
err
=>
{})
},
getRole
()
{
this
.
outerVisible1
=
true
;
this
.
dialogTitle
=
'选择岗位'
;
this
.
apipost
(
'WorkFlow_get_GetDepartMentPost'
,
{},
res
=>
{
this
.
roleList
=
res
.
data
.
data
},
err
=>
{})
},
handleNodeChange1
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
Type
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
myAuditUserList1
.
forEach
(
x
=>
{
if
(
x
.
EmployeeId
==
data
.
DepartmentId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
myAuditUserList1
.
push
({
EmName
:
data
.
DepartmentName
,
EmployeeId
:
data
.
DepartmentId
,
Sort
:
'1'
})
this
.
memberSetCheckedUserKeys
.
push
(
data
.
DepartmentId
)
}
}
else
if
(
data
.
Type
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
DepartmentId
)
!=
-
1
)
{
this
.
myAuditUserList1
.
splice
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
DepartmentId
),
1
)
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
),
1
)
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
Type
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
)
==
-
1
)
{
this
.
memberSetCheckedUserKeys
.
push
(
data
.
DepartmentId
)
}
}
else
if
(
data
.
Type
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
),
1
)
if
(
this
.
myAuditUserList1
.
findIndex
(
item
=>
item
.
EmployeeId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedUserKeys
.
splice
(
this
.
memberSetCheckedUserKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
handleNodeChange
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
Type
==
2
&&
data
.
IsCheck
)
{
//是员工且选中
let
isExsit
=
false
this
.
showMember
.
forEach
(
x
=>
{
if
(
x
.
DepartmentId
==
data
.
DepartmentId
)
{
isExsit
=
true
return
false
}
})
if
(
!
isExsit
)
{
this
.
showMember
.
push
({
DepartmentName
:
data
.
DepartmentName
,
DepartmentId
:
data
.
DepartmentId
})
this
.
memberSetCheckedKeys
.
push
(
data
.
DepartmentId
)
}
}
else
if
(
data
.
Type
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DepartmentId
===
data
.
DepartmentId
)
!=
-
1
)
{
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DepartmentId
===
data
.
DepartmentId
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DepartmentId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
if
(
data
.
Type
!=
2
&&
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
)
==
-
1
)
{
this
.
memberSetCheckedKeys
.
push
(
data
.
DepartmentId
)
}
}
else
if
(
data
.
Type
==
2
&&
!
data
.
IsCheck
)
{
if
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
DepartmentId
),
1
)
if
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DepartmentId
===
data
.
ParentId
)
!=
-
1
)
{
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
data
.
ParentId
),
1
)
}
}
}
},
mySetCheckedKeys
(
id
)
{
if
(
this
.
memberSetCheckedKeys
.
length
==
0
)
return
if
(
id
==
-
1
)
{
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
)
return
}
this
.
showMember
.
splice
(
this
.
showMember
.
findIndex
(
item
=>
item
.
DepartmentId
===
id
),
1
)
this
.
memberSetCheckedKeys
.
splice
(
this
.
memberSetCheckedKeys
.
findIndex
(
item
=>
item
===
id
),
1
)
this
.
$refs
.
tree
.
setCheckedKeys
(
this
.
memberSetCheckedKeys
);
},
mySetCheckedUsersKeys
()
{
},
checkedRole
(
data
,
checked
)
{
data
.
IsCheck
=
checked
;
if
(
data
.
Disabled
==
false
&&
data
.
IsCheck
)
{
this
.
showRole
=
[];
this
.
showRole
.
push
({
DepartmentName
:
data
.
DepartmentName
,
Id
:
data
.
DepartmentId
})
}
},
deleteItem
(
sort
)
{
this
.
myAuditList
.
splice
(
this
.
myAuditList
.
findIndex
(
item
=>
item
.
Sort
===
sort
),
1
)
},
getItemValue
(
obj
,
index
)
{
this
.
addBtn
=
false
;
this
.
updateItemIndex
=
index
;
this
.
updateItem
=
obj
;
this
.
showLayer
();
this
.
approvalType
=
obj
.
AuditType
;
if
(
obj
.
AuditType
==
1
)
{
this
.
zgObj
.
RoleOrInitiator
=
obj
.
RoleOrInitiator
.
toString
();
}
if
(
obj
.
AuditType
==
2
)
{
this
.
showMember
=
[];
this
.
memberSetCheckedKeys
=
[];
this
.
zgObj
.
AuditWay
=
obj
.
AuditWay
;
obj
.
AuditUserList
.
forEach
((
item
,
index
)
=>
{
this
.
showMember
.
push
({
DepartmentName
:
item
.
EmName
,
DepartmentId
:
item
.
EmployeeId
})
this
.
memberSetCheckedKeys
.
push
(
item
.
EmployeeId
)
})
}
if
(
obj
.
AuditType
==
3
)
{
this
.
zgObj
.
AuditWay
=
obj
.
AuditWay
;
this
.
showRole
=
[];
this
.
showRole
.
push
({
DepartmentName
:
obj
.
AuditDescription
})
}
},
saveUpdateNode
()
{
let
zg
=
{}
if
(
this
.
approvalType
==
1
)
{
zg
.
AuditType
=
1
;
zg
.
AuditWay
=
1
;
zg
.
AuditUserList
=
null
,
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
RoleOrInitiator
=
this
.
zgObj
.
RoleOrInitiator
let
obj
=
{}
if
(
this
.
tempChosenId
!=
-
1
)
{
obj
=
this
.
zgList
.
find
((
item
)
=>
{
return
item
.
value
===
this
.
tempChosenId
;
})
zg
.
AuditDescription
=
obj
.
label
}
else
{
zg
.
AuditDescription
=
'直接主管'
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
//this.myAuditList.push(zg);
}
if
(
this
.
approvalType
==
2
)
{
//指定成员
let
Au
=
this
.
showMember
;
let
Auu
=
[];
Au
.
forEach
((
item
,
index
)
=>
{
Auu
.
push
({
EmployeeId
:
item
.
DepartmentId
,
EmName
:
item
.
DepartmentName
,
Sort
:
index
})
})
if
(
Auu
.
length
==
1
)
{
zg
.
AuditWay
=
1
zg
.
AuditDescription
=
Auu
[
0
].
EmName
}
else
if
(
Auu
.
length
>
1
)
{
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
AuditDescription
=
'指定'
+
this
.
showMember
.
length
+
'人'
}
zg
.
AuditType
=
2
;
zg
.
RoleOrInitiator
=
'-1'
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
Auu
;
if
(
Auu
.
length
==
0
)
{
this
.
$message
.
error
(
"成员不能为空"
)
return
}
else
if
(
Auu
.
length
>
10
)
{
this
.
$message
.
error
(
"人数不能超过10人!"
)
return
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
if
(
this
.
approvalType
==
3
)
{
//岗位
zg
.
AuditType
=
3
;
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
''
;
if
(
this
.
showRole
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择岗位"
)
return
}
else
{
zg
.
RoleOrInitiator
=
this
.
showRole
[
0
].
Id
;
zg
.
AuditDescription
=
this
.
showRole
[
0
].
DepartmentName
;
}
this
.
myAuditList
[
this
.
updateItemIndex
]
=
zg
;
}
this
.
closeLayer
()
},
deleteRole
()
{
this
.
showRole
=
[];
},
changeValue
(
value
)
{
this
.
tempChosenId
=
value
},
addNode
()
{
//data>>AuditList>>AuditType 核人类型 1主管(指定一级) 2 指定成员 3角色
let
zg
=
{}
if
(
this
.
approvalType
==
1
)
//主管
{
zg
.
AuditType
=
1
;
zg
.
AuditWay
=
1
;
zg
.
AuditUserList
=
null
,
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
RoleOrInitiator
=
this
.
zgObj
.
RoleOrInitiator
let
obj
=
{}
if
(
this
.
tempChosenId
!=
-
1
)
{
obj
=
this
.
zgList
.
find
((
item
)
=>
{
return
item
.
value
===
this
.
tempChosenId
;
})
zg
.
AuditDescription
=
obj
.
label
}
else
{
zg
.
AuditDescription
=
'直接主管'
}
this
.
myAuditList
.
push
(
zg
);
}
if
(
this
.
approvalType
==
2
)
{
//指定成员
let
Au
=
this
.
showMember
;
let
Auu
=
[];
Au
.
forEach
((
item
,
index
)
=>
{
Auu
.
push
({
EmployeeId
:
item
.
DepartmentId
,
EmName
:
item
.
DepartmentName
,
Sort
:
index
})
})
if
(
Auu
.
length
==
1
)
{
zg
.
AuditWay
=
1
zg
.
AuditDescription
=
Auu
[
0
].
EmName
}
else
if
(
Auu
.
length
>
1
)
{
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
AuditDescription
=
'指定'
+
this
.
showMember
.
length
+
'人'
}
zg
.
AuditType
=
2
;
zg
.
RoleOrInitiator
=
'-1'
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
Auu
;
if
(
Auu
.
length
==
0
)
{
this
.
$message
.
error
(
"成员不能为空"
)
return
}
else
if
(
Auu
.
length
>
10
)
{
this
.
$message
.
error
(
"人数不能超过10人!"
)
return
}
this
.
myAuditList
.
push
(
zg
);
}
if
(
this
.
approvalType
==
3
)
{
//岗位
zg
.
AuditType
=
3
;
zg
.
AuditWay
=
this
.
zgObj
.
AuditWay
;
zg
.
Sort
=
this
.
myAuditList
.
length
+
1
;
zg
.
AuditUserList
=
''
;
if
(
this
.
showRole
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择岗位"
)
return
}
else
{
zg
.
RoleOrInitiator
=
this
.
showRole
[
0
].
Id
;
zg
.
AuditDescription
=
this
.
showRole
[
0
].
DepartmentName
;
}
this
.
myAuditList
.
push
(
zg
);
}
this
.
closeLayer
()
},
showLayer
()
{
this
.
showlayer
=
true
;
this
.
isTransition
=
true
;
},
closeLayer
()
{
let
_this
=
this
;
setTimeout
(
function
()
{
_this
.
showlayer
=
false
;
},
300
)
this
.
isTransition
=
false
;
},
saveApproval
()
{
if
(
this
.
askListType
==
1
)
{
if
(
this
.
AskforleaveTypeArr
.
length
==
0
)
{
this
.
$message
.
error
(
"请选择请假类型!"
)
return
}
}
if
(
this
.
addMsg
.
ConditionType
!=
6
&&
this
.
addMsg
.
StartValue
==
''
)
{
this
.
$message
.
error
(
"请输入时长!"
)
return
}
if
(
this
.
addMsg
.
ConditionType
==
6
)
{
if
(
this
.
addMsg
.
StartValue
==
''
||
this
.
addMsg
.
EndValue
==
''
)
{
this
.
$message
.
error
(
"请输入时长!"
)
return
}
}
this
.
addMsg
.
AuditList
=
this
.
myAuditList
;
this
.
addMsg
.
AuditUserList
=
this
.
myAuditUserList
;
this
.
ConditionSortList
=
[],
this
.
addMsg
.
AskforleaveType
=
'['
+
this
.
AskforleaveTypeArr
.
toString
()
+
']'
this
.
loading
=
true
;
this
.
apipost
(
'WorkFlow_post_SetOtherCondition'
,
this
.
addMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
loading
=
false
;
this
.
$message
.
success
(
"操作成功!"
)
this
.
goback
()
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
)
}
},
err
=>
{})
},
goback
()
{
history
.
back
(
-
1
)
}
},
mounted
()
{
this
.
TemplateId
=
this
.
$route
.
query
.
Id
this
.
getList
()
}
}
</
script
>
<
style
>
.processTimeP
.el-checkbox
+
.el-checkbox
{
margin-left
:
10px
;
margin-top
:
10px
;
}
.processTime
{
margin
:
10px
0
;
font-size
:
14px
;
padding-left
:
10px
;
}
.processTime
.el-input
{
height
:
38px
;
}
.processTime
em
{
font-style
:
normal
;
}
.processTime
.el-input
.el-input__inner
{
border-radius
:
4px
!important
;
}
.showMemberIcon
{
float
:
right
;
font-size
:
20px
;
margin
:
10px
20px
0
0
;
color
:
#999
;
cursor
:
pointer
;
}
.normalMember
{
margin
:
10px
0
;
width
:
700px
;
max-height
:
500px
;
overflow
:
auto
}
.normalMember
li
{
display
:
inline-block
;
margin
:
10px
;
padding
:
5px
10px
;
background
:
#f8f8f8
;
border-radius
:
4px
;
text-align
:
center
;
font-size
:
14px
;
color
:
#333
;
}
.approval_layer_info
{
padding
:
20px
0
0
30px
;
}
.ApprovalProcessBg
{
background
:
#f8f8f8
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.Approval_yxList
{
width
:
300px
;
background
:
#f8f8f8
;
min-height
:
400px
;
max-height
:
400px
;
overflow-y
:
auto
;
}
.Approval_yxList
li
{
line-height
:
40px
;
text-indent
:
15px
;
border-bottom
:
1px
dotted
#eee
;
}
.approval_page_content
i
{
color
:
#999
!important
;
}
.approval_page_layer_bottom
{
position
:
absolute
;
bottom
:
20px
;
padding-left
:
20px
;
}
.approval_span_type
{
float
:
left
;
width
:
120px
;
}
.approval_process_item_delete
{
position
:
absolute
;
right
:
2px
;
top
:
-11px
;
font-size
:
5px
;
}
.approval_process_item
{
display
:
inline-block
;
margin
:
10px
5px
10px
0
;
cursor
:
pointer
;
}
.approval_process_item
b
.bnotice
{
color
:
#E95252
;
}
.approval_process_item
>
span
{
padding
:
0
10px
;
min-width
:
100px
;
height
:
40px
;
line-height
:
40px
;
text-align
:
center
;
font-size
:
12px
;
background
:
#f8f8f8
;
border-radius
:
4px
;
display
:
inline-block
;
}
.approval_page_layer
{
position
:
fixed
;
width
:
100%
;
left
:
0
;
top
:
0
;
z-index
:
99
;
height
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
.2
);
}
.approval_page_title
{
height
:
14px
;
line-height
:
14px
;
padding-left
:
15px
;
border-left
:
3px
solid
#E95252
;
margin
:
20px
0
20px
0
;
}
.approval_back_btn
{
margin
:
20px
0
;
}
.approval_page_content
{
width
:
680px
;
min-height
:
480px
;
overflow
:
hidden
;
padding
:
0
20px
;
background
:
#fff
;
border-radius
:
4px
;
}
.approval_person_content
{
padding
:
0
30px
;
overflow
:
hidden
;
margin-bottom
:
30px
;
}
.approval_person_content
>
span
{
font-size
:
12px
;
color
:
#666
;
margin-right
:
30px
;
}
.approval_person_list
{
float
:
left
;
width
:
550px
;
max-height
:
400px
;
overflow
:
auto
;
}
.approval_person_set
{
width
:
800px
;
height
:
100%
;
transition
:
right
.3s
;
background
:
#fff
;
position
:
absolute
;
top
:
0
;
right
:
-800px
;
box-shadow
:
4px
0px
10px
rgba
(
0
,
0
,
0
,
0.1
)
}
.approval_person_set_right
{
right
:
0
;
}
.approval_person_set
.setTitle
{
height
:
48px
;
line-height
:
48px
;
background
:
#EDEEF0
;
font-size
:
16px
;
color
:
#333
;
text-indent
:
20px
;
}
.approval_person_layerContent
{
padding-left
:
20px
;
overflow
:
hidden
;
}
</
style
>
src/router/routes.js
View file @
6557b918
...
...
@@ -316,6 +316,21 @@ const routes = [{
component
:
()
=>
import
(
"pages/administration/Approval.vue"
)
},
{
path
:
"/administration/ApprovalProcess"
,
//审批流程详情
component
:
()
=>
import
(
"pages/administration/ApprovalProcess.vue"
)
},
{
path
:
"/administration/processDesign"
,
//分条件审批
component
:
()
=>
import
(
"pages/administration/processDesign.vue"
)
},
{
path
:
"/administration/updateProcessDesign"
,
//分条件审批
component
:
()
=>
import
(
"pages/administration/updateProcessDesign.vue"
)
},
{
path
:
"/test"
,
//API测试
component
:
()
=>
...
...
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