| New file |
| | |
| | | /* |
| | | * @Author: zhangchunxu |
| | | * @Date: 2023-07-19 13:22:53 |
| | | * @LastEditors: zhangchunxu |
| | | * @LastEditTime: 2023-08-04 15:30:27 |
| | | * |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference ,NavigationMixin} from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/NewLeadFromContact2.NewLeadFromContact2'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexNewLeadFromContact2 extends NavigationMixin(LightningElement) { |
| | | @api recordId;//当前这条数据的id |
| | | id;//返回值的id Tender_information__c招标项目的id |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | // 客户人员 新建购买意向 |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | // this.IsLoading = false; |
| | | // console.log(result,"xu111111111111"); |
| | | // this.id = result.Id; |
| | | // /00Q/e?retURL=%2F00Q%2Fo& |
| | | // RecordType=01210000000QiRf |
| | | // &ent=Lead |
| | | // &CF00N10000006ps6f={!HTMLENCODE(Contact.Name)} 客户姓名 contact_Name__c |
| | | // &CF00N10000006ps6f_lkid={!HTMLENCODE(Contact.Id)} 客户id contact_Name__c |
| | | // &CF00N10000002CvC5={!HTMLENCODE(Account.Name)} 医院名 Hospital_Name__c |
| | | // &CF00N10000002CvC5_lkid={!HTMLENCODE(Account.Id)}医院id Hospital_Name__c |
| | | // &lea3=%e4%b8%8d%e7%94%a8%e5%a1%ab%e5%86%99 |
| | | // &name_lastlea2=%e4%b8%8d%e7%94%a8%e5%a1%ab%e5%86%99 |
| | | // &CF00N10000006qNtt_lkid = {!HTMLENCODE(Account.Department_Class__c)} 战略科室分类id epartment_Class__c |
| | | // &CF00N10000006qNtt={!HTMLENCODE(Account.Department_Class__c)} 战略科室分类 epartment_Class__c |
| | | // var url = "/00Q/e?retURL=%2F00Q%2Fo&RecordType=01210000000QiRf&ent=Lead&CF00N10000006ps6f="+result.Name+"&CF00N10000006ps6f_lkid="+result.Id+"&CF00N10000002CvC5="+result.accountName+"&CF00N10000002CvC5_lkid="+result.accountIds+"&lea3=%e4%b8%8d%e7%94%a8%e5%a1%ab%e5%86%99&name_lastlea2=%e4%b8%8d%e7%94%a8%e5%a1%ab%e5%86%99&CF00N10000006qNtt_lkid ="+result.accountDepartmentClass+"&CF00N10000006qNtt="+result.accountDepartmentClass ; |
| | | // window.open(url); |
| | | console.log('LexNewLeadFromContact2 result = ' + JSON.stringify(result)) |
| | | const defaultValues = encodeDefaultFieldValues({ |
| | | //2023/ 7/25 update by 王雪琴 PIPL Start |
| | | contactName : result.Name, |
| | | accountName:result.accountName, |
| | | //2023/ 7/25 update by 王雪琴 PIPL END |
| | | RecordType :result.NewDailyReport, |
| | | contact_Name__c:result.Id, |
| | | Hospital_Name__c:result.accountIds, |
| | | lea3:"", |
| | | name_lastlea2:"", |
| | | Department_Class__c:result.accountDepartmentClass, |
| | | awsDataId:result.AWSDataId |
| | | }); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Lead', |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error=>{ |
| | | console.log(error) |
| | | }) |
| | | } |
| | | } |