//部门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(); var g; var sql_condition = ""; // 初始化函数 function initComplete() { //给初始化表格添加加载条件 var initCondition="IS_DEL=0"; // 列表加载参数 loadParams = { "listId" : '232', "condition" : initCondition }; initGrid(); } // 加载树 function initGrid() { g = $("#mainGrid").quiGrid({ columns : [ { display : '序号', name : 'FD_OBJECTID232', hide : true }, { display : '通知标题', name : 'NOTICE_TITLE_232', align : 'center', width : "15%" }, { display : '所属单位', name : 'DEPT_ID_232_SHOW', align : 'center', width : "15%" }, { display : '通知类别', name : 'NOTICE_CLASSIFY_232_SHOW', align : 'center', width : "25%" }, { display : '发布日期', name : 'NOTICE_PUBLISH_DATE_232', align : 'center', width : "15%" }, { display : '发布人', name : 'PUBLISH_MAN_232_SHOW', align : 'center', width : "15%" }, { display : '通知状态', name : 'FILE_STATUS_232_SHOW', align : 'center', width : "15%" } ], url : $.pathname() + '/ws/crud/CRUDService/queryQui', params : loadParams, sortName : 'UPDATEDATE_232 ', sortOrder : 'desc nulls last', rownumbers : true, checkbox : true, height : "100%", width : "100%", pageSize : 10, percentWidthMode : true, // 顶部图标按钮栏 toolbar : { items : [ { text : '新增', click : onAdd, iconClass : 'icon_add', disabled : false }, { line : true }, { text : '修改', click : onEdit, iconClass : 'icon_edit', disabled : false }, { line : true }, { text : '删除', click : onDelete, iconClass : 'icon_delete', disabled : false }, { line : true }, { text : '查看详情', click : onView, iconClass : 'icon_view', disabled : false } ] } }); } //查询 function searchHandel() { var condition = ""; var search_value = $("#searchinput").val().trim(); var patt= /[@#\$%\^&\*\~\<\>\)\(\{\}\[\]\`\/\\\'\"\;\:\:\;\!\¥\=\-\\\,\。\·\!]+/g; if(patt.test(search_value)){ top.Dialog.alert("请输入合法字符"); return; } if(!patt.test(search_value)){ condition += ("(" + " NOTICE_TITLE LIKE '%" + search_value + "%'" /*+ " OR SUP_UNIT LIKE '%" + search_value + "%'"*/ + " OR NOTICE_PUBLISH_DATE LIKE '%" + search_value + "%')"); condition += "AND IS_DEL=0 "; } if (search_value == "") { condition +="AND IS_DEL=0 "; } g.setOptions({// 重置加载列表的参数 params : { "listId" : '232', "condition" : condition } }); sql_condition = condition; g.setNewPage(1); g.loadData();// 刷新列表 } // 点击新增触发方法 function onAdd() { // 跳转页面 var iframe = parent.document.getElementById("frmright"); iframe.src = "business/am/noticeFile/notice-file-modify.html"; } // 点击修改按钮触发方法 function onEdit() { var rows = g.getSelectedRows(); if (rows.length == 0) { top.Dialog.alert("请选择一条记录"); return; } if (rows.length > 1) { top.Dialog.alert("只能选择一条记录"); return; } var fd_id = rows[0].FD_OBJECTID232; var iframe = parent.document.getElementsByName("frmright")[0]; iframe.src = "business/am/noticeFile/notice-file-modify.html?" + fd_id; } // 删除按钮点击事件 function onDelete() { var rows = g.getSelectedRows(); var rowsLength = rows.length; if (rowsLength == 0) { top.Dialog.alert("请选中要删除的记录!"); return; } var ids = ""; for (var i = 0; i < rowsLength; i++) { ids += rows[i].FD_OBJECTID232 + ","; } top.Dialog.confirm("确定要删除吗?|删除", function() { // 删除记录 $.post($.pathname() + "/ws/crud/CRUDService/delete/", { "objectIDs" : ids, classid : 232 }, function(result) { if (result.Msg.sucsess == true) { top.Dialog.alert("删除成功", null, null, null, 1); // 刷新表格数据 g.loadData(); } else { top.Dialog.alert("删除失败"); } }, "json"); }); } function onView(){ var rows = g.getSelectedRows(); if (rows.length == 0) { top.Dialog.alert("请选择一条记录"); return; } if (rows.length > 1) { top.Dialog.alert("只能选择一条记录"); return; } var fd_id = rows[0].FD_OBJECTID232; var iframe = parent.document.getElementById("frmright"); iframe.src = "business/am/noticeFile/notice-file-info.html?" + fd_id; }