YOUFANG
This commit is contained in:
@@ -1544,7 +1544,8 @@
|
||||
"views/news/newsDetail.html",
|
||||
"error.html",
|
||||
"views/rent/rent.html",
|
||||
"views/district/detail.html"
|
||||
"views/district/detail.html",
|
||||
"views/house/houseList.html"
|
||||
],
|
||||
"priority": 0
|
||||
},
|
||||
@@ -1646,6 +1647,21 @@
|
||||
"views/user/codeSms.html"
|
||||
],
|
||||
"priority": 0
|
||||
},
|
||||
"views/house/houseList.html": {
|
||||
"resources": [],
|
||||
"refer": [
|
||||
"views/house/add.html",
|
||||
"views/house/detail.html"
|
||||
],
|
||||
"priority": 0
|
||||
},
|
||||
"views/house/add.html": {
|
||||
"resources": [],
|
||||
"refer": [
|
||||
"views/evaluate/evaluateReport.html"
|
||||
],
|
||||
"priority": 0
|
||||
}
|
||||
},
|
||||
"idle": {
|
||||
|
||||
@@ -123,146 +123,86 @@ $.config = {router: false}
|
||||
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
|
||||
<script type="text/javascript" src="../../js/log/log_stat.js" ></script>
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
// 获取周期 1-30
|
||||
function getnumber(){
|
||||
var data = new Array();
|
||||
for(var i=1;i<31;i++){
|
||||
data.push(i);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
///* 错误提示 */
|
||||
//$("#confirm_btn").on("click", function () {
|
||||
// var a = $("#input_time01").val();
|
||||
// var b = $("#input_time02").val();
|
||||
// var c = $("#input_rent01").val();
|
||||
// var d = $("#input_time03").val();
|
||||
// if(a == ""){
|
||||
// $.toast("请选择起租日期");
|
||||
// return false;
|
||||
// }
|
||||
// else if(b == ""){
|
||||
// $.toast("请选择到期日期");
|
||||
// return false;
|
||||
// }
|
||||
// else if(c == ""){
|
||||
// $.toast("请输入每期租金");
|
||||
// return false;
|
||||
// }
|
||||
// else if(d == ""){
|
||||
// $.toast("请选择下次收租日期");
|
||||
// return false;
|
||||
// }
|
||||
//});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
|
||||
var edit = new Vue({
|
||||
el:"#edit",
|
||||
data:{liveStatus:"",leaseStartDate:"",leaseEndDate:"",lastRentDate:"",nowDay:"",rent:"",cycle:""}
|
||||
});
|
||||
function getNowFormatDate(time) {
|
||||
if(typeof(time)=="undefined"||time==null){
|
||||
return ""
|
||||
}
|
||||
var date = new Date(time)
|
||||
var seperator1 = "-";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return currentdate;
|
||||
}
|
||||
var id="165878889770385408"
|
||||
$(function (){
|
||||
//var self = plus.webview.currentWebview();
|
||||
// id = self.newsId;
|
||||
axios.get('/rest/rent/queryHouseRent',{params:{id:id}}).then(function(response){
|
||||
var data = response.data.data.houses;
|
||||
$.each(data,function(i){
|
||||
var active = "";
|
||||
var houseRoomNum = "";
|
||||
if(this.id == id){
|
||||
active = "active"
|
||||
}
|
||||
if(this.houseRoomNum){
|
||||
houseRoomNum = '<small>'+this.houseRoomNum+'</small>';
|
||||
}
|
||||
$("#titleList").append('<a v-bind:val="'+this.id+'" class="tab-link button '+active+'">'+
|
||||
'<label>'+this.name+'</label>'+houseRoomNum+'</a>')
|
||||
$(".buttons-tab01 a").click(function(){
|
||||
var id = $(this).attr("val")
|
||||
window.location.href = "index?id="+id;
|
||||
});
|
||||
})
|
||||
var houseInfo = response.data.data.houseInfo;
|
||||
edit.liveStatus=houseInfo.liveStatus;
|
||||
edit.leaseStartDate=getNowFormatDate(houseInfo.leaseStartDate);
|
||||
edit.leaseEndDate = getNowFormatDate(houseInfo.leaseEndDate);
|
||||
edit.lastRentDate = getNowFormatDate(houseInfo.lastRentDate);
|
||||
edit.nowDay = getNowFormatDate(response.data.data.nowDay);
|
||||
edit.rent = houseInfo.rent;
|
||||
edit.cycle = response.data.data.cycle;
|
||||
/* 选择-起租日期 */
|
||||
$("#input_time01").datetimePicker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">起租日期</h1>\
|
||||
</header>'
|
||||
});
|
||||
|
||||
/* 选择-到期日期 */
|
||||
$("#input_time02").datetimePicker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">到期日期</h1>\
|
||||
</header>'
|
||||
});
|
||||
|
||||
/* 选择-下次收租日期 */
|
||||
$("#input_time03").datetimePicker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">下次收租日期</h1>\
|
||||
</header>'
|
||||
});
|
||||
|
||||
/* 选择-收租周期 */
|
||||
$("#input_cycle").picker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">收租周期</h1>\
|
||||
</header>',
|
||||
cols: [
|
||||
{
|
||||
textAlign: 'center',
|
||||
values: getnumber()
|
||||
},
|
||||
{
|
||||
textAlign: 'center',
|
||||
values: ["年", "季", "月"]
|
||||
},
|
||||
{
|
||||
textAlign: 'center',
|
||||
values: ["/次"]
|
||||
}
|
||||
]
|
||||
});
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
document.addEventListener('plusready', onPlusReady, false);
|
||||
function onPlusReady() {
|
||||
var self = plus.webview.currentWebview();
|
||||
id = self.id
|
||||
axios.get('/rest/rent/queryHouseRent',{params:{id:id}}).then(function(response){
|
||||
var data = response.data.data.houses;
|
||||
$.each(data,function(i){
|
||||
var active = "";
|
||||
var houseRoomNum = "";
|
||||
if(this.id == id){
|
||||
active = "active"
|
||||
}
|
||||
if(this.houseRoomNum){
|
||||
houseRoomNum = '<small>'+this.houseRoomNum+'</small>';
|
||||
}
|
||||
$("#titleList").append('<a v-bind:val="'+this.id+'" class="tab-link button '+active+'">'+
|
||||
'<label>'+this.name+'</label>'+houseRoomNum+'</a>')
|
||||
$(".buttons-tab01 a").click(function(){
|
||||
var id = $(this).attr("val")
|
||||
window.location.href = "index?id="+id;
|
||||
});
|
||||
})
|
||||
var houseInfo = response.data.data.houseInfo;
|
||||
edit.liveStatus=houseInfo.liveStatus;
|
||||
edit.leaseStartDate=getNowFormatDate(houseInfo.leaseStartDate);
|
||||
edit.leaseEndDate = getNowFormatDate(houseInfo.leaseEndDate);
|
||||
edit.lastRentDate = getNowFormatDate(houseInfo.lastRentDate);
|
||||
edit.nowDay = getNowFormatDate(response.data.data.nowDay);
|
||||
edit.rent = houseInfo.rent;
|
||||
edit.cycle = response.data.data.cycle;
|
||||
/* 选择-起租日期 */
|
||||
$("#input_time01").datetimePicker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">起租日期</h1>\
|
||||
</header>'
|
||||
});
|
||||
})
|
||||
|
||||
/* 选择-到期日期 */
|
||||
$("#input_time02").datetimePicker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">到期日期</h1>\
|
||||
</header>'
|
||||
});
|
||||
|
||||
/* 选择-下次收租日期 */
|
||||
$("#input_time03").datetimePicker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">下次收租日期</h1>\
|
||||
</header>'
|
||||
});
|
||||
|
||||
/* 选择-收租周期 */
|
||||
$("#input_cycle").picker({
|
||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||
<button class="button button-link pull-right close-picker">确定</button>\
|
||||
<h1 class="title">收租周期</h1>\
|
||||
</header>',
|
||||
cols: [
|
||||
{
|
||||
textAlign: 'center',
|
||||
values: getnumber()
|
||||
},
|
||||
{
|
||||
textAlign: 'center',
|
||||
values: ["年", "季", "月"]
|
||||
},
|
||||
{
|
||||
textAlign: 'center',
|
||||
values: ["/次"]
|
||||
}
|
||||
]
|
||||
});
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
});
|
||||
|
||||
//var id="165878889770385408"
|
||||
/* 编辑状态-确定 */
|
||||
$(document).on('click','#confirm_btn', function () {
|
||||
|
||||
@@ -341,12 +281,70 @@ $("#input_cycle").picker({
|
||||
}
|
||||
|
||||
axios.post("/rest/rent/changeStatus",d).then(function(response){
|
||||
//$.toast(response.data.data);
|
||||
console.log(1);
|
||||
back(),plus.nativeUI.closeWaiting();
|
||||
}).catch(function(error){
|
||||
console.log(error)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取周期 1-30
|
||||
function getnumber(){
|
||||
var data = new Array();
|
||||
for(var i=1;i<31;i++){
|
||||
data.push(i);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
||||
///* 错误提示 */
|
||||
//$("#confirm_btn").on("click", function () {
|
||||
// var a = $("#input_time01").val();
|
||||
// var b = $("#input_time02").val();
|
||||
// var c = $("#input_rent01").val();
|
||||
// var d = $("#input_time03").val();
|
||||
// if(a == ""){
|
||||
// $.toast("请选择起租日期");
|
||||
// return false;
|
||||
// }
|
||||
// else if(b == ""){
|
||||
// $.toast("请选择到期日期");
|
||||
// return false;
|
||||
// }
|
||||
// else if(c == ""){
|
||||
// $.toast("请输入每期租金");
|
||||
// return false;
|
||||
// }
|
||||
// else if(d == ""){
|
||||
// $.toast("请选择下次收租日期");
|
||||
// return false;
|
||||
// }
|
||||
//});
|
||||
|
||||
|
||||
var edit = new Vue({
|
||||
el:"#edit",
|
||||
data:{liveStatus:"",leaseStartDate:"",leaseEndDate:"",lastRentDate:"",nowDay:"",rent:"",cycle:""}
|
||||
});
|
||||
function getNowFormatDate(time) {
|
||||
if(typeof(time)=="undefined"||time==null){
|
||||
return ""
|
||||
}
|
||||
var date = new Date(time)
|
||||
var seperator1 = "-";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return currentdate;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user