KKbes
2023-06-27 0230d0b66c508d98981fc2a3ff8e82f7ceecc3da
报价委托按钮等
9个文件已添加
187 ■■■■■ 已修改文件
force-app/main/default/classes/LexLeadRequestController.cls 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexLeadRequestController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexNewIntentionController.cls 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexNewIntentionController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexRepairQuoteController.cls 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexRepairQuoteController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexLeadRequestController.cls
New file
@@ -0,0 +1,20 @@
//author :kkbes
public with sharing class LexLeadRequestController {
    @AuraEnabled
    public static Lead init(String recordId){
        Lead res = new Lead();
        try{
            res=[SELECT Id,Status,Tender_information__c  FROM  Lead  WHERE Id = : recordId ];
        }
        catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
}
force-app/main/default/classes/LexLeadRequestController.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>51.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/LexNewIntentionController.cls
New file
@@ -0,0 +1,47 @@
//author : kkbes   forbutton  NewIntention  经销商询价对象
public with sharing class LexNewIntentionController {
    @AuraEnabled
    public static Agency_Opportunity__c init(String recordId){
        Agency_Opportunity__c  res = new Agency_Opportunity__c();
        try{
            res = [Select Id,Is_Transformed__c,Department_Class_Opp_Name__c,
            Department_Name_Text__c,StageName__c,Close_Forecasted_Date__c,
            Name,Purchase_Reason__c,Fund_Basis__c,Purchase_Type__c,
            Sales_Method__c,Request__c,Request_Detail__c
                FROM Agency_Opportunity__c
                    WHERE  Id = : recordId];
        }
        catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static List<Account> getAccountByLongName(String Name){
        try{
            List<Account> res = [Select id, name From Account WHERE Name = : Name];
            return res;
        }
        catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return null;
    }
        @AuraEnabled
    public static List<Account> getAccountByShortName(String Name){
        try{
            List<Account> res = [Select id, name From Account WHERE Name = : Name];
            return res;
        }
        catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return null;
    }
}
force-app/main/default/classes/LexNewIntentionController.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>51.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/LexRepairQuoteController.cls
New file
@@ -0,0 +1,18 @@
// author:kkbes for 产品检索 的修理报价预估按钮
public with sharing class LexRepairQuoteController {
    @AuraEnabled
    public static Product2__c  init(String recordId){
        try{
            Product2__c res = [SELECT id,   Name  FROM  Product2__c WHERE Id = : recordId];
            return res;
        }
        catch (Exception e) {
        }
        return null;
    }
}
force-app/main/default/classes/LexRepairQuoteController.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>51.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.html
New file
@@ -0,0 +1,3 @@
<template>
</template>
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js
New file
@@ -0,0 +1,73 @@
// author : kkbes
import { LightningElement, track, wire,api } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
  const event = new ShowToastEvent({
            title: '意向已结束',
            message:
                '意向已结束不能做报价委托',
        });
import init  from '@salesforce/apex/LexLeadRequestController.init';
export default class lexLeadQuotationRequest extends LightningElement {
    @api recordId;
    Lead;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
        if (currentPageReference) {
          const urlValue = currentPageReference.state.recordId;
          if (urlValue) {
            let str = `${urlValue}`;
            console.log("str");
            console.log(str);
            this.recordId = str;
          }
        }
    }
    connectedCallback(){
        console.log(this.recordId);
        init({
            recordId: this.recordId
        }).then(result => {
            console.log(result);
            if (result != null) {
                this.Lead = result;
                console.log(this.Lead);
                console.log(this.Lead.Status == '未跟进');
                this.QuotationRequest();
            }
        }).catch(error => {
            console.log("error");
            console.log(error);
        });
    }
    async QuotationRequest(){
        if( this.Lead.Status == '未跟进'){
        this.dispatchEvent(new CloseActionScreenEvent());
        window.open("/apex/NewQuoteIrai?leadid="+ this.Lead.Id +"&tenderid="+ this.Lead.Tender_information__c);
        }else{
        this.dispatchEvent(new CloseActionScreenEvent());
        this.dispatchEvent(event);
        }
    }
}
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.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="lexLeadQuotationRequest">
    <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>