| | |
| | | import sendToETQ from '@salesforce/apex/buttonQISReportCtl.sendToETQ'; |
| | | import updateQISReportC from '@salesforce/apex/buttonQISReportCtl.updateQISReportC'; |
| | | import selectQISReportC from '@salesforce/apex/buttonQISReportCtl.selectQISReportC'; |
| | | |
| | | import initSelectProfile from '@salesforce/apex/otherButtonRepairController.initSelectProfile'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | |
| | | QISFinalJudgementC; |
| | | ETQUPLOADSTATUSC; |
| | | AEDetermineResultC; |
| | | profileName; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.ETQUPLOADSTATUSC = result.ETQUPLOADSTATUSC; |
| | | this.AEDetermineResultC = result.AEDetermineResultC; |
| | | |
| | | this.myDate(); |
| | | this.myReload(); |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | |
| | | this.myDate(); |
| | | this.myReload(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | |
| | | |
| | | // 发送QIS到EtQ |
| | | SendQISToEtQ() { |
| | | console.log(this.profileName); |
| | | var QId = this.Id; |
| | | var uid = this.userId; |
| | | |
| | | if (this.profileId != "00e10000000xnoO" && this.profileId != "00e10000000hl7w") { |
| | | if (this.profileName != "2F7_OSH担当" && this.profileName != "2F7_OSH质量法规") { |
| | | alert("您没有发送QIS到EtQ的权限。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.PAEDetermineC == undefined) { |
| | | alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.AEDetermineResultC == "nonAE" && this.PAEDetermineC == "nonPAE" && this.PAEDetermineACC == "nonPAE" && this.OCMJudgementC == undefined && this.QISFinalJudgementC == undefined) { |
| | | alert("nonAE并nonPAE的QIS同步到EtQ的时候,检测结论(OCSM)是必填的。不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.ETQUPLOADSTATUSC == "3") { |
| | | if (!confirm("是否清空EtQ同步状态,重新同步数据?")) { |
| | | return; |
| | |
| | | selectQISReportC({ |
| | | QId: this.Id |
| | | }).then(record => { |
| | | if (record.AsyncData__c == 'true' && record.ETQ_UPLOAD_STATUS__c != '3' || record.Complaint_Number__c != null) { |
| | | console.log(record); |
| | | if (record[0].AsyncData__c == 'true' && record[0].ETQ_UPLOAD_STATUS__c != '3' || record[0].Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendqistoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | |
| | | } |
| | | alert('该QIS之前已经发送过了') |
| | | } else { |
| | | SendQISToEtQ(); |
| | | this.SendQISToEtQ(); |
| | | } |
| | | }) |
| | | } |