| | |
| | | @api recordId; |
| | | transferApplyPermission; |
| | | IsLoading=true; |
| | | cancelResult; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | applyPermission().then(result => { |
| | | console.log(result); |
| | | this.transferApplyPermission = result; |
| | | this.cancelSubmit(); |
| | | |
| | | }).catch( error =>{ |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | cancelSubmit(){ |
| | | |
| | | if (this.transferApplyPermission == false) { |
| | | this.showToast('','没有提交申请的权限','warning'); |
| | | this.IsLoading=false; |
| | |
| | | }).then(cancel=>{ |
| | | if(cancel) { |
| | | submitApply({taId:this.recordId}).then(submitRes=>{ |
| | | if(submitRes == '1'){ |
| | | this.showToast('','提交成功','success'); |
| | | console.log(submitRes); |
| | | this.cancelResult = submitRes; |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | |
| | | }).catch( error =>{ |
| | | this.showToast("",submitRes,"error"); |
| | | }); |
| | | // this.IsLoading=false; |
| | | // this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | }).catch( error =>{ |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | |
| | | async cancelSubmit(){ |
| | | console.log(this.cancelResult); |
| | | if(this.cancelResult == '1') { |
| | | console.log(this.cancelResult); |
| | | this.dispatchEvent( |
| | | new ShowToastEvent({ |
| | | message:'提交成功', |
| | | variant: "success" |
| | | }) |
| | | ); |
| | | setTimeout(function(){ |
| | | window.location.href = window.location; |
| | | }, 1500 ); |
| | | }, 1500 ) |
| | | }else{ |
| | | this.showToast("",submitRes,"warning"); |
| | | this.dispatchEvent( |
| | | new ShowToastEvent({ |
| | | message:this.cancelResult, |
| | | variant: "warning" |
| | | }) |
| | | ); |
| | | console.log("result:",this.cancelResult); |
| | | // await this.showToast("",this.cancelResult,"warning"); |
| | | } |
| | | |
| | | }); |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | } |
| | | |
| | | showToast(_title,_message,_variant) { |