黄千龙
2023-07-18 428f42fab44b654c69fbc461513203830743d7de
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
@@ -5,7 +5,14 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init  from '@salesforce/apex/QISReportController.initForOCMSubmitButton';
import updateQis  from '@salesforce/apex/QISReportController.updateQisWithOCM';
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 lexOCMSubmit extends LightningElement {
   @api recordId;
   IsLoading = true;
@@ -43,8 +50,8 @@
            this.isaohuiproduct = result.isaohuiproduct;
            if (this.qisStatus!='草案中' && this.qisStatus!='取消') {
               const evt = new ShowToastEvent({
                        title : '已经提交',
                        message: '',
                        title : '',
                        message: '已经提交',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -53,8 +60,8 @@
            }else{
               if (this.qisStatus == '取消') {
                  const evt = new ShowToastEvent({
                        title : '取消后的QIS不允许再提交,如果需要提交请点击\"复制\"按钮重新生成一个QIS',
                        message: '',
                        title : '',
                        message: '取消后的QIS不允许再提交,如果需要提交请点击\"复制\"按钮重新生成一个QIS',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -65,8 +72,8 @@
            
            if (this.QISInstallDate == null) {
               const evt = new ShowToastEvent({
                        title : '【购买日期/安装日期】为空时不能提交申请',
                        message: '',
                        title : '',
                        message: '【购买日期/安装日期】为空时不能提交申请',
                        variant: 'error'
                    });
                 this.dispatchEvent(evt);
@@ -76,8 +83,8 @@
            if (this.contractnumber == null) {
               const evt = new ShowToastEvent({
                        title : '【销售合同上订单号码】为空时不能提交申请',
                        message: '',
                        title : '',
                        message: '【销售合同上订单号码】为空时不能提交申请',
                        variant: 'error'
                    });
                    this.dispatchEvent(evt);
@@ -113,13 +120,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(() => {