| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-08 14:36:33 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-11 14:48:31 |
| | | * @LastEditTime: 2023-05-24 16:24:28 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForLoseBidButton'; |
| | | import updateForLoseBidButton from '@salesforce/apex/OpportunityLightingButtonController.updateForLoseBidButton'; |
| | | import queryForLexLoseBidButton from '@salesforce/apex/OpportunityLightingButtonController.queryForLoseBidButton'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | export default class LexLoseBid extends LightningElement { |
| | | @api recordId; |
| | | ifOpenBid; |
| | |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value', |
| | | }); |
| | | console.log(result); |
| | | if(result){ |
| | | try { |
| | | updateForLoseBidButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if (result) { |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.IsLoading = false; |
| | | this.updateRecordView(this.recordId); |
| | | this.showToast("操作成功!","success"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | } catch(e) { |
| | | console.log(e); |
| | | } |
| | | }else{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | |
| | | if(flag){ |
| | | this.showToast("条件不符合,不可操作","error"); |
| | | }else{ |
| | | if (window.confirm('是否确认竞争对手中标?')) { |
| | | updateForLoseBidButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if (result) { |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.IsLoading = false; |
| | | this.updateRecordView(this.recordId); |
| | | this.showToast("操作成功!","success"); |
| | | } |
| | | }) |
| | | } |
| | | this.handleConfirmClick('是否确认竞争对手中标?'); |
| | | } |
| | | }); |
| | | } |