营业:
SI项目需求表-按钮:终止SI需求表(lexSIAbortBtn)新建SI需求表(lexNewSICustomNew)
学会・培训-按钮:学会培训PDF报告(lexBTReport)
20个文件已添加
543 ■■■■■ 已修改文件
force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexBTReportController.cls 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexBTReportController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexNewSICustomNewController.cls 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexNewSICustomNewController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSIAbortBtnController.cls 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexSIAbortBtnController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBTReport/lexBTReport.css 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBTReport/lexBTReport.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBTReport/lexBTReport.js 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexBTReport/lexBTReport.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.html 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js-meta.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.html 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js-meta.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp
New file
@@ -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>
force-app/main/default/aura/lexBTReportAura/lexBTReportAura.cmp-meta.xml
New file
@@ -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>
force-app/main/default/classes/LexBTReportController.cls
New file
@@ -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;
    }
}
force-app/main/default/classes/LexBTReportController.cls-meta.xml
New file
@@ -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>
force-app/main/default/classes/LexNewSICustomNewController.cls
New file
@@ -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;
    }
}
force-app/main/default/classes/LexNewSICustomNewController.cls-meta.xml
New file
@@ -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>
force-app/main/default/classes/LexSIAbortBtnController.cls
New file
@@ -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 '请输入终止SI需求原因';
        }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;
    }
}
force-app/main/default/classes/LexSIAbortBtnController.cls-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexBTReport/lexBTReport.css
New file
@@ -0,0 +1,12 @@
.exampleHolder{
    position: relative;
    top: 0;
    width: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
}
.uiContainerManager {
    display:none;
}
force-app/main/default/lwc/lexBTReport/lexBTReport.html
New file
@@ -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>
force-app/main/default/lwc/lexBTReport/lexBTReport.js
New file
@@ -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);
        }
    }
}
force-app/main/default/lwc/lexBTReport/lexBTReport.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.css
New file
@@ -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;
}
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.html
New file
@@ -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>
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js
New file
@@ -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("存在已有的SI需求表,不能新建SI需求表");
            this.msg="存在已有的SI需求表,不能新建SI需求表";
        }else if(await getProfileName() !='2S'){
        // 添加新建需求表的限制
            // alert("非营业部人员不能创建需求表");
            this.msg="非营业部人员不能创建需求表";
        }else if(RecordTypeid!='012100000006KMeAAM'){
            // alert("非SI询价,不能新建SI需求表");
            this.msg="非SI询价,不能新建SI需求表";
        } else if(RecordTypeid=='012100000006KMeAAM'&&records.length==0){
            window.top.location.href="/apex/ISO_DemandOperAndDemonsNew?OppoerID="+this.recordId;
        }
    }
    closeAction() {
        //返回当前的备品申请
        window.open("/"+this.recordId,'_self');
    }
}
force-app/main/default/lwc/lexNewSICustomNew/lexNewSICustomNew.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.css
New file
@@ -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;
}
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.html
New file
@@ -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>
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js
New file
@@ -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');
    }
}
force-app/main/default/lwc/lexSIAbortBtn/lexSIAbortBtn.js-meta.xml
New file
@@ -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>