From 4661adc43f549036f4e6e44debe92521c5793083 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 06 六月 2023 11:06:36 +0800
Subject: [PATCH] 修改页面以及按钮
---
force-app/main/default/pages/Xin_SearchOpportunity.page | 2
force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js | 62 +++-
force-app/main/default/classes/OpportunityLightingButtonController.cls | 12
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js | 179 +++++---------
force-app/main/default/pages/QuoteTrial.page | 2
force-app/main/default/classes/lexLightingButtonConstant.cls | 8
force-app/main/default/pages/AccountCaseTab.page | 2
force-app/main/default/pages/Xin_SearchMaintenanceContract.page | 2
force-app/main/default/classes/OpportunityWebService.cls | 2
force-app/main/default/pages/Xin_SearchVisitorPlace_Campaign.page | 2
force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js | 10
force-app/main/default/pages/Xin_SearchVisitorPlace_Sales.page | 2
force-app/main/default/lwc/lexASACEditor/lexASACEditor.js | 34 ++
force-app/main/default/pages/CM_SearchDepartmentService.page | 2
force-app/main/default/lwc/lexRequestDB/lexRequestDB.js | 68 +++-
force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js | 34 ++
force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js | 19 +
force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js | 43 ++-
force-app/main/default/pages/MaintenanceDailyReport.page | 2
force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js | 81 ++++--
force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js | 43 ++-
force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js | 17 +
force-app/main/default/pages/CM_SearchDepartment.page | 2
force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html | 36 --
force-app/main/default/pages/CampaignMemberEditAndDelete.page | 2
force-app/main/default/pages/CM_SearchOpportunity.page | 2
force-app/main/default/classes/lexPCLLostReportLwcController.cls | 29 +
27 files changed, 424 insertions(+), 275 deletions(-)
diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls b/force-app/main/default/classes/OpportunityLightingButtonController.cls
index fbdcf8a..0f25b22 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-05-31 17:32:51
+ * @LastEditTime: 2023-06-05 13:59:58
*/
public with sharing class OpportunityLightingButtonController {
@AuraEnabled
@@ -184,6 +184,7 @@
res.systemProfileId = getProfileIdByName(lexLightingButtonConstant.SYSTEM_PROFILE_NAME);
res.s1ProfileId = getProfileIdByName(lexLightingButtonConstant.S1_PROFILE_NAME);
res.s4ProfileId = getProfileIdByName(lexLightingButtonConstant.S4_PROFILE_NAME);
+ res.recordTypeId = Schema.SObjectType.Request_tedner_doc__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_AUTHORIZATION_REQUEST).getRecordTypeId();
} catch (Exception e) {
System.debug('e:****' + e);
}
@@ -305,7 +306,11 @@
CurrencyIsoCode
from Opportunity where Id =: recordId
];
+ Report cnyReport = [SELECT Id FROM Report WHERE Name = :lexLightingButtonConstant.REPORT_NAME_FOR_CNY limit 1];
+ Report usdReport = [SELECT Id FROM Report WHERE Name = :lexLightingButtonConstant.REPORT_NAME_FOR_USD limit 1];
res.currencyIsoCode = opportunity.CurrencyIsoCode;
+ res.reportForCNYId = cnyReport.Id;
+ res.reportForUSDId = usdReport.Id;
} catch (Exception e) {
throw new AuraHandledException(e.getMessage());
}
@@ -426,6 +431,7 @@
res.accountId = opp.AccountId;
res.accountName = acc.Name;
res.name = opp.Name;
+ res.recordTypeId = Schema.SObjectType.Task.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_INQUIRY_FOLLOW_UP).getRecordTypeId();
} catch (Exception e) {
throw new AuraHandledException(e.getMessage());
}
@@ -836,5 +842,9 @@
public String accountName;
@AuraEnabled
public String recordTypeId;
+ @AuraEnabled
+ public String reportForCNYId;
+ @AuraEnabled
+ public String reportForUSDId;
}
}
\ No newline at end of file
diff --git a/force-app/main/default/classes/OpportunityWebService.cls b/force-app/main/default/classes/OpportunityWebService.cls
index d5bd86b..7eb86b8 100644
--- a/force-app/main/default/classes/OpportunityWebService.cls
+++ b/force-app/main/default/classes/OpportunityWebService.cls
@@ -1,5 +1,5 @@
global class OpportunityWebService {
-
+ @AuraEnabled
WebService static String changeTrade(String oppId){
List<Quote> quoList = [select id from Quote where OpportunityId = :oppId];
diff --git a/force-app/main/default/classes/lexLightingButtonConstant.cls b/force-app/main/default/classes/lexLightingButtonConstant.cls
index 21b2694..a8207e4 100644
--- a/force-app/main/default/classes/lexLightingButtonConstant.cls
+++ b/force-app/main/default/classes/lexLightingButtonConstant.cls
@@ -79,6 +79,14 @@
public static final String RECORD_TYPE_NAME_BY_COMP= '5.鐜板満缁撴';
//澶卞崟鍙栨秷鎶ュ憡鐨勮褰曠被鍨嬧�樿浠峰彇娑堟姤鍛娾��
public static final String RECORD_TYPE_NAME_BY_OPPO_CANCEL_REPORT = '璇环鍙栨秷鎶ュ憡';
+ //浠诲姟鐨勮褰曠被鍨嬧�樿浠疯窡杩涒��
+ public static final String RECORD_TYPE_NAME_BY_INQUIRY_FOLLOW_UP = '璇环璺熻繘';
+ //鎺堟潈鐢宠鐨勮褰曠被鍨嬧�樻巿鏉冪敵璇封��
+ public static final String RECORD_TYPE_NAME_BY_AUTHORIZATION_REQUEST = '鎺堟潈鐢宠';
+ //鎶ヨ〃鍚嶁�樻姤浠蜂骇鍝佲��
+ public static final String REPORT_NAME_FOR_CNY = '鎶ヤ环浜у搧';
+ //鎶ヨ〃鍚嶁�樹骇鍝佺殑璇环鈥�
+ public static final String REPORT_NAME_FOR_USD = '浜у搧鐨勮浠�';
//璁板綍绫诲瀷鐨刣eveloperName鈥楢SRCDecision鈥�
public static final String DEVELOPER_NAME_ASRC_DECISION = 'ASRCDecision';
//璁板綍绫诲瀷鐨刣eveloperName鈥楢SACDecision鈥�
diff --git a/force-app/main/default/classes/lexPCLLostReportLwcController.cls b/force-app/main/default/classes/lexPCLLostReportLwcController.cls
index 6adf98b..3a4b157 100644
--- a/force-app/main/default/classes/lexPCLLostReportLwcController.cls
+++ b/force-app/main/default/classes/lexPCLLostReportLwcController.cls
@@ -494,7 +494,7 @@
}
// 鏁版嵁褰曞叆
@AuraEnabled
- public static Map<String,String> dataEntry(String report1){
+ public static Map<String,String> dataEntry(String report1,List<Id> deleteBrandIdList,List<Id> deleteProductIdList){
LostReport report = (LostReport)JSON.deserialize(report1, LostReport.class);
Map<String,String> messageMap = new Map <String,String>();
system.debug('save---start:');
@@ -543,30 +543,32 @@
map<string,PCLLostProduct__c> upsertLostProductMap = new map<string,PCLLostProduct__c>();
// 闇�瑕佸垹鎺夌殑澶卞崟鍝佺墝
list<PCLLostProduct__c> deleteLostProductList = new list<PCLLostProduct__c>();
+ Integer lineNo = 0;
for(LostBrand tempLostBrand : report.LostBrands ) {
// 濡傛灉鏈夊け鍗曞搧鐗岋紝閭d箞灏辫鎻掑叆鏇存柊锛�
system.debug('tempLostBrand.lostBrand.Lost_By_Company__c:'+tempLostBrand.lostBrand.Lost_By_Company__c);
if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) {
- upsertLostBrandMap.put(tempLostBrand.lineNo,tempLostBrand.lostBrand);
- tempLostBrand.lostBrand.Lost_cancel_report__c = report.lostReport.id;
+ upsertLostBrandMap.put(lineNo,tempLostBrand.lostBrand);
+ tempLostBrand.lostBrand.Lost_cancel_report__c = report.lostReport.Id;
tempLostBrand.lostBrand.Name = tempLostBrand.lostBrand.Lost_By_Company__c;
integer tempNo = 0;
for( PCLLostProducts tempLostProduct : tempLostBrand.LostProducts) {
system.debug('Name:'+ tempLostProduct.LostProductss.Name );
if(tempLostProduct.LostProductss.Quantity__c !=null && tempLostProduct.LostProductss.Quantity__c >0) {
tempLostProduct.LostProductss.Name = tempLostBrand.lostBrand.Name + tempLostProduct.LostProductss.Quantity__c;
- upsertLostProductMap.put(tempLostBrand.lineNo +':'+ tempNo,tempLostProduct.LostProductss);
- }else if(string.isNotBlank(tempLostProduct.LostProductss.id)) {
+ upsertLostProductMap.put(lineNo +':'+ tempNo,tempLostProduct.LostProductss);
+ }else if(string.isNotBlank(tempLostProduct.LostProductss.Id)) {
deleteLostProductList.add(tempLostProduct.LostProductss);
}
tempNo++;
}
}
// 濡傛灉娌℃湁鍝佺墝锛屼絾鏄湁id锛� 杩欐牱鏁版嵁闇�瑕佸垹闄�
- else if(string.isNotBlank(tempLostBrand.lostBrand.id)) {
- deleteLostBrandMap.put(tempLostBrand.lineNo,tempLostBrand.lostBrand);
+ else if(string.isNotBlank(tempLostBrand.lostBrand.Id )) {
+ deleteLostBrandMap.put(lineNo,tempLostBrand.lostBrand);
// 杩欓噷鍙兘闇�瑕佷篃鍒ゆ柇涓�涓嬪け鍗曞瀷鍙锋湁娌℃湁闇�瑕佸垹鎺�
}
+ lineNo++;
}
if(upsertLostBrandMap.size()>0) {
upsert upsertLostBrandMap.values();
@@ -574,7 +576,7 @@
for( string productNo :upsertLostProductMap.keyset()) {
PCLLostProduct__c tempLostProduct = upsertLostProductMap.get(productNo);
integer brandNo = integer.valueof(productNo.split(':')[0]);
- tempLostProduct.PCLLostBrand__c = upsertLostBrandMap.get(brandNo).id;
+ tempLostProduct.PCLLostBrand__c = upsertLostBrandMap.get(brandNo).Id;
}
if(upsertLostProductMap.size()>0) {
upsert upsertLostProductMap.values();
@@ -582,13 +584,20 @@
if(deleteLostBrandMap.size()>0) {
delete deleteLostBrandMap.values();
for(PCLLostBrand__c pcl: deleteLostBrandMap.values()) {
- pcl.id = null;
+ pcl.Id = null;
}
+ }
+ if (deleteProductIdList.size()>0) {
+ database.delete(deleteProductIdList);
+
+ }
+ if (deleteBrandIdList.size()>0) {
+ database.delete(deleteBrandIdList);
}
if(deleteLostProductList.size()>0) {
delete deleteLostProductList;
for(PCLLostProduct__c pclp: deleteLostProductList) {
- pclp.id = null;
+ pclp.Id = null;
}
}
if(deleteBrandIDSet.size() > 0) {
diff --git a/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js
index 9346ff3..5b3b34f 100644
--- a/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js
+++ b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js
@@ -4,13 +4,14 @@
* @Author: chen jing wu
* @Date: 2023-05-08 14:36:32
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-26 15:57:45
+ * @LastEditTime: 2023-06-01 10:37:01
*/
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import init from '@salesforce/apex/ReportController.initForASACEditorButton';
import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
export default class LexASACEditor extends NavigationMixin(LightningElement) {
@api recordId;
lastModifiedDate
@@ -69,10 +70,35 @@
editor(){
if (this.id != undefined){
- this.url = "/apex/RepPAEDecisionRecord?Id="+this.id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision";
+ const defaultValues = encodeDefaultFieldValues({
+ nooverride: '1',
+ Id: this.id,
+ ReportId: this.recordId,
+ RecordTypeIds: 'ASACDecision'
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/apex/RepPAEDecisionRecord'
+ },
+ state: defaultValues
+ });
+ // this.url = "/apex/RepPAEDecisionRecord?Id="+this.id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision";
} else {
- this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision";
+ const defaultValues = encodeDefaultFieldValues({
+ nooverride: '1',
+ ReportId: this.recordId,
+ RecordTypeIds: 'ASACDecision'
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/apex/RepPAEDecisionRecord'
+ },
+ state: defaultValues
+ });
+ // this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision";
}
- window.open(this.url,"_self");
+ // window.open(this.url,"_self");
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js
index ba20f69..e875fd5 100644
--- a/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js
+++ b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js
@@ -4,13 +4,14 @@
* @Author: chen jing wu
* @Date: 2023-05-08 14:36:32
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-26 15:57:13
+ * @LastEditTime: 2023-06-01 10:37:17
*/
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import init from '@salesforce/apex/ReportController.initForASRCEditorButton';
import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
export default class LexASRCEditor extends NavigationMixin(LightningElement) {
@api recordId;
lastModifiedDate
@@ -67,10 +68,35 @@
editor(){
if (this.id != undefined){
- this.url = "/apex/RepPAEDecisionRecord?Id="+this.id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision";
+ const defaultValues = encodeDefaultFieldValues({
+ nooverride: '1',
+ Id: this.id,
+ ReportId: this.recordId,
+ RecordTypeIds: 'ASRCDecision'
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__webPage',
+ attributes: {
+ url: '/apex/RepPAEDecisionRecord'
+ },
+ state: defaultValues
+ });
+ // this.url = "/apex/RepPAEDecisionRecord?Id="+this.id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision";
} else {
- this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision";
+ const defaultValues = encodeDefaultFieldValues({
+ ReportId: this.recordId,
+ RecordTypeIds: 'ASRCDecision'
+ });
+ this[NavigationMixin.Navigate]({
+ nooverride: '1',
+ type: 'standard__webPage',
+ attributes: {
+ url: '/apex/RepPAEDecisionRecord'
+ },
+ state: defaultValues
+ });
+ // this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision";
}
- window.open(this.url,"_self");
+ // window.open(this.url,"_self");
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js b/force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js
index 854790a..acfaab3 100644
--- a/force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js
+++ b/force-app/main/default/lwc/lexAssignTaskButton/lexAssignTaskButton.js
@@ -4,17 +4,20 @@
* @Author: chen jing wu
* @Date: 2023-05-15 11:14:32
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-15 11:50:12
+ * @LastEditTime: 2023-06-05 14:01:14
*/
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForAssignTaskButtonButton';
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
export default class LexAssignTaskButton extends LightningElement {
@api recordId;
accountName;
accountId;
oppName;
+ recordTypeId;
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
console.log(111);
@@ -37,6 +40,7 @@
this.accountId = result.accountId;
this.accountName = result.accountName;
this.oppName = result.name;
+ this.recordTypeId = result.recordTypeId;
this.assignTask();
}).catch(error=>{
console.log("error");
@@ -44,25 +48,43 @@
});
}
assignTask(){
- //鍩虹璺緞
- var url = '/setup/ui/recordtypeselect.jsp?ent=01I100000016llf';
- //璁板綍绫诲瀷
- url += '&p3=01210000000cWfw';
- url += '&retURL=%2F';
- url += '&save_new_url=%2Fa3V%2Fe%3FretURL%3D%252Fa3V%252Fo';
- //瀹㈡埛
- url += '&CF00N100000095tn6=' + this.accountName;
- url += '&CF00N100000095tn6_lkid=' + this.accountId;
- //璇环
- url += '&CF00N100000095zcA=' + this.oppName;
- url += '&CF00N100000095zcA_lkid=' + this.recordId;
- //浠诲姟鐘舵��
- url += '&00N100000095tnR=01 鍒嗛厤';
- //浠诲姟鍖哄垎
- url += '&00N100000095tnP=涓婄骇鍒嗛厤浠诲姟';
- //浠诲姟鍚嶇О
- url += '&Name=*';
- window.open(url);
+ // //鍩虹璺緞
+ // var url = '/setup/ui/recordtypeselect.jsp?ent=01I100000016llf';
+ // //璁板綍绫诲瀷
+ // url += '&p3=01210000000cWfw';
+ // url += '&retURL=%2F';
+ // url += '&save_new_url=%2Fa3V%2Fe%3FretURL%3D%252Fa3V%252Fo';
+ // //瀹㈡埛
+ // url += '&CF00N100000095tn6=' + this.accountName;
+ // url += '&CF00N100000095tn6_lkid=' + this.accountId;
+ // //璇环
+ // url += '&CF00N100000095zcA=' + this.oppName;
+ // url += '&CF00N100000095zcA_lkid=' + this.recordId;
+ // //浠诲姟鐘舵��
+ // url += '&00N100000095tnR=01 鍒嗛厤';
+ // //浠诲姟鍖哄垎
+ // url += '&00N100000095tnP=涓婄骇鍒嗛厤浠诲姟';
+ // //浠诲姟鍚嶇О
+ // url += '&Name=*';
+ // window.open(url);
+ const defaultValues = encodeDefaultFieldValues({
+ account__c: this.accountId,
+ OpportunityId__c: this.recordId,
+ taskStatus__c: '01 鍒嗛厤',
+ taskDifferent__c: '涓婄骇鍒嗛厤浠诲姟'
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Task',
+ actionName: 'new'
+ },
+ state: {
+ nooverride: '1',
+ defaultFieldValues: defaultValues,
+ recordTypeId: this.recordTypeId
+ }
+ });
this.dispatchEvent(new CloseActionScreenEvent());
}
}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js b/force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js
index 6968bd3..5216575 100644
--- a/force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js
+++ b/force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-05-15 13:17:26
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-24 16:44:21
+ * @LastEditTime: 2023-06-02 10:59:13
*/
/*
* @Description:
@@ -22,7 +22,8 @@
import init from '@salesforce/apex/OpportunityLightingButtonController.initForChangeContractTypeButton';
import changeTrade from '@salesforce/apex/OpportunityLightingButtonController.changeTrade';
import LightningConfirm from 'lightning/confirm';
-export default class LexChangeContractType extends LightningElement {
+import { NavigationMixin } from 'lightning/navigation';
+export default class LexChangeContractType extends NavigationMixin(LightningElement) {
@api recordId;
stageName;
estimationDecision;
@@ -53,16 +54,26 @@
console.log(result);
if(result){
try {
+ console.log("22222");
changeTrade({
oppId: oppId
}).then(result=>{
+ console.log("1111");
str = result;
if(str != '1'){
this.showToast(str,"error");
}
this.IsLoading = false;
this.dispatchEvent(new CloseActionScreenEvent());
- window.location.href = 'https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Opportunity/' + this.recordId + '/view';
+ this[NavigationMixin.Navigate]({
+ type: 'standard__recordPage',
+ attributes: {
+ recordId: this.recordId,
+ objectApiName: 'Opportunity',
+ actionName: 'view'
+ }
+ });
+ // window.location.href = '/lightning/r/Opportunity/' + this.recordId + '/view';
}).catch(error=>{
console.log("error");
console.log(error);
diff --git a/force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js b/force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js
index 5cf2046..91e384a 100644
--- a/force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js
+++ b/force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js
@@ -4,14 +4,16 @@
* @Author: chen jing wu
* @Date: 2023-04-21 14:32:09
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-12 15:25:47
+ * @LastEditTime: 2023-06-05 11:09:35
*/
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForCopyWithAssetButton';
-export default class LexCopyWithAsset extends LightningElement {
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+export default class LexCopyWithAsset extends NavigationMixin(LightningElement) {
@api recordId;
sapSendOK;
name;
@@ -53,16 +55,33 @@
if(this.sapSendOK){
this.showToast("璇环宸茬粡WIN锛屼笉鑳借繘琛屾媶鍗�","error");
} else {
- window.open(
- "/"
- + this.recordId
- + "/e?clone=1&retURL=%2F006p0000004bsox&_CONFIRMATIONTOKEN=VmpFPSxNakF4Tnkwd05DMHdPVlF3TmpvME16bzFPUzR5TWpsYSxuc010bXY2U1MxYWgzTHcwNzdUX0VpLE5HUmlaR013&common.udd.actions.ActionsUtilORIG_URI=%2F006p0000004bsox%2Fe&cloneli=1&CF00N10000006qHai="
- + this.name
- +"&CF00N10000006qHai_lkid="
- + this.recordId
- + "&00N10000009Glvn="
- + this.isAuthorized
- + "&00N10000008pnmd=1&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb");
+ // window.open(
+ // "/"
+ // + this.recordId
+ // + "/e?clone=1&retURL=%2F006p0000004bsox&_CONFIRMATIONTOKEN=VmpFPSxNakF4Tnkwd05DMHdPVlF3TmpvME16bzFPUzR5TWpsYSxuc010bXY2U1MxYWgzTHcwNzdUX0VpLE5HUmlaR013&common.udd.actions.ActionsUtilORIG_URI=%2F006p0000004bsox%2Fe&cloneli=1&CF00N10000006qHai="
+ // + this.name
+ // +"&CF00N10000006qHai_lkid="
+ // + this.recordId
+ // + "&00N10000009Glvn="
+ // + this.isAuthorized
+ // + "&00N10000008pnmd=1&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb");
+
+ const defaultValues = encodeDefaultFieldValues({
+ Old_Opportunity_ID__c: this.recordId,
+ IsAuthorized__c: this.isAuthorized
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Opportunity',
+ actionName: 'clone',
+ recordId: this.recordId
+ },
+ state: {
+ nooverride: '1',
+ defaultFieldValues: defaultValues
+ }
+ });
}
this.dispatchEvent(new CloseActionScreenEvent());
}
diff --git a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
index 453f9df..b7ccc1f 100644
--- a/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
+++ b/force-app/main/default/lwc/lexCreateEvent/lexCreateEvent.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-04-13 13:50:23
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-04-13 14:39:54
+ * @LastEditTime: 2023-06-05 09:13:58
*/
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,7 +12,9 @@
import init from '@salesforce/apex/OpportunityLightingButtonController.initForCreateEventButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-export default class LexCreateEvent extends LightningElement {
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+export default class LexCreateEvent extends NavigationMixin(LightningElement) {
@api recordId;
accountId;
@wire(CurrentPageReference)
@@ -42,7 +44,18 @@
})
}
createEvent(){
- window.open("/00U/e?retURL=%2Fapex%2FVFClosePage&accid=" + this.accountId + "&oid=" + this.recordId, "鏂板缓璁″垝");
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Event',
+ actionName: 'new'
+ },
+ state: {
+ // retURL: '/apex/VFClosePage',
+ accid: this.accountId,
+ oid: this.recordId
+ }
+ });
this.dispatchEvent(new CloseActionScreenEvent());
}
showToast(msg,type) {
diff --git a/force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js b/force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js
index c5dbd36..f038f63 100644
--- a/force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js
+++ b/force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js
@@ -7,7 +7,9 @@
import queryForRecords from '@salesforce/apex/OpportunityLightingButtonController.queryForNewOpportunityAgencyButtonToRecords';
import queryForRecTypeList from '@salesforce/apex/OpportunityLightingButtonController.queryForNewOpportunityAgencyButtonToRecTypeList';
import queryForRecords2 from '@salesforce/apex/OpportunityLightingButtonController.queryForNewOpportunityAgencyButtonToRecords2';
-export default class LexNewOpportunityAgency extends LightningElement {
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+export default class LexNewOpportunityAgency extends NavigationMixin(LightningElement) {
@api recordId;
agency1Id;
agencyOpportunity;
@@ -178,32 +180,57 @@
var ahl = records[0];
try {
- var url = "/a2Y/e?retURL=%2F"
- + this.recordId
- + "&Name='(OLYMPUS)'"
- + encodeURIComponent(this.name)
- + "&RecordType=" + recTypeId + "&" + fId_Close_Forecasted_Date__c + "="
- + encodeURIComponent(this.closeForecastedDate)
- + "&" + fId_Bid_Planned_Date__c + "="
- + encodeURIComponent(this.bidPlannedDate)
- + "&" + fId_OCM_Change_To_Opportunity_Flg__c + "=1" + "&CF" + fId_Agency_Hospital__c + "_lkid=" + ahl.Id + "&CF" + fId_Agency_Hospital__c + "=" + encodeURIComponent(ahl.Name) + "&" + fId_Amount__c + "="
- + encodeURIComponent(this.dealerFinalPrice)
- + "&" + fId_OCMSale_Price__c + "="
- + encodeURIComponent(this.wholesalePrice)
- + "&CF" + fId_Agency__c + "_lkid="
- + encodeURIComponent(this.agency1Id)
- + "&CF" + fId_Agency__c + "="
- + encodeURIComponent(this.agency1Name)
- + "&" + fId_StageName__c + "="
- + encodeURIComponent(this.opportunityStage)
- + "&CF" + fId_Change_To_Opportunity__c + "_lkid="
- + encodeURIComponent(this.recordId )
- + "&CF" + fId_Change_To_Opportunity__c + "="
- + encodeURIComponent(this.name )
- + "&" + fId_Department_Cateogy__c + "="
- + encodeURIComponent(this.opportunityCategory);
- console.log(url);
- window.open(url);
+ // var url = "/a2Y/e?retURL=%2F"
+ // + this.recordId
+ // + "&Name='(OLYMPUS)'"
+ // + encodeURIComponent(this.name)
+ // + "&RecordType=" + recTypeId + "&" + fId_Close_Forecasted_Date__c + "="
+ // + encodeURIComponent(this.closeForecastedDate)
+ // + "&" + fId_Bid_Planned_Date__c + "="
+ // + encodeURIComponent(this.bidPlannedDate)
+ // + "&" + fId_OCM_Change_To_Opportunity_Flg__c + "=1" + "&CF" + fId_Agency_Hospital__c + "_lkid=" + ahl.Id + "&CF" + fId_Agency_Hospital__c + "=" + encodeURIComponent(ahl.Name) + "&" + fId_Amount__c + "="
+ // + encodeURIComponent(this.dealerFinalPrice)
+ // + "&" + fId_OCMSale_Price__c + "="
+ // + encodeURIComponent(this.wholesalePrice)
+ // + "&CF" + fId_Agency__c + "_lkid="
+ // + encodeURIComponent(this.agency1Id)
+ // + "&CF" + fId_Agency__c + "="
+ // + encodeURIComponent(this.agency1Name)
+ // + "&" + fId_StageName__c + "="
+ // + encodeURIComponent(this.opportunityStage)
+ // + "&CF" + fId_Change_To_Opportunity__c + "_lkid="
+ // + encodeURIComponent(this.recordId )
+ // + "&CF" + fId_Change_To_Opportunity__c + "="
+ // + encodeURIComponent(this.name )
+ // + "&" + fId_Department_Cateogy__c + "="
+ // + encodeURIComponent(this.opportunityCategory);
+ // console.log(url);
+ // window.open(url);
+ const defaultValues = encodeDefaultFieldValues({
+ Name: '(OLYMPUS)',
+ Close_Forecasted_Date__c: this.closeForecastedDate,
+ Bid_Planned_Date__c: this.bidPlannedDate,
+ OCM_Change_To_Opportunity_Flg__c: '1',
+ Agency_Hospital__c: ahl.Id,
+ Amount__c: this.dealerFinalPrice,
+ OCMSale_Price__c: this.wholesalePrice,
+ Agency__c: this.agency1Id,
+ StageName__c: this.opportunityStage,
+ Change_To_Opportunity__c: this.recordId,
+ Department_Cateogy__c: this.opportunityCategory,
+ RecordTypeId: recTypeId
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Agency_Opportunity__c',
+ actionName: 'new'
+ },
+ state: {
+ nooverride: '1',
+ defaultFieldValues: defaultValues,
+ }
+ });
this.dispatchEvent(new CloseActionScreenEvent());
} catch (error) {
console.log(error)
diff --git a/force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js b/force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js
index 22d1607..f55c4a5 100644
--- a/force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js
+++ b/force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-04-23 10:09:31
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-15 11:06:07
+ * @LastEditTime: 2023-06-05 11:53:46
*/
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -12,8 +12,9 @@
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import init from '@salesforce/apex/OpportunityLightingButtonController.initForOpporSpliteButton';
-
-export default class LexOpporSplite extends LightningElement {
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+export default class LexOpporSplite extends NavigationMixin(LightningElement) {
@api recordId;
authorizedDBNo;
estimationDecision;
@@ -61,18 +62,30 @@
}else if(this.siDecideID == ''){
this.showToast("闇�姹傝〃鏈壒鍑嗭紝涓嶈兘鎷嗗崟","error");
}else if(this.recordId != '鑽夋涓�' && this.recordId != '宸叉彁浜�' && this.recordId != '宸茬粓姝�'){
- console.log("sss");
- window.open(
- "/"
- + this.recordId
- + "/e?clone=1&retURL=%2F"
- + this.recordId + "&00N10000002Cbwh=*&CF00N10000006qHai="
- + this.name + "&00Np0000001DOwi=***&00Np0000001CxmR="
- + this.opportunityNo + "&CF00N10000006qHai_lkid="
- + this.recordId + "&00N10000006qHav="
- + this.opportunityNo + "&00N10000009Glvn="
- + this.isAuthorized + "&00N10000008pnmd=1&00N10000002DXkZ=&00N10000002DXke=&00N10000002CmTf=&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb"
- );
+ // console.log("sss");
+ // window.open(
+ // "/"
+ // + this.recordId
+ // + "/e?clone=1&retURL=%2F"
+ // + this.recordId + "&00N10000002Cbwh=*&CF00N10000006qHai="
+ // + this.name + "&00Np0000001DOwi=***&00Np0000001CxmR="
+ // + this.opportunityNo + "&CF00N10000006qHai_lkid="
+ // + this.recordId + "&00N10000006qHav="
+ // + this.opportunityNo + "&00N10000009Glvn="
+ // + this.isAuthorized + "&00N10000008pnmd=1&00N10000002DXkZ=&00N10000002DXke=&00N10000002CmTf=&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb"
+ // );
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Opportunity',
+ actionName: 'clone',
+ recordId: this.recordId
+ },
+ state: {
+ nooverride: '1',
+ // defaultFieldValues: defaultValues,
+ }
+ });
}
this.dispatchEvent(new CloseActionScreenEvent());
}
diff --git a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
index f15649e..10c9509 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-05-31 11:44:24
+ * @LastEditTime: 2023-06-06 10:33:07
-->
<template>
@@ -18,12 +18,7 @@
<div style="margin-left: 550px;">
<lightning-layout-item size="12">
<lightning-button label="杩藉姞鍝佺墝" onclick={addBrandJs}></lightning-button>
- <template if:true={isEdit}>
- <lightning-button name="save" label="淇濆瓨1" onclick={saveBrandToEditJs}></lightning-button>
- </template>
- <template if:false={isEdit}>
- <lightning-button name="save" label="淇濆瓨" onclick={saveBrandJs}></lightning-button>
- </template>
+ <lightning-button name="save" label="淇濆瓨" onclick={saveBrandJs}></lightning-button>
<lightning-button label="杩斿洖璇环" onclick={cancel}></lightning-button>
</lightning-layout-item>
</div>
@@ -52,12 +47,7 @@
<template for:each={LostReport.LostBrands} for:item="brand" for:index="i">
<li key={brand.index}>
<lightning-accordion-section class="" data-id={i} name="澶卞崟鍝佺墝" label="澶卞崟鍝佺墝">
- <template if:true={isEdit}>
- <lightning-button name="save" label="淇濆瓨1" onclick={saveBrandToEditJs}></lightning-button>
- </template>
- <template if:false={isEdit}>
- <lightning-button name="save" label="淇濆瓨" onclick={saveBrandJs}></lightning-button>
- </template>
+ <lightning-button name="save" label="淇濆瓨" onclick={saveBrandJs}></lightning-button>
<lightning-button name={i} label="鍒犻櫎" onclick={deleteBrandJs} disabled={isBrandCount2}></lightning-button>
<lightning-layout>
<lightning-layout-item size="4" padding="around-small">
@@ -119,7 +109,7 @@
<template for:each={brand.LostProducts} for:item="product" for:index="j">
<tr class="inputRows" key={product}>
<td>
- <lightning-combobox placeholder={product.LostProductss.LostBrandName__c} class="BrandName" name={j} title={i} options={brandOptions} value={product.LostProductss.LostBrandName__c} onchange={handleLostBrandNameChange} read-only="true"></lightning-combobox>
+ <lightning-combobox placeholder={product.LostProductss.LostBrandName__c} data-id={i} class="BrandName" name={j} title={i} options={brandOptions} value={product.LostProductss.LostBrandName__c} onchange={handleLostBrandNameChange} read-only="true"></lightning-combobox>
</td>
<td>
<!-- <lightning-record-edit-form
@@ -169,12 +159,7 @@
<div class="slds-align_absolute-center">
<lightning-layout-item size="12">
<lightning-button label="杩藉姞鍝佺墝" onclick={addBrandJs}></lightning-button>
- <template if:true={isEdit}>
- <lightning-button name="save" label="淇濆瓨1" onclick={saveBrandToEditJs}></lightning-button>
- </template>
- <template if:false={isEdit}>
- <lightning-button name="save" label="淇濆瓨" onclick={saveBrandJs}></lightning-button>
- </template>
+ <lightning-button name="save" label="淇濆瓨" onclick={saveBrandJs}></lightning-button>
<lightning-button label="杩斿洖璇环" onclick={cancel}></lightning-button>
</lightning-layout-item>
</div>
@@ -204,7 +189,7 @@
<label>澶卞崟绫诲瀷:</label>
</lightning-layout-item>
<lightning-layout-item size="1">
- <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={reportId} density="comfy">
+ <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
<lightning-output-field field-name="LostType__c" variant="label-hidden"></lightning-output-field>
</lightning-record-view-form>
</lightning-layout-item>
@@ -213,7 +198,7 @@
<label>澶卞崟鎬婚噾棰濓紙鍏冿級:</label>
</lightning-layout-item>
<lightning-layout-item size="1">
- <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={reportId} density="comfy">
+ <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
<lightning-output-field field-name="LostTotalAmount__c" variant="label-hidden"></lightning-output-field>
</lightning-record-view-form>
</lightning-layout-item>
@@ -222,7 +207,7 @@
<label>鍖呭惈瓒呭0:</label>
</lightning-layout-item>
<lightning-layout-item size="1">
- <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={reportId} density="comfy">
+ <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
<lightning-output-field field-name="InclusionUltrasound__c" variant="label-hidden"></lightning-output-field>
</lightning-record-view-form>
</lightning-layout-item>
@@ -231,7 +216,7 @@
<label>鐘舵��:</label>
</lightning-layout-item>
<lightning-layout-item size="1">
- <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={reportId} density="comfy">
+ <lightning-record-view-form object-api-name="Lost_cancel_report__c" record-id={LostReport.lostReport.Id} density="comfy">
<lightning-output-field field-name="Report_Status__c" variant="label-hidden"></lightning-output-field>
</lightning-record-view-form>
</lightning-layout-item>
@@ -322,9 +307,6 @@
</lightning-layout-item>
</div>
</lightning-layout>
- <template if:true={isSubmit}>
- <div>...test...</div>
- </template>
</div>
</div>
</lightning-card>
diff --git a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
index 47f681b..d3d0d93 100644
--- a/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
+++ b/force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-04-20 15:04:03
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-31 11:42:30
+ * @LastEditTime: 2023-06-06 10:51:30
*/
const columns2=[
{ label: '--鏃�--', value: '' },
@@ -47,10 +47,8 @@
import { CurrentPageReference } from "lightning/navigation";
import dataEntry from '@salesforce/apex/lexPCLLostReportLwcController.dataEntry';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-import setbrand from '@salesforce/apex/lexPCLLostReportLwcController.setBrand';
import init from '@salesforce/apex/lexPCLLostReportLwcController.init';
import multiSelectCombobox from 'c/multiSelectCombobox'
-import lexMultiSelectCombobox from 'c/lexmultiSelectCombobox';
import searchBrands from '@salesforce/apex/lexPCLLostReportLwcController.searchBrands';
import getNewLostBrand from '@salesforce/apex/lexPCLLostReportLwcController.getNewLostBrand';
import getPickList from '@salesforce/apex/lexPCLLostReportLwcController.getPickList';
@@ -64,7 +62,9 @@
@api oppId;
@track columns2=columns2;
- @api pageStatus = 'Create';
+ @track status = {
+ pageStatus: 'Create'
+ }
@track LostReport = {
LostBrands: [
],
@@ -84,11 +84,13 @@
//澶卞崟绫诲瀷
RecordTypeOptions = RecordTypeOptions;
isSubmit = false;
+ deleteBrandIdList = [];
+ deleteProductIdList = [];
connectedCallback(){
init({
oppId1: this.oppId,
lostReportId1: this.reportId,
- pageStatus1: this.pageStatus,
+ pageStatus1: this.status.pageStatus,
lostType1: this.lostType,
submitFlag1: this.submitFlag
}).then(result=>{
@@ -184,21 +186,21 @@
}
get isView(){
- if(this.pageStatus == 'View'){
+ if(this.status.pageStatus == 'View'){
return true;
}
return false;
}
get isCreateOrEdit(){
- if(this.pageStatus == 'Create' || this.pageStatus == 'Edit'){
+ if(this.status.pageStatus == 'Create' || this.status.pageStatus == 'Edit'){
return true;
}
return false;
}
get isEdit(){
- if(this.pageStatus == 'Edit'){
+ if(this.status.pageStatus == 'Edit'){
return true;
}
return false;
@@ -221,33 +223,7 @@
this.showToast(result.error,"error");
}else{
this.submitFlag = result.submitFlag;
- init({
- oppId1: this.oppId,
- lostReportId1: this.reportId,
- pageStatus1: result.pageStatus,
- lostType1: this.lostType,
- submitFlag1: this.submitFlag
- }).then(result=>{
- var report = result.LostReport;
- if(result.message != null){
- if(result.message == '鎻愪氦鎴愬姛锛�'){
- this.LostReport = report;
- this.isSubmit = true;
- this.pageStatus = 'View';
- console.log(this.LostReport);
- this.showToast(result.message,"success");
- this.updateRecordView(this.reportId);
-
- }else{
- this.showToast(result.message,"error");
- }
- }else{
- this.LostReport = report;
- }
- }).catch(error=>{
- console.log("error");
- console.log(error);
- });
+ this.updateRecordView(this.reportId);
}
}).catch(error=>{
console.log("error");
@@ -258,17 +234,21 @@
deleteBrandJs(event){
var str = event.target.name;
- this.columnsArrIndex = 0;
+ if(this.LostReport.LostBrands[str].lostBrand.Id){
+ this.deleteBrandIdList.push(this.LostReport.LostBrands[str].lostBrand.Id);
+ }
this.LostReport.LostBrands.splice(str,1);
+ console.log(this.LostReport);
+ this.deleteBrandIdList.forEach(brandId=>{
+ console.log(brandId);
+ });
+ this.setLostTotalAmount();
}
// add tcm 20211118 end
setLostTotalAmount() {
- var elements = this.template.querySelectorAll('[data-id="TotalAmount"]');
var tempLostAmount = 0.0;
- elements.forEach(element => {
- if(element.value != 0){
- tempLostAmount = tempLostAmount + parseFloat(element.value);
- }
+ this.LostReport.LostBrands.forEach(brand=>{
+ tempLostAmount = tempLostAmount + parseFloat(brand.lostBrand.LostPrice__c);
});
this.LostReport.lostReport.LostTotalAmount__c = tempLostAmount;
}
@@ -277,6 +257,15 @@
var index = event.target.name;
const payload = event.detail.payload;
const payloadType = event.detail.payloadType;
+ if(this.LostReport.LostBrands[index].lostBrand.Id){
+ this.LostReport.LostBrands[index].LostProducts.forEach(product=>{
+ if(product.LostProductss.Id){
+ var productId = product.LostProductss.Id
+ this.deleteProductIdList.push(productId);
+ }
+ });
+ console.log(this.deleteProductIdList);
+ }
this.LostReport.LostBrands[index].lostBrand.Lost_By_Company__c = payload.value;
if(payloadType === 'multi-select'){
this.clearProducts(payload.value,index);
@@ -285,10 +274,6 @@
}
}
setDefaultBrand(value,index){
- console.log('22222');
- // this.LostReport.LostBrands[index].LostProducts.forEach(product => {
- // product.LostProductss.LostBrandName__c = value;
- // });
var newProducts = [];
this.LostReport.LostBrands[index].LostProducts.forEach(product=>{
this.newProduct.LostProductss.LostBrandName__c = value;
@@ -297,7 +282,6 @@
this.LostReport.LostBrands[index].LostProducts = newProducts;
}
clearProducts(value,index){
- console.log('111111');
var newProducts = [];
this.LostReport.LostBrands[index].LostProducts.forEach(product=>{
this.newProduct.LostProductss.LostBrandName__c = value;
@@ -353,61 +337,42 @@
if(!this.flag){
return;
}
- console.log(this.pageStatus);
- if(this.pageStatus == 'Edit'){
- this.pageStatus = 'View';
- }else{
- dataEntry({
- report1 : JSON.stringify(this.LostReport)
- }).then(result=>{
- console.log(result);
- if(result.error){
- this.showToast(result.error,"error");
- }else{
- this.LostReport = JSON.parse(result.LostReport);
- this.reportId = result.reportId;
- console.log(this.LostReport);
- Promise.resolve().then(() => {
- this.pageStatus = 'View';
- this.template.querySelectorAll('lightning-card').forEach(elem => {
- elem.classList.toggle('View');
- });
+ console.log(this.LostReport);
+ dataEntry({
+ report1 : JSON.stringify(this.LostReport),
+ deleteBrandIdList: this.deleteBrandIdList,
+ deleteProductIdList: this.deleteProductIdList
+ }).then(result=>{
+ console.log(result);
+ this.deleteBrandIdList.splice(0,this.deleteBrandIdList.length);
+ this.deleteProductIdList.splice(0,this.deleteProductIdList.length);
+ if(result.error){
+ this.showToast(result.error,"error");
+ }else{
+ var report = JSON.parse(result.LostReport);
+ var index1 = 0;
+ this.LostReport.LostBrands.forEach(brand=>{
+ brand.lostBrand.Id = report.LostBrands[index1].lostBrand.Id;
+ var index2 = 0;
+ brand.LostProducts.forEach(product=>{
+ product.LostProductss.Id = report.LostBrands[index1].LostProducts[index2].LostProductss.Id;
+ index2++;
});
- }
- }).catch(error=>{
- console.log("error");
- console.log(error);
- });
- }
-
+ index1++;
+ });
+ this.reportId = result.reportId;
+ this.LostReport.lostReport.Id = result.reportId;
+ console.log(this.LostReport);
+ this.status.pageStatus = 'View';
+ this.tableflag = 0;
+ }
+ }).catch(error=>{
+ console.log("error");
+ console.log(error);
+ });
}
- saveBrandToEditJs(event) {
- Promise.resolve().then(() => {
- this.pageStatus = 'View';
- this.template.querySelectorAll('lightning-card').forEach(elem => {
- elem.classList.toggle('View');
- });
- });
- }
-
editJs(){
- Promise.resolve().then(() => {
- this.pageStatus = 'Edit';
- this.template.querySelectorAll('lightning-card').forEach(elem => {
- elem.classList.toggle('Edit');
- });
- });
- // var elements = this.template.querySelectorAll('.Product');
- // console.log(elements.length);
- // elements.forEach(element=>{
- // var name = null;
- // this.productNameList.forEach(product=>{
- // if(product.index1 == element.title && product.index2 == element.name){
- // name = product.name;
- // }
- // });
- // element.editLookup(name);
- // });
+ this.status.pageStatus = 'Edit';
}
dataCheck(){
@@ -510,10 +475,14 @@
if(deleteButtons.length == 1){
return;
}
+ if(this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.Id){
+ var productId = this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.Id;
+ this.deleteProductIdList.push(productId);
+ }
this.LostReport.LostBrands[index1].LostProducts.splice(index2,1);
+ console.log(this.deleteProductIdList);
}
search(topNum,secondNum){
- console.log("sb");
var elements1 = this.template.querySelectorAll('.ProductClass[data-id="' + topNum + '"]');
var elements2 = this.template.querySelectorAll('.ProductCategory[data-id="' + topNum + '"]');
if (this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c==null) {
@@ -526,7 +495,6 @@
elements2[secondNum].readOnly = true;
}else {
- console.log("a");
searchProduct({
lostProduct : this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c
}).then(result=>{
@@ -534,24 +502,19 @@
var prd = JSON.parse(result);
this.LostReport.LostBrands[topNum].LostProducts[secondNum].productOptions = this.productOptionsList[prd.ProductClass__c];
if (prd.ProductCategory__c!=null) {
- console.log("c");
elements1[secondNum].readOnly = false;
elements2[secondNum].readOnly = false;
this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=prd.ProductClass__c;
this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=prd.ProductCategory__c;
elements1[secondNum].readOnly = true;
elements2[secondNum].readOnly = true;
- console.log("e");
- // this.LostReport.LostBrands[topNum].LostProducts[secondNum].bool=true;
}else {
- console.log("d");
elements1[secondNum].readOnly = false;
elements2[secondNum].readOnly = false;
this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=null;
this.LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=null;
elements1[secondNum].readOnly = true;
elements2[secondNum].readOnly = true;
- // this.LostReport.LostBrands[topNum].LostProducts[secondNum].bool=false;
}
}).catch(error=>{
console.log("error");
@@ -561,16 +524,11 @@
}
}
handleSelected(event) {
- console.log('......');
var index1 = event.target.title;
var index2 = event.target.name;
- // var objectname = event.detail.ObjectName;
this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.LostProduct__c = event.detail.Id;
this.LostReport.LostBrands[index1].LostProducts[index2].productName = event.detail.Name;
this.search(index1,index2);
- console.log(this.LostReport);
- // this.account = {Name : event.detail.Name, Id: event.detail.Id}
-
}
handleLostTypeChange(event){
@@ -644,7 +602,6 @@
this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.LostProductMannual__c = event.target.value;
}
handleProductClassChange(event){
- console.log("qwer");
var index1 = event.target.title;
var index2 = event.target.name;
this.LostReport.LostBrands[index1].LostProducts[index2].LostProductss.ProductClass__c = event.target.value;
diff --git a/force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js b/force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js
index 7139eaf..d3a3a75 100644
--- a/force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js
+++ b/force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js
@@ -4,7 +4,7 @@
* @Author: chen jing wu
* @Date: 2023-04-14 17:15:33
* @LastEditors: chen jing wu
- * @LastEditTime: 2023-05-12 14:43:54
+ * @LastEditTime: 2023-06-05 10:36:22
*/
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -16,6 +16,8 @@
export default class LexQuotationProductNew extends LightningElement {
@api recordId;
currencyIsoCode;
+ reportForCNYId;
+ reportForUSDId;
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
console.log(111);
@@ -36,6 +38,8 @@
recordId:this.recordId
}).then(result=>{
this.currencyIsoCode = result.currencyIsoCode;
+ this.reportForCNYId = result.reportForCNYId;
+ this.reportForUSDId = result.reportForUSDId;
this.quotationProductNew();
}).catch(error=>{
console.log(error);
@@ -45,10 +49,10 @@
var Currency = this.currencyIsoCode;
var OppID = this.recordId;
if (Currency == 'CNY'){
- var url = '/00O10000002jviu?pv0=' + OppID;
+ var url = '/' + this.reportForCNYId + '?pv0=' + OppID;
}
else if (Currency == 'USD'){
- var url = '/00O10000005Ju6L?pv0=' + OppID;
+ var url = '/' + this.reportForUSDId + '?pv0=' + OppID;
}
window.open(url);
this.dispatchEvent(new CloseActionScreenEvent());
diff --git a/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
index a70cb25..ac5c4e2 100644
--- a/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
+++ b/force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
@@ -4,8 +4,9 @@
import init from '@salesforce/apex/OpportunityLightingButtonController.initForRequestDBButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
-
-export default class LexRequestDB extends LightningElement {
+import { NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+export default class LexRequestDB extends NavigationMixin(LightningElement) {
@api recordId;
stageName;
sapSendOK;
@@ -21,6 +22,7 @@
systemProfileId;
s1ProfileId;
s4ProfileId;
+ recordTypeId;
@wire(CurrentPageReference)
getStateParameters(currentPageReference) {
console.log(111);
@@ -55,6 +57,7 @@
this.systemProfileId = result.systemProfileId == undefined ? '' : result.systemProfileId;
this.s1ProfileId = result.s1ProfileId == undefined ? '' : result.s1ProfileId;
this.s4ProfileId = result.s4ProfileId == undefined ? '' : result.s4ProfileId;
+ this.recordTypeId = result.recordTypeId == undefined ? '' : result.recordTypeId;
this.requestDB();
})
}
@@ -77,27 +80,46 @@
this.showToast("璇环宸茬粡鏈夊彇娑堬紡澶卞崟鎶ュ憡浜嗭紒","error");
}
else {
- location.href = '/a2C/e?retURL=%2F' +
- encodeURI(this.recordId) +
- '&RecordType=01210000000RNXi' +
- '&CF00N10000006QdJz=' +
- encodeURI(this.agency1) +
- '&CF00N10000006QdJz_lkid=' +
- encodeURI(this.agency1Id) +
- '&CF00N10000006QdKn=' +
- encodeURI(this.name) +
- '&CF00N10000006QdKn_lkid=' +
- encodeURI(this.recordId) +
- '&00N10000006QdK4=' +
- encodeURI(this.name) +
- '&00N10000006QdYB=' +
- encodeURI(this.bidPlannedDate) +
- '&CF00N10000006QdZT=' +
- encodeURI(this.salesAssistantName) +
- '&CF00N10000006QdZT_lkid=' +
- encodeURI(this.salesAssistantID) +
- '';
- };
+ // location.href = '/a2C/e?retURL=%2F' +
+ // encodeURI(this.recordId) +
+ // '&RecordType=01210000000RNXi' +
+ // '&CF00N10000006QdJz=' +
+ // encodeURI(this.agency1) +
+ // '&CF00N10000006QdJz_lkid=' +
+ // encodeURI(this.agency1Id) +
+ // '&CF00N10000006QdKn=' +
+ // encodeURI(this.name) +
+ // '&CF00N10000006QdKn_lkid=' +
+ // encodeURI(this.recordId) +
+ // '&00N10000006QdK4=' +
+ // encodeURI(this.name) +
+ // '&00N10000006QdYB=' +
+ // encodeURI(this.bidPlannedDate) +
+ // '&CF00N10000006QdZT=' +
+ // encodeURI(this.salesAssistantName) +
+ // '&CF00N10000006QdZT_lkid=' +
+ // encodeURI(this.salesAssistantID) +
+ // '';
+ const defaultValues = encodeDefaultFieldValues({
+ Bid_distributor__c: this.agency1Id,
+ Prospect_name__c: this.recordId,
+ Product_discription__c: this.name,
+ Tedner_date__c: this.bidPlannedDate,
+ Request_target__c: this.salesAssistantID
+ });
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'Request_tedner_doc__c',
+ actionName: 'new'
+ },
+ state: {
+ nooverride: '1',
+ defaultFieldValues: defaultValues,
+ RecordTypeId: this.recordTypeId,
+ }
+ });
+ }
this.dispatchEvent(new CloseActionScreenEvent());
}
showToast(msg,type) {
diff --git a/force-app/main/default/pages/AccountCaseTab.page b/force-app/main/default/pages/AccountCaseTab.page
index 004aa72..11c5b80 100644
--- a/force-app/main/default/pages/AccountCaseTab.page
+++ b/force-app/main/default/pages/AccountCaseTab.page
@@ -1,4 +1,4 @@
-<apex:page controller="AccountCaseTabController" showChat="false" showHeader="false" sidebar="false" action="{!init}" id="Page">
+<apex:page controller="AccountCaseTabController" showChat="false" showHeader="false" sidebar="false" action="{!init}" id="Page" lightningStylesheets="true">
<title>妫�鏌ユ暟</title>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
diff --git a/force-app/main/default/pages/CM_SearchDepartment.page b/force-app/main/default/pages/CM_SearchDepartment.page
index ff8216d..6ef2313 100644
--- a/force-app/main/default/pages/CM_SearchDepartment.page
+++ b/force-app/main/default/pages/CM_SearchDepartment.page
@@ -1,4 +1,4 @@
-<apex:page controller="CM_SearchDepartment" action="{!search}" contentType="plain/text">
+<apex:page controller="CM_SearchDepartment" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡50浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
diff --git a/force-app/main/default/pages/CM_SearchDepartmentService.page b/force-app/main/default/pages/CM_SearchDepartmentService.page
index 3936304..909633e 100644
--- a/force-app/main/default/pages/CM_SearchDepartmentService.page
+++ b/force-app/main/default/pages/CM_SearchDepartmentService.page
@@ -1,4 +1,4 @@
-<apex:page controller="CM_SearchDepartmentServiceController" action="{!search}" contentType="plain/text">
+<apex:page controller="CM_SearchDepartmentServiceController" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡50浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
diff --git a/force-app/main/default/pages/CM_SearchOpportunity.page b/force-app/main/default/pages/CM_SearchOpportunity.page
index aa7898a..7a94059 100644
--- a/force-app/main/default/pages/CM_SearchOpportunity.page
+++ b/force-app/main/default/pages/CM_SearchOpportunity.page
@@ -1,4 +1,4 @@
-<apex:page controller="CM_SearchOpportunity" action="{!search}" contentType="plain/text">
+<apex:page controller="CM_SearchOpportunity" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡30浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
diff --git a/force-app/main/default/pages/CampaignMemberEditAndDelete.page b/force-app/main/default/pages/CampaignMemberEditAndDelete.page
index 5af8e09..18420fb 100644
--- a/force-app/main/default/pages/CampaignMemberEditAndDelete.page
+++ b/force-app/main/default/pages/CampaignMemberEditAndDelete.page
@@ -1,5 +1,5 @@
<apex:page standardcontroller="CampaignMember__c" extensions="CampaignMemberEditAndDeleteController"
-sidebar="true" showHeader="true" id="allPage" action="{!init}">
+sidebar="true" showHeader="true" id="allPage" action="{!init}" lightningStylesheets="true">
<apex:form >
<div style="font-size: 18px;text-align: center;">
<apex:outputPanel rendered="{!RecordTypecheck}">
diff --git a/force-app/main/default/pages/MaintenanceDailyReport.page b/force-app/main/default/pages/MaintenanceDailyReport.page
index bde6231..95b873e 100644
--- a/force-app/main/default/pages/MaintenanceDailyReport.page
+++ b/force-app/main/default/pages/MaintenanceDailyReport.page
@@ -1,3 +1,3 @@
-<apex:page standardController="Daily_Report__c">
+<apex:page standardController="Daily_Report__c" lightningStylesheets="true">
<h1>鏃ユ姤涓�瑙堟鍦ㄧ淮鎶や腑</h1>
</apex:page>
\ No newline at end of file
diff --git a/force-app/main/default/pages/QuoteTrial.page b/force-app/main/default/pages/QuoteTrial.page
index 572b9ac..f5988a9 100644
--- a/force-app/main/default/pages/QuoteTrial.page
+++ b/force-app/main/default/pages/QuoteTrial.page
@@ -1,4 +1,4 @@
-<apex:page showHeader="false" sidebar="false" id="quoteTrial" title="鎶ヤ环璁$畻">
+<apex:page showHeader="false" sidebar="false" id="quoteTrial" title="鎶ヤ环璁$畻" lightningStylesheets="true">
<apex:includeLightning />
<div style="width:100%;height:100%;" id="QuoteTrialApp" />
<script>
diff --git a/force-app/main/default/pages/Xin_SearchMaintenanceContract.page b/force-app/main/default/pages/Xin_SearchMaintenanceContract.page
index 1659706..5797c60 100644
--- a/force-app/main/default/pages/Xin_SearchMaintenanceContract.page
+++ b/force-app/main/default/pages/Xin_SearchMaintenanceContract.page
@@ -1,4 +1,4 @@
-<apex:page controller="Xin_Maintenance_Contract" action="{!search}" contentType="plain/text">
+<apex:page controller="Xin_Maintenance_Contract" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡30浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
diff --git a/force-app/main/default/pages/Xin_SearchOpportunity.page b/force-app/main/default/pages/Xin_SearchOpportunity.page
index b4b09c8..ab492c1 100644
--- a/force-app/main/default/pages/Xin_SearchOpportunity.page
+++ b/force-app/main/default/pages/Xin_SearchOpportunity.page
@@ -1,4 +1,4 @@
-<apex:page controller="Xin_SearchOpportunity" action="{!search}" contentType="plain/text">
+<apex:page controller="Xin_SearchOpportunity" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡30浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
diff --git a/force-app/main/default/pages/Xin_SearchVisitorPlace_Campaign.page b/force-app/main/default/pages/Xin_SearchVisitorPlace_Campaign.page
index fd5f84a..8202310 100644
--- a/force-app/main/default/pages/Xin_SearchVisitorPlace_Campaign.page
+++ b/force-app/main/default/pages/Xin_SearchVisitorPlace_Campaign.page
@@ -1,4 +1,4 @@
-<apex:page controller="Xin_SearchVisitorPlace_Campaign" action="{!search}" contentType="plain/text">
+<apex:page controller="Xin_SearchVisitorPlace_Campaign" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡30浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
diff --git a/force-app/main/default/pages/Xin_SearchVisitorPlace_Sales.page b/force-app/main/default/pages/Xin_SearchVisitorPlace_Sales.page
index ebbf481..c6eba47 100644
--- a/force-app/main/default/pages/Xin_SearchVisitorPlace_Sales.page
+++ b/force-app/main/default/pages/Xin_SearchVisitorPlace_Sales.page
@@ -1,4 +1,4 @@
-<apex:page controller="Xin_SearchVisitorPlace_Sales" action="{!search}" contentType="plain/text">
+<apex:page controller="Xin_SearchVisitorPlace_Sales" action="{!search}" contentType="plain/text" lightningStylesheets="true">
<apex:outputPanel layout="none" rendered="{!IsOverLimit}">
<span class="result_name" style="color:red;">妫�绱㈢粨鏋滆秴杩囦簡50浠�</span><span class="result_id" style="display:none"></span><br/>
</apex:outputPanel>
--
Gitblit v1.9.1