| | |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'doinit failed.'); |
| | | //component.set('v.errorMessage', 'doinit failed.'); |
| | | this.error('doinit failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'get_reports failed.'); |
| | | //component.set('v.errorMessage', 'get_reports failed.'); |
| | | this.error('get_reports failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'save_report failed.'); |
| | | //component.set('v.errorMessage', 'save_report failed.'); |
| | | this.error('save_report failed.'); |
| | | this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | |
| | | } |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'get_reports_now failed.'); |
| | | // 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); |
| | | component.set('v.login', false); |
| | |
| | | } |
| | | else { |
| | | var error = response.getError(); |
| | | component.set('v.errorMessage', '保存日报失败'); |
| | | //component.set('v.errorMessage', '保存日报失败'); |
| | | this.error('保存日报失败'); |
| | | this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | |
| | | create_report_header: function (component, event, helper, name, s_agency, s_date) { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | component.set('v.errorMessage', 'get_date_string failed.'); |
| | | //component.set('v.errorMessage', 'get_date_string failed.'); |
| | | this.error('get_date_string failed.'); |
| | | this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | | component.set('v.agency_report_header', head_key); |
| | | if (head_key == false) { |
| | | component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | //component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | this.error('create_header_input_key failed.'); |
| | | this.showErrorToast(component); |
| | | return false; |
| | | } |
| | |
| | | this.toggle_report(component, event, helper); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | //component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.error('createReportHeader callback failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | if (typeof (s_date) != 'string') { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | component.set('v.errorMessage', 'get_date_string in create_header_input_key.'); |
| | | //component.set('v.errorMessage', 'get_date_string in create_header_input_key.'); |
| | | this.error('get_date_string in create_header_input_key.'); |
| | | this.showErrorToast(component); |
| | | return false; |
| | | } |
| | |
| | | component.set("v.UseProduct1s", accname); |
| | | component.set("v.UseProduct1", accname); |
| | | } else { |
| | | component.set('v.errorMessage', '不能选择同样的产品'); |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | } |
| | | }, |
| | |
| | | component.set("v.UseProduct2s", accname); |
| | | component.set("v.UseProduct2", accname); |
| | | } else { |
| | | component.set('v.errorMessage', '不能选择同样的产品'); |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | } |
| | | |
| | |
| | | component.set("v.UseProduct3s", accname); |
| | | component.set("v.UseProduct3", accname); |
| | | } else { |
| | | component.set('v.errorMessage', '不能选择同样的产品'); |
| | | //component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.error('不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | } |
| | | |
| | |
| | | component.set('v.AWStransactionURL', awsmap.transactionURL); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'AWS url/token error.'); |
| | | // component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error('AWS url/token error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | |
| | | this.to_confirm(component, token, confirmUrl, JSON.stringify(data)); |
| | | } else if (acMap.errormsg != '') { |
| | | component.set('v.errorMessage', acMap.errormsg); |
| | | // component.set('v.errorMessage', acMap.errormsg); |
| | | this.error(acMap.errormsg); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } else { |
| | | component.set('v.errorMessage', 'agency contact insert id error.'); |
| | | //component.set('v.errorMessage', 'agency contact insert id error.'); |
| | | this.error('agency contact insert id error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'agency contact insert error.'); |
| | | //component.set('v.errorMessage', 'agency contact insert error.'); |
| | | this.error('agency contact insert error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component); |
| | | } else { |
| | | component.set('v.errorMessage', 'AWS confirm error.'); |
| | | //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.'); |
| | | // component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.error('AWS confirm error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | }); |
| | |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | // component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.error('set_doctor_list failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | 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)) { |
| | | component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | component.find('select_Product1').set('v.value', ''); |
| | | } |
| | |
| | | var p2bool = pcId2 != '' && pcId2 != null; |
| | | var p0bool = product_category_id != '' && product_category_id != null; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | component.set('v.UseProduct2_TEXT', ''); |
| | | } |
| | |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | 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)) { |
| | | component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | //component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.error('不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | component.find('select_Product3').set('v.value', ''); |
| | | } |
| | |
| | | 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"\>' + '行号' + '</th>'; |
| | | content += '<th scope=\"col"\ style=\"width:100px">' + '行号' + '</th>'; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope=\"col"\>' + headers[i] + '</th>'; |
| | | if (headers[i] == '产品1同类耗材科室月使用量') { |
| | | content += '<th scope=\"col"\ style=\"width:250px"\>' + headers[i] + '</th>'; |
| | | } else { |
| | | content += '<th scope=\"col"\ style=\"width:200px"\>' + headers[i] + '</th>'; |
| | | } |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i = 1; i < allTextLines.length; i++) { |
| | |
| | | if (callback) callback(result); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'AWS url/token error.'); |
| | | //component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.error('AWS url/token error.'); |
| | | this.showErrorToast01(component); |
| | | 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.'); |
| | | // component.set('v.errorMessage', 'AWS search error.'); |
| | | this.error('AWS search error.'); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | }); |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | //component.set('v.login', true); |
| | | component.set('v.modal_import_spinner', true); |
| | | //fy 导入 202200506 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | |
| | | 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.login', true); |
| | | component.set('v.modal_import_spinner', true); |
| | | this.saveRecordsEditFile(component, dataMap, result.object, helper); |
| | | } else { |
| | | component.set('v.errorMessage', 'AWS 查询数据为空 '); |
| | | //component.set('v.errorMessage', 'AWS 查询数据为空 '); |
| | | this.error('AWS 查询数据为空 '); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | } else { |
| | | component.set('v.errorMessage', 'AWS search status : ' + result.status); |
| | | //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.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | }, component); |
| | | }); |
| | | } else { |
| | | component.set('v.errorMessage', valur[1] + '\n' + "请修改后重新上传"); |
| | | //component.set('v.errorMessage', valur[1] + '\n' + "请修改后重新上传"); |
| | | this.error(valur[1] + '\n' + "请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | } |
| | | } |
| | |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | console.log('fileContentData = ' + JSON.stringify(fileContentData)) |
| | | console.log('errorArray = ' + JSON.stringify(errorArray)) |
| | | for (var i in errorArray) { |
| | | if (errorArray[i] != '') { |
| | | let errorData = {} |
| | | errorData.errorRow = errorArray[i].trim().substring(1, 2); |
| | | errorData.errorInfo = errorArray[i].trim().substring(5); |
| | | errorDatas.push(errorData); |
| | | } |
| | | // if (errorArray[i] != '') { |
| | | // let errorData = {} |
| | | // errorData.errorRow = errorArray[i].trim().substring(1, 2); |
| | | // errorData.errorInfo = errorArray[i].trim().substring(5); |
| | | // errorDatas.push(errorData); |
| | | // } |
| | | if (errorArray[i] != '') { |
| | | let errorData = {} |
| | | let index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2)); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | console.log('fileContentData = ' + JSON.stringify(fileContentData)) |
| | | let errorColumns = [ |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 50 }, |
| | | { 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(产品型号)') { |
| | | initialWidth = 250; |
| | | } |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | initialWidth: initialWidth |
| | | }); |
| | | } |
| | | |
| | |
| | | component.set("v.showErrorInfo", true); |
| | | |
| | | console.log('error = ' + error); |
| | | component.set('v.errorMessage', error); |
| | | //component.set('v.errorMessage', error); |
| | | this.error(error); |
| | | this.showErrorToast01(component); |
| | | console.log('error=' + error); |
| | | component.set('v.login', false); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | return; |
| | | } |
| | | |
| | |
| | | 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]) |
| | | debugger |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + '\n'; |
| | |
| | | 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 { |
| | | debugger |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | let errorColumns = [ |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 50 }, |
| | | { 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(产品型号)') { |
| | | initialWidth = 250; |
| | | } |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | initialWidth: initialWidth |
| | | }); |
| | | } |
| | | |
| | |
| | | component.set("v.showErrorInfo", true); |
| | | |
| | | console.log("==" + res1); |
| | | component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | //component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.error(res1 + "请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | //component.set('v.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } else { |
| | | component.set('v.successMessage', '导入成功'); |
| | | this.showSuccessToast01(component); |
| | | component.set("v.showMain", true); |
| | | component.set('v.login', false); |
| | | //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.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.login', false); |
| | | //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.login', false); |
| | | component.set('v.modal_import_spinner', false); |
| | | } |
| | | } |
| | | }); |
| | |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'newlyBuild failed.'); |
| | | //component.set('v.errorMessage', 'newlyBuild failed.'); |
| | | this.error('newlyBuild failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | |
| | | if (sc.replace(/\D/gi, "")) { |
| | | component.set("v.select_ConsumptionOfConsumables", sc); |
| | | } else { |
| | | component.set('v.errorMessage', '产品1同类耗材科室月使用量必须输入数字!'); |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.error('产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | } else { |
| | | component.set('v.errorMessage', '产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | //component.set('v.errorMessage', '产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | this.error('产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | } |
| | |
| | | if (sc.replace(/\D/gi, "")) { |
| | | component.set("v.select_warlocksNumber", sc); |
| | | } else { |
| | | component.set('v.errorMessage', '产品用量必须输入数字!'); |
| | | //component.set('v.errorMessage', '产品用量必须输入数字!'); |
| | | this.error('产品用量必须输入数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | } else { |
| | | component.set('v.errorMessage', '产品用量最多输入14位数字!'); |
| | | //component.set('v.errorMessage', '产品用量最多输入14位数字!'); |
| | | this.error('产品用量最多输入14位数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | } |
| | |
| | | |
| | | downloadCSV: function (component, csv) { |
| | | var link = document.createElement('a'); |
| | | link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(csv); |
| | | var bom = "\uFEFF"; |
| | | link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | link.download = 'data.csv'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | }, |
| | | error: function (message) { |
| | | // $('toastMessage.forceToastManager').css('white-space', 'pre-wrap'); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type": "error", |
| | | //"duration" : "sticky" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | }) |