import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/ApplicationButtonController.initSubmitButton'; import userInfo_Owner from '@salesforce/apex/ApplicationButtonController.userInfo_Owner'; import submit from '@salesforce/apex/ApplicationButtonController.submit'; import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class lexApplicationSubmitButton extends LightningElement { @api recordId;//OwnerId ownerId;//所有人id id;//返回值的id IsLoading = true; arrMessage = []; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback(){ init({ recordId: this.recordId }).then(result => { if (result != null) { this.IsLoading = false; this.ownerId = result.OwnerId; this.id = result.Id; this.Submit(); } }) } Submit(){ this.arrMessage = []; //获取获取当前登陆人 userInfo_Owner({}).then(result=>{ if(this.ownerId == result.id){ submit({ recordId: this.recordId }).then(requst=>{ if(requst == '1'){ this.showToast("提交授权信息成功","success"); } if(requst != "1"){ var messageage = ""; for(let i=0;i