//流程模块【supplier.供应商列表】下录入页面自定义js页面,初始函数
function initbodys(){
	  $(form("tend_type")).change(function(){
	  	 var receive = $("select[name='tend_type'] option:selected").val();
        
	  	 if(receive == 'JYLX02_SYS') {
				$('input[name="tax_register_code"]').val('不适用');
				$("select[name='tax_type']").val('其他');
				$("select[name='trade']").val('其他');
				$('input[name="legal_person"]').val('不适用');
				$('input[name="register_fund"]').val('不适用');
				$('input[name="register_code"]').val('不适用');
				$('input[name="tend_permit"]').val('不适用');
				$('input[name="register_address"]').val('不适用');
				$('input[name="web_site"]').val('不适用');

				$('input[name="pay_advance_amount"]').val('不适用');
			    $('#nnnn').html("<span style='white-space:nowrap;'><span style='white-space:normal;background-color:#CCCCCC;'><font color='red'>*</font></span>居民身份证号码</span>");
				$('input[name="tax_register_code"]').attr("disabled","disabled");
				$("select[name='tax_type']").attr("disabled","true");
				$("select[name='trade']").attr("disabled","true");
				$('input[name="legal_person"]').attr("disabled","disabled");
				$('input[name="register_fund"]').attr("disabled","disabled");
				$('input[name="register_code"]').attr("disabled","disabled");
				$('input[name="tend_permit"]').attr("disabled","disabled");
				$('input[name="register_address"]').attr("disabled","disabled");
				$('input[name="web_site"]').attr("disabled","disabled");
				$('input[name="pay_advance_amount"]').attr("disabled","disabled");


            }else{
                 $('#nnnn').html("<span style='white-space:nowrap;'><span style='white-space:normal;background-color:#CCCCCC;'><font color='red'>*</font></span>统一社会信用代码</span>");
				$('textarea[name="finance_desc"]').val('');
				$('input[name="tax_register_code"]').val('');
				$("select[name='tax_type']").val('');
				$("select[name='trade']").val('');
				$('input[name="legal_person"]').val('');
				$('input[name="register_fund"]').val('');
				$('input[name="register_code"]').val('');
				$('input[name="tend_permit"]').val('');
				$('input[name="register_address"]').val('');
				$('input[name="web_site"]').val('');
				$('input[name="pay_advance_amount"]').val('');

                
				$('textarea[name="finance_desc"]').removeAttr("disabled");
				$('input[name="tax_register_code"]').removeAttr("disabled");
				$("select[name='tax_type']").removeAttr("disabled");
				$("select[name='trade']").removeAttr("disabled");
				$('input[name="legal_person"]').removeAttr("disabled");
				$('input[name="register_fund"]').removeAttr("disabled");
				$('input[name="register_code"]').removeAttr("disabled");
				$('input[name="tend_permit"]').removeAttr("disabled");
				$('input[name="register_address"]').removeAttr("disabled");
				
				$('input[name="web_site"]').removeAttr("disabled");
				$('input[name="pay_advance_amount"]').removeAttr("disabled");
				
            }
    })



        
}

function changesubmit(d){
	if(d.tend_type=='JYLX02_SYS'){
	var social_cre_code =$('input[name="social_cre_code"]').val();
	  if(social_cre_code==''){
	  	return "居民身份证号码不能为空";
	  }
	}else{
		var social_cre_code =$('input[name="social_cre_code"]').val();
	  if(social_cre_code==''){
	  	return "统一社会信用代码不能为空";
	  }
	}
	
    return false;
}
