exchangeHouseList.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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 yesOrNoObj = null;
  7. var yesOrNo_array = null;
  8. //人员类别
  9. var personTypeObj = null;
  10. var personType_array = null;
  11. //审核意见
  12. var opinionObj = null;
  13. var opinion_array = null;
  14. //区
  15. var areaObj = null;
  16. var area_array = null;
  17. //街道
  18. var streetObj = null;
  19. var street_array = null;
  20. //居委会
  21. var neighborhoodObj = null;
  22. var neighborhood_array = null;
  23. /**用户显示区*/
  24. $(function() {
  25. //工作现状
  26. $.ajax({
  27. type: "post",//使用post方法访问后台
  28. dataType: "json",//返回json格式的数据
  29. url: "aa10Action_listAa10All",//要访问的后台地址
  30. data:{"aa10.letter":"workState" ,"aa10.name":"工作现状" },
  31. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  32. success: function(msg){//msg为返回的数据,在这里做数据绑定
  33. if(msg.success){
  34. workStateObj = msg.obj.rows;
  35. var select_arr = [];
  36. var data = workStateObj;
  37. for(var nItem = 0; nItem < data.length; nItem++ ){
  38. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  39. }
  40. workState_array = select_arr.join("");
  41. }
  42. }
  43. });
  44. //是否
  45. $.ajax({
  46. type: "post",//使用post方法访问后台
  47. dataType: "json",//返回json格式的数据
  48. url: "aa10Action_listAa10All",//要访问的后台地址
  49. data:{"aa10.letter":"yesOrNo" ,"aa10.name":"是否" },
  50. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  51. success: function(msg){//msg为返回的数据,在这里做数据绑定
  52. if(msg.success){
  53. yesOrNoObj = msg.obj.rows;
  54. var select_arr = [];
  55. var data = yesOrNoObj;
  56. for(var nItem = 0; nItem < data.length; nItem++ ){
  57. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  58. }
  59. yesOrNo_array = select_arr.join("");
  60. }
  61. }
  62. });
  63. //人员类别
  64. $.ajax({
  65. type: "post",//使用post方法访问后台
  66. dataType: "json",//返回json格式的数据
  67. url: "aa10Action_listAa10All",//要访问的后台地址
  68. data:{"aa10.letter":"personType" ,"aa10.name":"保障人员类别" },
  69. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  70. success: function(msg){//msg为返回的数据,在这里做数据绑定
  71. if(msg.success){
  72. personTypeObj = msg.obj.rows;
  73. var select_arr = [];
  74. var data = personTypeObj;
  75. for(var nItem = 0; nItem < data.length; nItem++ ){
  76. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  77. }
  78. personType_array = select_arr.join("");
  79. $("#personType").append(personType_array);
  80. }
  81. }
  82. });
  83. //审批意见
  84. $.ajax({
  85. type: "post",//使用post方法访问后台
  86. dataType: "json",//返回json格式的数据
  87. url: "aa10Action_listAa10All",//要访问的后台地址
  88. data:{"aa10.letter":"opinion" ,"aa10.name":"审核意见" },
  89. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  90. success: function(msg){//msg为返回的数据,在这里做数据绑定
  91. if(msg.success){
  92. opinionObj = msg.obj.rows;
  93. var select_arr = [];
  94. var data = opinionObj;
  95. for(var nItem = 0; nItem < data.length; nItem++ ){
  96. select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
  97. }
  98. opinion_array = select_arr.join("");
  99. }
  100. }
  101. });
  102. //获取区
  103. $.ajax({
  104. type: "post",//使用post方法访问后台
  105. dataType: "json",//返回json格式的数据
  106. url: "houseRegisterAction_listChildren",//要访问的后台地址
  107. //data:{"id":id},
  108. success: function(msg){//msg为返回的数据,在这里做数据绑定
  109. if(msg.success){
  110. areaObj = msg.obj.rows;
  111. var select_arr = [];
  112. var data = areaObj;
  113. for(var nItem = 0; nItem < data.length; nItem++ ){
  114. select_arr.push("<option value="+data[nItem].id+">"+data[nItem].name+"</option>");
  115. }
  116. area_array = select_arr.join("");
  117. }
  118. }
  119. });
  120. $('#exchangeHouseDataGrid').datagrid({
  121. rownumbers:true,
  122. fit:true,
  123. pageSize:20,
  124. pageList : [ 10, 20, 30, 40, 50 ],
  125. fitColumns:false,
  126. border:false,
  127. sortOrder:'desc',
  128. pagination:true,
  129. idField:'id',
  130. url:whzl.basePath + '/exchangeHouseAction_listExchangeHouse',
  131. toolbar:'#searchtool',
  132. checkOnSelect:true,
  133. selectOnCheck:false,
  134. nowrap:true,
  135. loadFilter:function(result){
  136. if(result.success){
  137. return result.obj;
  138. }else{
  139. $.messager.alert("提示",result.message);
  140. return ;
  141. }
  142. }
  143. });
  144. })
  145. /**查询*/
  146. function searchFun(){
  147. $("#exchangeHouseDataGrid").datagrid("load", {
  148. "exchangeHouse.name1":$("#tblQuery").find("input[id='securityPersonName']").val(),
  149. "exchangeHouse.idCard1":$("#tblQuery").find("input[id='securityPersonIdCard']").val()
  150. });
  151. }
  152. /*清除查询条件**/
  153. function ClearQuery() {
  154. $("#tblQuery").find("input").val("");
  155. $("#tblQuery").find("select").val("-1");
  156. }
  157. var dateFormatter = function(value,row,index){
  158. if(value != null){
  159. return value.substring(0,10);
  160. }else{
  161. return "";
  162. }
  163. }
  164. /**人员详细*/
  165. var detailFormatter = function(value , row , index){
  166. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/detail.png' title='查看详情' onclick=exchangeHouseDetail('" + row.id + "') style='cursor:pointer' />";
  167. };
  168. /**房源详细页面对话框*/
  169. var exchangeHouseDetail = function(id){
  170. $("#exchangeHouseDetailDialog").dialog({
  171. buttons : [{
  172. text : '确定',
  173. iconCls : 'icon-ok',
  174. handler : function(){
  175. $("#exchangeHouseDetailDialog").dialog("close");
  176. }
  177. }],
  178. onLoad : function(){
  179. detail_load(id);
  180. }
  181. });
  182. };
  183. /**打印审批表*/
  184. var printFormatter = function(value , row , index){
  185. return "<img src='<%=basePath%>/images/printer.png' title='选择合同模板' onclick=printRow(" + row.id + ") style='cursor:pointer' />";
  186. };
  187. function printRow(id){
  188. window.open(whzl.basePath+"/exchangeHouseAction_toApplicationPrint?exchangeHouseId="+id);
  189. }
  190. /**打印协议书*/
  191. var agreementPrintFormatter = function(value , row , index){
  192. if(row.state=="1"){
  193. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='查看详情' onclick=agreementPrint(" + row.id +") style='cursor:pointer' />";
  194. }else{
  195. return "";
  196. }
  197. };
  198. function agreementPrint(id){
  199. window.open(whzl.basePath+"/exchangeHouseAction_toAgreementPrint?exchangeHouseId="+id);
  200. }
  201. /**上传审批表*/
  202. var uploadFormatter = function(value , row , index){
  203. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=applicationUpload(" + row.id + ") style='cursor:pointer' />";
  204. };
  205. function applicationUpload(id){
  206. $("#uploadDialog").dialog({
  207. buttons : [{
  208. text : '确定',
  209. iconCls : 'icon-ok',
  210. handler : function(){
  211. $("#uploadExchangeContractDialog").dialog("close");
  212. }
  213. }],
  214. onLoad : function(){
  215. upload_load(id);
  216. }
  217. });
  218. }
  219. /**上传协议书*/
  220. var agreementUploadFormatter = function(value , row , index){
  221. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=agreementUpload(" + row.id + ") style='cursor:pointer' />";
  222. /*if(row.state=="1"){
  223. return "<img src='<%=basePath%>/images/pencil.png' title='修改' onclick=agreementUpload(" + row.id + ") style='cursor:pointer' />";
  224. }else{
  225. return "";
  226. }*/
  227. };
  228. function agreementUpload(id){
  229. $("#uploadDialog").dialog({
  230. buttons : [{
  231. text : '确定',
  232. iconCls : 'icon-ok',
  233. handler : function(){
  234. $("#uploadDialog").dialog("close");
  235. $("#exchangeHouseDataGrid").datagrid("reload");
  236. }
  237. }],
  238. onLoad : function(){
  239. upload_load(id);
  240. }
  241. });
  242. }
  243. /**更新*/
  244. var updateFormatter = function(value , row , index){
  245. if(row.state == 2){
  246. return "<img src='<%=basePath%>/images/pencil.png' title='审核' onclick=updateRow('" + row.id +"') style='cursor:pointer' />";
  247. }else{
  248. return "";
  249. }
  250. };
  251. function updateRow(id){
  252. $.messager.confirm('提示', '确认调换房源吗?', function(r){
  253. if(r){
  254. $.ajax({
  255. type: "post",//使用get方法访问后台
  256. dataType: "json",//返回json格式的数据
  257. url: "exchangeHouseAction_verify1ExchangeHouse",//要访问的后台地址
  258. data: "exchangeHouse.id="+id,//要发送的数据
  259. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  260. success: function(msg){
  261. parent.$.messager.progress('close');
  262. $('#exchangeHouseDataGrid').datagrid("reload");
  263. }
  264. })
  265. }
  266. })
  267. }
  268. /**导出退房信息*/
  269. function exchangeExport(){
  270. window.location.href = whzl.basePath+"/exchangeHouseAction_exchangeExport";
  271. }
  272. function exchangeHouseFile(){
  273. var ids = [];
  274. var rows = $('#exchangeHouseDataGrid').datagrid('getSelections');
  275. if(rows.length>0){
  276. for(var i=0; i<rows.length; i++){
  277. ids.push(rows[i].id);
  278. }
  279. var exchangeHouseIds = ids.join(',');
  280. parent.$.messager.progress({
  281. title : '提示',
  282. text : '正在下载,请稍候....'
  283. });
  284. $.ajax({
  285. type: "post",//使用get方法访问后台
  286. dataType: "json",//返回json格式的数据
  287. url: "exchangeHouseAction_exchangeHouseFileDownload?ids="+exchangeHouseIds,//要访问的后台地址
  288. success: function(msg){
  289. parent.$.messager.progress('close');
  290. $("#exchangeHouseDataGrid").datagrid("reload");
  291. if(msg.success){
  292. $.messager.alert('成功','下载完成');
  293. }else{
  294. $.messager.alert('失败',msg.message);
  295. }
  296. }
  297. })
  298. }else{
  299. $.messager.alert('提示',"请选择数据");
  300. }
  301. }
  302. function exchangeHouseExcelDownload(){
  303. var ids = [];
  304. var rows = $('#exchangeHouseDataGrid').datagrid('getSelections');
  305. if(rows.length>0){
  306. for(var i=0; i<rows.length; i++){
  307. ids.push(rows[i].id);
  308. }
  309. var checkOutHouseIds = ids.join(',');
  310. window.location.href = whzl.basePath+"/exchangeHouseAction_exchangeHouseExcelDownload?ids="+checkOutHouseIds
  311. }else{
  312. $.messager.alert('提示',"请选择数据");
  313. }
  314. }
  315. --></script>
  316. <div class="easyui-layout" data-options="fit:true,border:false">
  317. <div data-options="region:'center',border:false">
  318. <div id="searchtool" data-options="region:'north' , border:false">
  319. <div class="clear"></div>
  320. <table id="tblQuery" style="width:100%;">
  321. <tr>
  322. <td align="right" style="width: 10%;"><span>人员名称</span></td><td style="width: 10%;"><input id="securityPersonName" name="securityPersonHouse.name1" type="text" style="width: 100px;"/></td>
  323. <td align="right" style="width: 16%;"><span>身份证号码</span></td><td style="width: 18%;"><input id="securityPersonIdCard" name="securityPersonHouse.securityPerson.idCard" type="text" style="width: 140px;"/></td>
  324. <td align="left" style="width: 46%;">
  325. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  326. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  327. <a href="javascript:exchangeExport();" class="easyui-linkbutton" data-options="iconCls:'icon-import',plain:true">导出</a>
  328. <a href="javascript:exchangeHouseFile();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">附件下载</a>
  329. <a href="javascript:exchangeHouseExcelDownload();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">下载Excel</a>
  330. </td>
  331. </tr>
  332. </table>
  333. <div class="clear"></div>
  334. </div>
  335. <table id="exchangeHouseDataGrid" title="房源入住情况">
  336. <thead>
  337. <tr>
  338. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  339. <th data-options="field:'name1',width:80">换房人甲</th>
  340. <th data-options="field:'idCard1',width:140">换房人甲身份证号</th>
  341. <th data-options="field:'houseAddress1',width:200">房源甲</th>
  342. <th data-options="field:'name2',width:80">换房人乙</th>
  343. <th data-options="field:'idCard2',width:140">换房人乙身份证号</th>
  344. <th data-options="field:'houseAddress2',width:200">房源乙</th>
  345. <th data-options="field:'detail',width:60,align:'center',formatter:detailFormatter">换房详情</th>
  346. <th data-options="field:'agreementPrint',align:'center',width:70,formatter:agreementPrintFormatter">打印协议书</th>
  347. <th data-options="field:'agreementUpload',align:'center',width:70,formatter:agreementUploadFormatter">上传协议书</th>
  348. <th data-options="field:'update',align:'center',width:60,formatter:updateFormatter">确认换房</th>
  349. </tr>
  350. </thead>
  351. </table>
  352. </div>
  353. </div>
  354. <div id="exchangeHouseDetailDialog" data-options="title:'&nbsp;查看详情',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/exchangeHouseAction_toDetail'">
  355. </div>
  356. <div id="uploadDialog" data-options="title:'&nbsp;合同文件上传',iconCls:'icon-edit',width:800,height:420,modal:true,href:'<%=basePath %>/exchangeHouseAction_toUpload'">
  357. </div>
  358. <script type="text/javascript">
  359. <!--
  360. parent.$.messager.progress('close');
  361. $('#area').combobox({
  362. url: whzl.basePath + '/houseRegisterAction_listChildrenCombobox',
  363. valueField:'value',
  364. textField:'text',
  365. onChange:function (newValue,oldValue) {
  366. $('#communityId').combobox("setValue","");
  367. $('#no').combobox("setValue","");
  368. $('#houseNumber').combobox("setValue","");
  369. $('#communityId').combobox('reload',whzl.basePath + '/communityAction_findAll?community.area='+newValue);
  370. }
  371. });
  372. $('#communityId').combobox({
  373. url: whzl.basePath + '/communityAction_findAll',
  374. valueField:'value',
  375. textField:'text',
  376. filter:function(q,row){
  377. var opts=$(this).combobox("options");
  378. //return row[opts.textField].indexOf(q)==0;//
  379. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  380. },
  381. onChange:function (newValue,oldValue) {
  382. $('#no').combobox("setValue","");
  383. $('#houseNumber').combobox("setValue","");
  384. $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
  385. }
  386. });
  387. $('#no').combobox({
  388. //editable:false,
  389. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
  390. valueField:'value',
  391. textField:'text',
  392. filter:function(q,row){
  393. var opts=$(this).combobox("options");
  394. //return row[opts.textField].indexOf(q)==0;//
  395. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  396. },
  397. onChange:function (newValue,oldValue) {
  398. $('#houseNumber').combobox("setValue","");
  399. $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
  400. }
  401. });
  402. $('#houseNumber').combobox({
  403. //editable:false,
  404. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
  405. valueField:'value',
  406. textField:'text',
  407. filter:function(q,row){
  408. var opts=$(this).combobox("options");
  409. //return row[opts.textField].indexOf(q)==0;//
  410. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  411. }
  412. });
  413. //-->
  414. </script>