123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>{$title}</h5>
- <div class="ibox-tools">
- <a class="toback" href="{:url('index')}">
- 返回上一页
- </a>
- </div>
- </div>
- <div class="ibox-content">
- <form method="post" action="{:url('add')}" class="form-horizontal">
- <input type="hidden" name="id" value="{$info['id']|default='0'}">
- <div class="form-group">
- <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">时间段设置<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <select name="type" class="form-control" id="changeType">
- <option value="1">一天一次上下班</option>
- <option value="2">一天二次上下班</option>
- <option value="3">一天三次上下班</option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">第一次开始时间~结束时间<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <div class="col-xs-6" style="padding-left: 0">
- {:widget_view('common/timepicker',['name'=>'start1', 'val' =>isset($info['start1'])?$info['start1']:''])}
- </div>
- <div class="col-xs-6" style="padding-right: 0">
- {:widget_view('common/timepicker',['name'=>'end1', 'val' =>isset($info['end1'])?$info['end1']:''])}
- </div>
- </div>
- </div>
- <div class="form-group" id="start22" style="display: none">
- <label class="col-sm-2 control-label">第二次开始时间~结束时间<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <div class="col-xs-6" style="padding-left: 0">
- {:widget_view('common/timepicker',['name'=>'start2', 'val' =>isset($info['start2'])?$info['start2']:''])}
- </div>
- <div class="col-xs-6" style="padding-right: 0">
- {:widget_view('common/timepicker',['name'=>'end2', 'val' =>isset($info['end2'])?$info['end2']:''])}
- </div>
- </div>
- </div>
- <div class="form-group" id="start33" style="display: none">
- <label class="col-sm-2 control-label">第三次开始时间~结束时间<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <div class="col-xs-6" style="padding-left: 0">
- {:widget_view('common/timepicker',['name'=>'start3', 'val' =>isset($info['start3'])?$info['start3']:''])}
- </div>
- <div class="col-xs-6" style="padding-right: 0">
- {:widget_view('common/timepicker',['name'=>'end3', 'val' =>isset($info['end3'])?$info['end3']:''])}
- </div>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-6 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确 定</button>
- <a href="{:url('index')}" class="btn btn-default">取 消</a>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(document).ready(function(){
- formSetValue("enable", {$info.enable|default=1});
- });
- $(document).ready(function(){
- formSetValue("type", {$info.type|default=1});
- });
- //监听下拉列表的change事件
- $(function (){
- var types =$('#changeType').val(); //获取下拉列表选中的值
- if(types == 1){
- $('#start22').attr('style','display:none');
- $('#start33').attr('style','display:none');
- }
- if(types == 2){
- $('#start22').attr('style','display:block');
- $('#start33').attr('style','display:none');
- }
- if(types == 3){
- $('#start22').attr('style','display:block');
- $('#start33').attr('style','display:block');
- }
- })
- $("#changeType").change(function(){
- var types = $(this).val(); //获取下拉列表选中的值
- if(types == 1){
- $('#start22').attr('style','display:none');
- $('#start33').attr('style','display:none');
- }
- if(types == 2){
- $('#start22').attr('style','display:block');
- $('#start33').attr('style','display:none');
- }
- if(types == 3){
- $('#start22').attr('style','display:block');
- $('#start33').attr('style','display:block');
- }
- });
- </script>
- {/block}
|