黄千龙
2023-03-29 de8c520114fc0e875b784e1cfa3ebded124c8be2
黄千龙修改按钮(更新至2023.3.29)
22个文件已添加
969 ■■■■■ 已修改文件
force-app/main/default/classes/QISReportController.cls 269 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QISReportController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.css 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/oshRecieved/oshRecieved.css 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/oshRecieved/oshRecieved.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/oshRecieved/oshRecieved.js 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/oshRecieved/oshRecieved.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.css 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.js 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/QISReportController.cls
New file
@@ -0,0 +1,269 @@
public with sharing class QISReportController {
   @AuraEnabled
    public static InitData initForQisUniversalFailureCodeButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public  static InitData sqlForPAE (String qisReportId){
        InitData res = new initData();
        String RecordTypeId = 'ASACDecision';
        try{
            PAE_DecisionRecord__c RCPAED_IdList = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_QIS__c = :qisReportId  And RecordType.DeveloperName =  :RecordTypeId limit 1];
            res.PAEid = RCPAED_IdList.id;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForOSHRecievedButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id,QIS_Status__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.QIStatus = report.QIS_Status__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static String updateQis (String recordId){
        String re = '成功';
        try{
            ID myUserID = UserInfo.getUserId();
            User tempUser = [select id,Alias,Email from user where id = : myUserID ];
            QIS_Report__c rac  = new QIS_Report__c();
            rac.id = recordId;
            rac.QIS_Status__c = 'OSH检测中';
            // 待补充
            rac.OSHRecievedDate__c  = Date.today();
            System.debug( 'OSHRecievedDate__c=' + rac.OSHRecievedDate__c);
            rac.OSH_Receive_staff__c = tempUser.Alias;
            rac.OSH_staff__c = tempUser.Alias;
            rac.OSH_staff_email__c = tempUser.email;
            rac.Is_ProductGot__c = true;
            rac.OSH_GotProductPeople__c = tempUser.id;
            User resultSet = [SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id = :myUserID];
            if (resultSet!=null && resultSet.JingliApprovalManager__c != null && resultSet.BuchangApprovalManager__c != null ) {
                rac.OSH_Manager__c = resultSet.JingliApprovalManager__c;
                rac.OSH_Buzhang__c = resultSet.BuchangApprovalManager__c;
            }else{
                rac.OSH_Manager__c= myUserID;
                rac.OSH_Buzhang__c= myUserID;
            }
            Oly_TriggerHandler.bypass('QIS_ReportTrigger');
            update rac;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            re = e.getMessage();
        }
         return re;
    }
    @AuraEnabled
    public static InitData initForOSHSubmitButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id,QIS_Status__c,OSH_staff__c,OSH_staff_email__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.QIStatus = report.QIS_Status__c;
            res.OSHstaff = report.OSH_staff__c;
            res.OSHstaffEmail = report.OSH_staff_email__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static String updateQis1 (String recordId){
        String re = '成功';
        try{
            QIS_Report__c rac  = new QIS_Report__c();
            rac.id = recordId;
            rac.QIS_Status__c = 'OSH填写完毕';
            update rac;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            re = e.getMessage();
        }
         return re;
    }
     @AuraEnabled
    public static InitData initForRCSubmitButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id,RC_problem_not_found__c,QIS_Reply_day__c,RC_inspection_date__c,QIS_Status__c,Cancel_QIS_Reason__c,OSH_staff__c,OSH_staff_email__c,RC__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.QIStatus = report.QIS_Status__c;
            res.OSHstaff = report.OSH_staff__c;
            res.OSHstaffEmail = report.OSH_staff_email__c;
            res.CancelQISReason = report.Cancel_QIS_Reason__c;
            res.RCid = report.RC__c;
            res.RCinspectionDate = report.RC_inspection_date__c;
            res.QISReplyDay = report.QIS_Reply_day__c;
            res.RCproblemnotfound = report.RC_problem_not_found__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static String updateQisWithRC (String recordId,String type,String oldQIStatus){
        String re = '成功';
        ID myUserID = UserInfo.getUserId();
        User userinfo = [SELECT Id, JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c, BuchangApprovalManagerSales__c, SalesManager__c FROM User WHERE Id = :myUserID LIMIT 1];
        QIS_Report__c rac  = new QIS_Report__c();
        rac.id = recordId;
        if (type == '1') {
            QIS_Report__c report1 = [SELECT  id,RC_problem_not_found__c,RC_FixedJudgement__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            rac.QIS_Status__c = 'RC填写完毕';
            if (report1.RC_problem_not_found__c == true && report1.RC_FixedJudgement__c == false) {
                QIS_Report__c qisreport = [SELECT Id, Reason_bloken__c, Special_follow__c, next_action__c, QIS_Reply_Comment__c, OCM_judgement__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
                if (qisreport != null) {
                   rac.Reason_bloken1__c       = qisreport.Reason_bloken__c;
                   rac.Special_follow1__c      = qisreport.Special_follow__c;
                   rac.next_action1__c         = qisreport.next_action__c;
                   rac.QIS_Reply_Comment1__c   = qisreport.QIS_Reply_Comment__c;
                   rac.OCM_judgement1__c       = qisreport.OCM_judgement__c;
                }
            }
        }
        if (type == '2') {
            rac.QIS_Status__c = '取消申请';
            rac.QIS_Cancel_Submit_day__c  = Date.today();
        }
        try{
            if (userinfo!=null && userinfo.BuchangApprovalManagerSales__c != null) {
                rac.RC_Manager__c = userinfo.BuchangApprovalManagerSales__c;
            }else{
                rac.RC_Manager__c = myUserID;
            }
            if (userinfo!=null) {
                if (oldQIStatus == 'RC检测中') {
                    rac.RC__c = myUserID;
                }
                if (userinfo.SalesManager__c != null ) {
                    rac.ApproveManager__c  = userinfo.SalesManager__c;
                }else{
                    rac.ApproveManager__c  = myUserID;
                }
                if (userinfo.BuchangApprovalManagerSales__c != null ) {
                    rac.ApproveBuZhang__c  = userinfo.BuchangApprovalManagerSales__c ;
                }else{
                    rac.ApproveBuZhang__c  = myUserID;
                }
                if (userinfo.ZongjianApprovalManager__c != null ) {
                    rac.AppeoveZongJian__c = userinfo.ZongjianApprovalManager__c  ;
                }else{
                    rac.AppeoveZongJian__c = myUserID;
                }
            }
            update rac;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            re = e.getMessage();
        }
         return re;
    }
     @AuraEnabled
    public static InitData initForOCMSubmitButton (String recordId){
        InitData res = new initData();
        try{
            QIS_Report__c report = [SELECT  id,is_aohui_product__c,QIS_Status__c,OCM_Manager_Mail_F__c,QISInstallDate__c,contract_number__c FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.QIStatus = report.QIS_Status__c;
            res.QISInstallDate = report.QISInstallDate__c;
            res.contractnumber = report.contract_number__c;
            res.isaohuiproduct = report.is_aohui_product__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }
    @AuraEnabled
    public static String updateQisWithOCM (String recordId){
        String re = '成功';
        QIS_Report__c report = [SELECT  id,QIS_Status__c,QISInstallDate__c,contract_number__c,OCM_Manager_Mail_F__c
                                ,OCM_Member_Mail_F__c,OCM_Repair_Mail_F__c,OCM_Repair_Mail1_F__c,FSE_Special_Mail_F__c,FSE_Special_Manager_Mail_F__c
                                    ,WorkLocation_CC_Mail_F__c,is_aohui_product__c,QuolityApproveResult__c
                                FROM QIS_Report__c WHERE Id = :recordId LIMIT 1];
        try{
            QIS_Report__c rac  = new QIS_Report__c();
            rac.id = recordId;
            rac.QIS_Status__c = 'FSE填写完毕';
            rac.OCM_Manager_Mail__c = report.OCM_Manager_Mail_F__c;
            rac.OCM_Member_Mail__c = report.OCM_Member_Mail_F__c;
            rac.OCM_Repair_Mail__c = report.OCM_Repair_Mail_F__c;
            rac.OCM_Repair_Mail1__c = report.OCM_Repair_Mail1_F__c;
            rac.FSE_Special_Mail__c = report.FSE_Special_Mail_F__c;
            rac.FSE_Special_Manager_Mail__c = report.FSE_Special_Manager_Mail_F__c;
            rac.WorkLocation_CC_Mail__c = report.WorkLocation_CC_Mail_F__c;
            rac.Cancel_QIS_Reason__c = null;
            if (report.is_aohui_product__c == true) {
                    rac.OCM_judgement__c = '质量问题';
                    rac.next_action__c = '无偿维修';
                    rac.RecordTypeId = '01210000000RLWm';
                    rac.QIS_Status__c = 'OSH检测申请';
            }
            if (report.QuolityApproveResult__c == null || report.QuolityApproveResult__c == '') {
                rac.QuolityApproveResult__c = '3.已审核,一般质量问题';
            }
            update rac;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
            re = e.getMessage();
        }
         return re;
    }
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String PAEid;
        @AuraEnabled
        public String QIStatus;
        @AuraEnabled
        public String OSHstaff;
        @AuraEnabled
        public String OSHstaffEmail;
        @AuraEnabled
        public String CancelQISReason;
        @AuraEnabled
        public String RCid;
        @AuraEnabled
        public String contractnumber;
        @AuraEnabled
        public Date RCinspectionDate;
        @AuraEnabled
        public Date QISReplyDay;
        @AuraEnabled
        public Date QISInstallDate;
        @AuraEnabled
        public Boolean RCproblemnotfound;
        @AuraEnabled
        public Boolean isaohuiproduct;
    }
}
force-app/main/default/classes/QISReportController.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/lexOCMSubmit/lexOCMSubmit.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;
}/* sample css file */
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.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/lexOCMSubmit/lexOCMSubmit.js
New file
@@ -0,0 +1,133 @@
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.initForOCMSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisWithOCM';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
export default class lexOCMSubmit extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    QISInstallDate;
    qisStatus;
    contractnumber;
    isaohuiproduct;
    @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.qisReportId = result.Id;
            this.qisStatus = result.QIStatus;
            this.QISInstallDate = result.QISInstallDate;
            this.contractnumber = result.contractnumber;
            this.isaohuiproduct = result.isaohuiproduct;
            console.log('this.qisStatus='+this.qisStatus);
            console.log('this.isaohuiproduct='+this.isaohuiproduct);
             if (this.qisStatus!='草案中' && this.qisStatus!='取消') {
                 const evt = new ShowToastEvent({
                        title : '已经提交',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                this.dispatchEvent(new CloseActionScreenEvent());
                 return;
             }else{
                 if (this.qisStatus == '取消') {
                     const evt = new ShowToastEvent({
                        title : '取消后的QIS不允许再提交,如果需要提交请点击\"复制\"按钮重新生成一个QIS',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
             }
             if (this.QISInstallDate == null) {
                 const evt = new ShowToastEvent({
                        title : '【购买日期/安装日期】为空时不能提交申请',
                        message: '',
                        variant: 'error'
                    });
                 this.dispatchEvent(evt);
                 this.dispatchEvent(new CloseActionScreenEvent());
                return;
             }
             if (this.contractnumber == null) {
                 const evt = new ShowToastEvent({
                        title : '【销售合同上订单号码】为空时不能提交申请',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                 this.dispatchEvent(new CloseActionScreenEvent());
                return;
             }
             if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                 this.dispatchEvent(new CloseActionScreenEvent());
                return;
            }
            this.updateQisSubmit();
            if (this.isaohuiproduct == 'true') {
                this.dispatchEvent(new CloseActionScreenEvent());
                this.updateRecordView(this.recordId);
            }
            this.dispatchEvent(new CloseActionScreenEvent());
            this.updateRecordView(this.recordId);
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    updateQisSubmit(){
            updateQis({
                 recordId: this.recordId
                }).then(result =>{
                    console.log('result'+result);
                    if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: result,
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                    }
                this.dispatchEvent(new CloseActionScreenEvent());
                }).catch(error => {
                        console.log('error='+error);
                }).finally(() => {
                });
    }
}
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.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="lexOCMSubmit">
    <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/lexOSHSubmit/lexOSHSubmit.css
New file
@@ -0,0 +1,10 @@
.opdToSISHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}/* sample css file */
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="opdToSISHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
New file
@@ -0,0 +1,101 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import init  from '@salesforce/apex/QISReportController.initForOSHSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQis1';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
export default class lexOSHSubmit extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    qisStatus;
    OSHstaff;
    OSHstaffEmail;
    @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.qisReportId = result.Id;
            this.qisStatus = result.QIStatus;
            this.OSHstaff = result.OSHstaff;
            this.OSHstaffEmail = result.OSHstaffEmail;
            console.log('this.qisStatus='+this.qisStatus);
            console.log('this.OSHstaff='+this.OSHstaff);
            console.log('this.OSHstaffEmail='+this.OSHstaffEmail);
             if (this.qisStatus=='OSH检测申请' && this.qisStatus=='完毕') {
                 alert('需要先点击[OSH检查受理]');
                 return;
             }
             if (this.qisStatus!='OSH检测中') {
                 alert('已经提交审批');
                 return;
             }
             if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                return;
            }
            if (this.OSHstaff==null||this.OSHstaffEmail==null) {
                alert("OSH担当必须填写");
                return;
            }
            try{
                this.updateQisSubmit();
            }catch(err){
                if(err.faultstring !=undefined && err.faultstring.indexOf('INVALID_SESSION_ID') != -1) {
                    alert('当前网页已登出,请您重新登录后刷新该网页!');
                } else {
                    alert(err.faultstring);
                }
                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);
                    if (result!='成功') {
                        alert(result);
                    }
                this.dispatchEvent(new CloseActionScreenEvent());
                this.updateRecordView(this.recordId);
                }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
}
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.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="lexOSHSubmit">
     <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/lexRCSubmit/lexRCSubmit.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/lexRCSubmit/lexRCSubmit.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/lexRCSubmit/lexRCSubmit.js
New file
@@ -0,0 +1,163 @@
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.initForRCSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisWithRC';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
export default class lexRCSubmit extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    qisStatus;
    OSHstaff;
    OSHstaffEmail;
    CancelQISReason;
    Rcid;
    RCinspectionDate;
    QISReplyDay;
    RCproblemnotfound;
    type;
    @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.qisReportId = result.Id;
            this.qisStatus = result.QIStatus;
            this.OSHstaff = result.OSHstaff;
            this.OSHstaffEmail = result.OSHstaffEmail;
            this.CancelQISReason = result.CancelQISReason;
            this.Rcid = result.RCid;
            this.RCinspectionDate = result.RCinspectionDate;
            this.QISReplyDay = result.QISReplyDay;
            this.RCproblemnotfound = result.RCproblemnotfound;
            console.log('this.qisStatus='+this.qisStatus);
            console.log('this.CancelQISReason='+this.CancelQISReason);
            console.log('this.Rcid='+this.Rcid);
            console.log('this.RCproblemnotfound='+this.RCproblemnotfound);
            console.log('this.RCinspectionDate='+this.RCinspectionDate);
             if (this.qisStatus!='RC检测中') {
                const evt = new ShowToastEvent({
                        title : '已经提交审批',
                        message: '',
                        variant: 'error'
                    });
                 this.dispatchEvent(evt);
                this.dispatchEvent(new CloseActionScreenEvent());
                 return;
             }
             if (this.CancelQISReason!=null) {
                 if (this.qisStatus == 'RC检测申请') {
                    const evt = new ShowToastEvent({
                        title : '需要先点击[OCM服务本部收到实物]',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
                 if (this.Rcid ==null) {
                    const evt = new ShowToastEvent({
                        title : '判定担当必须填写',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
                 if (this.RCinspectionDate == null) {
                    const evt = new ShowToastEvent({
                        title : 'OCM服务本部还没有检测完毕',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
                 if (this.QISReplyDay!=null  && this.RCproblemnotfound == 'true') {
                    const evt = new ShowToastEvent({
                        title : '最终判定时,请取消[故障未发现留下继续观察]并选择[对应方法]',
                        message: '',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
                 if (confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                     this.type = '1';
                }else{
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
             }else{
                 if (confirm("一旦提交关闭此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                    this.type = '2';
                }else{
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
             }
             console.log('this.type='+this.type);
             // this.dispatchEvent(new CloseActionScreenEvent());
             this.updateQisSubmit();
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    updateQisSubmit(){
            updateQis({
                 recordId: this.recordId,
                 type: this.type,
                 oldQIStatus: this.qisStatus
                }).then(result =>{
                    console.log('result'+result);
                    if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: result,
                            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/lexRCSubmit/lexRCSubmit.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="lexRCSubmit">
    <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/oshRecieved/oshRecieved.css
New file
@@ -0,0 +1,10 @@
.VOCSubmitHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}/* sample css file */
force-app/main/default/lwc/oshRecieved/oshRecieved.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="VOCSubmitHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/oshRecieved/oshRecieved.js
New file
@@ -0,0 +1,81 @@
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 { updateRecord } from 'lightning/uiRecordApi';
import init  from '@salesforce/apex/QISReportController.initForOSHRecievedButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQis';
export default class oshRecieved extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    qisStatus;
     @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.qisReportId = result.Id;
            this.qisStatus = result.QIStatus;
            console.log('this.qisStatus='+this.qisStatus);
             if (this.qisStatus!='OSH检测申请' && this.qisStatus!='完毕') {
                const evt = new ShowToastEvent({
                        title : 'OSH已经收到实物',
                        message: '',
                        variant: 'error'
                    });
                this.dispatchEvent(evt);
             }else{
                 this.updateQisSubmit();
             }
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    updateQisSubmit(){
            updateQis({
                 recordId: this.recordId
                }).then(result =>{
                    console.log('result'+result);
                    if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: result,
                            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/oshRecieved/oshRecieved.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="oshRecieved">
    <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/qisUniversalFailureCode/qisUniversalFailureCode.css
New file
@@ -0,0 +1,10 @@
.exampleHolder{
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    text-align: center;
}
.container .uiContainerManager{
    display: none !important;
}/* sample css file */
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.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/qisUniversalFailureCode/qisUniversalFailureCode.js
New file
@@ -0,0 +1,63 @@
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.initForQisUniversalFailureCodeButton';
import sqlForPAE  from '@salesforce/apex/QISReportController.sqlForPAE';
export default class qisUniversalFailureCode extends LightningElement {
    @api recordId;
    IsLoading = true;
    qisReportId;
    paeId;
     @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 => {
            console.log(result);
            if (result != null) {
                this.IsLoading = false;
                this.qisReportId = result.Id;
                var RecordTypeId = "ASACDecision";
                sqlForPAE({
                    qisReportId: this.qisReportId
                    }).then(result => {
                    if (result!=null) {
                        this.paeId = result.PAEid;
                        console.log('result='+this.paeId);
                    }
                    var url = '';
                    if (result!=null&&result.length>0){
                        url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ;
                    } else {
                        url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId;
                    }
                    console.log('url='+url);
                    // window.open(url,'_self');
                    window.location.replace(url);
                });
            }
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
        });
    }
}
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.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="qisUniversalFailureCode">
   <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>