unknown
2023-05-26 a01d383c53ebd172400d7927ba6d52b111522db3
Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
2个文件已修改
6个文件已添加
234 ■■■■■ 已修改文件
force-app/main/default/classes/LightingButtonConstant.cls 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OppLoseController.cls 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTaskLoseBid/lexTaskLoseBid.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTaskLoseBid/lexTaskLoseBid.js 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTaskLoseBid/lexTaskLoseBid.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTaskOLYwinBid/lexTaskOLYwinBid.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTaskOLYwinBid/lexTaskOLYwinBid.js 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTaskOLYwinBid/lexTaskOLYwinBid.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LightingButtonConstant.cls
@@ -1,4 +1,8 @@
global without sharing class LightingButtonConstant {
    //任务的状态‘OLY中标’
    public static final String STATUS_OLYwinBid = 'OLY中标';
    //任务的状态‘竞争对手中标’
    public static final String STATUS_Bid_LoseBid = '竞争对手中标';
  //中标通知书的状态‘处理完毕’
    public static final String STATUS_Bid_Announcement_Consent = '处理完毕';
    //中标通知书的状态‘草案中’
force-app/main/default/classes/OppLoseController.cls
@@ -4,12 +4,13 @@
    public static InitData init(String taskId){
        InitData res = new initData();
        try{
            task__c task = [SELECT id, OpportunityId__c
            task__c task = [SELECT id, OpportunityId__c , taskStatus__c
                            FROM task__c
                            WHERE Id =: taskId 
                            LIMIT 1];
            res.task = task;
            res.taskStatus = task.taskStatus__c;
            res.OpportunityId = task.OpportunityId__c;
            Opportunity opp =  [SELECT Sales_owner_buchangID__c,Manager_name__c,Sales_owner_buchang__c,
@@ -38,18 +39,53 @@
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    }
    public class ReturnData{
    }
    //OLY中标
    @AuraEnabled
    public static String taskOLYwinBid(String recordId) {
        String messageText = '';
       try {
        Opportunity opp = [SELECT Id,ConfirmationofAward__c FROM Opportunity WHERE Id = :recordId LIMIT 1];
        opp.Id = recordId;
        opp.ConfirmationofAward__c = LightingButtonConstant.STATUS_OLYwinBid;
        messageText = '1';
        update opp;
        System.debug(LoggingLevel.INFO, '*** winBid: ' + opp);
        return messageText;
       } catch (Exception ex) {
        System.debug(LoggingLevel.INFO, '*** winBidXu: ' + ex);
        messageText = ex.getMessage();
        return messageText;
       }
    }
    //竞争对手中标
    @AuraEnabled
    public static String taskLoseBid(String recordId) {
        String messageText = '';
        try {
        Opportunity opp = [SELECT Id,ConfirmationofAward__c FROM Opportunity WHERE Id = :recordId LIMIT 1];
        opp.Id = recordId;
        opp.ConfirmationofAward__c = LightingButtonConstant.STATUS_Bid_LoseBid;
        messageText = '1';
        update opp;
        System.debug(LoggingLevel.INFO, '*** winBid: ' + opp);
        return messageText;
        } catch (Exception ex) {
        System.debug(LoggingLevel.INFO, '*** winBidXu: ' + ex);
        messageText = ex.getMessage();
        return messageText;
        }
    }
    public class InitData{
        //询价数据
        @AuraEnabled
        public Opportunity opp;
        @AuraEnabled
        public String stageName;
        public String StageName;
        @AuraEnabled
        public Boolean SAP_Send_OK;
        @AuraEnabled
@@ -73,6 +109,8 @@
        @AuraEnabled
        public String OpportunityId;
        @AuraEnabled
        public String taskStatus;
        @AuraEnabled
        public task__c task;
    }
force-app/main/default/lwc/lexTaskLoseBid/lexTaskLoseBid.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="ApplicationSubmit" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexTaskLoseBid/lexTaskLoseBid.js
New file
@@ -0,0 +1,75 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/OppLoseController.init';
import  taskLoseBid  from '@salesforce/apex/OppLoseController.taskLoseBid';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { updateRecord } from 'lightning/uiRecordApi';
import LightningConfirm from 'lightning/confirm';
export default class lexTaskOLYwinBid extends LightningElement {
    @api recordId;
    taskStatus;//任务 状态
    OpportunityId;//任务 ID
    IsLoading = true;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        if(currentPageReference){
            const urlValue=currentPageReference.state.recordId;
            if(urlValue){
                let str=`${urlValue}`;
                this.recordId=str;
            }
        }
    }
    connectedCallback(){
        init({
            taskId: this.recordId
        }).then(result => {
            this.IsLoading = false;
            console.log(result.OpportunityId,result.taskStatus);
            this.OpportunityId = result.OpportunityId;
            this.taskStatus = result.taskStatus;
            this.taskLoseBid();
        })
    }
    taskLoseBid(){
        if(this.taskStatus == '04 取消'){
            this.showToast('任务取消,不可操作',"error");
        }else{
            LightningConfirm.open({
                message: '是否确认竞争对手中标?',
                variant: 'headerless',
                label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        taskLoseBid({recordId:this.OpportunityId}).then(requst=>{
                            if(requst == '1'){
                                this.showToast("操作成功!","success");
                                this.updateRecordView();
                                this.dispatchEvent(new CloseActionScreenEvent());
                            }
                            if(requst != "1"){
                                this.showToast(requst,"error");
                            }
                        })
                    }else{
                        this.dispatchEvent(new CloseActionScreenEvent());
                        this.updateRecordView(this.recordId);
                        return;
                    }
                });
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    updateRecordView() {
        updateRecord({fields: { Id: this.OpportunityId }});
    }
}
force-app/main/default/lwc/lexTaskLoseBid/lexTaskLoseBid.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexTaskOLYwinBid/lexTaskOLYwinBid.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="ApplicationSubmit" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexTaskOLYwinBid/lexTaskOLYwinBid.js
New file
@@ -0,0 +1,75 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/OppLoseController.init';
import  taskOLYwinBid  from '@salesforce/apex/OppLoseController.taskOLYwinBid';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { updateRecord } from 'lightning/uiRecordApi';
import LightningConfirm from 'lightning/confirm';
export default class lexTaskOLYwinBid extends LightningElement {
    @api recordId;
    taskStatus;//任务 状态
    OpportunityId;//任务 ID
    IsLoading = true;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        if(currentPageReference){
            const urlValue=currentPageReference.state.recordId;
            if(urlValue){
                let str=`${urlValue}`;
                this.recordId=str;
            }
        }
    }
    connectedCallback(){
        init({
            taskId: this.recordId
        }).then(result => {
            this.IsLoading = false;
            console.log(result.OpportunityId,result.taskStatus);
            this.OpportunityId = result.OpportunityId;
            this.taskStatus = result.taskStatus;
            this.taskOLYwinBid();
        })
    }
    //任务 OLY中标
    taskOLYwinBid(){
        if(this.taskStatus == '04 取消'){
            this.showToast('任务取消,不可操作',"error");
        }else{
            LightningConfirm.open({
                message: '是否确认竞争对手中标?',
                variant: 'headerless',
                label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        taskOLYwinBid({recordId:this.OpportunityId}).then(requst=>{
                            if(requst == '1'){
                                this.showToast("操作成功!","success");
                                this.updateRecordView();
                                this.dispatchEvent(new CloseActionScreenEvent());
                            }
                            if(requst != "1"){
                                this.showToast(requst,"error");
                            }
                        })
                    }else{
                        this.dispatchEvent(new CloseActionScreenEvent());
                        this.updateRecordView(this.recordId);
                        return;
                    }
                });
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    updateRecordView() {
        updateRecord({fields: { Id: this.OpportunityId }});
    }
}
force-app/main/default/lwc/lexTaskOLYwinBid/lexTaskOLYwinBid.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>