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.

145 lines
5.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/jquery.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>
<div class="card-sub"> 企业基本信息</div>
<table id="example" style="" class="table table-hover">
</table>
<img id="orgimg" style="width:160px;height:50px;" src='' />
<form id="cc" name="cc" action="" enctype="multipart/form-data" method="post">
上传公司图标<input type="file" name="File_Upload" id="File_Upload" />
<input type="button" value="保存" onclick="Save()" />
</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;
BaseInfo();
});
//判断某个路径下的图片是否存在
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 BaseInfo() {
if (webuser.No == "" || webuser.No == null || webuser.No == undefined) {
alert("登录信息丢失");
return;
}
var en = new Entity("BP.Cloud.Emp", webuser.No);
var html = "";
html += "<tr><td>管理员账号:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id='TB_Adminer' name='TB_Admin' readonly='readonly' type='text'value='" + en.No + "'/></td></tr>";
html += "<tr><td>管理员名称:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id='TB_AdminerName' name='TB_AdminerName' type='text'value='" + en.Name + "'/></td></tr>";
html += "<tr><td>企业名称:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' readonly='readonly' value='" + en.FK_DeptText + "'/></td></tr>";
html += "<tr><td>公司图标</tr>";
$("#example").html(html);
}
//修改后保存的方法
function Save() {
var AdminerName = $("#TB_AdminerName").val();
if (AdminerName == "" || AdminerName == null || AdminerName == undefined) {
alert("管理员名称不能为空");
return;
}
var en = new Entity("BP.Cloud.Emp",webuser.No);
en.Name = AdminerName;
en.Update();
Upload();
alert("保存成功");
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;
}
// alert("保存成功");
// Reload();
}
});
}
</script>
</body>
</html>