| | |
| | | import { LightningElement, api , track, wire } from 'lwc'; |
| | | |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { getRecord } from 'lightning/uiRecordApi'; |
| | | import USER_ID from '@salesforce/user/Id'; |
| | | import USERPROFILE_ID from '@salesforce/schema/User.ProfileId'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import init from '@salesforce/apex/LexMeetingCostsController.init'; |
| | | import judgeMember from '@salesforce/apex/LexMeetingCostsController.judgeMumber'; |
| | | import getProfileIdByName from '@salesforce/apex/LexMeetingCostsController.getProfileIdByName'; |
| | |
| | | Campaign; |
| | | IsLoading = true; |
| | | userId = USER_ID; |
| | | currentUserProfileId; |
| | | NotSupportProfileId; |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | } |
| | | } |
| | | |
| | | @wire(getRecord, { recordId: USER_ID, fields: [USERPROFILE_ID]}) |
| | | userDetails({error, data}) { |
| | | if (data) { |
| | | this.currentUserProfileId = data.fields.ProfileId.value; |
| | | |
| | | } else if (error) { |
| | | this.error = error ; |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | console.log(this.userId); |
| | | this.MeetingCosts(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | async MeetingCosts(){ |
| | | |
| | | var logUser = this.userId; |
| | | |
| | | var records = await judgeMember({ UserId : this.userId}); |
| | | |
| | | var ProfileId= await getProfileIdByName({Name : "系统管理员"}); |
| | | |
| | | |
| | | |
| | | var userProfileId = await getProfileId(); |
| | | if(records.length>0 && this.Campaign.Sponsor_Ones_Post__c == '1.华北'){ |
| | | window.open("/apex/CampaignMeetingcost?id=" + this.Campaign.Id ,'CampaignMember','height=500,width=950'); |
| | | } |
| | |
| | | || logUser == this.Campaign.JingliApprovalManager__c |
| | | || logUser == this.Campaign.BuchangApprovalManager__c |
| | | || logUser == this.Campaign.ZongjianApprovalManager__c |
| | | || this.currentUserProfileId == ProfileId){ |
| | | || userProfileId == ProfileId){ |
| | | window.open("/apex/CampaignMeetingcost?id=" + this.Campaign.Id ,'CampaignMember','height=500,width=950'); |
| | | } |
| | | else { |