| | |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | export default class LexSCSubmit extends LightningElement { |
| | | @api recordId; |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | |
| | | this.SCSubmit(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 提交待审批 |
| | | SCSubmit() { |
| | | if (this.StatusC != '草案中') { |
| | | this.ShowToastEvent("已经提交审批", "error") |
| | | // alert('已经提交审批'); |
| | | this.ShowToastEvent("已经提交审批", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | if (!confirm("一旦OCM提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | | return; |
| | | } |
| | | |
| | | updateQISSCReport({ |
| | | Id: this.Id |
| | | }).then(result => { |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } |
| | | this.ShowToastEvent("已提交", "success") |
| | | // alert('已提交!') |
| | | window.location.reload(); |
| | | }) |
| | | this.handleConfirmClick("一旦OCM提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?"); |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | |
| | | if(result){ |
| | | updateQISSCReport({ |
| | | QId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | this.ShowToastEvent(split[1], "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | // alert(split[1]); |
| | | } else { |
| | | this.ShowToastEvent("已提交", "success"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.location.reload(); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |