add.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. <div class="form-group">
  10. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  11. <div class="col-sm-6">
  12. <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label">类型<span class="text-danger">*</span></label>
  17. <div class="col-sm-6">
  18. <select name="parent_id" onchange="setType(this.value)" class="form-control">
  19. <option value="0">选择类型</option>
  20. {volist name="commons" id="v"}
  21. <option value="{$v.id}">{$v.name}</option>
  22. {/volist}
  23. </select>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-2 control-label">派单权限</label>
  28. <div class="col-sm-6">
  29. {:widget_view('common/multiselect',['name'=>'work_type_mode','lists' =>$workType, 'val' =>isset($info)?$info['work_type_mode']:[]])}
  30. </div>
  31. </div>
  32. <div id="dispatch" {if isset($info) && $info.parent_id==9} style="display: block" {else} style="display: none" {/if}>
  33. <div class="form-group">
  34. <label class="col-sm-2 control-label">调度级别</label>
  35. <div class="col-sm-6">
  36. <label class="cr-inline">
  37. <input type="radio" value="1" name="level">一级调度&nbsp;&nbsp;
  38. </label>
  39. <label class="cr-inline">
  40. <input type="radio" value="2" name="level">二级调度
  41. </label>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="col-sm-2 control-label">备注</label>
  47. <div class="col-sm-6">
  48. <textarea name="content" class="form-control" rows="2">{$info.content|default=''}</textarea>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="col-sm-2 control-label">排序</label>
  53. <div class="col-sm-6">
  54. <input type="number" class="form-control" name="sort" value="{$info.sort|default='0'}">
  55. </div>
  56. </div>
  57. <div class="form-group">
  58. <label class="col-sm-2 control-label">状态</label>
  59. <div class="col-sm-6">
  60. <label class="cr-inline">
  61. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  62. </label>
  63. <label class="cr-inline">
  64. <input type="radio" value="0" name="enable">禁用
  65. </label>
  66. </div>
  67. </div>
  68. <div class="hr-line-dashed"></div>
  69. <div class="form-group">
  70. <div class="col-sm-6 col-sm-offset-2">
  71. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  72. </div>
  73. </div>
  74. </form>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. {/block}
  80. {block name="script"}
  81. <script>
  82. $(document).ready(function(){
  83. formSetValue("enable", {$info.enable|default=1});
  84. formSetValue("level", {$info.level|default=1});
  85. formSetValue("parent_id", {$info.parent_id|default=0});
  86. });
  87. function setType(val) {
  88. if(val==9){
  89. $("#dispatch").css('display','block')
  90. }else {
  91. $("#dispatch").css('display','none')
  92. }
  93. }
  94. </script>
  95. {/block}