| | |
| | | if(!rid){ |
| | | pid = window.location.href.replace("https://","").split("/")[4]; |
| | | } |
| | | let isClone = component.get('v.isClone'); |
| | | if(!rid || isClone){ |
| | | component.set('v.title',$A.get("$Label.c.New")+'.客户人员'); |
| | | }else{ |
| | | component.set('v.title',$A.get("$Label.c.Edit")+'.客户人员'); |
| | | } |
| | | |
| | | let record_type_id = null; |
| | | let pageref = component.get("v.pageReference") |
| | | if(!record_type_id && pageref){ |
| | | record_type_id = pageref.state.recordTypeId |
| | | } |
| | | component.set("v.showSpinner", true); |
| | | helper.CallBackAction(component,'Init',{ |
| | | rid : rid, |
| | | pid : pid, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id : component.get("v.pageReference").state.recordTypeId, |
| | | record_type_id : record_type_id, |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | |
| | |
| | | if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){ |
| | | item.value = pid; |
| | | } |
| | | |
| | | if(fields.hasOwnProperty(item.field)){ |
| | | item.fi = fields[item.field]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | let staticResource = component.get('v.staticResource'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | let url = staticResource.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id) { |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | |
| | | |
| | | payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value; |
| | | } |
| | | |
| | | if (item.behavior == "Required" && !item.value ) { |
| | | let fs = component.find("field"); |
| | | for(let fi in fs){ |
| | | let f = fs[fi]; |
| | | if(!f.get('v.value')){ |
| | | f.reset(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | let obj = result.object[0]; |
| | | let data = {}; |
| | | if(record_id){ |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | }else{ |
| | | data.AWS_Data_Id__c = obj.dataId; |
| | |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = rv.Data.recordId; |
| | | var sfId = null; |
| | | if(rv.IsSuccess){ |
| | | sfId = rv.Data.recordId; |
| | | } |
| | | |
| | | helper.AwsPost(staticResource.transactionUrl,{ |
| | | txId: result.txId, |
| | |
| | | "type" : "success" |
| | | }); |
| | | |
| | | if (record_id){ |
| | | if (record_id && !isClone){ |
| | | |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | $A.get('e.force:refreshView').fire(); |