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/lwc/lexRequestDB/lexRequestDB.js | 68 ++++++++++++++++++++++-----------
1 files changed, 45 insertions(+), 23 deletions(-)
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) {
--
Gitblit v1.9.1