| | |
| | | else { |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error('doinit failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | doinitSave: function (component, event, helper) { |
| | | document.title = "追溯日报"; |
| | | component.set('v.loginEdit', true); |
| | | this.report_date_list(component, event, helper, 5); |
| | | var action = component.get('c.getalldata'); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.set('v.alldata', res.reports); |
| | | component.set('v.fieldsmap', res.fieldsMap); |
| | | component.set('v.allselectlist', res.allselectlist); |
| | | component.set('v.doclist', res.doclist); |
| | | //fy |
| | | |
| | | var xx = res.UserProType; |
| | | component.set('v.UserProType', res.UserProType); |
| | | var gg = component.get('v.UserProType'); |
| | | //fy |
| | | component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); |
| | | component.find('select_DealerPersonnel').set('v.options', this.conv_selected(res.allselectlist.DealerPersonnel__c)); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.WorkRecord__c)); |
| | | component.find('select_ProductClassification').set('v.options', this.conv_selected(res.allselectlist.ProductClassification__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set('v.dialog_type', '新建'); |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | |
| | | component.set('v.PIConfig', res.PIConfig);// 20220222 PI改造 by Bright |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | else { |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error('doinit failed.'); |
| | | //this.showErrorToast(component); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | "date_str": date_str, |
| | | "person_str": person_str, |
| | | }); |
| | | component.set('v.login', true); |
| | | component.set('v.loginEdit', true); |
| | | action.setCallback(this, function (response) { |
| | | |
| | | var state = response.getState(); |
| | |
| | | component.set('v.report_count', res.reports.length); |
| | | } |
| | | //fy 20220414 end |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } else { |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | } |
| | | } else { |
| | | component.set('v.list_message', 'no_data'); |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | |
| | | } |
| | | else { |
| | | //component.set('v.errorMessage', 'get_reports failed.'); |
| | | this.error('get_reports failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | //this.showErrorToast(component); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | //编辑按钮 |
| | | edit_button: function (component, event, helper) { |
| | | //component.set('v.loginEdit', true); |
| | | component.set('v.login', true); |
| | | debugger |
| | | //component.set('v.loginEdit', true); |
| | | this.allclear(component); |
| | | //component.set('v.loadOpp', true); |
| | | var index = event.getSource().get('v.value'); |
| | |
| | | var ret = this.create_report_header_edit(component, event, helper, name, select_agency, select_date); |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component, 'Agency_Contact__c') |
| | | //component.set('v.login', false); |
| | | // SWAG-CF58C3 fy end |
| | | }, |
| | | //保存 |
| | |
| | | |
| | | // if (!productCategories__c) { error.push("其他品牌产品类别 不存在"); } |
| | | |
| | | //let errorMsg = ''; |
| | | for (var i = 0; i < error.length; i++) { |
| | | component.set('v.errorMessage', error[i]); |
| | | this.showErrorToast(component); |
| | | //errorMsg += '; ' + error[i] |
| | | //this.error(error[i]); |
| | | } |
| | | // if(errorMsg != '') |
| | | // this.error(errorMsg.substring(1)); |
| | | if (error.length > 0) { |
| | | component.find('save_button').set('v.disabled', false); |
| | | return false; |
| | | } |
| | | // 保存処理 |
| | | component.set('v.login', true); |
| | | component.set('v.loginEdit', true); |
| | | if (component.get('v.mode') == 'edit') { |
| | | var Agency_Report__c = component.get('v.select_report_data').Id; |
| | | var action = component.get('c.editAgencyReport'); |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | debugger |
| | | component.set('v.successMessage', '编辑保存成功'); |
| | | this.showSuccessToast(component); |
| | | var report_id = response.getReturnValue(); |
| | |
| | | component.set('v.update_select_report_data_id', report_id); |
| | | this.get_reports(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | else { |
| | | //component.set('v.errorMessage', 'save_report failed.'); |
| | | this.error('save_report failed.'); |
| | | this.showErrorToast(component); |
| | | this.error('保存日报失败'); |
| | | //this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | else { |
| | | // component.set('v.errorMessage', 'get_reports_now failed.'); |
| | | this.error('get_reports_now failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action2); |
| | | this.allclear(component); |
| | | component.find('select_WorkMark').set('v.value', false); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | this.doinit(component, event, helper); |
| | | component.set('v.loginEdit', false); |
| | | debugger |
| | | this.doinitSave(component, event, helper); |
| | | } |
| | | else { |
| | | var error = response.getError(); |
| | | //component.set('v.errorMessage', '保存日报失败'); |
| | | this.error('保存日报失败'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | | this.error('get_date_string failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | |
| | | if (head_key == false) { |
| | | //component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | this.error('create_header_input_key failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var key2 = s_date.replace(/-/g, ''); |
| | |
| | | else { |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error('createReportHeader callback failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | create_report_header_edit: function (component, event, helper, name, s_agency, s_date) { |
| | | component.set('v.login',true); |
| | | |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | | this.error('get_date_string failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | |
| | | if (head_key == false) { |
| | | //component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | this.error('create_header_input_key failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var key2 = s_date.replace(/-/g, ''); |
| | | var action = component.get('c.createReportHeader'); |
| | | |
| | | action.setParams({ |
| | | "name": name, |
| | | "s_date": s_date, |
| | | "s_agency": s_agency, |
| | | "head_key": head_key, |
| | | }); |
| | | component.set('v.loginEdit', true); |
| | | component.set('v.login',true); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.set('v.agency_report_header_id', res); |
| | | component.set('v.loginEdit', false); |
| | | component.set('v.login', false); |
| | | this.toggle_report_edit(component, event, helper); |
| | | } |
| | | else { |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error('createReportHeader callback failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.loginEdit', false); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string in create_header_input_key.'); |
| | | this.error('get_date_string in create_header_input_key.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | component.set("v.hospitalId", accid); |
| | | |
| | | component.set('v.setdoctorlisthos', true); |
| | | this.set_doctor_list(component, event, helper); |
| | | this.set_doctor_list_edit(component, event, helper); |
| | | }, |
| | | |
| | | |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | }, |
| | | //模糊查询使用产品2 |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | |
| | | }, |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | |
| | | }, |
| | |
| | | else { |
| | | // component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error('AWS url/token error.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | |
| | | } else if (acMap.errormsg != '') { |
| | | // component.set('v.errorMessage', acMap.errormsg); |
| | | this.error(acMap.errormsg); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } else { |
| | | //component.set('v.errorMessage', 'agency contact insert id error.'); |
| | | this.error('agency contact insert id error.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | else { |
| | | //component.set('v.errorMessage', 'agency contact insert error.'); |
| | | this.error('agency contact insert error.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.set('v.successMessage', '.拜访人已创建。'); |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component); |
| | | component.set('v.login', false); |
| | | this.set_doctor_list_edit(component); |
| | | } else { |
| | | //component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.error('AWS confirm error.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }).catch(error => { |
| | | // component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.error('AWS confirm error.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | }, |
| | | //SWAG-CF58C3 fy end 调用pi |
| | | |
| | | set_doctor_list: function (component) { |
| | | console.log('set_doctor_list') |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | console.log('hospital_id = ' + hospital_id); |
| | | if (hospital_id) { |
| | | if (doctor_value == '科室会') { |
| | | component.set('v.login', true); |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.set('v.login', true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | "hospital_id": hospital_id, |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | ; |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = component.get('v.setdoctorlisthos'); |
| | | if (setdoctorlisthos) { |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.setdoctorlisthos', false); |
| | | } |
| | | //fy |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].value == default_doctor) { |
| | | res[i].selected = true; |
| | | doctor_title = res[i].Doctor_Division1__c; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | if (res[i].AWS_Data_Id__c) { |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | component.set('v.doctor_title', doctor_title); |
| | | console.log('awsids = ' + JSON.stringify(awsids)) |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl, { |
| | | dataIds: awsids |
| | | }, function (data) { |
| | | console.log('data = ' + JSON.stringify(data)) |
| | | if (data && data.object && data.object.length) { |
| | | let m = {}; |
| | | for (let di in data.object) { |
| | | if (data.object[di] && data.object[di].dataId) { |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for (let ri in res) { |
| | | if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) { |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | } |
| | | |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } |
| | | } else { |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].AWS_Data_Id__c) { |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl, { |
| | | dataIds: awsids |
| | | }, function (data) { |
| | | if (data && data.object && data.object.length) { |
| | | let m = {}; |
| | | for (let di in data.object) { |
| | | if (data.object[di] && data.object[di].dataId) { |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for (let ri in res) { |
| | | if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) { |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | } |
| | | |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } |
| | | // component.find('select_doctor').set('v.options', res); |
| | | if (res.length > 0) { |
| | | component.set('v.doctor_title', res[0].Doctor_Division1__c); |
| | | } |
| | | } |
| | | // component.set('v.default_select_doctor_id', ''); |
| | | |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error('set_doctor_list failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | |
| | | } else { |
| | | if (doctor_value == '科室会') { |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.find('select_doctor').set('v.options', ''); |
| | | } |
| | | } |
| | | },//fy 20220414 |
| | | set_doctor_list_edit: function (component) { |
| | | console.log('set_doctor_list') |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | |
| | | else { |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error('set_doctor_list failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | |
| | | } else { |
| | | if (doctor_value == '科室会') { |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.find('select_doctor').set('v.options', ''); |
| | | } |
| | | } |
| | | component.set('v.loginEdit', false); |
| | | },//fy 20220414 |
| | | set_doctor_list_edit: function (component) { |
| | | console.log('set_doctor_list') |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | console.log('hospital_id = ' + hospital_id); |
| | | if (hospital_id) { |
| | | if (doctor_value == '科室会') { |
| | | component.set('v.loginEdit', true); |
| | | this.set_doctor_list2(component); |
| | | } else { |
| | | component.set('v.loginEdit', true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | "hospital_id": hospital_id, |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = component.get('v.setdoctorlisthos'); |
| | | if (setdoctorlisthos) { |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.setdoctorlisthos', false); |
| | | } |
| | | //fy |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].value == default_doctor) { |
| | | res[i].selected = true; |
| | | doctor_title = res[i].Doctor_Division1__c; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | if (res[i].AWS_Data_Id__c) { |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | component.set('v.doctor_title', doctor_title); |
| | | console.log('awsids = ' + JSON.stringify(awsids)) |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl, { |
| | | dataIds: awsids |
| | | }, function (data) { |
| | | console.log('data = ' + JSON.stringify(data)) |
| | | if (data && data.object && data.object.length) { |
| | | let m = {}; |
| | | for (let di in data.object) { |
| | | if (data.object[di] && data.object[di].dataId) { |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for (let ri in res) { |
| | | if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) { |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | } |
| | | |
| | | component.set('v.loginEdit', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } |
| | | } else { |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].AWS_Data_Id__c) { |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl, { |
| | | dataIds: awsids |
| | | }, function (data) { |
| | | if (data && data.object && data.object.length) { |
| | | let m = {}; |
| | | for (let di in data.object) { |
| | | if (data.object[di] && data.object[di].dataId) { |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for (let ri in res) { |
| | | if (res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)) { |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | } |
| | | |
| | | component.set('v.loginEdit', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } |
| | | // component.find('select_doctor').set('v.options', res); |
| | | if (res.length > 0) { |
| | | component.set('v.doctor_title', res[0].Doctor_Division1__c); |
| | | } |
| | | } |
| | | // component.set('v.default_select_doctor_id', ''); |
| | | |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | else { |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error('set_doctor_list failed.'); |
| | | //this.showErrorToast(component); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.find('select_Product1').set('v.value', ''); |
| | | } |
| | | }, |
| | |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.UseProduct2_TEXT', ''); |
| | | } |
| | | }, |
| | |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.find('select_Product3').set('v.value', ''); |
| | | } |
| | | }, |
| | |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.set('v.successMessage', '.拜访人已创建。'); |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component, event, helper); |
| | | this.set_doctor_list_edit(component, event, helper); |
| | | }, |
| | | createCancel: function (component, event, helper) { |
| | | component.set('v.truthy', false); |
| | |
| | | else { |
| | | //component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error('AWS url/token error.'); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | |
| | | console.log('AWS search error = ' + JSON.stringify(error)); |
| | | // component.set('v.errorMessage', 'AWS search error.'); |
| | | this.error('AWS search error.'); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | }, |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', 'AWS 查询数据为空 '); |
| | | this.error('AWS 查询数据为空 '); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | } else { |
| | | //component.set('v.errorMessage', 'AWS search status : ' + result.status); |
| | | this.error('AWS search status : ' + result.status); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', valur[1] + '\n' + "请修改后重新上传"); |
| | | this.error(valur[1] + '\n' + "请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | |
| | | console.log('error = ' + error); |
| | | //component.set('v.errorMessage', error); |
| | | this.error(error); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | console.log('error=' + error); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | |
| | | console.log("==" + res1); |
| | | //component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.error(res1 + "请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } else { |
| | |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope=\"col"\>' + headers[i] + '</th>'; |
| | | //content += '<th scope=\"col"\ style=\"width:200px">' + headers[i] + '</th>'; |
| | | if (headers[i] == '产品1同类耗材科室月使用量') { |
| | | content += '<th scope=\"col"\ style=\"width:250px"\>' + headers[i] + '</th>'; |
| | | } else { |
| | | content += '<th scope=\"col"\ style=\"width:200px"\>' + headers[i] + '</th>'; |
| | | } |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i = 0; i < objectRecords.length; i++) { |
| | |
| | | else { |
| | | //component.set('v.errorMessage', 'newlyBuild failed.'); |
| | | this.error('newlyBuild failed.'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.error('产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } else { |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | this.error('产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } |
| | | }, |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', '产品用量必须输入数字!'); |
| | | this.error('产品用量必须输入数字!'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } else { |
| | | //component.set('v.errorMessage', '产品用量最多输入14位数字!'); |
| | | this.error('产品用量最多输入14位数字!'); |
| | | this.showErrorToast(component); |
| | | //this.showErrorToast(component); |
| | | } |
| | | } |
| | | }, |
| | |
| | | component.find('new_con').set('v.disabled', true); |
| | | } |
| | | if (doctor_value != '') { |
| | | this.set_doctor_list(component); |
| | | this.set_doctor_list_edit(component); |
| | | var action = component.get('c.selectPurposeTypes'); |
| | | action.setParams({ |
| | | 'doctor_value': doctor_value |