<form id="financialForm" action="<%=basePath%>riskcontrol/website/review_borrow!financialUplaod.ds" method="post" enctype="multipart/form-data" onsubmit="return checkusertype()" >
<input type="hidden" name="usreId" value="<%=_usreId%>" />
<input type="hidden" name="borrowId" value="<%=_borrowId%>" />
<input type="file" name="image" multiple="multiple" id="financialImages"/>
<input type="submit" value="开始上传"/>
</form>
<script type="text/javascript">
function checkusertype(){
var usertype="${login_session_key.userType}";
if(!(usertype==2||usertype==11)){
alert("只有财务风控或者 总部客服可以上传复审材料");
return false;
}else{
return submitFile();
}
}
function submitFile(){
var fileArr = document.getElementById("financialImages").files;
if(fileArr.length==0){
alert('请选择上传的图片!');
return false;
}
for( var i=0;i<fileArr.length;i++){
var imageName=fileArr[i].name;
var extStart=imageName.lastIndexOf(".");
var ext=imageName.substring(extStart,imageName.length).toUpperCase();
if(ext!=".PNG"&&ext!=".JPEG"&&ext!=".JPG"&&ext!=".BMP"){
alert("图片限于PNG,JPEG,JPG,BHMP格式");
return false;
}
var filesize = fileArr[i].size/1024;
if(parseInt(filesize)>300){
alert('图片不能大于300KB');
return false;
}
// $('#financialForm').submit();
}
}
</script>