unknown
2023-07-20 5fa4c7d6c8d987891ffe5ef8fae615b33e032886
button-lexRentalFixtureSetAssignAgency

分配画面(办事处)
4个文件已修改
100 ■■■■■ 已修改文件
force-app/main/default/classes/RentalApplyWebService.cls 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexRentalFixtureSetAssignController.cls 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexRentalFixtureSetAssignController.cls-meta.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/RentalApplyWebService.cls
@@ -377,6 +377,7 @@
           rasdid = rentalApplyId.subString(rentalApplyId.indexOf(';') + 1);
           rentalApplyId = rentalApplyId.subString(0, rentalApplyId.indexOf(';'));
        }
        system.debug(rentalApplyId+'==aaa');
        //1388 yc 20211021 跨区域分配不能出库  end
        //备品借出申请
        Rental_Apply__c[] rentalApply = [select Id,repair__r.Repair_Final_Inspection_Date__c,Bollow_Date__c,repair__r.Return_Without_Repair_Date__c,
@@ -384,6 +385,7 @@
                                        demo_purpose2__c,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c,next_action__c,QIS_number__r.ReplaceDeliveryDate__c
                                        from Rental_Apply__c 
                                        where Id = :rentalApplyId];
        system.debug(rentalApplyId+'==aaa'+rentalApply.size());
        if (rentalApply.size() == 0) {
            returnStr = '没有备品借出申请,请确认。';
            return returnStr;
@@ -725,13 +727,13 @@
                                if(raescc != null && raescc.size() > 0){
                                    for(Rental_Apply_Equipment_Set__c rr : raescc){
                                        if ((rr.Received_Confirm__c == 'OK' || rr.Received_Confirm__c == '默认签收-OK') && rr.Asset_return_time__c != null) {
                                            return '此单不满足延期条件。';
                                            return '此单不满足延期条件01。';
                                        }
                                    }
                                    return '1';
                                }
                            }else{
                                return '此单不满足延期条件。';
                                return '此单不满足延期条件02。';
                            }
                        }else{
                            return '2';
force-app/main/default/classes/lexRentalFixtureSetAssignController.cls
@@ -1,3 +1,11 @@
/**
 * *
    ODescription:
    GAuthor: sun xia
    @Date: 2023-07-11 15:31:56
    GIastEditors: sun xia
    @IastEditTime: 2023-07-11 15:31:56
 * */
public with sharing class lexRentalFixtureSetAssignController {
    
    @AuraEnabled
force-app/main/default/classes/lexRentalFixtureSetAssignController.cls-meta.xml
@@ -2,4 +2,4 @@
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>50.0</apiVersion>
    <status>Active</status>
</ApexClass>
</ApexClass>
force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js
@@ -13,51 +13,53 @@
            recordId: this.recordId
        }).then(result=>{
            this.IsLoading = false;
            let res = result.ra;
            console.log(res);
            if(res.Campaign__c != '' || res.Campaign__c != undefined){
                if(res.CampaignStatus == '取消'){
                    this.isShow = true;
                    this.msg = '学会取消,不可分配';
                    return;
            if(result){
                let res = result.ra;
                console.log(res);
                if(res.Campaign__c != '' || res.Campaign__c != undefined){
                    if(res.CampaignStatus == '取消'){
                        this.isShow = true;
                        this.msg = '学会取消,不可分配';
                        return;
                    }
                }
            }
            if(res.Repair__c != '' || res.Repair__c != undefined){
                if(res.Repair_Final_Inspection_Date_F__c != null && res.Repair_Final_Inspection_Date_F__c !=''
                        || (res.RC_return_to_office__c!=null && res.RC_return_to_office__c != '')){
                    this.isShow = true;
                    this.msg = '修理有最终检测日或修理品返送日,不可分配';
                    return;
                if(res.Repair__c != '' || res.Repair__c != undefined){
                    if(res.Repair_Final_Inspection_Date_F__c != null && res.Repair_Final_Inspection_Date_F__c !=''
                            || (res.RC_return_to_office__c!=null && res.RC_return_to_office__c != '')){
                        this.isShow = true;
                        this.msg = '修理有最终检测日或修理品返送日,不可分配';
                        return;
                    }
                }
            }
            assignBtn({
                Rid: this.recordId
            }).then(resultMsg => {
                if(res.Status__c == '取消' && res.Rental_Apply_Equipment_Set_Cnt__c != 0){
                    window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId);
                    this.closeAction();
                }else if((res.demo_purpose2__c == '学会展会' || res.demo_purpose2__c == '课题研究' || res.demo_purpose2__c == '培训中心')&& res.Status__c == '草案中'){
                    this.isShow = true;
                    this.msg = "不能分配,请确认申请的状态";
                    return
                }else if((res.demo_purpose2__c =='试用(无询价)' || res.demo_purpose2__c == '试用(有询价)' || res.demo_purpose2__c =='动物实验' ||
                    res.demo_purpose2__c == '一般维修代用' || res.demo_purpose2__c== '保修合同用户维修代用' || res.demo_purpose2__c == '已购待货')
                && res.Status__c != '已批准' && res.Status__c != '已出库指示'){
                    this.isShow = true;
                    this.msg = "不能分配,请确认申请的状态";
                    return;
                }else if(resultMsg == 'Fin'){
                    window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId);
                    this.closeAction();
                    return;
                }else{
                    this.isShow = true;
                    this.msg = resultMsg;
                    return;
                }
            })
                assignBtn({
                    Rid: this.recordId
                }).then(resultMsg => {
                    if(res.Status__c == '取消' && res.Rental_Apply_Equipment_Set_Cnt__c != 0){
                        window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId);
                        this.closeAction();
                    }else if((res.demo_purpose2__c == '学会展会' || res.demo_purpose2__c == '课题研究' || res.demo_purpose2__c == '培训中心')&& res.Status__c == '草案中'){
                        this.isShow = true;
                        this.msg = "不能分配,请确认申请的状态";
                        return
                    }else if((res.demo_purpose2__c =='试用(无询价)' || res.demo_purpose2__c == '试用(有询价)' || res.demo_purpose2__c =='动物实验' ||
                        res.demo_purpose2__c == '一般维修代用' || res.demo_purpose2__c== '保修合同用户维修代用' || res.demo_purpose2__c == '已购待货')
                    && res.Status__c != '已批准' && res.Status__c != '已出库指示'){
                        this.isShow = true;
                        this.msg = "不能分配,请确认申请的状态";
                        return;
                    }else if(resultMsg == 'Fin'){
                        window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId);
                        this.closeAction();
                        return;
                    }else{
                        this.isShow = true;
                        this.msg = resultMsg;
                        return;
                    }
                })
            }
        })
        .catch(err=>{
            console.log('initErr==='+err);