From 9df794909328c58b92fa4ab62c846ec73e9304ea Mon Sep 17 00:00:00 2001
From: liwentao <1376563863@qq.com>
Date: 星期四, 25 五月 2023 17:04:28 +0800
Subject: [PATCH] 营业: SI项目需求表-按钮:终止SI需求表(lexSIAbortBtn)新建SI需求表(lexNewSICustomNew) 学会・培训-按钮:学会培训PDF报告(lexBTReport)

---
 force-app/main/default/classes/LexBTReportController.cls                   |   17 +
 force-app/main/default/lwc/lexBTReport/lexBTReport.js-meta.xml             |   11 +
 force-app/main/default/classes/LexNewSICustomNewController.cls             |   49 ++++
 force-app/main/default/classes/LexNewSICustomNewController.cls-meta.xml    |    5 
 force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js-meta.xml         |   18 +
 force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp-meta.xml   |    5 
 force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js          |   64 ++++++
 force-app/main/default/classes/LexBTReportController.cls-meta.xml          |    5 
 force-app/main/default/lwc/lexBTReport/lexBTReport.html                    |    6 
 force-app/main/default/classes/LexSIAbortBtnController.cls-meta.xml        |    5 
 force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.css                 |   22 ++
 force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp            |    8 
 force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.html                |   29 ++
 force-app/main/default/lwc/lexBTReport/lexBTReport.js                      |   62 ++++++
 force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js                  |  102 ++++++++++
 force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.css         |   22 ++
 force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.html        |   29 ++
 force-app/main/default/classes/LexSIAbortBtnController.cls                 |   55 +++++
 force-app/main/default/lwc/lexBTReport/lexBTReport.css                     |   12 +
 force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js-meta.xml |   17 +
 20 files changed, 543 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp b/force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp
new file mode 100644
index 0000000..8728a21
--- /dev/null
+++ b/force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp
@@ -0,0 +1,8 @@
+<aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global"> 
+    <aura:attribute name="recordId" type="String" />
+    <aura:handler name="render" value="{!this}"  action="{!c.closeModal}" />
+    <aura:attribute name="isDoneRendering" type="Boolean" default="false"/>
+    <div class="exampleHolder">
+        <c:lexBTReport recordId="{!v.recordId}" />
+    </div>
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp-meta.xml b/force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp-meta.xml
new file mode 100644
index 0000000..632b900
--- /dev/null
+++ b/force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <apiVersion>54.0</apiVersion>
+    <description>A Lightning Component Bundle</description>
+</AuraDefinitionBundle>
diff --git a/force-app/main/default/classes/LexBTReportController.cls b/force-app/main/default/classes/LexBTReportController.cls
new file mode 100644
index 0000000..e7d49de
--- /dev/null
+++ b/force-app/main/default/classes/LexBTReportController.cls
@@ -0,0 +1,17 @@
+public with sharing class LexBTReportController {
+    public LexBTReportController() {
+        
+    }
+
+    @AuraEnabled
+    public static String init(String recordId){
+    	try {
+    	    Campaign c=[select CampaignStatus__c from Campaign where id = :recordId];
+    	    return c.CampaignStatus__c;
+    	}
+    	catch (Exception e) {
+    	    System.debug('LexBTReportController init error:'+e.getMessage());
+    	}
+    	return null;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexBTReportController.cls-meta.xml b/force-app/main/default/classes/LexBTReportController.cls-meta.xml
new file mode 100644
index 0000000..70f89f4
--- /dev/null
+++ b/force-app/main/default/classes/LexBTReportController.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>
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexNewSICustomNewController.cls b/force-app/main/default/classes/LexNewSICustomNewController.cls
new file mode 100644
index 0000000..445f656
--- /dev/null
+++ b/force-app/main/default/classes/LexNewSICustomNewController.cls
@@ -0,0 +1,49 @@
+public with sharing class LexNewSICustomNewController {
+    public LexNewSICustomNewController() {
+        
+    }
+    @AuraEnabled
+    public static Opportunity init(String recordId){
+    	try{
+    		Opportunity res=[select RecordTypeId
+    		 from Opportunity
+    		 where id= :recordId ];
+    		return res;
+    	}catch(Exception e){
+    		System.debug('LexStockCancelController init error: '+e.getMessage());
+    	}
+    	return null;
+    }
+    @AuraEnabled
+    public static List<IS_Opportunity_Demand__c> getISOPList(String recordId){
+    	try{
+    		List<IS_Opportunity_Demand__c> res=[select id
+    		 from IS_Opportunity_Demand__c
+    		 where Opportunity_ID__c= :recordId and Func_SOD_Status__c !='00 宸茬粓姝�'];
+    		return res;
+    	}catch(Exception e){
+    		System.debug('LexStockCancelController init error: '+e.getMessage());
+    	}
+    	return null;
+    }
+
+    @AuraEnabled
+    public static String getProfileName(String recordId){
+    	try{
+    		String id=UserInfo.getProfileId();
+    		Profile p=[select name from Profile where id =:id];
+    		
+    		return p.name.subString(0,2);
+    	}catch(Exception e){
+    		System.debug('LexStockCancelController init error: '+e.getMessage());
+    	}
+    	return null;
+    }
+
+    public class InitData{
+        @AuraEnabled
+        public String id;
+        @AuraEnabled
+        public Boolean delFlag;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexNewSICustomNewController.cls-meta.xml b/force-app/main/default/classes/LexNewSICustomNewController.cls-meta.xml
new file mode 100644
index 0000000..70f89f4
--- /dev/null
+++ b/force-app/main/default/classes/LexNewSICustomNewController.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>
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSIAbortBtnController.cls b/force-app/main/default/classes/LexSIAbortBtnController.cls
new file mode 100644
index 0000000..9de9933
--- /dev/null
+++ b/force-app/main/default/classes/LexSIAbortBtnController.cls
@@ -0,0 +1,55 @@
+public with sharing class LexSIAbortBtnController {
+    public LexSIAbortBtnController() {
+        
+    }
+
+    @AuraEnabled
+    public static Boolean init(String recordId){
+    	try{
+    		Opportunity i=[select Estimation_Decision__c from Opportunity where id = :recordId];
+    		return i.Estimation_Decision__c;
+    	}catch(Exception e){
+    		System.debug('LexSIAbortBtnController init error: '+e.getMessage());
+    	}
+    	return null;
+    }
+
+
+    @AuraEnabled
+    public static String setAbortSI(String isoID,String AbortReason){
+        List<IS_Opportunity_Demand__c> updateList = new List<IS_Opportunity_Demand__c>();
+        List<id> oppidList = new List<id>();
+        List<Opportunity> Opplist = new List<Opportunity>();
+        if(AbortReason==null||String.isBlank(AbortReason)){
+            return '璇疯緭鍏ョ粓姝I闇�姹傚師鍥�';
+        }else{
+            updateList = [SELECT id,Abort_SI_Reason__c,Abort_Date__c,Opportunity_ID__c from IS_Opportunity_Demand__c where id = :isoID];
+            for(IS_Opportunity_Demand__c iso : updateList){
+                iso.Abort_SI_Reason__c = AbortReason;
+                iso.Abort_Date__c = Date.today();
+                oppidList.add(iso.Opportunity_ID__c);
+            }
+            Opplist = [SELECT Project_decide_date__c , Stock_Submit_Date__c , Stock_Confrim_Date__c from Opportunity WHERE id in:oppidList];
+            for(Opportunity ops : Opplist){
+                ops.Project_decide_date__c = null;
+                ops.Stock_Submit_Date__c = null;
+                ops.Stock_Confrim_Date__c = null;
+            }
+            Savepoint sp = Database.setSavepoint();
+            try{
+                update Opplist;
+                update updateList;
+                return 'Fin';
+            }catch (Exception o){
+                Database.rollback(sp);
+                return 'DataBase is Crashed,Connect with the Developer PLEASE';
+            }
+        }
+    }
+    public class InitData{
+        @AuraEnabled
+        public String id;
+        @AuraEnabled
+        public Boolean delFlag;
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/LexSIAbortBtnController.cls-meta.xml b/force-app/main/default/classes/LexSIAbortBtnController.cls-meta.xml
new file mode 100644
index 0000000..70f89f4
--- /dev/null
+++ b/force-app/main/default/classes/LexSIAbortBtnController.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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBTReport/lexBTReport.css b/force-app/main/default/lwc/lexBTReport/lexBTReport.css
new file mode 100644
index 0000000..426333e
--- /dev/null
+++ b/force-app/main/default/lwc/lexBTReport/lexBTReport.css
@@ -0,0 +1,12 @@
+.exampleHolder{
+    position: relative;
+    top: 0;
+    width: 0;
+    left: 0;
+    right: 0;
+    margin: 0 auto;
+}
+
+.uiContainerManager {
+    display:none;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexBTReport/lexBTReport.html b/force-app/main/default/lwc/lexBTReport/lexBTReport.html
new file mode 100644
index 0000000..24369b4
--- /dev/null
+++ b/force-app/main/default/lwc/lexBTReport/lexBTReport.html
@@ -0,0 +1,6 @@
+<template>
+<!--     <div class="cancelHolder" 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/lexBTReport/lexBTReport.js b/force-app/main/default/lwc/lexBTReport/lexBTReport.js
new file mode 100644
index 0000000..918bbda
--- /dev/null
+++ b/force-app/main/default/lwc/lexBTReport/lexBTReport.js
@@ -0,0 +1,62 @@
+
+
+import { LightningElement, api , track, wire } from 'lwc';
+
+import { CurrentPageReference } from "lightning/navigation";
+import { getRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init from '@salesforce/apex/LexBTReportController.init';
+
+export default class lexBTReport extends LightningElement {
+
+	@api recordId;
+    Status;
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+          const urlValue = currentPageReference.state.recordId;
+          if (urlValue) {
+            let str = `${urlValue}`;
+            console.log("str");
+            console.log(str);
+            this.recordId = str;
+          }
+        }
+    }
+
+
+
+    
+	connectedCallback(){
+		console.log(this.recordId);
+		init({recordId:this.recordId}).then(result=>{
+			console.log(result);
+			if(result!=null){
+				this.Status=result;
+				this.main().then(res=>{
+					this.dispatchEvent(new CloseActionScreenEvent());
+				});	
+			}
+		}).catch(err=>{
+			console.log("error:");
+			console.log(err);
+		}).finally(()=>{
+
+		});
+	}
+	main(){
+		if (this.Status =='浼氳缁撴潫'){
+			window.open('/apex/CampaignBTPDF?id='+this.recordId, 'CampaignBTPDF');
+		} else {
+			const event = new ShowToastEvent({
+	            title: '鎻愮ず淇℃伅',
+	            message:'浼氳缁撴潫涔嬪悗鍙煡鐪嬶紒'
+            });
+	        this.dispatchEvent(event);
+		}
+	}
+
+}
+
+
+
diff --git a/force-app/main/default/lwc/lexBTReport/lexBTReport.js-meta.xml b/force-app/main/default/lwc/lexBTReport/lexBTReport.js-meta.xml
new file mode 100644
index 0000000..6e6e94a
--- /dev/null
+++ b/force-app/main/default/lwc/lexBTReport/lexBTReport.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexBTReport">
+    <apiVersion>51.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/lexNewSICustomNew/lexNewSICustomNew.css b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.css
new file mode 100644
index 0000000..95c1c55
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.css
@@ -0,0 +1,22 @@
+.holder{
+	position: relative;
+	display: inline-block;
+	width: 80px;
+	height: 80px;
+	text-align: center;
+}
+
+.container .uiContainerManager{
+	display : none !important;
+}
+.toast{
+	border: 1px solid #c9c9c9;
+	border-radius: 10px; 
+	width: 50%;
+	margin: 0 auto;
+	font-size: 18px;
+	font-weight: bold;
+	padding: 10px 20px;
+	background: #feb75d;
+	display: flex;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.html b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.html
new file mode 100644
index 0000000..b690487
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.html
@@ -0,0 +1,29 @@
+<template>
+	<div class="holder" if:true={IsLoading}>
+	    <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+	</div>
+	<div if:false={IsLoading} class="toast">
+		<span style="padding: 10px;">{msg}</span>
+		<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;">
+                <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small"
+                    title="Close"  style="color: black;"></lightning-icon>
+              <span class="slds-assistive-text">Close</span>
+        </button>
+		<!-- <lightning:icon iconName="utility:warning" alternativeText="Warning!" title="Warning" /> -->
+	</div>
+	<!-- <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" if:false={IsLoading}>
+	    <div class="slds-modal__container">
+	        <header class="slds-modal__header" style="color: black;">
+	            <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">璇烽�夋嫨鍊熷嚭澶囧搧涓�瑙堣褰�</h2>
+	        </header>
+
+	         <div style="height: 100px;">
+                        <div class="rewardDetailsTitle">Details</div>
+             </div>
+	    
+	        <footer class="slds-modal__footer">
+	             <lightning-button variant="brand" label="纭畾" class="slds-var-m-left_x-small" onclick={handleSubmit}></lightning-button>
+	        </footer>
+	    </div>
+    </section> -->
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js
new file mode 100644
index 0000000..38e2087
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js
@@ -0,0 +1,64 @@
+import { LightningElement,api, track, wire } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+import init from '@salesforce/apex/LexNewSICustomNewController.init';
+import getISOPList from '@salesforce/apex/LexNewSICustomNewController.getISOPList';
+import getProfileName from '@salesforce/apex/LexNewSICustomNewController.getProfileName';
+
+export default class lexNewSICustomNew extends NavigationMixin(LightningElement) {
+	@api recordId;
+	
+    IsLoading=true;
+    //鎻愮ず淇℃伅
+    msg;
+    hasError;
+    records;
+    recordTypeId;
+	async connectedCallback(){
+		console.log(this.recordId);
+		await init({recordId:this.recordId}).then(res=>{
+			console.log(1);
+			console.log(res);
+			this.recordTypeId=res.RecordTypeId;
+			this.main().then(res=>{
+				this.IsLoading=false;
+				if(this.msg==''){
+
+					this.dispatchEvent(new CloseActionScreenEvent());
+					this.closeAction();
+				}
+				
+			})
+		})
+
+	}
+
+	async main(){
+		console.log("in main");
+		var records = new Array();
+		if(this.recordTypeId=='012100000006KMeAAM'){
+			records = await getISOPList({recordId:this.recordId});
+		}
+		var RecordTypeid = this.recordTypeId;
+		if(RecordTypeid=='012100000006KMeAAM'&&records.length!=0){
+			// alert("瀛樺湪宸叉湁鐨凷I闇�姹傝〃锛屼笉鑳芥柊寤篠I闇�姹傝〃");
+			this.msg="瀛樺湪宸叉湁鐨凷I闇�姹傝〃锛屼笉鑳芥柊寤篠I闇�姹傝〃";
+		}else if(await getProfileName() !='2S'){
+		// 娣诲姞鏂板缓闇�姹傝〃鐨勯檺鍒�
+
+			// alert("闈炶惀涓氶儴浜哄憳涓嶈兘鍒涘缓闇�姹傝〃");
+			this.msg="闈炶惀涓氶儴浜哄憳涓嶈兘鍒涘缓闇�姹傝〃";
+		}else if(RecordTypeid!='012100000006KMeAAM'){
+			// alert("闈濻I璇环锛屼笉鑳芥柊寤篠I闇�姹傝〃");
+			this.msg="闈濻I璇环锛屼笉鑳芥柊寤篠I闇�姹傝〃";
+		} else if(RecordTypeid=='012100000006KMeAAM'&&records.length==0){
+			window.top.location.href="/apex/ISO_DemandOperAndDemonsNew?OppoerID="+this.recordId;
+		}
+	}
+    closeAction() {
+	    //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+		window.open("/"+this.recordId,'_self');
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js-meta.xml b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js-meta.xml
new file mode 100644
index 0000000..63a0f14
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js-meta.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexNewSICustomNew">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+        <target>lightning__FlowScreen</target>
+    </targets>
+    <targetConfigs>
+        <targetConfig targets="lightning__FlowScreen">
+            <property name="recordId" type="String" label="recordId"/>
+        </targetConfig>
+    </targetConfigs>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.css b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.css
new file mode 100644
index 0000000..95c1c55
--- /dev/null
+++ b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.css
@@ -0,0 +1,22 @@
+.holder{
+	position: relative;
+	display: inline-block;
+	width: 80px;
+	height: 80px;
+	text-align: center;
+}
+
+.container .uiContainerManager{
+	display : none !important;
+}
+.toast{
+	border: 1px solid #c9c9c9;
+	border-radius: 10px; 
+	width: 50%;
+	margin: 0 auto;
+	font-size: 18px;
+	font-weight: bold;
+	padding: 10px 20px;
+	background: #feb75d;
+	display: flex;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.html b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.html
new file mode 100644
index 0000000..b690487
--- /dev/null
+++ b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.html
@@ -0,0 +1,29 @@
+<template>
+	<div class="holder" if:true={IsLoading}>
+	    <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+	</div>
+	<div if:false={IsLoading} class="toast">
+		<span style="padding: 10px;">{msg}</span>
+		<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;">
+                <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small"
+                    title="Close"  style="color: black;"></lightning-icon>
+              <span class="slds-assistive-text">Close</span>
+        </button>
+		<!-- <lightning:icon iconName="utility:warning" alternativeText="Warning!" title="Warning" /> -->
+	</div>
+	<!-- <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" if:false={IsLoading}>
+	    <div class="slds-modal__container">
+	        <header class="slds-modal__header" style="color: black;">
+	            <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">璇烽�夋嫨鍊熷嚭澶囧搧涓�瑙堣褰�</h2>
+	        </header>
+
+	         <div style="height: 100px;">
+                        <div class="rewardDetailsTitle">Details</div>
+             </div>
+	    
+	        <footer class="slds-modal__footer">
+	             <lightning-button variant="brand" label="纭畾" class="slds-var-m-left_x-small" onclick={handleSubmit}></lightning-button>
+	        </footer>
+	    </div>
+    </section> -->
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js
new file mode 100644
index 0000000..9c3fec8
--- /dev/null
+++ b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js
@@ -0,0 +1,102 @@
+import { LightningElement,api, track, wire } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+import init from '@salesforce/apex/LexSIAbortBtnController.init';
+import setAbortSI from '@salesforce/apex/LexSIAbortBtnController.setAbortSI';
+import LightningPrompt from 'lightning/prompt'; 
+//SI椤圭洰闇�姹傝〃 缁堟SI闇�姹傝〃
+export default class lexSIAbortBtn extends NavigationMixin(LightningElement) {
+	@api recordId;
+	
+	@api rentalApplyIds;
+    IsLoading=true;
+    //鎻愮ず淇℃伅
+    msg;
+    hasError;
+    rentalApplyIds;
+    decideFLG;
+	connectedCallback(){
+		init({recordId:this.recordId}).then(res=>{
+			console.log(1);
+			console.log(res);
+			this.decideFLG=res;
+			this.main().then(res=>{
+				this.IsLoading=false;
+				
+				if(this.msg==""){
+					this.dispatchEvent(new CloseActionScreenEvent());
+					this.closeAction();
+				}
+				
+			})
+		})
+	}
+
+	async main(){
+		// let rentalApplyIds = {!GETRECORDIDS($ObjectType.IS_Opportunity_Demand__c)};
+		// //alert(rentalApplyIds );
+		// let decideFLG ='{!Opportunity.Estimation_Decision__c}';
+		let hasError ='0';
+		let decideFLG=this.decideFLG;
+		let str;
+		if(decideFLG ==true){
+			// alert('鎶ヤ环宸插喅瀹氾紝涓嶈兘缁堟');
+			this.msg="鎶ヤ环宸插喅瀹氾紝涓嶈兘缁堟";
+			hasError ='1';
+		}else{
+			// str=prompt("璇疯緭鍏ョ粓姝㈢悊鐢�"," ");
+			await LightningPrompt.open({
+	            message: '璇疯緭鍏ョ粓姝㈢悊鐢�',
+	            //theme defaults to "default"
+	            label: '', // this is the header text
+	            defaultValue: '', //this is optional
+	        }).then((result) => {
+	            str=result;
+	        });
+		}
+		if (this.rentalApplyIds.length == 0) {
+			// alert("璇烽�夋嫨涓�涓渶姹傝〃銆�");
+			this.msg="璇烽�夋嫨涓�涓渶姹傝〃銆�";
+			hasError = '1';
+		} else if (this.rentalApplyIds.length > 1) {
+			// alert("鍙兘閫夋嫨涓�涓渶姹傝〃銆�");
+			this.msg="鍙兘閫夋嫨涓�涓渶姹傝〃銆�";
+			hasError = '1';
+		}
+		console.log("ttt1");
+		let ids= '';
+		if (hasError == '0') {
+			ids+= this.rentalApplyIds[0];
+			let id = this.rentalApplyIds[0];
+			try{
+				console.log("ttt1.1");
+				let rtn='Fin';
+				await setAbortSI({isoID:ids,AbortReason:str}).then(res=>{
+					rtn=res;
+				});
+				console.log(rtn);
+				console.log("ttt1.2");
+				if(rtn!='Fin'){
+					// alert(rtn);
+					this.msg=rtn;
+					console.log("ttt2");
+				}else{
+					this.msg='';
+					// window.top.location.reload();
+					console.log("ttt3");
+				}
+			}catch(e){
+				// alert(e);
+				console.log(e.message);
+				this.msg=e;
+				console.log("ttt4");
+			}
+		}
+	}
+	closeAction() {
+	    //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+		window.open("/"+this.recordId,'_self');
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js-meta.xml b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js-meta.xml
new file mode 100644
index 0000000..9befdc9
--- /dev/null
+++ b/force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js-meta.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexSIAbortBtn">
+    <apiVersion>51.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__AppPage</target>
+        <target>lightning__RecordPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+        <target>lightning__FlowScreen</target>
+    </targets>
+    <targetConfigs>
+        <targetConfig targets="lightning__FlowScreen">
+            <property name="recordId" type="String" label="recordId"/>
+            <property name="rentalApplyIds" type="String[]" label="rentalApplyIds"/>
+        </targetConfig>
+    </targetConfigs>
+</LightningComponentBundle>
\ No newline at end of file

--
Gitblit v1.9.1