| | |
| | | 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 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 = '非对象'; |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-12 11:16:07 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-23 14:55:57 |
| | | * @LastEditTime: 2023-05-15 13:40:51 |
| | | */ |
| | | public with sharing class OpportunityLightingButtonController { |
| | | @AuraEnabled |
| | |
| | | res.trade = opportunity.Trade__c; |
| | | res.isCorrosion = opportunity.Is_Corrosion__c; |
| | | res.ifAuthorizingLock = opportunity.If_Authorizing_Lock__c; |
| | | String profile18 = UserInfo.getProfileId(); |
| | | res.profileId = profile18.substring(0,profile18.length() - 3); |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.systemProfileId = getProfileIdByName(lexLightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | res.j3ProfileId = getProfileIdByName(lexLightingButtonConstant.J3_PROFILE_NAME); |
| | | res.s61ProfileId = getProfileIdByName(lexLightingButtonConstant.S61_PROFILE_NAME); |
| | | res.s62ProfileId = getProfileIdByName(lexLightingButtonConstant.S62_PROFILE_NAME); |
| | | res.m4ProfileId = getProfileIdByName(lexLightingButtonConstant.M4_PROFILE_NAME); |
| | | } catch (Exception e) { |
| | | System.debug('e:****' + e); |
| | | } |
| | |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static InitData initFoBeforeOPDPDFBtnButton(String recordId){ |
| | | public static InitData initForBeforeOPDPDFBtnButton(String recordId){ |
| | | InitData res = new InitData(); |
| | | try { |
| | | Opportunity opportunity = [ |
| | |
| | | res.bidPlannedDate = opportunity.Bid_Planned_Date__c; |
| | | res.salesAssistantName = opportunity.Sales_assistant_name__c; |
| | | res.salesAssistantID = opportunity.Sales_assistant_ID__c; |
| | | String profileId18 = UserInfo.getProfileId(); |
| | | res.profileId = profileId18.substring(0, profileId18.length() - 3); |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.systemProfileId = getProfileIdByName(lexLightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | res.s1ProfileId = getProfileIdByName(lexLightingButtonConstant.S1_PROFILE_NAME); |
| | | res.s4ProfileId = getProfileIdByName(lexLightingButtonConstant.S4_PROFILE_NAME); |
| | | } catch (Exception e) { |
| | | System.debug('e:****' + e); |
| | | } |
| | |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static InitData initForCreateActivityButton(String recordId){ |
| | | InitData res = new InitData(); |
| | | try { |
| | | Opportunity opp = [ |
| | | select |
| | | AccountId |
| | | from Opportunity where Id =: recordId |
| | | ]; |
| | | res.accountId = opp.AccountId; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static InitData initForAssignTaskButtonButton(String recordId){ |
| | | InitData res = new InitData(); |
| | | try { |
| | | Opportunity opp = [ |
| | | select |
| | | AccountId, |
| | | Name |
| | | from Opportunity where Id =: recordId |
| | | ]; |
| | | Account acc = [ |
| | | select |
| | | Name |
| | | from Account where Id =:opp.AccountId |
| | | ]; |
| | | res.accountId = opp.AccountId; |
| | | res.accountName = acc.Name; |
| | | res.name = opp.Name; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static InitData initForChangeContractTypeButton(String recordId){ |
| | | InitData res = new InitData(); |
| | | try { |
| | | Opportunity opp = [ |
| | | select |
| | | StageName, |
| | | Estimation_Decision__c, |
| | | SAP_Send_OK__c, |
| | | If_Authorizing_Lock__c |
| | | from Opportunity where Id =: recordId |
| | | ]; |
| | | res.stageName = opp.StageName; |
| | | res.estimationDecision = opp.Estimation_Decision__c; |
| | | res.sapSendOK = opp.SAP_Send_OK__c; |
| | | res.ifAuthorizingLock = opp.If_Authorizing_Lock__c; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static string updateForAgencyAuthorizeButton(String recordId){ |
| | | try { |
| | | Opportunity opp = new Opportunity(); |
| | |
| | | Opportunity opp = new Opportunity(); |
| | | opp.Id = recordId; |
| | | if(flag){ |
| | | opp.Stock_apply_status__c = '填写完毕'; |
| | | opp.Stock_apply_status__c = lexLightingButtonConstant.STOCK_APPLY_STATUS_WRITE_OVER; |
| | | }else { |
| | | opp.Stock_apply_status__c = '草案中'; |
| | | opp.Stock_apply_status__c = lexLightingButtonConstant.STOCK_APPLY_STATUS_DRAFT; |
| | | } |
| | | update opp; |
| | | return null; |
| | |
| | | select id, |
| | | Tender_information__r.subInfoType__c |
| | | from Tender_Opportunity_Link__c |
| | | where (Tender_information__r.subInfoType__c = '3-1:废标公告' OR Tender_information__r.subInfoType__c ='3-2:流标公告') and Opportunity__c =: recordId |
| | | where (Tender_information__r.subInfoType__c =:lexLightingButtonConstant.SUB_INFO_TYPE_SCRAPPED_LABEL OR Tender_information__r.subInfoType__c =:lexLightingButtonConstant.SUB_INFO_TYPE_FLOW_LABEL) and Opportunity__c =: recordId |
| | | ]; |
| | | } catch (Exception e) { |
| | | System.debug('e:****' + e); |
| | |
| | | quotes = [ |
| | | select |
| | | id |
| | | from QuoteIrai__c where Note__c like :opportunityId and QuoteIrai_Status__c = '草案中' |
| | | from QuoteIrai__c where Note__c like :opportunityId and QuoteIrai_Status__c =:lexLightingButtonConstant.QUOTEIRAI_STATUS_DRAFT |
| | | ]; |
| | | } catch (Exception e) { |
| | | System.debug('e:****' + e); |
| | |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | | public static string getUserIdByName(String userName){ |
| | | User user = null; |
| | | try { |
| | | user = [ |
| | | select |
| | | Id |
| | | from User where Name =: userName |
| | | ]; |
| | | return user.Id; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | | public static string getProfileIdByName(String profileName){ |
| | | Profile pro = null; |
| | | try { |
| | | pro = [ |
| | | select |
| | | Id |
| | | from Profile where Name =: profileName |
| | | ]; |
| | | return pro.Id; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | public class InitData{ |
| | |
| | | public String siDecideID; |
| | | @AuraEnabled |
| | | public String opportunityNo; |
| | | @AuraEnabled |
| | | public String systemProfileId; |
| | | @AuraEnabled |
| | | public String j3ProfileId; |
| | | @AuraEnabled |
| | | public String s62ProfileId; |
| | | @AuraEnabled |
| | | public String s61ProfileId; |
| | | @AuraEnabled |
| | | public String m4ProfileId; |
| | | @AuraEnabled |
| | | public String s4ProfileId; |
| | | @AuraEnabled |
| | | public String s1ProfileId; |
| | | @AuraEnabled |
| | | public String accountName; |
| | | } |
| | | } |
| | |
| | | try { |
| | | Report__c report = [select Status__c,VOC_Satisfy__c,VOC_Satisfy1__c from Report__c where Id = :recordId]; |
| | | res.status = report.Status__c; |
| | | res.Satisfy = report.VOC_Satisfy__c; |
| | | res.Satisfy1 = report.VOC_Satisfy1__c; |
| | | res.satisfy = report.VOC_Satisfy__c; |
| | | res.satisfy1 = report.VOC_Satisfy1__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | InitData res = new InitData(); |
| | | try { |
| | | Report__c report = [select OCSMAdministrativeReportNumber__c,OCSMAdministrativeReportDate__c,Aware_date__c from Report__c where Id = :recordId]; |
| | | res.OCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c; |
| | | res.OCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c; |
| | | res.theOCSMAdministrativeReportDate = report.OCSMAdministrativeReportDate__c; |
| | | res.theOCSMAdministrativeReportNumber = report.OCSMAdministrativeReportNumber__c; |
| | | res.awareDate = report.Aware_date__c; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | InitData res = new InitData(); |
| | | try { |
| | | Report__c report = [select OCSMAdministrativeReportStatus__c,AwareDate__C from Report__c where Id = :recordId]; |
| | | res.OCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c; |
| | | res.theOCSMAdministrativeReportStatus = report.OCSMAdministrativeReportStatus__c; |
| | | res.awareDate = report.AwareDate__C; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | try { |
| | | PAE_DecisionRecord__c[] report = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Report__c = :recordId And RecordType.DeveloperName = :developerName Order by LastModifiedDate desc]; |
| | | if (report != null && !report.isEmpty()) { |
| | | res.LastModifiedDate = report[0].LastModifiedDate; |
| | | res.Id = report[0].Id; |
| | | res.Name = report[0].Name; |
| | | res.LastModifiedById = report[0].LastModifiedById; |
| | | res.DeveloperName = report[0].RecordType.DeveloperName; |
| | | res.lastModifiedDate = report[0].LastModifiedDate; |
| | | res.id = report[0].Id; |
| | | res.name = report[0].Name; |
| | | res.lastModifiedById = report[0].LastModifiedById; |
| | | res.developerName = report[0].RecordType.DeveloperName; |
| | | } |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | try { |
| | | PAE_DecisionRecord__c[] report = [SELECT LastModifiedDate, Id, Name, LastModifiedById,RecordType.DeveloperName FROM PAE_DecisionRecord__c where PAE_Report__c = :recordId And RecordType.DeveloperName = :recordTypeId Order by LastModifiedDate desc]; |
| | | if (report != null && !report.isEmpty()) { |
| | | res.LastModifiedDate = report[0].LastModifiedDate; |
| | | res.Id = report[0].Id; |
| | | res.Name = report[0].Name; |
| | | res.LastModifiedById = report[0].LastModifiedById; |
| | | res.DeveloperName = report[0].RecordType.DeveloperName; |
| | | res.lastModifiedDate = report[0].LastModifiedDate; |
| | | res.id = report[0].Id; |
| | | res.name = report[0].Name; |
| | | res.lastModifiedById = report[0].LastModifiedById; |
| | | res.developerName = report[0].RecordType.DeveloperName; |
| | | } |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | |
| | | //VOC结果确认更新相应数据 |
| | | @AuraEnabled |
| | | public static String updateForVOCConfirmButton(String recordId,String Satisfy,String Satisfy1){ |
| | | public static String updateForVOCConfirmButton(String recordId,String satisfy,String satisfy1){ |
| | | try { |
| | | Report__c rac = new Report__c(); |
| | | rac.Id = recordId; |
| | | if (Satisfy == LightingButtonConstant.CN_YES) { |
| | | if (satisfy == LightingButtonConstant.CN_YES) { |
| | | rac.Status__c = LightingButtonConstant.STATUS_VOC_CONFIRMED; |
| | | } else if (Satisfy == LightingButtonConstant.CN_NO) { |
| | | } else if (satisfy == LightingButtonConstant.CN_NO) { |
| | | // 対応結果(一回目)に値なければ、一回目の「否」と見なす |
| | | if (Satisfy1 != LightingButtonConstant.CN_NO) { |
| | | if (satisfy1 != LightingButtonConstant.CN_NO) { |
| | | Report__c[] records = [SELECT Id, VOC_Satisfy__c, VOC_Unsatisfy_Reason__c, VOC_follow_up_result__c, VOC_solution_category__c FROM Report__c WHERE Id = :recordId]; |
| | | rac.VOC_Satisfy__c = null; |
| | | rac.VOC_Unsatisfy_Reason__c = null; |
| | |
| | | @AuraEnabled |
| | | public String ownerId; |
| | | @AuraEnabled |
| | | public String Satisfy; |
| | | public String satisfy; |
| | | @AuraEnabled |
| | | public String Satisfy1; |
| | | public String satisfy1; |
| | | @AuraEnabled |
| | | public String profileId; |
| | | @AuraEnabled |
| | | public String OCSMAdministrativeReportNumber; |
| | | public String theOCSMAdministrativeReportNumber; |
| | | @AuraEnabled |
| | | public Date OCSMAdministrativeReportDate; |
| | | public Date theOCSMAdministrativeReportDate; |
| | | @AuraEnabled |
| | | public Date awareDate; |
| | | @AuraEnabled |
| | | public String OCSMAdministrativeReportStatus; |
| | | public String theOCSMAdministrativeReportStatus; |
| | | @AuraEnabled |
| | | public Datetime LastModifiedDate; |
| | | public Datetime lastModifiedDate; |
| | | @AuraEnabled |
| | | public String Id; |
| | | public String id; |
| | | @AuraEnabled |
| | | public String Name; |
| | | public String name; |
| | | @AuraEnabled |
| | | public String LastModifiedById; |
| | | public String lastModifiedById; |
| | | @AuraEnabled |
| | | public String DeveloperName; |
| | | public String developerName; |
| | | @AuraEnabled |
| | | public String userId; |
| | | @AuraEnabled |
| New file |
| | |
| | | public with sharing class lexLightingButtonConstant { |
| | | //中标通知书的状态‘处理完毕’ |
| | | public static final String STATUS_Bid_Announcement_Consent = '处理完毕'; |
| | | //中标通知书的状态‘草案中’ |
| | | public static final String STATUS_Bid_Announcement_Reject = '草案中'; |
| | | //中标通知书的状态‘申请中’ |
| | | public static final String STATUS_Bid_Announcement_ApplyFor = '申请中'; |
| | | //授权申请的状态‘已提交’ |
| | | public static final String STATUS_Application_Submitted = '已提交'; |
| | | //授权申请的状态‘草案中’ |
| | | public static final String STATUS_Application_CancelSubmit= '草案中'; |
| | | //授权申请的记录类型名‘授权申请’ |
| | | public static final String RECORD_TYPE_NAME_Application = '授权申请'; |
| | | //周报月报的状态‘草案中’ |
| | | public static final String STATUS_DRAFT = '草案中'; |
| | | //报告书的状态‘完毕’ |
| | | public static final String STATUS_COMPLETE = '完毕'; |
| | | //报告书的状态‘取消’ |
| | | public static final String STATUS_CANCEL = '取消'; |
| | | //OCSM报告的状态‘待报告’ |
| | | public static final String STATUS_TO_BE_REPORTED = '待报告'; |
| | | //OCSM报告的状态‘无需报告’ |
| | | public static final String STATUS_TO_NOT_REPORT = '无需报告'; |
| | | //VOC报告的状态‘结果确认完毕’ |
| | | public static final String STATUS_VOC_CONFIRMED = '结果确认完毕'; |
| | | //VOC报告的状态‘回答完毕’ |
| | | public static final String STATUS_VOC_END_OF_ANSWER = '回答完毕'; |
| | | //VOC报告的状态‘申请中’ |
| | | public static final String STATUS_VOC_APPLYING = '申請中'; |
| | | //VOC报告的状态‘判定完毕’ |
| | | public static final String STATUS_VOC_CHECK_OVER = '判定完毕'; |
| | | //VOC报告的状态‘填写完毕’ |
| | | public static final String STATUS_VOC_WRITE_OVER = '填写完毕'; |
| | | //备货申请的状态‘填写完毕’ |
| | | public static final String STOCK_APPLY_STATUS_WRITE_OVER = '填写完毕'; |
| | | //备货申请的状态‘草案中’ |
| | | public static final String STOCK_APPLY_STATUS_DRAFT = '草案中'; |
| | | //VOC报告的状态‘完毕’ |
| | | public static final String STATUS_VOC_FINISH = '完毕'; |
| | | //报价委托功能的状态‘草案中’ |
| | | public static final String QUOTEIRAI_STATUS_DRAFT = '草案中'; |
| | | //QIS的状态‘OSH检测中’ |
| | | public static final String STATUS_QIS_OSH_TESTING = 'OSH检测中'; |
| | | //QIS的状态‘OSH填写完毕’ |
| | | public static final String STATUS_QIS_OSH_COMPLATED = 'OSH填写完毕'; |
| | | //QIS的状态‘OSH检测申请’ |
| | | public static final String STATUS_QIS_OSH_TESTING_APP = 'OSH检测申请'; |
| | | //QIS的状态‘RC填写完毕’ |
| | | public static final String STATUS_QIS_RC_COMPLATED = 'RC填写完毕'; |
| | | //QIS的状态‘取消申请’ |
| | | public static final String STATUS_QIS_CANCEL = '取消申请'; |
| | | //QIS的状态‘RC检测中’ |
| | | public static final String STATUS_QIS_RC_CHECKING = 'RC检测中'; |
| | | //QIS的状态‘FSE填写完毕’ |
| | | public static final String STATUS_QIS_FSE_COMPLATED = 'FSE填写完毕'; |
| | | //QIS的状态‘完毕’ |
| | | public static final String STATUS_QIS_COMPLATED = '完毕'; |
| | | //招标项目的阶段补充说明‘3-1:废标公告’ |
| | | public static final String SUB_INFO_TYPE_SCRAPPED_LABEL = '3-1:废标公告'; |
| | | //招标项目的阶段补充说明‘3-2:流标公告’ |
| | | public static final String SUB_INFO_TYPE_FLOW_LABEL = '3-2:流标公告'; |
| | | //周报月报的记录类型名‘周报’ |
| | | public static final String RECORD_TYPE_NAME_BY_MONTHLY_REPORT = '周报'; |
| | | //报告书的记录类型‘提交’ |
| | | public static final String RECORD_TYPE_NAME_BY_SUBMIT = '提交'; |
| | | //报告书的记录类型‘跟台’ |
| | | public static final String RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE = '跟台'; |
| | | //报告书的记录类型‘OPD’ |
| | | public static final String RECORD_TYPE_NAME_BY_OPD= 'OPD'; |
| | | //QIS的记录类型‘3.OSH’ |
| | | public static final String RECORD_TYPE_NAME_BY_OSH= '3.OSH'; |
| | | //QIS的记录类型‘4.OSH回答完毕’ |
| | | public static final String RECORD_TYPE_NAME_BY_OSH_FINASH= '4.OSH回答完毕'; |
| | | //QIS的记录类型‘9.Final 完毕’ |
| | | public static final String RECORD_TYPE_NAME_BY_FINAL= '9.Final 完毕'; |
| | | //QIS的记录类型‘5.现场结案’ |
| | | public static final String RECORD_TYPE_NAME_BY_COMP= '5.现场结案'; |
| | | //记录类型的developerName‘ASRCDecision’ |
| | | public static final String DEVELOPER_NAME_ASRC_DECISION = 'ASRCDecision'; |
| | | //记录类型的developerName‘ASACDecision’ |
| | | public static final String DEVELOPER_NAME_ASAC_DECISION = 'ASACDecision'; |
| | | //工作分类的销售服务 |
| | | public static final String TYPE_OF_SALES_SERVICES = '销售服务'; |
| | | //userAccess参数后缀_Edit |
| | | public static final String USER_ACCESS_EDIT = '_Edit'; |
| | | //userAccess参数后缀_Read |
| | | public static final String USER_ACCESS_READ = '_Read'; |
| | | //任务的名字‘中标结果确认’ |
| | | public static final String TASK_NAME_BY_CONFIRMATION_OF_WINNING_BID = '中标结果确认'; |
| | | //询价的ConfirmationofAward__c字段值‘OLY中标’ |
| | | public static final String OPPORTUNITY_CONFIRMATION_OF_AWARD_OLY_WIN_BID = 'OLY中标'; |
| | | //询价的ConfirmationofAward__c字段值‘竞争对手中标’ |
| | | public static final String OPPORTUNITY_CONFIRMATION_OF_AWARD_LOSE_BID = '竞争对手中标'; |
| | | public static final String PREDICTED_DATE_STATUS = '审批中'; |
| | | public static final String CN_YES = '是'; |
| | | public static final String CN_NO = '否'; |
| | | public static final String VOC_NAME = 'VOC'; |
| | | public static final String OK = 'OK'; |
| | | public static final String LU_SHENG_NAME = '陆 胜'; |
| | | public static final String HU_DI_AN_NAME = '胡 迪安'; |
| | | public static final String SYSTEM_PROFILE_NAME = '系统管理员'; |
| | | public static final String J3_PROFILE_NAME = '2J3_特约店窗口'; |
| | | public static final String S62_PROFILE_NAME = '2S6-2_营业助理'; |
| | | public static final String S61_PROFILE_NAME = '2S6-1_销售本部窗口'; |
| | | public static final String M4_PROFILE_NAME = '2M4_市场产品本部担当(询价)'; |
| | | public static final String S1_PROFILE_NAME = '2S1_销售医院担当'; |
| | | public static final String S4_PROFILE_NAME = '2S4_销售管理者'; |
| | | 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 static final String REPAIR_FIELD_SAP_CONDITION_IS_TRUE = 'true'; |
| | | } |
| 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> |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-08 14:36:32 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-15 09:20:08 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForASACEditorButton'; |
| | | export default class LexASACEditor extends LightningElement { |
| | | @api recordId; |
| | | LastModifiedDate |
| | | Id |
| | | Name |
| | | LastModifiedById |
| | | DeveloperName |
| | | lastModifiedDate |
| | | id |
| | | name |
| | | lastModifiedById |
| | | developerName |
| | | IsLoading = true; |
| | | url; |
| | | @wire(CurrentPageReference) |
| | |
| | | console.log(result); |
| | | if (result != undefined) { |
| | | console.log("if"); |
| | | this.LastModifiedById = result.LastModifiedById; |
| | | this.LastModifiedDate = result.LastModifiedDate; |
| | | this.Id = result.Id; |
| | | this.Name = result.Name; |
| | | this.DeveloperName = result.DeveloperName; |
| | | console.log(this.Id); |
| | | this.lastModifiedById = result.lastModifiedById; |
| | | this.lastModifiedDate = result.lastModifiedDate; |
| | | this.id = result.id; |
| | | this.name = result.name; |
| | | this.developerName = result.developerName; |
| | | this.editor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | |
| | | } |
| | | |
| | | editor(){ |
| | | if (this.Id != undefined){ |
| | | this.url = "/apex/RepPAEDecisionRecord?Id="+this.Id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision"; |
| | | if (this.id != undefined){ |
| | | this.url = "/apex/RepPAEDecisionRecord?Id="+this.id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision"; |
| | | console.log(this.url); |
| | | } else { |
| | | this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision"; |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-08 14:36:32 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-15 09:22:15 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | |
| | | |
| | | export default class LexASRCEditor extends LightningElement { |
| | | @api recordId; |
| | | LastModifiedDate |
| | | Id |
| | | Name |
| | | LastModifiedById |
| | | DeveloperName |
| | | lastModifiedDate |
| | | id |
| | | name |
| | | lastModifiedById |
| | | developerName |
| | | IsLoading = true; |
| | | url; |
| | | @wire(CurrentPageReference) |
| | |
| | | console.log(result); |
| | | if (result != undefined) { |
| | | console.log("if"); |
| | | this.LastModifiedById = result.LastModifiedById; |
| | | this.LastModifiedDate = result.LastModifiedDate; |
| | | this.Id = result.Id; |
| | | this.Name = result.Name; |
| | | this.DeveloperName = result.DeveloperName; |
| | | console.log(this.Id); |
| | | this.lastModifiedById = result.lastModifiedById; |
| | | this.lastModifiedDate = result.lastModifiedDate; |
| | | this.id = result.id; |
| | | this.name = result.name; |
| | | this.developerName = result.developerName; |
| | | this.editor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | |
| | | } |
| | | |
| | | editor(){ |
| | | if (this.Id != undefined){ |
| | | this.url = "/apex/RepPAEDecisionRecord?Id="+this.Id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision"; |
| | | if (this.id != undefined){ |
| | | this.url = "/apex/RepPAEDecisionRecord?Id="+this.id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision"; |
| | | console.log(this.url); |
| | | } else { |
| | | this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision"; |
| | |
| | | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-12 14:51:44 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-19 09:11:02 |
| | | * @LastEditTime: 2023-05-11 13:46:32 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | isCorrosion; |
| | | profileId; |
| | | ifAuthorizingLock; |
| | | systemProfileId; |
| | | j3ProfileId; |
| | | s61ProfileId; |
| | | s62ProfileId; |
| | | m4ProfileId; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.isCorrosion = result.isCorrosion; |
| | | this.profileId = result.profileId; |
| | | this.ifAuthorizingLock = result.ifAuthorizingLock; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.j3ProfileId = result.j3ProfileId; |
| | | this.s61ProfileId = result.s61ProfileId; |
| | | this.s62ProfileId = result.s62ProfileId; |
| | | this.m4ProfileId = result.m4ProfileId; |
| | | this.AgencyAuthorize(); |
| | | }) |
| | | } |
| | |
| | | var oppid = this.recordId; |
| | | var angency = this.agency1Id; |
| | | var profileId = this.profileId; |
| | | |
| | | if (profileId != '00e10000000Y3o5' && profileId != '00e10000000Nab7' && profileId != '00e10000000xnpR' && profileId != '00e10000000xyK6' && profileId != '00e10000000NbCE' |
| | | && profileId != '00e10000000xyK6' && profileId != '00e10000000Nb7i') { |
| | | //测试已锁定授权合同申请为“1” |
| | | this.estimationId = 'test'; |
| | | this.detailNum = 1; |
| | | if (profileId != this.systemProfileId && profileId != this.j3ProfileId && profileId != this.s61ProfileId && profileId != this.s62ProfileId && profileId != this.m4ProfileId) { |
| | | this.showToast("您没有授权申请的权限。请联系系统管理员。","error"); |
| | | return; |
| | | } |
| | |
| | | this.showToast("耗材不可与奥辉产品同时存在!","error"); |
| | | return; |
| | | } else if (this.cntLostCancelDraft > 0) { |
| | | if(!confirm('询价有草案中的取消/失单报告,是否继续?')){ |
| | | return ; |
| | | } |
| | | if(!confirm('询价有草案中的取消/失单报告,是否继续?')){ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return ; |
| | | } |
| | | } else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { |
| | | this.showToast('询价有已提交的取消/失单报告。',"error"); |
| | | return; |
| | |
| | | } else if (this.salesRoot != '販売店') { |
| | | this.showToast('医院直销不需要授权申请。',"error"); |
| | | return; |
| | | } |
| | | // else if ('{!Opportunity.AcecideCntCheck__c}' != '1') { |
| | | // alert('阿西赛多询价只能包含危化品,或者,普通询价不能包含危化品。'); |
| | | // return; |
| | | // } |
| | | else if (this.ifSubmit == '1') { |
| | | }else if (this.ifSubmit == '1') { |
| | | this.showToast('上传失败,请联系系统管理员!',"error"); |
| | | return; |
| | | } |
| | | if (this.ifAuthorizingLock == 'true') { |
| | | if (this.ifAuthorizingLock == true) { |
| | | this.showToast('询价正在授权中,请不要重复提交。',"error"); |
| | | return; |
| | | } |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexAssignTaskButton from 'c/lexAssignTaskButton'; |
| | | |
| | | describe('c-lex-assign-task-button', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-assign-task-button', { |
| | | is: LexAssignTaskButton |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="lexAssignTaskButtonHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-15 11:14:32 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-15 11:50:12 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForAssignTaskButtonButton'; |
| | | export default class LexAssignTaskButton extends LightningElement { |
| | | @api recordId; |
| | | accountName; |
| | | accountId; |
| | | oppName; |
| | | @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(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.accountId = result.accountId; |
| | | this.accountName = result.accountName; |
| | | this.oppName = result.name; |
| | | this.assignTask(); |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | assignTask(){ |
| | | //基础路径 |
| | | var url = '/setup/ui/recordtypeselect.jsp?ent=01I100000016llf'; |
| | | //记录类型 |
| | | url += '&p3=01210000000cWfw'; |
| | | url += '&retURL=%2F'; |
| | | url += '&save_new_url=%2Fa3V%2Fe%3FretURL%3D%252Fa3V%252Fo'; |
| | | //客户 |
| | | url += '&CF00N100000095tn6=' + this.accountName; |
| | | url += '&CF00N100000095tn6_lkid=' + this.accountId; |
| | | //询价 |
| | | url += '&CF00N100000095zcA=' + this.oppName; |
| | | url += '&CF00N100000095zcA_lkid=' + this.recordId; |
| | | //任务状态 |
| | | url += '&00N100000095tnR=01 分配'; |
| | | //任务区分 |
| | | url += '&00N100000095tnP=上级分配任务'; |
| | | //任务名称 |
| | | url += '&Name=*'; |
| | | window.open(url); |
| | | 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> |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 15:08:43 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-14 15:37:35 |
| | | * @LastEditTime: 2023-05-11 15:49:41 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initFoBeforeOPDPDFBtnButton'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForBeforeOPDPDFBtnButton'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence'; |
| | | import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF'; |
| | |
| | | import queryForCancelReportButton from '@salesforce/apex/OpportunityLightingButtonController.queryForCancelReportButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import ConSent from '@salesforce/apex/BidAnnouncementController.ConSent'; |
| | | export default class LexCancelReport extends LightningElement { |
| | | @api recordId; |
| | | stageName; |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.stageName = result.stageName; |
| | | this.sapSendOK = result.sapSendOK; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft; |
| | | this.cntLostCancelReport = result.cntLostCancelReport; |
| | | this.jobCategory = result.jobCategory; |
| | | this.biddingProjectNameBid = result.biddingProjectNameBid; |
| | | this.name = result.name; |
| | | this.salesAssistantID = result.salesAssistantID; |
| | | this.salesAssistantName = result.salesAssistantName; |
| | | this.managerName = result.managerName; |
| | | this.salesManagerDepartmentID = result.salesManagerDepartmentID; |
| | | this.salesOwnerBuchang = result.salesOwnerBuchang; |
| | | this.salesOwnerBuchangID = result.salesOwnerBuchangID; |
| | | console.log(result); |
| | | this.stageName = result.stageName == undefined ? '' : result.stageName; |
| | | this.sapSendOK = result.sapSendOK == undefined ? '' : result.sapSendOK; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft == undefined ? '' : result.cntLostCancelDraft; |
| | | this.cntLostCancelReport = result.cntLostCancelReport == undefined ? '' : result.cntLostCancelReport; |
| | | this.jobCategory = result.jobCategory == undefined ? '' : result.jobCategory; |
| | | this.biddingProjectNameBid = result.biddingProjectNameBid == undefined ? '' : result.biddingProjectNameBid; |
| | | this.name = result.name == undefined ? '' : result.name; |
| | | this.salesAssistantID = result.salesAssistantID == undefined ? '' : result.salesAssistantID; |
| | | this.salesAssistantName = result.salesAssistantName == undefined ? '' : result.salesAssistantName; |
| | | this.managerName = result.managerName == undefined ? '' : result.managerName; |
| | | this.salesManagerDepartmentID = result.salesManagerDepartmentID == undefined ? '' : result.salesManagerDepartmentID; |
| | | this.salesOwnerBuchang = result.salesOwnerBuchang == undefined ? '' : result.salesOwnerBuchang; |
| | | this.salesOwnerBuchangID = result.salesOwnerBuchangID == undefined ? '' : result.salesOwnerBuchangID; |
| | | this.cancelReport(); |
| | | }) |
| | | } |
| | |
| | | |
| | | } |
| | | else if (this.sapSendOK == '1') { |
| | | this.showToast("已经上传SAP、不能做 取消 了!",""); |
| | | this.showToast("已经上传SAP、不能做 取消 了!","error"); |
| | | } |
| | | else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { |
| | | this.showToast("询价已经有 取消/失单报告 了!","error"); |
| | | } |
| | | else if (this.jobCategory == '支援') { |
| | | this.showToast("询价所有人是助理的,先请修改到销售担当!",""); |
| | | this.showToast("询价所有人是助理的,先请修改到销售担当!","error"); |
| | | } |
| | | //XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 start |
| | | //else if({!NOT(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))}&& '{!Opportunity.subInfoType__c}' != '3-1:废标公告' &&'{!Opportunity.subInfoType__c}' != '3-2:流标公告'){ |
| | | else if(this.biddingProjectNameBid != undefined && sqlResult.size == 0){ |
| | | else if(this.biddingProjectNameBid != '' && sqlResult.length == 0){ |
| | | this.showToast("有招投标项目时只能做失单或部分失单报告!","error"); |
| | | } |
| | | //XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 end |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexChangeContractType from 'c/lexChangeContractType'; |
| | | |
| | | describe('c-lex-change-contract-type', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-change-contract-type', { |
| | | is: LexChangeContractType |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | .lexChangeContractTypeHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="lexChangeContractTypeHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-15 13:17:26 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-15 15:01:19 |
| | | */ |
| | | import { api, wire,LightningElement } 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/OpportunityLightingButtonController.initForChangeContractTypeButton'; |
| | | import changeTrade from '@salesforce/apex/OpportunityWebService.changeTrade'; |
| | | |
| | | export default class LexChangeContractType extends LightningElement { |
| | | @api recordId; |
| | | stageName; |
| | | estimationDecision; |
| | | sapSendOK; |
| | | ifAuthorizingLock; |
| | | 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(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.stageName = result.stageName; |
| | | this.estimationDecision = result.estimationDecision; |
| | | this.sapSendOK = result.sapSendOK; |
| | | this.ifAuthorizingLock = result.ifAuthorizingLock; |
| | | this.changeContractType(); |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | changeContractType(){ |
| | | var oppId = this.recordId; |
| | | var str ; |
| | | var status = this.stageName; |
| | | var quostatus = this.estimationDecision; |
| | | var win = this.sapSendOK; |
| | | var Auth = this.ifAuthorizingLock; |
| | | |
| | | if(status != '引合'){ |
| | | this.showToast('只有状态1是询价的可以更改合同类型','error'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(Auth == '1'){ |
| | | this.showToast('询价正在授权申请中,请在SPO中驳回后再做转换。','error'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(quostatus == 'true' || quostatus == true){ |
| | | this.showToast('已决定报价,不能修改内贸/外贸','error'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(win == 'true' || win == true){ |
| | | this.showToast('请先取消WIN, 再转换内外贸','error'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(confirm('变更合同类型会删除全部报价,是否继续?')){ |
| | | changeTrade({ |
| | | oppId: oppId |
| | | }).then(result=>{ |
| | | str = result; |
| | | if(str != '1'){ |
| | | this.showToast(str,"error"); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.location.href = 'https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Opportunity/' + this.recordId + '/view'; |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | }else{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | 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> |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-21 14:32:09 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-10 17:05:09 |
| | | * @LastEditTime: 2023-05-12 15:25:47 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import LexCreateActivity from 'c/lexCreateActivity'; |
| | | |
| | | describe('c-lex-create-activity', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-lex-create-activity', { |
| | | is: LexCreateActivity |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <div class="lexCreateActivityHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-15 09:50:42 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-15 10:34:33 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForCreateActivityButton'; |
| | | export default class LexCreateActivity extends LightningElement { |
| | | @api recordId; |
| | | accountId; |
| | | @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(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | this.accountId = result.accountId; |
| | | this.createActivity(); |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | createActivity(){ |
| | | window.open( |
| | | "/apex/SimpleEventRegister?retURL=%2Fapex%2FVFClosePage&accid=" |
| | | + this.accountId + "&oid=" |
| | | + this.recordId + "&source=AccountPCL&save_new=1&sfdc.override=1"); |
| | | 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> |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-05-08 14:36:33 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-11 14:48:31 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-20 14:08:55 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-24 13:58:53 |
| | | * @LastEditTime: 2023-05-12 11:35:46 |
| | | */ |
| | | /* |
| | | * @Description: |
| | |
| | | if(this.closeForecastedDate == undefined){ |
| | | this.closeForecastedDate = ''; |
| | | }else{ |
| | | this.closeForecastedDate = new String(this.closeForecastedDate).replace("-","/"); |
| | | this.closeForecastedDate = new String(this.closeForecastedDate).replaceAll("-","/"); |
| | | } |
| | | console.log(this.closeForecastedDate); |
| | | if(this.bidPlannedDate == undefined){ |
| | | this.bidPlannedDate = ''; |
| | | }else{ |
| | | this.bidPlannedDate = new String(this.bidPlannedDate).replace("-","/"); |
| | | this.bidPlannedDate = new String(this.bidPlannedDate).replaceAll("-","/"); |
| | | } |
| | | if(this.dealerFinalPrice == undefined){ |
| | | this.dealerFinalPrice = ''; |
| | |
| | | if (this.agency1Id == undefined) { |
| | | newflag = false; |
| | | this.showToast("经销商不存在,不能转成【经销商目标询价】。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | else if (this.agencyOpportunity != undefined) { |
| | | newflag = false; |
| | | this.showToast("已经转成过【经销商目标询价】。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | else if (this.trade != '内貿') { |
| | | newflag = false; |
| | | this.showToast("不是内贸,不能转成【经销商目标询价】。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | else { |
| | | var records = null; |
| | |
| | | hospitalId: this.hospitalId |
| | | }).then(result=>{ |
| | | records = result; |
| | | console.log(records.length); |
| | | if (records == null || records.length == 0) { |
| | | newflag = false; |
| | | this.showToast("没有有效的【经销商医院】。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | if (newflag) { |
| | | console.log("5"); |
| | |
| | | var recTypeList = result; |
| | | if (recTypeList.length == 0) { |
| | | this.showToast("没有找到,经销商询价的定义。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else { |
| | | console.log("7"); |
| | | queryForRecords2({ |
| | |
| | | + encodeURIComponent(this.opportunityCategory); |
| | | console.log(url); |
| | | window.open(url); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } catch (error) { |
| | | console.log(error) |
| | | } |
| | |
| | | }) |
| | | } |
| | | }); |
| | | console.log("4"); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-28 15:59:44 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-09 15:20:58 |
| | | * @LastEditTime: 2023-05-15 09:15:58 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | export default class LexOCSMNoToReportForReport extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | OCSMAdministrativeReportNumber; |
| | | OCSMAdministrativeReportDate; |
| | | AwareDate; |
| | | theOCSMAdministrativeReportNumber; |
| | | theOCSMAdministrativeReportDate; |
| | | awareDate; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | this.OCSMAdministrativeReportDate = result.OCSMAdministrativeReportDate; |
| | | this.OCSMAdministrativeReportNumber = result.OCSMAdministrativeReportNumber; |
| | | this.AwareDate = result.awareDate; |
| | | this.theOCSMAdministrativeReportDate = result.theOCSMAdministrativeReportDate; |
| | | this.theOCSMAdministrativeReportNumber = result.theOCSMAdministrativeReportNumber; |
| | | this.awareDate = result.awareDate; |
| | | this.noToReport(); |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(this.OCSMAdministrativeReportNumber != undefined || this.OCSMAdministrativeReportDate != undefined ){ |
| | | if(this.theOCSMAdministrativeReportNumber != undefined || this.theOCSMAdministrativeReportDate != undefined ){ |
| | | this.showToast("已经报告的QIS,不可以点击OCSM不要报告。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | this.AwareDate = Date.now(); |
| | | if(this.AwareDate != undefined ){ |
| | | this.awareDate = Date.now(); |
| | | if(this.awareDate != undefined ){ |
| | | updateForOCSMNoToReportButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:26:11 |
| | | * @LastEditTime: 2023-05-15 09:17:27 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | export default class LexOCSMToReport extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | OCSMAdministrativeReportStatus; |
| | | theOCSMAdministrativeReportStatus; |
| | | awareDate; |
| | | |
| | | |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.OCSMAdministrativeReportStatus = result.OCSMAdministrativeReportStatus; |
| | | this.theOCSMAdministrativeReportStatus = result.theOCSMAdministrativeReportStatus; |
| | | this.awareDate = result.awareDate; |
| | | this.toReport(); |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | if(this.OCSMAdministrativeReportStatus == undefined && this.awareDate != undefined ){ |
| | | if(this.theOCSMAdministrativeReportStatus == undefined && this.awareDate != undefined ){ |
| | | updateForOCSMToReportButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-23 10:09:31 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-10 17:38:56 |
| | | * @LastEditTime: 2023-05-15 11:06:07 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | this.authorizedDBNo = result.authorizedDBNo; |
| | | this.estimationDecision = result.estimationDecision; |
| | | this.siDecideID = result.siDecideID; |
| | | this.name = result.name; |
| | | this.opportunityNo = result.opportunityNo; |
| | | this.isAuthorized = result.isAuthorized; |
| | | this.authorizedDBNo = result.authorizedDBNo == undefined ? '' : result.authorizedDBNo; |
| | | this.estimationDecision = result.estimationDecision == undefined ? '' : result.estimationDecision; |
| | | this.siDecideID = result.siDecideID == undefined ? '' : result.siDecideID; |
| | | this.name = result.name == undefined ? '' : result.name; |
| | | this.opportunityNo = result.opportunityNo == undefined ? '' : result.opportunityNo; |
| | | this.isAuthorized = result.isAuthorized == undefined ? '' : result.isAuthorized; |
| | | this.opporSplite(); |
| | | }) |
| | | } |
| | | opporSplite(){ |
| | | this.authorizedDBNo = 'test'; |
| | | if(this.recordId == '已终止'){ |
| | | this.showToast("需求表已终止,不能拆单","error"); |
| | | }else if(this.authorizedDBNo == ''){ |
| | |
| | | }else if(this.siDecideID == ''){ |
| | | this.showToast("需求表未批准,不能拆单","error"); |
| | | }else if(this.recordId != '草案中' && this.recordId != '已提交' && this.recordId != '已终止'){ |
| | | console.log("sss"); |
| | | window.open( |
| | | this.recordId |
| | | "/" |
| | | + this.recordId |
| | | + "/e?clone=1&retURL=%2F" |
| | | + this.recordId + "&00N10000002Cbwh=*&CF00N10000006qHai=" |
| | | + this.name + "&00Np0000001DOwi=***&00Np0000001CxmR=" |
| | |
| | | + this.recordId + "&00N10000006qHav=" |
| | | + this.opportunityNo + "&00N10000009Glvn=" |
| | | + this.isAuthorized + "&00N10000008pnmd=1&00N10000002DXkZ=&00N10000002DXke=&00N10000002CmTf=&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb" |
| | | ); |
| | | ); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-14 17:15:33 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-14 17:20:45 |
| | | * @LastEditTime: 2023-05-12 14:43:54 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-14 11:09:28 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-14 11:21:24 |
| | | * @LastEditTime: 2023-05-12 13:17:30 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.biddingProjectNameBidId = result.biddingProjectNameBidId; |
| | | this.estimationId = result.estimationId; |
| | | this.biddingProjectNameBidId = result.biddingProjectNameBidId == undefined ? '' : result.biddingProjectNameBidId; |
| | | this.estimationId = result.estimationId == undefined ? '' : result.estimationId; |
| | | this.quotationRequest(); |
| | | }) |
| | | } |
| | |
| | | salesAssistantName; |
| | | salesAssistantID; |
| | | profileId; |
| | | systemProfileId; |
| | | s1ProfileId; |
| | | s4ProfileId; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.stageName = result.stageName; |
| | | this.sapSendOK = result.sapSendOK; |
| | | this.cntLostCancelReport = result.cntLostCancelReport; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft; |
| | | this.agency1 = result.agency1; |
| | | this.agency1Id = result.agency1Id; |
| | | this.name = result.name; |
| | | this.bidPlannedDate = result.bidPlannedDate; |
| | | this.salesAssistantName = result.salesAssistantName; |
| | | this.salesAssistantID = result.salesAssistantID; |
| | | this.profileId = result.profileId; |
| | | console.log(result); |
| | | this.stageName = result.stageName == undefined ? '' : result.stageName; |
| | | this.sapSendOK = result.sapSendOK == undefined ? '' : result.sapSendOK; |
| | | this.cntLostCancelReport = result.cntLostCancelReport == undefined ? '' : result.cntLostCancelReport; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft == undefined ? '' : result.cntLostCancelDraft; |
| | | this.agency1 = result.agency1 == undefined ? '' : result.agency1; |
| | | this.agency1Id = result.agency1Id == undefined ? '' : result.agency1Id; |
| | | this.name = result.name == undefined ? '' : result.name; |
| | | this.bidPlannedDate = result.bidPlannedDate == undefined ? '' : result.bidPlannedDate.replace(/-/g, '/');; |
| | | this.salesAssistantName = result.salesAssistantName == undefined ? '' : result.salesAssistantName; |
| | | this.salesAssistantID = result.salesAssistantID == undefined ? '' : result.salesAssistantID; |
| | | this.profileId = result.profileId == undefined ? '' : result.profileId; |
| | | this.systemProfileId = result.systemProfileId == undefined ? '' : result.systemProfileId; |
| | | this.s1ProfileId = result.s1ProfileId == undefined ? '' : result.s1ProfileId; |
| | | this.s4ProfileId = result.s4ProfileId == undefined ? '' : result.s4ProfileId; |
| | | this.requestDB(); |
| | | }) |
| | | } |
| | | requestDB(){ |
| | | var profileId = this.profileId; |
| | | if (profileId != '00e10000000Y3o5' && profileId != '00e10000000xnp2' && |
| | | profileId != '00e10000000xnpH') { |
| | | if (profileId != this.systemProfileId && profileId != this.s1ProfileId && |
| | | profileId != this.s4ProfileId) { |
| | | this.showToast("您没有授权委托的权限。请联系系统管理员。","error"); |
| | | } |
| | | // jsの場合、翻訳された値がでるので、要注意 |
| | | else if (this.stageName != '引合' |
| | | && this.stageName != '询价' |
| | | ) { |
| | | this.showToast("状态1:" + this.stageName + "、不能做授权申请!",""); |
| | | this.showToast("状态1:" + this.stageName + "、不能做授权申请!","error"); |
| | | } |
| | | else if (this.sapSendOK == '1') { |
| | | this.showToast("已经上传SAP、不能做授权申请了!","error"); |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 14:08:56 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-05-09 10:04:33 |
| | | * @LastEditTime: 2023-05-15 09:13:55 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | export default class LexVOCConfirm extends LightningElement { |
| | | @api recordId; |
| | | status; |
| | | VOCSatisfy; |
| | | VOCSatisfy1; |
| | | satisfy; |
| | | satisfy1; |
| | | Isloading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.status = result.status; |
| | | this.VOCSatisfy = result.Satisfy; |
| | | this.VOCSatisfy1 = result.Satisfy1; |
| | | console.log(this.VOCSatisfy); |
| | | console.log(this.VOCSatisfy1); |
| | | console.log(this.status); |
| | | this.satisfy = result.satisfy; |
| | | this.satisfy1 = result.satisfy1; |
| | | this.update(); |
| | | } |
| | | }).catch(error => { |
| | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.VOCSatisfy == undefined) { |
| | | if (this.satisfy == undefined) { |
| | | this.showToast("请选择是否满意","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | updateForVOCConfirmButton({ |
| | | recordId: this.recordId, |
| | | Satisfy: this.VOCSatisfy, |
| | | Satisfy1: this.VOCSatisfy1 |
| | | satisfy: this.sSatisfy, |
| | | satisfy1: this.satisfy1 |
| | | }).then(result=>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |