产品咨询单 “营业跟进”、“服务跟进”、“不需要”、“新建意向” 按钮提交
1个文件已修改
14个文件已添加
586 ■■■■■ 已修改文件
force-app/main/default/classes/InquiryFormController.cls 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/InquiryFormController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LightingButtonConstant.cls 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormCustomLink1/lexInquiryFormCustomLink1.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormCustomLink1/lexInquiryFormCustomLink1.js 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormCustomLink1/lexInquiryFormCustomLink1.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormCustomLink2/lexInquiryFormCustomLink2.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormCustomLink2/lexInquiryFormCustomLink2.js 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormCustomLink2/lexInquiryFormCustomLink2.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormNoStatus/lexInquiryFormNoStatus.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormNoStatus/lexInquiryFormNoStatus.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormNoStatus/lexInquiryFormNoStatus.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormServiceFollow/lexInquiryFormServiceFollow.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormServiceFollow/lexInquiryFormServiceFollow.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInquiryFormServiceFollow/lexInquiryFormServiceFollow.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/InquiryFormController.cls
New file
@@ -0,0 +1,124 @@
public class InquiryFormController {
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try{
            Inquiry_form__c report = [SELECT Id,Name,Service_Status__c,FSE_Owner__c,FSE_Owner_id__c,Status__c,Lead_link__c,Opp_Name_Search__c,Contact_Name__c,Contact_Id__c,Hospital_Name__c,Hospital_ID__c,Department_Class__c,Department_ID__c,Opp_Name_Search_ID__c,Campaign__c,Campaign_ID__c,Cancel_Reason__c,Product_Owner__c,Phone__c,Email__c,Last_Name__c,LeadSource__c,Opportunity_Division__c,Request1__c,Urgent__c,Family_Name__c FROM Inquiry_form__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.Name = report.Name;
            res.ServiceStatus = report.Service_Status__c;
            res.Status = report.Status__c;
            res.profileId = UserInfo.getProfileId();
            res.userId = UserInfo.getUserId();
            res.LeadLink= report.Lead_link__c;
            res.OppNameSearch= report.Opp_Name_Search__c;
            res.ContactName= report.Contact_Name__c;
            res.ContactId = report.Contact_Id__c;
            res.HospitalName = report.Hospital_Name__c;
            res.HospitalID = report.Hospital_ID__c;
            res.DepartmentClass= report.Department_Class__c;
            res.DepartmentID = report.Department_ID__c;
            res.OppNameSearchID= report.Opp_Name_Search_ID__c;
            res.Campaign= report.Campaign__c;
            res.CampaignID = report.Campaign_ID__c;
            res.CancelReason= report.Cancel_Reason__c;
            res.Phone = report.Phone__c;
            res.Email= report.Email__c;
            res.LastName = report.Last_Name__c;
            res.LeadSource = report.LeadSource__c;
            res.OpportunityDivision = report.Opportunity_Division__c;
            res.Request1 = report.Request1__c;
            res.Urgent = report.Urgent__c;
            res.FSEOwner = report.FSE_Owner__c;
            res.FSEOwnerId = report.FSE_Owner_id__c;
            res.FamilyName = report.Family_Name__c;
            res.JINGZHUOJISHU = getUserName(LightingButtonConstant.JINGZHUO_JISHU);
            System.debug(LoggingLevel.INFO, '*** xu: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** exu: ' + e);
        }
        return res;
    }
    //新建一项
    @AuraEnabled
    public static List<Inquiry_form__c> sqlResult (String id) {
        try {
            List<Inquiry_form__c> records = [SELECT id,Request_Detail__c FROM Inquiry_form__c WHERE id = :id];
            System.debug(LoggingLevel.INFO, '*** xu1: ' + records);
            return records;
        } catch (exception e) {
            System.debug(LoggingLevel.INFO, '*** xu1111111: ' + e);
            throw new AuraHandledException(e.getMessage());
        }
    }
    @AuraEnabled
    public static string getUserName(String name){
        User user = null;
        try {
            user = [select Id from user where Name =:name];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return user.Id;
    }
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String ServiceStatus;
        @AuraEnabled
        public String profileId;
        @AuraEnabled
        public String userId;
        @AuraEnabled
        public String Status;
        @AuraEnabled
        public String LeadLink;
        @AuraEnabled
        public String OppNameSearch;
        @AuraEnabled
        public String ContactName;
        @AuraEnabled
        public String ContactId;
        @AuraEnabled
        public String HospitalName;
        @AuraEnabled
        public String HospitalID;
        @AuraEnabled
        public String DepartmentClass;
        @AuraEnabled
        public String DepartmentID;
        @AuraEnabled
        public String OppNameSearchID;
        @AuraEnabled
        public String Campaign;
        @AuraEnabled
        public String CampaignID;
        @AuraEnabled
        public String Name;
        @AuraEnabled
        public String CancelReason;
        @AuraEnabled
        public String Phone;
        @AuraEnabled
        public String Email;
        @AuraEnabled
        public String LastName;
        @AuraEnabled
        public String LeadSource;
        @AuraEnabled
        public String OpportunityDivision;
        @AuraEnabled
        public String Request1;
        @AuraEnabled
        public Boolean Urgent;
        @AuraEnabled
        public String FSEOwner;
        @AuraEnabled
        public String FSEOwnerId;
        @AuraEnabled
        public String FamilyName;
        @AuraEnabled
        public String JINGZHUOJISHU;
    }
}
force-app/main/default/classes/InquiryFormController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/LightingButtonConstant.cls
@@ -90,6 +90,7 @@
    public static final String CN_NO = '否';
    public static final String VOC_NAME = 'VOC';
    public static final String OK = 'OK';
    public static final String JINGZHUO_JISHU = '精琢 技术';
    public static final String LU_SHENG_NAME = '陆 胜';
    public static final String HU_DI_AN_NAME = '胡 迪安';
    public static final String SYSTEM_PROFILE_NAME = '系统管理员';
force-app/main/default/lwc/lexInquiryFormCustomLink1/lexInquiryFormCustomLink1.html
New file
@@ -0,0 +1,4 @@
<template>
    <div class="lexESignAcceptanceHospital" if:true={IsLoding}>
    <lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
</template>
force-app/main/default/lwc/lexInquiryFormCustomLink1/lexInquiryFormCustomLink1.js
New file
@@ -0,0 +1,200 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/InquiryFormController.init';
import  sqlResult  from '@salesforce/apex/InquiryFormController.sqlResult';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexInquiryFormCustomLink1 extends LightningElement {
    @api recordId;//OwnerId
    IsLoading = true;
    Id= "";
    ServiceStatus= "";
    profileId= "";
    userId= "";
    Status= "";
    LeadLink= "";
    OppNameSearch= "";
    ContactName= "";
    ContactId = "";
    HospitalName= "";
    HospitalID= "";
    DepartmentClass= "";
    DepartmentID = "";
    OppNameSearchID= "";
    Campaign= "";
    CampaignID= "";
    Name= "";
    CancelReason= "";
    Phone= "";
    Email= "";
    LastName= "";
    LeadSource= "";
    OpportunityDivision= "";
    Request1= "";
    Urgent = false;
    FSEOwner= "";
    FamilyName= "";
    @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 => {
            this.IsLoading = false;
            this.Id = result.Id != undefined ? result.Id : "";
            this.ServiceStatus = result.ServiceStatus != undefined ? result.ServiceStatus : "";
            this.profileId = result.profileId != undefined ? result.profileId : "";
            this.userId = result.userId != undefined ? result.userId : "";
            this.Status = result.Status != undefined ? result.Status : "";
            this.LeadLink = result.LeadLink != undefined ? result.LeadLink : "";
            this.OppNameSearch = result.OppNameSearch != undefined ? result.OppNameSearch : "";
            this.ContactName = result.ContactName != undefined ? result.ContactName : "";
            this.ContactId = result.ContactId != undefined ? result.ContactId : "";
            this.HospitalName = result.HospitalName != undefined ? result.HospitalName : "";
            this.HospitalID = result.HospitalID != undefined ? result.HospitalID : "";
            this.DepartmentClass = result.DepartmentClass != undefined ? result.DepartmentClass : "";
            this.DepartmentID = result.DepartmentID != undefined ? result.DepartmentID : "";
            this.OppNameSearchID = result.OppNameSearchID != undefined ? result.OppNameSearchID : "";
            this.Campaign = result.Campaign != undefined ? result.Campaign : "";
            this.CampaignID = result.CampaignID != undefined ? result.CampaignID : "";
            this.Name = result.Name != undefined ? result.Name : "";
            this.CancelReason = result.CancelReason != undefined ? result.CancelReason : "";
            this.Phone = result.Phone != undefined ? result.Phone : "";
            this.Email = result.Email != undefined ? result.Email : "";
            this.LastName = result.LastName != undefined ? result.LastName : "";
            this.LeadSource = result.LeadSource != undefined ? result.LeadSource : "";
            this.OpportunityDivision = result.OpportunityDivision != undefined ? result.OpportunityDivision : "";
            this.Request1 = result.Request1 != undefined ? result.Request1 : "";
            this.FSEOwner = result.FSEOwner != undefined ? result.FSEOwner : "";
            this.FamilyName = result.FamilyName != undefined ? result.FamilyName : "";
            this.Urgent = result.Urgent == 0 ? 0 :1;
            this.CustomLink1();
        })
    }
    // 产品咨询单 新建意向
    CustomLink1(){
        var lead = "";
        var search = "";
        sqlResult({id:this.recordId}).then(records=>{
            var Request = '';
            if(records[0].Request_Detail__c != null){
            Request = records[0].Request_Detail__c.toString();
            }
            var lead = this.LeadLink;
            var search = this.OppNameSearch;
            // this.CustomLink1();
            if(lead){
                alert('已经有意向了,不能再创建新的意向。');
                return;
            }else{
            //var urlStr ='/00Q/e?RecordType=01210000000QiRa&ent=Lead';
            //window.open(urlStr);
            var urlStr ='/apex/NewAndEditLead?RecordType=01210000000QiRa&ent=Lead'+
            '&CF00N10000006ps6f='+encodeURI(this.ContactName)+
            '&CF00N10000006ps6f_lkid='+encodeURI(this.ContactId)+
            '&CF00N10000002CvC5='+encodeURI(this.HospitalName)+
            '&CF00N10000002CvC5_lkid='+encodeURI(this.HospitalID)+
            '&CF00N10000006qNtt='+encodeURI(this.DepartmentClass)+
            '&CF00N10000006qNtt_lkid='+encodeURI(this.DepartmentID)+
            '&CF00N10000006qNty='+encodeURI(this.OppNameSearch)+
            '&CF00N10000006qNty_lkid='+encodeURI(this.OppNameSearchID)+
            '&CF00N10000004oN28='+encodeURI(this.Campaign)+
            '&CF00N10000004oN28_lkid='+encodeURI(this.CampaignID)+
            '&CF00N1000000962np='+encodeURI(this.Name)+
            '&CF00N1000000962np_lkid='+encodeURI(this.Id)+
            '&00N10000006qBYk='+encodeURI(this.CancelReason)+
            // '&00N10000006qGvj='+result.ProductOwner+
            '&00N10000002CvBM=' + encodeURI(Request) +
            '&lea13=未跟进'+
            '&lea3='+encodeURI(this.HospitalName)+
            '&lea8='+encodeURI(this.Phone.trim())+
            '&lea11='+encodeURI(this.Email.trim())+
            '&name_lastlea2=' + encodeURI(this.FamilyName) +
            '&name_firstlea2='+encodeURI(this.LastName)+
            '&lea5='+encodeURI(this.LeadSource)+
            '&00N10000002CvBR='+encodeURI(this.Request1)+
            '&00N10000002CvBC='+encodeURI(this.OpportunityDivision)+
            //'&00N10000002EjE1={!Inquiry_form__c.Opp_Name_Search__c}'+
            '&00N10000002CvB7='+encodeURI(this.Urgent);
            if(search !=  "" && search != null){
            urlStr += '&00N10000002EjE1='+this.OppNameSearch;
            }
            window.open(urlStr);
            this.dispatchEvent(new CloseActionScreenEvent());
            }
        })
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
// var foo = function() {
//     var lead = '{!Inquiry_form__c.Lead_link__c}';
//     var status = '{!Inquiry_form__c.Status__c}';
//     //gzw add
//     var search = '{!Inquiry_form__c.Opp_Name_Search__c}';
//     //zyh add-search
//     var name = '{!Inquiry_form__c.Contact_Name__c}';
//     name = name.replace(" ", "");
//     var sql = "select id,Request_Detail__c from Inquiry_form__c where id = '{!Inquiry_form__c.Id}'";
//     var sqlResult = sforce.connection.query(sql);
//     var records = sqlResult.getArray("records");
//     var Request = '';
//     if(records[0].Request_Detail__c != null){
//     Request = records[0].Request_Detail__c.toString();
//     }
//     //gzw add
//     if(lead){
//     alert('已经有意向了,不能再创建新的意向。');
//     return;
//     }else{
//     //var urlStr ='/00Q/e?RecordType=01210000000QiRa&ent=Lead';
//     //window.open(urlStr);
//     var urlStr ='/00Q/e?RecordType=01210000000QiRa&ent=Lead'+
//     '&CF00N10000006ps6f={!HTMLENCODE(Inquiry_form__c.Contact_Name__c)}'+
//     '&CF00N10000006ps6f_lkid={!Inquiry_form__c.Contact_Id__c}'+
//     '&CF00N10000002CvC5={!HTMLENCODE(Inquiry_form__c.Hospital_Name__c)}'+
//     '&CF00N10000002CvC5_lkid={!Inquiry_form__c.Hospital_ID__c}'+
//     '&CF00N10000006qNtt={!HTMLENCODE(Inquiry_form__c.Department_Class__c)}'+
//     '&CF00N10000006qNtt_lkid={!Inquiry_form__c.Department_ID__c}'+
//     '&CF00N10000006qNty={!HTMLENCODE(Inquiry_form__c.Opp_Name_Search__c)}'+
//     '&CF00N10000006qNty_lkid={!Inquiry_form__c.Opp_Name_Search_ID__c}'+
//     '&CF00N10000004oN28={!HTMLENCODE(Inquiry_form__c.Campaign__c)}'+
//     '&CF00N10000004oN28_lkid={!Inquiry_form__c.Campaign_ID__c}'+
//     '&CF00N1000000962np={!HTMLENCODE(Inquiry_form__c.Name)}'+
//     '&CF00N1000000962np_lkid={!Inquiry_form__c.Id}'+
//     '&00N10000006qBYk={!HTMLENCODE(Inquiry_form__c.Cancel_Reason__c)}'+
//     '&00N10000006qGvj={!Inquiry_form__c.Product_Owner__c}'+
//     '&00N10000002CvBM=' + Request +
//     '&lea13=未跟进'+
//     '&lea3={!HTMLENCODE(Inquiry_form__c.Hospital_Name__c)}'+
//     '&lea8={!HTMLENCODE(Inquiry_form__c.Phone__c)}'+
//     '&lea11={!HTMLENCODE(Inquiry_form__c.Email__c)}'+
//     '&name_lastlea2=' + name +
//     '&name_firstlea2={!HTMLENCODE(Inquiry_form__c.Last_Name__c)}'+
//     '&lea5={!HTMLENCODE( TEXT(Inquiry_form__c.LeadSource__c))}'+
//     '&00N10000002CvBC={!HTMLENCODE(TEXT(Inquiry_form__c.Opportunity_Division__c))}'+
//     '&00N10000002CvBR={!Inquiry_form__c.Request1__c}'+
//     //'&00N10000002EjE1={!Inquiry_form__c.Opp_Name_Search__c}'+
//     '&00N10000002CvB7={!Inquiry_form__c.Urgent__c}';
//     if(search !=  "" && search != null){
//     urlStr += '&00N10000002EjE1={!Inquiry_form__c.Opp_Name_Search__c}';
//     }
//     window.open(urlStr);
//     }
//     }
//     foo();
force-app/main/default/lwc/lexInquiryFormCustomLink1/lexInquiryFormCustomLink1.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexInquiryFormCustomLink2/lexInquiryFormCustomLink2.html
New file
@@ -0,0 +1,4 @@
<template>
    <div class="lexESignAcceptanceHospital" if:true={IsLoding}>
    <lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
</template>
force-app/main/default/lwc/lexInquiryFormCustomLink2/lexInquiryFormCustomLink2.js
New file
@@ -0,0 +1,62 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/InquiryFormController.init';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexInquiryFormCustomLink2 extends LightningElement {
    @api recordId;//OwnerId
    IsLoading = true;
    Status;
    @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 => {
            this.Status = result.Statusl;
            this.IsLoading = false;
            this.CustomLink2();
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    // 产品咨询单 营业跟进
    CustomLink2(){
        if(this.Status != '04.已建意向'){
        window.open ('/apex/FollowPage?id='+this.recordId, '不需要的理由',
        'height=400, width=800, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
        }else {
        // alert('已经有意向了,不能执行此操作。');
        this.showToast("已经有意向了,不能执行此操作。","error")
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
// //2021-10-21 gwy 版本更改为51.0
// var foo = function() {
//     var Status = "{!Inquiry_form__c.Status__c}";
//     if(Status != '04.已建意向'){
//     window.open ('/apex/FollowPage?id='+"{!Inquiry_form__c.Id}", '不需要的理由',
//     'height=400, width=700, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
//     }else {
//     alert('已经有意向了,不能执行此操作。');
//     }
//     }
//     foo();
force-app/main/default/lwc/lexInquiryFormCustomLink2/lexInquiryFormCustomLink2.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexInquiryFormNoStatus/lexInquiryFormNoStatus.html
New file
@@ -0,0 +1,4 @@
<template>
    <div class="lexESignAcceptanceHospital" if:true={IsLoding}>
    <lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
</template>
force-app/main/default/lwc/lexInquiryFormNoStatus/lexInquiryFormNoStatus.js
New file
@@ -0,0 +1,65 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/InquiryFormController.init';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexInquiryFormNoStatus extends LightningElement {
    @api recordId;//OwnerId
    IsLoading = true;
    Status;
    @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 => {
            this.Status = result.Statusl;
            this.IsLoading = false;
            this.NoStatus();
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    // 产品咨询单 不需要
    NoStatus(){
        if(this.Status != '04.已建意向'){
            window.open ('/apex/StatusPage?id='+this.recordId , '不需要的理由',
    'height=400, width=700, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
        }else {
        // alert('已经有意向了,不能执行此操作。');
        this.showToast("已经有意向了,不能执行此操作。","error")
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
//2021-10-21 gwy 版本更改为51.0
// var foo = function() {
//     var Status = "{!Inquiry_form__c.Status__c}";
//     if(Status != '04.已建意向'){
//     window.open ('/apex/StatusPage?id='+"{!Inquiry_form__c.Id}", '不需要的理由',
//     'height=400, width=700, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
//     }else {
//     alert('已经有意向了,不能执行此操作。');
//     }
//     }
//     foo();
force-app/main/default/lwc/lexInquiryFormNoStatus/lexInquiryFormNoStatus.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexInquiryFormServiceFollow/lexInquiryFormServiceFollow.html
New file
@@ -0,0 +1,4 @@
<template>
    <div class="lexESignAcceptanceHospital" if:true={IsLoding}>
    <lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
</template>
force-app/main/default/lwc/lexInquiryFormServiceFollow/lexInquiryFormServiceFollow.js
New file
@@ -0,0 +1,69 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/InquiryFormController.init';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexInquiryFormServiceFollow extends LightningElement {
    @api recordId;//OwnerId
    IsLoading = true;
    FSEOwnerId;
    ServiceStatus;
    JINGZHUOJISHU;
    @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 => {
            this.ServiceStatus = result.ServiceStatus;
            this.FSEOwnerId = result.FSEOwnerId;
            this.userId = result.userId;
            this.JINGZHUOJISHU = result.JINGZHUOJISHU;
            this.IsLoading = false;
            this.ServiceFollow ();
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    // 产品咨询单 服务跟进
    ServiceFollow (){
        if(null != this.FSEOwnerId && this.FSEOwnerId== this.userId || this.userId == this.JINGZHUOJISHU){
            window.open ('/apex/ServiceFollowPage?id='+this.recordId, '服务跟进',
            'height=400, width=700, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
        }else{
            // alert("此按钮只有FSE可以点击!");
            this.showToast("此按钮只有FSE可以点击!","error")
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
// var foo = function() {
//     var Status = "{!Inquiry_form__c.Service_Status__c}";
//     var FSEOwner = "{!Inquiry_form__c.FSE_OwnerId__c}";
//     //alert( FSEOwner+'==='+"{!$User.Id}");
//     if(null!=FSEOwner && (FSEOwner=="{!$User.Id}" || "{!$User.Id}" == "00510000005sEEM")){
//     window.open ('/apex/ServiceFollowPage?id='+"{!Inquiry_form__c.Id}", '服务跟进',
//     'height=400, width=700, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
//     }else{
//     alert("此按钮只有FSE可以点击!");
//     }
//     }
//     foo();
force-app/main/default/lwc/lexInquiryFormServiceFollow/lexInquiryFormServiceFollow.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>