<%@ Page Title="" Language="C#" MasterPageFile="~/bps/bps.Master" AutoEventWireup="true" CodeBehind="bom_detail.aspx.cs" Inherits="bps.bps.bom_detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="margin-left:10px">

  <style>
      
  </style>

     <h1  class="border-active subnav" > BOM成品   </h1>
 
    <script>
        function writeImg(obj)
        {
            if (obj == "") {
                document.write("");
            }
            else {
                document.write("<a target=_blank href="+obj+">查看</a>");
            }

        }


    </script>

        <div style=" margin-right:20px; margin-bottom:10px; padding-bottom:10px; ">
        
          <b class="_status">  当前状态： <asp:Label runat="server" ID="lbl_status"></asp:Label> </b>
            
                <a href="bom_addedit.aspx?id=<%=id %>" style="float:right" class="btn btn-success btn-sm" >编辑</a>
        </div>

    <asp:FormView runat="server" ID="fv_detail"  RenderOuterTable="false"  EnableViewState="false">
        <ItemTemplate>

           


            
                   <table class="table    table-bordered "  >

                       <tr>

                           
                           <td width="100px" class="active">成品名称</td>
                           <td width="200px">
                               <%#Eval("productname") %>
                            </td>

                                <td width="100px" class="active">成品编号</td>
                           <td width="200px">
                               <%#Eval("productcode") %>
                            </td>

                               <td width="100px" class="active">版本号</td>
                           <td width="200px">
                               <%#Eval("revision") %>
                            </td>

                           </tr>


                        <tr>

                           
                           <td   class="active">设计人</td>
                           <td >
                               <%#Eval("designname") %>
                            </td>

                                <td  class="active">设计日期</td>
                           <td  >
                               <%# DtHelper.FormatDt(Eval("designdate")) %>
                            </td>

                               <td  > </td>
                           <td  >
                                
                            </td>

                           </tr>





                       
                        <tr>

                           
                           <td   class="active">建立人</td>
                           <td >
                               <%#Eval("opname") %>
                            </td>

                                <td  class="active">建立时间</td>
                           <td  >
                               <%# DtHelper.FormatDtShort(Eval("opdate")) %>
                            </td>

                               <td  > </td>
                           <td  >
                                
                            </td>

                           </tr>

                       <tr>
                           <td colspan="6">

                           </td>
                       </tr>


                         <tr>

                             
                                <td  class="active">客户名称</td>
                           <td  >
                               <%#Eval("customername") %>
                            </td>

                           
                           <td   class="active">客户代号</td>
                           <td >
                               <%#Eval("customercode") %>
                            </td>


                               <td class="active" >成品类型 </td>
                           <td  >
                                 <%#Eval("producttype") %>
                            </td>

                           </tr>






                         <tr>

                             
                                <td  class="active">产品结构图1</td>
                           <td  >

                              <script>
                                  writeImg('<%#Eval("attach1") %>');

                              </script> 


                            </td>

                           
                           <td   class="active">产品结构图2</td>
                           <td >
                                 <script>
                                     writeImg('<%#Eval("attach2") %>');

                              </script> 

                            </td>


                               <td  >  </td>
                           <td  >
                                
                            </td>

                           </tr>

                        
                       
                       
                         <tr>  
                           <td  class="active">成品说明</td>
                           <td  colspan="5" >
                               <%#Eval("note") %>
                            </td>  
                           </tr>




                       </table>


        </ItemTemplate>

    </asp:FormView>



        




        
               <br />
               <br />
              



          
         
          <h4 class="border-active subnav" >子件列表  </h4>
       
           <div style="margin:10px 10px 10px 5px; ">
               共有<span id="total1"></span> 行数据，共计数量 <span id="total2"></span> 个
           </div>

               <asp:GridView runat="server" ID="gv_items" Style="border-collapse: collapse"
                   GridLines="None" CssClass="table table-bordered table-hover detail"
                   AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="sds"
                    ClientIDMode="Static"  EnableViewState="false"
                   >

                   <Columns>
                       <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" Visible="false" />

                       <asp:BoundField DataField="ItemCode" HeaderText="子件编号" HeaderStyle-Width="90px" />
                       <asp:BoundField DataField="ItemName" HeaderText="子件名称" HeaderStyle-Width="160px" />
                       <asp:BoundField DataField="Levels" HeaderText="级别" HeaderStyle-Width="80px" />
                       <asp:BoundField DataField="findNumber" HeaderText="位置编号" HeaderStyle-Width="80px" />
                       <asp:BoundField DataField="quantity" HeaderText="数量" HeaderStyle-Width="80px" />
                       <asp:BoundField DataField="UOM" HeaderText="单位" HeaderStyle-Width="80px" />
                       <asp:BoundField DataField="revision" HeaderText="版本" HeaderStyle-Width="80px" />
                       <asp:BoundField DataField="MPN" HeaderText="制造商编号" HeaderStyle-Width="120px" />
                       <asp:BoundField DataField="Manufacturer" HeaderText="制造商名称" HeaderStyle-Width="150px" />
   
                       <asp:BoundField DataField="Note" HeaderText="用料说明" HeaderStyle-Width="150px" />

                       
                   </Columns>



               </asp:GridView>



                




               <asp:SqlDataSource ID="sds" 
                   ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                   runat="server" 
                   SelectCommand="SELECT * FROM purchase_bom_items where bid=@bid ORDER BY [id]"
                  
                   >

                   <SelectParameters>
                       <asp:QueryStringParameter DefaultValue="0" QueryStringField="id" Name="bid" />
                   </SelectParameters>
                 




               </asp:SqlDataSource>

             




  


    <script>

        var _r = $("#gv_items tr").length - 1;
        if(_r<0)
        {
            _r=0;
        }

        $("#total1").html(_r);




        var sum = 0;
        $("#gv_items  tr:not(:first-child)").each(
            function ()
            {
                var _c = $(this).find("td").eq(4).text().trim();
                sum += parseFloat(_c);


            }

            );
        $("#total2").html( sum.toFixed(2));


    </script>




    <br /><br />

    
         
  <h4 class="border-active subnav" >审批流程    <a href="###"  onclick="showFlow()">查看流程</a>

    <span id="flow" style="display:none">
      &nbsp;&nbsp;&nbsp;&nbsp;  <asp:Label runat="server" ID="lbl_flow"></asp:Label>
    </span>
  </h4>









      
        <script>
            function showFlow() {
                layer.open({
                    type: 1,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['700px', '250px'], //宽高
                    content: "<br><br> " + $("#flow").html()
                });

            }

        </script>





      

    <table  class="table table-bordered" >
        <tbody>
       
      
      <tr  >     
           <th  width="100px">设计人 </th>

           <th  width="100px">申请人</th>

          
          <th  width="100px">审核人</th>
          <th width="100px">确认人</th> 
        </tr>
             
  


              <tr>
                   <td style="height:100px;">
                        <asp:Label runat="server" ID="lbl_notedesign"></asp:Label>
                  </td>
              <td >
                   <asp:Label runat="server" ID="lbl_noteapp"></asp:Label>
                </td>

                 <td>
                         <asp:Label runat="server" ID="lbl_noteaudit1"></asp:Label>
                </td>


                 <td>
                      <asp:Label runat="server" ID="lbl_noteaudit2"></asp:Label>
                </td>

              
 
            </tr>

  </tbody>
  </table>
 




        
 
     </div>



</asp:Content>
