<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript">
  window.UMEDITOR_HOME_URL = ctx + "/page/umeditor/";
  var URL = window.UEDITOR_HOME_URL;
</script>
<form class="layui-form whitebg pb10 pt10" action="" id="data_form">  
	<div class="tab-pane active">     
		<div class="panel-body">
			<div class="wrapper wrapper-content">
				<div class="panel-form animated fadeInRight wp60 fc">
					<div class="layui-form-item dn	has-error" >   
						<label class="layui-form-label">id</label>  
						<div class="layui-input-block">
							<input type="text" name="id" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.id }" >
						</div>  
					</div>
					
					
					<!--管理员看到的  -->
                    <c:if test="${admin eq 'admin' }">
                       <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">商户</label>
                                <div class="layui-input-block">
                                    <select name="merchantCode" lay-filter="selectMerchantCode" id="merchantCode">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantBaseInfoList }" var="mb">
                                            <option value="${mb.merchantCode }" <c:if test="${merchantDevice.merchantCode eq mb.merchantCode }">selected="selected"</c:if>>${mb.merchantName }</option>
                                        </c:forEach>
                                    </select>              
                                </div>
                            </div>
                        </div>
                    </c:if>
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">设备名称</label>  
						<div class="layui-input-block">
							<input type="text" name="name" id="name" lay-verify="title" autocomplete="off"  placeholder="请输入内容" class="layui-input" value="${merchantDevice.name }" >
						</div>  
					</div>
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">设备类型</label>  
						<div class="layui-input-block">
							<input type="text" name="type" id="type" lay-verify="title"  autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.type }" >
						</div>  
					</div>
					<c:if test="${admin eq 'admin'||userType eq 'merchant'  }">
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">简介</label>  
						<div class="layui-input-block">
						  <textarea class="layui-textarea" id="introDesc"  >${merchantDevice.introDesc }</textarea>
						</div>  
					</div>
					</c:if>
					<c:if test="${admin ne 'admin'&&userType ne 'merchant'  }">
					   <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">简介</label>  
                        <div class="layui-input-block">
                          <textarea class="layui-textarea"  readonly="readonly">${merchantDevice.introDesc }</textarea>
                        </div>  
                    </div>
					</c:if>
					
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">status</label>  
						<div class="layui-input-block">
							<input type="text" name="status" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.status }" >
						</div>  
					</div> --%>
			<div class="form-group">
                <div class="layui-form-item">          
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <select name="status" lay-filter="aihao" id="status"  >  
                            <option value=""></option>
                            <option value="1" <c:if test="${merchantDevice.status eq '1' }">selected="selected"</c:if>>使用</option>         
                            <option value="0" <c:if test="${merchantDevice.status eq '0' }">selected="selected"</c:if>>不使用</option>
                        </select>              
                    </div>
                </div>
            </div>
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">createDt</label>  
						<div class="layui-input-block">
							<input type="text" name="createDt" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.createDt }" >
						</div>  
					</div> --%>
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">merchantCode</label>  
						<div class="layui-input-block">
							<input type="text" name="merchantCode" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.merchantCode }" >
						</div>  
					</div> --%>
					<%-- <div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">userId</label>  
						<div class="layui-input-block">
							<input type="text" name="userId" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.userId }" >
						</div>  
					</div> --%>
					<div class="layui-form-item 	has-error" >   
						<label class="layui-form-label">设备sn</label>  
						<div class="layui-input-block">
							<input type="text" name="sn" id="sn" lay-verify="title"  autocomplete="off" placeholder="请输入内容" class="layui-input" value="${merchantDevice.sn }" >
						</div>  
					</div>
					
					<c:if test="${admin eq 'admin' }">
                       <input type="hidden" id="isAdmin" value="1">
                    </c:if>
                    <c:if test="${admin ne 'admin' }">
                       <input type="hidden" id="isAdmin" value="0">
                    </c:if>
	
				</div>
			</div>
		</div>  
	</div>
</form>
<script type="text/javascript">
    //form表单样式
    layui.use(['layer', 'form'], function() {    
        var layer = layui.layer,
            form = layui.form;
        form.render();
    });
    $(function(){
        UM.getEditor('introDesc');
    })
</script>

