From 626f3c3bb25e204568019e8d568e2d7547d1037a Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期三, 09 八月 2023 10:54:08 +0800
Subject: [PATCH] 20230809修改伟意按钮同步

---
 force-app/main/default/lwc/lexApplyForRepair/lexApplyForRepair.js |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/lwc/lexApplyForRepair/lexApplyForRepair.js b/force-app/main/default/lwc/lexApplyForRepair/lexApplyForRepair.js
index 40da9e3..f99da45 100644
--- a/force-app/main/default/lwc/lexApplyForRepair/lexApplyForRepair.js
+++ b/force-app/main/default/lwc/lexApplyForRepair/lexApplyForRepair.js
@@ -10,11 +10,12 @@
     CloseActionScreenEvent
 } from 'lightning/actions';
 import init from '@salesforce/apex/buttonRepairSubOrderCtl.init';
+import { NavigationMixin } from 'lightning/navigation';
 import {
     ShowToastEvent
 } from 'lightning/platformShowToastEvent';
 
-export default class LexApplyForRepair extends LightningElement {
+export default class lexApplyForRepair extends NavigationMixin(LightningElement) {
     @api recordId;
     str;
     IsLoading = true;
@@ -36,7 +37,7 @@
         init({
             recordId: this.recordId
         }).then(result => {
-            console.log(result);
+            // console.log(result);
             if (result != null) {
                 this.IsLoading = false;
                 this.Id = result.Id;
@@ -47,9 +48,7 @@
             }
         }).catch(error => {
             console.log(error);
-        }).finally(() => {
-
-        });
+        })
     }
 
     //鐢宠淇悊
@@ -57,11 +56,25 @@
         var status = this.StatusC;
         if (status != '寰呭鐞�') {
             this.ShowToastEvent("鎶ヤ慨瀛愬崟鐨勭姸鎬佷笉鏄� 寰呭鐞� 鏃犳硶鐢宠淇悊", "error")
-            // alert('鎶ヤ慨瀛愬崟鐨勭姸鎬佷笉鏄� 寰呭鐞� 鏃犳硶鐢宠淇悊');
             return;
         }
-        var url = '/apex/ChoiceAsset?Id=' + this.Id + '&Type=Repair';
-        window.open(url, '鐢宠淇悊', 'height=700, width=1000, top=200, left=200, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
+        const paramMap = {
+                Id: this.recordId// 娣诲姞鍙傛暟鍒癠RL涓紝鏇挎崲paramName鍜宲aramValue涓哄疄闄呯殑鍙傛暟鍚嶅拰鍊�
+              };
+        this[NavigationMixin.Navigate]({
+            type: 'standard__webPage',
+            attributes: {
+              url: '/lightning/n/Tab5',
+              target: '_blank' // 鏇挎崲涓轰綘鐨勮嚜瀹氫箟椤甸潰鐨凙PI鍚嶇О鎴朥RL
+            },
+            state: {
+              params: JSON.stringify(paramMap)
+            }
+          });
+        
+
+        // var url = '/apex/ChoiceAsset?Id=' + this.Id + '&Type=Repair';
+        // window.open(url, '鐢宠淇悊', 'height=700, width=1000, top=200, left=200, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
     }
 
     ShowToastEvent(msg, type) {

--
Gitblit v1.9.1