Merge branch 'LEX_dev' into LEX_zhangzhengmei_dev
4 文件已复制
27个文件已删除
55个文件已修改
47个文件已添加
1 文件已重命名
| | |
| | | public with sharing class AddSubmitApprovalProcessController { |
| | | public AddSubmitApprovalProcessController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | |
| | | res.applyUserId = ra.applyUser__r.Id; |
| | | res.ownerId = ra.OwnerId; |
| | | res.rentalApplyStatus = ra.Status__c; |
| | | res.demoRequestPastDataId = Schema.SObjectType.Rental_Apply__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_PastData).getRecordTypeId(); |
| | | |
| | | List<Rental_Apply_Equipment_Set_Detail__c> raeSet = [SELECT Id from Rental_Apply_Equipment_Set_Detail__c WHERE Rental_Apply__c = :recordId AND Draft_Appended__c=1]; |
| | | res.detailSize = raeSet.size(); |
| | | res.addApprovalStatus = '草案中'; |
| | | res.detailSize = 1; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '****e:' + e); |
| | |
| | | } |
| | | |
| | | |
| | | public Class InitData{ |
| | | //提交审批 |
| | | @AuraEnabled |
| | | public static String submitApproval(String recordId){ |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); |
| | | req1.setObjectId(recordId); |
| | | Approval.ProcessResult submitResult = Approval.process(req1); |
| | | return 'OK'; |
| | | } |
| | | catch (Exception e) { |
| | | Database.rollback(sp); |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | |
| | | |
| | | private class InitData{ |
| | | @AuraEnabled |
| | | public String rentalApplyId; //备品借出申请Id |
| | | @AuraEnabled |
| | |
| | | public String ownerId; //备品借出申请.所有人Id |
| | | @AuraEnabled |
| | | public String rentalApplyStatus; //备品借出申请.状态 |
| | | @AuraEnabled |
| | | public String demoRequestPastDataId; //备品申请 过去历史转移Id |
| | | } |
| | | } |
| | |
| | | public with sharing class AllReceivedFseController { |
| | | public AllReceivedFseController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new InitData(); |
| | | Rental_Apply__c ra = [SELECT Id, Loaner_received_ng_num__c from Rental_Apply__c where Id = :recordId]; |
| | | res.Id = ra.Id; |
| | | res.LoanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); |
| | | res.id = ra.Id; |
| | | res.loanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); |
| | | |
| | | return res; |
| | | } |
| | |
| | | |
| | | if(updateList.size()>0){ |
| | | try { |
| | | update updateList; |
| | | Update updateList; |
| | | return 'SUCCESS'; |
| | | } |
| | | catch (Exception e) { |
| | |
| | | |
| | | public Class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | public String id; |
| | | @AuraEnabled |
| | | public Integer LoanerReceivedNgNum; |
| | | public Integer loanerReceivedNgNum; |
| | | } |
| | | } |
| | |
| | | public static InitData ESignController (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | eSignForm__c report = [SELECT Id,Group_purchase_PCL__c,OCM_man_province_cus__c,HPSignUpStatus__c,Sales_Root_Formula__c,HPSignUpDate__c FROM eSignForm__c WHERE Id = :recordId LIMIT 1]; |
| | | eSignForm__c report = [SELECT Id,Group_purchase_PCL__c,OCM_man_province_cus__c,HPSignUpStatus__c,Sales_Root_Formula__c,HPSignUpDate__c,agencyAutoSignUpStatus__c,agencySignUpDate__c FROM eSignForm__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | // res.RCManagerId = report.RC_ManagerId__c; |
| | | res.GrouppurchasePCL = report.Group_purchase_PCL__c; |
| | | res.OCMManProvinceCus = report.OCM_man_province_cus__c; |
| | | res.HPSignUpStatus = report.HPSignUpStatus__c; |
| | | res.agencyAutoSignUpStatus = report.agencyAutoSignUpStatus__c; |
| | | res.SalesRootFormula = report.Sales_Root_Formula__c; |
| | | res.HPSignUpDate = report.HPSignUpDate__c; |
| | | res.agencySignUpDate = report.agencySignUpDate__c; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userId = UserInfo.getUserId(); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | res.OBA4_sinFor = getProfileIdByName(LightingButtonConstant.OBA4_sinFor); |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static string getProfileIdByName(String name){ |
| | | Profile profile = null; |
| | | try { |
| | | profile = [select Id from Profile where Name =:name]; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return profile.Id; |
| | | } |
| | | |
| | | //检索OCSM管理省 上的营业管理部担当 |
| | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | // @AuraEnabled |
| | | // public String RCManagerId; |
| | | @AuraEnabled |
| | | public Boolean GrouppurchasePCL; |
| | | @AuraEnabled |
| | |
| | | @AuraEnabled |
| | | public String HPSignUpStatus; |
| | | @AuraEnabled |
| | | public String agencyAutoSignUpStatus; |
| | | @AuraEnabled |
| | | public String SalesRootFormula; |
| | | @AuraEnabled |
| | | public Date HPSignUpDate; |
| | | @AuraEnabled |
| | | public String profileId; |
| | | } |
| | | |
| | | //获取当前登录人的 id |
| | | public Date agencySignUpDate; |
| | | @AuraEnabled |
| | | public static UserResult UserInfo_Owner() { |
| | | UserResult result = new UserResult(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | try { |
| | | User tempUser = [select id from user where id = : myUserID ]; |
| | | result.id = tempUser.id; |
| | | } catch (exception e) { |
| | | result.result = e.getMessage(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public class UserResult { |
| | | @AuraEnabled |
| | | public string result; |
| | | public UserResult( ) { |
| | | result = 'Success'; |
| | | } |
| | | @AuraEnabled |
| | | public string id; |
| | | } |
| | | public String profileId; |
| | | @AuraEnabled |
| | | public String userId; |
| | | @AuraEnabled |
| | | public String systemProfileId; |
| | | @AuraEnabled |
| | | public String OBA4_sinFor; |
| | | } |
| | | } |
| | |
| | | res.pageLength = Math.mod(setLength,10)== 0 ? setLength/10 : (setLength/10) +1 ; |
| | | res.raesList = raeSet; |
| | | } |
| | | res.ShipmentRequestedCnt = Integer.valueOf(ra.Shipment_requested_cnt__c); |
| | | res.shipmentRequestedCnt = Integer.valueOf(ra.Shipment_requested_cnt__c); |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '****e:' + e); |
| | |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | public String id; |
| | | @AuraEnabled |
| | | public Integer pagelength; |
| | | @AuraEnabled |
| | | public Integer ShipmentRequestedCnt; |
| | | public Integer shipmentRequestedCnt; |
| | | @AuraEnabled |
| | | public List<Rental_Apply_Equipment_Set__c> raesList; |
| | | } |
| New file |
| | |
| | | public with sharing class LexLostSubmitApprovalController { |
| | | |
| | | // 遗失报告 提交待审核 |
| | | @AuraEnabled |
| | | public static InitData LexLostSubmitApprovalController(String recordId) { |
| | | InitData res = new initData(); |
| | | try{ |
| | | List<LostReport_Detail__c> reportDetail = new List<LostReport_Detail__c>(); |
| | | LostReport__c report = [SELECT Id,Status__c FROM LostReport__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.statusTf = report.Status__c; |
| | | reportDetail = [SELECT Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c FROM LostReport_Detail__c WHERE id = :recordId AND Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c != null]; |
| | | res.reportDetailList = reportDetail; |
| | | System.debug(LoggingLevel.INFO, '*** zq: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** zq: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String statusTf; |
| | | @AuraEnabled |
| | | public List<LostReport_Detail__c> reportDetailList; |
| | | } |
| | | |
| | | //提交按钮 |
| | | @AuraEnabled |
| | | public static String submit(String recordId) { |
| | | try { |
| | | LostReport__c rac = [SELECT Id,Status__c FROM LostReport__c WHERE Id = :recordId LIMIT 1]; |
| | | rac.Id = rac.Id; |
| | | rac.Status__c = '填写完毕'; |
| | | update rac; |
| | | return '1'; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** zq: ' + ex); |
| | | // return errMsg; |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public static final String LU_SHENG_NAME = '陆 胜'; |
| | | public static final String HU_DI_AN_NAME = '胡 迪安'; |
| | | public static final String SYSTEM_PROFILE_NAME = '系统管理员'; |
| | | public static final String TwoS10_FSE_ManagerMent = '2S10_FSE管理者'; |
| | | public static final String TwoS1_Sales_Hospital = '2S1_销售医院担当'; |
| | | public static final String TwoS1_Sales_Hospital_Non_Singleton = '2S1_销售医院担当(非单点)'; |
| | | public static final String TwoS2_Sales_Product = '2S2_销售产品担当'; |
| | | public static final String TwoS4_Sales_Manager = '2S4_销售管理者'; |
| | | public static final String TwoS4_Sales_Manager_Non_Singleton = '2S4_销售管理者(非单点)'; |
| | | public static final String TwoS4_Sales_Manager_Majordomo = '2S4_销售管理者(总监)'; |
| | | public static final String TwoS6_Trade_Assistant = '2S6-2_营业助理'; |
| | | public static final String TwoS6_Sales_Headquarters = '2S6-1_销售本部窗口'; |
| | | public static final String TwoS7_Sales_Headquarters = '2S7_销售本部合同管理窗口'; |
| | | public static final String TwoS8_Sales_Administrative_Assistant = '2S8_销售行政助理'; |
| | | public static final String TwoS8_Sales_Administrative_Assistant_Plan = '2S8_销售行政助理(计划仪表板)'; |
| | | public static final String TwoS9_Spare = '2S9_备品窗口'; |
| | | public static final String OBA1_Tenderee = 'OBA1_招标管理'; |
| | | public static final String OBA4_sinFor = 'OBA4_签收管理'; |
| | | public static final String OBA7_Enquiry_Tenderee = 'OBA7_询价+招标管理'; |
| | | public static final String TwoM4_Marketplace_Manager = '2M4_市场产品本部担当(询价)'; |
| | | public static final String SOBJECT_NAME_OF_REPORT_SHARE ='Report__Share'; |
| | | public static final String SOBJECT_NAME_OF_VOC_SHARE = 'VOCShare__c'; |
| | | public static final String REPAIR_FIELD_DOJ_STATUS_NOT_OBJECT = '非对象'; |
| | |
| | | public with sharing class ReturnDeliverySlipController { |
| | | public ReturnDeliverySlipController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | |
| | | res.raeSet = raSet; |
| | | system.debug('raeSet===='+res.raeSet); |
| | | } |
| | | res.Name = ra.Name; |
| | | res.RentalApplyEquipmentSetCnt = Integer.valueOf(ra.Rental_Apply_Equipment_Set_Cnt__c); |
| | | res.LoanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); |
| | | res.name = ra.Name; |
| | | res.rentalApplyEquipmentSetCnt = Integer.valueOf(ra.Rental_Apply_Equipment_Set_Cnt__c); |
| | | res.loanerReceivedNgNum = Integer.valueOf(ra.Loaner_received_ng_num__c); |
| | | } |
| | | catch (Exception e) { |
| | | system.debug('INFO****' + e); |
| | |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public Integer RentalApplyEquipmentSetCnt; |
| | | public Integer rentalApplyEquipmentSetCnt; |
| | | @AuraEnabled |
| | | public Integer LoanerReceivedNgNum; |
| | | public Integer loanerReceivedNgNum; |
| | | @AuraEnabled |
| | | public String Name; |
| | | public String name; |
| | | @AuraEnabled |
| | | public List<Rental_Apply_Equipment_Set_Detail__c> raeSet; |
| | | } |
| | |
| | | res.Id = report.Id; |
| | | res.status = report.status__c; |
| | | res.name = report.Name; |
| | | res.opportunityNum = String.valueOf(report.OpportunityNum__c); |
| | | // res.opportunityNum = String.valueOf(report.OpportunityNum__c); |
| | | res.opportunityNum = Integer.valueOf(report.OpportunityNum__c); |
| | | res.isRelateProject = report.IsRelateProject__c; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | res.SalesManagerId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | res.SalesHospitalId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | res.TwoS1_Sales_Hospital = getProfileIdByName(LightingButtonConstant.TwoS1_Sales_Hospital); |
| | | res.TwoS1_Sales_Hospital_Non_Singleton = getProfileIdByName(LightingButtonConstant.TwoS1_Sales_Hospital_Non_Singleton ); |
| | | res.TwoS2_Sales_Product = getProfileIdByName(LightingButtonConstant.TwoS2_Sales_Product); |
| | | res.TwoS4_Sales_Manager = getProfileIdByName(LightingButtonConstant.TwoS4_Sales_Manager); |
| | | res.TwoS4_Sales_Manager_Non_Singleton = getProfileIdByName(LightingButtonConstant.TwoS4_Sales_Manager_Non_Singleton); |
| | | res.TwoS4_Sales_Manager_Majordomo = getProfileIdByName(LightingButtonConstant.TwoS4_Sales_Manager_Majordomo); |
| | | res.TwoS6_Trade_Assistant = getProfileIdByName(LightingButtonConstant.TwoS6_Trade_Assistant); |
| | | res.TwoS6_Sales_Headquarters = getProfileIdByName(LightingButtonConstant.TwoS6_Sales_Headquarters); |
| | | res.TwoS7_Sales_Headquarters = getProfileIdByName(LightingButtonConstant.TwoS7_Sales_Headquarters); |
| | | res.TwoS8_Sales_Administrative_Assistant = getProfileIdByName(LightingButtonConstant.TwoS8_Sales_Administrative_Assistant); |
| | | res.TwoS8_Sales_Administrative_Assistant_Plan = getProfileIdByName(LightingButtonConstant.TwoS8_Sales_Administrative_Assistant_Plan); |
| | | res.TwoS9_Spare = getProfileIdByName(LightingButtonConstant.TwoS9_Spare); |
| | | res.OBA1_Tenderee = getProfileIdByName(LightingButtonConstant.OBA1_Tenderee); |
| | | res.OBA7_Enquiry_Tenderee = getProfileIdByName(LightingButtonConstant.OBA7_Enquiry_Tenderee); |
| | | res.TwoM4_Marketplace_Manager = getProfileIdByName(LightingButtonConstant.TwoM4_Marketplace_Manager); |
| | | res.Environment_Url = System.Label.Environment_Url; |
| | | System.debug(LoggingLevel.INFO, '*** xu: ' + res); |
| | | }catch(Exception e){ |
| | |
| | | @AuraEnabled |
| | | public String name; |
| | | @AuraEnabled |
| | | public String opportunityNum; |
| | | public Integer opportunityNum; |
| | | @AuraEnabled |
| | | public String isRelateProject; |
| | | @AuraEnabled |
| | |
| | | @AuraEnabled |
| | | public String systemProfileId; |
| | | @AuraEnabled |
| | | public String SalesManagerId; |
| | | public String TwoS1_Sales_Hospital; |
| | | @AuraEnabled |
| | | public String SalesHospitalId; |
| | | public String TwoS1_Sales_Hospital_Non_Singleton; |
| | | @AuraEnabled |
| | | public String TwoS2_Sales_Product; |
| | | @AuraEnabled |
| | | public String TwoS4_Sales_Manager; |
| | | @AuraEnabled |
| | | public String TwoS4_Sales_Manager_Non_Singleton; |
| | | @AuraEnabled |
| | | public String TwoS4_Sales_Manager_Majordomo; |
| | | @AuraEnabled |
| | | public String TwoS6_Trade_Assistant; |
| | | @AuraEnabled |
| | | public String TwoS6_Sales_Headquarters; |
| | | @AuraEnabled |
| | | public String TwoS7_Sales_Headquarters; |
| | | @AuraEnabled |
| | | public String TwoS8_Sales_Administrative_Assistant; |
| | | @AuraEnabled |
| | | public String TwoS8_Sales_Administrative_Assistant_Plan; |
| | | @AuraEnabled |
| | | public String TwoS9_Spare; |
| | | @AuraEnabled |
| | | public String OBA1_Tenderee; |
| | | @AuraEnabled |
| | | public String OBA7_Enquiry_Tenderee; |
| | | @AuraEnabled |
| | | public String TwoM4_Marketplace_Manager; |
| | | @AuraEnabled |
| | | public String SalesMarketplaceId; |
| | | @AuraEnabled |
| | | public String Environment_Url; |
| | | } |
| New file |
| | |
| | | public with sharing class buttonMaintenanceContractAssetCtl { |
| | | public buttonMaintenanceContractAssetCtl() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Maintenance_Contract_Asset__c report = [SELECT Id FROM Maintenance_Contract_Asset__c 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; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public with sharing class buttonMaintenanceTaskCtl { |
| | | public buttonMaintenanceTaskCtl() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Maintenance_Task__c report = [SELECT Id,Maintenance_Contract__c FROM Maintenance_Task__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.Id = report.Id; |
| | | res.MaintenanceContractC = report.Maintenance_Contract__c; |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | |
| | | @AuraEnabled |
| | | public static List<Maintenance_Contract__c> selectMaintenanceContract(String Id){ |
| | | List<Maintenance_Contract__c> res = new List<Maintenance_Contract__c>(); |
| | | try{ |
| | | res = [SELECT Id,RecordType_DeveloperName__c,Estimate_Target__c from Maintenance_Contract__c WHERE Id =: Id]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String MaintenanceContractC; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | QIS_Report__c report = [SELECT 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 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.PAEDetermineC = report.PAE_Determine__c; |
| | | res.PAEDetermineACC = report.PAE_DetermineAC__c; |
| | | res.OCMJudgementC = report.OCM_judgement__c; |
| | |
| | | res.ETQUPLOADSTATUSC = report.ETQ_UPLOAD_STATUS__c; |
| | | res.AEDetermineResultC = report.AE_DetermineResult__c; |
| | | res.Id = report.Id; |
| | | res.Name = report.Name; |
| | | res.QISStatusC = report.QIS_Status__c; |
| | | |
| | | res.isAEProfileC = report.isAE_Profile__c; |
| | | res.isCNBuyC = report.is_CNBuy__c; |
| | | res.isPAEProfileC = report.isPAE_Profile__c; |
| | | res.userId = UserInfo.getUserId(); |
| | | res.email = UserInfo.getUserEmail(); |
| | | res.profileId = UserInfo.getProfileId(); |
| | |
| | | @AuraEnabled |
| | | public static String updateOSHNogoods(String Id,String email,String userId){ |
| | | List<User> user = new List<User>(); |
| | | user = [SELECT Id,Alias from User]; |
| | | user = [SELECT Id,Alias,Alias__c from User]; |
| | | |
| | | String res =''; |
| | | try { |
| | |
| | | return res; |
| | | } |
| | | |
| | | // 根据ID修理报价提交 |
| | | @AuraEnabled |
| | | public static String updateQisForRCRecieved(String QId,String uid){ |
| | | String res=''; |
| | | try { |
| | | List<User> user = new List<User>(); |
| | | user = [SELECT Id,Alias,Alias__c from User]; |
| | | |
| | | QIS_Report__c rac = new QIS_Report__c(); |
| | | rac.Id = QId; |
| | | rac.QIS_Status__c = 'RC检测中'; |
| | | rac.OCM_RC_RecievedDate__c = Date.today(); |
| | | rac.RC__c = uid; |
| | | rac.RC_Receive_staff__c = user[0].Alias; |
| | | List<User> records = new List<User>(); |
| | | records = [SELECT Id, BuchangApprovalManagerSales__c,JingliApprovalManager__c, BuchangApprovalManager__c, ZongjianApprovalManager__c FROM User WHERE Id=: uid ]; |
| | | if (records != null && records.size() > 0 && records[0].BuchangApprovalManagerSales__c != null) { |
| | | rac.RC_Manager__c = records[0].BuchangApprovalManagerSales__c; |
| | | } else { |
| | | rac.RC_Manager__c = uid; |
| | | } |
| | | rac.CDS_date__c = Date.today(); |
| | | rac.RC_CDS_staff__c = user[0].Alias__c; |
| | | rac.OCSM_Nogoods__c = true; |
| | | update rac; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 查找简档 |
| | | @AuraEnabled |
| | | public static List<Profile> initSelectProfile(String profileId){ |
| | | List<Profile> res = new List<Profile>(); |
| | | try{ |
| | | res = [SELECT Id,name FROM Profile WHERE Id=: profileId ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String isAEProfileC; |
| | | @AuraEnabled |
| | | public String isCNBuyC; |
| | | @AuraEnabled |
| | | public String isPAEProfileC; |
| | | |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String Name; |
| | | @AuraEnabled |
| | | public String QISStatusC; |
| | | @AuraEnabled |
| | | public String userId; |
| | |
| | | |
| | | // 根据ID修改QIS市场部 |
| | | @AuraEnabled |
| | | public static void updateQISSCReport(String Id){ |
| | | public static String updateQISSCReport(String QId){ |
| | | String s; |
| | | try { |
| | | QIS_SC_Report__c qis_Sc = new QIS_SC_Report__c(); |
| | | qis_Sc.Id = Id; |
| | | qis_Sc.Status__c = '已提交'; |
| | | update qis_Sc; |
| | | QIS_SC_Report__c qis = new QIS_SC_Report__c(); |
| | | qis.Id = QId; |
| | | qis.Status__c = '已提交'; |
| | | update qis; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | s=e.getMessage(); |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | public class InitData{ |
| | |
| | | String res =''; |
| | | try { |
| | | Repair_Quotation__c repair = new Repair_Quotation__c(); |
| | | repair.Id = recordid; |
| | | repair.Id = recordId; |
| | | repair.CutPriceStatus_Service__c = '已提交'; |
| | | update repair; |
| | | } catch (Exception e) { |
| | |
| | | String res =''; |
| | | try { |
| | | Repair_Quotation__c repair = new Repair_Quotation__c(); |
| | | repair.Id = recordid; |
| | | repair.Id = recordId; |
| | | repair.Rental_Apply_Discount_Status__c = '已提交'; |
| | | update repair; |
| | | } catch (Exception e) { |
| | |
| | | return res; |
| | | } |
| | | |
| | | // 查找简档 |
| | | @AuraEnabled |
| | | public static List<Profile> initSelectProfile(String profileId){ |
| | | List<Profile> res = new List<Profile>(); |
| | | try{ |
| | | res = [SELECT Id,name FROM Profile WHERE Id=: profileId ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| New file |
| | |
| | | public with sharing class lexConsumablesLostController { |
| | | // 耗材备品申请 取消 |
| | | @AuraEnabled |
| | | public static InitData lexConsumablesLostController(String recordId) { |
| | | InitData res = new initData(); |
| | | try{ |
| | | Consum_Apply__c report = [SELECT Id,Status__c,RA_Status__c,Yi_loaner_arranged__c FROM Consum_Apply__c WHERE Id = :recordId LIMIT 1]; |
| | | res.Id = report.Id; |
| | | res.statusTf = report.Status__c; |
| | | res.raStatusTf = report.RA_Status__c; |
| | | res.yiLoanerArr = report.Yi_loaner_arranged__c; |
| | | System.debug(LoggingLevel.INFO, '*** zq: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** zq: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String statusTf; |
| | | @AuraEnabled |
| | | public String raStatusTf; |
| | | @AuraEnabled |
| | | public Decimal yiLoanerArr; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public with sharing class loanerArrangedEmailController { |
| | | |
| | | |
| | | |
| | | public loanerArrangedEmailController() { |
| | | } |
| | | public with sharing class LoanerArrangedEmailController { |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId) { |
| | |
| | | if( rac.Campaign__c != null ){ |
| | | //获取学会对象 |
| | | Campaign camp = [select Id, Status, Rental_Apply_Flag__c,IF_Approved__c,Approved_Status__c, Meeting_Approved_No__c from Campaign where id = :rac.Campaign__c]; |
| | | res.CampaignId = camp.Id; |
| | | res.CampaignStatus = camp.Status; |
| | | res.IFApproved = camp.IF_Approved__c; |
| | | res.MeetingApprovedNo = camp.Meeting_Approved_No__c; |
| | | res.ApprovedStatus = camp.Approved_Status__c; |
| | | res.campaignId = camp.Id; |
| | | res.campaignStatus = camp.Status; |
| | | res.iFApproved = camp.IF_Approved__c; |
| | | res.meetingApprovedNo = camp.Meeting_Approved_No__c; |
| | | res.approvedStatus = camp.Approved_Status__c; |
| | | } |
| | | res.Id = recordId; |
| | | res.RaStatus = rac.Status__c; |
| | | res.WeiAssignedCnt = Integer.valueOf(rac.Wei_Assigned_Cnt__c); |
| | | res.AssignedNotShipment = Integer.valueOf(rac.Assigned_Not_Shipment__c); |
| | | res.DemoPurpose1 = rac.Demo_purpose1__c; |
| | | res.ContractPdfUpdated = rac.Contract_pdf_updated__c; |
| | | res.RepairId = rac.Repair__c; |
| | | res.RepairFinalInspectionDateF = rac.Repair_Final_Inspection_Date_F__c; |
| | | res.RCReturnToOffice = rac.RC_return_to_office__c; |
| | | res.StatusList = status; |
| | | res.id = recordId; |
| | | res.raStatus = rac.Status__c; |
| | | res.weiAssignedCnt = Integer.valueOf(rac.Wei_Assigned_Cnt__c); |
| | | res.assignedNotShipment = Integer.valueOf(rac.Assigned_Not_Shipment__c); |
| | | res.demoPurpose1 = rac.Demo_purpose1__c; |
| | | res.contractPdfUpdated = rac.Contract_pdf_updated__c; |
| | | res.repairId = rac.Repair__c; |
| | | res.repairFinalInspectionDateF = rac.Repair_Final_Inspection_Date_F__c; |
| | | res.rCReturnToOffice = rac.RC_return_to_office__c; |
| | | res.statusList = status; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '****e:' + e); |
| | |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | public String id; |
| | | @AuraEnabled |
| | | public String CampaignStatus; //学会状态 |
| | | public String campaignStatus; //学会状态 |
| | | @AuraEnabled |
| | | public String CampaignId; //学会Id |
| | | public String campaignId; //学会Id |
| | | @AuraEnabled |
| | | public String RaStatus; //备品借出申请状态 |
| | | public String raStatus; //备品借出申请状态 |
| | | @AuraEnabled |
| | | public Integer WeiAssignedCnt; //未分配件数 Wei_Assigned_Cnt__c |
| | | public Integer weiAssignedCnt; //未分配件数 Wei_Assigned_Cnt__c |
| | | @AuraEnabled |
| | | public Integer AssignedNotShipment; //已分配未出库指示 Assigned_Not_Shipment__c |
| | | public Integer assignedNotShipment; //已分配未出库指示 Assigned_Not_Shipment__c |
| | | @AuraEnabled |
| | | public String DemoPurpose1; //使用目的1 Demo_purpose1__c |
| | | public String demoPurpose1; //使用目的1 Demo_purpose1__c |
| | | @AuraEnabled |
| | | public Boolean ContractPdfUpdated; //合同书已上传 Contract_pdf_updated__c |
| | | public Boolean contractPdfUpdated; //合同书已上传 Contract_pdf_updated__c |
| | | @AuraEnabled |
| | | public String RepairId; //学会.修理Id |
| | | public String repairId; //学会.修理Id |
| | | @AuraEnabled |
| | | public Date RepairFinalInspectionDateF; //修理最终检测日F Repair_Final_Inspection_Date_F__c |
| | | public Date repairFinalInspectionDateF; //修理最终检测日F Repair_Final_Inspection_Date_F__c |
| | | @AuraEnabled |
| | | public Date RCReturnToOffice; //RC修理品返送日 RC_return_to_office__c |
| | | public Date rCReturnToOffice; //RC修理品返送日 RC_return_to_office__c |
| | | @AuraEnabled |
| | | public Boolean IFApproved; //学会.是否需要申请决裁 |
| | | public Boolean iFApproved; //学会.是否需要申请决裁 |
| | | @AuraEnabled |
| | | public String MeetingApprovedNo; //学会.会议决裁编码 |
| | | public String meetingApprovedNo; //学会.会议决裁编码 |
| | | @AuraEnabled |
| | | public String ApprovedStatus; //学会.决裁状态 Approved_Status__c |
| | | public String approvedStatus; //学会.决裁状态 Approved_Status__c |
| | | @AuraEnabled |
| | | public List<String> StatusList; |
| | | public List<String> statusList; |
| | | } |
| | | } |
| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Maintenance_Contract__c report = [SELECT URF_Contract__c,RecordTypeId,Is_RecognitionModel__c,Status__c,MC_approval_status__c,Payment_Plan_Sum_First__c, |
| | | Maintenance_Contract__c report = [SELECT URF_Contract__c,RecordTypeId,Is_RecognitionModel__c,Status__c,MC_approval_status__c,Payment_Plan_Sum_First__c, |
| | | Contract_quotation_or_not__c,Name,notRenew__c,Contract_print_completed__c,Maintenance_Contract_No__c, |
| | | upload_to_sap_time__c,old_Is_RecognitionModel__c,upload_to_RM_time__c,Is_Recognition_Model_True__c, |
| | | Id,URF_Contract_F__c,RecordType_DeveloperName__c,Estimate_Target__c FROM Maintenance_Contract__c WHERE Id =: recordId LIMIT 1]; |
| | |
| | | |
| | | // 维修合同失单报告 |
| | | @AuraEnabled |
| | | public static List<Lost_Report__c> selectRecords(String recordId){ |
| | | public static List<Lost_Report__c> selectRecords(String mcId){ |
| | | List<Lost_Report__c> res = new List<Lost_Report__c>(); |
| | | try{ |
| | | res = [SELECT Id,Status__c,Other_Reasons__c,Other__c,Third_Party_Company__c,Third_Party_Contract_Price__c,To_Where__c,Specific_Reasons__c,Maintenance_Contract__c from Lost_Report__c where Maintenance_Contract__c =: recordId ]; |
| | | res = [SELECT Id,Status__c,Other_Reasons__c,Other__c,Third_Party_Company__c,Third_Party_Contract_Price__c,To_Where__c,Specific_Reasons__c,Maintenance_Contract__c from Lost_Report__c where Maintenance_Contract__c =: mcId ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | |
| | | |
| | | //通过Is_Validity__c和Id字段查询Account的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Account> queryForFindInvalidLicense(Boolean isValidity,String dealerId){ |
| | | public static List<Account> queryForFindInvalidLicense(String dealerId){ |
| | | try { |
| | | List<Account> accounts = [select Id,Is_Validity__c from Account where Is_Validity__c = false And Id = :dealerId]; |
| | | return accounts; |
| | |
| | | |
| | | //通过Id查询Repair__c中的Dealer__c,再根据Dealer__c查询Account中的记录并返回 |
| | | @AuraEnabled |
| | | public static List<Account> queryForrecords3(String recordId){ |
| | | public static List<Account> queryForrecords3(String dealer){ |
| | | try { |
| | | Repair__c repair = [select Repair__c.Dealer__c from Repair__c where Id =:recordId]; |
| | | List<Account> accounts = [select id, FirstParagraph__c from Account where name =:repair.Dealer__c]; |
| | | List<Account> accounts = [SELECT id, FirstParagraph__c from Account where name =:dealer]; |
| | | return accounts; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | |
| | | //更新Repair__c中的记录,将Maintenance_Contract__c和MaintenanceContractType__c字段更新为空,若捕获到异常则返回错误信息 |
| | | @AuraEnabled |
| | | public static String updateForRepair1(String recordId){ |
| | | String res=''; |
| | | try { |
| | | Repair__c repair = new Repair__c(); |
| | | repair.ID = recordId; |
| | | repair.Id = recordId; |
| | | repair.Maintenance_Contract__c = null; |
| | | repair.MaintenanceContractType__c = null; |
| | | update repair; |
| | | return null; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //更新Repair__c中的记录,若捕获到异常则返回错误信息 |
| | | @AuraEnabled |
| | | public static String updateRepair2(String recordId,User staff,Boolean DWSign,String statusc,String DOJStatus,String SAPcondition){ |
| | | String res=''; |
| | | try { |
| | | Repair__c repair = new Repair__c(); |
| | | repair.Id = recordId; |
| | |
| | | repair.SAP_Transfer_time__c = Datetime.now(); |
| | | } |
| | | update repair; |
| | | return null; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | res = e.getMessage(); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | // 查找简档 |
| | | @AuraEnabled |
| | | public static List<Profile> initSelectProfile(String profileId){ |
| | | List<Profile> res = new List<Profile>(); |
| | | try{ |
| | | res = [SELECT Id,name FROM Profile WHERE Id=: profileId ]; |
| | | }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 FROM User WHERE Id=: userId ]; |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String detailedAddress; |
| | |
| | | public static InitData init(String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | Inspection_Report__c report = [SELECT Id,RecordTypeId FROM Inspection_Report__c WHERE Id =: recordId LIMIT 1]; |
| | | Inspection_Report__c report = [SELECT Id,RecordTypeId,RecordType.DeveloperName FROM Inspection_Report__c WHERE Id =: recordId LIMIT 1]; |
| | | System.debug(LoggingLevel.INFO, '*** opp: ' + report); |
| | | res.Id = report.Id; |
| | | res.RecordTypeId = report.RecordTypeId; |
| | | res.RecordType = report.RecordType.DeveloperName; |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String RecordTypeId; |
| | | @AuraEnabled |
| | | public String RecordType; |
| | | } |
| | | } |
| | |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } |
| | | |
| | | window.open(url, '_self'); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // Intake universal code编辑 |
| | |
| | | } |
| | | window.open(url, '_self'); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| | |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | import init from '@salesforce/apex/AddSubmitApprovalProcessController.init'; |
| | | import setSObjectShare from '@salesforce/apex/ControllerUtil.setSObjectShare' |
| | | import submitApproval from '@salesforce/apex/AddSubmitApprovalProcessController.submitApproval'; |
| | | import setSObjectShare from '@salesforce/apex/ControllerUtil.setSObjectShare'; |
| | | |
| | | export default class lexAddSubmitApprovalProcess extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if(result.addApprovalStatus != '草案中' || result.detailSize == 0){ |
| | | this.ToastShow('没有需要审批的追加附属品'); |
| | | this.ToastShow('没有需要审批的追加附属品','warning'); |
| | | return; |
| | | } |
| | | if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | |
| | | // alert('希望到货日不能早于申请提交日'); |
| | | // return; |
| | | // } |
| | | console.log(JSON.stringify(result)); |
| | | if(result.repairId != null){ |
| | | if(result.demoPurpose1 == '维修代用' && result.demoPurpose2 == '一般用户'){ |
| | | if(result.repairEstimatedDateFormula == null){ |
| | | this.ToastShow('一般维修无报价日,不可借用备品'); |
| | | this.ToastShow('一般维修无报价日,不可借用备品','warning'); |
| | | return; |
| | | }else if(result.repairEstimatedDateFormula <'2019-07-01' && result.agreedDate == null){ |
| | | this.ToastShow('报价日在2019/7/1之前且户同意日为空,不可借用备品'); |
| | | this.ToastShow('报价日在2019/7/1之前且户同意日为空,不可借用备品','warning'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if(result.recordTypeId !='01210000000RHIn' && result.newProductGuaranteeObject=='2: 服务多年保修' && (result.assetModelNo=='CV-V1' ||result.assetModelNo=='CV-V1(A)'||result.assetModelNo=='CV-V1(B)'||result.assetModelNo=='GIF-LV1'||result.assetModelNo=='CF-LV1L'||result.assetModelNo=='CF-LV1I'||result.assetModelNo=='MAJ-1910') &&(result.demoPurpose2=='一般用户'||result.demoPurpose2=='再修理')){ |
| | | this.ToastShow('奥辉设备,保修期内不提供备品.'); |
| | | //备品申请 过去历史转移 |
| | | if(result.recordTypeId != result.demoRequestPastDataId && result.newProductGuaranteeObject=='2: 服务多年保修' && (result.assetModelNo=='CV-V1' ||result.assetModelNo=='CV-V1(A)'||result.assetModelNo=='CV-V1(B)'||result.assetModelNo=='GIF-LV1'||result.assetModelNo=='CF-LV1L'||result.assetModelNo=='CF-LV1I'||result.assetModelNo=='MAJ-1910') &&(result.demoPurpose2=='一般用户'||result.demoPurpose2=='再修理')){ |
| | | this.ToastShow('奥辉设备,保修期内不提供备品.','warning'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if(result.campaignId!=null || result.campaignId!=''){ |
| | | if(result.rentalApplyFlag == '草案中'){ |
| | | this.ToastShow('学会状态为草案中,不能提交'); |
| | | if(result.campaignStatus == '草案中'){ |
| | | this.ToastShow('学会状态为草案中,不能提交','warning'); |
| | | return; |
| | | } |
| | | if(result.rentalApplyFlag == '申请中'){ |
| | | this.ToastShow('学会状态为申请中,不能提交'); |
| | | if(result.campaignStatus == '申请中'){ |
| | | this.ToastShow('学会状态为申请中,不能提交','warning'); |
| | | return; |
| | | } |
| | | if(result.rentalApplyFlag == '已结束'){ |
| | | this.ToastShow('学会状态为已结束,不能提交'); |
| | | if(result.campaignStatus == '已结束'){ |
| | | this.ToastShow('学会状态为已结束,不能提交','warning'); |
| | | return; |
| | | } |
| | | if(result.rentalApplyFlag == '已提交报告'){ |
| | | this.ToastShow('学会状态为已提交报告,不能提交'); |
| | | if(result.campaignStatus == '已提交报告'){ |
| | | this.ToastShow('学会状态为已提交报告,不能提交','warning'); |
| | | return; |
| | | } |
| | | if(result.rentalApplyFlag == '取消申请中'){ |
| | | this.ToastShow('学会状态为取消申请中,不能提交'); |
| | | if(result.campaignStatus == '取消申请中'){ |
| | | this.ToastShow('学会状态为取消申请中,不能提交','warning'); |
| | | return; |
| | | } |
| | | if(result.rentalApplyFlag == '取消'){ |
| | | this.ToastShow('学会状态为取消,不能提交'); |
| | | if(result.campaignStatus == '取消'){ |
| | | this.ToastShow('学会状态为取消,不能提交','warning'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if(result.qISNumber!=null || result.qISNumber!=''){ |
| | | if(result.nextAction=='送回'){ |
| | | this.ToastShow('QIS 已送回,不能再申请备品了'); |
| | | this.ToastShow('QIS 已送回,不能再申请备品了','warning'); |
| | | return; |
| | | } |
| | | } |
| | |
| | | userAccess:userAccess, |
| | | ownerId:result.ownerId |
| | | }).then(res=>{ |
| | | if(res!='OK'){ |
| | | this.ToastShow(res); |
| | | console.log('setSObjectShareSuccess===='+res); |
| | | if(res!='OK'){ |
| | | this.ToastShow(res,'warning'); |
| | | return; |
| | | } |
| | | }).catch(err=>{ |
| | | console.log('setSObjectShareErr====',err); |
| | | console.log('setSObjectShareErr===='+err); |
| | | }) |
| | | |
| | | |
| | | var request = new sforce.ProcessSubmitRequest(); |
| | | request.objectId = "{!Rental_Apply__c.Id}"; |
| | | var processResults = sforce.connection.process([request]); |
| | | // var request = new sforce.ProcessSubmitRequest(); |
| | | // request.objectId = "{!Rental_Apply__c.Id}"; |
| | | // var processResults = sforce.connection.process([request]); |
| | | |
| | | |
| | | if (processResults[0].errors != null) { |
| | | var back = new sforce.SObject("Rental_Apply__c"); |
| | | back.Id = "{!Rental_Apply__c.Id}"; |
| | | back.Add_Approval_Status__c = "草案中"; |
| | | var backResult = sforce.connection.update([back]); |
| | | backMessages = this.getConnectDMLErrorMessages(backResult); |
| | | if (backMessages.length > 0) { |
| | | alert(backMessages.join("\n")); |
| | | return; |
| | | } |
| | | // if (processResults[0].errors != null) { |
| | | // var back = new sforce.SObject("Rental_Apply__c"); |
| | | // back.Id = "{!Rental_Apply__c.Id}"; |
| | | // back.Add_Approval_Status__c = "草案中"; |
| | | // var backResult = sforce.connection.update([back]); |
| | | // backMessages = this.getConnectDMLErrorMessages(backResult); |
| | | // if (backMessages.length > 0) { |
| | | // this.showToast(backMessages.join("\n"),'error'); |
| | | // return; |
| | | // } |
| | | |
| | | var errmsg = processResults[0].errors.message.toString(); |
| | | alert(errmsg); |
| | | return; |
| | | } |
| | | // var errmsg = processResults[0].errors.message.toString(); |
| | | // this.showToast(errmsg,'error'); |
| | | // return; |
| | | // } |
| | | |
| | | //updateRecord({fields: { Id: this.recordId }}); |
| | | |
| | | submitApproval({ |
| | | recordId: this.recordId |
| | | }).then(res=>{ |
| | | console.log('submitApproval===='+res); |
| | | if(res == 'OK'){ |
| | | this.ToastShow('提交成功','success'); |
| | | }else{ |
| | | this.ToastShow(res,'error'); |
| | | } |
| | | }) |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | |
| | | }).catch(err=>{ |
| | | console.log('sErr====',err); |
| | | console.log('sErr====',err.message); |
| | | }) |
| | | } |
| | | |
| | | ToastShow(msg){ |
| | | ToastShow(msg,type){ |
| | | const evt = new ShowToastEvent({ |
| | | title : msg, |
| | | message: '', |
| | | variant: 'warning' |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | Address() { |
| | | if (this.partArrangementCompleteC != undefined) { |
| | | this.ShowToastEvent('零件已齐备完毕,直返收货地址不能修改!',"error") |
| | | // alert('零件已齐备完毕,直返收货地址不能修改!'); |
| | | } else if (this.RepairShippedDateC != undefined) { |
| | | this.ShowToastEvent('RC修理品已返送,直返收货地址不能修改!',"error") |
| | | // alert('RC修理品已返送,直返收货地址不能修改!'); |
| | | } else { |
| | | window.open("/apex/StraightBackAddress?id=" + this.Id, '_self'); |
| | | } |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(res=>{ |
| | | if(res.LoanerReceivedNgNum == 0){ |
| | | console.log('loanerReceivedNgNum==='+ res.loanerReceivedNgNum); |
| | | if(res.loanerReceivedNgNum == 0){ |
| | | const evt = new ShowToastEvent({ |
| | | title : '现场已经全部收到实物了', |
| | | message: '', |
| | | variant: 'success' |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | getRaeSet({ |
| | | recordId: this.recordId |
| | |
| | | } |
| | | |
| | | }) |
| | | .catch(err=>{ |
| | | console.log('getRaeSet==='+err); |
| | | }) |
| | | } |
| | | }).catch(err=>{ |
| | | console.log(err); |
| | | console.log('init==='+err); |
| | | }) |
| | | } |
| | | } |
| | |
| | | var status = this.StatusC; |
| | | if (status != '待处理') { |
| | | this.ShowToastEvent("报修子单的状态不是 待处理 无法申请修理", "error") |
| | | // alert('报修子单的状态不是 待处理 无法申请修理'); |
| | | return; |
| | | } |
| | | var url = '/apex/ChoiceAsset?Id=' + this.Id + '&Type=Repair'; |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import updateForSubmitButton from '@salesforce/apex/ReportController.updateForSubmitButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import init from '@salesforce/apex/lexConsumablesLostController.lexConsumablesLostController'; |
| | | |
| | | export default class LexConsumablesLost extends LightningElement { |
| | | |
| | | @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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | this.IsLoading = false; |
| | | // this.submit(); |
| | | init({recordId:this.recordId}) |
| | | .then(result=>{ |
| | | console.log("LexConsumablesLost------>>>",result) |
| | | if (result.statusTf == "取消" ) { |
| | | this.showToast('已经取消!','error') |
| | | return; |
| | | } |
| | | if (result.statusTf == "删除" ) { |
| | | this.showToast('已经删除!','error') |
| | | return; |
| | | } |
| | | //状态为终止的不能提交审批 |
| | | if(result.raStatusTf == "已出库" || result.yiLoanerArr > 0){ |
| | | this.showToast('备品已经出库,不能取消!','error') |
| | | return; |
| | | } |
| | | window.open("/apex/ConsumApplyCancel?objId="+this.recordId, 'ConsumApplyCancel', 'width=500,height=250'); |
| | | // window.open("/apex/ConsumApplyCancel?objId={!URLENCODE(Consum_Apply__c.Id)}", 'ConsumApplyCancel', 'width=500,height=250'); |
| | | }) |
| | | .catch(e=>{console.log(e)}) |
| | | .finally(()=>{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
copy from force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
copy to force-app/main/default/lwc/lexCreateAssessmentReport/lexCreateAssessmentReport.html
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonCampaignCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCreateAssessmentReport extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | Status; |
| | | |
| | | @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.Status = result.Status; |
| | | |
| | | this.CreateAssessmentReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建授课/考核报告 |
| | | CreateAssessmentReport() { |
| | | var status = this.Status; |
| | | if (status == '公开中') { |
| | | window.open("/apex/AssessmentReport?camid=" + this.Id, "_top"); |
| | | } else { |
| | | this.ShowToastEvent("只有批准后才能创建报告!", "error") |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
copy from force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
copy to force-app/main/default/lwc/lexCreateInstructReport/lexCreateInstructReport.html
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonCampaignCtl.init'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCreateInstructReport extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | Status; |
| | | |
| | | @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.Status = result.Status; |
| | | |
| | | this.CreateInstructReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建带教报告 |
| | | CreateInstructReport() { |
| | | var status = this.Status; |
| | | if (status == '公开中') { |
| | | window.open("/apex/InstructReport?camid="+this.Id, "_top"); |
| | | } else { |
| | | this.ShowToastEvent("只有批准后才能创建报告!", "error") |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import init from '@salesforce/apex/buttonMaintenanceTaskCtl.init'; |
| | | import selectMaintenanceContract from '@salesforce/apex/buttonMaintenanceTaskCtl.selectMaintenanceContract'; |
| | | |
| | | export default class LexCreateReportMaintenanceTask extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeDeveloperNameC; |
| | | EstimateTargetC; |
| | | MaintenanceContractC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | | this.EstimateTargetC = result.EstimateTargetC; |
| | | this.MaintenanceContractC = result.MaintenanceContractC; |
| | | |
| | | this.CreateReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 制作报告书 |
| | | CreateReport() { |
| | | var MaintenanceContractId = this.Id; |
| | | var RecordTypeName = this.RecordTypeDeveloperNameC; |
| | | var EstimateTarget = this.EstimateTargetC; |
| | | selectMaintenanceContract({ |
| | | Id: this.MaintenanceContractC |
| | | }).then(result => { |
| | | console.log(result); |
| | | var MaintenanceContractId = this.MaintenanceContractC; |
| | | var RecordTypeName = result[0].RecordType_DeveloperName__c; |
| | | var EstimateTarget = result[0].Estimate_Target__c; |
| | | |
| | | var url = ''; |
| | | if (EstimateTarget == "经销商" && (RecordTypeName == "NewMaintenance_Contract" || RecordTypeName == "VM_Contract")) { |
| | | url = "/apex/MoreMaintenanceContractPop?Id=" + MaintenanceContractId + "&RecordTypeName=" + RecordTypeName; |
| | | } else { |
| | | url = "http://powerbi.olympus.com.cn/Home/Login"; |
| | | } |
| | | window.open(url, '_bank'); |
| | | console.log(RecordTypeName); |
| | | console.log(EstimateTarget); |
| | | var url = ''; |
| | | if (EstimateTarget == "经销商" && (RecordTypeName == "NewMaintenance_Contract" || RecordTypeName == "VM_Contract")) { |
| | | url = "/apex/MoreMaintenanceContractPop?Id=" + MaintenanceContractId + "&RecordTypeName=" + RecordTypeName; |
| | | } else { |
| | | url = "http://powerbi.olympus.com.cn/Home/Login"; |
| | | } |
| | | window.open(url, '_bank'); |
| | | }) |
| | | } |
| | | } |
copy from force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
copy to force-app/main/default/lwc/lexCustomAnewMaintenance copy/lexCustomAnewMaintenance.html
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import selectMaintenanceContractEstimate from '@salesforce/apex/otherButtonMaintenanceContractCtl.selectMaintenanceContractEstimate'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCustomAnewMaintenance extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | StatusC; |
| | | RecordTypeId; |
| | | URFContractC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.StatusC = result.StatusC; |
| | | this.URFContractC = result.URFContractC; |
| | | |
| | | this.CustomAnew(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | //中止 |
| | | CustomAnew() { |
| | | if (this.StatusC != "引合中") { |
| | | this.ShowToastEvent("维修合同不是询价中的状态,不能再报价", "error") |
| | | // alert("维修合同不是询价中的状态,不能再报价"); |
| | | } else { |
| | | init().then(result => { |
| | | if (result.length == 1) { |
| | | if (this.RecordTypeId == "01210000000gTYq") { |
| | | //URF限次合同2期 LY 20220902 start |
| | | if (this.URFContractC == true) { |
| | | window.open("/apex/SelectAssetEstimateURF?copyid=" + ids[0], "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimateVM?copyid=" + ids[0], "_top"); |
| | | } |
| | | //URF限次合同2期 LY 20220902 end |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?copyid=" + ids[0], "_top"); |
| | | } |
| | | |
| | | } else { |
| | | this.ShowToastEvent('请选择一个报价', "error") |
| | | // alert('请选择一个报价'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | }).then(repList => { |
| | | if (repList != null && repList.length > 0) { |
| | | var rp = repList[0]; |
| | | if (rp.Status__c != "草案中" && |
| | | rp.Status__c != "1.受理完毕(SAP待发送)" && |
| | | rp.Status__c != "4.修理品返送阶段" |
| | | ) { |
| | | if (rp.Status__c != "草案中" && rp.Status__c != "1.受理完毕(SAP待发送)" && rp.Status__c != "4.修理品返送阶段") { |
| | | this.ShowToastEvent("不是草案中,不能删除", "error") |
| | | } else if (rp.Status__c == "4.修理品返送阶段" && |
| | | (rp.SAP_Transfer_time__c != undefined || rp.Repair_Ordered_Date__c != undefined) |
| | | ) { |
| | | } else if (rp.Status__c == "4.修理品返送阶段" && (rp.SAP_Transfer_time__c != undefined || rp.Repair_Ordered_Date__c != undefined)) { |
| | | this.ShowToastEvent("已经发送过SAP,不能删除", "error") |
| | | } else if (this.userID.substring(0, 15) != rp.CreatedById.substring(0, 15) && this.userID.substring(0, 15) != rp.Acc_OwnerId__c.substring(0, 15) && this.userID.substring(0, 15) != rp.FSE_ownerid__c.substring(0, 15)) { |
| | | this.ShowToastEvent("不是所有人、创建人或FSE主负责人,不能删除", "error") |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 继续新服务合同 |
| | | CustomNewCopy2() { |
| | | if (this.notRenewC) { |
| | | this.ShowToastEvent("请联系服务商品部!", "error"); |
| | | // alert("请联系服务商品部!"); |
| | | } else { |
| | | window.open("/" + this.Id + "/e?clone=1&Name=&00N10000002Dx5D=&00N10000002Dx5S=%e5%bc%95%e5%90%88%e4%b8%ad&00NO00000010sDc=&CF00NO00000010hyI=&CF00NO00000010hyI_lkid=&CF00NO00000010hyX=&CF00NO00000010hyX_lkid=&CF00NO00000010hyN=&CF00NO00000010hyN_lkid=&RecordType=01210000000gTYq&00N10000002pmOp=&00N10000006gZDd=&00N10000006gZDe=&00NO00000010hy4=&00N10000002Dx4j=&00N10000002Dx4m=&00N10000002Dx4w=&00N10000002Dx4k=&00N10000002Dx5J=&00N10000002Dx5M=&00N10000002Dx4i=&00N10000002Dx4h=&00N10000002Dx5K=&00N10000003OXdT=&00N100000048zfn=&00N10000002FMsq=&00N10000003OlGF=&00N10000002Dx4r=&00N100000047AY1=&00N100000047AYB=&00N100000047AY6=&00N10000003PCeB=&00N10000005HBNe=&00N10000006plAl=&00N10000002Dx5C=&retURL=%2F" + this.Id + "&saveURL=%2Fapex/SaveMaintenanceByCopy?mid=" + this.Id + "&CF00N100000048Paw=" + this.Name + "&CF00N100000048Paw_lkid=" + this.Id, "_blank"); |
| | | window.open("/" + this.Id + "/e?clone=1&Name=&00N10000002Dx5D=&00N10000002Dx5S=%e5%bc%95%e5%90%88%e4%b8%ad&00NO00000010sDc=&CF00NO00000010hyI=&CF00NO00000010hyI_lkid=&CF00NO00000010hyX=&CF00NO00000010hyX_lkid=&CF00NO00000010hyN=&CF00NO00000010hyN_lkid=&RecordType=01210000000gTYq&00N10000002pmOp=&00N10000006gZDd=&00N10000006gZDe=&00NO00000010hy4=&00N10000002Dx4j=&00N10000002Dx4m=&00N10000002Dx4w=&00N10000002Dx4k=&00N10000002Dx5J=&00N10000002Dx5M=&00N10000002Dx4i=&00N10000002Dx4h=&00N10000002Dx5K=&00N10000003OXdT=&00N100000048zfn=&00N10000002FMsq=&00N10000003OlGF=&00N10000002Dx4r=&00N100000047AY1=&00N100000047AYB=&00N100000047AY6=&00N10000003PCeB=&00N10000005HBNe=&00N10000006plAl=&00N10000002Dx5C=&retURL=%2F{!Maintenance_Contract__c.Id}&saveURL=%2Fapex/SaveMaintenanceByCopy?mid=" + this.Id + "&CF00N100000048Paw=" + this.Name + "&CF00N100000048Paw_lkid=" + this.Id, "_blank"); |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | |
| | | export default class LexCustomNewMCMaintenance extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | StatusC; |
| | | IsRecognitionModelC; |
| | | RecordTypeId; |
| | | URFContractC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | this.IsRecognitionModelC = result.IsRecognitionModelC; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.URFContractC = result.URFContractC; |
| | | |
| | | this.CustomNewMC(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建新服务合同报价 |
| | | CustomNewMC() { |
| | | if ( this.StatusC != "引合中") { |
| | | alert("维修合同不是询价中的状态,不能新建报价"); |
| | | } else { |
| | | //维修合同新建报价时,如果是先款对象,弹出对话框提示 thh 20220304 start |
| | | if (this.IsRecognitionModelC == 1) { |
| | | if (!confirm("该经销商为先款对象,是否继续新建报价?")) { |
| | | return; |
| | | } |
| | | } |
| | | //维修合同新建报价时,如果是先款对象,弹出对话框提示 thh 20220304 end |
| | | if (this.RecordTypeId == "01210000000gTYq") { |
| | | if (this.URFContractC == "0") { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimateURF?mcid=" + this.Id, "_top"); |
| | | } |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
copy from force-app/main/default/lwc/lexCustomDelete/lexCopyRepair.html
copy to force-app/main/default/lwc/lexCustomNewMaintenance copy/lexCustomNewMaintenance.html
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCustomNewMaintenance extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | StatusC; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.CustomNew(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建维修合同报价 |
| | | CustomNew() { |
| | | if (this.StatusC != "引合中") { |
| | | this.ShowToastEvent("维修合同不是询价中的状态,不能新建报价", "error"); |
| | | // alert("维修合同不是询价中的状态,不能新建报价"); |
| | | } else { |
| | | if (this.RecordTypeId == "01210000000gTYq") { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | }).then(repairs => { |
| | | if (repairs != null && repairs.length > 0) { |
| | | var rp = repairs[0]; |
| | | if (rp.Return_Without_Repair_IF__c == 'true') { |
| | | console.log(rp); |
| | | if (rp.Return_Without_Repair_IF__c == true) { |
| | | this.ShowToastEvent("未修理归还的修理不允许减价申请", "error"); |
| | | // alert("未修理归还的修理不允许减价申请"); |
| | | return; |
| | | } else { |
| | | if (rp.Return_Without_Repair__c == 'true') { |
| | | if (rp.Return_Without_Repair__c == true) { |
| | | this.ShowToastEvent("已经申请未修理返回,如果需要继续修理请取消\"未修理归还申请\"的勾选后再进行减价申请操作", "error"); |
| | | // alert("已经申请未修理返回,如果需要继续修理请取消\"未修理归还申请\"的勾选后再进行减价申请操作"); |
| | | return; |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | }) |
| | | location.reload(); |
| | | }) |
| | | } |
| | | |
| New file |
| | |
| | | <template> |
| | | <div class="lexESignAcceptanceHospital" if:true={IsLoding}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"> </lightning-spinner> </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ESignController.ESignController'; |
| | | import OcsmResult from '@salesforce/apex/ESignController.OcsmResult'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexESignAcceptanceFranchiser extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | IsLoading = true; |
| | | profileId = '';//当前登录人的权限 |
| | | GrouppurchasePCL = null; //是否集采询价 |
| | | OCMManProvinceCus = null; //OCSM管理省 |
| | | agencyAutoSignUpStatus = null; //经销商状态 |
| | | agencySignUpDate = null;// 经销商签收日 |
| | | userId; // 当前登录人 |
| | | systemProfileId;//系统管理员 |
| | | OBA4_sinFor;//OBA4_签收管理 |
| | | |
| | | @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.agencyAutoSignUpStatus); |
| | | this.GrouppurchasePCL = result.GrouppurchasePCL; |
| | | this.OCMManProvinceCus = result.OCMManProvinceCus; |
| | | this.agencyAutoSignUpStatus = result.agencyAutoSignUpStatus; |
| | | this.agencySignUpDate = result.agencySignUpDate; |
| | | this.profileId = result.profileId; |
| | | this.userId = result.userId; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.OBA4_sinFor = result.OBA4_sinFor; |
| | | this.IsLoading = false; |
| | | this.AcceptanceFranchiser(); |
| | | }) |
| | | } |
| | | //签收单 验收确认(经销商) |
| | | AcceptanceFranchiser(){ |
| | | var Group_purchase_PCL ; |
| | | if(this.GrouppurchasePCL == 1){ |
| | | Group_purchase_PCL = '集采课'; |
| | | }else{ |
| | | Group_purchase_PCL = this.OCMManProvinceCus; |
| | | } |
| | | //检索OCSM管理省 上的营业管理部担当 |
| | | OcsmResult({GrouppurchasePCL:Group_purchase_PCL}).then(res=>{ |
| | | //营业管理部担当id |
| | | var salesManage; |
| | | console.log(res[0].SalesManage__c); |
| | | salesManage = res[0].SalesManage__c; |
| | | //电子签收单id |
| | | var id = this.recordId |
| | | //new 一个对象 |
| | | var eSignForm; |
| | | //经销商状态 |
| | | var status = this.agencyAutoSignUpStatus; |
| | | if (salesManage || this.profileId == this.systemProfileId) { |
| | | if (salesManage != this.userId && this.profileId != this.systemProfileId && this.profileId != this.OBA4_sinFor) { |
| | | // alert('您只能审批营业管理部担当是自己的签收单!'); |
| | | this.showToast("您只能审批营业管理部担当是自己的签收单!","error"); |
| | | return; |
| | | } else if (status != '申请中') { |
| | | // alert('您只能审批申请中的签收单!') |
| | | this.showToast("您只能审批申请中的签收单!","error"); |
| | | return; |
| | | } else if (this.agencySignUpDate == undefined || this.agencySignUpDate == null || this.agencySignUpDate == "") { |
| | | // alert('经销商签收日为空时,不可以确认!'); |
| | | this.showToast("经销商签收日为空时,不可以确认!","error"); |
| | | return; |
| | | }else{ |
| | | window.open ('/apex/AgencyConfirmPage?id='+this.recordId, '经销商确认', |
| | | 'height=440, width=750, top=150, left=300, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| | |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ESignController.ESignController'; |
| | | import OcsmResult from '@salesforce/apex/ESignController.OcsmResult'; |
| | | import UserInfo_Owner from '@salesforce/apex/ESignController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class Submit extends LightningElement { |
| | | export default class lexESignAcceptanceHospital extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | profileId = ''; |
| | | arrMessage = []; |
| | | RCManagerId = null; |
| | | GrouppurchasePCL = null; |
| | | OCMManProvinceCus = null; |
| | | HPSignUpStatus = null; |
| | | SalesRootFormula = null; |
| | | HPSignUpDate = null; |
| | | salesManage = null; |
| | | profileId = '';//当前登录人的权限 |
| | | GrouppurchasePCL = null; //是否集采询价 |
| | | OCMManProvinceCus = null; //OCSM管理省 |
| | | HPSignUpStatus = null; //医院审批状态 |
| | | SalesRootFormula = null; // 销售渠道(文本) |
| | | HPSignUpDate = null;// 医院签收日 |
| | | userId; // 当前登录人 |
| | | systemProfileId;//系统管理员 |
| | | OBA4_sinFor;//OBA4_签收管理 |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | // this.RCManagerId = result.RCManagerId; |
| | | this.GrouppurchasePCL = result.GrouppurchasePCL; |
| | | this.OCMManProvinceCus = result.OCMManProvinceCus; |
| | | this.HPSignUpStatus = result.HPSignUpStatus; |
| | | this.SalesRootFormula = result.SalesRootFormula; |
| | | this.HPSignUpDate = result.HPSignUpDate; |
| | | this.profileId = result.profileId.slice(0,15); |
| | | this.profileId = result.profileId; |
| | | this.userId = result.userId; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.OBA4_sinFor = result.OBA4_sinFor; |
| | | this.IsLoading = false; |
| | | this.AcceptanceHospital(); |
| | | }) |
| | | } |
| | | //签收单 验收确认(医院) |
| | | AcceptanceHospital(){ |
| | | //先判断是否为集采课 |
| | | // var Group_purchase_PCL ; |
| | | // var Group_purchase_PCLFlag = "{!eSignForm__c.Group_purchase_PCL__c}"; |
| | | // if(Group_purchase_PCLFlag == 1){ |
| | | // Group_purchase_PCL = '集采课'; |
| | | // }else{ |
| | | // Group_purchase_PCL = "{!eSignForm__c.OCM_man_province_cus__c}"; |
| | | // } |
| | | console.log(this.GrouppurchasePCL,this.OCMManProvinceCus,'111111111') |
| | | var Group_purchase_PCL ; |
| | | // if(this.GrouppurchasePCL == 1){ |
| | | // Group_purchase_PCL = '集采课'; |
| | | // }else{ |
| | | Group_purchase_PCL = this.OCMManProvinceCus; |
| | | // } |
| | | if(this.GrouppurchasePCL == 1){ |
| | | Group_purchase_PCL = '集采课'; |
| | | }else{ |
| | | Group_purchase_PCL = this.OCMManProvinceCus; |
| | | } |
| | | //检索OCSM管理省 上的营业管理部担当 |
| | | // var sql = "select id, Name, SalesManage__c from OCM_Management_Province__c where Name = "+"\'"+Group_purchase_PCL+"\'"; |
| | | // var ocsmResult = sforce.connection.query(sql); |
| | | // var ocsm = ocsmResult.getArray("records"); |
| | | // //营业管理部担当id |
| | | // var salesManage; |
| | | // if (ocsm) { |
| | | // salesManage = ocsm[0].SalesManage__c; |
| | | // } |
| | | console.log(Group_purchase_PCL,this.profileId,'77777777777') |
| | | OcsmResult({GrouppurchasePCL:Group_purchase_PCL}).then(res=>{ |
| | | console.log(res) |
| | | //营业管理部担当id |
| | | var salesManage; |
| | | salesManage = res[0].SalesManage__c; |
| | | //电子签收单id |
| | |
| | | var status = this.HPSignUpStatus; |
| | | //销售渠道 |
| | | var sales_Root_Formula = this.SalesRootFormula; |
| | | if (salesManage || this.profileId == '00e10000000Y3o5') { |
| | | UserInfo_Owner().then(res => { |
| | | var userId = ''; |
| | | userId = res.id; |
| | | if (salesManage != userId && this.profileId != '00e10000000Y3o5' && this.profileId != '00e10000000s2cp') { |
| | | alert('您只能审批营业管理部担当是自己的签收单!'); |
| | | return; |
| | | } else if (status != '申请中') { |
| | | alert('您只能审批申请中的签收单!') |
| | | return; |
| | | } else if (this.HPSignUpDate) { |
| | | alert('医院签收日为空时,不可以确认!'); |
| | | return; |
| | | }else{ |
| | | if (salesManage || this.profileId == this.systemProfileId) { |
| | | if (salesManage != this.userId && this.profileId != this.systemProfileId && this.profileId != this.OBA4_sinFor) { |
| | | // alert('您只能审批营业管理部担当是自己的签收单!'); |
| | | this.showToast("您只能审批营业管理部担当是自己的签收单!","error"); |
| | | return; |
| | | } else if (status != '申请中') { |
| | | // alert('您只能审批申请中的签收单!') |
| | | this.showToast("您只能审批申请中的签收单!","error"); |
| | | return; |
| | | } else if (this.HPSignUpDate == undefined) { |
| | | // alert('医院签收日为空时,不可以确认!'); |
| | | this.showToast("医院签收日为空时,不可以确认!","error"); |
| | | return; |
| | | }else{ |
| | | if(sales_Root_Formula == 'OCM直接販売'){ |
| | | window.open ('/apex/HPDirectSalesConfirmPage?id='+this.recordId, '医院确认', |
| | | 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | window.open ('/apex/HPConfirmPage?id='+this.recordId, '医院确认', |
| | | 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | // var foo = function() { |
| | | // //当前用户登录id |
| | | // var userId = "{!CASESAFEID($User.Id)}"; |
| | | // //当前用户简档id |
| | | // var ProfileId = "{!$Profile.Id}"; |
| | | // // var RC_Manager = "{!eSignForm__c.RC_ManagerId__c }"; |
| | | // //先判断是否为集采课 |
| | | // var Group_purchase_PCL ; |
| | | // var Group_purchase_PCLFlag = "{!eSignForm__c.Group_purchase_PCL__c}"; |
| | | // if(Group_purchase_PCLFlag == 1){ |
| | | // Group_purchase_PCL = '集采课'; |
| | | // }else{ |
| | | // Group_purchase_PCL = "{!eSignForm__c.OCM_man_province_cus__c}"; |
| | | // } |
| | | // //检索OCSM管理省 上的营业管理部担当 |
| | | // var sql = "select id, Name, SalesManage__c from OCM_Management_Province__c where Name = "+"\'"+Group_purchase_PCL+"\'"; |
| | | // var ocsmResult = sforce.connection.query(sql); |
| | | // var ocsm = ocsmResult.getArray("records"); |
| | | // //营业管理部担当id |
| | | // var salesManage; |
| | | // if (ocsm) { |
| | | // salesManage = ocsm[0].SalesManage__c; |
| | | // } |
| | | |
| | | // //电子签收单id |
| | | // var id = "{!eSignForm__c.Id}"; |
| | | // //new 一个对象 |
| | | // var eSignForm; |
| | | // //医院状态 |
| | | // var status = "{!eSignForm__c.HPSignUpStatus__c}"; |
| | | // //销售渠道 |
| | | // var sales_Root_Formula = "{!eSignForm__c.Sales_Root_Formula__c}"; |
| | | |
| | | // if (salesManage || ProfileId == '00e10000000Y3o5') { |
| | | // if (salesManage != userId && ProfileId != '00e10000000Y3o5' && ProfileId != '00e10000000s2cp') { |
| | | // alert('您只能审批营业管理部担当是自己的签收单!'); |
| | | // return; |
| | | // } else if (status != '申请中') { |
| | | // alert('您只能审批申请中的签收单!') |
| | | // return; |
| | | // } else if (!'{!eSignForm__c.HPSignUpDate__c}') { |
| | | // alert('医院签收日为空时,不可以确认!'); |
| | | // return; |
| | | // }else{ |
| | | // if(sales_Root_Formula == 'OCM直接販売'){ |
| | | // window.open ('/apex/HPDirectSalesConfirmPage?id='+"{!eSignForm__c.Id}", '医院确认', |
| | | // 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | // }else{ |
| | | // window.open ('/apex/HPConfirmPage?id='+"{!eSignForm__c.Id}", '医院确认', |
| | | // 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | // foo(); |
| | | } |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import init from '@salesforce/apex/ESignController.ESignController'; |
| | | |
| | | export default class lexESignFormAttachment extends LightningElement { |
| | | @api recordId; |
| | | id; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //签收单 查看附件 |
| | | connectedCallback () { |
| | | this.IsLoading = false; |
| | | this.Attachment(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | Attachment(){ |
| | | window.open( `/apex/eSignFormAttachment?parentId=${this.recordId}`); |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.id = result.Id |
| | | window.open( `/apex/eSignFormAttachment?parentId=${this.id}`); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | // var From= function(){ |
| | | // window.open( "/apex/eSignFormAttachment?parentId={!URLENCODE(eSignForm__c.Id)}"); |
| | | // } |
| | | // From(); |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | import init from '@salesforce/apex/EquipmentRentalPicturePDFController.init'; |
| | | export default class lexEquipmentRentalPicturePDF extends LightningElement { |
| | | @api recordId; |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | //console.log('result.ShipmentRequestedCnt===' + result.ShipmentRequestedCnt) |
| | | if( result.ShipmentRequestedCnt > 0){ |
| | | //console.log('result.shipmentRequestedCnt===' + result.shipmentRequestedCnt) |
| | | if( result.shipmentRequestedCnt > 0){ |
| | | console.log(result.pagelength); |
| | | for(var i =0; i<result.pagelength; i++){ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.open('/apex/FixtureRentalPicturePDF?raid='+ this.recordId +'&page=' + i); |
| | | } |
| | | }else{ |
| | | alert('当前的申请单中没有已出库指示的配套。'); |
| | | this.showToast('当前的申请单中没有已出库指示的配套。','error'); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(err=>{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | console.log(err); |
| | | console.log('initerr===='+err); |
| | | }) |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | } |
| | |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | RecordType; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.RecordType = result.RecordType; |
| | | |
| | | this.insPageBtn(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 报告书明细编辑 |
| | | insPageBtn() { |
| | | var url; |
| | | if (this.RecordTypeId == '01210000000aLii') { |
| | | if (this.RecordType == 'ContractInspection') { |
| | | url = '/apex/OFSInsReportLayoutForVm'; |
| | | } else { |
| | | url = '/apex/OFSInsReportLayout'; |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | import init from '@salesforce/apex/loanerArrangedEmailController.init'; |
| | | import getRentalApplyEquipmentSet from '@salesforce/apex/loanerArrangedEmailController.getRentalApplyEquipmentSet'; |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(this.recordId); |
| | | let statusArr = result.statusList; |
| | | console.log('result==='+JSON.stringify(result)); |
| | | if(result != null) { |
| | | if( result.WeiAssignedCnt > 0 ) { |
| | | alert("申请单内存在未分配的配套,请分配备品或分割申请单"); |
| | | }else if(result.CampaignStatus == "取消") { |
| | | alert("学会取消,不可出库指示"); |
| | | }else if (result.RaStatus == "已出库指示" && result.AssignedNotShipment == 0){ |
| | | alert("所有的借出备品Set一览都进行过出库指示了"); |
| | | }else if (result.AssignedNotShipment == 0) { |
| | | alert("没有可以出库指示的明细"); |
| | | }else if (result.DemoPurpose1 == "长期借出" && result.ContractPdfUpdated == 0){ |
| | | alert("长期借出时,必须先上传契约书"); |
| | | }else if (result.RepairId != '' && (result.RepairFinalInspectionDateF != null && result.RepairFinalInspectionDateF != '') || (result.RCReturnToOffice != null && result.RCReturnToOffice != '')){ |
| | | alert("修理有最终检测日或修理品返送日,不可出库指示"); |
| | | }else if (result.IFApproved == "true" && (result.MeetingApprovedNo == null || result.MeetingApprovedNo == "")){ |
| | | alert("没有决裁号的,暂不能出借,请更新裁决信息。"); |
| | | }else if (result.IFApproved == "true" && result.MeetingApprovedNo != "" && result.StatusList.indexOf(records[0].Approved_Status__c) != -1){ |
| | | alert("已申请决裁但决裁状态不符合条件。"); |
| | | }else { |
| | | if( result.weiAssignedCnt > 0 ) { |
| | | this.showToast("申请单内存在未分配的配套,请分配备品或分割申请单",'error'); |
| | | }else if(result.campaignStatus == "取消") { |
| | | this.showToast("学会取消,不可出库指示",'error'); |
| | | }else if (result.raStatus == "已出库指示" && result.assignedNotShipment == 0){ |
| | | this.showToast("所有的借出备品Set一览都进行过出库指示了",'error'); |
| | | }else if (result.assignedNotShipment == 0) { |
| | | this.showToast("没有可以出库指示的明细",'error'); |
| | | }else if (result.demoPurpose1 == "长期借出" && result.contractPdfUpdated == false){ |
| | | this.showToast("长期借出时,必须先上传契约书",'error'); |
| | | }else if (result.repairId != '' && (result.repairFinalInspectionDateF != null && result.repairFinalInspectionDateF != '') || (result.rCReturnToOffice != null && result.rCReturnToOffice != '')){ |
| | | this.showToast("修理有最终检测日或修理品返送日,不可出库指示",'error'); |
| | | }else if (result.iFApproved == true && (result.meetingApprovedNo == null || result.meetingApprovedNo == "")){ |
| | | this.showToast("没有决裁号的,暂不能出借,请更新裁决信息。",'error'); |
| | | }else if (result.iFApproved == true && result.meetingApprovedNo != "" && statusArr.indexOf(result.approvedStatus) != -1){ |
| | | this.showToast("已申请决裁但决裁状态不符合条件。",'error'); |
| | | }else{ |
| | | approvalCheck({ |
| | | rentalApplyId: this.recordId |
| | | }).then(res=>{ |
| | | if (res != '1') { |
| | | alert(rs1); |
| | | } else { |
| | | }).then(res1 =>{ |
| | | if (res1 != '1') { |
| | | this.showToast(res1,'error'); |
| | | }else{ |
| | | //bp2 var rs2 = sforce.apex.execute("RentalApplyWebService", "reserve", {rentalApplyId: raid}); |
| | | //bp2 if (rs2 != '1') { |
| | | //bp2 alert(rs2); |
| | | //bp2 } else { |
| | | //var rs1 = sforce.apex.execute("RentalApplyWebService", "setShipment_request", {raid : "{!Rental_Apply__c.Id}"}); |
| | | |
| | | console.log('setShipment_request=='); |
| | | setShipment_request({ |
| | | raid: this.recordId |
| | | }).then(res=>{ |
| | | if (res == "状态更新到已出库指示") { |
| | | alert("状态更新到已出库指示"); |
| | | console.log('res==',res); |
| | | if (res == "状态更新到已出库指示") { |
| | | this.showToast("状态更新到已出库指示",'success'); |
| | | print(); |
| | | setTimeout(function() { |
| | | location.href = "/{!Rental_Apply__c.Id}"; |
| | | },100); |
| | | // setTimeout(function() { |
| | | // location.href = "/{!Rental_Apply__c.Id}"; |
| | | // },100); |
| | | }else { |
| | | alert(res); |
| | | this.showToast(res,'error'); |
| | | } |
| | | }).catch(e=>{ |
| | | console.log('approvalCheck==='+e); |
| | |
| | | var Seconds = fixTime(date.getSeconds()); |
| | | return date.getFullYear() + "-" + Month + "-" + Day + "T" + Time; |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import updateForSubmitButton from '@salesforce/apex/ReportController.updateForSubmitButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/LexLostSubmitApprovalController.LexLostSubmitApprovalController'; |
| | | import submit from '@salesforce/apex/LexLostSubmitApprovalController.submit'; |
| | | |
| | | // 遗失报告 提交待审核 |
| | | export default class LexLostSubmitApproval extends LightningElement { |
| | | @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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | this.IsLoading = false; |
| | | // this.submit(); |
| | | init({recordId:this.recordId}) |
| | | .then(result=>{ |
| | | console.log("LexConsumablesLost------>>>",result) |
| | | |
| | | if (result.statusTf == "填写完毕" || result.statusTf == "申请中" || result.statusTf == "已批准") { |
| | | this.showToast('请确认遗失报告状态,已经提交过的申请,不能重复提交','warning') |
| | | return; |
| | | } |
| | | |
| | | if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | | return; |
| | | } |
| | | |
| | | // ----------------------------------------------------------------------------------------------------- |
| | | if (result.reportDetailList.length > 0) { |
| | | var qianpinDate = new Date(result.reportDetailList[0].Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c); |
| | | for (var i = 1; i < result.reportDetailList.length; i++) { |
| | | var d = new Date(result.reportDetailList[i].Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c); |
| | | if(d < qianpinDate){ |
| | | qianpinDate = d; |
| | | } |
| | | } |
| | | qianpinDate.setDate(qianpinDate.getDate() + 90); |
| | | var d = '' + qianpinDate.getFullYear()+'/' + (qianpinDate.getMonth()+1) + '/' + qianpinDate.getDate(); |
| | | this.showToast('请您的上级领导于' + d + '前完成遗失报告审批,否则备品自动断念,遗失报告自动取消。','warning'); |
| | | } |
| | | // ----------------------------------------------------------------------------------------------------- |
| | | |
| | | this.submitApproval() |
| | | }) |
| | | .catch(e=>{console.log(e)}) |
| | | .finally(()=>{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | submitApproval(){ |
| | | submit({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if(result != '1'){ |
| | | this.showToast(result,"error"); |
| | | return |
| | | } |
| | | this.updateRecordView(this.recordId); |
| | | // this.showToast("提交成功","success"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.InchargeStaffEmailC = result.InchargeStaffEmailC; |
| | | this.Name = result.Name; |
| | | this.HPNameC = result.HPNameC; |
| | | this.DeliveredProductC = result.DeliveredProductC; |
| | | this.RepairProductSerialNoC = result.RepairProductSerialNoC; |
| | | this.ServiceRepairNoC = result.ServiceRepairNoC; |
| | | this.RepairFirstestimatedDateC = result.RepairFirstestimatedDateC; |
| | | this.RepairEstimatedDateC = result.RepairEstimatedDateC; |
| | | this.RCInformationC = result.RCInformationC; |
| | | this.userEmail = result.userEmail; |
| | | this.InchargeStaffEmailC = result.InchargeStaffEmailC == undefined ? "" : result.InchargeStaffEmailC; |
| | | this.Name = result.Name == undefined ? "" : result.Name; |
| | | this.HPNameC = result.HPNameC == undefined ? "" : result.HPNameC; |
| | | this.DeliveredProductC = result.DeliveredProductC == undefined ? "" : result.DeliveredProductC; |
| | | this.RepairProductSerialNoC = result.RepairProductSerialNoC == undefined ? "" : result.RepairProductSerialNoC; |
| | | this.ServiceRepairNoC = result.ServiceRepairNoC == undefined ? "" : result.ServiceRepairNoC; |
| | | this.RepairFirstestimatedDateC = result.RepairFirstestimatedDateC == undefined ? "" : result.RepairFirstestimatedDateC; |
| | | this.RepairEstimatedDateC = result.RepairEstimatedDateC == undefined ? "" : result.RepairEstimatedDateC; |
| | | this.RCInformationC = result.RCInformationC == undefined ? "" : result.RCInformationC; |
| | | this.userEmail = result.userEmail == undefined ? "" : result.userEmail; |
| | | |
| | | this.mailMessege(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | // 报价附件更新的邮件通知 |
| | | mailMessege() { |
| | | var Link = "https://ocsm--partial.sandbox.my.salesforce.com/" + this.Id; |
| | | console.log(Link); |
| | | |
| | | location.href = 'mailto:' + this.InchargeStaffEmailC + |
| | | '?bcc=' + this.userEmail + |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // OCSM不要报告 |
| | |
| | | if (!confirm("不要报告后无法撤回,是否继续?")) { |
| | | return; |
| | | } |
| | | |
| | | if (this.OCSMAdministrativeReportNumberC != undefined || |
| | | this.OCSMAdministrativeReportDateC != undefined) { |
| | | this.ShowToastEvent("已经报告的QIS,不可以点击OCSM不要报告。", "error") |
| | | // alert("已经报告的QIS,不可以点击OCSM不要报告。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.AwareDateC != undefined) { |
| | | updateRepair({ |
| | | recordId: this.Id |
| | | }).catch(error => { |
| | | if (error.body.pageErrors.length > 0) { |
| | | var errmsg = error.body.pageErrors[0].message.toString(); |
| | | this.ShowToastEvent(errmsg.join("\n"), "error") |
| | | // alert(errmsg.join("\n")); |
| | | return; |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } |
| | | window.location.reload(); |
| | | }) |
| | | window.location.reload(); |
| | | } else { |
| | | this.ShowToastEvent("没有AwareDate或已经OCSM行政报告,请确认。", "error") |
| | | // alert("没有AwareDate或已经OCSM行政报告,请确认。"); |
| | | return; |
| | | } |
| | | } |
| | |
| | | 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 { updateRecord } from 'lightning/uiRecordApi'; |
| | | import init from '@salesforce/apex/QISReportController.initForlexRCRecievedButton'; |
| | | import updateQis from '@salesforce/apex/QISReportController.updateQisForRCRecieved'; |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/buttonQISReportCtl.init'; |
| | | import updateQisForRCRecieved from '@salesforce/apex/buttonQISReportCtl.updateQisForRCRecieved'; |
| | | |
| | | export default class lexOCSMNogoods extends LightningElement { |
| | | @api recordId; |
| | | err; |
| | | IsLoading = true; |
| | | qisReportId; |
| | | qisStatus; |
| | | isAEProfile; |
| | | isCNBuy; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | userId; |
| | | QISStatusC; |
| | | isAEProfileC; |
| | | isCNBuyC; |
| | | isPAEProfileC; |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.qisReportId = result.Id; |
| | | this.qisStatus = result.qIStatus; |
| | | this.isAEProfile = result.isAEProfile; |
| | | this.isCNBuy = result.isCNBuy; |
| | | console.log('this.qisStatus='+this.qisStatus); |
| | | if (this.qisStatus!='RC检测申请') { |
| | | const evt = new ShowToastEvent({ |
| | | title : 'OCM服务本部已经收到实物', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.userId = result.userId; |
| | | this.QISStatusC = result.QISStatusC; |
| | | this.isAEProfileC = result.isAEProfileC; |
| | | this.isPAEProfileC = result.isPAEProfileC; |
| | | this.isCNBuyC = result.isCNBuyC; |
| | | |
| | | this.OCSMNogoods(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | }else{ |
| | | if (this.isAEProfile == null || this.isPAEProfile == null || this.isCNBuy != 'true') { |
| | | const evt = new ShowToastEvent({ |
| | | title : '安全信息未判定,请联系质量法规部', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | }else{ |
| | | this.updateQisSubmit(); |
| | | } |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | updateQisSubmit(){ |
| | | updateQis({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | |
| | | console.log('result'+result); |
| | | this.err = result; |
| | | if (result!='成功') { |
| | | const evt = new ShowToastEvent({ |
| | | title : '更新失败', |
| | | message: this.err, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | //OCSM无实物送达 |
| | | OCSMNogoods() { |
| | | if (this.QISStatusC != 'RC检测申请') { |
| | | this.ShowToastEvent("OCM服务本部已经收到实物", "error"); |
| | | } else { |
| | | if ((this.isAEProfileC == undefined || this.isPAEProfileC == undefined) && this.isCNBuyC != 'true') { |
| | | this.ShowToastEvent("安全信息未判定,请联系质量法规部", "error"); |
| | | var btns = document.getElementsByName('rc_recieved'); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | } else { |
| | | updateQisForRCRecieved({ |
| | | QId: this.Id, |
| | | uid: this.userId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | alert(result); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.updateRecordView(this.recordId); |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // 减价申请 |
| | | // OSH无实物送达 |
| | | OSHNogoods() { |
| | | if (this.QISStatusC != 'OSH检测申请' && this.QISStatusC != '完毕') { |
| | | this.ShowToastEvent("OSH已经收到实物", "error") |
| | | // alert('OSH已经收到实物'); |
| | | } else { |
| | | updateOSHNogoods({ |
| | | Id: this.Id, |
| | |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } |
| | | location.reload(); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 合同复核 |
| | |
| | | if (this.oldIsRecognitionModelC) { |
| | | if (this.uploadToRMTimeC == null) { |
| | | this.ShowToastEvent('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能复核。', "error") |
| | | // alert('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能复核。'); |
| | | return; |
| | | } else { |
| | | if (!this.IsRecognitionModelTrueC) { |
| | | this.ShowToastEvent('当前维修合同没有完成认款,不能进行复核。', "error") |
| | | // alert('当前维修合同没有完成认款,不能进行复核。'); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var status = this.MCApprovalStatusC; |
| | | if (status != 'Draft' && status != 'Reject' && status != undefined) { |
| | | this.ShowToastEvent('复核已经提交,请确认状态。', "success") |
| | | // alert('复核已经提交,请确认状态。'); |
| | | this.ShowToastEvent('复核已经提交,请确认状态。', "error") |
| | | return; |
| | | } |
| | | var con_no = this.ContractprintCompletedC; |
| | | if (con_no == '') { |
| | | if (con_no == undefined) { |
| | | this.ShowToastEvent('合同盖章完毕为空,不能提交合同复核申请。', "error") |
| | | // alert('合同盖章完毕为空,不能提交合同复核申请。'); |
| | | return; |
| | | } |
| | | if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | |
| | | }).catch(error => { |
| | | if (error.body.pageErrors[0] != null) { |
| | | var errmsg = error.body.pageErrors[0].message.toString(); |
| | | // alert(errmsg + '_sys'); |
| | | this.ShowToastEvent(errmsg + '_sys', "error") |
| | | return; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | |
| | | export default class LexPrintInspectupReportInspectupPlan extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | |
| | | @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.PrintInspectupReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 报告书明细编辑 |
| | | PrintInspectupReport() { |
| | | window.open("/apex/PrintInspectupReport?id=" + this.Id, "_blank", "height=700px,innerHeight=700,width=700px,innerWidth=700px,top=100,left=300", "scrollbars=auto,resizable=yes,modal=false,alwaysRaised=yes"); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | console.log('result2='+this.paeId); |
| | | } |
| | | var url = ''; |
| | | if (result!=null){ |
| | | if (result!=null&& this.paeId!=null){ |
| | | url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ; |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId; |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonQISReportCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexQISMBCrequestNew extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | QISStatusC; |
| | | Name; |
| | | |
| | | @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.QISStatusC = result.QISStatusC; |
| | | this.Name = result.Name; |
| | | |
| | | this.QISMBCRequestNew(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建QIS M-BC申请. |
| | | QISMBCRequestNew() { |
| | | var status = this.QISStatusC; |
| | | |
| | | if (status != '完毕' && status != '已回答' && status != '取消') { |
| | | this.ShowToastEvent("QIS没有审批完毕或取消,不可以创建QIS M-BC!", "error"); |
| | | 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); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | console.log('result='+this.paeId); |
| | | } |
| | | var url = ''; |
| | | if (result!=null){ |
| | | if (result!=null&& this.paeId!=null){ |
| | | url = "/apex/PAEDecisionRecord?Id="+this.paeId+"&QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId ; |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?QISReportId="+this.qisReportId +"&RecordTypeIds="+RecordTypeId; |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | | this.EstimateTargetC = result.EstimateTargetC; |
| | | |
| | | |
| | | this.QuarterlyReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 制作季报 |
| | |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonRepairQuotationCtl.init'; |
| | | import updateRepairQuotation03 from '@salesforce/apex/buttonRepairQuotationCtl.updateRepairQuotation03'; |
| | | |
| | | import initSelectProfile from '@salesforce/apex/buttonRepairQuotationCtl.initSelectProfile'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | |
| | | RentalApplyDiscountStatusC; |
| | | LoanerRepairSysC; |
| | | profileId; |
| | | profileName; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.RentalApplyDiscountStatusC = result.RentalApplyDiscountStatusC; |
| | | this.LoanerRepairSysC = result.LoanerRepairSysC; |
| | | |
| | | this.RentalApplyDiscountApproval(); |
| | | |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | this.RentalApplyDiscountApproval(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | |
| | | |
| | | // 备品减价申请 |
| | | RentalApplyDiscountApproval() { |
| | | var power = this.profileId; |
| | | // 2B2_备品中心检测&仓库管理 00e10000000xnoY |
| | | if (power != '00e10000000xnoY') { |
| | | var power = this.profileName; |
| | | |
| | | if (power != '2B2_备品中心检测&仓库管理') { |
| | | this.ShowToastEvent("对不起,您没有权限提交此申请!", "error"); |
| | | // alert('对不起,您没有权限提交此申请!'); |
| | | return; |
| | | } |
| | | |
| | | var status = this.RentalApplyDiscountStatusC; |
| | | if (status == '审批中') { |
| | | this.ShowToastEvent("审批提交成功,当前正在审批请勿再提交!", "error"); |
| | | // alert("审批提交成功,当前正在审批请勿再提交!"); |
| | | return; |
| | | } |
| | | if (status == '批准') { |
| | | this.ShowToastEvent("审批已批准,请勿再提交!", "error"); |
| | | // alert("审批已批准,请勿再提交!"); |
| | | return; |
| | | } |
| | | if (status == '草案中' || status == undefined || status == '驳回') { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("请先填写备品减价金额!", "error"); |
| | | // alert("请先填写备品减价金额!"); |
| | | this.ShowToastEvent("提交失败", "error"); |
| | | return; |
| | | } |
| | | } |
| | | location.reload(); |
| | | } |
| | | |
| | | // 弹窗 |
| New file |
| | |
| | | .Holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="Holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api, track, wire } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | // 2023/05/12 借出备品配套一览 选择配套按钮 |
| | | export default class lexRentalFixtureSetSelect extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | |
| | | connectedCallback(){ |
| | | if (this.recordId) { |
| | | window.open("/apex/RentalFixtureSetSelect?pt_recid="+this.recordId, "_top"); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexSplitApply"> |
| | | <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"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | import init from '@salesforce/apex/ReturnDeliverySlipController.init'; |
| | | |
| | | |
| | | export default class lexReturnDeliverySlip extends LightningElement { |
| | | |
| | | @api recordId; |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | if(result.RentalApplyEquipmentSetCnt > 0){ |
| | | console.log(JSON.stringify(result.raeSet)); |
| | | if(JSON.stringify(result.raeSet) != '[]'){ |
| | | var check = result.raeSet && result.raeSet.length>0; |
| | | if((check || result.RentalApplyEquipmentSetCnt - result.LoanerReceivedNgNum > 0) && result.RentalApplyEquipmentSetCnt > 0){ |
| | | window.open("/apex/EquipmentSetShippmentReceived4?id=" + result.Name); |
| | | }else{ |
| | | alert("没有申请者收到确认的借出备品"); |
| | | } |
| | | }else{ |
| | | alert("没有符合条件的备品借出申请一览明细"); |
| | | console.log('else'); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | alert("没有备品借出申请一览及一览明细"); |
| | | } |
| | | console.log(JSON.stringify(result.raeSet)); |
| | | var check = result.raeSet && result.raeSet.length>0; |
| | | if((check || result.rentalApplyEquipmentSetCnt - result.loanerReceivedNgNum > 0) && result.rentalApplyEquipmentSetCnt > 0){ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.open("/apex/EquipmentSetShippmentReceived4?id=" + result.name); |
| | | }else{ |
| | | this.showToast("没有申请者收到确认的借出备品", 'error'); |
| | | } |
| | | }).catch(err=>{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | console.log('err=='+err); |
| | | }) |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 提交待审批 |
| | | SCSubmit() { |
| | | if (this.StatusC != '草案中') { |
| | | this.ShowToastEvent("已经提交审批", "error") |
| | | // alert('已经提交审批'); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | updateQISSCReport({ |
| | | Id: this.Id |
| | | QId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } else { |
| | | this.ShowToastEvent("已提交", "success") |
| | | window.location.reload(); |
| | | } |
| | | this.ShowToastEvent("已提交", "success") |
| | | // alert('已提交!') |
| | | window.location.reload(); |
| | | }) |
| | | } |
| | | |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | export default class LexSLADetails extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | |
| | | @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.SLADetails(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // SLA报告书信息 |
| | | SLADetails() { |
| | | var url = '/00O10000006tLAl?pv0=' + this.Id; |
| | | window.open(url, '_bank'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import init from '@salesforce/apex/buttonMaintenanceContractAssetCtl.init'; |
| | | |
| | | export default class LexSelectAssetsMaintenance extends LightningElement { |
| | | @api recordId; |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonCaseCtl.init'; |
| | | |
| | | export default class LexSelectProduct2CIC extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | |
| | | @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.QuarterlyReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建CIC/产品 |
| | | SelectProduct2CIC() { |
| | | var pathnames = window.self.location.pathname.split('/'); |
| | | if (pathnames[1] == "emptyHtmlDoc.html") { |
| | | window.open("/apex/SelectProduct2CIC?cicid=" + this.Id, "_parent"); |
| | | } else { |
| | | window.open("/apex/SelectProduct2CIC?cicid=" + this.Id, "_self"); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?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> |
| | |
| | | import getStaticResource from "@salesforce/apex/ButtonJsUtility.getStaticResource"; |
| | | import init from "@salesforce/apex/otherButtonRepairController.init"; |
| | | import initSelectProfile from '@salesforce/apex/otherButtonRepairController.initSelectProfile'; |
| | | import initUserName from '@salesforce/apex/otherButtonRepairController.initUserName'; |
| | | import queryForEquipments from "@salesforce/apex/otherButtonRepairController.queryForEquipments"; |
| | | import queryForFindInvalidLicense from "@salesforce/apex/otherButtonRepairController.queryForFindInvalidLicense"; |
| | | import queryForRds from "@salesforce/apex/otherButtonRepairController.queryForRds"; |
| | |
| | | profileId; |
| | | userId; |
| | | AWSDataId; |
| | | userName; |
| | | profileName; |
| | | Id; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | |
| | | this.Id = result.Id; |
| | | this.detailedAddress = result.detailedAddress; |
| | | this.dealer = result.dealer; |
| | | this.dealer = result.DealerC; |
| | | this.numberofEffectiveContract = result.numberofEffectiveContract; |
| | | this.newProductGuaranteTxt = result.newProductGuaranteTxt; |
| | | this.onSiteRepair = result.onSiteRepair; |
| | | this.onSiteRepair = result.OnSiteRepairC; |
| | | this.maintenanceContract = result.maintenanceContract; |
| | | this.VMMaintenanceContract = result.VMMaintenanceContract; |
| | | this.FSEState = result.FSEState; |
| | | this.dateReceiptQuestions = result.dateReceiptQuestions; |
| | | this.delayReportReason = result.delayReportReason; |
| | | this.dateReceiptQuestions = result.DateReceiptQuestionsC; |
| | | this.delayReportReason = result.DelayReportReasonC; |
| | | this.repairSource = result.repairSource; |
| | | this.quickRepairSign = result.quickRepairSign; |
| | | this.RCCD = result.RCCD; |
| | | this.returnsProductway = result.returnsProductway; |
| | | this.returnsProductway = result.ReturnsProductWayC; |
| | | this.salesDeptHP = result.salesDeptHP; |
| | | this.isAohuiProduct = result.isAohuiProduct; |
| | | this.stateHospital = result.stateHospital; |
| | |
| | | this.URFLimitSerial = result.URFLimitSerial; |
| | | this.status = result.status; |
| | | this.dealerId = result.dealerId; |
| | | this.ifDeadHurt = result.ifDeadHurt; |
| | | this.ifDeadHurt = result.ifDeadHurtC; |
| | | this.dayLater30 = result.dayLater30; |
| | | this.recallCorrespondence = result.recallCorrespondence; |
| | | this.URFReapir = result.URFReapir; |
| | |
| | | this.DWSign = result.DWSign; |
| | | this.DOJStatus = result.DOJStatus; |
| | | this.SAPcondition = result.SAPcondition; |
| | | this.salesOfficeCodeSelection = result.salesOfficeCodeSelection; |
| | | this.salesOfficeCodeSelection = result.SalesOfficeCodeSelectionC; |
| | | this.profileId = result.profileId; |
| | | this.userId = result.userId; |
| | | this.userId = result.userID; |
| | | this.AWSDataId = result.AWSDataId; |
| | | |
| | | this.logicalJudgmentA(); |
| | | |
| | | initUserName({ |
| | | userId: this.userId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.userName = result[0].Name; |
| | | } |
| | | }) |
| | | |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | |
| | | this.foo(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | |
| | | showToast(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({ |
| | | fields: { |
| | | Id: recordId |
| | | } |
| | | }); |
| | | } |
| | | |
| | | logicalJudgmentA() { |
| | | try { |
| | | if ( |
| | | this.numberofEffectiveContract == "无" && |
| | | this.newProductGuaranteTxt != "2: 多年保修" && |
| | | this.newProductGuaranteTxt != "2: 服务多年保修" && |
| | | this.newProductGuaranteTxt != "8: 市场多年保修" && |
| | | this.onSiteRepair == "直送SORC修理" |
| | | ) { |
| | | if ( |
| | | !confirm("设备为非维修合同且非多年保修对象品,请确认是否直送SORC修理?") |
| | | ) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | foo() { |
| | | queryForrecords3({ |
| | | dealer: this.dealer |
| | | }).then(result => { |
| | | if (result.length > 0 && result[0].FirstParagraph__c == true) { |
| | | if (!confirm("该经销商为先款对象,是否继续申请修理?")) { |
| | | return; |
| | | } |
| | | } |
| | | console.log("11"); |
| | | if ( |
| | | (this.maintenanceContract != undefined || |
| | | this.VMMaintenanceContract != undefined) && |
| | | this.onSiteRepair == "RC修理" && |
| | | this.FSEState == "山东省" |
| | | this.numberofEffectiveContract == "无" && this.newProductGuaranteTxt != "2: 多年保修" && |
| | | this.newProductGuaranteTxt != "2: 服务多年保修" && this.newProductGuaranteTxt != "8: 市场多年保修" && |
| | | this.onSiteRepair == "直送SORC修理" |
| | | ) { |
| | | if ( |
| | | !confirm("该设备为维修合同或多年保修对象品,请确认是否送至RC修理?") |
| | | ) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | 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.profileId != "00e10000000Y3o5" && |
| | | this.userId != "0051000000AKgzv" && |
| | | this.userId != "0051000000AKh05" && |
| | | this.userId != "00510000004q1ed" && |
| | | this.delayReportReason == "" && |
| | | dates > "1" && |
| | | this.repairSource != "QIS转修理" |
| | | ) { |
| | | this.showToast("申请修理时SAP修理申请日超过问题联络收到日1天,必须填写问超时报告的理由", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | 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.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修理,请确认是否继续。" |
| | | ) |
| | | ) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送SORC修理,请确认是否继续。")) { |
| | | return; |
| | | } |
| | | } else if ( |
| | | this.RCCD == "1.华北" || |
| | | this.RCCD == "6.华南" || |
| | | this.RCCD == "4.西南" |
| | | ) { |
| | | if ( |
| | | !confirm( |
| | | "该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送OGZ修理,请确认是否继续。" |
| | | ) |
| | | ) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else if (this.RCCD == "1.华北" || this.RCCD == "6.华南" || this.RCCD == "4.西南") { |
| | | if (!confirm("该型号对应为合同或多年保对象品。如确认为大修理故障,需要选择直送OGZ修理,请确认是否继续。")) { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var returnsProductWay = this.returnsProductway; |
| | | var falg = true; |
| | | if (returnsProductWay == undefined) { |
| | | if (!confirm("返品方式为空,是否继续申请修理!")) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | if (this.assetOwner == "Olympus") {} else { |
| | | console.log(this.detailedAddress); |
| | | if (this.detailedAddress != undefined) { |
| | | var prompt = |
| | | "当前直返收货地址为:" + this.detailedAddress + ",您确认不修改了吗?"; |
| | | var DetailedAddress = this.detailedAddress; |
| | | if (this.assetOwner != "Olympus") { |
| | | if (DetailedAddress != undefined) { |
| | | var prompt = '当前直返收货地址为:' + DetailedAddress + ',您确认不修改了吗?'; |
| | | if (!confirm(prompt)) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } else { |
| | | this.showToast("当前修理没有录入直返收货的详细地址,不能申请修理!", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | alert('当前修理没有录入直返收货的详细地址,不能申请修理!'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | queryForEquipments({ |
| | | deliveredProductId: this.deliveredProductId, |
| | | }).then((result) => { |
| | | var equipments = result; |
| | | }).then(equipments => { |
| | | if (equipments != null && equipments.length > 0) { |
| | | var equipment = equipments[0]; |
| | | if (equipment.Status == "廃棄") { |
| | | this.showToast("设备废弃,不能提交申请!", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | alert("设备废弃,不能提交申请!"); |
| | | return; |
| | | } |
| | | } |
| | | }); |
| | | if (this.FSEApplyForRepairTime != undefined) { |
| | | this.showToast("已修理申请,不再修理申请了", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | alert("已修理申请,不再修理申请了"); |
| | | return; |
| | | } |
| | | var surplusCount = 0; |
| | | if (this.URFReapir == true) { |
| | | var urfAsset = null; |
| | | |
| | | if (this.URFReapir == false) { |
| | | queryForUrfAsset({ |
| | | maintenanceContractId: this.maintenanceContractId, |
| | | deliveredProductId: this.deliveredProductId, |
| | | }).then((result) => { |
| | | urfAsset = result; |
| | | }).then(urfAsset => { |
| | | var seriesMaxRepairCount = 0; |
| | | var seriesRepairCount = 0; |
| | | if (urfAsset != null && urfAsset.length > 0) { |
| | |
| | | surplusCount = seriesMaxRepairCount - seriesRepairCount; |
| | | } |
| | | }); |
| | | var urfSeriesInfo = null; |
| | | |
| | | queryForUrfSeriesInfo({ |
| | | URFLimitSerial: this.URFLimitSerial, |
| | | }).then((result) => { |
| | | urfSeriesInfo = result; |
| | | }).then(urfSeriesInfo => { |
| | | var urfSeries = ""; |
| | | if (urfSeriesInfo != null && urfSeriesInfo.length > 0) { |
| | | urfSeries = urfSeriesInfo[0].URFLimitSerial__c; |
| | | } |
| | | var repairCount = null; |
| | | |
| | | queryForRepairCount({ |
| | | maintenanceContractId: this.maintenanceContractId, |
| | | status1: "1.受理完毕", |
| | | URFLimitSerial: urfSeries, |
| | | }).then((result) => { |
| | | repairCount = result; |
| | | }).then(repairCount => { |
| | | if (repairCount.length > 0 && surplusCount == 1) { |
| | | alert("该设备关联限次合同,目前剩余次数小于送修设备。请等待进行中修理完成后再进行申请"); |
| | | return; |
| | | } |
| | | }); |
| | | if (repairCount.length > 0 && surplusCount == 1) { |
| | | this.showToast("该设备关联限次合同,目前剩余次数小于送修设备。请等待进行中修理完成后再进行申请", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | if ( |
| | | this.status != "草案中" && |
| | | this.status != "1.受理完毕(SAP待发送)" && |
| | | this.status != "4.修理品返送阶段" |
| | | ) { |
| | | this.showToast("不是草案中不能申请", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | if (this.status != "草案中" && this.status != "1.受理完毕(SAP待发送)" && this.status != "4.修理品返送阶段") { |
| | | alert("不是草案中不能申请"); |
| | | } else { |
| | | if (this.dealer != undefined) { |
| | | var findInvalidLicense = null; |
| | | |
| | | queryForFindInvalidLicense({ |
| | | isValidity: false, |
| | | dealerId: this.dealerId, |
| | | }).then((result) => { |
| | | findInvalidLicense = result; |
| | | if (findInvalidLicense.size > 0) { |
| | | this.showToast("经销商三证不在有效期,无法送修", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).then(findInvalidLicense => { |
| | | console.log(findInvalidLicense); |
| | | if (findInvalidLicense.length > 0) { |
| | | alert("经销商三证不在有效期,无法送修"); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | if (this.ifDeadHurt == "有") { |
| | | if (!confirm("是否确认AE要提交?")) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | if (this.dayLater30 == "是") { |
| | | this.showToast("创建后超过30天,不能申请了", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | if (this.ifDeadHurt == "有") { |
| | | if (!confirm("是否确认AE要提交?")) { |
| | | return; |
| | | } |
| | | var prompt11 = "合同内大修次数已用完,当前修理为合同外的修理,是否继续?"; |
| | | if (this.URFReapir == true && surplusCount == 0) { |
| | | var resultTmp = null; |
| | | if (!confirm(prompt11)) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | updateForRepair1({ |
| | | recordId: this.recordId, |
| | | }).then((result) => { |
| | | resultTmp = result; |
| | | console.log("1111"); |
| | | var messagesTmp = ""; |
| | | if (resultTmp) { |
| | | messagesTmp = this.getConnectDMLErrorMessages(resultTmp); |
| | | } |
| | | if (messagesTmp.length > 0) { |
| | | this.showToast(messagesTmp.join("\n"), "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | 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 records = null; |
| | | }); |
| | | }); |
| | | |
| | | queryForReocrds({ |
| | | inchargeStaffId: this.inchargeStaffId, |
| | | }).then((result) => { |
| | | records = result; |
| | | console.log(result); |
| | | this.logicalJudgmentB(records); |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console(error); |
| | | } |
| | | var staticResource = null; |
| | | var staticResource; |
| | | var DetailedAddress = this.detailedAddress; |
| | | |
| | | getStaticResource({ |
| | | sobj: "Repair__c" |
| | | }).then(result => { |
| | | console.log(result); |
| | | staticResource = JSON.parse(result); |
| | | |
| | | Promise.all([ |
| | | loadScript(this, AWSService + '/AWSService.js'), |
| | | loadScript(this, jqueryurl), |
| | |
| | | function (data) { |
| | | console.log(data); |
| | | if (data && data.object) { |
| | | var DetailedAddress = data.object.detailedAddress; |
| | | DetailedAddress = data.object.detailedAddress; |
| | | } |
| | | this.foo(); |
| | | }, |
| | | staticResource.token).then(result => { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | }).catch(error => { |
| | | console.log('Failed to load the JQuery : ' + error); |
| | | staticResource.token); |
| | | }); |
| | | }).catch(error => { |
| | | console.log('Failed to load the JQuery : ' + error); |
| | | }) |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | console.log('load correctly'); |
| | | } |
| | | |
| | | foo() { |
| | | console.log("end"); |
| | | var records3 = null; |
| | | |
| | | queryForrecords3({ |
| | | recordId: this.recordId, |
| | | }).then((result) => { |
| | | records3 = result; |
| | | }); |
| | | var FirstParagraph__c = ""; |
| | | if (records3.length >= 1) { |
| | | FirstParagraph__c = records3[0].FirstParagraph__c; |
| | | } |
| | | if (FirstParagraph__c == "true") { |
| | | if (!confirm("该经销商为先款对象,是否继续申请修理?")) { |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | console.log("endend"); |
| | | } |
| | | |
| | | logicalJudgmentB(records) { |
| | | if (records != null && records.length > 0) { |
| | | var staff = records[0]; |
| | | var res = null; |
| | | updateRepair2({ |
| | | recordId: this.recordId, |
| | | staff: staff, |
| | | DWSign: this.DWSign, |
| | | statusc: "1.受理完毕", |
| | | DOJStatus: this.DOJStatus, |
| | | SAPcondition: this.SAPcondition, |
| | | }).then((result) => { |
| | | console.log(result + "result"); |
| | | res = result; |
| | | console.log("start3"); |
| | | var messages = ""; |
| | | if (res) { |
| | | messages = this.getConnectDMLErrorMessages(res); |
| | | } |
| | | if (messages.length > 0) { |
| | | this.showToast(messages.join("\n"), "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else { |
| | | if (this.salesOfficeCodeSelection == "成都RC") { |
| | | |
| | | this.showToast("现阶段,成都RC仅受理四川(西藏)内镜、西南全域CV/CLV,其余实物请发至广州RC。", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | var rds = null; |
| | | |
| | | queryForRds({ |
| | | recordId: this.recordId, |
| | | }).then((result) => { |
| | | rds = result; |
| | | if (rds != null && rds.length > 0) { |
| | | var repairAft = rds[0]; |
| | | if ( |
| | | repairAft.NewProductGuarante_Formula__c != |
| | | repairAft.ProductGuarante_Create__c |
| | | ) { |
| | | this.showToast("该设备保修信息已发生变化,请了解", "error"); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } else { |
| | | this.showToast("没有找到 修理委托者", "error"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | getConnectDMLErrorMessages(results) { |
| | | console.log(results); |
| | | var messages = [], |
| | | i = 0, |
| | | len = results.length, |
| | | r; |
| | | console.log("sos"); |
| | | for (; i < len; i++) { |
| | | r = results[i]; |
| | | if (!r.getBoolean("success")) { |
| | | messages = messages.concat(getConnectDMLMessagesOfAResult(r)); |
| | | } |
| | | } |
| | | return messages; |
| | | } |
| | | |
| | | getConnectDMLMessagesOfAResult(res) { |
| | | var messages = [], |
| | | errors = res.getArray("errors"), |
| | | i = 0, |
| | | len = errors.length, |
| | | e; |
| | | for (; i < len; i++) { |
| | | e = errors[i]; |
| | | messages.push(e.message + " " + getConnectDMLErrorFields(e)); |
| | | } |
| | | return messages; |
| | | } |
| | | |
| | | getConnectDMLErrorFields(error) { |
| | | var fields = error.getArray("fields"); |
| | | if (fields.length > 0) { |
| | | return "[" + fields.join(",") + "]"; |
| | | } else { |
| | | return ""; |
| | | } |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | |
| | | import sendToETQ from '@salesforce/apex/buttonQISReportCtl.sendToETQ'; |
| | | import updateQISReportC from '@salesforce/apex/buttonQISReportCtl.updateQISReportC'; |
| | | import selectQISReportC from '@salesforce/apex/buttonQISReportCtl.selectQISReportC'; |
| | | |
| | | import initSelectProfile from '@salesforce/apex/otherButtonRepairController.initSelectProfile'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | |
| | | QISFinalJudgementC; |
| | | ETQUPLOADSTATUSC; |
| | | AEDetermineResultC; |
| | | profileName; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.ETQUPLOADSTATUSC = result.ETQUPLOADSTATUSC; |
| | | this.AEDetermineResultC = result.AEDetermineResultC; |
| | | |
| | | this.myDate(); |
| | | this.myReload(); |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | |
| | | this.myDate(); |
| | | this.myReload(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | |
| | | |
| | | // 发送QIS到EtQ |
| | | SendQISToEtQ() { |
| | | console.log(this.profileName); |
| | | var QId = this.Id; |
| | | var uid = this.userId; |
| | | |
| | | if (this.profileId != "00e10000000xnoO" && this.profileId != "00e10000000hl7w") { |
| | | if (this.profileName != "2F7_OSH担当" && this.profileName != "2F7_OSH质量法规") { |
| | | alert("您没有发送QIS到EtQ的权限。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.PAEDetermineC == undefined) { |
| | | alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.AEDetermineResultC == "nonAE" && this.PAEDetermineC == "nonPAE" && this.PAEDetermineACC == "nonPAE" && this.OCMJudgementC == undefined && this.QISFinalJudgementC == undefined) { |
| | | alert("nonAE并nonPAE的QIS同步到EtQ的时候,检测结论(OCSM)是必填的。不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | |
| | | if (this.ETQUPLOADSTATUSC == "3") { |
| | | if (!confirm("是否清空EtQ同步状态,重新同步数据?")) { |
| | | return; |
| | |
| | | selectQISReportC({ |
| | | QId: this.Id |
| | | }).then(record => { |
| | | if (record.AsyncData__c == 'true' && record.ETQ_UPLOAD_STATUS__c != '3' || record.Complaint_Number__c != null) { |
| | | console.log(record); |
| | | if (record[0].AsyncData__c == 'true' && record[0].ETQ_UPLOAD_STATUS__c != '3' || record[0].Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendqistoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | |
| | | } |
| | | alert('该QIS之前已经发送过了') |
| | | } else { |
| | | SendQISToEtQ(); |
| | | this.SendQISToEtQ(); |
| | | } |
| | | }) |
| | | } |
| | |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectRecords from '@salesforce/apex/otherButtonRepairController.selectRecords'; |
| | | import sendToETQ from '@salesforce/apex/otherButtonRepairController.sendToETQ'; |
| | | import initSelectProfile from '@salesforce/apex/otherButtonRepairController.initSelectProfile'; |
| | | import initUserName from '@salesforce/apex/otherButtonRepairController.initUserName'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | |
| | | ContainUseRSAC; |
| | | userID; |
| | | profileId; |
| | | profileName; |
| | | userName; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.ContainUseRSAC = result.ContainUseRSAC; |
| | | this.userID = result.userID; |
| | | this.profileId = result.profileId; |
| | | initUserName({ |
| | | userId: this.userID |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.userName = result[0].Name; |
| | | } |
| | | }) |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | |
| | | this.myDate(); |
| | | this.myReload(); |
| | | this.myDate(); |
| | | this.myReload(); |
| | | } |
| | | }) |
| | | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 根据日期构建MessageGroupNumber |
| | |
| | | selectRecords({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.AsyncData__c == 'true' && result.ETQ_UPLOAD_STATUS__c != '3' || result.Complaint_Number__c != null) { |
| | | if (result[0].AsyncData__c == 'true' && result[0].ETQ_UPLOAD_STATUS__c != '3' || result[0].Complaint_Number__c != null) { |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | | for (var i = 0; i < btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | this.ShowToastEvent('该修理之前已经发送过了', "error"); |
| | | // alert('该修理之前已经发送过了') |
| | | alert('该修理之前已经发送过了'); |
| | | } else { |
| | | this.SendRepairsToEtQ(); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 发送ETQ |
| | | SendRepairsToEtQ() { |
| | | console.log(this.userID); |
| | | console.log(this.profileId); |
| | | |
| | | var uid = this.userID; |
| | | if (this.profileId != "00e10000000xnoO" && this.profileId != "00e10000000hl7w" && this.profileId != '00e10000000Y3o5') { |
| | | this.ShowToastEvent("您没有发送修理到EtQ的权限。", "error"); |
| | | // alert("您没有发送修理到EtQ的权限。"); |
| | | if (this.profileName != "2F7_OSH担当" && this.profileName != "2F7_OSH质量法规" && this.profileName != '系统管理员') { |
| | | alert("您没有发送修理到EtQ的权限。"); |
| | | return; |
| | | } |
| | | var statu = ''; |
| | | if (this.PAEDetermineC == undefined) { |
| | | this.ShowToastEvent("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。", "error"); |
| | | // alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | alert("OCSM QARA的PAE判定是空的时候,不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | if (this.ETQUPLOADSTATUSC == "3") { |
| | |
| | | return; |
| | | } |
| | | } |
| | | if (this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE" && uid != "005100000068zJ6") { |
| | | this.ShowToastEvent("Close Complait的时候,不可以发送到EtQ", "error"); |
| | | // alert("Close Complait的时候,不可以发送到EtQ"); |
| | | if (this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE" && this.userName != "雷 新建") { |
| | | alert("Close Complait的时候,不可以发送到EtQ"); |
| | | return; |
| | | } |
| | | if (this.PAEDetermineC != undefined && this.AEDetermineResultC != undefined && this.PAEDetermineACC == undefined) { |
| | |
| | | } else if ((this.AEDetermineResultC != undefined && this.PAEDetermineC != undefined && this.PAEDetermineACC != undefined) && |
| | | !(this.PAEDetermineC == "nonPAE" && this.AEDetermineResultC == "nonAE" && this.PAEDetermineACC == "nonPAE")) { |
| | | statu = "R2"; |
| | | if (this.RepairInspectionDateC == "") { |
| | | this.ShowToastEvent("5.修理检测日是空的时候,不可以发送到EtQ。", "error"); |
| | | // alert("5.修理检测日是空的时候,不可以发送到EtQ。"); |
| | | if (this.RepairInspectionDateC == undefined) { |
| | | alert("5.修理检测日是空的时候,不可以发送到EtQ。"); |
| | | return; |
| | | } |
| | | if (this.ContainUseRSAC == 1) { |
| | | this.ShowToastEvent("Final universal code为空,或者包含UseRSA,请确认。", "error"); |
| | | // alert("Final universal code为空,或者包含UseRSA,请确认。"); |
| | | alert("Final universal code为空,或者包含UseRSA,请确认。"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var result; |
| | | try { |
| | | var repairids = new Array() |
| | | repairids[0] = this.Id; |
| | |
| | | repairIds: repairids, |
| | | statu: statuArr[0] |
| | | }).then(result => { |
| | | this.ShowToastEvent(result, "error"); |
| | | // alert(result); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | alert(result); |
| | | location.reload(); |
| | | }) |
| | | |
| | | var btns = document.getElementsByName("sendrepairstoetq"); |
| | |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | location.reload(); |
| | | } catch (error) { |
| | | this.ShowToastEvent("发送修理到EtQ失败" + error.faultstring + ' code:' + error.faultcode, "error"); |
| | | // alert("发送修理到EtQ失败" + error.faultstring + ' code:' + error.faultcode); |
| | | alert("发送修理到EtQ失败" + error.faultstring + ' code:' + error.faultcode); |
| | | } |
| | | } |
| | | |
| | |
| | | import init from '@salesforce/apex/buttonRepairQuotationCtl.init'; |
| | | import updateRepairQuotation from '@salesforce/apex/buttonRepairQuotationCtl.updateRepairQuotation'; |
| | | import updateRepairQuotation02 from '@salesforce/apex/buttonRepairQuotationCtl.updateRepairQuotation02'; |
| | | import initSelectProfile from '@salesforce/apex/buttonRepairQuotationCtl.initSelectProfile'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | |
| | | Id; |
| | | CutPriceStatusServiceC; |
| | | profileId; |
| | | profileName; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | this.CutPriceStatusServiceC = result.CutPriceStatusServiceC; |
| | | this.profileId = result.profileId; |
| | | |
| | | this.ServiceCutPriceApply(); |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | this.ServiceCutPriceApply(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | //服务本部减价申请 |
| | | ServiceCutPriceApply() { |
| | | var power = this.profileId; |
| | | if (power != '00e10000000xnnz' && power != '00e10000000xno9' && power != '00e10000000NbC4') { |
| | | var power = this.profileName; |
| | | |
| | | if (power != '2F2A_RC' && power != '2F4_技术推进部' && power != '2F4_技术推进部_非SSO') { |
| | | this.ShowToastEvent("对不起,您没有权限提交此申请!", "error"); |
| | | // alert('对不起,您没有权限提交此申请!'); |
| | | return; |
| | | } |
| | | var status = this.CutPriceStatusServiceC; |
| | | if (status == '审批中') { |
| | | this.ShowToastEvent("审批提交成功,当前正在审批请勿再提交!", "error"); |
| | | // alert("审批提交成功,当前正在审批请勿再提交!"); |
| | | return; |
| | | } |
| | | if (status == '批准') { |
| | | this.ShowToastEvent("审批已批准,请勿再提交!", "error"); |
| | | // alert("审批已批准,请勿再提交!"); |
| | | return; |
| | | } |
| | | if (status == '草案中' || status == undefined || status == '驳回') { |
| | |
| | | alert("提交失败 " + split[1]); |
| | | return; |
| | | } else { |
| | | // alert("审批提交成功!"); |
| | | this.ShowToastEvent("审批提交成功!", "success"); |
| | | location.reload(); |
| | | } |
| | | }) |
| | | } |
| | | location.reload(); |
| | | } |
| | | |
| | | // 弹窗 |
| New file |
| | |
| | | .holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| | | .toast{ |
| | | border: 1px solid #c9c9c9; |
| | | border-radius: 10px; |
| | | width: 50%; |
| | | margin: 0 auto; |
| | | font-size: 18px; |
| | | font-weight: bold; |
| | | padding: 10px 20px; |
| | | background: #feb75d; |
| | | display: flex; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | <div if:false={IsLoading} class="toast"> |
| | | <span style="padding: 10px;">{msg}</span> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;"> |
| | | <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small" |
| | | title="Close" style="color: black;"></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | <!-- <lightning:icon iconName="utility:warning" alternativeText="Warning!" title="Warning" /> --> |
| | | </div> |
| | | <!-- <section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" if:false={IsLoading}> |
| | | <div class="slds-modal__container"> |
| | | <header class="slds-modal__header" style="color: black;"> |
| | | <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">请选择借出备品一览记录</h2> |
| | | </header> |
| | | |
| | | <div style="height: 100px;"> |
| | | <div class="rewardDetailsTitle">Details</div> |
| | | </div> |
| | | |
| | | <footer class="slds-modal__footer"> |
| | | <lightning-button variant="brand" label="确定" class="slds-var-m-left_x-small" onclick={handleSubmit}></lightning-button> |
| | | </footer> |
| | | </div> |
| | | </section> --> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api, track, wire } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | // 2023/05/11 借出备品配套一览 分单按钮 |
| | | export default class lexSplitApplyFlowLWC extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | //只获取当前list选中的一览Id |
| | | @api rentalApplyIds; |
| | | IsLoading=true; |
| | | //提示信息 |
| | | msg; |
| | | |
| | | connectedCallback(){ |
| | | if (this.recordId && JSON.stringify(this.rentalApplyIds)) { |
| | | window.open("/apex/RentalApplySplit?objId="+this.recordId+"&raesIds="+this.rentalApplyIds, 'RentalApplySplit', 'width=600,height=200'); |
| | | this.closeAction(); |
| | | }else{ |
| | | this.msg = '请选择借出备品一览记录'; |
| | | this.IsLoading = false; |
| | | } |
| | | } |
| | | closeAction() { |
| | | //返回当前的备品申请 |
| | | window.open("/"+this.recordId,'_self'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexSplitApply"> |
| | | <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"> |
| | | <property name="recordId" type="String" label="recordId"/> |
| | | <property name="rentalApplyIds" type="String[]" label="rentalApplyIds"/> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 关闭询价/关闭续签 |
| | | SubmitForApproval() { |
| | | var url = ''; |
| | | selectRecords({ |
| | | recordId: this.Id |
| | | mcId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | url = "/apex/SubmitForApprovalPage?id=" + result[0].Id; |
| | | } else { |
| | | url = "/apex/SubmitForApprovalPage?mcId=" + this.Id; |
| | | } |
| | | window.open(url, '', 'height=350, width=600, top=200, left=350,location=no'); |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | }) |
| | | } |
| | | } |
| | |
| | | status;//状态 |
| | | profileId;//profileId id |
| | | systemProfileId; |
| | | SalesManagerId; |
| | | SalesHospitalId; |
| | | TwoS1_Sales_Hospital; |
| | | TwoS4_Sales_Manager; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | this.status = result.status; |
| | | this.profileId = result.profileId; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.SalesManagerId = result.SalesManagerId; |
| | | this.SalesHospitalId = result.SalesHospitalId; |
| | | this.TwoS1_Sales_Hospital = result.TwoS1_Sales_Hospital; |
| | | this.TwoS4_Sales_Manager = result.TwoS4_Sales_Manager; |
| | | this.LoseButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | |
| | | LoseButton(){ |
| | | sqlResult({id: this.recordId}).then(result=>{ |
| | | //简档权限 2S1_销售医院担当 2S4_销售管理者 系统管理员 |
| | | if (this.profileId != this.SalesManagerId && this.profileId != this.SalesHospitalId && this.profileId != this.systemProfileId) { |
| | | if (this.profileId != this.TwoS1_Sales_Hospital && this.profileId != this.TwoS4_Sales_Manager && this.profileId != this.systemProfileId) { |
| | | this.showToast("您没有权限,无法创建询价提交失单。","error"); |
| | | return; |
| | | } |
| | |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | import sqlResult from '@salesforce/apex/TenderingButtonController.sqlResult'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexTenderingNotarizeButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | status;//状态 |
| | | profileId;//profileId id |
| | | systemProfileId;//系统管理员 |
| | | TwoS1_Sales_Hospital;//2S1_销售医院担当 |
| | | TwoS1_Sales_Hospital_Non_Singleton;//2S1_销售医院担当(非单点) |
| | | TwoS6_Trade_Assistant;//2S6-2_营业助理 |
| | | TwoS6_Sales_Headquarters;//2S6-1_销售本部窗口 |
| | | TwoS7_Sales_Headquarters;//2S7_销售本部合同管理窗口 |
| | | TwoS8_Sales_Administrative_Assistant;//2S8_销售行政助理 |
| | | TwoS8_Sales_Administrative_Assistant_Plan;//2S8_销售行政助理(计划仪表板) |
| | | TwoS9_Spare;//2S9_备品窗口 |
| | | OBA1_Tenderee;//OBA1_招标管理 |
| | | OBA7_Enquiry_Tenderee;//OBA7_询价+招标管理 |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result) |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.status = result.status; |
| | | this.profileId = result.profileId.slice(0,15); |
| | | this.NotarizeButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.status = result.status; |
| | | this.profileId = result.profileId; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.TwoS1_Sales_Hospital = result.TwoS1_Sales_Hospital; |
| | | this.TwoS1_Sales_Hospital_Non_Singleton = result.TwoS1_Sales_Hospital_Non_Singleton; |
| | | this.TwoS6_Trade_Assistant = result.TwoS6_Trade_Assistant; |
| | | this.TwoS6_Sales_Headquarters = result.TwoS6_Sales_Headquarters; |
| | | this.TwoS7_Sales_Headquarters = result.TwoS7_Sales_Headquarters; |
| | | this.TwoS8_Sales_Administrative_Assistant = result.TwoS8_Sales_Administrative_Assistant; |
| | | this.TwoS8_Sales_Administrative_Assistant_Plan = result.TwoS8_Sales_Administrative_Assistant_Plan; |
| | | this.TwoS9_Spare = result.TwoS9_Spare; |
| | | this.OBA1_Tenderee = result.OBA1_Tenderee; |
| | | this.OBA7_Enquiry_Tenderee = result.OBA7_Enquiry_Tenderee; |
| | | this.NotarizeButton(); |
| | | }) |
| | | } |
| | | |
| | | //相关性确认 |
| | | //招标项目 相关性确认 |
| | | NotarizeButton(){ |
| | | console.log(this.ProfileId,'行吗'); |
| | | if( this.profileId!= '00e1m000000MSci' |
| | | if( |
| | | //简档无 该条数据 this.profileId!= '00e1m000000MSci' |
| | | // 系统管理员 |
| | | && this.profileId!= '00e10000000Y3o5' |
| | | // 2s6 |
| | | && this.profileId!= '00e10000000xnpR' && this.profileId!= '00e10000000xyK6' |
| | | // 2s7 |
| | | && this.profileId!= '00e10000000xnpW' |
| | | // 2s8 |
| | | && this.profileId!= '00e10000000xnpb' && this.profileId!= '00e10000000xyKB' |
| | | // 2s9 |
| | | && this.profileId!= '00e10000000a7NY' |
| | | // OBA1 |
| | | && this.profileId!= '00e10000000s2fZ' |
| | | // OBA7 |
| | | && this.profileId!= '00e10000000s3Jp' |
| | | this.profileId != this.systemProfileId |
| | | //2s1 2S1_销售医院担当 2S1_销售医院担当(非单点) |
| | | && this.profileId!= this.TwoS1_Sales_Hospital && this.profileId!= this.TwoS1_Sales_Hospital_Non_Singleton |
| | | // 2s6 2S6-2_营业助理 2S6-1_销售本部窗口 |
| | | && this.profileId!= this.TwoS6_Trade_Assistant && this.profileId!= this.TwoS6_Sales_Headquarters |
| | | // 2s7 2S7_销售本部合同管理窗口 |
| | | && this.profileId!= this.TwoS7_Sales_Headquarters |
| | | // 2s8 2S8_销售行政助理 2S8_销售行政助理(计划仪表板) |
| | | && this.profileId!= this.TwoS8_Sales_Administrative_Assistant && this.profileId !=this.TwoS8_Sales_Administrative_Assistant_Plan |
| | | // 2s9 2S9_备品窗口 |
| | | && this.profileId!= this.TwoS9_Spare |
| | | // OBA1 OBA1_招标管理 |
| | | && this.profileId!= this.OBA1_Tenderee |
| | | // OBA7 OBA7_询价+招标管理 |
| | | && this.profileId!= this.OBA7_Enquiry_Tenderee |
| | | ){ |
| | | // alert("只有助理才能进行相关性确认!"); |
| | | this.showToast("只有助理才能进行相关性确认!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(this.status== '01.待确认' || |
| | | this.status== '02.不相关' || |
| | | this.status == '03.不应标' || |
| | | this.status== '04.待关联询价' |
| | | ){ |
| | | if(this.status== '01.待确认' || this.status== '02.不相关' || this.status == '03.不应标' || this.status== '04.待关联询价'){ |
| | | window.open (`/apex/Relevance?id=${this.id}`, '', 'height=500, width=800, top=200, left=250,location=no'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | else{ |
| | | // alert('只有01.待确认时需要进行相关性确认!'); |
| | | // alert('关联询价后不能进行相关性确认!'); |
| | | this.showToast("关联询价后不能进行相关性确认!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | |
| | | // function init(){ |
| | | // var ProfileId = "{!$Profile.Id}"; |
| | | // if( ProfileId!= '00e1m000000MSci' |
| | | // // 系统管理员 |
| | | // && ProfileId!= '00e10000000Y3o5' |
| | | // // 2s1 |
| | | // // && ProfileId!= '00e10000000xnp2' && ProfileId!= '00e10000000xzQ0' |
| | | |
| | | // // 2s6 |
| | | // && ProfileId!= '00e10000000xnpR' && ProfileId!= '00e10000000xyK6' |
| | | |
| | | // // 2s7 |
| | | // && ProfileId!= '00e10000000xnpW' |
| | | |
| | | // // 2s8 |
| | | // && ProfileId!= '00e10000000xnpb' && ProfileId!= '00e10000000xyKB' |
| | | |
| | | // // 2s9 |
| | | // && ProfileId!= '00e10000000a7NY' |
| | | // // OBA1 |
| | | // && ProfileId!= '00e10000000s2fZ' |
| | | // // OBA7 |
| | | // && ProfileId!= '00e10000000s3Jp' |
| | | // ) |
| | | // { |
| | | // alert("只有助理才能进行相关性确认!"); |
| | | // return; |
| | | // } |
| | | |
| | | |
| | | // if('{!Tender_information__c.status__c}' == '01.待确认' || |
| | | // '{!Tender_information__c.status__c}' == '02.不相关' || |
| | | // '{!Tender_information__c.status__c}' == '03.不应标' || |
| | | // '{!Tender_information__c.status__c}' == '04.待关联询价' ) |
| | | // { |
| | | // window.open ('/apex/Relevance?id={!Tender_information__c.Id}', '', 'height=500, width=800, top=200, left=250,location=no'); |
| | | // } |
| | | // else{ |
| | | // // alert('只有01.待确认时需要进行相关性确认!'); |
| | | // alert('关联询价后不能进行相关性确认!'); |
| | | // } |
| | | // } |
| | | // init(); |
| | | } |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexTenderingRelevancyButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | ProfileId; |
| | | ProfileId;// 账号的权限 |
| | | systemProfileId;//系统管理员 |
| | | TwoS1_Sales_Hospital;//'2S1_销售医院担当'; |
| | | TwoS1_Sales_Hospital_Non_Singleton;//2S1_销售医院担当(非单点) |
| | | TwoS2_Sales_Product;//'2S2_销售产品担当'; |
| | | TwoS4_Sales_Manager;//2S4_销售管理者 |
| | | TwoS4_Sales_Manager_Non_Singleton;//'2S4_销售管理者(非单点)' |
| | | TwoS4_Sales_Manager_Majordomo;//'2S4_销售管理者(总监)' |
| | | TwoS6_Trade_Assistant;//2S6-2_营业助理 |
| | | TwoS6_Sales_Headquarters;//2S6-1_销售本部窗口 |
| | | TwoS7_Sales_Headquarters;//2S7_销售本部合同管理窗口 |
| | | TwoM4_Marketplace_Manager;//2M4_市场产品本部担当(询价) |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.ProfileId = result.profileId.slice(0,15); |
| | | this.ProfileId = result.profileId; |
| | | this.systemProfileId = result.systemProfileId;//系统管理员 |
| | | this.TwoS1_Sales_Hospital = result.TwoS1_Sales_Hospital;//'2S1_销售医院担当'; |
| | | this.TwoS1_Sales_Hospital_Non_Singleton = result.TwoS1_Sales_Hospital_Non_Singleton;//2S1_销售医院担当(非单点) |
| | | this.TwoS2_Sales_Product = result.TwoS2_Sales_Product;//'2S2_销售产品担当'; |
| | | this.TwoS4_Sales_Manager = result.TwoS4_Sales_Manager;//2S4_销售管理者 |
| | | this.TwoS4_Sales_Manager_Non_Singleton = result.TwoS4_Sales_Manager_Non_Singleton;//'2S4_销售管理者(非单点)' |
| | | this.TwoS4_Sales_Manager_Majordomo = result.TwoS4_Sales_Manager_Majordomo;//'2S4_销售管理者(总监)' |
| | | this.TwoS6_Trade_Assistant = result.TwoS6_Trade_Assistant;//2S6-2_营业助理 |
| | | this.TwoS6_Sales_Headquarters = result.TwoS6_Sales_Headquarters;//2S6-1_销售本部窗口 |
| | | this.TwoS7_Sales_Headquarters = result.TwoS7_Sales_Headquarters;//2S7_销售本部合同管理窗口 |
| | | this.TwoM4_Marketplace_Manager = result.TwoM4_Marketplace_Manager;//2M4_市场产品本部担当(询价) |
| | | this.RelevancyButton(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | //招标项目 关联已有询价 |
| | | RelevancyButton(){ |
| | | if( this.ProfileId != '00e1m000000MSci' |
| | | // 无该简档数据 '00e1m000000MSci' |
| | | if( |
| | | // 系统管理员 |
| | | && this.ProfileId != '00e10000000Y3o5' |
| | | this.ProfileId != this.systemProfileId |
| | | // 2s1 |
| | | && this.ProfileId != '00e10000000xnp2' && this.ProfileId != '00e10000000xzQ0' |
| | | // 2s2 |
| | | && this.ProfileId != '00e10000000xnp7'&& this.ProfileId != '00e10000001220i' |
| | | && this.ProfileId != this.TwoS1_Sales_Hospital && this.ProfileId != this.TwoS1_Sales_Hospital_Non_Singleton |
| | | // 2s2 无该简档数据 00e10000001220i |
| | | && this.ProfileId != this.TwoS2_Sales_Product |
| | | // 2s4 |
| | | && this.ProfileId != '00e10000000xnpH' && this.ProfileId != '00e10000000xzQA' |
| | | && this.ProfileId != '00e10000000hkas' |
| | | && this.ProfileId != this.TwoS4_Sales_Manager && this.ProfileId != this.TwoS4_Sales_Manager_Non_Singleton && this.ProfileId != this.TwoS4_Sales_Manager_Majordomo |
| | | // 2s6 |
| | | && this.ProfileId != '00e10000000xnpR' && this.ProfileId != '00e10000000xyK6' |
| | | && this.ProfileId != this.TwoS6_Trade_Assistant && this.ProfileId != this.TwoS6_Sales_Headquarters |
| | | // 2s7 |
| | | && this.ProfileId != '00e10000000xnpW' |
| | | && this.ProfileId != this.TwoS7_Sales_Headquarters |
| | | // 2M4 20221012 ljh SWAG-CK28WT |
| | | && this.ProfileId != '00e10000000Nb7i' |
| | | && this.ProfileId != this.TwoM4_Marketplace_Manager |
| | | ){ |
| | | // alert('只有担当和助理才能关联询价!'); |
| | | this.showToast('只有担当和助理才能关联询价','error'); |
| | | return; |
| | | } |
| | | |
| | | window.open ('/apex/Enquiry?id='+this.recordId, '_blank'); |
| | | } |
| | | |
| | | // this.showToast(result,'success'); |
| | | // this.showToast('项目已关联过询价,请到询价里做不应标申请','error'); |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | // title: title, |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | | |
| | | // function RelateOpp(){ |
| | | |
| | | // var ProfileId = "{!$Profile.Id}"; |
| | | // if( ProfileId!= '00e1m000000MSci' |
| | | // // 系统管理员 |
| | | // && ProfileId!= '00e10000000Y3o5' |
| | | // // 2s1 |
| | | // && ProfileId!= '00e10000000xnp2' && ProfileId!= '00e10000000xzQ0' |
| | | |
| | | // // 2s2 |
| | | // && ProfileId!= '00e10000000xnp7'&& ProfileId!= '00e10000001220i' |
| | | |
| | | // // 2s4 |
| | | // && ProfileId!= '00e10000000xnpH' && ProfileId!= '00e10000000xzQA' |
| | | |
| | | // && ProfileId!= '00e10000000hkas' |
| | | |
| | | // // 2s6 |
| | | // && ProfileId!= '00e10000000xnpR' && ProfileId!= '00e10000000xyK6' |
| | | |
| | | // // 2s7 |
| | | // && ProfileId!= '00e10000000xnpW' |
| | | // // 2M4 20221012 ljh SWAG-CK28WT |
| | | // && ProfileId!= '00e10000000Nb7i' |
| | | // ){ |
| | | // alert('只有担当和助理才能关联询价!'); |
| | | // return; |
| | | // } |
| | | |
| | | |
| | | // url = window.location.pathname; |
| | | // url = url.substring(url.lastIndexOf('/') + 1, url.length); |
| | | // window.open ('/apex/Enquiry?id='+url, '_blank'); |
| | | // } |
| | | // RelateOpp(); |
| | | } |
| | |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/TenderingButtonController.initTenderingController'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexTenderingUsedAttachmentButton extends LightningElement { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //招标项目 查看附件(旧) |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.id = result.Id; |
| | | this.AttachmentButton(); |
| | | window.open(`/apex/QLMAttachmentPreview?parentId=${this.id}`); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | //查看附件(旧) |
| | | AttachmentButton(){ |
| | | window.open(`/apex/QLMAttachmentPreview?parentId=${this.id}`); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | | |
| | | // var From= function(){ |
| | | // window.open( "/apex/QLMAttachmentPreview?parentId={!URLENCODE(Tender_information__c.Id)}"); |
| | | // } |
| | | // From(); |
| | | } |
| | |
| | | |
| | | //中止 |
| | | Terminal() { |
| | | // sforce.connection.sessionId = this.sessionId; |
| | | if (this.ProcessStatusC == "草案中" || |
| | | this.ProcessStatusC == "不批准" || |
| | | this.ProcessStatusC == "批准" |
| | |
| | | updateMaintenanceContract({ |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | this.ShowToastEvent("该维修合同报价中止了!", "success"); |
| | | // alert("该维修合同报价中止了!") |
| | | window.location.reload(); |
| | | |
| | | this.ShowToastEvent("该维修合同报价中止了!", "success"); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("该维修合同报价还在审批中 或 已经中止,不能中止!", "error"); |
| | | // alert("该维修合同报价还在审批中 或 已经中止,不能中止!") |
| | | } |
| | | } |
| | | |
| | |
| | | uploadToRecognitionModel() { |
| | | if (this.ContractQuotationOrNotC == '还没做报价') { |
| | | this.ShowToastEvent("您还没有做合同报价,不能上传认款合同。", "error") |
| | | // alert("您还没有做合同报价,不能上传认款合同。"); |
| | | } else if (this.MaintenanceContractNoC == undefined) { |
| | | this.ShowToastEvent('合同号码为空,不能上传认款合同。', "error") |
| | | // alert('合同号码为空,不能上传认款合同。'); |
| | | } else if (this.uploadToSapTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传SAP,不能再次上传认款合同。', "error") |
| | | // alert('已经上传SAP,不能再次上传认款合同。'); |
| | | } else if (this.uploadToRMTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传认款合同,不能再次上传认款合同。', "error") |
| | | // alert('已经上传认款合同,不能再次上传认款合同。'); |
| | | } else { |
| | | if (!this.oldIsRecognitionModelC) { |
| | | this.ShowToastEvent('经销商为空或经销商不是先款对象,不需要上传认款合同。', "error") |
| | | // alert('经销商为空或经销商不是先款对象,不需要上传认款合同。'); |
| | | } else if (this.PaymentPlanSumFirstC == undefined) { |
| | | this.ShowToastEvent('第一次计划付款金额不能为空。', "error") |
| | | // alert('第一次计划付款金额不能为空。'); |
| | | } else { |
| | | if (!confirm('请确认是否要上传认款合同。')) { |
| | | return; |
| | | } |
| | | |
| | | updateColunm({ |
| | | mcid: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != '1') { |
| | | this.ShowToastEvent('上传认款合同失败,因为 来年合同相关信息修改失败', "error") |
| | | // alert('上传认款合同失败,因为 来年合同相关信息修改失败'); |
| | | alert('上传认款合同失败,因为 来年合同相关信息修改失败') |
| | | location.href = "/" + this.Id; |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | |
| | | up2sap({ |
| | | mcid: this.Id |
| | | }).then(rtn => { |
| | | console.log(rtn); |
| | | if (rtn == '1') { |
| | | this.ShowToastEvent("上传认款合同成功", "success") |
| | | // alert("上传认款合同成功"); |
| | | alert("上传认款合同成功") |
| | | location.href = "/" + this.Id; |
| | | } else { |
| | | this.ShowToastEvent(rtn, "error") |
| | | // alert(rtn); |
| | | alert(rtn) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| | |
| | | urfFlag; |
| | | rtn1; |
| | | rtn; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }) |
| | | } |
| | | |
| | | // 上传SAP |
| | | uploadToSap() { |
| | | if (this.MCApprovalStatusC != 'Pass') { |
| | | this.ShowToastEvent("合同复核批准后才可以上传SAP。", "error") |
| | | // alert("合同复核批准后才可以上传SAP。"); |
| | | } else if (this.MaintenanceContractNoC == undefined) { |
| | | this.ShowToastEvent('维修合同管理编码为空,不能上传SAP。', "error") |
| | | // alert('维修合同管理编码为空,不能上传SAP。'); |
| | | } else if (this.uploadToSapTimeC != undefined) { |
| | | this.ShowToastEvent('已经上传SAP,不能重复上传。', "error") |
| | | // alert('已经上传SAP,不能重复上传。'); |
| | | } else { |
| | | if (this.oldIsRecognitionModelC) { |
| | | if (this.uploadToRMTimeC == undefined) { |
| | | this.ShowToastEvent('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能上传SAP。', "error") |
| | | // alert('当前维修合同的经销商是先款对象,需要先【上传认款合同】,然后完成认款以后才能上传SAP。'); |
| | | return; |
| | | } else { |
| | | if (!this.IsRecognitionModelTrueC) { |
| | | this.ShowToastEvent('当前维修合同没有完成认款,不能上传SAP。', "error") |
| | | // alert('当前维修合同没有完成认款,不能上传SAP。'); |
| | | return; |
| | | } |
| | | } |
| | |
| | | }).then(result => { |
| | | if (result != '1') { |
| | | this.ShowToastEvent('上传SAP失败,因为 来年合同相关信息修改失败', "error") |
| | | // alert('上传SAP失败,因为 来年合同相关信息修改失败'); |
| | | } |
| | | }); |
| | | updateFirstContract({ |
| | |
| | | }).then(result => { |
| | | if (result != '1') { |
| | | this.ShowToastEvent(result, "error") |
| | | // alert(result); |
| | | } |
| | | }); |
| | | this.urfFlag = this.URFContractFC; |
| | |
| | | }); |
| | | if (this.rtn == '1') { |
| | | this.ShowToastEvent("上传SAP成功", "success") |
| | | // alert("上传SAP成功"); |
| | | window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Maintenance_Contract__c/" + this.recordId + "/view"); |
| | | location.href = "/" + this.Id; |
| | | } else { |
| | | this.ShowToastEvent(this.rtn, "error") |
| | | // alert(this.rtn); |
| | | } |
| | | } else { |
| | | this.ShowToastEvent(this.rtn1, "error") |
| | | // alert(this.rtn1); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | recordId: this.Id |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | if (result != null) { |
| | | if (result.length > 0) { |
| | | var split = result.split(", "); |
| | | alert(split[1]); |
| | | } |
| | | } |
| | | location.reload(); |
| | | }).catch(error => { |
| | | console.log(error); |
| | | alert("已经申请过了,不允许重新申请"); |
| | | }) |
| | | } |
| | | |
| | | getConnectDMLErrorMessages(results) { |
| | | var messages = [], |
| | | i = 0, |
| | | len = results.length, |
| | | r; |
| | | for (; i < len; i++) { |
| | | r = results[i]; |
| | | if (!r.getBoolean("success")) { |
| | | messages = messages.concat(this.getConnectDMLMessagesOfAResult(r)); |
| | | } |
| | | } |
| | | return messages; |
| | | } |
| | | getConnectDMLMessagesOfAResult(res) { |
| | | var messages = [], |
| | | errors = res.getArray("errors"), |
| | | i = 0, |
| | | len = errors.length, |
| | | e; |
| | | for (; i < len; i++) { |
| | | e = errors[i]; |
| | | messages.push(e.message + " " + this.getConnectDMLErrorFields(e)); |
| | | } |
| | | return messages; |
| | | } |
| | | getConnectDMLErrorFields(error) { |
| | | var fields = error.getArray('fields'); |
| | | if (fields.length > 0) { |
| | | return "[" + fields.join(",") + "]" |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | |
| | | import { LightningElement,wire,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/QISReportController.initForlexcopyQISButton'; |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/buttonQISReportCtl.init'; |
| | | |
| | | |
| | | export default class lexcopyQIS extends LightningElement { |
| | | @api recordId; |
| | | err; |
| | | IsLoading = true; |
| | | qisReportId; |
| | | qisStatus; |
| | | name; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | @api recordId; |
| | | err; |
| | | IsLoading = true; |
| | | Id; |
| | | QISStatusC; |
| | | Name; |
| | | |
| | | connectedCallback () { |
| | | @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 => { |
| | | this.IsLoading = false; |
| | | this.qisReportId = result.Id; |
| | | this.qisStatus = result.qIStatus; |
| | | this.name = result.name; |
| | | if (this.qisStatus != '取消') { |
| | | const evt = new ShowToastEvent({ |
| | | title : '状态为取消的QIS才可以被复制并新建', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | var url = "/"+this.qisReportId+"/e?newclone=1&retURL=%2F"+this.qisReportId+" &CF00N100000073PA0="+this.name+"&CF00N100000073PA0_lkid="+this.qisReportId; |
| | | window.open(url); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.Id = result.Id; |
| | | this.QISStatusC = result.QISStatusC; |
| | | this.Name = result.Name; |
| | | |
| | | this.copyQIS() |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | copyQIS() { |
| | | if (this.QISStatusC != '取消') { |
| | | this.ShowToastEvent('状态为取消的QIS才可以被复制并新建', 'error'); |
| | | return; |
| | | } |
| | | var url = "/" + this.Id + "/e?newclone=1&retURL=%2F" + this.Id + " &CF00N100000073PA0=" + this.Name + "&CF00N100000073PA0_lkid=" + this.Id; |
| | | window.open(url); |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |