<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
     {
        this.XTextBox9.Text = DateTime.Now.Year.ToString();
        this.XTextBox10.Text = (DateTime.Now.Year-1).ToString();
    
        DateTime dt=DateTime.Now;
        this.XDateTimePicker4.Text = dt.AddYears(1).AddMonths(-dt.Month + 03).AddDays(-dt.Day+01).ToString("yyyy-MM-dd");
     }

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="Stylesheet" type="text/css" />
    <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}
    </style>
</head>
<script type="text/javascript">

    //金额默认为0
    function txtFocus(el) {
        if (el.defaultValue == el.value) { el.value = ''; el.style.color = '#000'; }
    }

    function txtBlur(el) {
        if (el.value == '') { el.value = el.defaultValue; el.style.color = '#666'; }
    }



    //获取员工可用年假
    function NJTS(account) {

        YZSoft.Ajax.request({
            url: YZSoft.$url('Oimec/ApiServices/HRAPIHandler.ashx'),
            method: 'POST',
            params: {
                method: 'GetAnnualLeave',
                account: account
            },
            success: function (action) {
                var result = action.result;
                agent.Eles[document.getElementById("XTextBox18").getAttribute("xform_xele_index")].setValue(result.Value);
            },
            failure: function (action) {
               alert(action.result.Message);

            }
        });
    }


</script>
<body>
    <form runat="server">
        <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="XLabel2" runat="server" value valuetodisplaytext text="积分使用申请表"></asp:Label></td>
                    <td class="formno">
                        <asp:Label id="XLabel93" runat="server" value valuetodisplaytext text="表单号："></asp:Label>
                        <aspxform:XLabel id="XLabel94" runat="server" text="--系统自动生成--" BackColor="#8AB3DF" XDataBind="DF_HR_USINGINTEGRAL.FormNo" Value ValueToDisplayText></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <aspxform:XDropDownList id="XDropDownList5" runat="server" XDataBind="varD1" HiddenExpress="1" Height="22px" XDataSource="ProcedureName:proc_DF_OA_GetNJDays;Filter:@BpmAccount->DF_HR_USINGINTEGRAL.AppAcount,@Date->varInductionDate" DisplayColumn="enableDays" ValueColumn="enableDays"></aspxform:XDropDownList>
        <aspxform:XDateTimePicker id="XDateTimePicker2" runat="server" XDataBind="varInductionDate" HiddenExpress="1" Height="22px" Type="TimeMinutes" BorderColor="#DCDCDC" BorderWidth="1" Width="200px"></aspxform:XDateTimePicker>
        <aspxform:XTextBox id="XTextBox23" runat="server" XDataBind="varAccount" ValueToDisplayText="TableName:DF_HR_EMPLOYEEINFORMATION_INFO;FilterColumn:AttendanceKakaNO;DisplayColumn:AttendanceKakaNO" HiddenExpress="1" Height="22px" BorderColor="#DCDCDC" BorderWidth="1" DataMap="InductionDate->varInductionDate" Express="DF_HR_USINGINTEGRAL.AppAcount"></aspxform:XTextBox>
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel1" runat="server" value valuetodisplaytext text="姓名 "></asp:Label>
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="DF_HR_USINGINTEGRAL.AppName" BorderColor="#DCDCDC" BorderWidth="1" CssClass="text" backColor="#e6f1f8" HiddenInput="True" width="20px"></aspxform:XTextBox>
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" HiddenExpress="1" XDataSource="TableName:DF_HR_PRIZEPUNISH_Integral;Filter:years->dangnian;BufferType:RuntimeUpdate" DisplayColumn="EmployeeAccount" ValueColumn="EmployeeAccount" DataMap="Integral->DF_HR_USINGINTEGRAL.WhenAvailableIntegral" Express="DF_HR_USINGINTEGRAL.AppAcount">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox9" runat="server" XDataBind="dangnian" BorderColor="#DCDCDC" BorderWidth="1" HiddenInput="True"></aspxform:XTextBox>
                        <aspxform:XDropDownList id="XDropDownList3" runat="server" HiddenExpress="1" XDataSource="TableName:DF_HR_PRIZEPUNISH_Integral;Filter:years->shangnian;BufferType:RuntimeUpdate" DisplayColumn="EmployeeAccount" ValueColumn="EmployeeAccount" DataMap="Integral->DF_HR_USINGINTEGRAL.UPAvailableIntegral" Express="DF_HR_USINGINTEGRAL.AppAcount">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox10" runat="server" XDataBind="shangnian" BorderColor="#DCDCDC" BorderWidth="1" HiddenInput="True"></aspxform:XTextBox>
                    </td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="DF_HR_USINGINTEGRAL.AppAcount" ValueToDisplayText="TableName:V_DF_HR_BasicInfo;FilterColumn:AttendanceKakaNO;DisplayColumn:Name" BorderColor="#DCDCDC" BorderWidth="1" DataMap="Department->DF_HR_USINGINTEGRAL.Department" CssClass="text" backColor="#e6f1f8" width="50%"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel3" runat="server" value valuetodisplaytext text="部门"></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="DF_HR_USINGINTEGRAL.Department" BorderColor="#DCDCDC" BorderWidth="1" CssClass="text" backColor="#e6f1f8" width="50%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel11" runat="server" value valuetodisplaytext text="上年可用积分" width="90px"></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox3" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.UPAvailableIntegral" BorderColor="#DCDCDC" BorderWidth="1" width="50%" ReadOnly="True">0</aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox14" runat="server" BorderColor="#DCDCDC" BorderWidth="1" Express="DF_HR_USINGINTEGRAL.UPAvailableIntegral" HiddenInput="True" width="50%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel4" runat="server" value valuetodisplaytext text="使用上年积分" width="90px"></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox6" onfocus="txtFocus(this)" onblur="txtBlur(this)" runat="server" XDataBind="DF_HR_USINGINTEGRAL.UseUpIntegral" BorderColor="#DCDCDC" BorderWidth="1" width="50%" Format="type:number;.0" DisableExpress="DF_HR_USINGINTEGRAL.UPAvailableIntegral=='' ||DF_HR_USINGINTEGRAL.UPAvailableIntegral==0" ValidationGroup="1">0</aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox15" onfocus="txtFocus(this)" onblur="txtBlur(this)" runat="server" BorderColor="#DCDCDC" BorderWidth="1" Express="DF_HR_USINGINTEGRAL.UseUpIntegral" HiddenInput="True" width="50%" ValidationGroup="1">0</aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel12" runat="server" value valuetodisplaytext text="当年可用积分" width="85px"></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox8" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.WhenAvailableIntegral" BorderColor="#DCDCDC" BorderWidth="1" width="50%" ReadOnly="True">0</aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox17" runat="server" BorderColor="#DCDCDC" BorderWidth="1" Express="DF_HR_USINGINTEGRAL.UPAvailableIntegral+DF_HR_USINGINTEGRAL.WhenAvailableIntegral" HiddenInput="True" width="50%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel7" runat="server" value valuetodisplaytext text="使用当年积分" width="85px"></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox4" onfocus="txtFocus(this)" onblur="txtBlur(this)" runat="server" XDataBind="DF_HR_USINGINTEGRAL.UseWhenIntegral" BorderColor="#DCDCDC" BorderWidth="1" width="50%" DisableExpress="DF_HR_USINGINTEGRAL.WhenAvailableIntegral==0||DF_HR_USINGINTEGRAL.WhenAvailableIntegral==''">0</aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td">
                        <asp:Label id="XLabel5" runat="server" value valuetodisplaytext text="类型"></asp:Label>
                        <aspxform:XTextBox id="XTextBox19" runat="server" XDataBind="jifenshiyongleixing" BorderColor="#DCDCDC" BorderWidth="1" HiddenInput="True" width="20px">jifenshiyongleixing</aspxform:XTextBox>
                    </td>
                    <td class="td1">
                        <aspxform:XDropDownList id="XDropDownList2" runat="server" XDataBind="DF_HR_USINGINTEGRAL.Type" XDataSource="TableName:DF_HR_DataSourceList;Filter:Type->jifenshiyongleixing" DisplayColumn="Name" ValueColumn="ItemID" Width="50%" DataMap="value->DF_HR_USINGINTEGRAL.TypeValue" PromptText="---请选择---">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox11" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.TypeValue" BorderColor="#DCDCDC" BorderWidth="1" HiddenInput="True" width="50%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="td">
                        <asp:Label id="XLabel9" runat="server" value valuetodisplaytext text="累加积分" width="85px"></asp:Label>
                        <aspxform:XTextBox id="XTextBox20" runat="server" XDataBind="varInit" ValueToDisplayText BorderColor="Gainsboro" BorderWidth="1px" Width="57px" Max="0" Min="0" HiddenInput="True">0</aspxform:XTextBox>
                    </td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox12" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.AccumulativeIntegral" BorderColor="#DCDCDC" BorderWidth="1" Express="DF_HR_USINGINTEGRAL.UseUpIntegral+DF_HR_USINGINTEGRAL.UseWhenIntegral" width="50%" ReadOnly="True"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox21" runat="server" XDataBind="varSum" BorderColor="#DCDCDC" BorderWidth="1" Express="DF_HR_USINGINTEGRAL.AccumulativeIntegral" HiddenInput="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td">
                        <asp:Label id="XLabel8" runat="server" value valuetodisplaytext text="申请日期"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XDateTimePicker id="XDateTimePicker1" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.AppDate" BorderColor="#DCDCDC" BorderWidth="1" Width="50%" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                    <td class="td">
                        <asp:Label id="XLabel6" runat="server" value valuetodisplaytext text="剩余积分" width="85px"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox7" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.RemainingIntegral" BorderColor="#DCDCDC" BorderWidth="1" Express="(DF_HR_USINGINTEGRAL.UPAvailableIntegral-DF_HR_USINGINTEGRAL.UseUpIntegral)+(DF_HR_USINGINTEGRAL.WhenAvailableIntegral-DF_HR_USINGINTEGRAL.UseWhenIntegral)" width="50%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr hiddenexpress="DF_HR_USINGINTEGRAL.Type=='58'|| DF_HR_USINGINTEGRAL.Type==''">
                    <td class="td">
                        <asp:Label id="XLabel13" runat="server" value valuetodisplaytext text="所要兑换年假天数" width="138px"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox13" runat="server" XDataBind="DF_HR_USINGINTEGRAL.DaysNumber" BorderColor="#DCDCDC" BorderWidth="1" width="50%"></aspxform:XTextBox>
                    </td>
                    <td class="td">
                        <asp:Label id="XLabel10" runat="server" value valuetodisplaytext text="可用年假" width="85px"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox18" runat="server" BackColor="#E6F1F8" BorderColor="#DCDCDC" BorderWidth="1" Express="javascript('NJTS',DF_HR_USINGINTEGRAL.AppAcount)" width="50%" ReadOnly="True">0</aspxform:XTextBox>
                    </td>
                </tr>
                <tr hiddenexpress="DF_HR_USINGINTEGRAL.Type=='58'|| DF_HR_USINGINTEGRAL.Type==''">
                    <td class="td">
                        <asp:Label id="XLabel91" runat="server" value valuetodisplaytext text="年假有效期"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XDateTimePicker id="XDateTimePicker4" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.PeriodValidity" BorderColor="#DCDCDC" BorderWidth="1" Width="50%" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                    <td class="td">
                        <asp:Label id="XLabel19" runat="server" value valuetodisplaytext text="兑换年假所需积分" width="139px"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox16" runat="server" BackColor="#E6F1F8" XDataBind="DF_HR_USINGINTEGRAL.TotalScore" BorderColor="#DCDCDC" BorderWidth="1" Express="DF_HR_USINGINTEGRAL.DaysNumber*DF_HR_USINGINTEGRAL.TypeValue" width="50%" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" border="0" cellspacing="0" cellpadding="0" hiddenexpress="DF_HR_USINGINTEGRAL.Type=='57'|| DF_HR_USINGINTEGRAL.Type==''">
            <tbody>
                <tr>
                    <td width="1200">
                        兑换说明如下：<br />
                        1、&nbsp; 每1个积分对应的实际税前金额为10元。<br />
                        2、&nbsp;员工可于6月1日至6月30日期间、12月1日至12月31日期间分别进行2次兑换，兑换的奖金金额（税前）将并入6月份工资或12月份工资中发放，合并计税。 
                    </td>
                </tr>
            </tbody>
        </table>
        <table width="1200" align="center" border="0" cellspacing="0" cellpadding="0" hiddenexpress="DF_HR_USINGINTEGRAL.Type=='58'|| DF_HR_USINGINTEGRAL.Type==''">
            <tbody>
                <tr>
                    <td width="1200">
                        兑换说明如下：<br />
                        1、&nbsp; 年假15个积分兑换一天<br />
                        2、&nbsp;当年累计兑换年假天数不得超过本人常规年假 
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="19" colspan="2">
                        <asp:Label id="XLabel50" runat="server" value valuetodisplaytext text="注：如有上年可用积分，剩余积分先使用上年积分" font-size="11pt" font-bold="True"></asp:Label></td>
                </tr>
            </tbody>
        </table>
        <p align="center">
            <aspxform:XSignTrace id="XSignTrace1" runat="server" BorderColor="#dcdcdc" BorderWidth="1" Width="1200px"></aspxform:XSignTrace>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            <aspxform:XRangeValidator id="XRangeValidator1" runat="server" Type="Double" DisableExpress="DF_HR_USINGINTEGRAL.Type=='58'||DF_HR_USINGINTEGRAL.Type==''" ValidationGroup="app" ErrorMessage="您还有年假未使用，不能用积分兑换" ControlToValidate="XTextBox18" MaxValueExpress="0"></aspxform:XRangeValidator>
            &nbsp;&nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ValidationGroup="app" ErrorMessage="请填写类型" ControlToValidate="XDropDownList2"></aspxform:XRequiredFieldValidator>
            &nbsp;&nbsp;&nbsp;&nbsp;<aspxform:XCompareValidator id="XCompareValidator4" runat="server" Type="Integer" ValidationGroup="app" ErrorMessage="你所填的使用积分超过了去年可用积分，请重新填写使用积分" ControlToValidate="XTextBox6" ControlToCompare="XTextBox3" Operator="LessThanEqual"></aspxform:XCompareValidator>
            &nbsp;&nbsp;&nbsp;&nbsp;<aspxform:XCompareValidator id="XCompareValidator5" runat="server" Type="Integer" ValidationGroup="app" ErrorMessage="你所填的使用积分超过了当年可用积分，请重新填写使用积分" ControlToValidate="XTextBox4" ControlToCompare="XTextBox8" Operator="LessThanEqual"></aspxform:XCompareValidator>
            &nbsp;&nbsp;&nbsp;&nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" runat="server" DisableExpress="DF_HR_USINGINTEGRAL.Type=='58'||DF_HR_USINGINTEGRAL.Type==''" ValidationGroup="app" ErrorMessage="请填写积分所要兑换年假天数" ControlToValidate="XTextBox13"></aspxform:XRequiredFieldValidator>
            &nbsp;&nbsp;&nbsp;&nbsp;<aspxform:XCompareValidator id="XCompareValidator3" runat="server" Type="Integer" ValidationGroup="app" ErrorMessage="请填写使用积分分数" ControlToValidate="XTextBox21" ControlToCompare="XTextBox20" Operator="GreaterThan"></aspxform:XCompareValidator>
            &nbsp;&nbsp;&nbsp;&nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator4" runat="server" DisableExpress="DF_HR_USINGINTEGRAL.Type=='58'||DF_HR_USINGINTEGRAL.Type==''" ValidationGroup="app" ErrorMessage="请填写年假有效期" ControlToValidate="XDateTimePicker4"></aspxform:XRequiredFieldValidator>
            &nbsp;&nbsp;&nbsp; 
            <aspxform:XCompareValidator id="XCompareValidator2" runat="server" Type="Integer" DisableExpress="DF_HR_USINGINTEGRAL.UPAvailableIntegral==0||DF_HR_USINGINTEGRAL.UPAvailableIntegral==''" ValidationGroup="app" ErrorMessage="有未使用的上年积分，请确认" ControlToValidate="XTextBox14" ControlToCompare="XTextBox6" Operator="GreaterThanEqual"></aspxform:XCompareValidator>
            &nbsp;&nbsp; 
            <aspxform:XCompareValidator id="XCompareValidator1" runat="server" Type="Integer" DisableExpress="DF_HR_USINGINTEGRAL.Type=='58'||DF_HR_USINGINTEGRAL.Type==''" ValidationGroup="app" ErrorMessage="兑换年假所需积分与累加积分不一致请重新填写使用积分 " ControlToValidate="XTextBox12" ControlToCompare="XTextBox16"></aspxform:XCompareValidator>
            <aspxform:XCompareValidator id="XCompareValidator6" runat="server" Type="Double" DisableExpress="DF_HR_USINGINTEGRAL.Type=='58'||DF_HR_USINGINTEGRAL.Type==''" ValidationGroup="app" ErrorMessage="当年累计兑换年假天数比常规年假数据多，请重新填写" ControlToValidate="XTextBox13" ControlToCompare="XDropDownList5" Operator="LessThanEqual"></aspxform:XCompareValidator>
        </p>
    </form>
</body>
</html>
