123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- var czyh = new Object();
- czyh.loadSearchModule = function(p) {
- var $div = $("#" + p.id);
- if ($div.length > 0) {
- $div.load('czyhSearchModule.htm', {
- from : p.from,
- callBackFunName : p.callBackFunName,
- 'czyhSearchGrid' : $("#czyhSearchGrid").val()
- }, function() {
- });
- }
- };
- /**
- * 加载操作用户查询模块
- */
- czyh.loadSearchModule({
- id : 'czyhSearchModule',
- from : 'czyh',
- callBackFunName : 'searchCzyhCallBack'
- });
- /**
- * 搜索条件回调函数
- *
- * @param {搜索条件对象}
- * data
- * @param {分隔符}
- * fgf
- */
- function searchCzyhCallBack(data, fgf) {
- huimv.searchGrid("czyhGrid", {
- url : 'getCzyhList.htm',
- params : [{
- name : 'param',
- value : data
- }, {
- name : 'fgf',
- value : fgf
- }]
- }, '<b>操作用户搜索结果</b>');
- }
- /**
- * 加载操作用户列表数据
- */
- function loadCzyhGrid(czyhSearchGrid) {
- var xtwh_czyh_fpjs = $("#xtwh_czyh_fpjs").val();
- var xtwh_czyh_czmm = $("#xtwh_czyh_czmm").val();
- jQuery("#czyhGrid").flexigrid({
- url : 'getCzyhList.htm',
- dataType : 'json',
- method : 'post',
- params : [{
- name : 'czyhSearchGrid',
- value : $('#czyhSearchGrid').val()
- }, {
- name : 'from',
- value : $("#from").val()
- }],
- title : '<b>操作用户浏览</b>',
- usepager : true,
- useRp : true,
- rp : 10,
- singleSelect : true,
- hidehead : false,
- showInputPage : true,
- showSelectRp : false,
- showTableToggleBtn : false,
- width : '790',
- resizable : false,
- height : '335',
- cache : false,// 清除缓存
- colModel : [{
- display : '行号',
- name : 'hh',
- width : 25,
- sortable : false,
- align : 'center',
- process : function(col, record, d) {
- jQuery(col).html(d + 1);
- }
- }, {
- display : '所属企业',
- name : 'qymc',
- width : 160,
- sortable : false,
- align : 'center'
- }, {
- display : '所属牧场',
- name : 'mcmc',
- width : 160,
- sortable : true,
- align : 'center'
- }, {
- display : '工号',
- name : 'gh',
- width : 80,
- sortable : true,
- align : 'center'
- }, {
- display : '姓名',
- name : 'yhxm',
- width : 100,
- sortable : false,
- align : 'center'
- }, {
- display : '职务',
- name : 'zwmc',
- width : 90,
- sortable : false,
- align : 'center'
- }, {
- display : '联系电话',
- name : 'lxdh',
- width : 90,
- sortable : false,
- align : 'center'
- }, {
- display : '操作',
- name : '',
- width : 150,
- sortable : false,
- align : 'center',
- process : function(col, record, postion, pid) {
- jQuery(col).addClass('s');
- var str = '<a onclick="viewCzyh(\'' + record.id + '\')">查看</a> ';
- if (xtwh_czyh_czmm == "true") {
- str += '<a onclick="resetPW(\'' + record.id + '\')">重置密码</a> ';
- }
- if (xtwh_czyh_fpjs == "true") {
- str += '<a onclick="setJsxx(\'' + record.id + '\')">分配角色</a>';
- }
- jQuery(col).html(str);
- }
- }]
- });
- }
- loadCzyhGrid($('#czyhSearchGrid'));
- /**
- * 加载操作用户查看页面
- * @param id
- */
- function viewCzyh(id) {
- huimv.loadPage('czyhRight', 'viewCzyh.htm', {
- "id" : id
- });
- }
- /**
- * 加载操作用户编辑页面
- * @param id
- */
- function editCzyh(id, from) {
- huimv.loadPage('czyhRight', 'editCzyh.htm', {
- "id" : id,
- "from" : from
- });
- }
- function resetPW(id) {
- jQuery.ajax({
- url: "resetPW.htm",
- dataType: "json",
- type: "post",
- async: false,
- data : {"id" : id},
- success: function(data){
- if (data.returnCode > 0) {
- Dialogs.alert("用户密码已重置为系统默认密码!", {
- title : '提示信息',
- width : 250,
- height : 80,
- top : 150
- });
- }
- }
- });
- }
- /**
- * 编辑完成后回调函数
- *
- * @param {} lx
- * @param {} data
- */
- function processAfterEditCzyh() {
- Dialogs.close();
- huimv.reloadGrid('czyhGrid');
- }
- /**
- * 给指定的用户分配角色信息
- * @param id
- */
- function setJsxx(yhid) {
- // var x = e.offsetLeft, y = e.offsetTop;
- // while (e = e.offsetParent) {
- // x += e.offsetLeft;
- // y += e.offsetTop;
- // }
- // x = x-600;
- // y = y-50;
-
- Dialogs.load('setJsxx.htm', {"yhid" : yhid}, {
- // 对话框基本配置选项
- draggable: true,//是否拖动
- autosize: false,//是否自适应大小
- resizable: true,//是否可以改变大小
- maximizable: true,//是否显示最大化最小化
- autopos: 'fixed',// 窗口是否(自动剧中,fixed)页面 默认’fixed’
- title: "分配角色",//窗口标题
- lightbox: true,//窗口应用时是否禁用其他操作
- width: 470,//窗口宽度
- height: 300,//窗口高度
- // top: y,
- // left: x,
- button: {
- ok: ['确定',function(){
- setYhqx();
- }],
- cancel: ['取消',function(){
- this.close();
- }]
- }
- });
- }
|