rentList5.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <%-- 打印合同 --%>
  2. <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
  3. <jsp:include page="../../common/include.jsp" />
  4. <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
  5. <script type="text/javascript">
  6. //家庭收入情况
  7. var incomeTypeObj = null;
  8. var incomeType_array = null;
  9. $.ajax({
  10. type: "post",//使用post方法访问后台
  11. dataType: "json",//返回json格式的数据
  12. url: "aa10Action_listAa10All",//要访问的后台地址
  13. data:{"aa10.letter":"incomeType" ,"aa10.name":"家庭收入类型" },
  14. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  15. success: function(msg){//msg为返回的数据,在这里做数据绑定
  16. if(msg.success){
  17. incomeTypeObj = msg.obj.rows;
  18. }
  19. }
  20. });
  21. /**小区显示区*/
  22. $(function() {
  23. $('#rentDataGrid5').datagrid({
  24. rownumbers:true,
  25. fit:true,
  26. pageSize:10,
  27. pageList : [ 10, 20, 30, 40, 50 ],
  28. fitColumns:false,
  29. border:false,
  30. sortOrder:'desc',
  31. pagination:true,
  32. idField:'id',
  33. toolbar:'#searchtool',
  34. url:whzl.basePath + '/rent10Action_rentList?rentStatus=0',
  35. pageNumber:1,
  36. nowrap:true,
  37. loadFilter:function(result){
  38. console.log(result.obj)
  39. if(result.success){
  40. return result.obj;
  41. }else{
  42. $.messager.alert("提示",result.message);
  43. return ;
  44. }
  45. }
  46. });
  47. });
  48. /**查询*/
  49. function searchFun(){
  50. $("#rentDataGrid5").datagrid("load", {
  51. "rent10.house.community.id":trim($('#communityId').combobox("getValue")),
  52. "rent10.house.no":trim($('#no').combobox("getValue")),
  53. "rent10.house.houseNumber":trim($('#houseNumber').combobox("getValue")),
  54. "rent10.lesseeId":trim($('#lesseeId').val()),
  55. "createStartDay":trim($('#createStartDay').datebox('getValue')),
  56. "createEndDay":trim($('#createEndDay').datebox('getValue')),
  57. "rent10.startDay":trim($('#startDay').datebox('getValue')),
  58. "rent10.endDay":trim($('#endDay').datebox('getValue'))
  59. });
  60. }
  61. /*清除查询条件**/
  62. function ClearQuery() {
  63. $("#tblQuery").find("input").val("");
  64. $("#tblQuery").find("select").val("-1");
  65. }
  66. var communityNameFormatter = function(value , row , index){
  67. return row.house.communityName;
  68. }
  69. var noFormatter = function(value , row , index){
  70. return row.house.no;
  71. }
  72. var houseNumberFormatter = function(value , row , index){
  73. return row.house.houseNumber;
  74. }
  75. var dateFormatter = function(value , row , index){
  76. return dealDate(value);
  77. }
  78. //合同当前状态
  79. var rentStatusFormatter = function(value , row , index){
  80. if(value == 1) {
  81. return "正常";
  82. }else if(value == 0) {
  83. return "作废";
  84. }else if(value == 2) {
  85. return "申请作废中";
  86. }
  87. }
  88. /**详情*/
  89. var detailFormatter = function(value , row , index){
  90. return "<img src='<%=basePath%>/images/details.png' title='详情' onclick=rentDetail(" + row.id + ") style='cursor:pointer' />";
  91. }
  92. var rentDetail = function(id){
  93. $("#rentDetailDialog").dialog(
  94. {
  95. buttons : [
  96. {
  97. text : '关闭',
  98. iconCls : 'icon-ok',
  99. handler : function(){
  100. $("#rentDetailDialog").dialog("close");
  101. }
  102. }
  103. ],
  104. onLoad : function(){
  105. rentDetail_load(id);
  106. }
  107. }
  108. );
  109. };
  110. /**打印租金合同*/
  111. var printRentFormatter = function(value , row , index){
  112. if(row.contractNo!=null&&row.contractNo!=""){
  113. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='打印' onclick=printRent(" + row.id + ",'" + row.house.communityName + "') style='cursor:pointer' />"
  114. }else{
  115. return "";
  116. }
  117. }
  118. /**模板选择对话框*/
  119. var printRent = function(id,communityName){
  120. $("#templetSelectDialog").dialog(
  121. {
  122. buttons : [
  123. {
  124. text : '关闭',
  125. iconCls : 'icon-ok',
  126. handler : function(){
  127. $("#templetSelectDialog").dialog("close");
  128. }
  129. }
  130. ],
  131. onLoad : function(){
  132. templet_load(id,communityName);
  133. }
  134. }
  135. );
  136. };
  137. var printStateFormatter = function(value , row , index){
  138. if(value == 0){
  139. return "未打印";
  140. }else if(value == 1){
  141. return "已打印";
  142. }
  143. }
  144. var pdfSelectFormatter = function(value , row , index){
  145. return "<img src='<%=basePath%>/js/easyui/themes/itemicon/print.png' title='选择PDF' onclick=pdfSelect(" + row.id+",'"+row.lessee+"') style='cursor:pointer' />"
  146. }
  147. var pdfSelect = function(id,lesseeName){
  148. $("#pdfSelectDialog").dialog(
  149. {
  150. buttons : [
  151. {
  152. text : '关闭',
  153. iconCls : 'icon-ok',
  154. handler : function(){
  155. $("#pdfSelectDialog").dialog("close");
  156. }
  157. }
  158. ],
  159. onLoad : function(){
  160. pdfSelect_load(id,lesseeName);
  161. }
  162. }
  163. );
  164. };
  165. /**上传附件*/
  166. uploadFormatter = function(value , row , index){
  167. return "<img src='<%=basePath%>/images/up.png' title='确认退房' onclick=uploadRent10(" + row.id + ") style='cursor:pointer' />"
  168. }
  169. function uploadRent10(id){
  170. $("#uploadDialog").dialog({
  171. buttons : [{
  172. text : '提交',
  173. iconCls : 'icon-ok',
  174. handler : function(){
  175. uploadRent10File_submit(id);
  176. $("#uploadDialog").dialog("close");
  177. }
  178. },{
  179. text : '取消',
  180. iconCls : 'icon-cancel',
  181. handler : function(){
  182. $("#uploadDialog").dialog("close");
  183. }
  184. }],
  185. onLoad : function(){
  186. detail_load(id);
  187. }
  188. });
  189. }
  190. </script>
  191. <div class="easyui-layout" data-options="fit:true,border:false">
  192. <div data-options="region:'center',border:false">
  193. <div id="searchtool" data-options="region:'north',border:false">
  194. <div class="clear"></div>
  195. <table id="tblQuery" style="width:100%;font-size:12px;">
  196. <tr>
  197. <td><span>小区名称</span></td>
  198. <td>
  199. <input id="communityId">
  200. <input id="no" style="width: 60px;">幢
  201. <input id="houseNumber" style="width: 80px;">室
  202. </td>
  203. <td>承租人身份证号</td>
  204. <td><input id="lesseeId"/></td>
  205. <td align="center">
  206. <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
  207. <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
  208. </td>
  209. </tr>
  210. <tr>
  211. <td><span>录入合同时间从</span></td>
  212. <td>
  213. <input class="easyui-datebox" id="createStartDay"/>&nbsp;至&nbsp;
  214. <input class="easyui-datebox" id="createEndDay"/>
  215. </td>
  216. <td><span>合同时间从</span></td>
  217. <td>
  218. <input class="easyui-datebox" id="startDay"/>&nbsp;至&nbsp;
  219. <input class="easyui-datebox" id="endDay"/>
  220. </td>
  221. </tr>
  222. </table>
  223. <div class="clear"></div>
  224. </div>
  225. <table id="rentDataGrid5">
  226. <thead frozen="true">
  227. <tr>
  228. <th data-options="field:'id',checkbox:true,width:30">ID</th>
  229. <th data-options="field:'contractNo',align:'center',width:110">合同编号</th>
  230. <th data-options="field:'communityName',sortable:true,width:100,formatter:communityNameFormatter">小区名称</th>
  231. </tr>
  232. </thead>
  233. <thead>
  234. <tr>
  235. <th data-options="field:'no',width:80,formatter:noFormatter">楼号</th>
  236. <th data-options="field:'houseNumber',width:80,formatter:houseNumberFormatter">房号</th>
  237. <th data-options="field:'lessee',width:80">承租人</th>
  238. <th data-options="field:'lesseeId',width:150">承租人身份证</th>
  239. <th data-options="field:'startDay',width:80,formatter:dateFormatter">开始时间</th>
  240. <th data-options="field:'endDay',width:80,formatter:dateFormatter">结束时间</th>
  241. <th data-options="field:'rentStatus',width:80,formatter:rentStatusFormatter">当前状态</th>
  242. <th data-options="field:'detail',width:80,formatter:detailFormatter">详情</th>
  243. <th data-options="field:'printState',width:80,formatter:printStateFormatter">打印状态</th>
  244. <th data-options="field:'printRent',align:'center',width:60,formatter:printRentFormatter">打印</th>
  245. <th data-options="field:'pdfSelect',align:'center',width:60,formatter:pdfSelectFormatter">选择模板</th>
  246. <th data-options="field:'upload',align:'center',width:60,formatter:uploadFormatter">上传PDF</th>
  247. </tr>
  248. </thead>
  249. </table>
  250. </div>
  251. </div>
  252. <div id="rentDetailDialog" data-options="title:'&nbsp;合同详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toRentDetail'">
  253. </div>
  254. <div id="templetSelectDialog" data-options="title:'&nbsp;选择合同模板',iconCls:'icon-details',width:420,height:320,modal:true,href:'<%=basePath %>/rent10Action_toSelectList'">
  255. </div>
  256. <div id="pdfSelectDialog" data-options="title:'&nbsp;选择合同模板',iconCls:'icon-details',width:1000,height:400,modal:true,href:'<%=basePath %>/rent10Action_toPdfSelect'">
  257. </div>
  258. <div id="uploadDialog" data-options="title:'&nbsp;上传附件',iconCls:'icon-detail',width:400,height:300,modal:true,href:'<%=basePath %>/rent10Action_toUploadRent10'">
  259. </div>
  260. <script type="text/javascript">
  261. $(function(){
  262. parent.$.messager.progress('close');
  263. $('#communityId').combobox({
  264. url: whzl.basePath + '/communityAction_findAll',
  265. valueField:'value',
  266. textField:'text',
  267. filter:function(q,row){
  268. var opts=$(this).combobox("options");
  269. //return row[opts.textField].indexOf(q)==0;//
  270. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  271. },
  272. onChange:function (newValue,oldValue) {
  273. $('#no').combobox("setValue","");
  274. $('#houseNumber').combobox("setValue","");
  275. $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
  276. }
  277. });
  278. $('#no').combobox({
  279. //editable:false,
  280. url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
  281. valueField:'value',
  282. textField:'text',
  283. filter:function(q,row){
  284. var opts=$(this).combobox("options");
  285. //return row[opts.textField].indexOf(q)==0;//
  286. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  287. },
  288. onChange:function (newValue,oldValue) {
  289. $('#houseNumber').combobox("setValue","");
  290. $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
  291. }
  292. });
  293. $('#houseNumber').combobox({
  294. //editable:false,
  295. url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
  296. valueField:'value',
  297. textField:'text',
  298. filter:function(q,row){
  299. var opts=$(this).combobox("options");
  300. //return row[opts.textField].indexOf(q)==0;//
  301. return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
  302. }
  303. });
  304. })
  305. </script>