123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- var xxtz = new Object();
- xxtz.loadSearchModule = function(p) {
- var $div = $("#" + p.id);
- if ($div.length > 0) {
- $div.load('xxtzSearchModule.htm', {
- from : p.from,
- callBackFunName : p.callBackFunName,
- 'xxtzSearchGrid' : $("#xxtzSearchModule").val()
- }, function() {
- });
- }
- };
- /**
- * 加载消息查询模块
- */
- xxtz.loadSearchModule({
- id : 'xxtzSearchModule',
- from : 'xxtz',
- callBackFunName : 'searchXxtzCallBack'
- });
- /**
- * 搜索条件回调函数
- *
- * @param {搜索条件对象}
- * data
- * @param {分隔符}
- * fgf
- */
- function searchXxtzCallBack(data, fgf) {
- huimv.searchGrid("xxtzGrid", {
- url : 'getXxtzList.htm',
- params : [{
- name : 'param',
- value : data
- }, {
- name : 'fgf',
- value : fgf
- }]
- }, '<b>消息搜索结果</b>');
- }
- /**
- * 加载消息列表数据
- */
- function loadXxtzGrid(xxtzSearchGrid) {
- var xxtz_xxtz_delete = $("#xxtz_xxtz_delete").val();
- var xxtz_xxtz_operate = $("#xxtz_xxtz_operate").val();
- jQuery("#xxtzGrid").flexigrid({
- url : 'getXxtzList.htm',
- dataType : 'json',
- method : 'post',
- params : [{
- name : 'xxtzSearchGrid',
- value : $('#xxtzSearchGrid').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',
- height : '335',
- nowrap : true,
- resizable : false,
- cache : false,// 清除缓存
- colModel : [{
- display : '行号',
- name : 'hh',
- width : 25,
- sortable : false,
- align : 'center',
- process : function(col, record, d) {
- jQuery(col).html(d + 1);
- }
- }, {
- display : '故障级别',
- name : 'xxbz',
- width : 50,
- sortable : true,
- align : 'center',
- process : function(col, record, d) {
- if (record.xxbz == 1) {
- jQuery(col).html("<font color=black>一般</font>");
- } else if (record.xxbz == 2) {
- jQuery(col).html("<font color=rgb(237,179,37)>警告</font>");
- } else if (record.xxbz == 3) {
- jQuery(col).html("<font color=red>严重</font>");
- }
- }
- }, {
- display : '处理状态',
- name : 'clzt',
- width : 50,
- sortable : true,
- align : 'center',
- process : function(col, record, d) {
- if (record.clzt == 1) {
- jQuery(col).html("<font color=red>未处理</font>");
- } else if (record.clzt == 2) {
- jQuery(col).html("<font color=rgb(111,222,111)>处理中</font>");
- } else if (record.clzt == 3) {
- jQuery(col).html("<font color=black>已处理</font>");
- }
- }
- }, {
- display : '标题',
- name : '',
- width : 200,
- sortable : false,
- align : 'left',
- process : function(col, record, postion, pid) {
- var s = record.bt;
- if (s.length > 22) {
- s = s.substring(0, 20) + "...";
- }
- jQuery(col).addClass('s');
- jQuery(col).html('<a onclick="viewXxtz(' + record.id + '); " title="' + record.bt + '">' + s + '</a>');
- }
- }, {
- display : '消息来源',
- name : 'xxlxmc',
- width : 60,
- sortable : false,
- align : 'center'
- }, {
- display : '作者',
- name : 'zz',
- width : 100,
- sortable : false,
- align : 'center'
- }, {
- display : '发布时间',
- name : 'fbsj',
- width : 115,
- sortable : true,
- align : 'center'
- }, {
- display : '操作',
- width : 90,
- sortable : false,
- align : 'center',
- process : function(col, record, postion, pid) {
- var s = "";
- if (record.clzt == 1 && xxtz_xxtz_operate == "true") {
- s += '<a onclick="updateXxtz(\'' + record.id + '\' , \'' + record.clzt + '\')">开始处理</a>';
- s += ' ';
- } else if (record.clzt == 2 && xxtz_xxtz_operate == "true") {
- s += '<a onclick="updateXxtz(\'' + record.id + '\' , \'' + record.clzt + '\')">处理完成</a>';
- s += ' ';
- }
- if (xxtz_xxtz_delete == "true" && record.clzt != '3') {
- s += '<a onclick="disableXxtz(\'' + record.id + '\' , \'list\');">删除</a>';
- }
- jQuery(col).addClass('s');
- jQuery(col).html(s);
- }
- }]
- });
- }
- loadXxtzGrid($('#xxtzSearchGrid'));
- /**
- * 加载消息查看页面
- * @param id
- */
- function viewXxtz(id) {
- huimv.loadPage('xxtzRight', 'viewXxtz.htm', {
- "id" : id
- });
- }
- /**
- * 加载消息编辑页面
- * @param id
- */
- function editXxtz(id, from) {
- huimv.loadPage('xxtzRight', 'editXxtz.htm', {
- "id" : id,
- "from" : from
- });
- }
- /**
- * 编辑完成后回调函数
- *
- * @param {} lx
- * @param {} data
- */
- function processAfterEditXxtz() {
- Dialogs.close();
- huimv.reloadGrid('xxtzGrid');
- }
- /**
- * 作废消息
- * @param id
- */
- function disableXxtz(id, from) {
- Dialogs.alert("确定作废消息?", {
- title : '提示信息',
- width : 250,
- height : 80,
- top : 150,
- button : {
- ok : ['确定',function(){
- this.close();
- huimv.showProcessModel('处理数据中');
-
- jQuery.ajax({
- url : 'disableXxtz.htm',
- dataType : 'json',
- type : 'post',
- cache : false,
- data : {"id" : id},
- success : function(data) {
- huimv.hideProcessModel();
- if (data.returnCode > 0) {
- if (from == 'list') {
- huimv.reloadGrid('xxtzGrid');
- } else if (from == 'view') {
- loadXxtzList();
- }
- } else {
- Dialogs.alert("传入参数有误!", {
- width : 300,
- height : 50
- });
- }
- },
- error : function(data) {
- huimv.showError(data.responseText);
- }
- });
- }],
- cancel : ['取消',function(){
- this.close();
- }]
- }
- });
- }
- /**
- * 修改状态
- * @param id
- */
- function updateXxtz(id, clzt) {
- Dialogs.alert("确定处理消息?", {
- title : '提示信息',
- width : 250,
- height : 80,
- top : 150,
- button : {
- ok : ['确定',function(){
- this.close();
- huimv.showProcessModel('处理数据中');
-
- jQuery.ajax({
- url : 'updateXxtz.htm',
- dataType : 'json',
- type : 'post',
- cache : false,
- data : {"id" : id, "clzt" : clzt},
- success : function(data) {
- huimv.hideProcessModel();
- if (data.returnCode > 0) {
- huimv.reloadGrid("xxtzGrid");
- } else {
- Dialogs.alert("传入参数有误!", {
- width : 300,
- height : 50
- });
- }
- },
- error : function(data) {
- huimv.showError(data.responseText);
- }
- });
- }],
- cancel : ['取消',function(){
- this.close();
- }]
- }
- });
- }
|