From d0b899c48eb14fdd6d8d5cb72a70aec785ddd4f9 Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期一, 10 四月 2023 14:59:07 +0800
Subject: [PATCH] TT
---
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js-meta.xml | 11
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js-meta.xml | 11
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js-meta.xml | 11
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js-meta.xml | 11
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js | 133 ++++
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js | 77 ++
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js | 79 ++
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.html | 6
force-app/main/default/lwc/lexOCSMToReportRepair/__tests__/lexOCSMToReportRepair.test.js | 25
force-app/main/default/lwc/lexSubmitForApproval/__tests__/lexSubmitForApproval.test.js | 25
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.html | 5
force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls-meta.xml | 5
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.html | 6
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js | 92 +++
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js | 54 +
force-app/main/default/lwc/lexASRCEditorRepair/__tests__/lexASRCEditorRepair.test.js | 25
force-app/main/default/lwc/lexProductRepairQuoteRepair/__tests__/lexProductRepairQuoteRepair.test.js | 25
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.html | 6
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.html | 5
force-app/main/default/lwc/lexInsPageBtn/__tests__/lexInsPageBtn.test.js | 25
force-app/main/default/lwc/lexPreContractSubmit/__tests__/lexPreContractSubmit.test.js | 25
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js | 102 +++
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js | 69 ++
force-app/main/default/lwc/lexCreateReportMaintenanceContract/__tests__/lexCreateReportMaintenanceContract.test.js | 25
force-app/main/default/lwc/lexYanshoudanRequest/__tests__/lexYanshoudanRequest.test.js | 25
force-app/main/default/lwc/lexOCSMNoToReportRepair/__tests__/lexOCSMNoToReportRepair.test.js | 25
force-app/main/default/lwc/lexSendRepairsToEtQ/__tests__/lexSendRepairsToEtQ.test.js | 25
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.html | 6
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js-meta.xml | 11
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js | 192 ++++++
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.html | 5
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js | 89 +++
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.html | 6
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js | 67 ++
force-app/main/default/lwc/lexCustomNewCopy2/__tests__/lexCustomNewCopy2.test.js | 25
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js | 75 ++
force-app/main/default/lwc/lexQuarterlyReport/__tests__/lexQuarterlyReport.test.js | 25
force-app/main/default/classes/otherButtonRepairController.cls-meta.xml | 2
force-app/main/default/lwc/lexCopyPIInspectionReport/__tests__/lexCopyPIInspectionReport.test.js | 25
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js-meta.xml | 11
force-app/main/default/lwc/lexPDFMaintenanceCommission/__tests__/lexPDFMaintenanceCommission.test.js | 25
force-app/main/default/lwc/lexUploadToRecognitionModel/__tests__/lexUploadToRecognitionModel.test.js | 25
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js-meta.xml | 11
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js-meta.xml | 11
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js-meta.xml | 11
force-app/main/default/lwc/lexUploadToSap/__tests__/lexUploadToSap.test.js | 25
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js-meta.xml | 11
force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls | 28 +
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.html | 6
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js-meta.xml | 11
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.html | 5
force-app/main/default/lwc/lexMailMessege/lexMailMessege.html | 5
force-app/main/default/lwc/lexMailMessege/__tests__/lexMailMessege.test.js | 25
53 files changed, 1,670 insertions(+), 1 deletions(-)
diff --git a/force-app/main/default/classes/otherButtonRepairController.cls-meta.xml b/force-app/main/default/classes/otherButtonRepairController.cls-meta.xml
index fbbad0a..9bbf7b4 100644
--- a/force-app/main/default/classes/otherButtonRepairController.cls-meta.xml
+++ b/force-app/main/default/classes/otherButtonRepairController.cls-meta.xml
@@ -2,4 +2,4 @@
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>56.0</apiVersion>
<status>Active</status>
-</ApexClass>
+</ApexClass>
\ No newline at end of file
diff --git a/force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls b/force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls
new file mode 100644
index 0000000..3cb0f27
--- /dev/null
+++ b/force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls
@@ -0,0 +1,28 @@
+public with sharing class otherButtonSpotInspectionReportCtl {
+ public otherButtonSpotInspectionReportCtl() {
+
+ }
+
+ @AuraEnabled
+ public static InitData init(String recordId){
+ InitData res = new initData();
+ try{
+ Inspection_Report__c report = [SELECT Id,RecordTypeId FROM Inspection_Report__c WHERE Id =: recordId LIMIT 1];
+ System.debug(LoggingLevel.INFO, '*** opp: ' + report);
+ res.Id = report.Id;
+ res.RecordTypeId = report.RecordTypeId;
+
+ 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 RecordTypeId;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls-meta.xml b/force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls-meta.xml
new file mode 100644
index 0000000..9bbf7b4
--- /dev/null
+++ b/force-app/main/default/classes/otherButtonSpotInspectionReportCtl.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/lwc/lexASRCEditorRepair/__tests__/lexASRCEditorRepair.test.js b/force-app/main/default/lwc/lexASRCEditorRepair/__tests__/lexASRCEditorRepair.test.js
new file mode 100644
index 0000000..d5c600d
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditorRepair/__tests__/lexASRCEditorRepair.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexASRCEditorRepair from 'c/lexASRCEditorRepair';
+
+describe('c-lex-asrc-editor-repair', () => {
+ 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-asrc-editor-repair', {
+ is: LexASRCEditorRepair
+ });
+
+ // 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/lexASRCEditorRepair/lexASRCEditorRepair.html b/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.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/lexASRCEditorRepair/lexASRCEditorRepair.js b/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js
new file mode 100644
index 0000000..8387edc
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js
@@ -0,0 +1,75 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+
+import init from '@salesforce/apex/otherButtonRepairController.init';
+import selectPAEDecisionRecord from '@salesforce/apex/otherButtonRepairController.selectPAEDecisionRecord';
+
+export default class LexASRCEditorRepair extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ RecordTypeId;
+
+ @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.RecordTypeId = result.RecordTypeId;
+
+ this.ASRCEditor();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // Intake universal code缂栬緫
+ ASRCEditor() {
+ var RecordTypeId = "ASRCDecision";
+ var RepairId = this.Id;
+ var url = '';
+ selectPAEDecisionRecord({
+ recordId: RepairId,
+ recordTypeId: RecordTypeId
+ }).then(result => {
+ if (result != null) {
+ if (result.length > 0) {
+ url = "/apex/PAEDecisionRecord?Id=" + result[0].Id + "&RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId;
+ } else {
+ url = "/apex/PAEDecisionRecord?RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId;
+ }
+ window.open(url, '_self');
+ }
+ }).catch(error => {
+ console.log(error);
+ })
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js-meta.xml b/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.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/lexCopyPIInspectionReport/__tests__/lexCopyPIInspectionReport.test.js b/force-app/main/default/lwc/lexCopyPIInspectionReport/__tests__/lexCopyPIInspectionReport.test.js
new file mode 100644
index 0000000..e21bfdf
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIInspectionReport/__tests__/lexCopyPIInspectionReport.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexCopyPIInspectionReport from 'c/lexCopyPIInspectionReport';
+
+describe('c-lex-copy-pi-inspection-report', () => {
+ 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-inspection-report', {
+ is: LexCopyPIInspectionReport
+ });
+
+ // 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/lexCreateReportMaintenanceContract/__tests__/lexCreateReportMaintenanceContract.test.js b/force-app/main/default/lwc/lexCreateReportMaintenanceContract/__tests__/lexCreateReportMaintenanceContract.test.js
new file mode 100644
index 0000000..c75ef3d
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateReportMaintenanceContract/__tests__/lexCreateReportMaintenanceContract.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexCreateReportMaintenanceContract from 'c/lexCreateReportMaintenanceContract';
+
+describe('c-lex-create-report-maintenance-contract', () => {
+ 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-create-report-maintenance-contract', {
+ is: LexCreateReportMaintenanceContract
+ });
+
+ // 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/lexCustomNewCopy2/__tests__/lexCustomNewCopy2.test.js b/force-app/main/default/lwc/lexCustomNewCopy2/__tests__/lexCustomNewCopy2.test.js
new file mode 100644
index 0000000..b377bae
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomNewCopy2/__tests__/lexCustomNewCopy2.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexCustomNewCopy2 from 'c/lexCustomNewCopy2';
+
+describe('c-lex-custom-new-copy2', () => {
+ 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-custom-new-copy2', {
+ is: LexCustomNewCopy2
+ });
+
+ // 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/lexCustomNewCopy2/lexCustomNewCopy2.html b/force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.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/lexCustomNewCopy2/lexCustomNewCopy2.js b/force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js
new file mode 100644
index 0000000..2daf585
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js
@@ -0,0 +1,77 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
+export default class LexCustomNewCopy2 extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ notRenewC;
+ Name;
+
+ @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.notRenewC = result.notRenewC;
+ this.Name = result.Name;
+
+ this.CustomNewCopy2();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 缁х画鏂版湇鍔″悎鍚�
+ CustomNewCopy2() {
+ if (this.notRenewC) {
+ this.ShowToastEvent("璇疯仈绯绘湇鍔″晢鍝侀儴锛�", "error");
+ // alert("璇疯仈绯绘湇鍔″晢鍝侀儴锛�");
+ } else {
+ window.open("/" + this.Id + "/e?clone=1&Name=&00N10000002Dx5D=&00N10000002Dx5S=%e5%bc%95%e5%90%88%e4%b8%ad&00NO00000010sDc=&CF00NO00000010hyI=&CF00NO00000010hyI_lkid=&CF00NO00000010hyX=&CF00NO00000010hyX_lkid=&CF00NO00000010hyN=&CF00NO00000010hyN_lkid=&RecordType=01210000000gTYq&00N10000002pmOp=&00N10000006gZDd=&00N10000006gZDe=&00NO00000010hy4=&00N10000002Dx4j=&00N10000002Dx4m=&00N10000002Dx4w=&00N10000002Dx4k=&00N10000002Dx5J=&00N10000002Dx5M=&00N10000002Dx4i=&00N10000002Dx4h=&00N10000002Dx5K=&00N10000003OXdT=&00N100000048zfn=&00N10000002FMsq=&00N10000003OlGF=&00N10000002Dx4r=&00N100000047AY1=&00N100000047AYB=&00N100000047AY6=&00N10000003PCeB=&00N10000005HBNe=&00N10000006plAl=&00N10000002Dx5C=&retURL=%2F" + this.Id + "&saveURL=%2Fapex/SaveMaintenanceByCopy?mid=" + this.Id + "&CF00N100000048Paw=" + this.Name + "&CF00N100000048Paw_lkid=" + this.Id, "_blank");
+ }
+ }
+
+ // 寮圭獥
+ 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/lexCustomNewCopy2/lexCustomNewCopy2.js-meta.xml b/force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.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/lexInsPageBtn/__tests__/lexInsPageBtn.test.js b/force-app/main/default/lwc/lexInsPageBtn/__tests__/lexInsPageBtn.test.js
new file mode 100644
index 0000000..bb52449
--- /dev/null
+++ b/force-app/main/default/lwc/lexInsPageBtn/__tests__/lexInsPageBtn.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexInsPageBtn from 'c/lexInsPageBtn';
+
+describe('c-lex-ins-page-btn', () => {
+ 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-ins-page-btn', {
+ is: LexInsPageBtn
+ });
+
+ // 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/lexMailMessege/__tests__/lexMailMessege.test.js b/force-app/main/default/lwc/lexMailMessege/__tests__/lexMailMessege.test.js
new file mode 100644
index 0000000..a01145a
--- /dev/null
+++ b/force-app/main/default/lwc/lexMailMessege/__tests__/lexMailMessege.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexMailMessege from 'c/lexMailMessege';
+
+describe('c-lex-mail-messege', () => {
+ 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-mail-messege', {
+ is: LexMailMessege
+ });
+
+ // 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/lexMailMessege/lexMailMessege.html b/force-app/main/default/lwc/lexMailMessege/lexMailMessege.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexMailMessege/lexMailMessege.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/lexMailMessege/lexMailMessege.js b/force-app/main/default/lwc/lexMailMessege/lexMailMessege.js
new file mode 100644
index 0000000..cf78f1a
--- /dev/null
+++ b/force-app/main/default/lwc/lexMailMessege/lexMailMessege.js
@@ -0,0 +1,89 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonRepairController.init';
+export default class LexMailMessege extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;;
+ InchargeStaffEmailC;
+ Name;
+ HPNameC;
+ DeliveredProductC;
+ RepairProductSerialNoC;
+ ServiceRepairNoC;
+ RepairFirstestimatedDateC;
+ RepairEstimatedDateC;
+ RCInformationC;
+ userEmail;
+
+ @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.InchargeStaffEmailC = result.InchargeStaffEmailC;
+ this.Name = result.Name;
+ this.HPNameC = result.HPNameC;
+ this.DeliveredProductC = result.DeliveredProductC;
+ this.RepairProductSerialNoC = result.RepairProductSerialNoC;
+ this.ServiceRepairNoC = result.ServiceRepairNoC;
+ this.RepairFirstestimatedDateC = result.RepairFirstestimatedDateC;
+ this.RepairEstimatedDateC = result.RepairEstimatedDateC;
+ this.RCInformationC = result.RCInformationC;
+ this.userEmail = result.userEmail;
+
+ this.mailMessege();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 鎶ヤ环闄勪欢鏇存柊鐨勯偖浠堕�氱煡
+ mailMessege() {
+ var Link = "https://ocsm--partial.sandbox.my.salesforce.com/" + this.Id;
+ console.log(Link);
+
+ location.href = 'mailto:' + this.InchargeStaffEmailC +
+ '?bcc=' + this.userEmail +
+ '&subject=銆愭姤浠烽檮浠舵洿鏂伴�氱煡:' + this.Name + '銆�' + this.HPNameC + this.DeliveredProductC + this.RepairProductSerialNoC + this.ServiceRepairNoC +
+ '&body=鍏堢敓/濂冲+%0D%0A' +
+ '%0D%0A' +
+ '鍏充簬涓婚鐨勪慨鐞嗭紝淇悊鎶ヤ环鐨勯檮浠舵洿鏂板ソ浜�%0D%0A' +
+ '璇风‘璁ゅ苟璺熻繘涓�涓�%0D%0A' +
+ '%0D%0A' +
+ '鍒濇鎶ヤ环鏃ワ細' + this.RepairFirstestimatedDateC + '%0D%0A' +
+ '姝ゆ鎶ヤ环鏃ワ細' + this.RepairEstimatedDateC + '%0D%0A' +
+ '%0D%0A' +
+ 'RC鑱旂粶浜嬮」锛�' + this.RCInformationC + '%0D%0A' +
+ '%0D%0A' + Link + '';
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexMailMessege/lexMailMessege.js-meta.xml b/force-app/main/default/lwc/lexMailMessege/lexMailMessege.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexMailMessege/lexMailMessege.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/lexOCSMNoToReportRepair/__tests__/lexOCSMNoToReportRepair.test.js b/force-app/main/default/lwc/lexOCSMNoToReportRepair/__tests__/lexOCSMNoToReportRepair.test.js
new file mode 100644
index 0000000..511b2f0
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMNoToReportRepair/__tests__/lexOCSMNoToReportRepair.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexOCSMNoToReportRepair from 'c/lexOCSMNoToReportRepair';
+
+describe('c-lex-ocsm-no-to-report-repair', () => {
+ 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-ocsm-no-to-report-repair', {
+ is: LexOCSMNoToReportRepair
+ });
+
+ // 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/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.html b/force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.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/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js b/force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js
new file mode 100644
index 0000000..44ef2be
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js
@@ -0,0 +1,102 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonRepairController.init';
+import updateRepair from '@salesforce/apex/otherButtonRepairController.updateRepair';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
+export default class LexOCSMNoToReportRepair extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;;
+ OCSMAdministrativeReportNumberC;
+ OCSMAdministrativeReportDateC;
+ AwareDateC;
+
+ @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.OCSMAdministrativeReportNumberC = result.OCSMAdministrativeReportNumberC;
+ this.OCSMAdministrativeReportDateC = result.OCSMAdministrativeReportDateC;
+ this.AwareDateC = result.AwareDateC;
+
+ this.OCSMNoToReport();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // OCSM涓嶈鎶ュ憡
+ OCSMNoToReport() {
+ if (!confirm("涓嶈鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�")) {
+ return;
+ }
+
+ if (this.OCSMAdministrativeReportNumberC != undefined ||
+ this.OCSMAdministrativeReportDateC != undefined) {
+ this.ShowToastEvent("宸茬粡鎶ュ憡鐨凲IS锛屼笉鍙互鐐瑰嚮OCSM涓嶈鎶ュ憡銆�", "error")
+ // alert("宸茬粡鎶ュ憡鐨凲IS锛屼笉鍙互鐐瑰嚮OCSM涓嶈鎶ュ憡銆�");
+ return;
+ }
+
+ if (this.AwareDateC != undefined) {
+ updateRepair({
+ recordId: this.Id
+ }).catch(error => {
+ if (error.body.pageErrors.length > 0) {
+ var errmsg = error.body.pageErrors[0].message.toString();
+ this.ShowToastEvent(errmsg.join("\n"), "error")
+ // alert(errmsg.join("\n"));
+ return;
+ }
+ })
+ window.location.reload();
+ } else {
+ this.ShowToastEvent("娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭銆�", "error")
+ // alert("娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭銆�");
+ return;
+ }
+ }
+
+ // 寮圭獥
+ 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/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js-meta.xml b/force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.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/lexOCSMToReportRepair/__tests__/lexOCSMToReportRepair.test.js b/force-app/main/default/lwc/lexOCSMToReportRepair/__tests__/lexOCSMToReportRepair.test.js
new file mode 100644
index 0000000..96ed586
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMToReportRepair/__tests__/lexOCSMToReportRepair.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexOCSMToReportRepair from 'c/lexOCSMToReportRepair';
+
+describe('c-lex-ocsm-to-report-repair', () => {
+ 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-ocsm-to-report-repair', {
+ is: LexOCSMToReportRepair
+ });
+
+ // 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/lexOCSMToReportRepair/lexOCSMToReportRepair.html b/force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.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/lexOCSMToReportRepair/lexOCSMToReportRepair.js b/force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js
new file mode 100644
index 0000000..40ebdc3
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js
@@ -0,0 +1,92 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonRepairController.init';
+import updateRepair from '@salesforce/apex/otherButtonRepairController.updateRepair';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
+
+export default class LexOCSMToReportRepair extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ AwareDateC;
+ OCSMAdministrativeReportStatusC;
+
+ @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.AwareDateC = result.AwareDateC;
+ this.OCSMAdministrativeReportStatusC = result.OCSMAdministrativeReportStatusC;
+
+ this.OCSMToReport();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // OCSM瑕佹姤鍛�
+ OCSMToReport() {
+ if (!confirm("鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�")) {
+ return;
+ }
+ if (this.OCSMAdministrativeReportStatusC == undefined && this.AwareDateC != undefined) {
+ updateRepair({
+ recordId: this.Id
+ }).catch(error => {
+ if (error.body.pageErrors.length > 0) {
+ // alert(messages.join("\n"));
+ var errmsg = error.body.pageErrors[0].message.toString();
+ this.ShowToastEvent(errmsg.join("\n"), "error")
+ return;
+ }
+ })
+ window.location.reload();
+ } else {
+ this.ShowToastEvent("娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭銆�", "error")
+ return;
+ }
+ }
+
+ // 寮圭獥
+ 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/lexOCSMToReportRepair/lexOCSMToReportRepair.js-meta.xml b/force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.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/lexPDFMaintenanceCommission/__tests__/lexPDFMaintenanceCommission.test.js b/force-app/main/default/lwc/lexPDFMaintenanceCommission/__tests__/lexPDFMaintenanceCommission.test.js
new file mode 100644
index 0000000..7387e21
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFMaintenanceCommission/__tests__/lexPDFMaintenanceCommission.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexPDFMaintenanceCommission from 'c/lexPDFMaintenanceCommission';
+
+describe('c-lex-pdf-maintenance-commission', () => {
+ 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-pdf-maintenance-commission', {
+ is: LexPDFMaintenanceCommission
+ });
+
+ // 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/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.html b/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.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/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js b/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js
new file mode 100644
index 0000000..3f5d7bb
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js
@@ -0,0 +1,54 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonRepairController.init';
+export default class LexPDFMaintenanceCommission 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.PDFMaintenanceCommission();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 鎵撳嵃缁翠慨濮旀墭涔�
+ PDFMaintenanceCommission() {
+ window.open('/apex/MaintenanceCommissionPDF?id=' + this.Id, 'MaintenanceCommissionPDF');
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js-meta.xml b/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.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/lexPreContractSubmit/__tests__/lexPreContractSubmit.test.js b/force-app/main/default/lwc/lexPreContractSubmit/__tests__/lexPreContractSubmit.test.js
new file mode 100644
index 0000000..4fb8447
--- /dev/null
+++ b/force-app/main/default/lwc/lexPreContractSubmit/__tests__/lexPreContractSubmit.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexPreContractSubmit from 'c/lexPreContractSubmit';
+
+describe('c-lex-pre-contract-submit', () => {
+ 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-pre-contract-submit', {
+ is: LexPreContractSubmit
+ });
+
+ // 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/lexProductRepairQuoteRepair/__tests__/lexProductRepairQuoteRepair.test.js b/force-app/main/default/lwc/lexProductRepairQuoteRepair/__tests__/lexProductRepairQuoteRepair.test.js
new file mode 100644
index 0000000..013ddd6
--- /dev/null
+++ b/force-app/main/default/lwc/lexProductRepairQuoteRepair/__tests__/lexProductRepairQuoteRepair.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexProductRepairQuoteRepair from 'c/lexProductRepairQuoteRepair';
+
+describe('c-lex-product-repair-quote-repair', () => {
+ 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-product-repair-quote-repair', {
+ is: LexProductRepairQuoteRepair
+ });
+
+ // 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/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.html b/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.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/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js b/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js
new file mode 100644
index 0000000..ef8176d
--- /dev/null
+++ b/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js
@@ -0,0 +1,67 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+
+import init from '@salesforce/apex/otherButtonRepairController.init';
+import selectAssetID from '@salesforce/apex/otherButtonRepairController.selectAssetID';
+
+export default class LexProductRepairQuoteRepair extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ RecordTypeId;
+ AssetOwnerC;
+ DeliveredProductC;
+
+ @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.RecordTypeId = result.RecordTypeId;
+
+ this.ProductRepairQuoteRepair();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 淇悊鎶ヤ环棰勪及
+ ProductRepairQuoteRepair() {
+ selectAssetID({
+ recordId: this.Id
+ }).then(result => {
+ this.DeliveredProductC = result;
+ window.open('/apex/ProductRepairQuote?productid=' + this.DeliveredProductC + '&flag=asset', '', 'height=250, width=500, top=300, left=350,location=no')
+ }).catch(error => {
+ console.log(error);
+ })
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js-meta.xml b/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.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/lexQuarterlyReport/__tests__/lexQuarterlyReport.test.js b/force-app/main/default/lwc/lexQuarterlyReport/__tests__/lexQuarterlyReport.test.js
new file mode 100644
index 0000000..95b6a0e
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuarterlyReport/__tests__/lexQuarterlyReport.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexQuarterlyReport from 'c/lexQuarterlyReport';
+
+describe('c-lex-quarterly-report', () => {
+ 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-quarterly-report', {
+ is: LexQuarterlyReport
+ });
+
+ // 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/lexQuarterlyReport/lexQuarterlyReport.html b/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.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/lexQuarterlyReport/lexQuarterlyReport.js b/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js
new file mode 100644
index 0000000..fc1f1e2
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js
@@ -0,0 +1,69 @@
+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 LexQuarterlyReport extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ RecordTypeDeveloperNameC;
+ EstimateTargetC;
+
+ @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.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC;
+ this.EstimateTargetC = result.EstimateTargetC;
+
+
+ this.QuarterlyReport();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 鍒朵綔瀛f姤
+ QuarterlyReport() {
+ var MaintenanceContractId = this.Id;
+ var RecordTypeName = this.RecordTypeDeveloperNameC;
+ var EstimateTarget = this.EstimateTargetC;
+ var url = '';
+ if (EstimateTarget == "缁忛攢鍟�" && (RecordTypeName == "NewMaintenance_Contract" || RecordTypeName == "VM_Contract")) {
+ url = "/apex/MoreMaintenanceContractPop?Id=" + MaintenanceContractId + "&RecordTypeName=" + RecordTypeName;
+ } else {
+ url = "http://powerbi.olympus.com.cn/Home/Login";
+ }
+ window.open(url, '_bank');
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js-meta.xml b/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.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/lexSendRepairsToEtQ/__tests__/lexSendRepairsToEtQ.test.js b/force-app/main/default/lwc/lexSendRepairsToEtQ/__tests__/lexSendRepairsToEtQ.test.js
new file mode 100644
index 0000000..0f076e5
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendRepairsToEtQ/__tests__/lexSendRepairsToEtQ.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexSendRepairsToEtQ from 'c/lexSendRepairsToEtQ';
+
+describe('c-lex-send-repairs-to-et-q', () => {
+ 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-send-repairs-to-et-q', {
+ is: LexSendRepairsToEtQ
+ });
+
+ // 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/lexSendRepairsToEtQ/lexSendRepairsToEtQ.html b/force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.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/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js b/force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js
new file mode 100644
index 0000000..927e6d3
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js
@@ -0,0 +1,192 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonRepairController.init';
+import selectRecords from '@salesforce/apex/otherButtonRepairController.selectRecords';
+import sendToETQ from '@salesforce/apex/otherButtonRepairController.sendToETQ';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
+export default class LexSendRepairsToEtQ extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;;
+ PAEDetermineC;
+ ETQUPLOADSTATUSC;
+ AEDetermineResultC;
+ PAEDetermineACC;
+ RepairInspectionDateC;
+ ContainUseRSAC;
+ userID;
+ profileId;
+
+ @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.PAEDetermineC = result.PAEDetermineC;
+ this.ETQUPLOADSTATUSC = result.ETQUPLOADSTATUSC;
+ this.AEDetermineResultC = result.AEDetermineResultC;
+ this.PAEDetermineACC = result.PAEDetermineACC;
+ this.RepairInspectionDateC = result.RepairInspectionDateC;
+ this.ContainUseRSAC = result.ContainUseRSAC;
+ this.userID = result.userID;
+ this.profileId = result.profileId;
+
+ this.myDate();
+ this.myReload();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 鏍规嵁鏃ユ湡鏋勫缓MessageGroupNumber
+ myDate() {
+ let messageNumber = '';
+ let today = new Date();
+ messageNumber = today.getFullYear() + '' + (today.getMonth() + 1) + '' + today.getDate() + '' + today.getHours() + '' +
+ today.getMinutes() + '' + today.getSeconds();
+ return messageNumber;
+ }
+
+ // 鎸夐挳鐐瑰嚮鍚庤Е鍙�,鍒ゆ柇鏄惁鍙戦�佽繃ETQ,濡傛灉鍙戦�佽繃缁欏嚭鎻愮ず骞剁伆鎺夋寜閽�
+ // 濡傛灉娌℃湁鍙戦�佽繃璋冪敤鍙戦�佹柟娉�
+ myReload() {
+ selectRecords({
+ recordId: this.Id
+ }).then(result => {
+ console.log(result);
+ if (result.AsyncData__c == 'true' && result.ETQ_UPLOAD_STATUS__c != '3' || result.Complaint_Number__c != null) {
+ var btns = document.getElementsByName("sendrepairstoetq");
+ for (var i = 0; i < btns.length; i++) {
+ btns[i].disabled = true;
+ btns[i].className = 'btnDisabled';
+ }
+ this.ShowToastEvent('璇ヤ慨鐞嗕箣鍓嶅凡缁忓彂閫佽繃浜�', "error");
+ // alert('璇ヤ慨鐞嗕箣鍓嶅凡缁忓彂閫佽繃浜�')
+ } else {
+ this.SendRepairsToEtQ();
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 鍙戦�丒TQ
+ SendRepairsToEtQ() {
+ console.log(this.userID);
+ console.log(this.profileId);
+
+ var uid = this.userID;
+ if (this.profileId != "00e10000000xnoO" && this.profileId != "00e10000000hl7w" && this.profileId != '00e10000000Y3o5') {
+ this.ShowToastEvent("鎮ㄦ病鏈夊彂閫佷慨鐞嗗埌EtQ鐨勬潈闄愩��", "error");
+ // alert("鎮ㄦ病鏈夊彂閫佷慨鐞嗗埌EtQ鐨勬潈闄愩��");
+ return;
+ }
+ var statu = '';
+ if (this.PAEDetermineC == undefined) {
+ this.ShowToastEvent("OCSM QARA鐨凱AE鍒ゅ畾鏄┖鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ銆�", "error");
+ // alert("OCSM QARA鐨凱AE鍒ゅ畾鏄┖鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ銆�");
+ return;
+ }
+ if (this.ETQUPLOADSTATUSC == "3") {
+ if (!confirm("鏄惁娓呯┖EtQ鍚屾鐘舵�侊紝閲嶆柊鍚屾鏁版嵁锛�")) {
+ return;
+ }
+ }
+ if (this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE" && uid != "005100000068zJ6") {
+ this.ShowToastEvent("Close Complait鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ", "error");
+ // alert("Close Complait鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ");
+ return;
+ }
+ if (this.PAEDetermineC != undefined && this.AEDetermineResultC != undefined && this.PAEDetermineACC == undefined) {
+ statu = "R1";
+ } else if ((this.AEDetermineResultC != undefined && this.PAEDetermineC != undefined && this.PAEDetermineACC != undefined) &&
+ !(this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE")) {
+ statu = "R2";
+ if (this.RepairInspectionDateC == "") {
+ this.ShowToastEvent("5.淇悊妫�娴嬫棩鏄┖鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ銆�", "error");
+ // alert("5.淇悊妫�娴嬫棩鏄┖鐨勬椂鍊欙紝涓嶅彲浠ュ彂閫佸埌EtQ銆�");
+ return;
+ }
+ if (this.ContainUseRSAC == 1) {
+ this.ShowToastEvent("Final universal code涓虹┖锛屾垨鑰呭寘鍚玌seRSA锛岃纭銆�", "error");
+ // alert("Final universal code涓虹┖锛屾垨鑰呭寘鍚玌seRSA锛岃纭銆�");
+ return;
+ }
+ }
+
+ var result;
+ try {
+ var repairids = new Array()
+ repairids[0] = this.Id;
+
+ var statuArr = new Array();
+ statuArr.push(statu);
+
+ sendToETQ({
+ iflog_Id: "",
+ rowDataSFDC: "",
+ repairIds: repairids,
+ statu: statuArr[0]
+ }).then(result => {
+ this.ShowToastEvent(result, "error");
+ // alert(result);
+ }).catch(error => {
+ console.log(error);
+ })
+
+ var btns = document.getElementsByName("sendrepairstoetq");
+ for (var i = 0; i < btns.length; i++) {
+ btns[i].disabled = true;
+ btns[i].className = 'btnDisabled';
+ }
+ location.reload();
+ } catch (error) {
+ this.ShowToastEvent("鍙戦�佷慨鐞嗗埌EtQ澶辫触" + error.faultstring + ' code:' + error.faultcode, "error");
+ // alert("鍙戦�佷慨鐞嗗埌EtQ澶辫触" + error.faultstring + ' code:' + error.faultcode);
+ }
+ }
+
+ // 寮圭獥
+ 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/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js-meta.xml b/force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.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/lexSubmitForApproval/__tests__/lexSubmitForApproval.test.js b/force-app/main/default/lwc/lexSubmitForApproval/__tests__/lexSubmitForApproval.test.js
new file mode 100644
index 0000000..fa04967
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitForApproval/__tests__/lexSubmitForApproval.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexSubmitForApproval from 'c/lexSubmitForApproval';
+
+describe('c-lex-submit-for-approval', () => {
+ 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-submit-for-approval', {
+ is: LexSubmitForApproval
+ });
+
+ // 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/lexUploadToRecognitionModel/__tests__/lexUploadToRecognitionModel.test.js b/force-app/main/default/lwc/lexUploadToRecognitionModel/__tests__/lexUploadToRecognitionModel.test.js
new file mode 100644
index 0000000..3986cf6
--- /dev/null
+++ b/force-app/main/default/lwc/lexUploadToRecognitionModel/__tests__/lexUploadToRecognitionModel.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexUploadToRecognitionModel from 'c/lexUploadToRecognitionModel';
+
+describe('c-lex-upload-to-recognition-model', () => {
+ 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-upload-to-recognition-model', {
+ is: LexUploadToRecognitionModel
+ });
+
+ // 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/lexUploadToRecognitionModel/lexUploadToRecognitionModel.html b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.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/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
new file mode 100644
index 0000000..6e22dc1
--- /dev/null
+++ b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
@@ -0,0 +1,133 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init';
+import updateColunm from '@salesforce/apex/MaintenanceContractSetColunmWebService.updateColunm';
+import up2sap from '@salesforce/apex/MaintenanceContractWebService.up2sap';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+export default class LexUploadToRecognitionModel extends LightningElement {
+ @api recordId;
+ str;
+ IsLoading = true;
+ Id;
+ ContractQuotationOrNotC;
+ oldIsRecognitionModelC;
+ MaintenanceContractNoC;
+ uploadToRMTimeC;
+ uploadToSapTimeC;
+ PaymentPlanSumFirstC;
+
+ @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.ContractQuotationOrNotC = result.ContractQuotationOrNotC;
+ this.oldIsRecognitionModelC = result.oldIsRecognitionModelC;
+ this.MaintenanceContractNoC = result.MaintenanceContractNoC;
+ this.uploadToSapTimeC = result.uploadToSapTimeC;
+ this.uploadToRMTimeC = result.uploadToRMTimeC;
+ this.PaymentPlanSumFirstC = result.PaymentPlanSumFirstC;
+
+ this.uploadToRecognitionModel();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 涓婁紶璁ゆ鍚堝悓
+ uploadToRecognitionModel() {
+ if (this.ContractQuotationOrNotC == '杩樻病鍋氭姤浠�') {
+ this.ShowToastEvent("鎮ㄨ繕娌℃湁鍋氬悎鍚屾姤浠凤紝涓嶈兘涓婁紶璁ゆ鍚堝悓銆�", "error")
+ // alert("鎮ㄨ繕娌℃湁鍋氬悎鍚屾姤浠凤紝涓嶈兘涓婁紶璁ゆ鍚堝悓銆�");
+ } else if (this.MaintenanceContractNoC == undefined) {
+ this.ShowToastEvent('鍚堝悓鍙风爜涓虹┖锛屼笉鑳戒笂浼犺娆惧悎鍚屻��', "error")
+ // alert('鍚堝悓鍙风爜涓虹┖锛屼笉鑳戒笂浼犺娆惧悎鍚屻��');
+ } else if (this.uploadToSapTimeC != undefined) {
+ this.ShowToastEvent('宸茬粡涓婁紶SAP锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��', "error")
+ // alert('宸茬粡涓婁紶SAP锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��');
+ } else if (this.uploadToRMTimeC != undefined) {
+ this.ShowToastEvent('宸茬粡涓婁紶璁ゆ鍚堝悓锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��', "error")
+ // alert('宸茬粡涓婁紶璁ゆ鍚堝悓锛屼笉鑳藉啀娆′笂浼犺娆惧悎鍚屻��');
+ } else {
+ if (!this.oldIsRecognitionModelC) {
+ this.ShowToastEvent('缁忛攢鍟嗕负绌烘垨缁忛攢鍟嗕笉鏄厛娆惧璞★紝涓嶉渶瑕佷笂浼犺娆惧悎鍚屻��', "error")
+ // alert('缁忛攢鍟嗕负绌烘垨缁忛攢鍟嗕笉鏄厛娆惧璞★紝涓嶉渶瑕佷笂浼犺娆惧悎鍚屻��');
+ } else if (this.PaymentPlanSumFirstC == undefined) {
+ this.ShowToastEvent('绗竴娆¤鍒掍粯娆鹃噾棰濅笉鑳戒负绌恒��', "error")
+ // alert('绗竴娆¤鍒掍粯娆鹃噾棰濅笉鑳戒负绌恒��');
+ } else {
+ if (!confirm('璇风‘璁ゆ槸鍚﹁涓婁紶璁ゆ鍚堝悓銆�')) {
+ return;
+ }
+
+ updateColunm({
+ mcid: this.Id
+ }).then(result => {
+ console.log(result);
+ if (result != '1') {
+ this.ShowToastEvent('涓婁紶璁ゆ鍚堝悓澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触', "error")
+ // alert('涓婁紶璁ゆ鍚堝悓澶辫触,鍥犱负 鏉ュ勾鍚堝悓鐩稿叧淇℃伅淇敼澶辫触');
+ location.href = "/" + this.Id;
+ }
+ }).catch(error => {
+ console.log(error);
+ })
+
+ up2sap({
+ mcid: this.Id
+ }).then(rtn => {
+ console.log(rtn);
+ if (rtn == '1') {
+ this.ShowToastEvent("涓婁紶璁ゆ鍚堝悓鎴愬姛", "success")
+ // alert("涓婁紶璁ゆ鍚堝悓鎴愬姛");
+ location.href = "/" + this.Id;
+ } else {
+ this.ShowToastEvent(rtn, "error")
+ // alert(rtn);
+ }
+ }).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/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js-meta.xml b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.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/lexUploadToSap/__tests__/lexUploadToSap.test.js b/force-app/main/default/lwc/lexUploadToSap/__tests__/lexUploadToSap.test.js
new file mode 100644
index 0000000..d5f3d47
--- /dev/null
+++ b/force-app/main/default/lwc/lexUploadToSap/__tests__/lexUploadToSap.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexUploadToSap from 'c/lexUploadToSap';
+
+describe('c-lex-upload-to-sap', () => {
+ 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-upload-to-sap', {
+ is: LexUploadToSap
+ });
+
+ // 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/lexYanshoudanRequest/__tests__/lexYanshoudanRequest.test.js b/force-app/main/default/lwc/lexYanshoudanRequest/__tests__/lexYanshoudanRequest.test.js
new file mode 100644
index 0000000..02e891b
--- /dev/null
+++ b/force-app/main/default/lwc/lexYanshoudanRequest/__tests__/lexYanshoudanRequest.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexYanshoudanRequest from 'c/lexYanshoudanRequest';
+
+describe('c-lex-yanshoudan-request', () => {
+ 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-yanshoudan-request', {
+ is: LexYanshoudanRequest
+ });
+
+ // 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/lexYanshoudanRequest/lexYanshoudanRequest.html b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.html
new file mode 100644
index 0000000..87f391a
--- /dev/null
+++ b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.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/lexYanshoudanRequest/lexYanshoudanRequest.js b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
new file mode 100644
index 0000000..84fe55d
--- /dev/null
+++ b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
@@ -0,0 +1,79 @@
+import {
+ LightningElement,
+ wire,
+ api
+} from 'lwc';
+import {
+ CurrentPageReference
+} from "lightning/navigation";
+import {
+ CloseActionScreenEvent
+} from 'lightning/actions';
+import init from '@salesforce/apex/otherButtonRepairController.init';
+import updateYanshoudan from '@salesforce/apex/otherButtonRepairController.updateYanshoudan';
+import {
+ ShowToastEvent
+} from 'lightning/platformShowToastEvent';
+
+export default class LexYanshoudanRequest 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.YanshoudanRequest();
+ this.dispatchEvent(new CloseActionScreenEvent());
+ }
+ }).catch(error => {
+ console.log(error);
+ }).finally(() => {
+
+ });
+ }
+
+ // 楠屾敹鍗曞洖鏀剁敵璇�
+ YanshoudanRequest() {
+ updateYanshoudan({
+ recordId: this.Id
+ }).then(result => {
+ console.log(result);
+ if (result.length > 0) {
+ var indexs = result.indexOf(": ")
+ var resolves = result.substring(indexs + 1, result.length);
+ alert(resolves);
+ }
+ location.reload();
+ })
+ }
+
+ // 寮圭獥
+ 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/lexYanshoudanRequest/lexYanshoudanRequest.js-meta.xml b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.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
--
Gitblit v1.9.1