| | |
| | | ({ |
| | | doinit: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | document.title = '追溯日报'; |
| | | |
| | | ======= |
| | | document.title = "追溯日报"; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.report_date_list(component, event, helper, 5); |
| | | component.set('v.login', true); |
| | | var action = component.get('c.getalldata'); |
| | |
| | | component.set('v.allselectlist', res.allselectlist); |
| | | component.set('v.doclist', res.doclist); |
| | | //fy |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var xx = res.UserProType; |
| | | component.set('v.UserProType', res.UserProType); |
| | | var gg = component.get('v.UserProType'); |
| | | //fy |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_agency_person') |
| | | .set( |
| | |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | ======= |
| | | 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.login', false); |
| | | } |
| | | else { |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error('doinit failed.'); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | doinitSave: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | document.title = '追溯日报'; |
| | | ======= |
| | | document.title = "追溯日报"; |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.loginEdit', true); |
| | | this.report_date_list(component, event, helper, 5); |
| | | var action = component.get('c.getalldata'); |
| | |
| | | component.set('v.allselectlist', res.allselectlist); |
| | | component.set('v.doclist', res.doclist); |
| | | //fy |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var xx = res.UserProType; |
| | | component.set('v.UserProType', res.UserProType); |
| | | var gg = component.get('v.UserProType'); |
| | | //fy |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_agency_person') |
| | | .set( |
| | |
| | | component.set('v.PIConfig', res.PIConfig); // 20220222 PI改造 by Bright |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | ======= |
| | | 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 { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error('doinit failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | }, |
| | | //其他品牌产品类别 下拉框赋值 |
| | | selectProductCcategory: function (component) { |
| | | <<<<<<< HEAD |
| | | var select_ProductClassification = component |
| | | .find('select_ProductClassification') |
| | | .get('v.value'); |
| | | ======= |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (select_ProductClassification != '') { |
| | | var action = component.get('c.selectProductCcategory'); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_ProductCcategory') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | ======= |
| | | component.find('select_ProductCcategory').set('v.options', JSON.parse(JSON.stringify(res))); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | //根据周和担当查询数据给初始页面赋数据 |
| | | get_reports: function (component, event, helper, date_str, person_str) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (!date_str) { |
| | | return false; |
| | | } |
| | |
| | | date_str = this.get_date_string(date_str); |
| | | var action = component.get('c.getReports'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | date_str: date_str, |
| | | person_str: person_str |
| | | }); |
| | | component.set('v.loginEdit', true); |
| | | action.setCallback(this, function (response) { |
| | | ======= |
| | | "date_str": date_str, |
| | | "person_str": person_str, |
| | | }); |
| | | component.set('v.loginEdit', true); |
| | | action.setCallback(this, function (response) { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | |
| | | component.set('v.report_count', res.reports.length); |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get('v.update_select_report_data_id'); |
| | | <<<<<<< HEAD |
| | | if (report_id != '') { |
| | | for (var i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | |
| | | 'v.select_report_data', |
| | | res.reports[i] |
| | | ); |
| | | ======= |
| | | if (report_id != "") { |
| | | for (var i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | | component.set('v.select_report_data', res.reports[i]); |
| | | >>>>>>> LEXCommunityLiJun |
| | | break; |
| | | } |
| | | } |
| | |
| | | //fy 20220414 start |
| | | var report1 = []; |
| | | var report2 = []; |
| | | <<<<<<< HEAD |
| | | res.reports.forEach((item) => { |
| | | if ( |
| | | (item.WorkRecord__c == '科室会' && |
| | |
| | | item.doctor2__r == '' || |
| | | item.doctor2__r == '')) |
| | | ) { |
| | | ======= |
| | | res.reports.forEach(item => { |
| | | if ((item.WorkRecord__c == '科室会' && item.doctor3__c != undefined) || |
| | | ((item.doctor3__c == undefined || item.doctor3__c == '' || item.doctor3__c == "") |
| | | && (item.doctor2__r == undefined || item.doctor2__r == '' || item.doctor2__r == ""))) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | report1.push(item); |
| | | } else { |
| | | report2.push(item); |
| | |
| | | //fy 20220414 end |
| | | // PI 改造 By Bright 20220328 |
| | | if (true) { |
| | | <<<<<<< HEAD |
| | | let doctor_awsids = res.reports.map(function (d) { |
| | | return d.doctor2__r.AWS_Data_Id__c; |
| | | }); |
| | |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | ======= |
| | | let doctor_awsids = res.reports.map(function (d) { return d.doctor2__r.AWS_Data_Id__c; }); |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | if (doctor_awsids.length > 0) { |
| | | AWSService.search(staticResourceAgencyContact.searchUrl, { |
| | | dataIds: doctor_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.reports) { |
| | | if (res.reports[ri] && res.reports[ri].doctor2__r && res.reports[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res.reports[ri].doctor2__r.AWS_Data_Id__c)) { |
| | | res.reports[ri].doctor2__r.awsdata = m[res.reports[ri].doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | component.set('v.reports', res.reports); |
| | | component.set('v.report_count', res.reports.length); |
| | | } |
| | | //fy 20220414 start |
| | | var reports3 = component.get('v.reports'); |
| | | if (reports3.length < flag2) { |
| | | res.reports = [...report1, ...reports3]; |
| | | component.set('v.reports', res.reports); |
| | | component.set('v.report_count', res.reports.length); |
| | | } |
| | | //fy 20220414 end |
| | | component.set('v.loginEdit', false); |
| | | }, staticResourceAgencyContact.token); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | component.set('v.loginEdit', false); |
| | | } |
| | |
| | | component.set('v.list_message', 'no_data'); |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'get_reports failed.'); |
| | | this.error('get_reports failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | }, |
| | | //复制按钮变灰色 |
| | | select_date_change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | this.get_reports( |
| | | component, |
| | | event, |
| | |
| | | component.find('select_date').get('v.value'), |
| | | component.find('select_agency_person').get('v.value') |
| | | ); |
| | | ======= |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.select_report_data_radio', ''); |
| | | component.find('copy_button').set('v.disabled', true); |
| | | component.find('delete_button').set('v.disabled', true); |
| | | }, |
| | | |
| | | select_agency_change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var select_value = component |
| | | .find('select_agency_person') |
| | | .get('v.value'); |
| | |
| | | component.find('select_date').get('v.value'), |
| | | select_value |
| | | ); |
| | | ======= |
| | | var select_value = component.find('select_agency_person').get('v.value'); |
| | | var new_label = this.get_agency_person_name(component, select_value); |
| | | component.set('v.selected_agency_person', new_label); |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), select_value); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.select_report_data_radio', ''); |
| | | component.find('copy_button').set('v.disabled', true); |
| | | component.find('delete_button').set('v.disabled', true); |
| | |
| | | }, |
| | | //复制和编辑回显的位置 |
| | | toggle_report: function (component) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | if ($A.util.hasClass(modal_window, 'disp_none')) { |
| | |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | //复制 和编辑 回显问题在这里面 |
| | | <<<<<<< HEAD |
| | | if ( |
| | | component.get('v.mode') == 'edit' || |
| | | component.get('v.mode') == 'copy' |
| | | ) { |
| | | ======= |
| | | if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var select_data = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | | select_data = component.get('v.select_report_data'); |
| | |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | reports[i]['Agency_Hospital__c'] == |
| | | select_data['Agency_Hospital__c'] |
| | |
| | | reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = |
| | | reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | ======= |
| | | if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) { |
| | | Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | component.set('v.hospital', Agency_Hospital_text); |
| | | component.set('v.hospitalId', Agency_Hospital_parent_id); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.hospitalLinkId', |
| | | select_data['Agency_Hospital__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('new_con').set('v.disabled', false); |
| | | } |
| | | //使用产品1(产品型号) |
| | | var UseProduct1Text = ''; |
| | | var UseProduct1Id = ''; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_data['UseProduct1__c'] != '' && |
| | | select_data['UseProduct1__c'] != undefined |
| | |
| | | reports[i]['UseProduct1__r'][ |
| | | 'Asset_Model_No__c' |
| | | ]; |
| | | ======= |
| | | if (select_data['UseProduct1__c'] != '' && select_data['UseProduct1__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct1__c'] == select_data['UseProduct1__c']) { |
| | | UseProduct1Text = reports[i]['UseProduct1__r']['Asset_Model_No__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | UseProduct1Id = reports[i]['UseProduct1__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct1', UseProduct1Text); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.UseProduct1Id', |
| | | select_data['UseProduct1__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.UseProduct1Id', select_data['UseProduct1__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //使用产品2 |
| | | var UseProduct2Text = ''; |
| | | var UseProduct2Id = ''; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_data['UseProduct2__c'] != '' && |
| | | select_data['UseProduct2__c'] != undefined |
| | |
| | | reports[i]['UseProduct2__r'][ |
| | | 'Asset_Model_No__c' |
| | | ]; |
| | | ======= |
| | | if (select_data['UseProduct2__c'] != '' && select_data['UseProduct2__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct2__c'] == select_data['UseProduct2__c']) { |
| | | UseProduct2Text = reports[i]['UseProduct2__r']['Asset_Model_No__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | UseProduct2Id = reports[i]['UseProduct2__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct2', UseProduct2Text); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.UseProduct2Id', |
| | | select_data['UseProduct2__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.UseProduct2Id', select_data['UseProduct2__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //使用产品3 |
| | | var UseProduct3Text = ''; |
| | | var UseProduct3Id = ''; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_data['UseProduct3__c'] != '' && |
| | | select_data['UseProduct3__c'] != undefined |
| | |
| | | reports[i]['UseProduct3__r'][ |
| | | 'Asset_Model_No__c' |
| | | ]; |
| | | ======= |
| | | if (select_data['UseProduct3__c'] != '' && select_data['UseProduct3__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct3__c'] == select_data['UseProduct3__c']) { |
| | | UseProduct3Text = reports[i]['UseProduct3__r']['Asset_Model_No__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | UseProduct3Id = reports[i]['UseProduct3__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct3', UseProduct3Text); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.UseProduct3Id', |
| | | select_data['UseProduct3__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.UseProduct3Id', select_data['UseProduct3__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //活动日 |
| | | var reportDate; |
| | | if (select_data['Report_Date__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | reports[i]['Report_Date__c'] == |
| | | select_data['Report_Date__c'] |
| | | ) { |
| | | reportDate = reports[i]['Report_Date__c']; |
| | | ======= |
| | | if (reports[i]['Report_Date__c'] == select_data['Report_Date__c']) { |
| | | reportDate = reports[i]["Report_Date__c"]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | component.set('v.data.Report_Date__c', reportDate); |
| | |
| | | // } |
| | | //fy Department_Cateogy_text__c |
| | | if (select_data['Department_Cateogy_text__c'] != '') { |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_department') |
| | | .set( |
| | |
| | | 'select_purpose_type', |
| | | select_data['WorkRecord__c'] |
| | | ); |
| | | ======= |
| | | component.find('select_department').set('v.value', select_data['Department_Cateogy_text__c']); |
| | | } |
| | | //经销商人员 |
| | | if (select_data['DealerPersonnel__c'] != '') { |
| | | this.set_selected(component, 'select_DealerPersonnel', select_data['DealerPersonnel__c']); |
| | | } |
| | | // 活动区分 |
| | | if (select_data['WorkRecord__c'] != '') { |
| | | this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.selectPurposeType(component); |
| | | } |
| | | // 拜访人 |
| | | if (select_data['WorkRecord__c'] == '科室会') { |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.default_select_doctor_id2', |
| | | select_data['doctor3__c'] |
| | |
| | | 'v.default_select_doctor_id', |
| | | select_data['doctor2__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.default_select_doctor_id2', select_data['doctor3__c']); |
| | | var a = component.get('v.default_select_doctor_id2'); |
| | | this.set_doctor_list(component); |
| | | } else { |
| | | component.set('v.default_select_doctor_id', select_data['doctor2__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.set_doctor_list(component); |
| | | } |
| | | //产品分类(第三分类) |
| | | if (select_data['ProductClassification__c'] != null) { |
| | | <<<<<<< HEAD |
| | | this.set_selected( |
| | | component, |
| | | 'select_ProductClassification', |
| | |
| | | } |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != '') { |
| | | ======= |
| | | this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']); |
| | | this.selectProductClassification(component); |
| | | } |
| | | // 产品1同类耗材科室月使用量 |
| | | if (select_data['ConsumptionOfConsumables__c'] != '') { |
| | | component.find('select_ConsumptionOfConsumables').set('v.value', select_data['ConsumptionOfConsumables__c']); |
| | | } |
| | | // 产品用量 |
| | | if (select_data['warlocksNumber__c'] != '') { |
| | | component.find('select_warlocksNumber').set('v.value', select_data['warlocksNumber__c']); |
| | | } |
| | | // 支援需求 |
| | | if (select_data['WorkMark__c'] != false) { |
| | | component.find('select_WorkMark').set('v.checked', select_data['WorkMark__c']); |
| | | } |
| | | ; |
| | | |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != "") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var select_EffectProgress1 = ''; |
| | | var WarlockClassification = ''; |
| | | var ProductCcategory = ''; |
| | | var productCategories = ''; |
| | | var i = 0; |
| | | for (i = 0; i < reports.length; i++) { |
| | | <<<<<<< HEAD |
| | | if (report_id == reports[i]['Id']) { |
| | | select_EffectProgress1 = |
| | | reports[i]['EffectProgress__c']; |
| | |
| | | reports[i]['ProductCcategory__c']; |
| | | productCategories = |
| | | reports[i]['productCategories__c']; |
| | | ======= |
| | | if (report_id == reports[i]["Id"]) { |
| | | select_EffectProgress1 = reports[i]["EffectProgress__c"]; |
| | | WarlockClassification = reports[i]["WarlockClassification__c"]; |
| | | ProductCcategory = reports[i]["ProductCcategory__c"]; |
| | | productCategories = reports[i]["productCategories__c"]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | break; |
| | | } |
| | | } |
| | | //效果/进度 |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_EffectProgress1 != null && |
| | | select_EffectProgress1 != '' |
| | |
| | | component |
| | | .find('select_ProductCcategory') |
| | | .set('v.value', ProductCcategory); |
| | | ======= |
| | | if (select_EffectProgress1 != null && select_EffectProgress1 != '') { |
| | | component.find('select_EffectProgress').set('v.value', select_EffectProgress1); |
| | | } |
| | | //术士分类 |
| | | if (WarlockClassification != null && WarlockClassification != '') { |
| | | component.find('select_OtherBrandConsumables').set('v.value', WarlockClassification); |
| | | } |
| | | //已采用其他品牌 |
| | | if (ProductCcategory != null && ProductCcategory != '') { |
| | | component.find('select_ProductCcategory').set('v.value', ProductCcategory); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.selectpurposetype(component); |
| | | } |
| | | //其他品牌产品类别 |
| | | if (productCategories != null && productCategories != '') { |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_productCategories') |
| | | .set('v.value', productCategories); |
| | | } |
| | | component.set('v.edit_copy_select_report_id', ''); |
| | | ======= |
| | | component.find('select_productCategories').set('v.value', productCategories); |
| | | } |
| | | component.set('v.edit_copy_select_report_id', ""); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } else { |
| | |
| | | var UseProduct1__c = component.get('v.UseProduct1Id'); |
| | | var UseProduct2__c = component.get('v.UseProduct2Id'); |
| | | var UseProduct3__c = component.get('v.UseProduct3Id'); |
| | | <<<<<<< HEAD |
| | | var Department_Cateogy__c = component |
| | | .find('select_department') |
| | | .get('v.value'); |
| | |
| | | var confirm_text = '放弃新建日报?'; |
| | | if ( |
| | | !Report_Date__c && |
| | | ======= |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value'); |
| | | var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value'); |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | var WorkRecord__c = component.find('select_purpose_type').get('v.value'); |
| | | var EffectProgress__c = component.find('select_EffectProgress').get('v.value'); |
| | | var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value'); |
| | | var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value'); |
| | | var productCategories__c = component.find('select_productCategories').get('v.value'); |
| | | var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value'); |
| | | var WorkMark__c = component.find('select_WorkMark').get('v.checked'); |
| | | if (component.get('v.mode') == 'new') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建日报?'; |
| | | if (!Report_Date__c && |
| | | >>>>>>> LEXCommunityLiJun |
| | | !Agency_Hospital__c && |
| | | !UseProduct1__c && |
| | | !UseProduct2__c && |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | <<<<<<< HEAD |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃新建日报?'; |
| | | if ( |
| | |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c |
| | | ) { |
| | | ======= |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建日报?'; |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['UseProduct1__c'] == UseProduct1__c && |
| | | select_report_data['UseProduct2__c'] == UseProduct2__c && |
| | | select_report_data['UseProduct3__c'] == UseProduct3__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c && |
| | | select_report_data['DealerPersonnel__c'] == DealerPersonnel__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['EffectProgress__c'] == EffectProgress__c && |
| | | select_report_data['WarlockClassification__c'] == WarlockClassification__c && |
| | | select_report_data['ProductCcategory__c'] == ProductCcategory__c && |
| | | select_report_data['productCategories__c'] == productCategories__c && |
| | | select_report_data['warlocksNumber__c'] == warlocksNumber__c && |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'edit') { |
| | | <<<<<<< HEAD |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃编辑日报?'; |
| | | if ( |
| | |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c |
| | | ) { |
| | | ======= |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃编辑日报?'; |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['UseProduct1__c'] == UseProduct1__c && |
| | | select_report_data['UseProduct2__c'] == UseProduct2__c && |
| | | select_report_data['UseProduct3__c'] == UseProduct3__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c && |
| | | select_report_data['DealerPersonnel__c'] == DealerPersonnel__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['EffectProgress__c'] == EffectProgress__c && |
| | | select_report_data['WarlockClassification__c'] == WarlockClassification__c && |
| | | select_report_data['ProductCcategory__c'] == ProductCcategory__c && |
| | | select_report_data['productCategories__c'] == productCategories__c && |
| | | select_report_data['warlocksNumber__c'] == warlocksNumber__c && |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | <<<<<<< HEAD |
| | | component.set('v.loginEdit', true); |
| | | //复制 和编辑 回显问题在这里面 |
| | | if ( |
| | | component.get('v.mode') == 'edit' || |
| | | component.get('v.mode') == 'copy' |
| | | ) { |
| | | ======= |
| | | component.set('v.loginEdit',true); |
| | | //复制 和编辑 回显问题在这里面 |
| | | if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var select_data = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | | select_data = component.get('v.select_report_data'); |
| | |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | reports[i]['Agency_Hospital__c'] == |
| | | select_data['Agency_Hospital__c'] |
| | |
| | | reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = |
| | | reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | ======= |
| | | if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) { |
| | | Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | component.set('v.hospital', Agency_Hospital_text); |
| | | component.set('v.hospitalId', Agency_Hospital_parent_id); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.hospitalLinkId', |
| | | select_data['Agency_Hospital__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('new_con').set('v.disabled', false); |
| | | } |
| | | //使用产品1(产品型号) |
| | | var UseProduct1Text = ''; |
| | | var UseProduct1Id = ''; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_data['UseProduct1__c'] != '' && |
| | | select_data['UseProduct1__c'] != undefined |
| | |
| | | reports[i]['UseProduct1__r'][ |
| | | 'Asset_Model_No__c' |
| | | ]; |
| | | ======= |
| | | if (select_data['UseProduct1__c'] != '' && select_data['UseProduct1__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct1__c'] == select_data['UseProduct1__c']) { |
| | | UseProduct1Text = reports[i]['UseProduct1__r']['Asset_Model_No__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | UseProduct1Id = reports[i]['UseProduct1__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct1', UseProduct1Text); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.UseProduct1Id', |
| | | select_data['UseProduct1__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.UseProduct1Id', select_data['UseProduct1__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //使用产品2 |
| | | var UseProduct2Text = ''; |
| | | var UseProduct2Id = ''; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_data['UseProduct2__c'] != '' && |
| | | select_data['UseProduct2__c'] != undefined |
| | |
| | | reports[i]['UseProduct2__r'][ |
| | | 'Asset_Model_No__c' |
| | | ]; |
| | | ======= |
| | | if (select_data['UseProduct2__c'] != '' && select_data['UseProduct2__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct2__c'] == select_data['UseProduct2__c']) { |
| | | UseProduct2Text = reports[i]['UseProduct2__r']['Asset_Model_No__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | UseProduct2Id = reports[i]['UseProduct2__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct2', UseProduct2Text); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.UseProduct2Id', |
| | | select_data['UseProduct2__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.UseProduct2Id', select_data['UseProduct2__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //使用产品3 |
| | | var UseProduct3Text = ''; |
| | | var UseProduct3Id = ''; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_data['UseProduct3__c'] != '' && |
| | | select_data['UseProduct3__c'] != undefined |
| | |
| | | reports[i]['UseProduct3__r'][ |
| | | 'Asset_Model_No__c' |
| | | ]; |
| | | ======= |
| | | if (select_data['UseProduct3__c'] != '' && select_data['UseProduct3__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct3__c'] == select_data['UseProduct3__c']) { |
| | | UseProduct3Text = reports[i]['UseProduct3__r']['Asset_Model_No__c']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | UseProduct3Id = reports[i]['UseProduct3__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct3', UseProduct3Text); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.UseProduct3Id', |
| | | select_data['UseProduct3__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.UseProduct3Id', select_data['UseProduct3__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //活动日 |
| | | var reportDate; |
| | | if (select_data['Report_Date__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | reports[i]['Report_Date__c'] == |
| | | select_data['Report_Date__c'] |
| | | ) { |
| | | reportDate = reports[i]['Report_Date__c']; |
| | | ======= |
| | | if (reports[i]['Report_Date__c'] == select_data['Report_Date__c']) { |
| | | reportDate = reports[i]["Report_Date__c"]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | component.set('v.data.Report_Date__c', reportDate); |
| | |
| | | // } |
| | | //fy Department_Cateogy_text__c |
| | | if (select_data['Department_Cateogy_text__c'] != '') { |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_department') |
| | | .set( |
| | |
| | | 'select_purpose_type', |
| | | select_data['WorkRecord__c'] |
| | | ); |
| | | ======= |
| | | component.find('select_department').set('v.value', select_data['Department_Cateogy_text__c']); |
| | | } |
| | | //经销商人员 |
| | | if (select_data['DealerPersonnel__c'] != '') { |
| | | this.set_selected(component, 'select_DealerPersonnel', select_data['DealerPersonnel__c']); |
| | | } |
| | | // 活动区分 |
| | | if (select_data['WorkRecord__c'] != '') { |
| | | this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.selectPurposeType(component); |
| | | } |
| | | // 拜访人 |
| | | if (select_data['WorkRecord__c'] == '科室会') { |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.default_select_doctor_id2', |
| | | select_data['doctor3__c'] |
| | |
| | | 'v.default_select_doctor_id', |
| | | select_data['doctor2__c'] |
| | | ); |
| | | ======= |
| | | component.set('v.default_select_doctor_id2', select_data['doctor3__c']); |
| | | var a = component.get('v.default_select_doctor_id2'); |
| | | this.set_doctor_list_edit(component); |
| | | } else { |
| | | component.set('v.default_select_doctor_id', select_data['doctor2__c']); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.set_doctor_list_edit(component); |
| | | } |
| | | //产品分类(第三分类) |
| | | if (select_data['ProductClassification__c'] != null) { |
| | | <<<<<<< HEAD |
| | | this.set_selected( |
| | | component, |
| | | 'select_ProductClassification', |
| | |
| | | } |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != '') { |
| | | ======= |
| | | this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']); |
| | | this.selectProductClassification(component); |
| | | } |
| | | // 产品1同类耗材科室月使用量 |
| | | if (select_data['ConsumptionOfConsumables__c'] != '') { |
| | | component.find('select_ConsumptionOfConsumables').set('v.value', select_data['ConsumptionOfConsumables__c']); |
| | | } |
| | | // 产品用量 |
| | | if (select_data['warlocksNumber__c'] != '') { |
| | | component.find('select_warlocksNumber').set('v.value', select_data['warlocksNumber__c']); |
| | | } |
| | | // 支援需求 |
| | | if (select_data['WorkMark__c'] != false) { |
| | | component.find('select_WorkMark').set('v.checked', select_data['WorkMark__c']); |
| | | } |
| | | ; |
| | | |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != "") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var select_EffectProgress1 = ''; |
| | | var WarlockClassification = ''; |
| | | var ProductCcategory = ''; |
| | | var productCategories = ''; |
| | | var i = 0; |
| | | for (i = 0; i < reports.length; i++) { |
| | | <<<<<<< HEAD |
| | | if (report_id == reports[i]['Id']) { |
| | | select_EffectProgress1 = |
| | | reports[i]['EffectProgress__c']; |
| | |
| | | reports[i]['ProductCcategory__c']; |
| | | productCategories = |
| | | reports[i]['productCategories__c']; |
| | | ======= |
| | | if (report_id == reports[i]["Id"]) { |
| | | select_EffectProgress1 = reports[i]["EffectProgress__c"]; |
| | | WarlockClassification = reports[i]["WarlockClassification__c"]; |
| | | ProductCcategory = reports[i]["ProductCcategory__c"]; |
| | | productCategories = reports[i]["productCategories__c"]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | break; |
| | | } |
| | | } |
| | | //效果/进度 |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_EffectProgress1 != null && |
| | | select_EffectProgress1 != '' |
| | |
| | | component |
| | | .find('select_ProductCcategory') |
| | | .set('v.value', ProductCcategory); |
| | | ======= |
| | | if (select_EffectProgress1 != null && select_EffectProgress1 != '') { |
| | | component.find('select_EffectProgress').set('v.value', select_EffectProgress1); |
| | | } |
| | | //术士分类 |
| | | if (WarlockClassification != null && WarlockClassification != '') { |
| | | component.find('select_OtherBrandConsumables').set('v.value', WarlockClassification); |
| | | } |
| | | //已采用其他品牌 |
| | | if (ProductCcategory != null && ProductCcategory != '') { |
| | | component.find('select_ProductCcategory').set('v.value', ProductCcategory); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.selectpurposetype(component); |
| | | } |
| | | //其他品牌产品类别 |
| | | if (productCategories != null && productCategories != '') { |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_productCategories') |
| | | .set('v.value', productCategories); |
| | | } |
| | | component.set('v.edit_copy_select_report_id', ''); |
| | | } |
| | | ======= |
| | | component.find('select_productCategories').set('v.value', productCategories); |
| | | } |
| | | component.set('v.edit_copy_select_report_id', ""); |
| | | } |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } else { |
| | | var select_report_data = component.get('v.select_report_data'); |
| | |
| | | var UseProduct1__c = component.get('v.UseProduct1Id'); |
| | | var UseProduct2__c = component.get('v.UseProduct2Id'); |
| | | var UseProduct3__c = component.get('v.UseProduct3Id'); |
| | | <<<<<<< HEAD |
| | | var Department_Cateogy__c = component |
| | | .find('select_department') |
| | | .get('v.value'); |
| | |
| | | var confirm_text = '放弃新建日报?'; |
| | | if ( |
| | | !Report_Date__c && |
| | | ======= |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value'); |
| | | var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value'); |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | var WorkRecord__c = component.find('select_purpose_type').get('v.value'); |
| | | var EffectProgress__c = component.find('select_EffectProgress').get('v.value'); |
| | | var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value'); |
| | | var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value'); |
| | | var productCategories__c = component.find('select_productCategories').get('v.value'); |
| | | var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value'); |
| | | var WorkMark__c = component.find('select_WorkMark').get('v.checked'); |
| | | if (component.get('v.mode') == 'new') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建日报?'; |
| | | if (!Report_Date__c && |
| | | >>>>>>> LEXCommunityLiJun |
| | | !Agency_Hospital__c && |
| | | !UseProduct1__c && |
| | | !UseProduct2__c && |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | <<<<<<< HEAD |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃新建日报?'; |
| | | if ( |
| | |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c |
| | | ) { |
| | | ======= |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建日报?'; |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['UseProduct1__c'] == UseProduct1__c && |
| | | select_report_data['UseProduct2__c'] == UseProduct2__c && |
| | | select_report_data['UseProduct3__c'] == UseProduct3__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c && |
| | | select_report_data['DealerPersonnel__c'] == DealerPersonnel__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['EffectProgress__c'] == EffectProgress__c && |
| | | select_report_data['WarlockClassification__c'] == WarlockClassification__c && |
| | | select_report_data['ProductCcategory__c'] == ProductCcategory__c && |
| | | select_report_data['productCategories__c'] == productCategories__c && |
| | | select_report_data['warlocksNumber__c'] == warlocksNumber__c && |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'edit') { |
| | | <<<<<<< HEAD |
| | | var confirm_title = '警告!'; |
| | | var confirm_text = '放弃编辑日报?'; |
| | | if ( |
| | |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c |
| | | ) { |
| | | ======= |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃编辑日报?'; |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['UseProduct1__c'] == UseProduct1__c && |
| | | select_report_data['UseProduct2__c'] == UseProduct2__c && |
| | | select_report_data['UseProduct3__c'] == UseProduct3__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c && |
| | | select_report_data['DealerPersonnel__c'] == DealerPersonnel__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['EffectProgress__c'] == EffectProgress__c && |
| | | select_report_data['WarlockClassification__c'] == WarlockClassification__c && |
| | | select_report_data['ProductCcategory__c'] == ProductCcategory__c && |
| | | select_report_data['productCategories__c'] == productCategories__c && |
| | | select_report_data['warlocksNumber__c'] == warlocksNumber__c && |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //component.set('v.loginEdit',false); |
| | | }, |
| | |
| | | var modal_bg = component.find('modal_bg'); |
| | | var modal_confirm = component.find('modal_confirm'); |
| | | var modal_confirm_bg = component.find('modal_confirm_bg'); |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (confirm_status == 0) { |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | |
| | | $A.util.addClass(modal_confirm_bg, 'disp_none'); |
| | | component.set('v.mode', ''); |
| | | this.allclear(component); |
| | | <<<<<<< HEAD |
| | | component.set('v.reports_now', ''); |
| | | ======= |
| | | component.set('v.reports_now', ""); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.reports_now_count', 0); |
| | | component.set('v.confirm_status', 0); |
| | | } else if (confirm_status == 2) { |
| | |
| | | }, |
| | | //新建按钮 |
| | | new_report: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.mode', 'new'); |
| | | component.set('v.dialog_type', '新建'); |
| | | // 周 |
| | | var select_date = component.find('select_date').get('v.value'); |
| | | // 担当 |
| | | <<<<<<< HEAD |
| | | var select_agency = component |
| | | .find('select_agency_person') |
| | | .get('v.value'); |
| | | var cm = 0; |
| | | if (select_agency.indexOf(';') != -1) { |
| | | select_agency = select_agency.split(';')[0]; |
| | | ======= |
| | | var select_agency = component.find('select_agency_person').get('v.value'); |
| | | var cm = 0; |
| | | if (select_agency.indexOf(";") != -1) { |
| | | select_agency = select_agency.split(";")[0]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | component.set('v.selected_date', select_date); |
| | | // 担当 |
| | | var name = component.get('v.selected_agency_person'); |
| | | <<<<<<< HEAD |
| | | var ret = this.create_report_header( |
| | | component, |
| | | event, |
| | |
| | | |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component, 'Agency_Contact__c'); |
| | | ======= |
| | | var ret = this.create_report_header(component, event, helper, name, select_agency, select_date); |
| | | component.set('v.default_select_doctor_id2', ''); |
| | | |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component, 'Agency_Contact__c') |
| | | >>>>>>> LEXCommunityLiJun |
| | | // SWAG-CF58C3 fy end |
| | | }, |
| | | // 复制按钮 |
| | | copy_button: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.allclear(component); |
| | | component.set('v.mode', 'copy'); |
| | | component.set('v.dialog_type', '新建'); |
| | |
| | | component.set('v.loadOpp', true); |
| | | // 週 |
| | | var now = new Date(); |
| | | <<<<<<< HEAD |
| | | var start_day = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | |
| | | (start_day.getMonth() + 1) + |
| | | '/' + |
| | | start_day.getDate(); |
| | | ======= |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1)); |
| | | var select_date = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.set_selected(component, 'select_date', select_date); |
| | | component.set('v.selected_date', select_date); |
| | | // 担当 |
| | |
| | | component.set('v.edit_copy_select_report_id', select_report_data['Id']); |
| | | component.set('v.select_report_data', select_report_data); |
| | | |
| | | <<<<<<< HEAD |
| | | var ret = this.create_report_header( |
| | | component, |
| | | event, |
| | |
| | | var action = component.get('c.deleteAgencyReport'); |
| | | action.setParams({ |
| | | agencyReport_id: select_report_data.Id |
| | | ======= |
| | | var ret = this.create_report_header(component, event, helper, name, select_agency, select_date); |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component, 'Agency_Contact__c') |
| | | // SWAG-CF58C3 fy end |
| | | |
| | | }, |
| | | //删除按钮 |
| | | delete_button: function (component, event, helper) { |
| | | |
| | | var select_report_data = component.get('v.select_report_data_radio'); |
| | | if (confirm('是否删除该数据?')) { |
| | | |
| | | component.set('v.login', true); |
| | | var action = component.get('c.deleteAgencyReport'); |
| | | action.setParams({ |
| | | "agencyReport_id": select_report_data.Id, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | |
| | | }, |
| | | //复制按钮可用 |
| | | change_report_radio: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var reports = component.get('v.reports'); |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i].Name == event.getSource().get('v.label')) { |
| | |
| | | //编辑按钮 |
| | | edit_button: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | <<<<<<< HEAD |
| | | debugger; |
| | | ======= |
| | | debugger |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.loginEdit', true); |
| | | this.allclear(component); |
| | | //component.set('v.loadOpp', true); |
| | | var index = event.getSource().get('v.value'); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.select_report_data', |
| | | component.get('v.reports')[index] |
| | |
| | | var text_tmp = select_date.split('-'); |
| | | var select_date_text = |
| | | text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]); |
| | | ======= |
| | | component.set('v.select_report_data', component.get('v.reports')[index]); |
| | | component.set('v.mode', 'edit'); |
| | | component.set('v.dialog_type', '编辑'); |
| | | var select_date = component.get('v.reports')[index].Submit_date__c; |
| | | var select_agency = component.get('v.reports')[index].Person_In_Charge2__c; |
| | | var text_tmp = select_date.split('-'); |
| | | var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.selected_date', select_date_text); |
| | | var name = component.get('v.reports')[index].Person_In_Charge2__r.Name; |
| | | this.set_selected(component, 'select_agency_person', select_agency); |
| | | var new_label = this.get_agency_person_name(component, select_agency); |
| | | component.set('v.selected_agency_person', new_label); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.edit_copy_select_report_id', |
| | | component.get('v.reports')[index].Id |
| | |
| | | ); |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component, 'Agency_Contact__c'); |
| | | ======= |
| | | component.set('v.edit_copy_select_report_id', component.get('v.reports')[index].Id); |
| | | 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') |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.login', false); |
| | | // SWAG-CF58C3 fy end |
| | | }, |
| | |
| | | component.find('save_button').set('v.disabled', true); |
| | | var etEng = component.get('v.etEng'); |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | <<<<<<< HEAD |
| | | var Person_In_Charge2__c = ''; |
| | | var Submit_date__c = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | |
| | | Amount__c == Amount__c_o && |
| | | Close_Forecasted_Date__c == Close_Forecasted_Date__c_o |
| | | ) { |
| | | ======= |
| | | var Person_In_Charge2__c = ""; |
| | | var Submit_date__c = ""; |
| | | if (component.get('v.mode') == 'edit') { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = component.get('v.select_report_data').Submit_date__c; |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.get('v.select_report_data').Person_In_Charge2__c; |
| | | } else { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = this.get_date_string(component.find('select_date').get('v.value')); |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.find('select_agency_person').get('v.value'); |
| | | } |
| | | |
| | | // Agency_Report_Header__c |
| | | var Agency_Report_Header__c = component.get('v.agency_report_header_id'); |
| | | // 医院 |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | // 产品分类(第三分类) |
| | | var ProductClassification__c = component.find('select_ProductClassification').get('v.value'); |
| | | // 使用产品1(产品型号) UseProduct1__c |
| | | var UseProduct1__c = component.get('v.UseProduct1Id'); |
| | | // 使用产品2 UseProduct2__c |
| | | var UseProduct2__c = component.get('v.UseProduct2Id'); |
| | | // 使用产品3 UseProduct3__c |
| | | var UseProduct3__c = component.get('v.UseProduct3Id'); |
| | | // 科室 Department_Cateogy__c |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | // 经销商人员 DealerPersonnel__c |
| | | var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value'); |
| | | // 拜访人 doctor2__c |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | // 活动区分会 WorkRecord__c |
| | | var WorkRecord__c = component.find('select_purpose_type').get('v.value'); |
| | | // 效果/进度 EffectProgress__c |
| | | var EffectProgress__c = component.find('select_EffectProgress').get('v.value'); |
| | | // alert(EffectProgress__c); |
| | | // 科室同来耗材月使用量 ConsumptionOfConsumables__c |
| | | var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value'); |
| | | // 术士分类 WarlockClassification__c |
| | | var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value'); |
| | | // 已采用其他品牌 ProductCcategory__c |
| | | var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value'); |
| | | // 其他品牌产品类别 productCategories__c |
| | | var productCategories__c = component.find('select_productCategories').get('v.value'); |
| | | // 产品用量 warlocksNumber__c |
| | | var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value'); |
| | | // 支援需求 WorkMark__c |
| | | var WorkMark__c = component.find('select_WorkMark').get('v.checked'); |
| | | var StageName__c = component.find('select_stageName').get('v.value'); |
| | | var Amount__c = component.get('v.oppdata.Amount__c') != null ? component.get('v.oppdata.Amount__c').toString() : ''; |
| | | var OCMSale_Price__c = component.get('v.oppdata.OCMSale_Price__c') != null ? component.get('v.oppdata.OCMSale_Price__c').toString() : ''; |
| | | var Close_Forecasted_Date__c = component.get('v.oppdata.Close_Forecasted_Date__c'); |
| | | var StageName__c_o = component.get('v.StageName__c_o'); |
| | | var Amount__c_o = component.get('v.Amount__c_o'); |
| | | var OCMSale_Price__c_o = component.get('v.OCMSale_Price__c_o'); |
| | | var Close_Forecasted_Date__c_o = component.get('v.Close_Forecasted_Date__c_o'); |
| | | if (StageName__c_o == undefined) StageName__c_o = ''; |
| | | if (Amount__c_o == undefined) Amount__c_o = ''; |
| | | if (OCMSale_Price__c_o == undefined) OCMSale_Price__c_o = ''; |
| | | if (Close_Forecasted_Date__c_o == undefined) Close_Forecasted_Date__c_o = ''; |
| | | if (StageName__c == StageName__c_o && OCMSale_Price__c_o == OCMSale_Price__c && Amount__c == Amount__c_o && Close_Forecasted_Date__c == Close_Forecasted_Date__c_o) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | StageName__c = ''; |
| | | Amount__c = ''; |
| | | OCMSale_Price__c = ''; |
| | |
| | | //fy start |
| | | // if(WorkRecord__c != 'SIS'&&WorkRecord__c != '科室会'){ |
| | | if (WorkRecord__c == '临床信息(使用量)收集') { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | warlocksNumber__c == '' || |
| | | warlocksNumber__c == '' || |
| | |
| | | |
| | | // if (!UseProduct2__c) { error.push("使用产品2 不存在"); } |
| | | // if (!UseProduct3__c) { error.push("使用产品3 不存在"); } |
| | | ======= |
| | | if (warlocksNumber__c == '' || warlocksNumber__c == "" || warlocksNumber__c == undefined) { error.push("产品用量 不能为空"); } |
| | | } |
| | | //fy end |
| | | if (WorkRecord__c == '临床信息(使用量)收集' && UserProType == 'ENG') { |
| | | if (productCategories__c == '' || productCategories__c == "" || productCategories__c == undefined) { error.push("其他品牌产品类别 不存在"); } |
| | | } |
| | | if (WorkRecord__c == '临床信息(使用量)收集') { |
| | | if (ProductCcategory__c == '' || ProductCcategory__c == "" || ProductCcategory__c == undefined) { error.push("已采用其他品牌 不存在"); } |
| | | } |
| | | if (WorkRecord__c == '临床信息(使用量)收集') { |
| | | if (WarlockClassification__c == '' || WarlockClassification__c == "" || WarlockClassification__c == undefined) { error.push("产品1对应OLY产品线 不存在"); } |
| | | } |
| | | if (WorkRecord__c == '临床信息(使用量)收集') { |
| | | if (ConsumptionOfConsumables__c == '' || ConsumptionOfConsumables__c == "" || ConsumptionOfConsumables__c == undefined) { error.push("产品1同类耗材科室月使用量 不能为空"); } |
| | | } |
| | | if (WorkRecord__c != '临床信息(使用量)收集' && WorkRecord__c != '市场推广类活动') { |
| | | if (EffectProgress__c == '' || EffectProgress__c == "" || EffectProgress__c == undefined) { error.push("效果/进度 不存在"); } |
| | | } |
| | | // if(WorkRecord__c != '临床信息(使用量)收集'&&WorkRecord__c != 'QIS处理'){ |
| | | if (WorkRecord__c != '临床信息(使用量)收集') { |
| | | if (UseProduct1__c == '' || UseProduct1__c == "" || UseProduct1__c == undefined) { error.push("使用产品1(产品型号) 不存在"); } |
| | | } |
| | | if (ProductClassification__c == '' || ProductClassification__c == "" || ProductClassification__c == undefined) { error.push("产品分类(第三分类) 不存在"); } |
| | | if (WorkRecord__c == 'SIS' || WorkRecord__c == '科室会' || WorkRecord__c == '院内入院申请' || WorkRecord__c == '收费项目申请') { |
| | | if (doctor2__c == '' || doctor2__c == "" || doctor2__c == undefined) { error.push("拜访人 不存在"); } |
| | | } |
| | | if (WorkRecord__c == '' || WorkRecord__c == "" || WorkRecord__c == undefined) { error.push("活动区分 不存在"); } |
| | | if (DealerPersonnel__c == '' || DealerPersonnel__c == "" || DealerPersonnel__c == undefined) { error.push("经销商人员 不存在"); } |
| | | if (Department_Cateogy__c == '' || Department_Cateogy__c == "" || Department_Cateogy__c == undefined) { error.push("科室 不存在"); } |
| | | if (Agency_Hospital__c == '' || Agency_Hospital__c == "" || Agency_Hospital__c == undefined) { error.push("医院 不存在"); } |
| | | |
| | | |
| | | |
| | | |
| | | if (Report_Date__c == '' || Report_Date__c == "" || Report_Date__c == undefined) { error.push("活动日 不存在"); } |
| | | if (Submit_date__c == '' || Submit_date__c == "" || Submit_date__c == undefined) { error.push("周 不存在"); } |
| | | var rDate = new Date(Report_Date__c); |
| | | var sDate = new Date(Submit_date__c); |
| | | sDate.setDate(sDate.getDate() - 1); |
| | | if (rDate < sDate) { error.push('活动日必须是本周!'); } |
| | | sDate.setDate(sDate.getDate() + 7); |
| | | if (rDate >= sDate) { error.push('活动日必须是本周!'); } |
| | | if (Person_In_Charge2__c == '' || Person_In_Charge2__c == "" || Person_In_Charge2__c == undefined) { error.push("担当 不存在"); } |
| | | if (Agency_Report_Header__c == '' || Agency_Report_Header__c == "" || Agency_Report_Header__c == undefined) { this.error("Report Header Id 不存在"); } |
| | | |
| | | |
| | | // if (!UseProduct2__c) { error.push("使用产品2 不存在"); } |
| | | // if (!UseProduct3__c) { error.push("使用产品3 不存在"); } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | // if (!productCategories__c) { error.push("其他品牌产品类别 不存在"); } |
| | | |
| | |
| | | var Agency_Report__c = component.get('v.select_report_data').Id; |
| | | var action = component.get('c.editAgencyReport'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | Agency_Report_Id: Agency_Report__c, |
| | | Department_Cateogy: Department_Cateogy__c, |
| | | ConsumptionOfConsumables: ConsumptionOfConsumables__c, |
| | |
| | | oppOCMPrice: OCMSale_Price__c, |
| | | Close_Forecasted_Date: Close_Forecasted_Date__c, |
| | | Report_Date: Report_Date__c |
| | | ======= |
| | | "Agency_Report_Id": Agency_Report__c, |
| | | "Department_Cateogy": Department_Cateogy__c, |
| | | "ConsumptionOfConsumables": ConsumptionOfConsumables__c, |
| | | "WorkRecord": WorkRecord__c, |
| | | "EffectProgress": EffectProgress__c, |
| | | "WarlockClassification": WarlockClassification__c, |
| | | "ProductCcategory": ProductCcategory__c, |
| | | "productCategories": productCategories__c, |
| | | "warlocksNumber": warlocksNumber__c, |
| | | "WorkMark": WorkMark__c, |
| | | "ProductClassification": ProductClassification__c, |
| | | "DealerPersonnel": DealerPersonnel__c, |
| | | "Agency_Report_Header": Agency_Report_Header__c, |
| | | "Agency_Hospital": Agency_Hospital__c, |
| | | "UseProduct1": UseProduct1__c, |
| | | "UseProduct2": UseProduct2__c, |
| | | "UseProduct3": UseProduct3__c, |
| | | "Person_In_Charge2": Person_In_Charge2__c, |
| | | "doctor": doctor2__c, |
| | | "Submit_date": Submit_date__c, |
| | | "StageName": StageName__c, |
| | | "oppAmount": Amount__c, |
| | | "oppOCMPrice": OCMSale_Price__c, |
| | | "Close_Forecasted_Date": Close_Forecasted_Date__c, |
| | | "Report_Date": Report_Date__c |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | <<<<<<< HEAD |
| | | debugger; |
| | | ======= |
| | | debugger |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.successMessage', '编辑保存成功'); |
| | | this.showSuccessToast(component); |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | <<<<<<< HEAD |
| | | var select_agency_list = |
| | | component.get('v.allselectlist').AgencyPerson__c; |
| | | for (var i = 0; i < select_agency_list.length; i++) { |
| | |
| | | component.get('v.select_report_data') |
| | | .Person_In_Charge2__c |
| | | ) { |
| | | ======= |
| | | var select_agency_list = component.get('v.allselectlist').AgencyPerson__c; |
| | | for (var i = 0; i < select_agency_list.length; i++) { |
| | | if (select_agency_list[i].value == component.get('v.select_report_data').Person_In_Charge2__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | select_agency_list[i].selected = true; |
| | | } else { |
| | | select_agency_list[i].selected = false; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_agency_person') |
| | | .set('v.options', select_agency_list); |
| | |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | ======= |
| | | component.find('select_agency_person').set('v.options', select_agency_list); |
| | | 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.loginEdit', false); |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'save_report failed.'); |
| | | this.error('保存日报失败'); |
| | | //this.showErrorToast(component); |
| | |
| | | /* Save (New & Copy) */ |
| | | var action = component.get('c.saveAgencyReport'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | Department_Cateogy: Department_Cateogy__c, |
| | | ConsumptionOfConsumables: ConsumptionOfConsumables__c, |
| | | WorkMark: WorkMark__c, |
| | |
| | | oppOCMPrice: OCMSale_Price__c, |
| | | Close_Forecasted_Date: Close_Forecasted_Date__c, |
| | | Report_Date: Report_Date__c |
| | | ======= |
| | | "Department_Cateogy": Department_Cateogy__c, |
| | | "ConsumptionOfConsumables": ConsumptionOfConsumables__c, |
| | | "WorkMark": WorkMark__c, |
| | | "warlocksNumber": warlocksNumber__c, |
| | | "DealerPersonnel": DealerPersonnel__c, |
| | | "ProductCcategory": ProductCcategory__c, |
| | | "productCategories": productCategories__c, |
| | | "WarlockClassification": WarlockClassification__c, |
| | | "ProductClassification": ProductClassification__c, |
| | | "WorkRecord": WorkRecord__c, |
| | | "EffectProgress": EffectProgress__c, |
| | | "Agency_Report_Header": Agency_Report_Header__c, |
| | | "Agency_Hospital": Agency_Hospital__c, |
| | | "Person_In_Charge2": Person_In_Charge2__c, |
| | | "doctor": doctor2__c, |
| | | "Submit_date": Submit_date__c, |
| | | "UseProduct1": UseProduct1__c, |
| | | "UseProduct2": UseProduct2__c, |
| | | "UseProduct3": UseProduct3__c, |
| | | "StageName": StageName__c, |
| | | "oppAmount": Amount__c, |
| | | "oppOCMPrice": OCMSale_Price__c, |
| | | "Close_Forecasted_Date": Close_Forecasted_Date__c, |
| | | "Report_Date": Report_Date__c |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | |
| | | this.showSuccessToast(component); |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | <<<<<<< HEAD |
| | | this.get_reports( |
| | | component, |
| | | event, |
| | |
| | | var action2 = component.get('c.getReportsById'); |
| | | action2.setParams({ |
| | | report_id: report_id |
| | | ======= |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | // モーダルウィンドウ内の一覧用 |
| | | var action2 = component.get('c.getReportsById'); |
| | | action2.setParams({ |
| | | "report_id": report_id, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action2.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | |
| | | var res = response.getReturnValue(); |
| | | var reports_now = component.get('v.reports_now'); |
| | | var reports_now_count = 0; |
| | | <<<<<<< HEAD |
| | | if (reports_now.length > 0 && reports_now != '') { |
| | | ======= |
| | | if (reports_now.length > 0 && reports_now != "") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | reports_now_count = reports_now.length; |
| | | } |
| | | // Save&New時のウィンドウ内データ一覧 |
| | |
| | | return 0; |
| | | }); |
| | | component.set('v.reports_now', reports_now); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.reports_now_count', |
| | | reports_now.length |
| | |
| | | component |
| | | .find('save_button') |
| | | .set('v.disabled', false); |
| | | ======= |
| | | component.set('v.reports_now_count', reports_now.length); |
| | | var data_list = component.find('modal_data_list_tr'); |
| | | } |
| | | } |
| | | else { |
| | | // component.set('v.errorMessage', 'get_reports_now failed.'); |
| | | this.error('get_reports_now failed.'); |
| | | //this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.loginEdit', false); |
| | | } |
| | | }); |
| | |
| | | component.find('select_WorkMark').set('v.value', false); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit', false); |
| | | <<<<<<< HEAD |
| | | debugger; |
| | | this.doinitSave(component, event, helper); |
| | | } else { |
| | | ======= |
| | | debugger |
| | | this.doinitSave(component, event, helper); |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var error = response.getError(); |
| | | //component.set('v.errorMessage', '保存日报失败'); |
| | | this.error('保存日报失败'); |
| | |
| | | component.find('select_WorkMark').set('v.checked', false); |
| | | component.find('new_con').set('v.disabled', true); |
| | | component.find('select_doctor').set('v.options', clear); |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_DealerPersonnel') |
| | | .set( |
| | |
| | | ) |
| | | ); |
| | | // component.find('select_ProductCcategory').set('v.options', this.conv_selected(component.get('v.allselectlist.ProductCcategory__c'))); |
| | | ======= |
| | | component.find('select_DealerPersonnel').set('v.options', this.conv_selected(component.get('v.allselectlist.DealerPersonnel__c'))); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.WorkRecord__c'))); |
| | | // component.find('select_ProductCcategory').set('v.options', this.conv_selected(component.get('v.allselectlist.ProductCcategory__c'))); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('select_EffectProgress').set('v.value', ''); |
| | | component.find('select_OtherBrandConsumables').set('v.value', ''); |
| | | component.find('select_ProductCcategory').set('v.value', ''); |
| | |
| | | component.set('v.Amount__c_o', ''); |
| | | component.set('v.OCMSale_Price__c_o', ''); |
| | | component.set('v.StageName__c_o', ''); |
| | | <<<<<<< HEAD |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | |
| | | component.find('input-opportunity-amount2'), |
| | | 'disp_none' |
| | | ); |
| | | ======= |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | this.selectPurposeType(component); |
| | | this.selectProductClassification(component); |
| | |
| | | var ret_obj = []; |
| | | var now = new Date(); |
| | | for (var i = 0; i < count; i++) { |
| | | <<<<<<< HEAD |
| | | var start_day = new Date( |
| | | now.getFullYear(), |
| | | now.getMonth(), |
| | |
| | | (end_day_show.getMonth() + 1) + |
| | | '/' + |
| | | end_day_show.getDate() |
| | | ======= |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1 - (i * 7))); |
| | | var end_day = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (7 - now.getDay()) - (i * 7)); |
| | | var start_day_show = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() - (i * 7))); |
| | | var end_day_show = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()) - (i * 7)); |
| | | var date_text = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate() + '~' + end_day.getFullYear() + '/' + (end_day.getMonth() + 1) + '/' + end_day.getDate(); |
| | | if (i == 0) { |
| | | ret_obj.push({ |
| | | selected: true, |
| | | value: start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label: start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | } else { |
| | | ret_obj.push({ |
| | | selected: false, |
| | | <<<<<<< HEAD |
| | | value: |
| | | start_day.getFullYear() + |
| | | '/' + |
| | |
| | | (end_day_show.getMonth() + 1) + |
| | | '/' + |
| | | end_day_show.getDate() |
| | | ======= |
| | | value: start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label: start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | } |
| | | } |
| | | component.find('select_date').set('v.options', ret_obj); |
| | | component.set('v.report_date_list', ret_obj); |
| | | }, |
| | | <<<<<<< HEAD |
| | | create_report_header: function ( |
| | | component, |
| | | event, |
| | |
| | | s_agency, |
| | | s_date |
| | | ) { |
| | | ======= |
| | | create_report_header: function (component, event, helper, name, s_agency, s_date) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | |
| | | var key2 = s_date.replace(/-/g, ''); |
| | | var action = component.get('c.createReportHeader'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | name: name, |
| | | s_date: s_date, |
| | | s_agency: s_agency, |
| | | head_key: head_key |
| | | ======= |
| | | "name": name, |
| | | "s_date": s_date, |
| | | "s_agency": s_agency, |
| | | "head_key": head_key, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | component.set('v.login', true); |
| | | action.setCallback(this, function (response) { |
| | |
| | | component.set('v.agency_report_header_id', res); |
| | | component.set('v.login', false); |
| | | this.toggle_report(component, event, helper); |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error('createReportHeader callback failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | <<<<<<< HEAD |
| | | create_report_header_edit: function ( |
| | | component, |
| | | event, |
| | |
| | | s_agency, |
| | | s_date |
| | | ) { |
| | | ======= |
| | | create_report_header_edit: function (component, event, helper, name, s_agency, s_date) { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | |
| | | } |
| | | var key2 = s_date.replace(/-/g, ''); |
| | | var action = component.get('c.createReportHeader'); |
| | | <<<<<<< HEAD |
| | | |
| | | action.setParams({ |
| | | name: name, |
| | |
| | | head_key: head_key |
| | | }); |
| | | component.set('v.login', true); |
| | | ======= |
| | | |
| | | action.setParams({ |
| | | "name": name, |
| | | "s_date": s_date, |
| | | "s_agency": s_agency, |
| | | "head_key": head_key, |
| | | }); |
| | | component.set('v.login',true); |
| | | >>>>>>> LEXCommunityLiJun |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | |
| | | component.set('v.agency_report_header_id', res); |
| | | component.set('v.login', false); |
| | | this.toggle_report_edit(component, event, helper); |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error('createReportHeader callback failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | create_header_input_key: function (agency_id, s_date) { |
| | | <<<<<<< HEAD |
| | | if (typeof s_date != 'string') { |
| | | ======= |
| | | if (typeof (s_date) != 'string') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | //component.set('v.errorMessage', 'get_date_string in create_header_input_key.'); |
| | |
| | | return false; |
| | | } |
| | | s_date = s_date.replace(/-/g, ''); |
| | | <<<<<<< HEAD |
| | | var headkey = agency_id + ':' + s_date; |
| | | ======= |
| | | var headkey = agency_id + ":" + s_date; |
| | | >>>>>>> LEXCommunityLiJun |
| | | return headkey; |
| | | }, |
| | | |
| | |
| | | }, |
| | | // create yyyy-mm-dd string |
| | | get_date_string: function (val) { |
| | | <<<<<<< HEAD |
| | | if (typeof val == 'string') { |
| | | ======= |
| | | if (typeof (val) == 'string') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) { |
| | | val = val.replace(/[\/]/g, '-'); |
| | | var tmp = val.split('-'); |
| | |
| | | }, |
| | | // Controller 根据页面医院查询符合的医院 |
| | | searchHos: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var hospital_name = event.getParam('value'); |
| | | var action = component.get('c.getHospitalList'); |
| | | action.setParams({ |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | var hospital_name = event.getParam("value"); |
| | | var action = component.get("c.getHospitalList"); |
| | | action.setParams({ |
| | | "hospital_name": hospital_name |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var hospital_list = component.find('hospital_list'); |
| | | var hosList = response.getReturnValue(); |
| | | if (hosList.length > 0) { |
| | |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | | <<<<<<< HEAD |
| | | component.set('v.hospitalList', response.getReturnValue()); |
| | | ======= |
| | | component.set("v.hospitalList", response.getReturnValue()); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | |
| | | hideSearchs: function (component, event, helper) { |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | <<<<<<< HEAD |
| | | component.set('v.hospital', ''); |
| | | component.set('v.hospitals', ''); |
| | | component.set('v.hospitalLinkId', ''); |
| | |
| | | component.set('v.hospitalId', ''); |
| | | }, |
| | | selectHos: function (component, event, helper) { |
| | | ======= |
| | | component.set("v.hospital", ''); |
| | | component.set("v.hospitals", ''); |
| | | component.set('v.hospitalLinkId', ''); |
| | | component.set('v.data.Agency_Hospital__c', ''); |
| | | component.set("v.hospitalId", ''); |
| | | }, |
| | | selectHos: function (component, event, helper) { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | | var accid = event.currentTarget.dataset.accid; |
| | | var hospital_data = component.get('v.hospitalList'); |
| | | <<<<<<< HEAD |
| | | var select_purpose_type = component |
| | | .find('select_purpose_type') |
| | | .get('v.value'); |
| | | ======= |
| | | var select_purpose_type = component.find('select_purpose_type').get('v.value'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (var i = 0; i < hospital_data.length; i++) { |
| | | if (hospital_data[i].Hospital__c == accid) { |
| | | component.set('v.hospitalLinkId', hospital_data[i].Id); |
| | | component.set('v.data.Agency_Hospital__c', hospital_data[i].Id); |
| | | <<<<<<< HEAD |
| | | if ( |
| | | select_purpose_type != '科室会' && |
| | | hospital_data[i].Hospital__c |
| | | ) { |
| | | ======= |
| | | if (select_purpose_type != '科室会' && hospital_data[i].Hospital__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('new_con').set('v.disabled', false); |
| | | } else { |
| | | component.find('new_con').set('v.disabled', true); |
| | | } |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | component.set('v.hospitals', accname); |
| | | component.set('v.hospital', accname); |
| | | component.set('v.hospitalId', accid); |
| | | |
| | | ======= |
| | | component.set("v.hospitals", accname); |
| | | component.set("v.hospital", accname); |
| | | component.set("v.hospitalId", accid); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.setdoctorlisthos', true); |
| | | this.set_doctor_list_edit(component, event, helper); |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | //模糊查询使用产品1(产品型号) |
| | | searchUseProduct1: function (component, event, helper) { |
| | | var UseProduct1Name = event.getParam('value'); |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | |
| | | //模糊查询使用产品1(产品型号) |
| | | searchUseProduct1: function (component, event, helper) { |
| | | var UseProduct1Name = event.getParam("value"); |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | var action = component.get("c.getUseProduct1"); |
| | | action.setParams({ |
| | | "UseProduct1Name": UseProduct1Name, |
| | | "select_ProductClassification": select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | var UseProduct1ListValue = response.getReturnValue(); |
| | | if (UseProduct1ListValue.length > 0) { |
| | |
| | | } else { |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | } |
| | | <<<<<<< HEAD |
| | | component.set('v.UseProduct1List', UseProduct1ListValue); |
| | | ======= |
| | | component.set("v.UseProduct1List", UseProduct1ListValue); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | } |
| | |
| | | hideSearchUseProduct1s: function (component, event, helper) { |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | <<<<<<< HEAD |
| | | component.set('v.UseProduct1', ''); |
| | | component.set('v.UseProduct1s', ''); |
| | | ======= |
| | | component.set("v.UseProduct1", ''); |
| | | component.set("v.UseProduct1s", ''); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.UseProduct1Id', ''); |
| | | component.set('v.data.UseProduct1__c', ''); |
| | | }, |
| | | seletUseProduct1Change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | |
| | | for (var i = 0; i < UseProduct1ListDate.length; i++) { |
| | | if (UseProduct1ListDate[i].Id == accid) { |
| | | component.set('v.UseProduct1Id', UseProduct1ListDate[i].Id); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.data.UseProduct1__c', |
| | | UseProduct1ListDate[i].Id |
| | |
| | | if (UseProduct2_TEXT != accname && UseProduct3_TEXT != accname) { |
| | | component.set('v.UseProduct1s', accname); |
| | | component.set('v.UseProduct1', accname); |
| | | ======= |
| | | component.set('v.data.UseProduct1__c', UseProduct1ListDate[i].Id); |
| | | } |
| | | } |
| | | var UseProduct2_TEXT = component.find('UseProduct2_TEXT').get('v.value'); |
| | | var UseProduct3_TEXT = component.find('UseProduct3_TEXT').get('v.value'); |
| | | if (UseProduct2_TEXT != accname && UseProduct3_TEXT != accname) { |
| | | component.set("v.UseProduct1s", accname); |
| | | component.set("v.UseProduct1", accname); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | |
| | | }, |
| | | //模糊查询使用产品2 |
| | | searchUseProduct2: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var UseProduct2Name = event.getParam('value'); |
| | | var select_ProductClassification = component |
| | | .find('select_ProductClassification') |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | var UseProduct2Name = event.getParam("value"); |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | var action = component.get("c.getUseProduct1"); |
| | | action.setParams({ |
| | | "UseProduct1Name": UseProduct2Name, |
| | | "select_ProductClassification": select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var UseProduct2_List = component.find('UseProduct2_List'); |
| | | var UseProduct2List = response.getReturnValue(); |
| | | if (UseProduct2List.length > 0) { |
| | |
| | | } else { |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | } |
| | | <<<<<<< HEAD |
| | | component.set('v.UseProduct2List', response.getReturnValue()); |
| | | ======= |
| | | component.set("v.UseProduct2List", response.getReturnValue()); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | } |
| | |
| | | hideSearchUseProduct2s: function (component, event, helper) { |
| | | var UseProduct2_List = component.find('UseProduct2_List'); |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | <<<<<<< HEAD |
| | | component.set('v.UseProduct2', ''); |
| | | component.set('v.UseProduct2s', ''); |
| | | ======= |
| | | component.set("v.UseProduct2", ''); |
| | | component.set("v.UseProduct2s", ''); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.UseProduct2Id', ''); |
| | | component.set('v.data.UseProduct2__c', ''); |
| | | }, |
| | |
| | | for (var i = 0; i < UseProduct2ListDate.length; i++) { |
| | | if (UseProduct2ListDate[i].Id == accid) { |
| | | component.set('v.UseProduct2Id', UseProduct2ListDate[i].Id); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.data.UseProduct2__c', |
| | | UseProduct2ListDate[i].Id |
| | |
| | | if (UseProduct1_TEXT != accname && UseProduct3_TEXT != accname) { |
| | | component.set('v.UseProduct2s', accname); |
| | | component.set('v.UseProduct2', accname); |
| | | ======= |
| | | component.set('v.data.UseProduct2__c', UseProduct2ListDate[i].Id); |
| | | } |
| | | } |
| | | var UseProduct1_TEXT = component.find('UseProduct1_TEXT').get('v.value'); |
| | | var UseProduct3_TEXT = component.find('UseProduct3_TEXT').get('v.value'); |
| | | if (UseProduct1_TEXT != accname && UseProduct3_TEXT != accname) { |
| | | component.set("v.UseProduct2s", accname); |
| | | component.set("v.UseProduct2", accname); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | //this.showErrorToast(component); |
| | | } |
| | | <<<<<<< HEAD |
| | | }, |
| | | //模糊查询使用产品3 |
| | | searchUseProduct3: function (component, event, helper) { |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | |
| | | }, |
| | | //模糊查询使用产品3 |
| | | searchUseProduct3: function (component, event, helper) { |
| | | var UseProduct3Name = event.getParam("value"); |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | var action = component.get("c.getUseProduct1"); |
| | | action.setParams({ |
| | | "UseProduct1Name": UseProduct3Name, |
| | | "select_ProductClassification": select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var UseProduct3_List = component.find('UseProduct3_List'); |
| | | var UseProduct3List = response.getReturnValue(); |
| | | if (UseProduct3List.length > 0) { |
| | |
| | | } else { |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | } |
| | | <<<<<<< HEAD |
| | | component.set('v.UseProduct3List', response.getReturnValue()); |
| | | ======= |
| | | component.set("v.UseProduct3List", response.getReturnValue()); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | } |
| | |
| | | hideSearchUseProduct3s: function (component, event, helper) { |
| | | var UseProduct3_List = component.find('UseProduct3_List'); |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | <<<<<<< HEAD |
| | | component.set('v.UseProduct3', ''); |
| | | component.set('v.UseProduct3s', ''); |
| | | ======= |
| | | component.set("v.UseProduct3", ''); |
| | | component.set("v.UseProduct3s", ''); |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.UseProduct3Id', ''); |
| | | component.set('v.data.UseProduct3__c', ''); |
| | | }, |
| | |
| | | for (var i = 0; i < UseProduct3ListDate.length; i++) { |
| | | if (UseProduct3ListDate[i].Id == accid) { |
| | | component.set('v.UseProduct3Id', UseProduct3ListDate[i].Id); |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.data.UseProduct3__c', |
| | | UseProduct3ListDate[i].Id |
| | |
| | | if (UseProduct1_TEXT != accname && UseProduct2_TEXT != accname) { |
| | | component.set('v.UseProduct3s', accname); |
| | | component.set('v.UseProduct3', accname); |
| | | ======= |
| | | component.set('v.data.UseProduct3__c', UseProduct3ListDate[i].Id); |
| | | } |
| | | } |
| | | var UseProduct1_TEXT = component.find('UseProduct1_TEXT').get('v.value'); |
| | | var UseProduct2_TEXT = component.find('UseProduct2_TEXT').get('v.value'); |
| | | if (UseProduct1_TEXT != accname && UseProduct2_TEXT != accname) { |
| | | component.set("v.UseProduct3s", accname); |
| | | component.set("v.UseProduct3", accname); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | //this.showErrorToast(component); |
| | | } |
| | | <<<<<<< HEAD |
| | | }, |
| | | //hospitalLinkId 经销商医院的ID 拜访人复制的地方 |
| | | doctor_change: function (component, event, helper) { |
| | | ======= |
| | | |
| | | }, |
| | | //hospitalLinkId 经销商医院的ID 拜访人复制的地方 |
| | | doctor_change: function (component, event, helper) { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var doctorurpose = component.find('select_purpose_type').get('v.value'); |
| | | var doctor_value = component.find('select_doctor').get('v.value'); |
| | | var doctor_list = component.get('v.doctor_list'); |
| | |
| | | if (doctorurpose == '科室会') { |
| | | // component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c); |
| | | } else { |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.doctor_title', |
| | | doctor_list[i].Doctor_Division1__c |
| | | ); |
| | | ======= |
| | | component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | flg = true; |
| | | break; |
| | |
| | | set_aws_url: function (component, sobject) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | sobj: sobject |
| | | ======= |
| | | "sobj": sobject, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | |
| | | component.set('v.AWSinsert', awsmap.newUrl); |
| | | component.set('v.AWSsearch', awsmap.searchUrl); |
| | | component.set('v.AWStransactionURL', awsmap.transactionURL); |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | // component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error('AWS url/token error.'); |
| | | //this.showErrorToast(component); |
| | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | insert_agencycontact: function ( |
| | | component, |
| | | token, |
| | |
| | | helper, |
| | | hospitalName |
| | | ) { |
| | | ======= |
| | | insert_agencycontact: function (component, token, newUrl, payload, agencyHospitalid, helper, hospitalName) { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | console.log('newUrl = ' + newUrl); |
| | | console.log('payload = ' + payload); |
| | | console.log('token = ' + token); |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | <<<<<<< HEAD |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | |
| | | component.set('v.login', false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | ======= |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | console.log('result = ' + JSON.stringify(result)); |
| | | if (result.status == '0') { |
| | | $A.getCallback(function () { |
| | | helper.to_agencycontact(component, result, agencyHospitalid); |
| | | })(); |
| | | } else { |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.login', false); |
| | | if (result.status == '129') { |
| | | component.find('OppMessage').setError('该客户人员名字已存在,在' + hospitalName + '医院,请修改'); |
| | | } else { |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.log('AWS insert error:' + error) |
| | | component.set('v.login', false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | to_agencycontact: function (component, result, agencyHospitalid) { |
| | | var action = component.get('c.saveAgencyContact'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | name: result.object[0].name, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, //zhj 新方案改造 2023-12-21 |
| | | type: result.object[0].type, |
| | |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, //zhj 新方案改造 2023-12-21 |
| | | agencyHospitalid: agencyHospitalid, |
| | | awsid: result.object[0].dataId |
| | | ======= |
| | | "name": result.object[0].name, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, //zhj 新方案改造 2023-12-21 |
| | | "type": result.object[0].type, |
| | | //"typeEncrypt" : result.object[0].typeEncrypt, //zhj 新方案改造 2023-12-21 |
| | | "doctorDivision1": result.object[0].doctorDivision1, |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, //zhj 新方案改造 2023-12-21 |
| | | "agencyHospitalid": agencyHospitalid, |
| | | "awsid": result.object[0].dataId, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | |
| | | var acMap = this.conv_selected(response.getReturnValue()); |
| | | console.log(acMap); |
| | | if (acMap.AgencyContactId != '') { |
| | | <<<<<<< HEAD |
| | | //确认事务 |
| | | ======= |
| | | //确认事务 |
| | | >>>>>>> LEXCommunityLiJun |
| | | var token = component.get('v.AWStoken'); |
| | | var confirmUrl = component.get('v.AWStransactionURL'); |
| | | |
| | |
| | | data['sfRecordId'] = ''; |
| | | data['txId'] = result.txId; |
| | | |
| | | <<<<<<< HEAD |
| | | this.to_confirm( |
| | | component, |
| | | token, |
| | | confirmUrl, |
| | | JSON.stringify(data) |
| | | ); |
| | | ======= |
| | | this.to_confirm(component, token, confirmUrl, JSON.stringify(data)); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else if (acMap.errormsg != '') { |
| | | // component.set('v.errorMessage', acMap.errormsg); |
| | | this.error(acMap.errormsg); |
| | |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'agency contact insert error.'); |
| | | this.error('agency contact insert error.'); |
| | | //this.showErrorToast(component); |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | <<<<<<< HEAD |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | ======= |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | if (result.status == '0' && result.hasOwnProperty('success') && result.success) { |
| | | // component.set('v.truthy', false); |
| | | // var modal_newAC = component.find('modal_newAC') |
| | | // $A.util.addClass(modal_newAC, 'disp_none'); |
| | | // this.success('.客户人员已创建。'); |
| | | // this.set_doctor_list(component); |
| | | |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.set('v.successMessage', '.拜访人已创建。'); |
| | | this.showSuccessToast(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); |
| | | component.set('v.login', false); |
| | | } |
| | | }).catch(error => { |
| | | // component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.error('AWS confirm error.'); |
| | | //this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | //SWAG-CF58C3 fy end 调用pi |
| | | |
| | | set_doctor_list: function (component) { |
| | | <<<<<<< HEAD |
| | | console.log('set_doctor_list'); |
| | | ======= |
| | | console.log('set_doctor_list') |
| | | >>>>>>> LEXCommunityLiJun |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | console.log('hospital_id = ' + hospital_id); |
| | |
| | | component.set('v.loginEdit', true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | hospital_id: hospital_id |
| | | ======= |
| | | "hospital_id": hospital_id, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | <<<<<<< HEAD |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = |
| | | component.get('v.setdoctorlisthos'); |
| | | ======= |
| | | ; |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = component.get('v.setdoctorlisthos'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (setdoctorlisthos) { |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.setdoctorlisthos', false); |
| | | } |
| | | <<<<<<< HEAD |
| | | //fy |
| | | var default_doctor = component.get( |
| | | 'v.default_select_doctor_id' |
| | | ); |
| | | ======= |
| | | //fy |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | let awsids = []; |
| | |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_doctor') |
| | | .set('v.options', res); |
| | |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | ======= |
| | | 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); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } else { |
| | | let awsids = []; |
| | |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_doctor') |
| | | .set('v.options', res); |
| | |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | ======= |
| | | 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 { |
| | | >>>>>>> LEXCommunityLiJun |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error('set_doctor_list failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | if (doctor_value == '科室会') { |
| | | this.set_doctor_list2(component); |
| | |
| | | } |
| | | } |
| | | component.set('v.loginEdit', false); |
| | | <<<<<<< HEAD |
| | | }, //fy 20220414 |
| | | set_doctor_list_edit: function (component) { |
| | | console.log('set_doctor_list'); |
| | | ======= |
| | | },//fy 20220414 |
| | | set_doctor_list_edit: function (component) { |
| | | console.log('set_doctor_list') |
| | | >>>>>>> LEXCommunityLiJun |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | console.log('hospital_id = ' + hospital_id); |
| | |
| | | component.set('v.loginEdit', true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | hospital_id: hospital_id |
| | | ======= |
| | | "hospital_id": hospital_id, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | <<<<<<< HEAD |
| | | var setdoctorlisthos = |
| | | component.get('v.setdoctorlisthos'); |
| | | ======= |
| | | var setdoctorlisthos = component.get('v.setdoctorlisthos'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (setdoctorlisthos) { |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.setdoctorlisthos', false); |
| | | } |
| | | <<<<<<< HEAD |
| | | //fy |
| | | var default_doctor = component.get( |
| | | 'v.default_select_doctor_id' |
| | | ); |
| | | ======= |
| | | //fy |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | let awsids = []; |
| | |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_doctor') |
| | | .set('v.options', res); |
| | |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | ======= |
| | | 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); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } else { |
| | | let awsids = []; |
| | |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_doctor') |
| | | .set('v.options', res); |
| | |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.loginEdit', false); |
| | | } else { |
| | | ======= |
| | | 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 { |
| | | >>>>>>> LEXCommunityLiJun |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error('set_doctor_list failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | if (doctor_value == '科室会') { |
| | | this.set_doctor_list2(component); |
| | |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].selected == 'true') { |
| | | res[i].selected = true; |
| | |
| | | res[i].selected = false; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('select_doctor').set('v.options', res); |
| | | var doctor3value = component.get('v.default_select_doctor_id2'); |
| | | this.set_selected(component, 'select_doctor', doctor3value); |
| | |
| | | $A.enqueueAction(action1); |
| | | }, |
| | | productcategoryChange1: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var product_category_id = component |
| | | .find('select_Product1') |
| | | .get('v.value'); |
| | | ======= |
| | | var product_category_id = component.find('select_Product1').get('v.value'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | var pcId1 = component.find('select_Product2').get('v.value'); |
| | | var pcId2 = component.find('select_Product3').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | <<<<<<< HEAD |
| | | var p0bool = |
| | | product_category_id != '' && |
| | | product_category_id != null && |
| | |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | ======= |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | //this.showErrorToast(component); |
| | |
| | | } |
| | | }, |
| | | productcategoryChange2: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var product_category_id = component |
| | | .find('UseProduct2_TEXT') |
| | | .get('v.value'); |
| | | ======= |
| | | var product_category_id = component.find('UseProduct2_TEXT').get('v.value'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | var pcId1 = component.find('UseProduct1_TEXT').get('v.value'); |
| | | var pcId2 = component.find('UseProduct3_TEXT').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null; |
| | | var p2bool = pcId2 != '' && pcId2 != null; |
| | | var p0bool = product_category_id != '' && product_category_id != null; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | ======= |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | //this.showErrorToast(component); |
| | |
| | | } |
| | | }, |
| | | productcategoryChange3: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var product_category_id = component |
| | | .find('select_Product3') |
| | | .get('v.value'); |
| | | ======= |
| | | var product_category_id = component.find('select_Product3').get('v.value'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | var pcId1 = component.find('select_Product1').get('v.value'); |
| | | var pcId2 = component.find('select_Product2').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | <<<<<<< HEAD |
| | | var p0bool = |
| | | product_category_id != '' && |
| | | product_category_id != null && |
| | |
| | | (p1bool && p0bool && product_category_id == pcId1) || |
| | | (p2bool && p0bool && product_category_id == pcId2) |
| | | ) { |
| | | ======= |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | //this.showErrorToast(component); |
| | |
| | | return obj; |
| | | }, |
| | | set_selected: function (component, aura_id_name, value) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | ; |
| | | >>>>>>> LEXCommunityLiJun |
| | | var select_tmp = component.find(aura_id_name).get('v.options'); |
| | | if (select_tmp) { |
| | | for (var i = 0; i < select_tmp.length; i++) { |
| | |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast: function (component) { |
| | | <<<<<<< HEAD |
| | | $A.util.removeClass(component.find('successDiv'), 'slds-hide'); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv'), 'slds-hide'); |
| | | }), |
| | | ======= |
| | | |
| | | $A.util.removeClass(component.find('successDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv'), 'slds-hide'); |
| | | }), |
| | | >>>>>>> LEXCommunityLiJun |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast01: function (component) { |
| | | <<<<<<< HEAD |
| | | $A.util.removeClass(component.find('successDiv01'), 'slds-hide'); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv01'), 'slds-hide'); |
| | | }), |
| | | ======= |
| | | |
| | | $A.util.removeClass(component.find('successDiv01'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv01'), 'slds-hide'); |
| | | }), |
| | | >>>>>>> LEXCommunityLiJun |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast: function (component) { |
| | | <<<<<<< HEAD |
| | | $A.util.removeClass(component.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | ======= |
| | | |
| | | $A.util.removeClass(component.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | >>>>>>> LEXCommunityLiJun |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast01: function (component) { |
| | | <<<<<<< HEAD |
| | | $A.util.removeClass(component.find('errorDiv01'), 'slds-hide'); |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv01'), 'slds-hide'); |
| | | }), |
| | | ======= |
| | | |
| | | $A.util.removeClass(component.find('errorDiv01'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv01'), 'slds-hide'); |
| | | }), |
| | | >>>>>>> LEXCommunityLiJun |
| | | 6000 |
| | | ); |
| | | }, |
| | | error: function (message) { |
| | | <<<<<<< HEAD |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | | title: '错误!', |
| | | message: message, |
| | | type: 'error', |
| | | duration: 'sticky' |
| | | ======= |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type": "error", |
| | | "duration": "sticky" |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | |
| | | component.set('v.truthy', true); |
| | | }, |
| | | hideCmp: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var div1 = component.find('report'); |
| | | var div2 = component.find('report_list'); |
| | | ======= |
| | | var div1 = component.find('report') |
| | | var div2 = component.find('report_list') |
| | | >>>>>>> LEXCommunityLiJun |
| | | $A.util.addClass(div1, 'disp_none'); |
| | | $A.util.addClass(div2, 'disp_none'); |
| | | }, |
| | |
| | | var displayValue = event.getParams().response.fields.Name.value; |
| | | event.setParams({}); |
| | | component.set('v.truthy', false); |
| | | <<<<<<< HEAD |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | ======= |
| | | var modal_newAC = component.find('modal_newAC') |
| | | >>>>>>> LEXCommunityLiJun |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.set('v.successMessage', '.拜访人已创建。'); |
| | | this.showSuccessToast(component); |
| | |
| | | }, |
| | | createCancel: function (component, event, helper) { |
| | | component.set('v.truthy', false); |
| | | <<<<<<< HEAD |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | ======= |
| | | var modal_newAC = component.find('modal_newAC') |
| | | >>>>>>> LEXCommunityLiJun |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.find('OppMessage').setError(''); |
| | | }, |
| | | //科室赋值 |
| | | setOpportunity_cfilter: function (component) { |
| | | var hosId = component.get('v.hospitalId'); |
| | | <<<<<<< HEAD |
| | | var Department_Cateogy__c = component |
| | | .find('select_department') |
| | | .get('v.value'); |
| | |
| | | if (hosId != '' && hosId != null) { |
| | | opportunity_cfilter = |
| | | ' Agency_Hospital__r.Hospital__c=' + "'" + hosId + "'"; |
| | | ======= |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var opportunity_cfilter = ''; |
| | | if (hosId != '' && hosId != null) { |
| | | opportunity_cfilter = ' Agency_Hospital__r.Hospital__c=' + '\'' + hosId + '\''; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | if (Department_Cateogy__c != '' && Department_Cateogy__c != null) { |
| | | if (opportunity_cfilter != '' && opportunity_cfilter != null) { |
| | | opportunity_cfilter += ' AND '; |
| | | } |
| | | // fy Department_Cateogy_text__c |
| | | <<<<<<< HEAD |
| | | opportunity_cfilter += |
| | | 'Department_Cateogy__c=' + "'" + Department_Cateogy__c + "'"; |
| | | ======= |
| | | opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\''; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // opportunity_cfilter += 'Department_Cateogy_text__c=' + '\'' + Department_Cateogy__c + '\''; |
| | | } |
| | | component.set('v.opportunity_cfilter', opportunity_cfilter); |
| | |
| | | break; // noop |
| | | default: |
| | | alert('An error occurred reading this file.'); |
| | | <<<<<<< HEAD |
| | | } |
| | | }; |
| | | ======= |
| | | }; |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | reader.onabort = function (e) { |
| | | alert('File read cancelled'); |
| | | }; |
| | | reader.onloadstart = function (e) { |
| | | <<<<<<< HEAD |
| | | var output = |
| | | '<ui type="disc"><li><strong>' + |
| | | file.name + |
| | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function () {}; |
| | | ======= |
| | | var output = '<ui type=\"disc\"><li><strong>' + file.name + '</strong> (' + file.type + ')- ' + file.size + 'bytes, last modified: ' + file.lastModifiedDate.toLocaleDateString() + '</li></ui>'; |
| | | component.set("v.filename", file.name); |
| | | component.set("v.TargetFileName", output); |
| | | }; |
| | | reader.onload = function (e) { |
| | | ; |
| | | var data = e.target.result; |
| | | |
| | | component.set("v.fileContentData", data); |
| | | console.log("file data" + JSON.stringify(data)); |
| | | var allTextLines = data.split(/\r\n|\n/); |
| | | console.log("qqqqqqqqqqqqqqqqqqq" + allTextLines); |
| | | var dataRows = allTextLines.length - 1; |
| | | var headers = allTextLines[0].split(','); |
| | | var numOfRows = component.get("v.NumOfRecords"); |
| | | if (dataRows > numOfRows + 1 || dataRows == 1 || dataRows == 0) { |
| | | alert("File Rows between 1 to " + numOfRows + " ."); |
| | | component.set("v.showMain", true); |
| | | } |
| | | else { |
| | | var lines = []; |
| | | var filecontentdata; |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | content += '<th scope=\"col"\ style=\"width:100px">' + '行号' + '</th>'; |
| | | for (i = 0; i < headers.length; i++) { |
| | | 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 = 1; i < allTextLines.length; i++) { |
| | | filecontentdata = allTextLines[i].split(','); |
| | | if (filecontentdata[0] != '') { |
| | | content += "<tr>"; |
| | | content += "<td>" + i + "</td>"; |
| | | for (var j = 0; j < filecontentdata.length; j++) { |
| | | content += '<td>' + filecontentdata[j] + '</td>'; |
| | | } |
| | | content += "</tr>"; |
| | | } |
| | | } |
| | | content += "</table>"; |
| | | console.log(content); |
| | | component.set("v.TableContent", content); |
| | | component.set("v.showMain", false); |
| | | } |
| | | } |
| | | reader.readAsText(file, 'gb2312'); |
| | | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function () { |
| | | }; |
| | | >>>>>>> LEXCommunityLiJun |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | // fy 调用pi改造的 获取url 和 token的方法 |
| | | search_contact_url: function (component, sobject, callback) { |
| | | <<<<<<< HEAD |
| | | var action = component.get('c.getAwsurl'); |
| | | ======= |
| | | var action = component.get("c.getAwsurl"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | action.setParams({ |
| | | sobj: sobject |
| | | }); |
| | |
| | | if (state == 'SUCCESS') { |
| | | var result = response.getReturnValue(); |
| | | if (callback) callback(result); |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error('AWS url/token error.'); |
| | | //this.showErrorToast01(component); |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | <<<<<<< HEAD |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | |
| | | //this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | ======= |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | component.set('v.login', false); |
| | | if (callback) callback(result); |
| | | }).catch(error => { |
| | | console.log('AWS search error = ' + JSON.stringify(error)); |
| | | // component.set('v.errorMessage', 'AWS search error.'); |
| | | this.error('AWS search error.'); |
| | | //this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | //component.set('v.login', true); |
| | | component.set('v.modal_import_spinner', true); |
| | | //fy 导入 202200506 start |
| | | <<<<<<< HEAD |
| | | var action1 = component.get('c.processDataAWSId'); |
| | | action1.setParams({ |
| | | fileData: component.get('v.fileContentData') |
| | |
| | | action1.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | | fileData: component.get("v.fileContentData"), |
| | | }); |
| | | action1.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var ress = response.getReturnValue(); |
| | | if (ress) { |
| | | var valur = ress.split('error1'); |
| | | if (valur.length <= 1) { |
| | | var res = JSON.parse(response.getReturnValue()); |
| | | <<<<<<< HEAD |
| | | |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | |
| | | } else { |
| | | //component.set('v.errorMessage', valur[1] + '\n' + "请修改后重新上传"); |
| | | this.error(valur[1] + '\n' + '请修改后重新上传'); |
| | | ======= |
| | | |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | | res.forEach(item => { |
| | | if (item.AWS_Data_Id__c) { |
| | | dataArr.push(item.AWS_Data_Id__c); |
| | | //dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); //zhj 新方案改造 2022-12-21 |
| | | dataMap.set(item.AWS_Data_Id__c, item.AWS_Data_Id__c); |
| | | } |
| | | }); |
| | | |
| | | let obj = Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | | this.search_contact_url(component, 'Agency_Contact__c', (result) => { |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | console.log('token = ' + token); |
| | | console.log('searchUrl = ' + searchUrl); |
| | | console.log('payload = ' + payload); |
| | | this.search_core(token, searchUrl, payload, (result) => { |
| | | console.log('result = ' + JSON.stringify(result)); |
| | | if (result.status == '0') { |
| | | if (result.object != null && result.object.length != 0) { |
| | | //component.set('v.login', true); |
| | | component.set('v.modal_import_spinner', true); |
| | | this.saveRecordsEditFile(component, dataMap, result.object, helper); |
| | | } else { |
| | | //component.set('v.errorMessage', 'AWS 查询数据为空 '); |
| | | this.error('AWS 查询数据为空 '); |
| | | //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); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | }, component); |
| | | }); |
| | | } else { |
| | | //component.set('v.errorMessage', valur[1] + '\n' + "请修改后重新上传"); |
| | | this.error(valur[1] + '\n' + "请修改后重新上传"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | |
| | | // } |
| | | // }); |
| | | // $A.enqueueAction(action); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | saveRecordsEditFile: function (component, dataMap, searchData, helper) { |
| | | var searchDataMap = new Map(); |
| | |
| | | } |
| | | console.log('searchDataMap=' + searchDataMap); |
| | | var error = ''; |
| | | <<<<<<< HEAD |
| | | var fileData = component.get('v.fileContentData'); |
| | | fileData = this.ToCDB(fileData); //全角转半角 |
| | | ======= |
| | | var fileData = component.get("v.fileContentData"); |
| | | fileData = this.ToCDB(fileData);//全角转半角 |
| | | >>>>>>> LEXCommunityLiJun |
| | | var files = fileData.split('\n'); |
| | | |
| | | var fileStr = files[0]; |
| | |
| | | var filelist = files[i].split(','); |
| | | var fileName = filelist[5]; |
| | | var WorkRecord = filelist[4]; |
| | | <<<<<<< HEAD |
| | | if ( |
| | | WorkRecord == 'SIS' || |
| | | WorkRecord == '院内入院申请' || |
| | |
| | | filelist[5] != '医生+护士' |
| | | ) { |
| | | //&&filelist[5]!='医生+护士' |
| | | ======= |
| | | if (WorkRecord == 'SIS' || WorkRecord == '院内入院申请' || WorkRecord == '收费项目申请' || WorkRecord == '科室会') { |
| | | if (fileName) { |
| | | if (WorkRecord != '科室会') { |
| | | if (searchDataMap.get(fileName.replace(' ', ''))) { |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ', '')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[5] = dataMap.get(nameDataId); //zhj 新方案改造 filelist[5]不再存的nameEncrpt 2022-12-21 |
| | | } else { |
| | | error += 'error1 第' + i + '行数据拜访人SF不存在'; |
| | | } |
| | | } else { |
| | | error += 'error1 第' + i + '行数据拜访人AWS不存在'; |
| | | } |
| | | } else { |
| | | if (filelist[5] != '医生' && filelist[5] != '医生+护士') {//&&filelist[5]!='医生+护士' |
| | | >>>>>>> LEXCommunityLiJun |
| | | error += 'error1 第' + i + '行数据拜访人不存在'; |
| | | } |
| | | } |
| | |
| | | if (fileName) { |
| | | if (WorkRecord != '科室会') { |
| | | if (searchDataMap.get(fileName.replace(' ', ''))) { |
| | | <<<<<<< HEAD |
| | | var nameDataId = searchDataMap.get( |
| | | fileName.replace(' ', '') |
| | | ); |
| | |
| | | filelist[5] != '医生+护士' |
| | | ) { |
| | | //&&filelist[5]!='医生+护士' |
| | | ======= |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ', '')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[5] = dataMap.get(nameDataId); |
| | | } else { |
| | | error += 'error1 第' + i + '行数据拜访人SF不存在'; |
| | | } |
| | | } else { |
| | | error += 'error1 第' + i + '行数据拜访人AWS不存在'; |
| | | } |
| | | } else { |
| | | if (filelist[5] != '医生' && filelist[5] != '医生+护士') {//&&filelist[5]!='医生+护士' |
| | | >>>>>>> LEXCommunityLiJun |
| | | error += 'error1 第' + i + '行数据拜访人不存在'; |
| | | } |
| | | } |
| | |
| | | let errorArray = error.split('error1'); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | <<<<<<< HEAD |
| | | |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | | console.log('fileContentData = ' + JSON.stringify(fileContentData)); |
| | | console.log('errorArray = ' + JSON.stringify(errorArray)); |
| | | ======= |
| | | |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | console.log('fileContentData = ' + JSON.stringify(fileContentData)) |
| | | console.log('errorArray = ' + JSON.stringify(errorArray)) |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (var i in errorArray) { |
| | | // if (errorArray[i] != '') { |
| | | // let errorData = {} |
| | |
| | | // errorDatas.push(errorData); |
| | | // } |
| | | if (errorArray[i] != '') { |
| | | <<<<<<< HEAD |
| | | let errorData = {}; |
| | | let index = errorDataRow.indexOf( |
| | | errorArray[i].trim().substring(1, 2) |
| | |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + errorArray[i].trim().substring(5); |
| | | ======= |
| | | let errorData = {} |
| | | let index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2)); |
| | | if (index == -1) { |
| | | errorData.errorRow = errorArray[i].trim().substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = errorArray[i].trim().substring(5); |
| | | if(errorData.errorInfo == '拜访人AWS不存在'){ |
| | | errorData.errorInfo ='拜访人 ' + fileContentData[errorData.errorRow].split(',')[5] + '不存在'; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | if(errorArray[i].trim().substring(5) == '拜访人AWS不存在'){ |
| | | errorData[index].errorInfo = '; ' + '拜访人 ' + fileContentData[errorDatas[index].errorRow].split(',')[5] + '不存在'; |
| | | }else{ |
| | | errorDatas[index].errorInfo += '; ' + errorArray[i].trim().substring(5); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | |
| | | '产品1同类耗材科室月使用量' || |
| | | fileContentData[0].split(',')[i] == '使用产品1(产品型号)' |
| | | ) { |
| | | ======= |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | console.log('fileContentData = ' + JSON.stringify(fileContentData)) |
| | | let errorColumns = [ |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 }, |
| | | { label: '错误信息', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true } |
| | | ]; |
| | | for (var i = 0; i < fileContentData[0].split(',').length - 1; i++) { |
| | | let initialWidth = 180; |
| | | if (fileContentData[0].split(',')[i] == '产品1同类耗材科室月使用量' || fileContentData[0].split(',')[i] == '使用产品1(产品型号)') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | initialWidth = 250; |
| | | } |
| | | errorColumns.push({ |
| | |
| | | } |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | console.log('errorDatas =' + JSON.stringify(errorDatas)); |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set('v.showErrorInfo', true); |
| | | ======= |
| | | console.log('errorDatas =' + JSON.stringify(errorDatas)) |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set("v.showErrorInfo", true); |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | console.log('error = ' + error); |
| | | //component.set('v.errorMessage', error); |
| | |
| | | |
| | | console.log('fileStr=' + fileStr); |
| | | $A.getCallback(function () { |
| | | <<<<<<< HEAD |
| | | helper.ImportMethod(component, fileStr, helper); |
| | | })(); |
| | | }, |
| | |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + ress[i].substr(7).substring(5); |
| | | ======= |
| | | |
| | | helper.ImportMethod(component, fileStr, helper); |
| | | })(); |
| | | |
| | | }, ImportMethod: function (component, fileStr, helper) { |
| | | var action = component.get("c.processData"); |
| | | var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields |
| | | // var filedata =component.get("v.fileContentData"); |
| | | action.setParams({ |
| | | fileData: fileStr, |
| | | sobjectName: 'Account', //Any object |
| | | fields: fieldsList |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | if (res != 'success') { |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | console.log('fileContentData[1].split(,)[5] = ' + fileContentData[1].split(',')[5]) |
| | | |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + '\n'; |
| | | if (ress[i] != '') { |
| | | let errorData = {} |
| | | let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2)); |
| | | if (index == -1) { |
| | | errorData.errorRow = ress[i].substr(7).substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = ress[i].substr(7).substring(5); |
| | | if(errorData.errorInfo == '拜访人不存在'){ |
| | | console.log('errorData.errorRow = ' + errorData.errorRow) |
| | | errorData.errorInfo ='拜访人 ' + fileContentData[errorData.errorRow].split(',')[5] + '不存在'; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | |
| | | if(ress[i].substr(7).substring(5) == '拜访人不存在'){ |
| | | errorDatas[index].errorInfo += '; ' + '拜访人 ' + fileContentData[errorDatas[index].errorRow].split(',')[5] + '不存在'; |
| | | }else{ |
| | | errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | var fileContentData = component |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | |
| | | fileContentData[0].split(',')[i] == |
| | | '使用产品1(产品型号)' |
| | | ) { |
| | | ======= |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | let errorColumns = [ |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 }, |
| | | { label: '错误信息', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true } |
| | | ]; |
| | | for (var i = 0; i < fileContentData[0].split(',').length - 1; i++) { |
| | | let initialWidth = 180; |
| | | if (fileContentData[0].split(',')[i] == '产品1同类耗材科室月使用量' || fileContentData[0].split(',')[i] == '使用产品1(产品型号)') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | initialWidth = 250; |
| | | } |
| | | errorColumns.push({ |
| | |
| | | } |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | <<<<<<< HEAD |
| | | component.set('v.showErrorInfo', true); |
| | | |
| | | console.log('==' + res1); |
| | | //component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.error(res1 + '请修改后重新上传'); |
| | | ======= |
| | | component.set("v.showErrorInfo", true); |
| | | |
| | | console.log("==" + res1); |
| | | //component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.error(res1 + "请修改后重新上传"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | //this.showErrorToast01(component); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } else { |
| | | component.set('v.successMessage', '导入成功'); |
| | | this.showSuccessToast01(component); |
| | | <<<<<<< HEAD |
| | | component.set('v.showMain', true); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | |
| | | } |
| | | } |
| | | return tmp; |
| | | ======= |
| | | component.set("v.showMain", true); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | this.doinit(component, event, helper); |
| | | } |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | },//全角转半角 |
| | | ToCDB: function (str) { |
| | | var tmp = ""; |
| | | for (var i = 0; i < str.length; i++) { |
| | | if (str.charCodeAt(i) > 65248 && str.charCodeAt(i) < 65375) { |
| | | tmp += String.fromCharCode(str.charCodeAt(i) - 65248); |
| | | } |
| | | else { |
| | | tmp += String.fromCharCode(str.charCodeAt(i)); |
| | | } |
| | | } |
| | | return tmp |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | //导出的CSV文件 |
| | | convertArrayOfObjectsToCSV: function (component, objectRecords) { |
| | |
| | | } |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | <<<<<<< HEAD |
| | | keys = [ |
| | | 'Report_Date__c', |
| | | 'Agency_Hospital__c', |
| | |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | | console.log('进入导出helper'); |
| | | ======= |
| | | keys = ['Report_Date__c', 'Agency_Hospital__c', 'Department_Cateogy_text__c', 'DealerPersonnel__c', 'WorkRecord__c', 'doctor2__c', 'ProductClassification__c', 'UseProduct1__c', 'UseProduct2__c', 'UseProduct3__c', 'EffectProgress__c', 'ConsumptionOfConsumables__c', 'WarlockClassification__c', 'ProductCcategory__c', 'productCategories__c', 'warlocksNumber__c', 'WorkMark__c']; |
| | | thkeys = ['活动日', '医院', '科室', '经销商人员', '活动区分', '拜访人', '产品分类(第三分类)', '使用产品1(产品型号)', '使用产品2', '使用产品3', '效果/进度', '产品1同类耗材科室月使用量', '产品1对应术式分类', '已采用其他品牌', '其他品牌产品类别', '产品用量', '支援需求'] |
| | | csvStringResult = ''; |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | | console.log("进入导出helper"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (var i = 0; i < objectRecords.length; i++) { |
| | | counter = 0; |
| | | for (var sTempkey in keys) { |
| | |
| | | if (counter > 0) { |
| | | csvStringResult += columnDivider; |
| | | } |
| | | <<<<<<< HEAD |
| | | if (typeof objectRecords[i][skey] === 'undefined') { |
| | | ======= |
| | | if (typeof objectRecords[i][skey] === "undefined") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | csvStringResult += '' + '' + ''; |
| | | continue; |
| | | } |
| | | if (skey == 'Person_In_Charge2__c') { |
| | | <<<<<<< HEAD |
| | | csvStringResult += |
| | | objectRecords[i].Person_In_Charge2__r.Name; |
| | | ======= |
| | | csvStringResult += objectRecords[i].Person_In_Charge2__r.Name; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else if (skey == 'Agency_Hospital__c') { |
| | | csvStringResult += objectRecords[i].Agency_Hospital__r.Name; |
| | | } else if (skey == 'DealerPersonnel__c') { |
| | |
| | | } else if (skey == 'doctor2__c') { |
| | | csvStringResult += objectRecords[i].doctor2__r.Name; |
| | | } else if (skey == 'UseProduct1__c') { |
| | | <<<<<<< HEAD |
| | | csvStringResult += |
| | | objectRecords[i].UseProduct1__r.Asset_Model_No__c; |
| | | } else if (skey == 'UseProduct2__c') { |
| | |
| | | } else if (skey == 'UseProduct3__c') { |
| | | csvStringResult += |
| | | objectRecords[i].UseProduct3__r.Asset_Model_No__c; |
| | | ======= |
| | | csvStringResult += objectRecords[i].UseProduct1__r.Asset_Model_No__c; |
| | | } else if (skey == 'UseProduct2__c') { |
| | | csvStringResult += objectRecords[i].UseProduct2__r.Asset_Model_No__c; |
| | | } else if (skey == 'UseProduct3__c') { |
| | | csvStringResult += objectRecords[i].UseProduct3__r.Asset_Model_No__c; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | csvStringResult += objectRecords[i][skey]; |
| | | } |
| | | counter++; |
| | | } |
| | | <<<<<<< HEAD |
| | | console.log('导出循环结束'); |
| | | ======= |
| | | console.log("导出循环结束"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | csvStringResult += lineDivider; |
| | | } |
| | | return csvStringResult; |
| | |
| | | // 导出页面显示的模板 |
| | | showExportDate: function (component, objectRecords) { |
| | | console.log('进入showexceportdate' + objectRecords); |
| | | <<<<<<< HEAD |
| | | var keys = [ |
| | | 'Report_Date__c', |
| | | 'Agency_Hospital__c', |
| | |
| | | '<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 += '</tr></thead>'; |
| | | ======= |
| | | var keys = ['Report_Date__c', 'Agency_Hospital__c', 'Department_Cateogy_text__c', 'DealerPersonnel__c', 'WorkRecord__c', 'doctor2__c', 'ProductClassification__c', 'UseProduct1__c', 'UseProduct2__c', 'UseProduct3__c', 'EffectProgress__c', 'ConsumptionOfConsumables__c', 'WarlockClassification__c', 'ProductCcategory__c', 'productCategories__c', 'warlocksNumber__c', 'WorkMark__c']; |
| | | var headers = ['活动日', '医院', '科室', '经销商人员', '活动区分', '拜访人', '产品分类(第三分类)', '使用产品1(产品型号)', '使用产品2', '使用产品3', '效果/进度', '产品1同类耗材科室月使用量', '产品1对应术式分类', '已采用其他品牌', '其他品牌产品类别', '产品用量', '支援需求'] |
| | | 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"\ style=\"width:200px">' + headers[i] + '</th>'; |
| | | if (headers[i] == '产品1同类耗材科室月使用量') { |
| | | content += '<th scope=\"col"\ style=\"width:250px"\>' + headers[i] + '</th>'; |
| | | content += |
| | | '<th scope="col" style="width:250px">' + |
| | | headers[i] + |
| | | '</th>'; |
| | | } else { |
| | | content += '<th scope=\"col"\ style=\"width:200px"\>' + headers[i] + '</th>'; |
| | | content += |
| | | '<th scope="col" style="width:200px">' + |
| | | headers[i] + |
| | | '</th>'; |
| | | } |
| | | } |
| | | content += "</tr></thead>"; |
| | | >>>>>>> LEXCommunityLiJun |
| | | content += '</tr></thead>'; |
| | | for (var i = 0; i < objectRecords.length; i++) { |
| | | console.log('for' + content); |
| | | content += '<tr>'; |
| | | for (var sTempkey in keys) { |
| | | console.log('for1' + sTempkey); |
| | | var skey = keys[sTempkey]; |
| | | <<<<<<< HEAD |
| | | if (typeof objectRecords[i][skey] === 'undefined') { |
| | | content += '<td>' + '' + '</td>'; |
| | | continue; |
| | |
| | | '<td>' + |
| | | objectRecords[i].UseProduct3__r.Asset_Model_No__c + |
| | | '</td>'; |
| | | ======= |
| | | if (typeof objectRecords[i][skey] === "undefined") { |
| | | content += '<td>' + '' + '</td>'; |
| | | continue; |
| | | } |
| | | console.log('for2' + objectRecords[i].Person_In_Charge2__r.Name); |
| | | if (skey == 'Person_In_Charge2__c') { |
| | | content += '<td>' + objectRecords[i].Person_In_Charge2__r.Name + '</td>'; |
| | | } else if (skey == 'Agency_Hospital__c') { |
| | | content += '<td>' + objectRecords[i].Agency_Hospital__r.Name + '</td>'; |
| | | } else if (skey == 'DealerPersonnel__c') { |
| | | content += '<td>' + objectRecords[i].DealerPersonnel__r.Name + '</td>'; |
| | | } else if (skey == 'doctor2__c') { |
| | | content += '<td>' + objectRecords[i].doctor2__r.Name + '</td>'; |
| | | } else if (skey == 'UseProduct1__c') { |
| | | content += '<td>' + objectRecords[i].UseProduct1__r.Asset_Model_No__c + '</td>'; |
| | | } else if (skey == 'UseProduct2__c') { |
| | | content += '<td>' + objectRecords[i].UseProduct2__r.Asset_Model_No__c + '</td>'; |
| | | } else if (skey == 'UseProduct3__c') { |
| | | content += '<td>' + objectRecords[i].UseProduct3__r.Asset_Model_No__c + '</td>'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | content += '<td>' + objectRecords[i][skey] + '</td>'; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | content += '</tr>'; |
| | | } |
| | | content += '</table>'; |
| | | console.log('helper循环结束' + content); |
| | | component.set('v.TableContent2', content); |
| | | component.set('v.showMain', false); |
| | | ======= |
| | | content += '</tr>' |
| | | } |
| | | content += '</table>'; |
| | | console.log("helper循环结束" + content); |
| | | component.set("v.TableContent2", content); |
| | | component.set("v.showMain", false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | select_repores_date: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | var reportsdate1 = component.find('input-report-date1').get('v.value'); |
| | | var reportsdate2 = component.find('input-report-date2').get('v.value'); |
| | | <<<<<<< HEAD |
| | | console.log( |
| | | '输入的开始日期' + reportsdate1 + '输入的结束日期' + reportsdate2 |
| | | ); |
| | | var action = component.get('c.getReportsByDate'); |
| | | ======= |
| | | console.log('输入的开始日期' + reportsdate1 + '输入的结束日期' + reportsdate2); |
| | | var action = component.get("c.getReportsByDate"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | console.log('输入的开始日期1'); |
| | | action.setParams({ |
| | | date1: reportsdate1, |
| | |
| | | console.log('输入的开始日期2'); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | <<<<<<< HEAD |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | if (state === "SUCCESS") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var res = response.getReturnValue(); |
| | | console.log('输入的开始日期3' + res); |
| | | component.set('v.login', false); |
| | |
| | | if (true) { |
| | | let awsids = []; |
| | | for (let ri in res) { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | res[ri] && |
| | | res[ri].doctor2__r && |
| | | res[ri].doctor2__r.AWS_Data_Id__c |
| | | ) { |
| | | ======= |
| | | if (res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | awsids.push(res[ri].doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | if (awsids.length > 0) { |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | <<<<<<< HEAD |
| | | let staticResourceAgencyContact = JSON.parse( |
| | | PIConfig.staticResourceAgencyContact |
| | | ); |
| | |
| | | }, |
| | | staticResourceAgencyContact.token |
| | | ); |
| | | ======= |
| | | 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].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)) { |
| | | res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | helper.showExportDate(component, res); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.set('v.reports_date', res); |
| | | } else { |
| | | alert('导出失败,请检查活动日'); |
| | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | showImport: function (component) { |
| | |
| | | newlyBuild: function (component, event, helper) { |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | event.preventDefault(); // stop form submission |
| | | <<<<<<< HEAD |
| | | var fields = component.find('newOpportunityField'); |
| | | ======= |
| | | var fields = component.find("newOpportunityField"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | var nameer = ''; |
| | | var type = ''; |
| | | var doctorDivision1 = ''; |
| | | fields.forEach(function (field) { |
| | | <<<<<<< HEAD |
| | | if (field.get('v.fieldName') === 'Name') { |
| | | nameer = field.get('v.value'); |
| | | } |
| | |
| | | } |
| | | if (field.get('v.fieldName') === 'Doctor_Division1__c') { |
| | | doctorDivision1 = field.get('v.value'); |
| | | ======= |
| | | if (field.get("v.fieldName") === 'Name') { |
| | | nameer = field.get("v.value"); |
| | | } |
| | | if (field.get("v.fieldName") === 'Type__c') { |
| | | type = field.get("v.value"); |
| | | } |
| | | if (field.get("v.fieldName") === 'Doctor_Division1__c') { |
| | | doctorDivision1 = field.get("v.value"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | if (hospital_id) { |
| | | component.set('v.login', true); |
| | | var action = component.get('c.newlyBuild'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | hospital_id: hospital_id, |
| | | nameer: nameer, |
| | | type: type, |
| | | doctorDivision1: doctorDivision1 |
| | | ======= |
| | | "hospital_id": hospital_id, |
| | | "nameer": nameer, |
| | | "type": type, |
| | | "doctorDivision1": doctorDivision1, |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | <<<<<<< HEAD |
| | | var default_doctor = component.get( |
| | | 'v.default_select_doctor_id' |
| | | ); |
| | | ======= |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | for (var i = 0; i < res.length; i++) { |
| | |
| | | } else { |
| | | component.find('select_doctor').set('v.options', res); |
| | | if (res.length > 0) { |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.doctor_title', |
| | | res[0].Doctor_Division1__c |
| | | ); |
| | | ======= |
| | | component.set('v.doctor_title', res[0].Doctor_Division1__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.login', false); |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | } |
| | | else { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //component.set('v.errorMessage', 'newlyBuild failed.'); |
| | | this.error('newlyBuild failed.'); |
| | | //this.showErrorToast(component); |
| | |
| | | var sc = event.getSource().get('v.value'); |
| | | if (sc != null) { |
| | | if (sc.length <= 14) { |
| | | <<<<<<< HEAD |
| | | if (sc.replace(/\D/gi, '')) { |
| | | component.set('v.select_ConsumptionOfConsumables', sc); |
| | | ======= |
| | | if (sc.replace(/\D/gi, "")) { |
| | | component.set("v.select_ConsumptionOfConsumables", sc); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.error('产品1同类耗材科室月使用量必须输入数字!'); |
| | |
| | | var sc = event.getSource().get('v.value'); |
| | | if (sc != null) { |
| | | if (sc.length <= 14) { |
| | | <<<<<<< HEAD |
| | | if (sc.replace(/\D/gi, '')) { |
| | | component.set('v.select_warlocksNumber', sc); |
| | | ======= |
| | | if (sc.replace(/\D/gi, "")) { |
| | | component.set("v.select_warlocksNumber", sc); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } else { |
| | | //component.set('v.errorMessage', '产品用量必须输入数字!'); |
| | | this.error('产品用量必须输入数字!'); |
| | |
| | | }, |
| | | //工作会记录 |
| | | selectPurposeType: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | // alert(doctor_value); |
| | | if (doctor_value != '科室会') { |
| | |
| | | this.set_doctor_list_edit(component); |
| | | var action = component.get('c.selectPurposeTypes'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | doctor_value: doctor_value |
| | | ======= |
| | | 'doctor_value': doctor_value |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_EffectProgress') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | ======= |
| | | component.find('select_EffectProgress').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | |
| | | selectProductClassification: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var select_ProductClassification = component |
| | | .find('select_ProductClassification') |
| | | .get('v.value'); |
| | |
| | | var action = component.get('c.selectProductClassificationc'); |
| | | action.setParams({ |
| | | select_ProductClassification: select_ProductClassification |
| | | ======= |
| | | |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | if (select_ProductClassification != '') { |
| | | var action = component.get('c.selectProductClassificationc'); |
| | | action.setParams({ |
| | | "select_ProductClassification": select_ProductClassification |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_OtherBrandConsumables') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | ======= |
| | | component.find('select_OtherBrandConsumables').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | this.selectProductCcategory(component); |
| | | }, |
| | | select_ProductCcategory: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var select_ProductCcategory = component |
| | | .find('select_ProductCcategory') |
| | | .get('v.value'); |
| | | |
| | | ======= |
| | | var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value'); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (select_ProductCcategory != '') { |
| | | var result = component.find('result'); |
| | | var UserProType = component.get('v.UserProType'); |
| | |
| | | } |
| | | var action = component.get('c.selectProductCcategory01'); |
| | | action.setParams({ |
| | | <<<<<<< HEAD |
| | | select_ProductCcategory: select_ProductCcategory |
| | | ======= |
| | | "select_ProductCcategory": select_ProductCcategory |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | <<<<<<< HEAD |
| | | component |
| | | .find('select_productCategories') |
| | | .set('v.options', JSON.parse(JSON.stringify(res))); |
| | | ======= |
| | | component.find('select_productCategories').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | } |
| | | }, |
| | | selectpurposetype: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var select_ProductCcategory = component |
| | | .find('select_ProductCcategory') |
| | | .get('v.value'); |
| | |
| | | select_ProductCcategory == undefined && |
| | | select_ProductCcategory == '' |
| | | ) { |
| | | ======= |
| | | var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value'); |
| | | if (select_ProductCcategory == null && select_ProductCcategory == undefined && select_ProductCcategory == '') { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var result = component.find('result'); |
| | | // $A.util.removeClass(result, 'disp_none'); |
| | | if (UserProType == 'ENG') { |
| | |
| | | $A.util.addClass(result, 'disp_none'); |
| | | } |
| | | } else { |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('select_productCategories').set('v.value', ''); |
| | | var result = component.find('result'); |
| | | $A.util.addClass(result, 'disp_none'); |
| | | this.select_ProductCcategory(component); |
| | | <<<<<<< HEAD |
| | | } |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | |
| | | for (var i in errorColumns) { |
| | | errorColumnsArray.push(errorColumns[i].label); |
| | | } |
| | | ======= |
| | | } |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | CallBackAction: function (component, action_name, para, callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.", "")); |
| | | if (para) { |
| | | action.setParams(para); |
| | | } |
| | | if (callback) { |
| | | action.setCallback(this, function (data) { |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | |
| | | //zhj 导出错误信息 2023-05-16 start |
| | | exportErrorInfoHelper: function (component) { |
| | | var errorData = component.get('v.errorData'); |
| | | var errorColumns = component.get('v.errorColumns'); |
| | | |
| | | var datas = []; |
| | | let errorColumnsArray = []; |
| | | for (var i in errorColumns) { |
| | | errorColumnsArray.push(errorColumns[i].label); |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | datas.push(errorColumnsArray); |
| | | //datas.push(errorColumns); |
| | | |
| | | for (var i in errorData) { |
| | | let data = []; |
| | | <<<<<<< HEAD |
| | | data.push(errorData[i].errorRow); |
| | | data.push(errorData[i].errorInfo); |
| | | for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) { |
| | | data.push(errorData[i]['field' + j]); |
| | | ======= |
| | | data.push(errorData[i].errorRow) |
| | | data.push(errorData[i].errorInfo) |
| | | for (var j = 0; j < Object.keys(errorData[i]).length - 2; j++) { |
| | | data.push(errorData[i]['field' + j]) |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | datas.push(data); |
| | | } |
| | | |
| | | console.log('datas = ' + JSON.stringify(datas)); |
| | | var csv = this.convertToCSV(component, datas); |
| | | <<<<<<< HEAD |
| | | console.log('csv = ' + JSON.stringify(csv)); |
| | | ======= |
| | | console.log('csv = ' + JSON.stringify(csv)) |
| | | >>>>>>> LEXCommunityLiJun |
| | | this.downloadCSV(component, csv); |
| | | }, |
| | | |
| | | convertToCSV: function (component, data) { |
| | | <<<<<<< HEAD |
| | | console.log('enter convertToCSV'); |
| | | ======= |
| | | console.log('enter convertToCSV') |
| | | >>>>>>> LEXCommunityLiJun |
| | | console.log('data = ' + data); |
| | | var csv = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | |
| | | var val = ''; |
| | | val = row[j] === null ? '' : row[j].toString(); |
| | | console.log('val = ' + val); |
| | | <<<<<<< HEAD |
| | | if ( |
| | | val.indexOf(',') !== -1 || |
| | | val.indexOf('"') !== -1 || |
| | | val.indexOf('\n') !== -1 |
| | | ) { |
| | | ======= |
| | | if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | //val = '"' + val.replace(/"/g,'""') + '"'; |
| | | } |
| | | if (j > 0) { |
| | |
| | | |
| | | downloadCSV: function (component, csv) { |
| | | var link = document.createElement('a'); |
| | | <<<<<<< HEAD |
| | | var bom = '\uFEFF'; |
| | | link.href = |
| | | 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | ======= |
| | | var bom = "\uFEFF"; |
| | | link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | >>>>>>> LEXCommunityLiJun |
| | | link.download = 'data.csv'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | |
| | | }, |
| | | error: function (message) { |
| | | // $('toastMessage.forceToastManager').css('white-space', 'pre-wrap'); |
| | | <<<<<<< HEAD |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | |
| | | toastEvent.setParams({ |
| | |
| | | } |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | }); |
| | | ======= |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type": "error", |
| | | //"duration" : "sticky" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |