From c69e36a64e4954b0b7e818843e8a833b3201ec29 Mon Sep 17 00:00:00 2001
From: liangxiaozhen <liangxiaozhen>
Date: 星期二, 08 八月 2023 18:23:15 +0800
Subject: [PATCH] 页面加lightning样式,开始询价LWC组件修改,补充controller
---
force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js | 43 ++++++++++---------------------------------
1 files changed, 10 insertions(+), 33 deletions(-)
diff --git a/force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js b/force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js
index 67e16ce..442877c 100644
--- a/force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js
+++ b/force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js
@@ -1,9 +1,7 @@
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;//褰撳墠杩欐潯鏁版嵁鐨刬d
@@ -22,29 +20,22 @@
}
}
-
+ //鎷涙爣椤圭洰涓嶅簲鏍囩敵璇�
connectedCallback(){
init({
recordId: this.recordId
}).then(result => {
+ console.log(result);
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) {
@@ -53,20 +44,6 @@
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();
\ No newline at end of file
+}
\ No newline at end of file
--
Gitblit v1.9.1