unknown
2023-07-06 4d3d177960575781e3d622d628fead93f5896dbc
插队申请

插队申请 一览 更新
4个文件已修改
135 ■■■■■ 已修改文件
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.css 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.html 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js-meta.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.css
@@ -1,4 +1,4 @@
.Holder{
.holder{
    position: relative;
    display: inline-block;
    width: 80px;
@@ -8,4 +8,15 @@
.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/lexRentalApplyJump/lexRentalApplyJump.html
@@ -1,5 +1,13 @@
<template>
      <div class="Holder" if:true={IsLoading}>
              <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
      </div>
  <div class="holder" if:true={IsLoading}>
      <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
  </div>
  <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/lexRentalApplyJump/lexRentalApplyJump.js
@@ -11,12 +11,14 @@
    @api recordId;
    id;
    @api rentalApplyIds;
    RentalApplyId;
    Status;
    //提示信息
    msg;
    IsLoading=true;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        alert("进入页面")
        console.log("进入页面");
        console.log(currentPageReference);
        if(currentPageReference){
@@ -35,11 +37,9 @@
    connectedCallback(){
        console.log(this.recordId);
        init({recordId:this.recordId}).then(result=>{
            console.log(result);
            if(result!=null){
                this.id=result.id;
                this.RentalApplyId=result.RentalApplyId;
                this.Status=result.Status;
                this.cancelSubmit().then(res=>{
                    this.IsLoading=false;
                    this.dispatchEvent(new CloseActionScreenEvent());
@@ -57,56 +57,63 @@
 
    async cancelSubmit(){
        // 可分配代替品前提1 -- 备品借出申请的状态:“已批准”到“已出库指示”
        var userIdArr = ['00510000001O6HoAAK','00510000001O6I2AAK','00510000000gW9pAAE','00510000000gW9BAAU','00510000008pVbWAAU','00510000001OOMjAAO','00510000005sEEMAA2','00510000004pNOtAAM','00510000005QJ2eAAG','00510000007iCmcAAE','00510000006kIg8AAE','00510000004rbkzAAA','00510000003LMHuAAO','00510000000gW92AAE'];
        var userIdArr = ['00510000001O6HoAAK','00510000001O6I2AAK','00510000000gW9pAAE','00510000000gW9BAAU','00510000008pVbWAAU','00510000001OOMjAAO',
            '00510000005sEEMAA2','00510000004pNOtAAM','00510000005QJ2eAAG','00510000007iCmcAAE','00510000006kIg8AAE','00510000004rbkzAAA','00510000003LMHuAAO',
            '00510000000gW92AAE'];
        //当前用户登录id
        var userId;
        await getUserId().then(res=>{
            userId=res;
        });
        console.log(userId);
        })
        .catch(err=>{
            console.log("getUserIderr==="+err);
        })
        //TODO====
        userId = '00510000001O6HoAAK';
        console.log("userId==="+userId);
        if(userIdArr.indexOf(userId)== -1){
            // alert('对不起你没有此操作的权限!');
            const event = new ShowToastEvent({
                title: '提示信息',
                message:'对不起你没有此操作的权限!'
            });
            this.dispatchEvent(event);
            this.msg = '对不起你没有此操作的权限!';
            this.IsLoading = false;
            return;
        } else {
            console.log(userId);
            let raid = this.RentalApplyId;
            console.log("hh1");
            await selectRentalApplyEquipmentSetByRACID({recordId:this.RentalApplyId}).then(res=>{
                console.log(res);
                if (res==null||res.length==0) {
                    // alert("查询结果为空");
                    const event = new ShowToastEvent({
                        title: '提示信息',
                        message:"查询结果为空"
                    });
                    this.dispatchEvent(event);
                    return;
                }
                var allRecords = res;
                var validSize= allRecords.length;
                var canJump = false;
                for(i=0;i<validSize;i++){
                    if(allRecords[i].Allow_Adjust_Queue_Flag__c == true){
                        canJump = true;
                        break;
            console.log('this.rentalApplyIds=='+this.rentalApplyIds);
            if(this.rentalApplyIds == undefined || this.rentalApplyIds.length<1){
                this.msg = '请选择借出备品一览记录';
                this.IsLoading = false;
                return;
            }else{
                let raid = this.RentalApplyId;
                await selectRentalApplyEquipmentSetByRACID({recordId:this.recordId}).then(res=>{
                    console.log('selectRentalApplyEquipmentSetByRACID=='+JSON.stringify(res));
                    var allRecords = res;
                    var validSize= allRecords.length;
                    var canJump = false;
                    for(var i=0;i<validSize;i++){
                        if(allRecords[i].Allow_Adjust_Queue_Flag__c == true){
                            canJump = true;
                            break;
                        }
                    }
                }
                if(canJump == true){
                    // alert("选择借出备品一览记录有已经允许插队的,请选择未允许的一览");
                    const event = new ShowToastEvent({
                        title: '提示信息',
                        message:"选择借出备品一览记录有已经允许插队的,请选择未允许的一览"
                    });
                    this.dispatchEvent(event);
                }else{
                    let records=[this.recordId];
                    window.open("/apex/RentalApplyJump?objId="+this.RentalApplyId+"&raesIds="+records, 'RentalApplyJump', 'width=700,height=300');
                }
            });
                    if(canJump == true){
                        this.msg = '选择借出备品一览记录有已经允许插队的,请选择未允许的一览';
                        this.IsLoading = false;
                        return;
                    }else{
                        let records=[this.recordId];
                        window.open("/apex/RentalApplyJump?objId="+this.recordId+"&raesIds="+ this.rentalApplyIds, 'RentalApplyJump', 'width=700,height=300');
                        this.closeAction();
                    }
                })
                .catch(error=>{
                    console.log('selectRentalApplyEquipmentSetByRACIDerr==='+error);
                })
            }
        }
    }
    closeAction() {
        //返回当前的备品申请
        window.open("/"+this.recordId,'_self');
    }
}
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js-meta.xml
@@ -7,5 +7,12 @@
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
        <target>lightning__FlowScreen</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__FlowScreen">
            <property name="recordId" type="String" label="recordId"/>
            <property name="rentalApplyIds" type="String[]" label="rentalApplyIds"/>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>