<%@ 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">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <title>BPM Form</title> <style>
    BODY {FONT-SIZE: 12px; FONT-FAMILY: verdana;background-color: #e9f0f6;}
    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>
    <script type="text/javascript">
        agent.on('beforeSubmit', function (actname, actname1) {
            if (actname1 == "提交") {
                var tb = document.getElementById('tb1');
                //alert(tb.rows.length);
                var flag = 0;
                var name, account;
                for (var i = 3; i < tb.rows.length ; i++) {
                    //姓名、编号、年月
                    name = agent.Eles[tb.rows[i].cells[0].children[0].getAttribute("xform_xele_index")].getValue();
                    account = agent.Eles[tb.rows[i].cells[1].children[0].getAttribute("xform_xele_index")].getValue();
                    var ym = agent.Eles[tb.rows[i].cells[2].children[0].getAttribute("xform_xele_index")].getValue();
                    var result = 0;

                    //alert(name + account);

                    YZSoft.Ajax.request({
                        url: YZSoft.$url('Oimec/ApiServices/HRSalaryAPIHandler.ashx'),
                        method: 'POST',
                        async: false,
                        disableCaching: true,
                        params: {
                            method: 'SalaryFileRecord',
                            account: account,
                            ym: ym

                        },
                        success: function (response, opts) {
                            if (response.responseText) {
                                var rv = Ext.decode(response.responseText);
                                //alert(rv.Msg);                        
                                if (rv.success) {
                                    if (rv.Msg == '1') {
                                        result = 1;
                                    }
                                }
                            }
                        },
                        failure: function (action) {
                            alert(action.result.Msg);
                            return false;
                        }
                    });
                    if (result == 1) {
                        flag = result;
                        break;
                    }
                }

                if (flag == 1) {
                    if (confirm("系统里存在 " + name + "(" + account + ") 晚于起始年月的薪酬记录，是否继续？"))
                        return true;
                    else {
                        return false;
                    }
                }
            }
        })
    </script>
</head>
<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="--系统自动生成--" Value ValueToDisplayText ForeColor="White" BackColor="#8AB3DF" XDataBind="SWMDB:DF_F_BatchSF.FormNo"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td height="15" class="title1" colspan="4">
                        <asp:Label id="XLabel1" runat="server" value valuetodisplaytext text="用户信息"></asp:Label></td>
                </tr>
                <tr>
                    <td width="68" class="td">
                        <asp:Label id="XLabel15" runat="server" value valuetodisplaytext text="修改人"></asp:Label></td>
                    <td class="td1">
                        <aspxform:XTextBox id="XTextBox15" runat="server" ValueToDisplayText XDataBind="SWMDB:DF_F_BatchSF.ModifyUser" ReadOnly="True" backColor="#e6f1f8" CssClass="text" width="70%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="td">
                        &nbsp;<asp:Label id="XLabel8" runat="server" value valuetodisplaytext text="最后修改日期"></asp:Label> 
                    </td>
                    <td width="159" class="td1">
                        &nbsp;<aspxform:XDateTimePicker id="XDateTimePicker2" runat="server" XDataBind="SWMDB:DF_F_BatchSF.ModifyDate" BorderWidth="1" BorderColor="#DCDCDC" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                </tr>
            </tbody>
        </table>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td height="15" class="title1" colspan="4">
                        <asp:Label id="XLabel6" runat="server" value valuetodisplaytext text="调薪范围"></asp:Label></td>
                </tr>
                <tr>
                    <td width="298" height="23" class="td">
                        <asp:Label id="XLabel14" runat="server" value valuetodisplaytext text="起始年月"></asp:Label></td>
                    <td width="298" class="td1">
                        <aspxform:XTextBox id="XTextBox9" runat="server" ValueToDisplayText XDataBind="SWMDB:DF_F_BatchSF.StarYM" width="100px" BorderWidth="1" BorderColor="#DCDCDC" MaxLength="6"></aspxform:XTextBox>
                        <asp:Label id="Label1" runat="server" text="(6位数字，例如：201801)" forecolor="Blue"></asp:Label></td>
                    <td width="298" class="td">
                        <%--<asp:Label id="XLabel17" runat="server" text="截止时间" valuetodisplaytext value></asp:Label>--%></td>
                    <td width="298" class="td1">
                        <%--<aspxform:XTextBox id="XTextBox7" runat="server" XDataBind="SWMDB:DF_F_BatchSF.EndYM" BorderColor="#DCDCDC" BorderWidth="1" width="70%"></aspxform:XTextBox>--%></td>
                </tr>
            </tbody>
        </table>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <table width="1200" align="center" class="table" id="tb1" border="0" cellspacing="0" cellpadding="0" dynamicarea="3,1">
            <tbody>
                <tr>
                    <td height="14" class="title1" colspan="8">
                        <p>
                            <asp:Label id="XLabel3" runat="server" value valuetodisplaytext text="批量导入"></asp:Label>
                        </p>
                    </td>
                </tr>
                <tr>
                    <td width="128" height="22" class="td">
                        <asp:Label id="XLabel23" runat="server" value valuetodisplaytext text="模板时间"></asp:Label></td>
                    <td class="td1" colspan="4">
                        <aspxform:XDateTimePicker id="XDateTimePicker1" runat="server" XDataBind="SWMDB:DF_F_BatchSF.ModelDate" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XDateTimePicker>
                    </td>
                    <td width="132" class="td">
                        <aspxform:XHyperLink id="XHyperLink1" runat="server" BackColor="#d4e4fe" Target="_blank" NavigateUrl="~\Oimec\Salary\Template\批量调薪模板.xlsx">下载模板</aspxform:XHyperLink>
                    </td>
                    <td class="td1" colspan="3">
                        <aspxform:XExcelDataLoadButton id="XExcelDataLoadButton1" runat="server" text="上传数据" AppendMode="ClearAndAppend" DataMap="A->SWMDB:DF_F_BatchSF_Info.Name;B->SWMDB:DF_F_BatchSF_Info.Account;C->SWMDB:DF_F_BatchSF_Info.StarYM;D->SWMDB:DF_F_BatchSF_Info.MonthlyPay;E->SWMDB:DF_F_BatchSF_Info.PostSalary;F->SWMDB:DF_F_BatchSF_Info.PerSalary;G->SWMDB:DF_F_BatchSF_Info.Cash;H->SWMDB:DF_F_BatchSF_Info.Type" ColumnCount="8"></aspxform:XExcelDataLoadButton>
                    </td>
                </tr>
                <tr>
                    <td height="16" class="tds">
                        <asp:Label id="XLabel4" runat="server" value valuetodisplaytext text="姓名"></asp:Label></td>
                    <td class="tds">
                        <asp:Label id="XLabel5" runat="server" value valuetodisplaytext text="员工编码"></asp:Label></td>
                    <td class="tds">
                        <asp:Label id="XLabel7" runat="server" value valuetodisplaytext text="起始年月"></asp:Label></td>
                    <%-- <td class="tds">
                        <asp:Label id="XLabel13" runat="server" text="截止时间" valuetodisplaytext value></asp:Label></td>--%> 
                    <td class="tds">
                        <asp:Label id="XLabel18" runat="server" value valuetodisplaytext text="月薪总额"></asp:Label></td>
                    <td class="tds">
                        <asp:Label id="XLabel19" runat="server" value valuetodisplaytext text="月度岗位工资"></asp:Label></td>
                    <td class="tds">
                        <asp:Label id="XLabel20" runat="server" value valuetodisplaytext text="月度绩效工资"></asp:Label></td>
                    <td class="tds">
                        <asp:Label id="XLabel21" runat="server" value valuetodisplaytext text="现金部分"></asp:Label></td>
                    <td class="tds">
                        <asp:Label id="XLabel22" runat="server" value valuetodisplaytext text="佣金计算方式"></asp:Label></td>
                </tr>
                <tr>
                    <td height="14" class="tds1">
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.Name" width="99%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.Account" width="99%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox8" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.StarYM" width="99%" BorderWidth="1" BorderColor="#DCDCDC" Express="SWMDB:DF_F_BatchSF.StarYM"></aspxform:XTextBox>
                    </td>
                    <%-- <td class="tds1">
                        <aspxform:XTextBox id="XTextBox10" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.EndYM" width="99%" BorderWidth="1" BorderColor="#DCDCDC" Express="SWMDB:DF_F_BatchSF.EndYM"></aspxform:XTextBox>
                    </td>--%> 
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox3" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.MonthlyPay" width="99%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox4" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.PostSalary" width="99%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.PerSalary" width="99%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox6" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.Cash" width="99%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" XDataBind="SWMDB:DF_F_BatchSF_Info.Type" XDataSource="DataSource:SWMDB;TableName:DF_SWM_YJ_Type" DisplayColumn="Type" ValueColumn="Type" Width="100%">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td width="1200" class="title1">
                        <asp:Label id="XLabel76" runat="server" text="备注"></asp:Label></td>
                </tr>
                <tr>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox67" runat="server" XDataBind="SWMDB:DF_F_BatchSF.Remrak" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" Width="100%" TextMode="MultiLine" Height="70px"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td width="800">
                        <p>
                            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ControlToValidate="XTextBox8" ErrorMessage="起始时间不能为空"></aspxform:XRequiredFieldValidator>
                            <%--<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" runat="server" ErrorMessage="截止时间不能为空" ControlToValidate="XTextBox10"></aspxform:XRequiredFieldValidator>--%>
                            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" runat="server" ControlToValidate="XDropDownList1" ErrorMessage="请选择佣金计算方式"></aspxform:XRequiredFieldValidator>
                            <aspxform:XCompareValidator id="XCompareValidator1" runat="server" Type="Double" ControlToValidate="XTextBox3" ErrorMessage="月度岗位工资+月度绩效工资和现金的总和必须等于月薪总额。" ValueToCompareExpress="SWMDB:DF_F_BatchSF_Info.PostSalary+SWMDB:DF_F_BatchSF_Info.PerSalary+SWMDB:DF_F_BatchSF_Info.Cash">月薪总额验证</aspxform:XCompareValidator>
                            &nbsp;<aspxform:XRegularExpressionValidator id="XRegularExpressionValidator1" runat="server" ControlToValidate="XTextBox9" ErrorMessage="输入年月格式不正确" Display="None" ValidationExpression="\d{4}((0([1-9]))|(1(0|1|2)))">输入年月格式不正确</aspxform:XRegularExpressionValidator>
                        </p>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <p align="center">
            <aspxform:XSignTrace id="XSignTrace1" runat="server" BorderWidth="1" BorderColor="#dcdcdc" Width="1200px"></aspxform:XSignTrace>
        </p>
        <!-- Insert content here -->
    </form>
</body>
</html>
