123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469 |
- <!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>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>应急组织外部机构信息</title>
- <!--框架必需start-->
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/framework.js"></script>
- <link href="/nwyj/scripts/qui/libs/css/import_basic.css"
- rel="stylesheet" type="text/css" />
- <link rel="stylesheet" type="text/css" id="skin"
- prePath="/nwyj/scripts/qui/" />
- <link rel="stylesheet" type="text/css" id="customSkin" />
- <!--框架必需end-->
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/form/form.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/form/validation.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/form/validationRule.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/popup/messager.js"></script>
- <!--弹窗组件start-->
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/popup/drag.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/popup/dialog.js"></script>
- <!--弹窗组件end-->
- <!--弹出式提示框start-->
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/popup/messager.js"></script>
- <!--弹出式提示框end-->
- <!--数据表格start-->
- <script src="/nwyj/scripts/qui/libs/js/table/quiGrid.js"
- type="text/javascript"></script>
- <!--数据表格end-->
- <!--树组件start-->
- <link rel="stylesheet" type="text/css"
- href="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.css" />
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/form/selectTree.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/form/listerTree.js"></script>
- <!--树组件end-->
- <!-- 日期选择框start -->
- <script type="text/javascript"
- src="/nwyj/scripts/qui/libs/js/form/datePicker/WdatePicker.js"></script>
- <!-- 日期选择框end -->
- <!-- 扩展工具js -->
- <script type="text/javascript" src="/nwyj/scripts/common/common.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/jquery/plugins/jquery.extension.util.js"></script>
- <script type="text/javascript"
- src="/nwyj/scripts/freamwork/com/sinosoft/common/common.js"></script>
-
- <!-- <script type="text/javascript"
- src="../../../../../scripts/business/am/org/maintenance/out-orginfo.js"></script> -->
- <script type="text/javascript">
- //部门id
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //取得用户真实姓名
- var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //获取用户的Id
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //部门名称
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- //外部单位的怕人id
- var outOrgParentId =top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //alert("进入modify页面");
- var fd_id="";
- var resetValue = {};
- var flagAdd_Edit;
- // 记录树形下拉框值
- var Dname;
- var DnameShow;
- var Lname;
- var LnameShow;
- $(function() {
- //绑定点击图片事件
- $("#back").click(function(){
- //fd_id = fd_id==""?outOrgParentId:fd_id;
- goBack();
-
- });
- $("#OrgReset").bind("click",function(){
- reset_input();
-
- })
-
- //给下拉框赋值--常量表中的
- $("#ORG_DEPT_TYPE_212").initCanstSelect('BM_OUT_ORG_TYPE');
-
- // 部门树的请求地址
- var deptUrl = $.pathname()
- + '/ws/orgInDeptService/OrgInDeptService/getDeptRootById';
- // 添加额外属性主要用于最初的初始节点
- $("#LINK_DEPT_212").attr('params', '{"deptId":"' + dpids + '"}');
- // 异步加载请求地址
- $("#LINK_DEPT_212").attr('url', deptUrl);
-
- var iframe = parent.document.getElementsByName("frmrightChild")[0];
- var iframeUrl = iframe.src;
- //alert("修改src==="+iframeUrl);
- //判定修改或者新增
- if ((iframeUrl).indexOf('?') > -1) {
- flagAdd_Edit="edit";
- //alert("进入修改界面");
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- fd_id = iframeUrl.split('?')[1];
- var params = {
- classid : '212',
- objectID : fd_id
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data) {
- resetValue=data;
-
- $("#fillForm").ajaxWrite({
- data : data
- });
- $("#fillForm input[name='classid']").val("212");
- $("#fillForm input[name='fd_id212']").val(fd_id);
- //修改标题
- $("#titleShow").html("修改"+data.ORG_DEPT_NAME_212+"信息");
-
-
-
- // 设定联动部门树形下拉框的值
- Dname = data.LINK_DEPT_212;
- DnameShow = data.LINK_DEPT_212_SHOW;
- // 获取隐藏域的值(已通过SHOW转换了的值)--树形下拉框的隐形域
- // 异步加载树的赋值--联动部门
- $("#LINK_DEPT_212").attr("relValue", Dname);
- $("#LINK_DEPT_212").attr("relText", DnameShow);
- $("#LINK_DEPT_212").find("input:text").val(DnameShow);
- // 设定联动联系人树形下拉框的值
- Lname = data.LINK_MAN_212;
- LnameShow = data.LINK_MAN_212_SHOW;
-
- $("#LINK_MAN_212").attr("relValue", Lname);
- $("#LINK_MAN_212").attr("relText", LnameShow);
- $("#LINK_MAN_212").find("input:text").val(LnameShow);
-
- /*
- * //给联动联系人赋值--用于表单提交 $("#linkName").val(Lname);
- */
- // 联动人员请求地址
- /* var pUrl = $.pathname()
- + '/ws/orgInDeptService/OrgInDeptService/getInLinkManById';
- // 联动人员的的post请求
- $.post(pUrl, {
- "id" : Dname
- }, function(data) {
- // 存在联动人员则加载树
- $("#LINK_MAN_212").data("data", data);
- $("#LINK_MAN_212").render();
- }, "json");
- $("#LINK_MAN_212").attr("selectedValue", Lname);
- $("#LINK_MAN_212").render(); */
-
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }else{
- //新增
- //alert("进入新增界面");
- //修改标题
- flagAdd_Edit="add";
- // 初始化部门树
- $.post(deptUrl, {
- "id" : dpids
- }, function(data) {
- $("#LINK_DEPT_212").data("data", data);
- $("#LINK_DEPT_212").render();
- }, "json");
- $("#titleShow").html("新增外部机构");
- };
-
- // 绑定部门下拉框的选中值得改变状态
- $("#LINK_DEPT_212").bind(
- "change",
- function() {
- var selectedDept = $(this).attr("relValue");
- var selectedNode = $("#LINK_DEPT_212").data("selectedNode");
- if (selectedDept) {
- // 联动人员请求地址
- var pUrl = $.pathname()
- + '/ws/orgInDeptService/OrgInDeptService/getInLinkManById';
- // 联动人员的的post请求
- $.post(pUrl, {
- "id" : selectedDept,
- "type":selectedNode.isV
- }, function(data) {
- // 判定选中机构下是否有联动人员
- if (data.treeNodes.length == 0) {
- top.Dialog.alert("该机构下没有联动人员");
- $("#LINK_MAN_212").resetValue();
- } else {
- // 存在联动人员则加载树
- $("#LINK_MAN_212").data("data", data);
- $("#LINK_MAN_212").render();
- }
- }, "json");
- }
- });
- });
- //修改事件--表单提交时触发
- function save_orgInfo1() {
-
- if(flagAdd_Edit=="add"){
- //验证表单--新增
- addValidate();
- }else if(flagAdd_Edit="edit"){
- //验证表单--修改
- editValidate();
- }
- };
- //修改表单验证
- function editValidate() {
- var valid = $("#fillForm").validationEngine({
- returnIsValid : true,
- });
- if (valid == true) {
- editfn();
- } else {
- top.Dialog.alert('表单填写不正确,请按要求填写!');
- }
- };
- //新增
- function addValidate(){
- var valid = $("#fillForm").validationEngine({
- returnIsValid : true,
- });
- if (valid == true) {
- addfn();
- } else {
- top.Dialog.alert('表单填写不正确,请按要求填写!');
- }
-
- };
- //新增机构信息--发送请求后台交互
- function addfn(){
- //alert("进入新增表单提交");
- var orgNameInform = $("#ORG_DEPT_NAME_212").val();
- //记录新增的机构类别
- var addorgType = $("#ORG_DEPT_TYPE_212").attr("relValue");
- //alert(addorgType);
- $("#fillForm input[name='PARENT_ID_212']").val(outOrgParentId);
- $form = $("#fillForm");
- $("#classid").val("212");
- var formValue = $form.serialize();
- var url = $.pathname() + "/ws/crud/CRUDService/create/";
- $.ajax({
- url : url,
- type : "post",
- timeout : 60000,
- data : formValue,
- async:false,
- dataType : "json",
- success : function(data) {
- if(data.Msg.info =="新增成功"){
-
- //alert(orgNameInform+"|"+outOrgParentId);
- var newNode={id:data.Msg.objectID, parentId:outOrgParentId, name:orgNameInform,
- objectId:data.Msg.objectID,classId:"210",orgType:addorgType,
- icon:"/nwyj/scripts/qui/libs/icons/home.gif"};
- parent.outOrgNodeAdd(newNode);
- //更新左边点击的属性值
- top.Dialog.alert("新增"+ orgNameInform +"外部机构成功");
- parent.sup_classId = newNode.classId;
- parent.sup_org_name = newNode.name;
- parent.sup_fd_objectId = newNode.objectId;
- parent.sup_orgType= newNode.orgType;
-
- goBack();
- }
- if(data.Msg.info =="新增失败"){
-
- top.Dialog.alert("新增机构失败,稍后再试");
- }
- },
- error : function() {
- top.Dialog.alert("新增机构失败,稍后再试...");
- }
- });
-
- };
- //返回到详情界面
- function goBack() {
- var iframe = parent.document.getElementsByName("frmrightChild")[0];
- iframe.src = "out-org-info.html";
- }
-
- //修改机构信息--发送请求后台交互
- function editfn() {
- var orgNameInform = $("#ORG_DEPT_NAME_212").val();
- //记录修改的机构类别
- var addorgType = $("#ORG_DEPT_TYPE_212").attr("relValue");
- $form = $("#fillForm");
- var formValue = $form.serialize();
- var url = $.pathname() + "/ws/crud/CRUDService/update/";
- $.ajax({
- url : url,
- type : "post",
- timeout : 60000,
- data : formValue,
- dataType : "json",
- success : function(data) {
- if(data.Msg.info=="修改成功"){
- var newNode={id:fd_id, parentId:outOrgParentId, name:orgNameInform,
- objectId:fd_id,classId:"210",
- orgType:addorgType,
- icon:"/nwyj/scripts/qui/libs/icons/home.gif"};
- parent.outOrgNodeRefresh(newNode);
- top.Dialog.alert("修改机构成功,返回机构详情界面");
- //手动更新选中机构(即为当前机构)的信息
- parent.sup_classId = newNode.classId;
- parent.sup_org_name = newNode.name;
- parent.sup_fd_objectId = newNode.objectId;
- parent.sup_orgType= newNode.orgType;
-
- goBack(fd_id);
-
- }else if(data.Msg.info=="fail"){
-
- alert("修改失败");
- }
- },
- error : function() {
- top.Dialog.alert("修改失败,稍后再试...");
- }
- });
- };
- // 重置按钮
- function reset_input() {
-
- $("#ORG_DEPT_NAME_212").val(resetValue.ORG_DEPT_NAME_212);
- $("#ORG_DEPT_TYPE_212").val(resetValue.ORG_DEPT_TYPE_212);
- $("#LOCATION_212").val(resetValue.LOCATION_212);
- $("#CODE_212").val(resetValue.CODE_212);
- $("#SITE_212").val(resetValue.SITE_212);
- // 重置联动部门
- $("#LINK_DEPT_212").attr("relValue", Dname);
- $("#LINK_DEPT_212").attr("relText", DnameShow);
- $("#LINK_DEPT_212").find("input:text").val(DnameShow);
- // 重置联动联系人
- $("#LINK_MAN_212").attr("relValue", Lname);
- $("#LINK_MAN_212").attr("relText", LnameShow);
- $("#LINK_MAN_212").find("input:text").val(LnameShow);
- }
- </script>
- </head>
- <body>
- <div class="box1" id="formContent"
- style="overflow:auto;height:545px;border: 1px solid #E4E4E4;background: #F8F8F8;">
- <div style="height: 50px;background: #F8F8F8;" align="center">
- <img align="left" alt="返回" title="返回" src="/nwyj/images/temp/back.png" id="back"/>
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;" id="titleShow"></font></div>
- <div>
- <form id="fillForm" action="javascript:save_orgInfo1()" method="post"
- failAlert="表单填写错误,请检查">
- <table class="tableStyle" formMode="line">
- <tr style="display: none;">
- <td><input type="hidden" id="fd_id212" name="FD_OBJECTID212"
- required="true" /> <input type="hidden" name="classid"
- value="212" required="true" />
- <input type="hidden" name="PARENT_ID_212"
- required="true" /></td>
- </tr>
- <tr>
- <td colspan="4" align="center" id="option_tr" style=""><input
- type="submit" value="保存 " /> <input type="button" id="OrgReset" value=" 重置 " />
- </td>
- </tr>
- <tr>
- <td width="18%"><span class="star">*</span>机构名称:</td>
- <td width="32%"><input id="ORG_DEPT_NAME_212"
- name="ORG_DEPT_NAME_212" type="text" value="" maxlength="20"
- class="validate[required,length[1,15]]" /></td>
- <td width="18%"><span class="star">*</span>机构类别:</td>
- <td width="32%"><select id="ORG_DEPT_TYPE_212"
- name="ORG_DEPT_TYPE_212" prompt="请选择"
- class="validate[required]" /></td>
- </tr>
- <tr>
- <td width="18%">所在区域:</td>
- <td width="32%" ><input id="LOCATION_212" name="LOCATION_212" maxlength="80"
- type="text" class=" validate[length[0,80]]" />
- </td>
- <td width="18%">办公地点:</td>
- <td width="32%" > <input id="WORK_ADDRESS_212" maxlength="100"
- name="WORK_ADDRESS_212" type="text" maxlength="80"
- class=" validate[length[0,80]]" /></td>
- </tr>
- <!-- <tr>
- <td width="18%"><span class="star">*</span>联动部门:</td>
- <td width="32%" ><input id="LINK_DEPT_212"
- name="LINK_DEPT_212" type="text"
- class=" validate[required]" /></td>
- <td width="18%"><span class="star">*</span>联动联系人:</td>
- <td width="32%" ><input id="LINK_MAN_212" name="LINK_MAN_212"
- type="text" class=" validate[required]" /></td>
- </tr> -->
- <tr>
- <td width="15%"><span class="star">*</span>联动部门:</td>
- <td width="35%"><div class="selectTree validate[required]"
- id="LINK_DEPT_212" asyncMode="true" name="LINK_DEPT_212" ></div></td>
- <td width="15%"><span class="star">*</span>联动联系人:</td>
- <td width="35%"><div class="selectTree validate[required]"
- id="LINK_MAN_212" name="LINK_MAN_212" ></div></td>
- </tr>
- <tr>
- <td width="18%">邮编:</td>
- <td width="32%" ><input id="CODE_212" name="CODE_212" maxlength="10"
- type="text" class=" validate[custom[zipcode]]" /></td>
- <td width="18%">网址:</td>
- <td width="32%" ><input id="SITE_212" name="SITE_212" maxlength="30"
- type="text" class="Validate[length[0,20]]" /></td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- </body>
- </html>
|