黄千龙
2023-07-18 428f42fab44b654c69fbc461513203830743d7de
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js
@@ -5,7 +5,14 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForRCSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisWithRC';
import { updateRecord } from 'lightning/uiRecordApi';
/*
 * @Description: 提交待审批
 * @Author: hql
 * @Date: 2023-07-12 09:45:19
 * @LastEditTime: 2023-07-12 15:44:33
 * @LastEditors:
 */
export default class lexRCSubmit extends LightningElement {
   @api recordId;
   IsLoading = true;
@@ -61,11 +68,11 @@
               return;
            }
            console.log('this.RCproblemnotfound='+(this.QISReplyDay!=null  && this.RCproblemnotfound));
            if (this.CancelQISReason!=null) {
            if (this.CancelQISReason==null) {
               if (this.qisStatus == 'RC检测申请') {
                    const evt = new ShowToastEvent({
                        title : '需要先点击[OCM服务本部收到实物]',
                        message: '',
                        title : '',
                        message: '需要先点击[OCM服务本部收到实物]',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -74,8 +81,8 @@
               }
               if (this.Rcid ==null) {
                    const evt = new ShowToastEvent({
                        title : '判定担当必须填写',
                        message: '',
                        title : '',
                        message: '判定担当必须填写',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -84,8 +91,8 @@
               }
               if (this.RCinspectionDate == null) {
                    const evt = new ShowToastEvent({
                        title : 'OCM服务本部还没有检测完毕',
                        message: '',
                        title : '',
                        message: 'OCM服务本部还没有检测完毕',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -95,8 +102,8 @@
               if (this.QISReplyDay!=null  && this.RCproblemnotfound) {
                    const evt = new ShowToastEvent({
                        title : '最终判定时,请取消[故障未发现留下继续观察]并选择[对应方法]',
                        message: '',
                        title : '',
                        message: '最终判定时,请取消[故障未发现留下继续观察]并选择[对应方法]',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -154,12 +161,14 @@
                     this.err = result;
                 if (result!='成功') {
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: this.err,
                            title : '',
                            message: '更新失败'+this.err,
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        updateRecord({fields: { Id: this.recordId }});
                    }
                    updateRecord({fields: { Id: this.recordId }});
                this.dispatchEvent(new CloseActionScreenEvent());
              }).catch(error => {
            console.log('error='+error);