123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468 |
- <%@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">
- //登陆人的机构id
- var loginOrgId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //登录人id
- var entryManId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //当前点击的机构节点
- var parentClickOrg = parent.selectedTreeNode;
- //记录选中的组织id
- var selectedOrgId=[];
- //当前点击的机构节点
- var parentClickOrg = parent.selectedTreeNode;
- //修改的人员主键id
- var fd_id = "<%=request.getParameter("fd_id")%>";
- //保存ajax 数据 用于重置按钮
- var resetValue={};
- //tab 标签id
- var tabId = parent.tabIndex;
- //部门树的名称(id)
- var Dname="";
- //部门树的显示名
- var DnameShow="";
- //联动人的名称(id)
- var Lname="";
- //联动人的显示名
- var LnameShow="";
- $(function(){
- //绑定表单提交按钮和重置按钮
- $("#save").bind("click",function(){
- editValidate();
- });
-
- $("#cancel").bind("click",function(){
- reset_input();
- });
-
- // 记录选中的树的名字用于给表单赋值
- var orgName = parentClickOrg.name;
- var tree_fd_id = parentClickOrg.id;
- //标记机构类型
- var flagOrgType = parentClickOrg.orgType;
-
- // 部门树的请求地址
- var deptUrl = $.pathname()
- + '/ws/InDepartmentService/InDepartmentService/getOrgInfoById';
- // 添加额外属性主要用于最初的初始节点
- $("#LINK_DEPT_210").attr('params', '{"deptId":"' + loginOrgId + '"}');
- // 异步加载请求地址
- $("#LINK_DEPT_210").attr('url', deptUrl);
-
- var url = $.pathname() + "/ws/crud/CRUDService/getDataById/";
- var params = {
- classid : '210',
- objectID : fd_id
- };
- /* ajax请求 */
- $
- .ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data) {
- // 给resetValue赋值
- resetValue = data;
- $('#fillForm').ajaxWrite({
- data : data
- });
- $("#outlinktitle").html("修改"+orgName+"联系人") ;
- //给部门名称赋值
- $("#ORG_DEPT_ID_210_SHOW").html(data.ORG_DEPT_ID_210_SHOW);
- $("#ORG_TYPE_210_SHOW").html(transFormType(data.ORG_TYPE_210));
-
- $('#fillForm input[name="classid"]').val('210');
- // 设定联动部门树形下拉框的值
- Dname = data.LINK_DEPT_210;
- DnameShow = data.LINK_DEPT_210_SHOW;
- // 异步加载树的赋值--联动部门
- $("#LINK_DEPT_210").attr("relValue", Dname);
- $("#LINK_DEPT_210").attr("relText", DnameShow);
- $("#LINK_DEPT_210").find("input:text").val(DnameShow);
- // 设定联动联系人树形下拉框的值
- Lname = data.LINK_MAN_210;
- LnameShow = data.LINK_MAN_210_SHOW;
-
-
- // 初次加载获取联动人员下拉框 。
- // 联动人员请求地址
- var pUrl = $.pathname()
- + '/ws/orgInDeptService/OrgInDeptService/getInLinkManJustById';
- // 联动人员的的post请求
- $.post(pUrl, {
- "id" : Dname
- }, function(data) {
- // 判定选中机构下是否有联动人员
- if (data.treeNodes.length == 0) {
- $("#LINK_MAN_210").data("data","");
- $("#LINK_MAN_210").render();
- } else {
- // 存在联动人员则加载树
- $("#LINK_MAN_210").data("data", data);
- $("#LINK_MAN_210").render();
- }
- }, "json");
-
- $("#LINK_MAN_210").attr("relValue", Lname);
- $("#LINK_MAN_210").attr("relText", LnameShow);
- $("#LINK_MAN_210").find("input:text").val(LnameShow);
-
- $("#UPDATEDATE").html(data.UPDATEDATE_210);
-
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- // 绑定部门下拉框的选中值得改变状态
- $("#LINK_DEPT_210")
- .bind(
- "change",
- function() {
- var selectedDept = $(this).attr("relValue");
- var selectedNode = $("#LINK_DEPT_210").data("selectedNode");
- if (selectedDept) {
- // 联动人员请求地址
- var pUrl = $.pathname()
- + '/ws/orgInDeptService/OrgInDeptService/getInLinkManById';
- // 联动人员的的post请求
- $.post(pUrl, {
- "id" : selectedDept,
- "type":selectedNode.isVirtual
- }, function(data) {
- // 判定选中机构下是否有联动人员
- if (data.treeNodes.length == 0) {
- top.Dialog.alert("该机构下没有联动人员");
- $("#LINK_MAN_210").data("data","");
- $("#LINK_MAN_210").render();
- } else {
- // 存在联动人员则加载树
- $("#LINK_MAN_210").data("data", data);
- $("#LINK_MAN_210").render();
- }
- }, "json");
- }
- });
-
- /****************************登陆人信息************************/
- //取登录用户信息
- //登录用户姓名
- 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);
- }
-
- //用户所属单位
- var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- $("#COMPANY_ID_880").html(getCorp_names);
- //用户所属部门
- var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- $("#ORG_ID_880").html(getDeptnames);
- /****************************登陆人信息************************/
- });
- //转换机构类型
- function transFormType(type){
- var typeShow="机构类别";
- switch(type){
- case '1':
- typeShow='政府机关';
- break;
- case '2':
- typeShow='教育';
- break;
- case '3':
- typeShow='卫生';
- break;
- case '4':
- typeShow='公安';
- break;
- case '5':
- typeShow='消防';
- break;
-
- case '6':
- typeShow='三防';
- break;
- case '7':
- typeShow='厂家';
- break;
- case '8':
- typeShow='重要用户';
- break;
- case '9':
- typeShow='其他';
- break;
- default :
- typeShow='其他';
- }
-
- return typeShow;
-
- }
- // 新增表单验证
- function editValidate() {
- var valid = $("#fillForm").validationEngine({
- returnIsValid : true,
- });
- if (valid == true) {
- editfn();
- } else {
- top.Dialog.alert('表单填写不正确,请按要求填写!');
- }
- }
- // 新增事件
- function editfn() {
- $("#ENTRY_MAN_ID_210").val(entryManId);
- $("#classid").val("210");
- $form = $("#fillForm");
- var formValue = $form.serialize();
- var url = $.pathname() + "/ws/crud/CRUDService/update/";
- $.ajax({
- url : url,
- type : "post",
- timeout : 60000,
- data : formValue,
- dataType : "json",
- async : false,
- success : function(data) {
- if (data.Msg.info == "修改成功") {
-
- //切换标签
- parent.avtiveTab('tab1_index1');
- //关闭页签
- parent.closeTab('tab1_index'+tabId);
- top.Dialog.alert("修改外部联系人成功");
- }
- if (data.Msg.info == "修改失败") {
- top.Dialog.alert("修改外部联系人失败");
- }
- },
- error : function() {
- top.Dialog.alert("修改失败,稍后再试...");
- }
- });
- };
- // 重置按钮
- function reset_input() {
- $("#LIAISON_NAME_210").val(resetValue.LIAISON_NAME_210);
- $("#PHONE_210").val(resetValue.PHONE_210);
- $("#ORG_TYPE_210").resetValue();
- $("#ORG_ADDRESS_210").val(resetValue.ORG_ADDRESS_210);
- $("#CODE_210").val(resetValue.CODE_210);
- $("#LANDLINE_210").val(resetValue.LANDLINE_210);
- $("#FAX_210").val(resetValue.FAX_210);
- $("#EMAIL_210").val(resetValue.EMAIL_210);
- $("#SITE_210").val(resetValue.SITE_210);
- // 重置联动部门
- $("#LINK_DEPT_210").attr("relValue", Dname);
- $("#LINK_DEPT_210").attr("relText", DnameShow);
- $("#LINK_DEPT_210").find("input:text").val(DnameShow);
- // 重置联动联系人
- $("#LINK_MAN_210").attr("relValue", Lname);
- $("#LINK_MAN_210").attr("relText", LnameShow);
- $("#LINK_MAN_210").find("input:text").val(LnameShow);
- }
- </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="outlinktitle"></font>
- </div>
- <div style="margin:10px 20px 0px 0px;float:right;">
- <input value="保存" id="save" type="button"/>
- <input id="cancel" value="重置" type="button"/>
- </div><br />
- <fieldset style="border-color:#cdcaca;margin:0px 20px 10px 20px" >
- <legend class="legend">基本信息:</legend>
- <form method="post" action="" id="fillForm">
- <table class="table-style" align="center" >
- <tr style="display: none;">
- <td>
- <input type="hidden" id="fd_id210" name="FD_OBJECTID210" required="true" />
- <input type="hidden" name="classid" value="210" required="true" />
- <input type="hidden" name="ORG_DEPT_ID_210" id="ORG_DEPT_ID_210" required="true" />
- <input type="hidden" name="ORG_TYPE_210" id="ORG_TYPE_210" required="true" />
- <input type="hidden" name="ENTRY_MAN_ID_210" id="ENTRY_MAN_ID_210" required="true" />
- </td>
- </tr>
- <tr>
- <td width="15%" align="right" style="padding-top: 10px"><span class="star">*</span><span class="td-font">联系人:</span></td>
- <td width="35%" style="padding-top: 10px"><input id="LIAISON_NAME_210" name="LIAISON_NAME_210" type="text" maxlength="10"
- class="validate[required,custom[chinese],length[1,10]]" /></td>
- <td width="15%" align="right" style="padding-top: 10px"><span class="star">*</span><span class="td-font">联系人手机:</span></td>
- <td width="35%" style="padding-top: 10px"><input id="PHONE_210" name="PHONE_210" type="text" maxlength="15"
- class=" validate[required,custom[mobilephone]]" /></td>
- </tr>
- <tr>
- <td align="right"><span class="td-font">机构类别:</span></td>
- <td name="ORG_TYPE_210_SHOW" id="ORG_TYPE_210_SHOW" ></td>
- <td align="right"><span class="td-font">外部机构名称:</span></td>
- <td id="ORG_DEPT_ID_210_SHOW" name="ORG_DEPT_ID_210_SHOW"></td>
- </tr>
-
- <tr>
- <td align="right"><span class="td-font">联系人座机:</span></td>
- <td ><input id="LANDLINE_210" name="LANDLINE_210" type="text" maxlength="15"
- class=" validate[custom[onlyNumber]],length[0,15]" /></td>
- <td align="right"><span class="td-font">联系人传真:</span></td>
- <td ><input id="FAX_210" name="FAX_210" type="text" maxlength="15"
- class=" validate[custom[telephone]]" /></td>
- </tr>
- <tr>
- <td align="right"><span class="td-font">办公OA邮箱:</span></td>
- <td ><input id="EMAIL_210" name="EMAIL_210" type="text" maxlength="30"
- class="validate[custom[email]]" /></td>
- <td align="right"><span class="td-font">网址:</span></td>
- <td ><input id="SITE_210" name="SITE_210" type="text" maxlength="30"
- class=" validate[length[0,64]]" /></td>
- </tr>
- <!-- <tr>
- <td align="right"><span class="star">*</span><span class="td-font">联动部门:</span></td>
- <td ><div class="selectTree validate[required]"
- id="LINK_DEPT_210" asyncMode="true" name="LINK_DEPT_210" selWidth="206"></div></td>
- <td align="right"><span class="star">*</span><span class="td-font">联动联系人:</span></td>
- <td ><div class="selectTree validate[required]"
- id="LINK_MAN_210" name="LINK_MAN_210" selWidth="206"></div></td>
- </tr> -->
- <tr>
-
- <td align="right"><span class="td-font">邮编:</span></td>
- <td colspan="3"><input id="CODE_210" name="CODE_210" type="text" maxlength="10"
- class=" validate[custom[zipcode]]" /></td>
- </tr>
- <tr>
- <td align="right" ><span class="td-font">所在区域:</span></td>
- <td colspan="3" ><input maxlength="46" type="text" style="width:86%;" id="LOCATION_210" name="LOCATION_210"
- class=" validate[length[0,80]]"/></td>
- </tr>
- <tr>
- <td align="right" style="padding-bottom: 10px"><span class="td-font">地址:</span></td>
- <td colspan="3" style="padding-bottom: 10px"><input id="ORG_ADDRESS_210" maxlength="46" style="width:86%;"
- name="ORG_ADDRESS_210" type="text"
- class=" validate[length[0,256]]" /></td>
- </tr>
- </table>
- </form>
- </fieldset>
- <!-- *****************************录入人信息部分************************************** -->
- <fieldset style="border-color:#cdcaca;margin:10px 20px 10px 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>
- <tr>
- <td align="right" class="td-style"><span class="td-font">录入时间:</span></td>
- <td class="td-style" colspan="3"><div id="UPDATEDATE" name="UPDATEDATE" readOnly="true"/></td>
- </tr>
- </table>
- </fieldset>
- <!-- /***************************************录入人信息end***************************************/ -->
- </div>
- </body>
- </html>
|