| | |
| | | if (result.object != null) { |
| | | this.to_contact_list(result, contactData, component); |
| | | } else { |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else { |
| | | this.error("AWS search status1 : " + result.status); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }, |
| | | component |
| | |
| | | } |
| | | component.find("select_agency_person").set("v.options", res); |
| | | component.set("v.allselectlistAgencyPerson", res); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | |
| | | search_contact_url: function (component, sobject, callback) { |
| | |
| | | if (callback) callback(result); |
| | | } else { |
| | | this.error("AWS url/token error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | get_reports_edit: function (component, event, helper, date_str, person_str) { |
| | | if (!date_str) { |
| | | return false; |
| | | } |
| | | |
| | | date_str = this.get_date_string(date_str); |
| | | |
| | | var action = component.get("c.getReports"); |
| | | action.setParams({ |
| | | date_str: date_str, |
| | | person_str: person_str |
| | | }); |
| | | |
| | | component.set("v.loginEdit", true); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | component.set("v.reports", res.reports); |
| | | |
| | | // 20220222 PI改造 by Bright--start |
| | | let dataIds = []; |
| | | let dataIds1 = []; |
| | | let mm = {}; |
| | | let b = false; |
| | | let b1 = false; |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) { |
| | | dataIds.push(rep.doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | |
| | | if ( |
| | | rep.Person_In_Charge2__r && |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c |
| | | ) { |
| | | dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | let Foo = null; |
| | | Foo = function () { |
| | | if (b && b1) { |
| | | for (const rep of res.reports) { |
| | | if ( |
| | | rep.doctor2__r && |
| | | rep.doctor2__r.AWS_Data_Id__c && |
| | | mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c) |
| | | ) { |
| | | rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | if ( |
| | | rep.Person_In_Charge2__r && |
| | | rep.Person_In_Charge2__r.AWS_Data_Id__c && |
| | | mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c) |
| | | ) { |
| | | rep.Person_In_Charge2__r.awsdata = |
| | | mm[rep.Person_In_Charge2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | |
| | | $A.getCallback(() => component.set("v.reports", res.reports))(); |
| | | } else { |
| | | console.log("b=" + b + ",b1=" + b1 + ",continue"); |
| | | setTimeout(Foo, 100); |
| | | } |
| | | }; |
| | | |
| | | if (dataIds.length > 0) { |
| | | let awsurl = component.get("v.awsurl"); |
| | | helper.search_core( |
| | | awsurl.token, |
| | | awsurl.searchUrl, |
| | | JSON.stringify({ |
| | | dataIds: dataIds |
| | | }), |
| | | (result) => { |
| | | if (result.status == "0") { |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b = true; |
| | | Foo(); |
| | | } else { |
| | | //this.error('AWS search status2 : ' + result.status); |
| | | this.success("请重新刷新页面进行解密"); |
| | | } |
| | | }, |
| | | component |
| | | ); |
| | | } else { |
| | | b = true; |
| | | } |
| | | |
| | | if (dataIds1.length > 0) { |
| | | let contactawsurl = component.get("v.contactawsurl"); |
| | | helper.search_core( |
| | | contactawsurl.token, |
| | | contactawsurl.searchUrl, |
| | | JSON.stringify({ |
| | | dataIds: dataIds1 |
| | | }), |
| | | (result) => { |
| | | if (result.status == "0") { |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b1 = true; |
| | | Foo(); |
| | | } else { |
| | | this.error("AWS search status3 : " + result.status); |
| | | } |
| | | }, |
| | | component |
| | | ); |
| | | } else { |
| | | b1 = true; |
| | | } |
| | | // 20220222 PI改造 by Bright--end |
| | | |
| | | component.set("v.report_count", res.reports.length); |
| | | |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get("v.update_select_report_data_id"); |
| | | |
| | | if (report_id != "") { |
| | | for (i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]["Id"] == report_id) { |
| | | component.set("v.select_report_data", res.reports[i]); |
| | | break; |
| | | } |
| | | } |
| | | component.set("v.update_select_report_data_id", ""); |
| | | } |
| | | |
| | | if (res.reports.length > 0) { |
| | | component.set("v.list_message", ""); |
| | | } else { |
| | | component.set("v.list_message", "no_data"); |
| | | } |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | this.error("get_reports failed."); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | select_date_change: function (component, event, helper) { |
| | | this.get_reports( |
| | |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, "disp_none"); |
| | | $A.util.removeClass(modal_bg, "disp_none"); |
| | | |
| | | component.set("v.loginEdit", true); |
| | | if ( |
| | | component.get("v.mode") == "edit" || |
| | | component.get("v.mode") == "copy" |
| | |
| | | component.set("v.edit_copy_select_report_id", ""); |
| | | } |
| | | } |
| | | setTimeout(function () { |
| | | component.set("v.loginEdit", false); |
| | | }, 1000); |
| | | } else { |
| | | // CLOSE |
| | | |
| | |
| | | }, |
| | | |
| | | edit_button: function (component, event, helper) { |
| | | component.set("v.login", true); |
| | | this.allclear(component); |
| | | component.set("v.loadOpp", true); |
| | | var index = event.getSource().get("v.value"); |
| | |
| | | } |
| | | |
| | | // 保存処理 |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | if (component.get("v.mode") == "edit") { |
| | | var Agency_Report__c = component.get("v.select_report_data").Id; |
| | | var action = component.get("c.editAgencyReport"); |
| | |
| | | .set("v.options", select_agency_list); |
| | | |
| | | component.set("v.update_select_report_data_id", report_id); |
| | | this.get_reports( |
| | | this.get_reports_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | |
| | | ); |
| | | |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | // var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | |
| | | // } |
| | | this.error("save_report failed."); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | var report_id = response.getReturnValue(); |
| | | component.set("v.create_agency_report_id", report_id); |
| | | |
| | | this.get_reports( |
| | | this.get_reports_edit( |
| | | component, |
| | | event, |
| | | helper, |
| | |
| | | } else { |
| | | this.error("get_reports_now failed."); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action2); |
| | | |
| | | this.allclear(component); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | | this.error("saveAgencyReport failed."); |
| | | component.find("save_button").set("v.disabled", false); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | component.set("v.AWStransactionURL", awsmap.transactionURL); |
| | | } else { |
| | | this.error("AWS url/token error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | })(); |
| | | } else { |
| | | console.log("AWS status error:" + result); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | if (result.status == "129") { |
| | | component |
| | | .find("OppMessage") |
| | |
| | | }) |
| | | .catch((error) => { |
| | | console.log("AWS insert error:" + error); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | component.find("OppMessage").setError("AWS insert error."); |
| | | }); |
| | | }, |
| | |
| | | this.to_confirm(component, token, confirmUrl, JSON.stringify(data)); |
| | | } else if (acMap.errormsg != "") { |
| | | this.error(acMap.errormsg); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | this.error("agency contact insert id error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else { |
| | | this.error("agency contact insert error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | this.set_doctor_list(component); |
| | | } else { |
| | | this.error("AWS confirm error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | this.error("AWS confirm error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }); |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | |
| | | set_doctor_list: function (component) { |
| | | var hospital_id = component.get("v.hospitalLinkId"); |
| | | if (hospital_id) { |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | var action = component.get("c.getDoctorList"); |
| | | action.setParams({ |
| | | hospital_id: hospital_id |
| | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | } else { |
| | | this.error("set_doctor_list failed."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | dataArr.push(key); |
| | | } |
| | | if (dataArr.length == 0) { |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | this.warning("没有找到符合条件的客户人员"); |
| | | return; |
| | | } |
| | |
| | | this.to_doctor_list(result, retMap, component); |
| | | } else { |
| | | this.error("AWS search status4 : " + result.status); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }, |
| | | component |
| | |
| | | return data.json(); |
| | | }) |
| | | .then((result) => { |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | if (callback) callback(result); |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | this.error("AWS search error."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }); |
| | | }, |
| | | |
| | |
| | | |
| | | component.set("v.default_select_doctor_id", ""); |
| | | component.set("v.doctor_list", res); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | |
| | | agency_hospital_link_id: component.get("v.hospitalLinkId") |
| | | }); |
| | | |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == "SUCCESS") { |
| | |
| | | // } else { |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | return false; |
| | | } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy start |
| | |
| | | ); |
| | | } |
| | | |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | this.error("selectOpportunityByIdAndHospitalLinkId failed."); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | |
| | | saveRecords: function (component, event, helper) { |
| | | debugger; |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | //fy 导入 20220424 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | |
| | | // component.set('v.login',true); |
| | | // this.ImportMethod(component,resultjson); |
| | | // } |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | this.saveRecordsEditFile( |
| | | component, |
| | | dataMap, |
| | |
| | | ); |
| | | } else { |
| | | this.error("AWS 查询数据为空 "); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else { |
| | | this.error("AWS search status6 : " + result.status); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }, |
| | | component |
| | |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger; |
| | | var fileContentData = component.get("v.fileContentData").split("\n"); |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + "\n"; |
| | | if (ress[i] != "") { |
| | |
| | | .substr(7) |
| | | .substring(5) |
| | | .replace("=", ""); |
| | | if (errorData.errorInfo == "拜访人不存在") { |
| | | console.log("errorData.errorRow = " + errorData.errorRow); |
| | | errorData.errorInfo = |
| | | "拜访人 " + |
| | | fileContentData[errorData.errorRow].split(",")[4] + |
| | | "不存在"; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | "; " + ress[i].substr(7).substring(5); |
| | | if (ress[i].substr(7).substring(5) == "拜访人不存在") { |
| | | errorDatas[index].errorInfo += |
| | | "; " + |
| | | "拜访人 " + |
| | | fileContentData[errorDatas[index].errorRow].split(",")[4] + |
| | | "不存在"; |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | "; " + ress[i].substr(7).substring(5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var fileContentData = component.get("v.fileContentData").split("\n"); |
| | | let errorColumns = [ |
| | | { |
| | | label: "错误行", |
| | |
| | | component.set("v.showErrorInfo", true); |
| | | console.log("==" + res1); |
| | | this.error(res1 + "请修改后重新上传"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } else { |
| | | component.set("v.showMain", true); |
| | | this.success("导入成功"); |
| | | // alert('saved successfully'); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } else if (state === "INCOMPLETE") { |
| | | // do something |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", 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.loginEdit", false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | } |
| | | }); |
| | |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger; |
| | | var fileContentData = component.get("v.fileContentData").split("\n"); |
| | | console.log("errorArray = " + JSON.stringify(errorArray)); |
| | | for (var i in errorArray) { |
| | | if (errorArray[i] != "") { |
| | |
| | | .trim() |
| | | .substring(5, errorArray[i].trim().length) |
| | | .replace("=", ""); |
| | | if (errorData.errorInfo == "拜访人AWS不存在") { |
| | | errorData.errorInfo = |
| | | "拜访人 " + |
| | | fileContentData[errorData.errorRow].split(",")[4] + |
| | | "不存在"; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | "; " + |
| | | errorArray[i].trim().substring(5, errorArray[i].trim().length); |
| | | if (errorArray[i].trim().substring(5) == "拜访人AWS不存在") { |
| | | errorData[index].errorInfo = |
| | | "; " + |
| | | "拜访人 " + |
| | | fileContentData[errorDatas[index].errorRow].split(",")[4] + |
| | | "不存在"; |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | "; " + |
| | | errorArray[i].trim().substring(5, errorArray[i].trim().length); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | this.error(error); |
| | | console.log("error=" + error); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | return; |
| | | } |
| | | |
| | |
| | | }, |
| | | |
| | | select_repores_date: function (component, event, helper) { |
| | | component.set("v.login", true); |
| | | component.set("v.loginEdit", true); |
| | | var reportsdate1 = component.find("input-report-date1").get("v.value"); |
| | | var reportsdate2 = component.find("input-report-date2").get("v.value"); |
| | | console.log( |
| | |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | console.log("输入的开始日期3" + res); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | |
| | | // PI 改造 By Bright 20220328 |
| | | if (true) { |
| | |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | }, |
| | | awsurl.token |
| | | ); |
| | |
| | | component.set("v.reports_date", res); |
| | | } else { |
| | | alert("导出失败,请检查活动日"); |
| | | component.set("v.login", false); |
| | | component.set("v.loginEdit", false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |