123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- <%@page language="java" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>组织机构管理</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <!--框架必需start-->
- <%@include file="../.././../../include1.jsp"%>
- <!--引用资源文件,JS CSS-->
- <script type="text/javascript"
- src="<%=path%>/scripts/jquery/plugins/jquery.extension.util.js"></script>
- <script type="text/javascript"
- src="<%=path%>/scripts/freamwork/com/sinosoft/common/common.js"></script>
- <script type="text/javascript"
- src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/utils.js"></script>
- <script type="text/javascript"
- src="<%=path%>/scripts/freamwork/com/sinosoft/common/frameWork/frameWork.js"></script>
- <script type="text/javascript"
- src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
- <script type="text/javascript"
- src="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.js"></script>
- <link
- href="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.css"
- rel="stylesheet" type="text/css" />
- <style type = "text/css">
- .legend{
- font-family:宋体;
- font-weight: bold;
- font-size:14px;
- color:#3e62a0;
- }
- .table-style{
- border-style:solid;
- border-width:1px;
- border-color:#cdcaca;
- margin:0px 20px 0px 20px;
- border-collapse:collapse;
- width: 895px;
- }
- .table-style2{
- border:1px solid #cdcaca;
- margin:0px 20px 0px 20px;
- border-collapse:collapse;
- width: 895px;
- }
- .td-font{
- font-family:宋体;
- font-size:14px;
- color:#161616;
- }
- .td-move{
- padding: 10px 5px 0px 0px;
- }
- .td-style{
- border:1px solid #cdcaca;
- border-collapse:collapse;
- padding-left: 10px
- }
- </style>
- <script type="text/javascript">
- //新增的父机构节点
- var parentClickOrg = parent.selectedTreeNode;
- //登录人id
- var entryManId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //tab 标签id
- var tabId = parent.tabIndex;
- //重置的值
- var resetValue={};
- $(function(){
- //绑定重置按钮
- $("#OrgReset").bind("click",function(){
- window.location.href="/nwyj/page/business/am/org/query/Add_VirtualOrg.jsp";
- //reset_input();
- })
-
- //给下拉框赋值--常量表中的
- //$("#ORG_TYPE").initCanstSelect('BM_VIRTUAL_ORG_TYPE');
- $("#ORG_PROP").initCanstSelect('BM_ORG_PROP');
- $("#OFFICE_TYPE").initCanstSelect('BM_ORG_OFFICE_TYPE');
-
- getOrgType();
-
- //机构性质下拉框绑定change事件
- $("#ORG_TYPE").bind("change",function(){
- var selValue = $(this).attr("relValue");
- if(selValue=="XCZHB"||selValue=="XCGZZ"){
- $star =$('<span class="star">*</span>');
- $("#ORG_ADDRESS").attr("class","validate[required,length[1,80]]");
- $("#ORG_ADDRESS").parent("td").prev().html('<span class="star">*</span>机构地址');
- $("#ORG_ADDRESS").render();
- $("#ORG_PROP").attr("selectedValue","");
- $("#ORG_PROP").attr("class","");
- $("#ORG_PROP").attr("disabled",true);
- $("#ORG_PROP").render();
- }else{
- $("#ORG_PROP").attr("class","validate[required,length[1,25]]");
- $("#ORG_PROP").attr("disabled",false);
- if(selValue=="ZHZX"){
- $("#ORG_PROP").attr("selectedValue","YJZHJG");
- }else if(selValue=="ZHZXYJB"){
- $("#ORG_PROP").attr("selectedValue","YJGLJG");
- }else{
- $("#ORG_PROP").attr("selectedValue","");
- }
- $("#ORG_PROP").render();
- $("#ORG_ADDRESS").attr("class","validate[length[0,80]]");
- $("#ORG_ADDRESS").parent("td").prev().html('机构地址');
- $("#ORG_ADDRESS").render();
- }
- });
- gernerateInputs("DUTY_TEL");
- //gernerateInputs("EMERGENCY_TEL");
- //gernerateInputs("EMERGENCY_TEL","1231,232,3434,343");
-
- //修改标题
- $("#titleShow").html("新增【"+parentClickOrg.name+"】信息");
-
-
- //取登录人的ID
- ENTERING_214 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //用户所属单位
- var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames()
- //取登录用户信息
- //登录用户姓名
- var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- $("#REAL_NAME_880").html(userName);
- //用户手机号
- getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
- if(getMobile==undefined){
- $("#MOBILE_880").html("暂无手机号码");
- }else{
- $("#MOBILE_880").html(getMobile);
- }
-
- $("#COMPANY_ID_880").html(getCorp_names);
- $("#ORG_ID_880").html(getDeptnames);
-
-
- });
- //生成input
- function gernerateInputs(id,data){
- $("#"+id).empty();
- $firstSpan = $('<span><input class="validate[required,custom[onlyNumber],length[1,15]] " type="text" style ="margin: 0px 0px 5px 0px;" maxlength="15" ><img style = "margin:0px 0px 0px 7px" src="/nwyj/scripts/qui/libs/icons/add.png" onclick="addMore(this)"/></span>');
- $secondSpan =$('<span><input class="validate[required,custom[onlyNumber],length[1,15]] " type="text" style ="margin: 0px 0px 5px 0px;" maxlength="15" ><img style = "margin:0px 0px 0px 7px" src="/nwyj/scripts/qui/libs/icons/delete.png" onclick="deleteInput(this)"/></span>') ;
-
- if(data==null||data==undefined||data==""||data=="null"){
-
- $("#"+id).append($firstSpan);
-
- }else{
-
-
- var dataValues = data.split(",");
- $("#"+id).append($firstSpan);
- //加载input
- for(var i = 1;i<dataValues.length;i++){
-
- addMore($("#"+id).find("span:first").find("span"));
- //$("#"+id).append($secondSpan);
-
- }
- //赋值
- $("#"+id).children("span").each(function(index ,event){
-
-
- $(this).find("input").val(dataValues[index]);
-
- });
-
- }
- $("#"+id).find("input").render();
-
- }
- //新增一个input
- function addMore(event){
- var $td = $(event).parent("span").parent("td");
- if($td.children("span").length>4){
- top.Dialog.alert("超过个数限制");
- return;
- }
- var $i = $(event).prev().clone();
- $i.val("");
- var $span = $('<span></span>');
- //alert($(event).prev().attr("id"));
- $span.append($i);
- $span.append($('<img style = "margin:0px 0px 0px 7px" src="/nwyj/scripts/qui/libs/icons/delete.png" onclick="deleteInput(this)"/>'))
- $(event).parent("span").parent("td").append($span);
- }
- //获取inputs 的值
- function getAllTel(id){
- var v="";
- $("#"+id).children("span").each(function(){
- var t = $(this).find("input").val();
- v +=t+",";
- });
-
- if(v.lastIndexOf(",") > -1){
-
- v=v.substring(0, v.length-1);
-
- }
- return v;
- }
- //删除input
- function deleteInput(event){
- $(event).parent("span").remove();
- }
- //新增验证
- function addValidate(){
- var valid = $("#fillForm").validationEngine({
- returnIsValid : true,
- });
- if (valid == true) {
- addfn();
- } else {
- top.Dialog.alert('表单填写不正确,请按要求填写!');
- }
-
- };
- //新增后台方法
- //新增机构信息--发送请求后台交互
- function addfn(){
-
- $("#fillForm input[name='PARENT_ID']").val(parentClickOrg.id);
- $("#fillForm input[name='IS_VIRTUAL']").val("1");
- $("#fillForm input[name='DUTY_TEL']").val(getAllTel("DUTY_TEL"));
- $("#fillForm input[name='EMERGENCY_TEL']").val(getAllTel("EMERGENCY_TEL"));
- $("#fillForm input[name='ENTRY_MAN_ID']").val(entryManId);
- var entrycompName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- $("#fillForm input[name='ENTRY_MAN_NAME']").val(entrycompName);
-
-
- var $form = $("#fillForm");
- var formValue = $form.serialize();
- var url = $.pathname() + "/ws/InDepartmentService/InDepartmentService/createVirtualOrg";
- $.ajax({
- url : url,
- type : "post",
- timeout : 60000,
- data : formValue,
- async:false,
- dataType : "json",
- success : function(data) {
- top.Dialog.alert("新增机构成功!");
- //新增应急机构成功后更新树
- parent.initTree();
-
- parent.addNewVirtualOrg(parentClickOrg,data,tabId);
-
- },
- error : function() {
- top.Dialog.alert("新增机构失败,稍后再试...");
- }
- });
-
- };
-
- //重置按钮
- function reset_input(){
- $("#ORG_NAME").val("");
- $("#ORG_NAME").resetValue();
- $("#ORG_TYPE").resetValue();
- $("#ORG_PROP").resetValue();
- $("#SHORT_NAME").val(resetValue.SHORT_NAME);
- $("#OFFICE_TYPE").resetValue();
- $("#ORG_ADDRESS").val(resetValue.ORG_ADDRESS);
- $("#DUTY_FAX").val(resetValue.DUTY_FAX);
- $("#EMERGENCY_FAX").val(resetValue.EMERGENCY_FAX);
- $("#DUTY_EMAIL").val(resetValue.DUTY_FAX);
- $("#EMERGENCY_EMAIL").val(resetValue.EMERGENCY_FAX);
- //重置电话号码
- gernerateInputs("DUTY_TEL",resetValue.DUTY_TEL);
- gernerateInputs("EMERGENCY_TEL",resetValue.EMERGENCY_TEL);
-
- /* //刷新当前页面即可
- window.location.reload();//刷新当前页面. */
-
-
- }
- /************2016-09-13 唐群胜加****************/
- function getOrgType(){
- $.ajax({
- url : $.pathname() + "/ws/InDepartmentService/InDepartmentService/getOrgType",
- type : "post",
- timeout : 60000,
- data : {id:parentClickOrg.id},
- async:false,
- dataType : "text",
- success : function(data) {
- if(data=="ZHZX"){
- var selData={"list":[{"value":"ZHZXYJB","key":"应急办"},{"value":"XCZHB","key":"现场指挥部"},{"value":"XCGZZ","key":"现场工作组"},{"value":"XCCZZHB","key":"现场应急处置指挥部"}]};
- $("#ORG_TYPE").data("data",selData)
- $("#ORG_TYPE").render();
- }else if(data=="ZHZXYJB"){
- var selData={"list":[{"value":"ZHZX","key":"应急指挥中心"},{"value":"XCZHB","key":"现场指挥部"},{"value":"XCGZZ","key":"现场工作组"},{"value":"XCCZZHB","key":"现场应急处置指挥部"}]};
- $("#ORG_TYPE").data("data",selData)
- $("#ORG_TYPE").render();
- }else if(data=="ZHZXZHZXYJB"){
- var selData={"list":[{"value":"XCZHB","key":"现场指挥部"},{"value":"XCGZZ","key":"现场工作组"},{"value":"XCCZZHB","key":"现场应急处置指挥部"}]};
- $("#ORG_TYPE").data("data",selData)
- $("#ORG_TYPE").render();
- }else{
- $("#ORG_TYPE").initCanstSelect('BM_VIRTUAL_ORG_TYPE');
- }
- }
- });
- }
- </script>
- </head>
- <body>
- <div id="formContent" style="overflow:auto;border: 1px solid #cdcaca;background:white;">
- <div style="height: 50px;border: 1px solid #cdcaca;border-right:1px;border-left:1px;border-top:1px;" align="center">
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;color:#3e62a0;" id="titleShow"></font>
- </div>
-
- <form id="fillForm" action="javascript:addValidate()" method="post" failAlert="表单填写错误,请检查">
-
- <div style="margin:10px 20px 0px 0px;float:right;">
- <input type="submit" value="保存 " />
- <input type="button" id="OrgReset" value="重置 " />
- </div><br />
-
- <!-- /***********************************机构基本信息********************************************/ -->
- <fieldset style="border-color:#cdcaca;margin:0px 20px 10px 20px">
- <legend class="legend">基本信息:</legend>
- <table class="table-style" align="center">
- <tr style="display: none;">
- <td><input type="hidden" id="fd_id" name="FD_OBJECTID"
- required="true" />
- <input type="hidden" name="classid"
- value="" required="true" />
- <input type="hidden" name="PARENT_ID"
- required="true" />
- <input type="hidden" name="IS_VIRTUAL"
- required="true" value="" />
- <input type="hidden" name="SORT_NO"
- required="true" value="" />
- <input type="hidden" name="ORG_LEVEL"
- required="true" value="" />
- <input type="hidden" name="DUTY_TEL"
- required="true" value="" />
- <input type="hidden" name="ENTRY_MAN_ID"
- required="true" value="" />
- <input type="hidden" name="ENTRY_MAN_NAME"
- required="true" value="" />
- <input type="hidden" name="EMERGENCY_TEL"
- required="true" value="" />
- </td>
- </tr>
- <tr>
- <td align="right" width="120px" ><span class="star">*</span><span class="td-font">机构类型:</span></td>
- <td width="280px" ><select id="ORG_TYPE" selWidth="206"
- name="ORG_TYPE" prompt="请选择"
- class="validate[required]" />
- </td>
-
- <td align="right" width="120px" ><span class="star">*</span><span class="td-font">机构名称:</span></td>
- <td width="280px"><input id="ORG_NAME"
- name="ORG_NAME" type="text" maxlength="25"
- class="validate[required,length[1,25]]" />
- </td>
-
- </tr>
- <tr>
- <td align="right" ><span class="star">*</span><span class="td-font">机构性质:</span></td>
- <td ><select id="ORG_PROP"
- name="ORG_PROP" prompt="请选择"
- class="validate[required]" selWidth="206" /></td>
- <td align="right" ><span class="star">*</span><span class="td-font">办公类型:</span></td>
- <td ><select id="OFFICE_TYPE"
- name="OFFICE_TYPE" prompt="请选择"
- class="selectWidth validate[required]" selWidth="206" /></td>
- </tr>
- <tr>
- <td align="right" ><span class="td-font">机构地址:</span></td>
- <td colspan="3" ><input id="ORG_ADDRESS" name="ORG_ADDRESS" maxlength="80" type="text" style="width: 86%;"
- class=" validate[length[0,80]]" />
- </tr>
- <tr>
- <td align="right" ><span class="star">*</span><span class="td-font">总值班室电话:</span></td>
- <td id="DUTY_TEL" width="200px"></td><!-- 加宽度是防止有的浏览器在会使页面变形 -->
- <td align="right" ><span class="star">*</span><span class="td-font">应急办电话:</span></td>
- <td id="EMERGENCY_TEL" width="200px">
- <span> <input class="validate[required,custom[onlyNumber],length[1,15]] textinput" type="text" maxlength="15" style="margin: 0px 0px 5px; font-family: 微软雅黑; font-size: 14px;" truetype="textinput">
- <img onclick="addMore(this)" src="/nwyj/scripts/qui/libs/icons/add.png" style="margin:0px 0px 0px 7px">
- </span>
- </td>
- </tr>
- <tr>
- <td align="right" ><span class="td-font">总值班室传真:</span></td>
- <td ><input id="DUTY_FAX" name = "DUTY_FAX" maxlength="15"type="text" class=" validate[custom[onlyNumber],length[0,15]]" /></td>
- <td align="right" ><span class="td-font">应急办传真:</span></td>
- <td > <input id="EMERGENCY_FAX" name = "EMERGENCY_FAX" maxlength="15"type="text" class=" validate[custom[onlyNumber],length[0,15]]" /></td>
- </tr>
- <tr>
- <td align="right" ><span class="td-font">总值班室邮箱:</span></td>
- <td > <input id="DUTY_EMAIL" name = "DUTY_EMAIL" maxlength="30"type="text" class=" validate[custom[email],length[0,30]]" /></td>
- <td align="right" ><span class="td-font">应急办邮箱:</span></td>
- <td > <input id="EMERGENCY_EMAIL" name = "EMERGENCY_EMAIL" maxlength="30"type="text" class=" validate[custom[email],length[0,30]]" /></td>
- </tr>
- </table>
- </fieldset>
-
- <!-- /***************************************机构基本信息end************************************/ -->
-
-
- <!-- *****************************录入人信息部分************************************** -->
- <fieldset style="border-color:#cdcaca;margin:10px 20px 20px 20px" >
- <legend class="legend">填写人员信息:</legend>
- <table align="center" class="table-style2" id="fillForm">
- <tr>
- <td align="right" width="120px" class="td-style"><span class="td-font">单位:</span></td>
- <td width="280px" class="td-style"><div id="COMPANY_ID_880" name="COMPANY_ID_880" readOnly="true"/></td>
- <td align="right" width="120px" class="td-style"><span class="td-font">部门:</span></td>
- <td width="280px" class="td-style"><div id="ORG_ID_880" name="ORG_ID_880" readOnly="true"/></td>
- </tr>
- <tr>
- <td align="right" class="td-style"><span class="td-font">填写人员:</span></td>
- <td class="td-style"><div id="REAL_NAME_880" name="REAL_NAME_880" readOnly="true"/></td>
- <td align="right" class="td-style"><span class="td-font">填写人员联系方式:</span></td>
- <td class="td-style"><div id="MOBILE_880" name="MOBILE_880" readOnly="true"/></td>
- </tr>
- </table>
- </fieldset>
- <!-- /***************************************录入人信息end***************************************/ -->
-
- </form>
- </div>
- </body>
- </html>
|