| | |
| | | urfFlag; |
| | | rtn1; |
| | | rtn; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 上传SAP |
| | | uploadToSap() { |
| | | if (this.MCApprovalStatusC != 'Pass') { |
| | | this.ShowToastEvent("合同复核批准后才可以上传SAP。", "error") |
| | | // alert("合同复核批准后才可以上传SAP。"); |
| | | } else if (this.MaintenanceContractNoC == undefined) { |
| | | this.ShowToastEvent('维修合同管理编码为空,不能上传SAP。', "error") |
| | | // alert('维修合同管理编码为空,不能上传SAP。'); |
| | | } else if (this.uploadToSapTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传SAP,不能重复上传。', "error") |
| | | // alert('已经上传SAP,不能重复上传。'); |
| | | } else { |
| | | if (this.oldIsRecognitionModelC) { |
| | | if (this.uploadToRMTimeC == undefined) { |
| | | this.ShowToastEvent('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能上传SAP。', "error") |
| | | // alert('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能上传SAP。'); |
| | | return; |
| | | } else { |
| | | if (!this.IsRecognitionModelTrueC) { |
| | | this.ShowToastEvent('当前维修合同没有完成认款,不能上传SAP。', "error") |
| | | // alert('当前维修合同没有完成认款,不能上传SAP。'); |
| | | return; |
| | | } |
| | | } |
| | |
| | | }).then(result => { |
| | | if (result != '1') { |
| | | this.ShowToastEvent('上传SAP失败,因为 来年合同相关信息修改失败', "error") |
| | | // alert('上传SAP失败,因为 来年合同相关信息修改失败'); |
| | | } |
| | | }); |
| | | updateFirstContract({ |
| | |
| | | }).then(result => { |
| | | if (result != '1') { |
| | | this.ShowToastEvent(result, "error") |
| | | // alert(result); |
| | | } |
| | | }); |
| | | this.urfFlag = this.URFContractFC; |
| | |
| | | }); |
| | | if (this.rtn == '1') { |
| | | this.ShowToastEvent("上传SAP成功", "success") |
| | | // alert("上传SAP成功"); |
| | | window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Maintenance_Contract__c/" + this.recordId + "/view"); |
| | | location.href = "/" + this.Id; |
| | | } else { |
| | | this.ShowToastEvent(this.rtn, "error") |
| | | // alert(this.rtn); |
| | | } |
| | | } else { |
| | | this.ShowToastEvent(this.rtn1, "error") |
| | | // alert(this.rtn1); |
| | | } |
| | | } |
| | | } |