From 666b1cff3d705a53d07cd3ee6d146a7ef7ac7754 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 26 六月 2023 17:13:11 +0800
Subject: [PATCH] Merge branch 'LEX_chenjingwu_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_chenjingwu_dev
---
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.html | 7
force-app/main/default/classes/OpportunityLightingButtonController.cls | 42 +
force-app/main/default/pages/ImprovedForecastTime.page | 2
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.html | 14
force-app/main/default/lwc/lexCopyPI/lexCopyPI.js-meta.xml | 11
force-app/main/default/classes/lexSolutionProgrammeController.cls-meta.xml | 5
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls | 137 ++++
force-app/main/default/classes/lexAccountController.cls-meta.xml | 5
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.html | 10
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js | 59 ++
force-app/main/default/classes/lexAgencyHospitalController.cls | 17
force-app/main/default/classes/lexAgencyHospitalController.cls-meta.xml | 5
force-app/main/default/lwc/lexCopyPI/lexCopyPI.html | 14
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.html | 5
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.test.js | 8
force-app/main/default/lwc/lexCopyPI/lexCopyPI.js | 46 +
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js | 38 +
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js | 87 +++
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js | 98 +++
force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js-meta.xml | 11
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.html | 5
force-app/main/default/classes/lexLightingButtonConstant.cls-meta.xml | 2
force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.test.js | 8
force-app/main/default/classes/ReportController.cls | 83 ++
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js | 65 ++
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js | 90 +++
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.html | 5
force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.test.js | 8
force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js-meta.xml | 11
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js-meta.xml | 11
force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.html | 15
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js-meta.xml | 11
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js | 69 ++
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js | 148 +++++
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/__tests__/lexSpecilaApplyCreateLwc.test.js | 8
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls-meta.xml | 5
force-app/main/default/classes/lexLightingButtonConstant.cls | 9
force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js-meta.xml | 11
force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.test.js | 8
force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.test.js | 8
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js | 59 ++
force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.html | 5
force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.test.js | 8
force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.test.js | 8
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js-meta.xml | 4
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js-meta.xml | 11
force-app/main/default/lwc/lexOPDReport/lexOPDReport.js | 161 +++++
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js-meta.xml | 11
force-app/main/default/classes/lexAccountController.cls | 30 +
force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js-meta.xml | 11
force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.css | 0
/dev/null | 32 -
force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.test.js | 8
force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js-meta.xml | 11
force-app/main/default/classes/OCMManagementProvinceWebService.cls | 2
force-app/main/default/lwc/lexOPDReport/lexOPDReport.html | 5
force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.html | 5
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html | 6
force-app/main/default/classes/lexSolutionProgrammeController.cls | 48 +
force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.test.js | 8
60 files changed, 1,543 insertions(+), 91 deletions(-)
diff --git a/force-app/main/default/classes/OCMManagementProvinceWebService.cls b/force-app/main/default/classes/OCMManagementProvinceWebService.cls
index 1038471..8e4dde3 100644
--- a/force-app/main/default/classes/OCMManagementProvinceWebService.cls
+++ b/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';
diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls b/force-app/main/default/classes/OpportunityLightingButtonController.cls
index 0f25b22..b7d7a02 100644
--- a/force-app/main/default/classes/OpportunityLightingButtonController.cls
+++ b/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;
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/ReportController.cls b/force-app/main/default/classes/ReportController.cls
index 9afd242..76a56d9 100644
--- a/force-app/main/default/classes/ReportController.cls
+++ b/force-app/main/default/classes/ReportController.cls
@@ -2,6 +2,44 @@
鐢ㄤ簬缁檒wc鐨刯s鍒濆鍖栨暟鎹拰瀵硅褰曡繘琛宒ml鎿嶄綔锛屾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;
+ }
//缁橵OC瀹屾瘯鐩稿簲鐨刯s鎻愪緵鍒濆鍖栨暟鎹�
@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;
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexAccountController.cls b/force-app/main/default/classes/lexAccountController.cls
new file mode 100644
index 0000000..1cc2bfe
--- /dev/null
+++ b/force-app/main/default/classes/lexAccountController.cls
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexAccountController.cls-meta.xml b/force-app/main/default/classes/lexAccountController.cls-meta.xml
new file mode 100644
index 0000000..45cccbd
--- /dev/null
+++ b/force-app/main/default/classes/lexAccountController.cls-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexAgencyHospitalController.cls b/force-app/main/default/classes/lexAgencyHospitalController.cls
new file mode 100644
index 0000000..c879ca5
--- /dev/null
+++ b/force-app/main/default/classes/lexAgencyHospitalController.cls
@@ -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{
+
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexAgencyHospitalController.cls-meta.xml b/force-app/main/default/classes/lexAgencyHospitalController.cls-meta.xml
new file mode 100644
index 0000000..45cccbd
--- /dev/null
+++ b/force-app/main/default/classes/lexAgencyHospitalController.cls-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexLightingButtonConstant.cls b/force-app/main/default/classes/lexLightingButtonConstant.cls
index 498e06e..ba0f1f2 100644
--- a/force-app/main/default/classes/lexLightingButtonConstant.cls
+++ b/force-app/main/default/classes/lexLightingButtonConstant.cls
@@ -71,6 +71,10 @@
public static final String RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE = '璺熷彴';
//鎶ュ憡涔︾殑璁板綍绫诲瀷鈥極PD鈥�
public static final String RECORD_TYPE_NAME_BY_OPD= 'OPD';
+ //鎶ュ憡涔︾殑璁板綍绫诲瀷鈥楽IS-ENG鈥�
+ public static final String RECORD_TYPE_NAME_BY_SIS_ENG= 'SIS-ENG';
+ //鎶ュ憡涔︾殑璁板綍绫诲瀷鈥楽IS-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 = '闈炲璞�';
diff --git a/force-app/main/default/classes/lexLightingButtonConstant.cls-meta.xml b/force-app/main/default/classes/lexLightingButtonConstant.cls-meta.xml
index 9bbf7b4..fbbad0a 100644
--- a/force-app/main/default/classes/lexLightingButtonConstant.cls-meta.xml
+++ b/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>
\ No newline at end of file
+</ApexClass>
diff --git a/force-app/main/default/classes/lexSolutionProgrammeController.cls b/force-app/main/default/classes/lexSolutionProgrammeController.cls
new file mode 100644
index 0000000..e663a8e
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProgrammeController.cls
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexSolutionProgrammeController.cls-meta.xml b/force-app/main/default/classes/lexSolutionProgrammeController.cls-meta.xml
new file mode 100644
index 0000000..45cccbd
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProgrammeController.cls-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
new file mode 100644
index 0000000..0b4b579
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls-meta.xml b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls-meta.xml
new file mode 100644
index 0000000..45cccbd
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.test.js
similarity index 72%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.test.js
index 3ab1eb3..e905952 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexClosingCaseFlow/__tests__/lexClosingCaseFlow.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
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.css b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.css
similarity index 100%
rename from force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.css
rename to force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.css
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.html b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.html
similarity index 80%
rename from force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.html
rename to force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.html
index 2dfa0c5..2d30661 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.html
+++ b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js
new file mode 100644
index 0000000..48030b9
--- /dev/null
+++ b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js
@@ -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');
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js-meta.xml b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js-meta.xml
similarity index 77%
rename from force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js-meta.xml
rename to force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.js-meta.xml
index 5354ac9..19d7893 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js-meta.xml
+++ b/force-app/main/default/lwc/lexClosingCaseFlow/lexClosingCaseFlow.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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.test.js
similarity index 72%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.test.js
index 3ab1eb3..38ec186 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexCopyPI/__tests__/lexCopyPI.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
diff --git a/force-app/main/default/lwc/lexCopyPI/lexCopyPI.html b/force-app/main/default/lwc/lexCopyPI/lexCopyPI.html
new file mode 100644
index 0000000..f66d1fa
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPI/lexCopyPI.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPI/lexCopyPI.js b/force-app/main/default/lwc/lexCopyPI/lexCopyPI.js
new file mode 100644
index 0000000..29d758e
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPI/lexCopyPI.js
@@ -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'
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPI/lexCopyPI.js-meta.xml b/force-app/main/default/lwc/lexCopyPI/lexCopyPI.js-meta.xml
new file mode 100644
index 0000000..709c8f7
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPI/lexCopyPI.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.test.js
similarity index 72%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.test.js
index 3ab1eb3..4ff3651 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexCopyPIASEActivity/__tests__/lexCopyPIASEActivity.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
diff --git a/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.html b/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.html
new file mode 100644
index 0000000..addf11d
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js b/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js
new file mode 100644
index 0000000..94b71e5
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js
@@ -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'
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js-meta.xml b/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js-meta.xml
new file mode 100644
index 0000000..329e839
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIASEActivity/lexCopyPIASEActivity.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.test.js
similarity index 72%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.test.js
index 3ab1eb3..422765a 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexNewAgencyHospital/__tests__/lexNewAgencyHospital.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
diff --git a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.html b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.html
new file mode 100644
index 0000000..d044dbb
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="exampleHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
new file mode 100644
index 0000000..b0deed5
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js
@@ -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
+ }
+ });
+ }
+ }
+}
diff --git a/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js-meta.xml b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewAgencyHospital/lexNewAgencyHospital.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.test.js
similarity index 72%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.test.js
index 3ab1eb3..943c21f 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexNewSolutonPro/__tests__/lexNewSolutonPro.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
diff --git a/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.html b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.html
new file mode 100644
index 0000000..629bde7
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="reportHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js
new file mode 100644
index 0000000..61d3127
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js
@@ -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());
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js-meta.xml b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexNewSolutonPro/lexNewSolutonPro.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReport/lexOPDReport.html b/force-app/main/default/lwc/lexOPDReport/lexOPDReport.html
new file mode 100644
index 0000000..af7bc51
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReport/lexOPDReport.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="holder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReport/lexOPDReport.js b/force-app/main/default/lwc/lexOPDReport/lexOPDReport.js
new file mode 100644
index 0000000..5ff2566
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReport/lexOPDReport.js
@@ -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 璁﹗ser鑷繁閫夋嫨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
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReport/lexOPDReport.js-meta.xml b/force-app/main/default/lwc/lexOPDReport/lexOPDReport.js-meta.xml
new file mode 100644
index 0000000..2d27159
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReport/lexOPDReport.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
index 15ad499..baa2d12 100644
--- a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
+++ b/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;">
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js b/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js
deleted file mode 100644
index cbb6767..0000000
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/lexSpecilaApplyCreate.js
+++ /dev/null
@@ -1,32 +0,0 @@
-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';
-export default class LexSpecilaApplyCreate extends NavigationMixin(LightningElement) {
- @api oppId;
- @api oppName;
- @api oppForecastStatus;
- msg;
- IsLoading = true;
- connectedCallback(){
- // 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: '01210000000gTCW'
- // }
- });
- // var url = 'a3W/e?RecordType=01210000000gTCW&CF00N10000008qvFQ='+ encodeURIComponent(this.oppName) + '&CF00N10000008qvFQ_lkid='+ encodeURIComponent(this.oppId) + '&00N10000008qvFX='+ encodeURIComponent(this.oppForecastStatus)+'&retURL='+ encodeURIComponent(this.oppId);
- // window.location.href = url;
- }
-}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.test.js
similarity index 78%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.test.js
index 3ab1eb3..f97eb79 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/__tests__/lexSpecilaApplyCreateAch.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
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.html b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.html
new file mode 100644
index 0000000..af7bc51
--- /dev/null
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="holder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js
new file mode 100644
index 0000000..342acc2
--- /dev/null
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js
@@ -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());
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js-meta.xml b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js-meta.xml
new file mode 100644
index 0000000..768aca4
--- /dev/null
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateAch/lexSpecilaApplyCreateAch.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/__tests__/lexSpecilaApplyCreateLwc.test.js
similarity index 78%
rename from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
rename to force-app/main/default/lwc/lexSpecilaApplyCreateLwc/__tests__/lexSpecilaApplyCreateLwc.test.js
index 3ab1eb3..f7262ab 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/__tests__/lexSpecilaApplyCreateLwc.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
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.html b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.html
new file mode 100644
index 0000000..af7bc51
--- /dev/null
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="holder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js
new file mode 100644
index 0000000..d7b04dd
--- /dev/null
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js
@@ -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());
+ }
+}
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js-meta.xml b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js-meta.xml
new file mode 100644
index 0000000..62fdec9
--- /dev/null
+++ b/force-app/main/default/lwc/lexSpecilaApplyCreateLwc/lexSpecilaApplyCreateLwc.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.test.js
similarity index 69%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.test.js
index 3ab1eb3..38f7779 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexSubmitSolutionForApproval/__tests__/lexSubmitSolutionForApproval.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
diff --git a/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.html b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.html
new file mode 100644
index 0000000..8fef32d
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.html
@@ -0,0 +1,5 @@
+<template>
+ <div class="submitSolutionForApprovalHolder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
new file mode 100644
index 0000000..08d011f
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
@@ -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('鍙厑鍏舵垬鐣ョ瀹や富鎷呫�佷骇鍝佹媴褰撳強鐪佺粡鐞嗘彁浜olution椤圭洰闇�姹傦紒','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;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js-meta.xml b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.test.js
similarity index 66%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.test.js
index 3ab1eb3..fc668d1 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/__tests__/lexSubmitSolutionSchemeForApproval.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
diff --git a/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.html b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.html
new file mode 100644
index 0000000..429de8a
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js
new file mode 100644
index 0000000..91df026
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js
@@ -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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js-meta.xml b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js-meta.xml
new file mode 100644
index 0000000..c307012
--- /dev/null
+++ b/force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js b/force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.test.js
similarity index 72%
copy from force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
copy to force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.test.js
index 3ab1eb3..5532a72 100644
--- a/force-app/main/default/lwc/lexSpecilaApplyCreate/__tests__/lexSpecilaApplyCreate.test.js
+++ b/force-app/main/default/lwc/lexUpdateToOpp/__tests__/lexUpdateToOpp.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
diff --git a/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.html b/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.html
new file mode 100644
index 0000000..e274769
--- /dev/null
+++ b/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.html
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js b/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js
new file mode 100644
index 0000000..6809eb6
--- /dev/null
+++ b/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js
@@ -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('鏄惁灏哋CSM绠$悊鐪佺殑鎷呭綋鑰呬俊鎭弽鏄犲埌鍏宠仈璇环锛�');
+ }
+ 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('寮�濮嬫墽琛宐atch锛岃绛夊緟鎵ц瀹屾瘯銆�','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;
+ }
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js-meta.xml b/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js-meta.xml
new file mode 100644
index 0000000..3392981
--- /dev/null
+++ b/force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js-meta.xml
@@ -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>
\ No newline at end of file
diff --git a/force-app/main/default/pages/ImprovedForecastTime.page b/force-app/main/default/pages/ImprovedForecastTime.page
index b22d112..2845c61 100644
--- a/force-app/main/default/pages/ImprovedForecastTime.page
+++ b/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" />
--
Gitblit v1.9.1