add.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. {if condition="isset($info) and $info['type'] eq 2"}
  10. <div class="form-group" style="display: none;">
  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="account" value="{$info.account|default=''}">
  14. </div>
  15. </div>
  16. {else /}
  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. <input type="text" class="form-control" name="account" value="{$info.account|default=''}">
  21. </div>
  22. </div>
  23. {/if}
  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. <input type="text" class="form-control" name="real_name" value="{$info.real_name|default=''}">
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <label class="col-sm-2 control-label">密码</label>
  32. <div class="col-sm-6">
  33. <input type="password" autocomplete="off" class="form-control" name="password" placeholder="新增时必填,不修改不用填" value="">
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <label class="col-sm-2 control-label">手机号</label>
  38. <div class="col-sm-6">
  39. <input type="text" class="form-control" name="mobile" value="{$info.mobile|default=''}">
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label class="col-sm-2 control-label">所在科室/部门<span class="text-danger">*</span></label>
  44. <div class="col-sm-6">
  45. <select name="depId" class="form-control">
  46. <option value="0">选择科室/部门</option>
  47. {volist name="deps" id="v"}
  48. <option value="{$v.id}">{$v.title}</option>
  49. {/volist}
  50. </select>
  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. <select name="rolesId" onchange="setBx(this.value)" class="form-control">
  57. <option value="0">选择角色</option>
  58. {volist name="roles" id="v"}
  59. <option value="{$v.id}">{$v.title}</option>
  60. {/volist}
  61. </select>
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label">护士站始发空间</label>
  66. <div class="col-sm-6">
  67. {:widget('common/select',['name'=>'addr_id','lists'=>$address,'value'=>isset($info.addr_id)?$info.addr_id:""])}
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <label class="col-sm-2 control-label">排序</label>
  72. <div class="col-sm-6">
  73. <input type="number" class="form-control" name="sort" value="{$info.sort|default='0'}">
  74. </div>
  75. </div>
  76. <div class="form-group">
  77. <label class="col-sm-2 control-label">状态</label>
  78. <div class="col-sm-6">
  79. <label class="cr-inline">
  80. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  81. </label>
  82. <label class="cr-inline">
  83. <input type="radio" value="0" name="enable">禁用
  84. </label>
  85. </div>
  86. </div>
  87. <div class="form-group" {if !isset($info) || $info['is_bx']!=1} style="display: none" {/if} id="bxlx">
  88. <label class="col-sm-2 control-label">报修类型</label>
  89. <div class="col-sm-6">
  90. {:widget_view('common/select',['name'=>'type_id','lists'=>$orderType,'value'=>isset($info)&&!empty($info['type_id']) ?$info['type_id']:''])}
  91. </div>
  92. </div>
  93. <div class="hr-line-dashed"></div>
  94. <div class="form-group">
  95. <div class="col-sm-6 col-sm-offset-2">
  96. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  97. </div>
  98. </div>
  99. </form>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. {/block}
  105. {block name="script"}
  106. <script>
  107. function setBx(val) {
  108. console.log(val)
  109. $.post('{:url("getRole")}',{id:val},function (res) {
  110. if(res.data.show==1){
  111. $("#bxlx").css('display','block');
  112. }else {
  113. $("#bxlx").css('display','none');
  114. }
  115. })
  116. }
  117. $(document).ready(function(){
  118. formSetValue("enable", {$info.enable|default=1});
  119. formSetValue("depId", {$info.dep_id|default=0});
  120. formSetValue("rolesId", {$info.roles_id|default=0});
  121. });
  122. </script>
  123. {/block}