|
|
|
@ -76,14 +76,9 @@ export default {
|
|
|
|
|
} else this.doEdit() |
|
|
|
|
}, |
|
|
|
|
doAdd() { |
|
|
|
|
// console.log('this.form',Number(this.form.time.slice(0,2))) |
|
|
|
|
console.log('增加') |
|
|
|
|
this.form.time=Number(this.form.time.slice(0,2)) |
|
|
|
|
add(this.form).then(res => { |
|
|
|
|
if (res.status==500){ |
|
|
|
|
this.$message.error(res.msg) |
|
|
|
|
this.loading = false |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.resetForm() |
|
|
|
|
this.$notify({ |
|
|
|
|
title: '添加成功', |
|
|
|
@ -93,18 +88,16 @@ export default {
|
|
|
|
|
this.loading = false |
|
|
|
|
this.$parent.init() |
|
|
|
|
}).catch(err => { |
|
|
|
|
// console.log('this.form.time',this.form.time) |
|
|
|
|
this.form.time= this.form.time>9?this.form.time+':00':'0'+this.form.time+':00' |
|
|
|
|
this.loading = false |
|
|
|
|
console.log(err.response.data.message) |
|
|
|
|
// console.log(err.response.data.message) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
doEdit() { |
|
|
|
|
console.log('修改') |
|
|
|
|
this.form.time=Number(this.form.time.slice(0,2)) |
|
|
|
|
edit(this.form).then(res => { |
|
|
|
|
if (res.status==500){ |
|
|
|
|
this.$message.error(res.msg) |
|
|
|
|
this.loading = false |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.resetForm() |
|
|
|
|
this.$notify({ |
|
|
|
|
title: '修改成功', |
|
|
|
@ -115,7 +108,8 @@ export default {
|
|
|
|
|
this.$parent.init() |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.loading = false |
|
|
|
|
console.log(err.response.data.message) |
|
|
|
|
this.form.time= this.form.time>9?this.form.time+':00':'0'+this.form.time+':00' |
|
|
|
|
// console.log(err.response.data.message) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
resetForm() { |
|
|
|
|