<%@ Page Title="" Language="C#" MasterPageFile="~/helpdesk/Pc.master" AutoEventWireup="true" CodeBehind="Pc_AddEditPc.aspx.cs" Inherits="helpdesk.helpdesk.PC_AddEditPc" %>
 

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    <link href="../style/pc.css" rel="stylesheet" />
    <style>
       
        .red {
         color:red
        }
        .table>tbody>tr>th {
         text-align:right;  
         padding-top:15px;
        }

        .form-control{  border-radius:0px; }

        
    </style>

     
     

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


     
  <div class="panel panel-default">
    <div class="panel-heading">
     1.硬件PC基本信息
    </div>
    
      <div class="panel-body">

 
      <table  class="table">
        <tbody>
           
           <tr>     
     
          <th style="width:100px; " ><span class="red">*</span>  机器名  </th>
       
          <td style="width:200px;  ">
               <asp:TextBox ID="txt_pcname"  ClientIDMode="Static"  CssClass="form-control" runat="server"  ></asp:TextBox>
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txt_pcname" runat="server" ErrorMessage="必须输入机器名" Display="Dynamic"></asp:RequiredFieldValidator> 

          </td>
        
          
          
          
              
                
         <th style="width:100px;" >资产编号</th>
          <td  style="width:200px;  "> 
             
               <asp:TextBox ID="txt_assettag" runat="server"   ClientIDMode="Static"  CssClass="form-control"></asp:TextBox>
               
 
            </td>
             
          
          
          
      
                
         <th style="width:100px; " >机器型号 </th>
          <td  style="width:200px; "> 
          
              <div class="input-group">
             <asp:TextBox runat="server"  ID="txt_spec"  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_spec','txt_spec'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>
              
               

            </td>
            
         </tr>






<tr> 
          <th  >服务序列号</th>
          <td  >
                <asp:TextBox ID="txt_serial" CssClass="form-control" runat="server"></asp:TextBox>
           </td>
           
                   
        <th  >使用者:</th>
          <td  >
             <div class="input-group">
                 <asp:TextBox ID="txt_enduser" ClientIDMode="Static" CssClass="form-control" runat="server" ></asp:TextBox>
                 <span class="input-group-addon">
<a href="###" onclick="popusers();"><i class="glyphicon glyphicon-user"></i>  </a>
</span>
               </div>    
           </td>
           
             
                
         <th  >使用部门:</th>
          <td  > 
        
              
                  <div class="input-group">
                 <asp:TextBox ID="txt_dept" ClientIDMode="Static" CssClass="form-control" runat="server" ></asp:TextBox>
                 <span class="input-group-addon">
<a href="###" onclick="Pop('SelectDept.aspx',800,600,'部门');"><i class="glyphicon glyphicon-plus"></i>  </a>
</span>
               </div> 
              
              
              
              
                    </td>
             
       
          </tr>
  

             


      
      <tr  >     
                
         <th  >IT资产编号:</th>
          <td  > 
            
             <asp:TextBox runat="server"  ID="txt_itasset"  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>
 
              </td>


 



            
     
          <th >员工号:</th>
          <td >
             
           



               
             <asp:TextBox runat="server"  ID="txt_staffcode" Text=""  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>

 
              





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



 
 



              
            </td>
            </tr>

















                
      <tr  >     
                
         <th  >机器用途:</th>
          <td  > 
          


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


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_usetype','txt_usetype'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>
              

              </td>









            
     
          <th >使用状态:</th>
          <td >
             
           



                 <div class="input-group">
             <asp:TextBox runat="server"  ID="txt_usestatus" Text="在用"  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_usestatus','txt_usestatus'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>
              





           </td>
          
                
         <th  >操作系统:</th>
          <td  > 
             
         
          




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


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_os','txt_os'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>
              






              
            </td>
            </tr>








           <tr> 
          <th  >Office</th>
          <td  >
              
          
              
                 <div class="input-group">
             <asp:TextBox runat="server"  ID="txt_office"  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_office','txt_office'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>



              
           </td>
         
             


                <th  >所属组织</th>
          <td  >
            
                   <div class="input-group">
             <asp:TextBox runat="server"  ID="txt_belongto"  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_belongto','txt_belongto'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>








           </td>
       
            

                  <th  >存放位置:</th>
          <td  > 
             
          
              <div class="input-group">
             <asp:TextBox runat="server"  ID="txt_storeplace"  ClientIDMode="Static" CssClass="form-control"></asp:TextBox>


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_storeplace','txt_storeplace'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span>


                  </div>
              
                  
            </td>
            

                
    
          </tr>


          
            <tr>
                <td colspan="6"   >

                    <div  style=" width:99%; background-color:#e0e0e0; height:5px;"></div>

                </td>
            </tr>



             



         <tr>
              <th  >IP地址</th>
          <td  >
              <asp:TextBox ID="txt_ip" runat="server"  CssClass="form-control"  ClientIDMode="Static"  ></asp:TextBox>
		
           </td>
       
                 <th    >MAC地址</th>
          <td   >
              <asp:TextBox ID="txt_mac" runat="server"  ClientIDMode="Static"   CssClass="form-control"  ></asp:TextBox>
		
           </td>

       
         <th    >主板号:</th>
          <td   > 
             
              <asp:TextBox ID="txt_mainboardserialno" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>
            
     
     
          </tr>
          










            

         <tr>
              <th  >无线MAC</th>
          <td  >
              <asp:TextBox ID="txt_wifimac" runat="server"  CssClass="form-control"  ClientIDMode="Static"  ></asp:TextBox>
		
           </td>
       
                 <th    >外网</th>
          <td   >
             <asp:DropDownList runat="server" ID="ddl_isinternet" CssClass="form-control">
                 <asp:ListItem Text="是" Value="是"></asp:ListItem>
                    <asp:ListItem Text="否" Value="否"></asp:ListItem>
             </asp:DropDownList>
		
           </td>

       
         <th    >USB权限:</th>
          <td   > 
             
              <asp:DropDownList runat="server" ID="ddl_usbright" CssClass="form-control">
                 <asp:ListItem Text="是" Value="是"></asp:ListItem>
                    <asp:ListItem Text="否" Value="否"></asp:ListItem>
             </asp:DropDownList>
              
            </td> 
     
          </tr>
          







            
         <tr>
              <th  >粘贴标签</th>
          <td  >
            <asp:DropDownList runat="server" ID="ddl_tag" CssClass="form-control">
                 <asp:ListItem Text="Y" Value="Y"></asp:ListItem>
                    <asp:ListItem Text="N" Value="N"></asp:ListItem>
             </asp:DropDownList>
		
           </td>
       
                 <th    > 供应商 </th>
          <td   >
           
		<asp:TextBox runat="server" ID="txt_supply" CssClass="form-control"></asp:TextBox>
           </td>

       
         <th    > </th>
          <td   > 
             
          
              
            </td> 
     
          </tr>
          







            <tr> 
                
      
     
         
     
        
               
                     <th    >制造商</th>
          <td  >
              <asp:TextBox ID="txt_mainboardmanufacture" runat="server"   CssClass="form-control"  ></asp:TextBox>
		
           </td>

                
                     <th >采购时间:</th>
          <td  > 
             
              <asp:TextBox ID="dt_buydate"  CssClass="form-control" runat="server" onClick="laydate()"  ></asp:TextBox>
              
            </td>
            
     
                   <th  >保修到期日</th>
          <td  >
              <asp:TextBox ID="dt_expiredate"  CssClass="form-control" runat="server" onClick="laydate()" ></asp:TextBox>
		
           </td>


            </tr>


            <tr>



                
       
                
                 
         <th  >购买费用:</th>
          <td  > 
             
              <asp:TextBox ID="txt_money" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>


          <th >报废日期</th>
          <td >
              <asp:TextBox ID="dt_discarddate" runat="server" onClick="laydate()"  CssClass="form-control"    ></asp:TextBox>
		
           </td>

                <th>报废原因
                 

                </th>
                <td>

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


                  <span class="input-group-addon">
    <a href="#"   onclick="showpara('lbl_discardreason','txt_discardreason'); return false;"><i class="glyphicon glyphicon-plus"></i>

    </a>

</span> 
                  </div>
              

                </td>

            </tr>




            
            <tr>
                <td colspan="6"   >

                    <div  style=" width:99%; background-color:#e0e0e0; height:5px;"></div>

                </td>
            </tr>




            <tr>

                  <th    >显示器:</th>
          <td  > 
             
              <asp:TextBox ID="txt_display" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>



            <th   >CPU:</th>
          <td  > 
             
              <asp:TextBox ID="txt_cpu" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>



                

            <th   >内存（G）:</th>
          <td   > 
             
              <asp:TextBox ID="txt_mem" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>




            </tr>





               <tr>

                  <th    >硬盘（G）:</th>
          <td   > 
             
              <asp:TextBox ID="txt_harddisk" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>



            <th   >鼠标:</th>
          <td  > 
             
              <asp:TextBox ID="txt_mouse" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>



                

            <th   >键盘:</th>
          <td  > 
             
              <asp:TextBox ID="txt_keyboard" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>




            </tr>







             <tr>

           


            <th   >光驱:</th>
          <td  > 
             
              <asp:TextBox ID="txt_cd" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>

                    <th   > 网卡 </th>
          <td  > 
             
           <asp:TextBox ID="txt_netcard" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
            </td>

                

            <th   > 声卡</th>
          <td  > 
             
   <asp:TextBox ID="txt_sound" runat="server"  CssClass="form-control"  ></asp:TextBox>
              
              
            </td>




            </tr>


               </tbody>  
</table>

   
          
     </div>
      </div>     
          



    
    </asp:Panel>      
          
          
          
          
          
        
     
  <div class="panel panel-default">
    <div class="panel-heading">
     2.自定义硬件   <a href="pcparam.aspx?types=hardware"><img src="../images/add.png" border=0px />修改模板</a> 
    </div>
    
      <div class="panel-body">


          
        <asp:table runat="server" ID="tb_hardware"    CssClass="table">
         </asp:table>  
      

</div>
      </div>
      
                         
       
          
          
          
        


    
    
    
    
    
    
    
    
    
    
         
  <div class="panel panel-default">
    <div class="panel-heading">
     3.自定义软件   <a href="pcparam.aspx?types=software"><img src="../images/add.png" border=0px />修改模板</a> 
    </div>
    
      <div class="panel-body">  

        <asp:table runat="server" ID="tb_software"  CssClass="table">
         </asp:table>  
        </div>
      </div>
      
                
              
    
    
    
    
    
    
    
    
    
    
     <div class="panel panel-default">
    <div class="panel-heading">
    4.附件
    </div>
    
      <div class="panel-body">  
  
      <table  class="table" >
        <tbody>
     <tr  valign="top" >  
            <td width="190px">
                <b>添加附件</b>
            </td>
   
          <td colspan="4">
        
                 
       
                
                    <div style="display:inline-block" class="upload"> 
                    <div id=t123>
                       <div style="display:none" id=copy_t123>
                           <asp:Literal runat="server" ID="lt_attach"></asp:Literal>
                       </div>
                    <p id="p_pop">
                        
                        <a href="###" 
                        
                        onclick="layer.open({ type:2, content: '../SimlpeUploadFile.aspx?t=customlist&cid=t123', area: ['700px', '360px'], title:'添加附件'}); return false;"><asp:Literal runat="server" ID="lt_upload" Text="上传"></asp:Literal></a>


                    </p>
                     
                        <asp:Literal runat="server" ID="lt_editattach"></asp:Literal>


                    </div>

                    <input id="hfatta_t123"  type="hidden" name="hfatta_t123" />
                    <input  id="hfatta_t123_with_remove" type="hidden" name="hfatta_t123_with_remove"  />
                   
                         </div>



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



          

           
 
 

      </div>   
   </div>
 
    
    
    

    
    
    
    
    
    
    
     
    <script>
        //_cid:_t123 
        function AddAttach(_cid, _div, _path, _filename) {

            result = "<span><div id=" + _div + "><a target=_blank  href=" + _path + ">" + _filename + "</a> &nbsp;&nbsp;&nbsp;&nbsp;";

            result += "<img onclick=\"if(!confirm('确认删除该附件吗？'))return; $('#" + _div + "').remove();  $('#copy_" + _div + "').remove();  Rrfresh('" + _cid + "'); \" border=0 src=images/remove.gif></div></span>";


            resultcopy = "<div class=attach id=copy_" + _div + "><a target=_blank  href=" + _path + ">" + _filename + "</a> </div> ";


            $('#' + _cid).html($('#' + _cid).html() + result);

            $('#copy_' + _cid).html($('#copy_' + _cid).html() + resultcopy);

            Rrfresh(_cid);
        }

        function Rrfresh(_cid) {
            $('#hfatta_' + _cid).val($('#copy_' + _cid).html());
            BuildRemove();
        }


        function BuildRemove()
        {
            var result = "";

            $("#p_pop").siblings("span").each(
                function () {
                    result += $(this).html(); 
                }

                );;

            $("#hfatta_t123_with_remove").val("<span>"+result+"</span>");

        }

    </script>

    
    
    
    
    
    
    
    
    
    
    
    
    
    
      

            
  <div class="panel panel-default">
    <div class="panel-heading">
    5.备注
    </div>
    
      <div class="panel-body">  
  
      <table  class="table" >
        <tbody>

     <tr  >     
          <td colspan="4">
         <asp:TextBox runat="server" Width="90%" Height="60px"
             
              CssClass="form-control"
             
              TextMode="MultiLine" ID="note"></asp:TextBox>
               
             
              
          </td></tr>
          
          </tbody>
          </table>
         
   </div>
      </div>

   
    
    
    
      <div  class=" text-center">

      
               <asp:Button ID="btn_add"
                   runat="server" 
                   class="btn btn-primary btn-flat" 
                   OnClick="btn_add_Click"   Text="添加" />
            
          
            <asp:Button ID="btn_update" 
                 runat="server" 
                class="btn bg-fuchsia btn-flat"
                 OnClick="btn_update_Click"  
                 Text="更新" />
          

            <asp:Button ID="del" runat="server" 
                class="btn btn-primary btn-flat"
                 OnClick="btn_del_Click"  
                
                  OnClientClick="return confirm('确定删除吗？'); " 
                Text="删除" />
           



          
                <a href="Pc_List.aspx" class="btn btn-success btn-flat">返回</a>  


          <asp:PlaceHolder runat="server" ID="ph_log" Visible="false">
                 <a href="###" class="btn btn-success btn-default btn-flat" OnClick="Pop('../ajax/pc_logs.aspx?id=<%=Request.QueryString["id"] %>',700,600,'变更日志');return false;" >
              日志 </a>
         </asp:PlaceHolder>

              </div>
      
          
          
          
          
          
          
        
    <div style="display:none">
    <asp:Label runat="server" ClientIDMode="Static" ID="lbl_spec"></asp:Label>

    <asp:Label runat="server" ClientIDMode="Static" ID="lbl_usetype"></asp:Label>

      <asp:Label runat="server" ClientIDMode="Static" ID="lbl_usestatus"></asp:Label>

          <asp:Label runat="server" ClientIDMode="Static" ID="lbl_os"></asp:Label>

          <asp:Label runat="server" ClientIDMode="Static" ID="lbl_office"></asp:Label>


           <asp:Label runat="server" ClientIDMode="Static" ID="lbl_belongto"></asp:Label>

           <asp:Label runat="server" ClientIDMode="Static" ID="lbl_storeplace"></asp:Label>

        <asp:Label runat="server" ClientIDMode="Static" ID="lbl_discardreason"></asp:Label>

        </div>
    
    
    

              <script>



                  function showpara( _contId, _txtId) {

                      layer.open({
                          type: 1,
                          skin: 'layui-layer-rim', //加上边框
                          area: ['420px', '240px'], //宽高
                          content: formatStr($("#" + _contId).html(), _txtId)
                      });

                  }


                  function formatStr(cont, _txtId)
                  {
                      var result = "";
                      var items = cont.split(';');
                      for (var i = 0; i < items.length; i++)
                      {

                          result += '<a href="#" onclick="javascript:closethis(this,'+"'"+_txtId +"'"+ '); return false;" class="btn  btn-flat  btn-sm">' + items[i] + '</a> ';

                      }

                      return result;
                  }


                  function closethis(cont, _txtId)
                  { 
                     
                      $("#" + _txtId).val($(cont).html()); 
                      layer.closeAll();
                  
                  }

                   


                  function popusers() {
                      Pop('Pop_Users.aspx', 900, 600, '选择人员');
                  }


                  
                  function setuser(result) {

                      setpopuser(result, '', '', 'txt_enduser', '', '', 'txt_staffcode', 'txt_dept');
         
                  }
                  



                  function setpopuser(result, uid, username, displayname, tel, email, staffcode, dept) {
                      result = result.split("!")[0];
                      var _result = result.split("$");
                      if (uid != "") {
                          $('#' + uid).val(_result[0]);
                      }
                      if (username != "") {
                          $('#' + username).val(_result[1]);
                      }

                      if (displayname != "") {
                          $('#' + displayname).val(_result[2]);
                      }

                      if (tel != "") {
                          $('#' + tel).val(_result[3]);
                      }


                      if (email != "") {
                          $('#' + email).val(_result[4]);
                      }


                      if (staffcode != "") {
                          $('#' + staffcode).val(_result[5]);
                      }

                      if (dept != "") {
                          $('#' + dept).val(_result[6]);
                      }


                  }


                  </script>



     

    <br /><br /><br />  
</asp:Content>
