From ecf60bb0cd5a04ce38120302be4cf55fd3c3a27b Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期二, 04 四月 2023 16:23:38 +0800
Subject: [PATCH] 返品限制条件验证

---
 force-app/main/default/lwc/relevant/relevant.js |   67 ++++++++++++++++++++++++++-------
 1 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/force-app/main/default/lwc/relevant/relevant.js b/force-app/main/default/lwc/relevant/relevant.js
index 6ec83e4..37f9cee 100644
--- a/force-app/main/default/lwc/relevant/relevant.js
+++ b/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 --;}
 
 
         //鍒ゆ柇鏄惁鏈夐」鐩礋璐d汉

--
Gitblit v1.9.1