houseRepairHistoryList.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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. var repairStateObj = null;
  7. var opinionObj = null;
  8. //故障类别
  9. var repairCategoryObj = null;
  10. var repairCategory_array = null;
  11. //审批状态
  12. $.ajax({
  13. type: "post",//使用post方法访问后台
  14. dataType: "json",//返回json格式的数据
  15. url: "aa10Action_listAa10All",//要访问的后台地址
  16. data:{"aa10.letter":"repairState" ,"aa10.name":"维修状态" },
  17. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  18. success: function(msg){//msg为返回的数据,在这里做数据绑定
  19. if(msg.success){
  20. repairStateObj = msg.obj.rows;
  21. var select_arr = [];
  22. var data = repairStateObj;
  23. for(var nItem = 0; nItem < data.length; nItem++ ){
  24. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  25. }
  26. state_array = select_arr.join("");
  27. $("#repairState").append(state_array);
  28. }
  29. }
  30. });
  31. //故障类别
  32. $.ajax({
  33. type: "post",//使用post方法访问后台
  34. dataType: "json",//返回json格式的数据
  35. url: "aa10Action_listAa10All",//要访问的后台地址
  36. data:{"aa10.letter":"repairCategory" ,"aa10.name":"故障类别" },
  37. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  38. success: function(msg){//msg为返回的数据,在这里做数据绑定
  39. if(msg.success){
  40. repairCategoryObj = msg.obj.rows;
  41. var select_arr = [];
  42. var data = repairCategoryObj;
  43. for(var nItem = 0; nItem < data.length; nItem++ ){
  44. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  45. }
  46. repairCategory_array = select_arr.join("");
  47. }
  48. }
  49. });
  50. /**维修记录显示区*/
  51. $(function() {
  52. $('#houseRepairHistoryDataGrid').datagrid({
  53. rownumbers:true,
  54. fit:true,
  55. pageSize:20,
  56. pageList : [ 10, 20, 30, 40, 50 ],
  57. fitColumns:false,
  58. border:false,
  59. sortOrder:'desc',
  60. pagination:true,
  61. idField:'id',
  62. url:whzl.basePath + '/houseRepairAction_listHouseRepair',
  63. toolbar:'#searchtool',
  64. checkOnSelect:true,
  65. selectOnCheck:true,
  66. nowrap:true,
  67. loadFilter:function(result){
  68. if(result.success){
  69. return result.obj;
  70. }else{
  71. $.messager.alert('提示',result.message,'error');
  72. return ;
  73. }
  74. }
  75. });
  76. });
  77. /**查询*/
  78. function searchFun(){
  79. $("#houseRepairHistoryDataGrid").datagrid("load", {
  80. "houseRepair.name":$("#tblQuery").find("input[id='name']").val(),
  81. "houseRepair.idCard":$("#tblQuery").find("input[id='idCard']").val(),
  82. "houseRepair.repairState":$("#tblQuery").find("select[id='repairState']").val(),
  83. "houseRepair.communityId":$('#communityIdFromHouse').combobox("getValue"),
  84. "houseRepair.no":$('#noFromHouse').combobox("getValue"),
  85. "houseRepair.houseNumber":$('#houseNumberFromHouse').combobox("getValue")
  86. });
  87. }
  88. /*清除查询条件**/
  89. function ClearQuery() {
  90. $("#tblQuery").find("input").val("");
  91. $("#tblQuery").find("select").val("-1");
  92. }
  93. /**报修时间*/
  94. var reportDateFormatter = function(value , row , index){
  95. return dealDate(row.reportDate);
  96. }
  97. /**故障类别*/
  98. var repairCategoryFormatter = function(value , row , index){
  99. var repairCategory = "";
  100. for(var nItem = 0; nItem < repairCategoryObj.length; nItem++ ){
  101. if(repairCategoryObj[nItem].code == row.repairCategory){
  102. repairCategory = repairCategoryObj[nItem].value;
  103. break;
  104. }
  105. }
  106. return repairCategory;
  107. }
  108. /**审核状态*/
  109. var repairStateFormatter = function(value , row , index){
  110. var repairState = "";
  111. for(var nItem = 0; nItem < repairStateObj.length; nItem++ ){
  112. if(repairStateObj[nItem].code == row.repairState){
  113. repairState = repairStateObj[nItem].value;
  114. break;
  115. }
  116. }
  117. return repairState;
  118. };
  119. /**详细*/
  120. var detailsFormatter = function(value , row , index){
  121. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/detail.png' title='查看详情' onclick=houseRepairDetails(" + row.id + ") style='cursor:pointer' />";
  122. };
  123. /**详细页面对话框*/
  124. var houseRepairDetails = function(id){
  125. $("#detailHouseRepairDialog").dialog({
  126. buttons : [{
  127. text : '确定',
  128. iconCls : 'icon-ok',
  129. handler : function(){
  130. $("#detailHouseRepairDialog").dialog("close");
  131. }
  132. }],
  133. onLoad : function(){
  134. detail_load(id);
  135. }
  136. });
  137. };
  138. /**导出*/
  139. function houseRepairExport(){
  140. var params = encodeURI("houseRepair.name="+trim($('#name').val())+
  141. "&houseRepair.idCard="+trim($('#idCard').val())+
  142. "&houseRepair.repairState="+trim($('#repairState').val())+
  143. "&houseRepair.communityId="+trim($('#communityIdFromHouse').combobox("getValue"))+
  144. "&houseRepair.no="+trim($('#noFromHouse').combobox("getValue"))+
  145. "&houseRepair.houseNumber="+trim($('#houseNumberFromHouse').combobox("getValue"))
  146. );
  147. window.location.href = whzl.basePath+"/houseRepairAction_export?"+params;
  148. }
  149. /**打印*/
  150. var printFormatter = function(value , row , index){
  151. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/detail.png' title='查看详情' onclick=houseRepairPrint(" + row.id + ") style='cursor:pointer' />";
  152. };
  153. function houseRepairPrint(id){
  154. window.open(whzl.basePath+"/houseRepairAction_toPrint?houseRepairId="+id);
  155. }
  156. --></script>
  157. <div class="easyui-layout" data-options="fit:true,border:false">
  158. <div data-options="region:'center',border:false">
  159. <div id="searchtool" data-options="region:'north' , border:false">
  160. <table id="tblQuery" style="width:100%;font-size:12px;">
  161. <tr>
  162. <td align="right" style="width: 10%"><span>保障人员姓名</span></td>
  163. <td style="width: 10%"><input id="name" name="houseRepair.name" type="text" style="width: 100px"/></td>
  164. <td align="right" style="width: 12%"><span>保障人员身份证号</span></td>
  165. <td style="width: 10%"><input id="idCard" name="houseRepair.idCard" type="text"/></td>
  166. <td align="right" style="width: 8%"><span>维修状态</span></td>
  167. <td style="width: 14%"><select id="repairState" name="houseRepair.repairState" style="width:100px" onchange="searchFun();">
  168. <option value="">全部</option>
  169. </select>
  170. </td>
  171. <td align="left" colspan="2" style="width: 36%">
  172. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  173. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  174. <a href="javascript:houseRepairExport();" class="easyui-linkbutton" data-options="iconCls:'icon-export',plain:true">导出</a>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td align="right" width="130px"><span>小区名称</span></td>
  179. <td colspan="5">
  180. <input id="communityIdFromHouse">
  181. <input id="noFromHouse" style="width: 60px;">幢
  182. <input id="houseNumberFromHouse" style="width: 80px;">室
  183. </td>
  184. </tr>
  185. </table>
  186. </div>
  187. <table id="houseRepairHistoryDataGrid">
  188. <thead frozen="true">
  189. <tr>
  190. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  191. <th data-options="field:'houseRepairNo',sortable:true,width:100">工单编号</th>
  192. <th data-options="field:'address',sortable:true,width:170">房源地址</th>
  193. <th data-options="field:'name',sortable:true,width:60">姓名</th>
  194. </tr>
  195. </thead>
  196. <thead>
  197. <tr>
  198. <th data-options="field:'idCard',sortable:true,width:120">身份证号</th>
  199. <th data-options="field:'phone',sortable:true,width:90">联系电话</th>
  200. <th data-options="field:'reportDate',sortable:true,width:70, formatter:reportDateFormatter">报修时间</th>
  201. <th data-options="field:'repairCategory',sortable:true,width:60, formatter:repairCategoryFormatter">故障类别</th>
  202. <th data-options="field:'repairState',sortable:true,width:70, formatter:repairStateFormatter">当前状态</th>
  203. <th data-options="field:'details',align:'center',width:64, formatter:detailsFormatter">查看详情</th>
  204. <th data-options="field:'print',align:'center',width:64, formatter:printFormatter">打印审批表</th>
  205. </tr>
  206. </thead>
  207. </table>
  208. </div>
  209. </div>
  210. <div id="detailHouseRepairDialog" data-options="title:'&nbsp;房屋维修详细信息',iconCls:'icon-details',width:700,height:400,modal:true,href:'<%=basePath %>/houseRepairAction_toDetail'">
  211. </div>
  212. <div id="setHouseRepairHistoryDialog" data-options="title:'&nbsp;个性化设置',iconCls:'icon-cog',width:500,height:370,modal:true,href:'<%=basePath %>/columnSetAction_toSet?tname=houseRepairHistory'">
  213. </div>
  214. <script type="text/javascript">
  215. $(function(){
  216. parent.$.messager.progress('close');
  217. //小区名称
  218. $("#communityIdFromHouse").combobox({
  219. url: whzl.basePath + '/communityAction_findAll',
  220. valueField:'value',
  221. textField:'text',
  222. filter:function(q,row){
  223. var opts=$(this).combobox("options");
  224. //return row[opts.textField].indexOf(q)==0;//
  225. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  226. },
  227. onChange:function (newValue,oldValue) {
  228. $('#noFromHouse').combobox("setValue","");
  229. $('#houseNumberFromHouse').combobox("setValue","");
  230. $('#noFromHouse').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityIdFromHouse').combobox("getValue"));
  231. }
  232. });
  233. //幢
  234. $("#noFromHouse").combobox({
  235. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityIdFromHouse').combobox("getValue"),
  236. valueField:'value',
  237. textField:'text',
  238. filter:function(q,row){
  239. var opts=$(this).combobox("options");
  240. //return row[opts.textField].indexOf(q)==0;//
  241. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  242. },
  243. onChange:function (newValue,oldValue) {
  244. $('#houseNumberFromHouse').combobox("setValue","");
  245. $('#houseNumberFromHouse').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityIdFromHouse').combobox("getValue") + '&house.no='+newValue);
  246. }
  247. });
  248. //室
  249. $("#houseNumberFromHouse").combobox({
  250. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityIdFromHouse').combobox("getValue") + '&house.no='+$('#noFromHouse').combobox("getValue"),
  251. valueField:'value',
  252. textField:'text',
  253. filter:function(q,row){
  254. var opts=$(this).combobox("options");
  255. //return row[opts.textField].indexOf(q)==0;//
  256. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  257. }
  258. });
  259. });
  260. </script>