提交 a1c32f18 编写于 作者: huangwensu's avatar huangwensu

按钮防止多次点击

上级 e5e5fdd0
...@@ -243,7 +243,8 @@ export default { ...@@ -243,7 +243,8 @@ export default {
{ required: true, message: '请选择预约结束时间', trigger: 'change'} { required: true, message: '请选择预约结束时间', trigger: 'change'}
] ]
}, },
liveBack: false liveBack: false,
timeClickFlag: true
} }
}, },
mounted() { mounted() {
...@@ -329,6 +330,17 @@ export default { ...@@ -329,6 +330,17 @@ export default {
this.timeForm.endTime = row.appointEndTime this.timeForm.endTime = row.appointEndTime
}, },
confirmTime() { confirmTime() {
let timeoutId = null
if(this.timeClickFlag) {
this.timeClickFlag = false
timeoutId && clearTimeout(timeoutId)
timeoutId = setTimeout(() => {
this.clickHandle()
}, 2000)
}
},
// 防止按钮多次点击
clickHandle() {
this.$refs.timeForm.validate((valid) => { this.$refs.timeForm.validate((valid) => {
if(valid) { if(valid) {
if(this.beginFlag || this.endFlag) { if(this.beginFlag || this.endFlag) {
...@@ -337,6 +349,7 @@ export default { ...@@ -337,6 +349,7 @@ export default {
this.loading = true this.loading = true
this.POST('/diagnose/admin/diagnose/appointTime', this.timeForm).then(res => { this.POST('/diagnose/admin/diagnose/appointTime', this.timeForm).then(res => {
this.loading = false this.loading = false
this.timeClickFlag = true
if (res.code == "000000") { if (res.code == "000000") {
this.$message({ this.$message({
message: '修改预约时间成功', message: '修改预约时间成功',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册