|
|
@ -4,11 +4,11 @@
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>人员归属关系</title>
|
|
|
|
<title>人员归属关系</title>
|
|
|
|
|
|
|
|
<#include "/head/headaddedit.html" />
|
|
|
|
<#include "/head/headlist.html" />
|
|
|
|
<link href="${ctx}/static/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
|
|
|
|
<link rel="stylesheet" href="${ctx}/static/js/plugins/jcrop/css/jquery.Jcrop.css" type="text/css" />
|
|
|
|
<link rel="stylesheet" href="${ctx}/static/js/plugins/jcrop/css/jquery.Jcrop.css" type="text/css" />
|
|
|
|
<link href="${ctx}/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
|
|
|
<link href="${ctx}/static/css/plugins/chosen/chosen.css" rel="stylesheet">
|
|
|
|
<link href="${ctx}/static/css/plugins/iCheck/custom.css" rel="stylesheet">
|
|
|
|
<link href="${ctx}/static/js/plugins/jqueryzTree/css/metroStyle/metroStyle.css" rel="stylesheet">
|
|
|
|
<style type="text/css">
|
|
|
|
<style type="text/css">
|
|
|
|
|
|
|
|
|
|
|
|
.jcrop-holder #preview-pane {
|
|
|
|
.jcrop-holder #preview-pane {
|
|
|
@ -56,49 +56,74 @@
|
|
|
|
</head>
|
|
|
|
</head>
|
|
|
|
<body class="gray-bg">
|
|
|
|
<body class="gray-bg">
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight">
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight">
|
|
|
|
<div class="ibox ">
|
|
|
|
<div class="row">
|
|
|
|
<div class="ibox-content">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="ibox-content">
|
|
|
|
<div class="ibox float-e-margins">
|
|
|
|
<form id="searcheuserform" name="searcheuserform" class="form-inline">
|
|
|
|
<div class="ibox-title">
|
|
|
|
<div class="form-group">
|
|
|
|
<h5>设置流程权限</h5>
|
|
|
|
<div class="input-group">
|
|
|
|
</div>
|
|
|
|
<select data-placeholder="选择租户..." class="chosen-select" name='userDisId' id='userDisId' class="chosen-select" style="width:350px;" tabindex="2">
|
|
|
|
<div class="col-sm-3" id="departDivTree">
|
|
|
|
</select>
|
|
|
|
<div class="ibox float-e-margins">
|
|
|
|
|
|
|
|
<div class="ibox-title">
|
|
|
|
|
|
|
|
<h5>组织机构</h5>
|
|
|
|
|
|
|
|
<div class="ibox-tools">
|
|
|
|
|
|
|
|
<a class="collapse-link" title="折叠" id="collapes_linkclose">
|
|
|
|
|
|
|
|
<i class="fa fa-chevron-up" ></i>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<a class="collapse-link" title="展开" id="collapes_linkopen" style="display:none;">
|
|
|
|
|
|
|
|
<i class="fa fa fa-chevron-down" ></i>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="ibox-content">
|
|
|
|
<div class="form-group">
|
|
|
|
<div id="zTreeDemoBackground left">
|
|
|
|
<div class="input-group">
|
|
|
|
<ul id="departZtreeUl" class="ztree"></ul>
|
|
|
|
<select data-placeholder="审批角色..." class="chosen-select" name='userDisRolesid' id='userDisRolesid' class="chosen-select" style="width:350px;" tabindex="2">
|
|
|
|
</div>
|
|
|
|
<option value="">请选择审批角色</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<input name='search_username' id='search_username' class='form-control' placeholder='姓名--'/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="ibox ">
|
|
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="refreshTable()"><i class="fa fa-search"></i> 搜索</a>
|
|
|
|
<div class="ibox-content">
|
|
|
|
</div>
|
|
|
|
<div class="main-content">
|
|
|
|
</form>
|
|
|
|
<form name="Userdistionaryform" method="post" id="Userdistionaryform" class="form-horizontal" action="${ctx}/backstage/userdistionary/save">
|
|
|
|
</div>
|
|
|
|
<input type="hidden" id="search_parentid">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<input type="hidden" id="deptlist" name="deptlist">
|
|
|
|
<div class="ibox-content">
|
|
|
|
<input type="hidden" value="1" name="usertype">
|
|
|
|
<div class="row row-lg">
|
|
|
|
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
|
|
|
<div class="container-div">
|
|
|
|
<div class="row">
|
|
|
|
<div class="btn-group-sm" id="_mybutton" role="group">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<label class="col-sm-2 control-label is-required">* 用户列表:</label>
|
|
|
|
|
|
|
|
<div class="col-sm-10">
|
|
|
|
|
|
|
|
<table id="Userdistionary_add_list" ></table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<div class="col-sm-offset-5">
|
|
|
|
|
|
|
|
<button id="savebutton" type="submit" class="btn btn-w-m btn-primary">保存</button>
|
|
|
|
|
|
|
|
<button type="button" onclick="rolesback()" class="btn btn-w-m btn-success">取消</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-sm-12 select-table table-striped" >
|
|
|
|
|
|
|
|
<table id="Userdistionary_list" ></table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 展示流程图的 窗口 -->
|
|
|
|
<!-- 展示流程图的 窗口 -->
|
|
|
|
<div id="modal-candidate-user-role" class="modal fade" aria-hidden="true">
|
|
|
|
<div id="modal-candidate-user-role" class="modal fade" aria-hidden="true">
|
|
|
|
<div class="modal-dialog" role="document" style="width: auto">
|
|
|
|
<div class="modal-dialog" role="document" style="width: auto">
|
|
|
@ -110,7 +135,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="modal-body">
|
|
|
|
<form id="candidateUserFrom">
|
|
|
|
<form id="candidateUserFrom">
|
|
|
|
<input type="hidden" id="fromUserDisId">
|
|
|
|
<input type="hidden" id="fromUserId">
|
|
|
|
|
|
|
|
<input type="hidden" id="fromDeptId">
|
|
|
|
<input type="hidden" value="1" name="fromUserTyped" id="fromUserTyped">
|
|
|
|
<input type="hidden" value="1" name="fromUserTyped" id="fromUserTyped">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="input-group" id="fromUserNameDiv">
|
|
|
|
<div class="input-group" id="fromUserNameDiv">
|
|
|
@ -134,47 +160,92 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<#include "/head/footlist.html" />
|
|
|
|
<#include "/head/footadd.html" />
|
|
|
|
<script src="${ctx}/static/js/plugins/jcrop/js/jquery.color.js" type="text/javascript"></script>
|
|
|
|
<script src="${ctx}/static/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
|
|
|
|
<script src="${ctx}/static/js/plugins/jcrop/js/jquery.Jcrop.js" type="text/javascript"></script>
|
|
|
|
<script src="${ctx}/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
|
|
|
|
|
|
|
|
<script src="${ctx}/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
|
|
|
|
|
|
|
|
<script src="${ctx}/static/js/plugins/jqueryzTree/js/jquery.ztree.all.min.js"></script>
|
|
|
|
<script src="${ctx}/static/js/plugins/iCheck/icheck.min.js"></script>
|
|
|
|
<script src="${ctx}/static/js/plugins/jqueryzTree/js/jquery.ztree.all.min.js"></script>
|
|
|
|
<!-- Chosen -->
|
|
|
|
<!-- Chosen -->
|
|
|
|
<script src="${ctx}/static/js/plugins/chosen/chosen.jquery.js"></script>
|
|
|
|
<script src="${ctx}/static/js/plugins/chosen/chosen.jquery.js"></script>
|
|
|
|
</body>
|
|
|
|
<script type="text/javascript">
|
|
|
|
</html>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
var _tableListUserdistionary;
|
|
|
|
var _tableListUserdistionary;
|
|
|
|
var jsptoolbar = '';
|
|
|
|
var _tableAddListUserdistionary;
|
|
|
|
var jspOperation = '';
|
|
|
|
var selectionIds = []; //保存选中ids
|
|
|
|
var userDisRolesidarray;
|
|
|
|
var selectionIdDepts = []; //保存选中用户机构主键
|
|
|
|
var selectConfig = {
|
|
|
|
var _deptTree;
|
|
|
|
'.chosen-select': {},
|
|
|
|
var setting = {
|
|
|
|
'.chosen-select-deselect': {
|
|
|
|
data: {
|
|
|
|
allow_single_deselect: true
|
|
|
|
simpleData: {
|
|
|
|
},
|
|
|
|
enable: true
|
|
|
|
'.chosen-select-no-single': {
|
|
|
|
}
|
|
|
|
disable_search_threshold: 10
|
|
|
|
}, callback: {onClick: zTreeOnClick }
|
|
|
|
},
|
|
|
|
};
|
|
|
|
'.chosen-select-no-results': {
|
|
|
|
function zTreeOnClick(event, treeId, treeNode) {
|
|
|
|
no_results_text: 'Oops, nothing found!'
|
|
|
|
|
|
|
|
},
|
|
|
|
if(treeNode.id != '0'){
|
|
|
|
'.chosen-select-width': {
|
|
|
|
$("#search_parentid").val(treeNode.id);
|
|
|
|
width: "95%"
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$("#search_parentid").val("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
refreshAddTable();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
jQuery(document).ready(function($){
|
|
|
|
//折叠ibox
|
|
|
|
|
|
|
|
$('#collapes_linkopen').click(function () {
|
|
|
|
|
|
|
|
_deptTree.expandAll(true);
|
|
|
|
|
|
|
|
$(this).hide();
|
|
|
|
|
|
|
|
$("#collapes_linkclose").show();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
parent.axgetXiaoyao("${ctx}/backstage/admin/tenant/listall",null,false,function (data) {
|
|
|
|
$("#collapes_linkclose").click(function () {
|
|
|
|
if(data.code == "OK"){
|
|
|
|
_deptTree.expandAll(false);
|
|
|
|
$.each(data.data,function(name,anArray) {
|
|
|
|
|
|
|
|
console.log(anArray)
|
|
|
|
$(this).hide();
|
|
|
|
$("#userDisId").append("<option value='" + anArray.id + "'>" + anArray.name + "</option>");
|
|
|
|
$("#collapes_linkopen").show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$("#userDisId").chosen(selectConfig[$("#userDisId")]);
|
|
|
|
//选中事件操作数组
|
|
|
|
|
|
|
|
var union = function(array,ids){
|
|
|
|
|
|
|
|
$.each(ids, function (i, id) {
|
|
|
|
|
|
|
|
if($.inArray(id,array)==-1){
|
|
|
|
|
|
|
|
array[array.length] = id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return array;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//取消选中事件操作数组
|
|
|
|
|
|
|
|
var difference = function(array,ids){
|
|
|
|
|
|
|
|
$.each(ids, function (i, id) {
|
|
|
|
|
|
|
|
var index = $.inArray(id,array);
|
|
|
|
|
|
|
|
if(index!=-1){
|
|
|
|
|
|
|
|
array.splice(index, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return array;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _ = {"union":union,"difference":difference};
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
initDepartTree()
|
|
|
|
|
|
|
|
$('.i-checks').iCheck({
|
|
|
|
|
|
|
|
checkboxClass: 'icheckbox_square-green',
|
|
|
|
|
|
|
|
radioClass: 'iradio_square-green',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
var selectConfig = {
|
|
|
|
|
|
|
|
'.chosen-select': {},
|
|
|
|
|
|
|
|
'.chosen-select-deselect': {
|
|
|
|
|
|
|
|
allow_single_deselect: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
'.chosen-select-no-single': {
|
|
|
|
|
|
|
|
disable_search_threshold: 10
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
'.chosen-select-no-results': {
|
|
|
|
|
|
|
|
no_results_text: 'Oops, nothing found!'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
'.chosen-select-width': {
|
|
|
|
|
|
|
|
width: "95%"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//审批角色
|
|
|
|
//审批角色
|
|
|
|
parent.axgetXiaoyao('${ctx}/backstage/oa/candidate/list',null,false , function(result) {
|
|
|
|
parent.axgetXiaoyao('${ctx}/backstage/oa/candidate/list',null,false , function(result) {
|
|
|
@ -190,83 +261,190 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_tableAddListUserdistionary = $('#Userdistionary_add_list').bootstrapTable({
|
|
|
|
|
|
|
|
url: '${ctx}/backstage/oa/userdistionary/listnoin' ,
|
|
|
|
|
|
|
|
pagination: true, //是否显示分页(*)
|
|
|
|
|
|
|
|
pageNumber:1, //初始化加载第一页,默认第一页
|
|
|
|
|
|
|
|
pageSize: 20, //每页的记录行数(*)
|
|
|
|
|
|
|
|
sidePagination: "server",
|
|
|
|
|
|
|
|
idField:"id",
|
|
|
|
|
|
|
|
height: "100%",
|
|
|
|
|
|
|
|
striped:true, //奇偶行渐色表
|
|
|
|
|
|
|
|
clickToSelect:true, //是否选中
|
|
|
|
|
|
|
|
maintainSelected:true,
|
|
|
|
|
|
|
|
pageList: [20, 50, 100],
|
|
|
|
|
|
|
|
ajaxOptions:{
|
|
|
|
|
|
|
|
headers: {"logintoken": parent.getLoginToken()}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
queryParams: function queryParams(params) {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
sortorder: params.order,
|
|
|
|
|
|
|
|
sortname: params.sort,
|
|
|
|
|
|
|
|
pagesize: params.limit,
|
|
|
|
|
|
|
|
start: (params.offset / params.limit) + 1,
|
|
|
|
|
|
|
|
parentid: $("#search_parentid").val(),
|
|
|
|
|
|
|
|
userDisId: $("#userDisId").val()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
responseHandler:function(res){
|
|
|
|
|
|
|
|
//表格分页之前处理多选框数据
|
|
|
|
|
|
|
|
$.each(res.data.records, function (i, row) {
|
|
|
|
|
|
|
|
row.checkStatus = $.inArray(row.id, selectionIds) != -1; //判断当前行的数据id是否存在与选中的数组,存在则将多选框状态变为true
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return{"rows": res.data.records, "total": res.data.total};
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
|
|
|
|
|
|
parent.axgetXiaoyao("${ctx}/backstage/admin/user/toolsbarOperation?" + "resourceid=${resourceid}",null,true ,
|
|
|
|
{ width:150,valign: "middle",field:'username',title:'用户名',sortable:true},
|
|
|
|
function(data){
|
|
|
|
{ width:150,valign: "middle",field:'loginname',title:'登录账号',sortable:true},
|
|
|
|
if(data.code == "OK"){
|
|
|
|
{ width:150,valign: "middle",field:'departname',title:'所属部门',sortable:true},
|
|
|
|
jsptoolbar = data.data.Jsptoolbar;
|
|
|
|
{ width:150,valign: "middle",field:'candidatename',title:'审批权限组',sortable:false},
|
|
|
|
jspOperation = data.data.JspOperation;
|
|
|
|
{
|
|
|
|
$("#_mybutton").empty();
|
|
|
|
width:200,
|
|
|
|
$(jsptoolbar).each(function (i, toolbar) {
|
|
|
|
field: 'id',
|
|
|
|
if(toolbar.methodid != '104'){
|
|
|
|
title: '操作',
|
|
|
|
$("#_mybutton").append('<button class="btn sbold ' + toolbar.img + '" onClick="' + toolbar.actionmethod + '(\'${resourceid}' + toolbar.methodid + '\')"> ' + ' <i class="fa ' + toolbar.methodkey + '"></i> ' + toolbar.text + '</button> ');
|
|
|
|
formatter:function(value,oData,index) {
|
|
|
|
}
|
|
|
|
var listOperation = "<a href=\"javascript:void(0)\" onclick=\"setCandiRole('" + index +"')\" class=\"btn btn-primary btn-xs\" ><i class=\"fa fa-pencil\"></i> 设置审批组 </a> ";
|
|
|
|
});
|
|
|
|
|
|
|
|
_tableListUserdistionary = $('#Userdistionary_list').bootstrapTable({
|
|
|
|
|
|
|
|
url: '${ctx}/backstage/oa/userdistionary/list' ,
|
|
|
|
return listOperation;
|
|
|
|
pagination: true, //是否显示分页(*)
|
|
|
|
}
|
|
|
|
pageNumber:1, //初始化加载第一页,默认第一页
|
|
|
|
}
|
|
|
|
pageSize: 10, //每页的记录行数(*)
|
|
|
|
]
|
|
|
|
sidePagination: "server",
|
|
|
|
});
|
|
|
|
height: "100%",
|
|
|
|
|
|
|
|
pageList: [10, 25, 50],
|
|
|
|
//绑定选中事件、取消事件、全部选中、全部取消
|
|
|
|
ajaxOptions:{
|
|
|
|
_tableAddListUserdistionary.on('check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table', function (e, rows) {
|
|
|
|
headers: {"logintoken": parent.getLoginToken()}
|
|
|
|
var ids = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
|
|
|
},
|
|
|
|
return row.id;
|
|
|
|
queryParams: function queryParams(params) {
|
|
|
|
});
|
|
|
|
return {
|
|
|
|
var idDepts = $.map(!$.isArray(rows) ? [rows] : rows, function (row) {
|
|
|
|
sortorder: params.order,
|
|
|
|
return row.id + "_" + row.departmentId;
|
|
|
|
sortname: params.sort,
|
|
|
|
});
|
|
|
|
pagesize: params.limit,
|
|
|
|
func = $.inArray(e.type, ['check', 'check-all']) > -1 ? 'union' : 'difference';
|
|
|
|
start: (params.offset / params.limit) + 1,
|
|
|
|
|
|
|
|
userDisId:$("#userDisId").val() ,
|
|
|
|
selectionIds = _[func](selectionIds, ids);
|
|
|
|
search_username:'{"value":"' + $("#search_username").val() + '","op":"equal","type":"string"}',
|
|
|
|
|
|
|
|
userDisRolesid: $("#userDisRolesid").val()
|
|
|
|
selectionIdDepts = _[func](selectionIdDepts, idDepts);
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
});
|
|
|
|
responseHandler:function(res){
|
|
|
|
|
|
|
|
return{"rows": res.data.records, "total": res.data.total};
|
|
|
|
|
|
|
|
},
|
|
|
|
$("#Userdistionaryform").attr("action","${ctx}/backstage/oa/userdistionary/save");
|
|
|
|
columns: [
|
|
|
|
var form1 = $('#Userdistionaryform');
|
|
|
|
{checkbox: true},
|
|
|
|
var error1 = $('.alert-danger', form1);
|
|
|
|
{ width:150,valign: "middle",field:'username',title:'用户名',sortable:false},
|
|
|
|
form1.validate({
|
|
|
|
{ width:150,valign: "middle",field:'loginname',title:'登录账号',sortable:false},
|
|
|
|
debug: true,
|
|
|
|
{ width:150,valign: "middle",field:'departname',title:'所属部门',sortable:false},
|
|
|
|
errorElement: 'span',
|
|
|
|
{ width:150,valign: "middle",field:'candidatename',title:'审批权限组',sortable:false},
|
|
|
|
errorClass: 'help-block help-block-error',
|
|
|
|
{
|
|
|
|
focusInvalid: false,
|
|
|
|
width:200,
|
|
|
|
ignore: ":hidden",
|
|
|
|
field: 'id',
|
|
|
|
errorPlacement: function (error, element) {
|
|
|
|
title: '操作',
|
|
|
|
if (element.parent(".input-group").size() > 0) {
|
|
|
|
formatter:function(value,oData,index) {
|
|
|
|
error.insertAfter(element.parent(".input-group"));
|
|
|
|
var listOperation = "<a href=\"javascript:void(0)\" onclick=\"setCandiRole('" + index +"')\" class=\"btn btn-primary btn-xs\" ><i class=\"fa fa-pencil\"></i> 设置审批组 </a> ";
|
|
|
|
} else if (element.attr("data-error-container")) {
|
|
|
|
|
|
|
|
error.appendTo(element.attr("data-error-container"));
|
|
|
|
|
|
|
|
} else if (element.parents('.radio-list').size() > 0) {
|
|
|
|
return listOperation;
|
|
|
|
error.appendTo(element.parents('.radio-list').attr("data-error-container"));
|
|
|
|
}
|
|
|
|
} else if (element.parents('.radio-inline').size() > 0) {
|
|
|
|
}
|
|
|
|
error.appendTo(element.parents('.radio-inline').attr("data-error-container"));
|
|
|
|
]
|
|
|
|
} else if (element.parents('.checkbox-list').size() > 0) {
|
|
|
|
});
|
|
|
|
error.appendTo(element.parents('.checkbox-list').attr("data-error-container"));
|
|
|
|
|
|
|
|
} else if (element.parents('.checkbox-inline').size() > 0) {
|
|
|
|
|
|
|
|
error.appendTo(element.parents('.checkbox-inline').attr("data-error-container"));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
error.insertAfter(element);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
highlight: function (element) {
|
|
|
|
|
|
|
|
$(element).closest('.form-group').addClass('has-error');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
unhighlight: function (element) {
|
|
|
|
|
|
|
|
$(element).closest('.form-group').removeClass('has-error');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
success: function (label) {
|
|
|
|
|
|
|
|
label.closest('.form-group').removeClass('has-error');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
submitHandler: function (){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(selectionIdDepts.length < 1){
|
|
|
|
|
|
|
|
parent.toastr.success("选择要添加的用户。");
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#deptlist").val(selectionIdDepts.join());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parent.layer.load();
|
|
|
|
|
|
|
|
$("#savebutton").addClass('disabled');
|
|
|
|
|
|
|
|
$("#Userdistionaryform").ajaxSubmit({
|
|
|
|
|
|
|
|
headers:{"logintoken": parent.getLoginToken()},
|
|
|
|
|
|
|
|
success:function(data){
|
|
|
|
|
|
|
|
parent.layer.closeAll('loading');
|
|
|
|
|
|
|
|
if(data.code == "OK"){
|
|
|
|
|
|
|
|
parent.toastr.success(data.message);
|
|
|
|
|
|
|
|
rolesback();
|
|
|
|
|
|
|
|
}else if(data.code == "ERRORM"){
|
|
|
|
|
|
|
|
$.each(data.message,function(name,anArray) {
|
|
|
|
|
|
|
|
$.each(anArray,function(n,value){
|
|
|
|
|
|
|
|
$("#" + n).closest('.form-group').addClass('has-error');
|
|
|
|
|
|
|
|
$("<span>").attr( "id", n + "-error" ).addClass("help-block help-block-error").html(value).insertAfter($("#" + n));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$("#savebutton").addClass('removeClass');
|
|
|
|
|
|
|
|
parent.toastr.error(data.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
function getIdSelections() {
|
|
|
|
function saveUserCandidateForm(){
|
|
|
|
return $.map(_tableListUserdistionary.bootstrapTable('getSelections'), function(row) {
|
|
|
|
|
|
|
|
return row.userdistionaryid
|
|
|
|
var chk_value =[];//定义一个数组
|
|
|
|
|
|
|
|
$('input[name="userCandRolesid"]:checked').each(function(){//遍历每一个名字为nodes的复选框,其中选中的执行函数
|
|
|
|
|
|
|
|
chk_value.push($(this).val());//将选中的值添加到数组chk_value中
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function _useradd(jframeid){
|
|
|
|
|
|
|
|
parent._xiaoyaoOpenMenuTab('${ctx}/backstage/oa/userdistionaryHtml/toSave',"添加人员",jframeid + '_add');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var selectId = chk_value.join(",");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//审批角色
|
|
|
|
|
|
|
|
parent.axpostXiaoyao('${ctx}/backstage/oa/userdistionary/saveupdate',
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
userid:$("#fromUserId").val(),
|
|
|
|
|
|
|
|
userdeptid:$("#fromDeptId").val(),
|
|
|
|
|
|
|
|
fromUserTyped:1,
|
|
|
|
|
|
|
|
fromUserDisRolesid:selectId
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
false ,
|
|
|
|
|
|
|
|
function(result) {
|
|
|
|
|
|
|
|
if(result.code == 'OK'){
|
|
|
|
|
|
|
|
parent.toastr.success(result.message);
|
|
|
|
|
|
|
|
refreshAddTable();
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
parent.toastr.error(result.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#modal-candidate-user-role").modal("hide");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
function setCandiRole(index){
|
|
|
|
function setCandiRole(index){
|
|
|
|
|
|
|
|
|
|
|
|
$("#modal-candidate-user-role").modal();
|
|
|
|
$("#modal-candidate-user-role").modal();
|
|
|
|
$("#modal-candidate-user-role").css("z-index",(parent.getMaxZIndex() + 1));
|
|
|
|
$("#modal-candidate-user-role").css("z-index",(parent.getMaxZIndex() + 1));
|
|
|
|
|
|
|
|
|
|
|
|
var getdata = _tableListUserdistionary.bootstrapTable('getData');
|
|
|
|
var getdata = _tableAddListUserdistionary.bootstrapTable('getData');
|
|
|
|
|
|
|
|
|
|
|
|
var task = getdata[index];
|
|
|
|
var task = getdata[index];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#fromUserId").val(task.id);
|
|
|
|
|
|
|
|
$("#fromDeptId").val(task.departid);
|
|
|
|
|
|
|
|
console.log(task)
|
|
|
|
|
|
|
|
console.log("--------------------------------")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询当前人员已经设置的角色
|
|
|
|
//查询当前人员已经设置的角色
|
|
|
|
var candidateid = task.candidateid;
|
|
|
|
var candidateid = task.candidateid;
|
|
|
|
var candidateidArray = candidateid.split(",");
|
|
|
|
var candidateidArray = candidateid.split(",");
|
|
|
@ -306,119 +484,24 @@
|
|
|
|
$("#fromUserNameDiv").html("姓名:" + task.username);
|
|
|
|
$("#fromUserNameDiv").html("姓名:" + task.username);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function initDepartTree() {
|
|
|
|
|
|
|
|
|
|
|
|
function setCandiDept(index){
|
|
|
|
if(undefined != _deptTree){
|
|
|
|
|
|
|
|
_deptTree.destroy();
|
|
|
|
var getdata = _tableListUserdistionary.bootstrapTable('getData');
|
|
|
|
}
|
|
|
|
|
|
|
|
parent.axgetXiaoyao("${ctx}/backstage/admin/department/showDeptJsTree",null,true ,function (data) {
|
|
|
|
var task = getdata[index];
|
|
|
|
_deptTree = $.fn.zTree.init($("#departZtreeUl"),setting, data);
|
|
|
|
//查询当前人员已经设置的角色
|
|
|
|
_deptTree.expandAll(true);
|
|
|
|
var candidateid = task.candidateid;
|
|
|
|
|
|
|
|
var username = task.username;
|
|
|
|
|
|
|
|
var userid = task.id;
|
|
|
|
|
|
|
|
var usertype = task.userOsudType;
|
|
|
|
|
|
|
|
var userdistionaryid = task.userdistionaryid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parent._xiaoyaoOpenMenuTab('${ctx}/backstage/oa/userdistionaryHtml/tolinkdept?candidateid=' + candidateid + "&username=" + username + "&userid=" + userid + "&usertype=" + usertype + "&userdistionaryid=" + userdistionaryid,"设置分管部门",userdistionaryid + '_add');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function t_delete(str){
|
|
|
|
|
|
|
|
parent.layer.closeAll('loading');
|
|
|
|
|
|
|
|
parent.axgetXiaoyao('${ctx}/backstage/oa/userdistionary/delmore' , {id:str},false, function(data){
|
|
|
|
|
|
|
|
parent.layer.closeAll('loading');
|
|
|
|
|
|
|
|
if(data.code == "OK"){
|
|
|
|
|
|
|
|
swal(data.message, "您已经永久删除了这条信息。", "success");
|
|
|
|
|
|
|
|
refreshTable();
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
swal(data.message, "遇到未知错误!", "error");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function saveUserCandidateForm(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var chk_value =[];//定义一个数组
|
|
|
|
|
|
|
|
$('input[name="userCandRolesid"]:checked').each(function(){//遍历每一个名字为nodes的复选框,其中选中的执行函数
|
|
|
|
|
|
|
|
chk_value.push($(this).val());//将选中的值添加到数组chk_value中
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var selectId = chk_value.join(",");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//审批角色
|
|
|
|
|
|
|
|
parent.axpostXiaoyao('${ctx}/backstage/oa/userdistionary/saveupdate',
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fromUserDisId:$("#fromUserDisId").val(),
|
|
|
|
|
|
|
|
fromUserDisRolesid:selectId,
|
|
|
|
|
|
|
|
fromUserTyped:$("#fromUserTyped").val()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
false ,
|
|
|
|
|
|
|
|
function(result) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(result.code == 'OK'){
|
|
|
|
|
|
|
|
var userDisRolesidarray = result.data;
|
|
|
|
|
|
|
|
var posthtml = "";
|
|
|
|
|
|
|
|
$(userDisRolesidarray).each(function(idx,item){
|
|
|
|
|
|
|
|
posthtml = posthtml + '<option value="' + item.id + '" hassubinfo="true">' + item.candidatename + '</option>';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#userDisRolesid").append(posthtml);
|
|
|
|
|
|
|
|
$("#userDisRolesid").chosen(selectConfig[$("#userDisRolesid")]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parent.toastr.success(result.message);
|
|
|
|
|
|
|
|
refreshTable();
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
parent.toastr.error(result.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#modal-candidate-user-role").modal("hide");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _deletebu(sourceid){
|
|
|
|
function refreshAddTable(){
|
|
|
|
var str = getIdSelections() + "";
|
|
|
|
_tableAddListUserdistionary.bootstrapTable('refreshOptions',{pageNumber:1});
|
|
|
|
var tempstr = str.split(",");
|
|
|
|
|
|
|
|
if (str.length > 0 && tempstr.length > 0) {
|
|
|
|
|
|
|
|
swal({
|
|
|
|
|
|
|
|
title: "您确定要删除这条信息吗",
|
|
|
|
|
|
|
|
text: "删除后将无法恢复,请谨慎操作!",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
|
|
|
confirmButtonColor: "#DD6B55",
|
|
|
|
|
|
|
|
confirmButtonText: "是的,我要删除!",
|
|
|
|
|
|
|
|
cancelButtonText: "让我再考虑一下…",
|
|
|
|
|
|
|
|
closeOnConfirm: false,
|
|
|
|
|
|
|
|
closeOnCancel: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
function (isConfirm) {
|
|
|
|
|
|
|
|
if (isConfirm) {
|
|
|
|
|
|
|
|
t_delete(str);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
swal("已取消", "您取消了删除操作!", "error");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
parent.toastr.error("至少选择一条数据操作");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function _delete(sourceid,str){
|
|
|
|
|
|
|
|
swal({
|
|
|
|
|
|
|
|
title: "您确定要删除这条信息吗",
|
|
|
|
|
|
|
|
text: "删除后将无法恢复,请谨慎操作!",
|
|
|
|
|
|
|
|
type: "warning",
|
|
|
|
|
|
|
|
showCancelButton: true,
|
|
|
|
|
|
|
|
confirmButtonColor: "#DD6B55",
|
|
|
|
|
|
|
|
confirmButtonText: "是的,我要删除!",
|
|
|
|
|
|
|
|
cancelButtonText: "让我再考虑一下…",
|
|
|
|
|
|
|
|
closeOnConfirm: false,
|
|
|
|
|
|
|
|
closeOnCancel: false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
function (isConfirm) {
|
|
|
|
|
|
|
|
if (isConfirm) {
|
|
|
|
|
|
|
|
t_delete(str);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
swal("已取消", "您取消了删除操作!", "error");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function refreshTable(){
|
|
|
|
function rolesback() {
|
|
|
|
_tableListUserdistionary.bootstrapTable('refreshOptions',{pageNumber:1});
|
|
|
|
parent.closeItem(window.frameElement.name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
|
|