add.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .layui-laydate-content>.layui-laydate-list {
  5. padding-bottom: 0px;
  6. overflow: hidden;
  7. }
  8. .layui-laydate-content>.layui-laydate-list>li{
  9. width:50%
  10. }
  11. .merge-box .scrollbox .merge-list {
  12. padding-bottom: 5px;
  13. }
  14. </style>
  15. <div class="row">
  16. <div class="col-sm-12">
  17. <div class="ibox float-e-margins">
  18. <div class="ibox-title">
  19. <h5>{$title}</h5>
  20. <div class="ibox-tools">
  21. <a class="toback" href="{:url('index')}">
  22. 返回上一页
  23. </a>
  24. </div>
  25. </div>
  26. <div class="ibox-content">
  27. <form method="post" action="{:url('add')}" class="form-horizontal">
  28. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label">任务名称<span class="text-danger">*</span></label>
  31. <div class="col-sm-6">
  32. <input type="text" class="form-control" name="title" value="{$info.title|default=''}" placeholder="请输入任务名称">
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label">日常工作地点<span class="text-danger">*</span></label>
  37. <div class="col-sm-6">
  38. {:widget_view('common/multiselect',['name'=>'addrs','lists' =>$dailyAddr, 'val' =>isset($info)?$info['daily_addr']:[]])}
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <label class="col-sm-2 control-label">检查人员<span class="text-danger">*</span></label>
  43. <div class="col-sm-6">
  44. {:widget_view('common/user-group-select',['name'=>'user_ids','multi'=>$send_user_num,'lists'=>$dailyUser,'val' =>isset($info)?$info['daily_user']:'','msg'=>''])}
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <label class="col-sm-2 control-label">开始时间<span class="text-danger">*</span></label>
  49. <div class="col-sm-6">
  50. <input class="form-control" id="date" readonly name="start_time" value="{$info.start_time|default=''}">
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <label class="col-sm-2 control-label">结束时间<span class="text-danger">*</span></label>
  55. <div class="col-sm-6">
  56. <input class="form-control" id="date-one" readonly name="end_time" value="{$info.end_time|default=''}">
  57. </div>
  58. </div>
  59. {if condition="empty($info['id'])"}
  60. <div class="form-group">
  61. <label class="col-sm-2 control-label">重复任务间隔时长</label>
  62. <div class="col-sm-6">
  63. <select name="hours" class="form-control">
  64. {for start="0" end="12" }
  65. <option value="{$i}">{$i}小时</option>
  66. {/for}
  67. </select>
  68. <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> “开始”和“结束”时间之间每隔多少小时重复执行一次,如果不需要重复设置为0即可</span>
  69. </div>
  70. </div>
  71. {else}
  72. <input type="hidden" name="hours" value="0">
  73. {/if}
  74. {if condition="empty($info['id'])"}
  75. <div class="form-group">
  76. <label class="col-sm-2 control-label">连续执行天数 </label>
  77. <div class="col-sm-6">
  78. <select name="days" class="form-control">
  79. {for start="0" end="30" }
  80. <option value="{$i}">{$i}天</option>
  81. {/for}
  82. </select>
  83. <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>连续执行多少天;如果不需要重复设置为0即可,跨天不可设置</span>
  84. </div>
  85. </div>
  86. {else}
  87. <input type="hidden" name="days" value="0">
  88. {/if}
  89. <div class="hr-line-dashed"></div>
  90. <div class="form-group">
  91. <div class="col-sm-6 col-sm-offset-2">
  92. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确 定</button>
  93. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  94. </div>
  95. </div>
  96. </form>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. {/block}
  102. {block name="script"}
  103. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  104. <script>
  105. var time =new Date();
  106. //日期时间选择器
  107. laydate.render({
  108. elem: '#date',
  109. type: 'datetime',
  110. format:'yyyy-MM-dd HH:mm',
  111. trigger: 'click' ,
  112. theme:'#148d8f'
  113. // value:dateFormat(),
  114. });
  115. laydate.render({
  116. elem: '#date-one',
  117. type: 'datetime',
  118. trigger: 'click' ,
  119. format:'yyyy-MM-dd HH:mm',
  120. theme:'#148d8f'
  121. // value:dateFormatH(),
  122. });
  123. //当前日期格式化
  124. function dateFormat() {
  125. var year=time.getFullYear();
  126. var mouth=time.getMonth()+ 1;
  127. if(mouth < 10){
  128. var mouths='0'+mouth;
  129. }else {
  130. var mouths=mouth;
  131. }
  132. var day=time.getDate();
  133. if(day < 10){
  134. var days='0'+day;
  135. }else {
  136. var days=day;
  137. }
  138. var hour=time.getHours();
  139. if(hour < 10){
  140. var hours='0'+hour;
  141. }else {
  142. var hours=hour;
  143. }
  144. var minute=time.getMinutes();
  145. if(minute < 10){
  146. var minutes='0'+minute;
  147. }else {
  148. var minutes=minute;
  149. }
  150. var dateStr=year+'-'+mouths+'-'+days+' '+hours+':'+minutes;
  151. return dateStr;
  152. }
  153. function dateFormatH() {
  154. var year=time.getFullYear();
  155. var mouth=time.getMonth()+ 1;
  156. if(mouth < 10){
  157. var mouths='0'+mouth;
  158. }else {
  159. var mouths=mouth;
  160. }
  161. var day=time.getDate();
  162. if(day < 10){
  163. var days='0'+day;
  164. }else {
  165. var days=day;
  166. }
  167. var hour=time.getHours();
  168. if(hour < 10){
  169. var hours='0'+hour;
  170. }else {
  171. var hours=hour;
  172. }
  173. var minute=time.getMinutes()+20;
  174. var dateStr=year+'-'+mouths+'-'+days+' '+hours+':'+minute;
  175. return dateStr;
  176. }
  177. </script>
  178. {/block}