You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
4.2 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script type="text/javascript" src="../../WF/Scripts/jquery-1.11.0.min.js"></script>
<script src="../../WF/Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../../WF/Scripts/config.js"></script>
<script type="text/javascript" src="../../WF/Scripts/QueryString.js"></script>
<script type="text/javascript" src="../../WF/Comm/Gener.js"></script>
<script type="text/javascript" src="../../WF/Scripts/vue.js"></script>
</head>
<body>
<form id="cc" name="cc" action="" enctype="multipart/form-data" method="post">
<fieldset>
<legend>组织ICON修改 </legend>
<ul>
<li>每个组织都有自己的ICON</li>
<li>ICON图片显示在系统的前后台的的左上角以及登录窗口上.</li>
</ul>
<legend> 当前ICON</legend>
<ul>
<li>
<img id="orgimg" style="width:160px;height:50px;" src='' />
</li>
</ul>
<legend>上传新ICON</legend>
<input type="file" name="File_Upload" id="File_Upload" />
<input type="button" value="保存" onclick="Save()" />
</fieldset>
</form>
<script type="text/javascript">
var webuser = new WebUser();
$(function () {
var empNo = GetQueryString("EmpNo");
if (empNo == null) {
var webUser = new WebUser();
empNo = webUser.No;
}
var img = document.getElementById("orgimg");
var url = "";
if (plant == "CCFlow")
url = '/DataUser/OrgIcon/' + empNo + '.jpg';
else
url = basePath + '/DataUser/OrgIcon/' + empNo + '.jpg';
if (isHasImg(url) == false) {
url = "/DataUser/ICON/CCBPMDesigner.png";
}
img.src = url;
});
//判断某个路径下的图片是否存在
function isHasImg(pathImg) {
var ImgObj = new Image();
ImgObj.src = pathImg;
if (ImgObj.fileSize > 0 || (ImgObj.width > 0 && ImgObj.height > 0)) {
return true;
} else {
return false;
}
}
//修改后保存的方法
function Save() {
Upload();
Reload();
}
//图片上传的方法
function Upload() {
if (File_Upload.files.length == 0) {
//alert('请选择要上传的文件');
return;
}
var fileName = File_Upload.files[0].name;
//判断文件类型.
var fileExt = "bpm,jpg,jpeg,png,gif";
//获取文件的后缀名
var ext = fileName.substring(fileName.lastIndexOf(".") + 1);
if (fileExt.indexOf(ext.toLowerCase()) == -1) {
alert("上传的文件必须是以图片格式:" + fileExt + " 类型, 现在类型是:" + ext);
return;
}
var empNo = GetQueryString("EmpNo");
if (empNo == null) {
var webUser = new WebUser();
empNo = webUser.No;
}
var doMethod = "UPOrgIcon_Save";
var httpHandlerName = "BP.Cloud.HttpHandler.Root";
var url = dynamicHandler + "?DoType=HttpHandler&DoMethod=" + doMethod + "&HttpHandlerName=" + httpHandlerName + "&EmpNo=" + empNo;
$("#cc").form("submit", {
type: 'POST',
dataType: 'html',
url: url,
onSubmit: function (param) {
//return false; //这里可以做表单的验证如果验证失败就return false 来终止表单提交
},
success: function (data) {
if (data.indexOf("err@") != -1) {
alert(data);
return;
}
}
});
}
</script>
</body>
</html>