123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- <%@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>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>应急制度文件管理</title>
- <!--框架必需start-->
- <%@include file="../../../include.jsp" %>
- <!--框架必需end-->
- <script type="text/javascript" src="/nwyj/scripts/business/am/org/maintenance/orgSel.js"></script>
- <script type="text/javascript">
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var ztData = {"list":[{"key":"单位","value":"1"},{"key":"部门","value":"2"},{"key":"直属中心机构","value":"3"},{"key":"虚拟机构","value":"4"},{"key":"车间","value":"5"},{"key":"班组","value":"6"}]}
-
-
- $(function(){
-
- $("#UNITS_214").OrgSel();//{orgType:"per"}
-
- });
-
- var g;
- //var condition = "IS_DEL='0' AND PARENT_ID ='"+ deptId +"' and (dept_name like '%供电局' or dept_name like '%供电分局' or dept_name like '%供电所' or dept_name like '%电网有限责任公司' or dept_name like '%输电%' or dept_name like '%变电%' or dept_name like '%调度%') order by sort ";
- var condition11 ="IS_DEL='0' AND PARENT_ID ='"+deptId +"' order by sort desc";
- //列表加载参数
- var loadParams = {
- "listId" : '800',
- "condition" : condition11,
- };
- function initComplete(){
- g = $("#maingrid").quiGrid({
- columns: [
- // { display: '单位名称', name: 'CORP_NAME_800', align: 'center', width: "25%"},
- { display: '单位/部门名称', name: 'DEPT_NAME_800', align: 'center', width: "30%"},
- { display: '序号', name: 'SORT_800', align: 'center' , width: "20%" ,editor: { type: 'text'}},
- { display: '单位/部门类型', name: 'DEPT_TYPE_800', align: 'center' , width: "20%" ,
- editor: { type: 'select', data : ztData},
- render : function(rowdata, rowindex, value, column) {
- var thisvalue = value;
- for (var i = 0; i < ztData["list"].length; i++) {
- if (ztData["list"][i]['value'] == value)
- thisvalue = ztData["list"][i]['key'];
- }
- return thisvalue;
- }},
- { display: '单位名称', name: 'CORP_NAME_800', align: 'center' , width: "35%",editor: { type: 'text'}}
- ],
-
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- sortName : '',
- sortOrder : '',
- rownumbers:true,
- checkbox:true,
- usePager:false,
- height: '100%',
- width:"100%",
- enabledEdit: true, //编辑用
- onBeforeEdit: onBeforeEdit, onBeforeSubmitEdit: onBeforeSubmitEdit,onAfterEdit: onAfterEdit,
- percentWidthMode:true,
- //顶部图标按钮栏
- toolbar:{
- items:[
-
- {text: '批量保存', click: saveAll, iconClass: 'icon_add'},
- { line : true }
- ]
- }
- });
-
- }
-
- var bh_code = "";
-
- //编辑前事件
- function onBeforeEdit(e){
- bh_code = parseInt(e.rowindex)+31;
- }
- //编辑提交前事件
- function onBeforeSubmitEdit(e){
- /* if(e.column.columnname=="SORT_800"){
- var re = /^[1-9]*[1-9][0-9]*$/;
- if(e.record.SORT_800==""){
- e.record.SORT_800 = bh_code;
- }else if(e.record.SORT_800 != undefined && e.record.SORT_800 != ""){
- if (e.record.SORT_800.length!=2 || !re.test(e.record.SORT_800)){
- top.Dialog.alert("请输入2位数的正整数!");
- // return false;
- }
- }
-
- }else if(e.column.columnname=="CORP_NAME_800"){
- e.record.CORP_ID_800 = $("#editCellId").val();
- } */
-
- }
-
- //编辑后事件
- function onAfterEdit(e){
- var num = e.record.SORT_800;
- if(isNaN(num)){
- top.Dialog.alert("请输入正整数!");
- }
- }
-
-
- function saveAll(){
- /* var PatternsDict=/^(\d{4})-(0\d{1}|1[0-2])-(0\d{1}|[12]\d{1}|3[01])$/;
- var PatternsDict1= new RegExp("[%@~!%#$*&',;=?$\x22]+"); */
-
- var rows=g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要保存的信息!");
- return;
- }
- var json=JSON.stringify(rows);
-
- var myobj=eval(json);
-
- for(var i=0;i<myobj.length;i++){
- var SORT_800 = myobj[i].SORT_800;
-
- /* var fff =1;
- fff = fff+i; */
- if(SORT_800==null||""==SORT_800){
- top.Dialog.alert("保存的机构中序号不能为空值,请勾选有序号的或补全序号!");
- return;
- }
-
- }
-
- var ids = "";
- var sort= "";
- var type= "";
- var corpName= "";
- var corpId= "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID800 + ",";
- sort += rows[i].SORT_800 + ",";
- type += rows[i].DEPT_TYPE_800 +",";
- corpName += rows[i].CORP_NAME_800 +",";
- corpId += rows[i].CORP_ID_800 +",";
- }
- var url = $.pathname()
- + "/ws/InDepartmentService/InDepartmentService/getDepartmentUilt";
- var params = {
- id:ids,
- sort:sort,
- type:type,
- corpName:corpName,
- corpId:corpId
- };
- $("body").eq(0).showLoading();
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- $("body").eq(0).hideLoading();
- $.messager.alert('保存成功');
- window.location.href = "DepartmentUilt.jsp";
- },
- error : function(e) {
- $("body").eq(0).hideLoading();
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
-
- }
-
- function searchHandler(){
- //var condition = "IS_DEL='0' and (dept_name like '%供电局' or dept_name like '%供电分局' or dept_name like '%供电所' or dept_name like '%电网有限责任公司' or dept_name like '%输电%' or dept_name like '%变电%' or dept_name like '%调度%') ";
- var condition ="IS_DEL='0' ";
-
- var compId = $('#UNITS_214').val();
-
- if(compId!=""){
- condition += " and PARENT_ID = '"+compId+"'";
- }else{
- condition += " and PARENT_ID = '"+deptId+"'";
- }
- condition += " order by sort ";
-
- g.setOptions({
- params : {
- "listId" :'800' ,
- "condition" : condition
- }
- });
-
- g.loadData();//加载数据
- }
-
- $(function(){
- //单位/部门类型 改变事件
- $(".l-grid-editor").find("select").live("change",function(){//申请单位联系人的绑定事件
- var value = $(this).data("selectedNode").value;
- var id = $(".l-grid-row-cell-editing").parent().attr("id");
- var rowindex = Number(id.split("r1")[1])-1;
- var data = g.getRow(rowindex);
- if(value==1){
- //alert(JSON.stringify(data));
- data.CORP_ID_800 = data.DEPT_ID_800;
- data.CORP_NAME_800 = data.DEPT_NAME_800;/*
- $(".l-grid-row-cell-editing").next().find(".l-grid-row-cell-inner").text(data.DEPT_ID_800);
- $(".l-grid-row-cell-editing").prev().prev().prev().find(".l-grid-row-cell-inner").text(data.DEPT_NAME_800); */
- g.updateRow(data,g.getRowObj(rowindex));
- }
- });
-
-
- $(".l-grid-editor").find("input").unbind("click").live("click",openone);
- })
-
- function openone(){
- var id = $(".l-grid-row-cell-editing").attr("id");
- id = id.substring(id.length-1);
- if(id=="6"){
-
- var $self = $(this);
- $(".l-grid-editor").find("input").attr("id","editCellId_show");
- var defalutOption = {
- loadId_in : loadId_in,
- loadId_out : loadId_out,
- orgWidth : "91%",
- selectedMulti : false,
- setMulti : {
- "Y" : "",
- "N" : ""
- },
- orgType : "",
- manGroup:"no-addManGroup",
- loadCorp:"",
- divId : "editCellId"
- };
- openandSelectOrg(defalutOption);
- }
- }
-
- function openandSelectOrg(params,orgData) {
- var iframeHeight = $(window.document.body).height();
- var inId = params.loadId_in;
- var outId = params.loadId_out;
- var divId = params.divId;
- var mu = params.selectedMulti;
- var diag = new top.Dialog();// 定义一个窗口对象
- var chkboxType1 = params.setMulti.Y;
- var chkboxType2 = params.setMulti.N;
- var orgType = params.orgType;
- var manGroup = params.manGroup;
- var loadCorp = params.loadCorp;
- //alert(orgData);
- diag.Title = "选择组织";// 窗口标题/
- if(manGroup=="addManGroup"){
- diag.URL = "/nwyj/page/business/am/org/maintenance/orgSel.html?" + inId
- + "?" + outId + "?" + divId + "?" + mu + "?" + chkboxType1 + "?"
- + chkboxType2 + "?" + orgType+"?"+iframeHeight+"?"+loadCorp+"?"+orgData+"?"+manGroup;// 窗口对应的页面
-
- }else{
- diag.URL = "/nwyj/page/business/am/org/maintenance/orgSel.html?" + inId
- + "?" + outId + "?" + divId + "?" + mu + "?" + chkboxType1 + "?"
- + chkboxType2 + "?" + orgType+"?"+iframeHeight+"?"+loadCorp+"?"+orgData;// 窗口对应的页面
-
-
- }
-
- diag.Height = 500;
- diag.Width = 380;
- diag.ShowOkButton = false;// 不显示确认按钮
- diag.ShowCancelButton = false;// 不显示取消按钮
- diag.ButtonAlign = "center";// 按钮居中
- //diag.ParamsObj属性 ={"aa":"11","bb":"22"};
- diag.show();// 显示窗口
- // 添加关闭按钮
- };
-
- $.messager = top.Dialog;
- </script>
- </head>
- <body>
- <div class="box2" id="searchPanel">
- <input type="hidden" id="editCellId" />
- <input type="hidden" id="show_editCellId" />
- <form id="queryUserForm" method="post">
- <table width="100%">
- <tr>
- <td align="right" width="10%">所属单位:</td>
- <td width="60%"><div id="UNITS_214" ></div></td>
- <td width="30%"><button type="button" onclick="searchHandler()"><span class="icon_find">查询</span></button></td>
- </tr>
- </table>
- </form>
- </div>
- <div class="adding_right5">
- <div id="maingrid"></div>
- </div>
- </body>
- </html>
|