unknown
2023-04-11 fd1234ddc5be42b9ec2fad9d9286cd2aa58eb0ef
force-app/main/default/lwc/lexApplicationCancelSubmit/lexApplicationCancelSubmit.js
@@ -1,13 +1,12 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import  init  from '@salesforce/apex/ApplicationButtonController.initSubmitButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import submitCancel from '@salesforce/apex/ApplicationButtonController.submitCancel';
import UserInfo_Owner from '@salesforce/apex/ApplicationButtonController.UserInfo_Owner';
export default class Submit extends LightningElement {
import userInfo_Owner from '@salesforce/apex/ApplicationButtonController.userInfo_Owner';
export default class lexApplicationCancelSubmit extends LightningElement {
    @api recordId;//OwnerId
    ownerId;
    monthlyReportId;
@@ -19,33 +18,25 @@
           const urlValue = currentPageReference.state.recordId;
           if (urlValue) {
             let str = `${urlValue}`;
             console.log("str:"+str);
             this.recordId = str;
           }
         }
     }
    
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result => {
            if (result != null) {
                this.IsLoading = false;
                this.ownerId = result.OwnerId;
                this.monthlyReportId = result.Id;
                this.cancelSubmit();
            }
        }).catch(error => {
            console.log("error"+error);
        }).finally(() => {
        });
        })
    }
    //授权申请 取消提交
    cancelSubmit(){
        UserInfo_Owner({}).then(result=>{
            console.log(result,'获取当前登陆人id')
        //'获取当前登陆人id'
        userInfo_Owner({}).then(result=>{
            if(this.ownerId == result.id){
                submitCancel({
                    recordId: this.recordId
@@ -64,7 +55,6 @@
            }
        })
    }
    updateRecordView() {
        updateRecord({fields: { Id: this.recordId }});