123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <form method="post" action="{:url('editTodo')}" class="form-horizontal">
- <input type="hidden" name="id" value="{$info['id']|default='0'}">
- <div class="form-group">
- <label class="col-xs-2 control-label">开始时间<span class="text-danger">*</span></label>
- <div class="col-xs-6">
- <input type="text" class="form-control" placeholder="请选择" readonly id="start" name="start" value="{$info.start|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-2 control-label">结束时间<span class="text-danger">*</span></label>
- <div class="col-xs-6">
- <input type="text" class="form-control" readonly placeholder="请选择" id="end" name="end" value="{$info.end|default=''}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-2 control-label">服务天数</label>
- <div class="col-xs-6">
- <input type="number" class="form-control" id="day" name="day" value="{$info.day|default=''}">
- <span class="help-block m-b-none">不填或为0,系统将自动计算服务天数</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">备注</label>
- <div class="col-sm-6">
- <textarea name="remark" class="form-control" value="{$info.remark|default=''}"></textarea>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">状态</label>
- <div class="col-sm-6">
- <label class="cr-inline">
- <input type="radio" value="1" name="status">服务中
- </label>
- <label class="cr-inline">
- <input type="radio" value="2" name="status">已结束
- </label>
- <label class="cr-inline">
- <input type="radio" value="0" name="status">已作废
- </label>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
- </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>
- laydate.render({
- elem: '#start',
- //设置开始日期、日期日期的 input 选择器
- //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
- type: 'datetime',
- trigger: 'click',
- theme: '#2e6da4'
- });
- laydate.render({
- elem: '#end',
- //设置开始日期、日期日期的 input 选择器
- //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
- type: 'datetime',
- trigger: 'click',
- theme: '#2e6da4'
- });
- $(document).ready(function(){
- formSetValue("status", {$info.status|default=1});
- });
- function changeDay() {
- var start = $('#start').val();
- var end = $('#end').val();
- console.log(start,end);
- // if(!start || !end || end <= start){
- // $('#day').val(0);
- // }else{
- // var days = getDaysBetween(start,end);
- //
- // console.log(days);
- // }
- }
- function getDaysBetween(dateString1,dateString2){ // 获取两个日期之间的天数
- var startDate = Date.parse(dateString1);
- var endDate = Date.parse(dateString2);
- if (startDate>endDate){
- return 0;
- }
- if (startDate==endDate){
- return 1;
- }
- var days=(endDate - startDate)/(1*24*60*60*1000);
- return days + 1;
- };
- </script>
- {/block}
|