rentPlanList.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
  2. <jsp:include page="../../common/include.jsp" />
  3. <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
  4. <script type="text/javascript"><!--
  5. /**用户显示区*/
  6. $(function() {
  7. $('#rentPlanDataGrid').datagrid({
  8. rownumbers:true,
  9. fit:true,
  10. pageSize:20,
  11. pageList : [ 10, 20, 30, 40, 50 ],
  12. fitColumns:false,
  13. border:false,
  14. sortOrder:'desc',
  15. pagination:true,
  16. idField:'id',
  17. url:whzl.basePath + '/rentPlanAction_listRentPlan',
  18. toolbar:'#searchtool',
  19. checkOnSelect:true,
  20. selectOnCheck:false,
  21. nowrap:true,
  22. loadFilter:function(result){
  23. if(result.success){
  24. return result.obj;
  25. }else{
  26. $.messager.alert("提示",result.message);
  27. return ;
  28. }
  29. }
  30. });
  31. });
  32. /**查询*/
  33. function searchFun(){
  34. $("#rentPlanDataGrid").datagrid("load", {
  35. "rentPlan.title":$("#tblQuery").find("input[id='title']").val()
  36. });
  37. }
  38. /*清除查询条件**/
  39. function ClearQuery() {
  40. $("#tblQuery").find("input").val("");
  41. $("#tblQuery").find("select").val("-1");
  42. }
  43. var startDateFormatter = function(value,row,index){
  44. return value.substring(0,10);
  45. }
  46. var endDateFormatter = function(value,row,index){
  47. return value.substring(0,10);
  48. }
  49. /**详细*/
  50. var detailsFormatter = function(value , row , index){
  51. return "<img src='<%=basePath%>/images/details.png' title='查看详情' onclick=rentPlanDetails(" + row.id + ") style='cursor:pointer' />";
  52. };
  53. /**详细页面对话框*/
  54. var rentPlanDetails = function(id){
  55. $("#detailRentPlanDialog").dialog(
  56. {
  57. buttons : [
  58. {
  59. text : '确定',
  60. iconCls : 'icon-ok',
  61. handler : function(){
  62. $("#detailRentPlanDialog").dialog("close");
  63. }
  64. }
  65. ],
  66. onLoad : function(){
  67. detail_load(id);
  68. }
  69. }
  70. );
  71. };
  72. /**更新*/
  73. var updateFormatter = function(value , row , index){
  74. if(row.rentPlanState == null || row.rentPlanState == '' ){
  75. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=updateRow('" + row.id + "','0') style='cursor:pointer' />";
  76. }else{
  77. return "";
  78. }
  79. };
  80. /**更新事件*/
  81. function updateRow(id,page){
  82. $('#updateRentPlanDialog').dialog(
  83. {
  84. buttons : [
  85. {
  86. text : '提交',
  87. iconCls : 'icon-ok',
  88. handler : function(){
  89. task_submit(id);
  90. $("#updaterentPlanDialog").dialog("close");
  91. }
  92. },
  93. {
  94. text : '取消',
  95. iconCls : 'icon-cancel',
  96. handler : function(){
  97. $("#updaterentPlanDialog").dialog("close");
  98. }
  99. }
  100. ],
  101. onLoad : function(){
  102. task_load(id,page);
  103. }
  104. }
  105. );
  106. }
  107. /**立即发布*/
  108. var publishFormatter = function(value , row , index){
  109. if(row.rentPlanState == null || row.rentPlanState == '' ){
  110. return "<img src='<%=basePath%>/images/pencil.png' title='立即发布' onclick=publishRow(" + row.id + ") style='cursor:pointer' />";
  111. }else{
  112. return "已发布";
  113. }
  114. };
  115. /**立即发布*/
  116. function publishRow(id){
  117. $.messager.confirm('提示', '确定发布该条配租方案么?发布后将无法修改', function(r){
  118. if (r){
  119. $.ajax({
  120. type: "post",//使用get方法访问后台
  121. dataType: "json",//返回json格式的数据
  122. url: "rentPlanAction_publish",//要访问的后台地址
  123. data: "rentPlan.id="+id,//要发送的数据
  124. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  125. success: function(msg){//msg为返回的数据,在这里做数据绑定
  126. if(msg.success){
  127. $.messager.alert('提示','发布成功!');
  128. $('#rentPlanDataGrid').datagrid('reload');
  129. }else{
  130. $.messager.alert('提示','发布失败!');
  131. }
  132. }
  133. });
  134. }
  135. });
  136. }
  137. /**更新人员*/
  138. var applyUpdateFormatter = function(value , row , index){
  139. if(row.rentPlanState == '1'){
  140. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=applyUpdateRow(" + row.id + ") style='cursor:pointer' />";
  141. }else{
  142. return "";
  143. }
  144. };
  145. /**人员申请修改*/
  146. function applyUpdateRow(id){
  147. $('#updateRentPlanApplyDialog').dialog(
  148. {
  149. buttons : [
  150. {
  151. text : '关闭',
  152. iconCls : 'icon-ok',
  153. handler : function(){
  154. $("#updateRentPlanApplyDialog").dialog("close");
  155. }
  156. }
  157. ],
  158. onLoad : function(){
  159. rentPlanApply_load(id);
  160. }
  161. }
  162. );
  163. }
  164. /**生成摇号*/
  165. var generateYaohaoFormatter = function(value , row , index){
  166. if(row.rentPlanState == '1'){
  167. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=generateYaohao(" + row.id + ") style='cursor:pointer' />";
  168. }else if(row.rentPlanState == '2'){
  169. return "已生成";
  170. }else{
  171. return "";
  172. }
  173. };
  174. /**生成摇号*/
  175. function generateYaohao(id){
  176. $.messager.confirm('提示', '确定要生成摇号了吗?生成摇号后将不可再修改意向登记', function(r){
  177. if (r){
  178. $.ajax({
  179. type: "post",//使用get方法访问后台
  180. dataType: "json",//返回json格式的数据
  181. url: "rentPlanAction_generateYaohao",//要访问的后台地址
  182. data: "rentPlan.id="+id,//要发送的数据
  183. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  184. success: function(msg){//msg为返回的数据,在这里做数据绑定
  185. if(msg.success){
  186. $.messager.alert('提示','摇号生成成功!');
  187. $('#rentPlanDataGrid').datagrid('reload');
  188. }else{
  189. $.messager.alert('提示','摇号生成失败,请先完成登记意向!');
  190. }
  191. }
  192. });
  193. }
  194. });
  195. }
  196. /**增加配租方案*/
  197. function rentPlanAdd(){
  198. $('#addRentPlanDialog').dialog(
  199. {
  200. buttons : [
  201. {
  202. text : '下一步',
  203. iconCls : 'icon-redo',
  204. handler : function(){
  205. add_submit();
  206. }
  207. },
  208. {
  209. text : '取消',
  210. iconCls : 'icon-cancel',
  211. handler : function(){
  212. $("#addRentPlanDialog").dialog("close");
  213. }
  214. }
  215. ],
  216. onLoad : function(){
  217. add_load(id);
  218. }
  219. }
  220. );
  221. }
  222. /**小区名称*/
  223. var communityNameFormatter = function(value , row , index){
  224. return row.house.communityName ;
  225. };
  226. /**居住地点*/
  227. var addressFormatter = function(value , row , index){
  228. return row.house.address ;
  229. };
  230. /**房号*/
  231. var houseNumberFormatter = function(value , row , index){
  232. return row.house.houseNumber ;
  233. };
  234. /**户型*/
  235. var roomTypeHouseFormatter = function(value , row , index){
  236. if(row.house.roomType ==2){
  237. return "二居室";
  238. }else{
  239. return "一居室";
  240. }
  241. };
  242. /**面积*/
  243. var areaFormatter = function(value , row , index){
  244. return row.house.area ;
  245. };
  246. /**人员名称*/
  247. var nameFormatter = function(value , row , index){
  248. return row.securityPerson.name ;
  249. };
  250. /**身份证号*/
  251. var idCardFormatter = function(value , row , index){
  252. return row.securityPerson.idCard ;
  253. };
  254. /**联系电话*/
  255. var phoneFormatter = function(value , row , index){
  256. return row.securityPerson.phone ;
  257. };
  258. /**适用户型*/
  259. var roomTypeFormatter = function(value , row , index){
  260. if(row.securityPerson.securityNum >=3){
  261. return "二居室";
  262. }else{
  263. return "一居室";
  264. }
  265. };
  266. /**意向小区*/
  267. var communityNameApplyFormatter = function(value , row , index){
  268. return row.communityName ;
  269. };
  270. /**删除*/
  271. var delRentPlanHouseItemFormatter = function(value , row , index){
  272. return "<img src='" + whzl.basePath +"/images/edit_remove.png' title='删除' onclick=deleteRentPlanHouseItemRow(" + row.id + ") style='cursor:pointer' />";
  273. };
  274. /**删除*/
  275. var delRentPlanApplyFormatter = function(value , row , index){
  276. return "<img src='" + whzl.basePath +"/images/edit_remove.png' title='删除' onclick=deleteRentPlanApplyRow(" + row.id + ") style='cursor:pointer' />";
  277. };
  278. --></script>
  279. <div class="easyui-layout" data-options="fit:true,border:false">
  280. <div data-options="region:'center',border:false">
  281. <div id="searchtool" data-options="region:'north' , border:false">
  282. <div class="clear"></div>
  283. <table id="tblQuery" style="width:100%;">
  284. <tr>
  285. <td align="right" style="width: 70px;"><span>配租方案标题</span></td><td style="width: 120px;"><input id="title" name="rentPlan.title" type="text" style="width: 100px;"/></td>
  286. <td align="left" style="width: 200px;">
  287. <a href="javascript:rentPlanAdd();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</a>
  288. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  289. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  290. </td>
  291. </tr>
  292. </table>
  293. <div class="clear"></div>
  294. </div>
  295. <table id="rentPlanDataGrid">
  296. <thead frozen="true">
  297. <tr>
  298. <th data-options="field:'title',sortable:true,width:255">配租方案标题</th>
  299. </tr>
  300. </thead>
  301. <thead>
  302. <tr>
  303. <th data-options="field:'startDate',sortable:true,width:150,formatter:startDateFormatter">开始日期</th>
  304. <th data-options="field:'endDate',sortable:true,width:150,formatter:endDateFormatter">结束日期</th>
  305. <th data-options="field:'details',align:'center',width:60,formatter:detailsFormatter">查看详细</th>
  306. <th data-options="field:'update',align:'center',width:60,formatter:updateFormatter">修改</th>
  307. <th data-options="field:'publish',align:'center',width:60,formatter:publishFormatter">立即发布</th>
  308. <th data-options="field:'applyUpdate',align:'center',width:60,formatter:applyUpdateFormatter">意向登记</th>
  309. <th data-options="field:'generateYaohao',align:'center',width:60,formatter:generateYaohaoFormatter">摇号生成</th>
  310. </tr>
  311. </thead>
  312. </table>
  313. </div>
  314. </div>
  315. <div id="detailRentPlanDialog" data-options="title:'&nbsp;配租方案详情',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/rentPlanAction_toDetail'">
  316. </div>
  317. <div id="addRentPlanDialog" data-options="title:'&nbsp;添加配租方案',iconCls:'icon-add',width:800,height:420,modal:true,href:'<%=basePath %>/rentPlanAction_toAdd'">
  318. </div>
  319. <div id="updateRentPlanDialog" data-options="title:'&nbsp;修改配租方案',iconCls:'icon-edit',width:800,height:420,modal:true,href:'<%=basePath %>/rentPlanAction_toUpdate'">
  320. </div>
  321. <div id="updateRentPlanApplyDialog" data-options="title:'&nbsp;配租方案意向登记',iconCls:'icon-edit',width:800,height:420,modal:true,href:'<%=basePath %>/rentPlanAction_toRentPlanApplyList'">
  322. </div>
  323. <div id="addHouse" data-options="title:'&nbsp;选择房源',iconCls:'icon-edit',width:700,height:460,modal:true,href:'houseAction_toSelectList'">
  324. </div>
  325. <div id="addApply" data-options="title:'&nbsp;选择人员',iconCls:'icon-edit',width:700,height:460,modal:true,href:'securityPersonAction_toSelectListForRentPlan'">
  326. </div>
  327. <script type="text/javascript">
  328. <!--
  329. parent.$.messager.progress('close');
  330. //-->
  331. </script>