黄千龙
2023-07-18 428f42fab44b654c69fbc461513203830743d7de
force-app/main/default/lwc/lexOSHInspect/lexOSHInspect.js
@@ -3,8 +3,16 @@
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForlexOSHInspectButton';
import { updateRecord } from 'lightning/uiRecordApi';
import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOSHInspect';
/*
 * @Description: OSH检查受理
 * @Author: hql
 * @Date: 2023-07-12 09:45:19
 * @LastEditTime: 2023-07-12 15:44:33
 * @LastEditors:
 */
export default class lexOSHInspect extends LightningElement {
   @api recordId;
   IsLoading = true;
@@ -39,8 +47,8 @@
            this.oSHInspectionDate = result.oSHInspectionDate;
            if (this.qisStatus!='OSH检测中') {
               const evt = new ShowToastEvent({
                            title : '需要先点击[OSH现品收到]',
                            message: '',
                            title : '',
                            message: '需要先点击[OSH现品收到]',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
@@ -48,8 +56,8 @@
                        return;
            }else if(this.oSHInspectionDate != null){
               const evt = new ShowToastEvent({
                            title : 'OSH检测已经受理',
                            message: '',
                            title : '',
                            message: 'OSH检测已经受理',
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
@@ -75,13 +83,15 @@
                 if (result!='成功') {
                        this.err = result;
                        const evt = new ShowToastEvent({
                            title : '更新失败',
                            message: this.err,
                            title : '',
                            message: '更新失败'+this.err,
                            variant: 'error'
                        });
                        this.dispatchEvent(evt);
                        updateRecord({fields: { Id: this.recordId }});
                    }
                this.dispatchEvent(new CloseActionScreenEvent());
                updateRecord({fields: { Id: this.recordId }});
              }).catch(error => {
            console.log('error='+error);
        }).finally(() => {