|
|
@@ -136,6 +136,9 @@ class LeaveAddCPage extends Component {
|
|
|
}
|
|
|
|
|
|
onSubmitClick = (event) => {
|
|
|
+ if(this.isRequesting == true){
|
|
|
+ return
|
|
|
+ }
|
|
|
console.log('state', this.state)
|
|
|
console.log('state', this.state.leaveType)
|
|
|
if (this.state.leaveType == null || this.state.leaveType == '') {
|
|
|
@@ -190,11 +193,14 @@ class LeaveAddCPage extends Component {
|
|
|
|
|
|
}
|
|
|
console.log('param', params)
|
|
|
+ this.isRequesting = true
|
|
|
fetchPost(API.oaCreate, {
|
|
|
oaString:JSON.stringify(params)
|
|
|
}, {}).then((response) => {
|
|
|
console.log('response', response)
|
|
|
+ this.isRequesting = false
|
|
|
if (response.success) {
|
|
|
+ this.isRequesting = true
|
|
|
Toast.show(response.data, 1)
|
|
|
// this.props.history.push("/leaveList/" + this.props.match.params.role)
|
|
|
// this.props.history.push("/homePage")
|
|
|
@@ -203,6 +209,7 @@ class LeaveAddCPage extends Component {
|
|
|
}, 1000)
|
|
|
}
|
|
|
}).catch((error) => {
|
|
|
+ this.isRequesting = false
|
|
|
console.log('error', error)
|
|
|
if (typeof error === 'string') {
|
|
|
Toast.fail(error, 2)
|