招标项目 代码修改 新建意向,反逻辑删除,逻辑删除,反应询价状态,不应标申请
6个文件已修改
203 ■■■■ 已修改文件
force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.js 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTenderingEnquiryButton/lexTenderingEnquiryButton.js 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTenderingIntentionButton/lexTenderingIntentionButton.js 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.js 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.js
@@ -1,9 +1,7 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/TenderingButtonController.initTenderingController';
import  ContraryLogicalDel  from '@salesforce/apex/TenderWebService.ContraryLogicalDel';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class LexTenderingAntiLogicButton extends LightningElement {
    @api recordId;//当前这条数据的id
    id;//返回值的id  Tender_information__c招标项目的id
@@ -19,47 +17,11 @@
           }
         }
     }
    //招标项目反逻辑删除
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result => {
                this.IsLoading = false;
                this.id = result.Id;
                this.AntiLogicButton();
                this.dispatchEvent(new CloseActionScreenEvent());
        }).catch(() => {
        }).finally(() => {
        });
    }
    //反逻辑删除
    AntiLogicButton(){
        ContraryLogicalDel({DTenId : this.id}).then(result =>{
            console.log(result,'成功与否');
            if(result == 'OK'){
                this.showToast("反逻辑删除成功","success");
            }
        ContraryLogicalDel({DTenId : this.recordId}).then(result =>{
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
}
// /var ContraryL = function(){
//     var DTenId = "{!Tender_information__c.Id}";//删除的招投标
//     var rtn = sforce.apex.execute("TenderWebService", "ContraryLogicalDel", {DTenId : DTenId } );
//     //重新加载页面
//     window.location.reload();
//     }
//     ContraryL();
force-app/main/default/lwc/lexTenderingEnquiryButton/lexTenderingEnquiryButton.js
@@ -1,7 +1,6 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import  init  from '@salesforce/apex/TenderingButtonController.initTenderingController';
import  updateOpportunityInformation  from '@salesforce/apex/UpdateTenderInformationBatch.updateOpportunityInformation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
@@ -26,35 +25,29 @@
        init({
            recordId: this.recordId
        }).then(result => {
            if (result != null) {
                this.IsLoading = false;
                this.id = result.Id;
                this.isRelateProject = result.isRelateProject;
                this.EnquiryButton();
                this.dispatchEvent(new CloseActionScreenEvent());
            }
        }).catch(error => {
            console.log("error"+error);
        }).finally(() => {
        });
            console.log(result);
            this.IsLoading = false;
            this.id = result.Id;
            this.isRelateProject = result.isRelateProject;
            this.EnquiryButton();
        })
    }
    //招标项目 反应询价状态
    EnquiryButton(){
        if(this.isRelateProject == "否"){
            this.showToast('招投标项目不相关后不能反应询价状态!','error');
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
        var listss = [];
        listss.push(this.id);
        updateOpportunityInformation({TenderIdList : listss}).then(result=>{
            console.log(result,'走开了吗?')
            if(result != 'OK'){
                this.showToast(result,'error');
                this.dispatchEvent(new CloseActionScreenEvent());
            }else {
                console.log('烦')
                // alert('反映完了');
                this.showToast('反映完了','success');
                this.dispatchEvent(new CloseActionScreenEvent());
            }
        })
    }
@@ -65,28 +58,6 @@
            message: msg,
            variant: type
        });
        console.log('提示框不能用了吗?');
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
// var foo = function(){
//     if('{!Tender_information__c.IsRelateProject__c}'== "否"){
//     alert('招投标项目不相关后不能反应询价状态!');
//     return;
//     }
//     var listss = [];
//     listss.push('{!Tender_information__c.Id}');
//     var rtn = sforce.apex.execute("UpdateTenderInformationBatch", "updateOpportunityInformation", {TenderIdList : listss } );
//     if(rtn != 'OK'){
//     alert(rtn);
//     }else {
//     alert('反映完了');
//     }
//     //重新加载页面
//     window.location.reload();
//     }
//     foo();
}
force-app/main/default/lwc/lexTenderingIntentionButton/lexTenderingIntentionButton.js
@@ -1,15 +1,12 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import  init  from '@salesforce/apex/TenderingButtonController.initTenderingController';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexTenderingIntentionButton extends LightningElement {
    @api recordId;//当前这条数据的id
    id;//返回值的id  Tender_information__c招标项目的id
    IsLoading = true;
    @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
         if (currentPageReference) {
@@ -21,8 +18,7 @@
           }
         }
     }
    //招标项目新建意向
    connectedCallback(){
        init({
            recordId: this.recordId
@@ -30,46 +26,20 @@
            if (result != null) {
                this.IsLoading = false;
                this.id = result.Id;
                this.IntentionButton();
                alert('填写失单报告请直接点击招标页面【失单】按钮');
                // this.showToast('填写失单报告请直接点击招标页面【失单】按钮','success');
                var url = '/apex/NewAndEditLead?' + '00N10000009HKS5=' + this.id
                + '&LeadSource=招标网' + '&RecordTypeId=01210000000QiRf' + '&retURL=%2F' + this.id ;
                window.open(url);
                this.dispatchEvent(new CloseActionScreenEvent());
            }
        }).catch(error => {
            console.log("error"+error);
        }).finally(() => {
        });
        })
    }
    //招标项目新建意向
    IntentionButton(){
            // alert('填写失单报告请直接点击招标页面【失单】按钮');
            this.showToast('填写失单报告请直接点击招标页面【失单】按钮','success');
            var url = '/apex/NewAndEditLead?' + '00N10000009HKS5=' + this.id
            + '&LeadSource=招标网' + '&RecordTypeId=01210000000QiRf' + '&retURL=%2F' + this.id ;
            window.open(url);
    }
    updateRecordView() {
        updateRecord({fields: { Id: this.recordId }});
    }
    showToast(msg,type) {
        console.log(msg,type);
        const event = new ShowToastEvent({
            // title: title,
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
}
// var foo = function(){
//     alert('填写失单报告请直接点击招标页面【失单】按钮');
//     var url = '/apex/NewAndEditLead?' + '00N10000009HKS5=' + '{!Tender_information__c.Id}'
//     + '&LeadSource=招标网' + '&RecordTypeId=01210000000QiRf' + '&retURL=%2F' + '{!Tender_information__c.Id}' ;
//     window.open(url);
//     }
//     foo();
}
force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.js
@@ -18,7 +18,7 @@
         }
     }
    
     //招标项目逻辑删除
    connectedCallback(){
        init({
            recordId: this.recordId
@@ -26,24 +26,9 @@
            if (result != null) {
                this.IsLoading = false;
                this.id = result.Id;
                this.LogicButton();
                window.open (`/apex/TenderDeletePagelwc?id=${this.id}`, '', 'height=350, width=600, top=200, left=350');
                this.dispatchEvent(new CloseActionScreenEvent());
            }
        }).catch(() => {
        }).finally(() => {
        });
        })
    }
    //逻辑删除
    LogicButton(){
        window.open (`/apex/TenderDeletePagelwc?id=${this.id}`, '', 'height=350, width=600, top=200, left=350');
    }
}
// function IfResponse(){
//     window.open ('/apex/TenderDeletePagelwc?id={!Tender_information__c.Id}', '', 'height=350, width=600, top=200, left=350');
//     }
//     IfResponse();
}
force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
@@ -50,7 +50,6 @@
            }
            // 判断内部确认状态
            if(this.status == '01.待确认'|| this.status == '02.不相关'){ 
                console.log('没走吗');
                this.showToast("状态为待确认或不相关,不可以做失单。","error");
                return;
            }
force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js
@@ -1,9 +1,7 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import  init  from '@salesforce/apex/TenderingButtonController.initTenderingController';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexTenderingNoStandardButton extends LightningElement {
    @api recordId;//当前这条数据的id
@@ -22,7 +20,7 @@
         }
     }
    
    //招标项目不应标申请
    connectedCallback(){
        init({
            recordId: this.recordId
@@ -30,21 +28,13 @@
                this.IsLoading = false;
                this.id = result.Id;
                this.opportunityNum = result.opportunityNum;
                this.NoStandardButton();
                if(this.opportunityNum > 0) {
                    this.showToast('项目已关联过询价,请到询价里做不应标申请','error');
                    return;
                }
                window.open ('/apex/Bidding?id='+this.id, '', 'height=350, width=600, top=200, left=350,location=no');
                this.dispatchEvent(new CloseActionScreenEvent());
        }).catch(error => {
            console.log("error"+error);
        }).finally(() => {
        });
    }
    //招标项目不应标申请
    NoStandardButton(){
        if(Number(this.opportunityNum) > 0) {
            this.showToast('项目已关联过询价,请到询价里做不应标申请','error');
            return;
        }
        window.open ('/apex/Bidding?id='+this.id, '', 'height=350, width=600, top=200, left=350,location=no');
        })
    }
    showToast(msg,type) {
@@ -53,20 +43,6 @@
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
// function IfResponse(){
//     // 关联询价之后不能在招标里申请不应标
//     if('{!Tender_information__c.OpportunityNum__c}' > 0) {
//     alert('项目已关联过询价,请到询价里做不应标申请');
//     return;
//     }
//     window.open ('/apex/Bidding?id={!Tender_information__c.Id}', '', 'height=350, width=600, top=200, left=350,location=no');
//     }
//     IfResponse();
}