123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- <%@ 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 roomType1= 0;
-
- var roomType2 = 0;
- 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,
- rowStyler:function(index,row){
- if(row.house != null){
- if (row.house.roomType == 1){
- roomType1++;
- return 'background-color:yellow;color:blue;font-weight:bold;';
- }else{
- roomType2++;
- }
- }
- },
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
-
-
- rentPlanId = id;
- $('#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:'applyType',title:'在保类型',width:100,
- formatter:function(value,row,index){
- if(row.securityPerson.subsidiesState==0||row.securityPerson.subsidiesState==''){
- return "无其他保障类别";
- }else{
- return "申请公租房补贴";
- }
- }
- },
- {field:'delete',title:'删除',width:38,align:'center',
- formatter:function(value,row,index){
- return "<img src='" + whzl.basePath +"/js/easyui/themes/itemicon/delete.png' title='删除' onclick=deleteRentPlanApplyRow(" + row.id + ") style='cursor:pointer' />";
- }
- }
- ]],
- rowStyler:function(index,row){
- if(row.securityPerson !=null){
- if(row.securityPerson.securityNum <3){
- return 'background-color:yellow;color:blue;font-weight:bold;';
- }
- }
- },
-
- 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));
- }
- }
- });
- }
-
- var task_submit = function(id){
- $('#updateRentPlanForm').form('submit',{
- url : whzl.basePath+'/rentPlanAction_updateRentPlan',
- success : function(result){
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- $.messager.alert("提示","摇号方案修改成功");
- 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");
- $.messager.alert('提示','房源添加成功!');
- }
- }
- });
- $("#addHouse").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addHouse").dialog("close");
- }
- }
- ],
- onLoad : function(){
- house_select_load('&house.houseState=6');
- }
- }
- );
- }
- 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);
- }
- }
- });
- }
- });
- }
-
- 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){
- $.messager.alert('提示','人员添加成功!');
- $('#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");
- $.messager.alert('提示','人员添加成功!');
- }
- }
- });
- $("#addApply").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addApply").dialog("close");
- }
- }
- ],
- onLoad : function(){
- var condition = "?securityPerson.rentHouseState=1&sort=waitDate&order=asc";
- 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_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>
- <span style="background-color:yellow;color:blue;font-weight:bold;">一居室房屋</span>
- <span >二居室房屋</span>
- </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:60,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 title="人员选择" id="yxdj_update">
- <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">
- <span style="background-color:yellow;color:blue;font-weight:bold;">一居室房屋</span>
- <span >二居室房屋</span>
- </th>
- </tr>
- </table>
- <table id="rentPlanApplyDataGrid" >
- </table>
- </div>
-
- </div>
|