From 0230d0b66c508d98981fc2a3ff8e82f7ceecc3da Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期二, 27 六月 2023 09:44:59 +0800
Subject: [PATCH] 报价委托按钮等
---
force-app/main/default/classes/LexRepairQuoteController.cls-meta.xml | 5 +
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.html | 3
force-app/main/default/classes/LexLeadRequestController.cls | 20 +++++
force-app/main/default/classes/LexNewIntentionController.cls-meta.xml | 5 +
force-app/main/default/classes/LexRepairQuoteController.cls | 18 ++++
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js-meta.xml | 11 ++
force-app/main/default/classes/LexLeadRequestController.cls-meta.xml | 5 +
force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js | 73 ++++++++++++++++++
force-app/main/default/classes/LexNewIntentionController.cls | 47 +++++++++++
9 files changed, 187 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/classes/LexLeadRequestController.cls b/force-app/main/default/classes/LexLeadRequestController.cls
new file mode 100644
index 0000000..5536a0b
--- /dev/null
+++ b/force-app/main/default/classes/LexLeadRequestController.cls
@@ -0,0 +1,20 @@
+//author 锛歬kbes
+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;
+
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexLeadRequestController.cls-meta.xml b/force-app/main/default/classes/LexLeadRequestController.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/LexLeadRequestController.cls-meta.xml
@@ -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>
diff --git a/force-app/main/default/classes/LexNewIntentionController.cls b/force-app/main/default/classes/LexNewIntentionController.cls
new file mode 100644
index 0000000..f508d2b
--- /dev/null
+++ b/force-app/main/default/classes/LexNewIntentionController.cls
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexNewIntentionController.cls-meta.xml b/force-app/main/default/classes/LexNewIntentionController.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/LexNewIntentionController.cls-meta.xml
@@ -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>
diff --git a/force-app/main/default/classes/LexRepairQuoteController.cls b/force-app/main/default/classes/LexRepairQuoteController.cls
new file mode 100644
index 0000000..d092412
--- /dev/null
+++ b/force-app/main/default/classes/LexRepairQuoteController.cls
@@ -0,0 +1,18 @@
+// author锛歬kbes 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;
+
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexRepairQuoteController.cls-meta.xml b/force-app/main/default/classes/LexRepairQuoteController.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/LexRepairQuoteController.cls-meta.xml
@@ -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>
diff --git a/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.html b/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js b/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js
new file mode 100644
index 0000000..3b61b29
--- /dev/null
+++ b/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js
@@ -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);
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js-meta.xml b/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js-meta.xml
new file mode 100644
index 0000000..e966a43
--- /dev/null
+++ b/force-app/main/default/lwc/lexLeadQuotationRequest/lexLeadQuotationRequest.js-meta.xml
@@ -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>
\ No newline at end of file
--
Gitblit v1.9.1