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

按钮防止多次点击

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