|
@@ -98,6 +98,8 @@ export const FORECAST_FORM_EVENTS = {
|
|
|
RESET: 'reset',
|
|
|
/** 表单提交事件 */
|
|
|
SUBMIT: 'submit',
|
|
|
+ /** 表单提交失败事件 */
|
|
|
+ SUBMIT_ERROR: 'submit-error',
|
|
|
/** 更新可见性事件 */
|
|
|
UPDATE_VISIBLE: 'update:visible'
|
|
|
}
|
|
@@ -965,11 +967,15 @@ export default {
|
|
|
this.$emit && this.$emit(FORECAST_FORM_EVENTS.SUBMIT_SUCCESS, res.data)
|
|
|
} else {
|
|
|
const msg = (res && res.data && (res.data.msg || res.data.message)) || '提交失败'
|
|
|
- this.$message && this.$message.error(msg)
|
|
|
+ // this.$message && this.$message.error(msg)
|
|
|
+ // 通知父组件:提交失败(业务失败)
|
|
|
+ this.$emit && this.$emit(FORECAST_FORM_EVENTS.SUBMIT_ERROR, { message: msg, response: res })
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('提交表单失败:', error)
|
|
|
- this.$message && this.$message.error(error && error.message ? error.message : '操作失败,请重试')
|
|
|
+ // this.$message && this.$message.error(error && error.message ? error.message : '操作失败,请重试')
|
|
|
+ // 通知父组件:提交失败(异常)
|
|
|
+ this.$emit && this.$emit(FORECAST_FORM_EVENTS.SUBMIT_ERROR, error)
|
|
|
}
|
|
|
},
|
|
|
|