From 5adc17e982b1a460952eae05f5547e6d43245de7 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@prec-tech.com>
Date: 星期二, 20 六月 2023 17:43:06 +0800
Subject: [PATCH] 附属品追加和选择
---
force-app/main/default/lwc/lexAccessory_Select/lexAccessory_Select.js | 1
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.css | 22 +++++++++++
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.html | 12 +++++-
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js | 27 +++++++------
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js-meta.xml | 1
5 files changed, 48 insertions(+), 15 deletions(-)
diff --git a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.css b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.css
new file mode 100644
index 0000000..95c1c55
--- /dev/null
+++ b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.css
@@ -0,0 +1,22 @@
+.holder{
+ position: relative;
+ display: inline-block;
+ width: 80px;
+ height: 80px;
+ text-align: center;
+}
+
+.container .uiContainerManager{
+ display : none !important;
+}
+.toast{
+ border: 1px solid #c9c9c9;
+ border-radius: 10px;
+ width: 50%;
+ margin: 0 auto;
+ font-size: 18px;
+ font-weight: bold;
+ padding: 10px 20px;
+ background: #feb75d;
+ display: flex;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.html b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.html
index d044dbb..7c59830 100644
--- a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.html
+++ b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.html
@@ -1,5 +1,13 @@
<template>
- <div class="exampleHolder" if:true={IsLoading}>
+ <div class="holder" if:true={IsLoading}>
<lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
</div>
-</template>
\ No newline at end of file
+ <div if:false={IsLoading} class="toast">
+ <span style="padding: 10px;">{msg}</span>
+ <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;">
+ <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small"
+ title="Close" style="color: black;"></lightning-icon>
+ <span class="slds-assistive-text">Close</span>
+ </button>
+ </div>
+ </template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js
index 1ac6018..5f363ea 100644
--- a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js
+++ b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js
@@ -11,35 +11,36 @@
export default class LexAccessory_Add extends LightningElement {
@api recordId;
IsLoading = true;
+ @api rentalApplyEquipmentSetDetailIds;
+ msg;
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
+ console.log(111);
+ console.log(currentPageReference);
if (currentPageReference) {
const urlValue = currentPageReference.state.recordId;
if (urlValue) {
let str = `${urlValue}`;
this.recordId = str;
+ this.connectedCallback();
}
}
}
connectedCallback(){
this.IsLoading = false;
- if (this.recordId.length == 0) {
- this.ShowToastEvent("璇烽�夋嫨涓�涓�熷嚭澶囧搧閰嶅涓�瑙堟槑缁嗕俊鎭�", "warning");
+ if (this.rentalApplyEquipmentSetDetailIds == undefined || this.rentalApplyEquipmentSetDetailIds.length == 0) {
+ this.msg = "璇烽�夋嫨涓�涓�熷嚭澶囧搧閰嶅涓�瑙堟槑缁嗕俊鎭�";
+ return;
} else {
- window.open("/apex/AccessoryAdd?recid=" + this.recordId, "_top");
+ window.open("/apex/AccessoryAdd?recid=" + this.rentalApplyEquipmentSetDetailIds, "_top");
+ this.closeAction();
}
}
- //寮规
- ShowToastEvent(msg,type) {
- const event = new ShowToastEvent({
- title: '',
- message: msg,
- variant: type
- });
- this.dispatchEvent(event);
+ closeAction() {
+ //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+ window.open("/"+this.recordId,'_self');
}
-
-}
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js-meta.xml b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js-meta.xml
index 622f243..3a0a2c6 100644
--- a/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js-meta.xml
+++ b/force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js-meta.xml
@@ -15,6 +15,7 @@
<targetConfig targets="lightning__FlowScreen">
<!-- name js涓娇鐢ㄧ殑鍙橀噺锛屼粠灞忓箷娴佷腑鑾峰彇鍙傛暟 label 鍦ㄥ睆骞曟祦鐨勮LWC鐨勮缃腑鏄剧ず -->
<property name="recordId" type="String" label="recordId"/>
+ <property name="rentalApplyEquipmentSetDetailIds" type="String[]" label="rentalApplyEquipmentSetDetailIds"/>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAccessory_Select/lexAccessory_Select.js b/force-app/main/default/lwc/lexAccessory_Select/lexAccessory_Select.js
index ddd6f9c..71c0086 100644
--- a/force-app/main/default/lwc/lexAccessory_Select/lexAccessory_Select.js
+++ b/force-app/main/default/lwc/lexAccessory_Select/lexAccessory_Select.js
@@ -24,6 +24,7 @@
}
connectedCallback(){
+ console.log("---------------id-------",this.recordId);
this.IsLoading = false;
if(this.recordId){
window.open("/apex/AccessorySelect?pt_recid="+this.recordId, "_top");
--
Gitblit v1.9.1