unknown
2023-07-20 44ed00f66817d069afafb09c19e7ff87162b65c2
button-lexFeedbackReport

现场反馈
2个文件已修改
2个文件已添加
85 ■■■■ 已修改文件
force-app/main/default/classes/LexRentalApplyFaultController.cls 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexRentalApplyFaultController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LexRentalApplyFaultController.cls
New file
@@ -0,0 +1,41 @@
/**
 * *
    ODescription:
    GAuthor: sun xia
    @Date: 2023-07-11 15:31:56
    GIastEditors: sun xia
    @IastEditTime: 2023-07-17 15:31:56
 * */
public with sharing class LexRentalApplyFaultController {
    @AuraEnabled
    public static Rental_Apply_Fault__c init(String recordId){
        try {
            List<Rental_Apply_Fault__c> rafList = [Select Id, status__c from Rental_Apply_Fault__c where Id = :recordId];
            if(rafList.size()>0){
                return rafList[0];
            }
        }
        catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e.getMessage()+e.getLineNumber(): ' + e.getMessage()+e.getLineNumber());
        }
        return null;
    }
    @AuraEnabled
    public static String updateRentalApplyFaultStatus(String recordId, String updateStatus){
        Savepoint sp = Database.setSavepoint();
        try {
            Rental_Apply_Fault__c updateRaf = new Rental_Apply_Fault__c();
            updateRaf.Id = recordId;
            updateRaf.status__c = updateStatus;
            Update updateRaf;
            return 'SUCCESS';
        }
        catch (Exception e) {
            Database.rollback(sp);
            System.debug(LoggingLevel.INFO, '*** e.getMessage()+e.getLineNumber(): ' + e.getMessage()+e.getLineNumber());
            return e.getMessage();
        }
    }
}
force-app/main/default/classes/LexRentalApplyFaultController.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>50.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.html
@@ -1,5 +1,2 @@
<template>
    <div class="sisToOPDHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js
@@ -3,12 +3,10 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CurrentPageReference } from 'lightning/navigation';
import init from '@salesforce/apex/RentalApplyFaultController.init';
import updateRentalApplyFaultStatus from '@salesforce/apex/RentalApplyFaultController.updateRentalApplyFaultStatus';
import init from '@salesforce/apex/LexRentalApplyFaultController.init';
import updateRentalApplyFaultStatus from '@salesforce/apex/LexRentalApplyFaultController.updateRentalApplyFaultStatus';
export default class lexFeedbackReport extends LightningElement {
    @api recordId;
    IsLoading = true;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        if(currentPageReference) {
@@ -24,21 +22,25 @@
        init({
            recordId: this.recordId
        }).then(res=>{
            if(res.status__c!='已发送'){
            if(res){
                if(res.status__c!='已发送'){
                this.showToast('只有已发送的检测分析报告才能发送','warning');
                return;
            }
            updateRentalApplyFaultStatus({
                recordId: this.recordId,
                updateStatus: '已反馈'
            }).then(result=>{
                if(result=='SUCCESS'){
                    this.showToast('报告已反馈','success');
                }else{
                    this.showToast(res,'error');
                    return;
                }
            })
                updateRentalApplyFaultStatus({
                    recordId: this.recordId,
                    updateStatus: '已反馈'
                }).then(result=>{
                    if(result=='SUCCESS'){
                        this.showToast('报告已反馈','success');
                    }else{
                        this.showToast(res,'error');
                    }
                })
            }else{
                this.showToast('未查询到数据','warning');
            }
        })
    }