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

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

    // Insert page code here
    //
    protected void Page_Load(object sender, EventArgs e)
    {
        string acc = Request.QueryString["acc"];

        this.XLabel7.Text = acc;

    }

</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" />
    <script src="/Oimec/Script/My97DatePicker/WdatePicker.js"></script>
    <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>
    <script type="text/javascript">



        function download() {
            //PO号
            var PO = agent.Eles[document.getElementById("XTextBox1").getAttribute("xform_xele_index")].getValue();
            //打印模板
            var Print = agent.Eles[document.getElementById("XDropDownList1").getAttribute("xform_xele_index")].getValue();
            //收货地区
            var Area = agent.Eles[document.getElementById("XDropDownList3").getAttribute("xform_xele_index")].getValue();
            //打印格式
            var radio1 = document.getElementById("XRadioButtonList1_0");
            var radio2 = document.getElementById("XRadioButtonList1_1");
            var format;
            if (radio1.checked == true) {
                format = radio1.value;
            }
            if (radio2.checked == true) {
                format = radio2.value;
            }
            //电子章
            var seal;
            var radio2_0 = document.getElementById("XRadioButtonList2_0");
            var radio2_1 = document.getElementById("XRadioButtonList2_1");
            if (radio2_0.checked == true) {
                seal = radio2_0.value;
            }
            if (radio2_1.checked == true) {
                seal = radio2_1.value;
            }
            var CompanyName = agent.Eles[document.getElementById("XTextBox3").getAttribute("xform_xele_index")].getValue();
            var Address = agent.Eles[document.getElementById("XTextBox5").getAttribute("xform_xele_index")].getValue();
            var Code = agent.Eles[document.getElementById("XTextBox7").getAttribute("xform_xele_index")].getValue();
            var ContactName = agent.Eles[document.getElementById("XTextBox4").getAttribute("xform_xele_index")].getValue();
            var ContactTelPhone = agent.Eles[document.getElementById("XTextBox6").getAttribute("xform_xele_index")].getValue();
            var ContactMobile = agent.Eles[document.getElementById("XTextBox8").getAttribute("xform_xele_index")].getValue();
            var Name = agent.Eles[document.getElementById("XLabel9").getAttribute("xform_xele_index")].getValue();
            var Phone = agent.Eles[document.getElementById("XLabel8").getAttribute("xform_xele_index")].getValue();
            if (PO == '') {
                alert("请选择PO号");
                return false;
            }
            if (Area == '') {
                alert("请选择收货库存地");
                return false;
            }
            if (Print == '') {
                alert("请选择打印模板");
                return false;
            }

            var url = YZSoft.$url('Oimec/ApiServices/GenerateContactTeplateHandler.ashx');
            YZSoft.src.ux.File.download(url, {
                method: 'DownloadPDFByContractTemplate',
                PO: PO,
                Print: Print,
                format: format,
                seal: seal,
                Area: Area,
                CompanyName: CompanyName,
                Address: Address,
                Code: Code,
                ContactName: ContactName,
                ContactTelPhone: ContactTelPhone,
                ContactMobile: ContactMobile,
                Name: Name,
                Phone: Phone
            });

        }
    </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" style="padding-left: 30px">
                        <asp:Label ID="Label1" runat="server" Text="采购合同申请"></asp:Label></td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1062" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="tsbottomlabel">
                        <asp:Label ID="Label7" runat="server" Text="采购员姓名" value valuetodisplaytext></asp:Label>
                        <aspxform:XLabel ID="XLabel7" runat="server" BackColor="#D4E4FE" ValueToDisplayText="TableName:BPMSysUsers;FilterColumn:Account;DisplayColumn:Account" DataMap="DisplayName->Name;OfficePhone->Phone" HiddenExpress="1"></aspxform:XLabel>
                    </td>
                    <td class="tsbottomtext">
                        <aspxform:XLabel ID="XLabel9" runat="server" BackColor="#D4E4FE" ValueToDisplayText XDataBind="Name"></aspxform:XLabel>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label ID="Label11" runat="server" Text="联系电话" value valuetodisplaytext></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XLabel ID="XLabel8" runat="server" BackColor="#D4E4FE" ValueToDisplayText XDataBind="Phone"></aspxform:XLabel>
                    </td>
                </tr>
                <tr>
                    <td width="10%" height="19" class="tsbottomlabel">
                        <asp:Label ID="Label10" runat="server" Text="*" ForeColor="Red"></asp:Label>&nbsp;<asp:Label ID="XLabel41" runat="server" Text="PO号" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox1" runat="server" BorderWidth="1" BorderColor="#DCDCDC" Width="50%" CssClass="text">4500000218</aspxform:XTextBox>
                    </td>
                    <td width="10%" class="tsbottomlabel">&nbsp;</td>
                    <td width="35%" class="tsbottomtext"></td>
                </tr>
                <tr>
                    <td width="10%" height="37" class="tsbottomlabel">
                        <asp:Label ID="Label12" runat="server" Text="*" ForeColor="Red"></asp:Label>&nbsp;<asp:Label ID="XLabel432" runat="server" Text="收货库存地" value valuetodisplaytext></asp:Label>
                        <aspxform:XTextBox ID="XTextBox2" runat="server" XDataBind="storageID" BorderWidth="1" BorderColor="#DCDCDC" Width="50px" CssClass="text" HiddenInput="True"></aspxform:XTextBox>
                        <aspxform:XDropDownList ID="XDropDownList2" runat="server" DataMap="CompanyName->CompanyName;Address->Address;Code->Code" HiddenExpress="1" XDataSource="TableName:DF_Logistics_StorageAddress;Filter:StorageID->storageID"></aspxform:XDropDownList>
                        <aspxform:XDropDownList ID="XDropDownList4" runat="server" DataMap="ContactName->ContactName;ContactTelPhone->ContactTelPhone;ContactMobile->ContactMobile" HiddenExpress="1" XDataSource="TableName:DF_Logistics_StorageContact;Filter:StorageID->storageID"></aspxform:XDropDownList>
                    </td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XDropDownList ID="XDropDownList3" runat="server" DataMap="StorageID->storageID" Width="50%" XDataSource="TableName:V_DF_Logistics_Storage1" PromptText="----请选择----" ValueColumn="StorageName" DisplayColumn="StorageName"></aspxform:XDropDownList>
                    </td>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Label14" runat="server" Text="*" ForeColor="Red"></asp:Label>&nbsp;<asp:Label ID="Label15" runat="server" Text="打印模板" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XDropDownList ID="XDropDownList1" runat="server" Width="50%" PromptText="----请选择----">
                            <asp:ListItem Value="01">通用模板</asp:ListItem>
                            <asp:ListItem Value="02">产品购销合同模板</asp:ListItem>
                            <asp:ListItem Value="03">人民币大额采购合同模板</asp:ListItem>
                            <asp:ListItem Value="04">菊水贸易采购合同模板</asp:ListItem>
                            <asp:ListItem Value="05">二手仪器采购合同模板</asp:ListItem>
                            <asp:ListItem Value="06">计量/校准合同模板</asp:ListItem>
                            <asp:ListItem Value="07">维修合同模板</asp:ListItem>
                            <asp:ListItem Value="08">延保合同模板</asp:ListItem>
                            <asp:ListItem Value="09">租赁合同模板</asp:ListItem>
                            <asp:ListItem Value="11">颐合订单模板</asp:ListItem>
                            <asp:ListItem Value="12">颐合采购合同</asp:ListItem>
                            <asp:ListItem Value="13">博德订单模板</asp:ListItem>
                            <asp:ListItem Value="14">博德人民币大额采购合同模板</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                </tr>
                <tr>
                    <td width="10%" height="19" class="tsbottomlabel">
                        <asp:Label ID="Label2" runat="server" Text="单位名称" value valuetodisplaytext></asp:Label>
                        <aspxform:XDataBrowserButton ID="XDataBrowserButton1" runat="server" DataMap="CompanyName->CompanyName;Address->Address;Code->Code" Width="40px" XDataSource="TableName:DF_Logistics_StorageAddress;Filter:StorageID->storageID" Text="查询" DisplayColumns="CompanyName:公司名称;Address:地址;Code:邮编"></aspxform:XDataBrowserButton>
                    </td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox3" runat="server" ValueToDisplayText XDataBind="CompanyName" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" HiddenInput="False" DisableExpress='storageID!="0"' Width="100%"></aspxform:XTextBox>
                    </td>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Label5" runat="server" Text="收货联系人" value valuetodisplaytext></asp:Label>
                        <aspxform:XDataBrowserButton ID="XDataBrowserButton2" runat="server" DataMap="ContactName->ContactName;ContactTelPhone->ContactTelPhone;ContactMobile->ContactMobile" Width="40px" XDataSource="TableName:DF_Logistics_StorageContact;Filter:StorageID->storageID" Text="查询" DisplayColumns="ContactName:联系人姓名;ContactTelPhone:联系人手机;ContactMobile:联系人电话"></aspxform:XDataBrowserButton>
                    </td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox4" runat="server" ValueToDisplayText XDataBind="ContactName" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" HiddenInput="False" DisableExpress='storageID!="0"' Width="412px"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td width="10%" height="17" class="tsbottomlabel">
                        <asp:Label ID="Label3" runat="server" Text="地址" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox5" runat="server" XDataBind="Address" BorderWidth="1" BorderColor="#DCDCDC" DisableExpress='storageID!="0"' Width="100%"></aspxform:XTextBox>
                    </td>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Label9" runat="server" Text="收货联系电话" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox6" runat="server" ValueToDisplayText XDataBind="ContactTelPhone" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" HiddenInput="False" DisableExpress='storageID!="0"' Width="412px"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Label4" runat="server" Text="邮编" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox7" runat="server" XDataBind="Code" BorderWidth="1" BorderColor="#DCDCDC" DisableExpress='storageID!="0"' Width="100%"></aspxform:XTextBox>
                    </td>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Label8" runat="server" Text="联系人手机" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XTextBox ID="XTextBox8" runat="server" ValueToDisplayText XDataBind="ContactMobile" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" HiddenInput="False" DisableExpress='storageID!="0"' Width="412px"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Labe24" runat="server" Text="文件格式" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XRadioButtonList ID="XRadioButtonList1" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem>Word</asp:ListItem>
                            <asp:ListItem Selected="True">Pdf</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                    <td width="10%" class="tsbottomlabel">
                        <asp:Label ID="Label6" runat="server" Text="是否有电子章" value valuetodisplaytext></asp:Label></td>
                    <td width="35%" class="tsbottomtext">
                        <aspxform:XRadioButtonList ID="XRadioButtonList2" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True">是</asp:ListItem>
                            <asp:ListItem>否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel">
                        <asp:Label ID="Labe28" runat="server" Text="合同下载" value valuetodisplaytext></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XButton ID="XButton1" runat="server" Text="采购合同下载" OnClientClick="download();"></aspxform:XButton>
                        <br />
                        <aspxform:XAttachments ID="XAttachments2" runat="server" HiddenExpress="1" Width="100%" FileTypes="*.pdf;*.doc;*.docx;*.xls;*.xlsx" FileTypesDescription=" "></aspxform:XAttachments>
                    </td>
                    <td class="tsbottomlabel"></td>
                    <td class="tsbottomtext"></td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
