customer.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="formId">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. <label>客户id:</label>
  15. <input type="text" name="customerId"/>
  16. </li>
  17. <li>
  18. <label>客户姓名:</label>
  19. <input type="text" name="customerName"/>
  20. </li>
  21. <li>
  22. <label>手机号码:</label>
  23. <input type="text" name="phonenumber"/>
  24. </li>
  25. <li>
  26. <label>客户性别:</label>
  27. <select name="sex" th:with="type=${@dict.getType('sys_user_sex')}">
  28. <option value="">所有</option>
  29. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  30. </select>
  31. </li>
  32. <li class="select-time">
  33. <label>客户生日:</label>
  34. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBirthday]"/>
  35. <span>-</span>
  36. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBirthday]"/>
  37. </li>
  38. <li>
  39. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  40. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  41. </li>
  42. </ul>
  43. </div>
  44. </form>
  45. </div>
  46. <div class="btn-group-sm" id="toolbar" role="group">
  47. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customer:add">
  48. <i class="fa fa-plus"></i> 添加
  49. </a>
  50. <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:customer:edit">
  51. <i class="fa fa-edit"></i> 修改
  52. </a>
  53. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:customer:remove">
  54. <i class="fa fa-remove"></i> 删除
  55. </a>
  56. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:customer:export">
  57. <i class="fa fa-download"></i> 导出
  58. </a>
  59. </div>
  60. <div class="col-sm-12 select-table table-striped">
  61. <table id="bootstrap-table"></table>
  62. </div>
  63. </div>
  64. </div>
  65. <th:block th:include="include :: footer" />
  66. <script th:inline="javascript">
  67. var editFlag = [[${@permission.hasPermi('system:customer:edit')}]];
  68. var removeFlag = [[${@permission.hasPermi('system:customer:remove')}]];
  69. var sexDatas = [[${@dict.getType('sys_user_sex')}]];
  70. var prefix = ctx + "system/customer";
  71. $(function() {
  72. var options = {
  73. url: prefix + "/list",
  74. createUrl: prefix + "/add",
  75. updateUrl: prefix + "/edit/{id}",
  76. removeUrl: prefix + "/remove",
  77. exportUrl: prefix + "/export",
  78. modalName: "客户",
  79. columns: [{
  80. checkbox: true
  81. },
  82. {
  83. field: 'customerId',
  84. title: '客户id'
  85. },
  86. {
  87. field: 'customerName',
  88. title: '客户姓名'
  89. },
  90. {
  91. field: 'phonenumber',
  92. title: '手机号码'
  93. },
  94. {
  95. field: 'sex',
  96. title: '客户性别',
  97. formatter: function(value, row, index) {
  98. return $.table.selectDictLabel(sexDatas, value);
  99. }
  100. },
  101. {
  102. field: 'birthday',
  103. title: '客户生日'
  104. },
  105. {
  106. field: 'remark',
  107. title: '客户描述'
  108. },
  109. {
  110. title: '操作',
  111. align: 'center',
  112. formatter: function(value, row, index) {
  113. var actions = [];
  114. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.customerId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  115. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.customerId + '\')"><i class="fa fa-remove"></i>删除</a>');
  116. return actions.join('');
  117. }
  118. }]
  119. };
  120. $.table.init(options);
  121. });
  122. </script>
  123. </body>
  124. </html>