add.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <form method="post" action="{:url('add')}" class="form-horizontal">
  8. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  9. <input type="hidden" name="patrol_mode" value="{$info['patrol_mode']|default=$mode}">
  10. <div class="form-group">
  11. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  12. <div class="col-sm-6">
  13. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  14. </div>
  15. </div>
  16. {if $mode==4}
  17. <div class="form-group">
  18. <label class="col-sm-2 control-label">检查项<span class="text-danger">*</span></label>
  19. <div class="col-sm-6">
  20. {:widget_view('common/select2',['title'=>'检查项','name'=>'cate_id','name1'=>'patrol_form','lists'=>$cate,'options1' =>isset($patrol_form)?$patrol_form:[],'value' =>isset($info)?$info['cate_id']:[],'url'=>url('PatrolForm/getByCateFrom'), 'value1' =>isset($info)?$info['patrol_form']:[]])}
  21. </div>
  22. </div>
  23. {else}
  24. <div class="form-group">
  25. <label class="col-sm-2 control-label">检查项<span class="text-danger">*</span></label>
  26. <div class="col-sm-6">
  27. {:widget_view('common/multiselect',['name'=>'patrol_form','lists' => $patrol_form, 'val' => isset($info)?$info['patrol_form']:[]])}
  28. </div>
  29. </div>
  30. {/if}
  31. <div class="form-group">
  32. <label class="col-sm-2 control-label">备注</label>
  33. <div class="col-sm-6">
  34. <textarea name="remark" class="form-control" id="" cols="30" rows="5">{$info.remark|default=''}</textarea>
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-sm-2 control-label">状态</label>
  39. <div class="col-sm-6">
  40. <label class="cr-inline">
  41. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  42. </label>
  43. <label class="cr-inline">
  44. <input type="radio" value="0" name="enable">禁用
  45. </label>
  46. </div>
  47. </div>
  48. <div class="hr-line-dashed"></div>
  49. <div class="form-group">
  50. <div class="col-sm-6 col-sm-offset-2">
  51. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  52. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  53. </div>
  54. </div>
  55. </form>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. {/block}
  61. {block name="script"}
  62. <script>
  63. $(document).ready(function(){
  64. formSetValue("enable", {$info.enable|default=1});
  65. });
  66. </script>
  67. {/block}