<%@ Page Title="小类设置" Language="C#" MasterPageFile="~/bps/basic.Master"  ClientIDMode="Static"  AutoEventWireup="true" CodeBehind="material_addEdit.aspx.cs" Inherits="purchase.purchase.Product_AddEdit" %>
 
  
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

        <asp:HiddenField runat="server" ID="hf_oldprice" />
         
    
    <script src="../UserControl/mat_js.aspx?index=0&id=<%=id %>"></script>

   


    <script src="../javascript/layer/layer.js"></script>

    <script>
        function _P(_src,_width,_height,_title)
        {
            layer.open({
                type: 2,
                title: _title,
                shadeClose: true,
                shade: 1,
                area: [_width + 'px', _height + 'px'],
                content: _src
            });


        }

    </script>
 

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


     
       
     

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

            
                    <table class="table add table-condensed"    >
                     
                          <tr>
                                <th  width="100px" ><%=isen?"Name":"原料名称" %> <font color=red>*</font>：</th>
                                <td width="200px">
                                   
                                    <asp:TextBox class="form-control"   ValidationGroup="Add" ID="catname" Text=""  runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ValidationGroup="Add"
                                         ForeColor="Red"
                                         ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须填写类别" ControlToValidate="catname" Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                            
                            <th width="100px"><%=isen?"Code":"原料编号" %>  <font color=red>*</font>:</th>
                            <td width="200px">
                            <asp:TextBox id="code" Runat="Server"     class="form-control"  ValidationGroup="Add"></asp:TextBox>
 
                            </td>


                               

                              
<th width="100px"><%=isen?"UOM":"单位" %> :</th>
<td width="200px">
<asp:DropDownList id="ddl_piece" Runat="Server"     AppendDataBoundItems="true" class="form-control"  ValidationGroup="Add"> 
    
    <asp:ListItem Text="" Value=""></asp:ListItem>

</asp:DropDownList>
 
</td>

  </tr>







                            
<tr>
 
<th><%=isen?"Spec":"规格型号" %> :</th>
<td>
<asp:TextBox id="spec" Runat="Server"     class="form-control"  ValidationGroup="Add"></asp:TextBox>
 
</td>





    <th><%=isen?"Reference Price":"参考价格" %>  :

</th>
<td>
<asp:TextBox id="price" Runat="Server"  Text="0"   style="display:inline-block; width:150px"  class="form-control inline"  ValidationGroup="Add"></asp:TextBox> 
 
    <asp:DropDownList runat="server"  style="display:inline-block; width:100px" 
           AppendDataBoundItems="true"   class="form-control inline"   ID="ddl_currency"> 
    </asp:DropDownList>  

</td>



    <th><%=isen?"LeadTime":"交货期（天）" %>：</th>
            <td>
                <asp:TextBox  class="form-control" ID="leadtime"      runat="server"></asp:TextBox>
    </td>

     


</tr>










                           <tr>
                            <th  ><%=isen?"Category":"原料分类" %>  <font color="red">*</font>:</th>
                            <td  >
                              <asp:DropDownList ID="ddl_parentid" runat="server" 
                            CssClass="form-control inline"  ValidationGroup="Add"     >
        </asp:DropDownList> 
                         <asp:RequiredFieldValidator Display="Dynamic"  ValidationGroup="Add" ForeColor="Red"  InitialValue="0" ControlToValidate="ddl_parentid" ID="RequiredFieldValidator2" runat="server" ErrorMessage="必须选择类别"></asp:RequiredFieldValidator>
                            </td>
                        


                            <th>
                             <%=isen?"MOQ":"最小库存MOQ" %>  
                            </th>
                               <td>
                                 <asp:TextBox  class="form-control" ID="moq"    Text="0"   runat="server"></asp:TextBox>
                               </td>


                               <th>
                                  <%=isen?"Ship Method":"运输方式" %>    
                               </th>

                               <td>
                                     <asp:DropDownList ID="ddl_shipmethod" runat="server" 
                                             CssClass="form-control inline"  ValidationGroup="Add"     >
                                    </asp:DropDownList> 
                               </td>






                        </tr>



<tr>
    <th>
        英文名
    </th>
    <td colspan="5">
        
        <asp:TextBox runat="server"    class="form-control" ID="enname" 
           
            style="display:inline-block"  Width="300"
           
            ></asp:TextBox>  在BOM物料导入清单时，物料名默认存放在此处

    </td>

</tr>


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





                                   <tr>


   
                                <th> <%=isen?"Default Supply Name":"默认供应商号Vnr" %>      
                                </th>
                                   <td>

<div class="input-group">
        
        
               <asp:TextBox ID="supplycode" ClientIDMode="Static"    class="form-control"  runat="server"></asp:TextBox>  
               

  
<span class="input-group-addon">
    <a href="###"  onclick="_P('pop_supply.aspx',750,550,'选择供应商'); return false;"><i class="glyphicon glyphicon-user"></i>

    </a>

</span>
	 
   </div>

<script>

    function setSupply(_k) {
        $("#supplycode").val(_k.split('$')[0]);
        $("#supplyname").val(_k.split('$')[1]);
    }


</script>
                                   
                                   </td>



                                  <th>
                                   <%=isen?"Supply Code":"供应商名" %>        
                                  </th>
                                      <td>
                                        <asp:TextBox ClientIDMode="Static"   class="form-control  " ID="supplyname"  runat="server"></asp:TextBox>
                               

                                      </td>

                                  <th> <%=isen?"Supply Material Code":"供应商料号" %>      </th>
                                   <td>
                                        <asp:TextBox ClientIDMode="Static"   class="form-control inline" ID="supplyprocode"     runat="server"></asp:TextBox>
                                 </td>

                                 
                                       
                                      
                                       
                                       
                                       
                                            
                               </tr>


  
                                 <tr>
                            <th>
                                   <%=isen?"Price Note":"价格备注" %>       
                            </th>
                            <td colspan="5">
                                <asp:TextBox runat="server" ID="pricenote" CssClass="form-control"  ></asp:TextBox>
                            </td>

                        </tr>

                                   
                 
                             <tr> 


                                 
                              <th>
                               <%=isen?"MPN":"制造商编号MPN" %>            

                              </th>

                                 <td> 
  

                                     <div class="input-group">
        
        
               <asp:TextBox ID="mpn" ClientIDMode="Static"    class="form-control"  runat="server"></asp:TextBox>  
               

  
<span class="input-group-addon">
    <a href="###"  onclick="_P('pop_make.aspx',750,550,'选择制造商'); return false;"><i class="glyphicon glyphicon-user"></i>

    </a>

</span>
	 
   </div>

                                 </td>






                                 <th>
                                  <%=isen?"Manufacturer Code":"制造商名" %>        
                                 </th>
                               
                                <td>

  <asp:TextBox ClientIDMode="Static"   class="form-control " ID="manufacturer"     runat="server"></asp:TextBox>
                                   
         
                                </td>


                                 <th>  <%=isen?"Env Protect":"是否环保" %>   </th>

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

                                 </td>
                                </tr>





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


                            
                            <script>

                                function setMaker(_k) {
                                    $("#mpn").val(_k.split('$')[0]);
                                    $("#manufacturer").val(_k.split('$')[1]);
                                }


</script>           


         </td>
     </tr>






     <tr>
                           


                           <th     >
                               <%=isen?"Material Drawing 1":"原料结构图1" %>        
                                 
                            </th>
                            <td  >
                                   <a  href="###"
                                        onclick="layer.open({ type:2, content: '../SimlpeUploadFile.aspx?t=customlist&cid=attach1', area: ['700px', '360px'], title:'添加附件'}); return false;"

                                       
                                       ><%=isen?"Upload1":"上传1" %>  </a>
                                   
                                <asp:TextBox runat="server" ID="attach1"   style="width:150px; border:0px; border-bottom:solid 1px #ccc; display:inline-block"></asp:TextBox>
                            
                                <a href="###" onclick="_preview('attach1');">  <%=isen?"Preview1":"预览1" %>    </a>
                                  </td>
                       


                              <th    >
                        <%=isen?"Material Drawing 2":"原料结构图2" %>        
                                  </th>    
                                   <td  >
                                  
                                 <a href="###"
                                          onclick="layer.open({ type:2, content: '../SimlpeUploadFile.aspx?t=customlist&cid=attach2', area: ['700px', '360px'], title:'添加附件'}); return false;"
                                     ><%=isen?"Upload2":"上传2" %>     </a>

                              <asp:TextBox runat="server" ID="attach2"  style="width:150px;border:0px; border-bottom:solid 1px #ccc;  display:inline-block"></asp:TextBox>

                               <a href="###" onclick="_preview('attach2');">  <%=isen?"Preview2":"预览2" %>    </a>

                            </td>

                            <th><%=isen?"Is Involve Price":"是否参与报价" %>   </th>
                            <td>
                             <asp:RadioButtonList runat="server" Width="200px" RepeatDirection="Horizontal" ID="rbl_IsInprice">
                                 <asp:ListItem Text="是" Value="1"></asp:ListItem>
                                  <asp:ListItem Text="否" Value="0"></asp:ListItem>

                             </asp:RadioButtonList>

                            </td>

                        </tr>







                        <tr>
                            <th>
                                   <%=isen?"Note":"备注" %>       
                            </th>
                            <td colspan="5">
                                <asp:TextBox runat="server" ID="note" CssClass="form-control" TextMode="MultiLine"  Height="100px"></asp:TextBox>
                            </td>

                        </tr>
                        <tr>

                                <td colspan="4" style="text-align:center">
                                    <asp:Button ID="btn_add" runat="server" Text="添加"  ValidationGroup="Add" 
                                        class="btn btn-primary btn-flat btn-sm " onclick="btn_add_Click" />
 

                                          <asp:button  Text="更 新" CssClass="btn btn-success btn-sm" runat=server ID="edit"  ValidationGroup="Add"    class="btn-flat btn-sm  btn   bg-green" 
                   onclick="edit_Click" />

                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                 <asp:button  Text="删 除" OnClientClick="return confirm('确定删除吗？')" runat=server ID="delete"   CausesValidation="false"   class="  btn btn-danger btn-flat btn-sm" 
                   onclick="delete_Click" />
               

                                   
                                     

                                 </td>
                            </tr> 
                    </table>
                 

                 <asp:TextBox runat="server" ID="pinyin" Visible="false"></asp:TextBox>
         </asp:Panel>




             
     <script>

         function _preview(_cid) {
             window.open(document.getElementById(_cid).value);
         }

         function AddAttach(_cid, _path) {
             $("#" + _cid).val(_path);
         }

 

     </script>


   

     




     <input type="hidden" name="hf_ids" id="hf_ids" />







         


     



     

 
 </asp:Content>