19626
2023-06-26 666b1cff3d705a53d07cd3ee6d146a7ef7ac7754
Merge branch 'LEX_chenjingwu_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_chenjingwu_dev
39个文件已添加
1个文件已删除
4 文件已重命名
9 文件已复制
7个文件已修改
1634 ■■■■■ 已修改文件
force-app/main/default/classes/OCMManagementProvinceWebService.cls 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OpportunityLightingButtonController.cls 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ReportController.cls 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexAccountController.cls 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexAccountController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexAgencyHospitalController.cls 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexAgencyHospitalController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexLightingButtonConstant.cls 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexLightingButtonConstant.cls-meta.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexSolutionProgrammeController.cls 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexSolutionProgrammeController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls-meta.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.css 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js-meta.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPI/lexCopyPI.html 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPI/lexCopyPI.js 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPI/lexCopyPI.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.html 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOPDReport/lexOPDReport.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/__tests__/lexSpecilaApplyCreateLwc.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.html 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.test.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.html 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/ImprovedForecastTime.page 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/OCMManagementProvinceWebService.cls
@@ -1,5 +1,5 @@
global class OCMManagementProvinceWebService {
    @AuraEnabled
    WebService static String updateOpportunity() {
        Id execBTId = Database.executeBatch(new OCMManagementProvinceBatch(null), 200);
        return '1';
force-app/main/default/classes/OpportunityLightingButtonController.cls
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-12 11:16:07
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-05 13:59:58
 * @LastEditTime: 2023-06-25 13:10:39
 */
public with sharing class OpportunityLightingButtonController {
    @AuraEnabled
@@ -458,6 +458,42 @@
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForSpecilaApplyCreateButton(String recordId){
        InitData res = new InitData();
        try {
            Opportunity opp = [
                select
                Forecast_this_month__c
                from Opportunity where Id =: recordId
            ];
            res.oppForecastStatus = opp.Forecast_this_month__c;
            res.recordTypeId = Schema.SObjectType.OpportunitySpecialApply__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForSpecilaApplyCreateAchButton(String recordId){
        InitData res = new InitData();
        try {
            Statu_Achievements__c ach = [
                select
                Id,
                Monthly_forecast_shipping__c,
                Opportunity__c
                from Statu_Achievements__c where Id =: recordId
            ];
            res.oppId = ach.Opportunity__c;
            res.oppForecastStatus = ach.Monthly_forecast_shipping__c;
            res.recordTypeId = Schema.SObjectType.OpportunitySpecialApply__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE_ACH).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static string updateForAgencyAuthorizeButton(String recordId){
        try {
@@ -846,5 +882,9 @@
        public String reportForCNYId;
        @AuraEnabled
        public String reportForUSDId;
        @AuraEnabled
        public String oppForecastStatus;
        @AuraEnabled
        public String oppId;
    }
}
force-app/main/default/classes/ReportController.cls
@@ -2,6 +2,44 @@
用于给lwc的js初始化数据和对记录进行dml操作,此controller属于报告书
*/
public with sharing class ReportController {
    @AuraEnabled
    public static InitData initForOPDReportConsumButton(String recordId){
        InitData res = new initData();
        try {
            Consum_Apply__c con = [select RA_Status__c,Product_category__c,Id,Hospital__c,Strategic_dept__c,Account__c from Consum_Apply__c where Id =: recordId];
            res.raStatus = con.RA_Status__c;
            res.productCategory = con.Product_category__c;
            res.consumApplyId = con.Id;
            res.hospital = con.Hospital__c;
            res.strategicDept = con.Strategic_dept__c;
            res.account = con.Account__c;
            res.recordTypeId1 = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ENG).getRecordTypeId();
            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ET).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForOPDReportButton(String recordId){
        InitData res = new initData();
        try {
            Rental_Apply__c rent = [select RA_Status__c,Asset_return_day2__c,Hospital__c,Strategic_dept__c,Account__c,OPDPlan__c,Follow_UP_Opp__c,demo_purpose2__c from Rental_Apply__c where Id =: recordId];
            res.raStatus = rent.RA_Status__c;
            res.assetReturnDay2 = rent.Asset_return_day2__c;
            res.hospitalId = rent.Hospital__c;
            res.strategicDeptId = rent.Strategic_dept__c;
            res.accountId = rent.Account__c;
            res.demoPurpose2 = rent.demo_purpose2__c;
            res.followUPOpp = rent.Follow_UP_Opp__c;
            res.opdPlan = rent.OPDPlan__c;
            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    //给VOC完毕相应的js提供初始化数据
    @AuraEnabled
    public static InitData initForVOCFinishButton (String recordId) {
@@ -248,7 +286,7 @@
        try {
            Report__c rac = new Report__c();
            rac.Id = recordId;
            rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
            rac.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
            update rac;
            return null;
        } catch (Exception e) {
@@ -284,7 +322,7 @@
        try {
            rac.Id = recordId;
            rac.Status__c = LightingButtonConstant.STATUS_COMPLETE;
            rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.VOC_NAME).getRecordTypeId();
            rac.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.VOC_NAME).getRecordTypeId();
            update rac;
            return null;
        } catch (Exception e) {
@@ -317,7 +355,7 @@
        Report__c rac = new Report__c();
        try {
            rac.Id = recordId;
            rac.RecordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE).getRecordTypeId();
            rac.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE).getRecordTypeId();
            update rac;
            return null;
        } catch (Exception e) {
@@ -413,6 +451,8 @@
            return eMessage.substring(left,right);
        }
    }
    //VOC回答更新相应数据
    @AuraEnabled
    public static String updateForVOCAnswerButton(String recordId){
@@ -610,10 +650,37 @@
        public String huDiAnId;
        @AuraEnabled
        public String systemProfileId;
        @AuraEnabled
        public String raStatus;
        @AuraEnabled
        public String productCategory;
        @AuraEnabled
        public String hospitalId;
        @AuraEnabled
        public String hospital;
        @AuraEnabled
        public String strategicDeptId;
        @AuraEnabled
        public String strategicDept;
        @AuraEnabled
        public String accountId;
        @AuraEnabled
        public String account;
        @AuraEnabled
        public String rentalApplyId;
        @AuraEnabled
        public String consumApplyId;
        @AuraEnabled
        public String recordTypeId;
        @AuraEnabled
        public String recordTypeId1;
        @AuraEnabled
        public Date assetReturnDay2;
        @AuraEnabled
        public String followUPOpp;
        @AuraEnabled
        public String demoPurpose2;
        @AuraEnabled
        public String opdPlan;
    }
}
force-app/main/default/classes/lexAccountController.cls
New file
@@ -0,0 +1,30 @@
public with sharing class lexAccountController {
    @AuraEnabled
    public static InitData initForNewSolutonProButton(String recordId){
        InitData res = new InitData();
        try {
            Account acc = [
                select
                Id,
                Hospital__r.Salesdepartment_HP__c,
                Hospital__r.Id,
                Hospital__r.OCM_Category__c
                from Account where Id =: recordId
            ];
            res.hospitalSalesdepartmentHP = acc.Hospital__r.Salesdepartment_HP__c;
            res.hospitalId = acc.Hospital__r.Id;
            res.hospitalOCMCategory = acc.Hospital__r.OCM_Category__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    class InitData{
        @AuraEnabled
        public String hospitalSalesdepartmentHP;
        @AuraEnabled
        public String hospitalId;
        @AuraEnabled
        public String hospitalOCMCategory;
    }
}
force-app/main/default/classes/lexAccountController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/lexAgencyHospitalController.cls
New file
@@ -0,0 +1,17 @@
public with sharing class lexAgencyHospitalController {
    @AuraEnabled
    public static InitData queryForAgencyHospitalRecordType(String recordId){
        InitData res = new InitData();
        try {
            RecordType recordType = [
                select Id from RecordType where DeveloperName = 'AHospital' and SobjectType = 'Agency_Hospital_Link__c'
            ];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
    }
    class InitData{
    }
}
force-app/main/default/classes/lexAgencyHospitalController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/lexLightingButtonConstant.cls
@@ -71,6 +71,10 @@
     public static final String RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE = '跟台';
      //报告书的记录类型‘OPD’
      public static final String RECORD_TYPE_NAME_BY_OPD= 'OPD';
      //报告书的记录类型‘SIS-ENG’
      public static final String RECORD_TYPE_NAME_BY_SIS_ENG= 'SIS-ENG';
      //报告书的记录类型‘SIS-ET’
      public static final String RECORD_TYPE_NAME_BY_SIS_ET= 'SIS-ET';
      //QIS的记录类型‘3.OSH’
      public static final String RECORD_TYPE_NAME_BY_OSH= '3.OSH';
      //QIS的记录类型‘4.OSH回答完毕’
@@ -85,6 +89,10 @@
      public static final String RECORD_TYPE_NAME_BY_INQUIRY_FOLLOW_UP = '询价跟进';
      //授权申请的记录类型‘授权申请’
      public static final String RECORD_TYPE_NAME_BY_AUTHORIZATION_REQUEST = '授权申请';
      //52 询价注残特殊对应的记录类型‘询价特殊对应’
      public static final String RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE = '询价特殊对应';
      //52 询价注残特殊对应的记录类型‘注残特殊对应’
      public static final String RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE_ACH = '注残特殊对应';
      //报表名‘报价产品’
      public static final String REPORT_NAME_FOR_CNY = '报价产品';
      //报表名‘产品的询价’
@@ -119,6 +127,7 @@
    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 M2_PROFILE_NAME = '2M2_市场产品本部担当';
    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 = '非对象';
force-app/main/default/classes/lexLightingButtonConstant.cls-meta.xml
@@ -2,4 +2,4 @@
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <status>Active</status>
</ApexClass>
</ApexClass>
force-app/main/default/classes/lexSolutionProgrammeController.cls
New file
@@ -0,0 +1,48 @@
public with sharing class lexSolutionProgrammeController {
    @AuraEnabled
    public static InitData initSubmitSolutionSchemeForApprovalButton(String recordId){
        InitData res = new InitData();
        try {
            Solution_Programme__c so = [
                select
                Scheme_Type__c,
                Confirmation_Result__c
                from Solution_Programme__c where Id =: recordId
            ];
            res.schemeType = so.Scheme_Type__c;
            res.confirmationResult = so.Confirmation_Result__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static List<solutionClosingAttachment__c> queryForAttachments(String Id){
        List<solutionClosingAttachment__c> so = new List<solutionClosingAttachment__c>();
        try {
            so = [select id,name from solutionClosingAttachment__c where Solution_Programme__c =: Id];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }
    @AuraEnabled
    public static string updateSubmitSolutionSchemeForApprovalButton(String recordId){
        Solution_Programme__c so = new Solution_Programme__c();
        try {
            so.Id = recordId;
            so.Submint_TF__c = true;
            update so;
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    class InitData{
        @AuraEnabled
        public String schemeType;
        @AuraEnabled
        public String confirmationResult;
    }
}
force-app/main/default/classes/lexSolutionProgrammeController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
New file
@@ -0,0 +1,137 @@
public with sharing class lexSolutionProjectRequirementsController {
    @AuraEnabled
    public static InitData initSubmitSolutionForApprovalButton(String recordId){
        InitData res = new InitData();
        try {
            SolutionProjectRequirements__c so = [
                select
                Status__c,
                Submit_Date_YouWant__c,
                CreatedDate,
                Department_Class__r.Id,
                Product_Leader__c
                from SolutionProjectRequirements__c where Id =: recordId
            ];
            res.status = so.Status__c;
            res.submitDateYouWant = so.Submit_Date_YouWant__c;
            res.createdDate = so.CreatedDate;
            res.departmentClassId = so.Department_Class__r.Id;
            res.productLeader = so.Product_Leader__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForClosingCaseFlowButton(String recordId){
        InitData res = new InitData();
        try {
            SolutionProjectRequirements__c so = [
                select
                Status__c
                from SolutionProjectRequirements__c where Id =: recordId
            ];
            res.status = so.Status__c;
            res.profileId = UserInfo.getProfileId();
            res.m2ProfileId = lexLightingButtonConstant.M2_PROFILE_NAME;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static string updateSubmitSolutionForApprovalButton(String recordId){
        SolutionProjectRequirements__c so = new SolutionProjectRequirements__c();
        try {
            so.Id = recordId;
            so.Submint_TF__c = true;
            so.Submitter__c = UserInfo.getUserId();
            update so;
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    @AuraEnabled
    public static string updateForClosingCaseFlowButton(String recordId){
        SolutionProjectRequirements__c so = new SolutionProjectRequirements__c();
        try {
            so.Id = recordId;
            so.Status__c = '07结案';
            update so;
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    @AuraEnabled
    public static List<Account> queryForAttachments(String Id){
        List<Account> accList = null;
        try {
            accList = [
                select id,
                Department_Class__r.OwnerId,
                Department_Class__r.Owner.SalesManager__c
                from Account where id =: Id
            ];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return accList;
    }
    @AuraEnabled
    public static List<Solution_Programme__c> queryForSolutionProgramme(String recordId){
        List<Solution_Programme__c> so = new List<Solution_Programme__c>();
        try {
            so = [
                select id,
                Scheme_Type__c,
                ApprovalClosingProgramme__c
                from Solution_Programme__c where SolutionProjectRequirements__c =: recordId and Scheme_Type__c = '结案'
            ];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }
    @AuraEnabled
    public static List<solutionClosingAttachment__c> queryForAttachments1(String solprogrammeId){
        List<solutionClosingAttachment__c> so = new List<solutionClosingAttachment__c>();
        try {
            so = [
                select id,name from solutionClosingAttachment__c where Solution_Programme__c =: solprogrammeId
            ];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }
    class InitData{
        @AuraEnabled
        public String status;
        @AuraEnabled
        public Date submitDateYouWant;
        @AuraEnabled
        public Datetime createdDate;
        @AuraEnabled
        public String departmentClassId;
        @AuraEnabled
        public String userId;
        @AuraEnabled
        public String userName;
        @AuraEnabled
        public String productLeader;
        @AuraEnabled
        public String profileId;
        @AuraEnabled
        public String m2ProfileId;
    }
}
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls-meta.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <status>Active</status>
</ApexClass>
force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexClosingCaseFlow from 'c/lexClosingCaseFlow';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-closing-case-flow', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-closing-case-flow', {
            is: LexClosingCaseFlow
        });
        // Act
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.css
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.html
File was renamed from force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.html
@@ -1,3 +1,11 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 11:23:56
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 11:26:38
-->
<template>
    <div class="holder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
@@ -9,5 +17,5 @@
                    title="Close"  style="color: black;"></lightning-icon>
              <span class="slds-assistive-text">Close</span>
        </button>
    </div>
    </div>
</template>
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js
New file
@@ -0,0 +1,90 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 11:23:56
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 17:51:15
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import init  from '@salesforce/apex/lexSolutionProjectRequirementsController.initForClosingCaseFlowButton';
import updateForClosingCaseFlowButton  from '@salesforce/apex/lexSolutionProjectRequirementsController.updateForClosingCaseFlowButton';
import queryForSolutionProgramme  from '@salesforce/apex/lexSolutionProjectRequirementsController.queryForSolutionProgramme';
import queryForAttachments1 from '@salesforce/apex/lexSolutionProjectRequirementsController.queryForAttachments1';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class LexClosingCaseFlow extends LightningElement {
    @api recordId;
    status;
    profileId;
    m2ProfileId;
    IsLoading = true;
    msg;
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result=>{
            this.status = result.status;
            this.profileId = result.profileId;
            this.m2ProfileId = result.m2ProfileId;
            this.closingCase();
        });
    }
    closingCase(){
        if(this.profileId != this.m2ProfileId){
            this.msg = '只有GIR窗口可以结案';
            this.Isloading = false;
            return;
        }else if(this.status == '07结案'){
            this.msg = '该项目已经结案';
            this.Isloading = false;
            return;
        }else{
            queryForSolutionProgramme({
                recordId: this.recordId
            }).then(result=>{
                var Solprogramme = result;
                if(Solprogramme.length > 0){
                    if(Solprogramme[0].ApprovalClosingProgramme__c != 'true'){
                        this.msg = '结案方案还未通过审批,不能结案';
                        this.Isloading = false;
                        return;
                    }else{
                        queryForAttachments1({
                            recordId: this.recordId
                        }).then(result=>{
                            var records= result;
                            if(records.length > 0){
                                updateForClosingCaseFlowButton({
                                    recordId: this.recordId
                                }).then(result=>{
                                    if(result){
                                        this.msg = result;
                                        this.Isloading = false;
                                        return;
                                    }
                                    this.closeAction();
                                });
                            }else{
                                this.msg = '结案前请先新建并上传结案附件';
                                this.Isloading = false;
                                return;
                            }
                        });
                    }
                }else{
                    this.msg = '没有结案方案不能结案';
                    this.Isloading = false;
                    return;
                }
            });
        }
    }
    closeAction(){
        window.open("/"+this.recordId,'_self');
    }
}
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js-meta.xml
File was renamed from force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js-meta.xml
@@ -16,9 +16,7 @@
    <targetConfigs> 
        <targetConfig targets="lightning__FlowScreen"> 
            <!-- name js中使用的变量,从屏幕流中获取参数  label 在屏幕流的该LWC的设置中显示 --> 
            <property name="oppId" type="String" label="oppId"/>
            <property name="oppName" type="String" label="oppName"/>
            <property name="oppForecastStatus" type="String" label="oppForecastStatus"/>
            <property name="recordId" type="String" label="recordId"/>
        </targetConfig> 
    </targetConfigs>
</LightningComponentBundle>
force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexCopyPI from 'c/lexCopyPI';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-copy-pi', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-copy-pi', {
            is: LexCopyPI
        });
        // Act
force-app/main/default/lwc/lexCopyPI/lexCopyPI.html
New file
@@ -0,0 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 10:22:50
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 11:09:31
-->
<template>
    <div class="lexCopyPIHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexCopyPI/lexCopyPI.js
New file
@@ -0,0 +1,46 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 10:22:50
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 11:10:10
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
export default class LexCopyPI extends NavigationMixin(LightningElement) {
    @api recordId;
    @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[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Address__c',
                actionName: 'clone',
                recordId: this.recordId
            },
            state: {
                nooverride: '1'
            }
        });
    }
}
force-app/main/default/lwc/lexCopyPI/lexCopyPI.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
     <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexCopyPIASEActivity from 'c/lexCopyPIASEActivity';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-copy-piase-activity', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-copy-piase-activity', {
            is: LexCopyPIASEActivity
        });
        // Act
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.html
New file
@@ -0,0 +1,14 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 11:08:00
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 11:09:52
-->
<template>
    <div class="copyPIASEActivityHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js
New file
@@ -0,0 +1,38 @@
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
export default class LexCopyPIASEActivity extends NavigationMixin(LightningElement) {
    @api recordId;
    @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[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'ASEActivity__c',
                actionName: 'clone',
                recordId: this.recordId
            },
            state: {
                nooverride: '1'
            }
        });
    }
}
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexNewAgencyHospital from 'c/lexNewAgencyHospital';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-new-agency-hospital', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-new-agency-hospital', {
            is: LexNewAgencyHospital
        });
        // Act
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="exampleHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
New file
@@ -0,0 +1,59 @@
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { NavigationMixin } from 'lightning/navigation';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
export default class LexNewAgencyHospital extends LightningElement {
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
            console.log(111);
            console.log(currentPageReference);
        if (currentPageReference) {
          const urlValue = currentPageReference.state.recordId;
          if (urlValue) {
            let str = `${urlValue}`;
            console.log("str");
            console.log(str);
            this.recordId = str;
          }
        }
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
    connectedCallback(){
        var doubleFlg = false;
        if(!doubleFlg) {
        doubleFlg = true;
        const defaultValues = encodeDefaultFieldValues({
            Agency__c: this.recordId,
            Name: '*'
        });
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Agency_Hospital_Link__c',
                actionName: 'new'
            },
            state: {
                nooverride: '1',
                defaultFieldValues: defaultValues
            }
        });
        }
    }
}
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexNewSolutonPro from 'c/lexNewSolutonPro';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-new-soluton-pro', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-new-soluton-pro', {
            is: LexNewSolutonPro
        });
        // Act
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="reportHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js
New file
@@ -0,0 +1,87 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-25 13:21:05
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-25 17:18:27
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import init  from '@salesforce/apex/lexAccountController.initForNewSolutonProButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import SolutionHBLabel from '@salesforce/label/c.Solution_HB';
import SolutionHBLabel from '@salesforce/label/c.Solution_DB';
import SolutionHBLabel from '@salesforce/label/c.Solution_XB';
import SolutionHBLabel from '@salesforce/label/c.Solution_XN';
import SolutionHBLabel from '@salesforce/label/c.Solution_HD';
import SolutionHBLabel from '@salesforce/label/c.Solution_HN';
export default class LexNewSolutonPro extends LightningElement {
    @api accountId;
    hospitalSalesdepartmentHP;
    hospitalId;
    hospitalOCMCategory;
    salesAssistant;
    @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.accountId = str;
          }
        }
    }
    connectedCallback(){
        init({
            recordId: this.accountId
        }).then(result=>{
            this.hospitalId = result.hospitalId;
            this.hospitalOCMCategory = result.hospitalOCMCategory;
            this.hospitalSalesdepartmentHP = result.hospitalSalesdepartmentHP;
            this.newSolutonPro();
        });
    }
    newSolutonPro(){
        if(this.hospitalSalesdepartmentHP == '1.华北'){
            this.salesAssistant = $A.get("$Label.");
        }else if(this.hospitalSalesdepartmentHP == '2.东北'){
            this.salesAssistant = $A.get("$Label.c.");
        }else if(this.hospitalSalesdepartmentHP == '3.西北'){
            this.salesAssistant = $A.get("$Label.c.");
        }else if(this.hospitalSalesdepartmentHP == '4.西南'){
            this.salesAssistant = $A.get("$Label.c.");
        }else if(this.hospitalSalesdepartmentHP == '5.华东'){
            this.salesAssistant = $A.get("$Label.c.");
        }else if(this.hospitalSalesdepartmentHP == '6.华南'){
            this.salesAssistant = $A.get("$Label.c.");
        }else{
            this.salesAssistant = '';
        }
        const defaultValues = encodeDefaultFieldValues({
            Hospital__c: this.hospitalId == undefined ? '' : this.hospitalId,
            Department_Class__c: this.accountId == undefined ? '' : this.accountId,
            Sales_Assistant__c: this.salesAssistant == undefined ? '' : this.salesAssistant
        });
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'SolutionProjectRequirements__c',
                actionName: 'new'
            },
            state: {
                defaultFieldValues: defaultValues
            }
        });
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexOPDReport/lexOPDReport.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="holder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js
New file
@@ -0,0 +1,161 @@
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';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/ReportController.initForOPDReportButton';
export default class LexOPDReport extends NavigationMixin(LightningElement) {
    @api recordId;
    assetReturnDay2;
    demoPurpose2;
    followUPOpp;
    opdPlan;
    raStatus;
    hospital;
    strategicDept;
    account;
    recordTypeId;
    msg;
    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;
          }
        }
    }
    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 }});
    }
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result=>{
            console.log(result);
            this.assetReturnDay2 = result.assetReturnDay2;
            this.demoPurpose2 = result.demoPurpose2;
            this.followUPOpp = result.followUPOpp;
            this.opdPlan = result.opdPlan;
            this.raStatus = result.raStatus;
            this.hospital = result.hospitalId;
            this.strategicDept = result.strategicDeptId;
            this.account = result.accountId;
            this.recordTypeId = result.recordTypeId;
            this.OPDReportConsum();
        });
    }
    OPDReportConsum(){
        var status = this.raStatus;
        if(status != "已出库" && status != "申请者已收货" && status != "医院已装机确认" && status != "已回寄" && status != "已回收" && status != "完了" && status != "欠品中"){
            this.msg = "备品借出状态:" + status + ",不能创建报告书!";
            this.showToast(this.msg,'error');
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
        //var d = new Date("{!Rental_Apply__c.Asset_return_day2__c}");
        //var d15 = new Date("{!Rental_Apply__c.Asset_return_day2__c}");
        //d15.setDate(d.getDate()+7);
        //if(status == "已回寄" && ( new Date()< d || new Date() > d15)){
        // alert("备品借出状态:" + status + ",但不在回寄日之后7天之内,不能创建报告书!");
        // return;
        //}
        //2021/7/15 fxk Start
        // var str;
        // var url;
        // str='&RecordType=01210000000RLTi';
        // url = '/a0B/e?retURL=%2Fa0B%2Fo'+str;
        //2021/7/15 fxk End
        //SWAG-BVW8CW 20201217 让user自己选择recordtype
        //目的2为---试用(有询价) 带询价
        var demo_purpose2 = this.demoPurpose2;
        // var strs ;
        if(demo_purpose2=='试用(有询价)'){
            const defaultValues = encodeDefaultFieldValues({
                Loaner_request_no1__c: this.recordId, // 关联主记录 ID
                Hospital_Reference__c: this.hospital,
                Department_Class_Ref__c: this.strategicDept,
                Report_OPDPlan__c: this.opdPlan,
                Hospital_Department__c: this.account,
                Opportunity1__c: this.followUPOpp,
                Opportunity_Situation__c: '跟进询价',
            });
            this[NavigationMixin.Navigate]({
                type: 'standard__objectPage',
                attributes: {
                    objectApiName: 'Report__c',
                    actionName: 'new'
                },
                state: {
                    nooverride: '1',
                    defaultFieldValues: defaultValues,
                    recordTypeId: this.recordTypeId
                }
            });
            this.dispatchEvent(new CloseActionScreenEvent());
            // strs='&CF00N10000002DT68=' + this.followUPOpp +
            // '&CF00N10000002DT68_lkid=' + this.followUPOppId +
            // '&00N10000002DHk5=跟进询价'
            return;
        }
        //Before Update by LiJun 20220321 end
        //After Update by LiJun 20220321 start
        const defaultValues = encodeDefaultFieldValues({
            Loaner_request_no1__c: this.recordId, // 关联主记录 ID
            Hospital_Reference__c: this.hospital,
            Department_Class_Ref__c: this.strategicDept,
            Report_OPDPlan__c: this.opdPlan,
            Hospital_Department__c: this.account
        });
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Report__c',
                actionName: 'new'
            },
            state: {
                nooverride: '1',
                defaultFieldValues: defaultValues,
                recordTypeId: this.recordTypeId
            }
        });
        this.dispatchEvent(new CloseActionScreenEvent());
        // url = url + '&CF00N10000004maf3=' + this.name +
        // '&CF00N10000004maf3_lkid=' + this.recordId +
        // '&CF00N10000002DPUD=' + this.hospital +
        // '&CF00N10000002DPUD_lkid=' + this.hospitalId +
        // '&CF00N10000002Dh0f=' + this.strategicDept +
        // '&CF00N10000002Dh0f_lkid='+ this.strategicDeptId +
        // '&CF00N10000008ps6d=' + this.opdPlan +
        // '&CF00N10000008ps6d_lkid=' + this.opdPlanId +
        // '&CF00N10000002CWW4=' + this.account +
        // '&CF00N10000002CWW4_lkid=' + this.accountId;
        //After Update by LiJun 20220321 end
    }
}
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
   <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-20 17:16:48
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-06 14:00:41
 * @LastEditTime: 2023-06-25 17:28:26
-->
<template>
    
@@ -45,7 +45,7 @@
                    </lightning-layout>
                        <lightning-accordion allow-multiple-sections-open class="myAccordion">
                                <template for:each={LostReport.LostBrands} for:item="brand" for:index="i">
                                    <li key={brand.index}>
                                    <li key={brand}>
                                        <lightning-accordion-section class="" data-id={i} name="失单品牌" label="失单品牌">
                                            <lightning-button name="save" label="保存" onclick={saveBrandJs}></lightning-button>
                                            <lightning-button name={i} label="删除" onclick={deleteBrandJs} disabled={isBrandCount2}></lightning-button>
@@ -223,7 +223,7 @@
                        </lightning-layout>
                            <lightning-accordion allow-multiple-sections-open class="myAccordion">
                                    <template for:each={LostReport.LostBrands} for:item="brand" for:index="i">
                                        <li key={brand.index}>
                                        <li key={brand}>
                                            <lightning-accordion-section class="text-container" data-id={i} name="失单品牌" label="失单品牌">
                                                <lightning-layout>
                                                    <lightning-layout-item size="2" style="border-style:solid;border-width: 1px;">
force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js
File was deleted
force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexSpecilaApplyCreateAch from 'c/lexSpecilaApplyCreateAch';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-specila-apply-create-ach', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-specila-apply-create-ach', {
            is: LexSpecilaApplyCreateAch
        });
        // Act
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="holder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js
New file
@@ -0,0 +1,69 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-25 10:54:07
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-25 13:04:02
 */
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';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForSpecilaApplyCreateAchButton';
export default class LexSpecilaApplyCreateAch extends NavigationMixin(LightningElement) {
    @api achId;
    oppId;
    forecastStatus;
    recordTypeId;
    @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.achId = str;
          }
        }
    }
    connectedCallback(){
        init({
            recordId: this.achId
        }).then(result=>{
            console.log(result);
            this.oppId = result.oppId;
            this.forecastStatus = result.forecastStatus;
            this.recordTypeId = result.recordTypeId;
            this.specilaApplyCreateAch();
        });
    }
    specilaApplyCreateAch(){
        const defaultValues = encodeDefaultFieldValues({
            Opportunity__c: this.oppId == undefined ? '' : this.oppId, // 关联主记录 ID
            Achievements__c: this.achId == undefined ? '' : this.achId,
            Apply_Content_Old__c: this.forecastStatus == undefined ? '' : this.forecastStatus
        });
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'OpportunitySpecialApply__c',
                actionName: 'new'
            },
            state: {
                defaultFieldValues: defaultValues,
                RecordTypeId: this.recordTypeId
            }
        });
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/__tests__/lexSpecilaApplyCreateLwc.test.js
File was renamed from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexSpecilaApplyCreateLwc from 'c/lexSpecilaApplyCreateLwc';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-specila-apply-create-lwc', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-specila-apply-create-lwc', {
            is: LexSpecilaApplyCreateLwc
        });
        // Act
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="holder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js
New file
@@ -0,0 +1,65 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-25 10:06:08
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-25 10:54:46
 */
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';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForSpecilaApplyCreateButton';
export default class LexSpecilaApplyCreateLwc extends NavigationMixin(LightningElement) {
    @api oppId;
    oppName;
    oppForecastStatus;
    IsLoading = true;
    recordTypeId;
    @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.oppId = str;
          }
        }
    }
    connectedCallback(){
        init({
            recordId: this.oppId
        }).then(result=>{
            this.oppForecastStatus = result.oppForecastStatus;
            this.recordTypeId = result.recordTypeId;
            this.specilaApplyCreate();
        });
    }
    specilaApplyCreate(){
        const defaultValues = encodeDefaultFieldValues({
            Opportunity__c: this.oppId, // 关联主记录 ID
            Apply_Content_Old__c: this.oppForecastStatus == undefined ? '' : this.oppForecastStatus
        });
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'OpportunitySpecialApply__c',
                actionName: 'new'
            },
            state: {
                defaultFieldValues: defaultValues,
                RecordTypeId: this.recordTypeId
            }
        });
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
     <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexSubmitSolutionForApproval from 'c/lexSubmitSolutionForApproval';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-submit-solution-for-approval', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-submit-solution-for-approval', {
            is: LexSubmitSolutionForApproval
        });
        // Act
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="submitSolutionForApprovalHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
New file
@@ -0,0 +1,148 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-20 14:37:24
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-20 17:50:52
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import updateSubmitSolutionForApprovalButton  from '@salesforce/apex/lexSolutionProjectRequirementsController.updateSubmitSolutionForApprovalButton';
import init  from '@salesforce/apex/lexSolutionProjectRequirementsController.initSubmitSolutionForApprovalButton';
import queryForAttachments  from '@salesforce/apex/lexSolutionProjectRequirementsController.queryForAttachments';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
export default class LexSubmitSolutionForApproval extends LightningElement {
    @api recordId;
    status;
    submitDateYouWant;
    createdDate;
    departmentClassId;
    userId;
    userName;
    productLeader;
    @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;
          }
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result=>{
            this.status = result.status;
            this.submitDateYouWant = result.submitDateYouWant;
            this.createdDate = result.createdDate;
            this.departmentClassId = result.departmentClassId;
            this.userId = result.userId;
            this.userName = result.userName;
            this.submitSolutionForApproval();
        });
    }
    submitSolutionForApproval(){
        if(this.status == '07结案'){
            this.showToast('已结案','error');
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
        if(this.submitDateYouWant < this.createdDate + 3){
            this.showToast('希望提交日期不得小于三天,如紧急需求请邮件联络Solution担当','error');
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
        queryForAttachments({
            Id: this.departmentClassId
        }).then(result=>{
            var records = result;
            var header = this.productLeader;
            var usrname = this.userName;
            var rtn = '';
            if(header.contains(usrname.replaceAll(' ', ''))){
                rtn = 'Y';
            }else{
                rtn = 'N';
            }
            if(records.length > 0){
                if(rtn != 'Y' && this.userId != records[0].Department_Class__r.OwnerId && this.userId != records[0].Department_Class__r.Owner.SalesManager__c){
                    this.showToast('只允其战略科室主担、产品担当及省经理提交solution项目需求!','error');
                    this.dispatchEvent(new CloseActionScreenEvent());
                    return;
                }
            }
            //111111111111111111111111111111111111111111
            this.handleConfirmClick('一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?');
        });
    }
    async handleConfirmClick(msg) {
        const result = await LightningConfirm.open({
            message: msg,
            variant: 'headerless',
            label: 'this is the aria-label value',
        });
        console.log(result);
        if(result){
            updateSubmitSolutionForApprovalButton({
                recordId: this.recordId
            }).then(results=>{
                try {
                   if(results){
                        this.showToast(results,"error");
                        this.dispatchEvent(new CloseActionScreenEvent());
                   }
                } catch (error) {
                    if(err.faultstring !=undefined && err.faultstring.indexOf('INVALID_SESSION_ID') != -1) {
                        this.showToast('当前网页已登出,请您重新登录后刷新该网页!','error');
                        this.dispatchEvent(new CloseActionScreenEvent());
                    } else {
                        this.showToast(err.faultstring,'error');
                        this.dispatchEvent(new CloseActionScreenEvent());
                    }
                    return;
                }
                this.updateRecordView(this.recordId);
            });
            // isopd.Id = "{!SolutionProjectRequirements__c.Id}";
            // isopd.Submint_TF__c = true;
            // isopd.Submitter__c = "{!$User.Id}";
        }else{
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
    }
}
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexSubmitSolutionSchemeForApproval from 'c/lexSubmitSolutionSchemeForApproval';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-submit-solution-scheme-for-approval', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-submit-solution-scheme-for-approval', {
            is: LexSubmitSolutionSchemeForApproval
        });
        // Act
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.html
New file
@@ -0,0 +1,7 @@
<template>
    <div class="submitSolutionSchemeForApprovalHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js
New file
@@ -0,0 +1,98 @@
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import updateSubmitSolutionSchemeForApprovalButton  from '@salesforce/apex/lexSolutionProgrammeController.updateSubmitSolutionSchemeForApprovalButton';
import init  from '@salesforce/apex/lexSolutionProgrammeController.initSubmitSolutionSchemeForApprovalButton';
import queryForAttachments  from '@salesforce/apex/lexSolutionProgrammeController.queryForAttachments';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
export default class LexSubmitSolutionSchemeForApproval extends LightningElement {
    @api recordId;
    schemeType;
    confirmationResult;
    records;
    @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;
          }
        }
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result=>{
            this.schemeType = result.schemeType == undefined ? result.schemeType : '';
            this.confirmationResult = result.confirmationResult == undefined ? result.confirmationResult : '';
            this.submitSolutionSchemeForApproval();
        });
    }
    submitSolutionSchemeForApproval(){
        queryForAttachments({
            Id: this.recordId
        }).then(result=>{
            this.records = result;
            this.handleConfirmClick('一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?');
        });
    }
    async handleConfirmClick(msg) {
        const result = await LightningConfirm.open({
            message: msg,
            variant: 'headerless',
            label: 'this is the aria-label value',
        });
        console.log(result);
        if(result){
            if(this.schemeType == '结案' && this.confirmationResult == ''){
                this.showToast('结案方案提交前,方案采纳结果必填','error');
                this.dispatchEvent(new CloseActionScreenEvent());
                return;
            }
            if((this.records.length > 0 && this.schemeType == '结案') || (this.schemeType == '初次')){
                updateSubmitSolutionSchemeForApprovalButton({
                    recordId: this.recordId
                }).then(result=>{
                    if(result){
                        this.showToast(result,'error');
                    }else{
                        this.updateRecordView(this.recordId);
                    }
                    this.dispatchEvent(new CloseActionScreenEvent());
                });
            }else{
                this.showToast('结案的方案提交前,必须上传结案附件','error');
                this.dispatchEvent(new CloseActionScreenEvent());
                return;
            }
            // window.location.reload();
        }else{
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
    }
}
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
     <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.test.js
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js copy to force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.test.js
File was copied from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
@@ -1,7 +1,7 @@
import { createElement } from 'lwc';
import LexSpecilaApplyCreate from 'c/lexSpecilaApplyCreate';
import LexUpdateToOpp from 'c/lexUpdateToOpp';
describe('c-lex-specila-apply-create', () => {
describe('c-lex-update-to-opp', () => {
    afterEach(() => {
        // The jsdom instance is shared across test cases in a single file so reset the DOM
        while (document.body.firstChild) {
@@ -11,8 +11,8 @@
    it('TODO: test case generated by CLI command, please fill in test logic', () => {
        // Arrange
        const element = createElement('c-lex-specila-apply-create', {
            is: LexSpecilaApplyCreate
        const element = createElement('c-lex-update-to-opp', {
            is: LexUpdateToOpp
        });
        // Act
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.html
New file
@@ -0,0 +1,15 @@
<!--
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 10:42:48
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 10:44:48
-->
<template>
    <div class="updateToOppHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
        <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button>
    </div>
</template>
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js
New file
@@ -0,0 +1,59 @@
/*
 * @Description:
 * @version:
 * @Author: chen jing wu
 * @Date: 2023-06-21 10:42:48
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-21 10:55:05
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
import updateOpportunity from '@salesforce/apex/OCMManagementProvinceWebService.updateOpportunity';
export default class LexUpdateToOpp extends LightningElement {
    showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
    }
    connectedCallback(){
        this.handleConfirmClick('是否将OCSM管理省的担当者信息反映到关联询价?');
    }
    async handleConfirmClick(msg) {
        const result = await LightningConfirm.open({
            message: msg,
            variant: 'headerless',
            label: 'this is the aria-label value',
        });
        console.log(result);
        if(result){
            try {
                updateOpportunity().then(result1=>{
                    var rtn = result1;
                    if (rtn == '1') {
                        this.showToast('开始执行batch,请等待执行完毕。','success');
                    } else {
                        this.showToast(rtn,'error');
                    }
                    this.dispatchEvent(new CloseActionScreenEvent());
                });
                } catch(e) {
                    if (e.faultcode == 'sf:INSUFFICIENT_ACCESS') {
                        this.showToast('没有执行权限。','error');
                    } else {
                        this.showToast(e,'error');
                    }
                    this.dispatchEvent(new CloseActionScreenEvent());
                }
        }else{
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
    }
}
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>54.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordPage</target>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>
force-app/main/default/pages/ImprovedForecastTime.page
@@ -1,4 +1,4 @@
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变">
<apex:page showHeader="false" sidebar="false" id="ImprovedForecastTimeApp" title="预测日期改变" lightningStylesheets="true">
    <apex:includeLightning />
    <div style="width:100%;height:100%;" id="ImprovedForecastTimeApp" />