| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexConsumApply_FromAccount extends LightningElement { |
| | | export default class LexConsumApply_FromAccount extends NavigationMixin(LightningElement) { |
| | | |
| | | @api recordId; |
| | | IsLoading = true; |
| | |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | UserInfo_Owner({}).then(res=>{ |
| | | if(res.isFormalStuff == 'true'){ |
| | | this.showToast('试用期内,不能申请','warning'); |
| | | if(res.isFormalStuff){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | return; |
| | | }else{ |
| | | |
| | |
| | | Account__c:result.name, |
| | | Name:'*', |
| | | demo_purpose2__c:'OPD试用', |
| | | Person_In_Charge__c:res.lastName + res.firstName, |
| | | applyUser__c:res.lastName + res.firstName |
| | | Person_In_Charge__c:res.id, |
| | | applyUser__c:res.id |
| | | }); |
| | | |
| | | this[NavigationMixin.Navigate]({ |
| | |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: this.defaultValues |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }) |
| | | } |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="dispatchOCSMQARAHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference, NavigationMixin} from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/LexConsumApply_FromCampaignCtl.init'; |
| | | import rentalApp from '@salesforce/apex/LexConsumApply_FromCampaignCtl.rentalApp'; |
| | | import UserInfo_Owner from '@salesforce/apex/LexConsumApply_FromCampaignCtl.UserInfo_Owner'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexConsumApply_FromCampaign extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | UserInfo_Owner({}).then(res=>{ |
| | | if(res){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | var ups = res.userprovince.slice(0,2); |
| | | if(res.isFormalStuff){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | }else if(result.recordTypeId != result.servicetrainig && res.jobCategory == '销售服务'){ |
| | | |
| | | this.showToast('FSE不能申请该学会类型备品','error'); |
| | | }else if((res.jobCategory == '销售服务' || res.jobCategory == '支援') && result.recordTypeId != result.servicetrainig && res.chargeProvince.indexOf((ups) == -1)){ |
| | | this.showToast('与FSE所在省一致,才可使用备品','error'); |
| | | }else if(result.status == '已结束'){ |
| | | this.showToast('已结束,不能申请','error'); |
| | | }else if(result.status == '已提交报告'){ |
| | | this.showToast('已提交报告,不能申请','error'); |
| | | }else if(result.status == '取消申请中'){ |
| | | this.showToast('取消申请中,不能申请','error'); |
| | | }else if(result.status == '取消'){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | }else{ |
| | | rentalApp({}) |
| | | .then(results=>{ |
| | | var fieldmap = new Map(); |
| | | for (var i=0; i< results.length; i++) { |
| | | var record = results[i]; |
| | | fieldmap.set(record.QualifiedApiName,record.DurableId.toString().split('.')[1]); |
| | | } |
| | | // var url = "{!$Site.Prefix}/" + prefix + "/e?retURL=%2F{!URLENCODE(Campaign.Id)}" |
| | | // + "&CF" + fieldmap.get('Campaign__c') + "={!URLENCODE(Campaign.Name)}" |
| | | // + "&CF" + fieldmap.get('Campaign__c') + "_lkid={!URLENCODE(Campaign.Id)}" |
| | | // + "&Name={!URLENCODE('*')}" |
| | | // + "&" + fieldmap.get('demo_purpose2__c') + "={!URLENCODE('学会展会')}" |
| | | // + "&Name={!URLENCODE('*')}" |
| | | // + "&CF" + fieldmap.get('Person_In_Charge__c') + "={!URLENCODE($User.LastName&' '&$User.FirstName)}" |
| | | // + "&CF" + fieldmap.get('Person_In_Charge__c') + "_lkid={!URLENCODE($User.Id)}" |
| | | // + "&CF" + fieldmap.get('applyUser__c') + "={!URLENCODE($User.LastName&' '&$User.FirstName)}" |
| | | // + "&CF" + fieldmap.get('applyUser__c') + "_lkid={!URLENCODE($User.Id)}" |
| | | // + ""; |
| | | const defaultValues = encodeDefaultFieldValues({ |
| | | Campaign__c: result.campaignId, |
| | | Name:'*', |
| | | demo_purpose2__c:'学会展会', |
| | | Person_In_Charge__c:res.id, |
| | | applyUser__c:res.id |
| | | }); |
| | | |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Consum_Apply__c', |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | showToast(message, type) { |
| | | const evt = new ShowToastEvent({ |
| | | title: 'Error', |
| | | message: message, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexConsumApply_FromCampaign"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexConsumApply_FromOPDPlan extends LightningElement { |
| | | // 新建耗材申请(OPD计划) |
| | | export default class LexConsumApply_FromOPDPlan extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | UserInfo_Owner({}).then(res=>{ |
| | | if(res.isFormalStuff == 'true'){ |
| | | this.showToast('试用期内,不能申请','warning'); |
| | | console.log("-----UserInfo_Owner--",res) |
| | | if(res.isFormalStuff){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | return; |
| | | }else{ |
| | | |
| | |
| | | Account__c:result.accountLab, |
| | | Name:'*', |
| | | demo_purpose2__c:'OPD试用', |
| | | Person_In_Charge__c:res.lastName + res.firstName, |
| | | applyUser__c:res.lastName + res.firstName |
| | | Person_In_Charge__c:res.id, |
| | | applyUser__c:res.id |
| | | }); |
| | | |
| | | console.log("defaultValues====> ",defaultValues); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: this.defaultValues |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | console.log("error ---> ",error); |
| | | }) |
| | | }) |
| | | |
| | | .catch(error => { |
| | | console.log("error"); |
| | | console.log("error----"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |
| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | export default class LexConsumApply_FromQIS extends LightningElement { |
| | | // 新建耗材备品申请(QIS) |
| | | export default class LexConsumApply_FromQIS extends NavigationMixin(LightningElement) { |
| | | |
| | | @api recordId; |
| | | IsLoading = true; |
| | |
| | | rentalApp({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log('rentalApp============' + result); |
| | | console.log('rentalApp============',result); |
| | | if(result.lenth > 0){ |
| | | const evt = new ShowToastEvent({ |
| | | title : 'Error', |
| | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log('init============',result); |
| | | this.IsLoading = false; |
| | | if (result != null) { |
| | | if(result.nextAction=='送回'){ |
| | | this.showToast('QIS对应方法为“送回”,不能申请','warning'); |
| | | this.showToast('QIS对应方法为“送回”,不能申请','error'); |
| | | return; |
| | | } |
| | | if(result.qISStatus=='草案中'){ |
| | | this.showToast('QIS状态为草案中,不能申请','warning'); |
| | | this.showToast('QIS状态为草案中,不能申请','error'); |
| | | return; |
| | | } |
| | | if(result.qISStatus=='FSE填写完毕'){ |
| | | this.showToast('QIS状态为FSE填写完毕,不能申请','warning'); |
| | | this.showToast('QIS状态为FSE填写完毕,不能申请','error'); |
| | | return; |
| | | } |
| | | if(result.qISStatus=='取消'){ |
| | | this.showToast('QIS状态为取消,不能申请','warning'); |
| | | this.showToast('QIS状态为取消,不能申请','error'); |
| | | return; |
| | | } |
| | | // if('{!$User.isFormal_Stuff__c}'=='true'){ |
| | |
| | | // window.top.location.href=url; |
| | | // } |
| | | UserInfo_Owner({}).then(res=>{ |
| | | if(res.isFormalStuff == 'true'){ |
| | | this.showToast('试用期内,不能申请','warning'); |
| | | if(res.isFormalStuff){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | return; |
| | | }else{ |
| | | // var query = "Select QualifiedApiName, EntityDefinition.KeyPrefix, DurableId From FieldDefinition WHERE EntityDefinition.QualifiedApiName = 'Consum_Apply__c'"; |
| | |
| | | .catch(e=>{console.log(e)}) |
| | | |
| | | const defaultValues = encodeDefaultFieldValues({ |
| | | QIS_Report__c: this.recordId, |
| | | Hospital: result.hospital, |
| | | Strategic_dept: result.departmentClass, |
| | | Account:result.hospitalDepartment, |
| | | demo_purpose2:'索赔QIS', |
| | | Hospital__c: result.hospital, |
| | | Strategic_dept__c: result.departmentClass, |
| | | Account__c:result.hospitalDepartment, |
| | | demo_purpose2__c:'索赔QIS', |
| | | Name:'*', |
| | | Person_In_Charge:res.lastName + res.firstName, |
| | | applyUser:res.lastName + res.firstName, |
| | | QIS_number:result.name |
| | | Person_In_Charge__c:res.id, |
| | | applyUser__c:res.id, |
| | | QIS_number__c:result.qisReportId |
| | | }); |
| | | |
| | | console.log('init============',result); |
| | | console.log('init============',defaultValues); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: this.defaultValues |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="dispatchOCSMQARAHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference, NavigationMixin} from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/lexConsumApply_FromRACtl.init'; |
| | | import fieldDefineApp from '@salesforce/apex/lexConsumApply_FromRACtl.fieldDefineApp'; |
| | | import UserInfo_Owner from '@salesforce/apex/lexConsumApply_FromRACtl.UserInfo_Owner'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | |
| | | // 新建耗材申请 |
| | | export default class LexConsumApply_FromRA extends NavigationMixin(LightningElement) { |
| | | |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | UserInfo_Owner({}).then(res=>{ |
| | | this.IsLoading = false; |
| | | if(res.isFormalStuff){ |
| | | this.showToast('试用期内,不能申请','error'); |
| | | return; |
| | | }else{ |
| | | fieldDefineApp({}).then(resp=>{ |
| | | var fieldmap = new Map(); |
| | | for (var i=0; i< resp.length; i++) { |
| | | var record = resp[i]; |
| | | fieldmap.set(record.QualifiedApiName,record.DurableId.toString().split('.')[1]); |
| | | } |
| | | |
| | | }) |
| | | .catch(e=>{console.log(e)}) |
| | | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log('result.rentalHospital'+result.rentalHospital); |
| | | if(result){ |
| | | const defaultValues = encodeDefaultFieldValues({ |
| | | Rental_Apply__c: result.rentalApplyId, |
| | | demo_purpose2__c:result.demoPurpose2, |
| | | Campaign__c: result.rentalCampaign, |
| | | QIS_number__c:result.rentalQISNumber, |
| | | QISRepair__c:result.rentalQISRepair, |
| | | OPD__c:result.rentalOPD, |
| | | OPDPlan__c:result.rentalOPDPlan, |
| | | Hospital__c:result.rentalHospital, |
| | | Strategic_dept__c:result.rentalStrategicDept, |
| | | Account__c:result.rentalAccount, |
| | | ApplyPerson_Phone__c:result.rentalApplyPersonPhone, |
| | | Phone_number__c:result.rentalPhoneNumber, |
| | | Request_shipping_day__c:result.rentalRequestShippingDay, |
| | | Loaner_medical_Staff__c:result.rentalLoanerMedicalStaff, |
| | | Shipment_address__c:result.rentalShipmentAddress, |
| | | Dealer__c:result.rentalDealer, |
| | | direct_send__c:result.rentalDirectSend, |
| | | pickup_time__c:result.rentalPickupTime, |
| | | Loaner_received_staff__c:result.rentalLoanerReceivedStaff, |
| | | Loaner_received_staff_phone__c:result.rentalLoanerReceivedStaffPhone, |
| | | Post_Code__c:result.rentalPostCode, |
| | | direct_shippment_address__c:result.rentalDirectShippmentAddress, |
| | | Name:'*', |
| | | Person_In_Charge__c:res.id, |
| | | applyUser__c:res.id |
| | | }); |
| | | console.log('init============',result); |
| | | console.log('init============',defaultValues); |
| | | this[NavigationMixin.Navigate]({ |
| | | type: 'standard__objectPage', |
| | | attributes: { |
| | | objectApiName: 'Consum_Apply__c', |
| | | actionName: 'new' |
| | | }, |
| | | state:{ |
| | | defaultFieldValues: defaultValues |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }).catch(e=>{console.log(e)}) |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | .catch(err=>{console.log(err)}) |
| | | } |
| | | |
| | | showToast(message, type) { |
| | | const evt = new ShowToastEvent({ |
| | | title: '', |
| | | message: message, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| | |
| | | import AssignBtn from '@salesforce/apex/RentalApplyWebService.AssignBtn'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | const event1 = new ShowToastEvent({ |
| | | title: '请检查申请状态', |
| | | message: |
| | | '不能引当,请确认申请的状态', |
| | | }); |
| | | const event2 = new ShowToastEvent({ |
| | | title: 'Get Help', |
| | | message: |
| | | '方法错误,请联系管理员', |
| | | }); |
| | | |
| | | export default class lexEquipmentSetRental_Order extends LightningElement { |
| | | |
| | | @api recordId; |
| | |
| | | Rental_Apply__c; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference){ |
| | | console.log(currentPageReference); |
| | | console.log("进入获取page参数") |
| | | const IdValue=currentPageReference.state.recordId; |
| | | if(IdValue){ |
| | | let str=`${IdValue}`; |
| | | this.recordId=str; |
| | | console.log("recordId="+str); |
| | | } |
| | | } |
| | | } |
| | | // @wire(CurrentPageReference) |
| | | // getStateParameters(currentPageReference){ |
| | | // if(currentPageReference){ |
| | | // console.log(currentPageReference); |
| | | // console.log("进入获取page参数") |
| | | // const IdValue=currentPageReference.state.recordId; |
| | | // if(IdValue){ |
| | | // let str=`${IdValue}`; |
| | | // this.recordId=str; |
| | | // console.log("recordId="+str); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({recordId:this.recordId}).then(res=>{ |
| | | if(res!=null){ |
| | | this.IsLoading=false; |
| | | console.log("res"); |
| | | console.log(res); |
| | | console.log("进入初始化对象其他属性"); |
| | | this.Rental_Apply__c=res; |
| | | console.log(this.Rental_Apply__c); |
| | | this.distribution(); |
| | | this.IsLoading=false; |
| | | console.log("res"); |
| | | console.log(res); |
| | | console.log("进入初始化对象其他属性"); |
| | | this.Rental_Apply__c=res; |
| | | console.log(this.Rental_Apply__c); |
| | | this.distribution(); |
| | | } |
| | | else{ |
| | | var a="没进distribution"; |
| | | console.log(a); |
| | | var a="没进distribution"; |
| | | console.log(a); |
| | | } |
| | | }).catch(error =>{ |
| | | console.log("error"); |
| | |
| | | this.Rental_Apply__c.demo_purpose2__c == '培训中心' |
| | | ) |
| | | && this.Rental_Apply__c.Status__c == '草案中') { |
| | | alert("不能引当,请确认申请的状态"); |
| | | this.dispatchEvent(event1); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else if( |
| | | (this.Rental_Apply__c.demo_purpose2__c == '试用(无询价)' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '试用(有询价)' || |
| | |
| | | && this.Rental_Apply__c.Status__c != '批准完了' |
| | | && this.Rental_Apply__c.Status__c != '引当完了' |
| | | && this.Rental_Apply__c.Status__c != '出库指示完了') { |
| | | alert("不能引当,请确认申请的状态"); |
| | | this.dispatchEvent(event1); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } else if(rtn == 'Fin') { |
| | | window.open("/apex/EquipmentRentalApply?raid="+URLENCODE(this.Rental_Apply__c.Id)); |
| | | this.closeAction(); |
| | | } else{ |
| | | alert(rtn); |
| | | this.dispatchEvent(event2); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | } |
| | | |
| | | closeAction() { |
| | | //返回当前的备品申请 |
| | | window.open("/"+this.recordId,'_self'); |
| | | } |
| | | } |