force-app/main/default/classes/lexCopyProductController.cls
New file @@ -0,0 +1,33 @@ public with sharing class lexCopyProductController { public lexCopyProductController() { } @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { List<Product_Set__c> rl=[select Name,Product_Set_CD__c,Applicable_Department__c,Product_category__c,Valid_Date__c,Invalid_Date__c,Quote_Select_Info__c,Description__c from Product_Set__c where id = :recordId]; res.name=rl[0].Name; res.ProductSetCDC=rl[0].Product_Set_CD__c; res.ApplicableDepartmentC=rl[0].Applicable_Department__c; res.ProductCategoryC=rl[0].Product_category__c; res.ValidDateC=rl[0].Valid_Date__c; res.InvalidDateC=rl[0].Invalid_Date__c; res.QuoteSelectInfoC=rl[0].Quote_Select_Info__c; res.DescriptionC=rl[0].Description__c; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } class InitData{ @AuraEnabled public String name; @AuraEnabled public String ProductSetCDC; @AuraEnabled public String ApplicableDepartmentC; @AuraEnabled public String ProductCategoryC; @AuraEnabled public Date ValidDateC; @AuraEnabled public Date InvalidDateC; @AuraEnabled public String QuoteSelectInfoC; @AuraEnabled public String DescriptionC; } } force-app/main/default/classes/lexCopyProductController.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/lexQuotationProductNotUseController.cls
New file @@ -0,0 +1,22 @@ public with sharing class lexQuotationProductNotUseController { public lexQuotationProductNotUseController() { } @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { List<Opportunity> r1= [SELECT Department_Class__c from Opportunity where id=:recordId]; List<Report> r2=[SELECT Id from Report where name='保有设备一览(询价) 按钮']; res.Id=r1.get(0).Department_Class__c; res.reportId=r2.get(0).Id; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } class InitData{ @AuraEnabled public String Id; @AuraEnabled public String reportId; } } force-app/main/default/classes/lexQuotationProductNotUseController.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/lexCopyProduct/lexCopyProduct.html
New file @@ -0,0 +1,6 @@ <template> <div class="baseHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> </template> force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js
New file @@ -0,0 +1,77 @@ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; import init from '@salesforce/apex/lexCopyProductController.init'; export default class lexCopyProduct extends NavigationMixin(LightningElement) { @api recordId; reportId; name; Product_Set_CD__c; Applicable_Department__c; Product_category__c; Valid_Date__c; Invalid_Date__c; Quote_Select_Info__c; Description__c; @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.name=result.name; this.Product_Set_CD__c=result.ProductSetCDC; this.Applicable_Department__c=result.ApplicableDepartmentC; this.Product_category__c=result.ProductCategoryC; this.Valid_Date__c=result.ValidDateC; this.Invalid_Date__c=result.InvalidDateC; this.Quote_Select_Info__c=result.QuoteSelectInfoC; this.Description__c=result.DescriptionC; this.createOPDFromRentalApply(); }); } createOPDFromRentalApply(){ console.log("ddd1"); const data = encodeDefaultFieldValues({ RefertoID__c:this.recordId, Name:'Copy of'+this.name, Product_Set_CD__c:this.Product_Set_CD__c, Applicable_Department__c:this.Applicable_Department__c, Product_category__c:this.Product_category__c, Valid_Date__c:this.Valid_Date__c, Invalid_Date__c:this.Invalid_Date__c, Quote_Select_Info__c:this.Quote_Select_Info__c, Description__c:this.Description__c, }); console.log('data'); console.log(data); // const queryParams = Object.keys(data) .map((key) => key + '=' + encodeURIComponent(data[key])) .join('&'); // 使用NavigationMixin生成URL this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: 'Product_Set__c', // 要新建的对象API actionName: 'new', // recordId: this.recordId }, state:{ // nooverride: '1', defaultFieldValues:data,// 要复制的字段API } }); this.dispatchEvent(new CloseActionScreenEvent()); } } force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.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="lexCopyProduct"> <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/lexFollowUpHistory/lexFollowUpHistory.html
New file @@ -0,0 +1,6 @@ <template> <div class="baseHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> </template> force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js
New file @@ -0,0 +1,41 @@ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; import init from '@salesforce/apex/lexQuotationProductNotUseController.init'; export default class lexFollowUpHistory extends NavigationMixin(LightningElement) { @api recordId; reportId; @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.reportId=result.reportId; this.createOPDFromRentalApply(); }); } createOPDFromRentalApply(){ let url='/lightning/r/Report/'+this.reportId+'/view?fv0='+this.recordId; this[NavigationMixin.Navigate]({ type: 'standard__webPage', attributes: { url:url } }); this.dispatchEvent(new CloseActionScreenEvent()); } } force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.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="lexFollowUpHistory"> <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/lexQuotationProductNotUse/lexQuotationProductNotUse.html
New file @@ -0,0 +1,6 @@ <template> <div class="baseHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> </template> force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js
New file @@ -0,0 +1,43 @@ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; import init from '@salesforce/apex/lexQuotationProductNotUseController.init'; export default class lexQuotationProductNotUse extends NavigationMixin(LightningElement) { @api recordId; id; reportId; @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.id = result.Id; this.reportId=result.reportId; this.createOPDFromRentalApply(); }); } createOPDFromRentalApply(){ let url='/lightning/r/Report/'+this.reportId+'/view?fv0='+this.id; this[NavigationMixin.Navigate]({ type: 'standard__webPage', attributes: { url:url } }); this.dispatchEvent(new CloseActionScreenEvent()); } } force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.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="lexQuotationProductNotUse"> <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>