123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <script type="text/javascript">
- var communityPrice1 = 0;
- var garagePrice1 = 0;
- var area1 = 0;
- var garageArea1 = 0;
- var marketRent1 = 0;
- var communityPrice2 = 0;
- var garagePrice2 = 0;
- var area2 = 0;
- var garageArea2 = 0;
- var marketRent2 = 0;
- //合计应收月租金
- var rent = 0;
- //合计应收年租金
- var rentYear = 0;
- //甲方房源基本信息
- function house1_load(id){
- var endTime ="";
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- async:false,
- url: "houseAction_findById",//要访问的后台地址
- data:{"house.id":id },
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $("#houseId1_add").val(id);
- $("#initialPlacementTime1_add").val(dealDate(msg.obj.initialPlacementTime));
- $("#houseAddress1_add").val(msg.obj.address);
- $("#name1_add").val(msg.obj.lessee);
- $("#idCard1_add").val(msg.obj.lesseeId);
- $("#phone1_add").val(msg.obj.lesseeTel);
- $("#residence1_add").val(msg.obj.residence);
- $("#area1_add").val(msg.obj.area);
- $("#garageArea1_add").val(msg.obj.garageArea);
- $("#personType1_add").val(msg.obj.incomeType);
- endTime = dealDate(msg.obj.endTime);
- communityPrice1 = msg.obj.community.price;
- garagePrice1 = msg.obj.community.garagePrice;
- area1 = msg.obj.area;
- garageArea1 = msg.obj.garageArea;
- marketRent1 = msg.obj.marketRent;
- }
- }
- })
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- async:false,
- url: "rent10Action_findByHouseId",//要访问的后台地址
- data:{"house.id":id },
- success: function(msg){
- if(msg.obj !=null){
- endTime = dealDate(msg.obj.endDay);
- $("#name1_add").val(msg.obj.lessee);
- $("#idCard1_add").val(msg.obj.lesseeId);
- $("#phone1_add").val(msg.obj.lesseeTel);
- $("#residence1_add").val(msg.obj.residence);
- $("#personType1_add").val(msg.obj.incomeType);
- }
- }
- })
- $("#rentTime1_add").val(endTime);
- //合同结束-日
- var refundTime;
- refundTime = addDate(new Date(),1);
- $("#refundTime1_add").val(refundTime);
- //当前日期-日
- var date = new Date();
- var day2 = date.getDate();
- if(new Date(endTime)>date){
- var refundMonth = 0;
- refundMonth = countDate(refundTime,endTime);
- $("#refundMonth1_add").val(refundMonth);
- }else{
- $("#refundTime1_add").val(endTime);
- $("#refundMonth1_add").val(0);
- }
- }
- function addSecurityPersonHouse2(){
- var endTime2 = "";
- var houseId2 = "";
- $('#exchangeHouseIntentSelectDialog').dialog({
- buttons : [{
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- houseId2 = select_submit();
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- async:false,
- url: "houseAction_findById",//要访问的后台地址
- data:{"house.id":houseId2 },
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $("#houseId2_add").val(houseId2);
- $("#initialPlacementTime2_add").val(dealDate(msg.obj.initialPlacementTime));
- $("#houseAddress2_add").val(msg.obj.address);
- $("#name2_add").val(msg.obj.lessee);
- $("#idCard2_add").val(msg.obj.lesseeId);
- $("#phone2_add").val(msg.obj.lesseeTel);
- $("#residence2_add").val(msg.obj.residence);
- $("#area2_add").val(msg.obj.area);
- $("#garageArea2_add").val(msg.obj.garageArea);
- $("#personType2_add").val(msg.obj.incomeType)
- endTime2 = dealDate(msg.obj.endTime);
- communityPrice2 = msg.obj.community.price;
- garagePrice2 = msg.obj.community.garagePrice;
- area2 = msg.obj.area;
- garageArea2 = msg.obj.garageArea;
- marketRent2 = msg.obj.marketRent;
- }
- }
- })
-
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- async:false,
- url: "rent10Action_findByHouseId",//要访问的后台地址
- data:{"house.id":houseId2 },
- success: function(msg){
- if(msg.obj!=null){
- endTime2 = dealDate(msg.obj.endDay);
- }else{
-
- }
- }
- })
- $("#rentTime2_add").val(endTime2);
- //当前日期-日
- var refundTime;
- refundTime = addDate(new Date(),1);
- $("#refundTime2_add").val(refundTime);
- var date = new Date();
- var day2 = date.getDate();
- if(new Date(endTime2)>date){
- var refundMonth = 0;
- refundMonth = countDate(refundTime,endTime2);
- $("#refundMonth2_add").val(refundMonth);
- }else{
- $("#refundTime2_add").val(endTime2);
- $("#refundMonth2_add").val(0);
- }
-
- $("#exchangeHouseIntentSelectDialog").dialog("close");
- }
- },{
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#exchangeHouseIntentSelectDialog").dialog("close");
- }
- }],
- onLoad : function(){
- select_load();
- }
- });
- }
-
- function addExchangeHouse_submit(){
- $('#addExchangeHouseForm').form('submit',{
- url : whzl.basePath+'/exchangeHouseAction_addExchangeHouse',
- success : function(result){
- parent.$.messager.progress('close');
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- $('#addExchangeHouseDialog').dialog("close")
- }else{
- $.messager.alert("提示",parseResult.message);
- }
- }
- });
- }
-
- function countDate(start, end) {//sDate1和sDate2是2006-12-18格式
- var dateSpan,
- tempDate,
- iDays;
- sDate1 = Date.parse(start);
- sDate2 = Date.parse(end);
- dateSpan = sDate2 - sDate1;
- dateSpan = Math.abs(dateSpan);
- iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
- return iDays
- };
-
- function addDate(date, days) {
- if (days == undefined || days == '') {
- days = 1;
- }
- var date = new Date(date);
- date.setDate(date.getDate() + days);
- var month = date.getMonth() + 1;
- var day = date.getDate();
- return date.getFullYear() + '-' + getFormatDate(month) + '-' + getFormatDate(day);
- }
- // 日期月份/天的显示,如果是1位数,则在前面加上'0'
- function getFormatDate(arg) {
- if(arg == undefined || arg == '') {
- return '';
- }
- var re = arg + '';
- if(re.length < 2) {
- re = '0' + re;
- }
- return re;
- }
- //折扣
- var discount = 0;
- //核定月租金
- var priceMonth = 0;
- //应收月租金
- var sspriceMonth = 0;
- //车库月租金
- var garagePriceMonth = 0;
- var jmMoney = 0;
- function check1(){
- if($("#personType1_add").val()==""){
- $.messager.alert('提醒','请选择家庭收入类型');
- return false;
- }
- if($("#personType1_add").val()=="6"){
- communityPrice1 = marketRent1;
- }
- var garagePriceDiscount = 1
- if($("#personType1_add").val()== 1){
- discount = 0;
- garagePriceDiscount = 0
- }else if($("#personType1_add").val()== 2){
- discount = 0.3;
- }else if($("#personType1_add").val()== 6){
- discount = 1;
- }else{
- discount = 0.7;
- }
- //核定月租金
- priceMonth = Number(communityPrice1 * area1).toFixed(2);
- //应收月租金
- sspriceMonth = Number(priceMonth * discount).toFixed(2);
- //车库月租金
- garagePriceMonth = Number(garagePrice1 * garageArea1 * garagePriceDiscount).toFixed(2);
- //特困减半
- var jm = $("#jmType1_add").val();
- if("0" != jm){
- jmMoney = Number((Number(sspriceMonth)+Number(garagePriceMonth))*0.5).toFixed(2);
- }
- if("7" == jm){
- jmMoney = Number((Number(sspriceMonth)+Number(garagePriceMonth))*0.3).toFixed(2);
- }
- //合计应收月租金
- rent = (Number(sspriceMonth)+Number(garagePriceMonth)-jmMoney).toFixed(2);
- var month = $("#refundMonth1_add").val();
- //合计应收年租金
- //rentYear = Number(rent * month).toFixed(0);
- rentYear = (Number(rent*12/365)*Number(month)).toFixed(0);
- $("#refundMoney1_add").val(rentYear)
- }
-
- function check2(){
- var jmMoney = 0;
- if($("#personType2_add").val()==""){
- $.messager.alert('提醒','请选择家庭收入类型');
- return false;
- }
- if($("#personType2_add").val()=="6"){
- communityPrice2 = marketRent2;
- }
- var garagePriceDiscount = 1
- if($("#personType2_add").val()== 1){
- discount = 0;
- garagePriceDiscount = 0
- }else if($("#personType2_add").val()== 2){
- discount = 0.3;
- }else{
- discount = 0.7;
- }
- //核定月租金
- priceMonth = Number(communityPrice2 * area2).toFixed(2);
- //应收月租金
- sspriceMonth = Number(priceMonth * discount).toFixed(2);
- //车库月租金
- garagePriceMonth = Number(garagePrice2 * garageArea2 * garagePriceDiscount).toFixed(2);
- //特困减半
- var jm = $("#jmType2_add").val();
-
- if("0" != jm){
- jmMoney = Number((Number(sspriceMonth)+Number(garagePriceMonth))*0.5).toFixed(2);
- }
- if("7" == jm){
- jmMoney = Number((Number(sspriceMonth)+Number(garagePriceMonth))*0.3).toFixed(2);
- }
- console.log(discount+" "+jm+" "+jmMoney)
- //合计应收月租金
- rent = (Number(sspriceMonth)+Number(garagePriceMonth)-jmMoney).toFixed(2);
- var month = $("#refundMonth2_add").val();
- //合计应收年租金
- rentYear = (Number(rent*12/365)*Number(month)).toFixed(0);
- $("#refundMoney2_add").val(rentYear)
- }
- </script>
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th>
- <!-- <a href="javascript:addSecurityPersonHouse1();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">选择换房甲方</a> -->
- <a href="javascript:addSecurityPersonHouse2();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">选择换房乙方</a>
- </th>
- </tr>
- </table>
- <form id="addExchangeHouseForm" method="post">
- <table class="mytable" style="width:100%;">
- <tr>
- <th colspan="4">换房甲方信息<input type="button" value="计算" onclick="check1()"/></th>
- </tr>
- <tr>
- <th>甲方房源地址</th>
- <td colspan="3">
- <input type="text" readonly="readonly" id="houseAddress1_add" name="exchangeHouse.houseAddress1" style="width:370px" >
- <input type="hidden" id="houseId1_add" name="exchangeHouse.houseId1"/>
- <input type="hidden" id="initialPlacementTime1_add" name="exchangeHouse.initialPlacementTime1"/>
- </td>
- </tr>
- <tr>
- <th width="20%">甲方人员姓名</th>
- <td width="30%">
- <input type="text" id="name1_add" name="exchangeHouse.name1" readonly="readonly">
- </td>
- <th width="20%">甲方人员身份证号</th>
- <td width="30%">
- <input type="text" id="idCard1_add" name="exchangeHouse.idCard1" readonly="readonly">
- </td>
- </tr>
- <tr>
- <th>甲方联系电话</th>
- <td>
- <input type="text" id="phone1_add" name="exchangeHouse.phone1">
- </td>
- <th>甲方所属街道</th>
- <td>
- <input type="text" readonly="readonly" id="residence1_add" name="exchangeHouse.residence1">
- </td>
- </tr>
- <tr>
- <th>甲方房源面积</th>
- <td>
- <input type="text" readonly="readonly" id="area1_add" name="exchangeHouse.area1">
- </td>
- <th>甲方车库面积</th>
- <td>
- <input type="text" readonly="readonly" id="garageArea1_add" name="exchangeHouse.garageArea1">
- </td>
- </tr>
- <tr>
- <th>合同结束时间</th>
- <td>
- <input type="text" readonly="readonly" id="rentTime1_add" name="exchangeHouse.rentTime1">
- </td>
- <th>退还起止时间</th>
- <td>
- <input type="text" readonly="readonly" id="refundTime1_add" name="exchangeHouse.refundTime1">
- </td>
- </tr>
- <tr>
- <th>家庭收入类型</th>
- <td>
- <select id="personType1_add" name="exchangeHouse.personType1">
- <option value="">请选择</option>
- <option value="1">低保</option>
- <option value="2">低收入</option>
- <option value="3">中低收入</option>
- <option value="4">新就业</option>
- <option value="5">外来务工</option>
- <option value="6">市场租金</option>
- </select>
- </td>
- <th>是否减免</th>
- <td>
- <select id="jmType1_add" name="exchangeHouse.jmType1" name="exchangeHouse.jmType1">
- <option value="0">无</option>
- <option value="1">低保</option>
- <option value="2">特困人员证</option>
- <option value="3">特困职工证</option>
- <option value="4">残疾证</option>
- <option value="5">困境儿童</option>
- <option value="6">未成年子女(三个及以上减免50%)</option>
- <option value="7">未成年子女(两个减免30%)</option>
- <option value="8">抚恤补助证</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>退还天数</th>
- <td>
- <input type="text" readonly="readonly" id="refundMonth1_add" name="exchangeHouse.refundMonth1">
- </td>
- <th>退还租金</th>
- <td>
- <input type="text" readonly="readonly" id="refundMoney1_add" name="exchangeHouse.refundMoney1">
- </td>
- </tr>
-
- <tr>
- <th colspan="4">换房乙方信息<input type="button" value="计算" onclick="check2()"/></th>
- </tr>
- <tr>
- <th>乙方房源地址</th>
- <td colspan="3">
- <input type="text" readonly="readonly" id="houseAddress2_add" style="width:370px" name="exchangeHouse.houseAddress2">
- <input type="hidden" id="houseId2_add" name="exchangeHouse.houseId2"/>
- <input type="hidden" id="initialPlacementTime2_add" name="exchangeHouse.initialPlacementTime2"/>
- </td>
- </tr>
- <tr>
- <th width="20%">乙方人员姓名</th>
- <td width="30%">
- <input type="text" id="name2_add" readonly="readonly" name="exchangeHouse.name2">
- </td>
- <th width="20%">乙方人员身份证号</th>
- <td width="30%">
- <input type="text" id="idCard2_add" readonly="readonly" name="exchangeHouse.idCard2">
- </td>
- </tr>
- <tr>
- <th>乙方联系电话</th>
- <td>
- <input type="text" id="phone2_add" name="exchangeHouse.phone2">
- </td>
- <th>乙方所属街道</th>
- <td>
- <input type="text" readonly="readonly" id="residence2_add" name="exchangeHouse.residence2">
- </td>
- </tr>
- <tr>
- <th>乙方房源面积</th>
- <td>
- <input type="text" readonly="readonly" id="area2_add" name="exchangeHouse.area2">
- </td>
- <th>乙方车库面积</th>
- <td>
- <input type="text" readonly="readonly" id="garageArea2_add" name="exchangeHouse.garageArea2">
- </td>
- </tr>
- <tr>
- <th>合同结束时间</th>
- <td>
- <input type="text" readonly="readonly" id="rentTime2_add" name="exchangeHouse.rentTime2">
- </td>
- <th>退还起止时间</th>
- <td>
- <input type="text" readonly="readonly" id="refundTime2_add" name="exchangeHouse.refundTime2">
- </td>
- </tr>
- <tr>
- <th>家庭收入类型</th>
- <td>
- <select id="personType2_add" name="exchangeHouse.personType2" name="exchangeHouse.personType2">
- <option value="">请选择</option>
- <option value="1">低保</option>
- <option value="2">低收入</option>
- <option value="3">中低收入</option>
- <option value="4">新就业</option>
- <option value="5">外来务工</option>
- <option value="6">市场租金</option>
- </select>
- </td>
- <th>是否减免</th>
- <td>
- <select id="jmType2_add" name="exchangeHouse.jmType2" name="exchangeHouse.jmType2">
- <option value="0">无</option>
- <option value="1">低保</option>
- <option value="2">特困人员证</option>
- <option value="3">特困职工证</option>
- <option value="4">残疾证</option>
- <option value="5">困境儿童</option>
- <option value="6">未成年子女(三个及以上减免50%)</option>
- <option value="7">未成年子女(两个减免30%)</option>
- <option value="8">抚恤补助证</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>退还天数</th>
- <td>
- <input type="text" readonly="readonly" id="refundMonth2_add" name="exchangeHouse.refundMonth2">
- </td>
- <th>退还租金</th>
- <td>
- <input type="text" readonly="readonly" id="refundMoney2_add" name="exchangeHouse.refundMoney2">
- </td>
- </tr>
- </table>
- </form>
|