<%@ Page Language="C#" %>

<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>

<script runat="server">

    // Insert page code here
    //

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="Stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <title>BPM Form</title>
    <style>
        BODY {
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TABLE {
            border-collapse: collapse;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        P {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 0px;
            PADDING-BOTTOM: 0px;
            MARGIN: 0px;
            PADDING-TOP: 0px;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TD {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 2px;
            PADDING-BOTTOM: 0px;
        }

            TD.NoPadding {
                PADDING-RIGHT: 0px;
                PADDING-LEFT: 0px;
                PADDING-BOTTOM: 0px;
                PADDING-TOP: 0px;
            }

        INPUT {
            HEIGHT: 20px;
        }

            INPUT.UL {
                BORDER-RIGHT: medium none;
                BORDER-TOP: medium none;
                BORDER-LEFT: medium none;
                BORDER-BOTTOM: #33ff33 1px solid;
            }

        TEXTAREA {
            FONT-SIZE: 12px;
        }

        .yz-inp-cnt {
            display: inline;
        }

        .yz-textbox {
            display: inline;
        }
    </style>
    <script type="text/javascript">


        /*获取福利报销费用  
        庆生费按照孩子出生日期与入职日期计算，婚庆费按照结婚日期与入职日期计算
        */
        function getWelfarelimit(welfareType, CreateTime, EntryTime, BirthDate, WeddingDate) {

            var limit = 0;

            if (welfareType == "庆生费") {
                if (BirthDate == "") {
                    return limit;
                }
                else {
                    CreateTime = BirthDate;
                }
            }
            else if (welfareType == "婚庆费") {
                if (WeddingDate == "") {
                    return limit;
                }
                else {
                    CreateTime = WeddingDate;
                }
            }


            if (EntryTime != "" && welfareType != "") {
                var workAge = 0;
                workAge = getworkage(CreateTime, EntryTime);
                YZSoft.Ajax.request({
                    url: YZSoft.$url('Oimec/ApiServices/OAAPIHandler.ashx'),
                    method: 'POST',
                    params: {
                        method: 'GetWelfareCost',
                        welfaretype: welfareType,
                        workage: workAge
                    },
                    success: function (action) {
                        var result = action.result;
                        var cost = result.Value[0][1];
                        var a = agent.Eles[document.getElementById("XTextBox8").getAttribute("xform_xele_index")].setValue(cost);

                    },
                    failure: function (action) {
                        alert(action.result.Message);

                    }
                });
            }
        }


        function getworkage(CreateTime, EntryTime) {
            var CreateTime = CreateTime.replace(/\-/g, "/");
            var EntryTime = EntryTime.replace(/\-/g, "/");
            var createDate = new Date(CreateTime);
            var entryDate = new Date(EntryTime);
            var date = createDate.getTime() - entryDate.getTime();
            var day = Math.floor(date / (24 * 3600 * 1000));
            var workage = parseInt(day / 365);
            return workage;

        }
    </script>
</head>
<body>
    <form runat="server">

        <!-- Insert content here -->
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo"></td>
                    <td class="biaoti">
                        <asp:Label ID="XLabel1" runat="server" Text="员工福利费申请单"></asp:Label></td>
                    <td class="formno">
                        <asp:Label ID="XLabel2" runat="server" Text="表单号:"></asp:Label>
                        <aspxform:XLabel ID="XLabel3" runat="server" Text="----系统自动生成----" XDataBind="DF_HR_WelfareFundsApp.FormNo" Value ValueToDisplayText BackColor="#8AB3DF"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="title1" colspan="4">
                        <asp:Label ID="XLabel4" runat="server" Text="基本信息"></asp:Label></td>
                </tr>
                <tr>
                    <td class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel5" runat="server" Text="申请人"></asp:Label>
                        <aspxform:XTextBox ID="XTextBox7" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppAccount" ValueToDisplayText="TableName:V_DF_HR_BasicInfo;FilterColumn:AttendanceKakaNO;DisplayColumn:AttendanceKakaNO" DataMap="Name->DF_HR_WelfareFundsApp.AppName;Department->DF_HR_WelfareFundsApp.AppDepartment;Region->DF_HR_WelfareFundsApp.AppRegion;PostName->DF_HR_WelfareFundsApp.AppJobs;InductionDate->DF_HR_WelfareFundsApp.AppEntryTime;BUName->DF_HR_WelfareFundsApp.AppBU" Width="10px" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True" HiddenInput="True"></aspxform:XTextBox>
                    </td>
                    <td class="basictextfirst" style="width: 35%">
                        <aspxform:XTextBox class="text" ID="XTextBox1" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppName" BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="basiclblfirst3" style="width: 10%">
                        <asp:Label ID="XLabel6" runat="server" Text="创建日期"></asp:Label></td>
                    <td class="basictextfirst3" style="width: 35%">
                        <aspxform:XDateTimePicker ID="XDateTimePicker1" runat="server" XDataBind="DF_HR_WelfareFundsApp.CreateDate" BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                </tr>
                <tr>
                    <td class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel7" runat="server" Text="部门"></asp:Label></td>
                    <td class="basictextfirst" style="width: 35%">
                        <aspxform:XTextBox class="text" ID="XTextBox2" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppDepartment" BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="basiclblfirst3" style="width: 10%">
                        <asp:Label ID="XLabel8" runat="server" Text="BU" value valuetodisplaytext></asp:Label></td>
                    <td class="basictextfirst3" style="width: 35%">
                        <aspxform:XTextBox class="text" ID="XTextBox3" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppBU" ValueToDisplayText BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="21" class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel9" runat="server" Text="岗位"></asp:Label></td>
                    <td class="basictextfirst" style="width: 35%">
                        <aspxform:XTextBox class="text" ID="XTextBox4" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppJobs" BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="basiclblfirst3" style="width: 10%">
                        <asp:Label ID="XLabel10" runat="server" Text="地区"></asp:Label></td>
                    <td class="basictextfirst3" style="width: 35%">
                        <aspxform:XTextBox class="text" ID="XTextBox5" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppRegion" BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel11" runat="server" Text="入职时间"></asp:Label></td>
                    <td class="basictextfirst3" style="width: 35%">
                        <aspxform:XDateTimePicker class="text" ID="XDateTimePicker2" runat="server" XDataBind="DF_HR_WelfareFundsApp.AppEntryTime" BackColor="#E6F1F8" BorderWidth="1" BorderColor="#DCDCDC" DisplayOnly="True" Width="50%"></aspxform:XDateTimePicker>
                    </td>
                    <td class="basiclblfirst" style="width: 10%"></td>
                    <td class="basictextfirst3" style="width: 35%"></td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="14" class="title1" colspan="4">
                        <asp:Label ID="XLabel12" runat="server" Text="福利费申请"></asp:Label>
                        <aspxform:XTextBox ID="XTextBox6" runat="server" ValueToDisplayText="TableName:V_DF_HR_WelfareApp_Count;FilterColumn:AppAccount;DisplayColumn:AppAccount" DataMap="Num1->hunqingnum;Num2->qingshengnum" HiddenInput="True" Width="20px" Express="DF_HR_WelfareFundsApp.AppAccount"></aspxform:XTextBox>
                        <aspxform:XTextBox ID="XTextBox10" runat="server" XDataBind="qingshengnum" Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenInput="True"></aspxform:XTextBox>
                        <aspxform:XTextBox ID="XTextBox13" runat="server" XDataBind="hunqingnum" ValueToDisplayText Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenInput="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="24" class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel13" runat="server" Text="福利申请类别"></asp:Label></td>
                    <td class="basictextfirst" style="width: 35%">
                        <aspxform:XDropDownList ID="XDropDownList1" runat="server" XDataBind="DF_HR_WelfareFundsApp.WealApplyType" PromptText="------请选择------">
                            <asp:ListItem>婚庆费</asp:ListItem>
                            <asp:ListItem>庆生费</asp:ListItem>
                            <asp:ListItem>丧葬费</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox ID="XTextBox11" runat="server" Value Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenInput="True">1</aspxform:XTextBox>
                        <aspxform:XTextBox ID="XTextBox12" runat="server" Value Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenInput="True">2</aspxform:XTextBox>
                    </td>
                    <td class="basiclblfirst3" style="width: 10%">
                        <asp:Label ID="XLabel22" runat="server" Text="*" hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'" ForeColor="Red"></asp:Label><asp:Label ID="XLabel17" runat="server" Text="孩子出生日期" hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'"></asp:Label><asp:Label ID="XLabel23" runat="server" Text="*" hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'" ForeColor="Red"></asp:Label><asp:Label ID="XLabel24" runat="server" Text="结婚日期" hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'"></asp:Label></td>
                    <td class="basictextfirst3" style="width: 35%">
                        <aspxform:XDateTimePicker ID="XDateTimePicker3" runat="server" XDataBind="DF_HR_WelfareFundsApp.BirthDate" BorderWidth="1" BorderColor="#DCDCDC" Width="50%" HiddenExpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'"></aspxform:XDateTimePicker>
                        <aspxform:XRequiredFieldValidator ID="XRequiredFieldValidator4" runat="server" DisableExpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'" Display="None" ErrorMessage="请选择孩子出生日期" ControlToValidate="XDateTimePicker3">请选择孩子出生日期</aspxform:XRequiredFieldValidator>
                        <aspxform:XCompareValidator ID="XCompareValidator3" runat="server" DisableExpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'" Display="None" ErrorMessage="出生日期要小于此申请日期" ControlToValidate="XDateTimePicker3" Operator="LessThan" ControlToCompare="XDateTimePicker1">出生日期要小于此申请日期</aspxform:XCompareValidator>
                        <aspxform:XDateTimePicker ID="XDateTimePicker4" runat="server" XDataBind="DF_HR_WelfareFundsApp.WeddingDate" BorderWidth="1" BorderColor="#DCDCDC" Width="50%" HiddenExpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'"></aspxform:XDateTimePicker>
                        <aspxform:XRequiredFieldValidator ID="XRequiredFieldValidator5" runat="server" DisableExpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'" Display="None" ErrorMessage="请选择结婚日期" ControlToValidate="XDateTimePicker4">请选择结婚日期</aspxform:XRequiredFieldValidator>
                        <aspxform:XCompareValidator ID="XCompareValidator4" runat="server" DisableExpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'" Display="None" ErrorMessage="结婚日期要小于此申请日期" ControlToValidate="XDateTimePicker4" Operator="LessThan" ControlToCompare="XDateTimePicker1">结婚日期要小于此申请日期</aspxform:XCompareValidator>
                    </td>
                </tr>
                <tr>
                    <td class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel15" runat="server" Text="发票类型"></asp:Label></td>
                    <td class="basictextfirst" style="width: 35%">
                        <aspxform:XDropDownList ID="XDropDownList2" runat="server" XDataBind="DF_HR_WelfareFundsApp.InvoiceType" PromptText="------请选择------">
                            <asp:ListItem>交通费</asp:ListItem>
                            <asp:ListItem>办公用品费</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                    <td class="basiclblfirst3" style="width: 10%">
                        <asp:Label ID="XLabel14" runat="server" Text="报销金额"></asp:Label></td>
                    <td class="basictextfirst3" style="width: 35%">
                        <aspxform:XTextBox class="text" ID="XTextBox8" runat="server" XDataBind="DF_HR_WelfareFundsApp.ReimbursementAmount" BackColor="#E6F1F8" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True" Express="javascript('getWelfarelimit',DF_HR_WelfareFundsApp.WealApplyType,DF_HR_WelfareFundsApp.CreateDate,DF_HR_WelfareFundsApp.AppEntryTime,DF_HR_WelfareFundsApp.BirthDate,DF_HR_WelfareFundsApp.WeddingDate)"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="basiclblfirst" style="width: 10%">
                        <asp:Label ID="XLabel16" runat="server" Text="附件"></asp:Label></td>
                    <td class="basictextfirst3" style="width: 80%" colspan="3">
                        <aspxform:XAttachments ID="XAttachments1" runat="server" XDataBind="DF_HR_WelfareFundsApp.Attachments" Width="100%" FileTypesDescription="Word,Excel,bmp,jpg,tiff,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,PDF"></aspxform:XAttachments>
                    </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator ID="XRequiredFieldValidator1" runat="server" Display="None" ErrorMessage="请选择福利申请类别" ControlToValidate="XDropDownList1">请选择福利申请类别</aspxform:XRequiredFieldValidator>
        <aspxform:XCompareValidator ID="XCompareValidator1" runat="server" DisableExpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'" Display="None" ErrorMessage="婚庆费一个人只能申请一次" ControlToValidate="XTextBox13" Operator="LessThan" ControlToCompare="XTextBox11">婚庆费一个人只能申请一次</aspxform:XCompareValidator>
        <aspxform:XCompareValidator ID="XCompareValidator2" runat="server" DisableExpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'" Display="None" ErrorMessage="庆生费一个人只能申请两次" ControlToValidate="XTextBox10" Operator="LessThan" ControlToCompare="XTextBox12">庆生费一个人只能申请两次</aspxform:XCompareValidator>
        <aspxform:XRequiredFieldValidator ID="XRequiredFieldValidator2" runat="server" Display="None" ErrorMessage="请选择发票类型" ControlToValidate="XDropDownList2">请选择发票类型</aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator ID="XRequiredFieldValidator3" runat="server" DisableExpress='DF_HR_WelfareFundsApp.WealApplyType!="庆生费" &amp;&amp; DF_HR_WelfareFundsApp.WealApplyType!="婚庆费"' Display="None" ErrorMessage="请上传相关证件" ControlToValidate="XAttachments1">请上传相关证件</aspxform:XRequiredFieldValidator>
        <table width="1200" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='婚庆费'">
                    <td width="1200" height="16">
                        <asp:Label ID="XLabel18" runat="server" Text="婚庆费:需上传结婚证，自登记之日起有效期一年内" Font-Bold="True"></asp:Label></td>
                </tr>
                <tr hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='庆生费'">
                    <td height="12">
                        <asp:Label ID="XLabel19" runat="server" Text="庆生费：需上传医院出生证明，自出生之日起有效期一年内" Font-Bold="True"></asp:Label></td>
                </tr>
                <tr hiddenexpress="DF_HR_WelfareFundsApp.WealApplyType!='丧葬费'">
                    <td>
                        <asp:Label ID="XLabel20" runat="server" Text="丧葬费：限直系亲属，包括：本人父母、本人兄弟姐妹、配偶父母及子女" Font-Bold="True"></asp:Label></td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td width="1200">
                        <aspxform:XSignTrace ID="XSignTrace1" runat="server" BorderWidth="1" BorderColor="#dcdcdc" Width="1200px"></aspxform:XSignTrace>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
