| | |
| | | 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'; |
| | |
| | | qisStatus; |
| | | contractnumber; |
| | | isaohuiproduct; |
| | | err; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.qisReportId = result.Id; |
| | | this.qisStatus = result.QIStatus; |
| | | this.QISInstallDate = result.QISInstallDate; |
| | | 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 : '已经提交', |
| | |
| | | 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); |
| | | 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(() => { |
| | |
| | | }).then(result =>{ |
| | | console.log('result'+result); |
| | | if (result!='成功') { |
| | | this.err = result; |
| | | const evt = new ShowToastEvent({ |
| | | title : '更新失败', |
| | | message: result, |
| | | message: this.err, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |