Commit ad65c3cb authored by 盖献康's avatar 盖献康

bug(66985) - 当前时间以前不能选择

parent f916f389
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
size="mini" size="mini"
type="success" type="success"
plain plain
:disabled="parseInt(scope.row.price) > parseInt(currentHospital.currentBalance) || currentHospital.currentBalance === 0" :disabled="accordingToTime(scope.row.checkTime) || parseInt(scope.row.price) > parseInt(currentHospital.currentBalance) || currentHospital.currentBalance === 0"
@click="handleSubscribeDevice(scope.row)" @click="handleSubscribeDevice(scope.row)"
>立即预约 >立即预约
</el-button> </el-button>
...@@ -550,6 +550,27 @@ export default { ...@@ -550,6 +550,27 @@ export default {
this.currentUser.userType = this.$store.state.user.userType this.currentUser.userType = this.$store.state.user.userType
this.currentUser.name = this.$store.state.user.name this.currentUser.name = this.$store.state.user.name
}, },
// 根据当前条数据时间段判断能不能点击
accordingToTime(checkTime) {
const currentTime = parseTime(new Date(), '{y}-{m}-{d}')
if (this.form.checkDate === null || this.form.checkDate === currentTime) {
if (checkTime !== null && checkTime !== '') {
// 计算的时间
const startTime = checkTime.split('-')[0]
// 当前时间
const currentDay = new Date().getHours() + ':' + new Date().getMinutes()
// 计算的时间小于当前时间就false
if (startTime < currentDay) {
return true
} else {
return false
}
}
} else {
return false
}
return false
},
// 立即预约对话框关闭回调函数 // 立即预约对话框关闭回调函数
closeSubscribe() { closeSubscribe() {
this.form = { this.form = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment