select_Region.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <style>
  10. dl dd label {
  11. display: inline-block;
  12. padding: 5px 20px;
  13. }
  14. input[type="checkbox"]{
  15. margin-right: 5px;
  16. }
  17. </style>
  18. <article class="page-container">
  19. <form class="form form-horizontal" id="form-notify-addPush" ><!-- th:action="@{/government/notify/addPushSearch}" -->
  20. <div class="row cl">
  21. <input type="hidden" name="street_id" id="street_id"/>
  22. <input type="hidden" name="street_name" id="street_name"/>
  23. <dt>
  24. <label class="form-label col-xs-4 col-sm-4"><span>街道:</span></label>
  25. </dt>
  26. <dd class="pushStreetsList">
  27. <div class="formControls col-xs-8 col-sm-3">
  28. <select id="Street" onchange="getStreet_ids1()">
  29. <option value="-1">--请选择--</option>
  30. <option value="" th:each="item : ${streetList}" th:value="${item.id}" th:text="${item.name}"/>
  31. </select>
  32. </div>
  33. </dd>
  34. </div>
  35. <div class="row cl">
  36. <input type="hidden" name="build_id" id="build_id"/>
  37. <input type="hidden" name="build_name" id="build_name"/>
  38. <dt>
  39. <label class="form-label col-xs-4 col-sm-2"><span>园区:</span></label>
  40. </dt>
  41. <dd class="pushBuildsList">
  42. <div class="formControls col-xs-8 col-sm-6">
  43. <select id="Builds" style="width: 200px" onchange = "getBuild_ids1()">
  44. <!-- <option value="-1">--请选择--</option> -->
  45. </select>
  46. </div>
  47. <dd/>
  48. </div>
  49. <!-- <div class="row cl">
  50. <input type="hidden" name="build_ids" id="build_ids"/>
  51. <dt>
  52. <label class=""><input type="checkbox" onchange="getBuild_ids();getCompanys();">园区222</label>
  53. </dt>
  54. <dd class="pushBuildsList">
  55. <label class="" th:each="build,iterStat:${buildList}" th:object="${build}">
  56. <input type="checkbox" th:value="*{id}" th:buildName="*{name}" th:name="builds" th:id="*{id}"
  57. th:text="*{name}"
  58. th:checked="*{isChecked}" onchange="getBuild_ids();getCompanys();">
  59. <span class="c-red" th:if="*{isPush}">已推送</span>
  60. </label>
  61. </dd>
  62. </dl>
  63. </div> -->
  64. <div class="row cl">
  65. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2" th:unless="*{directPush}">
  66. <button class="btn btn-primary radius" type="submit" onClick="saveRegion();"><i class="Hui-iconfont">&#xe632;</i>
  67. 确定
  68. </button>
  69. <button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;返回&nbsp;&nbsp;</button>
  70. </div>
  71. </div>
  72. </form>
  73. </article>
  74. <script type="text/javascript" th:src="@{/js/company/companyInfoManage/selectRegion.js}"></script>
  75. <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
  76. <script th:inline="javascript">
  77. /**
  78. * 取消
  79. */
  80. function removeIframe() {
  81. var index = parent.layer.getFrameIndex(window.name);
  82. parent.layer.close(index);
  83. }
  84. /* function bindBuild(buildList) {
  85. $(".pushBuildsList").empty();
  86. // debugger;
  87. for (var i = 0; i < buildList.length; i++) {
  88. var label = '<label class="">';
  89. label += '<input type="checkbox" value="' + buildList[i].id + '" buildName="' + buildList[i].name + '" id="' + buildList[i].id + '" onchange="getBuild_ids();getCompanys();">';
  90. label += buildList[i].name;
  91. //label += '<span class="c-red" th:if="*{isPush}">已推送</span>';
  92. label += '</label>';
  93. if(buildList[i].isPush){
  94. label +='<span class="c-red" >已推送</span>';
  95. }
  96. $(".pushBuildsList").append(label);
  97. }
  98. }*/
  99. function bidBuild(buildInfo){
  100. $("#Builds option").remove();
  101. var option = '<option value="-1">' + "--请选择--" + '</option>'
  102. for (var i = 0; i < buildInfo.length; i++) {
  103. option += '<option value="'+ buildInfo[i].id +'" name = "'+ buildInfo[i].name +'" id = "'+ buildInfo[i].id +'" >'
  104. option += buildInfo[i].name
  105. option += '</option>'
  106. }
  107. $("#Builds").append(option);
  108. }
  109. /*绑定街道id*/
  110. function getStreet_ids1(){
  111. var value = $("#Street").find("option:selected").val();
  112. var text = $("#Street").find("option:selected").text();
  113. $("#street_id").val(value);
  114. $("#street_name").val(text);
  115. getBuilds();
  116. }
  117. /*绑定园区id*/
  118. function getBuild_ids1(){
  119. var value = $("#Builds").find("option:selected").val();
  120. var text = $("#Builds").find("option:selected").text();
  121. $("#build_id").val(value);
  122. $("#build_name").val(text);
  123. }
  124. function getBuilds(){
  125. $.ajax({
  126. url : pagePath+"/company/companyInfoManage/selectBuildByStreetId",
  127. type : "post",
  128. data : {
  129. 'street_id' : $("#street_id").val()
  130. },
  131. dataType : "json",
  132. success: function (result) {
  133. if (result.success) {
  134. var buildInfo = result.obj;
  135. bidBuild(buildInfo);
  136. } else {
  137. //errorMessage(result.message);
  138. }
  139. },
  140. error: function () {
  141. errorMessage('系统错误!');
  142. }
  143. });
  144. }
  145. /*保存选择的街道、园区id*/
  146. function saveRegion(){
  147. var street_id = $("#street_id").val();
  148. var build_id = $("#build_id").val();
  149. var street_name = $("#street_name").val();
  150. var build_name = $("#build_name").val();
  151. $.ajax({
  152. url: pagePath+"/company/companyInfoManage/saveSteetAndBuildId",
  153. type: "post",
  154. dataType: "json",
  155. data: {
  156. 'street_id':street_id,
  157. 'build_id':build_id,
  158. 'street_name':street_name,
  159. 'build_name':build_name
  160. },
  161. success:function(result){
  162. setTimeClose();
  163. },
  164. error:function(){
  165. }
  166. });
  167. }
  168. </script>
  169. </body>
  170. </html>