sysAdmin = function() { /** 定义变量* */ var _this = this; _this.listGrid = null;// 数据列表 //_this.searchPanel = null; // 查询面板 $queryForm = null;// 查询区域表单 $searchButt = null;// 查询按钮 $more = null; // 更多 $reported = null; //填报 _this.loadParams = null;// 列表加载参数 /** 私有方法* */ /** *新增信息** */ _this.addForm = function() { $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/evaluate/admin/sysAdminEdit.jsp?fd_id=&is_adjst=1"); }; /** *修改信息** */ _this.editForm = function() { var rows = _this.listGrid.getSelectedRows(); var rowsLength = rows.length; if (rowsLength == 0) { top.Dialog.alert("请选中要修改的记录!"); return; } else if (rowsLength > 1) { top.Dialog.alert("请选中一条要修改的记录!"); return; } else { var fd_id = rows[0].FD_OBJECTID799; //alert(fd_id) $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/evaluate/admin/sysAdminEdit.jsp?fd_id="+ fd_id+"&is_adjst=2"); } }; /** *删除信息** */ _this.del = function(){ var rows = _this.listGrid.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_OBJECTID799 + ","; } var url = $.pathname() +"/ws/crud/CRUDService/delete/"; var params = { objectIDs : ids, classid : 799 }; top.Dialog.confirm("确定要删除吗?|删除", function() { $.request.del(url,params,function(result){ if (result.Msg.sucsess == true) { top.Dialog.alert("删除成功!"); // 刷新表格数据 //_this.listGrid.loadData(); _this.listGrid.rend(); } else { top.Dialog.alert("删除失败!"); } }); }); }; _this.editSYS = function(){ var rows = _this.listGrid.getSelectedRows(); var rowsLength = rows.length; user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id(); if (rowsLength == 0) { top.Dialog.alert("请选中一条配置记录!"); return; } else if (rowsLength > 1) { top.Dialog.alert("请选中一条配置记录!"); return; } else if(rows[0].WRITER_ID_799!=user_id){ top.Dialog.alert("只有本人新增的才可以配置!"); } else { var fd_id = rows[0].FD_OBJECTID799; //console.log(rows[0].TYPE_799); if(rows[0].TYPE_799 == 1){ $.noIndexOpenNextWindow($.pathname()+ "/page/business/em/evaluate/admin/sysAdminManageEdit.jsp?fd_id="+ fd_id+"&is_adjst="+rows[0].TYPE_799); }else{ $.noIndexOpenNextWindow($.pathname()+ "/page/business/em/evaluate/admin/sysOuterManageEdit.jsp?fd_id="+ fd_id+"&is_adjst="+rows[0].TYPE_799); } } }; _this.test = function(){ var rows = _this.listGrid.getSelectedRows(); var rowsLength = rows.length; if (rowsLength == 0) { top.Dialog.alert("请选中要评分的记录!"); return; } if (rowsLength > 1) { top.Dialog.alert("请选中一条要评分的记录!"); return; } var fdId = rows[0].FD_OBJECTID799; console.log(rows[0].TYPE_799); var url = $.pathname() + '/ws/scoreGrade/ScoreService/testscore'; var params = { user_id : "", fd_id : fdId, sys_id : fdId, is_assinging : "", type : rows[0].TYPE_799 }; $.request.query(url,params,function(data){ }); }; // 查询 function search(obj) { //去掉水印 if($("#NAME_799").val().trim()==" 体 系 名" || $("#NAME_799").val().trim()==""){ $("#NAME_799").val(""); } $queryForm.serialize(); //获取选中的值 var searchCondition = getSelectCon(conditionData); var queryParams = getQueryFormParams($queryForm); var params=$.extend({},_this.loadParams,queryParams); //与之前参数条件拼接 params.condition = searchCondition.condition + params.condition; _this.listGrid.setOptions({"params":params}); //加载数据 _this.listGrid.rend();//加载数据 } // 更多 function more() { $('#moreTable').toggle(); } //点击主键跳转详细信息页面 _this.openDetail = function(rowindex) { var row = _this.listGrid.getRow(rowindex); var fd_id = row.FD_OBJECTID799; if(row.TYPE_799=="1"){ $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/evaluate/admin/sysAdminView.jsp?fd_id='+fd_id); }else{ $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/em/evaluate/admin/sysOuterView.jsp?fd_id='+fd_id); } }; return { init : function() { $queryForm = $("#queryForm"); //绑定查询面板的按钮点击事件 $searchButt = $("#searchButt");// 查询按钮 $searchButt.bind('click', function() { search(); }); $('#NAME_799').keydown(function(e){ if(e.keyCode==13){ search(); } }); //绑定更多的按钮点击事件 $more = $("#more"); // 更多按钮 $more.bind('click', function() { more(); }); // 获得面板对象 12 //_this.searchPanel = $("#searchPanel"); //部门id--预警范围用到 //var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids(); // 列表加载参数 _this.loadParams = { listId : '799', direction:'ASC', sort: 'UPDATEDATE', direction:'DESC', condition : 'is_del = 0', }; var toolBarOpt1 = { items : [ {text : '新增', disabled: false,click : 'addForm',iconClass : 'add1_tem',id : '10000'}, {text : '删除', disabled: false,click : 'del',iconClass : 'delete_tem',id : '10002'}, {text : '修改',disabled: false,click : 'editForm',iconClass : 'update_tem',id : '10001'}, //{text : 'CESHI',disabled: false,click : 'test',iconClass : 'update_tem',id : '10001'}, {text : '配置标准',disabled: false,click : 'editSYS',iconClass : 'adjust_tem',id : '10004'} ] }; var grid_option1={ columns : [ {name : 'FD_OBJECTID799',hide : true}, {display : '体系名', name : 'NAME_799', align : 'center', width : "30%",isPrimaryKey:true, render : function(rowdata, rowindex, value, column) { return "" + value + ""; } }, {display : '体系类型', name : 'TYPE_799_SHOW', align : 'center', width : "15%"}, {display : '备注', name : 'REMARK_799', align : 'center', width : "35%"}, {display : '创建时间', name : 'WRITE_TIME_799', align : 'center', width : "20%",render:function (rowdata, rowindex, value){ return value.split(' ')[0]; }} ], checkbox : true, rownumbers : true, pageSize : 10, percentWidthMode : true }; //alert(grid_option1); var options1={ //url :'/nwyj/ws/crud/CRUDService/queryQui', url :$.pathname() + '/ws/crud/CRUDService/queryQui', params: _this.loadParams, width:960, height:300, gridOptions:grid_option1, singleRecodeOptions:{a:"aa"}, paperOpration:{showInput:"true"}, toolBarOptions:toolBarOpt1 }; _this.listGrid=gridAndSingleRecode=$("#dataGrid").quickgridAndSingleRecode(options1); // _this.listGrid.rend(); } }; }(); $(function() { sysAdmin.init(); });