1个文件已删除
10个文件已修改
5个文件已添加
2 文件已重命名
| New file |
| | |
| | | public with sharing class LexAgenceCopyPIController { |
| | | //.客户人员的复制按钮 |
| | | @AuraEnabled |
| | | public static Agency_Contact__c init(String recordId){ |
| | | Agency_Contact__c res = new Agency_Contact__c(); |
| | | try{ |
| | | res = [SELECT Id,Name,Department_Class__c,Contact__c,Agency_ID__c, |
| | | Type__c, Doctor_Division1__c, Agency_Hospital__c,AWS_Data_Id__c |
| | | FROM Agency_Contact__c |
| | | WHERE Id=:recordId]; |
| | | return res; |
| | | } |
| | | catch (Exception e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | //客户人员的复制按钮 |
| | | @AuraEnabled |
| | | public static String init2(String recordId){ |
| | | String s=''; |
| | | try { |
| | | String objectName = 'Contact'; // 要获取字段的对象名 |
| | | Map<String, Schema.SObjectType> globalDescribe = Schema.getGlobalDescribe(); |
| | | Schema.SObjectType objType = globalDescribe.get(objectName); |
| | | if (objType != null) { |
| | | Schema.DescribeSObjectResult objDescribe = objType.getDescribe(); |
| | | Map<String, Schema.SObjectField> fieldMap = objDescribe.fields.getMap(); |
| | | s+='SELECT '; |
| | | // 现在,fieldMap中包含了对象的所有字段信息 |
| | | for (String fieldName : fieldMap.keySet()) { |
| | | if(!fieldName.equals('id')) |
| | | s+=fieldName+','; |
| | | } |
| | | |
| | | s=s.removeEnd(','); |
| | | s+=' FROM Contact where id=\''+recordId+'\''; |
| | | system.debug('SQL:'+s); |
| | | List<Contact> opportunitys = Database.query(s); |
| | | s=''; |
| | | if(opportunitys.size()>0){ |
| | | system.debug('in!'); |
| | | for (String fieldName : fieldMap.keySet()) { |
| | | String formaF=fieldMap.get(fieldName).getDescribe().getName(); |
| | | if(opportunitys.get(0).get(fieldName)!=null&&!opportunitys.get(0).get(fieldName).equals('null')) |
| | | s+=formaF+'='+opportunitys.get(0).get(fieldName)+','; |
| | | } |
| | | s=s.removeEnd(','); |
| | | return s; |
| | | } |
| | | } |
| | | return s; |
| | | } catch (Exception e) { |
| | | System.debug('LexAgenceCopyPIController init2 error:'+e.getMessage()); |
| | | } |
| | | return s; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static void newUpdateMeetingDelayApply(String Id){ |
| | | public static String newUpdateMeetingDelayApply(String Id){ |
| | | meeting_delay_apply__c res = new meeting_delay_apply__c(); |
| | | try{ |
| | | res.Id=Id; |
| | | res.Status__c ='提交'; |
| | | update res; |
| | | return 'succuse'; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return e.getMessage(); |
| | | } |
| | | |
| | | } |
| | |
| | | public static String makeAndUpdateLead(String leadId,String Id,String QuoteIraiId){ |
| | | Lead res = new Lead(); |
| | | try{ |
| | | res.Id = leadId; |
| | | res.Opp_Name_Search__c = Id; |
| | | res.Id = Id; |
| | | res.Opp_Name_Search__c = leadId; |
| | | if(QuoteIraiId != ''){ |
| | | res.LatestQuotationEntrustment__c=QuoteIraiId; |
| | | } |
| | |
| | | Sales_Method__c,Request__c,Request_Detail__c |
| | | FROM Agency_Opportunity__c |
| | | WHERE Id = : recordId]; |
| | | return res; |
| | | |
| | | } |
| | | catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return null; |
| | | } |
| | | return res; |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return null; |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return null; |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | public with sharing class LexOpdCommitApprovalController { |
| | | @AuraEnabled |
| | | public static CancelPostponePlan__c init(String recordId){ |
| | | CancelPostponePlan__c res = new CancelPostponePlan__c(); |
| | | try{ |
| | | res = [Select Id,Status__c,CancelOPDPlan__c |
| | | FROM CancelPostponePlan__c |
| | | WHERE Id = : recordId]; |
| | | } |
| | | catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String newUpdateCancelPostponePlan(String Id,String Status){ |
| | | CancelPostponePlan__c res = new CancelPostponePlan__c(); |
| | | try{ |
| | | res.Id=Id; |
| | | if(Status == '取消'){ |
| | | res.Status__c ='提交'; |
| | | } |
| | | else if (Status == '延期报告'){ |
| | | res.Status__c ='延期提交'; |
| | | } |
| | | update res; |
| | | return 'success'; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | return e.getMessage(); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | |
| | | |
| | | async commitNeedApproval(){ |
| | | var changeFlg=0; |
| | | var NowStatus = this.MeetingDelayApply.status__c; |
| | | if(NowStatus == "草案中" || NowStatus == "驳回"){ |
| | | var campaignId = this.MeetingDelayApply.campaign__c; //学会id |
| | |
| | | message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?', |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value', |
| | | // setting theme would have no effect |
| | | }); |
| | | if(!result){ |
| | | return; |
| | |
| | | if(NowStatus == "草案中" || NowStatus == "驳回"){ |
| | | await newUpdateMeetingDelayApply({Id : this.recordId }) |
| | | .then(result=>{ |
| | | }).catch(error=>{ |
| | | const event2 = new ShowToastEvent({ |
| | | message: |
| | | error.message, |
| | | variant : 'error' |
| | | }); |
| | | this.dispatchEvent(event2); |
| | | }); |
| | | if(result!='success'){ |
| | | const event2 = new ShowToastEvent({ |
| | | message: |
| | | result, |
| | | variant : 'error' |
| | | }); |
| | | changeFlg+=1; |
| | | this.dispatchEvent(event2); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if(changeFlg!=0){ |
| | | return; |
| | | } |
| | | |
| | | //4. 进程生成器 |
| | | |
| | |
| | | //author : kk |
| | | //self review 更新失败返回的错误信息没有之前class的好。给出的都是意义不明的报错 |
| | | |
| | | import { LightningElement, track, wire , api } from 'lwc'; |
| | | |
| | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.Task = result; |
| | | this.ExistingInquiry().then(result=>{ |
| | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | |
| | | } |
| | |
| | | await getQuoteIrai({QuoteIraiId : this.Task.QuoteIraiId__c |
| | | }).then(res=>{ |
| | | this.NewTask=res; |
| | | }).catch(err=>{ |
| | | console.log("err:",err.message); |
| | | }); |
| | | |
| | | if(this.NewTask.Lead__c){ |
| | | // Lead作成并更 |
| | | await makeAndUpdateLead({ Lead_c : this.Opportunity.Lead__c, Id : this.NewTask.Id, |
| | | await makeAndUpdateLead({ Lead_c : this.Opportunity.Id, Id : this.NewTask.Lead__c, |
| | | QuoteIraiId__c : this.Task.QuoteIraiId__c |
| | | }).then(res=>{ |
| | | if(res !='success'){ |
| | |
| | | return; |
| | | } |
| | | // 判断报价委托 |
| | | if( this.Task.QuoteIraiId__c != '') { |
| | | if( this.Task.QuoteIraiId__c != '' && this.Task.QuoteIraiId__c!=undefined) { |
| | | // 报价委托作成 |
| | | await makeAndUpdateQuoteIrai({ QuoteIraiStatus : "已有询价", Id : this.Task.QuoteIraiId__c |
| | | }).then(res=>{ |
| | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "存在审批中的会议延期申请,无法再次提交延期申请。!", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | const event2 = new ShowToastEvent({ |
| | | message: |
| | | "耗材借出申请的状态未处于`草案中`或`取消`,该会议只能取消,无法延期。", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | const event3 = new ShowToastEvent({ |
| | | message: |
| | | "备品借出申请的状态未处于`草案中`或`取消`,该会议只能取消,无法延期。", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | const event4 = new ShowToastEvent({ |
| | | message: |
| | | "该活动信息已发送到智慧医疗,请确认后再操作", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | const event5 = new ShowToastEvent({ |
| | | message: |
| | | "该会议不在公开中或申请中,只能取消,无法延期。", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | export default class lexMeetingDelayApplyCampaign extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | console.log(this.recordId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({recordId:this.recordId}).then(res=>{ |
| | | console.log(res); |
| | | this.Campaign=res; |
| | | this.meetingDelayApply().then(res=>{ |
| | | this.IsLoading=false; |
| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import init from '@salesforce/apex/LexNewIntentionController.init'; |
| | | import getRecordIdByName from '@salesforce/apex/LexSubmitCampaignController.getRecordIdByName'; |
| | | import getAccountByLongName from '@salesforce/apex/LexNewIntentionController.getAccountByLongName'; |
| | | import getAccountByShortName from '@salesforce/apex/LexNewIntentionController.getAccountByShortName'; |
| | | |
| | | |
| | | import Agency_Opportunity from '@salesforce/label/c.Agency_Opportunity'; |
| | | import Opportunity_stage from '@salesforce/label/c.Opportunity_stage'; |
| | | import Opp_Name from '@salesforce/label/c.Opp_Name'; |
| | | import Purchase_Reason from '@salesforce/label/c.Purchase_Reason'; |
| | | import Fund_Basis from '@salesforce/label/c.Fund_Basis'; |
| | | import Purchase_Type from '@salesforce/label/c.Purchase_Type'; |
| | | import Sales_Method from '@salesforce/label/c.Sales_Method'; |
| | | import Request from '@salesforce/label/c.Request'; |
| | | import Request_Detail from '@salesforce/label/c.Request_Detail'; |
| | | |
| | | |
| | | const event1 = new ShowToastEvent({ |
| | |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.AgencyOpportunity = result; |
| | | this.newIntention().then(result=>{ |
| | | IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | this.judageWhertherNull(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | |
| | | } |
| | |
| | | var accountID = ''; |
| | | if(accountrecords.length > 0){ |
| | | accountID = accountrecords[0].Id; |
| | | console.log('长name返回长度大于0') |
| | | } |
| | | if (accountID == '') { |
| | | accountName = this.AgencyOpportunity.Department_Class_Opp_Name__c; |
| | | accountrecords = await getAccountByShortName({Name : accountName}); |
| | | if(accountrecords.length > 0){ |
| | | accountID = accountrecords[0].Id; |
| | | console.log('shortName return size 》 0') |
| | | } |
| | | } |
| | | var url = '/apex/NewAndEditLead?' + '00N10000009HKSP=' + this.AgencyOpportunity.Id |
| | | + '&LeadSource=经销商' + '&00N10000006qOFb=' + this.AgencyOpportunity.StageName__c |
| | | + '&00N10000006qOF0=' + this.AgencyOpportunity.Close_Forecasted_Date__c |
| | | + '&00N10000002EjE1=' + this.AgencyOpportunity.Name |
| | | + '&00N10000008rqHf=' + this.AgencyOpportunity.Purchase_Reason__c |
| | | + '&00N10000008rqHd=' + this.AgencyOpportunity.Fund_Basis__c |
| | | + '&00N10000008rqHg=' + this.AgencyOpportunity.Purchase_Type__c |
| | | +'&00N10000008rqHj=' + this.AgencyOpportunity.Sales_Method__c |
| | | + '&00N10000008rqHi=' + this.AgencyOpportunity.Request__c |
| | | + '&00N10000008rqHh=' + this.AgencyOpportunity.Request_Detail__c |
| | | //后端代码取参数数据,一一对应 |
| | | var recordTypeId= await getRecordIdByName({Name : '拜访获取的意向'}) |
| | | var url = '/apex/NewAndEditLead?' + Agency_Opportunity+'=' + this.AgencyOpportunity.Id |
| | | + '&LeadSource=经销商' + '&'+Opportunity_stage+'=' + this.AgencyOpportunity.StageName__c |
| | | + '&00N10000006qOF0=' + this.AgencyOpportunity.Close_Forecasted_Date__c |
| | | + '&'+Opp_Name+'=' + this.AgencyOpportunity.Name |
| | | + '&'+Purchase_Reason+'=' + this.AgencyOpportunity.Purchase_Reason__c |
| | | + '&'+Fund_Basis+'=' + this.AgencyOpportunity.Fund_Basis__c |
| | | + '&'+Purchase_Type+'=' + this.AgencyOpportunity.Purchase_Type__c |
| | | +'&'+Sales_Method+'=' + this.AgencyOpportunity.Sales_Method__c |
| | | + '&'+Request+'=' + this.AgencyOpportunity.Request__c |
| | | + '&'+Request_Detail+'=' + this.AgencyOpportunity.Request_Detail__c |
| | | + '&CF00N10000002CvC5=' + accountName |
| | | + '&CF00N10000002CvC5_lkid=' + accountID |
| | | + '&RecordTypeId=01210000000QiRf' + '&retURL=%2F' + this.AgencyOpportunity.Id; |
| | | |
| | | + '&RecordTypeId='+recordTypeId + '&retURL=%2F' + this.AgencyOpportunity.Id; |
| | | window.open(url); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "科室状态为无效,不允许新建OPD计划", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | import init from '@salesforce/apex/LexOPDSupplementaryController.initNewOPDButton'; |
| | | export default class lexNewOPDButtonAccount extends NavigationMixin(LightningElement) { |
| | |
| | | connectedCallback(){ |
| | | init({recordId:this.recordId}).then(res=>{ |
| | | if (res!=null) { |
| | | console.log(res); |
| | | this.Account=res; |
| | | this.newOPDButtonAccount().then(res=>{ |
| | | this.IsLoading=false; |
| | |
| | | const event1 = new ShowToastEvent({ |
| | | message: |
| | | "询价状态为:失单、取消、注残、发货、完毕,不允许创建OPD计划", |
| | | variant : "warning" |
| | | variant : "error" |
| | | }); |
| | | import init from '@salesforce/apex/LexOPDSupplementaryController.initNewOPDButton2'; |
| | | export default class lexNewOPDButtonOpportunity extends NavigationMixin(LightningElement) { |
| | |
| | | connectedCallback(){ |
| | | init({recordId:this.recordId}).then(res=>{ |
| | | if (res!=null) { |
| | | console.log(res); |
| | | this.Opportunity=res; |
| | | this.newOPDButtonOpportunity().then(res=>{ |
| | | this.IsLoading=false; |
| New file |
| | |
| | | //author:kkbes 增加LexOpdCommitApprovalController |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/LexOpdCommitApprovalController.init'; |
| | | import newUpdateCancelPostponePlan from '@salesforce/apex/LexOpdCommitApprovalController.newUpdateCancelPostponePlan'; |
| | | import changeTrade from '@salesforce/apex/OpdPlanWebService.changeTrade'; |
| | | |
| | | |
| | | |
| | | const event1 = new ShowToastEvent({ |
| | | title: '状态错误', |
| | | message: |
| | | "只有取消或者延期报告状态才可以进行审批!", |
| | | }); |
| | | export default class lexOPDCommitNeedApproval extends LightningElement { |
| | | |
| | | @api recordId; |
| | | IsLoading=true; |
| | | CancelPostponePlan; |
| | | |
| | | @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 => { |
| | | if (result != null) { |
| | | this.CancelPostponePlan = result; |
| | | this.OPDCommitApproval().then(result=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(error => { |
| | | const event3 = new ShowToastEvent({ |
| | | title: '页面初始化错误', |
| | | message: |
| | | error.message, |
| | | }); |
| | | this.dispatchEvent(event3); |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | async OPDCommitApproval(){ |
| | | var changeFlg=0; |
| | | var NowStatus = this.CancelPostponePlan.Status__c; |
| | | if(NowStatus == "取消" || NowStatus == "延期报告"){ |
| | | var opdplanid = this.CancelPostponePlan.CancelOPDPlan__c; //学会id |
| | | var rtn = await changeTrade({opdplanId:opdplanid}); |
| | | if (rtn != 'OK') { |
| | | const event = new ShowToastEvent({ |
| | | title: '失败', |
| | | message: |
| | | rtn, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | } |
| | | } |
| | | if(NowStatus != "取消" && NowStatus != "延期报告"){ |
| | | this.dispatchEvent(event1); |
| | | return; |
| | | } |
| | | const result = await LightningConfirm.open({ |
| | | message: '一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?', |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value', |
| | | }); |
| | | if(!result){ |
| | | return; |
| | | } |
| | | await newUpdateCancelPostponePlan({Id : this.recordId ,Status : this.CancelPostponePlan.Status__c}) |
| | | .then(result=>{ |
| | | if(result!='success'){ |
| | | const event2 = new ShowToastEvent({ |
| | | message: |
| | | result, |
| | | variant : 'error' |
| | | }); |
| | | changeFlg+=1; |
| | | this.dispatchEvent(event2); |
| | | } |
| | | }); |
| | | if(changeFlg!=0){ |
| | | return; |
| | | } |
| | | setTimeout(function(){ |
| | | window.location.href = window.location; |
| | | }, 1500 ) |
| | | } |
| | | |
| | | } |
| File was renamed from force-app/main/default/lwc/lexAgenceCopyPI/lexAgenceCopyPI.js-meta.xml |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexAgenceCopyPI"> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOPDCommitNeedApproval"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | console.log(currentPageReference); |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log(str); |
| | | this.recordId = str; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | this.productRepairQuoteProduct().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.productRepairQuoteProduct().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | async productRepairQuoteProduct(){ |
| | | |
| | | async productRepairQuoteProduct(){ |
| | | window.open ('/apex/ProductRepairQuote?productid=' + this.recordId + |
| | | '&flag=productsearch', '', 'height=500, width=1200, top=300, left=350,location=no'); |
| | | |
| | | '&flag=productsearch', '', 'height=500, width=1200, top=300, left=350,location=no'); |
| | | } |
| | | |
| | | |