Files
iMES_Net/iMES.WebApi/wwwroot/BiManage/JS/SZHLCommon.min.js
2026-02-06 18:34:35 +08:00

3 lines
27 KiB
JavaScript

var ComFunJS={yuming:"",isIE:function(){return!!window.ActiveXObject||"ActiveXObject"in window?!0:!1},isPC:function(){for(var r=navigator.userAgent,t=["Android","iPhone","SymbianOS","Windows Phone","iPad","iPod"],i=!0,n=0;n<t.length;n++)if(r.indexOf(t[n])>0){i=!1;break}return i},setCookie:function(n,t){var i=new Date;i.setTime(i.getTime()+2592e6);document.cookie=n+"="+escape(t)+";expires="+i.toGMTString()+";path=/"},getCookie:function(n){var t,i=new RegExp("(^| )"+n+"=([^;]*)(;|$)");return(t=document.cookie.match(i))?unescape(t[2]):null},delCookie:function(n){var t=new Date,i;t.setTime(t.getTime()-1);i=this.getCookie(n);i!=null&&(document.cookie=n+"="+i+";expires="+t.toGMTString()+";path=/;")},getfileapi:function(){return ComFunJS.getCookie("fileapi")},getnowuser:function(){return ComFunJS.getCookie("username")},delendchar:function(n){return n.length>1?n.substring(0,n.length-1):n},loadJs:function(n,t){var r=!1,i=document.createElement("script");i.type="text/javascript";i.language="javascript";i.src=n;i.onload=i.onreadystatechange=function(){r||i.readyState&&i.readyState!="loaded"&&i.readyState!="complete"||(r=!0,i.onload=i.onreadystatechange=null,t&&t.call(i))};document.getElementsByTagName("head")[0].appendChild(i)},loadCss:function(n,t){var i=document.createElement("link");i.rel="stylesheet";i.type="text/css";i.media="screen";i.href=n;document.getElementsByTagName("head")[0].appendChild(i);t&&t.call(i)},fmoney:function(n,r){r=r>0&&r<=20?r:2;n=parseFloat((n+"").replace(/[^\d\.-]/g,"")).toFixed(r)+"";var u=n.split(".")[0].split("").reverse(),f=n.split(".")[1];for(t="",i=0;i<u.length;i++)t+=u[i]+((i+1)%3==0&&i+1!=u.length?",":"");return t.split("").reverse().join("")+"."+f},getTree:function(n){return function(t){for(var i,u=[],r=0;r<n.length;r++)i=n[r],i.id=i.value,i.parent==t&&(i.children=arguments.callee(i.id),u.push(i));return u}(undefined)},getRootPath:function(){var t=window.document.location.href,n=window.document.location.pathname,i=t.indexOf(n),r=t.substring(0,i),u=n.substring(0,n.substr(1).indexOf("/")+1);return r+u},DelItem:function(n,t,r){for(i=n.length-1;i>=0;i--)n[i][t]==r&&n.splice(i,1)},isOffice:function(n){return $.inArray(n.toLowerCase(),["doc","docx","xls","xlsx","ppt","pptx","pdf"])!=-1},isPic:function(n){return $.inArray(n.toLowerCase(),["jpg","jpeg","gif","png","bmp"])!=-1},getfile:function(n){var t=ComFunJS.yuming+"/ToolS/DownFile.aspx?szhlcode="+ComFunJS.getCookie("szhlcode");return n&&(t=t+"&fileId="+n),t},viewbigimg:function(n,t){t||(t=".img-rounded");var i={title:"图片预览",id:123,start:$(t).index(n),data:[]};$(t).each(function(){var n={alt:$(this).attr("filename")?$(this).attr("filename"):"",pid:"",src:$(this).attr("imgyt"),thumb:$(this).attr("src")};i.data.push(n)});top.layer.ready(function(){top.layer.photos({photos:i})});return},viewfile:function(n){if(ComFunJS.isPic(n.FileExtendName)){ComFunJS.viewbigimg(this);return}if(ComFunJS.isOffice(n.FileExtendName)&&n.ISYL=="Y"){window.location=n.YLUrl;return}window.location=ComFunJS.getfile(n.ID)},FindItem:function(n,t){for(var r=[],i=0;i<n.length;i++)t(n[i])&&(r[r.length]=n[i]);return r},getQueryString:function(n,t){var r=new RegExp("(^|&)"+n+"=([^&]*)(&|$)","i"),i=window.location.search.substr(1).match(r);return i!=null?unescape(i[2]):t||""},convstr:function(n,t){return n?(n=n.replace(/<[^>]+>/g,""),t?n.length>t?n.substr(0,t)+"...":n:n):""},trim:function(n){return n.replace(/^,+/,"").replace(/,+$/,"")},getnowday:function(){var t=new Date,e=t.getFullYear(),u=t.getMonth()+1,f=t.getDate(),i=t.getDay(),o=t.getHours(),s=t.getMinutes(),h=t.getSeconds(),c=t.getMilliseconds(),r=e,n;return r=u>9?r+"年"+u:r+"年0"+u,r=f>9?r+"月"+f+"日":r+"月0"+f+"日",n="",i==0?n="星期日":i==1?n="星期一":i==2?n="星期二":i==3?n="星期三":i==4?n="星期四":i==5?n="星期五":i==6&&(n="星期六"),r+" "+n},getnowdate:function(n,t){var u=new Date;t&&(u=new Date(Date.parse(t.replace(/-/g,"/"))));var h=u.getFullYear(),r=u.getMonth()+1,f=u.getDate(),e=u.getHours(),o=u.getMinutes(),s=u.getSeconds(),i=h+"-";return n=="yyyy-mm"&&(r<10&&(i+="0"),i+=r+"-"),n=="yyyy-mm-dd"&&(r<10&&(i+="0"),i+=r+"-",f<10&&(i+="0"),i+=f+"-"),n=="yyyy-mm-dd hh:mm"&&(r<10&&(i+="0"),i+=r+"-",f<10&&(i+="0"),i+=f+" ",e<10&&(i+="0"),i+=e+":",o<10&&(i+="0"),i+=o+":"),n=="yyyy-mm-dd hh:mm:ss"&&(r<10&&(i+="0"),i+=r+"-",f<10&&(i+="0"),i+=f+" ",e<10&&(i+="0"),i+=e+":",o<10&&(i+="0"),i+=o+":",s<10&&(i+="0"),i+=s+":"),i.substr(0,i.length-1)},daysBetween:function(n,t){var i=n.substring(5,n.lastIndexOf("-")),r=n.substring(n.length,n.lastIndexOf("-")+1),u=n.substring(0,n.indexOf("-")),f=t.substring(5,t.lastIndexOf("-")),e=t.substring(t.length,t.lastIndexOf("-")+1),o=t.substring(0,t.indexOf("-"));return(Date.parse(f+"/"+e+"/"+o)-Date.parse(i+"/"+r+"/"+u))/864e5},GetBMPeople:function(n){var t=n.next("input:hidden").val();n.data("people")&&(t=n.data("people").userid);top.$("body").data("checkvalue",t);ComFunJS.winbtnwin("/BiManage/Base/UserSelect.html","选择人员",900,540,{},function(t,i){var u=$("iframe",$(t)).attr("id"),r=ComFunJS.isIE()?window.frames[u].getqiandaopeople():window.frames[u].contentWindow.getqiandaopeople();n.data("people",r).val(r.username).next("input:hidden").val(r.userid);n.is("td")&&n.text(r.username);layer.close(i)})},Arabia_to_Chinese:function(n){for(i=n.length-1;i>=0;i--)n=n.replace(",",""),n=n.replace(" ","");if(isNaN(n)){alert("请检查小写金额是否正确");return}for(part=String(n).split("."),newchar="",i=part[0].length-1;i>=0;i--){if(part[0].length>10)return alert("位数过大,无法计算"),"";tmpnewchar="";perchar=part[0].charAt(i);switch(perchar){case"0":tmpnewchar="零"+tmpnewchar;break;case"1":tmpnewchar="壹"+tmpnewchar;break;case"2":tmpnewchar="贰"+tmpnewchar;break;case"3":tmpnewchar="叁"+tmpnewchar;break;case"4":tmpnewchar="肆"+tmpnewchar;break;case"5":tmpnewchar="伍"+tmpnewchar;break;case"6":tmpnewchar="陆"+tmpnewchar;break;case"7":tmpnewchar="柒"+tmpnewchar;break;case"8":tmpnewchar="捌"+tmpnewchar;break;case"9":tmpnewchar="玖"+tmpnewchar}switch(part[0].length-i-1){case 0:tmpnewchar=tmpnewchar+"元";break;case 1:perchar!=0&&(tmpnewchar=tmpnewchar+"拾");break;case 2:perchar!=0&&(tmpnewchar=tmpnewchar+"佰");break;case 3:perchar!=0&&(tmpnewchar=tmpnewchar+"仟");break;case 4:tmpnewchar=tmpnewchar+"万";break;case 5:perchar!=0&&(tmpnewchar=tmpnewchar+"拾");break;case 6:perchar!=0&&(tmpnewchar=tmpnewchar+"佰");break;case 7:perchar!=0&&(tmpnewchar=tmpnewchar+"仟");break;case 8:tmpnewchar=tmpnewchar+"亿";break;case 9:tmpnewchar=tmpnewchar+"拾"}newchar=tmpnewchar+newchar}if(part.length>1)for(part[1].length>2&&(alert("小数点之后只能保留两位,系统将自动截段"),part[1]=part[1].substr(0,2)),i=0;i<part[1].length;i++){tmpnewchar="";perchar=part[1].charAt(i);switch(perchar){case"0":tmpnewchar="零"+tmpnewchar;break;case"1":tmpnewchar="壹"+tmpnewchar;break;case"2":tmpnewchar="贰"+tmpnewchar;break;case"3":tmpnewchar="叁"+tmpnewchar;break;case"4":tmpnewchar="肆"+tmpnewchar;break;case"5":tmpnewchar="伍"+tmpnewchar;break;case"6":tmpnewchar="陆"+tmpnewchar;break;case"7":tmpnewchar="柒"+tmpnewchar;break;case"8":tmpnewchar="捌"+tmpnewchar;break;case"9":tmpnewchar="玖"+tmpnewchar}i==0&&(tmpnewchar=tmpnewchar+"角");i==1&&(tmpnewchar=tmpnewchar+"分");newchar=newchar+tmpnewchar}while(newchar.search("零零")!=-1)newchar=newchar.replace("零零","零");return newchar=newchar.replace("零亿","亿"),newchar=newchar.replace("亿万","亿"),newchar=newchar.replace("零万","万"),newchar=newchar.replace("零元","元"),newchar=newchar.replace("零角",""),newchar=newchar.replace("零分",""),(newchar.charAt(newchar.length-1)=="元"||newchar.charAt(newchar.length-1)=="角")&&(newchar=newchar+"整"),newchar},convertuser:function(n){var t="",i=n.split(","),f,r,u;if(n!=="")if(top.$("body").data("usersarr"))for(f=top.$("body").data("usersarr"),r=0;r<i.length;r++)u=ComFunJS.FindItem(f,function(n){return n.UserName==i[r]}),u.length>0&&(t=t+","+u[0].UserRealName);else $.ajaxSettings.async=!1,$.getJSON("/api/Auth/ExeAction?Action=GETUSERJS",{P1:""},function(n){var u,r,f;if(n.ErrorMsg==""){for(u=n.Result,r=0;r<i.length;r++)f=ComFunJS.FindItem(u,function(n){return n.UserName==i[r]}),f.length>0&&(t=t+","+f[0].UserRealName);top.$("body").data("usersarr",u)}});return t.length>1&&(t=t.substring(1)),t},getuser:function(){},converfilesize:function(n){if(n){for(var n=parseFloat(n),t=0,i="Bytes";n>1024;)n=n/1024,t++;return t==1?i="KB":t==2?i="MB":t==3&&(i="GB"),n.toFixed(2)+" "+i}},winsuccess:function(n){top.toastr.success(n)},winsuccessnew:function(n){top.toastr.success(n)},winprompt:function(n){layer.prompt(function(t){n.call(this,t)})},winwarning:function(n){top.toastr.warning(n)},wintips:function(n){layer.msg(n,{offset:200,shift:6})},wintip:function(n,t){layer.tips(n,t)},winload:function(){layer.load()},wintab:function(){layer.tab({area:["600px","300px"],tab:[{title:"TAB1",content:"内容1"},{title:"TAB2",content:"内容2"},{title:"TAB3",content:"内容3"}]})},wincloseload:function(){layer.closeAll("loading")},winconfirm:function(n,t,i){layer.confirm(n,{btn:["确认","取消"],shade:!1},function(){return layer.closeAll("dialog"),t.call(this)},function(){return i&&i.call(this)})},winAlert:function(n){layer.confirm(n,{btn:["确认"],shade:!1},function(){layer.closeAll("dialog")})},winAlert2:function(n,t){layer.confirm(n,{btn:["确认"],shade:!0},function(){return layer.closeAll("dialog"),t.call(this)})},winviewform:function(n,t,i,r,u){var i=i||$("body").width()*2/3,r=r||$(window).height()-140,f={type:2,fix:!0,area:[i+"px",r+"px"],maxmin:!0,content:n,title:t,shadeClose:!1,scrollbar:!1,shade:.4,shift:0,success:function(){},end:function(){if(u)return u.call(this)}};layer.open(f)},winviewformmax:function(n,t,i,r,u){var i=i||$("body").width()-300,r=r||$("#main").height(),f={type:2,fix:!0,area:[i+"px",r+"px"],maxmin:!1,content:n,title:t,shadeClose:!1,success:function(){$(".layui-layer-shade").css("opacity","0.1")},end:function(){if(u)return u.call(this)}},e=layer.open(f);layer.full(e)},winviewformNoClose:function(n,t,i,r){var i=i||$("body").width()-300,r=r||$("#main").height(),u={type:2,fix:!0,closeBtn:0,area:[i+"px",r+"px"],maxmin:!1,content:n,title:t,shadeClose:!1,success:function(){}};layer.open(u)},winviewformright:function(n,t,i){var r;if($(".layui-layer").length==0){var u=$("body").width()*2/3,f=$(window).height(),e={type:2,fix:!0,area:[u+"px",f+"px"],content:n,title:t,shift:0,shade:.4,shadeClose:!1,scrollbar:!1,success:function(n,t){var i=$("iframe",$(n)).attr("id");$("body").one("click",function(){layer.close(t)})},end:function(){if(i)return i.call(this)}};return layer.open(e)}r=$(".layui-layer").find("iframe")[0].name;window.frames[r].document.location.href=n},winbtnwin:function(n,t,i,r,u,f){var i=i||$("body").width()-300,r=r||$(window).height()*.8,e={type:2,fix:!0,area:[i+"px",r+"px"],maxmin:!0,content:n,title:t,shade:.4,shift:0,shadeClose:!1,scrollbar:!1,success:function(n,t){if($(n).find(".successfoot").length==0){var i=$('<div class="successfoot" style="border-bottom-width: 1px; padding: 0 20px 0 10px;margin-top: -3px;height:50px;background: #fff;"><\/div>'),r=$("<a href='javascript:void(0)' class='btn btn-sm btn-success' style='float:right; margin-top: 10px;width: 140px;'><i class='fa fa-spinner fa-spin' style='display:none'><\/i> 确 认<\/a>"),u=$("<a href='javascript:void(0)' class='btn btn-sm btn-danger' style='float:right; margin-top: 10px;margin-right: 10px;width: 80px;'>取 消<\/a>"),e=$("<input type='hidden' class='r_data' >");r.appendTo(i).bind("click",function(){return f.call(this,n,t,r)});u.appendTo(i).bind("click",function(){layer.close(t)});$(n).append(i).append(e);try{}catch(o){}}}};layer.open(e)},winviewhtml:function(n,t,i,r,u){var i=i||600,r=r||400;layer.open({type:1,title:t,skin:"layui-layer-rim",area:[i+"px",r+"px"],content:n,shadeClose:!0,success:function(n,t){if(u)return u.call(this,n,t)}})},winold:function(n){var t=610,i=600,r=(window.screen.availHeight-30-i)/2,u=(window.screen.availWidth-10-t)/2,f="width="+t+",height="+i+",top="+r+",left="+u+",channelmode=yes,directories=yes,fullscreen=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no";window.open(n,name,f)},initForm:function(){$(".szhl_form_date")[0]&&($(".szhl_form_date").datetimepicker({format:"yyyy-mm-dd"}),$(".szhl_form_date").each(function(){$(this).val()!==""||$(this).hasClass("null")||$(this).val(ComFunJS.getnowdate("yyyy-mm-dd"));$(this).trigger("change")}));$(".szhl_form_date_year")[0]&&($(".szhl_form_date_year").datetimepicker({minView:4,startView:4,format:"yyyy"}),$(".szhl_form_date_year").val()===""&&$(".szhl_form_date_year").val(ComFunJS.getnowdate("yyyy")),$(".szhl_form_date_year").trigger("change"));$(".szhl_form_date_mon")[0]&&($(".szhl_form_date_mon").datetimepicker({minView:3,startView:3,format:"yyyy-mm"}),$(".szhl_form_date_mon").val()===""&&$(".szhl_form_date_mon").val(ComFunJS.getnowdate("yyyy-mm")),$(".szhl_form_date_mon").trigger("change"));$(".szhl_form_date_hour")[0]&&($(".szhl_form_date_hour").datetimepicker({minView:0,startView:1,format:"hh:ii"}),$(".szhl_form_date_mon").val()===""&&$(".szhl_form_date_mon").val(ComFunJS.getnowdate("yyyy-mm")),$(".szhl_form_date_mon").trigger("change"));$(".szhl_form_date_time")[0]&&($(".szhl_form_date_time").datetimepicker({minView:0,format:"yyyy-mm-dd hh:ii"}),$(".szhl_form_date_time").val()===""&&$(".szhl_form_date_time").attr("novalue")==undefined&&$(".szhl_form_date_time").val(ComFunJS.getnowdate("yyyy-mm-dd hh:mm")),$(".szhl_form_date_time").trigger("change"));$(".szhl_UEEDIT").length>0&&$(".szhl_UEEDIT").each(function(){var t=$(this),i=$(this).attr("id"),n=UM.getEditor(i);$(this).attr("umheight")?n.setHeight($(this).attr("umheight")):n.setHeight("100");n.ready(function(){if(t.val()!=""&&n.setContent(t.val()),t.hasClass("focus")&&n.focus(),$(".edui-btn-toolbar").find(".zdyimg").length==0){var i=$(".edui-btn-toolbar").find(".edui-btn-image").clone(),r=$(".edui-btn-toolbar").find(".edui-btn-image").clone();$(".edui-btn-toolbar").find(".edui-btn-image").hide();i.css("display","inline-block");i.addClass("zdyimg").show().appendTo($(".edui-btn-toolbar")).bind("click",function(){top.ComFunJS.winbtnwin(ComFunJS.getfileapi()+"fileupload","上传","550","400",{},function(t,i,r){var f,u,e;r.addClass("disabled").find("i").show();f=$("iframe",$(t)).attr("id");u=ComFunJS.isIE()?top.window.frames[f]:top.window.frames[f].contentWindow;u.location="/BiManage/Base/Success.html?ID=3&fmindex="+i;e=top.window.setInterval("getwinname()",1500);top.window.getwinname=function(){var f,o,t;try{if(u.filedata){for(top.window.clearInterval(e),f=u.filedata,r.removeClass("disabled").find("i").hide(),o="",t=0;t<f.length;t++)ComFunJS.isPic(f[t].FileExtendName)&&(o=o+"<p><img style='max-height:775px;max-width:475px' src='"+ComFunJS.getfile(f[t].ID)+"'/><\/p>");n.setContent(o,!0);top.layer.close(i)}}catch(s){}}})})}});n.addListener("contentChange",function(){t.val(UM.getEditor(i).getContent())});n.addListener("blur",function(){t.val(UM.getEditor(i).getContent())})});$(".szhl_getPeoples:hidden").length>0&&$(".szhl_getPeoples:hidden").each(function(){var n=$(this),r,i,t;n.attr("isinit","Y");r=$(this).attr("signle")?"Y":"N";i="";n.val()!=""&&$.each(n.val().split(","),function(n,t){ComFunJS.convertuser(t)&&(i=i+'<span class="label label-info" style="display: inline-block;margin-right: 10px;padding: 4px;margin-top: 3px;">'+ComFunJS.convertuser(t)+'<span class="badge peopledel" style="background-color: brown;font-size: x-small;" nowuser="'+t+'">X<\/span><\/span>')});n.parent().find(".panpel").remove();t=$('<div class="panel panel-default panpel" style="margin-bottom: 0px;"><div class="panel-body" style="padding: 4px;max-height:100px;overflow:auto">'+i+'<a href="javascript:void(0)" class="btn-upload btn-link">选择人员<\/a><i class="iconfont icon-838ribao" style="display:none"><\/i><\/div><\/div>');$(".peopledel",t).one("click",function(){var i=$(this).attr("nowuser"),t;$(this).parent().remove();t=(","+n.val()+",").replace(i+",","");t.substring(0,1)==","&&(t=t.substring(1));t.substring(t.length-1,t.length)==","&&(t=t.substring(0,t.length-1));n.val(t)});t.insertAfter(n);t.find(".btn-upload").bind("click",function(){var i=$(this),u="";n.attr("usertype")&&(u="&userType="+n.attr("usertype")+"&typeid="+n.attr("typeid"));top.$("body").data("checkvalue",n.val());top.ComFunJS.winbtnwin("/BiManage/Base/UserSelect.html?issignle="+r+u,"选择人员",900,470,{},function(r,u){var e=$("iframe",$(r)).attr("id"),f=ComFunJS.isIE()?top.window.frames[e].getqiandaopeople():top.window.frames[e].contentWindow.getqiandaopeople();n.data("people",f).val(f.userid);i.parent().find(".label-info").remove();$.each(f.username.split(","),function(n,t){if(t!=""){var r=$('<span class="label label-info" style="display: inline-block;margin-right: 10px;padding: 3px; margin-top: 3px;">'+t+'<span class="badge peopledel" style="background-color: brown;font-size: x-small;" nowuser="'+f.userid.split(",")[n]+'">X<\/span><\/span>');r.insertBefore(i)}});$(".peopledel",t).one("click",function(){var i=$(this).attr("nowuser"),t;$(this).parent().remove();t=(","+n.val()+",").replace(i+",","");t.substring(0,1)==","&&(t=t.substring(1));t.substring(t.length-1,t.length)==","&&(t=t.substring(0,t.length-1));n.val(t)});top.layer.close(u)})})});$(".szhl_Upload:hidden").length>0&&$(".szhl_Upload:hidden").each(function(){var t=$(this),i=$(this).attr("title")?$(this).attr("title"):"上传文件",r=$(this).attr("FileType")?$(this).attr("FileType"):"",n;t.parent().find(".panpel").remove();n=$('<div class="panel panel-default panpel" style="margin-bottom: 0px;"><div class="panel-body"><button class="btn btn-success btn-upload dim" type="button"><i class="fa fa-upload"><\/i>上传文件<\/button><button class="btn btn-success btn-selfile dim" type="button" style="margin-left: 10px;"><i class="fa fa-upload"><\/i>从文档中心选择文件<\/button><\/div><ul class="list-group"><\/ul><\/div>').insertAfter(t);n.find(".btn-upload").bind("click",function(){parent.ComFunJS.winbtnwin(ComFunJS.getfileapi()+"fileupload","上传","550","400",{},function(i,r,u){var f="",o,e,s;u.addClass("disabled").find("i").show();o=$("iframe",$(i)).attr("id");e=ComFunJS.isIE()?parent.window.frames[o]:parent.window.frames[o].contentWindow;e.location="/BiManage/Base/Success.html?ID=3&fmindex="+r;s=parent.window.setInterval("getwinname()",1500);parent.window.getwinname=function(){var i,o,c,h;try{if(e.filedata){for(parent.window.clearInterval(s),i=e.filedata,u.removeClass("disabled").find("i").hide(),o=0;o<i.length;o++)c="",ComFunJS.isPic(i[o].FileExtendName)&&(c="<img class='fjimg' style='width:60px;height:60px' src='"+ComFunJS.getfile(i[o].ID)+"'/>"),h=$("<a class='list-group-item' fileid='"+i[o].ID+"' >"+c+i[o].Name+"."+i[o].FileExtendName+"<span class='glyphicon glyphicon-download-alt' fileid='"+i[o].ID+"' FileMD5='"+i[o].FileMD5+"' style='margin-left: 5px;'><\/span><span class='glyphicon glyphicon-trash pull-right'><\/span><\/a>"),h.find(".glyphicon-trash").bind("click",function(){$(this).parent().remove();var i="";n.find(".list-group-item").each(function(){i=i+$(this).attr("fileid")+","});i.length>0&&(i=i.substring(0,i.length-1));t.val(i)}),h.find(".glyphicon-download-alt").bind("click",function(){window.open(ComFunJS.getfile($(this).attr("fileid")))}),n.find(".list-group").append(h);n.find(".list-group-item").each(function(){f=f+$(this).attr("fileid")+","});f.length>0&&(f=f.substring(0,f.length-1));t.val(f);top.layer.close(r);t.attr("ATTR_KJ")&&i[0].FileExtendName=="zip"&&($(".KJMD5").attr("ATTR_FileMd5",i[0].FileMD5),$(".btn_sy").trigger("click"))}}catch(l){}}})});n.find(".btn-selfile").bind("click",function(){parent.ComFunJS.winbtnwin("/BiManage/Base/FileSel.html","","550","500",{},function(i,r,u){var o="",c=$("iframe",$(i)).attr("id"),l=ComFunJS.isIE()?parent.window.frames[c]:parent.window.frames[c].contentWindow,e=l.model.selfiles.$model,f,h,s;for(u.removeClass("disabled").find("i").hide(),f=0;f<e.length;f++)h="",ComFunJS.isPic(e[f].FileExtendName)&&(h="<img class='fjimg' style='width:60px;height:60px' src='"+ComFunJS.getfile(e[f].ID)+"'/>"),s=$("<a class='list-group-item' fileid='"+e[f].ID+"' >"+h+e[f].Name+"."+e[f].FileExtendName+"<span class='glyphicon glyphicon-download-alt' fileid='"+e[f].ID+"' FileMD5='"+e[f].FileMD5+"' style='margin-left: 5px;'><\/span><span class='glyphicon glyphicon-trash pull-right'><\/span><\/a>"),s.find(".glyphicon-trash").bind("click",function(){$(this).parent().remove();var i="";n.find(".list-group-item").each(function(){i=i+$(this).attr("fileid")+","});i.length>0&&(i=i.substring(0,i.length-1));t.val(i)}),s.find(".glyphicon-download-alt").bind("click",function(){window.open(ComFunJS.getfile($(this).attr("fileid")))}),n.find(".list-group").append(s);n.find(".list-group-item").each(function(){o=o+$(this).attr("fileid")+","});o.length>0&&(o=o.substring(0,o.length-1));t.val(o);parent.layer.close(r)})});t.val()!=""&&$.getJSON("/API/VIEWAPI.ashx?ACTION=QYWD_GETFILESLIST",{P1:t.val()},function(i){var u,r,e,f;if(i.ErrorMsg==""){for(u=i.Result,r=0;r<u.length;r++)e="",ComFunJS.isPic(u[r].FileExtendName)&&(e="<img class='fjimg' style='width:60px;height:60px' src='"+ComFunJS.getfile(u[r].ID)+"'/>"),f=$("<a class='list-group-item' fileid='"+u[r].ID+"' >"+e+u[r].Name+"."+u[r].FileExtendName+"<span class='glyphicon glyphicon-download-alt' fileid='"+u[r].ID+"' FileMD5='"+u[r].FileMD5+"' style='margin-left: 5px;'><\/span><span class='glyphicon glyphicon-trash pull-right'><\/span><\/a>"),f.find(".glyphicon-trash").bind("click",function(){$(this).parent().remove();var i="";n.find(".list-group-item").each(function(){i=i+$(this).attr("fileid")+","});i.length>0&&(i=i.substring(0,i.length-1));t.val(i)}),f.find(".glyphicon-download-alt").bind("click",function(){window.open(ComFunJS.getfile($(this).attr("fileid")))}),n.find(".list-group").append(f);t.attr("UploadType")=="1"&&n.find(".glyphicon-trash").remove()}else n.find(".panel-body").text("无附件")});t.attr("UploadType")=="1"&&n.find(".btn-upload").remove()})},initsetajax:function(n){$(document).ajaxSend(function(n,t,i){var r=t,u=i;t.setRequestHeader("randomcode","msg")}).ajaxStart(function(){n&&top.ComFunJS.winload()}).ajaxSuccess(function(t,i,r,u){try{if(r.type=="POST"&&(u=$.parseJSON(u)),r.type=="GET"&&(u=u),u.ErrorMsg=="NOSESSIONCODE"||u.ErrorMsg=="WXTIMEOUT"){top.ComFunJS.winwarning("页面超时!");top.window.location.href="/Login.html";return}u.ErrorMsg&&top.ComFunJS.winwarning(u.ErrorMsg)}catch(t){n&&top.ComFunJS.wincloseload()}}).ajaxStop(function(){n&&top.ComFunJS.wincloseload()}).ajaxError(function(){})},getSPStatus:function(n,t,i){return n=="正在审批"?"<a href='javascript:void(0)' onclick='ViewForm("+t+", "+i+")'><i class='iconfont icon-shezhichilun fa-spin'><\/i>正在审批<\/a>":n=="已退回"?"<a href='javascript:void(0)' style='color:red' onclick='ViewForm("+t+", "+i+")'><i class='fa fa-times text-danger'>"+n+"<\/i><\/a>":"<a href='javascript:void(0)' style='color:green' onclick='ViewForm("+t+", "+i+")'><i class='fa fa-check text-navy'>"+n+"<\/i><\/a>"},facePath:[{faceName:"微笑",facePath:"0_微笑.gif"},{faceName:"撇嘴",facePath:"1_撇嘴.gif"},{faceName:"色",facePath:"2_色.gif"},{faceName:"发呆",facePath:"3_发呆.gif"},{faceName:"得意",facePath:"4_得意.gif"},{faceName:"流泪",facePath:"5_流泪.gif"},{faceName:"害羞",facePath:"6_害羞.gif"},{faceName:"闭嘴",facePath:"7_闭嘴.gif"},{faceName:"睡",facePath:"8_睡.gif"},{faceName:"大哭",facePath:"9_大哭.gif"},{faceName:"尴尬",facePath:"10_尴尬.gif"},{faceName:"发怒",facePath:"11_发怒.gif"},{faceName:"调皮",facePath:"12_调皮.gif"},{faceName:"龇牙",facePath:"13_龇牙.gif"},{faceName:"惊讶",facePath:"14_惊讶.gif"},{faceName:"难过",facePath:"15_难过.gif"},{faceName:"酷",facePath:"16_酷.gif"},{faceName:"冷汗",facePath:"17_冷汗.gif"},{faceName:"抓狂",facePath:"18_抓狂.gif"},{faceName:"吐",facePath:"19_吐.gif"},{faceName:"偷笑",facePath:"20_偷笑.gif"},{faceName:"可爱",facePath:"21_可爱.gif"},{faceName:"白眼",facePath:"22_白眼.gif"},{faceName:"傲慢",facePath:"23_傲慢.gif"},{faceName:"饥饿",facePath:"24_饥饿.gif"},{faceName:"困",facePath:"25_困.gif"},{faceName:"惊恐",facePath:"26_惊恐.gif"},{faceName:"流汗",facePath:"27_流汗.gif"},{faceName:"憨笑",facePath:"28_憨笑.gif"},{faceName:"大兵",facePath:"29_大兵.gif"},{faceName:"奋斗",facePath:"30_奋斗.gif"},{faceName:"咒骂",facePath:"31_咒骂.gif"},{faceName:"疑问",facePath:"32_疑问.gif"},{faceName:"嘘",facePath:"33_嘘.gif"},{faceName:"晕",facePath:"34_晕.gif"},{faceName:"折磨",facePath:"35_折磨.gif"},{faceName:"衰",facePath:"36_衰.gif"},{faceName:"骷髅",facePath:"37_骷髅.gif"},{faceName:"敲打",facePath:"38_敲打.gif"},{faceName:"再见",facePath:"39_再见.gif"},{faceName:"擦汗",facePath:"40_擦汗.gif"},{faceName:"抠鼻",facePath:"41_抠鼻.gif"},{faceName:"鼓掌",facePath:"42_鼓掌.gif"},{faceName:"糗大了",facePath:"43_糗大了.gif"},{faceName:"坏笑",facePath:"44_坏笑.gif"},{faceName:"左哼哼",facePath:"45_左哼哼.gif"},{faceName:"右哼哼",facePath:"46_右哼哼.gif"},{faceName:"哈欠",facePath:"47_哈欠.gif"},{faceName:"鄙视",facePath:"48_鄙视.gif"},{faceName:"委屈",facePath:"49_委屈.gif"},{faceName:"快哭了",facePath:"50_快哭了.gif"},{faceName:"阴险",facePath:"51_阴险.gif"},{faceName:"亲亲",facePath:"52_亲亲.gif"},{faceName:"吓",facePath:"53_吓.gif"},{faceName:"可怜",facePath:"54_可怜.gif"},{faceName:"菜刀",facePath:"55_菜刀.gif"},{faceName:"西瓜",facePath:"56_西瓜.gif"},{faceName:"啤酒",facePath:"57_啤酒.gif"},{faceName:"篮球",facePath:"58_篮球.gif"},{faceName:"乒乓",facePath:"59_乒乓.gif"},{faceName:"拥抱",facePath:"78_拥抱.gif"},{faceName:"握手",facePath:"81_握手.gif"}],insertAtCursor:function(n,t){if(document.selection)n.focus(),sel=document.selection.createRange(),sel.text=t,sel.select();else if(n.selectionStart||n.selectionStart=="0"){var i=n.selectionStart,u=n.selectionEnd,r=n.scrollTop;n.value=n.value.substring(0,i)+t+n.value.substring(u,n.value.length);r>0&&(n.scrollTop=r);n.focus();n.selectionStart=i+t.length;n.selectionEnd=i+t.length}else n.value+=t},bqhContent:function(t){var u,r,f;if(t&&(u=/(\[[\u4e00-\u9fa5]*\w*\]){1}/g,r=t.match(u),r))for(i=0;i<r.length;i++)for(n=0;n<ComFunJS.facePath.length;n++)if(ComFunJS.facePath[n].faceName==r[i].substring(1,r[i].length-1)){f='<img title="'+ComFunJS.facePath[n].faceName+"\" style='display: initial;' src=\"/View_Mobile/Images/face/"+ComFunJS.facePath[n].facePath+'" />';t=t.replace(r[i],f);break}return t}};$(function(){$.getJSON=function(n,t,i){t.szhlcode=ComFunJS.getCookie("szhlcode");var r={success:function(){}};i&&(r.success=i);$.ajax({url:ComFunJS.yuming+n,data:t,dataType:"json",type:"post",success:function(n,t){if(n.ErrorMsg=="NOSESSIONCODE"||n.ErrorMsg=="WXTIMEOUT"){top.ComFunJS.winwarning("页面超时!");top.window.location.href="/BiManage/Login.html";return}if(n.ErrorMsg){top.ComFunJS.winwarning(n.ErrorMsg);return}r.success(n,t)},beforeSend:function(){},error:function(){},complete:function(){}})};$.post=function(n,t,i){t.szhlcode=ComFunJS.getCookie("szhlcode");var r={success:function(){}};i&&(r.success=i);$.ajax({type:"post",url:ComFunJS.yuming+n,data:t,success:function(n,t){if(n.ErrorMsg=="NOSESSIONCODE"||n.ErrorMsg=="WXTIMEOUT"){top.ComFunJS.winwarning("页面超时!");top.window.location.href="/BiManage/Login.html";return}if(n.ErrorMsg){top.ComFunJS.winwarning(n.ErrorMsg);return}r.success(n,t)},dataType:"json",beforeSend:function(){},error:function(){top.ComFunJS.winwarning("请求执行有误,请检查系统运行环境")},complete:function(){}})}});
//# sourceMappingURL=SZHLCommon.min.js.map