| | |
| | | component.set("v.button_text", "编辑"); |
| | | var recordId = component.get("v.recordId"); |
| | | var action = component.get("c.getHospital"); |
| | | action.setParams({"recordId": recordId}); |
| | | action.setParams({recordId: recordId}); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | console.log("state1:"+state); |
| | |
| | | var select_ah_name = ah.Name; |
| | | // component.set('v.record.Agency_Hospital__c', select_ah); |
| | | //add by Deloitte 2023-6-8 |
| | | let agencyHosp = component.get('v.record'); |
| | | agencyHosp.Agency_Hospital__c = select_ah; |
| | | let agency = component.get("v.record"); |
| | | agency.Agency_Hospital__c = select_ah; |
| | | // component.set("v.record", agency); |
| | | // alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values'))); |
| | | if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | console.log("flag1"); |
| | |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误", |
| | | "type":"error", |
| | | "message": errors[0].message |
| | | title: "错误", |
| | | type:"error", |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | |
| | | if ($A.util.hasClass(modal_window, 'disp_none') && !component.get("v.recordId")) { |
| | | $A.get('e.force:refreshView').fire(); |
| | | } |
| | | }, |
| | | |
| | | toggle_report : function(component, event, helper) { |
| | |
| | | |
| | | var accid = component.get("v.record.Agency_Hospital__c"); |
| | | var action = component.get("c.getDeptAmount"); |
| | | action.setParams({ "hospitalId" : accid }); |
| | | action.setParams({ hospitalId : accid }); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | |
| | | |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "成功", |
| | | "type":"success", |
| | | "message": "保存成功" |
| | | title: "成功", |
| | | type:"success", |
| | | message: "保存成功" |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | |
| | | } else if (state === "INCOMPLETE") { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "未完成!", |
| | | "type":"error", |
| | | "message": "未完成" |
| | | title: "未完成!", |
| | | type:"error", |
| | | message: "未完成" |
| | | }); |
| | | toastEvent.fire(); |
| | | } else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误", |
| | | "type":"error", |
| | | "message": errors[0].message |
| | | title: "错误", |
| | | type:"error", |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "警告!", |
| | | "message": message, |
| | | "type":"warning", |
| | | "duration" : "10000" |
| | | title: "警告!", |
| | | message: message, |
| | | type:"warning", |
| | | duration : "10000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | |
| | | error : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type":"error", |
| | | "duration" : "10000" |
| | | title: "错误!", |
| | | message: message, |
| | | type:"error", |
| | | duration : "10000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |