//方法体里面leave() { MessageBox.prompt('请假理由', { inputValidator: (val) => { if (val === null) { return true;//初始化的值为null,不做处理的话,刚打开MessageBox就会校验出错,影响用户体验 } return !(val.length < 100) }, inputErrorMessage: '不能小于100字' }).then((val) => { this.loading = true; var leaveForm = { trainId: this.trainInfo.trainId, leaveFlow: this.trainInfo.leaveFlow, leaveReason: val, }; this.postRequest("/tmsproxy/trainLeave", leaveForm).then(resp => { this.loading = false; if(resp.data.status == "success") { MessageBox.alert(resp.data.msg, ""); } }) }, () => { console.info('cancel') })}请假