123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <%-- 合同查询 --%>
- <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
- <jsp:include page="../../common/include.jsp" />
- <% String basePath = request.getScheme()+ "://" + request.getServerName() + ":" +request.getServerPort() + request.getContextPath(); %>
- <script type="text/javascript">
- //家庭收入情况
- var incomeTypeObj = null;
- var incomeType_array = null;
-
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"incomeType" ,"aa10.name":"家庭收入类型" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- incomeTypeObj = msg.obj.rows;
- }
- }
- });
-
- /**小区显示区*/
- $(function() {
- $('#rentDataGrid4').datagrid({
- rownumbers:true,
- fit:true,
- pageSize:10,
- pageList : [ 10, 20, 30, 40, 50 ],
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- pagination:true,
- idField:'id',
- toolbar:'#searchtool',
- pageNumber:1,
- nowrap:true,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
- });
-
- /**查询*/
- function searchFun(){
- $("#rentDataGrid4").datagrid("load", {
- "rent10.house.community.id":trim($('#communityId').combobox("getValue")),
- "rent10.house.no":trim($('#no').combobox("getValue")),
- "rent10.house.houseNumber":trim($('#houseNumber').combobox("getValue")),
- "rent10.lesseeId":trim($('#lesseeId').val()),
- "rent10.lessee":trim($('#lessee').val()),
- "createStartDay":trim($('#createStartDay').datebox('getValue')),
- "createEndDay":trim($('#createEndDay').datebox('getValue')),
- "rent10.startDay":trim($('#startDay').datebox('getValue')),
- "rent10.endDay":trim($('#endDay').datebox('getValue')),
- "rent10.rentStatus":$('#rentStatus').val()
- });
- $('#rentDataGrid4').datagrid({url:whzl.basePath + '/rent10Action_rentList'});
- }
-
- /*清除查询条件**/
- function ClearQuery() {
- $("#tblQuery").find("input").val("");
- $("#tblQuery").find("select").val("-1");
- }
-
- var communityNameFormatter = function(value , row , index){
- return row.house.communityName;
- }
- var noFormatter = function(value , row , index){
- return row.house.no;
- }
- var houseNumberFormatter = function(value , row , index){
- return row.house.houseNumber;
- }
-
- var dateFormatter = function(value , row , index){
- return dealDate(value);
- }
-
- //合同当前状态
- var rentStatusFormatter = function(value , row , index){
- if(value == 1) {
- return "正常";
- }else if(value == 0) {
- return "作废";
- }else if(value == 2) {
- return "申请作废中";
- }
- }
- /**详情*/
- var detailFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/images/details.png' title='详情' onclick=rentDetail(" + row.id + ") style='cursor:pointer' />";
- }
-
- var rentDetail = function(id){
- $("#rentDetailDialog").dialog({
- buttons : [{
- text : '关闭',
- iconCls : 'icon-ok',
- handler : function(){
- $("#rentDetailDialog").dialog("close");
- }
- }],
- onLoad : function(){
- rentDetail_load(id);
- }
- });
- };
- /**导出合同*/
- function rentExport(){
- var params = encodeURI("rent10.house.community.id="+trim($('#communityId').combobox("getValue"))+
- "&rent10.house.no="+trim($('#no').combobox("getValue")) +
- "&rent10.house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
- "&rent10.lesseeId="+trim($('#lesseeId').val())+
- "&rent10.lessee="+trim($('#lessee').val())+
- "&rent10.startDay="+$('#startDay').datebox('getValue')+
- "&rent10.endDay="+$('#endDay').datebox('getValue')+
- "&rent10.rentStatus="+$('#rentStatus').val()+
- "&createStartDay="+trim($('#createStartDay').datebox('getValue'))+
- "&createEndDay="+trim($('#createEndDay').datebox('getValue'))
- );
- window.location.href = whzl.basePath+"/rent10Action_export?"+params;
- /*$("#exportColumnDialog").dialog({
- buttons : [{
- text : '确认',
- iconCls : 'icon-ok',
- handler : function(){
- var columnValue = [];
- var columnName = [];
- $("input[name='columnName']:checked").each(function () {
- columnValue.push($(this).val());
- columnName.push($(this).attr('valueText'));
- });
- if(columnValue==""){
- $.messager.alert("提示","请选择导出的字段名称!");
- return;
- }else{
- var params = encodeURI("house.community.id="+trim($('#communityId').combobox("getValue"))+
- "&rent10.house.no="+trim($('#no').combobox("getValue")) +
- "&rent10.house.houseNumber="+trim($('#houseNumber').combobox("getValue"))+
- "&createStartDay="+$('#createStartDay').datebox('getValue')+
- "&createEndDay="+$('#createEndDay').datebox('getValue')+
- "&rent10.rentStatus="+$('#rentStatus').val()+
- "&rent10.lesseeId="+trim($('#lesseeId').val())+
- "&rent10.lessee="+trim($('#lessee').val())+
- "&rent10.startDay="+trim($('#startDay').datebox('getValue'))+
- "&rent10.endDay="+trim($('#endDay').datebox('getValue'))
- );
- window.location.href = whzl.basePath+"/rent10Action_houseAllExport?columnValue="+columnValue+"&columnName="+columnName+"&"+params;
- }
- }
- }]
- })*/
- }
-
- function onCheckRows(){
- var rows = $('#rentDataGrid4').datagrid('getSelections');
- var ptotal = 0//计算rentYear的总和
- for (var i = 0; i < rows.length; i++) {
- ptotal += rows[i]['rentYear'];
- }
- $('#rentDataGrid4').datagrid('getPager').pagination({
- buttons:[{
- text:'总租金为:'+ptotal.toFixed(2)
- }]
- });
- }
-
- /**上传附件*/
- var uploadFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/images/up.png' title='确认退房' onclick=uploadRent10File(" + row.id + ") style='cursor:pointer' />"
- }
-
- function uploadRent10File(id){
- $("#uploadCheckOutHouseDialog").dialog({
- buttons : [{
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- uploadRent10File_submit(id);
- $("#uploadCheckOutHouseDialog").dialog("close");
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#uploadCheckOutHouseDialog").dialog("close");
- }
- }],
- onLoad : function(){
- detail_load(id);
- }
- });
- }
-
- function rent10File(){
- var ids = [];
- var rows = $('#rentDataGrid4').datagrid('getSelections');
- if(rows.length>0){
- for(var i=0; i<rows.length; i++){
- ids.push(rows[i].id);
- }
- var checkOutHouseIds = ids.join(',');
- parent.$.messager.progress({
- title : '提示',
- text : '正在下载,请稍候....'
- });
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rent10Action_rent10FileDownload?ids="+checkOutHouseIds,//要访问的后台地址
- success: function(msg){
- parent.$.messager.progress('close');
- $("#checkOutHouseDataGrid").datagrid("reload");
- if(msg.success){
- $.messager.alert('成功','下载完成');
- }else{
- $.messager.alert('失败',msg.message);
- }
- }
- })
- }else{
- $.messager.alert('提示',"请选择数据");
- }
- }
-
-
-
-
- function rent10ExcelDownload(){
- var ids = [];
- var rows = $('#rentDataGrid4').datagrid('getSelections');
- if(rows.length>0){
- for(var i=0; i<rows.length; i++){
- ids.push(rows[i].id);
- }
- var checkOutHouseIds = ids.join(',');
- window.location.href = whzl.basePath+"/rent10Action_rent10ExcelDownload?ids="+checkOutHouseIds
- }else{
- $.messager.alert('提示',"请选择数据");
- }
- }
- var updateFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/images/update.png' title='更新' onclick=updateRent10(" + row.id + ") style='cursor:pointer' />"
- }
- function updateRent10(id){
- $("#updateDialog").dialog({
- buttons : [{
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- updateRent10_submit(id);
- $("#updateDialog").dialog("close");
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#updateDialog").dialog("close");
- }
- }],
- onLoad : function(){
- detail_load(id);
- }
- });
- }
- var incomeTypeFormatter= function(value , row , index){
- var incomeType = "";
- for(var nItem = 0; nItem < incomeTypeObj.length; nItem++ ){
- if(incomeTypeObj[nItem].code == value){
- incomeType = incomeTypeObj[nItem].value;
- break;
- }
- }
- return incomeType;
- }
- </script>
- <div class="easyui-layout" data-options="fit:true,border:false">
- <div data-options="region:'center',border:false">
- <div id="searchtool" data-options="region:'north',border:false">
- <div class="clear"></div>
- <table id="tblQuery" style="width:100%;font-size:12px;">
- <tr>
- <td align="right">承租人身份证号</td>
- <td><input id="lesseeId"/></td>
- <td align="right"><span>承租人姓名</span></td>
- <td><input id="lessee"/></td>
-
- </tr>
- <tr>
- <td align="right"><span>小区名称</span></td>
- <td>
- <input id="communityId">
- <input id="no" style="width: 60px;">幢
- <input id="houseNumber" style="width: 80px;">室
- </td>
- <td align="right"><span>合同状态</span></td>
- <td>
- <select id="rentStatus" style="width: 173px">
- <option value="1" selected="selected">正常</option>
- <option value="0">已作废</option>
- <option value="2">申请作废中</option>
- <option value="">全部</option>
- </select>
- </td>
- </tr>
- <tr>
- <td align="right"><span>交钱时间从</span></td>
- <td>
- <input class="easyui-datebox" id="createStartDay"/> 至
- <input class="easyui-datebox" id="createEndDay"/>
- </td>
- <td align="right"><span>合同时间从</span></td>
- <td>
- <input class="easyui-datebox" id="startDay"/> 至
- <input class="easyui-datebox" id="endDay"/>
- </td>
- <td align="center">
- <a href="javascript:searchFun();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</a>
- <a href="javascript:ClearQuery();" class="easyui-linkbutton" data-options="iconCls:'icon-emptied',plain:true">清空</a>
- <a href="javascript:rentExport();" class="easyui-linkbutton" data-options="iconCls:'icon-export',plain:true">导出</a>
- <a href="javascript:rent10File();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">附件下载</a>
- <a href="javascript:rent10ExcelDownload();" class="easyui-linkbutton" data-options="iconCls:'icon-nextstep',plain:true">下载Excel</a>
-
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
-
- <table id="rentDataGrid4">
- <thead frozen="true">
- <tr>
- <th data-options="field:'id',checkbox:true,width:30">ID</th>
- <th data-options="field:'contractNo',align:'center',sortable:true,width:110">合同编号</th>
- <th data-options="field:'house.communityName',sortable:true,width:100,formatter:communityNameFormatter">小区名称</th>
- </tr>
- </thead>
- <thead>
- <tr>
- <th data-options="field:'no',width:80,formatter:noFormatter">楼号</th>
- <th data-options="field:'houseNumber',width:80,formatter:houseNumberFormatter">房号</th>
- <th data-options="field:'lessee',width:80">承租人</th>
- <th data-options="field:'lesseeId',width:150">承租人身份证</th>
- <th data-options="field:'startDay',width:80,sortable:true,formatter:dateFormatter">开始时间</th>
- <th data-options="field:'endDay',width:80,sortable:true,formatter:dateFormatter">结束时间</th>
- <th data-options="field:'createDay',width:80,sortable:true,formatter:dateFormatter">录入时间</th>
- <th data-options="field:'rentYear',width:80">年租金</th>
- <th data-options="field:'incomeType',width:80,formatter:incomeTypeFormatter">家庭收入情况</th>
- <th data-options="field:'rentStatus',width:80,formatter:rentStatusFormatter">当前状态</th>
- <th data-options="field:'detail',width:80,formatter:detailFormatter">详情</th>
- <th data-options="field:'update',width:80,align:'center',formatter:updateFormatter">更新</th>
- <th data-options="field:'upload',width:80,align:'center',formatter:uploadFormatter">上传附件</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <div id="rentDetailDialog" data-options="title:' 合同详情信息',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toRentDetail'">
- </div>
- <div id="exportColumnDialog" data-options="title:' 选择导出字段',iconCls:'icon-details',width:850,height:400,modal:true,href:'<%=basePath %>/rent10Action_toExportColumn2'">
- </div>
- <div id="uploadCheckOutHouseDialog" data-options="title:' 上传附件',iconCls:'icon-detail',width:1000,height:500,modal:true,href:'<%=basePath %>/rent10Action_toUploadCheckOutHouse'">
- </div>
- <div id="updateDialog" data-options="title:' 修改合同信息',iconCls:'icon-detail',width:700,height:300,modal:true,href:'<%=basePath %>/rent10Action_toUpdate'">
- </div>
- <script type="text/javascript">
- $(function(){
- parent.$.messager.progress('close');
- $('#communityId').combobox({
- url: whzl.basePath + '/communityAction_findAll',
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#no').combobox("setValue","");
- $('#houseNumber').combobox("setValue","");
- $('#no').combobox('reload',whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"));
- }
- });
- $('#no').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllNo?house.community.id='+$('#communityId').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#houseNumber').combobox("setValue","");
- $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+newValue);
- }
- });
- $('#houseNumber').combobox({
- //editable:false,
- url: whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+$('#no').combobox("getValue"),
- valueField:'value',
- textField:'text',
- filter:function(q,row){
- var opts=$(this).combobox("options");
- //return row[opts.textField].indexOf(q)==0;//
- return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配
- }
- });
- })
- </script>
|