serv.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('服务列表')" />
  5. <th:block th:include="include :: layout-latest-css" />
  6. <th:block th:include="include :: ztree-css" />
  7. </head>
  8. <body class="gray-bg">
  9. <div class="ui-layout-center">
  10. <div class="container-div">
  11. <div class="row">
  12. <div class="col-sm-12 search-collapse">
  13. <form id="user-form">
  14. <input type="hidden" id="deptId" name="deptId">
  15. <input type="hidden" id="parentId" name="parentId">
  16. <div class="select-list">
  17. <ul>
  18. <li>
  19. 查询名称:<input type="text" name="loginName"/>
  20. </li>
  21. <li>
  22. 手机号码:<input type="text" name="phonenumber"/>
  23. </li>
  24. <li>
  25. 用户状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
  26. <option value="">所有</option>
  27. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  28. </select>
  29. </li>
  30. <li class="select-time">
  31. <label>创建时间: </label>
  32. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
  33. <span>-</span>
  34. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
  35. </li>
  36. <li>
  37. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  38. <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  39. </li>
  40. </ul>
  41. </div>
  42. </form>
  43. </div>
  44. <div class="btn-group-sm" id="toolbar" role="group">
  45. <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:user:add">
  46. <i class="fa fa-plus"></i> 新增
  47. </a>
  48. <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
  49. <i class="fa fa-edit"></i> 修改
  50. </a>
  51. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
  52. <i class="fa fa-remove"></i> 删除
  53. </a>
  54. <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
  55. <i class="fa fa-upload"></i> 导入
  56. </a>
  57. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
  58. <i class="fa fa-download"></i> 导出
  59. </a>
  60. </div>
  61. <div class="col-sm-12 select-table table-striped">
  62. <table id="bootstrap-table"></table>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <th:block th:include="include :: footer" />
  68. <th:block th:include="include :: layout-latest-js" />
  69. <th:block th:include="include :: ztree-js" />
  70. <script th:inline="javascript">
  71. var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
  72. var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
  73. var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
  74. var prefix = ctx + "server/serv";
  75. $(function() {
  76. var panehHidden = false;
  77. if ($(this).width() < 769) {
  78. panehHidden = true;
  79. }
  80. $('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
  81. // 回到顶部绑定
  82. if ($.fn.toTop !== undefined) {
  83. var opt = {
  84. win:$('.ui-layout-center'),
  85. doc:$('.ui-layout-center')
  86. };
  87. $('#scroll-up').toTop(opt);
  88. }
  89. queryUserList();
  90. queryDeptTree();
  91. });
  92. function queryUserList() {
  93. var options = {
  94. url: prefix + "/list",
  95. viewUrl: prefix + "/view/{id}",
  96. createUrl: prefix + "/add",
  97. updateUrl: prefix + "/edit/{id}",
  98. removeUrl: prefix + "/remove",
  99. exportUrl: prefix + "/export",
  100. importUrl: prefix + "/importData",
  101. importTemplateUrl: prefix + "/importTemplate",
  102. sortName: "createTime",
  103. sortOrder: "desc",
  104. modalName: "服务",
  105. columns: [{
  106. checkbox: true
  107. },
  108. {
  109. field: 'serviceTypeNumber',
  110. title: '服务类型编号'
  111. },
  112. {
  113. field: 'serviceTypeName',
  114. title: '服务类型名称'
  115. },
  116. {
  117. field: 'serviceTypeDescription',
  118. title: '服务类型描述'
  119. },
  120. {
  121. field: 'fulfillmentParty',
  122. title: '履约方'
  123. },
  124. /*{
  125. visible: editFlag == 'hidden' ? false : true,
  126. title: '用户状态',
  127. align: 'center',
  128. formatter: function (value, row, index) {
  129. return statusTools(row);
  130. }
  131. },*/
  132. {
  133. title: '操作',
  134. align: 'center',
  135. formatter: function(value, row, index) {
  136. if (row.serviceId != 1) {
  137. var actions = [];
  138. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.serviceId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  139. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.serviceId + '\')"><i class="fa fa-remove"></i>删除</a> ');
  140. var more = [];
  141. /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
  142. more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
  143. actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
  144. return actions.join('');
  145. } else {
  146. return "";
  147. }
  148. }
  149. }]
  150. };
  151. $.table.init(options);
  152. }
  153. function queryDeptTree()
  154. {
  155. var url = ctx + "system/user/deptTreeData";
  156. var options = {
  157. url: url,
  158. expandLevel: 2,
  159. onClick : zOnClick
  160. };
  161. $.tree.init(options);
  162. function zOnClick(event, treeId, treeNode) {
  163. $("#deptId").val(treeNode.id);
  164. $("#parentId").val(treeNode.pId);
  165. $.table.search();
  166. }
  167. }
  168. $('#btnExpand').click(function() {
  169. $._tree.expandAll(true);
  170. $(this).hide();
  171. $('#btnCollapse').show();
  172. });
  173. $('#btnCollapse').click(function() {
  174. $._tree.expandAll(false);
  175. $(this).hide();
  176. $('#btnExpand').show();
  177. });
  178. $('#btnRefresh').click(function() {
  179. queryDeptTree();
  180. });
  181. /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
  182. function resetPre() {
  183. resetDate();
  184. $("#user-form")[0].reset();
  185. $("#deptId").val("");
  186. $("#parentId").val("");
  187. $(".curSelectedNode").removeClass("curSelectedNode");
  188. $.table.search();
  189. }
  190. /* 用户管理-部门 */
  191. function dept() {
  192. var url = ctx + "system/dept";
  193. $.modal.openTab("部门管理", url);
  194. }
  195. /* 用户管理-重置密码 */
  196. function resetPwd(userId) {
  197. var url = prefix + '/resetPwd/' + userId;
  198. $.modal.open("重置密码", url, '800', '300');
  199. }
  200. /* 用户管理-分配角色 */
  201. function authRole(userId) {
  202. var url = prefix + '/authRole/' + userId;
  203. $.modal.openTab("用户分配角色", url);
  204. }
  205. /* 用户状态显示 */
  206. function statusTools(row) {
  207. if (row.status == 1) {
  208. return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
  209. } else {
  210. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
  211. }
  212. }
  213. /* 用户管理-停用 */
  214. function disable(userId) {
  215. $.modal.confirm("确认要停用用户吗?", function() {
  216. $.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 1 });
  217. })
  218. }
  219. /* 用户管理启用 */
  220. function enable(userId) {
  221. $.modal.confirm("确认要启用用户吗?", function() {
  222. $.operate.post(prefix + "/changeStatus", { "userId": userId, "status": 0 });
  223. })
  224. }
  225. </script>
  226. </body>
  227. <!-- 导入区域 -->
  228. <!--<script id="importTpl" type="text/template">
  229. <form enctype="multipart/form-data" class="mt20 mb10">
  230. <div class="col-xs-offset-1">
  231. <input type="file" id="file" name="file"/>
  232. <div class="mt10 pt5">
  233. <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
  234. &nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
  235. </div>
  236. <font color="red" class="pull-left mt10">
  237. 提示:仅允许导入“xls”或“xlsx”格式文件!
  238. </font>
  239. </div>
  240. </form>
  241. </script>-->
  242. </html>