force-app/main/default/lwc/lexTenderingAttachmentButton/lexTenderingAttachmentButton.js
@@ -2,7 +2,6 @@ import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class lexTenderingAttachmentButton extends LightningElement { @api recordId;//当前这条数据的id id;//返回值的id Tender_information__c招标项目的id @@ -18,37 +17,16 @@ } } } //招标项目查看附件 connectedCallback(){ init({ recordId: this.recordId }).then(result => { this.IsLoading = false; this.id = result.Id; this.AttachmentButton(); window.open(`/apex/TenderInformationUploadPdf?id=${this.id}`); this.dispatchEvent(new CloseActionScreenEvent()); }).catch(error => { console.log("error"+error); }).finally(() => { }); }) } //查看附件 AttachmentButton(){ window.open(`/apex/TenderInformationUploadPdf?id=${this.id}`); } showToast(msg,type) { const event = new ShowToastEvent({ message: msg, variant: type }); this.dispatchEvent(event); } } // var From= function(){ // window.open( "/apex/TenderInformationUploadPdf?id={!URLENCODE(Tender_information__c.Id)}"); // } // From(); } force-app/main/default/lwc/lexTenderingHospitalButton/lexTenderingHospitalButton.js
@@ -24,46 +24,22 @@ init({ recordId: this.recordId }).then(result => { console.log(result) this.IsLoading = false; this.id = result.Id; this.name = result.name; this.Environment_Url = result.Environment_Url this.HospitalButton(); this.dispatchEvent(new CloseActionScreenEvent()); }).catch(error => { console.log("error"+error); }).finally(() => { }); }) } //新建医院 //招标项目新建医院 HospitalButton(){ var url = this.Environment_Url+'001/e?CF00N10000009I0o7='+encodeURIComponent(this.name) +'&CF00N10000009I0o7_lkid='+encodeURIComponent(this.id) +'&00N10000009HFQT='+encodeURIComponent('招标项目') +'&RecordType=01210000000QemG' +'&retURL='+ encodeURIComponent(this.id); console.log('url',url) window.location.href = url; } } // var foo = function() { // var TenderId = '{!Tender_information__c.Id}'; // var Tendername = '{!Tender_information__c.Name}'; // var HospitalSource= '招标项目'; // var url = '{!$Label.Environment_Url}'+'001/e?CF00N10000009I0o7='+encodeURIComponent(Tendername) // +'&CF00N10000009I0o7_lkid='+encodeURIComponent(TenderId) // +'&00N10000009HFQT='+encodeURIComponent(HospitalSource) // +'&RecordType=01210000000QemG' // +'&retURL='+ encodeURIComponent(TenderId); // window.top.location.href = url; // } // foo(); } force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
@@ -6,7 +6,6 @@ import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class lexTenderingLostButton extends LightningElement { @api recordId;//当前这条数据的id id;//返回值的id Tender_information__c招标项目的id status;//状态 profileId;//profileId id IsLoading = true; @@ -28,21 +27,16 @@ recordId: this.recordId }).then(result => { this.IsLoading = false; this.id = result.Id; this.status = result.status; this.profileId = result.profileId.slice(0,15); this.LoseButton(); this.dispatchEvent(new CloseActionScreenEvent()); }).catch(error => { console.log("error"+error); }).finally(() => { }); }) } //失单 //招标项目失单 LoseButton(){ sqlResult({id: this.id}).then(result=>{ sqlResult({id: this.recordId}).then(result=>{ //简档权限 2S1_销售医院担当 2S4_销售管理者 系统管理员 if (this.profileId != '00e10000000xnp2' && this.profileId != '00e10000000xnpH' && this.profileId != '00e10000000Y3o5') { this.showToast("您没有权限,无法创建询价提交失单。","error"); @@ -62,7 +56,7 @@ return; } } window.open(`/apex/TenderLostPage?id=${this.id}`,'','height=500,width=800,top=200,left=250,location=no'); window.open(`/apex/TenderLostPage?id=${this.recordId}`,'','height=500,width=800,top=200,left=250,location=no'); }) } showToast(msg,type) { @@ -73,36 +67,3 @@ this.dispatchEvent(event); } } // var sql = "select id from Tender_Opportunity_Link__c where Tender_information__c='" + '{!Tender_information__c.Id}'+ "'"; // var sqlResult = sforce.connection.query(sql); // //简档权限 2S1_销售医院担当 2S4_销售管理者 系统管理员 // if ('{!$Profile.Id}' != '00e10000000xnp2' && '{!$Profile.Id}' != '00e10000000xnpH' && '{!$Profile.Id}' != '00e10000000Y3o5') { // alert("您没有权限,无法创建询价提交失单。"); // return; // } // // 判断内部确认状态 // if({!Tender_information__c.status__c == '01.待确认'|| Tender_information__c.status__c == '02.不相关'}){ // alert('状态为待确认或不相关,不可以做失单。'); // return; // } // // 判断是否需要新建询价 // if({!Tender_information__c.status__c == '05.询价中'|| Tender_information__c.status__c == '06.成交' || Tender_information__c.status__c == '07.部分成交' || Tender_information__c.status__c == '08.失单'} || sqlResult.size > 0){ // if(!confirm('此项目已关联询价,请确实是否新建询价提交失单。')) { // return; // } // } // // 判断是否需要新建询价 // //if(sqlResult.size > 0){ // //if(!confirm('已有关联询价,是否创建新的询价。')) { // //return; // //} // //} // window.open('/apex/TenderLostPage?id={!Tender_information__c.Id}','','height=500,width=800,top=200,left=250,location=no');