tt
twysparks
2023-05-15 db0fa56676f63e02a43900891781aa67498f9ea6
force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
@@ -6,9 +6,11 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexTenderingLostButton extends LightningElement {
    @api recordId;//当前这条数据的id
    id;//返回值的id  Tender_information__c招标项目的id
    status;//状态
    profileId;//profileId id
    systemProfileId;
    TwoS1_Sales_Hospital;
    TwoS4_Sales_Manager;
    IsLoading = true;
    @wire(CurrentPageReference)
@@ -28,21 +30,21 @@
            recordId: this.recordId
        }).then(result => {
                this.IsLoading = false;
                this.id = result.Id;
                this.status = result.status;
                this.profileId = result.profileId.slice(0,15);
                this.profileId = result.profileId;
                this.systemProfileId = result.systemProfileId;
                this.TwoS1_Sales_Hospital = result.TwoS1_Sales_Hospital;
                this.TwoS4_Sales_Manager = result.TwoS4_Sales_Manager;
                this.LoseButton();
                this.dispatchEvent(new CloseActionScreenEvent());
        }).catch(() => {
        }).finally(() => {
        });
        })
    }
    //失单
    //招标项目 失单
    LoseButton(){
        sqlResult({id: this.id}).then(result=>{
        sqlResult({id: this.recordId}).then(result=>{
            //简档权限 2S1_销售医院担当 2S4_销售管理者 系统管理员
            if (this.profileId != '00e10000000xnp2' && this.profileId != '00e10000000xnpH' && this.profileId != '00e10000000Y3o5') {
            if (this.profileId != this.TwoS1_Sales_Hospital  && this.profileId != this.TwoS4_Sales_Manager && this.profileId != this.systemProfileId) {
                this.showToast("您没有权限,无法创建询价提交失单。","error");
                return;
            }
@@ -59,7 +61,7 @@
                    return;
                }
            }
            window.open(`/apex/TenderLostPage?id=${this.id}`,'','height=500,width=800,top=200,left=250,location=no');
            window.open(`/apex/TenderLostPage?id=${this.recordId}`,'','height=500,width=800,top=200,left=250,location=no');
        })
    }
    showToast(msg,type) {
@@ -69,4 +71,4 @@
        });
        this.dispatchEvent(event);
    }
}
}