| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 09:05:05 |
| | | * @LastEditTime: 2023-05-09 17:42:28 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | @api recordId;//OwnerId |
| | | ownerId; |
| | | monthlyReportId; |
| | | userId; |
| | | IsLoading = true; |
| | | |
| | | |
| | |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.ownerId = result.ownerId; |
| | | this.userId = result.userId; |
| | | this.monthlyReportId = result.Id; |
| | | this.cancelSubmit(); |
| | | console.log("end"); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Monthly_Report__c/" + this.monthlyReportId + "/view"); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | cancelSubmit () { |
| | | //需要完善 |
| | | if(this.ownerId == UserInfo_Owner.Id) { |
| | | if(this.ownerId == this.userId) { |
| | | cancel({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | console.log("321"); |