<%@ 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)
    {
        if (!IsPostBack)
        { //首次加载
    
            string bidId = Request.QueryString["bid"];
            if (bidId != null)
            {
    
                this.BidID.Text = bidId;
                //  this.FileType.Text = "3";
                //this.FileType.SelectedIndex = 2;
                //  this.FileType.SelectedValue = "3";
                this.biditemid.Text = "3";
    
            }
            else {
                this.FileType.Express = "";
            }
        }
    }

</script>
<html xmlns:XForm="xmlns:xform">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
     <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:1px}
    TD.NoPadding {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}
    /*INPUT {height: 15px}*/
    INPUT.UL {BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: #33ff33 1px solid}
    TEXTAREA {FONT-SIZE:12px}
    input {vertical-align:middle;/*margin-right:-3px*/}
    </style>
    <script>
        //首次进入
        Ext.onReady(function () {
            var bidid = getQueryString("bid");
            if (bidid != null && bidid != "") {
               // agent.Eles[document.getElementById("FileType").getAttribute("xform_xele_index")].setValue("3");
            }
        })
        agent.on('beforeSubmit', function () {
            
            var usageType = agent.Eles[document.getElementById("UsageType").getAttribute("xform_xele_index")].getValue();//用印方式
            if (usageType=="") {
                Ext.MessageBox.alert('提示', '请您选择用印方式');
                return false;
            }
            if (usageType == "1" || usageType == "2" || usageType == "3" ||  usageType == "6") {
                
                var FileName = agent.Eles[document.getElementById("FileName").getAttribute("xform_xele_index")].getValue();//文件名称
                var FileType = agent.Eles[document.getElementById("FileType").getAttribute("xform_xele_index")].getValue();//文件类别
                var FileToCompany = agent.Eles[document.getElementById("FileToCompany").getAttribute("xform_xele_index")].getValue();//发往单位
                var BidLabel = agent.Eles[document.getElementById("BidLabel").getAttribute("xform_xele_index")].getValue();//招标号
                var Attachement = agent.Eles[document.getElementById("Attachement").getAttribute("xform_xele_index")].getValue();//附件
                if (FileName=="") {
                    Ext.MessageBox.alert('提示', '请输入文件名称');
                    return false;
                }
                if (FileType == "") {
                    Ext.MessageBox.alert('提示', '请选择文件类别');
                    return false;
                }
                if (FileToCompany == "") {
                    Ext.MessageBox.alert('提示', '请输入文件发往单位');
                    return false;
                }
                if (Attachement == "") {
                    Ext.MessageBox.alert('提示', '请选择文件附件');
                    return false;
                }

                if (FileType == "3") {

                    if (BidLabel.trim() =="") {
                        Ext.MessageBox.alert('提示', '请输入招投标号');
                        return false;
                    }
                
                }
                
            }

            if (usageType == "4" || usageType == "5") {

                var BorrowingInstructions = agent.Eles[document.getElementById("BorrowingInstructions").getAttribute("xform_xele_index")].getValue();//用印说明
                if (BorrowingInstructions=="") {
                    Ext.MessageBox.alert('提示', '请输入借印说明');
                    return false;
                }
            
            }

        });

        //获取网址参数
        function  getQueryString (name){
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;

        }
    </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="Label1" runat="server" text="公章使用申请单"></asp:Label></td>
                    <td class="formno">
                        <asp:Label id="Label2" runat="server" text="表单号："></asp:Label>
                        <aspxform:XLabel id="XLabel1" runat="server" Text="--系统自动生成--" XDataBind="DF_HR_SealApplication.FormNo" BackColor="#8AB3DF"></aspxform:XLabel>
                        <aspxform:XTextBox id="BidID" runat="server" XDataBind="DF_HR_SealApplication.BidID" HiddenInput="true"></aspxform:XTextBox>
                        <aspxform:XTextBox id="biditemid" runat="server" XDataBind="biditemid" HiddenInput="true"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%" colspan="3">
                        <asp:Label id="Label20" runat="server" text="标记*为申请人必填项" forecolor="Red"></asp:Label></td>
                </tr>
                <tr>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label4" runat="server" text="创建用户"></asp:Label>
                        <aspxform:XTextBox id="XTextBox24" runat="server" XDataBind="DF_HR_SealApplication.CreateAccount" Width="20px" ValueToDisplayText BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox1" runat="server" XDataBind="DF_HR_SealApplication.CreateName" BackColor="#E6F1F8" DisableBehavior="ReadOnly" Width="70%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label11" runat="server" text="创建日期"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XDateTimePicker id="XDateTimePicker1" runat="server" XDataBind="DF_HR_SealApplication.CreateDate" BackColor="#E6F1F8" Width="70%" BorderWidth="1" BorderColor="#DCDCDC" DisplayOnly="True"></aspxform:XDateTimePicker>
                    </td>
                </tr>
                <tr>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label22" runat="server" text="申请人"></asp:Label>
                        <aspxform:XTextBox id="XTextBox3" runat="server" XDataBind="DF_HR_SealApplication.AppAccount" Width="20px" ValueToDisplayText="TableName:V_DF_HR_BasicInfo;FilterColumn:AttendanceKakaNO;DisplayColumn:AttendanceKakaNO" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1" DataMap="Department->DF_HR_SealApplication.AppDepartment"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox32" runat="server" XDataBind="DF_HR_SealApplication.AppName" BackColor="#E6F1F8" DisableBehavior="ReadOnly" Width="70%" BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True" Express="DF_HR_SealApplication.CreateName"></aspxform:XTextBox>
                        <aspxform:XDataBrowserButton id="XDataBrowserButton9" runat="server" Text="查询" XClass="YZSoft.Forms.Field.DataBrowserButton" Width="40px" DataMap="AttendanceKakaNO->DF_HR_SealApplication.AppAccount;Department->DF_HR_SealApplication.AppDepartment;Name->DF_HR_SealApplication.AppName" UseSubmitBehavior="False" PrintOut="False" Height="22px" DisableExpress="Global.StepName!='公章使用申请'" XDataSource="TableName:V_DF_HR_BasicInfo;Filter:State->'在职'" PopupWndWidth="-1" PopupWndHeight="-1" DisplayColumns="Account:账号;Name:姓名"></aspxform:XDataBrowserButton>
                    </td>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label5" runat="server" text="申请人部门"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="DF_HR_SealApplication.AppDepartment" BackColor="#E6F1F8" DisableBehavior="ReadOnly" Width="70%" ValueToDisplayText BorderWidth="1" BorderColor="#DCDCDC" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label13" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label3" runat="server" text="用印方式"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <%-- <aspxform:XRadioButtonList id="XRadioButtonList1" runat="server" XDataBind="DF_HR_SealApplication.UsageType" RepeatDirection="Horizontal">
                            <asp:ListItem>用印</asp:ListItem>
                            <asp:ListItem>借印</asp:ListItem>
                        </aspxform:XRadioButtonList>--%>
                        <aspxform:XDropDownList id="UsageType" runat="server" XDataBind="DF_HR_SealApplication.UsageType" Width="30%" PromptText="--请选择--">
                            <asp:ListItem Value="1">盖公章</asp:ListItem>
                            <asp:ListItem Value="2">盖公章(含法人章)</asp:ListItem>
                            <asp:ListItem Value="3">盖法人章</asp:ListItem>
                            <asp:ListItem Value="4">借公章</asp:ListItem>
                            <asp:ListItem Value="5">借法人章</asp:ListItem>
							 <asp:ListItem Value="6">盖财务专用章</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                    <%-- <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label6" runat="server" text="印章类别"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XCheckBoxList id="XCheckBoxList1" runat="server" XDataBind="DF_HR_SealApplication.SealType" RepeatDirection="Horizontal">
                            <asp:ListItem>公章</asp:ListItem>
                            <asp:ListItem>法人章</asp:ListItem>
                        </aspxform:XCheckBoxList>
                    </td>--%>
                </tr>
                <tr hiddenexpress="DF_HR_SealApplication.UsageType=='4' || DF_HR_SealApplication.UsageType=='5'">
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label14" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label7" runat="server" text="文件名称"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="FileName" runat="server" XDataBind="DF_HR_SealApplication.FileName" DisableBehavior="ReadOnly" Width="70%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label15" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label8" runat="server" text="文件类别"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XDropDownList id="FileType" runat="server" XDataBind="DF_HR_SealApplication.FileType" Width="50%" Express="biditemid" PromptText="--请选择--">
                            <asp:ListItem Value="1">董事会类</asp:ListItem>
                            <asp:ListItem Value="2">运营管理类</asp:ListItem>
                            <asp:ListItem Value="3">业务及招标类</asp:ListItem>
                            <asp:ListItem Value="4">财务类</asp:ListItem>
                            <asp:ListItem Value="5">人事行政类</asp:ListItem>
                            <asp:ListItem Value="7">采购报关类</asp:ListItem>
                            <asp:ListItem Value="8">市场类</asp:ListItem>
                            <asp:ListItem Value="9">内控法务类</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
                <tr hiddenexpress="DF_HR_SealApplication.UsageType=='4' || DF_HR_SealApplication.UsageType=='5'">
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label16" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label9" runat="server" text="文件发往单位"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="FileToCompany" runat="server" XDataBind="DF_HR_SealApplication.FileToCompany" Width="70%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%" hiddenexpress="DF_HR_SealApplication.FileType!='3'">
                        <asp:Label id="Label17" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label12" runat="server" text="招投标号"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" hiddenexpress="DF_HR_SealApplication.FileType!='3'">
                        <aspxform:XTextBox id="BidLabel" runat="server" XDataBind="DF_HR_SealApplication.BidLabel" DisableBehavior="ReadOnly" Width="70%" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                        <aspxform:XDataBrowserButton id="XDataBrowserButton8" runat="server" Text="查询" Width="35px" DataMap="TenderNumber->DF_HR_SealApplication.BidLabel;ID->DF_HR_SealApplication.BidID" Height="25px" XDataSource="TableName:V_DF_CRM_BidProject;Filter:OwnerAccount->DF_HR_SealApplication.AppAccount" DisplayColumns="ProjectName:项目名称,200;ProjectNumber:项目编号,200;TenderNumber:招投标号,200"></aspxform:XDataBrowserButton>
                    </td>
                </tr>
                <tr hiddenexpress="DF_HR_SealApplication.UsageType=='4' || DF_HR_SealApplication.UsageType=='5'">
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label18" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label10" runat="server" text="文件附件"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <aspxform:XAttachments id="Attachement" runat="server" XDataBind="DF_HR_SealApplication.Attachement" RepeatDirection="Horizontal" FileTypes="*.doc;*.docx;*.xls;*.xlsx;*.pdf;*.png;*.jpg;*.jpeg;*.gif" FileTypesDescription="Word,Excel,Pdf" width="100%"></aspxform:XAttachments>
                    </td>
                </tr>
                <tr hiddenexpress="DF_HR_SealApplication.UsageType=='1' || DF_HR_SealApplication.UsageType=='2' || DF_HR_SealApplication.UsageType=='3' || DF_HR_SealApplication.UsageType=='6'">
                    <td height="21" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label19" runat="server" text="*" forecolor="Red"></asp:Label><asp:Label id="Label6" runat="server" text="借印说明"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="BorrowingInstructions" runat="server" XDataBind="DF_HR_SealApplication.BorrowingInstructions" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" TextMode="MultiLine" Rows="5"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td width="1200" class="title1">
                        <asp:Label id="Label35" runat="server" text="备注"></asp:Label>&nbsp;</td>
                </tr>
                <tr>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox17" runat="server" XDataBind="DF_HR_SealApplication.Remark" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" TextMode="MultiLine" Rows="5"></aspxform:XTextBox>
                    </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" Width="1200px" BorderWidth="1" BorderColor="#dcdcdc"></aspxform:XSignTrace>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
