add.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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-title">-->
  7. <!--<h5>{$meta_title}</h5>-->
  8. <!--<div class="ibox-tools">-->
  9. <!--<a class="toback" href="{:url('index')}">-->
  10. <!--返回上一页-->
  11. <!--</a>-->
  12. <!--</div>-->
  13. <!--</div>-->
  14. <input type="hidden" id="is_first" value="{$info['id']|default='0'}">
  15. <div class="ibox-content">
  16. <form method="post" action="{:url('add')}" class="form-horizontal">
  17. <input type="hidden" name="id" value="{$info['user_id']|default='0'}">
  18. <div class="tabs-container">
  19. <ul class="nav nav-tabs">
  20. <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 基本信息</a></li>
  21. <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">证件照信息</a></li>
  22. <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">详细介绍</a></li>
  23. </ul>
  24. <div class="tab-content">
  25. <div id="tab-1" class="tab-pane active">
  26. <div class="panel-body" style="min-height: 450px">
  27. <div class="form-group">
  28. <label class="col-sm-2 control-label">账号<span class="text-danger">*</span></label>
  29. <div class="col-sm-6">
  30. <input type="text" class="form-control" name="account" value="{$info.account|default=''}">
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <label class="col-sm-2 control-label">姓名<span class="text-danger">*</span></label>
  35. <div class="col-sm-6">
  36. <input type="text" class="form-control" name="real_name" value="{$info.real_name|default=''}">
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="col-sm-2 control-label">密码</label>
  41. <div class="col-sm-6">
  42. <input type="password" class="form-control" name="password" placeholder="新增时必填,不修改不用填" value="">
  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. <input type="text" class="form-control" name="mobile" value="{$info.mobile|default=''}">
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="col-sm-2 control-label">所在科室/部门<span class="text-danger">*</span></label>
  53. <div class="col-sm-6">
  54. <select name="depId" class="form-control">
  55. <option value="0">选择科室/部门</option>
  56. {volist name="deps" id="v"}
  57. <option value="{$v.id}">{$v.title}</option>
  58. {/volist}
  59. </select>
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <label class="col-sm-2 control-label">角色<span class="text-danger">*</span></label>
  64. <div class="col-sm-6">
  65. <select name="rolesId" class="form-control">
  66. <option value="0">选择角色</option>
  67. {volist name="roles" id="v"}
  68. <option value="{$v.id}">{$v.title}</option>
  69. {/volist}
  70. </select>
  71. </div>
  72. </div>
  73. <div class="form-group">
  74. <label class="col-sm-2 control-label">头像<span class="text-danger">*</span></label>
  75. <div class="col-sm-6">
  76. {:widget('common/upimg',['name'=>'head_image','multi'=>0,'val'=>isset($info)?$info.head_image:''])}
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-sm-2 control-label">身份证号<span class="text-danger">*</span></label>
  81. <div class="col-sm-6">
  82. <input type="text" class="form-control" name="card" value="{$info.card|default=''}">
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <label class="col-sm-2 control-label">开始工作日期</label>
  87. <div class="col-sm-6">
  88. <input type="text" readonly class="form-control" id="date" name="work" value="{$info.work|default=''}">
  89. </div>
  90. </div>
  91. <div class="form-group">
  92. <label class="col-sm-2 control-label">是否推荐</label>
  93. <div class="col-sm-6">
  94. <label class="cr-inline">
  95. <input type="radio" value="0" name="recommend">未推荐&nbsp;&nbsp;
  96. </label>
  97. <label class="cr-inline">
  98. <input type="radio" value="1" name="recommend">推荐
  99. </label>
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <label class="col-sm-2 control-label">是否禁用</label>
  104. <div class="col-sm-6">
  105. <label class="cr-inline">
  106. <input type="radio" value="0" name="enable">禁用&nbsp;&nbsp;
  107. </label>
  108. <label class="cr-inline">
  109. <input type="radio" value="1" name="enable">否
  110. </label>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div id="tab-4" class="tab-pane">
  116. <div class="panel-body" style="min-height: 450px">
  117. <div class="form-group">
  118. <label class="col-sm-2 control-label">身份证正反面照片</label>
  119. <div class="col-sm-6">
  120. {:widget('common/upimg',['name'=>'card_imgs','max'=>2,'multi'=>1,'val'=>isset($info)?$info.card_imgs:''])}
  121. </div>
  122. </div>
  123. <div class="form-group">
  124. <label class="col-sm-2 control-label">证件照片</label>
  125. <div class="col-sm-6">
  126. {:widget('common/upimg',['name'=>'id_imgs','multi'=>1,'max'=>20,'val'=>isset($info)?$info.id_imgs:''])}
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <div id="tab-5" class="tab-pane">
  132. <div class="panel-body" style="min-height: 450px">
  133. <div class="form-group">
  134. <!-- <label class="col-sm-2 control-label">详细介绍<span class="text-danger">*</span></label>-->
  135. <div class="col-sm-8">
  136. {:widget('common/ueditor',['name'=>'content','height'=>300,'val'=>isset($info)?$info['content']:''])}
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="hr-line-dashed"></div>
  144. <div class="form-group">
  145. <div class="col-sm-4 col-sm-offset-2">
  146. <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>
  147. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  148. </div>
  149. </div>
  150. </form>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. {/block}
  156. {block name="script"}
  157. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  158. <script>
  159. $(document).ready(function(){
  160. formSetValue("gender", {$info.gender|default=1});
  161. formSetValue("recommend", {$info.recommend|default=0});
  162. formSetValue("enable", {$info.enable|default=1});
  163. formSetValue("depId", {$info.dep_id|default=0});
  164. formSetValue("rolesId", {$info.roles_id|default=0});
  165. });
  166. laydate.render({
  167. elem: '#date',
  168. type:'date',
  169. trigger: 'click' ,
  170. theme: '#337ab7',
  171. });
  172. function checkAll() {
  173. var checkbox=document.getElementById('allInput');//获取div
  174. var checked=checkbox.getElementsByTagName('input');//获取div下的input
  175. var allCheck=document.getElementById('all');//获取div
  176. var allChecked=allCheck.getElementsByTagName('input');//获取div下的input
  177. for(i=0;i<checked.length;i++){
  178. if(checked[i].className=='check'){
  179. checked[i].checked = allChecked[0].checked;
  180. }
  181. }
  182. }
  183. $(function () {
  184. var checkbox=document.getElementById('allInput');//获取div
  185. var checked=checkbox.getElementsByTagName('input');//获取div下的input
  186. $(document).on('click','.check',function () {
  187. var all = false;
  188. var count = 0;
  189. for(i=0;i<checked.length;i++){
  190. if(checked[i].className=='check'){
  191. if(checked[i].checked){
  192. all = true;
  193. count++;
  194. }
  195. }
  196. }
  197. var allCheck=document.getElementById('all');//获取div
  198. var allChecked=allCheck.getElementsByTagName('input');//获取div下的input
  199. if(!all){
  200. for(i=0;i<allChecked.length;i++){
  201. allChecked[i].checked = false;
  202. }
  203. }
  204. if(all && parseInt(count)*2===checked.length){
  205. for(i=0;i<allChecked.length;i++){
  206. allChecked[i].checked = true;
  207. }
  208. }
  209. if(all && parseInt(count)*2!==checked.length){
  210. for(i=0;i<allChecked.length;i++){
  211. allChecked[i].checked = false;
  212. }
  213. }
  214. })
  215. })
  216. </script>
  217. {/block}