123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- <%--房源交付--%>
- <%@ 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(){
- $('#deliveryHouseDataGrid').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',
- url:whzl.basePath + '/yaohaoAction_deliveryHouseList',
- pageNumber:1,
- nowrap:true,
- loadFilter:function(result){
- if(result.success){
- return result.obj;
- }else{
- $.messager.alert("提示",result.message);
- return ;
- }
- }
- });
- })
- /**查询*/
- function searchFun(){
- $("#deliveryHouseDataGrid").datagrid("load", {
- "securityPersonHouse.house.community.id":trim($('#communityId').combobox("getValue")),
- "securityPersonHouse.house.no":trim($('#no').combobox("getValue")),
- "securityPersonHouse.house.houseNumber":trim($('#houseNumber').combobox("getValue")),
- "securityPersonHouse.securityPerson.idCard":trim($('#lesseeId').val())
- });
- }
- /*清除查询条件**/
- function ClearQuery() {
- $("#tblQuery").find("input").val("");
- $("#tblQuery").find("select").val("-1");
- }
- var securityPersonNameFormatter = function(value , row , index){
- return row.securityPerson.name;
- }
- var isOtherProtectFormatter = function(value , row , index){
- if(row.securityPerson.applyType != undefined && row.securityPerson.waitApplyType != undefined &&row.securityPerson.waitApplyType != ''){
- if(row.securityPerson.applyType == "1"){
- return "补贴在保";
- }
- }else{
- return "无其他保障";
- }
- }
- var houseAddressFormatter = function(value , row , index){
- return row.house.address;
- }
- var isExistHouseFormatter = function(value , row , index){
- if(row.house.isExistHouse == "1"){
- return "现房";
- }else if(row.house.isExistHouse == "2"){
- return "期房";
- }
- }
- var deliveryFormatter = function(value , row , index){
- if(row.state == "0"){
- return "<img src='<%=basePath%>/images/pencil.png' title='交付' onclick=changeApplyType(" + row.id +","+row.securityPerson.id +","+row.house.id+",'"+row.securityPerson.name+"','"+row.securityPerson.applyType+"','"+row.house.address+ "') style='cursor:pointer' />";
- }else if(row.state == "1"){
- return "已交付"
- }
- }
- function changeApplyType(id,securityPersonId,houseId,name,applyType,address){
- if(applyType != "2"){
- $.messager.confirm('提醒', '是否停止其他保障', function(r){
- if(r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "securityPersonAction_changeApplyType",//要访问的后台地址
- data: "securityPerson.id="+securityPersonId,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){
- if(msg.success){
- deliveryHouse(id,houseId,name,address);
- }
- }
- })
- }
- })
- }else{
- deliveryHouse(id,houseId,name,address)
- }
- }
- function deliveryHouse(id,houseId,name,address){
- $.messager.confirm('提醒', '是否将'+address+'交付给'+name, function(r){
- if(r){
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseAction_deliveryHouse",//要访问的后台地址
- async:false,
- data: "house.id="+houseId,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){
- if(msg.success){
- }
- }
- })
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "securityPersonHouseAction_deliveryHouse",//要访问的后台地址
- async:false,
- data: "securityPersonHouse.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){
- if(msg.success){
- }
- }
- })
- }
- })
- }
- </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><span>小区名称</span></td>
- <td>
- <input id="communityId">
- <input id="no" style="width: 60px;"> 幢
- <input id="houseNumber" style="width: 80px;"> 室
- </td>
- <td>承租人身份证号</td>
- <td><input id="lesseeId"/></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>
- </td>
- </tr>
- </table>
- <div class="clear"></div>
- </div>
-
- <table id="deliveryHouseDataGrid">
- <thead frozen="true">
- <tr>
- <th data-options="field:'id',checkbox:true,width:30">ID</th>
- </tr>
- </thead>
- <thead>
- <tr>
- <th data-options="field:'securityPersonName',width:80,formatter:securityPersonNameFormatter">申请人</th>
- <th data-options="field:'isOtherProtect',width:90,formatter:isOtherProtectFormatter">是否有其他保障</th>
- <th data-options="field:'address',width:200,formatter:houseAddressFormatter">房源地址</th>
- <th data-options="field:'isExistHouse',width:60,formatter:isExistHouseFormatter">是否现房</th>
- <th data-options="field:'delivery',width:60,formatter:deliveryFormatter">交付</th>
- </tr>
- </thead>
- </table>
- </div>
- </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)>-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({
- 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)>-1;//将从头位置匹配改为任意匹配
- },
- onChange:function (newValue,oldValue) {
- $('#houseNumber').combobox("setValue","");
- $('#houseNumber').combobox('reload',whzl.basePath + '/houseAction_findAllHouseNumber?house.community.id='+$('#communityId').combobox("getValue") + '&house.no='+encodeURIComponent(newValue));
- }
- });
- $('#houseNumber').combobox({
- 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)>-1;//将从头位置匹配改为任意匹配
- }
- });
- })
- </script>
|