|
@@ -115,7 +115,9 @@ class LeaveAddPage extends Component{
|
|
|
}
|
|
}
|
|
|
onSubmitClick = (event) => {
|
|
onSubmitClick = (event) => {
|
|
|
console.log('state', this.state)
|
|
console.log('state', this.state)
|
|
|
-
|
|
|
|
|
|
|
+ if (this.isRequesting == true) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
if (this.state.startValue == null || this.state.startValue == '') {
|
|
if (this.state.startValue == null || this.state.startValue == '') {
|
|
|
Toast.fail('请输入请假开始时间')
|
|
Toast.fail('请输入请假开始时间')
|
|
|
return
|
|
return
|
|
@@ -165,11 +167,14 @@ class LeaveAddPage extends Component{
|
|
|
lvFiles:JSON.stringify(approveFiles),
|
|
lvFiles:JSON.stringify(approveFiles),
|
|
|
}
|
|
}
|
|
|
console.log('param', params)
|
|
console.log('param', params)
|
|
|
|
|
+ this.isRequesting = true
|
|
|
fetchPost(API.leaveCreate, {
|
|
fetchPost(API.leaveCreate, {
|
|
|
leaveString:JSON.stringify(params)
|
|
leaveString:JSON.stringify(params)
|
|
|
}, {}).then((response) => {
|
|
}, {}).then((response) => {
|
|
|
console.log('response', response)
|
|
console.log('response', response)
|
|
|
|
|
+ this.isRequesting = false
|
|
|
if (response.success) {
|
|
if (response.success) {
|
|
|
|
|
+ this.isRequesting = true
|
|
|
Toast.show(response.data, 1)
|
|
Toast.show(response.data, 1)
|
|
|
// this.props.history.push("/leaveList/" + this.props.match.params.role)
|
|
// this.props.history.push("/leaveList/" + this.props.match.params.role)
|
|
|
// this.props.history.push("/homePage")
|
|
// this.props.history.push("/homePage")
|
|
@@ -178,6 +183,7 @@ class LeaveAddPage extends Component{
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
}
|
|
}
|
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
|
|
|
+ this.isRequesting = false
|
|
|
console.log('error', error)
|
|
console.log('error', error)
|
|
|
if (typeof error === 'string') {
|
|
if (typeof error === 'string') {
|
|
|
Toast.fail(error, 2)
|
|
Toast.fail(error, 2)
|