| | |
| | | action.setParams({ recordId: recordId }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | console.log("state1:" + state); |
| | | if (state === "SUCCESS") { |
| | | var ah = response.getReturnValue(); |
| | | var select_ah = ah.Id; |
| | | var select_ah_name = ah.Name; |
| | | // component.set('v.record.Agency_Hospital__c', select_ah); |
| | | //add by Deloitte 2023-6-8 |
| | | let agency = component.get("v.record"); |
| | | agency.Agency_Hospital__c = select_ah; |
| | | // component.set("v.record", agency); |
| | | |
| | | component.set("v.record.Agency_Hospital__c", select_ah); |
| | | // alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values'))); |
| | | if ($A.get("$Browser.formFactor") == "DESKTOP") { |
| | | console.log("flag1"); |
| | | var values = [ |
| | | { |
| | | type: "Agency_Hospital_Link__c", |
| | |
| | | } |
| | | } |
| | | ]; |
| | | // component.find('input-hos').get("v.body")[0].set('v.values', values); |
| | | //add by Deloitte 2023-6-8 |
| | | if ( |
| | | component.find("input-hos").get("v.body") && |
| | | component.find("input-hos").get("v.body").length > 0 |
| | | ) { |
| | | component |
| | | .find("input-hos") |
| | | .get("v.body")[0] |
| | | .set("v.values", values); |
| | | } |
| | | component |
| | | .find("input-hos") |
| | | .get("v.body")[0] |
| | | .set("v.values", values); |
| | | } else { |
| | | // component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name); |
| | | //add by Deloitte 2023-6-8 |
| | | if ( |
| | | component.find("input-hos").get("v.body") && |
| | | component.find("input-hos").get("v.body").length > 0 |
| | | ) { |
| | | component |
| | | .find("input-hos") |
| | | .get("v.body")[0] |
| | | .set("v.selectedLabel", select_ah_name); |
| | | } |
| | | component |
| | | .find("input-hos") |
| | | .get("v.body")[0] |
| | | .set("v.selectedLabel", select_ah_name); |
| | | } |
| | | } else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | |
| | | var action = component.get("c.getProductList"); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | console.log("state2:" + state); |
| | | if (state === "SUCCESS") { |
| | | var opts = response.getReturnValue(); |
| | | // alert(JSON.stringify(opts["GI"])); |