From cf3dbaac9ef8ee0be7b741935461cd0fdd6ff495 Mon Sep 17 00:00:00 2001
From: liwentao <1376563863@qq.com>
Date: 星期三, 19 七月 2023 09:47:42 +0800
Subject: [PATCH] 营业 产品配套按钮: 复制 询价按钮: 跟进历史 科室保有设备一览

---
 force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js                        |   41 ++++++++
 force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml |   11 ++
 force-app/main/default/classes/lexCopyProductController.cls                                |   33 ++++++
 force-app/main/default/classes/lexQuotationProductNotUseController.cls-meta.xml            |    5 +
 force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js          |   43 ++++++++
 force-app/main/default/classes/lexQuotationProductNotUseController.cls                     |   22 ++++
 force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js                                |   77 +++++++++++++++
 force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.html                              |    6 +
 force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js-meta.xml                       |   11 ++
 force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html        |    6 +
 force-app/main/default/classes/lexCopyProductController.cls-meta.xml                       |    5 +
 force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html                      |    6 +
 force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml               |   11 ++
 13 files changed, 277 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/classes/lexCopyProductController.cls b/force-app/main/default/classes/lexCopyProductController.cls
new file mode 100644
index 0000000..ee5e0b3
--- /dev/null
+++ b/force-app/main/default/classes/lexCopyProductController.cls
@@ -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;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexCopyProductController.cls-meta.xml b/force-app/main/default/classes/lexCopyProductController.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/lexCopyProductController.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/lexQuotationProductNotUseController.cls b/force-app/main/default/classes/lexQuotationProductNotUseController.cls
new file mode 100644
index 0000000..b9e25a3
--- /dev/null
+++ b/force-app/main/default/classes/lexQuotationProductNotUseController.cls
@@ -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;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexQuotationProductNotUseController.cls-meta.xml b/force-app/main/default/classes/lexQuotationProductNotUseController.cls-meta.xml
new file mode 100644
index 0000000..d75b058
--- /dev/null
+++ b/force-app/main/default/classes/lexQuotationProductNotUseController.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/lexCopyProduct/lexCopyProduct.html b/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.html
new file mode 100644
index 0000000..9608e80
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js b/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js
new file mode 100644
index 0000000..868771d
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js
@@ -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());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js-meta.xml b/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js-meta.xml
new file mode 100644
index 0000000..e0d9930
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyProduct/lexCopyProduct.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html
new file mode 100644
index 0000000..9608e80
--- /dev/null
+++ b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js
new file mode 100644
index 0000000..0ddf35b
--- /dev/null
+++ b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js
@@ -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());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml
new file mode 100644
index 0000000..dc71306
--- /dev/null
+++ b/force-app/main/default/lwc/lexFollowUpHistory/lexFollowUpHistory.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html
new file mode 100644
index 0000000..9608e80
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js
new file mode 100644
index 0000000..112df75
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js
@@ -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());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml
new file mode 100644
index 0000000..a3206dd
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuotationProductNotUse/lexQuotationProductNotUse.js-meta.xml
@@ -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>
\ No newline at end of file

--
Gitblit v1.9.1