123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@ taglib prefix="s" uri="/struts-tags" %>
- <script>
- //人员类型
- var personTypeObj_remove = null;
- var personType_array_remove = null;
-
- //户型
- var roomTypeObj_remove = null;
- var roomType_array_remove = null;
-
- //取消原因
- var cancelReasonObj_cancel = null;
- var cancelReason_array_cancel = null;
-
-
- //从合同中添加
- function removeFromLeaseContract(){
- $('#leaseContractSelectDialog').dialog(
- {
- buttons : [
- {
- text : '确定',
- iconCls : 'icon-ok',
- handler : function(){
- var leaseContractId = select_submit();
- $("#leaseContractId_remove").val(leaseContractId);
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "leaseContractAction_findById",//要访问的后台地址
- data:{"leaseContract.id":leaseContractId },
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- $("#securityPersonIdCard_remove").val(msg.obj.securityPerson.idCard);
- $("#securityPersonName_remove").val(msg.obj.securityPerson.name);
- $("#leaseContractId_remove").val(msg.obj.id);
- $("#securityPersonId_remove").val(msg.obj.securityPerson.id);
- $("#houseId_remove").val(msg.obj.house.id);
-
- $("#rentMonthMoney_remove").numberbox('setValue', msg.obj.moneyActual);
-
- $("#leaseContract_startDate_remove").datebox('setValue', msg.obj.startDate);
- $("#leaseContract_endDate_remove").datebox('setValue', msg.obj.endDate);
-
- $("#personType_remove").val(msg.obj.securityPerson.personType);
- $("#securityNum_remove").numberbox('setValue', msg.obj.securityPerson.securityNum);
- $("#houseAddress_remove").val(msg.obj.houseAddress);
- $("#roomType_remove").val(msg.obj.house.roomType);
-
- $("#contractNo_remove").val(msg.obj.contractNo);
- $("#contractName_remove").val(msg.obj.contractName);
-
- var houseArea = msg.obj.houseArea;
- if(houseArea == null){
- houseArea = 0;
- }
- $("#houseArea_remove").numberbox('setValue', houseArea);
-
- var garageArea = msg.obj.garageArea;
- if(garageArea == null){
- garageArea = 0;
- }
- $("#garageArea_remove").numberbox('setValue', garageArea);
-
- $('#rent_endDate_remove').datebox('setValue', msg.obj.rentDate);
- $('#endDate_remove').datebox('setValue', msg.obj.rentDate);
- }
- }
- });
-
- $("#leaseContractSelectDialog").dialog("close");
- }
- },
- {
- text : '取消',
- iconCls : 'icon-cancel',
- handler : function(){
- $("#leaseContractSelectDialog").dialog("close");
- }
- }
- ],
- onLoad : function(){
- select_load();
- }
- }
- );
- }
- //空值转换
- var dealNull = function(value){
- if(value == ""){
- return 0;
- }
- else{
- return value;
- }
- }
-
- //月份加减函数
- function removeMoth(d,m){
- var ds=d.split('-'),_d=ds[2]-0;
- var nextM=new Date( ds[0],ds[1]-1+m+1, 0 );
- var max=nextM.getDate();
- d=new Date( ds[0],ds[1]-1+m,_d>max? max:_d );
- return d.toLocaleDateString().match(/\d+/g).join('-')
- }
-
- //日期加减函数
- function removeDate(dd,dremove){
- var a = new Date(dd)
- a = a.valueOf()
- a = a + dremove * 24 * 60 * 60 * 1000
- a = new Date(a)
- return a;
- }
-
- //日期格式化
- Date.prototype.Format = function (fmt) { //author: meizz
- var o = {
- "M+": this.getMonth() + 1, //月份
- "d+": this.getDate(), //日
- "h+": this.getHours(), //小时
- "m+": this.getMinutes(), //分
- "s+": this.getSeconds(), //秒
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
- "S": this.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- }
-
- //计算金额和租金
- var countMoney = function(){
- var rentMonth_remove = dealNull($("#rentMonth_remove").numberbox('getValue'));
- var rentMonthMoney_remove = dealNull($("#rentMonthMoney_remove").numberbox('getValue'));
- var rentMoney1_remove = rentMonth_remove * rentMonthMoney_remove;
- $("#rentMoney1_remove").numberbox('setValue', rentMoney1_remove );
- }
- var remove_load = function(){
-
- $('#rentMonth_remove').numberbox({
- onChange: function () {
- countMoney();
- }
- });
-
-
- //人员类别
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"personType" ,"aa10.name":"保障人员类别" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- personTypeObj_remove = msg.obj.rows;
- var select_arr = [];
- var data = personTypeObj_remove;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- personType_array_remove = select_arr.join("");
- $("#personType_remove").append(personType_array_remove);
- }
- }
- });
-
- //户型
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"roomType" ,"aa10.name":"户型" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- roomTypeObj_remove = msg.obj.rows;
- var select_arr = [];
- var data = roomTypeObj_remove;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- roomType_array_remove = select_arr.join("");
- $("#roomType_remove").append(roomType_array_remove);
- }
- }
- });
-
- $("#cancelLease").change(
- function () {
- if($("#cancelLease").val() == "0"){
- $("#zzbt").hide();
- $("#cancelReason_cancel").hide();
- }else{
- $("#zzbt").show();
- $("#cancelReason_cancel").show();
- }
- }
- );
- }
- //取消原因
- $.ajax({
- type: "post",//使用post方法访问后台
- dataType: "json",//返回json格式的数据
- url: "aa10Action_listAa10All",//要访问的后台地址
- data:{"aa10.letter":"cancelReason" ,"aa10.name":"取消原因" },
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){//msg为返回的数据,在这里做数据绑定
- if(msg.success){
- cancelReasonObj_cancel = msg.obj.rows;
- var select_arr = [];
- var data = cancelReasonObj_cancel;
- for(var nItem = 0; nItem < data.length; nItem++ ){
- select_arr.push("<option value="+data[nItem].code+">"+data[nItem].value+"</option>");
- }
- cancelReason_array_cancel = select_arr.join("");
- $("#cancelReason_cancel").append(cancelReason_array_cancel);
- }
- }
- });
- var remove_submit = function(){
- $('#removeRentForm').form('submit',{
- url : whzl.basePath+'/rentAction_removeRent',
- success : function(result){
- var parseResult = $.parseJSON(result);
- if(parseResult.success){
- $('#rentDataGrid').datagrid('reload');
- }
- }
- }
- );
- }
-
- </script>
- <div class="easyui-tabs" id="tabs_remove">
- <div title="基本信息" id="jbxx_detail">
- <table class="mytable" style="width: 100%;" >
- <tr>
- <th>
- <a href="javascript:removeFromLeaseContract();" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">从租赁合同中选择</a>
- </th>
- </tr>
- </table>
- <form id="removeRentForm" method="post" enctype="multipart/form-data">
- <table class="mytable" style="width: 100%;">
- <tr>
- <th width="20%">退租人身份证号</th>
- <td width="30%" >
- <input class="easyui-validatebox" readonly="readonly" style="width:150px" required="true" type="text" id="securityPersonIdCard_remove" />
- <input type="hidden" id="securityPersonId_remove" name="rent.securityPerson.id" />
- <input type="hidden" id="houseId_remove" name="rent.house.id" />
- <input type="hidden" id="leaseContractId_remove" name="rent.leaseContract.id" />
- </td>
- <th width="20%">退租人姓名</th>
- <td width="30%" >
- <input class="easyui-validatebox" readonly="readonly" style="width:150px" required="true" type="text" id="securityPersonName_remove" />
- </td>
- </tr>
- <tr>
- <th width="20%">合同编号</th>
- <td width="30%" >
- <input class="easyui-validatebox" style="width:150px" required="true" type="text" id="contractNo_remove" readonly="readonly" >
- </td>
- <th width="20%">合同名称</th>
- <td width="30%" >
- <input class="easyui-validatebox" style="width:150px" required="true" type="text" id="contractName_remove" >
- </td>
- </tr>
- <tr>
- <th width="20%">合同租房开始时间</th>
- <td width="30%" >
- <input id="leaseContract_startDate_remove" readonly="readonly" class="easyui-datebox" />
- </td>
- <th width="20%">合同租房结束时间</th>
- <td width="30%" >
- <input id="leaseContract_endDate_remove" readonly="readonly" class="easyui-datebox" />
- </td>
- </tr>
- <tr>
- <th width="20%">退租房屋地址</th>
- <td width="30%" >
- <input class="easyui-validatebox" readonly="readonly" style="width:150px" required="true" type="text" id="houseAddress_remove" >
- </td>
- <th width="20%">租金已交至</th>
- <td width="30%" >
- <input id="rent_endDate_remove" class="easyui-datebox" readonly="readonly" />
- </td>
- </tr>
-
- <tr>
- <th width="20%">退租开始时间</th>
- <td width="30%" >
- <input id="startDate_remove" name="rent.startDate" class="easyui-datebox" required="true"/>
- </td>
- <th width="20%">退租结束时间</th>
- <td width="30%" >
- <input id="endDate_remove" name="rent.endDate" class="easyui-datebox" required="true"/>
- </td>
- </tr>
-
- <tr>
- <th width="20%">退租月数</th>
- <td width="30%" >
- <input id="rentMonth_remove" name="rent.rentMonth" class="easyui-numberbox" required="true"/>
- </td>
- <th width="20%">月应退租金</th>
- <td width="30%" >
- <input id="rentMonthMoney_remove" precision="2" name="rent.rentMonthMoney" class="easyui-numberbox" required="true"/>
- </td>
- </tr>
-
- <tr>
- <th width="20%">应退租总金额</th>
- <td width="30%" >
- <input id="rentMoney1_remove" precision="2" readonly="readonly" class="easyui-numberbox" required="true"/>
- </td>
- <th width="20%">实际退租总金额</th>
- <td width="30%" >
- <input id="rentMoney_remove" precision="2" name="rent.rentMoney" class="easyui-numberbox" required="true"/>
- </td>
- </tr>
- <tr>
- <th width="20%">退租原因</th>
- <td colspan="3" >
- <textarea rows="2" cols="50" id="removeReason_remove" name= "rent.removeReason" ></textarea>
- </td>
- </tr>
-
- <tr>
- <th width="20%">是否终止合同</th>
- <td>
- <select id="cancelLease" style="width:100px;" name="cancelLease">
- <option value="0">否</option>
- <option value="1">是</option>
- </select>
- </td>
- <th> <span id="zzbt" style="display:none">合同终止原因 </span></th>
- <td>
- <select id="cancelReason_cancel" style="display:none" name="cancelReason" required="true">
- <option value="">请选择</option>
- </select>
- </td>
-
- </tr>
-
-
- </table>
- </form>
- </div>
- </div>
|