<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../language.jsp" %>


<link href="../scripts/jquery/uploadify/uploadify.css"  rel="stylesheet" type="text/css"/>   
<script src="../scripts/itsm/cm/configureItemEdit.js?random=<%=new java.util.Date().getTime()%>"></script>



<div class="loading" id="configureItemEdit_loading"><img src="../images/icons/loading.gif" /></div>
	
<div id="configureItemEdit_panel" class="easyui-panel content" fit="true" border="none">
	
	<div class="easyui-layout"  fit="true">
		<!-- 新的面板 start-->
		
		<div region="north" border="false" class="northBar">
			<DIV align="left">
				<a id="itemEditSave" class="easyui-linkbutton" icon="icon-save" plain="true"><fmt:message key="common.save"/></a>
				<a class="easyui-linkbutton" plain="true" icon="icon-undo" style="margin-right:10px" onclick="itsm.cm.configureItemEdit.returnConfigureItemList()"><fmt:message key="common.returnToList" /></a>
			</DIV>
		</div>
		
		<div region="west" split="true" title="<fmt:message key="common.basicInfo" />" style="width:450px">
		
		        <form id="configureItemEdit_form">
		        <input type="hidden" name="ciDto.ciId" id="editCiId" value="${ciDto.ciId}"/>
		         <div class="lineTableBgDiv">
		           
				<table style="width:100%" class="lineTable" cellspacing="1">
        
         
	            <tr>
	                <td style="width:40%"><fmt:message key="ci.ci"/><fmt:message key="common.category"/></td>
					<td style="width:60%">
					  <input type="hidden" name="ciDto.categoryNo" id="ci_categoryNo_edit" value="${ciDto.categoryNo}"/>
					  <input name="ciDto.categoryName" value="${ciDto.categoryName}" id="ci_categoryName_edit" class="easyui-validatebox input" required="true" 
					  onclick="itsm.cm.ciCategoryTree.autoUpdateEavAttrCiCategoryTree('configureItemEditCategory','configureItemEditCategoryTree','ci_categoryNo_edit','ci_categoryName_edit','ci_edit_eavAttributet')" 
					  readonly style="cursor:pointer"/>
	                </td>
	             </tr><tr>   
	                <td><fmt:message key="lable.ci.assetNo"/></td>
	                <td>
	                  <input name="ciDto.cino" id="ci_edit_cino" value="${ciDto.cino}" class="easyui-validatebox input" required="true" validType="length[1,50]" />
	                </td>
	            </tr>
	            <tr>
	                <td><fmt:message key="label.name"/></td>
	                <td>
	                <input name="ciDto.ciname" id="ciname_edit" value="${ciDto.ciname}" class="easyui-validatebox input" required="true" validType="length[1,50]"/>
	                </td>
	           </tr>
	           <tr>     
	                <td><fmt:message key="ci.productType"/></td>
	                <td>
	                <input name="ciDto.model" id="model"  class="input" value="${ciDto.model}"/>
	                </td>        
	            </tr>
	            
	            <tr>
	                <td><fmt:message key="ci.serialNumber"/></td>
	                <td>
	                <input name="ciDto.serialNumber" id="serialNumber" class="input" value="${ciDto.serialNumber}"/>
	                </td>
	            </tr>
	            
	            <tr>    
	                <td><fmt:message key="ci.barcode"/></td>
	                <td>
	                <input name="ciDto.barcode" id="barcode" class="input" value="${ciDto.barcode}" />
	                </td>
	            </tr>
	            
	            <tr>
	                <td><fmt:message key="ci.purchaseNo"/></td>
	                <td>
	                <input name="ciDto.poNo" id="poNo" class="input" value="${ciDto.poNo}" />
	                </td>
	            </tr>
	            
	            <tr>
	                <td><fmt:message key="common.status"/></td>
	                <td>
	 
	                <select name="ciDto.statusId" id="ci_statusAdd" class="input">
	                	<c:forEach items="${dictionaryItemsStatusList}" var="dc">
	                
	                	<option value="${dc.dcode}" ${dc.dcode eq ciDto.statusId?'selected':''}>${dc.dname}</option>
	                	</c:forEach>
	                </select>
	                
	                </td>
	                
	                
	            </tr>
	            
	            <tr>    
	                <td><fmt:message key="ci.brands"/></td>
	                <td>
	                
	                 <select name="ciDto.brandId" id="ci_brandNameAdd" value="${ciDto.brandId}" class="input">
	                	<c:forEach items="${dictionaryItemsBrandList}" var="dc">
	                	<option value="${dc.dcode}" ${dc.dcode eq ciDto.brandId?'selected':''} >${dc.dname}</option>
	                	</c:forEach>
	                </select>
	                                           
	                </td>
	            </tr>
	            <tr>
	                <td><fmt:message key="label.supplier"/></td>
	                <td>

	                <select name="ciDto.providerId" id="ci_providerAdd" class="input">
	                	<c:forEach items="${dictionaryItemsProviderList}" var="dc">
	                	<option value="${dc.dcode}" ${dc.dcode eq ciDto.providerId?'selected':''}>${dc.dname}</option>
	                	</c:forEach>
	                </select>
	
	                </td>
	            </tr>
	            
	            <tr>    
	                <td><fmt:message key="ci.location"/></td>
	                <td>
	                
	                <select name="ciDto.locId" id="ci_locAdd" class="input">
	                	<c:forEach items="${dictionaryItemsLocList}" var="dc">
	                	<option value="${dc.dcode}" ${dc.dcode eq ciDto.locId?'selected':''}>${dc.dname}</option>
	                	</c:forEach>
	                </select>
	            
	                </td>
	            </tr>
	            <tr>
	                <td><fmt:message key="ci.purchaseDate"/></td>
	                <td>
	                
		                <input style="cursor:pointer" name="ciDto.buyDate" id="configureItem_edit_buyDate" class="easyui-datebox choose" value="<fmt:formatDate type="date" value="${ciDto.buyDate}"  pattern="yyyy-MM-dd" />" readonly />
	                </td>
	             </tr>
	             
	             <tr>   
	                <td><fmt:message key="ci.arrivalDate"/></td>
	                <td>
		                <input style="cursor:pointer" name="ciDto.arrivalDate" id="configureItem_edit_arrivalDate" class="easyui-validatebox easyui-datebox choose" validType="DateComparison['configureItem_edit_buyDate']" value="<fmt:formatDate type="date" value="${ciDto.arrivalDate}"  pattern="yyyy-MM-dd" />" readonly/>
	                </td>
	            </tr>
	            <tr>     
	                 <td><fmt:message key="ci.warningDate"/></td>
	                <td>
		                 <input style="cursor:pointer" name="ciDto.warningDate" id="warningDate" class="easyui-datebox choose" value="<fmt:formatDate type="date" value="${ciDto.warningDate}"  pattern="yyyy-MM-dd" />" readonly/>
	                </td>
	            </tr>
	
	            <tr>
	                <td><fmt:message key="ci.lifeCycle"/></td>
	                <td>
	                	<input name="ciDto.lifeCycle" id="lifeCycle" class="easyui-validatebox input"  value="<c:if test="${ciDto.lifeCycle!='0'}">${ciDto.lifeCycle}</c:if>" min="0"/>
	                </td>
	            </tr>
	            
	            <tr>    
	                <td><fmt:message key="ci.warrantyDate"/></td>
	                <td>

	                <input name="ciDto.warranty" id="warranty" class="easyui-validatebox input"   value="<c:if test="${ciDto.warranty!='0'}">${ciDto.warranty}</c:if>" min="0"/>

	                </td>
	            </tr>
	            <tr>
	                <td><fmt:message key="ci.use"/></td>
	                <td>
	                <input name="ciDto.userName" id="ci_edit_useName" class="choose"  value="${ciDto.userName}" />
	                
	            
	                </td>
	            </tr>
	            
	            <tr>    
	                <td><fmt:message key="ci.owner"/></td>
	                <td><input name="ciDto.owner" id="ci_edit_owner" class="choose"  value="${ciDto.owner}" /></td>  
	            </tr>
	            <tr><td colspan="2">&nbsp;<br><br><br><br></td></tr>
          </table>
          </div>
         </form>
		
		
		</div>
			
			
		<div region="center" id="configureItemEdit_tabs" title="<fmt:message key="common.detailInfo" />" >
			
			<!-- 扩展信息 start -->
			<div class="easyui-tabs"  id="configureItemEditSlarule" fit="true" border="false">
				<div title="<fmt:message key="config.extendedInfo"/>" style="overflow:hidden;">
					<div id="ciNotExtendedInfo" style="padding: 5px;"><s:if test="attributeList==null"><span style="color:#939090"><h3><fmt:message key="label.ciNotExtendedInfo" /></h3></span></s:if></div>
					
					<form>
						<div class="lineTableBgDiv" id="ci_edit_eavAttributet" >
						
						<table style="width:100%" class="lineTable" cellspacing="1">
              			<s:iterator value="attributeList" status="attrs">
              			<tr>
						    <td>
						    	<s:property value="attrAsName"/>
						    </td>
						    <td>
						    	<s:if test="%{attrType=='String'}" >
						    		<input style="width:98%" name="ciDto.attrVals['${attrName}']" value="${ciDto.attrVals[attrName]}"/>
						    	</s:if>
						    	<s:if test="%{attrType=='Date'}" >
						    		<input style="width:98%" name="ciDto.attrVals['${attrName}']" value="${ciDto.attrVals[attrName]}" class="easyui-datebox" />
						    	</s:if>
						    	
						    	<s:if test="%{attrType=='Integer'}" >
						    		<input style="width:98%" name="ciDto.attrVals['${attrName}']" value="${ciDto.attrVals[attrName]}" class="easyui-numberbox" min="0" maxlength="9"/>
						    	</s:if>
						    	
						    	<s:if test="%{attrType=='Double'}" >
						    		<input style="width:98%" name="ciDto.attrVals['${attrName}']" value="${ciDto.attrVals[attrName]}" class="easyui-numberbox" precision="3"/>
						    	</s:if>
						    	<s:if test="%{attrType=='Lob'}" >
						    		<textarea style="width:98%" name="ciDto.attrVals['${attrName}']">${ciDto.attrVals[attrName]}</textarea>
						    	</s:if>
							</td>
					       </tr>
						</s:iterator>
                	</table>
                	</div>
                	</form>
                	
				</div>
				<div title="<fmt:message key="common.attachment"/>">
				
					<form>
                	<div class="lineTableBgDiv">
					<table style="width:100%" class="lineTable" cellspacing="1">
                		<tr>
			              <td>
			              
			               <input type="file"  name="filedata" id="editConfigureItem_uploadAttachments">
				 		   <div style="padding-top:3px">
				 		    	<a class="easyui-linkbutton" icon="icon-ok" href="javascript:$('#editConfigureItem_uploadAttachments').uploadifyUpload()" ><fmt:message key="label.attachment.upload" /></a>
	             		   </div>
	              		   <div id="editConfigureItem_oldUploadedAttachments" style="line-height:25px;color:#555"></div>
				           <div id="editConfigureItem_fileQueue"></div>  
				           <input style=" width: 100%" type="hidden" name="ciDto.attachmentStr" id="editConfigureItem_attachments"/>
              
			              </td>
			        	</tr>
			        	
                	</table>
                	</div>
                	</form>
				
				</div>
	
	    	</div>
			<!-- 扩展信息 end -->
		</div>
	
	</div>
<!-- 新的面板 end-->
</div>

    <!-- 选择配置项分类 -->
    <div id="configureItemEditCategory" class="easyui-window"  closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="common.select"/><fmt:message key="ci.ci"/><fmt:message key="common.category"/>" style="width:400px;height:400px;padding:3px">
		<div id="configureItemEditCategoryTree"></div>
	</div> 


