<%@ 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" />
    <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-textbox{display:inline;}
    </style>
    <script type="text/javascript">

        //出差总天数
        function GetLeaveTotalDay(dateFrom, StartTime, dateTo, EndTime) {

            if (dateFrom != "" && dateTo != ""&& StartTime!=""&& EndTime!="") {
                var dateFrom = dateFrom.replace(/\-/g, "/");
                var dateTo = dateTo.replace(/\-/g, "/");
                var StarD = new Date(dateFrom);
                var EndD = new Date(dateTo);
                YZSoft.Ajax.request({
                    url: YZSoft.$url('Oimec/ApiServices/HRAPIHandler.ashx'),
                    method: 'POST',
                    params: { method: 'GetLeaveDate', StarD: dateFrom, EndD: dateTo, StartT: StartTime, EndT: EndTime, Type:35 },
                    success: function (action) {
                        var result = action.result;
                        var a = agent.Eles[document.getElementById("XTextBox4").getAttribute("xform_xele_index")];
                        a.setValue(result.Value);
                    },
                    failure: function (action) {
                        alert(action.result.Message);
                    }
                });
            }
        }

        agent.on('beforeSubmit', function (actname1,actname) {
            if (actname == "提交")
            {
                //出差时间 起止为同一天时，判断上下午时间
                var startDate = agent.Eles[document.getElementById("XDateTimePicker2").getAttribute("xform_xele_index")].getValue();
                var endDate = agent.Eles[document.getElementById("XDateTimePicker3").getAttribute("xform_xele_index")].getValue();
                var startTime = agent.Eles[document.getElementById("XDropDownList2").getAttribute("xform_xele_index")].getValue();
                var endTime = agent.Eles[document.getElementById("XDropDownList3").getAttribute("xform_xele_index")].getValue();

                if (startDate == endDate) {
                    if (endTime == "上午" && startTime == "下午") {
                        alert("请核对出差时间“起止时间”！");
                        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" text="出差申请单" valuetodisplaytext value></asp:Label></td>
                    <td class="formno">
                        <asp:Label id="XLabel93" runat="server" text="表单号：" valuetodisplaytext value></asp:Label>
                        <aspxform:XLabel id="XLabel94" runat="server" text="--系统自动生成--" ValueToDisplayText Value XDataBind="DF_HR_BUSINESSTRIPAPP.FormNo" BackColor="#8AB3DF"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td height="27" class="title1" colspan="4">
                        <asp:Label id="XLabel1" runat="server" text="个人信息  " valuetodisplaytext value></asp:Label>
                        <aspxform:XTextBox id="XTextBox8" runat="server" ValueToDisplayText Value XDataBind="DF_HR_BUSINESSTRIPAPP.KQUserID" HiddenInput="True" Width="84px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox13" runat="server" ValueToDisplayText Value XDataBind="var123" HiddenInput="True" Width="33px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel3" runat="server" text="姓名" valuetodisplaytext value></asp:Label>
                        <aspxform:XTextBox id="XTextBox7" runat="server" ValueToDisplayText="TableName:DF_HR_EMPLOYEEINFORMATION_INFO;FilterColumn:AttendanceKakaNO;DisplayColumn:AttendanceKakaNO" Value HiddenInput="True" Width="28px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" DataMap="Shift->var133;KQUserID->DF_HR_BUSINESSTRIPAPP.KQUserID" Express="DF_HR_BUSINESSTRIPAPP.AppName"></aspxform:XTextBox>
                    </td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox2" runat="server" ValueToDisplayText="TableName:V_DF_HR_BasicInfo;FilterColumn:AttendanceKakaNO;DisplayColumn:Name" XDataBind="DF_HR_BUSINESSTRIPAPP.AppName" BorderColor="#DCDCDC" BorderWidth="1" DataMap="BUID->var123;Department->DF_HR_BUSINESSTRIPAPP.AppDepartment;PostName->DF_HR_BUSINESSTRIPAPP.AppJobs;Region->DF_HR_BUSINESSTRIPAPP.AppRegion" ReadOnly="True" width="60%" CssClass="text" backColor="#e6f1f8"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel5" runat="server" text="部门" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.AppDepartment" BorderColor="#DCDCDC" BorderWidth="1" ReadOnly="True" width="70%" CssClass="text" backColor="#e6f1f8"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel14" runat="server" text="BU" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox12" runat="server" ValueToDisplayText="TableName:DF_HR_OrgBU;FilterColumn:BUID;DisplayColumn:BUName" XDataBind="DF_HR_BUSINESSTRIPAPP.AppBU" BorderColor="#DCDCDC" BorderWidth="1" Express="var123" width="60%" CssClass="text" backColor="#e6f1f8"></aspxform:XTextBox>
                    </td>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel4" runat="server" text="地区" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox3" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.AppRegion" BorderColor="#DCDCDC" BorderWidth="1" ReadOnly="True" width="70%" CssClass="text" backColor="#e6f1f8"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel6" runat="server" text="岗位" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox6" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.AppJobs" BorderColor="#DCDCDC" BorderWidth="1" ReadOnly="True" width="60%" CssClass="text" backColor="#e6f1f8"></aspxform:XTextBox>
                    </td>
                    <td class="td">
                    </td>
                    <td class="td1">
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table">
            <tbody>
                <tr>
                    <td height="20" class="title1" colspan="2">
                        <asp:Label id="XLabel7" runat="server" text="出差明细" valuetodisplaytext value></asp:Label>
                        <aspxform:XDropDownList id="XDropDownList5" runat="server" XDataBind="var133" DataMap="Name->v1;StartDate->v2;EndDate->v3" HiddenExpress="1" ValueColumn="ItemID" DisplayColumn="ItemID" XDataSource="TableName:V_DF_HR_SHIFT;BufferType:RuntimeUpdate">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel38" runat="server" text="班次" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 80%">
                        <aspxform:XTextBox id="XTextBox24" runat="server" ValueToDisplayText Value XDataBind="v1" HiddenInput="False" Width="36px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" ReadOnly="True" TextAlign="Center"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox25" runat="server" ValueToDisplayText Value XDataBind="v2" HiddenInput="False" Width="96px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" ReadOnly="True"></aspxform:XTextBox>
                        <asp:Label id="XLabel39" runat="server" text="到" valuetodisplaytext value></asp:Label>
                        <aspxform:XTextBox id="XTextBox26" runat="server" ValueToDisplayText Value XDataBind="v3" HiddenInput="False" Width="96px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="96" class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel8" runat="server" text="出差事由" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 80%">
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.TravelReason" BorderColor="#DCDCDC" BorderWidth="1" width="100%" TextMode="MultiLine" Rows="6"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td" style="WIDTH: 10%">
                        <asp:Label id="XLabel9" runat="server" text="出差时间" valuetodisplaytext value></asp:Label></td>
                    <td class="td1" style="WIDTH: 80%">
                        <asp:Label id="XLabel10" runat="server" text="起:" valuetodisplaytext value font-names="微软雅黑"></asp:Label>
                        <aspxform:XDateTimePicker id="XDateTimePicker2" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveStart" Width="112px" BorderColor="Gainsboro" BorderWidth="1px"></aspxform:XDateTimePicker>
                        <aspxform:XDropDownList id="XDropDownList2" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveStartTime">
                            <asp:ListItem>上午</asp:ListItem>
                            <asp:ListItem>下午</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox9" runat="server" ValueToDisplayText Value XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveStartTS" HiddenInput="False" Width="60px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" Express="if(DF_HR_BUSINESSTRIPAPP.LeaveStartTime=='上午',v2,'13:00')" ReadOnly="True"></aspxform:XTextBox>
                        <asp:Label id="XLabel11" runat="server" text=";" valuetodisplaytext value width="10px" font-names="微软雅黑"></asp:Label><asp:Label id="XLabel12" runat="server" text="止:" valuetodisplaytext value font-names="微软雅黑"></asp:Label>
                        <aspxform:XDateTimePicker id="XDateTimePicker3" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveEnd" Width="139px" BorderColor="Gainsboro" BorderWidth="1px" Height="24px"></aspxform:XDateTimePicker>
                        <aspxform:XDropDownList id="XDropDownList3" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveEndTime">
                            <asp:ListItem>上午</asp:ListItem>
                            <asp:ListItem>下午</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox10" runat="server" ValueToDisplayText Value XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveEndTS" HiddenInput="False" Width="60px" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" Express="if(DF_HR_BUSINESSTRIPAPP.LeaveEndTime=='上午','12:00',v3)" ReadOnly="True"></aspxform:XTextBox>
                        <asp:Label id="XLabel21" runat="server" text=";" valuetodisplaytext value width="10px" font-names="微软雅黑"></asp:Label><asp:Label id="XLabel22" runat="server" text="共:" valuetodisplaytext value font-names="微软雅黑"></asp:Label>
                        <aspxform:XTextBox id="XTextBox4" runat="server" ValueToDisplayText Value XDataBind="DF_HR_BUSINESSTRIPAPP.LeaveTime" HiddenInput="False" Min="0" Max="0" BorderColor="Gainsboro" BorderWidth="1px" Express="javascript('GetLeaveTotalDay',DF_HR_BUSINESSTRIPAPP.LeaveStart,DF_HR_BUSINESSTRIPAPP.LeaveStartTime,DF_HR_BUSINESSTRIPAPP.LeaveEnd,DF_HR_BUSINESSTRIPAPP.LeaveEndTime)" ReadOnly="True" width="165px"></aspxform:XTextBox>
                        <asp:Label id="XLabel23" runat="server" text="天" valuetodisplaytext value font-names="微软雅黑"></asp:Label></td>
                </tr>
                <tr>
                    <td class="td">
                        <asp:Label id="XLabel13" runat="server" text="是否自动销假" valuetodisplaytext value></asp:Label></td>
                    <td class="td1">
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" XDataBind="DF_HR_BUSINESSTRIPAPP.IsClean" Width="58px" XDataSource DisableExpress="1">
                            <asp:ListItem Value="1">是</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <p align="center">
            <aspxform:XSignTrace id="XSignTrace1" runat="server" Width="1200px" BorderColor="#dcdcdc" BorderWidth="1"></aspxform:XSignTrace>
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ErrorMessage="请填写出差事由" ControlToValidate="XTextBox1"></aspxform:XRequiredFieldValidator>
            &nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" runat="server" ErrorMessage="请填写出差时间开始日期" ControlToValidate="XDateTimePicker2"></aspxform:XRequiredFieldValidator>
            &nbsp; 
            <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" runat="server" ErrorMessage="请填写出差时间结束日期" ControlToValidate="XDateTimePicker3"></aspxform:XRequiredFieldValidator>
            &nbsp; 
            <aspxform:XCompareValidator id="XCompareValidator1" runat="server" ErrorMessage="结束时间必须大于开始时间" ControlToValidate="XDateTimePicker3" Display="None" ControlToCompare="XDateTimePicker2" Operator="GreaterThanEqual">结束时间必须大于开始时间</aspxform:XCompareValidator>
        </p>
    </form>
</body>
</html>
