add_group_class.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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('addGroupClass')}" class="form-horizontal">
  8. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  9. <input type="hidden" name="day" value="{$day|default=''}">
  10. <input type="hidden" name="gid" value="{$gid|default=''}">
  11. <div class="form-group">
  12. <label class="col-sm-2 control-label">方式<span class="text-danger">*</span></label>
  13. <div class="col-sm-6">
  14. <select name="type" onchange="setTT(this.value)" class="form-control">
  15. <option value="1">班次排班</option>
  16. <option value="2">周期排班</option>
  17. </select>
  18. </div>
  19. </div>
  20. <div class="form-group" id="b1" {if isset($info) && $info.type==2} style="display: none" {/if}>
  21. <label class="col-sm-2 control-label">班次</label>
  22. <div class="col-sm-6">
  23. <select name="class_id" class="form-control">
  24. <option value="0">休息</option>
  25. {foreach $classList as $k=>$v}
  26. <option value="{$v.id}">{$v.name}</option>
  27. {/foreach}
  28. </select>
  29. </div>
  30. </div>
  31. <div class="form-group" id="b2" {if !isset($info) || (isset($info) && $info.type==1)} style="display: none" {/if}>
  32. <label class="col-sm-2 control-label">考勤周期</label>
  33. <div class="col-sm-6">
  34. <select name="week" class="form-control">
  35. <option value="0">休息</option>
  36. {if !empty($weekList['title'])}
  37. <option value="{$weekList.days}">{$weekList.title}</option>
  38. {/if}
  39. </select>
  40. </div>
  41. </div>
  42. <div class="hr-line-dashed"></div>
  43. <div class="form-group">
  44. <div class="col-sm-6 col-sm-offset-2">
  45. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  46. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. {/block}
  55. {block name="script"}
  56. <script>
  57. $(document).ready(function(){
  58. formSetValue("type", {$info.type|default=1});
  59. });
  60. function setTT(val) {
  61. if(val==1){
  62. $("#b1").css('display','block');
  63. $("#b2").css('display','none');
  64. }
  65. if(val==2){
  66. $("#b1").css('display','none');
  67. $("#b2").css('display','block');
  68. }
  69. }
  70. </script>
  71. {/block}