rentPlanApplyUpdate.jsp 9.1 KB

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