123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <script type="text/javascript"><!--
- var yaohaoId = null;
-
- var rentPlanObj = null;
-
- var rentPlan_array = null;
-
- var update_load = function(id,page){
- $('#tabs_update').tabs('select', page);
- yaohaoId = id;
-
- //配租方案
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_listRentPlan",//要访问的后台地址
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- rentPlanObj = msg.obj.rows;
- var select_arr = [];
- var data = rentPlanObj;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].id+">"+ data[nItem].title +"</option>");
- }
- rentPlan_array = select_arr.join("");
- $("#rentPlanId_update").append(rentPlan_array);
- }
- }
- });
-
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "yaohaoAction_findById",//要访问的后台地址
- data:{"yaohao.id":id},
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $("#rentPlanId_update").val(msg.obj.rentPlan.id);
- $("#title_update").val(msg.obj.title);
- $("#id_update").val(id);
- }
- }
- });
-
- $('#houseDataGrid_update').datagrid({
- rownumbers:true,
- border:false,
- sortOrder:'desc',
- url:whzl.basePath + '/yaohaoAction_findHousesById?yaohao.id=' + id,
- checkOnSelect:true,
- selectOnCheck:false,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
-
-
- $('#rentPlanApplyDataGrid_update').datagrid({
- rownumbers:true,
- border:false,
- sortOrder:'desc',
- url:whzl.basePath + '/yaohaoAction_findRentPlanApplysById?yaohao.id=' + id,
- checkOnSelect:true,
- selectOnCheck:false,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
-
- }
-
- var update_submit = function(){
- $('#updateYaohaoForm').form('submit',{
- url : whzl.basePath+'/yaohaoAction_updateYaohao',
- success : function(result){
- $("#updateYaohaoDialog").dialog("close");
- $('#yaohaoDataGrid').datagrid('reload');
- }
- }
- );
- }
-
- /**删除*/
- var delHouseFormatter = function(value , row , index){
- return "<img src='" + whzl.basePath +"/images/edit_remove.png' title='删除' onclick=deleteHouseRow(" + row.id + ") style='cursor:pointer' />";
- };
-
- /**删除*/
- var delSecurityPersonFormatter = function(value , row , index){
- return "<img src='" + whzl.basePath +"/images/edit_remove.png' title='删除' onclick=deleteSecurityPersonRow(" + row.id + ") style='cursor:pointer' />";
- };
-
- var addHouse = function(){
- var rentPlanId = $("#rentPlanId_update").val();
- $('#addHouseDialog').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var houseIds = house_select_submit(rentPlanId);
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "yaohaoAction_addHouses",//要访问的后台地址
- data:{"yaohaoId":yaohaoId ,"houseIds":houseIds },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $('#houseDataGrid_update').datagrid("reload");
- }
- }
- });
- $("#addHouseDialog").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouseDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- house_select_load(rentPlanId);
- }
- }
- );
- }
-
-
- var addRentPlanApply = function(){
- var rentPlanId = $("#rentPlanId_update").val();
- $('#addSecurityPersonDialog').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var rentPlanApplyIds = select_submit(rentPlanId);
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "yaohaoAction_addSecurityPersons",//要访问的后台地址
- data:{"yaohaoId":yaohaoId ,"rentPlanApplyIds":rentPlanApplyIds },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $('#rentPlanApplyDataGrid_update').datagrid("reload");
- }
- }
- });
- $("#addSecurityPersonDialog").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addSecurityPersonDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- select_load(rentPlanId);
- }
- }
- );
- }
-
- //删除待摇号房屋
- var deleteHouseRow = function(id){
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "yaohaoAction_deleteHouseById",//要访问的后台地址
- data:{"yaohaoId":yaohaoId , "houseId" : id },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- $.messager.alert("提示","删除成功");
- $('#houseDataGrid_update').datagrid("reload");
- }
- });
- }
-
- //删除待摇号人员
- var deleteSecurityPersonRow = function(id){
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "yaohaoAction_deleteSecurityPersonById",//要访问的后台地址
- data:{"yaohaoId":yaohaoId , "securityPersonId" : id },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- $.messager.alert("提示","删除成功");
- $('#rentPlanApplyDataGrid_update').datagrid("reload");
- }
- });
- }
-
-
- --></script>
- <form id="updateYaohaoForm" method="post" enctype="multipart/form-data">
- <div class="easyui-tabs" id="tabs_update">
- <div title="基本信息" id="jbxx_update">
- <table class="mytable" style="width: 100%;">
- <tr>
- <th width="40%">摇号标题</th>
- <td width="60%" >
- <input type="hidden" id="id_update" name="yaohao.id">
- <input class="easyui-validatebox" style="width:350px" required="true" type="text" id="title_update" name="yaohao.title">
- </td>
- </tr>
- <tr>
- <th>选择配租方案</th>
- <td>
- <select name="yaohao.rentPlan.id" disabled="disabled" id="rentPlanId_update" class="easyui-validatebox" required="true">
- <option value="">请选择</option>
- </select>
- </td>
- </tr>
- </table>
- </div>
- <div title="待摇号房源信息" id="fyxx_update">
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th>加入待摇号房源
- <a href="javascript:addHouse();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">加入待摇号房源</a>
- </th>
- </tr>
- </table>
- <table id="houseDataGrid_update" title="待摇号房源信息" >
- <thead>
- <tr>
- <th data-options="field:'communityName',width:100,formatter:communityNameFormatter">小区名称</th>
- <th data-options="field:'address',width:200,formatter:addressFormatter">居住地点</th>
- <th data-options="field:'houseNumber',width:40,formatter:houseNumberFormatter">房号</th>
- <th data-options="field:'area',width:60,formatter:areaFormatter">面积</th>
- <th data-options="field:'delete',align:'center',width:38,formatter:delHouseFormatter">删除</th>
- </tr>
- </thead>
- </table>
- </div>
-
- <div title="待摇号人员信息" id="yxdj_update">
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th>加入待摇号人员
- <a href="javascript:addRentPlanApply();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">加入待摇号人员</a>
- </th>
- </tr>
- </table>
- <table id="rentPlanApplyDataGrid_update" title="待摇号人员信息">
- <thead>
- <tr>
- <th data-options="field:'name',align:'center',sortable:true,width:80,formatter:nameFormatter">姓名</th>
- <th data-options="field:'idCard',align:'center',sortable:true,width:180,formatter:idCardFormatter">身份证<br/>号码</th>
- <th data-options="field:'phone',align:'center',sortable:true,width:90,formatter:phoneFormatter">联系<br/>电话</th>
- <th data-options="field:'roomType',align:'center',sortable:true,width:90,formatter:roomTypeFormatter">适用户型</th>
- <th data-options="field:'communityName',align:'center',sortable:true,width:90,formatter:communityNameApplyFormatter">意向小区</th>
- <th data-options="field:'delete',align:'center',width:38,formatter:delSecurityPersonFormatter">删除</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- </form>
|