yaohaoResult.jsp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
  3. <script type="text/javascript">
  4. /**人员名称*/
  5. var nameFormatter_result = function(value , row , index){
  6. if(row.securityPerson!=null){
  7. return row.securityPerson.name ;
  8. }else{
  9. return "";
  10. }
  11. };
  12. /**身份证号*/
  13. var idCardFormatter_result = function(value , row , index){
  14. if(row.securityPerson!=null){
  15. return row.securityPerson.idCard ;
  16. }else{
  17. return "";
  18. }
  19. };
  20. /**联系电话*/
  21. var phoneFormatter_result = function(value , row , index){
  22. if(row.securityPerson!=null){
  23. return row.securityPerson.phone ;
  24. }else{
  25. return "";
  26. }
  27. };
  28. /**录入房源*/
  29. var houseInputFormatter_result = function(value, row, index){
  30. return "<img src='<%=basePath%>/images/pencil.png' title='录入房源' onclick=houseInput(" + row.securitypersonId + ") style='cursor:pointer' />";
  31. };
  32. function houseInput(id){
  33. $("#securityPersonId").val(id);
  34. $("#houseYaohaoDialog").dialog({
  35. buttons:[{
  36. text : '确定',
  37. iconCls : 'icon-ok',
  38. handler : function(){
  39. var selectedItem = $('#houseDataGrid_yaohaoHouse').datagrid('getSelected');
  40. if(selectedItem.houseState == 4){
  41. $.messager.alert("提示","该房屋已分配!");
  42. return ;
  43. }
  44. var houseId = selectedItem.id;
  45. var yaohaoId = $("#yaohaoId").val();
  46. var securityPersonId = $("#securityPersonId").val();
  47. $.messager.confirm('提示', '确定要录入该房源吗?', function(r){
  48. if (r){
  49. //if(selectedItem=''){$.messager.alert("警告","请选择至少一条待公示的数据!");}
  50. $.ajax({
  51. type: "post",
  52. dataType: "json",
  53. url: "yaohaoAction_yaohaoResultInput?houseId="+houseId+"&yaohaoId="+yaohaoId+"&securityPersonId="+securityPersonId,
  54. complete :function(){$("#load").hide();},
  55. success: function(msg){
  56. $("#houseYaohaoDialog").dialog('close');
  57. $('#rentPlanApplyDataGrid_result').datagrid('reload');
  58. }
  59. })
  60. }
  61. });
  62. }
  63. },{
  64. text : '取消',
  65. iconCls : 'icon-cancel',
  66. handler : function(){
  67. $("#houseYaohaoDialog").dialog('close');
  68. }
  69. }],
  70. onLoad : function(){
  71. var yaohaoId = $("#yaohaoId").val();
  72. yaohaoHouse_load(yaohaoId);
  73. }
  74. });
  75. }
  76. var result_load = function(id){
  77. $('#tabs_result').tabs('select', 1);
  78. $("#yaohaoId").val(id);
  79. //加载摇号信息
  80. $.ajax({
  81. type: "post",//使用post方法访问后台
  82. dataType: "json",//返回json格式的数据
  83. url: "yaohaoAction_findById",//要访问的后台地址
  84. data:{"yaohao.id":id },
  85. success: function(msg){//msg为返回的数据,在这里做数据绑定
  86. if(msg.success){
  87. var rentPlanId = msg.obj.rentPlan.id;
  88. //加载配租方案
  89. $.ajax({
  90. type: "post",//使用post方法访问后台
  91. dataType: "json",//返回json格式的数据
  92. url: "rentPlanAction_findById",//要访问的后台地址
  93. data:{"rentPlan.id":rentPlanId },
  94. success: function(msg){//msg为返回的数据,在这里做数据绑定
  95. if(msg.success){
  96. $("#title_result").text(msg.obj.title);
  97. $("#content_result").text(msg.obj.content);
  98. $("#startDate_result").text(msg.obj.startDate.substring(0,10));
  99. $("#endDate_result").text(msg.obj.endDate.substring(0,10));
  100. }
  101. }
  102. });
  103. }
  104. }
  105. });
  106. $('#rentPlanApplyDataGrid_result').datagrid({
  107. rownumbers:true,
  108. border:false,
  109. sortOrder:'desc',
  110. url:whzl.basePath + '/yaohaoAction_rentPlanApplysById?yaohao.id=' + id,
  111. checkOnSelect:true,
  112. selectOnCheck:false,
  113. loadFilter:function(result){
  114. if(result.success){
  115. return result.obj;
  116. }else{
  117. $.messager.alert("提示",result.message);
  118. return ;
  119. }
  120. }
  121. });
  122. }
  123. </script>
  124. <div class="easyui-tabs" id="tabs_result">
  125. <div title="基本信息" id="jbxx_result">
  126. <table class="mytable" style="width: 100%;">
  127. <tr>
  128. <th width="30%">配租方案标题</th>
  129. <td width="70%" colspan = "3">
  130. <span id="title_result" />
  131. </td>
  132. </tr>
  133. <tr>
  134. <th width="30%" >配租方案开始时间</th>
  135. <td width="20%" >
  136. <span id="startDate_result" />
  137. </td>
  138. <th width="30%" >配租方案结束时间</th>
  139. <td width="20%" >
  140. <span id="endDate_result" />
  141. </td>
  142. </tr>
  143. <tr>
  144. <th>配租方案内容</th>
  145. <td colspan = "3" >
  146. <span id="content_result" />
  147. </td>
  148. </tr>
  149. </table>
  150. </div>
  151. <div title="人员信息" id="yxdj_result">
  152. <input id="yaohaoId" type="hidden">
  153. <input id="securityPersonId" type="hidden">
  154. <table id="rentPlanApplyDataGrid_result" title="人员信息">
  155. <thead>
  156. <tr>
  157. <th data-options="field:'securitypersonName',align:'center',sortable:true,width:80">姓名</th>
  158. <th data-options="field:'securitypersonIdCard',align:'center',sortable:true,width:180">身份证号码</th>
  159. <th data-options="field:'securitypersonPhone',align:'center',width:120">联系电话</th>
  160. <th data-options="field:'address',align:'center',width:200">房源地址</th>
  161. <th data-options="field:'houseInput',align:'center',width:60,formatter:houseInputFormatter_result">录入房源</th>
  162. </tr>
  163. </thead>
  164. </table>
  165. </div>
  166. </div>
  167. <div id="houseYaohaoDialog" data-options="title:'&nbsp;待配房源',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/yaohaoAction_toYaohaoHouse'">
  168. </div>