|
|
@@ -60,24 +60,25 @@ |
|
|
|
<view class="item"> |
|
|
|
<view class="label">租约期限</view> |
|
|
|
<view class="input" > |
|
|
|
<u-input height="100" @click="openCalendar(0)" disabled input-align="right" v-model="form.starDate" placeholder="请选择开始时间"></u-input> |
|
|
|
<image class="calendar" @click="openCalendar(0)" src="/static/kehu/calendar.png" mode=""/> |
|
|
|
<u-calendar :min-date="form.mindate" :max-date="form.maxdate" v-model="calendarShow1" mode="date" @change="dateConfirm1"></u-calendar> |
|
|
|
<u-input height="100" @click="calendarShow1=true" disabled input-align="right" v-model="form.starDate" placeholder="请选择开始时间"></u-input> |
|
|
|
<image class="calendar" @click="calendarShow1=true" src="/static/kehu/calendar.png" mode=""/> |
|
|
|
<u-picker mode="time" confirm-color="#FF6D25" :default-time="form.starDate" v-model="calendarShow1" :params="params" @confirm="dateConfirm1"></u-picker> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="label">至</view> |
|
|
|
<view class="input" > |
|
|
|
<u-input height="100" @click="openCalendar(1)" disabled input-align="right" v-model="form.endDate" placeholder="请选择结束时间"></u-input> |
|
|
|
<image class="calendar" @click="openCalendar(1)" src="/static/kehu/calendar.png" mode=""/> |
|
|
|
<u-input height="100" @click="calendarShow2= true" disabled input-align="right" v-model="form.endDate" placeholder="请选择结束时间"></u-input> |
|
|
|
<image class="calendar" @click="calendarShow2= true" src="/static/kehu/calendar.png" mode=""/> |
|
|
|
<u-picker mode="time" confirm-color="#FF6D25" :default-time="form.endDate" v-model="calendarShow2" :params="params" @confirm="dateConfirm2"></u-picker> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="label">签约时间</view> |
|
|
|
<view class="input" > |
|
|
|
<u-input height="100" @click="calendarShow2 = true" disabled input-align="right" v-model="form.rent_date" placeholder="请选择签约时间"></u-input> |
|
|
|
<image class="calendar" @click="calendarShow2 = true" src="/static/kehu/calendar.png" mode=""/> |
|
|
|
<u-calendar v-model="calendarShow2" maxdate='2099-12-31' mode="date" @change="dateConfirm2"></u-calendar> |
|
|
|
<u-input height="100" @click="calendarShow3 = true" disabled input-align="right" v-model="form.rent_date" placeholder="请选择签约时间"></u-input> |
|
|
|
<image class="calendar" @click="calendarShow3 = true" src="/static/kehu/calendar.png" mode=""/> |
|
|
|
<u-picker mode="time" confirm-color="#FF6D25" :default-time="form.rent_date" v-model="calendarShow3" :params="params" @confirm="dateConfirm3"></u-picker> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@@ -88,10 +89,14 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
mindate: '', |
|
|
|
maxdate: '2099-12-31', |
|
|
|
params: { |
|
|
|
year: true, |
|
|
|
month: true, |
|
|
|
day: true |
|
|
|
}, |
|
|
|
calendarShow1: false, |
|
|
|
calendarShow2: false, |
|
|
|
calendarShow3: false, |
|
|
|
payTypeShow: false, |
|
|
|
form: { |
|
|
|
customerName: '', |
|
|
@@ -126,53 +131,41 @@ |
|
|
|
label: '年付' |
|
|
|
}, |
|
|
|
], |
|
|
|
type:0, |
|
|
|
customStyle:{ |
|
|
|
maxHeight:'200rpx', |
|
|
|
padding: '20rpx', |
|
|
|
fontSize: '30rpx', |
|
|
|
borderBottom:'1px solid #e0e0e0' |
|
|
|
}, |
|
|
|
roomId: '' |
|
|
|
roomId: '', |
|
|
|
roomNum: '' |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.roomId = options.id; |
|
|
|
this.roomNum = options.roomNum; |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
openCalendar(type){ |
|
|
|
if(type==0){ |
|
|
|
this.type = 0 |
|
|
|
this.form.mindate = '' |
|
|
|
this.form.maxdate = this.form.endDate |
|
|
|
}else{ |
|
|
|
this.type = 1 |
|
|
|
this.form.mindate = this.form.starDate |
|
|
|
this.form.maxdate = '2099-12-31' |
|
|
|
} |
|
|
|
this.calendarShow1 = true; |
|
|
|
}, |
|
|
|
// 租约期限 |
|
|
|
dateConfirm1(e){ |
|
|
|
if(this.type==0){ |
|
|
|
this.form.starDate = e.result |
|
|
|
}else{ |
|
|
|
this.form.endDate = e.result |
|
|
|
} |
|
|
|
this.form.starDate = e.year + '-'+e.month + '-'+e.day |
|
|
|
}, |
|
|
|
// 租约期限 |
|
|
|
dateConfirm2(e){ |
|
|
|
this.form.rent_date = e.result |
|
|
|
this.form.endDate = e.year + '-'+e.month + '-'+e.day |
|
|
|
}, |
|
|
|
// 签约时间 |
|
|
|
dateConfirm3(e){ |
|
|
|
this.form.rent_date = e.year + '-'+e.month + '-'+e.day |
|
|
|
}, |
|
|
|
confirmPaytype(e){ |
|
|
|
console.log(e) |
|
|
|
this.form.payment_way = e[0].value |
|
|
|
this.form.payTypeName = e[0].label |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
let body={ |
|
|
|
// "companyId": 22, |
|
|
|
let body = { |
|
|
|
"roomId": this.roomId, |
|
|
|
"customerName": this.form.customerName, |
|
|
|
"customerTel": this.form.mobile, |
|
|
@@ -185,11 +178,20 @@ |
|
|
|
"rent_date_start":this.form.starDate, |
|
|
|
"rent_date_end": this.form.endDate, |
|
|
|
"rent_date": this.form.rent_date, |
|
|
|
"idno": this.form.idno, |
|
|
|
"idno": this.form.idno |
|
|
|
} |
|
|
|
this.$u.api.appSave({body:body}).then((res)=>{ |
|
|
|
if(res.ErrNo=='0000'){ |
|
|
|
uni.navigateBack() |
|
|
|
uni.showToast({ |
|
|
|
title: res.ErrMsg, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
uni.setStorageSync('position_roomNum',this.roomNum) |
|
|
|
setTimeout(()=>{ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/otherPage/rent' |
|
|
|
}); |
|
|
|
},2000) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|