123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .layui-laydate-content>.layui-laydate-list {
- padding-bottom: 0px;
- overflow: hidden;
- }
- .layui-laydate-content>.layui-laydate-list>li{
- width:50%
- }
- .merge-box .scrollbox .merge-list {
- padding-bottom: 5px;
- }
- </style>
- <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="title" value="{$info.title|default=''}" placeholder="请输入任务名称">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">日常工作地点<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget_view('common/multiselect',['name'=>'addrs','lists' =>$dailyAddr, 'val' =>isset($info)?$info['daily_addr']:[]])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">检查人员<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- {:widget_view('common/user-group-select',['name'=>'user_ids','multi'=>$send_user_num,'lists'=>$dailyUser,'val' =>isset($info)?$info['daily_user']:'','msg'=>''])}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">开始时间<span class="text-danger">*</span></label>
- <div class="col-sm-6">
- <input class="form-control" id="date" readonly name="start_time" value="{$info.start_time|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">
- <input class="form-control" id="date-one" readonly name="end_time" value="{$info.end_time|default=''}">
- </div>
- </div>
- {if condition="empty($info['id'])"}
- <div class="form-group">
- <label class="col-sm-2 control-label">重复任务间隔时长</label>
- <div class="col-sm-6">
- <select name="hours" class="form-control">
- {for start="0" end="12" }
- <option value="{$i}">{$i}小时</option>
- {/for}
- </select>
- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> “开始”和“结束”时间之间每隔多少小时重复执行一次,如果不需要重复设置为0即可</span>
- </div>
- </div>
- {else}
- <input type="hidden" name="hours" value="0">
- {/if}
- {if condition="empty($info['id'])"}
- <div class="form-group">
- <label class="col-sm-2 control-label">连续执行天数 </label>
- <div class="col-sm-6">
- <select name="days" class="form-control">
- {for start="0" end="30" }
- <option value="{$i}">{$i}天</option>
- {/for}
- </select>
- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>连续执行多少天;如果不需要重复设置为0即可,跨天不可设置</span>
- </div>
- </div>
- {else}
- <input type="hidden" name="days" value="0">
- {/if}
- <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 type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- var time =new Date();
- //日期时间选择器
- laydate.render({
- elem: '#date',
- type: 'datetime',
- format:'yyyy-MM-dd HH:mm',
- trigger: 'click' ,
- theme:'#284a94'
- // value:dateFormat(),
- });
- laydate.render({
- elem: '#date-one',
- type: 'datetime',
- trigger: 'click' ,
- format:'yyyy-MM-dd HH:mm',
- theme:'#284a94'
- // value:dateFormatH(),
- });
- //当前日期格式化
- function dateFormat() {
- var year=time.getFullYear();
- var mouth=time.getMonth()+ 1;
- if(mouth < 10){
- var mouths='0'+mouth;
- }else {
- var mouths=mouth;
- }
- var day=time.getDate();
- if(day < 10){
- var days='0'+day;
- }else {
- var days=day;
- }
- var hour=time.getHours();
- if(hour < 10){
- var hours='0'+hour;
- }else {
- var hours=hour;
- }
- var minute=time.getMinutes();
- if(minute < 10){
- var minutes='0'+minute;
- }else {
- var minutes=minute;
- }
- var dateStr=year+'-'+mouths+'-'+days+' '+hours+':'+minutes;
- return dateStr;
- }
- function dateFormatH() {
- var year=time.getFullYear();
- var mouth=time.getMonth()+ 1;
- if(mouth < 10){
- var mouths='0'+mouth;
- }else {
- var mouths=mouth;
- }
- var day=time.getDate();
- if(day < 10){
- var days='0'+day;
- }else {
- var days=day;
- }
- var hour=time.getHours();
- if(hour < 10){
- var hours='0'+hour;
- }else {
- var hours=hour;
- }
- var minute=time.getMinutes()+20;
- var dateStr=year+'-'+mouths+'-'+days+' '+hours+':'+minute;
- return dateStr;
- }
- </script>
- {/block}
|