| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-20 14:08:55 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-08-25 16:44:13 |
| | | * @LastEditTime: 2023-09-25 13:21:17 |
| | | */ |
| | | /* |
| | | * @Description: |
| | |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForLostReportButton'; |
| | | import lwcCSS from '@salesforce/resourceUrl/lwcCSS'; |
| | | import {loadStyle} from 'lightning/platformResourceLoader'; |
| | | export default class LexLoseReport extends LightningElement { |
| | | @api recordId; |
| | | stageName; |
| | |
| | | salesManagerDepartmentID; |
| | | salesOwnerBuchang; |
| | | salesOwnerBuchangID; |
| | | cntLostCancelDraft; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | Promise.all([ |
| | | loadStyle(this, lwcCSS) |
| | | ]); |
| | | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | |
| | | this.salesManagerDepartmentID = result.salesManagerDepartmentID; |
| | | this.salesOwnerBuchang = result.salesOwnerBuchang; |
| | | this.salesOwnerBuchangID = result.salesOwnerBuchangID; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft; |
| | | this.loseReport(); |
| | | }) |
| | | } |
| | |
| | | else if (this.sapSendOK == '1') { |
| | | this.showToast("已经上传SAP、不能做 失单 了!","error"); |
| | | } |
| | | else if (this.cntLostCancelReport > 0) { |
| | | this.showToast("询价已经有 取消/失单报告 了!","error"); |
| | | else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { |
| | | // this.showToast("询价已经有 取消/失单报告 了!","error"); |
| | | this.showToast('询价已经有 取消/失单报告 了!','error'); |
| | | } |
| | | //else if({!Not(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))} && //'{!Opportunity.InfoTypeBid__c}' != '3:结果' ){ |
| | | //alert("关联招投标项目的询价,只能在有结果后做失单报告!"); |
| | |
| | | title: ' ', |
| | | message: msg, |
| | | variant: type, |
| | | mode: 'sticky' |
| | | duration: 15000 |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | //显示信息 |
| | | showMyToast(title, message, variant) { |
| | | console.log('show custom message'); |
| | | let iconName = ''; |
| | | let content = ''; |
| | | if (variant == 'success') { |
| | | iconName = 'utility:check'; |
| | | } else { |
| | | iconName = 'utility:error'; |
| | | } |
| | | if (message != '') { |
| | | content = |
| | | '<h2><strong>' + |
| | | title + |
| | | '<strong/></h2><h5>' + |
| | | message + |
| | | '</h5>'; |
| | | } else { |
| | | content = '<h2><strong>' + title + '<strong/></h2>'; |
| | | } |
| | | this.template |
| | | .querySelector('c-common-toast') |
| | | .showToast(variant, content, iconName, 10000).then(result=>{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | this.isLoading = false; |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |