force-app/main/default/classes/buttonAccountCtl.cls
@@ -7,14 +7,16 @@ public static InitData init(String recordId){ InitData res = new initData(); try{ Account report = [SELECT Name,Department_Class_ID_18__c,Department_Class__c,Hospital_ID__c,Hospital__c,Id FROM Account WHERE Id =: recordId LIMIT 1]; Account report = [SELECT Department_Class__r.Id,Hospital__r.Id,Name,Department_Class__c,Hospital__c,Id FROM Account WHERE Id =: recordId LIMIT 1]; System.debug(LoggingLevel.INFO, '*** opp: ' + report); res.Id = report.Id; res.HospitalC = report.Hospital__c; res.HospitalIdC = report.Hospital_ID__c; res.HospitalId = report.Hospital__r.Id; res.DepartmentClassC = report.Department_Class__c; res.DepartmentClassIdC = report.Department_Class_ID_18__c; res.DepartmentClassId = report.Department_Class__r.Id; res.Name = report.Name; res.userID = UserInfo.getUserId(); System.debug(LoggingLevel.INFO, '*** res: ' + res); }catch(Exception e){ @@ -23,18 +25,42 @@ return res; } // 查找UserName @AuraEnabled public static List<User> initUserName(String userId){ List<User> res = new List<User>(); try{ res = [SELECT Id,name,RepairSalesPoint_Province_China__c,Employee_No__c FROM User WHERE Id=: userId ]; }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } @AuraEnabled public static List<Account> selecctAccountByAccountId(String AccountId){ try { List<Account> accounts = [SELECT ParentId,Parent.RecordTypeId,Parent.RecordType_DeveloperName__c ,Parent.Parent.FSE_GI_Main_Leader__c, Parent.Parent.FSE_GI_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__c,Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE ID=:AccountId]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } public class InitData{ @AuraEnabled public String Id; @AuraEnabled public String HospitalC; @AuraEnabled public String HospitalIdC; public String HospitalId; @AuraEnabled public String DepartmentClassC; @AuraEnabled public String DepartmentClassIdC; public String DepartmentClassId; @AuraEnabled public String Name; @AuraEnabled public String userID; } } force-app/main/default/classes/buttonAccountCtl.cls-meta.xml
@@ -2,4 +2,4 @@ <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>56.0</apiVersion> <status>Active</status> </ApexClass> </ApexClass> force-app/main/default/classes/buttonAssetCtl.cls
New file @@ -0,0 +1,140 @@ public with sharing class buttonAssetCtl { public buttonAssetCtl() { } @AuraEnabled public static InitData init(String recordId){ InitData res = new initData(); try{ Asset report = [SELECT Id,NoPartRiskDate_F__c,Product_ID__c,AccountId,HP_Id__c,Hospital__c,Hospital__r.Id,Department_Class__c,Department_Class__r.Id,Name FROM Asset WHERE Id =: recordId LIMIT 1]; System.debug(LoggingLevel.INFO, '*** opp: ' + report); res.Id = report.Id; res.Name = report.Name; res.NoPartRiskDateFC = report.NoPartRiskDate_F__c; res.ProductIDC = report.Product_ID__c; res.AccountId = report.AccountId; res.HPIdC = report.HP_Id__c; res.HospitalC = report.Hospital__c; res.DepartmentClassC = report.Department_Class__c; res.HospitalId = report.Hospital__r.Id; res.DepartmentClassId = report.Department_Class__r.Id; res.userID = UserInfo.getUserId(); res.day = Date.today(); res.day1 = Date.today().addDays(-10); res.day2 = Date.today().addDays(+365); res.notCreateRepairFromAssetButton= System.Label.notCreateRepairFromAssetButton; res.notCreateRepairFromAssetButton02= System.Label.notCreateRepairFromAssetButton02; System.debug(LoggingLevel.INFO, '*** res: ' + res); }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } // 查找UserName @AuraEnabled public static List<User> initUserName(String userId){ List<User> res = new List<User>(); try{ res = [SELECT Id,name,RepairSalesPoint_Province_China__c,Employee_No__c FROM User WHERE Id=: userId ]; }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } //查询Account修理画面“修理品返送地”问题调查-后续 @AuraEnabled public static List<Account> selecctAccountBySegmentId(String segmentId){ try { List<Account> accounts = [SELECT id,ParentId,Parent.RecordTypeId, Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE Id=:segmentId]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } //查询Product2 @AuraEnabled public static List<Product2> selecctProduct2ById(String Id){ try { List<Product2> accounts = [SELECT id,Name,Can_Repair__c from Product2 where ID=:Id]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } //查询QIS_Report__c @AuraEnabled public static List<QIS_Report__c> selecctQISReportByFomatToday(String AssetId,Date fomatToday){ try { List<QIS_Report__c> accounts = [SELECT id,Name,QIS_Submit_day__c from QIS_Report__c where nonyushohin__c=:AssetId and QIS_Submit_day__c != null and QIS_Submit_day__c >=:fomatToday]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } //查询Repair__c @AuraEnabled public static List<Repair__c> selecctRepairByFomatToday(String AssetId, Date fomatToday){ try { List<Repair__c> accounts = [SELECT Name from Repair__c where Delivered_Product__c =:AssetId and Status2__c!='00.删除' and Status2__c!='00.取消' and FSE_ApplyForRepair_Day__c >=: fomatToday order by FSE_ApplyForRepair_Day__c desc limit 1]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } //查询Repair__c @AuraEnabled public static List<Account> selecctAccountByAccountId(String AccountId){ try { List<Account> accounts = [SELECT id,Parent.RecordTypeId, Parent.RecordType_DeveloperName__c ,Parent.Parent.FSE_GI_Main_Leader__c, Parent.Parent.FSE_GI_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__c,Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE ID=: AccountId]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } public class InitData{ @AuraEnabled public String Id; @AuraEnabled public String userID; @AuraEnabled public Date day; @AuraEnabled public Date day2; @AuraEnabled public Date day1; @AuraEnabled public String Name; @AuraEnabled public Date NoPartRiskDateFC; @AuraEnabled public String ProductIDC; @AuraEnabled public String AccountId; @AuraEnabled public String HPIdC; @AuraEnabled public String HospitalC; @AuraEnabled public String DepartmentClassC; @AuraEnabled public String HospitalId; @AuraEnabled public String DepartmentClassId; @AuraEnabled public String notCreateRepairFromAssetButton; @AuraEnabled public String notCreateRepairFromAssetButton02; } } force-app/main/default/classes/buttonAssetCtl.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/buttonCampaignCtl.cls
New file @@ -0,0 +1,28 @@ public with sharing class buttonCampaignCtl { public buttonCampaignCtl() { } @AuraEnabled public static InitData init(String recordId){ InitData res = new initData(); try{ Campaign report = [SELECT Id,Status FROM Campaign WHERE Id =: recordId LIMIT 1]; System.debug(LoggingLevel.INFO, '*** opp: ' + report); res.Id = report.Id; res.Status = report.Status; System.debug(LoggingLevel.INFO, '*** res: ' + res); }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } public class InitData{ @AuraEnabled public String Id; @AuraEnabled public String Status; } } force-app/main/default/classes/buttonCampaignCtl.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/buttonCaseCtl.cls
New file @@ -0,0 +1,26 @@ public with sharing class buttonCaseCtl { public buttonCaseCtl() { } @AuraEnabled public static InitData init(String recordId){ InitData res = new initData(); try{ Case report = [SELECT Id FROM Case WHERE Id =: recordId LIMIT 1]; System.debug(LoggingLevel.INFO, '*** opp: ' + report); res.Id = report.Id; System.debug(LoggingLevel.INFO, '*** res: ' + res); }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } public class InitData{ @AuraEnabled public String Id; } } force-app/main/default/classes/buttonCaseCtl.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/buttonMaintenanceContractAssetCtl.cls-meta.xml
@@ -2,4 +2,4 @@ <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>56.0</apiVersion> <status>Active</status> </ApexClass> </ApexClass> force-app/main/default/classes/buttonMaintenanceTaskCtl.cls-meta.xml
@@ -2,4 +2,4 @@ <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>56.0</apiVersion> <status>Active</status> </ApexClass> </ApexClass> force-app/main/default/classes/buttonOnCallCtl.cls
@@ -7,9 +7,21 @@ public static InitData init(String recordId){ InitData res = new initData(); try{ On_Call__c report = [SELECT Id FROM On_Call__c WHERE Id =: recordId LIMIT 1]; On_Call__c report = [SELECT Id,Name,Oncall_Equipment__r.Id,segment__r.Id,segment__c,HP__c,HospitalId__c,Salesdepartment_HP_ID__c,Salesdepartment_HP__c,Oncall_Equipment__c,Trable_occur_daY_collect_c__c FROM On_Call__c WHERE Id =: recordId LIMIT 1]; System.debug(LoggingLevel.INFO, '*** opp: ' + report); res.Id = report.Id; res.Name = report.Name; res.SegmentC = report.segment__c; res.SegmentId = report.segment__r.Id; res.HPC = report.HP__c; res.HospitalIdC = report.HospitalId__c; res.SalesdepartmentHPIDC = report.Salesdepartment_HP_ID__c; res.SalesdepartmentHPC = report.Salesdepartment_HP__c; res.OncallEquipmentC = report.Oncall_Equipment__c; res.OncallEquipmentId = report.Oncall_Equipment__r.Id; res.TrableOccurdaYCollectC = report.Trable_occur_daY_collect_c__c; res.userID = UserInfo.getUserId(); System.debug(LoggingLevel.INFO, '*** res: ' + res); }catch(Exception e){ @@ -18,8 +30,62 @@ return res; } @AuraEnabled public static List<Account> selecctAccountBySegmentId(String segmentId){ try { List<Account> accounts = [SELECT ParentId,Parent.RecordTypeId,Parent.RecordType_DeveloperName__c ,Parent.Parent.FSE_GI_Main_Leader__c, Parent.Parent.FSE_GI_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__c FROM Account WHERE Id=: segmentId]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } @AuraEnabled public static List<Account> selecctAccountBySegmentId02(String segmentId){ try { List<Account> accounts = [SELECT id,ParentId,Parent.RecordTypeId,Parent.RecordType_DeveloperName__c, Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE Id=: segmentId]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } // 查找UserName @AuraEnabled public static List<User> initUserName(String userId){ List<User> res = new List<User>(); try{ res = [SELECT Id,name,RepairSalesPoint_Province_China__c,Employee_No__c FROM User WHERE Id=: userId ]; }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } public class InitData{ @AuraEnabled public String Id; @AuraEnabled public String Name; @AuraEnabled public String SegmentC; @AuraEnabled public String HPC; @AuraEnabled public String HospitalIdC; @AuraEnabled public String SalesdepartmentHPIDC; @AuraEnabled public String SalesdepartmentHPC; @AuraEnabled public String OncallEquipmentC; @AuraEnabled public Date TrableOccurdaYCollectC; @AuraEnabled public String userID; @AuraEnabled public String SegmentId; @AuraEnabled public String OncallEquipmentId; } } force-app/main/default/classes/buttonQISReportCtl.cls
@@ -7,7 +7,24 @@ public static InitData init(String recordId){ InitData res = new initData(); try{ QIS_Report__c report = [SELECT is_CNBuy__c,isPAE_Profile__c,isAE_Profile__c,Name,QIS_Status__c,PAE_DetermineAC__c,AE_DetermineResult__c,ETQ_UPLOAD_STATUS__c,QIS_final_judgement__c,OCM_judgement__c,PAE_Determine__c,Id FROM QIS_Report__c WHERE Id =: recordId LIMIT 1]; QIS_Report__c report = [SELECT Source_OnCall__r.Id,nonyushohin__r.Id,Hospital_Department__r.Id,Hospital__r.Id,source_for_repair__c,Trable_occur_daY_collect__c,nonyushohin__c,Hospital_Department__c,Department_Class__c,Department_Class__r.Id,Source_OnCall__c,HP_ID__c,Special_follow__c,next_action__c,Hospital__c,is_CNBuy__c,isPAE_Profile__c,isAE_Profile__c,Name,QIS_Status__c,PAE_DetermineAC__c,AE_DetermineResult__c,ETQ_UPLOAD_STATUS__c,QIS_final_judgement__c,OCM_judgement__c,PAE_Determine__c,Id FROM QIS_Report__c WHERE Id =: recordId LIMIT 1]; res.Hospital = report.Hospital__c; res.HospitalId = report.Hospital__r.Id; res.nextAction = report.next_action__c; res.SpecialFollow = report.Special_follow__c; res.HPID = report.HP_ID__c; res.SourceOnCallId = report.Source_OnCall__r.Id; res.SourceOnCall = report.Source_OnCall__c; res.DepartmentClassId = report.Department_Class__r.Id; res.DepartmentClass = report.Department_Class__c; res.HospitalDepartment = report.Hospital_Department__c; res.HospitalDepartmentId = report.Hospital_Department__r.Id; res.nonyushohin = report.nonyushohin__c; res.nonyushohinId = report.nonyushohin__r.Id; res.TrableOccurDaYCollect = report.Trable_occur_daY_collect__c; res.sourceForRepair = report.source_for_repair__c; res.PAEDetermineC = report.PAE_Determine__c; res.PAEDetermineACC = report.PAE_DetermineAC__c; res.OCMJudgementC = report.OCM_judgement__c; @@ -183,8 +200,61 @@ return res; } @AuraEnabled public static List<Account> selecctAccountByAccountId(String HospitalDepartmentId){ try { List<Account> accounts = [SELECT ParentId,Parent.RecordTypeId, Parent.RecordType_DeveloperName__c ,Parent.Parent.FSE_GI_Main_Leader__c, Parent.Parent.FSE_GI_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__r.Name,Parent.Parent.FSE_SP_Main_Leader__c,Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c,Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c FROM Account WHERE ID=: HospitalDepartmentId]; return accounts; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } // 查找UserName @AuraEnabled public static List<User> initUserName(String userId){ List<User> res = new List<User>(); try{ res = [SELECT Id,name,RepairSalesPoint_Province_China__c FROM User WHERE Id=: userId ]; }catch(Exception e){ System.debug(LoggingLevel.INFO, '*** e: ' + e); } return res; } public class InitData{ @AuraEnabled public String SourceOnCallId; @AuraEnabled public String nonyushohinId; @AuraEnabled public String Hospital; @AuraEnabled public String HospitalId; @AuraEnabled public String nextAction; @AuraEnabled public Boolean SpecialFollow; @AuraEnabled public String HPID; @AuraEnabled public String SourceOnCall; @AuraEnabled public String DepartmentClassId; @AuraEnabled public String DepartmentClass; @AuraEnabled public String HospitalDepartment; @AuraEnabled public String nonyushohin; @AuraEnabled public Date TrableOccurDaYCollect; @AuraEnabled public String sourceForRepair; @AuraEnabled public String HospitalDepartmentId; @AuraEnabled public String isAEProfileC; @AuraEnabled public String isCNBuyC; force-app/main/default/lwc/lexApplyForRepair/lexApplyForRepair.js
@@ -47,9 +47,7 @@ } }).catch(error => { console.log(error); }).finally(() => { }); }) } //申请修理 @@ -57,6 +55,7 @@ var status = this.StatusC; if (status != '待处理') { this.ShowToastEvent("报修子单的状态不是 待处理 无法申请修理", "error") // alert('报修子单的状态不是 待处理 无法申请修理'); return; } var url = '/apex/ChoiceAsset?Id=' + this.Id + '&Type=Repair'; force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
@@ -45,9 +45,7 @@ } }).catch(error => { console.log(error); }).finally(() => { }); }) } // 复制 force-app/main/default/lwc/lexCopyRepair/lexCopyRepair.js
@@ -161,9 +161,7 @@ } }).catch(error => { console.log(error); }).finally(() => { }); }) } // 复制 force-app/main/default/lwc/lexCreateAssessmentReport/lexCreateAssessmentReport.html
@@ -1,6 +1,5 @@ <template> <div class="exampleHolder" 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/lexCreateAssessmentReport/lexCreateAssessmentReport.js
@@ -10,9 +10,6 @@ CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonCampaignCtl.init'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class LexCreateAssessmentReport extends LightningElement { @api recordId; @@ -56,16 +53,7 @@ if (status == '公开中') { window.open("/apex/AssessmentReport?camid=" + this.Id, "_top"); } else { this.ShowToastEvent("只有批准后才能创建报告!", "error") alert("只有批准后才能创建报告!"); } } ShowToastEvent(msg, type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } } force-app/main/default/lwc/lexCreateAssessmentReport/lexCreateAssessmentReport.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateInstructReport/lexCreateInstructReport.html
@@ -1,6 +1,5 @@ <template> <div class="exampleHolder" 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/lexCreateInstructReport/lexCreateInstructReport.js
@@ -10,7 +10,6 @@ CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonCampaignCtl.init'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class LexCreateInstructReport extends LightningElement { @api recordId; @@ -52,18 +51,9 @@ CreateInstructReport() { var status = this.Status; if (status == '公开中') { window.open("/apex/InstructReport?camid="+this.Id, "_top"); window.open("/apex/InstructReport?camid=" + this.Id, "_top"); } else { this.ShowToastEvent("只有批准后才能创建报告!", "error") alert("只有批准后才能创建报告!") } } ShowToastEvent(msg, type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } } force-app/main/default/lwc/lexCreateInstructReport/lexCreateInstructReport.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateNewServiceContract/lexCreateNewServiceContract.js
@@ -41,10 +41,10 @@ if (result != null) { this.IsLoading = false; this.Id = result.Id; this.HospitalC = result.HospitalC; this.HospitalIdC = result.HospitalIdC; this.DepartmentClassC = result.DepartmentClassC; this.DepartmentClassIdC = result.DepartmentClassIdC; this.HospitalC = result.HospitalC == undefined ? "" : result.HospitalC;; this.HospitalIdC = result.HospitalIdC == undefined ? "" : result.HospitalIdC;; this.DepartmentClassC = result.DepartmentClassC == undefined ? "" : result.DepartmentClassC;; this.DepartmentClassIdC = result.DepartmentClassIdC == undefined ? "" : result.DepartmentClassIdC;; this.Name = result.Name; this.CreateNewServiceContract(); @@ -72,6 +72,6 @@ console.log(url); // window.top.location.href = url; window.top.location.href = url; } } force-app/main/default/lwc/lexCreateNewServiceContract/lexCreateNewServiceContract.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.css
New file @@ -0,0 +1,10 @@ .createEmailHolder{ position: relative; display: inline-block; width: 80px; height: 80px; text-align: center; } .container .uiContainerManager{ display: none !important; } force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.html
New file @@ -0,0 +1,5 @@ <template> <div class="createEmailHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.js
New file @@ -0,0 +1,60 @@ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { NavigationMixin } from 'lightning/navigation'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import init from '@salesforce/apex/QISReportController.initForlexCreateQISFromAssetButton'; import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; import { updateRecord } from 'lightning/uiRecordApi'; export default class lexCreateQISFromAsset extends LightningElement { @api recordId; IsLoading = true; Old_Repair_Name; @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({recordId:this.recordId}).then(result=>{ console.log(result); if(result!=null){ if (result.id!=null) { var boolday=confirm('请确认此件是否属于10天内重复报告,如果是,请使用原QIS里的复制功能重新提交。'); if(!boolday){ return; } } if (result.repId!=null) { var boolday=confirm('请确认此件是否属于10天内重复报告,如果是,需按照原先的维修信息填写。'); if(!boolday){ return; } } } }).catch(err=>{ console.log("error:"); console.log(err); }).finally(()=>{ }); } } force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.js-meta.xml
New file @@ -0,0 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCreateQISFromAsset"> <apiVersion>51.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__AppPage</target> <target>lightning__RecordPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <!-- 屏幕流配置 --> <target>lightning__FlowScreen</target> </targets> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <!-- name js中使用的变量,从屏幕流中获取参数 label 在屏幕流的该LWC的设置中显示 --> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateRepairFromAsset/lexCreateRepairFromAsset.html
New file @@ -0,0 +1,5 @@ <template> <div class="exampleHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexCreateRepairFromAsset/lexCreateRepairFromAsset.js
New file @@ -0,0 +1,251 @@ import { LightningElement, wire, api } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonAssetCtl.init'; import initUserName from '@salesforce/apex/buttonAssetCtl.initUserName'; import selecctAccountByAccountId from '@salesforce/apex/buttonAssetCtl.selecctAccountByAccountId'; import selecctProduct2ById from '@salesforce/apex/buttonAssetCtl.selecctProduct2ById'; import selecctRepairByFomatToday from '@salesforce/apex/buttonAssetCtl.selecctRepairByFomatToday'; import selecctQISReportByFomatToday from '@salesforce/apex/buttonAssetCtl.selecctQISReportByFomatToday'; export default class LexCreateRepairFromAsset extends LightningElement { @api recordId; str; IsLoading = true; Id; userID; EmployeeNoC; day; day1; day2; Name; NoPartRiskDateFC; ProductIDC; AccountId; HPIdC; HospitalC; DepartmentClassC; HospitalId; DepartmentClassId; RepairSalesPointProvinceChinaC; notCreateRepairFromAssetButton; notCreateRepairFromAssetButton02; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result => { console.log(result); if (result != null) { this.IsLoading = false; this.Id = result.Id; this.userID = result.userID; this.day = result.day; this.day1 = result.day1; this.day2 = result.day2; this.Name = result.Name; this.NoPartRiskDateFC = result.NoPartRiskDateFC == undefined ? "" : result.NoPartRiskDateFC; this.ProductIDC = result.ProductIDC == undefined ? "" : result.ProductIDC; this.AccountId = result.AccountId == undefined ? "" : result.AccountId; this.HPIdC = result.HPIdC == undefined ? "" : result.HPIdC; this.HospitalC = result.HospitalC == undefined ? "" : result.HospitalC; this.DepartmentClassC = result.DepartmentClassC == undefined ? "" : result.DepartmentClassC; this.HospitalId = result.HospitalId == undefined ? "" : result.HospitalId; this.DepartmentClassId = result.DepartmentClassId == undefined ? "" : result.DepartmentClassId; this.notCreateRepairFromAssetButton = result.notCreateRepairFromAssetButton; this.notCreateRepairFromAssetButton02 = result.notCreateRepairFromAssetButton02; initUserName({ userId: this.userID }).then(result => { console.log(result); if (result != null) { this.EmployeeNoC = result[0].Employee_No__c; this.RepairSalesPointProvinceChinaC = result[0].RepairSalesPoint_Province_China__c; } this.CreateRepairFromAsset(); }) this.dispatchEvent(new CloseActionScreenEvent()); } }).catch(error => { console.log(error); }) } // 新建修理 CreateRepairFromAsset() { var nCRepairFromAssetBSting = this.notCreateRepairFromAssetButton; var nCRepairFromAssetB02Sting = this.notCreateRepairFromAssetButton02; nCRepairFromAssetBSting = nCRepairFromAssetBSting + nCRepairFromAssetB02Sting; var nCRepairFromAssetBList = nCRepairFromAssetBSting.split(','); var EmployeeNo = this.EmployeeNoC; if (nCRepairFromAssetBList.indexOf(EmployeeNo) != -1) { alert("对不起,您无权使用此按钮创建修理!"); return; } var fomatToday = this.day1; var QIS_Name = ''; var QIS_Id = ''; var url1 = ""; var FSE_GI_Main_Leader__id = ''; var FSE_GI_Main_Leader__name = ''; var FSE_SP_Main_Leader__id = ''; var FSE_SP_Main_Leader__name = ''; var Incharge_Staff = ''; var Incharge_Staff_id = ''; var Work_Location = ''; var Old_Repair_Name = ''; selecctQISReportByFomatToday({ AssetId: this.Id, fomatToday: fomatToday }).then(records => { console.log(records); if (records.length >= 1) { var boolday = confirm('请确认此件是否属于10天内重复报告,如果是,请使用原QIS信息填写。'); if (!boolday) { return; } } if (records.length >= 1) { QIS_Name = records[0].Name; QIS_Id = records[0].Id; } }) selecctRepairByFomatToday({ AssetId: this.Id, fomatToday: fomatToday }).then(records2 => { console.log(records2); if (records2.length >= 1) { var boolday = confirm('此件设备如为10天内重复报告,建议回到原修理单使用复制功能提交。请确认是否继续新建修理? '); if (!boolday) { return; } } if (records2.length >= 1) { Old_Repair_Name = records2[0].Name; } }) var partSupplyFinishDate = this.NoPartRiskDateFC; if (this.day < this.NoPartRiskDateFC && this.NoPartRiskDateFC <= this.day2) { alert('预计' + partSupplyFinishDate + '零件即将停产,请送修前与工厂及RC联络'); } if (this.NoPartRiskDateFC != null && this.NoPartRiskDateFC != undefined && this.NoPartRiskDateFC <= this.day) { alert('该型号零件已经停产,有特殊需求,请送修前与工厂RC联络'); } selecctProduct2ById({ Id: this.ProductIDC }).then(recordP => { console.log(recordP); if (recordP != null && recordP.length > 0) { var canRepair = recordP[0].Can_Repair__c; if (canRepair == '第三方') { alert('非我司修理对象,无法新建修理,如有不明请咨询CIC'); return; } if (canRepair == '不' || canRepair == null) { alert('本设备无法新建修理'); return; } if (canRepair == 'RC送修') { url1 = "&00N10000009HAJl=TRUE" } } }) selecctAccountByAccountId({ AccountId: this.AccountId }).then(List => { console.log(List); if (List != null) { var RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); console.log(RecordTypeId); if (RecordTypeId != 'Agency') { if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; } if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; } if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Work_Location__c']; } } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Work_Location__c']; } } } if (RecordTypeId == 'Department_Class_GI') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_BF') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ET') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GS') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_URO') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ENT') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GYN') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_OTH') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } } } var url = "/a0J/e?CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClassC + "&CF00N10000002Dx5n_lkid=" + this.Id + "&CF00N10000002Dx5n=" + this.Name + "&CF00N10000002Dx1X_lkid=" + this.Id + "&CF00N10000002Dx1X=" + this.Name + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002FH86=%e5%8f%aa%e4%bf%ae%e7%90%86&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&CF00N10000009H7yM=" + QIS_Name + "&CF00N10000009H7yM_lkid=" + QIS_Id + "&00N10000009H2fa=" + Old_Repair_Name + "&retURL=%2F" + this.Id; if (url1 != undefined) { url = url + url1; } window.open(url); }) } } force-app/main/default/lwc/lexCreateRepairFromAsset/lexCreateRepairFromAsset.js-meta.xml
New file @@ -0,0 +1,18 @@ <?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> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateRepairFromDepartment/lexCreateRepairFromDepartment.html
New file @@ -0,0 +1,5 @@ <template> <div class="exampleHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexCreateRepairFromDepartment/lexCreateRepairFromDepartment.js
New file @@ -0,0 +1,149 @@ import { LightningElement, wire, api } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonAccountCtl.init'; import initUserName from '@salesforce/apex/buttonAccountCtl.initUserName'; import selecctAccountByAccountId from '@salesforce/apex/buttonAccountCtl.selecctAccountByAccountId'; export default class LexCreateRepairFromDepartment extends LightningElement { @api recordId; str; IsLoading = true; Id; RepairSalesPointProvinceChinaC; HospitalC; HospitalId; DepartmentClassC; DepartmentClassId; Name; userID; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result => { console.log(result); if (result != null) { this.IsLoading = false; this.Id = result.Id; this.HospitalC = result.HospitalC == undefined ? "" : result.HospitalC;; this.HospitalId = result.HospitalId == undefined ? "" : result.HospitalId;; this.DepartmentClassC = result.DepartmentClassC == undefined ? "" : result.DepartmentClassC;; this.DepartmentClassId = result.DepartmentClassId == undefined ? "" : result.DepartmentClassId;; this.Name = result.Name; this.userID = result.userID; initUserName({ userId: this.userID }).then(result => { console.log(result); if (result != null) { this.RepairSalesPointProvinceChinaC = result[0].RepairSalesPoint_Province_China__c; } this.CreateRepairFromDepartment(); }) this.dispatchEvent(new CloseActionScreenEvent()); } }).catch(error => { console.log(error); }) } //新建修理 CreateRepairFromDepartment() { var RecordTypeId; var Incharge_Staff = ''; var Incharge_Staff_id = ''; var Work_Location = ''; var FSE_GI_Main_Leader__id = ''; var FSE_GI_Main_Leader__name = ''; var FSE_SP_Main_Leader__id = ''; var FSE_SP_Main_Leader__name = ''; selecctAccountByAccountId({ AccountId: this.Id }).then(List => { console.log(List); if (List[0]['ParentId'] != null) { RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); console.log(RecordTypeId); if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; } if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; } if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); console.log(recordId); if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Work_Location__c']; } } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Work_Location__c']; } } } if (RecordTypeId == 'Department_Class_GI') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_BF') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ET') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GS') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_URO') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ENT') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GYN') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_OTH') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } } var url = "/a0J/e?CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClassC + "&CF00N10000002Dx5n_lkid=" + this.Id + "&CF00N10000002Dx5n=" + this.Name + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002FH86=%e5%8f%aa%e4%bf%ae%e7%90%86&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&retURL=%2F" + this.Id; window.open(url); }) } } force-app/main/default/lwc/lexCreateRepairFromDepartment/lexCreateRepairFromDepartment.js-meta.xml
New file @@ -0,0 +1,18 @@ <?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> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateRepairFromOnCall/lexCreateRepairFromOnCall.html
New file @@ -0,0 +1,5 @@ <template> <div class="exampleHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexCreateRepairFromOnCall/lexCreateRepairFromOnCall.js
New file @@ -0,0 +1,170 @@ import { LightningElement, wire, api } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonOnCallCtl.init'; import selecctAccountBySegmentId from '@salesforce/apex/buttonOnCallCtl.selecctAccountBySegmentId'; import selecctAccountBySegmentId02 from '@salesforce/apex/buttonOnCallCtl.selecctAccountBySegmentId02'; import initUserName from '@salesforce/apex/buttonOnCallCtl.initUserName'; export default class LexCreateRepairFromOnCall extends LightningElement { @api recordId; str; IsLoading = true; Id; RepairSalesPointProvinceChinaC; Name; SegmentC; HPC; HospitalIdC; SalesdepartmentHPIDC; SalesdepartmentHPC; OncallEquipmentC; TrableOccurdaYCollectC; userID; SegmentId; OncallEquipmentId; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result => { console.log(result); if (result != null) { this.IsLoading = false; this.Id = result.Id; this.Name = result.Name; this.SegmentC = result.SegmentC == undefined ? "" : result.SegmentC; this.HPC = result.HPC == undefined ? "" : result.HPC; this.HospitalIdC = result.HospitalIdC == undefined ? "" : result.HospitalIdC; this.SalesdepartmentHPIDC = result.SalesdepartmentHPIDC == undefined ? "" : result.SalesdepartmentHPIDC; this.SalesdepartmentHPC = result.SalesdepartmentHPC == undefined ? "" : result.SalesdepartmentHPC; this.OncallEquipmentC = result.OncallEquipmentC == undefined ? "" : result.OncallEquipmentC; this.TrableOccurdaYCollectC = result.TrableOccurdaYCollectC == undefined ? "" : result.TrableOccurdaYCollectC; this.userID = result.userID; this.SegmentId = result.SegmentId == undefined ? "" : result.SegmentId; this.OncallEquipmentId = result.OncallEquipmentId == undefined ? "" : result.OncallEquipmentId; initUserName({ userId: this.userID }).then(result => { console.log(result); if (result != null) { this.RepairSalesPointProvinceChinaC = result[0].RepairSalesPoint_Province_China__c; } this.CreateRepairFromOnCall(); }) this.dispatchEvent(new CloseActionScreenEvent()); } }).catch(error => { console.log(error); }) } //新建修理 CreateRepairFromOnCall() { var Work_Location = ''; var Incharge_Staff = ''; var Incharge_Staff_id = ''; var FSE_GI_Main_Leader__id = ''; var FSE_GI_Main_Leader__name = ''; var FSE_SP_Main_Leader__id = ''; var FSE_SP_Main_Leader__name = ''; var RecordTypeId; selecctAccountBySegmentId({ segmentId: this.SegmentId }).then(List => { console.log(List); if (List[0]['ParentId']) { RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); console.log(RecordTypeId); } selecctAccountBySegmentId02({ segmentId: this.SegmentId }).then(account => { console.log(account); if (account[0].ParentId != null) { if (account[0].Parent.RecordTypeId != null || account[0].Parent.RecordTypeId != undefined) { var recordId = account[0].Parent.RecordType_DeveloperName__c.substring(0, 15); console.log(recordId); if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { if (account[0].Parent.Parent.FSE_GI_Main_Leader__c != null) { Work_Location = account[0].Parent.Parent.FSE_GI_Main_Leader__r.Work_Location__c; } } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { if (account[0].Parent.Parent.FSE_SP_Main_Leader__c != null) { Work_Location = account[0].Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c; } } } if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; } if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; } if (RecordTypeId == 'Department_Class_GI') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_BF') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ET') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GS') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_URO') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ENT') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GYN') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_OTH') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } } var url = "/a0J/e?CF00N10000002FIJU_lkid=" + this.Id + "&CF00N10000002FIJU=" + this.Name + "&CF00N10000002Dx66_lkid=" + this.HospitalIdC + "&CF00N10000002Dx66=" + this.HPC + "&CF00N10000002Dx5t_lkid=" + this.SalesdepartmentHPIDC + "&CF00N10000002Dx5t=" + this.SalesdepartmentHPC + "&CF00N10000002Dx5n_lkid=" + this.SegmentId + "&CF00N10000002Dx5n=" + this.SegmentC + "&CF00N10000002Dx1X_lkid=" + this.OncallEquipmentId + "&CF00N10000002Dx1X=" + this.OncallEquipmentC + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002Dx5y=" + this.TrableOccurdaYCollectC + "&00N10000002FH86=%e4%bb%8eOn-Call&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&retURL=%2F" + this.Id; window.open(url); }) }) } } force-app/main/default/lwc/lexCreateRepairFromOnCall/lexCreateRepairFromOnCall.js-meta.xml
New file @@ -0,0 +1,18 @@ <?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> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateRepairFromQIS/lexCreateRepairFromQIS.html
New file @@ -0,0 +1,5 @@ <template> <div class="exampleHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexCreateRepairFromQIS/lexCreateRepairFromQIS.js
New file @@ -0,0 +1,182 @@ import { LightningElement, wire, api } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonQISReportCtl.init'; import initUserName from '@salesforce/apex/buttonQISReportCtl.initUserName'; import selecctAccountByAccountId from '@salesforce/apex/buttonQISReportCtl.selecctAccountByAccountId'; export default class LexCreateRepairFromQIS extends LightningElement { @api recordId; str; IsLoading = true; Id; Name; RepairSalesPointProvinceChinaC; Hospital; HospitalId; nextAction; SpecialFollow; HPID; SourceOnCall; DepartmentClassId; DepartmentClass; HospitalDepartment; nonyushohin; TrableOccurDaYCollect; sourceForRepair; OCMJudgementC HospitalDepartmentId; userId; SourceOnCallId; nonyushohinId; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result => { console.log(result); if (result != null) { this.IsLoading = false; this.Id = result.Id; this.Name = result.Name; this.SourceOnCallId = result.SourceOnCallId == undefined ? "" : result.SourceOnCallId; this.nonyushohinId = result.nonyushohinId == undefined ? "" : result.nonyushohinId; this.Hospital = result.Hospital == undefined ? "" : result.Hospital; this.HospitalId = result.HospitalId == undefined ? "" : result.HospitalId; this.nextAction = result.nextAction == undefined ? "" : result.nextAction; this.SpecialFollow = result.SpecialFollow == undefined ? "" : result.SpecialFollow; this.HPID = result.HPID == undefined ? "" : result.HPID; this.SourceOnCall = result.SourceOnCall == undefined ? "" : result.SourceOnCall; this.DepartmentClassId = result.DepartmentClassId == undefined ? "" : result.DepartmentClassId; this.DepartmentClass = result.DepartmentClass == undefined ? "" : result.DepartmentClass; this.HospitalDepartment = result.HospitalDepartment == undefined ? "" : result.HospitalDepartment; this.nonyushohin = result.nonyushohin == undefined ? "" : result.nonyushohin; this.TrableOccurDaYCollect = result.TrableOccurDaYCollect == undefined ? "" : result.TrableOccurDaYCollect; this.sourceForRepair = result.sourceForRepair == undefined ? "" : result.sourceForRepair; this.OCMJudgementC = result.OCMJudgementC == undefined ? "" : result.OCMJudgementC; this.HospitalDepartmentId = result.HospitalDepartmentId == undefined ? "" : result.HospitalDepartmentId; this.userId = result.userId; initUserName({ userId: this.userId }).then(result => { console.log(result); if (result != null) { this.RepairSalesPointProvinceChinaC = result[0].RepairSalesPoint_Province_China__c; } this.CreateRepairFromQIS(); }) this.dispatchEvent(new CloseActionScreenEvent()); } }).catch(error => { console.log(error); }) } //新建修理QIS CreateRepairFromQIS() { console.log("开始"); var newflag = false; if ((this.OCMJudgementC == '质量问题' && this.nextAction == '无偿维修' && this.SpecialFollow == '0') || (this.OCMJudgementC == '非质量问题' && this.nextAction == '无偿维修' && this.SpecialFollow == '1') || (this.OCMJudgementC == '非质量问题' && this.nextAction == '有偿维修' && this.SpecialFollow == '0') || (this.OCMJudgementC == '质量问题+非质量问题' && this.nextAction == '无偿维修' && this.SpecialFollow == '1') || (this.OCMJudgementC == '质量问题+非质量问题' && this.nextAction == '有偿维修+无偿维修' && this.SpecialFollow == '0')) { newflag = true; } console.log(newflag); if (newflag) { selecctAccountByAccountId({ HospitalDepartmentId: this.HospitalDepartmentId }).then(List => { console.log(List); var RecordTypeId; var Incharge_Staff = ''; var Incharge_Staff_id = ''; var Work_Location = ''; if (List[0]['ParentId'] != null) { RecordTypeId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); console.log(RecordTypeId); var FSE_GI_Main_Leader__id = ''; var FSE_GI_Main_Leader__name = ''; var FSE_SP_Main_Leader__id = ''; var FSE_SP_Main_Leader__name = ''; if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { FSE_GI_Main_Leader__id = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'].substring(0, 15); FSE_GI_Main_Leader__name = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Name']; } if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { FSE_SP_Main_Leader__id = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'].substring(0, 15); FSE_SP_Main_Leader__name = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Name']; } if (List[0]['Parent']['RecordType_DeveloperName__c'] != null || List[0]['Parent']['RecordType_DeveloperName__c'] != undefined) { var recordId = List[0]['Parent']['RecordType_DeveloperName__c'].substring(0, 15); if (recordId == 'Department_Class_GI' || recordId == 'Department_Class_BF' || recordId == 'Department_Class_ET') { if (List[0]['Parent']['Parent']['FSE_GI_Main_Leader__c'] != null) { Work_Location = List[0]['Parent']['Parent']['FSE_GI_Main_Leader__r']['Work_Location__c']; } } else if (recordId == 'Department_Class_GS' || recordId == 'Department_Class_URO' || recordId == 'Department_Class_ENT' || recordId == 'Department_Class_GYN' || recordId == 'Department_Class_OTH') { if (List[0]['Parent']['Parent']['FSE_SP_Main_Leader__c'] != null) { Work_Location = List[0]['Parent']['Parent']['FSE_SP_Main_Leader__r']['Work_Location__c']; } } } if (RecordTypeId == 'Department_Class_GI') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_BF') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ET') { Incharge_Staff = FSE_GI_Main_Leader__name; Incharge_Staff_id = FSE_GI_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GS') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_URO') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_ENT') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_GYN') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } if (RecordTypeId == 'Department_Class_OTH') { Incharge_Staff = FSE_SP_Main_Leader__name; Incharge_Staff_id = FSE_SP_Main_Leader__id; } } window.open("/a0J/e?CF00N10000002FIJU_lkid=" + this.SourceOnCallId + "&CF00N10000002FIJU=" + this.SourceOnCall + "&CF00N10000002FIJZ_lkid=" + this.Id + "&CF00N10000002FIJZ=" + this.Name + "&CF00N10000002Dx66_lkid=" + this.HospitalId + "&CF00N10000002Dx66=" + this.Hospital + "&CF00N10000002Dx5t_lkid=" + this.DepartmentClassId + "&CF00N10000002Dx5t=" + this.DepartmentClass + "&CF00N10000002Dx5n_lkid=" + this.HospitalDepartmentId + "&CF00N10000002Dx5n=" + this.HospitalDepartment + "&CF00N10000002Dx1X_lkid=" + this.nonyushohinId + "&CF00N10000002Dx1X=" + this.nonyushohin + "&CF00N10000002EMHw_lkid=" + Incharge_Staff_id + "&CF00N10000002EMHw=" + Incharge_Staff + "&00N10000002Dx5y=" + this.TrableOccurDaYCollect + "&00N10000006P6SM=" + encodeURI(Work_Location) + "&00N10000002FH86=" + this.sourceForRepair + "&00N10000006P6Rn=" + this.RepairSalesPointProvinceChinaC + "&retURL=%2F" + this.Id); }) } else { alert("不能新建修理"); } } } force-app/main/default/lwc/lexCreateRepairFromQIS/lexCreateRepairFromQIS.js-meta.xml
New file @@ -0,0 +1,18 @@ <?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> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexCreateReportMaintenanceContract/lexCreateReportMaintenanceContract.js
@@ -47,9 +47,7 @@ } }).catch(error => { console.log(error); }).finally(() => { }); }) } // 制作报告书 force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
New file @@ -0,0 +1,6 @@ <template> <div class="exampleHolder" 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/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js
@@ -74,8 +74,8 @@ if (result.length > 0) { var split = result.split(", "); alert(split[1]); } window.location.reload(); } window.location.reload(); }) } else { this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error") force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js
@@ -42,9 +42,7 @@ } }).catch(error => { console.log(error); }).finally(() => { }); }) } // 打印维修委托书 force-app/main/default/lwc/lexPrintInspectupReportInspectupPlan/lexPrintInspectupReportInspectupPlan.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js
@@ -48,9 +48,7 @@ } }).catch(error => { console.log(error); }).finally(() => { }); }) } // 修理报价预估 force-app/main/default/lwc/lexQISMBCrequestNew/lexQISMBCrequestNew.html
@@ -1,6 +1,5 @@ <template> <div class="exampleHolder" 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/lexQISMBCrequestNew/lexQISMBCrequestNew.js
@@ -10,9 +10,6 @@ CloseActionScreenEvent } from 'lightning/actions'; import init from '@salesforce/apex/buttonQISReportCtl.init'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; export default class LexQISMBCrequestNew extends LightningElement { @api recordId; @@ -57,19 +54,10 @@ var status = this.QISStatusC; if (status != '完毕' && status != '已回答' && status != '取消') { this.ShowToastEvent("QIS没有审批完毕或取消,不可以创建QIS M-BC!", "error"); alert("QIS没有审批完毕或取消,不可以创建QIS M-BC!"); return; } var url = "a20/e?retURL=%2Fa20%2Fo&Name=" + this.Name + "&CF00N10000006Q4NP_lkid=" + this.Id; window.top.location.href = url; } ShowToastEvent(msg, type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } } force-app/main/default/lwc/lexQISMBCrequestNew/lexQISMBCrequestNew.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexSLADetails/lexSLADetails.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexSelectProduct2CIC/lexSelectProduct2CIC.js
@@ -37,7 +37,7 @@ this.IsLoading = false; this.Id = result.Id; this.QuarterlyReport(); this.SelectProduct2CIC(); this.dispatchEvent(new CloseActionScreenEvent()); } }).catch(error => { @@ -47,7 +47,8 @@ // 新建CIC/产品 SelectProduct2CIC() { var pathnames = window.self.location.pathname.split('/'); console.log(11111111); var pathnames = window.location.pathname.split("/"); if (pathnames[1] == "emptyHtmlDoc.html") { window.open("/apex/SelectProduct2CIC?cicid=" + this.Id, "_parent"); } else { force-app/main/default/lwc/lexSelectProduct2CIC/lexSelectProduct2CIC.js-meta.xml
@@ -7,5 +7,12 @@ <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> <target>lightning__FlowScreen</target> </targets> <!-- 定义变量 --> <targetConfigs> <targetConfig targets="lightning__FlowScreen"> <property name="recordId" type="String" label="recordId"/> </targetConfig> </targetConfigs> </LightningComponentBundle> force-app/main/default/lwc/lexSendNFM103/lexSendNFM103.js
@@ -167,198 +167,198 @@ } foo() { queryForrecords3({ dealer: this.dealer }).then(result => { if (result.length > 0 && result[0].FirstParagraph__c == true) { if (!confirm("该经销商为先款对象,是否继续申请修理?")) { return; } } if ( this.numberofEffectiveContract == "无" && this.newProductGuaranteTxt != "2: 多年保修" && this.newProductGuaranteTxt != "2: 服务多年保修" && this.newProductGuaranteTxt != "8: 市场多年保修" && this.onSiteRepair == "直送SORC修理" ) { if (!confirm("设备为非维修合同且非多年保修对象品,请确认是否直送SORC修理?")) { return; } } if ((this.maintenanceContract != undefined || this.VMMaintenanceContract != undefined) && this.onSiteRepair == "RC修理" && this.FSEState == "山东省" ) { if (!confirm("该设备为维修合同或多年保修对象品,请确认是否送至RC修理?")) { return; } } var today = Date.now(); var dateReceiptQuestions = Date.parse(this.dateReceiptQuestions); var dates = (today - dateReceiptQuestions) / (24 * 60 * 60 * 1000); if (this.profileName != "系统管理员" && this.userName != "胡 玉成" && this.userName != "李 琪清" && this.userName != "郭 洋" && this.delayReportReason == undefined && dates > "1" && this.repairSource != "QIS转修理") { alert("申请修理时SAP修理申请日超过问题联络收到日1天,必须填写问超时报告的理由"); return; } if (this.quickRepairSign == true && (this.numberofEffectiveContract == "有" || this.newProductGuaranteTxt == "2: 多年保修" || this.newProductGuaranteTxt == "2: 服务多年保修" || this.newProductGuaranteTxt == "8: 市场多年保修") && (this.onSiteRepair == "RC修理" || this.onSiteRepair == "办事处修理" || this.onSiteRepair == "现场修理")) { if (this.RCCD == "2.东北" || this.RCCD == "3.西北") { if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送SORC修理,请确认是否继续。")) { return; } } else if (this.RCCD == "1.华北" || this.RCCD == "6.华南" || this.RCCD == "4.西南") { if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送OGZ修理,请确认是否继续。")) { return; } } } var returnsProductWay = this.returnsProductway; if (returnsProductWay == undefined) { if (!confirm("返品方式为空,是否继续申请修理!")) { return; } } var DetailedAddress = this.detailedAddress; if (this.assetOwner != "Olympus") { if (DetailedAddress != undefined) { var prompt = '当前直返收货地址为:' + DetailedAddress + ',您确认不修改了吗?'; if (!confirm(prompt)) { return; } } else { alert('当前修理没有录入直返收货的详细地址,不能申请修理!'); return; } } queryForEquipments({ deliveredProductId: this.deliveredProductId, }).then(equipments => { if (equipments != null && equipments.length > 0) { var equipment = equipments[0]; if (equipment.Status == "廃棄") { alert("设备废弃,不能提交申请!"); return; } } }); if (this.FSEApplyForRepairTime != undefined) { alert("已修理申请,不再修理申请了"); return; } var surplusCount = 0; if (this.URFReapir == false) { queryForUrfAsset({ maintenanceContractId: this.maintenanceContractId, deliveredProductId: this.deliveredProductId, }).then(urfAsset => { var seriesMaxRepairCount = 0; var seriesRepairCount = 0; if (urfAsset != null && urfAsset.length > 0) { seriesMaxRepairCount = urfAsset[0].Series_MaxRepairCount_F__c; seriesRepairCount = urfAsset[0].Series_RepairCount_F__c; surplusCount = seriesMaxRepairCount - seriesRepairCount; } }); queryForUrfSeriesInfo({ URFLimitSerial: this.URFLimitSerial, }).then(urfSeriesInfo => { var urfSeries = ""; if (urfSeriesInfo != null && urfSeriesInfo.length > 0) { urfSeries = urfSeriesInfo[0].URFLimitSerial__c; } queryForRepairCount({ maintenanceContractId: this.maintenanceContractId, status1: "1.受理完毕", URFLimitSerial: urfSeries, }).then(repairCount => { if (repairCount.length > 0 && surplusCount == 1) { alert("该设备关联限次合同,目前剩余次数小于送修设备。请等待进行中修理完成后再进行申请"); return; } }); }); } if (this.status != "草案中" && this.status != "1.受理完毕(SAP待发送)" && this.status != "4.修理品返送阶段") { alert("不是草案中不能申请"); } else { if (this.dealer != undefined) { // queryForrecords3({ // dealer: this.dealer // }).then(result => { // if (result.length > 0 && result[0].FirstParagraph__c == true) { // if (!confirm("该经销商为先款对象,是否继续申请修理?")) { // return; // } // } // if ( // this.numberofEffectiveContract == "无" && this.newProductGuaranteTxt != "2: 多年保修" && // this.newProductGuaranteTxt != "2: 服务多年保修" && this.newProductGuaranteTxt != "8: 市场多年保修" && // this.onSiteRepair == "直送SORC修理" // ) { // if (!confirm("设备为非维修合同且非多年保修对象品,请确认是否直送SORC修理?")) { // return; // } // } // if ((this.maintenanceContract != undefined || this.VMMaintenanceContract != undefined) && // this.onSiteRepair == "RC修理" && this.FSEState == "山东省" // ) { // if (!confirm("该设备为维修合同或多年保修对象品,请确认是否送至RC修理?")) { // return; // } // } // var today = Date.now(); // var dateReceiptQuestions = Date.parse(this.dateReceiptQuestions); // var dates = (today - dateReceiptQuestions) / (24 * 60 * 60 * 1000); // if (this.profileName != "系统管理员" && this.userName != "胡 玉成" && this.userName != "李 琪清" && // this.userName != "郭 洋" && // this.delayReportReason == undefined && dates > "1" && // this.repairSource != "QIS转修理") { // alert("申请修理时SAP修理申请日超过问题联络收到日1天,必须填写问超时报告的理由"); // return; // } // if (this.quickRepairSign == true && (this.numberofEffectiveContract == "有" || this.newProductGuaranteTxt == "2: 多年保修" || // this.newProductGuaranteTxt == "2: 服务多年保修" || this.newProductGuaranteTxt == "8: 市场多年保修") && // (this.onSiteRepair == "RC修理" || this.onSiteRepair == "办事处修理" || this.onSiteRepair == "现场修理")) { // if (this.RCCD == "2.东北" || this.RCCD == "3.西北") { // if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送SORC修理,请确认是否继续。")) { // return; // } // } else if (this.RCCD == "1.华北" || this.RCCD == "6.华南" || this.RCCD == "4.西南") { // if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送OGZ修理,请确认是否继续。")) { // return; // } // } // } // var returnsProductWay = this.returnsProductway; // if (returnsProductWay == undefined) { // if (!confirm("返品方式为空,是否继续申请修理!")) { // return; // } // } // var DetailedAddress = this.detailedAddress; // if (this.assetOwner != "Olympus") { // if (DetailedAddress != undefined) { // var prompt = '当前直返收货地址为:' + DetailedAddress + ',您确认不修改了吗?'; // if (!confirm(prompt)) { // return; // } // } else { // alert('当前修理没有录入直返收货的详细地址,不能申请修理!'); // return; // } // } // queryForEquipments({ // deliveredProductId: this.deliveredProductId, // }).then(equipments => { // if (equipments != null && equipments.length > 0) { // var equipment = equipments[0]; // if (equipment.Status == "廃棄") { // alert("设备废弃,不能提交申请!"); // return; // } // } // }); // if (this.FSEApplyForRepairTime != undefined) { // alert("已修理申请,不再修理申请了"); // return; // } // var surplusCount = 0; // if (this.URFReapir == false) { // queryForUrfAsset({ // maintenanceContractId: this.maintenanceContractId, // deliveredProductId: this.deliveredProductId, // }).then(urfAsset => { // var seriesMaxRepairCount = 0; // var seriesRepairCount = 0; // if (urfAsset != null && urfAsset.length > 0) { // seriesMaxRepairCount = urfAsset[0].Series_MaxRepairCount_F__c; // seriesRepairCount = urfAsset[0].Series_RepairCount_F__c; // surplusCount = seriesMaxRepairCount - seriesRepairCount; // } // }); // queryForUrfSeriesInfo({ // URFLimitSerial: this.URFLimitSerial, // }).then(urfSeriesInfo => { // var urfSeries = ""; // if (urfSeriesInfo != null && urfSeriesInfo.length > 0) { // urfSeries = urfSeriesInfo[0].URFLimitSerial__c; // } // queryForRepairCount({ // maintenanceContractId: this.maintenanceContractId, // status1: "1.受理完毕", // URFLimitSerial: urfSeries, // }).then(repairCount => { // if (repairCount.length > 0 && surplusCount == 1) { // alert("该设备关联限次合同,目前剩余次数小于送修设备。请等待进行中修理完成后再进行申请"); // return; // } // }); // }); // } // if (this.status != "草案中" && this.status != "1.受理完毕(SAP待发送)" && this.status != "4.修理品返送阶段") { // alert("不是草案中不能申请"); // } else { // if (this.dealer != undefined) { queryForFindInvalidLicense({ dealerId: this.dealerId, }).then(findInvalidLicense => { console.log(findInvalidLicense); if (findInvalidLicense.length > 0) { alert("经销商三证不在有效期,无法送修"); return; } }); } } if (this.ifDeadHurt == "有") { if (!confirm("是否确认AE要提交?")) { return; } } if (this.dayLater30 == "是") { alert("创建后超过30天,不能申请了"); return; } var prompt11 = "合同内大修次数已用完,当前修理为合同外的修理,是否继续?"; if (this.URFReapir == false && surplusCount == 0) { if (!confirm(prompt11)) { return; } } updateForRepair1({ recordId: this.Id }).then(result => { if (result != null && result.length > 0) { var split = result.split(", "); alert(split[1]); } else { queryForReocrds({ inchargeStaffId: this.inchargeStaffId, }).then(records => { if (records != null && records.length > 0) { var staff = records[0]; console.log(staff); updateRepair2({ recordId: this.Id, staff: staff, DWSign: this.DWSign, statusc: "1.受理完毕", DOJStatus: this.DOJStatus, SAPcondition: this.SAPcondition, }).then(result => { console.log(result); if (result != null && result.length > 0) { var split = result.split(", "); alert(split[1]); } else { if (this.salesOfficeCodeSelection == "成都RC") { alert("现阶段,成都RC仅受理四川(西藏)内镜、西南全域CV/CLV,其余实物请发至广州RC。"); } } }); queryForRds({ recordId: this.Id, }).then(rds => { if (rds != null && rds.length > 0) { var repairAft = rds[0]; if (repairAft.NewProductGuarante_Formula__c != repairAft.ProductGuarante_Create__c) { alert("该设备保修信息已发生变化,请了解"); } } }); } else { alert("没有找到 修理委托者"); } }); } }); }); // queryForFindInvalidLicense({ // dealerId: this.dealerId, // }).then(findInvalidLicense => { // console.log(findInvalidLicense); // if (findInvalidLicense.length > 0) { // alert("经销商三证不在有效期,无法送修"); // return; // } // }); // } // } // if (this.ifDeadHurt == "有") { // if (!confirm("是否确认AE要提交?")) { // return; // } // } // if (this.dayLater30 == "是") { // alert("创建后超过30天,不能申请了"); // return; // } // var prompt11 = "合同内大修次数已用完,当前修理为合同外的修理,是否继续?"; // if (this.URFReapir == false && surplusCount == 0) { // if (!confirm(prompt11)) { // return; // } // } // updateForRepair1({ // recordId: this.Id // }).then(result => { // if (result != null && result.length > 0) { // var split = result.split(", "); // alert(split[1]); // } else { // queryForReocrds({ // inchargeStaffId: this.inchargeStaffId, // }).then(records => { // if (records != null && records.length > 0) { // var staff = records[0]; // console.log(staff); // updateRepair2({ // recordId: this.Id, // staff: staff, // DWSign: this.DWSign, // statusc: "1.受理完毕", // DOJStatus: this.DOJStatus, // SAPcondition: this.SAPcondition, // }).then(result => { // console.log(result); // if (result != null && result.length > 0) { // var split = result.split(", "); // alert(split[1]); // } else { // if (this.salesOfficeCodeSelection == "成都RC") { // alert("现阶段,成都RC仅受理四川(西藏)内镜、西南全域CV/CLV,其余实物请发至广州RC。"); // } // } // }); // queryForRds({ // recordId: this.Id, // }).then(rds => { // if (rds != null && rds.length > 0) { // var repairAft = rds[0]; // if (repairAft.NewProductGuarante_Formula__c != repairAft.ProductGuarante_Create__c) { // alert("该设备保修信息已发生变化,请了解"); // } // } // }); // } else { // alert("没有找到 修理委托者"); // } // }); // } // }); // }); var staticResource; var DetailedAddress = this.detailedAddress; force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.css
New file @@ -0,0 +1,22 @@ .outerBorderCss{ border: 1px solid #D4D4D4; border-radius : 5px; border-top : 3px solid #565959; } .borderCss{ border: 1px solid #D4D4D4; border-radius : 5px; margin-bottom : 7px; border-top : 3px solid #565959; } .headerDorderCss{ border-top: 1px solid #565959; border-bottom: 1px solid #D4D4D4; padding:3px; } .centerCss{ text-align: center; } .centerCss .left{ margin-left: 100px; }/* sample css file *//* sample css file */