var commonGridObj_attrlist;
function $(id){
return document.getElementById(id);
}
function createGrid(){
//header
var headerArgs_attrlist = new Array("","参数名称","参数描述信息","参数类型","参数默认值","创建人","创建时间");
//width
var widthArgs_attrlist = new Array("40","250","200","120","120","120","120");
//column align
var colAlignArgs_attrlist = new Array("center","center","center","center","center","center","center");
//column sort
var colSortArgs_attrlist = new Array("na","str","str","str","str","str","str");
//column type
var colTypeArgs_attrlist = new Array("ch","ro","ro","ro","ro","ro","ro");
commonGridObj_attrlist = new TGridCommon("mygrid_container_attributelist","form1",headerArgs_attrlist,widthArgs_attrlist,colAlignArgs_attrlist,colSortArgs_attrlist,colTypeArgs_attrlist);
commonGridObj_attrlist.setResponseUrl("AttributeGridSource.aspx");
commonGridObj_attrlist.setRequest("AttributeGridSource.aspx?handle=attrlist&show_page=15&cur_page=1&uid="+commonGridObj_attrlist.newGuid());
commonGridObj_attrlist.setSourceType("json");
commonGridObj_attrlist.setSkin("xp");
commonGridObj_attrlist.setImageUrl("../images/");
commonGridObj_attrlist.initGrid();
commonGridObj_attrlist.bind();
commonGridObj_attrlist.initPageByHandle("attrlist");
commonGridObj_attrlist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){
var openSet = "height=200, width=700, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-200)/2 + ",Left= "+(screen.width-700)/2
var openType = "_blank";
var openUrl = "AttributeEdit.aspx?handle=edit&id="+rId;
window.open (openUrl,openType,openSet);
});
commonGridObj_attrlist.dbclickEvent = function(){
commonGridObj_attrlist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){
var openSet = "height=200, width=700, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-200)/2 + ",Left= "+(screen.width-700)/2
var openType = "_blank";
var openUrl = "AttributeEdit.aspx?handle=edit&id="+rId;
window.open (openUrl,openType,openSet);
});
}
}
//删除参数
function deleteAttribute(){
var totalCount = 0;
var sucCount = 0;
var falCount = 0;
var nullCount = 0;
var delArg = new Array();
var iDelCount = 0;
for(var i=0;i 0){
if(window.confirm("确定要将选择的参数删除?")){
for(var j=0;j 9 && _endtime.length > 9){
var status = DateTimeEqual(_begintime,_endtime);
if(status == 0){
searchJson += "\"btime\":\""+_begintime+"\","
searchJson += "\"etime\":\""+_endtime+"\","
}else if(status == -1){
alert("时间设置错误,起始时间不能大于结束时间,请修改!");
return;
}
// else if(status == -2){
// alert("时间设置错误,起始时间不能等于结束时间,请修改!");
// return;
// }
}
else{
alert("时间格式有问题,长度应大于9个字符,请修改!");
return;
}
}else{
searchJson += "\"btime\":\""+_begintime+"\","
searchJson += "\"etime\":\""+_endtime+"\","
}
searchJson += "\"cus\":\""+_customer+"\",";
searchJson += "\"no\":\""+_checkno+"\"";
searchJson += "]";
searchJson +="}";//alert(searchJson);
commonGridObj_invoicelist.initGrid();
commonGridObj_invoicelist.setRequest("InvoiceApplicationGridSource.aspx?handle=makeoutlist&show_page=15&cur_page=1&search="+escape(searchJson)+"&uid="+commonGridObj_invoicelist.newGuid());
commonGridObj_invoicelist.bind();
commonGridObj_invoicelist.setSearch(searchJson);
commonGridObj_invoicelist.initPageByHandle("makeoutlist");
commonGridObj_invoicelist.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){
if(stage == 0){
if(cInd == 2 || cInd == 3){
return false;
}else{
return true;
}
}
});
commonGridObj_invoicelist.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){
var rId = commonGridObj_invoicelist.getGridObj().getSelectedRowId();
var openSet = "height=500, width=960, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-710)/2 + ",Left= "+(screen.width-960)/2
var openType = "_blank";
var openUrl = "InvoiceMakeOutEdit.aspx?id="+rId+"&handle=edit";
window.open (openUrl,openType,openSet);
});
}
//校验时间格式
function validateDateTime(dateTimeObj){
var isValid = false;
var parseToObj = new Date(dateTimeObj.replace(/-/g, "/"));
if(!isNaN(parseToObj)){
isValid = true;
}
return isValid;
}
function DateTimeEqual(beginObj,endObj){
var isEqual = 0;
var begin = new Date(beginObj.replace(/-/g, "/"));
var end = new Date(endObj.replace(/-/g, "/"));
if(Date.parse(begin) - Date.parse(end) > 0){
isEqual = -1;//起始时间大于结束时间
}else if(Date.parse(begin) - Date.parse(end) == 0){
isEqual = -2;//起始时间与结束时间相等
}
return isEqual;
}
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); }
//初始化界面
function initGrid(){
$("h_customer").value = "";
comboCustomer.setComboText($("h_customer").value);
$("txt_beginDate").value = "";
$("txt_endDate").value = "";
$("txt_billno").value = "";
createGrid();
}
function checkInfo(){
var checkRowID = "";
var iCheckCount = 0;
for(var i=0;i 0){
commonGridObj_attrlist.getGridObj().cellByIndex(rowIndex,0).setValue(0);
}else{
iCheckCount++;
checkRowID = rowId;
}
}
}
if(checkRowID != ""){
var openSet = "height=200, width=700, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-200)/2 + ",Left= "+(screen.width-700)/2
var openType = "_blank";
var openUrl = "TypeEdit.aspx?handle=edit&id="+checkRowID;
var tempWin = window.open ("about:blank",openType,openSet);
tempWin.location = openUrl;
}
}
function checkAll(){
if(commonGridObj_attrlist != null){
for(var i=0;i