19626
2023-06-06 4661adc43f549036f4e6e44debe92521c5793083
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) {