zhangqian
2023-06-20 5adc17e982b1a460952eae05f5547e6d43245de7
附属品追加和选择

1
4个文件已修改
1个文件已添加
63 ■■■■ 已修改文件
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.html 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.js-meta.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAccessory_Select/lexAccessory_Select.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexAccessory_Add/lexAccessory_Add.css
New file
@@ -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;
}
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>
    <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>
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');
    }
}
}
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>
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");