checkout2.jsp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <script type="text/javascript">
  3. //小区单价
  4. var communityPrice = 0;
  5. //车库单价
  6. var garagePrice = 0;
  7. //房源面积
  8. var area = 0
  9. //车库面积
  10. var garageArea = 0
  11. //折扣
  12. var discount = 0;
  13. //核定月租金
  14. var priceMonth = 0;
  15. //月租金补贴
  16. var btpriceMonth = 0;
  17. //应收月租金
  18. var sspriceMonth = 0;
  19. //车库月租金
  20. var garagePriceMonth = 0;
  21. //合计应收月租金
  22. var rent = 0;
  23. //合计应收年租金
  24. var rentYear = 0;
  25. //月份
  26. var month = 0
  27. var checkoutRents_load = function(houseId){
  28. $.ajax({
  29. type: "post",//使用get方法访问后台
  30. dataType: "json",//返回json格式的数据
  31. url: "rent10Action_findByHouseId",//要访问的后台地址
  32. data: "house.id="+houseId,//要发送的数据
  33. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  34. success: function(msg){
  35. console.log(msg.obj);
  36. $("#name_community_checkout").text(msg.obj.house.community.name);
  37. $("#houseNumber_house_checkout").text(msg.obj.house.houseNumber);
  38. $("#area_house_checkout").text(msg.obj.house.area);
  39. $("#garageArea_house_checkout").text(msg.obj.house.garageArea);
  40. $("#price_community_checkout").text(msg.obj.price);
  41. $("#garagePrice_community_checkout").text(msg.obj.garagePrice);
  42. $("#btprice1_community_checkout").text(msg.obj.btprice1);
  43. $("#btprice2_community_checkout").text(msg.obj.btprice2);
  44. $("#btprice3_community_checkout").text(msg.obj.btprice3);
  45. $("#ssprice1_community_checkout").text(msg.obj.ssprice1);
  46. $("#ssprice2_community_checkout").text(msg.obj.ssprice2);
  47. $("#ssprice3_community_checkout").text(msg.obj.ssprice3);
  48. $("#price_checkout").val(msg.obj.price);
  49. $("#garagePrice_checkout").val(msg.obj.garagePrice);
  50. $("#btprice1_checkout").val(msg.obj.btprice1);
  51. $("#btprice2_checkout").val(msg.obj.btprice2);
  52. $("#btprice3_checkout").val(msg.obj.btprice3);
  53. $("#ssprice1_checkout").val(msg.obj.ssprice1);
  54. $("#ssprice2_checkout").val(msg.obj.ssprice2);
  55. $("#ssprice3_checkout").val(msg.obj.ssprice3);
  56. $("#lessee_checkout").val(msg.obj.lessee);
  57. $("#lesseeId_checkout").val(msg.obj.lesseeId);
  58. $("#population_checkout").val(msg.obj.population);
  59. $("#lesseeTel_checkout").val(msg.obj.lesseeTel);
  60. $("#incomeType_checkout").val(msg.obj.incomeType);
  61. $("#jmType_checkout").val(msg.obj.jmType);
  62. $("#startDay").text(dealDate(msg.obj.startDay));
  63. $("#endDay").text(dealDate(msg.obj.endDay));
  64. $("#priceMonth_span_checkout").text(msg.obj.priceMonth);
  65. $("#btpriceMonth_span_checkout").text(msg.obj.btpriceMonth);
  66. $("#sspriceMonth_span_checkout").text(msg.obj.sspriceMonth);
  67. $("#garagePriceMonth_span_checkout").text(msg.obj.garagePriceMonth);
  68. $("#jmpriceMonth_span_checkout").text(msg.obj.jmpriceMonth);
  69. $("#house_checkout").val(msg.obj.house.id);
  70. $("#priceMonth_checkout").val(msg.obj.priceMonth);
  71. $("#btpriceMonth_checkout").val(msg.obj.btpriceMonth);
  72. $("#sspriceMonth_checkout").val(msg.obj.sspriceMonth);
  73. $("#garagePriceMonth_checkout").val(msg.obj.garagePriceMonth);
  74. $("#rent_checkout").val(msg.obj.rent);
  75. $("#jmpriceMonth_checkout").val(msg.obj.jmpriceMonth);
  76. $("#rent_span_checkout").text(msg.obj.rent);
  77. $('#endDay_checkout').datebox('setValue', msg.obj.endDay);
  78. $("#house_checkout").val(houseId);
  79. if(msg.obj.price != null){
  80. communityPrice = msg.obj.price;
  81. }
  82. if(msg.obj.garagePrice != null){
  83. garagePrice = msg.obj.garagePrice;
  84. }
  85. if(msg.obj.house.area != null){
  86. area = msg.obj.house.area;
  87. }
  88. if(msg.obj.house.garageArea != null){
  89. garageArea = msg.obj.house.garageArea;
  90. }
  91. }
  92. })
  93. }
  94. function calculateRent(){
  95. if($("#incomeType_checkout").val()==''){
  96. alert("请选择家庭收入类别");
  97. }else{
  98. if($("#startDay_checkout").datebox('getValue') == ''||$("#endDay_checkout").datebox('getValue')==''){
  99. alert("请选择合同起止时间");
  100. }else{
  101. var startDay = $("#startDay_checkout").datebox('getValue');
  102. var endDay = $("#endDay_checkout").datebox('getValue');
  103. var rent = $("#rent_span_checkout").text();
  104. month = countMonthCheckout(startDay,endDay);
  105. if(month>0){
  106. $("#monthTip_span").text("多缴");
  107. $("#rentYear_span").text("合计实退租金");
  108. }else{
  109. $("#monthTip_span").text("欠缴");
  110. $("#rentYear_span").text("合计欠缴租金");
  111. }
  112. $("#month_checkout").text(month);
  113. //合计应收年租金
  114. rentYear = Number(rent * month).toFixed(0);
  115. $("#rentYear_span_checkout").text(rentYear);
  116. $("#rentYear_checkout").val(rentYear);
  117. }
  118. }
  119. }
  120. var checkoutRents_submit = function(){
  121. if(!idCard1($("#lesseeId_checkout").val())){
  122. alert("请核对身份证号!");
  123. return false;
  124. }
  125. //if(rentYear == 0){
  126. if($("#rentYear_checkout").val() == ""){
  127. alert("请完善并核对租金信息!");
  128. }else{
  129. $('#incomeType_checkout').attr("disabled",false);
  130. $('#jmType_checkout').attr("disabled",false);
  131. if($("#file_checkout").val() == null||$("#file_checkout").val() == ""){
  132. $.messager.alert("提示","请上传附件");
  133. }else{
  134. $('#checkoutRentForm').form('submit',{
  135. url : whzl.basePath+'/rent10Action_checkoutRent10',
  136. success : function(){
  137. $("#checkoutDialog").dialog("close");
  138. searchFun();
  139. }
  140. });
  141. }
  142. }
  143. }
  144. function countMonthCheckout(start,end){
  145. var endDate = new Date(end);
  146. var startDate = new Date(start);
  147. var renNumber = 0;
  148. var yearToMonth = (endDate.getFullYear() - startDate.getFullYear()) * 12;
  149. var monthToMonth = endDate.getMonth() - startDate.getMonth();
  150. var day = endDate.getDate() - startDate.getDate();
  151. if(day>0){
  152. renNumber = yearToMonth + monthToMonth +1;
  153. }else{
  154. renNumber = yearToMonth + monthToMonth;
  155. }
  156. return renNumber;
  157. }
  158. $(function(){
  159. //选中开始时间自动计算结束时间
  160. $('#startDay_checkout').datebox({
  161. onSelect: function(date){
  162. //判断是否小于开始时间,大于结束时间
  163. var endDate = new Date($("#endDay").text());
  164. var startDate = new Date($("#startDay").text());
  165. var tDate = new Date(date);
  166. if(tDate>startDate ){
  167. }else{
  168. $('#startDay_checkout').datebox('setValue', '');
  169. $.messager.alert("提示","退房时间必须在开始和结束时间内!");
  170. }
  171. }
  172. });
  173. })
  174. </script>
  175. <table class="mytable" style="width: 100%;">
  176. <tr>
  177. <th colspan="12">收费标准&nbsp;单位:元/㎡•月</th>
  178. </tr>
  179. <tr>
  180. <th width="8.3%">小区名称</th>
  181. <th width="8.3%">房号</th>
  182. <th width="8.3%">面积</th>
  183. <th width="8.3%">车库面积</th>
  184. <th width="8.3%">租金价格</th>
  185. <th width="8.3%">车库价格</th>
  186. <th width="8.3%">低保补贴</th>
  187. <th width="8.3%">低收入补贴</th>
  188. <th width="8.3%">中低收入<br />补贴</th>
  189. <th width="8.3%">低保实收</th>
  190. <th width="8.3%">低收入实收</th>
  191. <th width="8.3%">中低收入<br />实收</th>
  192. </tr>
  193. <tr>
  194. <td><span id="name_community_checkout"></span></td>
  195. <td><span id="houseNumber_house_checkout"></span></td>
  196. <td><span id="area_house_checkout"></span></td>
  197. <td><span id="garageArea_house_checkout"></span></td>
  198. <td><span id="price_community_checkout"></span></td>
  199. <td><span id="garagePrice_community_checkout"></span></td>
  200. <td><span id="btprice1_community_checkout"></span></td>
  201. <td><span id="btprice2_community_checkout"></span></td>
  202. <td><span id="btprice3_community_checkout"></span></td>
  203. <td><span id="ssprice1_community_checkout"></span></td>
  204. <td><span id="ssprice2_community_checkout"></span></td>
  205. <td><span id="ssprice3_community_checkout"></span></td>
  206. </tr>
  207. </table>
  208. <form id="checkoutRentForm" method="post" enctype="multipart/form-data">
  209. <table class="mytable" style="width: 100%;">
  210. <tr>
  211. <th colspan="7">人员信息</th>
  212. </tr>
  213. <tr>
  214. <th width="25%">户主姓名</th>
  215. <td width="25%" colspan="2">
  216. <input type="text" id="lessee_checkout" name="rent10.lessee" readonly="readonly">
  217. </td>
  218. <th width="25%" colspan="2">身份证号</th>
  219. <td width="25%" colspan="2">
  220. <input type="text" id="lesseeId_checkout" name="rent10.lesseeId" readonly="readonly">
  221. </td>
  222. </tr>
  223. <tr>
  224. <th>家庭人口</th>
  225. <td colspan="2">
  226. <input type="text" id="population_checkout" name="rent10.population" readonly="readonly">
  227. </td>
  228. <th colspan="2">联系电话</th>
  229. <td colspan="2">
  230. <input type="text" id="lesseeTel_checkout" name="rent10.lesseeTel" readonly="readonly">
  231. </td>
  232. </tr>
  233. <tr>
  234. <th>家庭收入类别</th>
  235. <td colspan="2">
  236. <select id="incomeType_checkout" name="rent10.incomeType" style="width: 173px" disabled="disabled">
  237. <option value="">请选择</option>
  238. <option value="1">低保</option>
  239. <option value="2">低收入</option>
  240. <option value="3">中低收入</option>
  241. </select>
  242. </td>
  243. <th colspan="2">是否减免</th>
  244. <td colspan="2">
  245. <select id="jmType_checkout" name="rent10.jmType" style="width: 173px" disabled="disabled">
  246. <option value="0">否</option>
  247. <option value="1">是</option>
  248. </select>
  249. </td>
  250. </tr>
  251. <tr>
  252. <th>附件</th>
  253. <td colspan="6">
  254. <input type="file" multiple="multiple" name="upload" id="file_checkout">
  255. </td>
  256. </tr>
  257. <tr>
  258. <th colspan="7">交租信息</th>
  259. </tr>
  260. <tr>
  261. <th>合同开始时间</th>
  262. <td colspan="2">
  263. <span id="startDay"></span>
  264. </td>
  265. <th colspan="2">合同结束时间</th>
  266. <td colspan="2">
  267. <span id="endDay"></span>
  268. </td>
  269. </tr>
  270. <tr>
  271. <th>退租时间</th>
  272. <td colspan="2">
  273. <input class="easyui-datebox" type="text" id="startDay_checkout" name="rent10.startDay" class="easyui-validatebox" required="true">
  274. </td>
  275. <th colspan="2">合同结束时间</th>
  276. <td colspan="2">
  277. <input class="easyui-datebox" type="text" id="endDay_checkout" name="rent10.endDay" readonly="readonly">
  278. <input type="button" value="计算" onclick="calculateRent()"/>
  279. </td>
  280. </tr>
  281. <tr>
  282. <th rowspan="2" width="25%">
  283. <span>租金&nbsp;</span><span id="monthTip_span"></span>&nbsp;<span id="month_checkout" style="color: red"></span>&nbsp;个月
  284. <input id="house_checkout" name="rent10.house.id" type="hidden"/>
  285. <input id="priceMonth_checkout" name="rent10.priceMonth" type="hidden"/>
  286. <input id="btpriceMonth_checkout" name="rent10.btpriceMonth" type="hidden"/>
  287. <input id="sspriceMonth_checkout" name="rent10.sspriceMonth" type="hidden"/>
  288. <input id="garagePriceMonth_checkout" name="rent10.garagePriceMonth" type="hidden"/>
  289. <input id="rent_checkout" name="rent10.rent" type="hidden"/>
  290. <input id="rentYear_checkout" name="rent10.rentYear" type="hidden"/>
  291. <input id="jmpriceMonth_checkout" name="rent10.jmpriceMonth" type="hidden"/>
  292. <input id="price_checkout" name="rent10.price" type="hidden"/>
  293. <input id="garagePrice_checkout" name="rent10.garagePrice" type="hidden"/>
  294. <input id="btprice1_checkout" name="rent10.btprice1" type="hidden"/>
  295. <input id="btprice2_checkout" name="rent10.btprice2" type="hidden"/>
  296. <input id="btprice3_checkout" name="rent10.btprice3" type="hidden"/>
  297. <input id="ssprice1_checkout" name="rent10.ssprice1" type="hidden"/>
  298. <input id="ssprice2_checkout" name="rent10.ssprice2" type="hidden"/>
  299. <input id="ssprice3_checkout" name="rent10.ssprice3" type="hidden"/>
  300. </th>
  301. <th width="12.5%">核定月租金</th>
  302. <th width="12.5%">月租金补贴</th>
  303. <th width="12.5%">应收月租金</th>
  304. <th width="12.5%">车库月租金</th>
  305. <th width="12.5%">月减免金额</th>
  306. <th width="12.5%">合计实收月租金</th>
  307. </tr>
  308. <tr>
  309. <td><span id="priceMonth_span_checkout"></span></td>
  310. <td><span id="btpriceMonth_span_checkout"></span></td>
  311. <td><span id="sspriceMonth_span_checkout"></span></td>
  312. <td><span id="garagePriceMonth_span_checkout"></span></td>
  313. <td><span id="jmpriceMonth_span_checkout"></span></td>
  314. <td><span id="rent_span_checkout"></span></td>
  315. </tr>
  316. <tr>
  317. <th><span id="rentYear_span">合计实退租金</span>(<span style="color: red;">正退负补</span>)</th>
  318. <td colspan="6">
  319. <span id="rentYear_span_checkout"></span>
  320. <input type="hidden" name="rent10.rentType" value="2">
  321. <input type="hidden" name="rent10.rentStatus" value="1">
  322. </td>
  323. </tr>
  324. <tr>
  325. <th>退押金</th>
  326. <td colspan="2">
  327. <input type="text" id="deposit_checkout" name="rent10.deposit">
  328. </td>
  329. <th colspan="2">退电费</th>
  330. <td colspan="2">
  331. <input type="text" id="" name="">
  332. </td>
  333. </tr>
  334. <tr>
  335. <th>退水费</th>
  336. <td colspan="2">
  337. <input type="text" id="" name="">
  338. </td>
  339. </tr>
  340. </table>
  341. </form>