2025-03-27 15:05:14 +08:00

339 lines
14 KiB
Plaintext

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaffPageGs.aspx.cs"
MasterPageFile="~/SuperMap_Client/MasterPage/v4_0/SizeBox.Master"
Inherits="SuperMap.RealEstate.Personnel.Modules.Staff.StaffPageGs" %>
<%@ Register Assembly="RealEstate.Web" Namespace="SuperMap.RealEstate.Web.UI.WebControls" TagPrefix="smwc" %>
<%@ Register Src="StaffGs.ascx" TagName="Staff" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HTMLHead" runat="server">
<style type="text/css">
.ui-widget-content {
border: 0px;
}
.ui-widget-header {
border: 0px;
border-bottom: 1px solid #d0d0d0;
background: #fff;
}
.ui-corner-bottom, .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-right-radius: 0px;
-khtml-border-bottom-right-radius: 0px;
border-bottom-right-radius: 0px;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function () {
console.log("b");
jQuery('#tabs').tabs();
RealEstate.Page.ShowMask('正在加载...');
GetPictureList1();
GetPictureList2();
GetPictureList3();
GetPictureList4();
GetPictureList5();
GetPictureList6();
GetPictureList7();
GetPictureList8();
GetPictureList9();
RealEstate.Page.HideMask('正在加载...');
});
function BindImg() {
jQuery("#imghead").attr("src", jQuery("#M_Staff1_AVATAR_ADDRESS").val() == "" ?
"img/photo_icon.png" : jQuery("#M_Staff1_AVATAR_ADDRESS").val());
}
function Reload() {
jQuery("#M_Staff1_tabs1").attr("aria-selected", "flase");
jQuery("#M_Staff1_tabs1").attr("class", "ui-state-default ui-corner-top");
jQuery("#M_Staff1_tabs6").attr("aria-selected", "true");
jQuery("#M_Staff1_tabs6").attr("class", "ui-state-default ui-corner-top ui-tabs-active ui-state-active");
jQuery("#tabs-6").attr("style", "");
jQuery("#tabs-1").attr("style", "display:none;");
}
//图片上传预览 IE是用了滤镜。
function previewImage(file) {
var MAXWIDTH = 170;
var MAXHEIGHT = 210;
var div = document.getElementById('preview');
if (file.files && file.files[0]) {
div.innerHTML = '<img id=imghead onclick=$("#previewImg").click()>';
var img = document.getElementById('imghead');
img.onload = function () {
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
img.width = rect.width;
img.height = rect.height;
// img.style.marginLeft = rect.left+'px';
img.style.marginTop = rect.top + 'px';
}
var reader = new FileReader();
reader.onload = function (evt) { img.src = evt.target.result; }
reader.readAsDataURL(file.files[0]);
}
else //兼容IE
{
var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
file.select();
var src = document.selection.createRange().text;
div.innerHTML = '<img id=imghead>';
var img = document.getElementById('imghead');
img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
}
}
function clacImgZoomParam(maxWidth, maxHeight, width, height) {
var param = { top: 0, left: 0, width: width, height: height };
if (width > maxWidth || height > maxHeight) {
rateWidth = width / maxWidth;
rateHeight = height / maxHeight;
if (rateWidth > rateHeight) {
param.width = maxWidth;
param.height = Math.round(height / rateWidth);
} else {
param.width = Math.round(width / rateHeight);
param.height = maxHeight;
}
}
param.left = Math.round((maxWidth - param.width) / 2);
param.top = Math.round((maxHeight - param.height) / 2);
return param;
}
function GetPictureList1() {
console.log("a");
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 1000
},
dataType: "html",
success: function (data) {
console.log("c");
try {
if (data != "") {
$("#M_Staff1_PictureList1").html("");
$("#M_Staff1_PictureList1").html(data);
}
} catch (e) {
console.log(e);
}
}
});
}
function GetPictureList2() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 2000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList2").html("");
$("#M_Staff1_PictureList2").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList3() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 3000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList3").html("");
$("#M_Staff1_PictureList3").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList4() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 4000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList4").html("");
$("#M_Staff1_PictureList4").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList5() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 5000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList5").html("");
$("#M_Staff1_PictureList5").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList6() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 6000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList6").html("");
$("#M_Staff1_PictureList6").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList7() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 7000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList7").html("");
$("#M_Staff1_PictureList7").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList8() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 8000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList8").html("");
$("#M_Staff1_PictureList8").html(data);
}
} catch (e) {
}
}
});
}
function GetPictureList9() {
$.ajax({
type: "POST",
url: "/Personnel/Handler/handler_ajax.ashx?action_type=GetPictureList",
data: {
TableID: $("#M_tableId").val(),
TableName: $("#M_tableName").val(),
ImageType: 9000
},
dataType: "html",
success: function (data) {
try {
if (data != "") {
$("#M_Staff1_PictureList9").html("");
$("#M_Staff1_PictureList9").html(data);
}
} catch (e) {
}
}
});
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="B" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="B_L" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="B_R" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="T" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="T_L" runat="server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="T_R" runat="server">
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="S_T" runat="server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="S" runat="server">
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="S_B" runat="server">
</asp:Content>
<asp:Content ID="Content11" ContentPlaceHolderID="M_T" runat="server">
</asp:Content>
<asp:Content ID="Content12" ContentPlaceHolderID="M" runat="server">
<uc1:Staff ID="Staff1" runat="server" />
<smwc:TextBoxEx runat="server" ID="tableId" Visible="false"></smwc:TextBoxEx>
<smwc:TextBoxEx runat="server" ID="tableName" Visible="false"></smwc:TextBoxEx>
</asp:Content>
<asp:Content ID="Content13" ContentPlaceHolderID="M_B" runat="server">
</asp:Content>
<asp:Content ID="Content14" ContentPlaceHolderID="F" runat="server">
</asp:Content>
<asp:Content ID="Content15" ContentPlaceHolderID="F_L" runat="server">
<asp:Button ID="ButtonFile" runat="server" Text="员工资料上传" CssClass="ButtonNew" CausesValidation="false" Visible="false" />
<asp:Button ID="BtnAdd" runat="server" Text="添加兼职" CssClass="ButtonNew" CausesValidation="false" />
</asp:Content>
<asp:Content ID="Content16" ContentPlaceHolderID="F_R" runat="server">
<asp:Button ID="Button_Print" runat="server" Text="员工信息打印" CssClass="ButtonSave" CausesValidation="false" Visible="false" />
<asp:Button ID="Button_DataPrint" runat="server" Text="员工资料打印" CssClass="ButtonSave" CausesValidation="false" Visible="false" />
<asp:Button ID="ButtonSave" runat="server" OnClick="ButtonSave_Click" Text="保存" CssClass="ButtonSave" />
<asp:Button ID="ButtonDelete" runat="server" OnClick="ButtonDelete_Click" CausesValidation="false" Text="删除" CssClass="ButtonDelete" />
<asp:Button ID="ButtonClose" runat="server" CausesValidation="false" Text="关闭" CssClass="ButtonClose" />
</asp:Content>