123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- $(function() {
-
-
-
- /** 绑定查询面板的按钮点击事件* */
- $searchButt = $("#searchButt");// 查询按钮
- $searchButt.bind('click', function() {
- searchHandler();
- });
- });
- var g;
- var sql_condition = "";
- // 初始化函数
-
-
- //给初始化表格添加加载条件
- var initCondition= " IS_DEL = '0' and NAME IS NOT NULL ";
- // 列表加载参数
- loadParams = {
- "listId" : '777',
- "condition" : initCondition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
-
- function initComplete() {
-
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items : [
- {text : '新增',click : "onAdd",iconClass : 'add1_tem',id : '10000'},
- {text : '删除',click : "onDelete",iconClass : 'delete_tem',id : '10002'},
- {text : '修改',click : "onEdit",iconClass : 'update_tem',id : '10001'},
- {text : '查看',click : "onView",iconClass : 'view_tem',id : '10003'},
- {text : '导入', click: "showImportDialog", iconClass: 'import_tem',id:"rcdr"}
- ],
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns : [ {
- display : '姓名', name : 'NAME_777', align : 'center', width : "20%",isPrimaryKey:true,
- render : function(rowdata, rowindex, value, column) {
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
-
- }, {
- display : '单位',
- name : 'COMPID_777_SHOW',
- align : 'center',
- width : "20%"
- }, {
- display : '电话',
- name : 'TELPHONE_777',
- align : 'center',
- width : "20%"
- }, {
- display : '职能',
- name : 'COMPETENCY_777_SHOW',
- align : 'center',
- width : "20%"
- }, {
- display : '是否领导',
- name : 'ISLEADER_777_SHOW',
- align : 'center',
- width : "20%"
- } ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true
- };
-
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- width:960,
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
-
- //
- g=gridAndSingleRecode=$("#baseMainGrid").quickgridAndSingleRecode(options1);
- }
-
- //查询
- function searchHandler() {
-
-
- // var ff = /[@#\$%\^&\*\~\<\>\)\(\{\}\[\]\`\/\\\'\"\;\:\:\;\!\¥\=\-\\\,\。\·\!]+/g;
- var name = $('#NAME_777').val();//名字
- // if(ff.test(name)){
- // top.Dialog.alert("请不要输入非法字符搜索!");
- // return;
- // }
- var condition = " IS_DEL='0' and NAME IS NOT NULL ";
-
-
- if(name!=""&&name!="姓名"){
- condition += " AND NAME LIKE '%" +name+"%'";
- }
- g.setOptions({// 重置加载列表的参数
- params : {
- "listId" : '777',
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- }
- });
- // sql_condition = condition;
- // g.setNewPage(1);
- g.rend();// 刷新列表
-
- }
-
- // 点击新增触发方法
- function onAdd() {
- // 跳转页面
- var iframe = parent.document.getElementById("frmright");
- iframe.src = "/nwyj/page/business/am/MsgUser/msguser-update.jsp";
- }
-
- // 点击修改按钮触发方法
- 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_OBJECTID777;
- var iframe = parent.document.getElementsByName("frmright")[0];
- iframe.src = "/nwyj/page/business/am/MsgUser/msguser-update.jsp?" + 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_OBJECTID777 + ",";
- }
-
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
- $.post($.pathname() + "/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 777
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功", null, null, null, 1);
- // 刷新表格数据
- g.rend();
- } 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_OBJECTID777;
- var iframe = parent.document.getElementById("frmright");
- iframe.src = "business/am/MsgUser/msguser-info.jsp?" + fd_id;
-
- }
-
- //点击主键跳转详细信息页面
- this.openDetail = function(rowindex) {
- var row = g.getRow(rowindex);
- var fd_id = row.FD_OBJECTID777;
- var iframe = parent.document.getElementById("frmright");
- iframe.src = "business/am/MsgUser/msguser-info.jsp?" + fd_id;
- };
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID777;
- var iframe = parent.document.getElementById("frmright");
- iframe.src = "business/am/MsgUser/msguser-info.jsp?" + fd_id;
- }
- //导入
- function showImportDialog(){
- window.location.href="msguser-import.jsp";
- }
|