rentPlanApplyUpdate.jsp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <script type="text/javascript">
  3. var rentPlanId = null;
  4. var roomType1= 0;
  5. var roomType2 = 0;
  6. //加载配租方案房源信息
  7. var rentPlanApply_load = function(id){
  8. rentPlanId = id;
  9. $('#tabs_update1').tabs('select', 2);
  10. $('#rentPlanApplyDataGrid').datagrid({
  11. rownumbers:true,
  12. border:false,
  13. checkOnSelect:true,
  14. selectOnCheck:true,
  15. url:whzl.basePath + '/rentPlanAction_listRentPlanApply?rentPlanApply.rentPlan.id=' + id,
  16. columns:[[
  17. {field:'name',title:'姓名',width:80,
  18. formatter:function(value,row,index){
  19. return row.securityPerson.name ;
  20. }
  21. },
  22. {field:'idCard',title:'身份证号码',width:150,
  23. formatter:function(value,row,index){
  24. return row.securityPerson.idCard ;
  25. }
  26. },
  27. {field:'phone',title:'联系电话',width:120,
  28. formatter:function(value,row,index){
  29. return row.securityPerson.phone;
  30. }
  31. },
  32. {field:'roomType',title:'适用户型',width:80,
  33. formatter:function(value,row,index){
  34. if(row.securityPerson.securityNum >=3){
  35. return "二居室";
  36. }else{
  37. return "一居室";
  38. }
  39. }
  40. },
  41. {field:'delete',title:'删除',width:38,align:'center',
  42. formatter:function(value,row,index){
  43. return "<img src='" + whzl.basePath +"/images/edit_remove.png' title='删除' onclick=deleteRentPlanApplyRow(" + row.id + ") style='cursor:pointer' />";
  44. }
  45. }
  46. ]],
  47. rowStyler:function(index,row){
  48. if(row.securityPerson !=null){
  49. if(row.securityPerson.securityNum <3){
  50. return 'background-color:yellow;color:blue;font-weight:bold;';
  51. }
  52. }
  53. },
  54. loadFilter:function(result){
  55. if(result.success){
  56. return result.obj;
  57. }else{
  58. return ;
  59. }
  60. },
  61. onLoadSuccess : function(){
  62. var rows = $("#rentPlanApplyDataGrid").datagrid("getRows");
  63. for(var i=0,l=rows.length;i<l;i++){
  64. $('#rentPlanApplyDataGrid').datagrid('beginEdit', i);
  65. }
  66. }
  67. });
  68. //加载配租方案
  69. $.ajax({
  70. type: "post",//使用post方法访问后台
  71. dataType: "json",//返回json格式的数据
  72. url: "rentPlanAction_findById",//要访问的后台地址
  73. data:{"rentPlan.id":id },
  74. success: function(msg){//msg为返回的数据,在这里做数据绑定
  75. if(msg.success){
  76. $("#title_update1").text(msg.obj.title);
  77. $("#content_update1").text(msg.obj.content);
  78. $("#startDate_update1").text(msg.obj.startDate.substring(0,10));
  79. $("#endDate_update1").text(msg.obj.endDate.substring(0,10));
  80. }
  81. }
  82. });
  83. $('#rentPlanHouseItemDataGrid_update1').datagrid({
  84. rownumbers:true,
  85. border:false,
  86. sortOrder:'desc',
  87. url:whzl.basePath + '/rentPlanAction_listRentPlanHouseItem?rentPlanHouseItem.rentPlan.id=' + id,
  88. checkOnSelect:true,
  89. selectOnCheck:false,
  90. rowStyler:function(index,row){
  91. if(row.house != null){
  92. if (row.house.roomType == 1){
  93. roomType1++;
  94. return 'background-color:yellow;color:blue;font-weight:bold;';
  95. }else{
  96. roomType2++;
  97. }
  98. }
  99. },
  100. loadFilter:function(result){
  101. if(result.success){
  102. return result.obj;
  103. }else{
  104. $.messager.alert("提示",result.message);
  105. return ;
  106. }
  107. }
  108. });
  109. $("houseInfo").text("一居室共:" + roomType1 + "套,二居室共:" + roomType2 +"套");
  110. }
  111. var importRentPlanApply = function(){
  112. $.ajax({
  113. type: "post",//使用post方法访问后台
  114. dataType: "json",//返回json格式的数据
  115. url: "rentPlanAction_importRentPlanApply",//要访问的后台地址
  116. data:{"rentPlan.id":rentPlanId},
  117. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  118. success: function(msg){//msg为返回的数据,在这里做数据绑定
  119. if(msg.success){
  120. $('#rentPlanApplyDataGrid').datagrid("reload");
  121. }
  122. }
  123. });
  124. }
  125. //添加人员
  126. var addRentPlanApply = function(){
  127. $('#addApply').dialog(
  128. {
  129. buttons : [
  130. {
  131. text : '提交',
  132. iconCls : 'icon-ok',
  133. handler : function(){
  134. var securityPersonIds = select_submit();
  135. $.ajax({
  136. type: "post",//使用post方法访问后台
  137. dataType: "json",//返回json格式的数据
  138. url: "rentPlanAction_addRentPlanApplys",//要访问的后台地址
  139. data:{"rentPlanId":rentPlanId ,"securityPersonIds":securityPersonIds },
  140. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  141. success: function(msg){//msg为返回的数据,在这里做数据绑定
  142. if(msg.success){
  143. $('#rentPlanApplyDataGrid').datagrid("reload");
  144. }
  145. }
  146. });
  147. $("#addApply").dialog("close");
  148. }
  149. },
  150. {
  151. text : '取消',
  152. iconCls : 'icon-cancel',
  153. handler : function(){
  154. $("#addApply").dialog("close");
  155. }
  156. }
  157. ],
  158. onLoad : function(){
  159. var condition = "?securityPerson.rentHouseState=1&securityPerson.state=2";
  160. select_load(condition);
  161. }
  162. }
  163. );
  164. }
  165. var deleteRentPlanApplyRow = function(id){
  166. $.messager.confirm('删除提示', '确定删除这条记录吗?', function(r){
  167. if (r){
  168. $.ajax({
  169. type: "post",//使用get方法访问后台
  170. dataType: "json",//返回json格式的数据
  171. url: "rentPlanAction_deleteRentPlanApply",//要访问的后台地址
  172. data: "rentPlanApply.id="+id,//要发送的数据
  173. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  174. success: function(msg){//msg为返回的数据,在这里做数据绑定
  175. if(msg.success){
  176. $.messager.alert('提示','删除成功!');
  177. $('#rentPlanApplyDataGrid').datagrid('reload');
  178. }else{
  179. $.messager.alert('提示',msg.message);
  180. }
  181. }
  182. });
  183. }
  184. });
  185. }
  186. </script>
  187. <div class="easyui-tabs" id="tabs_update1">
  188. <div title="基本信息" id="jbxx_update1">
  189. <table class="mytable" style="width: 100%;">
  190. <tr>
  191. <th width="30%">摇号方案标题</th>
  192. <td width="70%" colspan = "3">
  193. <span id="title_update1" />
  194. </td>
  195. </tr>
  196. <tr>
  197. <th width="30%" >摇号方案开始时间</th>
  198. <td width="20%" >
  199. <span id="startDate_update1" />
  200. </td>
  201. <th width="30%" >摇号方案结束时间</th>
  202. <td width="20%" >
  203. <span id="endDate_update1" />
  204. </td>
  205. </tr>
  206. <tr>
  207. <th>摇号方案内容</th>
  208. <td colspan = "3" >
  209. <span id="content_update1" />
  210. </td>
  211. </tr>
  212. </table>
  213. </div>
  214. <div title="房源信息" id="fyxx_update1">
  215. <table class="mytable" style="width: 100%;" >
  216. <tr>
  217. <th >
  218. 房源信息:
  219. <span style="background-color:yellow;color:blue;font-weight:bold;">一居室房屋</span>
  220. <span >二居室房屋</span>
  221. </th>
  222. </tr>
  223. </table>
  224. <table id="rentPlanHouseItemDataGrid_update1" >
  225. <thead>
  226. <tr>
  227. <th data-options="field:'communityName',width:100,formatter:communityNameFormatter">小区名称</th>
  228. <th data-options="field:'address',width:200,formatter:addressFormatter">居住地点</th>
  229. <th data-options="field:'houseNumber',width:40,formatter:houseNumberFormatter">房号</th>
  230. <th data-options="field:'roomType',width:40,formatter:roomTypeHouseFormatter">户型</th>
  231. <th data-options="field:'area',width:60,formatter:areaFormatter">面积</th>
  232. </tr>
  233. </thead>
  234. </table>
  235. </div>
  236. <div title="人员信息" id="yxdj_update1">
  237. <table class="mytable" style="width: 100%;" >
  238. <tr>
  239. <th colspan="4" >添加摇号对象
  240. <a href="javascript:importRentPlanApply();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">导入轮候人员</a>
  241. <a href="javascript:addRentPlanApply();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增摇号对象</a>
  242. <input type="hidden" value="${rentPlanId}" id="rentPlanId">
  243. <span style="background-color:yellow;color:blue;font-weight:bold;">一居室房屋</span>
  244. <span >二居室房屋</span>
  245. </th>
  246. </tr>
  247. </table>
  248. <table id="rentPlanApplyDataGrid" >
  249. </table>
  250. </div>
  251. </div>