| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>所在区域</title>
- </head>
- <body layout:fragment="content">
- <style>
- dl dd label {
- display: inline-block;
- padding: 5px 20px;
- }
- input[type="checkbox"]{
- margin-right: 5px;
- }
- </style>
- <article class="page-container">
- <form class="form form-horizontal" id="form-notify-addPush" ><!-- th:action="@{/government/notify/addPushSearch}" -->
- <div class="row cl">
- <input type="hidden" name="street_id" id="street_id"/>
- <input type="hidden" name="street_name" id="street_name"/>
- <dt>
- <label class="form-label col-xs-4 col-sm-4"><span>街道:</span></label>
- </dt>
- <dd class="pushStreetsList">
- <div class="formControls col-xs-8 col-sm-3">
- <select id="Street" onchange="getStreet_ids1()">
- <option value="-1">--请选择--</option>
- <option value="" th:each="item : ${streetList}" th:value="${item.id}" th:text="${item.name}"/>
- </select>
- </div>
- </dd>
- </div>
-
- <div class="row cl">
- <input type="hidden" name="build_id" id="build_id"/>
- <input type="hidden" name="build_name" id="build_name"/>
- <dt>
- <label class="form-label col-xs-4 col-sm-2"><span>园区:</span></label>
- </dt>
- <dd class="pushBuildsList">
- <div class="formControls col-xs-8 col-sm-6">
- <select id="Builds" style="width: 200px" onchange = "getBuild_ids1()">
- <!-- <option value="-1">--请选择--</option> -->
- </select>
- </div>
- <dd/>
- </div>
- <!-- <div class="row cl">
- <input type="hidden" name="build_ids" id="build_ids"/>
- <dt>
- <label class=""><input type="checkbox" onchange="getBuild_ids();getCompanys();">园区222</label>
- </dt>
- <dd class="pushBuildsList">
- <label class="" th:each="build,iterStat:${buildList}" th:object="${build}">
- <input type="checkbox" th:value="*{id}" th:buildName="*{name}" th:name="builds" th:id="*{id}"
- th:text="*{name}"
- th:checked="*{isChecked}" onchange="getBuild_ids();getCompanys();">
- <span class="c-red" th:if="*{isPush}">已推送</span>
- </label>
- </dd>
- </dl>
-
- </div> -->
-
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2" th:unless="*{directPush}">
- <button class="btn btn-primary radius" type="submit" onClick="saveRegion();"><i class="Hui-iconfont"></i>
- 确定
- </button>
- <button onClick="removeIframe();" class="btn btn-default radius" type="button"> 返回 </button>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" th:src="@{/js/company/companyInfoManage/selectRegion.js}"></script>
- <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
- <script th:inline="javascript">
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
-
- /* function bindBuild(buildList) {
- $(".pushBuildsList").empty();
- // debugger;
- for (var i = 0; i < buildList.length; i++) {
- var label = '<label class="">';
- label += '<input type="checkbox" value="' + buildList[i].id + '" buildName="' + buildList[i].name + '" id="' + buildList[i].id + '" onchange="getBuild_ids();getCompanys();">';
- label += buildList[i].name;
- //label += '<span class="c-red" th:if="*{isPush}">已推送</span>';
- label += '</label>';
- if(buildList[i].isPush){
- label +='<span class="c-red" >已推送</span>';
- }
- $(".pushBuildsList").append(label);
- }
- }*/
-
- function bidBuild(buildInfo){
- $("#Builds option").remove();
- var option = '<option value="-1">' + "--请选择--" + '</option>'
- for (var i = 0; i < buildInfo.length; i++) {
- option += '<option value="'+ buildInfo[i].id +'" name = "'+ buildInfo[i].name +'" id = "'+ buildInfo[i].id +'" >'
- option += buildInfo[i].name
- option += '</option>'
- }
- $("#Builds").append(option);
- }
-
-
-
- /*绑定街道id*/
- function getStreet_ids1(){
- var value = $("#Street").find("option:selected").val();
- var text = $("#Street").find("option:selected").text();
- $("#street_id").val(value);
- $("#street_name").val(text);
- getBuilds();
- }
-
- /*绑定园区id*/
- function getBuild_ids1(){
- var value = $("#Builds").find("option:selected").val();
- var text = $("#Builds").find("option:selected").text();
- $("#build_id").val(value);
- $("#build_name").val(text);
- }
-
- function getBuilds(){
- $.ajax({
- url : pagePath+"/company/companyInfoManage/selectBuildByStreetId",
- type : "post",
- data : {
- 'street_id' : $("#street_id").val()
- },
- dataType : "json",
- success: function (result) {
- if (result.success) {
- var buildInfo = result.obj;
- bidBuild(buildInfo);
- } else {
- //errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
-
- /*保存选择的街道、园区id*/
- function saveRegion(){
- var street_id = $("#street_id").val();
- var build_id = $("#build_id").val();
- var street_name = $("#street_name").val();
- var build_name = $("#build_name").val();
- $.ajax({
- url: pagePath+"/company/companyInfoManage/saveSteetAndBuildId",
- type: "post",
- dataType: "json",
- data: {
- 'street_id':street_id,
- 'build_id':build_id,
- 'street_name':street_name,
- 'build_name':build_name
- },
- success:function(result){
- setTimeClose();
- },
- error:function(){
- }
- });
- }
- </script>
- </body>
- </html>
|