You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

393 lines
11 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<%
String menu_code = request.getParameter("menucode");
WDK.writeButton(out, su, menu_code);
%>
<title>员工管理</title>
<style type="text/css">
</style>
<script type="text/javascript">
<% if(null==su){%>
$.timeout();
<%}%>
var _gridcode = "platform.uum.uumusergrid";
var _gridid = $.getUUID();
//页面初始化
$(function() {
//人员状态
check_box("status_type_code", "ENUM_UC_PERSONSTATUSTYPE");
//组织部门
//组织参数
var dataJson = {
op_acc: $.getSessionUser().account_id
,parent_uuid: '-1'
,org_id: $.getSessionUser().companyuuid
,level:1
,include_self : 1
,result_fields:'org_uuid,org_code,org_name,parent_uuid'
,order_expr:'display_order' //' display_order '
};
//方法名
var queryMethod="queryAccountOrgListByParentID"; //"queryOrgListByParentID";
//组织请求数据集
var dataParam = {
_SRVNAME: 'service.usr.org',
_SRVMETHOD: queryMethod,
_DATA: $.json2str(dataJson),
_RSFIELD: 'resultset',//TODO:待确认
_RSTYPE: 'tree',
_RSPARAM: $.json2str({
idField: 'org_uuid'
,textField: 'org_name'
,parentField: 'parent_uuid'
,asyn:'1' //是否是异步 0:同步;1:异步
,asyn_urlField:'parent_uuid'
,asyn_dataField:'parent_uuid' //如果是异步,则从url中取出的参数替换_DATA参数的名
})
};
$.inputpop({
id:'depart_uuid',
type:'tree',
title:'组织机构',
width:320,
height:480,
editable:false,
required:false,
checkbox:false,
asyn:true,
parentField:'parent_uuid',
initid: $.getSessionUser().companyuuid,
inittext:$.getSessionUser().companyname,
initvalue:$.getSessionUser().companyuuid,
dataurl:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
onBeforeOpen:'',
callback:function(jparam){
//alert($.json2str(jparam));
$.inputpop_setValue ({
id:'depart_uuid',
value_id:jparam.value_id,
value_text:jparam.value_text,
value_value:jparam.value_text
});
}
});
//查询grid数据
//组织参数
//获取form对象值
var staffFieldValues = $.getFieldValue({formid:'search_form'});
//staffFieldValues.depart_uuid= $.getSessionUser().deptuuid;
if(staffFieldValues.depart_uuid == ""){
staffFieldValues.depart_uuid = $.getSessionUser().companyuuid;
}
if(staffFieldValues.status_type_code == ""){
staffFieldValues.status_type_code = '1';
}
//组织参数
var dataParam = {
_SRVNAME:'service.usr.staff'
,_SRVMETHOD:'pagequeryStaffList'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,staff_info: staffFieldValues
,result_fields:''
,order_fields:'display_order'
})
,_RSTYPE:'grid'
,_RSFIELD:'staff_info'
,_RSPARAM:$.json2str({pagequery:'1'})
};
var gridid = $.grid({
id : _gridid,
containerid : 'layout_grid',
gridcode : _gridcode,
checkbox : false,
checkOnSelect : false,
selectOnCheck : false,
url : 'wdk?action=wdk.pub&method=call_service&ajaxparam='+ new Date().getTime(),
queryParams : dataParam,
idField : 'person_uuid',
showContextMenu:false,
fitColumns:true, //是否自动填充满
nowrap:true, //自动换行
pagination:true,
formatter:{
person_name:'formatter_person_name',
command:'formatter_command'
}
});
//注册用户添加成功的监听
$.addListener("uum_user_edit","opt_query");
});
//下拉框
function check_box(id, moduleCode){
$.checkbox({
id:id,
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:{
_SRVNAME:'service.wdk.pub'
,_SRVMETHOD:'wql_queryCombobox'
,_DATA:$.json2str({
modulecode:moduleCode
,jparam:{
condition:''
}
})
,_RSFIELD:'result'
},
disabled:false,
initvalue:'1',
onSelect:function(data){
opt_query();
},
onUnSelect:function(data){
opt_query();
}
});
}
//获取grid查询参数
function getGridQueryParam(){
//获取form对象值
var staffFieldValues = $.getFieldValue({formid:'search_form'});
//staffFieldValues.depart_uuid= $.getSessionUser().deptuuid;
if(staffFieldValues.depart_uuid == ""){
staffFieldValues.depart_uuid = $.getSessionUser().companyuuid;
}
//组织参数
var dataParam = {
_SRVNAME:'service.usr.staff'
,_SRVMETHOD:'pagequeryStaffList'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,staff_info: staffFieldValues
,result_fields:''
,order_fields:'display_order'
})
,_RSTYPE:'grid'
,_RSFIELD:'staff_info'
,_RSPARAM:$.json2str({pagequery:'1'})
};
return dataParam;
}
//format 姓名
function formatter_person_name(value,row,index) {
return "<a style='margin:5px;' href='javascript:void(0)' onclick=opt_view('"+ row.person_uuid +"','"+row.persondeptex_uuid+"')>"+value+"</a>";
}
//format 操作
function formatter_command(value,row,index) {
var str = '<i tilte="修改" class="fa fa-pencil-square-o grid-oper-icon" aria-hidden="true" onclick="opt_update(\''+ row.person_uuid +'\')"></i>';
if(row.isex == "1"){
str = str = '<i tilte="修改" class="fa fa-pencil-square-o oper-obj" style="font-size:14px;margin:0 5px;color:#ddd;cursor: pointer;" aria-hidden="true" ></i>';
}
str += '<i tilte="删除" class="fa fa-trash-o grid-oper-icon" aria-hidden="true" onclick="opt_delete(\''+ row.person_uuid +'\')"></i>';
return str;
}
//查询
function opt_query() {
//组织参数
var dataParam = getGridQueryParam();
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
//新增人员
function opt_add(){
$.openInTab({
id: $.getUUID(),
title: '员工管理-新增',
height: 500,
width: 1150,
url: './platform/uum/uum_user_edit.jsp',
queryParams:{
actionflag:'add',
depart_uuid:$("#depart_uuid").val(),
depart_name:$("#depart_name").val()
}
});
};
//修改人员
function opt_update(person_uuid){
$.openInTab({
id: $.getUUID(),
title: '员工管理-修改',
height: 500,
width: 1150,
url: './platform/uum/uum_user_edit.jsp',
queryParams:{
actionflag:'update',
selected_id:person_uuid
}
});
}
//删除人员
function opt_delete(person_uuid) {
confirmDialog('是否确认删除!',function(){
//打开旋转
$.wait_open();
//组织参数
var dataParam = {
_SRVNAME:'service.uum.staff'
,_SRVMETHOD:'deleteStaff'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,person_uuid:person_uuid
})
};
//加载数据
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime()
,method:"post"
,timeout:WDK_Timeout
,data:dataParam
,success:function(result) {
//关闭旋转
$.wait_close();
var jres = $.str2json(result);
if (jres.code == "1") { //操作成功
alert(jres.desc);
//删除后重新请求
opt_query();
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
},function(){});
}
//人员详情
function opt_view(person_uuid,persondeptex_uuid){
$.openInTab({
id: $.getUUID(),
title: '员工管理-详细',
height: 500,
width: 1150,
url: './platform/uum/uum_user_info.jsp',
queryParams:{
actionflag:'view',
selected_id:person_uuid,
persondeptex_uuid : persondeptex_uuid
}
});
}
//兼职人员
function opt_deptex(){
var row = $.grid_getSelected({
id : _gridid
});
if (!row.person_uuid) {
alert('请选择人员的记录!');
return;
}
//组装人员信息
var person_info = {
person_uuid: row.person_uuid,
person_name: row.person_name,
login_name: row.login_name,
manage_unit_name: row.manage_unit_name,
depart_uuid: row.depart_uuid,
depart_name: row.depart_name
};
opt_deptexStaff($.json2str(person_info));
}
//兼职人员
function opt_deptexStaff(person){
var person_info = $.str2json(person);
$.openWin({
id: $.getUUID(),
title: '员工管理-兼职部门',
height: 500,
width: 1050,
url: './platform/uum/uum_user_deptex.jsp',
queryParams:{
actionflag:'deptex',
selected_id:person_info.person_uuid,
person_name:person_info.person_name,
person_info:person_info
},
onClose:function(){
opt_query();
}
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow:hidden">
<div class="page-toolbar">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="opt_add()">新增</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-info-circle'" onclick="opt_deptex()">兼职信息</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="row-1" style="padding:0 10px;overflow:hidden;" >
<form id="search_form" >
<div class="h_layout">
<div>
<div class="inputgroup" >
<label>组织结构</label>
<div>
<input id="depart_uuid" name="depart_uuid"/>
</div>
</div>
<div class="inputgroup">
<label>关键字</label>
<div>
<input class="easyui-validatebox" id="search_bar" name="search_bar" placeholder="输入工号、姓名、登录账号"/>
</div>
</div>
<div class="inputgroup">
<label>人员状态</label>
<div>
<input id="status_type_code" name="status_type_code" />
</div>
</div>
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="opt_query()"><i class="fa fa-search" aria-hidden="true"></i><span><span>查询</span></span></a>
</div>
</div>
</form>
</div>
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="padding:0px 10px;" >
</div>
</div>
</div>
</body>
</html>