force-app/main/default/classes/TenderWebService.cls
New file @@ -0,0 +1,83 @@ global class TenderWebService { public TenderWebService() { } @AuraEnabled //招投标反逻辑删除 WebService static String ContraryLogicalDel(String DTenId) { Tender_information__c DTenInfo = [Select Id, InfoId__c, Logical_delete__c, ProjectId__c, Retain_Tender__c From Tender_information__c Where id = : DTenId]; // 更新删除招投标 List<Tender_information__c> updateTenInfoList = new List<Tender_information__c>(); // 更新保留招投标 // List<Tender_information__c> updateBTenList = new List<Tender_information__c>(); if (String.isNotBlank(DTenInfo.Retain_Tender__c)) { // System.debug('11111111' + TenInfo.Retain_Tender__c); //要保留的招投标 Tender_information__c BTen = [select Id, InfoId__c From Tender_information__c Where Id = : DTenInfo.Retain_Tender__c]; // 删除招投标关联的询价 // List<Tender_Opportunity_Link__c> DTenLinkList = [select Opportunity__c // from Tender_Opportunity_Link__c // where Tender_information__c = :DTenId and IsRelated__c = true]; // System.debug('---------2---------' + DTenLinkList); // Set<Id> DTenLinkOppIdSet = new Set<Id>(); // if (DTenLinkList.size() > 0) { // for (Tender_Opportunity_Link__c DTenlink : DTenLinkList) { // DTenLinkOppIdSet.add(DTenlink.Opportunity__c); // } // System.debug('---------3---------' + DTenLinkOppIdSet); // // 删除项目关联并且与保留项目关联的询价关联信息 // List<Tender_Opportunity_Link__c> DelD_BTenLinkList = [select id, Opportunity__c, Tender_information__c // from Tender_Opportunity_Link__c // where Tender_information__c = :BTen.Id and Opportunity__c in : DTenLinkOppIdSet]; // System.debug('---------1---------' + DelD_BTenLinkList); // if (DelD_BTenLinkList.size() > 0) { // Delete DelD_BTenLinkList; // } // } // 保留项目通过软删除逻辑关联来的询价 List<Tender_Opportunity_Link__c> DelD_BTenLinkList = [select id, Opportunity__c, Tender_information__c from Tender_Opportunity_Link__c where Tender_information__c = :BTen.Id and IsRelated__c = true]; // 判断link是否为空 if (DelD_BTenLinkList != null && DelD_BTenLinkList.size() > 0) { // 逻辑有大坑 暂时只把打标记的删掉 不做回写的操作了 // List<Tender_Opportunity_Link__c> add_list = new List<Tender_Opportunity_Link__c>(); // for (Tender_Opportunity_Link__c link : DelD_BTenLinkList) { // Tender_Opportunity_Link__c add_link = new Tender_Opportunity_Link__c(); // add_link.Tender_information__c = DTenInfo.Id; // add_link.Opportunity__c = link.Opportunity__c; // add_link.Tender_Opportunity_Uniq__c = DTenInfo.Id + '' + link.Opportunity__c; // add_link.IsRelated__c = false; // add_list.add(add_link); // } // 删掉保留项目上的关联询价 delete DelD_BTenLinkList; // 删除项目上的关联加回来 // if (add_list.size() > 0) { // insert add_list; // } } // 互换保留招投标与删除招投标的信息Id DTenInfo.Retain_Tender__c = BTen.Id; String BTenInfo = BTen.InfoId__c; BTen.InfoId__c = DTenInfo.InfoId__c;//保留招投标的信息Id赋给删除招投标的信息Id DTenInfo.InfoId__c = BTenInfo;//删除招投标的信息Id赋给保留招投标的信息Id // 点击保存后 删除招投标上的逻辑删除字段变为true DTenInfo.Logical_delete__c = false; // update TenInfo; // 一起更新就行了 updateTenInfoList.add(DTenInfo); updateTenInfoList.add(BTen); update updateTenInfoList; // updateBTenList.add(BTen); // update updateBTenList; } return 'OK'; } } force-app/main/default/classes/TenderWebService.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>45.0</apiVersion> <status>Active</status> </ApexClass> force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.html
New file @@ -0,0 +1,5 @@ <template> <div class="AntiLogicButton" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.js
New file @@ -0,0 +1,52 @@ 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 IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback(){ init({ recordId: this.recordId }).then(result => { this.IsLoading = false; this.id = result.Id; this.AntiLogicButton(); this.dispatchEvent(new CloseActionScreenEvent()); }) } //招标项目反逻辑删除 AntiLogicButton(){ ContraryLogicalDel({DTenId : this.id}).then(result =>{ if(result == 'OK'){ this.showToast("反逻辑删除成功","success"); } this.dispatchEvent(new CloseActionScreenEvent()); }) } showToast(msg,type) { const event = new ShowToastEvent({ message: msg, variant: type }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); } } force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.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/lexTenderingAttachmentButton/lexTenderingAttachmentButton.js
@@ -27,14 +27,10 @@ this.id = result.Id; this.AttachmentButton(); this.dispatchEvent(new CloseActionScreenEvent()); }).catch(() => { }).finally(() => { }); }) } //查看附件 //招标项目查看附件 AttachmentButton(){ window.open(`/apex/TenderInformationUploadPdf?id=${this.id}`); } force-app/main/default/lwc/lexTenderingHospitalButton/lexTenderingHospitalButton.js
@@ -36,7 +36,7 @@ }); } //新建医院 //招标项目新建医院 HospitalButton(){ var url = this.Environment_Url+'001/e?CF00N10000009I0o7='+encodeURIComponent(this.name) +'&CF00N10000009I0o7_lkid='+encodeURIComponent(this.id) force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.html
New file @@ -0,0 +1,5 @@ <template> <div class="LogicButton" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.js
New file @@ -0,0 +1,39 @@ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; export default class Logic extends LightningElement { @api recordId;//当前这条数据的id id;//返回值的id Tender_information__c招标项目的id IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback(){ init({ recordId: this.recordId }).then(result => { if (result != null) { this.IsLoading = false; this.id = result.Id; this.LogicButton(); this.dispatchEvent(new CloseActionScreenEvent()); } }) } //招标项目逻辑删除 LogicButton(){ window.open (`/apex/TenderDeletePagelwc?id=${this.id}`, '', 'height=350, width=600, top=200, left=350'); } } force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.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/lexTenderingLostButton/lexTenderingLostButton.js
@@ -33,12 +33,10 @@ this.profileId = result.profileId.slice(0,15); this.LoseButton(); this.dispatchEvent(new CloseActionScreenEvent()); }).catch(() => { }).finally(() => { }); }) } //失单 //招标项目失单 LoseButton(){ sqlResult({id: this.id}).then(result=>{ //简档权限 2S1_销售医院担当 2S4_销售管理者 系统管理员 @@ -68,5 +66,6 @@ variant: type }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); } }