高章伟
2023-04-04 ecf60bb0cd5a04ce38120302be4cf55fd3c3a27b
force-app/main/default/lwc/relevant/relevant.js
@@ -2,6 +2,7 @@
import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
import cannotModifyIsRelateProject from '@salesforce/apex/InspectCheckController.cannotModifyIsRelateProject';
import { refreshApex } from '@salesforce/apex';
import GetIrrelevantReasons from '@salesforce/apex/InspectCheckController.GetIrrelevantReasons';
@@ -38,6 +39,10 @@
TongzhiIcon = 'standard:account' //提示框的图标
IsLeftStyle = "" //提示框的样式
BgColorStyle = ""
// 是否关联能不能编辑
xgxLyDisabled = false;
//弹框提示 content 内容 error 是否是错误提示框  left 是否居左
Alert(content,error = false,left = false){
    this.SaveShowText = content;
@@ -125,6 +130,7 @@
        this.paramIdStr = paramId;
        this.GetInspectByIdFn(paramId);
        this.GetIrrelevantReasonsFn();
        this.cannotModifyIsRelateProjectFn(paramId);
        
     
    }
@@ -144,6 +150,13 @@
        })
    }
    cannotModifyIsRelateProjectFn(Id) {
        cannotModifyIsRelateProject({Id:Id}).then(result=>{
            this.xgxLyDisabled = result;
            console.log(this.xgxLyDisabled);
        })
    }
    checkDatas(tempData)
    {
        if (tempData.irrelevantReasonOther__c  == undefined || tempData.irrelevantReasonOther__c == '') {
@@ -153,7 +166,12 @@
            this.isOther = true;
          
        // }
        if (tempData.IsRelateProject__c == "是") {
        if (tempData.IsRelateProject__c == "是"
            && !(tempData.status__c == '01.待确认'
                || tempData.status__c == '02.不相关'
                || tempData.status__c == '03.不应标'
                || tempData.status__c == '04.待关联询价')
            ) {
            this.isShi = true;
            this.isFou = false;
            this.isOther = false;
@@ -174,7 +192,28 @@
            boxs.forEach(fileInput=>{
                fileInput.disabled = true;
            })
        }else if(tempData.IsRelateProject__c == "否"){
        } else if(tempData.IsRelateProject__c == "是"){
            this.isShi = true;
            this.isFou = false;
            this.isOther = false;
            //加载关联数据
            // this.yyInit();
            // this.InitZLKS();
            // this.InitPTKS();
            this.OnLoading(true);
            setTimeout(()=>{
                this.InitSearchDatas(tempData);
            },3000);
            this.dispatchFn(false);
            var boxs = this.template.querySelectorAll('lightning-combobox');
            boxs.forEach(fileInput=>{
                fileInput.disabled = false;
            })
        } else if(tempData.IsRelateProject__c == "否"){
            this.isShi = false;
            this.isFou = true;
            this.dispatchFn(true);
@@ -241,20 +280,20 @@
        }else {temp --;}
        //判断是否有医院3
        // if (tempData.Hospital3__c != undefined) {
        //     this.template.querySelector('[data-parent-id="lookupyy3"]').setvalue(tempData.Hospital3__c);
        //     this.yyId3 = tempData.Hospital3__c;
        //     this.yyIdArrs[3] = this.yyId3;
        //     temp --;
        // }else {temp --;}
        if (tempData.Hospital3__c != undefined) {
            this.template.querySelector('[data-parent-id="lookupyy3"]').setvalue(tempData.Hospital3__c);
            this.yyId3 = tempData.Hospital3__c;
            this.yyIdArrs[3] = this.yyId3;
            temp --;
        }else {temp --;}
        // //判断是否有医院4
        // if (tempData.Hospital4__c != undefined) {
        //     this.template.querySelector('[data-parent-id="lookupyy4"]').setvalue(tempData.Hospital4__c);
        //     this.yyId4 = tempData.Hospital4__c;
        //     this.yyIdArrs[4] = this.yyId4;
        //     temp --;
        // }else {temp --;}
        if (tempData.Hospital4__c != undefined) {
            this.template.querySelector('[data-parent-id="lookupyy4"]').setvalue(tempData.Hospital4__c);
            this.yyId4 = tempData.Hospital4__c;
            this.yyIdArrs[4] = this.yyId4;
            temp --;
        }else {temp --;}
        //判断是否有项目负责人