|
@@ -485,8 +485,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- const valid = await this.$refs.orderForm.validate()
|
|
|
- return Boolean(valid)
|
|
|
+ // AvueJS 表单验证方法,使用 Promise 包装
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ this.$refs.orderForm.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ this.$message.warning('请检查表单填写是否正确')
|
|
|
+ }
|
|
|
+ resolve(Boolean(valid))
|
|
|
+ })
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
console.warn('表单验证失败:', error)
|
|
|
this.$message.warning('请检查表单填写是否正确')
|