招标项目 代码修改 新建意向,反逻辑删除,逻辑删除,反应询价状态,不应标申请
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //招标项目反逻辑删除 |
| | | 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(); |
| | |
| | | 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'; |
| | |
| | | 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()); |
| | | } |
| | | }) |
| | | } |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //招标项目新建意向 |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | |
| | | 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(); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //招标项目逻辑删除 |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | |
| | | 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(); |
| | | } |
| | |
| | | } |
| | | // 判断内部确认状态 |
| | | if(this.status == '01.待确认'|| this.status == '02.不相关'){ |
| | | console.log('没走吗'); |
| | | this.showToast("状态为待确认或不相关,不可以做失单。","error"); |
| | | return; |
| | | } |
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //招标项目不应标申请 |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | |
| | | 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) { |
| | |
| | | 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(); |
| | | } |