123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <%@ 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"><!--
- /**用户显示区*/
- $(function() {
- $('#rentDataGrid').datagrid({
- rownumbers:true,
- fit:true,
- pageSize:20,
- pageList : [ 10, 20, 30, 40, 50 ],
- fitColumns:false,
- border:false,
- sortOrder:'desc',
- pagination:true,
- idField:'id',
- url:whzl.basePath + '/rentAction_listRent',
- toolbar:'#searchtool',
- checkOnSelect:true,
- selectOnCheck:false,
- nowrap:true,
- rowStyler:function(index,row){
- if(row.rentType == 1){
- return 'background-color:pink;color:blue;font-weight:bold;';
- }
- },
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
- });
-
-
- /**查询*/
- function searchFun(){
- $("#rentDataGrid").datagrid("load", {
- "rent.securityPerson.name":$("#tblQuery").find("input[id='securityPersonName']").val(),
- "rent.securityPerson.idCard":$("#tblQuery").find("input[id='securityPersonIdCard']").val()
- });
- }
-
- /*清除查询条件**/
- function ClearQuery() {
- $("#tblQuery").find("input").val("");
- $("#tblQuery").find("select").val("-1");
- }
-
- var dateFormatter = function(value,row,index){
- if(value != null){
- return value.substring(0,10);
- }else{
- return "";
- }
- }
-
- var contractNameFormatter = function(value,row,index){
- return row.leaseContract.contractName;
- }
-
- var contractNoFormatter = function(value,row,index){
- return row.leaseContract.contractNo;
- }
-
- var securityPersonNameFormatter = function(value,row,index){
- return row.securityPerson.name;
- }
-
- var securityPersonIdCardFormatter = function(value,row,index){
- return row.securityPerson.idCard;
- }
-
- var houseAddressFormatter = function(value,row,index){
- return row.house.address;
- }
- //月租金保留小数点后两位
- var rentMonthMoneyFormatter = function(value,row,index){
- return row.rentMonthMoney.toFixed(2);
- }
- //总租金保留小数点后两位
- var rentMoneyFormatter = function(value,row,index){
- return row.rentMoney.toFixed(2);
- }
-
- /**详细*/
- var detailsFormatter = function(value , row , index){
- if(row.rentType != 1){
- return "<img src='<%=basePath%>/images/details.png' title='查看详情' onclick=rentDetails(" + row.id + ") style='cursor:pointer' />";
- }else{
- return "<img src='<%=basePath%>/images/details.png' title='查看详情' onclick=rentRemoveDetails(" + row.id + ") style='cursor:pointer' />";
- }
- };
-
- /**详细页面对话框*/
- var rentDetails = function(id){
- $("#detailRentDialog").dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#detailRentDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- detail_load(id);
- }
- }
- );
- };
-
- /**详细页面对话框*/
- var rentRemoveDetails = function(id){
- $("#detailRentRemoveDialog").dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- $("#detailRentRemoveDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- removeDetail_load(id);
- }
- }
- );
- };
-
- /**增加租金收取*/
- function rentAdd(){
- $('#addRentDialog').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- /*parent.$.messager.progress({
- title : '提示',
- text : '保存中,请稍后....'
- });*/
- add_submit();
- $("#addRentDialog").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#addRentDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- add_load();
- }
- }
- );
- }
-
- /**增加租金退还*/
- function rentRemove(){
- $('#removeRentDialog').dialog(
- {
- buttons : [
- {
- text : '提交',
- iconCls : 'icon-ok',
- handler : function(){
- remove_submit();
- $("#removeRentDialog").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#removeRentDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- remove_load();
- }
- }
- );
- }
-
-
- /**删除*/
- var delFormatter = function(value , row , index){
- return "<img src='<%=basePath%>/images/edit_remove.png' title='删除' onclick=deleteRow(" + row.id + ") style='cursor:pointer' />";
- };
-
- /**删除功能*/
- function deleteRow(id){
- $.messager.confirm('删除提示', '确定删除这条记录吗?', function(r){
- if (r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "rentAction_delete",//要访问的后台地址
- data: "rent.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $.messager.alert('提示','删除成功!');
- $('#rentDataGrid').datagrid('reload');
- }else{
- $.messager.alert('提示','删除失败!');
- }
- }
- });
- }
- });
- }
-
-
-
- --></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%;">
- <tr>
- <td align="right" style="width: 70px;"><span>租房人姓名</span></td><td style="width: 120px;"><input id="securityPersonName" name="rent.securityPerson.name" type="text" style="width: 100px;"/></td>
- <td align="right" style="width: 70px;"><span>租房人身份证号</span></td><td style="width: 120px;"><input id="securityPersonIdCard" name="rent.securityPerson.idCard" type="text" style="width: 140px;"/></td>
- <td align="left" style="width: 200px;">
- <a href="javascript:rentAdd();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">租金收取</a>
- <a href="javascript:rentRemove();" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">租金退还</a>
- <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>
- </td>
- </tr>
-
- </table>
- <div class="clear"></div>
- </div>
-
- <table id="rentDataGrid">
- <thead>
- <tr>
- <th data-options="field:'contractName',sortable:true,width:155,formatter:contractNameFormatter">租赁合同名称</th>
- <th data-options="field:'contractNo',sortable:true,width:90,formatter:contractNoFormatter">租赁合同编号</th>
- <th data-options="field:'securityPersonName',sortable:true,width:80,formatter:securityPersonNameFormatter">租赁人</th>
- <th data-options="field:'securityPersonIdCard',sortable:true,width:160,formatter:securityPersonIdCardFormatter">租赁人身份证号码</th>
- <th data-options="field:'houseAddress',sortable:true,width:120,formatter:houseAddressFormatter">租赁房屋</th>
- <th data-options="field:'rentMonthMoney',sortable:true,width:75,formatter:rentMonthMoneyFormatter">月租金</th>
- <th data-options="field:'rentMonth',sortable:true,width:50">收取月数</th>
- <th data-options="field:'rentMoney',sortable:true,width:75,formatter:rentMoneyFormatter">收取总金额</th>
- <th data-options="field:'startDate',sortable:true,width:75,formatter:dateFormatter">租金开始日期</th>
- <th data-options="field:'endDate',sortable:true,width:75,formatter:dateFormatter">租金结束日期</th>
- <th data-options="field:'details',align:'center',width:60,formatter:detailsFormatter">查看详情</th>
- <!--<th data-options="field:'delete',align:'center',width:60,formatter:delFormatter">删除</th>-->
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <div id="detailRentDialog" data-options="title:' 租金收取详情',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/rentAction_toDetail'">
- </div>
- <div id="addRentDialog" data-options="title:' 添加租金收取',iconCls:'icon-add',width:800,height:420,modal:true,href:'<%=basePath %>/rentAction_toAdd'">
- </div>
- <div id="leaseContractSelectDialog" data-options="title:' 选择合同',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/leaseContractAction_toLeaseContractSelect'">
- </div>
- <div id="removeRentDialog" data-options="title:' 添加租金退还',iconCls:'icon-remove',width:800,height:420,modal:true,href:'<%=basePath %>/rentAction_toRemove'">
- </div>
- <div id="detailRentRemoveDialog" data-options="title:' 租金退还详情',iconCls:'icon-details',width:800,height:420,modal:true,href:'<%=basePath %>/rentAction_toRemoveDetail'">
- </div>
- <script type="text/javascript">
- <!--
- parent.$.messager.progress('close');
- //-->
- </script>
|