function initbodys(){
	if(!form('applydt'))return;
	$.getScript('js/rmb.js');
	form('applydt').readOnly=true;
	form('money').readOnly=true;

	
	addchengesss();
	
	if(mid=='0'){
		if(form('cardid'))js.ajax(geturlact('getlast'),{},function(d){
			if(d){
				form('paytype').value=d.paytype;
				form('cardid').value=d.cardid;
				form('openbank').value=d.openbank;
				form('fullname').value=d.fullname;
			}
		},'get,json');
	}
}
function addchengesss(){
	if(isedit==0)return;
	$("[name^='sdt0_']").unbind('change').change(function(){
		// cchangtongss();
	});
	$("[name^='name0_']").unbind('change').change(function(){
		// cchangtongss();
	});
	$("[name^='money0_']").unbind('change').change(function(){
		// cchangtongss();
	});

	}
function changesubmit(d){
	var jg = parseFloat(form('money').value);
	if(jg<=0)return '报销金额不能小于0';

	var subs = d.sub_totals0;
	var reg = new RegExp(/^[0-9a-zA-Z]+$/);
	for(i=0;i<subs;i++){
		var skey = 'invoice0_' + i;
		console.log(d[skey])
		if(!reg.test(d[skey])){
			return '第'+ (i+1) +'条费用明细,发票号只能填写英文字母与数字'
		}
	}
}
function changesubmitbefore(){
	addchengesss()
}
function eventaddsubrows(){
	 // cchangtongss();
	addchengesss();
}
function eventdelsubrows(){
	// cchangtongss();
}
