123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- var xtgg = new Object();
- xtgg.loadSearchModule = function(p) {
- var $div = $("#" + p.id);
- if ($div.length > 0) {
- $div.load('xtggSearchModule.htm', {
- from : p.from,
- callBackFunName : p.callBackFunName,
- 'xtggSearchGrid' : $("#xtggSearchModule").val()
- }, function() {
- });
- }
- };
- /**
- * 加载系统公告查询模块
- */
- xtgg.loadSearchModule({
- id : 'xtggSearchModule',
- from : 'xtgg',
- callBackFunName : 'searchXtggCallBack'
- });
- /**
- * 搜索条件回调函数
- *
- * @param {搜索条件对象}
- * data
- * @param {分隔符}
- * fgf
- */
- function searchXtggCallBack(data, fgf) {
- huimv.searchGrid("xtggGrid", {
- url : 'getXtggList.htm',
- params : [{
- name : 'param',
- value : data
- }, {
- name : 'fgf',
- value : fgf
- }]
- }, '<b>系统公告搜索结果</b>');
- }
- /**
- * 加载系统公告列表数据
- */
- function loadXtggGrid(xtggSearchGrid) {
- var xxtz_xtgg_fb = $("#xxtz_xtgg_fb").val();
- jQuery("#xtggGrid").flexigrid({
- url : 'getXtggList.htm',
- dataType : 'json',
- method : 'post',
- params : [{
- name : 'xtggSearchGrid',
- value : $('#xtggSearchGrid').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,
- nowrap : true,
- 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 : '',
- width : 180,
- sortable : false,
- align : 'left',
- process : function(col, record, postion, pid) {
- jQuery(col).addClass('s');
- jQuery(col).html('<a onclick="viewXtgg(' + record.id + ');">' + record.bt + '</a>');
- }
- }, {
- display : '描述',
- name : 'ms',
- width : 270,
- sortable : false,
- align : 'left'
- }, {
- display : '发布时间',
- name : 'fbsj',
- width : 120,
- sortable : true,
- align : 'center'
- }, {
- display : '发布状态',
- name : 'fbzt',
- width : 60,
- sortable : true,
- align : 'center',
- process : function(col, record, postion, pid) {
- jQuery(col).addClass('s');
- var str = '';
- if (record.fbzt == 1) {
- str += '<span>' + "已发布" + '</span>';
- } else {
- str += '<span>' + "未发布" + '</span>';
- }
- jQuery(col).html(str);
- }
- }, {
- display : '操作',
- name : '',
- width : 60,
- sortable : true,
- align : 'center',
- process : function(col, record, postion, pid) {
- jQuery(col).addClass('s');
- if (record.fbzt != 1 && xxtz_xtgg_fb == "true") {
- jQuery(col).html('<a onclick="fbXtgg(' + record.id + ');">' + "发布" + '</a>');
- }
- }
- }]
- });
- }
- loadXtggGrid($('#xtggSearchGrid'));
- /**
- * 发布系统公告
- * @param id
- */
- function fbXtgg(id) {
- huimv.showProcessModel('发布中...');
- jQuery.ajax({
- url : 'fbXtgg.htm',
- dataType : 'json',
- type : 'post',
- cache : false,
- data : {
- "id" : id
- },
- success : function(data) {
- huimv.hideProcessModel();
- huimv.reloadGrid('xtggGrid');
- },
- error : function(data) {
- huimv.showError(data.responseText);
- }
- });
- }
- /**
- * 加载系统公告查看页面
- * @param id
- */
- function viewXtgg(id) {
- huimv.loadPage('xtggRight', 'viewXtgg.htm', {
- "id" : id
- });
- }
- /**
- * 加载系统公告编辑页面
- * @param id
- */
- function editXtgg(id, from) {
- huimv.loadPage('xtggRight', 'editXtgg.htm', {
- "id" : id,
- "from" : from
- });
- }
- /**
- * 编辑完成后回调函数
- *
- * @param {} lx
- * @param {} data
- */
- function processAfterEditXtgg() {
- Dialogs.close();
- huimv.reloadGrid('xtggGrid');
- }
- /**
- * 作废公告
- * @param id
- */
- function disableXtgg(id, from) {
- Dialogs.alert("确定作废系统公告?", {
- title : '提示信息',
- width : 250,
- height : 80,
- top : 150,
- button : {
- ok : ['确定',function(){
- this.close();
- huimv.showProcessModel('处理数据中');
-
- jQuery.ajax({
- url : 'disableXtgg.htm',
- dataType : 'json',
- type : 'post',
- cache : false,
- data : {"id" : id},
- success : function(data) {
- huimv.hideProcessModel();
- if (data.returnCode > 0) {
- if (from == 'list') {
- huimv.reloadGrid('xtggGrid');
- } else if (from == 'view') {
- loadXtggList();
- }
- } else {
- Dialogs.alert("传入参数有误!", {
- width : 300,
- height : 50
- });
- }
- },
- error : function(data) {
- huimv.showError(data.responseText);
- }
- });
- }],
- cancel : ['取消',function(){
- this.close();
- }]
- }
- });
- }
|