黄千龙
2023-04-12 51f6dc7bc93a89c97ebc17e8c908f7f6be6566dc
黄千龙提交按钮20230412
8个文件已添加
1个文件已修改
320 ■■■■■ 已修改文件
force-app/main/default/classes/QISReportController.cls 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.css 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QISReportController.cls
@@ -351,6 +351,68 @@
         return re;
    }
    //OCSM不要报告
    @AuraEnabled
    public static InitData initForlexOCSMNoToReportLightingButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id ,OCSMAdministrativeReportNumber__c,OCSMAdministrativeReportDate__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.oCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c;
            res.oCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c;
            res.Awaredate = report.Aware_date__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static String updateQisForlexOCSMNoToReportLighting (String recordId){
        String re = '成功';
        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
        try{
                QIS_Report__c rac  = new QIS_Report__c();
                rac.id = recordId;
                rac.OCSMAdministrativeReportStatus__c = '无需报告';
                update rac;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            re = e.getMessage();
        }
         return re;
    }
    //OCSM要报告
    @AuraEnabled
    public static InitData initForlexOCSMToReportLightingButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id ,OCSMAdministrativeReportStatus__c,Aware_date__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.oCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c;
            res.Awaredate = report.Aware_date__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static String updateQisForlexOCSMToReportLighting (String recordId){
        String re = '成功';
        QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
        try{
                QIS_Report__c rac  = new QIS_Report__c();
                rac.id = recordId;
                rac.OCSMAdministrativeReportStatus__c  = '待报告';
                update rac;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            re = e.getMessage();
        }
         return re;
    }
    public class InitData{
        @AuraEnabled
        public String Id;
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.css
New file
@@ -0,0 +1,22 @@
.outerBorderCss{
    border: 1px solid #D4D4D4;
    border-radius : 5px;
    border-top : 3px solid #565959;
}
.borderCss{
    border: 1px solid #D4D4D4;
    border-radius : 5px;
    margin-bottom : 7px;
    border-top : 3px solid #565959;
}
.headerDorderCss{
    border-top: 1px solid #565959;
    border-bottom: 1px solid #D4D4D4;
    padding:3px;
}
.centerCss{
    text-align: center;
}
.centerCss .left{
    margin-left: 100px;
}
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.html
New file
@@ -0,0 +1,5 @@
<template>
   <div class="sisToOPDHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
New file
@@ -0,0 +1,105 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForlexOCSMNoToReportLightingButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOCSMNoToReportLighting';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
export default class lexOCSMNoToReportLighting extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    OCSMAdministrativeReportNumber;
    OCSMAdministrativeReportDate;
    Awaredate;
    err;
    @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
             console.log(111);
             console.log(currentPageReference);
         if (currentPageReference) {
           const urlValue = currentPageReference.state.recordId;
           if (urlValue) {
             let str = `${urlValue}`;
             console.log("str");
             console.log(str);
             this.recordId = str;
           }
         }
    }
    connectedCallback () {
        init({
            recordId: this.recordId
        }).then(result => {
            this.IsLoading = false;
            this.OCSMAdministrativeReportNumber = result.oCSMAdministrativeReportNumber;
            this.OCSMAdministrativeReportDate = result.oCSMAdministrativeReportDate;
            this.qisReportId = result.Id;
            this.Awaredate = result.awaredate;
            if (!confirm("不要报告后无法撤回,是否继续?")) {
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
            }
            if (this.OCSMAdministrativeReportDate != null || this.OCSMAdministrativeReportNumber != null) {
                    const evt = new ShowToastEvent({
                            title : '已经报告的QIS,不可以点击OCSM不要报告',
                            message: '',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
            }
             if (this.Awaredate!=null) {
                 this.updateQisSubmit();
             }else{
                 const evt = new ShowToastEvent({
                        title : '没有AwareDate或已经OCSM行政报告,请确认',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
             }
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    updateQisSubmit(){
            updateQis({
                 recordId: this.recordId
                }).then(result =>{
                    console.log('result'+result);
                     this.err = result;
                    if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: this.err,
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                    }
                this.dispatchEvent(new CloseActionScreenEvent());
                this.updateRecordView(this.recordId);
                }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
}
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.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" fqn="lexOCSMNoToReportLighting">
   <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/lexOCSMToReportLighting/lexOCSMToReportLighting.css
New file
@@ -0,0 +1,10 @@
.toReportHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}/* sample css file *//* sample css file */
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.html
New file
@@ -0,0 +1,5 @@
<template>
   <div class="sisToOPDHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js
New file
@@ -0,0 +1,89 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForlexOCSMToReportLightingButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOCSMToReportLighting';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
export default class lexOCSMToReportLighting extends LightningElement {
    @api recordId;
    str;
    err;
    IsLoading = true;
    qisReportId;
    OCSMAdministrativeReportStatus;
    Awaredate;
    @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);
                this.IsLoading = false;
                this.OCSMAdministrativeReportStatus = result.oCSMAdministrativeReportStatus;
                this.qisReportId = result.Id;
                this.Awaredate = result.awaredate;
                if (!confirm("不要报告后无法撤回,是否继续?")) {
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
                if (this.OCSMAdministrativeReportStatus == null && this.Awaredate!=null) {
                     this.updateQisSubmit();
                 }else{
                     const evt = new ShowToastEvent({
                            title : '没有AwareDate或已经OCSM行政报告,请确认',
                            message: '',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
                 }
        }).catch(error => {
            console.log(error);
        }).finally(() => {
        });
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    updateQisSubmit(){
            updateQis({
                 recordId: this.recordId
                }).then(result =>{
                    console.log('result'+result);
                     this.err = result;
                    if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: this.err,
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                    }
                this.dispatchEvent(new CloseActionScreenEvent());
                this.updateRecordView(this.recordId);
                }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
}
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.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" fqn="lexOCSMToReportLighting">
   <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>