add.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('新增网格人员管理')" />
  5. <th:block th:include="include :: datetimepicker-css" />
  6. </head>
  7. <body class="white-bg">
  8. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  9. <form class="form-horizontal m" id="form-gridPerson-add">
  10. <input name="deptId" type="hidden" id="treeId"/>
  11. <div class="form-group">
  12. <label class="col-sm-3 control-label is-required">归属部门:</label>
  13. <div class="col-sm-8">
  14. <input class="form-control" type="text" name="deptName" onclick="selectDeptTree()" id="treeName" required>
  15. </div>
  16. </div>
  17. <div class="form-group">
  18. <label class="col-sm-3 control-label is-required">网格人员姓名:</label>
  19. <div class="col-sm-8">
  20. <input name="personName" class="form-control" type="text" required>
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="col-sm-3 control-label">性别:</label>
  25. <div class="col-sm-8">
  26. <select name="personSex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
  27. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
  28. </select>
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <label class="col-sm-3 control-label">手机号:</label>
  33. <div class="col-sm-8">
  34. <input name="personPhone" class="form-control" type="text">
  35. </div>
  36. </div>
  37. <div class="form-group">
  38. <label class="col-sm-3 control-label">身份证号:</label>
  39. <div class="col-sm-8">
  40. <input name="personIdcard" class="form-control" type="text">
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <label class="col-sm-3 control-label is-required">所属岗位:</label>
  45. <div class="col-sm-8">
  46. <select name="postId" class="form-control m-b" th:with="type=${@dict.getType('grid_person_type')}">
  47. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
  48. </select>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="col-sm-3 control-label">入职时间:</label>
  53. <div class="col-sm-8">
  54. <div class="input-group date">
  55. <input name="wordTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
  56. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  57. </div>
  58. </div>
  59. </div>
  60. </form>
  61. </div>
  62. <th:block th:include="include :: footer" />
  63. <th:block th:include="include :: datetimepicker-js" />
  64. <script th:inline="javascript">
  65. var prefix = ctx + "grid/gridPerson"
  66. $("#form-gridPerson-add").validate({
  67. personName:{
  68. maxlength: 5
  69. },
  70. messages: {
  71. "personName": {
  72. remote: "姓名不能超过5个汉字"
  73. }
  74. },
  75. focusCleanup: true
  76. });
  77. function submitHandler() {
  78. if ($.validate.form()) {
  79. $.operate.save(prefix + "/add", $('#form-gridPerson-add').serialize());
  80. }
  81. }
  82. $("input[name='wordTime']").datetimepicker({
  83. format: "yyyy-mm-dd",
  84. minView: "month",
  85. autoclose: true
  86. });
  87. /*网格人员管理-新建-选择部门树*/
  88. function selectDeptTree() {
  89. var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
  90. var url = ctx + "system/dept/selectDeptTree/" + deptId;
  91. var options = {
  92. title: '选择部门',
  93. width: "380",
  94. url: url,
  95. callBack: doSubmit
  96. };
  97. $.modal.openOptions(options);
  98. }
  99. function doSubmit(index, layero){
  100. var tree = layero.find("iframe")[0].contentWindow.$._tree;
  101. if ($.tree.notAllowParents(tree)) {
  102. var body = layer.getChildFrame('body', index);
  103. $("#treeId").val(body.find('#treeId').val());
  104. $("#treeName").val(body.find('#treeName').val());
  105. layer.close(index);
  106. }
  107. }
  108. </script>
  109. </body>
  110. </html>