TT
twysparks
2023-04-10 d0b899c48eb14fdd6d8d5cb72a70aec785ddd4f9
TT
52个文件已添加
1个文件已修改
1671 ■■■■■ 已修改文件
force-app/main/default/classes/otherButtonRepairController.cls-meta.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexASRCEditorRepair/__tests__/lexASRCEditorRepair.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPIInspectionReport/__tests__/lexCopyPIInspectionReport.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCreateReportMaintenanceContract/__tests__/lexCreateReportMaintenanceContract.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomNewCopy2/__tests__/lexCustomNewCopy2.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexInsPageBtn/__tests__/lexInsPageBtn.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexMailMessege/__tests__/lexMailMessege.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexMailMessege/lexMailMessege.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportRepair/__tests__/lexOCSMNoToReportRepair.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportRepair/__tests__/lexOCSMToReportRepair.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPDFMaintenanceCommission/__tests__/lexPDFMaintenanceCommission.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPreContractSubmit/__tests__/lexPreContractSubmit.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexProductRepairQuoteRepair/__tests__/lexProductRepairQuoteRepair.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuarterlyReport/__tests__/lexQuarterlyReport.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendRepairsToEtQ/__tests__/lexSendRepairsToEtQ.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitForApproval/__tests__/lexSubmitForApproval.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUploadToRecognitionModel/__tests__/lexUploadToRecognitionModel.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUploadToSap/__tests__/lexUploadToSap.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexYanshoudanRequest/__tests__/lexYanshoudanRequest.test.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls
New file
@@ -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;
     }
}
force-app/main/default/classes/otherButtonSpotInspectionReportCtl.cls-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexASRCEditorRepair/__tests__/lexASRCEditorRepair.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js
New file
@@ -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);
        })
    }
}
force-app/main/default/lwc/lexASRCEditorRepair/lexASRCEditorRepair.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexCopyPIInspectionReport/__tests__/lexCopyPIInspectionReport.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexCreateReportMaintenanceContract/__tests__/lexCreateReportMaintenanceContract.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexCustomNewCopy2/__tests__/lexCustomNewCopy2.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.html
New file
@@ -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>
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js
New file
@@ -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);
    }
}
force-app/main/default/lwc/lexCustomNewCopy2/lexCustomNewCopy2.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexInsPageBtn/__tests__/lexInsPageBtn.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexMailMessege/__tests__/lexMailMessege.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexMailMessege/lexMailMessege.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js
New file
@@ -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 + '';
    }
}
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexOCSMNoToReportRepair/__tests__/lexOCSMNoToReportRepair.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.html
New file
@@ -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>
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js
New file
@@ -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("已经报告的QIS,不可以点击OCSM不要报告。", "error")
            // alert("已经报告的QIS,不可以点击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或已经OCSM行政报告,请确认。", "error")
            // alert("没有AwareDate或已经OCSM行政报告,请确认。");
            return;
        }
    }
    // 弹窗
    ShowToastEvent(msg, type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
}
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexOCSMToReportRepair/__tests__/lexOCSMToReportRepair.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.html
New file
@@ -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>
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js
New file
@@ -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或已经OCSM行政报告,请确认。", "error")
            return;
        }
    }
    // 弹窗
    ShowToastEvent(msg, type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
}
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexPDFMaintenanceCommission/__tests__/lexPDFMaintenanceCommission.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js
New file
@@ -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');
    }
}
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexPreContractSubmit/__tests__/lexPreContractSubmit.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexProductRepairQuoteRepair/__tests__/lexProductRepairQuoteRepair.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js
New file
@@ -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);
        })
    }
}
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexQuarterlyReport/__tests__/lexQuarterlyReport.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js
New file
@@ -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(() => {
        });
    }
    // 制作季报
    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');
    }
}
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexSendRepairsToEtQ/__tests__/lexSendRepairsToEtQ.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.html
New file
@@ -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>
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js
New file
@@ -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(() => {
        });
    }
    // 发送ETQ
    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的PAE判定是空的时候,不可以发送到EtQ。", "error");
            // alert("OCSM QARA的PAE判定是空的时候,不可以发送到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为空,或者包含UseRSA,请确认。", "error");
                // alert("Final universal code为空,或者包含UseRSA,请确认。");
                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);
    }
}
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexSubmitForApproval/__tests__/lexSubmitForApproval.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexUploadToRecognitionModel/__tests__/lexUploadToRecognitionModel.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.html
New file
@@ -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>
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
New file
@@ -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);
    }
}
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js-meta.xml
New file
@@ -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>
force-app/main/default/lwc/lexUploadToSap/__tests__/lexUploadToSap.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexYanshoudanRequest/__tests__/lexYanshoudanRequest.test.js
New file
@@ -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);
    });
});
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.html
New file
@@ -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>
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
New file
@@ -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);
    }
}
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js-meta.xml
New file
@@ -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>