123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <script type="text/javascript">
- var rentPlanId = null;
-
- //加载配租方案房源信息
- var rentPlanApply_load = function(id){
- rentPlanId = id;
- $('#tabs_update1').tabs('select', 2);
- $('#rentPlanApplyDataGrid').datagrid({
- rownumbers:true,
- border:false,
- checkOnSelect:true,
- selectOnCheck:true,
- url:whzl.basePath + '/rentPlanAction_listRentPlanApply?rentPlanApply.rentPlan.id=' + id,
- columns:[[
- {field:'name',title:'姓名',width:80,
- formatter:function(value,row,index){
- return row.securityPerson.name ;
- }
- },
- {field:'idCard',title:'身份证号码',width:150,
- formatter:function(value,row,index){
- return row.securityPerson.idCard ;
- }
- },
- {field:'phone',title:'联系电话',width:120,
- formatter:function(value,row,index){
- return row.securityPerson.phone;
- }
- },
- {field:'roomType',title:'适用户型',width:80,
- formatter:function(value,row,index){
- if(row.securityPerson.securityNum >=3){
- return "二居室";
- }else{
- return "一居室";
- }
- }
- },
-
- {field:'communityName',title:'意向小区',width:100,
- formatter:function(value,row,index){
- return row.communityName ;
- },
- editor:{
- type:'combobox',
- options:{
- valueField:'name',
- textField:'name',
- method:'get',
- url:'rentPlanAction_listCommunityByRentPlanHouseItem?rentPlanHouseItem.rentPlan.id=' + id,
- loadFilter:function(result){
- if(result.success){
- return result.obj.rows;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- }
- }
- },
- {field:'delete',title:'删除',width:38,align:'center',
- formatter:function(value,row,index){
- return "<img src='" + whzl.basePath +"/images/edit_remove.png' title='删除' onclick=deleteRentPlanApplyRow(" + row.id + ") style='cursor:pointer' />";
- }
- }
- ]],
-
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- return ;
- }
- },
- onLoadSuccess : function(){
- var rows = $("#rentPlanApplyDataGrid").datagrid("getRows");
- for(var i=0,l=rows.length;i<l;i++){
- $('#rentPlanApplyDataGrid').datagrid('beginEdit', i);
- }
- }
- });
-
-
- //加载配租方案
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_findById",//要访问的后台地址
- data:{"rentPlan.id":id },
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $("#title_update1").text(msg.obj.title);
- $("#content_update1").text(msg.obj.content);
- $("#startDate_update1").text(msg.obj.startDate.substring(0,10));
- $("#endDate_update1").text(msg.obj.endDate.substring(0,10));
- }
- }
- });
-
- $('#rentPlanHouseItemDataGrid_update1').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 rentPlanApply_submit = function(){
- var rows = $("#rentPlanApplyDataGrid").datagrid("getRows");
- for(var i=0,l=rows.length;i<l;i++){
- if(rows[i].id != null){
- var community = $('#rentPlanApplyDataGrid').datagrid('getEditor', {index:i,field:'communityName'});
- var communityName = $(community.target).combobox('getText');
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_updateRentPlanApply",//要访问的后台地址
- data:{"rentPlanApplyId":rows[i].id ,"communityName":communityName }
- });
-
- }
- }
- }
-
- var importRentPlanApply = function(){
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_importRentPlanApply",//要访问的后台地址
- data:{"rentPlan.id":rentPlanId},
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $('#rentPlanApplyDataGrid').datagrid("reload");
- }
- }
- });
- }
-
- //添加人员
- var addRentPlanApply = function(){
- $('#addApply').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- var securityPersonIds = select_submit();
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_addRentPlanApplys",//要访问的后台地址
- data:{"rentPlanId":rentPlanId ,"securityPersonIds":securityPersonIds },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $('#rentPlanApplyDataGrid').datagrid("reload");
- }
- }
- });
- $("#addApply").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addApply").dialog("close");
- }
- }
- ],
- onLoad : function(){
- var condition = "?securityPerson.applyType=2&securityPerson.state=2";
- select_load(condition);
- }
- }
- );
-
-
- }
-
-
- var deleteRentPlanApplyRow = function(id){
- $.messager.confirm('删除提示', '确定删除这条记录吗?', function(r){
- if (r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentPlanAction_deleteRentPlanApply",//要访问的后台地址
- data: "rentPlanApply.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $.messager.alert('提示','删除成功!');
- $('#rentPlanApplyDataGrid').datagrid('reload');
- }else{
- $.messager.alert('提示',msg.message);
- }
- }
- });
- }
- });
- }
-
-
- </script>
- <div class="easyui-tabs" id="tabs_update1">
- <div title="基本信息" id="jbxx_update1">
- <table class="mytable" style="width: 100%;">
- <tr>
- <th width="30%">配租方案标题</th>
- <td width="70%" colspan = "3">
- <span id="title_update1" />
- </td>
- </tr>
- <tr>
- <th width="30%" >配租方案开始时间</th>
- <td width="20%" >
- <span id="startDate_update1" />
- </td>
- <th width="30%" >配租方案结束时间</th>
- <td width="20%" >
- <span id="endDate_update1" />
- </td>
- </tr>
- <tr>
- <th>配租方案内容</th>
- <td colspan = "3" >
- <span id="content_update1" />
- </td>
- </tr>
- </table>
- </div>
- <div title="房源信息" id="fyxx_update1">
- <table id="rentPlanHouseItemDataGrid_update1" 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:'roomType',width:40,formatter:roomTypeHouseFormatter">户型</th>
- <th data-options="field:'area',width:60,formatter:areaFormatter">面积</th>
- </tr>
- </thead>
- </table>
- </div>
- <div title="人员信息" id="yxdj_update1">
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th colspan="4" >添加配租对象
- <a href="javascript:importRentPlanApply();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">导入轮候人员</a>
- <a href="javascript:addRentPlanApply();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增配租对象</a>
- <input type="hidden" value="${rentPlanId}" id="rentPlanId">
- </th>
- </tr>
- </table>
- <table id="rentPlanApplyDataGrid" >
- </table>
- </div>
- </div>
|