From 07390e2fcb4adf27c928335bf27ae7939c5a80ad Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 23 五月 2023 11:28:12 +0800
Subject: [PATCH] bakcup20230523

---
 force-app/main/default/lwc/lexSendQISToEtQ/lexSendQISToEtQ.js |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/force-app/main/default/lwc/lexSendQISToEtQ/lexSendQISToEtQ.js b/force-app/main/default/lwc/lexSendQISToEtQ/lexSendQISToEtQ.js
index 30ae41a..8cee80b 100644
--- a/force-app/main/default/lwc/lexSendQISToEtQ/lexSendQISToEtQ.js
+++ b/force-app/main/default/lwc/lexSendQISToEtQ/lexSendQISToEtQ.js
@@ -13,7 +13,7 @@
 import sendToETQ from '@salesforce/apex/buttonQISReportCtl.sendToETQ';
 import updateQISReportC from '@salesforce/apex/buttonQISReportCtl.updateQISReportC';
 import selectQISReportC from '@salesforce/apex/buttonQISReportCtl.selectQISReportC';
-
+import initSelectProfile from '@salesforce/apex/otherButtonRepairController.initSelectProfile';
 import {
     ShowToastEvent
 } from 'lightning/platformShowToastEvent';
@@ -31,6 +31,7 @@
     QISFinalJudgementC;
     ETQUPLOADSTATUSC;
     AEDetermineResultC;
+    profileName;
 
     @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
@@ -60,8 +61,17 @@
                 this.ETQUPLOADSTATUSC = result.ETQUPLOADSTATUSC;
                 this.AEDetermineResultC = result.AEDetermineResultC;
 
-                this.myDate();
-                this.myReload();
+                initSelectProfile({
+                    profileId: this.profileId
+                }).then(result => {
+                    if (result != null) {
+                        this.IsLoading = false;
+                        this.profileName = result[0].Name;
+
+                        this.myDate();
+                        this.myReload();
+                    }
+                })
                 this.dispatchEvent(new CloseActionScreenEvent());
             }
         }).catch(error => {
@@ -79,24 +89,22 @@
 
     // 鍙戦�丵IS鍒癊tQ	
     SendQISToEtQ() {
+        console.log(this.profileName);
         var QId = this.Id;
         var uid = this.userId;
 
-        if (this.profileId != "00e10000000xnoO" && this.profileId != "00e10000000hl7w") {
+        if (this.profileName != "2F7_OSH鎷呭綋" && this.profileName != "2F7_OSH璐ㄩ噺娉曡") {
             alert("鎮ㄦ病鏈夊彂閫丵IS鍒癊tQ鐨勬潈闄愩��");
             return;
         }
-
         if (this.PAEDetermineC == undefined) {
             alert("OCSM QARA鐨凱AE鍒ゅ畾鏄┖鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ銆�");
             return;
         }
-
         if (this.AEDetermineResultC == "nonAE" && this.PAEDetermineC == "nonPAE" && this.PAEDetermineACC == "nonPAE" && this.OCMJudgementC == undefined && this.QISFinalJudgementC == undefined) {
             alert("nonAE骞秐onPAE鐨凲IS鍚屾鍒癊tQ鐨勬椂鍊欙紝妫�娴嬬粨璁�(OCSM)鏄繀濉殑銆備笉鍙互鍙戦�佸埌EtQ銆�");
             return;
         }
-
         if (this.ETQUPLOADSTATUSC == "3") {
             if (!confirm("鏄惁娓呯┖EtQ鍚屾鐘舵�侊紝閲嶆柊鍚屾鏁版嵁锛�")) {
                 return;
@@ -158,7 +166,8 @@
         selectQISReportC({
             QId: this.Id
         }).then(record => {
-            if (record.AsyncData__c == 'true' && record.ETQ_UPLOAD_STATUS__c != '3' || record.Complaint_Number__c != null) {
+        console.log(record);
+            if (record[0].AsyncData__c == 'true' && record[0].ETQ_UPLOAD_STATUS__c != '3' || record[0].Complaint_Number__c != null) {
                 var btns = document.getElementsByName("sendqistoetq");
                 for (var i = 0; i < btns.length; i++) {
                     btns[i].disabled = true;
@@ -166,7 +175,7 @@
                 }
                 alert('璇IS涔嬪墠宸茬粡鍙戦�佽繃浜�')
             } else {
-                SendQISToEtQ();
+                this.SendQISToEtQ();
             }
         })
     }

--
Gitblit v1.9.1