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.
 
 
 
 
 
 

645 lines
19 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 org_attr_scode = $.getURLParam('org_attr_scode');
var org_attr_scodename = $.getURLParam('org_attr_scode');
if(org_attr_scode==null || org_attr_scode==""){
alert("请检查url地址,必须传入业务组织类型!");
}else if(org_attr_scode=="01"){
org_attr_scodename ="财务组织";
}else if(org_attr_scode=="02"){
org_attr_scodename ="成本中心";
}else if(org_attr_scode=="03"){
org_attr_scodename ="利润中心";
}else if(org_attr_scode=="04"){
org_attr_scodename ="采购组织";
}else if(org_attr_scode=="05"){
org_attr_scodename ="质检组织";
}else if(org_attr_scode=="06"){
org_attr_scodename ="销售组织";
}else if(org_attr_scode=="07"){
org_attr_scodename ="库存组织";
}else if(org_attr_scode=="08"){
org_attr_scodename ="发运组织";
}else if(org_attr_scode=="09"){
org_attr_scodename ="人力资源组织";
}else if(org_attr_scode=="10"){
org_attr_scodename ="生产组织";
}
//初始化加载左侧的树
$(function(){
//下拉框
$.combobox({
id:"orgType"
,initvalue:'00'
,url:''
,queryParams:{
},data:[{
id:'00',
text:'行政组织'
}
,{
id:org_attr_scode,
text:org_attr_scodename
}]
,onChange: function(newValue,oldValue){
//加载树
selectOrgType(newValue,oldValue);
}
});
});
//下拉框
function Combo_box(id, moduleCode){
$.combobox({
id:id
,initvalue:'00'
,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'
}
,onChange: function(newValue,oldValue){
//加载树
selectOrgType(newValue,oldValue);
}
});
}
//右侧上级inputpop
function InputPop_tree(id, org_id){
//组织参数
var dataJson = {
op_acc: $.getSessionUser().account_id
,org_uuid: org_id
,org_attr_uuid: org_attr_scode
,result_fields:'org_uuid,org_code,org_name,parent_uuid'
,order_expr:' display_order '
};
var queryMethod="queryRootBizOrg";//方法名
//组织请求数据集
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:'0' //是否是异步 0:同步;1:异步
,asyn_dataField:'parent_uuid' //如果是异步,则从url中取出的参数替换_DATA参数的名
})
};
$.inputpop({
id:id,
type:'tree',
title:'组织机构',
width:320,
height:480,
editable:false,
required:false,
checkbox:false,
asyn:false,
initid: '',
inittext:'',
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 loadOrgTree(){
var orgType =$.combobox_getValue({id:'orgType'});//选中的值
var parent_uuid = "-1";
//组织参数
var dataJson = {
op_acc: $.getSessionUser().account_id
,parent_uuid: parent_uuid
,result_fields:'org_uuid,org_code,org_name,parent_uuid'
,order_expr:' display_order '
};
var queryMethod=null; //方法名
if(orgType=="" || orgType=="00"){ //行政组织
queryMethod = "queryMUOrgListByParentID";
}else{ //业务组织
queryMethod = "queryMUBizOrgListByParentID";
dataJson = {
op_acc: $.getSessionUser().account_id
,parent_uuid: parent_uuid
,org_attr_scode:orgType
,result_fields:'org_uuid,org_code,org_name,parent_uuid'
,order_expr:' display_order '
};
}
//组织请求数据集
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' //是否是异步
,asyn_dataField:'parent_uuid' //如果是异步,则从url中取出的参数替换_DATA参数的名
})
};
//加载树
$.tree({
id: 'listtree',
checkbox: false,
expandall: false,
cascadeCheck: false,
asyn: true,
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
onClick:function(event,treeid,node){
//属性业务树
var input = document.getElementById("biz_parent_uuid");
if(input.className!="inputpop_input"){
InputPop_tree('biz_parent_uuid', node.id);
}else{
//清除inputpop 数据
$.inputpop_clear({id:'biz_parent_uuid'});
//更新查询参数
var options =$.inputpop_getOptions({id:"biz_parent_uuid"});
var dataStr = options.queryParams._DATA;
var dataPs =$.str2json(dataStr);
dataPs.org_uuid = node.id;
options.queryParams._DATA = $.json2str(dataPs);
$.inputpop_setOptions({id:"biz_parent_uuid", options:options});
}
//刷新右侧主数据
refreshRightPanel(node);
}
});
}
//删除其他业务组织类型
function removeOtherOrgType(){
$.combobox_clear({id:"orgType"});
$.combobox_setValues({id:'orgType',value:'00,01'});
}
//选择组织类型
function selectOrgType(newValue,oldValue){
var orgType =$.combobox_getValue({id:"orgType"});//选中的值
if(orgType=="" || orgType=="00"){ //行政组织
$("#btn_saveBiz").css("visibility","visible");
}else{
$("#btn_saveBiz").css("visibility","hidden");
}
//加载树
loadOrgTree();
}
//点击了左侧的树之后,刷新右侧的页面数据
function refreshRightPanel(node){
if(node==null){
return;
}
//加载机构基础信息
loadOrgBaseInfo(node);
//加载机构业务信息
loadOrgBizInfo(node);
}
//加载机构基础信息
function loadOrgBaseInfo(node){
//打开旋转
$.wait_open();
//加载基本数据
var dataParam = {
_SRVNAME:'service.usr.org'
,_SRVMETHOD:'queryOrgInfoByID'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,org_uuid:node.id
,result_fields:''
})
};
//加载数据
$.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.result, "#orgForm");
//业务组织复选框
var is_biz_org ='0';
if(org_attr_scode == "01"){
is_biz_org = jres.result.is_fin_org;//财务组织
}else if(org_attr_scode == "02"){
is_biz_org = jres.result.is_cost_org;//成本中心
}else if(org_attr_scode == "03"){
is_biz_org = jres.result.is_profit_org;//利润中心
}else if(org_attr_scode == "04"){
is_biz_org = jres.result.is_purch_org;//采购组织
}else if(org_attr_scode == "05"){
is_biz_org = jres.result.is_qc_org;//质检组织
}else if(org_attr_scode == "06"){
is_biz_org = jres.result.is_sale_org;//销售组织
}else if(org_attr_scode == "07"){
is_biz_org = jres.result.is_stora_org;//库存组织
}else if(org_attr_scode == "08"){
is_biz_org = jres.result.is_trans_org;//发运组织
}else if(org_attr_scode == "09"){
is_biz_org = jres.result.is_hr_org;//人力资源组织
}else if(org_attr_scode == "10"){
is_biz_org = jres.result.is_produce_org;//生产组织
}
//设置业务属性值
if(is_biz_org=="1"){
$("#is_biz_org").iCheck("check");
}else{
$("#is_biz_org").iCheck("uncheck");
}
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
//加载机构业务信息
function loadOrgBizInfo(node){
$.wait_open();
//加载业务组织数据
var dataParam = {
_SRVNAME:'service.usr.bizorg'
,_SRVMETHOD:'queryOrgBizAttrByOrgID'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,org_uuid:node.id
,org_attr_scode:org_attr_scode
,result_fields:''
})
};
//加载数据
$.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"){
//回填数据
var biz_info = jres.result;
var biz_parent_uuid = "";
var biz_parent_uuid_name = "";
if(biz_info!=null && biz_info!=undefined){
var sysisdelete =biz_info.sysisdelete;
if(sysisdelete!=undefined && sysisdelete!=null && sysisdelete!="1"){
biz_parent_uuid = biz_info.parent_uuid;
biz_parent_uuid_name = biz_info.parent_uuidname;
}
}
//加载数据
$.inputpop_setValue ({
id:'biz_parent_uuid',
value_id:biz_parent_uuid,
value_text:biz_parent_uuid_name,
value_value:biz_parent_uuid_name
});
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
//保存对象
function saveBiz(){
var org_uuid = $("#org_uuid").val();
var parent_uuid = $("#parent_uuid").val();
if(org_uuid==""){
alert("请您点击组织树节点后,在执行保存操作!");
return;
}
var bizOrgFieldValues= $.getFieldValue({formid:'bizOrgForm'});
var is_biz_org = bizOrgFieldValues.is_biz_org;
var biz_parent_uuid = bizOrgFieldValues.biz_parent_uuid;
//组织参数
var dataParam = null;
if(is_biz_org=="1"){
if(parent_uuid != '-1' && biz_parent_uuid==""){ //浙江省级的允许设置为空,其他必须要选择上级节点
alert("请您选择上级业务组织!");
return;
}
dataParam = {
_SRVNAME:'service.usr.bizorg'
,_SRVMETHOD:'setOrgBizAttr'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,org_uuid:org_uuid
,org_attr_scode:org_attr_scode
,parent_uuid:biz_parent_uuid
})
};
}else{
dataParam = {
_SRVNAME:'service.usr.bizorg'
,_SRVMETHOD:'cancelOrgBizAttr'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,org_uuid:org_uuid
,org_attr_scode:org_attr_scode
})
};
}
//加载数据
$.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);
alert(jres.desc);
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true" style="background:#fff;">
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'west',border:true,collapsed:false" style="width:220px;" >
<div class="tree_title" style="width:95%;font-weight: bold;margin:15px 0 10px 8px;font-size:14px;">组织机构
</div>
<div style="width:95%;float:left;">
<div style="float:left;width:30%;text-align: right;font-weight: bold;margin-left:3px;line-height:35px;min-width:65px;">
选择类型
</div>
<div style="float:left;width:60%;">
<input id="orgType" name="orgType" type="text" style="width:100%;" />
</div>
</div>
<div id="listtree" style="width:95%;float:left;"></div>
</div>
<div data-options="region:'center',border:true,collapsed:false" style="border-left:0;">
<div class="edit-container" style="width:985px;">
<form id="bizOrgForm">
<div class="form-title" >
<span class="form-title-text">业务类型</span>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>上级业务组织</label>
<div>
<input id="is_biz_org" name="is_biz_org" type="checkbox">
</div>
<div>
<input id="biz_parent_uuid" type="text"/>
</div>
</div>
<div style="float:left;margin-left:80px;margin-top:4px;">
<button class="btn btn-default bottom-btn btn-warning" id="btn_saveBiz" onclick="saveBiz();" type="button">保 存</button>
</div>
</div>
<div style="clear: both;"></div>
</form>
<form id="orgForm">
<input type="hidden" id="org_uuid" name="org_uuid"/>
<input type="hidden" id="parent_uuid" name="parent_uuid"/>
<div class="form-title" style="margin-top:10px;">
<span class="form-title-text">基本信息</span>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>上级组织</label>
<div>
<input type="text" class="easyui-validatebox" id="parent_uuidname" name="parent_uuidname" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>系统编码</label>
<div>
<input type="text" class="easyui-validatebox" id="path_code" name="path_code" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>组织编码</label>
<div>
<input type="text" class="easyui-validatebox" id="org_code" name="org_code" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>助记码</label>
<div>
<input type="text" class="easyui-validatebox" id="mark_code" name="mark_code" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>组织名称</label>
<div>
<input type="text" class="easyui-validatebox" id="org_name" name="org_name" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>简称</label>
<div>
<input type="text" class="easyui-validatebox" id="simple_name" name="simple_name" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>英文名称</label>
<div>
<input type="text" class="easyui-validatebox" id="english_name" name="english_name" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>排序序号</label>
<div>
<input type="text" class="easyui-validatebox" id="display_order" name="display_order" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>组织类型</label>
<div>
<input type="text" class="easyui-validatebox" id="org_type_scodename" name="org_type_scodename" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>组织级别</label>
<div>
<input type="text" class="easyui-validatebox" id="org_level_scodename" name="org_level_scodename" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row" style="height:50px;">
<div class="formgroup col-12">
<label>描述</label>
<div>
<textarea class="easyui-validatebox" id="remark" name="remark" disabled="disabled" rows="2" readonly="readonly" style="resize:none;"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>虚拟组织</label>
<div>
<input type="checkbox" id="is_virtual_org" name="is_virtual_org" disabled/>
</div>
</div>
</div>
<div class="form-title" style="margin-top:10px;">
<span class="form-title-text">行政信息</span>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>行政区划</label>
<div>
<input type="text" class="easyui-validatebox" id="area_uuidname" name="area_uuidname" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>法人单位</label>
<div>
<input type="checkbox" id="is_ppl_org" name="is_ppl_org" disabled/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>法人代表</label>
<div>
<input type="text" class="easyui-validatebox" id="principle" name="principle" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>电话</label>
<div>
<input type="text" class="easyui-validatebox" id="tel_no" name="tel_no" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row">
<div class="formgroup" style="width:450px;">
<label>传真</label>
<div>
<input type="text" class="easyui-validatebox" id="fax" name="fax" value="" readonly="readonly"/>
</div>
</div>
<div class="formgroup" style="width:450px;">
<label>邮编</label>
<div>
<input type="text" class="easyui-validatebox" id="zip_code" name="zip_code" value="" readonly="readonly"/>
</div>
</div>
</div>
<div class="row" style="height:50px;">
<div class="formgroup col-12">
<label>地址</label>
<div>
<textarea class="easyui-validatebox" id="address" name="address" disabled="disabled" rows="2" readonly="readonly" style="resize:none;"></textarea>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>