黄千龙
2023-05-24 ac49e658cf9674065476431a5deb81a93d1bc25a
0524LightningConfirm框修改
5个文件已修改
256 ■■■■■ 已修改文件
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
@@ -2,6 +2,7 @@
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForOCMSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisWithOCM';
@@ -86,18 +87,23 @@
                 this.dispatchEvent(new CloseActionScreenEvent());
                return;
             }
             if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                 this.dispatchEvent(new CloseActionScreenEvent());
                return;
            }
            this.updateQisSubmit();
            if (this.isaohuiproduct) {
                this.dispatchEvent(new CloseActionScreenEvent());
                this.updateRecordView(this.recordId);
            }
            this.dispatchEvent(new CloseActionScreenEvent());
            this.updateRecordView(this.recordId);
                LightningConfirm.open({
                message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?',
                variant: 'headerless',
                label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        this.updateQisSubmit();
                        if (this.isaohuiproduct) {
                            this.dispatchEvent(new CloseActionScreenEvent());
                            this.updateRecordView(this.recordId);
                        }
                    }else{
                        this.dispatchEvent(new CloseActionScreenEvent());
                        this.updateRecordView(this.recordId);
                        return;
                    }
                });
        }).catch(error => {
            console.log('error='+error);
        }).finally(() => {
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
@@ -2,6 +2,7 @@
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForlexOCSMNoToReportLightingButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOCSMNoToReportLighting';
@@ -42,32 +43,40 @@
            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);
            LightningConfirm.open({
                message: '不要报告后无法撤回,是否继续?',
                variant: 'headerless',
                label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        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;
                        }
                    }else{
                        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(() => {
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js
@@ -2,6 +2,7 @@
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForlexOCSMToReportLightingButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOCSMToReportLighting';
@@ -38,22 +39,30 @@
                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);
                LightningConfirm.open({
                    message: '报告后无法撤回,是否继续?',
                    variant: 'headerless',
                    label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        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;
                        }
                    }else{
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
                 }
                    }
                 });
        }).catch(error => {
            console.log(error);
        }).finally(() => {
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
@@ -2,6 +2,7 @@
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForOSHSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQis1';
@@ -64,43 +65,53 @@
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
             }
             if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                return;
            }
            if (this.OSHstaff==null||this.OSHstaffEmail==null) {
                const evt = new ShowToastEvent({
                            title : 'OSH担当必须填写',
                            message: '',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
            }
            try{
                this.updateQisSubmit();
            }catch(err){
                if(err.faultstring !=undefined && err.faultstring.indexOf('INVALID_SESSION_ID') != -1) {
                    const evt = new ShowToastEvent({
                            title : '当前网页已登出,请您重新登录后刷新该网页!',
                            message: '',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
                } else {
                    const evt = new ShowToastEvent({
                            title : err.faultstring,
                            message: '',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
            LightningConfirm.open({
            message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?',
            variant: 'headerless',
            label: 'this is the aria-label value',
            }).then(res=>{
                if(res) {
                    if (this.OSHstaff==null||this.OSHstaffEmail==null) {
                        const evt = new ShowToastEvent({
                                    title : 'OSH担当必须填写',
                                    message: '',
                                    variant: 'error'
                                });
                                this.dispatchEvent(evt);
                                this.dispatchEvent(new CloseActionScreenEvent());
                                return;
                        }
                        try{
                            this.updateQisSubmit();
                        }catch(err){
                            if(err.faultstring !=undefined && err.faultstring.indexOf('INVALID_SESSION_ID') != -1) {
                                const evt = new ShowToastEvent({
                                        title : '当前网页已登出,请您重新登录后刷新该网页!',
                                        message: '',
                                        variant: 'error'
                                    });
                                    this.dispatchEvent(evt);
                                    this.dispatchEvent(new CloseActionScreenEvent());
                                    return;
                            } else {
                                const evt = new ShowToastEvent({
                                        title : err.faultstring,
                                        message: '',
                                        variant: 'error'
                                    });
                                    this.dispatchEvent(evt);
                                    this.dispatchEvent(new CloseActionScreenEvent());
                                    return;
                            }
                            return;
                        }
                }else{
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
                return;
            }
            });
            
        }).catch(error => {
            console.log('error='+error);
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js
@@ -2,6 +2,7 @@
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { NavigationMixin } from 'lightning/navigation';
import LightningConfirm from 'lightning/confirm';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForRCSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisWithRC';
@@ -62,6 +63,7 @@
                this.dispatchEvent(new CloseActionScreenEvent());
                 return;
             }
            console.log('this.RCproblemnotfound='+(this.QISReplyDay!=null  && this.RCproblemnotfound));
             if (this.CancelQISReason!=null) {
                 if (this.qisStatus == 'RC检测申请') {
                    const evt = new ShowToastEvent({
@@ -93,6 +95,7 @@
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
                 if (this.QISReplyDay!=null  && this.RCproblemnotfound) {
                    const evt = new ShowToastEvent({
                        title : '最终判定时,请取消[故障未发现留下继续观察]并选择[对应方法]',
@@ -103,23 +106,41 @@
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                 }
                 if (confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                     this.type = '1';
                }else{
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
                LightningConfirm.open({
                message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?',
                variant: 'headerless',
                label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        this.type = '1';
                        console.log('this.type='+this.type);
                        this.updateQisSubmit();
                    }else{
                        this.dispatchEvent(new CloseActionScreenEvent());
                        return;
                    }
                });
             }else{
                 if (confirm("一旦提交关闭此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
                    this.type = '2';
                }else{
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
                LightningConfirm.open({
                message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?',
                variant: 'headerless',
                label: 'this is the aria-label value',
                }).then(res=>{
                    if(res) {
                        this.type = '2';
                        console.log('this.type='+this.type);
                        this.updateQisSubmit();
                    }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(() => {