From 26ad084e248b21ced76e6226ab2a32db53f582b9 Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期三, 26 四月 2023 13:37:50 +0800
Subject: [PATCH] tt
---
force-app/main/default/lwc/lexOSHNogoods/__tests__/lexOSHNogoods.test.js | 25 ++
force-app/main/default/lwc/lexSelectAssetsMaintenance/__tests__/lexSelectAssetsMaintenance.test.js | 25 ++
force-app/main/default/lwc/lexCopyPIOnCall/__tests__/lexCopyPIOnCall.test.js | 25 ++
force-app/main/default/classes/buttonRepairSubOrderCtl.cls | 28 ++
force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js | 90 +++++++
force-app/main/default/classes/buttonQISSCReportCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js | 15 -
force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js | 52 ++++
force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js | 53 ++++
force-app/main/default/classes/otherButtonRepairController.cls | 7
force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html | 6
force-app/main/default/classes/buttonQISReportCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.html | 5
force-app/main/default/classes/buttonQISReportCtl.cls | 162 +++++++++++++
force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js | 21 +
force-app/main/default/classes/buttonRepairQuotationCtl.cls | 55 ++++
force-app/main/default/classes/buttonQISSCReportCtl.cls | 41 +++
force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js-meta.xml | 11
force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.html | 6
force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.html | 5
force-app/main/default/classes/buttonRepairSubOrderCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js-meta.xml | 11
force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js-meta.xml | 11
23 files changed, 649 insertions(+), 20 deletions(-)
diff --git a/force-app/main/default/classes/buttonQISReportCtl.cls b/force-app/main/default/classes/buttonQISReportCtl.cls
new file mode 100644
index 0000000..364dfe5
--- /dev/null
+++ b/force-app/main/default/classes/buttonQISReportCtl.cls
@@ -0,0 +1,162 @@
+public with sharing class buttonQISReportCtl {
+ public buttonQISReportCtl() {
+
+ }
+
+ @AuraEnabled
+ public static InitData init(String recordId){
+ InitData res = new initData();
+ try{
+ QIS_Report__c report = [SELECT QIS_Status__c,PAE_DetermineAC__c,AE_DetermineResult__c,ETQ_UPLOAD_STATUS__c,QIS_final_judgement__c,OCM_judgement__c,PAE_Determine__c,Id FROM QIS_Report__c WHERE Id =: recordId LIMIT 1];
+ res.PAEDetermineC = report.PAE_Determine__c;
+ res.PAEDetermineACC = report.PAE_DetermineAC__c;
+ res.OCMJudgementC = report.OCM_judgement__c;
+ res.QISFinalJudgementC = report.QIS_final_judgement__c;
+ res.ETQUPLOADSTATUSC = report.ETQ_UPLOAD_STATUS__c;
+ res.AEDetermineResultC = report.AE_DetermineResult__c;
+ res.Id = report.Id;
+ res.QISStatusC = report.QIS_Status__c;
+ res.userId = UserInfo.getUserId();
+ res.email = UserInfo.getUserEmail();
+ res.profileId = UserInfo.getProfileId();
+ }catch(Exception e){
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
+ // 鏍规嵁ID淇悊鎶ヤ环鎻愪氦
+ @AuraEnabled
+ public static String updateOSHNogoods(String Id,String email,String userId){
+ List<User> user = new List<User>();
+ user = [SELECT Id,Alias from User];
+
+ String res ='';
+ try {
+ QIS_Report__c rac = new QIS_Report__c();
+ rac.Id = Id;
+ rac.QIS_Status__c = 'OSH妫�娴嬩腑';
+ rac.OSHRecievedDate__c = Date.today();
+ rac.OSH_Receive_staff__c = user[0].Alias;
+ rac.OSH_staff__c = user[0].Alias;
+ rac.OSH_staff_email__c = email;
+ rac.Is_ProductGot__c = true;
+ rac.OSH_GotProductPeople__c = userId;
+
+ List<User> records = new List<User>();
+ records = [SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id=: userId ];
+ if (records != null && records.size() > 0 && records[0].JingliApprovalManager__c != null&& records[0].BuchangApprovalManager__c != null) {
+ rac.OSH_Manager__c= records[0].JingliApprovalManager__c;
+ rac.OSH_Buzhang__c= records[0].BuchangApprovalManager__c;
+ } else {
+ rac.OSH_Manager__c= userId;
+ rac.OSH_Buzhang__c= userId;
+ }
+ rac.OSHInspectionDate__c = Date.today();
+ rac.OSH_Nogoods__c = true;
+ update rac;
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ res = e.getMessage();
+ }
+ return res;
+ }
+
+ @AuraEnabled
+ public static String sendToETQ(String iflog_Id,BatchIF_Log__c rowDataSFDC, List<String> repairIds,String statu){
+ List<QIS_Report__c> temp = [select id from QIS_Report__c where id in :repairIds ];
+ if(temp != null && temp.size() > 0){
+ try {
+ Database.executeBatch(new QISToPDFBatch(iflog_Id, rowDataSFDC,repairIds,statu),50); //鐢熸垚PDF
+ }
+ catch (Exception e) {
+ return '鏇存柊QIS鎶ラ敊:'+ e.getMessage();
+ }
+ }else{
+ BatchIF_Log__c iflog = new BatchIF_Log__c();
+ iflog.Type__c = 'sendToETQ';
+ iflog.ErrorLog__c = '';
+ iflog.Log__c = 'NFM401WebService start--';
+
+ Repair__c updateRe = new Repair__c();
+ updateRe.Id = repairIds[0];
+ updateRe.INTERFACE_RECORD_ID__c = null;
+ updateRe.ETQ_UPLOAD_STATUS__c = null;
+ updateRe.ETQ_UPLOAD_MESSAGE__c = null;
+ updateRe.OSH_ConfirmationDate__c = Date.today();
+ updateRe.OSH_Affirmant__c = UserInfo.getUserId();
+ updateRe.AWS_Interface_Time__c = Datetime.now();
+ updateRe.AsyncData__c = true;
+ try{
+ update updateRe;
+ Database.executeBatch(new RepairToPDFBatch(iflog_Id, rowDataSFDC,repairIds,statu)); //鐢熸垚PDF
+ iflog.Log__c += '\n淇悊:'+updateRe+' 鏇存柊鎴愬姛';
+ iflog.Log__c = '\nNFM401WebService end--';
+ insert iflog;
+ }catch(Exception ex){
+ iflog.ErrorLog__c += '淇悊:'+updateRe+' 鏇存柊澶辫触,鍥犱负::'+ex.getMessage();
+ iflog.Log__c = '\nNFM401WebService end--';
+ insert iflog;
+ return '鏇存柊淇悊鎶ラ敊:'+ ex.getMessage();
+ }
+ }
+ return '鍙戦�佹垚鍔�!';
+ }
+
+ // 鏍规嵁ID淇悊鎶ヤ环鎻愪氦
+ @AuraEnabled
+ public static void updateQISReportC(String QId,String uid){
+ try {
+ QIS_Report__c rac = new QIS_Report__c();
+ rac.Id = QId;
+ rac.INTERFACE_RECORD_ID__c = null;
+ rac.ETQ_UPLOAD_STATUS__c = null;
+ rac.ETQ_UPLOAD_MESSAGE__c = null;
+ rac.AsyncData__c = true;
+ rac.AWS_Interface_Time__c = Datetime.now();
+ rac.OSH_ConfirmationDate__c = Date.today();
+ rac.OSH_Affirmant__c = uid;
+ update rac;
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ }
+
+ // 鏍规嵁ID淇悊鎶ヤ环鎻愪氦
+ @AuraEnabled
+ public static List<QIS_Report__c> selectQISReportC(String QId){
+ List<QIS_Report__c> res = new List<QIS_Report__c>();
+ try {
+ res = [SELECT Id,AsyncData__c,Complaint_Number__c,ETQ_UPLOAD_STATUS__c from QIS_Report__c where Id=: QId ];
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
+ public class InitData{
+ @AuraEnabled
+ public String Id;
+ @AuraEnabled
+ public String QISStatusC;
+ @AuraEnabled
+ public String userId;
+ @AuraEnabled
+ public String email;
+ @AuraEnabled
+ public String profileId;
+ @AuraEnabled
+ public String PAEDetermineC;
+ @AuraEnabled
+ public String PAEDetermineACC;
+ @AuraEnabled
+ public String OCMJudgementC;
+ @AuraEnabled
+ public String QISFinalJudgementC;
+ @AuraEnabled
+ public String ETQUPLOADSTATUSC;
+ @AuraEnabled
+ public String AEDetermineResultC;
+
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonQISReportCtl.cls-meta.xml b/force-app/main/default/classes/buttonQISReportCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/buttonQISReportCtl.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonQISSCReportCtl.cls b/force-app/main/default/classes/buttonQISSCReportCtl.cls
new file mode 100644
index 0000000..8704763
--- /dev/null
+++ b/force-app/main/default/classes/buttonQISSCReportCtl.cls
@@ -0,0 +1,41 @@
+public with sharing class buttonQISSCReportCtl {
+ public buttonQISSCReportCtl() {
+
+ }
+
+ @AuraEnabled
+ public static InitData init(String recordId){
+ InitData res = new initData();
+ try{
+ QIS_SC_Report__c report = [SELECT Status__c,Id FROM QIS_SC_Report__c WHERE Id =: recordId LIMIT 1];
+ System.debug(LoggingLevel.INFO, '*** opp: ' + report);
+ res.Id = report.Id;
+ res.StatusC = report.Status__c;
+
+ System.debug(LoggingLevel.INFO, '*** res: ' + res);
+ }catch(Exception e){
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
+ // 鏍规嵁ID淇敼QIS甯傚満閮�
+ @AuraEnabled
+ public static void updateQISSCReport(String Id){
+ try {
+ QIS_SC_Report__c qis_Sc = new QIS_SC_Report__c();
+ qis_Sc.Id = Id;
+ qis_Sc.Status__c = '宸叉彁浜�';
+ update qis_Sc;
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ }
+
+ public class InitData{
+ @AuraEnabled
+ public String Id;
+ @AuraEnabled
+ public String StatusC;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonQISSCReportCtl.cls-meta.xml b/force-app/main/default/classes/buttonQISSCReportCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/buttonQISSCReportCtl.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonRepairQuotationCtl.cls b/force-app/main/default/classes/buttonRepairQuotationCtl.cls
index 061b409..e7213e6 100644
--- a/force-app/main/default/classes/buttonRepairQuotationCtl.cls
+++ b/force-app/main/default/classes/buttonRepairQuotationCtl.cls
@@ -7,10 +7,13 @@
public static InitData init(String recordId){
InitData res = new initData();
try{
- Repair_Quotation__c report = [SELECT Id,CutPriceStatus_Service__c FROM Repair_Quotation__c WHERE Id =: recordId LIMIT 1];
+ Repair_Quotation__c report = [SELECT Repair__c,Loaner_repair_sys__c,Rental_Apply_Discount_Status__c,Id,CutPriceStatus_Service__c FROM Repair_Quotation__c WHERE Id =: recordId LIMIT 1];
System.debug(LoggingLevel.INFO, '*** opp: ' + report);
+ res.RepairC = report.Repair__c;
+ res.LoanerRepairSysC = report.Loaner_repair_sys__c;
res.Id = report.Id;
res.CutPriceStatusServiceC = report.CutPriceStatus_Service__c;
+ res.RentalApplyDiscountStatusC = report.Rental_Apply_Discount_Status__c;
res.profileId = UserInfo.getProfileId();
System.debug(LoggingLevel.INFO, '*** res: ' + res);
@@ -51,6 +54,50 @@
return res;
}
+ // 鏍规嵁ID淇悊鎶ヤ环鎻愪氦
+ @AuraEnabled
+ public static String updateRepairQuotation03(String recordId){
+ String res ='';
+ try {
+ Repair_Quotation__c repair = new Repair_Quotation__c();
+ repair.Id = recordid;
+ repair.Rental_Apply_Discount_Status__c = '宸叉彁浜�';
+ update repair;
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ res = e.getMessage();
+ }
+ return res;
+ }
+
+ // 鏍规嵁ID淇悊鎶ヤ环鎻愪氦
+ @AuraEnabled
+ public static String updateRepairQuotation04(String recordId){
+ String res ='';
+ try {
+ Repair_Quotation__c repair = new Repair_Quotation__c();
+ repair.Id = recordid;
+ repair.Repair_quotation_status__c = '鍑忎环鐢宠濉啓瀹屾瘯';
+ update repair;
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ res = e.getMessage();
+ }
+ return res;
+ }
+
+ // 鏌ユ壘淇悊
+ @AuraEnabled
+ public static List<Repair__c> selectRepairC(String recordId){
+ List<Repair__c> res = new List<Repair__c>();
+ try{
+ res = [SELECT Id, Return_Without_Repair__c, Return_Without_Repair_IF__c FROM Repair__c WHERE Id=: recordId ];
+ }catch(Exception e){
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
public class InitData{
@AuraEnabled
public String Id;
@@ -58,5 +105,11 @@
public String CutPriceStatusServiceC;
@AuraEnabled
public String profileId;
+ @AuraEnabled
+ public String RentalApplyDiscountStatusC;
+ @AuraEnabled
+ public Boolean LoanerRepairSysC;
+ @AuraEnabled
+ public String RepairC;
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonRepairSubOrderCtl.cls b/force-app/main/default/classes/buttonRepairSubOrderCtl.cls
new file mode 100644
index 0000000..6569071
--- /dev/null
+++ b/force-app/main/default/classes/buttonRepairSubOrderCtl.cls
@@ -0,0 +1,28 @@
+public with sharing class buttonRepairSubOrderCtl {
+ public buttonRepairSubOrderCtl() {
+
+ }
+
+ @AuraEnabled
+ public static InitData init(String recordId){
+ InitData res = new initData();
+ try{
+ RepairSubOrder__c report = [SELECT Id,Status__c FROM RepairSubOrder__c WHERE Id =: recordId LIMIT 1];
+ System.debug(LoggingLevel.INFO, '*** opp: ' + report);
+ res.Id = report.Id;
+ res.StatusC = report.Status__c;
+
+ System.debug(LoggingLevel.INFO, '*** res: ' + res);
+ }catch(Exception e){
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
+ public class InitData{
+ @AuraEnabled
+ public String Id;
+ @AuraEnabled
+ public String StatusC;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/buttonRepairSubOrderCtl.cls-meta.xml b/force-app/main/default/classes/buttonRepairSubOrderCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/buttonRepairSubOrderCtl.cls-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <status>Active</status>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/otherButtonRepairController.cls b/force-app/main/default/classes/otherButtonRepairController.cls
index 7e007a7..986cab3 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls
+++ b/force-app/main/default/classes/otherButtonRepairController.cls
@@ -141,7 +141,8 @@
// 鏍规嵁ID淇敼淇悊
@AuraEnabled
- public static void updateRepair(String recordId){
+ public static String updateRepair(String recordId){
+ String res;
try {
Repair__c repair = new Repair__c();
repair.Id = recordid;
@@ -149,8 +150,10 @@
update repair;
} catch (Exception e) {
System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ res=e.getMessage();
}
- }
+ return res;
+ }
// 淇敼楠屾敹鍗�
@AuraEnabled
diff --git a/force-app/main/default/lwc/lexCopyPIOnCall/__tests__/lexCopyPIOnCall.test.js b/force-app/main/default/lwc/lexCopyPIOnCall/__tests__/lexCopyPIOnCall.test.js
new file mode 100644
index 0000000..4ecaaab
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIOnCall/__tests__/lexCopyPIOnCall.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexCopyPIOnCall from 'c/lexCopyPIOnCall';
+
+describe('c-lex-copy-pi-on-call', () => {
+ afterEach(() => {
+ // The jsdom instance is shared across test cases in a single file so reset the DOM
+ while (document.body.firstChild) {
+ document.body.removeChild(document.body.firstChild);
+ }
+ });
+
+ it('TODO: test case generated by CLI command, please fill in test logic', () => {
+ // Arrange
+ const element = createElement('c-lex-copy-pi-on-call', {
+ is: LexCopyPIOnCall
+ });
+
+ // Act
+ document.body.appendChild(element);
+
+ // Assert
+ // const div = element.shadowRoot.querySelector('div');
+ expect(1).toBe(1);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.html b/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js b/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js
new file mode 100644
index 0000000..700808a
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js
@@ -0,0 +1,52 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/buttonOnCallCtl.init';
+
+export default class LexCopyPIOnCall extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback() {
+ init({
+ recordId: this.recordId
+ }).then(result => {
+ console.log(result);
+ if (result != null) {
+ this.IsLoading = false;
+ this.Id = result.Id;
+
+ this.CopyPI();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ })
+ }
+
+ //澶嶅埗
+ CopyPI() {
+ window.location.href = '/' + this.Id + '/e?newclone=1';
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js-meta.xml b/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIOnCall/lexCopyPIOnCall.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html b/force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
@@ -0,0 +1,6 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
index 4ae611c..0c3c21f 100644
--- a/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
+++ b/force-app/main/default/lwc/lexCustomDelete/lexCustomDelete.js
@@ -12,7 +12,9 @@
import init from '@salesforce/apex/otherButtonRepairController.init';
import selectCustomDeleteById from '@salesforce/apex/otherButtonRepairController.selectCustomDeleteById';
import deleteRepair from '@salesforce/apex/otherButtonRepairController.deleteRepair';
-
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
export default class LexCustomDelete extends LightningElement {
@api recordId;
@@ -63,13 +65,13 @@
rp.Status__c != "1.鍙楃悊瀹屾瘯(SAP寰呭彂閫�)" &&
rp.Status__c != "4.淇悊鍝佽繑閫侀樁娈�"
) {
- alert("涓嶆槸鑽夋涓紝涓嶈兘鍒犻櫎");
+ this.ShowToastEvent("涓嶆槸鑽夋涓紝涓嶈兘鍒犻櫎", "error")
} else if (rp.Status__c == "4.淇悊鍝佽繑閫侀樁娈�" &&
- (rp.SAP_Transfer_time__c != "" || rp.Repair_Ordered_Date__c != "")
+ (rp.SAP_Transfer_time__c != undefined || rp.Repair_Ordered_Date__c != undefined)
) {
- alert("宸茬粡鍙戦�佽繃SAP锛屼笉鑳藉垹闄�");
+ this.ShowToastEvent("宸茬粡鍙戦�佽繃SAP锛屼笉鑳藉垹闄�", "error")
} else if (this.userID.substring(0, 15) != rp.CreatedById.substring(0, 15) && this.userID.substring(0, 15) != rp.Acc_OwnerId__c.substring(0, 15) && this.userID.substring(0, 15) != rp.FSE_ownerid__c.substring(0, 15)) {
- alert("涓嶆槸鎵�鏈変汉銆佸垱寤轰汉鎴朏SE涓昏礋璐d汉锛屼笉鑳藉垹闄�");
+ this.ShowToastEvent("涓嶆槸鎵�鏈変汉銆佸垱寤轰汉鎴朏SE涓昏礋璐d汉锛屼笉鑳藉垹闄�", "error")
} else {
if (confirm("鏄惁纭畾锛�")) {
deleteRepair({
@@ -86,4 +88,13 @@
}
})
}
+
+ ShowToastEvent(msg, type) {
+ const event = new ShowToastEvent({
+ title: '',
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ }
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHNogoods/__tests__/lexOSHNogoods.test.js b/force-app/main/default/lwc/lexOSHNogoods/__tests__/lexOSHNogoods.test.js
new file mode 100644
index 0000000..1e819d2
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHNogoods/__tests__/lexOSHNogoods.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexOSHNogoods from 'c/lexOSHNogoods';
+
+describe('c-lex-osh-nogoods', () => {
+ afterEach(() => {
+ // The jsdom instance is shared across test cases in a single file so reset the DOM
+ while (document.body.firstChild) {
+ document.body.removeChild(document.body.firstChild);
+ }
+ });
+
+ it('TODO: test case generated by CLI command, please fill in test logic', () => {
+ // Arrange
+ const element = createElement('c-lex-osh-nogoods', {
+ is: LexOSHNogoods
+ });
+
+ // Act
+ document.body.appendChild(element);
+
+ // Assert
+ // const div = element.shadowRoot.querySelector('div');
+ expect(1).toBe(1);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.html b/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.html
new file mode 100644
index 0000000..aaa4cbd
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.html
@@ -0,0 +1,6 @@
+<template>
+ <div class="toReportHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js b/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js
new file mode 100644
index 0000000..c8ce47e
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js
@@ -0,0 +1,90 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/buttonQISReportCtl.init';
+import updateOSHNogoods from '@salesforce/apex/buttonQISReportCtl.updateOSHNogoods';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
+export default class LexOSHNogoods extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ QISStatusC;
+ userId;
+ email;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback() {
+ init({
+ recordId: this.recordId
+ }).then(result => {
+ console.log(result);
+ if (result != null) {
+ this.IsLoading = false;
+ this.Id = result.Id;
+ this.QISStatusC = result.QISStatusC;
+ this.userId = result.userId;
+ this.email = result.email;
+
+ this.OSHNogoods();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ })
+ }
+
+ // 鍑忎环鐢宠
+ OSHNogoods() {
+ if (this.QISStatusC != 'OSH妫�娴嬬敵璇�' && this.QISStatusC != '瀹屾瘯') {
+ this.ShowToastEvent("OSH宸茬粡鏀跺埌瀹炵墿", "error")
+ // alert('OSH宸茬粡鏀跺埌瀹炵墿');
+ } else {
+ updateOSHNogoods({
+ Id: this.Id,
+ email: this.email,
+ userId: this.userId
+ }).then(result => {
+ console.log(result);
+ if (result.length > 0) {
+ var split = result.split(", ");
+ alert(split[1]);
+ }
+ location.reload();
+ }).catch(error => {
+ console.log(error);
+ })
+ }
+ }
+
+ // 寮圭獥
+ ShowToastEvent(msg, type) {
+ const event = new ShowToastEvent({
+ title: '',
+ message: msg,
+ variant: type
+ });
+ this.dispatchEvent(event);
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js-meta.xml b/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexOSHNogoods/lexOSHNogoods.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetsMaintenance/__tests__/lexSelectAssetsMaintenance.test.js b/force-app/main/default/lwc/lexSelectAssetsMaintenance/__tests__/lexSelectAssetsMaintenance.test.js
new file mode 100644
index 0000000..2b62f83
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetsMaintenance/__tests__/lexSelectAssetsMaintenance.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexSelectAssetsMaintenance from 'c/lexSelectAssetsMaintenance';
+
+describe('c-lex-select-assets-maintenance', () => {
+ afterEach(() => {
+ // The jsdom instance is shared across test cases in a single file so reset the DOM
+ while (document.body.firstChild) {
+ document.body.removeChild(document.body.firstChild);
+ }
+ });
+
+ it('TODO: test case generated by CLI command, please fill in test logic', () => {
+ // Arrange
+ const element = createElement('c-lex-select-assets-maintenance', {
+ is: LexSelectAssetsMaintenance
+ });
+
+ // Act
+ document.body.appendChild(element);
+
+ // Assert
+ // const div = element.shadowRoot.querySelector('div');
+ expect(1).toBe(1);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.html b/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js b/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js
new file mode 100644
index 0000000..21cb5c4
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js
@@ -0,0 +1,53 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init';
+
+export default class LexSelectAssetsMaintenance extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordId = str;
+ }
+ }
+ }
+
+ connectedCallback() {
+ console.log(this.recordId);
+ init({
+ recordId: this.recordId
+ }).then(result => {
+ console.log(result);
+ if (result != null) {
+ this.IsLoading = false;
+ this.Id = result.Id;
+
+ this.SelectAssets();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ })
+ }
+
+ // 銈点兗銉撱偣濂戠磩瀵捐薄瑁藉搧鐧婚尣
+ SelectAssets() {
+ window.open("/apex/SelectAsset?targetContractId=" + this.Id, "_top");
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js-meta.xml b/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>54.0</apiVersion>
+ <isExposed>true</isExposed>
+ <targets>
+ <target>lightning__RecordPage</target>
+ <target>lightning__AppPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ </targets>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js b/force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js
index ee1cc09..95bfd52 100644
--- a/force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js
+++ b/force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js
@@ -1,9 +1,7 @@
-import { LightningElement,wire,track,api} from 'lwc';
+import { LightningElement,wire,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
-import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import { updateRecord } from 'lightning/uiRecordApi';
import init from '@salesforce/apex/QISReportController.initForlexcopyQISButton';
@@ -17,15 +15,10 @@
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
- console.log(111);
- console.log(currentPageReference);
-
if (currentPageReference) {
const urlValue = currentPageReference.state.recordId;
if (urlValue) {
let str = `${urlValue}`;
- console.log("str");
- console.log(str);
this.recordId = str;
}
}
@@ -54,8 +47,6 @@
this.dispatchEvent(new CloseActionScreenEvent());
}).catch(error => {
console.log('error='+error);
- }).finally(() => {
-
- });
+ })
}
-}
\ No newline at end of file
+}
\ No newline at end of file
--
Gitblit v1.9.1