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.
 
 
 
 
 
 

505 lines
16 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>
<script type="text/javascript">
//获取参数数据
var param = $.getURLParam('param');
var jparam = $.str2json($.urlparam_decode(param));
var _actionflag = jparam.queryParams.actionflag; //操作类型 add-新增 update-修改,读取原信息
var _mid = jparam.queryParams.mid; //父界面刷新方法标识
var _selected_id = jparam.queryParams.selected_id; //主键
var depart_uuid = jparam.queryParams.depart_uuid; //部门id
var depart_name = jparam.queryParams.depart_name; //部门名称
//初始化
$(function() {
//下拉框
//性别
Combo_box("gender_scode", "S_UC_GENDER", false);
//学历
Combo_box("diploma_uuid", "ENUM_UC_DIPLOMA", false);
//政治面貌
Combo_box("politics_uuid", "ENUM_UC_POLITICS", false);
//证件
Combo_box("cer_type_scode", "S_UC_CER_TYPE", true);
//人员状态
Combo_box("person_status_uuid", "ENUM_UC_PERSONSTATUS", true);
//民族
Combo_box("nation", "ENUM_UC_NATION", false);
//日期框
//出生日期
Date_box("birth_date", false);
//入职日期
Date_box("entry_date", false);
//所属部门
Input_pop("depart_uuid", "组织机构", true, false, true, $.getSessionUser().deptuuid, $.getSessionUser().deptname);
//如果是修改,则首先查询下详细信息
if ('update' == _actionflag) {
$.wait_open();
//组织参数
var dataParam = {
_SRVNAME : 'service.usr.staff',
_SRVMETHOD : 'queryStaffInfoByID',
_DATA : $.json2str({
op_account_uuid : $.getSessionUser().account_id,
person_uuid : _selected_id,
resultfields : ''
})
}
//初始化加载数据
$.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") {
//回填数据
$.setFieldValue(jres.staff_info, "#edit_form");
//inputpop 因为有两个值,需要单独设置下
$.inputpop_setValue({
id : "depart_uuid",
value_id : jres.staff_info.depart_uuid,
value_text : jres.staff_info.depart_uuidname,
value_value : jres.staff_info.depart_uuidname
});
$("#birth_date").datebox('setValue', jres.staff_info.birth_date);
$("#entry_date").datebox('setValue', jres.staff_info.entry_date);
} else {
alert(jres.desc);
}
},
error : function(result) {
$.wait_close();
alert('网络错误!result=' + result);
}
});
}
});
//下拉框
function Combo_box(id, moduleCode, flag) {
$.combobox({
id : id,
required : flag ? true : false,
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'
}
});
}
//日期框
function Date_box(id, isrequired) {
$.datebox({
id : id,
required : isrequired,
editable : false,
tipPosition : 'bottom',
strFormatter : 'yyyy-MM-dd',
onSelect: function(data) {
var now = new Date();
if (data > now) {
alert('不可选择未来的日期!');
$.datebox_clear({id: id});
}
}
});
}
//所属部门inputpop控件请求参数
function Input_pop_param_departuuid() {
//组织参数
var dataJson = {
op_acc : $.getSessionUser().account_id,
//parent_uuid : $.getSessionUser().orguuid,
parent_uuid : '-1',
result_fields : 'org_uuid,org_code,org_name,parent_uuid',
order_expr : ' display_order '
};
//方法名
var queryMethod = "queryMUOrgListByParentID";
//组织请求数据集
var dataParam = {
_SRVNAME : 'service.usr.org',
_SRVMETHOD : queryMethod,
_DATA : $.json2str(dataJson),
_RSFIELD : 'resultset',
_RSTYPE : 'tree',
_RSPARAM : $.json2str({
idField : 'org_uuid',
textField : 'org_name',
parentField : 'parent_uuid',
asyn : '1', //是否是异步 0同步;1异步
asyn_dataField : 'parent_uuid' //如果是异步,则从url中取出的参数替换_DATA参数的名
})
};
return dataParam;
}
//Inputpop控件
function Input_pop(id, title, isrequired, ischeckbox, isasyn, initid, initvalue) {
var dataParam = Input_pop_param_departuuid();
$.inputpop({
id : id,
type : 'tree',
title : title,
width : 320,
height : 480,
editable : false,
required : isrequired,
checkbox : ischeckbox,
asyn : isasyn,
initid : initid,
inittext : initvalue,
initvalue : initvalue,
dataurl : 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
queryParams : dataParam,
onBeforeOpen : '',
callback : function(jparam) {
$.inputpop_setValue({
id : id,
value_id : jparam.value_id,
value_text : jparam.value_text,
value_value : jparam.value_text
});
}
});
}
//保存数据
function opt_save() {
//验证
var isok = $("#edit_form").form('validate');
if(!isok){
alert('尚有必填项未填或输入有误,请检查后提交');
return false;
}
//打开旋转
$.wait_open();
//获取所有input和textarea 的输入值
var staffFieldValues = $.getFieldValue({formid : 'edit_form'});
//排序字段为负整数时归为0
var tmp = staffFieldValues.display_order;
if (!(tmp.match(/^([1-9]\d*|[0]{1,1})$/))) {
console.log('负整数!');
staffFieldValues.display_order = '0';
}
//组织参数
var dataParam = {
_SRVNAME : 'service.uum.staff',
_SRVMETHOD : 'save',
_DATA : $.json2str({
op_account_uuid : $.getSessionUser().account_id,
staff_info : staffFieldValues,
account_info : {
manage_unit_uuid:$.getSessionUser().manageunituuid,
email:staffFieldValues.master_email,
mobile_phone:staffFieldValues.master_mobile
//,login_name:staffFieldValues.login_name
}
})
}
//表单提交的方法、比如ajax提交
//调用保存组织数据
$.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();
//返回值字符串转json
var jres = $.str2json(result);
if (jres.code == "1") { //操作成功
$.notify("uum_user_edit");//触发用户添加成功消息
alert(jres.desc);
opt_close();
} else {
alert(jres.desc);
}
},
error : function(result) {
$.wait_close();
alert('网络错误!result=' + result);
}
});
}
//关闭当前页面
function opt_close() {
$.closeActiveTab();
}
</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;height:40px;">
<div class="edit-page-toolbar">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-save'" onclick="opt_save()">保存</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-close'" onclick="opt_close()">关闭</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false">
<div class="edit-container">
<form id="edit_form">
<input type="hidden" id="person_uuid" name="person_uuid" value="" />
<div class="form-title">
<span class="form-title-text">人员基本信息</span>
</div>
<div class="row">
<div class="formgroup">
<label class="required">姓名</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="required:true,validType:'length[2,20]',tipPosition:'bottom'" id="person_name" name="person_name" value="" />
</div>
</div>
<div class="formgroup">
<label>曾用名</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="validType:'length[0,20]',tipPosition:'bottom'" id="old_name" name="old_name" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label class="required">性别</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="gender_scode" name="gender_scode" value="" />
</div>
</div>
<div class="formgroup">
<label>出生日期</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="tipPosition:'bottom'" id="birth_date" name="birth_date" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label class="required">证件类型</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="cer_type_scode" name="cer_type_scode" value="" />
</div>
</div>
<div class="formgroup">
<label>证件号码</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="id_no" name="id_no" data-options="validType:'length[0,20]',tipPosition:'bottom'" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>国家</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="country" data-options="validType:'length[0,100]',tipPosition:'bottom'" name="country" id="country" value="" />
</div>
</div>
<div class="formgroup">
<label>籍贯</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="nation_place" data-options="validType:'length[0,100]',tipPosition:'bottom'" name="nation_place" id="nation_place" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>政治面貌</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="politics_uuid" name="politics_uuid" value="" />
</div>
</div>
<div class="formgroup">
<label>学历</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="diploma_uuid" name="diploma_uuid" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>民族</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:'length[0,20]',tipPosition:'bottom'" id="nation" name="nation" value="" />
</div>
</div>
<div class="formgroup">
<label class="required">人员状态</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="person_status_uuid" name="person_status_uuid" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label>常住地址</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:'length[0,100]',tipPosition:'bottom'" id="address" name="address" value="" />
</div>
</div>
</div>
<div class="form-title" style="margin-top:10px;">
<span class="form-title-text">岗位相关信息</span>
</div>
<div class="row">
<div class="formgroup">
<label>工号</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:'length[0,20]',tipPosition:'bottom'" id="emp_no" name="emp_no" value=""/>
</div>
</div>
<div class="formgroup">
<label class="required">人员编码</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="required:true,validType:'length[1,100]',tipPosition:'bottom'" id="person_code" name="person_code" value=""/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label class="required">所属部门</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" id="depart_uuid" name="depart_uuid" value="" />
</div>
</div>
<div class="formgroup">
<label>岗位</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="validType:'length[0,100]',tipPosition:'bottom'" id="job_title" name="job_title" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label class="">入职日期</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" id="entry_date" name="entry_date" value="" />
</div>
</div>
<div class="formgroup">
<label>排序序号</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="validType:['isNumber','length[0,4]'],tipPosition:'bottom'" id="display_order" name="display_order" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>邮箱</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="validType:'length[0,100]',tipPosition:'bottom'" id="master_email" name="master_email" value="" />
</div>
</div>
<div class="formgroup">
<label>备用邮箱</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="validType:'length[0,100]',tipPosition:'bottom'" id="backup_email" name="backup_email" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup">
<label>手机</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="validType:['isMobile','length[11]'],tipPosition:'bottom'" id="master_mobile" name="master_mobile" value="" />
</div>
</div>
<div class="formgroup">
<label>办公室电话</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside nospaceinside" data-options="validType:'isTel',tipPosition:'bottom'" id="office_phone_no" name="office_phone_no" value="" />
</div>
</div>
</div>
<div class="row">
<div class="formgroup col-12">
<label>备注</label>
<div>
<input type="text" class="easyui-validatebox nospaceinside" data-options="tipPosition:'bottom'" id="remark" name="remark" value="" />
</div>
</div>
</div>
<div class="form-title" style="margin-top:10px;">
<span class="form-title-text">业务相关信息</span>
</div>
<div class="row">
<div class="formgroup col-2">
<label>销售员</label>
<div>
<input type="checkbox" id="is_saler" name="is_saler" value="1" />
</div>
</div>
<div class="formgroup col-2" style="margin-left:20px;">
<label>采购员</label>
<div>
<input type="checkbox" id="is_purcher" name="is_purcher" value="1" />
</div>
</div>
<div class="formgroup col-2" style="margin-left:20px;">
<label>仓管员</label>
<div>
<input type="checkbox" id="is_warehouse_keeper" name="is_warehouse_keeper" value="1" />
</div>
</div>
<div class="formgroup col-2" style="margin-left:20px;">
<label>质检员</label>
<div>
<input type="checkbox" id="is_inspector" name="is_inspector" value="1" />
</div>
</div>
<div class="formgroup col-2" style="margin-left:20px;">
<label>生产员</label>
<div>
<input type="checkbox" id="is_producer" name="is_producer" value = "1"/>
</div>
</div>
</div>
</form>
</div>
</div>
</body>
</html>