123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@ taglib prefix="s" uri="/struts-tags" %>
- <script type="text/javascript"><!--
- var rentPlanId = null;
- var task_load = function(id,page){
- $('#tabs_update').tabs('select', page);
- //加载配租方案
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_findById",//要访问的后台地址
- data:{"rentPlan.id":id },
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $("#id_update").val(msg.obj.id);
- $("#title_update").val(msg.obj.title);
- $("#content_update").val(msg.obj.content);
- $("#startDate_update").datebox("setValue",msg.obj.startDate);
- $("#endDate_update").datebox("setValue",msg.obj.endDate);
- }
- }
- });
-
- rentPlanId = id;
- $('#rentPlanHouseItemDataGrid').datagrid({
- rownumbers:true,
- border:false,
- sortOrder:'desc',
- url:whzl.basePath + '/rentPlanAction_listRentPlanHouseItem?rentPlanHouseItem.rentPlan.id=' + id,
- checkOnSelect:true,
- selectOnCheck:false,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
-
- }
-
- var task_submit = function(id){
- $('#updateRentPlanForm').form('submit',{
- url : whzl.basePath+'/rentPlanAction_updateRentPlan',
- success : function(result){
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- parent.$.messager.progress('close');
- $("#updateRentPlanDialog").dialog("close");
- searchFun();
- }else{
- parent.$.messager.progress('close');
- $.messager.alert("提示",parseResult.message);
- }
- }
- });
- }
-
- //添加房源
- var addRentPlanHouse = function(){
- $('#addHouse').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var houseIds = house_select_submit(rentPlanId);
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_addRentPlanHouseItems",//要访问的后台地址
- data:{"rentPlanId":rentPlanId ,"houseIds":houseIds },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $('#rentPlanHouseItemDataGrid').datagrid("reload");
- }
- }
- });
- $("#addHouse").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouse").dialog("close");
- }
- }
- ],
- onLoad : function(){
- house_select_load('&house.houseState=1');
- }
- }
- );
- }
- var deleteRentPlanHouseItemRow = function(id){
-
- $.messager.confirm('删除提示', '确定删除这条记录吗?', function(r){
- if (r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_deleteRentPlanHouseItem",//要访问的后台地址
- data: "rentPlanHouseItem.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $.messager.alert('提示','删除成功!');
- $('#rentPlanHouseItemDataGrid').datagrid('reload');
- }else{
- $.messager.alert('提示',msg.message);
- }
- }
- });
- }
- });
- }
-
-
-
- -->
- </script>
- <div class="easyui-tabs" id="tabs_update">
- <div title="基本信息" id="jbxx_update">
- <form id="updateRentPlanForm" method="post" enctype="multipart/form-data">
- <table class="mytable" style="width: 100%;">
- <tr>
- <th width="20%">配租方案标题</th>
- <td width="80%" colspan = "3">
- <input class="easyui-validatebox" style="width:350px" required="true" type="text" id="title_update" name="rentPlan.title">
- <input id="id_update" name="rentPlan.id" type="hidden" />
- </td>
- </tr>
- <tr>
- <th width="20%" >配租方案开始时间</th>
- <td width="30%" >
- <input id="startDate_update" name="rentPlan.startDate" class="easyui-datebox"/>
- </td>
- <th width="20%" >配租方案结束时间</th>
- <td width="30%" >
- <input id="endDate_update" name="rentPlan.endDate" class="easyui-datebox"/>
- </td>
- </tr>
- <tr>
- <th>配租方案内容</th>
- <td colspan = "3" >
- <textarea rows="12" cols="70" id="content_update" name="rentPlan.content"></textarea>
- </td>
- </tr>
- </table>
- </form>
- </div>
-
- <div title="房源选择" id="fyxz_update" >
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th colspan="4" >添加配租方案房源
- <a href="javascript:addRentPlanHouse();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增房源</a>
- </th>
- </tr>
- </table>
- <table id="rentPlanHouseItemDataGrid" >
- <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:'roomType',width:40,formatter:roomTypeHouseFormatter">户型</th>
- <th data-options="field:'area',width:60,formatter:areaFormatter">面积</th>
- <th data-options="field:'delete',align:'center',width:38,formatter:delRentPlanHouseItemFormatter">删除</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
|