From fd9df05c48c09b4d7f39a3b401882bda226dedea Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 31 十月 2023 20:38:18 +0800
Subject: [PATCH] 近期修改

---
 force-app/main/default/lwc/tBidding/tBidding.js |   71 ++++++++++++++++++++++++++---------
 1 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/force-app/main/default/lwc/tBidding/tBidding.js b/force-app/main/default/lwc/tBidding/tBidding.js
index fc8119c..51fcbbc 100644
--- a/force-app/main/default/lwc/tBidding/tBidding.js
+++ b/force-app/main/default/lwc/tBidding/tBidding.js
@@ -1,14 +1,16 @@
-import { LightningElement, track } from 'lwc';
+import { LightningElement, track,api } from 'lwc';
 import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
 import SaveDataYB from '@salesforce/apex/InspectCheckController.SaveDataYB';
 import ChangeDataYB from '@salesforce/apex/InspectCheckController.ChangeDataYB';
 import GetIrresponsibleReason from '@salesforce/apex/InspectCheckController.GetIrresponsibleReason';
 import GetproInvolvedManual from '@salesforce/apex/InspectCheckController.GetproInvolvedManual';
-
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { CloseActionScreenEvent } from 'lightning/actions';
 import CheckOwnerRequest from '@salesforce/apex/InspectCheckController.CheckOwner';
-
+import tnederDeletePageCss from '@salesforce/resourceUrl/tnederDeletePageCss';		
+import {loadStyle} from 'lightning/platformResourceLoader'	
 export default class Yb extends LightningElement {
-
+@api recordid;
 //鎻愮ず
 Tongzhishow=false;  //鎻愮ず鏄剧ず鐨勬爣璇�
 SaveShowText="鎿嶄綔鎴愬姛";  //鎻愮ず鏄剧ず鐨勬枃鏈�
@@ -59,7 +61,10 @@
     }
     ParamIdStr = ''
     connectedCallback(){
-        var paramId =  this.getQueryVariable('id');
+        Promise.all([			
+            loadStyle(this, tnederDeletePageCss)			
+        ]);
+        var paramId =  this.recordid;
         if (paramId == null || paramId == '') {
             return ;
         }
@@ -129,7 +134,7 @@
 
 
     @track InspectData = {}; //鏁版嵁
-    IsSQZ = false; //鐢宠涓殑鏍囪瘑
+    IsSQZ = true; //鐢宠涓殑鏍囪瘑
     IsSQZButton = false;
     GetInspectByIdFn(Id)
     {
@@ -213,14 +218,19 @@
                 //20220914 you SWAG-CJ3DS5 end
                 debugger;
                 if (tempData.NotBidApprovalStatus__c == '鐢宠涓�') {
-                    setTimeout(()=>{
+                    // setTimeout(()=>{
                         this.IsSQZ = true;
                         this.IsSQZButton = true;
                         this.IsBC = true;
                         this.IsYSJE = true;
                         this.IsSJCP = true;
-                    },1000)
-              
+                    // },1000)
+                }else{
+                    this.IsSQZ = false;
+                    this.IsSQZButton = false;
+                    this.IsBC = false;
+                    this.IsYSJE = false;
+                    this.IsSJCP = false;
                 }
 
                 this.InspectData =tempData;
@@ -326,7 +336,7 @@
     }
   //杈撳叆妗� 鏈緭鍏ュ睍绀虹殑鍊�
     BCIsShow = false;
-    IsBC = false;
+    IsBC = true;
     handleBCSMFn(event)
     {
         var value = event.target.value;
@@ -351,7 +361,7 @@
     //
     SJCPIsShow = false;
     SJCPIsContent = '';
-    IsSJCP = false;
+    IsSJCP = true;
     handleSJCPFN(event)
     {
         var value = event.target.value;
@@ -397,30 +407,55 @@
             if (temp == 1) {
                 ChangeDataYB({JsonData:JSON.stringify(this.InspectData)}).then((response)=>{
                     if (response=="鎴愬姛") {
-                        this.Alert("鎻愪氦鎴愬姛");
+                        this.showToast("鎻愪氦鎴愬姛",'success');
                         this.IsSQZ = true;
                         this.IsSQZButton = true;
                         this.IsBC = true;
                         this.IsYSJE = true;
-                        window.location.hash = "Refresh"+"=="+this.ParamIdStr;
+                        // window.open("/"+this.recordid)
+                        setTimeout(() => {
+                            window.location.href = '/'+this.recordid
+                        },1000)
+                        // window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                     }else{
-                        this.Alert(response,true);
+                        this.showToast(response,'error');
                     }
                 });
             }else
             {
                 SaveDataYB({JsonData:JSON.stringify(this.InspectData)}).then((response)=>{
                     if (response=="鎴愬姛") {
-                        this.Alert("淇濆瓨鎴愬姛",false,true);
-                        window.location.hash = "Refresh"+"=="+this.ParamIdStr;
+                        this.showToast("淇濆瓨鎴愬姛",'success');
+                        window.open("/"+this.recordid)
+                        setTimeout(() => {
+                            window.location.href = '/'+this.recordid
+                        },1000)
+                        // window.location.hash = "Refresh"+"=="+this.ParamIdStr;
                     }else{
-                        this.Alert(response,true);
+                        // this.showToast(response,'error');
                     }
                 });
             }
         }
     }
-
+    showToast(msg,type) {
+        if(type == "success"){
+            const event = new ShowToastEvent({
+                message: msg,
+                variant: type
+            });
+            this.dispatchEvent(event);
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }else{
+            const event = new ShowToastEvent({
+                message: msg,
+                variant: type,
+                mode:"sticky"
+            });
+            this.dispatchEvent(event);
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }
+    }
     CheckFn()
     {
         this.saveFn(null,1);

--
Gitblit v1.9.1