From 0a6791a0f91663f20d63929f3098aee93e26af63 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 26 六月 2023 17:24:17 +0800
Subject: [PATCH] 修改按钮

---
 force-app/main/default/classes/lexSolutionProgrammaController.cls                                            |   52 ++++++
 force-app/main/default/lwc/lexNewSolutionClosingAttachment/__tests__/lexNewSolutionClosingAttachment.test.js |   25 +++
 force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.html              |    5 
 force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js                |   67 ++++++++
 force-app/main/default/classes/lexSolutionProgrammaController.cls-meta.xml                                   |    5 
 force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.html                              |    5 
 force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js                                        |   84 ++++++++++
 force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js-meta.xml       |   11 +
 force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js                                              |   34 ++-
 force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.html                                      |   13 +
 force-app/main/default/lwc/lexNewSolutionProgramma/__tests__/lexNewSolutionProgramma.test.js                 |   25 +++
 force-app/main/default/lwc/lexNewSolutonProLwc/__tests__/lexNewSolutonProLwc.test.js                         |   25 +++
 force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js                                |   93 +++++++++++
 force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js-meta.xml                       |   11 +
 force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js-meta.xml                               |   11 +
 15 files changed, 453 insertions(+), 13 deletions(-)

diff --git a/force-app/main/default/classes/lexSolutionProgrammaController.cls b/force-app/main/default/classes/lexSolutionProgrammaController.cls
new file mode 100644
index 0000000..843adf3
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProgrammaController.cls
@@ -0,0 +1,52 @@
+public with sharing class lexSolutionProgrammaController {
+    @AuraEnabled
+    public static InitData initForNewSolutionProgramma(String recordId){
+        InitData res = new InitData();
+        try {
+            SolutionProjectRequirements__c so = [
+                select
+                Status__c,
+                GirWindowDirectorApproved__c,
+                HospitalOwner__c
+                from SolutionProjectRequirements__c where Id =: recordId
+            ];
+            res.girWindowDirectorApproved = so.GirWindowDirectorApproved__c;
+            res.hospitalOwnerId = so.HospitalOwner__c;
+            res.status = so.Status__c;
+            res.profileId = UserInfo.getProfileId();
+            res.m2profileId = [select Id from Profile where Name =: lexLightingButtonConstant.M2_PROFILE_NAME].Id;
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
+    @AuraEnabled
+    public static InitData initForNewSolutionClosingAttachment(String recordId){
+        InitData res = new InitData();
+        try {
+            Solution_Programme__c so = [
+                select
+                Scheme_Type__c
+                from Solution_Programme__c where Id =: recordId
+            ];
+            res.schemeType = so.Scheme_Type__c;
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
+    class InitData{
+        @AuraEnabled
+        public String status;
+        @AuraEnabled
+        public Boolean girWindowDirectorApproved;
+        @AuraEnabled
+        public String hospitalOwnerId;
+        @AuraEnabled
+        public String profileId;
+        @AuraEnabled
+        public String m2profileId;
+        @AuraEnabled
+        public String schemeType;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexSolutionProgrammaController.cls-meta.xml b/force-app/main/default/classes/lexSolutionProgrammaController.cls-meta.xml
new file mode 100644
index 0000000..45cccbd
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProgrammaController.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>57.0</apiVersion>
+    <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionClosingAttachment/__tests__/lexNewSolutionClosingAttachment.test.js b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/__tests__/lexNewSolutionClosingAttachment.test.js
new file mode 100644
index 0000000..f18b831
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/__tests__/lexNewSolutionClosingAttachment.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexNewSolutionClosingAttachment from 'c/lexNewSolutionClosingAttachment';
+
+describe('c-lex-new-solution-closing-attachment', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-new-solution-closing-attachment', {
+            is: LexNewSolutionClosingAttachment
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.html b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.html
new file mode 100644
index 0000000..d895563
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="baseholder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div> 
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js
new file mode 100644
index 0000000..035d557
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js
@@ -0,0 +1,67 @@
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/lexSolutionProgrammaController.initForNewSolutionClosingAttachment';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import LightningConfirm from 'lightning/confirm';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+
+export default class LexNewSolutionClosingAttachment extends LightningElement {
+    @api recordId;
+    schemeType;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+      console.log(111);
+      console.log(currentPageReference);
+  
+      if (currentPageReference) {
+        const urlValue = currentPageReference.state.recordId;
+        if (urlValue) {
+          let str = `${urlValue}`;
+          console.log("str");
+          console.log(str);
+          this.recordId = str;
+        }
+      }
+    }
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+        title: '',
+        message: msg,
+        variant: type
+      });
+      this.dispatchEvent(event);
+    }
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.schemeType = result.schemeType;
+            this.newSolutionClosingAttachment();
+        });
+    }
+    newSolutionClosingAttachment(){
+        if(this.schemeType != '缁撴'){
+            this.showToast('鍙湁缁撴鐨勬柟妗堟墠鑳藉垱寤虹粨妗堥檮浠�','error');
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }else{
+            const defaultValues = encodeDefaultFieldValues({
+                Solution_Programme__c: this.recordId
+            });
+            this[NavigationMixin.Navigate]({
+                type: 'standard__objectPage',
+                attributes: {
+                    objectApiName: 'solutionClosingAttachment__c',
+                    actionName: 'new'
+                },
+                state: {
+                    nooverride: '1',
+                    defaultFieldValues: defaultValues
+                }
+            });
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js-meta.xml b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js-meta.xml
new file mode 100644
index 0000000..c307012
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+     <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</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/lexNewSolutionProgramma/__tests__/lexNewSolutionProgramma.test.js b/force-app/main/default/lwc/lexNewSolutionProgramma/__tests__/lexNewSolutionProgramma.test.js
new file mode 100644
index 0000000..e40af42
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionProgramma/__tests__/lexNewSolutionProgramma.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexNewSolutionProgramma from 'c/lexNewSolutionProgramma';
+
+describe('c-lex-new-solution-programma', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-new-solution-programma', {
+            is: LexNewSolutionProgramma
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.html b/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.html
new file mode 100644
index 0000000..8be2ba0
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="baseholder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js b/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js
new file mode 100644
index 0000000..180c7c9
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js
@@ -0,0 +1,93 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-06-26 11:10:52
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-06-26 14:18:17
+ */
+
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/lexSolutionProgrammaController.initForNewSolutionProgramma';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import LightningConfirm from 'lightning/confirm';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+
+export default class LexNewSolutionProgramma extends LightningElement {
+  @api recordId;
+  status;
+  girWindowDirectorApproved;
+  hospitalOwnerId;
+  profileId;
+  m2profileId;
+  @wire(CurrentPageReference)
+  getStateParameters(currentPageReference) {
+    console.log(111);
+    console.log(currentPageReference);
+
+    if (currentPageReference) {
+      const urlValue = currentPageReference.state.recordId;
+      if (urlValue) {
+        let str = `${urlValue}`;
+        console.log("str");
+        console.log(str);
+        this.recordId = str;
+      }
+    }
+  }
+  showToast(msg,type) {
+    const event = new ShowToastEvent({
+      title: '',
+      message: msg,
+      variant: type
+    });
+    this.dispatchEvent(event);
+  }
+  connectedCallback(){
+    init({
+      recordId: this.recordId
+    }).then(result=>{
+      this.status = result.status;
+      this.girWindowDirectorApproved = result.girWindowDirectorApproved;
+      this.hospitalOwnerId = result.hospitalOwnerId;
+      this.profileId = result.profileId;
+      this.m2profileId = result.m2profileId;
+      this.newSolutionProgramma();
+    });
+  }
+  newSolutionProgramma(){ 
+    if(this.profileId != this.m2profileId){
+      this.showToast('鍙湁GIR绐楀彛鎵嶈兘鏂板缓鏂规','error');
+      this.dispatchEvent(new CloseActionScreenEvent());
+    }else if(this.status == '07缁撴'){
+      this.showToast('缁撴鍚庝笉鑳芥柊寤烘柟妗�','error');
+      this.dispatchEvent(new CloseActionScreenEvent());
+    }else if(this.status == '01鑽夋涓�' || this.status == '02闇�姹傚凡鎻愪氦'){
+    }else if(!this.girWindowDirectorApproved){
+      this.showToast('椤圭洰闇�姹傝繕鏈�氳繃瀹℃壒涓嶈兘鏂板缓鏂规','error');
+      this.dispatchEvent(new CloseActionScreenEvent());
+    }else{
+      const defaultValues = encodeDefaultFieldValues({
+        SolutionProjectRequirements__c: this.recordId == undefined ? '' : this.recordId,
+        Business_Promotion__c: this.hospitalOwnerId == undefined ? '' : this.hospitalOwnerId
+      });
+      this[NavigationMixin.Navigate]({
+          type: 'standard__objectPage',
+          attributes: {
+              objectApiName: 'Solution_Programme__c',
+              actionName: 'new'
+          },
+          state: {
+              nooverride: '1',
+              defaultFieldValues: defaultValues
+          
+          }
+      });
+      this.dispatchEvent(new CloseActionScreenEvent());
+    }
+  }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js-meta.xml b/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js-meta.xml
new file mode 100644
index 0000000..c307012
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+     <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</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/lexNewSolutonPro/lexNewSolutonPro.js b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js
index 61d3127..4935a13 100644
--- a/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js
+++ b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js
@@ -4,9 +4,16 @@
  * @Author: chen jing wu
  * @Date: 2023-06-25 13:21:05
  * @LastEditors: chen jing wu
- * @LastEditTime: 2023-06-25 17:18:27
+ * @LastEditTime: 2023-06-26 09:15:15
  */
-import { api, wire,LightningElement } from 'lwc';
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-06-25 13:21:05
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-06-26 09:07:52
+ */import { api, wire,LightningElement } from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
 import init  from '@salesforce/apex/lexAccountController.initForNewSolutonProButton';
@@ -14,11 +21,12 @@
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import LightningConfirm from 'lightning/confirm';
 import SolutionHBLabel from '@salesforce/label/c.Solution_HB';
-import SolutionHBLabel from '@salesforce/label/c.Solution_DB';
-import SolutionHBLabel from '@salesforce/label/c.Solution_XB';
-import SolutionHBLabel from '@salesforce/label/c.Solution_XN';
-import SolutionHBLabel from '@salesforce/label/c.Solution_HD';
-import SolutionHBLabel from '@salesforce/label/c.Solution_HN';
+import SolutionDBLabel from '@salesforce/label/c.Solution_DB';
+import SolutionXBLabel from '@salesforce/label/c.Solution_XB';
+import SolutionXNLabel from '@salesforce/label/c.Solution_XN';
+import SolutionHDLabel from '@salesforce/label/c.Solution_HD';
+import SolutionHNLabel from '@salesforce/label/c.Solution_HN';
+
 export default class LexNewSolutonPro extends LightningElement {
     @api accountId;
     hospitalSalesdepartmentHP;
@@ -53,17 +61,17 @@
 
     newSolutonPro(){
         if(this.hospitalSalesdepartmentHP == '1.鍗庡寳'){
-            this.salesAssistant = $A.get("$Label.");
+            this.salesAssistant = SolutionHBLabel;
         }else if(this.hospitalSalesdepartmentHP == '2.涓滃寳'){
-            this.salesAssistant = $A.get("$Label.c.");
+            this.salesAssistant = SolutionDBLabel;
         }else if(this.hospitalSalesdepartmentHP == '3.瑗垮寳'){
-            this.salesAssistant = $A.get("$Label.c.");
+            this.salesAssistant = SolutionXBLabel;
         }else if(this.hospitalSalesdepartmentHP == '4.瑗垮崡'){
-            this.salesAssistant = $A.get("$Label.c.");
+            this.salesAssistant = SolutionXNLabel;
         }else if(this.hospitalSalesdepartmentHP == '5.鍗庝笢'){
-            this.salesAssistant = $A.get("$Label.c.");
+            this.salesAssistant = SolutionHDLabel;
         }else if(this.hospitalSalesdepartmentHP == '6.鍗庡崡'){
-            this.salesAssistant = $A.get("$Label.c.");
+            this.salesAssistant = SolutionHNLabel;
         }else{
             this.salesAssistant = '';
         }
diff --git a/force-app/main/default/lwc/lexNewSolutonProLwc/__tests__/lexNewSolutonProLwc.test.js b/force-app/main/default/lwc/lexNewSolutonProLwc/__tests__/lexNewSolutonProLwc.test.js
new file mode 100644
index 0000000..cdf2e3b
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonProLwc/__tests__/lexNewSolutonProLwc.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexNewSolutonProLwc from 'c/lexNewSolutonProLwc';
+
+describe('c-lex-new-soluton-pro-lwc', () => {
+    afterEach(() => {
+        // The jsdom instance is shared across test cases in a single file so reset the DOM
+        while (document.body.firstChild) {
+            document.body.removeChild(document.body.firstChild);
+        }
+    });
+
+    it('TODO: test case generated by CLI command, please fill in test logic', () => {
+        // Arrange
+        const element = createElement('c-lex-new-soluton-pro-lwc', {
+            is: LexNewSolutonProLwc
+        });
+
+        // Act
+        document.body.appendChild(element);
+
+        // Assert
+        // const div = element.shadowRoot.querySelector('div');
+        expect(1).toBe(1);
+    });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.html b/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.html
new file mode 100644
index 0000000..a2756d8
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.html
@@ -0,0 +1,13 @@
+<!--
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-06-26 09:14:47
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-06-26 09:15:04
+-->
+<template>
+    <div class="baseholder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js b/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js
new file mode 100644
index 0000000..0b84430
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js
@@ -0,0 +1,84 @@
+import { api, wire,LightningElement } from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/lexAccountController.initForNewSolutonProButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import LightningConfirm from 'lightning/confirm';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import SolutionHBLabel from '@salesforce/label/c.Solution_HB';
+import SolutionDBLabel from '@salesforce/label/c.Solution_DB';
+import SolutionXBLabel from '@salesforce/label/c.Solution_XB';
+import SolutionXNLabel from '@salesforce/label/c.Solution_XN';
+import SolutionHDLabel from '@salesforce/label/c.Solution_HD';
+import SolutionHNLabel from '@salesforce/label/c.Solution_HN';
+
+export default class LexNewSolutonProLwc extends NavigationMixin(LightningElement) {
+    @api accountId;
+    hospitalSalesdepartmentHP;
+    hospitalId;
+    hospitalOCMCategory;
+    salesAssistant;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+            console.log(111);
+            console.log(currentPageReference);
+
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.accountId = str;
+          }
+        }
+    }
+    connectedCallback(){
+        init({
+            recordId: this.accountId
+        }).then(result=>{
+            this.hospitalId = result.hospitalId;
+            this.hospitalOCMCategory = result.hospitalOCMCategory;
+            this.hospitalSalesdepartmentHP = result.hospitalSalesdepartmentHP;
+            this.newSolutonPro();
+        });
+    }
+
+    newSolutonPro(){
+        if(this.hospitalSalesdepartmentHP == '1.鍗庡寳'){
+            this.salesAssistant = SolutionHBLabel;
+        }else if(this.hospitalSalesdepartmentHP == '2.涓滃寳'){
+            this.salesAssistant = SolutionDBLabel;
+        }else if(this.hospitalSalesdepartmentHP == '3.瑗垮寳'){
+            this.salesAssistant = SolutionXBLabel;
+        }else if(this.hospitalSalesdepartmentHP == '4.瑗垮崡'){
+            this.salesAssistant = SolutionXNLabel;
+        }else if(this.hospitalSalesdepartmentHP == '5.鍗庝笢'){
+            this.salesAssistant = SolutionHDLabel;
+        }else if(this.hospitalSalesdepartmentHP == '6.鍗庡崡'){
+            this.salesAssistant = SolutionHNLabel;
+        }else{
+            this.salesAssistant = '';
+        }
+        const defaultValues = encodeDefaultFieldValues({
+            Hospital__c: this.hospitalId == undefined ? '' : this.hospitalId,
+            Department_Class__c: this.accountId == undefined ? '' : this.accountId,
+            Sales_Assistant__c: this.salesAssistant == undefined ? '' : this.salesAssistant
+        });
+        this[NavigationMixin.Navigate]({
+            type: 'standard__objectPage',
+            attributes: {
+                objectApiName: 'SolutionProjectRequirements__c',
+                actionName: 'new'
+            },
+            state: {
+                nooverride: '1',
+                defaultFieldValues: defaultValues
+            
+            }
+        });
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js-meta.xml b/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js-meta.xml
new file mode 100644
index 0000000..c307012
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonProLwc/lexNewSolutonProLwc.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+     <apiVersion>54.0</apiVersion>
+	<isExposed>true</isExposed>
+	<targets>
+		<target>lightning__RecordPage</target>
+		<target>lightning__AppPage</target>
+		<target>lightning__HomePage</target>
+		<target>lightning__RecordAction</target>
+	</targets>
+</LightningComponentBundle>
\ No newline at end of file

--
Gitblit v1.9.1