| | |
| | | } |
| | | |
| | | async cancelInService(){ |
| | | var checkUpdate=0; |
| | | var Status =this.Campaign.Status; |
| | | if (this.Campaign.Status == '取消') { |
| | | this.dispatchEvent(event1); |
| | | return; |
| | | } |
| | | if (this.Campaign.Status != '草案中' && this.Campaign.Status != '公开中') { |
| | | const event2 = new dispatchEvent({ |
| | | message : this.Campaign.Status +"状态不能取消" , |
| | | const event2 = new ShowToastEvent({ |
| | | message : Status +"状态不能取消" , |
| | | variant : 'error' |
| | | }) |
| | | }); |
| | | this.dispatchEvent(event2); |
| | | return; |
| | | } |
| | |
| | | this.dispatchEvent(event3); |
| | | return; |
| | | } |
| | | |
| | | var IsCancelFromOpen = false; |
| | | console.log(this.Campaign.Status); |
| | | if (this.Campaign.Status == '公开中') { |
| | |
| | | } |
| | | else{ |
| | | theStatus = '草案中' |
| | | } |
| | | } |
| | | newAndUpddateCampaign({campaignId : this.Campaign.Id , Status : theStatus}).then(result2=>{ |
| | | if(result2!='success'){ |
| | | const eventErroe3 = new ShowToastEvent({ |
| | |
| | | result2, |
| | | variant : 'error' |
| | | }); |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(eventErroe3); |
| | | } |
| | | |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | const eventFail = new ShowToastEvent({ |
| | | message: |
| | | result1, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(eventFail); |
| | | }); |
| | | checkUpdate +=1; |
| | | this.dispatchEvent(eventFail); |
| | | } |
| | | }); |
| | | if(checkUpdate!=0){ |
| | | return; |
| | | } |
| | | window.location.reload(); |
| | | |
| | | |