yaohaoList.jsp 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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. $('#yaohaoDataGrid').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 + '/yaohaoAction_listYaohao',
  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. $("#yaohaoDataGrid").datagrid("load", {
  35. "yaohao.title":$("#tblQuery").find("input[id='title']").val()
  36. });
  37. $('#yaohaoDataGrid').datagrid({
  38. columns:columns,
  39. frozenColumns:frozenColumns
  40. });
  41. toolBar("yaohaoDataGrid","setYaohaoDialog","yaohao");
  42. }
  43. /*清除查询条件**/
  44. function ClearQuery() {
  45. $("#tblQuery").find("input").val("");
  46. $("#tblQuery").find("select").val("-1");
  47. }
  48. var dateFormatter = function(value,row,index){
  49. if(value != null){
  50. return value.substring(0,10);
  51. }else{
  52. return "";
  53. }
  54. }
  55. /**详细*/
  56. var detailsFormatter = function(value , row , index){
  57. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/detail.png' title='查看详情' onclick=yaohaoDetails('" + row.id + "','" + row.rentPlan.id + "') style='cursor:pointer' />";
  58. };
  59. /**详细页面对话框*/
  60. var yaohaoDetails = function(id){
  61. $("#detailYaohaoDialog").dialog(
  62. {
  63. buttons : [
  64. {
  65. text : '确定',
  66. iconCls : 'icon-ok',
  67. handler : function(){
  68. $("#detailYaohaoDialog").dialog("close");
  69. }
  70. }
  71. ],
  72. onLoad : function(){
  73. detail_load(id);
  74. }
  75. }
  76. );
  77. };
  78. /**修改*/
  79. var updateFormatter = function(value , row , index){
  80. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=updateRow(" + row.id + ") style='cursor:pointer' />";
  81. };
  82. /**更新事件*/
  83. function updateRow(){
  84. var row = $('#yaohaoDataGrid').datagrid('getSelected');
  85. if(row == null){
  86. $.messager.alert("提示","请先选择要修改的摇号方案!");
  87. }
  88. var id = row.id;
  89. yaohaoUpdate(id,0);
  90. }
  91. /**修改摇号信息*/
  92. function yaohaoUpdate(id,page){
  93. $('#updateYaohaoDialog').dialog(
  94. {
  95. buttons : [
  96. {
  97. text : '上一步',
  98. iconCls : 'icon-undo',
  99. handler : function(){
  100. if($('#tabs_update').tabs('getTabIndex', $('#tabs_update').tabs('getSelected')) != 0){
  101. $('#tabs_update').tabs('select', $('#tabs_update').tabs('getTabIndex', $('#tabs_update').tabs('getSelected')) - 1);
  102. }
  103. }
  104. },
  105. {
  106. text : '下一步',
  107. iconCls : 'icon-redo',
  108. handler : function(){
  109. if($('#tabs_update').tabs('getTabIndex', $('#tabs_update').tabs('getSelected')) != 2){
  110. $('#tabs_update').tabs('select', $('#tabs_update').tabs('getTabIndex', $('#tabs_update').tabs('getSelected')) + 1);
  111. }else{
  112. update_submit(id);
  113. }
  114. }
  115. },
  116. {
  117. text : '取消',
  118. iconCls : 'icon-cancel',
  119. handler : function(){
  120. $("#updateYaohaoDialog").dialog("close");
  121. }
  122. }
  123. ],
  124. onLoad : function(){
  125. update_load(id,page);
  126. }
  127. }
  128. );
  129. }
  130. /**摇号*/
  131. var yaohaoFormatter = function(value , row , index){
  132. return "<a title='开始摇号' href='yaohaoAction_yaohao?yaohao.id=" + row.id + "' target='_blank' style='cursor:pointer'> <img src='<%=basePath%>/js/easyui/themes/itemicon/yaohao.png'/> </a>";
  133. };
  134. /**增加摇号*/
  135. function yaohaoAdd(){
  136. $('#addYaohaoDialog').dialog(
  137. {
  138. buttons : [
  139. {
  140. text : '下一步',
  141. iconCls : 'icon-redo',
  142. handler : function(){
  143. add_submit();
  144. }
  145. },
  146. {
  147. text : '取消',
  148. iconCls : 'icon-cancel',
  149. handler : function(){
  150. $("#addYaohaoDialog").dialog("close");
  151. }
  152. }
  153. ],
  154. onLoad : function(){
  155. add_load();
  156. }
  157. }
  158. );
  159. }
  160. /**小区名称*/
  161. var communityNameFormatter = function(value , row , index){
  162. return row.communityName ;
  163. };
  164. /**居住地点*/
  165. var addressFormatter = function(value , row , index){
  166. return row.address ;
  167. };
  168. /**房号*/
  169. var houseNumberFormatter = function(value , row , index){
  170. return row.houseNumber ;
  171. };
  172. /**面积*/
  173. var areaFormatter = function(value , row , index){
  174. return row.area ;
  175. };
  176. /**人员名称*/
  177. var nameFormatter = function(value , row , index){
  178. return row.securityPerson.name ;
  179. };
  180. /**身份证号*/
  181. var idCardFormatter = function(value , row , index){
  182. return row.securityPerson.idCard ;
  183. };
  184. /**联系电话*/
  185. var phoneFormatter = function(value , row , index){
  186. return row.securityPerson.phone ;
  187. };
  188. /**适用户型*/
  189. var roomTypeFormatter = function(value , row , index){
  190. if(row.securityPerson.securityNum >=3){
  191. return "二居室";
  192. }else{
  193. return "一居室";
  194. }
  195. };
  196. /**意向小区*/
  197. var communityNameApplyFormatter = function(value , row , index){
  198. return row.communityName ;
  199. };
  200. /**小区名称*/
  201. var yaohaoItem_communityNameFormatter = function(value , row , index){
  202. if(row.house != null){
  203. return row.house.communityName ;
  204. }
  205. };
  206. /**居住地点*/
  207. var yaohaoItem_addressFormatter = function(value , row , index){
  208. if(row.house != null){
  209. return row.house.address ;
  210. }
  211. };
  212. /**房号*/
  213. var yaohaoItem_houseNumberFormatter = function(value , row , index){
  214. if(row.house != null){
  215. return row.house.houseNumber ;
  216. }
  217. };
  218. /**面积*/
  219. var yaohaoItem_areaFormatter = function(value , row , index){
  220. if(row.house != null){
  221. return row.house.area ;
  222. }
  223. };
  224. /**人员名称*/
  225. var yaohaoItem_nameFormatter = function(value , row , index){
  226. if(row.securityPerson != null){
  227. return row.securityPerson.name ;
  228. }
  229. };
  230. /**身份证号*/
  231. var yaohaoItem_idCardFormatter = function(value , row , index){
  232. if(row.securityPerson != null){
  233. return row.securityPerson.idCard ;
  234. }
  235. };
  236. /**手动输入摇号结果*/
  237. var manualInputResultFormatter = function(value , row , index){
  238. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/update.png' title='输入结果' onclick=manualInputResult(" + row.id + ") style='cursor:pointer' />";
  239. }
  240. function manualInputResult(id){
  241. $("#resultYaohaoDialog").dialog({
  242. buttons:[{
  243. text : '取消',
  244. iconCls : 'icon-cancel',
  245. handler : function(){
  246. $("#resultYaohaoDialog").dialog("close");
  247. }
  248. }],
  249. onLoad : function(){
  250. result_load(id);
  251. }
  252. })
  253. }
  254. --></script>
  255. <div class="easyui-layout" data-options="fit:true,border:false">
  256. <div data-options="region:'center',border:false">
  257. <div id="searchtool" data-options="region:'north' , border:false">
  258. <div class="clear"></div>
  259. <table id="tblQuery" style="width:100%;">
  260. <tr>
  261. <td align="right" style="width: 10%;"><span>摇号标题</span></td>
  262. <td style="width: 20%;"><input id="title" name="yaohao.title" type="text" style="width: 100px;"/></td>
  263. <td align="left" style="width: 70%;">
  264. <a href="javascript:yaohaoAdd();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</a>
  265. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  266. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  267. <a href="javascript:updateRow();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
  268. </td>
  269. </tr>
  270. </table>
  271. <div class="clear"></div>
  272. </div>
  273. <table id="yaohaoDataGrid">
  274. <thead>
  275. <tr>
  276. <th data-options="field:'title',sortable:true,width:255">标题</th>
  277. <th data-options="field:'date',sortable:true,width:150,formatter:dateFormatter">摇号日期</th>
  278. <th data-options="field:'details',align:'center',width:60,formatter:detailsFormatter">查看详情</th>
  279. <th data-options="field:'yaohao',align:'center',width:60,formatter:yaohaoFormatter">开始摇号</th>
  280. <th data-options="field:'manualInputResult',align:'center',width:60,formatter:manualInputResultFormatter">录入结果</th>
  281. </tr>
  282. </thead>
  283. </table>
  284. </div>
  285. </div>
  286. <div id="detailYaohaoDialog" data-options="title:'&nbsp;摇号方案详情',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/yaohaoAction_toDetail'">
  287. </div>
  288. <div id="addYaohaoDialog" data-options="title:'&nbsp;添加摇号',iconCls:'icon-add',width:800,height:420,modal:true,href:'<%=basePath %>/yaohaoAction_toAdd'">
  289. </div>
  290. <div id="updateYaohaoDialog" data-options="title:'&nbsp;修改摇号方案',iconCls:'icon-edit',width:800,height:420,modal:true,href:'<%=basePath %>/yaohaoAction_toUpdate'">
  291. </div>
  292. <div id="addSecurityPersonDialog" data-options="title:'&nbsp;待选人员列表',iconCls:'icon-edit',width:800,height:420,modal:true,href:'<%=basePath %>/rentPlanAction_toSecurityPersonList'">
  293. </div>
  294. <div id="addHouseDialog" data-options="title:'&nbsp;待选房源列表',iconCls:'icon-edit',width:800,height:420,modal:true,href:'<%=basePath %>/rentPlanAction_toHouseSelectList'">
  295. </div>
  296. <div id="setYaohaoDialog" data-options="title:'&nbsp;个性化设置',iconCls:'icon-cog',width:500,height:370,modal:true,href:'<%=basePath %>/columnSetAction_toSet?tname=yaohao'">
  297. </div>
  298. <div id="resultYaohaoDialog" data-options="title:'&nbsp;摇号结果录入',iconCls:'icon-details',width:900,height:420,modal:true,href:'<%=basePath %>/yaohaoAction_toResult'">
  299. </div>
  300. <script type="text/javascript">
  301. <!--
  302. parent.$.messager.progress('close');
  303. //-->
  304. </script>