From 5f8c97f8716088019ad9a0302c5dea461bc668b1 Mon Sep 17 00:00:00 2001
From: zhangzhengmei <zhangzhengmei@prec-tech.com>
Date: 星期一, 07 八月 2023 15:35:56 +0800
Subject: [PATCH] CIC相关按钮

---
 force-app/main/default/lwc/lexCustomClone/lexCustomClone.js |   45 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/force-app/main/default/lwc/lexCustomClone/lexCustomClone.js b/force-app/main/default/lwc/lexCustomClone/lexCustomClone.js
index 8e437bd..9280a1d 100644
--- a/force-app/main/default/lwc/lexCustomClone/lexCustomClone.js
+++ b/force-app/main/default/lwc/lexCustomClone/lexCustomClone.js
@@ -3,15 +3,17 @@
 import { CloseActionScreenEvent } from 'lightning/actions';
 import { NavigationMixin } from 'lightning/navigation';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import init  from '@salesforce/apex/CaseController.initForlexCustomCloneButton';
-import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
-import { updateRecord } from 'lightning/uiRecordApi';
+// import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
+import init from '@salesforce/apex/LexCICInputSolutionController.initCustomClone';
+
+// import { updateRecord } from 'lightning/uiRecordApi';
 
 export default class lexCustomClone extends LightningElement {
 	@api recordId;
 	IsLoading = true;
 	inquirydetail;
 	answerdetailcontent;
+    RecordType;
 
 	@wire(CurrentPageReference)
      getStateParameters(currentPageReference) {
@@ -34,16 +36,39 @@
             recordId: this.recordId
         }).then(result => {
             this.IsLoading = false;
-            this.inquirydetail = result.inquirydetail;
-            this.answerdetailcontent = result.answerdetailcontent;
-            var url = "/500/e?retURL="+this.recordId+"&RecordType=01210000000QsYp&ent=Case"+
-						"&00N10000003M4vA="+this.inquirydetail+
-						"&00N10000003M4v8="+this.answerdetailcontent;
-            window.open(url);
+            if (result != null) {
+                console.log(result);
+                this.initData = result;
+                if(result !=null) {
+                    if(result.caseList.length>0) {
+                        this.inquirydetail = result.caseList[0].inquiry_detail__c;
+                        this.answerdetailcontent = result.caseList[0].answer_detail_content__c;
+                    }
+                    this.RecordType = result.caseRecordType;                   
+                }
+            }
+            this.cancelSubmit().then(res=>{
+                this.IsLoading=false;
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }); 
+      //       var url = "/500/e?retURL="+this.recordId+"&RecordType=01210000000QsYp&ent=Case"+
+						// "&00N10000003M4vA="+this.inquirydetail+
+						// "&00N10000003M4v8="+this.answerdetailcontent;
+      //       window.open(url);
         }).catch(error => {
             console.log('error='+error);
         }).finally(() => {
             
         }); 
+       
     }
-}
\ No newline at end of file
+    async cancelSubmit(){
+        // window.open('/apex/NewAndEditCase?retURL='+this.recordId+'&RecordType='+this.RecordType+'&inquiry_detail__c='+this.inquirydetail+'&answer_detail_content__c='+this.answerdetailcontent);
+        window.open('/apex/NewAndEditCase?retURL='+this.recordId+'&RecordType='+this.RecordType+'&inquiry_detail__c='+this.inquirydetail+'&answer_detail_content__c='+this.answerdetailcontent);
+    }
+}
+
+//oldjs
+// /500/e?retURL={!Case.Id}&RecordType=01210000000QsYp&ent=Case
+// &00N10000003M4vA={!HTMLENCODE(Case.inquiry_detail__c)}
+// &00N10000003M4v8={!HTMLENCODE(Case.answer_detail_content__c)}
\ No newline at end of file

--
Gitblit v1.9.1