var xtcs = new Object();
xtcs.loadSearchModule = function(p) {
var $div = $("#" + p.id);
if ($div.length > 0) {
$div.load('xtcsSearchModule.htm', {
from : p.from,
callBackFunName : p.callBackFunName,
'xtcsSearchGrid' : $("#xtcsSearchGrid").val()
}, function() {
});
}
};
/**
* 加载系统参数查询模块
*/
xtcs.loadSearchModule({
id : 'xtcsSearchModule',
from : 'xtcs',
callBackFunName : 'searchXtcsCallBack'
});
/**
* 搜索条件回调函数
*
* @param {搜索条件对象}
* data
* @param {分隔符}
* fgf
*/
function searchXtcsCallBack(data, fgf) {
huimv.searchGrid("xtcsGrid", {
url : 'getXtcsList.htm',
params : [{
name : 'param',
value : data
}, {
name : 'fgf',
value : fgf
}]
}, '系统参数搜索结果');
}
/**
* 加载系统参数列表数据
*/
function loadXtcsGrid(xtcsSearchGrid) {
jQuery("#xtcsGrid").flexigrid({
url : 'getXtcsList.htm',
dataType : 'json',
method : 'post',
params : [{
name : 'xtcsSearchGrid',
value : $('#xtcsSearchGrid').val()
},{
name : 'from',
value : $("#from").val()
}],
title : '系统参数浏览',
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 : '',
width : 190,
sortable : false,
align : 'center',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
var csid = record.csid;
if (csid != "" && csid.length > 20) {
csid = '' + csid.substr(0, 19) + '...';
}
jQuery(col).html('' + csid + '');
}
}, {
display : '系统编号',
name : 'xtid',
width : 50,
sortable : false,
align : 'center'
}, {
display : '参数描述',
name : 'csms',
width : 160,
sortable : false,
align : 'center'
}, {
display : '缺省取值',
name : 'qsqz',
width : 80,
sortable : false,
align : 'center'
}, {
display : '参数取值',
name : 'csqz',
width : 80,
sortable : false,
align : 'center'
}, {
display : '参数值域',
name : 'cszy',
width : 110,
sortable : false,
align : 'center'
}]
});
}
loadXtcsGrid($('#xtcsSearchGrid'));
function viewXtcs(id) {
huimv.loadPage("xtcsRight", "viewXtcs.htm", {
"csid" : id
});
}
/**
* 作废系统参数
* @param id
*/
function disableXtcs(id, from) {
Dialogs.alert("确定作废当前系统参数?", {
title : '提示信息',
width : 250,
height : 80,
top : 150,
button : {
ok : ['确定',function(){
this.close();
huimv.showProcessModel('处理数据中');
jQuery.ajax({
url : 'disableXtcs.htm',
dataType : 'json',
type : 'post',
cache : false,
data : {"csid" : id},
success : function(data) {
huimv.hideProcessModel();
if (data.returnCode > 0) {
if (from == 'list') {
huimv.reloadGrid('xtcsGrid');
} else if (from == 'view') {
loadXtcsList();
}
} else {
Dialogs.alert("传入参数有误!", {
width : 300,
height : 50
});
}
},
error : function(data) {
huimv.showError(data.responseText);
}
});
}],
cancel : ['取消',function(){
this.close();
}]
}
});
}