<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>    
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%> 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">                      
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> 
<meta name="format-detection" content="telephone=no">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> 
<meta name="renderer" content="webkit">
<!-- 移动设备 viewport -->                                     
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">   
<jsp:include page="../../common.jsp" />
<script type="text/javascript">
</script>
<title>编辑</title>
</head>                                 
	<body class="lgraybg">            
		<div class="	container-fluid animated fadeInRight col-sm-12">
			<div class="panel-toolbar mt10 mb10 pt5 pb5 pl10 bdd whitebg">
				<div class="buttons">
					<!-- <a href="javascript:void(0);" class="btn btn-primary fa fa-save f12"><span>保存</span></a> -->
					<a href="${ctx }/activityConsumReturn/index?pageIndex=${pageIndex}"  class="btn btn-primary fa fa-back f12" id="goback"><span>返回</span></a>
				</div>
			</div>
				<div class="tabs-container whitebg">
					<div class="pt10 pl5 pr5">
						<ul class="nav nav-tabs" id="nav-tabs">
							<li class="active" data-action="base">   
								<a href="javascript:void(0);" >基本资料</a>
							</li>
							<!-- <li class="" data-action="functions">
								<a href="javascript:void(0);"  >多功能输入</a>
							</li>
							<li class="" data-action="extends">
								<a href="javascript:void(0);" >扩展属性</a>
							</li> -->
						</ul>
						<div class="tab-content pt30 p30">               
		                      <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="${activityConsumReturn.id }" >
                        </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="${activityConsumReturn.userId }" >
                        </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="${activityConsumReturn.merchantCode }" >
                        </div>  
                    </div>
                    <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">merchantName</label>  
                        <div class="layui-input-block">
                            <input type="text" name="merchantName" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.merchantName }" >
                        </div>  
                    </div>
                    <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">storeId</label>  
                        <div class="layui-input-block">
                            <input type="text" name="storeId" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.storeId }" >
                        </div>  
                    </div>
                    <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">storeName</label>  
                        <div class="layui-input-block">
                            <input type="text" name="storeName" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.storeName }" >
                        </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" disabled="disabled">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantBaseInfoList }" var="mb">
                                            <option value="${mb.merchantCode }" <c:if test="${activityConsumReturn.merchantCode eq mb.merchantCode }">selected="selected"</c:if>>${mb.merchantName }</option>
                                        </c:forEach>
                                    </select>              
                                </div>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">门店</label>
                                <div class="layui-input-block">
                                    <select name="storeId" id="storeId" disabled="disabled">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantStoreList }" var="ms">
                                            <option value="${ms.storeId }" <c:if test="${ms.storeId eq activityConsumReturn.storeId }">selected="selected"</c:if>>${ms.storeName }</option>
                                        </c:forEach>
                                    </select>              
                                </div>
                            </div>
                        </div>
                    </c:if>
                    
                    <!--不是管理员看到的  -->
                    <c:if test="${admin ne 'admin' }">
                       <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">门店</label>
                                <div class="layui-input-block">
                                    <select name="storeId" id="storeId" disabled="disabled">  
                                        <option value="">请选择</option>
                                        <c:forEach items="${merchantStoreList }" var="ms">
                                            <option value="${ms.storeId }" <c:if test="${ms.storeId eq activityConsumReturn.storeId }">selected="selected"</c:if>>${ms.storeName }</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" required="required" id="name" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.name }" >
                        </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="${activityConsumReturn.createDt }" >
                        </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" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.type }" >
                        </div>  
                    </div> --%>
                    
                    <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">活动类型</label>
                                <div class="layui-input-block">
                                    <select name="type" lay-filter="selectType" id="type" disabled="disabled">  
                                        <option value="">请选择</option>
                                        <option value="0" <c:if test="${activityConsumReturn.type eq '0' }">selected="selected"</c:if> >分等级返现</option>
                                        <option value="1" <c:if test="${activityConsumReturn.type eq '1' }">selected="selected"</c:if> >等比例返现</option>
                                        <option value="2" <c:if test="${activityConsumReturn.type eq '2' }">selected="selected"</c:if> >百分比返现</option>
                                    </select>              
                                </div>
                            </div>
                        </div>
                    
                    <div class="layui-form-item    has-error" id="percentDetail">   
                        <label class="layui-form-label">百分比返现比例</label>  
                        <div class="layui-input-block">
                            <input type="text" name="percent" readonly="readonly" id="percent" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.percent }" >
                        </div>  
                    </div>
                    
                    <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">消费金额</label>  
                        <div class="layui-input-block">
                            <input type="text" name="comsumeMoney" readonly="readonly" id="comsumeMoney" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.comsumeMoney }" >
                        </div>  
                    </div>
                    <div class="layui-form-item     has-error" >   
                        <label class="layui-form-label">返现金额</label>  
                        <div class="layui-input-block">
                            <input type="text" name="returnMoney" id="returnMoney"  readonly="readonly" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.returnMoney }" >
                        </div>  
                    </div>
                    
                    <div class="form-group">
                            <div class="layui-form-item">          
                                <label class="layui-form-label">活动时间类型</label>
                                <div class="layui-input-block">
                                    <select name="timeType" lay-filter="selectTimeType" id="timeType" disabled="disabled">  
                                        <option value="">请选择</option>
                                        <option value="0" <c:if test=" ${activityConsumReturn.timeType eq '0' }">selected="selected"</c:if> >永久</option>
                                        <option value="1" <c:if test=" ${activityConsumReturn.timeType eq '1' }">selected="selected"</c:if> >设置时间</option>
                                    </select>              
                                </div>
                            </div>
                        </div>
                        
                       <div class="mt10 mb20" id="dateDetail">
                                <span class="dlblock w100 textr">开始日期</span>
                                <span class="bdc pt6 pb6 pl6 pr5 w180 dlblock">
                                     <input type="text" placeholder="" name="startDt" readonly="readonly" id="date1"  value="<fmt:formatDate value='${activityConsumReturn.startDt }' pattern='yyyy-MM-dd' />"  class="w150">
                                     <i class="fa fa-calendar"></i>
                                </span> 
                                <span class="dlblock w100 textr">结束日期</span>
                                <span class="bdc pt6 pb6 pl6 pr5 w180 dlblock"> 
                                <input type="text" placeholder="" name="endDt" readonly="readonly" id="date2" value="<fmt:formatDate value='${activityConsumReturn.endDt }' pattern='yyyy-MM-dd' />" class="w150"> 
                                    <i class="fa fa-calendar"></i>
                                </span>
                         </div>
                    
                    <%-- <div class="layui-form-item    has-error" >   
                        <label class="layui-form-label">活动时间类型</label>  
                        <div class="layui-input-block">
                            <input type="text" name="timeType" lay-verify="title" autocomplete="off" placeholder="请输入内容" class="layui-input" value="${activityConsumReturn.timeType }" >
                        </div>  
                    </div> --%>
    
                </div>
            </div>
        </div>  
    </div>
</form>
<script type="text/javascript">
$(function(){
    //form表单样式
    layui.use(['layer', 'form'], function() {    
        var layer = layui.layer,
            form = layui.form;
        form.render();
    });
    
  /* //日历控件
    layui.use(['layer', 'laydate'], function() {
        var layer = layui.layer;
        laydate = layui.laydate;
        laydate.render({
        elem: '#date1' //指定元素
        });
        laydate.render({
            elem: '#date2' //指定元素
        });
    }); */
  $("#dateDetail").hide();
  $("#percentDetail").hide();
  if($("#timeType").val()=='1'){
      $("#dateDetail").show();
  }
  if($("#type")=='2'){
      $("#percentDetail").show();
  }
});
</script> 
						</div>     
					</div>
				</div>    
		</div>
		<!-- 隐藏域 -->
		<input type="hidden" id="activityConsumReturnId" value="${activityConsumReturn.id }"/>
	</body>
</html>

