This commit is contained in:
parent
4e5b399038
commit
53bd72b37e
|
|
@ -247,6 +247,7 @@ export default {
|
||||||
status: [{ required: true, message: '请选择状态', trigger: 'change' }]
|
status: [{ required: true, message: '请选择状态', trigger: 'change' }]
|
||||||
},
|
},
|
||||||
rentalDialogVisible: false,
|
rentalDialogVisible: false,
|
||||||
|
renewingRentalId: null,
|
||||||
rentalForm: {
|
rentalForm: {
|
||||||
id: '',
|
id: '',
|
||||||
roomId: '',
|
roomId: '',
|
||||||
|
|
@ -638,6 +639,7 @@ export default {
|
||||||
startDate: rental.startDate ? new Date(rental.startDate) : '',
|
startDate: rental.startDate ? new Date(rental.startDate) : '',
|
||||||
endDate: rental.endDate ? new Date(rental.endDate) : ''
|
endDate: rental.endDate ? new Date(rental.endDate) : ''
|
||||||
}
|
}
|
||||||
|
this.renewingRentalId = null
|
||||||
this.rentalDialogVisible = true
|
this.rentalDialogVisible = true
|
||||||
},
|
},
|
||||||
handleRenewRental(rental) {
|
handleRenewRental(rental) {
|
||||||
|
|
@ -661,6 +663,7 @@ export default {
|
||||||
status: 'active',
|
status: 'active',
|
||||||
remark: '续租'
|
remark: '续租'
|
||||||
}
|
}
|
||||||
|
this.renewingRentalId = rental.id
|
||||||
this.rentalDialogVisible = true
|
this.rentalDialogVisible = true
|
||||||
},
|
},
|
||||||
async handleSaveRental() {
|
async handleSaveRental() {
|
||||||
|
|
@ -671,6 +674,12 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
await rentalApi.create(this.rentalForm)
|
await rentalApi.create(this.rentalForm)
|
||||||
this.$message.success('租赁记录添加成功')
|
this.$message.success('租赁记录添加成功')
|
||||||
|
|
||||||
|
if (this.renewingRentalId) {
|
||||||
|
await rentalApi.update(this.renewingRentalId, { status: 'expired' })
|
||||||
|
this.$message.success('原租赁记录状态已更新为已到期')
|
||||||
|
this.renewingRentalId = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.rentalDialogVisible = false
|
this.rentalDialogVisible = false
|
||||||
this.loadData()
|
this.loadData()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue