Commit 23dfc420 authored by Mac's avatar Mac

提了一哈

parent 6557b918
...@@ -87,6 +87,17 @@ export function setDefaultCondition(data) { ...@@ -87,6 +87,17 @@ export function setDefaultCondition(data) {
}); });
} }
/**
*获取分段流程详情
*/
export function getConditionAndAuditInfo(data) {
return request({
url: '/WorkFlowManagement/GetConditionAndAuditInfo',
method: 'post',
data
});
}
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<div class="approval_layer_info" v-if="approvalType==2"> <div class="approval_layer_info" v-if="approvalType==2">
<div class="normalMember"> <div class="normalMember">
<ul> <ul>
<li v-for="item in showMember">{{item.DepartmentName}}</li> <li v-for="item in showMember">{{item.DeptName}}</li>
<!-- @click="mySetCheckedKeys(item.DepartmentId)"--> <!-- @click="mySetCheckedKeys(item.DeptId)"-->
</ul> </ul>
</div> </div>
<input type="button" class="normalBtn" @click="getMember(),mySetCheckedKeys(-1)" value="添加成员" /> <input type="button" class="normalBtn" @click="getMember(),mySetCheckedKeys(-1)" value="添加成员" />
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<div class="approval_layer_info" v-if="approvalType==3"> <div class="approval_layer_info" v-if="approvalType==3">
<div class="normalMember"> <div class="normalMember">
<ul> <ul>
<li v-for="item in showRole">{{item.DepartmentName}}</li> <li v-for="item in showRole">{{item.DeptName}}</li>
</ul> </ul>
</div> </div>
<input type="button" class="normalBtn" @click="getRole()" value="添加岗位" /> <input type="button" class="normalBtn" @click="getRole()" value="添加岗位" />
...@@ -138,14 +138,14 @@ ...@@ -138,14 +138,14 @@
</p> </p>
<el-tree class='ApprovalProcessBg' <el-tree class='ApprovalProcessBg'
:filter-node-method="filterNode" :filter-node-method="filterNode"
:data="memberList" show-checkbox ref="tree" :props="defaultProps" :render-after-expand="false" node-key="DepartmentId" @check-change="handleNodeChange"> :data="memberList" show-checkbox ref="tree" :props="defaultProps" :render-after-expand="false" node-key="DeptId" @check-change="handleNodeChange">
</el-tree> </el-tree>
</div> </div>
<div class="fl"> <div class="fl">
<p style="margin: 0 0 20px 0;">已选:</p> <p style="margin: 0 0 20px 0;">已选:</p>
<div class="Approval_yxList"> <div class="Approval_yxList">
<li v-for="item in showMember">{{item.DepartmentName}} <li v-for="item in showMember">{{item.DeptName}}
<i @click="mySetCheckedKeys(item.DepartmentId)" class="el-icon-circle-close showMemberIcon"></i> <i @click="mySetCheckedKeys(item.DeptId)" class="el-icon-circle-close showMemberIcon"></i>
</li> </li>
</div> </div>
</div> </div>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<div class="fl"> <div class="fl">
<p style="margin: 0 0 20px 0;">已选岗位:</p> <p style="margin: 0 0 20px 0;">已选岗位:</p>
<div class="Approval_yxList"> <div class="Approval_yxList">
<li v-for="item in showRole">{{item.DepartmentName}} <li v-for="item in showRole">{{item.DeptName}}
<i @click="deleteRole()" class="el-icon-circle-close showMemberIcon"></i> <i @click="deleteRole()" class="el-icon-circle-close showMemberIcon"></i>
</li> </li>
</div> </div>
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
</p> </p>
<el-tree class='ApprovalProcessBg' <el-tree class='ApprovalProcessBg'
:filter-node-method="filterNode2" :filter-node-method="filterNode2"
:data="userList" show-checkbox ref="treeUser" :props="defaultProps2" :render-after-expand="false" node-key="DepartmentId" @check-change="handleNodeChange1"> :data="userList" show-checkbox ref="treeUser" :props="defaultProps2" :render-after-expand="false" node-key="DeptId" @check-change="handleNodeChange1">
</el-tree> </el-tree>
</div> </div>
<div class="fl"> <div class="fl">
...@@ -209,7 +209,9 @@ ...@@ -209,7 +209,9 @@
<script> <script>
import { import {
getAskForLeaveType, getAskForLeaveType,
setOtherCondition setOtherCondition,
setDefaultCondition,
getConditionAndAuditInfo
} from '../../api/administration/administration'; } from '../../api/administration/administration';
import { import {
getEmployeeAddrBook getEmployeeAddrBook
...@@ -222,16 +224,16 @@ ...@@ -222,16 +224,16 @@
filterText2:"", filterText2:"",
defaultProps: { defaultProps: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DeptName',
}, },
defaultProps1: { defaultProps1: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DeptName',
disabled: "Disabled" disabled: "Disabled"
}, },
defaultProps2: { defaultProps2: {
children: 'ChildList', children: 'ChildList',
label: 'DepartmentName', label: 'DeptName',
}, },
zgList: [{ zgList: [{
value: '1', value: '1',
...@@ -330,15 +332,15 @@ ...@@ -330,15 +332,15 @@
methods: { methods: {
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1; return data.DeptName.indexOf(value) !== -1;
}, },
filterNode1(value, data) { filterNode1(value, data) {
if (!value) return true; if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1; return data.DeptName.indexOf(value) !== -1;
}, },
filterNode2(value, data) { filterNode2(value, data) {
if (!value) return true; if (!value) return true;
return data.DepartmentName.indexOf(value) !== -1; return data.DeptName.indexOf(value) !== -1;
}, },
addAppPerson() { addAppPerson() {
this.approvalType = 1; this.approvalType = 1;
...@@ -362,12 +364,14 @@ ...@@ -362,12 +364,14 @@
this.dialogTitle = '选择人员'; this.dialogTitle = '选择人员';
this.outerVisible2 = true; this.outerVisible2 = true;
let _this = this; let _this = this;
this.apipost('WorkFlow_get_GetDepartMentEmployee', {}, res => { getEmployeeAddrBook({}).then(res => {
if(res.data.resultCode == 1) { if(res.Code == 1) {
this.userList = res.data.data this.userList = res.Data
_this.$refs.treeUser.setCheckedKeys(_arr); _this.$refs.treeUser.setCheckedKeys(_arr);
} }
}, err => {}) }).catch(() => {
})
// //
}, },
saveAuditUser() { saveAuditUser() {
...@@ -398,88 +402,101 @@ ...@@ -398,88 +402,101 @@
ConditionId: this.TemplateId ConditionId: this.TemplateId
}, res => { }, res => {
if(res.data.resultCode == 1) { if(res.data.resultCode == 1) {
} else {}
}, error => {})
getConditionAndAuditInfo({ConditionId: this.TemplateId}).then(res => {
if(res.Code == 1) {
this.loading=false this.loading=false
this.TemplateTypeName = res.data.data.TemplateTypeName this.TemplateTypeName = res.Data.TemplateTypeName
this.addMsg.TemplateId=res.data.data.TemplateId this.addMsg.TemplateId=res.Data.TemplateId
this.addMsg.Id = res.data.data.Id this.addMsg.Id = res.Data.Id
this.askList = res.data.data.aftList; this.askList = res.Data.aftList;
this.askListType = res.data.data.TemplateType this.askListType = res.Data.TemplateType
this.addMsg.Sort = res.data.data.Sort this.addMsg.Sort = res.Data.Sort
let _arr = res.data.data.AskforleaveType.substring(1, res.data.data.AskforleaveType.length - 1).split(",") let _arr = res.Data.AskforleaveType.substring(1, res.Data.AskforleaveType.length - 1).split(",")
let _arr1 = [] let _arr1 = []
_arr.forEach(item => { _arr.forEach(item => {
_arr1.push(parseInt(item)) _arr1.push(parseInt(item))
}) })
this.addMsg.ConditionType = res.data.data.ConditionType.toString() this.addMsg.ConditionType = res.Data.ConditionType.toString()
this.addMsg.StartValue = res.data.data.StartValue this.addMsg.StartValue = res.Data.StartValue
if(res.data.data.StartType != null && res.data.data.StartType != '') { if(res.Data.StartType != null && res.Data.StartType != '') {
this.addMsg.StartType = res.data.data.StartType.toString() this.addMsg.StartType = res.Data.StartType.toString()
} }
if(res.data.data.EndValue != null && res.data.data.EndValue != '') { if(res.Data.EndValue != null && res.Data.EndValue != '') {
this.addMsg.EndValue = res.data.data.EndValue this.addMsg.EndValue = res.Data.EndValue
} }
if(res.data.data.EndType != null && res.data.data.EndType != '') { if(res.Data.EndType != null && res.Data.EndType != '') {
this.addMsg.EndType = res.data.data.EndType.toString() this.addMsg.EndType = res.Data.EndType.toString()
} }
this.AskforleaveTypeArr = _arr1 this.AskforleaveTypeArr = _arr1
this.myAuditList = res.data.data.AuditList this.myAuditList = res.Data.AuditList
this.myAuditUserList = res.data.data.AuditUserList this.myAuditUserList = res.Data.AuditUserList
this.myAuditUserList1 = JSON.parse(JSON.stringify(this.myAuditUserList)) this.myAuditUserList1 = JSON.parse(JSON.stringify(this.myAuditUserList))
this.myAuditUserList1.forEach(item => { this.myAuditUserList1.forEach(item => {
this.sysUserKeys.push(item.EmployeeId) this.sysUserKeys.push(item.EmployeeId)
}) })
} else {} }
}, error => {}) }).catch(() => {
})
}, },
getMember() { getMember() {
this.outerVisible = true; this.outerVisible = true;
this.dialogTitle = '选择人员'; this.dialogTitle = '选择人员';
this.apipost('WorkFlow_get_GetDepartMentEmployee', {}, res => { getEmployeeAddrBook({}).then(res => {
this.memberList = res.data.data if(res.Code == 1) {
}, err => {}) this.memberList = res.Data
}
}).catch(() => {
})
}, },
getRole() { getRole() {
this.outerVisible1 = true; this.outerVisible1 = true;
this.dialogTitle = '选择岗位'; this.dialogTitle = '选择岗位';
this.apipost('WorkFlow_get_GetDepartMentPost', {}, res => { this.apipost('WorkFlow_get_GetDepartMentPost', {}, res => {
this.roleList = res.data.data this.roleList = res.Data
}, err => {}) }, err => {})
}, },
handleNodeChange1(data, checked) { handleNodeChange1(data, checked) {
data.IsCheck = checked; data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中 if(data.DataType == 2 && data.IsCheck) { //是员工且选中
let isExsit = false let isExsit = false
this.myAuditUserList1.forEach(x => { this.myAuditUserList1.forEach(x => {
if(x.EmployeeId == data.DepartmentId) { if(x.EmployeeId == data.DeptId) {
isExsit = true isExsit = true
return false return false
} }
}) })
if(!isExsit) { if(!isExsit) {
this.myAuditUserList1.push({ this.myAuditUserList1.push({
EmName: data.DepartmentName, EmName: data.DeptName,
EmployeeId: data.DepartmentId, EmployeeId: data.DeptId,
Sort: '1' Sort: '1'
}) })
this.memberSetCheckedUserKeys.push(data.DepartmentId) this.memberSetCheckedUserKeys.push(data.DeptId)
} }
} else if(data.Type == 2 && !data.IsCheck) { } else if(data.DataType == 2 && !data.IsCheck) {
if(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.DepartmentId) != -1) { if(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.DeptId) != -1) {
this.myAuditUserList1.splice(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.DepartmentId), 1) this.myAuditUserList1.splice(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.DeptId), 1)
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DeptId), 1)
if(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.ParentId) != -1) { if(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1)
} }
} }
} }
if(data.Type != 2 && data.IsCheck) { if(data.DataType != 2 && data.IsCheck) {
if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) == -1) { if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DeptId) == -1) {
this.memberSetCheckedUserKeys.push(data.DepartmentId) this.memberSetCheckedUserKeys.push(data.DeptId)
} }
} else if(data.Type == 2 && !data.IsCheck) { } else if(data.DataType == 2 && !data.IsCheck) {
if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId) != -1) { if(this.memberSetCheckedUserKeys.findIndex(item => item === data.DeptId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DepartmentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.DeptId), 1)
if(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.ParentId) != -1) { if(this.myAuditUserList1.findIndex(item => item.EmployeeId === data.ParentId) != -1) {
this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1) this.memberSetCheckedUserKeys.splice(this.memberSetCheckedUserKeys.findIndex(item => item === data.ParentId), 1)
} }
...@@ -488,38 +505,38 @@ ...@@ -488,38 +505,38 @@
}, },
handleNodeChange(data, checked) { handleNodeChange(data, checked) {
data.IsCheck = checked; data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中 if(data.DataType == 2 && data.IsCheck) { //是员工且选中
let isExsit = false let isExsit = false
this.showMember.forEach(x => { this.showMember.forEach(x => {
if(x.DepartmentId == data.DepartmentId) { if(x.DeptId == data.DeptId) {
isExsit = true isExsit = true
return false return false
} }
}) })
if(!isExsit) { if(!isExsit) {
this.showMember.push({ this.showMember.push({
DepartmentName: data.DepartmentName, DeptName: data.DeptName,
DepartmentId: data.DepartmentId DeptId: data.DeptId
}) })
this.memberSetCheckedKeys.push(data.DepartmentId) this.memberSetCheckedKeys.push(data.DeptId)
} }
} else if(data.Type == 2 && !data.IsCheck) { } else if(data.DataType == 2 && !data.IsCheck) {
if(this.showMember.findIndex(item => item.DepartmentId === data.DepartmentId) != -1) { if(this.showMember.findIndex(item => item.DeptId === data.DeptId) != -1) {
this.showMember.splice(this.showMember.findIndex(item => item.DepartmentId === data.DepartmentId), 1) this.showMember.splice(this.showMember.findIndex(item => item.DeptId === data.DeptId), 1)
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.DepartmentId), 1) this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.DeptId), 1)
if(this.showMember.findIndex(item => item.DepartmentId === data.ParentId) != -1) { if(this.showMember.findIndex(item => item.DeptId === data.ParentId) != -1) {
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.ParentId), 1) this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.ParentId), 1)
} }
} }
} }
if(data.Type != 2 && data.IsCheck) { if(data.DataType != 2 && data.IsCheck) {
if(this.memberSetCheckedKeys.findIndex(item => item === data.DepartmentId) == -1) { if(this.memberSetCheckedKeys.findIndex(item => item === data.DeptId) == -1) {
this.memberSetCheckedKeys.push(data.DepartmentId) this.memberSetCheckedKeys.push(data.DeptId)
} }
} else if(data.Type == 2 && !data.IsCheck) { } else if(data.DataType == 2 && !data.IsCheck) {
if(this.memberSetCheckedKeys.findIndex(item => item === data.DepartmentId) != -1) { if(this.memberSetCheckedKeys.findIndex(item => item === data.DeptId) != -1) {
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.DepartmentId), 1) this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.DeptId), 1)
if(this.showMember.findIndex(item => item.DepartmentId === data.ParentId) != -1) { if(this.showMember.findIndex(item => item.DeptId === data.ParentId) != -1) {
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.ParentId), 1) this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.ParentId), 1)
} }
} }
...@@ -532,7 +549,7 @@ ...@@ -532,7 +549,7 @@
this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys) this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys)
return return
} }
this.showMember.splice(this.showMember.findIndex(item => item.DepartmentId === id), 1) this.showMember.splice(this.showMember.findIndex(item => item.DeptId === id), 1)
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === id), 1) this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === id), 1)
this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys); this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys);
}, },
...@@ -544,8 +561,8 @@ ...@@ -544,8 +561,8 @@
if(data.Disabled == false && data.IsCheck) { if(data.Disabled == false && data.IsCheck) {
this.showRole = []; this.showRole = [];
this.showRole.push({ this.showRole.push({
DepartmentName: data.DepartmentName, DeptName: data.DeptName,
Id: data.DepartmentId Id: data.DeptId
}) })
} }
}, },
...@@ -567,8 +584,8 @@ ...@@ -567,8 +584,8 @@
this.zgObj.AuditWay = obj.AuditWay; this.zgObj.AuditWay = obj.AuditWay;
obj.AuditUserList.forEach((item, index) => { obj.AuditUserList.forEach((item, index) => {
this.showMember.push({ this.showMember.push({
DepartmentName: item.EmName, DeptName: item.EmName,
DepartmentId: item.EmployeeId DeptId: item.EmployeeId
}) })
this.memberSetCheckedKeys.push(item.EmployeeId) this.memberSetCheckedKeys.push(item.EmployeeId)
}) })
...@@ -577,7 +594,7 @@ ...@@ -577,7 +594,7 @@
this.zgObj.AuditWay = obj.AuditWay; this.zgObj.AuditWay = obj.AuditWay;
this.showRole = []; this.showRole = [];
this.showRole.push({ this.showRole.push({
DepartmentName: obj.AuditDescription DeptName: obj.AuditDescription
}) })
} }
...@@ -607,8 +624,8 @@ ...@@ -607,8 +624,8 @@
let Auu = []; let Auu = [];
Au.forEach((item, index) => { Au.forEach((item, index) => {
Auu.push({ Auu.push({
EmployeeId: item.DepartmentId, EmployeeId: item.DeptId,
EmName: item.DepartmentName, EmName: item.DeptName,
Sort: index Sort: index
}) })
}) })
...@@ -642,7 +659,7 @@ ...@@ -642,7 +659,7 @@
return return
} else { } else {
zg.RoleOrInitiator = this.showRole[0].Id; zg.RoleOrInitiator = this.showRole[0].Id;
zg.AuditDescription = this.showRole[0].DepartmentName; zg.AuditDescription = this.showRole[0].DeptName;
} }
this.myAuditList[this.updateItemIndex] = zg; this.myAuditList[this.updateItemIndex] = zg;
} }
...@@ -682,8 +699,8 @@ ...@@ -682,8 +699,8 @@
let Auu = []; let Auu = [];
Au.forEach((item, index) => { Au.forEach((item, index) => {
Auu.push({ Auu.push({
EmployeeId: item.DepartmentId, EmployeeId: item.DeptId,
EmName: item.DepartmentName, EmName: item.DeptName,
Sort: index Sort: index
}) })
}) })
...@@ -718,7 +735,7 @@ ...@@ -718,7 +735,7 @@
return return
} else { } else {
zg.RoleOrInitiator = this.showRole[0].Id; zg.RoleOrInitiator = this.showRole[0].Id;
zg.AuditDescription = this.showRole[0].DepartmentName; zg.AuditDescription = this.showRole[0].DeptName;
} }
this.myAuditList.push(zg); this.myAuditList.push(zg);
} }
...@@ -757,15 +774,18 @@ ...@@ -757,15 +774,18 @@
this.ConditionSortList = [], this.ConditionSortList = [],
this.addMsg.AskforleaveType = '[' + this.AskforleaveTypeArr.toString() + ']' this.addMsg.AskforleaveType = '[' + this.AskforleaveTypeArr.toString() + ']'
this.loading = true; this.loading = true;
this.apipost('WorkFlow_post_SetOtherCondition', this.addMsg, res => { setOtherCondition(this.addMsg).then(res => {
if(res.data.resultCode == 1) { if(res.Code == 1) {
this.loading = false; this.loading = false;
this.$message.success("操作成功!") this.$message.success("操作成功!")
this.goback() this.goback()
}else{ }else {
this.$message.error(res.data.message) this.$message.success(res.Message)
} }
}, err => {}) }).catch(() => {
})
}, },
goback() { goback() {
history.back(-1) history.back(-1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment