force-app/main/default/classes/LightingButtonConstant.cls
New file @@ -0,0 +1,49 @@ global without sharing class LightingButtonConstant { //周报月报的状态‘草案中’ public static final String STATUS_DRAFT = '草案中'; //报告书的状态‘完毕’ public static final String STATUS_COMPLETE = '完毕'; //报告书的状态‘取消’ public static final String STATUS_CANCEL = '取消'; //OCSM报告的状态‘待报告’ public static final String STATUS_TO_BE_REPORTED = '待报告'; //OCSM报告的状态‘无需报告’ public static final String STATUS_TO_NOT_REPORT = '无需报告'; //VOC报告的状态‘结果确认完毕’ public static final String STATUS_VOC_CONFIRMED = '结果确认完毕'; //VOC报告的状态‘回答完毕’ public static final String STATUS_VOC_END_OF_ANSWER = '回答完毕'; //VOC报告的状态‘申请中’ public static final String STATUS_VOC_APPLYING = '申請中'; //VOC报告的状态‘判定完毕’ public static final String STATUS_VOC_CHECK_OVER = '判定完毕'; //VOC报告的状态‘填写完毕’ public static final String STATUS_VOC_WRITE_OVER = '填写完毕'; //VOC报告的状态‘完毕’ public static final String STATUS_VOC_FINISH = '完毕'; //周报月报的记录类型名‘周报’ public static final String RECORD_TYPE_NAME_BY_MONTHLY_REPORT = '周报'; //报告书的记录类型‘提交’ public static final String RECORD_TYPE_NAME_BY_SUBMIT = '提交'; //报告书的记录类型‘跟台’ public static final String RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE = '跟台'; //报告书的记录类型‘OPD’ public static final String RECORD_TYPE_NAME_BY_OPD= 'OPD'; //记录类型的developerName‘ASRCDecision’ public static final String DEVELOPER_NAME_ASRC_DECISION = 'ASRCDecision'; //记录类型的developerName‘ASACDecision’ public static final String DEVELOPER_NAME_ASAC_DECISION = 'ASACDecision'; //工作分类的销售服务 public static final String TYPE_OF_SALES_SERVICES = '销售服务'; //userAccess参数后缀_Edit public static final String USER_ACCESS_EDIT = '_Edit'; //userAccess参数后缀_Read public static final String USER_ACCESS_READ = '_Read'; public static final String CN_YES = '是'; public static final String CN_NO = '否'; public static final String VOC_NAME = 'VOC'; public static final String OK = 'OK'; public static final String SOBJECT_NAME_OF_REPORT_SHARE ='Report__Share'; public static final String SOBJECT_NAME_OF_VOC_SHARE = 'VOCShare__c'; } force-app/main/default/classes/LightingButtonConstant.cls-meta.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>56.0</apiVersion> <status>Active</status> </ApexClass> force-app/main/default/classes/MonthlyReportController.cls
@@ -1,4 +1,5 @@ public with sharing class MonthlyReportController { //为取消提交相应的js提供初始化数据 @AuraEnabled public static InitData initForCancelSubmitButton (String recordId){ InitData res = new initData(); @@ -14,7 +15,7 @@ return res; } //为创建notes邮箱操作提供初始化数据 @AuraEnabled public static InitData initForCreateNoteEmailButton (String recordId) { InitData res = new initData(); @@ -48,13 +49,13 @@ } return res; } //取消提交操作更新相应数据 @AuraEnabled public static void cancel(String recordId) { try { Monthly_Report__c report = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1]; report.Status__c = '草案中'; report.RecordTypeId = '01210000000Qggf'; report.Status__c = LightingButtonConstant.STATUS_DRAFT; report.RecordTypeId = Schema.SObjectType.Monthly_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_MONTHLY_REPORT).getRecordTypeId(); report.Submit_check_flag__c = false; report.Submit_time__c = null; update report; force-app/main/default/classes/ReportController.cls
@@ -62,7 +62,7 @@ } return res; } //给VOC结果确认相应的js提供初始化数据 @AuraEnabled public static InitData initForVOCConfirmButton (String recordId) { InitData res = new initData(); @@ -134,7 +134,7 @@ return res; } //给完毕相应的js提供初始化数据 @AuraEnabled public static InitData initForCompleteButton(String recordId){ InitData res = new InitData(); @@ -147,13 +147,13 @@ } return res; } //给Intake universal code编辑相应的js提供初始化数据 @AuraEnabled public static InitData initForASRCEditorButton(String recordId){ InitData res = new InitData(); String recordTypeId = 'ASRCDecision'; String developerName = LightingButtonConstant.DEVELOPER_NAME_ASRC_DECISION; try { PAE_DecisionRecord__c[] report = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Report__c = :recordId And RecordType.DeveloperName = :recordTypeId Order by LastModifiedDate desc]; PAE_DecisionRecord__c[] report = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Report__c = :recordId And RecordType.DeveloperName = :developerName Order by LastModifiedDate desc]; if (report != null && !report.isEmpty()) { res.LastModifiedDate = report[0].LastModifiedDate; res.Id = report[0].Id; @@ -168,11 +168,11 @@ } //给Final universal code编辑相应的js提供初始化数据 @AuraEnabled public static InitData initForASACEditorButton(String recordId){ InitData res = new InitData(); String recordTypeId = 'ASACDecision'; String recordTypeId = LightingButtonConstant.DEVELOPER_NAME_ASAC_DECISION; try { PAE_DecisionRecord__c[] report = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Report__c = :recordId And RecordType.DeveloperName = :recordTypeId Order by LastModifiedDate desc]; if (report != null && !report.isEmpty()) { @@ -189,7 +189,7 @@ } //给OPDtoSIS相应的js提供初始化数据 @AuraEnabled public static InitData initForOPDtoSISButton(String recordId){ InitData res = new InitData(); @@ -222,7 +222,7 @@ try { Report__c rac = new Report__c(); rac.Id = reocrdId; rac.Status__c = '提交'; rac.Status__c = LightingButtonConstant.RECORD_TYPE_NAME_BY_SUBMIT; rac.Submit_time__c = Datetime.now(); rac.Submit_report_day__c = Date.today(); update rac; @@ -230,13 +230,13 @@ throw new AuraHandledException(e.getMessage()); } } //OPDtoSIS操作更新相应数据 @AuraEnabled public static void updateForOPDtoSISButton(String recordId,String recordTypeId){ public static void updateForOPDtoSISButton(String recordId){ try { Report__c rac = new Report__c(); rac.Id = recordId; rac.RecordTypeId = recordTypeId; rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId(); update rac; } catch (Exception e) { System.debug(LoggingLevel.INFO, '*** e: ' + e); @@ -249,7 +249,7 @@ try { Report__c rac = new Report__c(); rac.Id = recordId; rac.Status__c = '草案中'; rac.Status__c = LightingButtonConstant.STATUS_DRAFT; rac.Submit_report_day__c = null; rac.Submit_time__c = null; update rac; @@ -257,14 +257,14 @@ throw new AuraHandledException(e.getMessage()); } } //完毕操作更新相应数据 @AuraEnabled public static void updateForCompleteButton(String recordId,String recordTypeId){ public static void updateForCompleteButton(String recordId){ Report__c rac = new Report__c(); try { rac.Id = recordId; rac.Status__c = '完毕'; rac.RecordTypeId = recordTypeId; rac.Status__c = LightingButtonConstant.STATUS_COMPLETE; rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.VOC_NAME).getRecordTypeId(); update rac; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); @@ -276,7 +276,7 @@ try { Report__c rac = new Report__c(); rac.Id = recordId; rac.OCSMAdministrativeReportStatus__c = '待报告'; rac.OCSMAdministrativeReportStatus__c = LightingButtonConstant.STATUS_TO_BE_REPORTED; update rac; } catch (Exception e) { System.debug(LoggingLevel.INFO, '*** e: ' + e); @@ -285,11 +285,11 @@ //SIStoOPD操作更新相应数据 @AuraEnabled public static String updateForSIStoOPDButton(String recordId,String recordTypeId){ public static String updateForSIStoOPDButton(String recordId){ Report__c rac = new Report__c(); try { rac.Id = recordId; rac.RecordTypeId = recordTypeId; rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE).getRecordTypeId(); update rac; return null; } catch (Exception e) { @@ -314,7 +314,7 @@ try { Report__c rac = new Report__c(); rac.Id = recordId; rac.OCSMAdministrativeReportStatus__c = '无需报告'; rac.OCSMAdministrativeReportStatus__c = LightingButtonConstant.STATUS_TO_NOT_REPORT; update rac; } catch (Exception e) { System.debug(LoggingLevel.INFO, '*** e: ' + e); @@ -327,24 +327,24 @@ try { Report__c rac = new Report__c(); rac.Id = recordId; rac.Status__c = '取消'; rac.Status__c = LightingButtonConstant.STATUS_CANCEL; update rac; } catch (Exception e) { System.debug(LoggingLevel.INFO, '*** e: ' + e); } } //VOC结果确认更新相应数据 @AuraEnabled public static void updateForVOCConfirmButton(String recordId,String Satisfy,String Satisfy1){ try { Report__c rac = new Report__c(); rac.Id = recordId; if (Satisfy == '是') { rac.Status__c = '结果确认完毕'; } else if (Satisfy == '否') { if (Satisfy == LightingButtonConstant.CN_YES) { rac.Status__c = LightingButtonConstant.STATUS_VOC_CONFIRMED; } else if (Satisfy == LightingButtonConstant.CN_NO) { // 対応結果(一回目)に値なければ、一回目の「否」と見なす if (Satisfy1 != '否') { if (Satisfy1 != LightingButtonConstant.CN_NO) { Report__c[] records = [SELECT Id, VOC_Satisfy__c, VOC_Unsatisfy_Reason__c, VOC_follow_up_result__c, VOC_solution_category__c FROM Report__c WHERE Id = :recordId]; rac.VOC_Satisfy__c = null; rac.VOC_Unsatisfy_Reason__c = null; @@ -354,11 +354,11 @@ rac.VOC_Unsatisfy_Reason1__c = records[0].VOC_Unsatisfy_Reason__c; rac.VOC_follow_up_result1__c = records[0].VOC_follow_up_result__c; rac.VOC_solution_category1__c = records[0].VOC_solution_category__c; rac.Status__c = '草案中'; rac.Status__c = LightingButtonConstant.STATUS_DRAFT; } // 対応結果(一回目)に値あれば、二回目の「否」と見なす else { rac.Status__c = '结果确认完毕'; rac.Status__c = LightingButtonConstant.STATUS_VOC_CONFIRMED; } } update rac; @@ -371,7 +371,7 @@ public static String updateForVOCAnswerButton(String recordId){ try { Report__c rac = [select Status__c from Report__c where Id = :recordId]; rac.Status__c = '回答完毕'; rac.Status__c = LightingButtonConstant.STATUS_VOC_END_OF_ANSWER; update rac; return null; } catch (Exception e) { @@ -386,13 +386,13 @@ } } //提交竞争对手报告更新相应数据 @AuraEnabled public static void updateForSubmitCompetitorReportButton(String recordId){ try { Report__c rac = new Report__c(); rac.Id = recordId; rac.Status__c = '申請中'; rac.Status__c = LightingButtonConstant.STATUS_VOC_APPLYING; rac.Submit_time__c = Datetime.now(); rac.Submit_report_day__c = Date.today(); rac.Date__c = Date.today(); @@ -410,23 +410,23 @@ rac.Id = recordId; User[] records = [SELECT Job_Category__c FROM User WHERE Id = :createdById]; List<String> userAccess = new List<String>(); if (records[0].Job_Category__c == '销售服务') { userAccess.add(rac.JingliApprovalManager__c + '_Read'); userAccess.add(rac.BuchangApprovalManager__c + '_Read'); if (records[0].Job_Category__c == LightingButtonConstant.TYPE_OF_SALES_SERVICES) { userAccess.add(rac.JingliApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); userAccess.add(rac.BuchangApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); rac.VOC_CreatedBy_jingli__c = rac.JingliApprovalManager__c; rac.VOC_CreatedBy_buzhang__c = rac.BuchangApprovalManager__c; } else { userAccess.add(rac.SalesManager__c + '_Read'); userAccess.add(rac.BuchangApprovalManagerSales__c + '_Read'); userAccess.add(rac.SalesManager__c + LightingButtonConstant.USER_ACCESS_READ); userAccess.add(rac.BuchangApprovalManagerSales__c + LightingButtonConstant.USER_ACCESS_READ); rac.VOC_CreatedBy_jingli__c = rac.SalesManager__c; rac.VOC_CreatedBy_buzhang__c = rac.BuchangApprovalManagerSales__c; } userAccess.add(rac.ZongjianApprovalManager__c + '_Read'); String rtn = ControllerUtil.setSObjectShare('Report__Share','VOCShare__c',recordId,userAccess,rac.Owner.Id); if (rtn != 'OK') { userAccess.add(rac.ZongjianApprovalManager__c + LightingButtonConstant.USER_ACCESS_READ); String rtn = ControllerUtil.setSObjectShare(LightingButtonConstant.SOBJECT_NAME_OF_REPORT_SHARE,LightingButtonConstant.SOBJECT_NAME_OF_VOC_SHARE,recordId,userAccess,rac.Owner.Id); if (rtn != LightingButtonConstant.OK) { return; } rac.Status__c = '填写完毕'; rac.Status__c = LightingButtonConstant.STATUS_VOC_WRITE_OVER; rac.Submit_time__c = Date.today(); rac.Submit_report_day__c = Date.today(); update rac; @@ -435,14 +435,15 @@ } } //VOC判定更新相应数据 @AuraEnabled public static String updateForVOCCheckButton (String recordId,String isVOC,String personId) { try { Report__c rac = [select Owner.Id,VOC_jingli__r.Id,VOC_buzhang__r.Id,VOC_zongjian__r.Id,VOC_Finish__c,VOC_share_date__c,Responsible_Person__r.Id from Report__c where Id = :recordId]; if (isVOC == 'VOC') { if (isVOC == LightingButtonConstant.VOC_NAME) { // VOC対応者の経理部長総監を設定 User[] records = [SELECT Id, Job_Category__c, JingliApprovalManager__c, SalesManager__c, BuchangApprovalManager__c, BuchangApprovalManagerSales__c, ZongjianApprovalManager__c FROM User WHERE Id = :personId]; if (records[0].job_Category__c == '销售服务') { if (records[0].job_Category__c == LightingButtonConstant.TYPE_OF_SALES_SERVICES) { rac.VOC_jingli__c = records[0].JingliApprovalManager__c == null ? '' : records[0].JingliApprovalManager__c; rac.VOC_buzhang__c = records[0].BuchangApprovalManager__c == null ? '' : records[0].BuchangApprovalManager__c; } else { @@ -450,23 +451,23 @@ rac.VOC_buzhang__c = records[0].BuchangApprovalManagerSales__c == null ? '' : records[0].BuchangApprovalManagerSales__c; } rac.VOC_zongjian__c = records[0].ZongjianApprovalManager__c == null ? '' : records[0].ZongjianApprovalManager__c; rac.Status__c = '判定完毕'; rac.Status__c = LightingButtonConstant.STATUS_VOC_CHECK_OVER; rac.VOC_Finish__c = false; Date serverTimestamp = Date.today(); rac.VOC_share_date__c = serverTimestamp; // share List<String> userAccess = new List<String>(); userAccess.add(rac.Responsible_Person__c + '_Edit'); userAccess.add(rac.VOC_jingli__c + '_Read'); userAccess.add(rac.VOC_buzhang__c + '_Read'); userAccess.add(rac.VOC_zongjian__c + '_Read'); String rtn = ControllerUtil.setSObjectShare('Report__Share','VOCShare__c',recordId,userAccess,rac.Owner.Id); if (rtn != 'OK') { userAccess.add(rac.Responsible_Person__c + LightingButtonConstant.USER_ACCESS_EDIT); userAccess.add(rac.VOC_jingli__c + LightingButtonConstant.USER_ACCESS_READ); userAccess.add(rac.VOC_buzhang__c + LightingButtonConstant.USER_ACCESS_READ); userAccess.add(rac.VOC_zongjian__c + LightingButtonConstant.USER_ACCESS_READ); String rtn = ControllerUtil.setSObjectShare(LightingButtonConstant.SOBJECT_NAME_OF_REPORT_SHARE,LightingButtonConstant.SOBJECT_NAME_OF_VOC_SHARE,recordId,userAccess,rac.Owner.Id); if (rtn != LightingButtonConstant.OK) { return null; } update rac; } else { rac.Status__c = '完毕'; rac.Status__c = LightingButtonConstant.STATUS_VOC_FINISH; rac.VOC_Finish__c = true; update rac; } @@ -477,11 +478,12 @@ return exc; } } //VOC完毕操作更新相应数据 @AuraEnabled public static void updateForVOCFinishButton (String recordId) { try { Report__c report = [select Id,Status__C from Report__c where Id = :recordId]; report.Status__c = '完毕'; report.Status__c = LightingButtonConstant.STATUS_VOC_FINISH; update report; } catch (Exception e) { System.debug(LoggingLevel.INFO, '*** e: ' + e); force-app/main/default/lwc/lexCancel/lexCancel.js
@@ -9,23 +9,7 @@ @api recordId; status; IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ console.log(this.recordId); force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.html
@@ -1,5 +1,6 @@ <template> <div class="cancelSubmitHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button> </div> </template> force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
@@ -6,29 +6,12 @@ import cancel from '@salesforce/apex/MonthlyReportController.cancel'; import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class LexCancelSubmit extends LightningElement { @api recordId;//OwnerId ownerId; monthlyReportId; IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback () { console.log(this.recordId); init({ @@ -42,6 +25,7 @@ this.cancelSubmit(); console.log("end"); this.dispatchEvent(new CloseActionScreenEvent()); this.showToast(); this.updateRecordView(this.recordId); //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Monthly_Report__c/" + this.monthlyReportId + "/view"); @@ -52,6 +36,15 @@ }).finally(() => { }); } showToast() { const event = new ShowToastEvent({ title: '', message: '取消提交成功!', variant: 'success' }); this.dispatchEvent(event); } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); @@ -64,7 +57,7 @@ }); console.log("321"); } else { alert("只周报的所有人可以取消"); this.showToast("只有周报的所有人可以取消","error"); } } } force-app/main/default/lwc/lexComplete/lexComplete.css
New file @@ -0,0 +1,10 @@ .completeHolder{ position: relative; display: inline-block; width: 80px; height: 80px; text-align: center; } .container .uiContainerManager{ display: none !important; } force-app/main/default/lwc/lexComplete/lexComplete.html
New file @@ -0,0 +1,6 @@ <template> <div class="completeHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> </template> force-app/main/default/lwc/lexComplete/lexComplete.js
New file @@ -0,0 +1,70 @@ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/ReportController.initForCompleteButton'; import updateForCompleteButton from '@salesforce/apex/ReportController.updateForCompleteButton'; import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class LexComplete extends LightningElement { @api recordId; profileId; status; IsLoading = true; connectedCallback () { console.log(this.recordId); init({ recordId: this.recordId }).then(result => { console.log(result); if (result != null) { this.IsLoading = false; this.status = result.status; this.profileId = result.profileId; this.complete(); this.dispatchEvent(new CloseActionScreenEvent()); //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); } }).catch(error => { console.log("error"); console.log(error); }).finally(() => { }); //this.updateRecordView(this.recordId); } showToast(msg,type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); } complete () { // 陆胜,胡迪安,系统管理员以外没有权限 if (UserInfo_Owner.Id != "00510000004reg2" && UserInfo_Owner.Id != "00510000000gWAE" && this.profileId != "00e10000000Y3o5") { ShowToastEvent("你没有权限","error"); return; } if (this.status == "完毕") { ShowToastEvent("已经完毕!","error"); return; } updateForCompleteButton({ recordId: this.recordId }).then(result =>{ this.updateRecordView(this.recordId); this.showToast("完毕成功!","success"); }); } } force-app/main/default/lwc/lexComplete/lexComplete.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>54.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexCreateNotesEmail/lexCreateNotesEmail.js
@@ -18,21 +18,6 @@ IsLoading = true; url; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
@@ -9,22 +9,6 @@ IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ console.log(this.recordId); force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
@@ -13,21 +13,6 @@ AwareDate; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
@@ -11,22 +11,6 @@ OCSMAdministrativeReportStatus; awareDate; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.css
New file @@ -0,0 +1,10 @@ .opdToSISHolder{ position: relative; display: inline-block; width: 80px; height: 80px; text-align: center; } .container .uiContainerManager{ display: none !important; } force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.html
New file @@ -0,0 +1,6 @@ <template> <div class="opdToSISHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> </template> force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
New file @@ -0,0 +1,70 @@ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import updateForOPDtoSISButton from '@salesforce/apex/ReportController.updateForOPDtoSISButton'; import init from '@salesforce/apex/ReportController.initForOPDtoSISButton'; import { updateRecord } from 'lightning/uiRecordApi'; import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class LexOPDtoSIS extends LightningElement { @api recordId; IsLoading = true; ownerId; status; userId; connectedCallback(){ console.log(this.recordId); init({ recordId: this.recordId }).then(result => { console.log(result); if (result != null) { this.IsLoading = false; this.ownerId = result.ownerId; this.status = result.status; this.userId = result.userId; this.OPDtoSIS(); this.dispatchEvent(new CloseActionScreenEvent()); } }).catch(error => { console.log("error"); console.log(error); }).finally(() => { }); } showToast(msg,type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); } OPDtoSIS () { if(this.ownerId == this.userId && this.status == "草案中") { updateForOPDtoSISButton({ recordId: this.recordId }).then(result =>{ this.updateRecordView(this.recordId); this.showToast("成功!","success"); }); } else { this.showToast("只草案中状态及OPD/SIS报告书的所有人可以提交","error"); } } } force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>54.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
@@ -12,24 +12,7 @@ ownerId; status; userId; recordTypeId = '01210000000Qekj'; errorMsg; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ console.log(this.recordId); @@ -73,8 +56,7 @@ SIStoOPD () { if(this.ownerId == this.userId && this.status == "草案中") { updateForSIStoOPDButton({ recordId: this.recordId, recordTypeId: this.recordTypeId recordId: this.recordId }).then(result=>{ if(result){ this.showToast(result,"error"); force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
@@ -10,22 +10,6 @@ @api recordId; IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); } force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
@@ -11,22 +11,6 @@ status; Isloading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback() { console.log(this.recordId); init({ force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -16,21 +16,6 @@ profileId; Isloading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ console.log(this.recordId); force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
@@ -12,22 +12,6 @@ IsLoading = true; profileId; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback(){ console.log(this.recordId); init({ force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
@@ -11,21 +11,6 @@ createdById; status; IsLoading = true; @wire(CurrentPageReference) getStateParameters(currentPageReference) { console.log(111); console.log(currentPageReference); if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; console.log("str"); console.log(str); this.recordId = str; } } } connectedCallback () { console.log(this.recordId);