From 2e0d3ce9c4f69d2edff19b3c220ae4da94dcb72c Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 31 七月 2023 15:41:15 +0800
Subject: [PATCH] 修改按钮7.31

---
 force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.html              |    5 
 force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js                  |   65 ++++
 force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js-meta.xml       |   11 
 force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.html                |   13 
 force-app/main/default/lwc/lexDepartmentCreateGI/__tests__/lexDepartmentCreateGI.test.js   |   25 +
 force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js                  |   65 ++++
 force-app/main/default/classes/lexLightingButtonConstant.cls                               |   16 +
 force-app/main/default/lwc/lexDepartmentCreateENT/__tests__/lexDepartmentCreateENT.test.js |   25 +
 force-app/main/default/lwc/lexDepartmentCreateGYN/__tests__/lexDepartmentCreateGYN.test.js |   25 +
 force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js-meta.xml       |   11 
 force-app/main/default/lwc/lexDepartmentCreateGS/__tests__/lexDepartmentCreateGS.test.js   |   25 +
 force-app/main/default/classes/lexAccountController.cls-meta.xml                           |    2 
 force-app/main/default/lwc/lexRepairContact/__tests__/lexRepairContact.test.js             |   25 +
 force-app/main/default/lwc/lexRepairContact/lexRepairContact.js                            |   59 +++
 force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js-meta.xml         |   11 
 force-app/main/default/lwc/lexDepartmentCreateOTH/__tests__/lexDepartmentCreateOTH.test.js |   25 +
 force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.html              |    5 
 force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js-meta.xml         |   11 
 force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js                  |   57 +++
 force-app/main/default/lwc/lexDepartmentCreateBF/__tests__/lexDepartmentCreateBF.test.js   |   25 +
 force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js                |   57 +++
 force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js                |   65 ++++
 force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js-meta.xml       |   11 
 force-app/main/default/lwc/lexRepairContact/lexRepairContact.js-meta.xml                   |   11 
 force-app/main/default/classes/lexAccountController.cls                                    |   46 ++
 force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js                |   65 ++++
 force-app/main/default/lwc/lexDepartmentCreateURO/__tests__/lexDepartmentCreateURO.test.js |   25 +
 force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.html                |    5 
 force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js-meta.xml       |   11 
 force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js                |   65 ++++
 force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.html              |    5 
 force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.html                |    5 
 force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.html              |    5 
 force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js-meta.xml         |   11 
 force-app/main/default/lwc/lexRepairContact/lexRepairContact.html                          |   13 
 35 files changed, 905 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/lexAccountController.cls b/force-app/main/default/classes/lexAccountController.cls
index ac41d3b..fbf2d82 100644
--- a/force-app/main/default/classes/lexAccountController.cls
+++ b/force-app/main/default/classes/lexAccountController.cls
@@ -29,6 +29,50 @@
         }
         return res;
     }
+
+    @AuraEnabled
+    public static InitData initForDepartmentCreate(String recordId,String type){
+        InitData res = new InitData();
+        try {
+            Account acc = [
+            select
+            Hospital_Department_Class__c
+            from Account where Id =: recordId
+            ];
+            res.hospitalDepartmentClass = acc.Hospital_Department_Class__c;
+            if(type == 'BF'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_BF).getRecordTypeId(); 
+            }else if(type == 'ENT'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_ENT).getRecordTypeId(); 
+            }else if(type == 'GI'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_GI).getRecordTypeId(); 
+            }else if(type == 'GS'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_GS).getRecordTypeId(); 
+            }else if(type == 'GYN'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_GYN).getRecordTypeId(); 
+            }else if(type == 'OTH'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_OTH).getRecordTypeId(); 
+            }else if(type == 'URO'){
+                res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_URO).getRecordTypeId(); 
+            }        
+         } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+         }
+         return res;
+        
+        
+    }
+
+    @AuraEnabled
+    public static InitData initForRepairContact(String recordId){
+        InitData res = new InitData();
+        try{
+            res.recordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_CON).getRecordTypeId(); 
+        }catch(Exception e){
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
     class InitData{
         @AuraEnabled
         public String hospitalSalesdepartmentHP;
@@ -38,5 +82,7 @@
         public String hospitalOCMCategory;
         @AuraEnabled
         public String recordTypeId;
+        @AuraEnabled
+        public String hospitalDepartmentClass;
     }
 }
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexAccountController.cls-meta.xml b/force-app/main/default/classes/lexAccountController.cls-meta.xml
index 45cccbd..754ecb1 100644
--- a/force-app/main/default/classes/lexAccountController.cls-meta.xml
+++ b/force-app/main/default/classes/lexAccountController.cls-meta.xml
@@ -2,4 +2,4 @@
 <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
     <apiVersion>57.0</apiVersion>
     <status>Active</status>
-</ApexClass>
\ No newline at end of file
+</ApexClass>
diff --git a/force-app/main/default/classes/lexLightingButtonConstant.cls b/force-app/main/default/classes/lexLightingButtonConstant.cls
index 9520a73..70ef7ea 100644
--- a/force-app/main/default/classes/lexLightingButtonConstant.cls
+++ b/force-app/main/default/classes/lexLightingButtonConstant.cls
@@ -95,6 +95,22 @@
       public static final String RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE = '璇环鐗规畩瀵瑰簲';
       //52 璇环娉ㄦ畫鐗规畩瀵瑰簲鐨勮褰曠被鍨嬧�樻敞娈嬬壒娈婂搴斺��
       public static final String RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE_ACH = '娉ㄦ畫鐗规畩瀵瑰簲';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 鍛煎惛绉�
+      public static final String RECORD_TYPE_NAME_BY_BF = 'Department_BF';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 鑰抽蓟鍠夌
+      public static final String RECORD_TYPE_NAME_BY_ENT = 'Department_ENT';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 娑堝寲绉�
+      public static final String RECORD_TYPE_NAME_BY_GI = 'Department_GI';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 鏅绉�
+      public static final String RECORD_TYPE_NAME_BY_GS = 'Department_GS';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 濡囩
+      public static final String RECORD_TYPE_NAME_BY_GYN = 'Department_GYN';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 鍏朵粬
+      public static final String RECORD_TYPE_NAME_BY_OTH = 'Department_OTH';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬭ê鐧傜 娉屽翱绉�
+      public static final String RECORD_TYPE_NAME_BY_URO = 'Department_URO';
+      //瀹㈡埛瀵瑰簲鐨勮褰曠被鍨嬬粡閿�鍟嗚仈绯讳汉
+      public static final String RECORD_TYPE_NAME_BY_CON = 'AgencyContact';
       //Case瀵瑰簲鐨勮褰曠被鍨嬧�榁OC鈥�
        public static final String RECORD_TYPE_NAME_BY_VOC = 'VOC';
       //鎶ヨ〃鍚嶁�樻姤浠蜂骇鍝佲��
diff --git a/force-app/main/default/lwc/lexDepartmentCreateBF/__tests__/lexDepartmentCreateBF.test.js b/force-app/main/default/lwc/lexDepartmentCreateBF/__tests__/lexDepartmentCreateBF.test.js
new file mode 100644
index 0000000..c5f0f57
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateBF/__tests__/lexDepartmentCreateBF.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateBF from 'c/lexDepartmentCreateBF';
+
+describe('c-lex-department-create-bf', () => {
+    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-department-create-bf', {
+            is: LexDepartmentCreateBF
+        });
+
+        // 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/lexDepartmentCreateBF/lexDepartmentCreateBF.html b/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.html
new file mode 100644
index 0000000..3b64547
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.html
@@ -0,0 +1,13 @@
+<!--
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-28 16:01:28
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-28 16:02:03
+-->
+<template>
+    <div class="Holder" 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/lexDepartmentCreateBF/lexDepartmentCreateBF.js b/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js
new file mode 100644
index 0000000..afb937e
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js
@@ -0,0 +1,65 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-28 16:01:28
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 10:01:47
+ */
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreateBF';
+export default class LexDepartmentCreateBF extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+			recordId: this.recordId,
+			type: 'BF'
+		}).then(result=>{
+			console.log(result);
+			this.recordTypeId = result.recordTypeId;
+			this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+			const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+		});
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateBF/lexDepartmentCreateBF.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexDepartmentCreateENT/__tests__/lexDepartmentCreateENT.test.js b/force-app/main/default/lwc/lexDepartmentCreateENT/__tests__/lexDepartmentCreateENT.test.js
new file mode 100644
index 0000000..9ef6eeb
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateENT/__tests__/lexDepartmentCreateENT.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateENT from 'c/lexDepartmentCreateENT';
+
+describe('c-lex-department-create-ent', () => {
+    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-department-create-ent', {
+            is: LexDepartmentCreateENT
+        });
+
+        // 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/lexDepartmentCreateENT/lexDepartmentCreateENT.html b/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.html
new file mode 100644
index 0000000..bf9cadc
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="Holder" 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/lexDepartmentCreateENT/lexDepartmentCreateENT.js b/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js
new file mode 100644
index 0000000..1d73cef
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js
@@ -0,0 +1,65 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-31 09:57:25
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 10:31:19
+ */
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreate';
+
+export default class LexDepartmentCreateENT extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId,
+            type: 'ENT'
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+            const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateENT/lexDepartmentCreateENT.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexDepartmentCreateGI/__tests__/lexDepartmentCreateGI.test.js b/force-app/main/default/lwc/lexDepartmentCreateGI/__tests__/lexDepartmentCreateGI.test.js
new file mode 100644
index 0000000..4895cc0
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGI/__tests__/lexDepartmentCreateGI.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateGI from 'c/lexDepartmentCreateGI';
+
+describe('c-lex-department-create-gi', () => {
+    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-department-create-gi', {
+            is: LexDepartmentCreateGI
+        });
+
+        // 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/lexDepartmentCreateGI/lexDepartmentCreateGI.html b/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.html
new file mode 100644
index 0000000..bf9cadc
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="Holder" 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/lexDepartmentCreateGI/lexDepartmentCreateGI.js b/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js
new file mode 100644
index 0000000..d7c3b33
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js
@@ -0,0 +1,57 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreate';
+
+export default class LexDepartmentCreateGI extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId,
+            type: 'GI'
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+            const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGI/lexDepartmentCreateGI.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexDepartmentCreateGS/__tests__/lexDepartmentCreateGS.test.js b/force-app/main/default/lwc/lexDepartmentCreateGS/__tests__/lexDepartmentCreateGS.test.js
new file mode 100644
index 0000000..f0548f4
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGS/__tests__/lexDepartmentCreateGS.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateGS from 'c/lexDepartmentCreateGS';
+
+describe('c-lex-department-create-gs', () => {
+    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-department-create-gs', {
+            is: LexDepartmentCreateGS
+        });
+
+        // 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/lexDepartmentCreateGS/lexDepartmentCreateGS.html b/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.html
new file mode 100644
index 0000000..bf9cadc
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="Holder" 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/lexDepartmentCreateGS/lexDepartmentCreateGS.js b/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js
new file mode 100644
index 0000000..8b26c3f
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js
@@ -0,0 +1,65 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-31 10:56:23
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 11:06:33
+ */
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreate';
+
+export default class LexDepartmentCreateGS extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId,
+            type: 'GS'
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+            const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGS/lexDepartmentCreateGS.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexDepartmentCreateGYN/__tests__/lexDepartmentCreateGYN.test.js b/force-app/main/default/lwc/lexDepartmentCreateGYN/__tests__/lexDepartmentCreateGYN.test.js
new file mode 100644
index 0000000..235a314
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGYN/__tests__/lexDepartmentCreateGYN.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateGYN from 'c/lexDepartmentCreateGYN';
+
+describe('c-lex-department-create-gyn', () => {
+    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-department-create-gyn', {
+            is: LexDepartmentCreateGYN
+        });
+
+        // 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/lexDepartmentCreateGYN/lexDepartmentCreateGYN.html b/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.html
new file mode 100644
index 0000000..bf9cadc
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="Holder" 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/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js b/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js
new file mode 100644
index 0000000..1180273
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js
@@ -0,0 +1,65 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-31 11:05:47
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 11:18:49
+ */
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreate';
+
+export default class LexDepartmentCreateGYN extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId,
+            type: 'GYN'
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+            const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateGYN/lexDepartmentCreateGYN.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexDepartmentCreateOTH/__tests__/lexDepartmentCreateOTH.test.js b/force-app/main/default/lwc/lexDepartmentCreateOTH/__tests__/lexDepartmentCreateOTH.test.js
new file mode 100644
index 0000000..d0429e9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateOTH/__tests__/lexDepartmentCreateOTH.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateOTH from 'c/lexDepartmentCreateOTH';
+
+describe('c-lex-department-create-oth', () => {
+    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-department-create-oth', {
+            is: LexDepartmentCreateOTH
+        });
+
+        // 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/lexDepartmentCreateOTH/lexDepartmentCreateOTH.html b/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.html
new file mode 100644
index 0000000..bf9cadc
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="Holder" 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/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js b/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js
new file mode 100644
index 0000000..24f9a5f
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js
@@ -0,0 +1,65 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-31 11:18:03
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 11:28:22
+ */
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreate';
+
+export default class LexDepartmentCreateOTH extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId,
+            type: 'OTH'
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+            const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateOTH/lexDepartmentCreateOTH.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexDepartmentCreateURO/__tests__/lexDepartmentCreateURO.test.js b/force-app/main/default/lwc/lexDepartmentCreateURO/__tests__/lexDepartmentCreateURO.test.js
new file mode 100644
index 0000000..6b5ae63
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateURO/__tests__/lexDepartmentCreateURO.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexDepartmentCreateURO from 'c/lexDepartmentCreateURO';
+
+describe('c-lex-department-create-uro', () => {
+    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-department-create-uro', {
+            is: LexDepartmentCreateURO
+        });
+
+        // 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/lexDepartmentCreateURO/lexDepartmentCreateURO.html b/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.html
new file mode 100644
index 0000000..5abcb96
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="Holder" 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/lexDepartmentCreateURO/lexDepartmentCreateURO.js b/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js
new file mode 100644
index 0000000..71b3692
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js
@@ -0,0 +1,57 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForDepartmentCreate';
+
+export default class LexDepartmentCreateURO extends NavigationMixin(LightningElement) {
+    @api recordId;
+    IsLoading = true;
+	recordTypeId;
+	hospitalDepartmentClass;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId,
+            type: 'URO'
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            this.hospitalDepartmentClass = result.hospitalDepartmentClass;
+            const defaultValues = encodeDefaultFieldValues({
+				Department_Class__c: this.recordId,
+				Hospital_Department_Class__c: '',
+				ParentId: this.recordId,
+				Hospital__c: this.hospitalDepartmentClass,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js-meta.xml b/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexDepartmentCreateURO/lexDepartmentCreateURO.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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/lexRepairContact/__tests__/lexRepairContact.test.js b/force-app/main/default/lwc/lexRepairContact/__tests__/lexRepairContact.test.js
new file mode 100644
index 0000000..396ef42
--- /dev/null
+++ b/force-app/main/default/lwc/lexRepairContact/__tests__/lexRepairContact.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexRepairContact from 'c/lexRepairContact';
+
+describe('c-lex-repair-contact', () => {
+    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-repair-contact', {
+            is: LexRepairContact
+        });
+
+        // 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/lexRepairContact/lexRepairContact.html b/force-app/main/default/lwc/lexRepairContact/lexRepairContact.html
new file mode 100644
index 0000000..3a2863a
--- /dev/null
+++ b/force-app/main/default/lwc/lexRepairContact/lexRepairContact.html
@@ -0,0 +1,13 @@
+<!--
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-31 11:42:00
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 11:42:37
+-->
+<template>
+    <div class="Holder" 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/lexRepairContact/lexRepairContact.js b/force-app/main/default/lwc/lexRepairContact/lexRepairContact.js
new file mode 100644
index 0000000..380acb8
--- /dev/null
+++ b/force-app/main/default/lwc/lexRepairContact/lexRepairContact.js
@@ -0,0 +1,59 @@
+/*
+ * @Description: 
+ * @version: 
+ * @Author: chen jing wu
+ * @Date: 2023-07-31 11:42:00
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-07-31 14:30:18
+ */
+import { LightningElement, track, wire, api } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+import init from '@salesforce/apex/lexAccountController.initForRepairContact';
+
+export default class LexRepairContact extends NavigationMixin(LightningElement) {
+    @api recordId;
+    recordTypeId;
+    @wire(CurrentPageReference)
+	getStateParameters(currentPageReference){
+		console.log("杩涘叆椤甸潰");
+		console.log(currentPageReference);
+		if(currentPageReference){
+			const urvalue=currentPageReference.state.recordId;
+			if(urvalue){
+				let str=`${urvalue}`;
+				console.log('str');
+				console.log(str);
+				this.recordId=str;
+			}
+		}
+	}
+    connectedCallback(){
+        init({
+            recordId: this.recordId
+        }).then(result=>{
+            this.recordTypeId = result.recordTypeId;
+            const defaultValues = encodeDefaultFieldValues({
+				AgencyContact__c: this.recordId,
+				ParentId: this.recordId,
+				Name: '*'
+			});
+			this[NavigationMixin.Navigate]({
+				type: 'standard__objectPage',
+				attributes: {
+					objectApiName: 'Account',
+					actionName: 'new'
+				},
+				state: {
+					nooverride: '1',
+					defaultFieldValues: defaultValues,
+					recordTypeId: this.recordTypeId
+				}
+			});
+			this.IsLoading = false;
+			this.dispatchEvent(new CloseActionScreenEvent());
+        });
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexRepairContact/lexRepairContact.js-meta.xml b/force-app/main/default/lwc/lexRepairContact/lexRepairContact.js-meta.xml
new file mode 100644
index 0000000..d0616f9
--- /dev/null
+++ b/force-app/main/default/lwc/lexRepairContact/lexRepairContact.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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