<%@ Page Title="" Language="C#" MasterPageFile="~/bps/bps.Master" ClientIDMode="Static" AutoEventWireup="true" CodeBehind="quote_add.aspx.cs" Inherits="bps.bps.quote_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


  


     <h1  class="border-active subnav" ><%=isen?"Add / Edit Quote ":"添加/修改报价单" %>   </h1>

    <div class=right-action>
        <a href="quote_list.aspx" class="btn btn-primary btn-sm" ><%=isen?"Back":"返回" %>  </a>  
         
    </div>


    <style>
        table.add th {
         font-weight:normal;
        }
    </style>

    <div>
     
       <div class="content">
 
            

 <div  >

     

             <asp:Panel runat="server" ID="pnl_rotate">

                   <asp:TextBox runat="server" ID="appname" Visible="false"></asp:TextBox>
                    <asp:TextBox runat="server" ID="appuid" Visible="false"></asp:TextBox>
            
            
                 
                    <table class="table table-condensed add" style="margin-bottom:-10px;  "  >
                     
                          <tr>
                                <th  width="100px" ><%=isen?"Quote Code":"报价单号" %> <font color=red>*</font></th>
                                <td width="200px">
                                   
                                    <asp:TextBox class="form-control"   ValidationGroup="Add" ID="quotecode" Text=""  runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ValidationGroup="Add"
                                          ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须填写报价单号" ControlToValidate="quotecode" Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                            

                        <th width="100">
                            BOM单据查询 <font color=red>*</font>  &nbsp;   
                        </th>
                              <td colspan="3"  class="form-inline">
                         
                                       
<div class="input-group">
        
  <asp:TextBox runat="server" ID="keys"  Width="400px"  CssClass="form-control"></asp:TextBox>
     
<span class="input-group-addon">
    <a href="###"  onclick="Pop('pop_bom.aspx',1150,600,'选择单据'); return false;"><i class="glyphicon glyphicon-search"></i>
    </a>

</span> 
	 
   </div>




               <asp:Button runat="server" ID="btn_read"  ValidationGroup="read" Text="读取" CssClass="btn btn-primary" OnClick="btn_read_Click" />


                     <asp:RequiredFieldValidator ValidationGroup="read"
                                          ID="RequiredFieldValidator2" runat="server" ErrorMessage="必须填写BOM单号" ControlToValidate="keys" Display="Dynamic"></asp:RequiredFieldValidator>


                                  

                                  </td>

                             
                            </tr>


                        <tr>

                                <th width="100px"> <%=isen?"Product Code":"成品编号" %>  </th>
                            <td width="200">
                            <asp:TextBox id="productcode" Runat="Server"  ReadOnly="true"  class="form-control"  ValidationGroup="Add"></asp:TextBox>
                           
                                       <asp:RequiredFieldValidator ValidationGroup="Add"
                                          ID="RequiredFieldValidator3" runat="server" ErrorMessage="必须填写产品编号" ControlToValidate="productcode" Display="Dynamic"></asp:RequiredFieldValidator>
                           
                            </td>


                            <th>成品名称</th>
                            <td>
                                <asp:TextBox runat="server" ID="productname" CssClass="form-control" Enabled="false"></asp:TextBox>
                            </td>

                              <th>成品版本号</th>
                            <td>
                                  <asp:TextBox runat="server" ID="bomrevision" CssClass="form-control" Enabled="false"></asp:TextBox>
                            </td>

                            </tr>

                            <tr>

                              <th width="100px">
                                 <%=isen?"Customer Name":"客户名称" %>    
                              </th>
                              <td width="200px">

                                      <asp:TextBox id="customername" Runat="Server"     ReadOnly="true"   class="form-control"  ValidationGroup="Add"></asp:TextBox>
 
                              </td>

                            
                              <th width="100px">
                                 <%=isen?"Customer Code":"客户号" %>    
                              </th>
                              <td width="200px">

                                      <asp:TextBox id="customercode" Runat="Server"     ReadOnly="true"   class="form-control"  ValidationGroup="Add"></asp:TextBox>
 
                              </td>


                                
                              <th> </th>
                            <td>

                            </td>

                        </tr>






                        <tr>
                            <th>销售人员</th>
                            <td>
                                  <asp:TextBox id="sellname" Runat="Server"      class="form-control"  ></asp:TextBox>
                            </td>


                            <th>报价日期</th>

                            <td>
                                <asp:TextBox id="dt_quotedate" Runat="Server"     class="form-control _dt"  ></asp:TextBox>
                            </td>

                            <th>报价版本</th>

                            <td>

                                 <asp:TextBox id="revision" Text="1.0" Runat="Server"     class="form-control"  ></asp:TextBox>
                            </td>
                        </tr>

                          
                          <tr>
                             
                            
                            <th width="100px"> <%=isen?"Quantity":"订购量" %> <font color=red>*</font> </th>
                            <td width="200">
                            <asp:TextBox id="quantity" Runat="Server"  Text="1"  class="form-control" ></asp:TextBox>

                             
 
                            </td>

                              <th width="100px">
                                 <%=isen?"UOM":"单位" %>    
                              </th>
                              <td width="200px">

                                   <asp:DropDownList runat="server"  CssClass="form-control"  ID="ddl_piece"></asp:DropDownList>
 
                              </td>


                              <th>

                              </th>
                              <td>

                              </td>

                            </tr>


                        <tr>
         <td style="background-color:#f5f5f5" colspan="6">
             
         </td>
     </tr>




                        

                          
                          <tr>
                              
                            
                            <th width="100px"> <%=isen?"Manage Fee":"管理费率%" %> <font color=red>*</font> </th>
                            <td width="200">
                            <asp:TextBox id="mgrrate" Runat="Server"  style="display:inline-block; width:150px"  Text="10"  class="form-control"  ValidationGroup="Add"></asp:TextBox>%
 
 
                            </td>

                              <th width="100px">
                                 <%=isen?"Profit Fee":"利润费率%" %> <font color=red>*</font>   
                              </th>
                              <td width="200px">

                                      <asp:TextBox id="profitrate" Runat="Server" 
                                           style="display:inline-block; width:150px"
                                             Text="6"  class="form-control"  ValidationGroup="Add"></asp:TextBox>%
 
                              </td>


                                <th  width="100px" > 调整率%</th>
                                <td width="200px"> 
                                 
                                     <asp:TextBox id="adjustrate" Runat="Server" 
                                           style="display:inline-block; width:150px"
                                             Text="0"  class="form-control"  ValidationGroup="Add"></asp:TextBox>%
                                   </td>

                            </tr>
                        <tr>
                               <th  width="100px" >工时(h) <font color=red>*</font></th>
                                <td width="200px"> 
                                    <asp:TextBox  Text="0"  CssClass="form-control"   
                                            style="display:inline-block; width:150px"
                                         ValidationGroup="Add" ID="workhour"  runat="server"></asp:TextBox>
                            </td>




                               <th>
工时费用(RMB/h)
                            </th>
                            <td>

                                     <asp:TextBox  Text="0"  CssClass="form-control"    
                                            style="display:inline-block; width:150px"
                                         ValidationGroup="Add" ID="workprice"  runat="server"></asp:TextBox>

                            </td>




                            <th>
                                磨具费用(RMB) 
                            </th>
                            <td>
                                  <asp:TextBox  Text="0"  CssClass="form-control"   
                                            style="display:inline-block; width:150px"
                                         ValidationGroup="Add" ID="toolingcost"    runat="server"></asp:TextBox>

                            </td>

                           
                        </tr>

                           

                 <tr>
                     <th>
                         报价说明
                     </th>

                     <td colspan="5">

                         <asp:TextBox runat="server" ID="note" TextMode="MultiLine" Width="800px" Height="60px" CssClass="form-control"></asp:TextBox>

                     </td>
                 </tr>

</table>

                   <asp:TextBox runat="server" ID="bomid" Visible="false"  CssClass="form-control"></asp:TextBox>

                </asp:Panel>

    
     
     
       
      
      </div>



           <br /><br />


   

   




     <asp:GridView runat="server" ID="gv_items" style=" border-collapse:collapse"  
          GridLines="None" CssClass="table table-bordered table-hover detail" 
         AutoGenerateColumns="False" >

         <Columns>
            
          
            <asp:BoundField DataField="ItemCode" HeaderText="子件编号"  HeaderStyle-Width="90px"/>
            <asp:BoundField DataField="ItemName" HeaderText="子件名称"  HeaderStyle-Width="160px"/>
 
            <asp:BoundField DataField="spec" HeaderText="规格" HeaderStyle-Width="180px"/>
   <asp:BoundField DataField="MPN" HeaderText="厂商号" HeaderStyle-Width="150px"/>
   
                <asp:BoundField DataField="Manufacturer" HeaderText="制造商" HeaderStyle-Width="100px"/>
           
                  <asp:BoundField DataField="UOM" HeaderText="单位" HeaderStyle-Width="80px"/> 

                  <asp:BoundField DataField="Drawing" HeaderText="图纸编号" HeaderStyle-Width="150px"/>
             
                  <asp:BoundField DataField="supplycode" HeaderText="供应商号" HeaderStyle-Width="100px"/>
           
                  <asp:BoundField DataField="supplyname" HeaderText="供应商名" HeaderStyle-Width="80px"/> 


                <asp:BoundField DataField="LeadTime" HeaderText="LeadTime" HeaderStyle-Width="100px"/>

           
              <asp:BoundField DataField="quantity" HeaderText="数量" HeaderStyle-Width="80px"/> 

              <asp:BoundField DataField="price" HeaderText="单价" HeaderStyle-Width="80px"/> 

             <asp:BoundField DataField="currency" HeaderText="货币" HeaderStyle-Width="80px"/>


           


           
         </Columns>





     </asp:GridView>

    
     
     
     


           <br /><br />
           
         <div class="text-center">

             <asp:Button runat="server" ID="btn_save" Text="保存报价单" Visible="false"  ValidationGroup="Add" class="  btn btn-danger btn-flat  " OnClick="btn_save_Click" />
                
             <br /><br />

         </div>














           </div>
        </div>
   













    <script>

        function setPopProductCode(_v)
        {

            $("#keys").val(_v);
        }
    </script>







</asp:Content>
