user_edit.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>编辑内容</title>
  7. </head>
  8. <body layout:fragment="content">
  9. <article class="page-container">
  10. <form class="form form-horizontal" id="form-content-edit">
  11. <input type="hidden" th:name="id" th:id="uid" th:value="${user.id}"/>
  12. <div class="row cl">
  13. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账号:</label>
  14. <div class="formControls col-xs-8 col-sm-9">
  15. <input type="text" class="input-text" value="" th:value="${user.nick_name}" th:id="nick_name"
  16. placeholder="请输入用户名" th:name="nick_name"/>
  17. </div>
  18. </div>
  19. <th:block th:if="${user.user_type!=3}">
  20. <div class="row cl">
  21. <label class="form-label col-xs-4 col-sm-2">所属部门:</label>
  22. <div class="formControls col-xs-8 col-sm-9">
  23. <select id="department_select" th:name="department_id">
  24. <option value="">--请选择--</option>
  25. <option th:each="item : ${departments}" th:selected="${user.department_id==item.id}"
  26. th:value="${item.id}">
  27. [[*{item.name}]]
  28. </option>
  29. </select>
  30. </div>
  31. </div>
  32. <div class="row cl">
  33. <label class="form-label col-xs-4 col-sm-2">审核层级:</label>
  34. <div class="formControls col-xs-8 col-sm-9">
  35. <select id="approve_level_select" th:name="approve_level" class="input-text">
  36. <option value="">--请选择--</option>
  37. <option th:selected="${user.approve_level}==0" th:value="0">第一层级</option>
  38. <option th:selected="${user.approve_level}==1" th:value="1">第二层级</option>
  39. </select>
  40. </div>
  41. </div>
  42. <div class="row cl">
  43. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>角色:</label>
  44. <div class="formControls col-xs-8 col-sm-9">
  45. <select id="role_select" th:name="roleIds" class="selectpicker" multiple data-live-search="true">
  46. <option th:each="item : ${roles}" th:value="${item.id}">
  47. [[*{item.name}]]
  48. </option>
  49. </select>
  50. </div>
  51. </div>
  52. </th:block>
  53. <div class="row cl">
  54. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>联系人:</label>
  55. <div class="formControls col-xs-8 col-sm-9">
  56. <input type="text" class="input-text" value="" th:value="${user.user_name}" placeholder="请输入联系人"
  57. th:name="user_name"/>
  58. </div>
  59. </div>
  60. <div class="row cl">
  61. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>联系电话:</label>
  62. <div class="formControls col-xs-8 col-sm-9">
  63. <input type="text" class="input-text" value="" placeholder="请输入联系电话" th:value="${user.phone}"
  64. th:name="phone"/>
  65. </div>
  66. </div>
  67. <div class="row cl">
  68. <label class="form-label col-xs-4 col-sm-2"><span>是否管理员:</span></label>
  69. <div class="formControls col-xs-8 col-sm-9">
  70. <input type="radio" name="is_admin" th:checked="${user.is_admin==false }" value="false">否</input>
  71. <input type="radio" name="is_admin" th:checked="${user.is_admin==true }" value="true">是</input>
  72. </div>
  73. </div>
  74. <div class="row cl">
  75. <label class="form-label col-xs-4 col-sm-2"><span>身份证号:</span></label>
  76. <div class="formControls col-xs-8 col-sm-9">
  77. <input type="text" class="input-text" value="" placeholder="请输入身份证号" th:name="id_number"/>
  78. </div>
  79. </div>
  80. <div class="row cl">
  81. <label class="form-label col-xs-4 col-sm-2"><span>证件上传:</span></label>
  82. <div class="formControls col-xs-8 col-sm-9">
  83. <div class="uploader-thum-container">
  84. <div id="fileListPre" class="uploader-list">
  85. <th:block th:unless="${user.fileDown.file_url} == null">
  86. <a th:href="${fileUrl} + ${user.fileDown.file_url}" target="_blank">[[${user.fileDown.file_name}]]</a>
  87. </th:block>
  88. </div>
  89. <div id="filePicker">选择文件</div>
  90. <input type="hidden" name="file_url" id="img" th:value="${user.fileDown.file_url}"/>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="row cl">
  95. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  96. <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i>保存</button>
  97. <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
  98. </div>
  99. </div>
  100. </form>
  101. </article>
  102. <script type="text/javascript" th:src="@{/js/government/user/user_edit.js}"></script>
  103. <script th:inline="javascript">
  104. $(function () {
  105. // 初始化上传
  106. var options = {
  107. uploadBtnId: '#filePicker',
  108. picturePreId: 'fileListPre',
  109. hiddenPictureUrl: 'img',
  110. hiddenPictureName: 'imgName',
  111. width: 81,
  112. height: 81
  113. };
  114. var webUploadDoc = new $WebUploadDoc(options);
  115. webUploadDoc.init();
  116. });
  117. /**
  118. * 取消
  119. */
  120. function removeIframe() {
  121. var index = parent.layer.getFrameIndex(window.name);
  122. parent.layer.close(index);
  123. }
  124. $(window).load(function () {
  125. initRoleSelect();
  126. initDepartmentSelect();
  127. $("#role_select").select2({
  128. multiple: true,
  129. width: '100%',
  130. language: {
  131. noResults: function (params) {
  132. return "暂无数据";
  133. }
  134. }
  135. });
  136. });
  137. function initRoleSelect() {
  138. $("#role_select").val([[${user.roleIds}]]).trigger("change");
  139. }
  140. function initDepartmentSelect() {
  141. $("#department_select").select2({
  142. width: '100%',
  143. language: {
  144. noResults: function (params) {
  145. return "暂无数据";
  146. }
  147. }
  148. });
  149. }
  150. </script>
  151. </body>
  152. </html>