SOURCE

<script type="text/javascript" src="/fnajs/fkdkm.js"></script>
<script type="text/javascript">
var arry=[];
var  table1 = "oTable0";//汇总明细表
var  table2 = "oTable1"; //预付明细表
var  table4 = "oTable3"; // 报销明细表

var  tb_indexnum4 = "#indexnum3"; // 报销明细行数
var  tb_indexnum1 = "#indexnum0"; //汇总明细行数
var  tb_indexnum2 = "#indexnum1"; //预付明细行数

//主表有无发票
var   ywfp = "field99907"; // 有无发票
var   ywfp_z = "";

// 报销明细表
var   field_yskm   = "field99932"; //报销预算科目
var   field_bxje   = "field99944"; // 报销金额(报销明细表)
var   cbzx   = "field99955"; // 成本中心
var   pjzs   = "field99945";//  发票张数
var   sl     = "field99950";// 税率
var   sj     = "field99951";// 税金
var   bhsje  = "field99949";// 不含税金额
var   sjfkje = "field99953"; //实际付款金额

// 预付明细表
var  field_yskm_yf = "field99933";// 预付预算科目
var  field_kcxje_yf = "field99922";// 预付可冲销金额
var  kcxje_id = "99922";
var  field_bccx_yf = "field99921";//本次冲销金额
var  bccx_id = "99921";
//汇总明细表
var  field_yskm_hz = "field99937"; // 汇总预算科目
var  field_bxzje_hz = "field99939"; // 汇总报销总金额
var  field_kkzje_hz  = "field99941"; //汇总扣款总金额
var  field_kcxje_hz  = "field99943"; // 可冲销金额
var  field_sfje_hz = "field99942";   // 实付金额
var  field_cxje_hz = "field99940"; // 冲销金额

var dt2_fieldIdJklc_wyy = "field99904"; // 相关预付流程ID
var dt2_fieldIdDnxh_wyy = "field99936";//   预付明细行

var field_kmxx_id = "106792" ; //科目选项
var field_kmxx = "field106792";
var field_ts_id = "106790"
var field_ts = "field106790"

var depart  = "field99889" ; // 部门
var ayydate = "field99887"; //申请日期
var ysxx_id = "103288";     //  预算信息id
 
jQuery(document).ready(function () {
if( jQuery("#" + ywfp + " option:selected").text() == "无") {
		jQuery("#" + table2).hide();
	}
	//界面打开自动获取最新的预算信息
	fullgetfna();
	//有无发票,自动锁定
	$("#" + ywfp ).bindPropertyChange(function(){
        btjiaoyan();
    });
	// 页面打开的时候 给科目赋change 事件
	  var row_bx = jQuery(tb_indexnum4).val();
	  for(var i = 0;i<row_bx;i++){

        
		   carbuzu(jQuery("#"+  field_kmxx + "_" + i),field_kmxx+"_"+i);
		  if(jQuery("#"+  field_yskm + "_" + i).length >0){
			 jQuery("#"+  field_yskm + "_" + i).bindPropertyChange(function(o) { 
				getfnainfo(o["value"],o["id"]);
		  });  
		  
		  jQuery("#"+  field_kmxx + "_" + i).bindPropertyChange(function(o) { 
				carbuzu(o["value"],o["id"]);
		  });  
		  
		  
		  }
	  }
	     // 给部门赋change权限
		 jQuery("#"+ depart ).bindPropertyChange(function(o) { 
			var row_bxc = jQuery(tb_indexnum4).val();
			for(var i = 0 ;i<row_bxc;i++){
				if(jQuery("#"+ field_yskm+"_" + i).length > 0){
					var yskm = jQuery("#"+field_yskm+"_" + i).val();
					var idd = field_yskm +"_" + i
					getfnainfo(yskm,idd);
				}	
			}
		  }); 
		  
    //重写提交checkCustomize
    checkCustomize = function (){
	if(fhuizong(table2,table4) == true && kmyizhi() == true ){
		HZFZ();
		return true;
	 }else 
	 {
		 return false;
	 }  
	
    }
});

 //增加按钮的回调函数
 function _customAddFun3(){
	 
	   btjiaoyan();
	   var maxnum = jQuery("#indexnum3").val()-1;
	   //给预算科目绑定change事件
	      jQuery("#"+  field_yskm + "_" + maxnum).bindPropertyChange(function(o) { 
		  getfnainfo(o["value"],o["id"]);

    }); 
	
	  jQuery("#"+  field_kmxx + "_" + maxnum).bindPropertyChange(function(o) { 
                       
				carbuzu(o["value"],o["id"]);
		  }); 
 }

function carbuzu(isbzvalue,isbzid){
	var index = 0;
	if(isbzid.indexOf("_") > 0 ){
		index = isbzid.substring(isbzid.indexOf("_")+1,isbzid.length);
	}
	if(isbzvalue == 1){
          jQuery("#" + field_ts + "_" + index).show();
		  needcheckcar(field_ts+ "_" + index);
          deleteneedcheckcar(field_bxje + "_" + index);	
	}else{
		
		 deleteneedcheckcar(field_ts+ "_" + index);
          needcheckcar(field_bxje+ "_" + index);
		 jQuery("#"+field_ts+"_" + index).hide();
	}
}

//加必填
function needcheckcar(fieldid){
    var needcheck = document.all("needcheck"); //获取必填框
	 var a1='<IMG src="/'+"images"+"/"+'BacoError_wev8.gif" align="absMiddle">';
	if(needcheck.value!=undefined){
			if(needcheck.value.indexOf(fieldid)<0){
	if(jQuery("#"+fieldid+"span").html()=="" || jQuery("#"+fieldid+"span").html() == undefined){
						jQuery("#"+fieldid+"span").html(a1);
				   }
                            needcheck.value+=",";
                            needcheck.value+=fieldid;
                     jQuery("#"+fieldid).bind('change',function(){
                           var b= jQuery("#"+fieldid).val();
                          if(b==''){
							  if(jQuery("#"+fieldid+"spanimg").length>0){
								    jQuery("#"+fieldid+"spanimg").html(a1);
							  }else{
								    jQuery("#"+fieldid+"span").html(a1);
							  }
						  }else{
							  
							  jQuery("#"+fieldid+"span").html("");
						  }
			
          })
		}
	}
}
//去必填
function deleteneedcheckcar(fieldid){
 var needcheck = document.all("needcheck"); //获取必填框
	if(needcheck.value!=undefined){
			   var a="";
               a=needcheck.value.replace(","+fieldid,"");
               needcheck.value=a;
			   jQuery("#"+fieldid).attr("value","");
			   jQuery("#"+fieldid+"span").html("");
			   jQuery("#"+fieldid+"spanimg").html("");
			   }
 } 



</script>

































































console 命令行工具 X clear

                    
>
console