|
@@ -8,7 +8,7 @@
|
|
|
<el-col v-show="!isDetail" :span="20">
|
|
|
<el-form-item prop="parkRoomId" label="看房地址">
|
|
|
<div style="display: ruby-text;">
|
|
|
- <el-input v-model="form.parkRoomId" placeholder="请选择" readonly @click.native="toSelectRoom" />
|
|
|
+ <el-input v-model="form.showAddress" placeholder="请选择" readonly @click.native="toSelectRoom" />
|
|
|
<el-button type="primary" @click="toAddRoom">新增地址</el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
@@ -38,6 +38,11 @@
|
|
|
<span>{{ form.parkRoomNo }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="门锁匹配地址">
|
|
|
+ {{ doorObj.houseName }}{{ doorObj.buildingName }}{{ doorObj.floorName }}{{ doorObj.roomName }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-divider />
|
|
|
</el-col>
|
|
@@ -105,8 +110,8 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="10">
|
|
|
- <el-form-item prop="timeRange" label="看房日段">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item prop="timeRange" label="看房时段">
|
|
|
<el-time-picker
|
|
|
v-model="form.timeRange"
|
|
|
is-range
|
|
@@ -119,9 +124,10 @@
|
|
|
:disabled="isDetail"
|
|
|
@change="timeChange"
|
|
|
/>
|
|
|
+ <span>门锁密码有效时段为:{{ timeStr ? timeStr : '' }}</span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item label="排队号">
|
|
|
<span>{{ form.reservationOrder }}</span>
|
|
|
</el-form-item>
|
|
@@ -197,6 +203,7 @@ export default {
|
|
|
reservationTimeStart: '',
|
|
|
reservationTimeEnd: '',
|
|
|
reservationOrder: '',
|
|
|
+ showAddress: '',
|
|
|
timeRange: null
|
|
|
},
|
|
|
rules: {
|
|
@@ -208,7 +215,9 @@ export default {
|
|
|
},
|
|
|
addVisible: false,
|
|
|
dialogVisible: false,
|
|
|
- dialogTitle: '选择地址'
|
|
|
+ dialogTitle: '选择地址',
|
|
|
+ doorObj: {},
|
|
|
+ timeStr: ''
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -220,14 +229,18 @@ export default {
|
|
|
this.getData()
|
|
|
}
|
|
|
},
|
|
|
- getData() {
|
|
|
+ async getData() {
|
|
|
this.loading = true
|
|
|
- this.baseRequest('getById', { id: this.id }).then(res => {
|
|
|
+ this.baseRequest('getById', { id: this.id }).then(async res => {
|
|
|
if (res.data) {
|
|
|
this.form = res.data
|
|
|
if (this.form.reservationTimeStart && this.form.reservationTimeEnd) {
|
|
|
this.$set(this.form, 'timeRange', [this.form.reservationTimeStart, this.form.reservationTimeEnd])
|
|
|
}
|
|
|
+ this.form.showAddress = this.form.parkInfoName + this.form.parkFloorDiscName +
|
|
|
+ this.form.mnpBuildingNo + '号' + this.form.parkRoomNo + '室'
|
|
|
+ this.timeStr = this.getHalfHourRange(this.form.reservationTimeStart)
|
|
|
+ await this.getDoorDetail(this.form.parkRoomId)
|
|
|
}
|
|
|
this.loading = false
|
|
|
})
|
|
@@ -249,6 +262,9 @@ export default {
|
|
|
this.form.parkRoomId = data.id
|
|
|
this.form.parkRoomFloor = data.floor
|
|
|
this.form.parkRoomNo = data.roomNo
|
|
|
+ this.form.showAddress = this.form.parkInfoName + this.form.parkFloorDiscName + this.form.mnpBuildingNo +
|
|
|
+ '号' + this.form.parkRoomNo + '室'
|
|
|
+ this.getDoorDetail(this.form.parkRoomId)
|
|
|
},
|
|
|
toAddRoom() {
|
|
|
this.addVisible = true
|
|
@@ -263,9 +279,11 @@ export default {
|
|
|
if (val && val.length) {
|
|
|
this.form.reservationTimeStart = val[0]
|
|
|
this.form.reservationTimeEnd = val[1]
|
|
|
+ this.timeStr = this.getHalfHourRange(val[0])
|
|
|
} else {
|
|
|
this.form.reservationTimeStart = ''
|
|
|
this.form.reservationTimeEnd = ''
|
|
|
+ this.timeStr = ''
|
|
|
}
|
|
|
},
|
|
|
handleClose() {
|
|
@@ -291,6 +309,24 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getDoorDetail(roomId) {
|
|
|
+ this.baseRequest('getDoorDetailByRoomId', { roomId: roomId }).then(res => {
|
|
|
+ this.doorObj = res.data.data || {}
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getHalfHourRange(timeStr) {
|
|
|
+ const [hours, minutes] = timeStr.split(':').map(Number)
|
|
|
+ const baseMinutes = Math.floor(minutes / 30) * 30
|
|
|
+ const startTime = `${String(hours).padStart(2, '0')}:${String(baseMinutes).padStart(2, '0')}`
|
|
|
+
|
|
|
+ // 计算结束时间(+30分钟)
|
|
|
+ const endTotalMinutes = hours * 60 + baseMinutes + 30
|
|
|
+ const endHours = Math.floor(endTotalMinutes / 60) % 24
|
|
|
+ const endMinutes = endTotalMinutes % 60
|
|
|
+ const endTime = `${String(endHours).padStart(2, '0')}:${String(endMinutes).padStart(2, '0')}`
|
|
|
+
|
|
|
+ return `${startTime}~${endTime}`
|
|
|
+ },
|
|
|
baseRequest(opUrl, postData, isArr) {
|
|
|
return this.$channel.globeRequest('ParkRoomReservationController', opUrl, postData, 'project', isArr)
|
|
|
}
|