2个文件已删除
40个文件已修改
865个文件已添加
| | |
| | | { |
| | | "trailingComma": "none", |
| | | "singleQuote": true, |
| | | "tabWidth": 4, |
| | | "overrides": [ |
| | | { |
| | | "files": "**/lwc/**/*.html", |
| | | "options": { "parser": "lwc" } |
| | | "options": { |
| | | "parser": "lwc" |
| | | } |
| | | }, |
| | | { |
| | | "files": "**/*.{cls,trigger,apex}", |
| | | "options": { |
| | | "apexInsertFinalNewline": true, |
| | | "printWidth": 140 |
| | | } |
| | | }, |
| | | { |
| | | "files": "*.{cmp,page,component}", |
| | | "options": { "parser": "html" } |
| | | "options": { |
| | | "parser": "html" |
| | | } |
| | | } |
| | | ] |
| | | } |
| | |
| | | { |
| | | "target-org": "OlympusStageEnv" |
| | | } |
| | |
| | | "**/.sfdx": true |
| | | }, |
| | | "salesforcedx-vscode-core.show-cli-success-msg": false, |
| | | "open-in-browser.default": "{\"opn-in-browser.default\":\"Microsoft Edge\"}" |
| | | "open-in-browser.default": "{\"opn-in-browser.default\":\"Microsoft Edge\"}", |
| | | "salesforcedx-vscode-apex.java.home": "C:\\Users\\buli\\Documents\\Software\\JDK\\jdk19\\bin" |
| | | } |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <aura:component implements = "force:lightningQuickAction, force:hasRecordId" > |
| | | <c:createCaseTest recordId="{!v.recordId}" onclose="{!c.closeQA}"/> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | closeQA : function(component, event, helper) { |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| | |
| | | <br/> |
| | | <div class="save_button_area"> |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" onclick="{!c.createCancel}"/> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="新建" /> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="保存" /> |
| | | </div> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | console.log('zhj 新方案'); |
| | | if (window.location.href.endsWith("weekly-report")) { |
| | | helper.doinit(component, event, helper); |
| | | } else { |
| | |
| | | */ |
| | | |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : agencyHospitalid |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var data = JSON.stringify(arr); |
| | | var requestData = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set('v.login',true); |
| | | helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }) |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // var arr = new Array(); |
| | | // arr.push(agencyReport); |
| | | // var data = JSON.stringify(arr); |
| | | // // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | // var token = component.get('v.AWStoken'); |
| | | // var newUrl = component.get('v.AWSinsert'); |
| | | |
| | | // component.set('v.login',true); |
| | | // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }else{ |
| | |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status1 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | b = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('请重新刷新一下页面。'); |
| | | } |
| | | },component); |
| | | }else{ |
| | |
| | | b1 = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status3 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | |
| | | var reports = component.get('v.reports'); |
| | | var Agency_Hospital_text = ''; |
| | | var Agency_Hospital_parent_id = ''; |
| | | |
| | | debugger |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | |
| | | component.set('v.hospitalLinkId', hospital_data[i].Id); |
| | | component.set('v.data.Agency_Hospital__c', hospital_data[i].Id); |
| | | component.find('new_con').set('v.disabled', false); |
| | | //break; |
| | | } |
| | | } |
| | | component.set("v.hospital", accname); |
| | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper) { |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) { |
| | | |
| | | // AWSService.insert(newUrl,payload,function(result){ |
| | | // if(result.status == '0'){ |
| | |
| | | }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) |
| | |
| | | var action = component.get('c.saveAgencyContact'); |
| | | action.setParams({ |
| | | "name" : result.object[0].name, |
| | | "nameEncrypt" : result.object[0].nameEncrypt, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, |
| | | "type" : result.object[0].type, |
| | | "typeEncrypt" : result.object[0].typeEncrypt, |
| | | //"typeEncrypt" : result.object[0].typeEncrypt, |
| | | "doctorDivision1" : result.object[0].doctorDivision1, |
| | | "doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, |
| | | "agencyHospitalid" : agencyHospitalid, |
| | | "awsid" : result.object[0].dataId, |
| | | }); |
| | |
| | | if(result.status == '0'){ |
| | | this.to_doctor_list(result,retMap,component); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status4 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | // }); |
| | | }, |
| | | search_core : function(token,searchUrl,payload,callback,component) { |
| | | console.log('token = ' + token); |
| | | console.log('searchUrl = ' + searchUrl); |
| | | console.log('payload = ' + payload); |
| | | fetch(searchUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | component.set('v.login',false); |
| | | if(callback)callback(result); |
| | | }).catch(error => { |
| | | console.log('error = ' + JSON.stringify(error)); |
| | | this.error('AWS search error.'); |
| | | component.set('v.login',false); |
| | | }); |
| | |
| | | // }, |
| | | |
| | | opportunityChange : function(component, event, helper) { |
| | | debugger |
| | | var opp_id = component.get('v.data.Opportunity__c'); |
| | | if (opp_id == '') { |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | |
| | | // } |
| | | component.set('v.login',false); |
| | | return false; |
| | | } else if (res[0]['StageName2__c'] != '3.询价' && !component.get('v.loadOpp')){ |
| | | this.warning('请选择询价中的项目'); |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | $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'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // } else { |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy start |
| | | // else if (res[0]['StageName2__c'] != '3.询价' && !component.get('v.loadOpp')){ |
| | | // this.warning('请选择询价中的项目'); |
| | | // // ToDo需要测试手机上能运行不 |
| | | // component.set('v.data.Opportunity__c', ''); |
| | | // $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'); |
| | | // $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | // $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | // // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // // var values = []; |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // // } else { |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // // } |
| | | // component.set('v.login',false); |
| | | // return false; |
| | | // } |
| | | component.set('v.login',false); |
| | | return false; |
| | | } else { |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy end |
| | | else { |
| | | component.set('v.loadOpp', false); |
| | | component.set('v.oppdata',res[0]); |
| | | this.set_selected(component, 'select_stageName', res[0].StageName__c); |
| | |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | }, |
| | | setOpportunity_cfilter : function(component) { |
| | | debugger |
| | | var hosId = component.get('v.hospitalId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var opportunity_cfilter = ''; |
| | |
| | | fileData : component.get("v.fileContentData"), |
| | | }); |
| | | action1.setCallback(this, function(response) { |
| | | console.log('response = ' + JSON.stringify(response)); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var ress = response.getReturnValue(); |
| | | console.log('ress = ' + JSON.stringify(ress)); |
| | | if(ress){ |
| | | var valur =ress.split('error1'); |
| | | if(valur.length<=1){ |
| | | var res = JSON.parse(response.getReturnValue()); |
| | | console.log('res = ' + JSON.stringify(res)); |
| | | 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); |
| | | //dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); |
| | | dataMap.set(item.AWS_Data_Id__c,item.AWS_Data_Id__c); //zhj 新方案改造 2022-12-21 |
| | | } |
| | | }); |
| | | debugger |
| | |
| | | component.set('v.login',true); |
| | | this.saveRecordsEditFile(component,dataMap,result.object,helper); |
| | | }else{ |
| | | this.error('AWS search status ' ); |
| | | this.error('AWS search status5 ' ); |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status6 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | if (searchDataMap.get(fileName.replace(' ',''))) { |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ','')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[4] = dataMap.get(nameDataId); |
| | | filelist[4] = dataMap.get(nameDataId); //zhj 新方案改造 filelist[4]不再存的nameEncrpt 2022-12-21 |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人SF不存在'; |
| | | error += '='; |
| | |
| | | var modalimportbg = component.find('modal_exportbg'); |
| | | $A.util.addClass(modalimport, 'disp_none'); |
| | | $A.util.addClass(modalimportbg,'disp_none'); |
| | | }, |
| | | |
| | | //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 |
| | | |
| | | // searchAgencyContact : function(res) { |
| | | // var agencyContacts = []; |
| | |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Account> HosinfoList) { |
| | | List<Tender_information__c> TenInfoList = [Select Id, Hospital__c, Hospital1__c, Hospital2__c, Hospital3__c, |
| | | Hospital4__c from Tender_information__c |
| | | Where Hospital__c in: HosinfoList or Hospital1__c in: HosinfoList |
| | | or Hospital2__c in: HosinfoList or Hospital3__c in: HosinfoList |
| | | or Hospital4__c in: HosinfoList ]; |
| | | List<Tender_information__c> TenInfoList = [ |
| | | SELECT Id, Hospital__c, Hospital1__c, Hospital2__c, Hospital3__c, Hospital4__c |
| | | FROM Tender_information__c |
| | | WHERE |
| | | Hospital__c IN :HosinfoList |
| | | OR Hospital1__c IN :HosinfoList |
| | | OR Hospital2__c IN :HosinfoList |
| | | OR Hospital3__c IN :HosinfoList |
| | | OR Hospital4__c IN :HosinfoList |
| | | ]; |
| | | |
| | | if (TenInfoList.size() > 0) { |
| | | // List<Tender_information__c> failedTenderList = new List<Tender_information__c>(); |
| | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| | |
| | | public override List<String> getColumnFieldList() { |
| | | // strColumus 里加 field |
| | | // FixtureUtil#raesdGroupBy()の項目も必要 |
| | | return new List<String>{'Id', 'Rental_Apply_Equipment_Set__c', 'FSD_Id__c', 'Select_Time__c', 'Fixture_Model_No_F__c', |
| | | 'IndexFromUniqueKey__c', 'FSD_Fixture_Model_No__c', 'Is_Body_F__c', 'SalesProvince__c', 'OneToOne_Flag__c', |
| | | 'Rental_Apply__c', 'Rental_Apply__r.Salesdepartment__c', 'DeliverySlip__c', 'Is_Body__c', |
| | | 'Rental_Apply__r.Equipment_Type_F__c', 'Rental_Apply__r.Internal_asset_location_F__c', |
| | | 'Rental_Apply__r.Salesdept__c', 'Rental_Apply__r.Product_category__c', |
| | | 'Rental_Apply__r.demo_purpose2__c','Rental_Apply__r.Follow_UP_Opp__r.Shipping_Finished_Day_Func__c', |
| | | 'Rental_Apply__r.next_action__c','Rental_Apply__r.QIS_number__r.ReplaceDeliveryDate__c'}; |
| | | return new List<String>{ |
| | | 'Id', |
| | | 'Rental_Apply_Equipment_Set__c', |
| | | 'FSD_Id__c', |
| | | 'Select_Time__c', |
| | | 'Fixture_Model_No_F__c', |
| | | 'IndexFromUniqueKey__c', |
| | | 'FSD_Fixture_Model_No__c', |
| | | 'Is_Body_F__c', |
| | | 'SalesProvince__c', |
| | | 'OneToOne_Flag__c', |
| | | 'Rental_Apply__c', |
| | | 'Rental_Apply__r.Salesdepartment__c', |
| | | 'DeliverySlip__c', |
| | | 'Is_Body__c', |
| | | 'Rental_Apply__r.Equipment_Type_F__c', |
| | | 'Rental_Apply__r.Internal_asset_location_F__c', |
| | | 'Rental_Apply__r.Salesdept__c', |
| | | 'Rental_Apply__r.Product_category__c', |
| | | 'Rental_Apply__r.demo_purpose2__c', |
| | | 'Rental_Apply__r.Follow_UP_Opp__r.Shipping_Finished_Day_Func__c', |
| | | 'Rental_Apply__r.next_action__c', |
| | | 'Rental_Apply__r.QIS_number__r.ReplaceDeliveryDate__c' |
| | | }; |
| | | } |
| | | // 画面里直接可以输入的項目 List |
| | | public override List<String> getWritableColumnFieldList() { |
| | |
| | | public override String getSqlWhereStr() { |
| | | sqlWhereStr = ''; |
| | | return sqlWhereStr; |
| | | |
| | | } |
| | | |
| | | public override Boolean getIsNeedRunSearch() { |
| | |
| | | public String goAccessoryAdd { get; set; } |
| | | |
| | | /*****************検索用******************/ |
| | | |
| | | |
| | | /*****************ソート時再検索条件(画面からの入力条件を無視するため)******************/ |
| | | |
| | |
| | | // public String bieBiePinFenLei { get; set; } //别备品分类 |
| | | // #OLY_OCM-654 End |
| | | public Rental_Apply_Equipment_Set_Detail__c pageRaesd {get; set;} |
| | | |
| | | |
| | | public AccessorySelectController() { |
| | | Integer i = 0; |
| | |
| | | //借出备品一览の情報を取得 |
| | | if (!String.isBlank(this.parentId)) { |
| | | List<Rental_Apply_Equipment_Set__c> parentObjs = [ |
| | | SELECT Id, Rental_Apply__r.Name, |
| | | SELECT |
| | | Id, |
| | | Rental_Apply__r.Name, |
| | | Rental_Apply__r.Owner.Name, |
| | | Rental_Apply__r.Salesdept__c, |
| | | Rental_Apply__r.WorkPlace__c, |
| | |
| | | Rental_End_Date__c, |
| | | Irreplaceable_flag__c, |
| | | RequestNoJoinStr2__c, |
| | | First_RAESD__c, First_RAESD__r.Is_Body__c |
| | | First_RAESD__c, |
| | | First_RAESD__r.Is_Body__c |
| | | FROM Rental_Apply_Equipment_Set__c |
| | | where Id = :parentId]; |
| | | WHERE Id = :parentId |
| | | ]; |
| | | if(parentObjs.size()>0){ |
| | | parentObj = parentObjs.get(0); |
| | | String rsdid=System.label.Rental_Apply_id; |
| | | List<Rental_Apply_Equipment_Set_Detail__c> raesdObjs = [ |
| | | SELECT Id, Rental_Apply_Equipment_Set__c, |
| | | SELECT |
| | | Id, |
| | | Rental_Apply_Equipment_Set__c, |
| | | Cancel_Reason__c, // 20210817 ljh SFDC-C448KZ add |
| | | Loaner_cancel_reason__c,// 20210817 ljh SFDC-C448KZ add |
| | | Loaner_cancel_Remarks__c// 20210817 ljh SFDC-C448KZ add |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE Rental_Apply__c =:rsdid limit 1]; |
| | | WHERE Rental_Apply__c = :rsdid |
| | | LIMIT 1 |
| | | ]; |
| | | |
| | | if (!raesdObjs.isEmpty()) { |
| | | sonObj = raesdObjs[0]; |
| | | } |
| | | // 主体 or 第一条 |
| | | List<Rental_Apply_Equipment_Set_Detail__c> bodyObjs = [ |
| | | SELECT Id, Internal_asset_location_before__c, Salesdepartment_before__c, |
| | | Product_category_text__c, Equipment_Type_text__c, Select_Time__c |
| | | SELECT |
| | | Id, |
| | | Internal_asset_location_before__c, |
| | | Salesdepartment_before__c, |
| | | Product_category_text__c, |
| | | Equipment_Type_text__c, |
| | | Select_Time__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE Rental_Apply_Equipment_Set__c = :parentId |
| | | and Id =: parentObj.First_RAESD__c |
| | | and Cancel_Select__c = false]; |
| | | WHERE Rental_Apply_Equipment_Set__c = :parentId AND Id = :parentObj.First_RAESD__c AND Cancel_Select__c = FALSE |
| | | ]; |
| | | if (!bodyObjs.isEmpty()) { |
| | | if (bodyObjs[0].Select_Time__c != null) { |
| | | bieCunFangDi = bodyObjs[0].Internal_asset_location_before__c; |
| | |
| | | throw new ControllerUtil.myException('不能明确存放地, 请确认数据。'); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 20210817 ljh SFDC-C448KZ update end |
| | | } |
| | |
| | | bieBenBu = ''; |
| | | } |
| | | // #OLY_OCM-654 保有设备合并后,取出的第一条一览明细的本部可能为空,所以biebenbu为空时,也要添加检索条件 End |
| | | |
| | | } |
| | | |
| | | //别存放地 SelectOption |
| | | public List<SelectOption> getbieCunFangDiOps() { |
| | | return new List<SelectOption>{ |
| | | new SelectOption(bieCunFangDi, bieCunFangDi) |
| | | }; |
| | | return new List<SelectOption>{ new SelectOption(bieCunFangDi, bieCunFangDi) }; |
| | | } |
| | | |
| | | // #OLY_OCM-654 别本部 页面没有检索所以不改 SelectOption |
| | | public List<SelectOption> getbieBenBuOps() { |
| | | return new List<SelectOption>{ |
| | | new SelectOption(bieBenBu, bieBenBu) |
| | | }; |
| | | return new List<SelectOption>{ new SelectOption(bieBenBu, bieBenBu) }; |
| | | // return FixtureUtil.bieBenBuOpsMap.get('本部'); |
| | | } |
| | | |
| | | private void searchOppSetParam() { |
| | | |
| | | } |
| | | |
| | | public PageReference searchOpp() { |
| | |
| | | Rental_Apply_Equipment_Set_Detail__c robj = (Rental_Apply_Equipment_Set_Detail__c) wprInfo.sobj; |
| | | |
| | | // 状态只有是可以分配时才会保存 |
| | | if (FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Ke_Yi_Fen_Pei.ordinal()) == robj.Fu_Shu_Pin_Fen_Pei_Jia__c |
| | | if ( |
| | | FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Ke_Yi_Fen_Pei.ordinal()) == |
| | | robj.Fu_Shu_Pin_Fen_Pei_Jia__c |
| | | ) { |
| | | if (!String.isBlank(robj.Asset__c)) { |
| | | assetIdList.add(robj.Asset__c); |
| | |
| | | if (assetIdList.size() > 0) { |
| | | //20170906 upsert by UniqueKey__c |
| | | List<Rental_Apply_Equipment_Set_Detail__c> mfUpsert = new List<Rental_Apply_Equipment_Set_Detail__c>(); |
| | | Map<Id, Asset> aSetMap = new Map<Id, Asset>([ |
| | | Select Id, Quantity, |
| | | Map<Id, Asset> aSetMap = new Map<Id, Asset>( |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Quantity, |
| | | Out_of_wh__c, |
| | | Manage_type__c, |
| | | Ji_Zhong_Guan_Li_Ku_Cun__c, // 20220118 ljh SFDC-C9V84U start |
| | | Last_Reserve_RAES_Detail__c |
| | | From Asset |
| | | where Id = :assetIdList |
| | | for Update]); |
| | | FROM Asset |
| | | WHERE Id = :assetIdList |
| | | FOR UPDATE |
| | | ] |
| | | ); |
| | | Map<Id, Asset> assetUpdateMap = new Map<Id, Asset>(); |
| | | |
| | | // 状态只有是可以分配时才会保存 |
| | |
| | | } |
| | | Rental_Apply_Equipment_Set_Detail__c robj = (Rental_Apply_Equipment_Set_Detail__c) wprInfo.sobj; |
| | | //1822 yc 20211021 已购待货目的,新品已有发货日不能出库 start |
| | | if(robj.Rental_Apply__r.demo_purpose2__c=='已购待货' && robj.Rental_Apply__r.Follow_UP_Opp__r.Shipping_Finished_Day_Func__c!= null){ |
| | | if ( |
| | | robj.Rental_Apply__r.demo_purpose2__c == '已购待货' && |
| | | robj.Rental_Apply__r.Follow_UP_Opp__r.Shipping_Finished_Day_Func__c != null |
| | | ) { |
| | | throw new ControllerUtil.myException('已购待货目的,新品已有发货日,不能继续了'); |
| | | } |
| | | if(robj.Rental_Apply__r.demo_purpose2__c=='索赔QIS' && robj.Rental_Apply__r.next_action__c=='无偿更换' && robj.Rental_Apply__r.QIS_number__r.ReplaceDeliveryDate__c!= null){ |
| | | if ( |
| | | robj.Rental_Apply__r.demo_purpose2__c == '索赔QIS' && |
| | | robj.Rental_Apply__r.next_action__c == '无偿更换' && |
| | | robj.Rental_Apply__r.QIS_number__r.ReplaceDeliveryDate__c != null |
| | | ) { |
| | | throw new ControllerUtil.myException('索赔QIS目的,QIS已有新品发货日,不能继续了'); |
| | | } |
| | | //1822 yc 20211021 已购待货目的,新品已有发货日不能出库 end |
| | | // 可以分配の場合 (Asset__c 从 null 到 有值) |
| | | if (FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Ke_Yi_Fen_Pei.ordinal()) == robj.Fu_Shu_Pin_Fen_Pei_Jia__c |
| | | if ( |
| | | FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Ke_Yi_Fen_Pei.ordinal()) == |
| | | robj.Fu_Shu_Pin_Fen_Pei_Jia__c |
| | | ) { |
| | | Asset aSet = aSetMap.get(robj.Asset__c); |
| | | // 不能lock到数据的时候 |
| | |
| | | //assetUpdateMap.put(aSet.Id, aSet); |
| | | } |
| | | |
| | | String uniqueKeyStr = parentObj.RequestNoJoinStr2__c + ':'+ robj.Rental_Apply_Equipment_Set__c |
| | | + ':' + robj.FSD_Id__c + ':' + robj.IndexFromUniqueKey__c; |
| | | String uniqueKeyStr = |
| | | parentObj.RequestNoJoinStr2__c + |
| | | ':' + |
| | | robj.Rental_Apply_Equipment_Set__c + |
| | | ':' + |
| | | robj.FSD_Id__c + |
| | | ':' + |
| | | robj.IndexFromUniqueKey__c; |
| | | |
| | | robj.UniqueKey__c = uniqueKeyStr; |
| | | |
| | |
| | | *@return PageReference 刷新附属品选择页面 |
| | | */ |
| | | public PageReference unassign(){ |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | |
| | | try { |
| | |
| | | } |
| | | |
| | | // 加lock |
| | | Map<Id,Rental_Apply_Equipment_Set_Detail__c> raesdMap = new Map<Id,Rental_Apply_Equipment_Set_Detail__c>([ |
| | | SELECT Id |
| | | , Asset__c |
| | | , Select_Time__c |
| | | , StockDown_time__c |
| | | , Cancel_Date__c |
| | | , Fixture_OneToOne_Link_Id__c |
| | | Map<Id, Rental_Apply_Equipment_Set_Detail__c> raesdMap = new Map<Id, Rental_Apply_Equipment_Set_Detail__c>( |
| | | [ |
| | | SELECT Id, Asset__c, Select_Time__c, StockDown_time__c, Cancel_Date__c, Fixture_OneToOne_Link_Id__c |
| | | FROM Rental_Apply_Equipment_Set_Detail__c |
| | | WHERE Id in :raesdIdList |
| | | FOR UPDATE]); |
| | | WHERE Id IN :raesdIdList |
| | | FOR UPDATE |
| | | ] |
| | | ); |
| | | |
| | | if (raesdMap.size() > 0) { |
| | | Map<String, Rental_Apply_Equipment_Set_Detail__c> mfUpsert = new Map<String, Rental_Apply_Equipment_Set_Detail__c>(); |
| | | // 读取已分配的所有附属品 |
| | | Map<Id, Asset> aSetMap = new Map<Id, Asset>([ |
| | | Select Id, Quantity, |
| | | Out_of_wh__c, |
| | | Manage_type__c, |
| | | Last_Reserve_RAES_Detail__c |
| | | From Asset |
| | | where Id = :assetIdList |
| | | for Update]); |
| | | Map<Id, Asset> aSetMap = new Map<Id, Asset>( |
| | | [ |
| | | SELECT Id, Quantity, Out_of_wh__c, Manage_type__c, Last_Reserve_RAES_Detail__c |
| | | FROM Asset |
| | | WHERE Id = :assetIdList |
| | | FOR UPDATE |
| | | ] |
| | | ); |
| | | for (Integer indexNum = 0; indexNum < viewList.size(); indexNum++) { |
| | | // 对打勾的附属品取消分配 |
| | | WrapperInfo wprInfo = viewList[indexNum]; |
| | |
| | | // 备品管理编码(借出时) |
| | | robj.EquipmentSet_Managment_Code_text__c = null; |
| | | |
| | | String uniqueKeyStr = parentObj.RequestNoJoinStr2__c + ':'+ robj.Rental_Apply_Equipment_Set__c |
| | | + ':' + robj.FSD_Id__c + ':' + robj.IndexFromUniqueKey__c; |
| | | String uniqueKeyStr = |
| | | parentObj.RequestNoJoinStr2__c + |
| | | ':' + |
| | | robj.Rental_Apply_Equipment_Set__c + |
| | | ':' + |
| | | robj.FSD_Id__c + |
| | | ':' + |
| | | robj.IndexFromUniqueKey__c; |
| | | robj.UniqueKey__c = uniqueKeyStr; |
| | | |
| | | mfUpsert.put(robj.UniqueKey__c, robj); |
| | |
| | | if (!mfUpsert.isEmpty()) { |
| | | FixtureUtil.withoutUpsertRaesd(mfUpsert.values()); |
| | | } |
| | | |
| | | } |
| | | else{ |
| | | } else { |
| | | throw new ControllerUtil.myException('没有下架前已分配的附属品'); |
| | | } |
| | | } |
| | | catch (Exception ex) { |
| | | } catch (Exception ex) { |
| | | ApexPages.addMessages(ex); |
| | | Database.rollback(sp); |
| | | return null; |
| | |
| | | pg.getParameters().put('pt_recid',parentId); |
| | | pg.setRedirect(true); |
| | | return pg; |
| | | |
| | | |
| | | } |
| | | |
| | | // https://sohobb.backlog.jp/view/OLY_OCM-152#comment-20041467 |
| | |
| | | if (robj.CreatedBy.ProfileId == System.Label.ProfileId_EquipmentCenter && robj.Select_Time__c == null) { |
| | | // 删除明细Id<List> |
| | | delIds.add(robj.Id); |
| | | |
| | | } else { |
| | | if (String.isBlank(robj.Cancel_Reason__c)) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '请输入取消理由')); |
| | |
| | | robj.Cancel_Mem__c = UserInfo.getUserId(); |
| | | // 取消理由备注 |
| | | //robj.Loaner_cancel_Remarks__c |
| | | robj.Loaner_cancel_Remarks__c = robj.Loaner_cancel_Remarks__c==null ? robj.Loaner_cancel_reason__c : robj.Loaner_cancel_Remarks__c;//20210818 SFDC-C448KZ ljh end |
| | | robj.Loaner_cancel_Remarks__c = robj.Loaner_cancel_Remarks__c == null |
| | | ? robj.Loaner_cancel_reason__c |
| | | : robj.Loaner_cancel_Remarks__c; //20210818 SFDC-C448KZ ljh end |
| | | //※已经分配的場合 トリがでやります |
| | | //if(!String.isBlank(robj.Asset__c) && robj.Select_Time__c != null) { |
| | | //借出备品Set一览明细 trigger 里 clear Asset__c |
| | |
| | | raesds.add(robj); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | Map<String, List<Asset>> autoSelectMap = new Map<String, List<Asset>>(); |
| | | // 自动分配对象 |
| | | Map<String, List<Rental_Apply_Equipment_Set_Detail__c>> autoRsdMap = new Map<String, List<Rental_Apply_Equipment_Set_Detail__c>>(); |
| | | Map<Rental_Apply_Equipment_Set_Detail__c, Map<String, FixtureUtil.groupBean>> rsdMap = FixtureUtil.raesdGroupBy(selectedData, myComponentController.columus, bieWhere); |
| | | Map<Rental_Apply_Equipment_Set_Detail__c, Map<String, FixtureUtil.groupBean>> rsdMap = FixtureUtil.raesdGroupBy( |
| | | selectedData, |
| | | myComponentController.columus, |
| | | bieWhere |
| | | ); |
| | | // 選択済みの明细 |
| | | if (selectedData.size() > 0) { |
| | | for (Integer i = 0; i < selectedData.size(); i++) { |
| | |
| | | Integer index = rsdGroupInfo.get(apikey).gnum; |
| | | |
| | | if (!String.isBlank(rsdObj.Asset__c) && rsdObj.Select_Time__c != null) { |
| | | rsdObj.put(apikey, FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.assetFixtureStatus.Yi_Fen_Pei.ordinal())); |
| | | } |
| | | else { |
| | | rsdObj.put( |
| | | apikey, |
| | | FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.assetFixtureStatus.Yi_Fen_Pei.ordinal()) |
| | | ); |
| | | } else { |
| | | rsdObj.put(apikey, FixtureUtil.assetFixtureStatusMap.get(index)); |
| | | } |
| | | } |
| | |
| | | } else { |
| | | showButtonList.add(false); |
| | | // 可以分配の場合 |
| | | if (FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.assetFixtureStatus.Ke_Yi_Fen_Pei.ordinal()) == rsdObj.Fu_Shu_Pin_Fen_Pei_Jia__c) { |
| | | if ( |
| | | FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.assetFixtureStatus.Ke_Yi_Fen_Pei.ordinal()) == |
| | | rsdObj.Fu_Shu_Pin_Fen_Pei_Jia__c |
| | | ) { |
| | | if (!autoRsdMap.containsKey(rsdObj.FSD_Fixture_Model_No__c)) { |
| | | autoRsdMap.put(rsdObj.FSD_Fixture_Model_No__c, new List<Rental_Apply_Equipment_Set_Detail__c>()); |
| | | autoSelectMap.put(rsdObj.FSD_Fixture_Model_No__c, new List<Asset>()); |
| | |
| | | // 検索条件 |
| | | String dateToday = String.valueOf(Date.today()); |
| | | |
| | | String soql = 'SELECT Id, Fixture_Model_No_F__c, Pre_Arrival_wh_time__c, Ji_Zhong_Guan_Li_Ku_Cun__c,' |
| | | + ' SerialNumber, Salesdepartment__c, Internal_asset_location__c,' |
| | | + ' You_Xiao_Ku_Cun__c, Out_of_wh__c, Repairing_Count__c' |
| | | + ' FROM Asset' |
| | | + ' WHERE Asset_Owner__c = \'Olympus\' AND ' + FixtureUtil.getAssetSoqlBase() |
| | | + ' and Asset_loaner_category__c != \'耗材\'' |
| | | + ' and RecordTypeId = \'01210000000kOPR\'' |
| | | + ' and Loaner_accsessary__c = true' |
| | | + ' and Equipment_Type__c != \'检测用备品\'' |
| | | + ' and Delete_Flag__c = False' |
| | | + ' and Freeze_sign_Abandoned_Flag__c = False' |
| | | + ' and (Consumable_Guaranteen_end__c = null or Consumable_Guaranteen_end__c >=' + dateToday + ')' |
| | | + ' and Fixture_OneToOne_Link__c = null' // 附属品一对一的个体管理不能检索出来 |
| | | + ' and Internal_asset_location__c != null' |
| | | + ' and Product2.Fixture_Model_No_T__c IN :moset' |
| | | + bieWhere + |
| | | String soql = |
| | | 'SELECT Id, Fixture_Model_No_F__c, Pre_Arrival_wh_time__c, Ji_Zhong_Guan_Li_Ku_Cun__c,' + |
| | | ' SerialNumber, Salesdepartment__c, Internal_asset_location__c,' + |
| | | ' You_Xiao_Ku_Cun__c, Out_of_wh__c, Repairing_Count__c' + |
| | | ' FROM Asset' + |
| | | ' WHERE Asset_Owner__c = \'Olympus\' AND ' + |
| | | FixtureUtil.getAssetSoqlBase() + |
| | | ' and Asset_loaner_category__c != \'耗材\'' + |
| | | ' and RecordTypeId = \'01210000000kOPR\'' + |
| | | ' and Loaner_accsessary__c = true' + |
| | | ' and Equipment_Type__c != \'检测用备品\'' + |
| | | ' and Delete_Flag__c = False' + |
| | | ' and Freeze_sign_Abandoned_Flag__c = False' + |
| | | ' and (Consumable_Guaranteen_end__c = null or Consumable_Guaranteen_end__c >=' + |
| | | dateToday + |
| | | ')' + |
| | | ' and Fixture_OneToOne_Link__c = null' + // 附属品一对一的个体管理不能检索出来 |
| | | ' and Internal_asset_location__c != null' + |
| | | ' and Product2.Fixture_Model_No_T__c IN :moset' + |
| | | bieWhere + |
| | | + ' and Ji_Zhong_Guan_Li_Ku_Cun__c > 0' ; // 有集中管理库存的 |
| | | soql += ' ORDER BY Product2.Fixture_Model_No_T__c, Consumable_Guaranteen_end__c ASC NULLS LAST, Ji_Zhong_Guan_Li_Ku_Cun__c DESC, Pre_Arrival_wh_time__c ASC NULLS FIRST, Id DESC'; |
| | | |
| | |
| | | } |
| | | } |
| | | if (String.isBlank(rsdObj.Asset__c)) { |
| | | rsdObj.put('Fu_Shu_Pin_Fen_Pei_Jia__c', FixtureUtil.assetFixtureStatusMap.get( |
| | | FixtureUtil.AssetFixtureStatus.Mei_You_Ku_Cun.ordinal())); |
| | | rsdObj.put( |
| | | 'Fu_Shu_Pin_Fen_Pei_Jia__c', |
| | | FixtureUtil.assetFixtureStatusMap.get(FixtureUtil.AssetFixtureStatus.Mei_You_Ku_Cun.ordinal()) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | @RestResource(urlMapping='/CPL003/*') |
| | | global with sharing class CPL003Rest { |
| | | |
| | | global class GeDatas { |
| | | webservice NFMUtil.Monitoring Monitoring; |
| | | webservice CPL003Rest.GeData[] Inventory; |
| | | webService NFMUtil.Monitoring Monitoring; |
| | | webService CPL003Rest.GeData[] Inventory; |
| | | } |
| | | |
| | | global class GeData { |
| | | webservice String MaterialNumber; //产品编码(产品代码) |
| | | webservice String ItemQuantity; //OpenPO和库存的总数量 |
| | | webService String MaterialNumber; //产品编码(产品代码) |
| | | webService String ItemQuantity; //OpenPO和库存的总数量 |
| | | |
| | | webservice String Area; //区域(待定) |
| | | webService String Area; //区域(待定) |
| | | //webservice String other1; |
| | | //webservice String other2; |
| | | //webservice String other3; |
| | |
| | | return; |
| | | } |
| | | |
| | | |
| | | @future |
| | | global static void executefuture(String rowData_Id) { |
| | | main(rowData_Id); |
| | |
| | | |
| | | global static void main(String rowData_Id) { |
| | | Integer batch_retry_max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt); |
| | | BatchIF_Log__c rowData = [Select Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c,retry_cnt__c from BatchIF_Log__c where RowDataFlg__c = true and Id = :rowData_Id]; |
| | | MDMITMWebService.isRunning = true; |
| | | BatchIF_Log__c rowData = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | retry_cnt__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = TRUE AND Id = :rowData_Id |
| | | ]; |
| | | //MDMITMWebService.isRunning = true; //Commented By Li Jun 20230428 |
| | | String logstr = rowData.MessageGroupNumber__c + ' start\n'; |
| | | BatchIF_Log__c iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'CPL003'; |
| | |
| | | List<String> materialNumberList = new List<String>(); |
| | | |
| | | for (GeData GeData : itemMasterList) { |
| | | if (String.isBlank(GeData.MaterialNumber)) continue; |
| | | if (String.isBlank(GeData.ItemQuantity)) continue; |
| | | if (String.isBlank(GeData.MaterialNumber)) |
| | | continue; |
| | | if (String.isBlank(GeData.ItemQuantity)) |
| | | continue; |
| | | materialNumberList.add(GeData.MaterialNumber); |
| | | } |
| | | |
| | | List<Product2> product2List = [select Id, ProductCode, StorageStatusNo__c |
| | | from Product2 |
| | | where ProductCode in :materialNumberList ]; |
| | | List<Product2> product2List = [ |
| | | SELECT Id, ProductCode, StorageStatusNo__c |
| | | FROM Product2 |
| | | WHERE ProductCode IN :materialNumberList |
| | | ]; |
| | | |
| | | Map<String,Product2> product2Map = new Map<String,Product2>(); |
| | | for (Product2 product2 : product2List) { |
| | |
| | | Map<String,Product2> prdUpdateMap = new Map<String, Product2>(); |
| | | |
| | | for (GeData GeData : itemMasterList) { |
| | | |
| | | if (String.isBlank(GeData.MaterialNumber)) { |
| | | iflog.ErrorLog__c += 'MaterialNumber is required.\n'; |
| | | continue; |
| | |
| | | Product2 product = product2Map.get(GeData.MaterialNumber); |
| | | product.StorageStatusNo__c = Double.valueOf(GeData.ItemQuantity); |
| | | upsertProList.add(product); |
| | | |
| | | } else { |
| | | iflog.ErrorLog__c += 'This MaterialNumber [ ' + GeData.MaterialNumber + ' ] is not Exist.\n'; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | if(upsertProList.size() > 0) upsert upsertProList; |
| | | if (upsertProList.size() > 0) |
| | | upsert upsertProList; |
| | | |
| | | logstr += '\nend'; |
| | | rowData.retry_cnt__c=0; |
| | |
| | | Database.rollback(sp); |
| | | logstr += '\n' + ex.getMessage(); |
| | | iflog.ErrorLog__c = ex.getMessage() + '\n' + ex.getStackTraceString() + '\n' + iflog.ErrorLog__c; |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c == null) |
| | | rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt){ |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt){ |
| | | rowData.ErrorLog__c = ex.getMessage() + '\n' + ex.getStackTraceString() + '\n' + rowData.ErrorLog__c+'错误次数已经超过自动收信设定的最大次数,请手动收信'; |
| | | rowData.ErrorLog__c = |
| | | ex.getMessage() + |
| | | '\n' + |
| | | ex.getStackTraceString() + |
| | | '\n' + |
| | | rowData.ErrorLog__c + |
| | | '错误次数已经超过自动收信设定的最大次数,请手动收信'; |
| | | } |
| | | } |
| | | |
| | |
| | | return (coc.Name); |
| | | } |
| | | // 精琢科技 zxk 2021-11-03 存放消耗品明细 end |
| | | public List < Consumable_Orderdetails__c > conoList { |
| | | get; |
| | | set; |
| | | } |
| | | public List<Consumable_Orderdetails__c> conoList { get; set; } |
| | | // 精琢科技 zxk 2021-11-03 存放消耗品明细 end |
| | | |
| | | public String shipmentAccount{ |
| | |
| | | //发票明细1(出库单) |
| | | private List<Consumable_order__c> invoiceOrderSelectedList = new List<Consumable_order__c>(); |
| | | |
| | | |
| | | |
| | | Map<String,Decimal> ordermx1defaultMap = new Map<String,Decimal>(); |
| | | //出库单汇总金额 from 发票明细1 |
| | | Map<String,Decimal> outorderMoneytMap = new Map<String,Decimal>(); |
| | |
| | | } |
| | | } |
| | | |
| | | list<Dealer_elationship__c> Dealerelationship = new list<Dealer_elationship__c>(); |
| | | list<Dealer_elationship__c> Dealerelationship = new List<Dealer_elationship__c>(); |
| | | //排序使用 |
| | | private String[] orderby = new String[]{ 'Outbound_Date__c','Name','ShipmentAccount__c'}; |
| | | private String[] orderby = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' }; |
| | | public String sortKey { get; set; } |
| | | public String preSortKey { get; private set; } |
| | | public Boolean sortOrderAsc { get; private set; } |
| | |
| | | this.sortKey = '1'; |
| | | this.preSortKey = '1'; |
| | | this.sortOrderAsc = false; |
| | | this.sortOrder = new String[2]; |
| | | this.sortOrder = new String[]{' ',' ',' ',' '}; |
| | | this.sortOrder = new List<String>(2); |
| | | this.sortOrder = new List<String>{ ' ', ' ', ' ', ' ' }; |
| | | |
| | | if(invoiceId!=null && invoiceId!='' && (statusEdit==''|| statusEdit==null)){ |
| | | editAble = false; |
| | |
| | | } |
| | | userId = UserInfo.getUserId(); |
| | | //userId = '00510000005QQ35'; |
| | | List<user> Useracc = New List<user>(); |
| | | List<user> Useracc = new List<user>(); |
| | | Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id = :userId ]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | |
| | | } |
| | | coc = new Consumable_order__c(); |
| | | |
| | | Dealerelationship = [SELECT Dealer_subordinate__c,Dealer_subordinate__r.Name FROM Dealer_elationship__c WHERE Dealer_principal__c =:accountid ]; |
| | | Dealerelationship = [ |
| | | SELECT Dealer_subordinate__c, Dealer_subordinate__r.Name |
| | | FROM Dealer_elationship__c |
| | | WHERE Dealer_principal__c = :accountid |
| | | ]; |
| | | List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>(); |
| | | AgencyHospitalLink = [select Id, Name, Hospital__c, Hospital__r.Id, Hospital__r.Name, Agency__c |
| | | from Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountId]; |
| | | AgencyHospitalLink = [ |
| | | SELECT Id, Name, Hospital__c, Hospital__r.Id, Hospital__r.Name, Agency__c |
| | | FROM Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountId |
| | | ]; |
| | | // 新規 |
| | | if (invoiceId== NULL || invoiceId=='') { |
| | | if (deliveryId== NULL || deliveryId=='') { |
| | | if (invoiceId == null || invoiceId == '') { |
| | | if (deliveryId == null || deliveryId == '') { |
| | | String msoql = makeSoql(); |
| | | invoiceOrderList = Database.query(msoql); |
| | | for(Integer i = 0; i < invoiceOrderList.size(); i++){ |
| | |
| | | }else if(statusEdit!=''&&statusEdit!=null){ |
| | | EditAble = true; |
| | | } |
| | | coc = [SELECT Id,Name, |
| | | coc = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Invoice_status__c, |
| | | Invoice_Date__c, |
| | | Order_ForDealerText__c, |
| | |
| | | Invoicedet_attachment__c, |
| | | Outbound_order__c |
| | | FROM Consumable_order__c |
| | | WHERE Id =:deliveryId]; |
| | | WHERE Id = :deliveryId |
| | | ]; |
| | | coc.Name = ''; |
| | | if(coc.Order_ForDealer__c != null){ |
| | | SecondDealer = coc.Order_ForDealer__c; |
| | |
| | | } |
| | | |
| | | //发票关联出库单取得(出库单) |
| | | invoiceOrderSelectedList = [SELECT Id, |
| | | invoiceOrderSelectedList = [ |
| | | SELECT |
| | | Id, |
| | | Order_ForDealer__r.Name, |
| | | Order_ForHospital__r.Name, |
| | | Order_ForDealerText__c, |
| | | Name,Outbound_Date__c, |
| | | Name, |
| | | Outbound_Date__c, |
| | | ShipmentAccount__c, |
| | | Order_Dealer_Info__c, |
| | | SummonsForDirction__c, |
| | |
| | | Billed_Status__c |
| | | FROM Consumable_order__c |
| | | WHERE Id = :deliveryId |
| | | order by Name ]; |
| | | ORDER BY Name |
| | | ]; |
| | | for(Integer i = 0; i < invoiceOrderSelectedList.size(); i++){ |
| | | invoiceOrderRecoeds.add(new InvoiceOrderInfo(invoiceOrderSelectedList[i])); |
| | | } |
| | | } |
| | | }else{ |
| | | coc = [SELECT Id,Name, |
| | | coc = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Invoice_status__c, |
| | | Invoice_Date__c, |
| | | Order_ForDealerText__c, |
| | |
| | | Invoicedet_attachment__c, |
| | | Outbound_order__c |
| | | FROM Consumable_order__c |
| | | WHERE Id =:invoiceId |
| | | AND Order_type__c = '发票']; |
| | | WHERE Id = :invoiceId AND Order_type__c = '发票' |
| | | ]; |
| | | if(coc.Order_ForDealer__c != null){ |
| | | SecondDealer = coc.Order_ForDealer__c; |
| | | } |
| | |
| | | HospitalName = coc.Order_ForHospital__r.Name; |
| | | } |
| | | //到链接表中查找关联出库单 |
| | | List<Consumable_order_LinkTable__c> outOrderList = [SELECT Outboundorder_Code_link__c |
| | | List<Consumable_order_LinkTable__c> outOrderList = [ |
| | | SELECT Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Invoice_Code_link__c = :invoiceId]; |
| | | WHERE Invoice_Code_link__c = :invoiceId |
| | | ]; |
| | | for(Integer i = 0; i < outOrderList.size(); i++){ |
| | | outOrderStringList.add(outOrderList[i].Outboundorder_Code_link__c); |
| | | } |
| | | //取得出库单信息 |
| | | invoiceOrderSelectedList = [SELECT Id, |
| | | invoiceOrderSelectedList = [ |
| | | SELECT |
| | | Id, |
| | | Order_ForDealer__r.Name, |
| | | Order_ForHospital__r.Name, |
| | | Order_ForDealerText__c, |
| | | Name,Outbound_Date__c, |
| | | Name, |
| | | Outbound_Date__c, |
| | | ShipmentAccount__c, |
| | | Shipment_total_amount__c, |
| | | RrturnPro_total_amount__c, |
| | |
| | | Invoice_total_amount__c, |
| | | Billed_Status__c |
| | | FROM Consumable_order__c |
| | | WHERE Id in :outOrderStringList |
| | | AND Order_Owner_WorkLocal__c =: userWorkLocation |
| | | order by Name ]; |
| | | WHERE Id IN :outOrderStringList AND Order_Owner_WorkLocal__c = :userWorkLocation |
| | | ORDER BY Name |
| | | ]; |
| | | for(Integer i = 0; i < invoiceOrderSelectedList.size(); i++){ |
| | | outorderMoneytMap.put(invoiceOrderSelectedList[i].id, 0); |
| | | invoiceOrderRecoeds.add(new InvoiceOrderInfo(invoiceOrderSelectedList[i])); |
| | |
| | | if(String.isNotBlank(deliveryId)){ |
| | | //发票关联出库单取得(出库单) |
| | | isChange = true; |
| | | invoiceOrderSelectedList = [SELECT Id, |
| | | invoiceOrderSelectedList = [ |
| | | SELECT |
| | | Id, |
| | | Order_ForDealer__r.Name, |
| | | Order_ForHospital__r.Name, |
| | | Order_ForDealerText__c, |
| | | Name,Outbound_Date__c, |
| | | Name, |
| | | Outbound_Date__c, |
| | | ShipmentAccount__c, |
| | | Shipment_total_amount__c, |
| | | RrturnPro_total_amount__c, |
| | |
| | | Invoice_total_amount__c, |
| | | Billed_Status__c |
| | | FROM Consumable_order__c |
| | | WHERE Id = :deliveryId |
| | | AND Order_Owner_WorkLocal__c =: userWorkLocation |
| | | order by Name ]; |
| | | WHERE Id = :deliveryId AND Order_Owner_WorkLocal__c = :userWorkLocation |
| | | ORDER BY Name |
| | | ]; |
| | | for(Integer i = 0; i < invoiceOrderSelectedList.size(); i++){ |
| | | if(!outorderMoneytMap.containsKey(invoiceOrderSelectedList[i].Id)){ |
| | | invoiceOrderRecoeds.add(new InvoiceOrderInfo(invoiceOrderSelectedList[i])); |
| | |
| | | } |
| | | } |
| | | //发票明细一览 |
| | | List<Consumable_Orderdetails__c> countDel = [SELECT Id, |
| | | List<Consumable_Orderdetails__c> countDel = [ |
| | | SELECT |
| | | Id, |
| | | Consumable_ZS_order__c, |
| | | Name, |
| | | Consumable_order__c, |
| | |
| | | ProductPacking_list_manual__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :invoiceId |
| | | order by Invoicedet1_OD_link__c]; |
| | | ORDER BY Invoicedet1_OD_link__c |
| | | ]; |
| | | if(countDel.size()>0){ |
| | | for (Integer i = 0; i < countDel.size(); i++) { |
| | | outordercountMap.put(countDel[i].Invoicedet1_OD_link__c + countDel[i].Asset_Model_No__c,countDel[i]); |
| | | if(outorderMoneytMap.containsKey(countDel[i].Invoicedet1_OD_link__c)){ |
| | | outorderMoneytMap.put(countDel[i].Invoicedet1_OD_link__c,outorderMoneytMap.get(countDel[i].Invoicedet1_OD_link__c) + countDel[i].InvoicedProCost_RMB__c); |
| | | outorderMoneytMap.put( |
| | | countDel[i].Invoicedet1_OD_link__c, |
| | | outorderMoneytMap.get(countDel[i].Invoicedet1_OD_link__c) + countDel[i].InvoicedProCost_RMB__c |
| | | ); |
| | | } |
| | | invoiceOrderdetail1Recoeds.add(new InvoiceOrderInfo(countDel[i])); |
| | | } |
| | |
| | | if(SecondDealer==null||SecondDealer==''){ |
| | | provinceOpts.add(new SelectOption('', '-无-')); |
| | | for(Integer i = 0; i < Dealerelationship.size(); i++){ |
| | | provinceOpts.add(new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name)); |
| | | provinceOpts.add( |
| | | new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name) |
| | | ); |
| | | } |
| | | }else{ |
| | | provinceOpts.add(new SelectOption('', '-无-')); |
| | |
| | | } |
| | | for(Integer i = 0; i < Dealerelationship.size(); i++){ |
| | | if(Dealerelationship[i].Dealer_subordinate__r.Name != SecondDealer){ |
| | | provinceOpts.add(new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name)); |
| | | provinceOpts.add( |
| | | new SelectOption(Dealerelationship[i].Dealer_subordinate__c, Dealerelationship[i].Dealer_subordinate__r.Name) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | |
| | | Map<String,String> consumableaccessoriesMap = new Map<String,String>(); |
| | | Map<String,String> invorceOrderIdMap = new Map<String,String>(); |
| | | List<Consumable_accessories_invoice__c> consumableaccessories =[SELECT Id, Name,Attachment_ID__c,Accessories_type__c FROM Consumable_accessories_invoice__c WHERE Invoice_code__c =:invoiceId ]; |
| | | List<Consumable_accessories_invoice__c> consumableaccessories = [ |
| | | SELECT Id, Name, Attachment_ID__c, Accessories_type__c |
| | | FROM Consumable_accessories_invoice__c |
| | | WHERE Invoice_code__c = :invoiceId |
| | | ]; |
| | | System.debug('consumableaccessories = ' + consumableaccessories); |
| | | if(consumableaccessories.size()>0){ |
| | | for (Integer i = 0; i < consumableaccessories.size(); i++) { |
| | | consumableaccessoriesMap.put(consumableaccessories[i].Attachment_ID__c,consumableaccessories[i].Accessories_type__c); |
| | |
| | | // 保存附件 |
| | | public PageReference saveAttachment() { |
| | | Consumable_accessories_invoice__c attachmentdetails = new Consumable_accessories_invoice__c(); |
| | | System.debug('AttachmentRecoeds = ' + AttachmentRecoeds); |
| | | for (InvoiceOrderInfo ass : AttachmentRecoeds) { |
| | | if(!String.isBlank(ass.mailSelectOptsin)){ |
| | | attachmentdetails.Id = ass.invoiceOrderId; |
| | |
| | | } |
| | | // 保存按钮 |
| | | public PageReference save() { |
| | | System.debug('enter ConInvoiceViewController.save success'); |
| | | List<String> chukudanID = new List<String>(); |
| | | // 画面录入项判断 |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, 'HospitalInfo +++++' + HospitalInfo + '-----' + HospitalName)); |
| | | //return null; |
| | | if(coc.Name ==''||coc.Name == null){ |
| | | coc.Name.addError('请录入发票号。'); |
| | | return null; |
| | |
| | | coc.addError('必须输入客户名或者二级经销商。'); |
| | | return null; |
| | | } |
| | | /*if(String.isBlank(HospitalInfo) && SecondDealer != null && coc.Order_ForDealerText__c != null){ |
| | | coc.Order_ForDealerText__c.addError('请输入二级经销商或者经销商(录入)。'); |
| | | return null; |
| | | }*/ |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-08-26 start |
| | | /* if(HospitalInfo !=null && HospitalInfo !='' && SecondDealer != null && coc.Order_ForDealerText__c != null){ |
| | | coc.addError('请输入客户名、二级经销商和经销商(录入)只可输入一个。'); |
| | | return null; |
| | | } |
| | | */ |
| | | if (HospitalInfo != null && HospitalInfo != '' && SecondDealer != null) { |
| | | coc.addError('请输入客户名、二级经销商只可输入一个。'); |
| | | |
| | | } |
| | | /* if(HospitalInfo !=null && HospitalInfo !='' && (SecondDealer != null || coc.Order_ForDealerText__c != null)){ |
| | | coc.addError('请输入客户名、二级经销商和经销商(录入)只可输入一个。'); |
| | |
| | | } |
| | | } |
| | | if(SecondDealer != null){ |
| | | if(ass.esd.Order_ForDealer__c != shipmentAccountString && ass.esd.Order_ForDealerText__c != shipmentAccountString){ |
| | | if ( |
| | | ass.esd.Order_ForDealer__c != shipmentAccountString && |
| | | ass.esd.Order_ForDealerText__c != shipmentAccountString |
| | | ) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, shipmentAccountString + ass.esd.Order_ForDealer__c + ass.esd.Order_ForDealerText__c)); |
| | | invoiceOrderAccountList.add(ass.esd.Name); |
| | | } |
| | |
| | | // if(coc.Order_ForDealerText__c != null){ |
| | | if(coc.Order_ForDealerText__c != null && (HospitalInfo == null || HospitalInfo == '' )){ |
| | | //update by rentx 2021-2-24 CHAN-BYH9PK end |
| | | if((ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') && ass.esd.ShipmentAccount__c != shipmentAccountString){ |
| | | if ( |
| | | (ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') && |
| | | ass.esd.ShipmentAccount__c != shipmentAccountString |
| | | ) { |
| | | invoiceOrderAccountList.add(ass.esd.Name); |
| | | } |
| | | } |
| | |
| | | // if(coc.Order_ForDealerText__c != null){ |
| | | if(coc.Order_ForDealerText__c != null && (HospitalInfo == null || HospitalInfo == '' )){ |
| | | //update by rentx 2021-2-24 CHAN-BYH9PK end |
| | | if((ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') && ass.esd.ShipmentAccount__c != shipmentAccountString){ |
| | | if ( |
| | | (ass.esd.Order_ForDealerText__c != null || ass.esd.Order_ForDealerText__c != '') && |
| | | ass.esd.ShipmentAccount__c != shipmentAccountString |
| | | ) { |
| | | invoiceOrderAccountList.add(ass.esd.Name); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | Consumable_order__c invoiceHead = new Consumable_order__c(); |
| | | List<String> outOrderIdList = New List<String>(); |
| | | List<Consumable_order_LinkTable__c> invoiceLinkList = New List<Consumable_order_LinkTable__c>(); |
| | | List<String> outOrderIdList = new List<String>(); |
| | | List<Consumable_order_LinkTable__c> invoiceLinkList = new List<Consumable_order_LinkTable__c>(); |
| | | Map<String,String> insertDetMap = new Map<String,String>(); |
| | | Map<String,String> deleteDetMap = new Map<String,String>(); |
| | | //新建发票时 |
| | |
| | | try{ |
| | | if(String.isBlank(invoiceId)){ |
| | | invoiceHead.Name = coc.Name; |
| | | if(coc.Invoice_status__c ==null||String.isBlank(coc.Invoice_status__c))coc.Invoice_status__c ='草案中'; |
| | | if (coc.Invoice_status__c == null || String.isBlank(coc.Invoice_status__c)) |
| | | coc.Invoice_status__c = '草案中'; |
| | | invoiceHead.Order_type__c = '发票'; |
| | | invoiceHead.Invoice_Date__c = coc.Invoice_Date__c; |
| | | invoiceHead.Dealer_Info__c = accountid; |
| | |
| | | insert invoiceHead; |
| | | |
| | | invoiceId = invoiceHead.Id ; |
| | | List<Consumable_order__c> cocinfo = New List<Consumable_order__c>(); |
| | | cocinfo = [SELECT Id,Name, |
| | | List<Consumable_order__c> cocinfo = new List<Consumable_order__c>(); |
| | | cocinfo = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Invoice_status__c, |
| | | Invoice_Date__c, |
| | | Order_ForDealerText__c, |
| | |
| | | Invoicedet_attachment__c, |
| | | Outbound_order__c |
| | | FROM Consumable_order__c |
| | | WHERE Id =:invoiceId]; |
| | | WHERE Id = :invoiceId |
| | | ]; |
| | | if (cocinfo.size()>0){ |
| | | invoiceHead = cocinfo[0]; |
| | | } |
| | |
| | | //return null; |
| | | if(insertDetMap.size() > 0 ){ |
| | | for (String field : insertDetMap.keySet()) { |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [SELECT Id FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c = :field |
| | | AND Invoice_Code_link__c = :insertDetMap.get(field)]; |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [ |
| | | SELECT Id |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c = :field AND Invoice_Code_link__c = :insertDetMap.get(field) |
| | | ]; |
| | | if(existLinkinfo.size() < 1){ |
| | | Consumable_order_LinkTable__c invoiceLink = new Consumable_order_LinkTable__c(); |
| | | invoiceLink.Name = field + insertDetMap.get(field); |
| | |
| | | } |
| | | delete invoiceLinkdetList; |
| | | }*/ |
| | | } |
| | | } else if (String.isNotBlank(reopen) && reopen.equals('isreopen') && String.isNotBlank(invoiceId)) { |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-09-04 start |
| | | else if (String.isNotBlank(reopen) && reopen.equals('isreopen') && String.isNotBlank(invoiceId)) { |
| | | //如果是 作废重开 |
| | | //1. 设置新发票信息 |
| | | invoiceHead.Name = coc.Name; |
| | |
| | | invoiceHead.Order_ForDealer__c = SecondDealer; |
| | | } |
| | | invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c; |
| | | System.debug('invoiceHead = ' + invoiceHead); |
| | | insert invoiceHead; |
| | | |
| | | List<String> updateChukudanId = new List<String>(); |
| | | //获取原发票相关联的链接表信息 |
| | | List<Consumable_order_LinkTable__c> tLinkList = [SELECT Outboundorder_Code_link__c |
| | | List<Consumable_order_LinkTable__c> tLinkList = [ |
| | | SELECT Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Invoice_Code_link__c = :invoiceId]; |
| | | WHERE Invoice_Code_link__c = :invoiceId |
| | | ]; |
| | | |
| | | for(Consumable_order_LinkTable__c colc : tLinkList){ |
| | | colc.Invoice_Code_link__c = invoiceHead.Id; |
| | | updateChukudanId.add(colc.Outboundorder_Code_link__c); |
| | | } |
| | | System.debug('tLinkList = ' + tLinkList); |
| | | update tLinkList; |
| | | //更新发票明细信息 |
| | | //获取出库单,设置关联关系 |
| | |
| | | |
| | | Map<String,Consumable_Orderdetails__c> tempCocMap = new Map<String,Consumable_Orderdetails__c>(); |
| | | List<Consumable_Orderdetails__c> tempCountList = [ |
| | | SELECT Id,Consumable_order__c,Asset_Model_No__c,InvoicedProCost_RMB__c, Invoicedet1_OD_link__c ,InvoicedProduct_RMB__c,Invoiced_Procount__c,Invoiced_BoxCount__c,Invoice_Unit__c |
| | | FROM Consumable_Orderdetails__c WHERE Consumable_order__c = :invoiceId]; |
| | | SELECT |
| | | Id, |
| | | Consumable_order__c, |
| | | Asset_Model_No__c, |
| | | InvoicedProCost_RMB__c, |
| | | Invoicedet1_OD_link__c, |
| | | InvoicedProduct_RMB__c, |
| | | Invoiced_Procount__c, |
| | | Invoiced_BoxCount__c, |
| | | Invoice_Unit__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :invoiceId |
| | | ]; |
| | | for(Consumable_Orderdetails__c cocTemp : tempCountList){ |
| | | cocTemp.Consumable_order__c = invoiceHead.Id; |
| | | tempCocMap.put(cocTemp.Invoicedet1_OD_link__c +cocTemp.Asset_Model_No__c, cocTemp); |
| | | } |
| | | System.debug('tempCountList = ' + tempCountList); |
| | | update tempCountList; |
| | | List<Consumable_Orderdetails__c> updateFromList = [ |
| | | SELECT |
| | |
| | | Shipment_amount__c, |
| | | Asset_Model_No__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c in : updateChukudanId |
| | | WHERE Consumable_order__c IN :updateChukudanId |
| | | ]; |
| | | for(Consumable_Orderdetails__c corderc : updateFromList){ |
| | | String tempStr = corderc.Consumable_order__c + corderc.Asset_Model_No__c; |
| | |
| | | corderc.Invoice_Unitprice__c = corderc.Delivery_List_RMB__c; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | Consumable_order__c tempcoc = new Consumable_order__c(); |
| | | tempcoc.Id = invoiceId; |
| | | System.debug('tempcoc = ' + tempcoc); |
| | | delete tempcoc; |
| | | invoiceId = invoiceHead.Id; |
| | | System.debug('updateFromList = ' + updateFromList); |
| | | update updateFromList; |
| | | //-------------------------------------------------------------------------- |
| | | for (InvoiceOrderInfo ass : invoiceOrderRecoeds) { |
| | |
| | | } |
| | | //被选中的出库单集合 |
| | | if(insertDetMap.size() > 0 ){ |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = |
| | | [SELECT Id,Invoice_Code_link__c,Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c WHERE Outboundorder_Code_link__c in :insertDetMap.keySet() |
| | | AND Invoice_Code_link__c = :invoiceHead.Id]; |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [ |
| | | SELECT Id, Invoice_Code_link__c, Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c IN :insertDetMap.keySet() AND Invoice_Code_link__c = :invoiceHead.Id |
| | | ]; |
| | | //存在没有与发票建立关联关系的出库单 |
| | | List<String> templist2 = new List<String>(); |
| | | for(Consumable_order_LinkTable__c colc : existLinkinfo){ |
| | |
| | | invoiceLinkList.add(invoiceLink); |
| | | } |
| | | } |
| | | System.debug('invoiceLinkList = ' + invoiceLinkList); |
| | | upsert invoiceLinkList; |
| | | |
| | | } |
| | | //删除出库单链接表 |
| | | if(deleteDetMap.size() > 0 ){ |
| | | |
| | | List<Consumable_order_LinkTable__c> invoiceLinkdetList = New List<Consumable_order_LinkTable__c>(); |
| | | List<Consumable_order_LinkTable__c> invoiceLinkdetList = new List<Consumable_order_LinkTable__c>(); |
| | | deleteOutboundorder(deleteDetMap,invoiceHead.Id); |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [SELECT Id,Outboundorder_Code_link__c,Invoice_Code_link__c FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c in :deleteDetMap.keySet() |
| | | AND Invoice_Code_link__c = :invoiceHead.Id]; |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [ |
| | | SELECT Id, Outboundorder_Code_link__c, Invoice_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c IN :deleteDetMap.keySet() AND Invoice_Code_link__c = :invoiceHead.Id |
| | | ]; |
| | | for(Consumable_order_LinkTable__c colctemp : existLinkinfo){ |
| | | if (deleteDetMap.get(colctemp.Outboundorder_Code_link__c) == colctemp.Invoice_Code_link__c) { |
| | | //存在与该发票关联的出库单 |
| | | invoiceLinkdetList.add(colctemp); |
| | | } |
| | | } |
| | | System.debug('invoiceLinkdetList = ' + invoiceLinkdetList); |
| | | delete invoiceLinkdetList; |
| | | } |
| | | //新建发票明细1 |
| | | if(chukudanID.size() > 0 ){ |
| | | newinvoicedetails1(chukudanID); |
| | | } |
| | | } |
| | | } else { |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-09-04 end |
| | | //编辑后保存 |
| | | else{ |
| | | List<Consumable_order__c> cocinfo = New List<Consumable_order__c>(); |
| | | cocinfo = [SELECT Id,Name, |
| | | List<Consumable_order__c> cocinfo = new List<Consumable_order__c>(); |
| | | cocinfo = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Invoice_status__c, |
| | | Invoice_Date__c, |
| | | Order_ForDealerText__c, |
| | |
| | | Invoicedet_attachment__c, |
| | | Outbound_order__c |
| | | FROM Consumable_order__c |
| | | WHERE Id =:invoiceId]; |
| | | WHERE Id = :invoiceId |
| | | ]; |
| | | if (cocinfo.size()>0){ |
| | | invoiceHead = cocinfo[0]; |
| | | } |
| | |
| | | Map<String,Decimal> returnProcountMap = new Map<String,Decimal>(); |
| | | Map<String,Decimal> changeOrderProcountMap = new Map<String,Decimal>(); |
| | | List<Consumable_Orderdetails__c> detaliFromList = [ |
| | | SELECT Id, |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Asset_Model_No__c, |
| | |
| | | Box_Piece__c, |
| | | Invoice_Cost_RMB__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :deliveryId ]; |
| | | WHERE Consumable_order__c = :deliveryId |
| | | ]; |
| | | for(Consumable_Orderdetails__c changeOD : detaliFromList){ |
| | | needchangeOrderProcountMap.put(changeOD.Asset_Model_No__c, changeOD.Shipment_Count__c); |
| | | } |
| | | //发票返品信息 |
| | | List<Consumable_Orderdetails__c> returnCountList = [ |
| | | SELECT Id, |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Asset_Model_No__c, |
| | |
| | | Invoice_Unit__c, |
| | | Box_Piece__c |
| | | FROM Consumable_Orderdetails__c |
| | | where Consumable_order__c = :invoiceId]; |
| | | WHERE Consumable_order__c = :invoiceId |
| | | ]; |
| | | |
| | | for(Consumable_Orderdetails__c changeOD : returnCountList){ |
| | | if(changeOD.RrturnPro_count__c > 0){ |
| | | if(returnProcountMap.containsKey(changeOD.Asset_Model_No__c)){ |
| | | returnProcountMap.put(changeOD.Asset_Model_No__c, returnProcountMap.get(changeOD.Asset_Model_No__c) + changeOD.RrturnPro_count__c); |
| | | returnProcountMap.put( |
| | | changeOD.Asset_Model_No__c, |
| | | returnProcountMap.get(changeOD.Asset_Model_No__c) + changeOD.RrturnPro_count__c |
| | | ); |
| | | }else{ |
| | | returnProcountMap.put(changeOD.Asset_Model_No__c, changeOD.RrturnPro_count__c); |
| | | } |
| | |
| | | |
| | | //已换货单出库数量信息 |
| | | List<Consumable_Orderdetails__c> returnCount1List = [ |
| | | SELECT Id, |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Asset_Model_No__c, |
| | |
| | | Invoice_Unit__c, |
| | | Box_Piece__c |
| | | FROM Consumable_Orderdetails__c |
| | | where Consumable_order__c in (SELECT Outboundorder_Code_link__c FROM Consumable_order_LinkTable__c |
| | | WHERE Invoice_Code_link__c = :invoiceId) |
| | | AND Consumable_order__r.Onchange_order__c = true |
| | | AND Consumable_order__c != :deliveryId]; |
| | | WHERE |
| | | Consumable_order__c IN ( |
| | | SELECT Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Invoice_Code_link__c = :invoiceId |
| | | ) |
| | | AND Consumable_order__r.Onchange_order__c = TRUE |
| | | AND Consumable_order__c != :deliveryId |
| | | ]; |
| | | for(Consumable_Orderdetails__c changeOD : returnCount1List){ |
| | | changeOrderProcountMap.put(changeOD.Asset_Model_No__c, changeOD.Shipment_Count__c); |
| | | } |
| | |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-09-08 start |
| | | //被选中的出库单集合 |
| | | if(insertDetMap.size() > 0 ){ |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = |
| | | [SELECT Id,Invoice_Code_link__c,Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c WHERE Outboundorder_Code_link__c in :insertDetMap.keySet() |
| | | AND Invoice_Code_link__c = :invoiceHead.Id]; |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [ |
| | | SELECT Id, Invoice_Code_link__c, Outboundorder_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c IN :insertDetMap.keySet() AND Invoice_Code_link__c = :invoiceHead.Id |
| | | ]; |
| | | //存在没有与发票建立关联关系的出库单 |
| | | List<String> templist2 = new List<String>(); |
| | | for(Consumable_order_LinkTable__c colc : existLinkinfo){ |
| | |
| | | } |
| | | } |
| | | upsert invoiceLinkList; |
| | | |
| | | } |
| | | /*if(insertDetMap.size() > 0 ){ |
| | | for (String field : insertDetMap.keySet()) { |
| | |
| | | }*/ |
| | | //删除出库单链接表 |
| | | if(deleteDetMap.size() > 0 ){ |
| | | |
| | | List<Consumable_order_LinkTable__c> invoiceLinkdetList = New List<Consumable_order_LinkTable__c>(); |
| | | List<Consumable_order_LinkTable__c> invoiceLinkdetList = new List<Consumable_order_LinkTable__c>(); |
| | | deleteOutboundorder(deleteDetMap,invoiceHead.Id); |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [SELECT Id,Outboundorder_Code_link__c,Invoice_Code_link__c FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c in :deleteDetMap.keySet() |
| | | AND Invoice_Code_link__c = :invoiceHead.Id]; |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [ |
| | | SELECT Id, Outboundorder_Code_link__c, Invoice_Code_link__c |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c IN :deleteDetMap.keySet() AND Invoice_Code_link__c = :invoiceHead.Id |
| | | ]; |
| | | for(Consumable_order_LinkTable__c colctemp : existLinkinfo){ |
| | | if (deleteDetMap.get(colctemp.Outboundorder_Code_link__c) == colctemp.Invoice_Code_link__c) { |
| | | //存在与该发票关联的出库单 |
| | |
| | | //换货单链接表 发票明细2做成 |
| | | public void outOrderchange(Map<String,String> insertDetMap){ |
| | | List<string> chukudanID = new List<string>(); |
| | | List<Consumable_order_LinkTable__c> invoiceLinkList = New List<Consumable_order_LinkTable__c>(); |
| | | List<Consumable_order_LinkTable__c> invoiceLinkList = new List<Consumable_order_LinkTable__c>(); |
| | | Consumable_order__c p = new Consumable_order__c(); |
| | | if(insertDetMap.size() > 0 ){ |
| | | for (String field : insertDetMap.keySet()) { |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [SELECT Id FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c = :field]; |
| | | List<Consumable_order_LinkTable__c> existLinkinfo = [ |
| | | SELECT Id |
| | | FROM Consumable_order_LinkTable__c |
| | | WHERE Outboundorder_Code_link__c = :field |
| | | ]; |
| | | if(existLinkinfo.size() > 0){ |
| | | delete existLinkinfo; |
| | | } |
| | |
| | | } |
| | | //换货出库单明细1更新 |
| | | List<Consumable_Orderdetails__c> detaliFrom1List = [ |
| | | SELECT Id, |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Asset_Model_No__c, |
| | |
| | | Consumable_Sale_order__r.Name, |
| | | Consumable_Shipment_order__r.Name |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c in : chukudanID]; |
| | | WHERE Consumable_order__c IN :chukudanID |
| | | ]; |
| | | for(Consumable_Orderdetails__c changeOD : detaliFrom1List){ |
| | | changeOD.Invoiced_Procount__c = changeOD.Shipment_Count__c; |
| | | } |
| | |
| | | changeOD.Invoice_Date__c = Date.today(); |
| | | } |
| | | update detaliFromList;*/ |
| | | |
| | | } |
| | | |
| | | //取得更新map初始化数据 |
| | | //获取 订单中产品的初始化 Map |
| | | public void getdefaultMapinfo(List<String> orderIdList){ |
| | | List<Consumable_Orderdetails__c> existLinkinfo = new List<Consumable_Orderdetails__c>(); |
| | | existLinkinfo = [SELECT Id,Consumable_order__c,Consumable_product__c,Asset_Model_No__c |
| | | existLinkinfo = [ |
| | | SELECT Id, Consumable_order__c, Consumable_product__c, Asset_Model_No__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c in:orderIdList]; |
| | | WHERE Consumable_order__c IN :orderIdList |
| | | ]; |
| | | for(Integer i = 0; i < existLinkinfo.size(); i++){ |
| | | ordermx1defaultMap.put(existLinkinfo[i].Consumable_order__c + existLinkinfo[i].Asset_Model_No__c,0); |
| | | } |
| | |
| | | }*/ |
| | | public void deleteOutboundorder(Map<String,String> deleteMap,String value){ |
| | | //删除发票明细1 |
| | | List<Consumable_Orderdetails__c> detInvoicedet1List = |
| | | [SELECT Id,Consumable_Shipment_order__c,Consumable_Sale_order__c,Consumable_product__c,Asset_Model_No__c |
| | | List<Consumable_Orderdetails__c> detInvoicedet1List = [ |
| | | SELECT Id, Consumable_Shipment_order__c, Consumable_Sale_order__c, Consumable_product__c, Asset_Model_No__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :value |
| | | AND Invoicedet1_OD_link__c = :deleteMap.keySet()]; |
| | | WHERE Consumable_order__c = :value AND Invoicedet1_OD_link__c = :deleteMap.keySet() |
| | | ]; |
| | | System.debug('detInvoicedet1List = ' + detInvoicedet1List); |
| | | delete detInvoicedet1List; |
| | | } |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-09-08 end |
| | | |
| | | public void newinvoicedetails1(List<String> chukudanID){ |
| | | //新规发票明细1 |
| | | List<Consumable_Orderdetails__c> invoiceorderList1 = New List<Consumable_Orderdetails__c>(); |
| | | List<Consumable_Orderdetails__c> invoiceorderList1 = new List<Consumable_Orderdetails__c>(); |
| | | //出库单明细更新 |
| | | List<Consumable_Orderdetails__c> outOrderList1 = New List<Consumable_Orderdetails__c>(); |
| | | List<Consumable_Orderdetails__c> outOrderList1 = new List<Consumable_Orderdetails__c>(); |
| | | List<Consumable_Orderdetails__c> detaliFromList = [ |
| | | SELECT Id, |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Asset_Model_No__c, |
| | |
| | | Invoice_Unit__c, |
| | | ProductPacking_list_manual__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c in : chukudanID |
| | | AND InvoiceProNot_count__c > 0 |
| | | WHERE Consumable_order__c IN :chukudanID AND InvoiceProNot_count__c > 0 |
| | | ]; |
| | | |
| | | for(Integer i = 0; i < detaliFromList.size(); i++){ |
| | |
| | | if(str.length() == 1){ |
| | | str = '0' + str; |
| | | } |
| | | invoiceInsert1.Name = coc.Name + '-' + detaliFromList[i].Name.substring(detaliFromList[i].Name.length() - 7,detaliFromList[i].Name.length()); |
| | | invoiceInsert1.Name = |
| | | coc.Name + |
| | | '-' + |
| | | detaliFromList[i].Name.substring(detaliFromList[i].Name.length() - 7, detaliFromList[i].Name.length()); |
| | | invoiceInsert1.Shipment_Count__c = detaliFromList[i].InvoiceProNot_count__c; |
| | | invoiceInsert1.Consumable_Product__c = detaliFromList[i].Consumable_Product__c; |
| | | invoiceInsert1.Intra_Trade_List_RMB__c = detaliFromList[i].Intra_Trade_List_RMB__c; |
| | |
| | | invoiceInsert1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | |
| | | if(detaliFromList[i].Box_Piece__c == '盒' && detaliFromList[i].Invoice_Unit__c == '个'){ |
| | | invoiceInsert1.Invoice_Unitprice__c = detaliFromList[i].Delivery_List_RMB__c/detaliFromList[i].ProductPacking_list_manual__c; |
| | | invoiceInsert1.Invoice_Unitprice__c = |
| | | detaliFromList[i].Delivery_List_RMB__c / detaliFromList[i].ProductPacking_list_manual__c; |
| | | }else{ |
| | | invoiceInsert1.Invoice_Unitprice__c = detaliFromList[i].Delivery_List_RMB__c; |
| | | } |
| | | invoiceInsert1.Box_Piece__c = detaliFromList[i].Box_Piece__c; |
| | | invoiceInsert1.Invoice_Unit__c = detaliFromList[i].Box_Piece__c; |
| | | //orderUpdate1.Invoice_Unitprice__c = detaliFromList[i].Delivery_List_RMB__c; |
| | | if (detaliFromList[i].Invoiced_Procount__c == null) detaliFromList[i].Invoiced_Procount__c = 0; |
| | | if (detaliFromList[i].RrturnPro_count__c == null) detaliFromList[i].RrturnPro_count__c = 0; |
| | | if (detaliFromList[i].Invoiced_Procount__c == null) |
| | | detaliFromList[i].Invoiced_Procount__c = 0; |
| | | if (detaliFromList[i].RrturnPro_count__c == null) |
| | | detaliFromList[i].RrturnPro_count__c = 0; |
| | | //invoiceInsert1.Invoiced_Procount__c = detaliFromList[i].Invoiced_Procount__c; |
| | | invoiceInsert1.Invoiced_Count__c = detaliFromList[i].InvoiceProNot_count__c; |
| | | if (detaliFromList[i].InvoicedProCost_RMB__c == null) detaliFromList[i].InvoicedProCost_RMB__c = 0; |
| | | if (detaliFromList[i].InvoicedProCost_RMB__c == null) |
| | | detaliFromList[i].InvoicedProCost_RMB__c = 0; |
| | | invoiceInsert1.InvoicedProCost_RMB__c = invoiceInsert1.Invoiced_Count__c * invoiceInsert1.Delivery_List_RMB__c; |
| | | //invoiceInsert1.Sum_of_money__c = invoiceInsert1.InvoicedProCost_RMB__c; |
| | | invoiceInsert1.Consumable_order__c = invoiceId; |
| | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | if(invoiceorderList1.size() > 0){ |
| | | try { |
| | | System.debug('invoiceorderList1 = ' + invoiceorderList1); |
| | | insert invoiceorderList1; |
| | | }catch (Exception ex) { |
| | | Database.rollback(sp); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //上传附件 |
| | | public PageReference FilesUpload(){ |
| | | PageReference ref = new Pagereference('/p/attach/NoteAttach?pid='+invoiceId+'&retURL=%2F' + '/ConInvoiceView?invoiceId=' +invoiceId); |
| | | PageReference ref = new Pagereference( |
| | | '/p/attach/NoteAttach?pid=' + |
| | | invoiceId + |
| | | '&retURL=%2F' + |
| | | '/ConInvoiceView?invoiceId=' + |
| | | invoiceId |
| | | ); |
| | | ref.setRedirect(true); |
| | | return ref; |
| | | } |
| | |
| | | // 删除按钮 |
| | | public PageReference deleteButton() { |
| | | system.debug('====invoiceId==========>' + invoiceId); |
| | | List < Consumable_Orderdetails__c > consList = [select id, Consumable_order__c from Consumable_Orderdetails__c where Consumable_order__c = : invoiceId]; |
| | | List<Consumable_Orderdetails__c> consList = [ |
| | | SELECT id, Consumable_order__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c = :invoiceId |
| | | ]; |
| | | // Consumable_order__c consumable = [select id from Consumable_order__c where id =: invoiceId AND Invoice_status__c = '草案中']; |
| | | try { |
| | | system.debug('====cons==========>' + consList); |
| | |
| | | } |
| | | // 精琢科技 zxk 2021-11-03 CHAN-C8D86K 添加删除按钮 end |
| | | |
| | | |
| | | // 作废重开按钮 |
| | | public PageReference setreopen(){ |
| | | statusEdit = 'Redirect'; |
| | |
| | | public PageReference approval() { |
| | | //更新发票明细2链接 |
| | | Consumable_order__c P = new Consumable_order__c(); |
| | | List<Consumable_order__c> cocinfo = New List<Consumable_order__c>(); |
| | | List<Consumable_order_details2__c> invoiceorderList2 = New List<Consumable_order_details2__c>(); |
| | | List<Consumable_order__c> cocinfo = new List<Consumable_order__c>(); |
| | | List<Consumable_order_details2__c> invoiceorderList2 = new List<Consumable_order_details2__c>(); |
| | | //更新出库单明细1 |
| | | List<Consumable_Orderdetails__c> outOrderdetUp1List = New List<Consumable_Orderdetails__c>(); |
| | | List<Consumable_Orderdetails__c> outOrderdetUp1List = new List<Consumable_Orderdetails__c>(); |
| | | //需要更新出库单明细1 |
| | | List<Consumable_Orderdetails__c> outOrderdet1List = [ |
| | | SELECT Id, |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Consumable_order__r.Name, |
| | |
| | | Box_Piece__c, |
| | | Invoice_Unit__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Consumable_order__c in : outOrderStringList |
| | | WHERE Consumable_order__c IN :outOrderStringList |
| | | ]; |
| | | for(Integer i = 0; i < outOrderdet1List.size(); i++){ |
| | | if(outordercountMap.containsKey(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c)){ |
| | | Consumable_Orderdetails__c invoiceUpdte1 = new Consumable_Orderdetails__c(); |
| | | invoiceUpdte1.Id = outOrderdet1List[i].Id; |
| | | invoiceUpdte1.Invoice_Unit__c = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoice_Unit__c; |
| | | if(outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Box_Piece__c == '盒' && outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoice_Unit__c == '个'){ |
| | | invoiceUpdte1.Invoice_Unit__c = outordercountMap.get( |
| | | outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c |
| | | ) |
| | | .Invoice_Unit__c; |
| | | if ( |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Box_Piece__c == |
| | | '盒' && |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoice_Unit__c == |
| | | '个' |
| | | ) { |
| | | Decimal OldinvoicedProcount = 0; |
| | | OldinvoicedProcount = (outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoiced_Count__c / outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).ProductPacking_list_manual__c).setScale(2); |
| | | OldinvoicedProcount = (outordercountMap.get( |
| | | outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c |
| | | ) |
| | | .Invoiced_Count__c / |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c) |
| | | .ProductPacking_list_manual__c) |
| | | .setScale(2); |
| | | invoiceUpdte1.Invoiced_Procount__c = outOrderdet1List[i].Invoiced_Procount__c + OldinvoicedProcount ; |
| | | }else{ |
| | | invoiceUpdte1.Invoiced_Procount__c = outOrderdet1List[i].Invoiced_Procount__c + outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoiced_Count__c; |
| | | invoiceUpdte1.Invoiced_Procount__c = |
| | | outOrderdet1List[i].Invoiced_Procount__c + |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c) |
| | | .Invoiced_Count__c; |
| | | } |
| | | invoiceUpdte1.Invoice_Unitprice__c = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoice_Unitprice__c; |
| | | invoiceUpdte1.Invoice_Unitprice__c = outordercountMap.get( |
| | | outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c |
| | | ) |
| | | .Invoice_Unitprice__c; |
| | | invoiceUpdte1.InvoicedProCost_RMB__c = invoiceUpdte1.Invoiced_Procount__c * outOrderdet1List[i].Delivery_List_RMB__c; |
| | | |
| | | Decimal invoicedProcount = 0; |
| | | if(outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Box_Piece__c == '盒' && outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoice_Unit__c == '个'){ |
| | | invoicedProcount = (outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoiced_Count__c / outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).ProductPacking_list_manual__c).setScale(2); |
| | | if ( |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Box_Piece__c == |
| | | '盒' && |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoice_Unit__c == |
| | | '个' |
| | | ) { |
| | | invoicedProcount = (outordercountMap.get( |
| | | outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c |
| | | ) |
| | | .Invoiced_Count__c / |
| | | outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c) |
| | | .ProductPacking_list_manual__c) |
| | | .setScale(2); |
| | | }else{ |
| | | invoicedProcount = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c).Invoiced_Count__c; |
| | | invoicedProcount = outordercountMap.get(outOrderdet1List[i].Consumable_order__c + outOrderdet1List[i].Asset_Model_No__c) |
| | | .Invoiced_Count__c; |
| | | } |
| | | |
| | | if(outOrderdet1List[i].InvoiceProNot_count__c < invoicedProcount){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '出库单' + outOrderdet1List[i].Consumable_order__r.Name + '中,' + outOrderdet1List[i].Asset_Model_No__c +'还没开票数量小于发票数量,请确认是否有返品。')); |
| | | ApexPages.addmessage( |
| | | new ApexPages.message( |
| | | ApexPages.severity.Error, |
| | | '出库单' + |
| | | outOrderdet1List[i].Consumable_order__r.Name + |
| | | '中,' + |
| | | outOrderdet1List[i].Asset_Model_No__c + |
| | | '还没开票数量小于发票数量,请确认是否有返品。' |
| | | ) |
| | | ); |
| | | return null; |
| | | } |
| | | |
| | | outOrderdetUp1List.add(invoiceUpdte1); |
| | | |
| | | } |
| | | } |
| | | Savepoint sp = Database.setSavepoint(); |
| | |
| | | ControllerUtil.updateOrderDetails1Satus(outOrderdetUp1List); |
| | | } |
| | | //发票状态更新 |
| | | cocinfo = [SELECT Id,Name,Invoice_status__c,Dealer_Info__c,Order_ForHospital__c,SummonsForDirction__c FROM Consumable_order__c WHERE Id =:invoiceId]; |
| | | cocinfo = [ |
| | | SELECT Id, Name, Invoice_status__c, Dealer_Info__c, Order_ForHospital__c, SummonsForDirction__c |
| | | FROM Consumable_order__c |
| | | WHERE Id = :invoiceId |
| | | ]; |
| | | if (cocinfo.size()>0){ |
| | | p = cocinfo[0]; |
| | | } |
| | |
| | | soql += ' AND InvoiceNotPro_total_amount__c > 0'; |
| | | soql += ' AND Onchange_order__c = false limit 1000'; |
| | | return soql; |
| | | |
| | | } |
| | | |
| | | // Data Bean |
| | |
| | | public without sharing class ConsumableController { |
| | | public without sharing class { |
| | | |
| | | /*****************検索用******************/ |
| | | public Consumable_order__c coc { get; set; } // FIMXE Consumable_order__c のインスタンス、sql多すぎ |
| | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | if( string.isBlank( rowData_Id )){ |
| | | return Database.getQueryLocator( |
| | | [Select Id, Name, Log__c, ErrorLog__c, Log2__c, |
| | | Log3__c, Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, |
| | | Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, |
| | | retry_cnt__c,DN_retry_cnt__c, CreatedDate |
| | | from BatchIF_Log__c |
| | | where RowDataFlg__c = true |
| | | and IsUpsertDN__c = true |
| | | and (DN_retry_cnt__c = null |
| | | or (DN_retry_cnt__c != 0 and DN_retry_cnt__c < 3))]); |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | retry_cnt__c, |
| | | DN_retry_cnt__c, |
| | | CreatedDate |
| | | FROM BatchIF_Log__c |
| | | WHERE |
| | | RowDataFlg__c = TRUE |
| | | AND IsUpsertDN__c = TRUE |
| | | AND (DN_retry_cnt__c = NULL |
| | | OR (DN_retry_cnt__c != 0 |
| | | AND DN_retry_cnt__c < 3)) |
| | | ] |
| | | ); |
| | | }else{ |
| | | return Database.getQueryLocator([Select Id, Name, Log__c, ErrorLog__c, Log2__c, |
| | | Log3__c, Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, |
| | | Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, |
| | | retry_cnt__c ,DN_retry_cnt__c,CreatedDate |
| | | from BatchIF_Log__c |
| | | where RowDataFlg__c = true |
| | | and Id = :rowData_Id ]); |
| | | return Database.getQueryLocator( |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | retry_cnt__c, |
| | | DN_retry_cnt__c, |
| | | CreatedDate |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = TRUE AND Id = :rowData_Id |
| | | ] |
| | | ); |
| | | } |
| | | } |
| | | global void execute(Database.BatchableContext BC, List<BatchIF_Log__c> rowDataList) { |
| | |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | String rowDataStr = NFMUtil.getRowDataStr(rowData); |
| | | List<NFM110Rest.GeneralData> generalDataList = |
| | | (List<NFM110Rest.GeneralData>) JSON.deserialize(rowDataStr, List<NFM110Rest.GeneralData>.class); |
| | | List<NFM110Rest.GeneralData> generalDataList = (List<NFM110Rest.GeneralData>) JSON.deserialize( |
| | | rowDataStr, |
| | | List<NFM110Rest.GeneralData>.class |
| | | ); |
| | | if (generalDataList == null || generalDataList.size() == 0) { |
| | | return; |
| | | } |
| | | // 电子签收单 start 优化原有select |
| | | list<account> olympusAcclist = |
| | | [select Id , ParentId ,AgentCode_Ext__c |
| | | from Account |
| | | where AgentCode_Ext__c = '9999900' or |
| | | AgentCode_Ext__c = '9999999' or |
| | | AgentCode_Ext__c = '9999901' |
| | | list<account> olympusAcclist = [ |
| | | SELECT Id, ParentId, AgentCode_Ext__c |
| | | FROM Account |
| | | WHERE AgentCode_Ext__c = '9999900' OR AgentCode_Ext__c = '9999999' OR AgentCode_Ext__c = '9999901' |
| | | ]; |
| | | Account ocm ,olympus,olympus_return; |
| | | for(Account tempAcc : olympusAcclist){ |
| | |
| | | //根据数据传的样式决定 |
| | | } |
| | | } |
| | | if (!(infoH.ReturnMark == null || infoH.ReturnMark == '' |
| | | || infoH.ReturnMark == '1' || infoH.ReturnMark == '3' |
| | | )) { |
| | | if (!(infoH.ReturnMark == null || infoH.ReturnMark == '' || infoH.ReturnMark == '1' || infoH.ReturnMark == '3')) { |
| | | // ReturnMark = 上記以外の場合 Errorメッセージ出力 |
| | | continue; |
| | | } |
| | |
| | | // CHAN-BBLAAP start |
| | | string Product_Serial_No = ''; |
| | | if (dnInfo.SorLMark == 'S') { |
| | | Product_Serial_No = |
| | | dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo; |
| | | Product_Serial_No = dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo; |
| | | } else { |
| | | Product_Serial_No = |
| | | dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo |
| | | + '(' + dnInfo.TracingCode + ')'; |
| | | Product_Serial_No = dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')'; |
| | | } |
| | | // CHAN-BBLAAP end |
| | | if (dnInfo.OTCode == null || dnInfo.OTCode == '' |
| | | || dnInfo.SerialNoorLotNo == null || dnInfo.SerialNoorLotNo == '' |
| | | ) { |
| | | if (dnInfo.OTCode == null || dnInfo.OTCode == '' || dnInfo.SerialNoorLotNo == null || dnInfo.SerialNoorLotNo == '') { |
| | | // 商品コードがない場合、処理と飛ばす |
| | | continue; |
| | | } |
| | |
| | | productSerialNoList.add(dnInfo.SerialNoorLotNo); |
| | | productSerialNoList.add(dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')'); |
| | | } |
| | | |
| | | } |
| | | // 电子签收单 start 额外检索end user |
| | | List<Account> accList = [select Id, Name, Management_Code__c, Department_Class__c, Hospital__c, ParentId, |
| | | RecordType.DeveloperName, Department_Name__c, OCM_man_province_txt__c |
| | | from Account |
| | | where Management_Code__c in :managementCodeList]; |
| | | List<Account> accList = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Management_Code__c, |
| | | Department_Class__c, |
| | | Hospital__c, |
| | | ParentId, |
| | | RecordType.DeveloperName, |
| | | Department_Name__c, |
| | | OCM_man_province_txt__c |
| | | FROM Account |
| | | WHERE Management_Code__c IN :managementCodeList |
| | | ]; |
| | | // HHOA-BLC8S6 update by vivek 2020-02-13 end |
| | | Map<String, Account> accsMap = new Map<String, Account>(); |
| | | for (Account acc : accList) { |
| | | accsMap.put(acc.Management_Code__c, acc); |
| | | } |
| | | Map<String, Opportunity> oppMap = new Map<String, Opportunity>(); |
| | | List<Opportunity> oppList = [Select Id, Purchase_Type__c, Opportunity_No__c,Strategic_department_Class_Name__c, |
| | | Sales_Root__c, SAP_Province__c, Trade__c, Agency1__c,Agency1__r.Name, |
| | | Agency1__r.OCM_man_province_txt__c, Opportunity_Category__c, |
| | | OCM_man_province_cus__c, Sales_assistant_name_text__c |
| | | List<Opportunity> oppList = [ |
| | | SELECT |
| | | Id, |
| | | Purchase_Type__c, |
| | | Opportunity_No__c, |
| | | Strategic_department_Class_Name__c, |
| | | Sales_Root__c, |
| | | SAP_Province__c, |
| | | Trade__c, |
| | | Agency1__c, |
| | | Agency1__r.Name, |
| | | Agency1__r.OCM_man_province_txt__c, |
| | | Opportunity_Category__c, |
| | | OCM_man_province_cus__c, |
| | | Sales_assistant_name_text__c, |
| | | // 电子签收单 start |
| | | // 临时使用 用作试点经销商 |
| | | ,Agency1__r.EsignTestAccount__c,Agency1__r.EsignTestAccountType__c |
| | | Agency1__r.EsignTestAccount__c, |
| | | Agency1__r.EsignTestAccountType__c, |
| | | // 电子签收单 end |
| | | //集中采购询价 精琢技术 wql start |
| | | ,Group_purchase_PCL__c |
| | | Group_purchase_PCL__c, |
| | | //集中采购询价 精琢技术 wql end |
| | | ,Is_Corrosion__c |
| | | |
| | | From Opportunity Where Opportunity_No__c IN :inquiryNoList]; |
| | | Is_Corrosion__c |
| | | FROM Opportunity |
| | | WHERE Opportunity_No__c IN :inquiryNoList |
| | | ]; |
| | | |
| | | for (Opportunity opp : oppList) { |
| | | oppMap.put(opp.Opportunity_No__c, opp); |
| | |
| | | |
| | | // 检索出DN 并生成DN Map |
| | | Boolean flg=true; |
| | | map <string, Statu_Achievements_DN__c> DNMap = new map <string, Statu_Achievements_DN__c>(); |
| | | map<string, Statu_Achievements_DN__c> DNMap = new Map<string, Statu_Achievements_DN__c>(); |
| | | List<Statu_Achievements_DN__c> DNList = GetDNList(DNNoSet); |
| | | // [select id, Name, |
| | | // DeliveryDate_Raw__c, |
| | |
| | | List<DNdetail> insertDNdetailList = new List<DNdetail>(); |
| | | |
| | | // CHAN-BBLAAP end |
| | | List<Statu_Achievements__c> boList = [select Id, Name |
| | | from Statu_Achievements__c |
| | | where Name in :soNoList and OverviewStatus__c <> '无效合同']; |
| | | List<Statu_Achievements__c> boList = [ |
| | | SELECT Id, Name |
| | | FROM Statu_Achievements__c |
| | | WHERE Name IN :soNoList AND OverviewStatus__c != '无效合同' |
| | | ]; |
| | | Map<String, String> boMap = new Map<String, String>(); |
| | | for (Statu_Achievements__c bo : boList) { |
| | | boMap.put(bo.Name, bo.Id); |
| | | } |
| | | |
| | | List<Product2> prdList = [select Id, Name, ProductCode, ProductCode_Ext__c, MDM_Model_No__c |
| | | from Product2 |
| | | where ProductCode_Ext__c in :productCodeList]; |
| | | List<Product2> prdList = [ |
| | | SELECT Id, Name, ProductCode, ProductCode_Ext__c, MDM_Model_No__c |
| | | FROM Product2 |
| | | WHERE ProductCode_Ext__c IN :productCodeList |
| | | ]; |
| | | Map<String, Product2> prdsMap = new Map<String, Product2>(); |
| | | for (Product2 prd : prdList) { |
| | | prdsMap.put(prd.ProductCode_Ext__c, prd); |
| | | } |
| | | List<Asset> astList = [select Id, Name, Product2.ProductCode, Product2.Dealer_special_Object__c , Product2.Dealer_Object__c, |
| | | SerialNumber, Product_Serial_No__c, Repair_Count__c, TracingCode__c, |
| | | Product2Id, AccountId, Account.Management_Code__c, Department_Class__c, Hospital__c, |
| | | Posting_Date__c, InstallDate, SLMark__c, MDM_Model_No__c, OT_CODE__c, |
| | | Guarantee_period_for_products__c, Installation_Site__c, Delete_Flag__c, Return_Flag__c, |
| | | Extend_Gurantee_DateTo__c, guarantee_period__c, Proviston_period__c |
| | | from Asset |
| | | where SerialNumber in :productSerialNoList |
| | | and IsCompetitorProduct = false |
| | | and Information_From__c <> '失单']; |
| | | List<Asset> astList = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Product2.ProductCode, |
| | | Product2.Dealer_special_Object__c, |
| | | Product2.Dealer_Object__c, |
| | | SerialNumber, |
| | | Product_Serial_No__c, |
| | | Repair_Count__c, |
| | | TracingCode__c, |
| | | Product2Id, |
| | | AccountId, |
| | | Account.Management_Code__c, |
| | | Department_Class__c, |
| | | Hospital__c, |
| | | Posting_Date__c, |
| | | InstallDate, |
| | | SLMark__c, |
| | | MDM_Model_No__c, |
| | | OT_CODE__c, |
| | | Guarantee_period_for_products__c, |
| | | Installation_Site__c, |
| | | Delete_Flag__c, |
| | | Return_Flag__c, |
| | | Extend_Gurantee_DateTo__c, |
| | | guarantee_period__c, |
| | | Proviston_period__c |
| | | FROM Asset |
| | | WHERE SerialNumber IN :productSerialNoList AND IsCompetitorProduct = FALSE AND Information_From__c != '失单' |
| | | ]; |
| | | Map<String, Asset> astsMap = new Map<String, Asset>(); |
| | | for (Asset ast : astList) { |
| | | astsMap.put(ast.MDM_Model_No__c + ast.SerialNumber, ast); |
| | |
| | | Map < String, String > provinceGIMap = new Map< String, String > (); |
| | | //检索OCSM管理省对象 |
| | | //集中采购询价 增加检索助理 |
| | | List < OCM_Management_Province__c > ompList = [select id, Name, SalesManage__c,GI_assistant__c from OCM_Management_Province__c ]; |
| | | List<OCM_Management_Province__c> ompList = [SELECT id, Name, SalesManage__c, GI_assistant__c FROM OCM_Management_Province__c]; |
| | | //存放map<省,担当> |
| | | for (OCM_Management_Province__c omp: ompList) { |
| | | provinceOwnerMap.put(omp.Name, omp.SalesManage__c); |
| | |
| | | continue; |
| | | } |
| | | if (infoH.DnInformation == null || infoH.DnInformation.size() == 0) { |
| | | iflog.ErrorLog__c += 'Error! SoNo[' + infoH.SoNo + '] DeliveryNote[' + infoH.DeliveryNote + '] DnInformation is required. This DN is skipped.\n'; |
| | | iflog.ErrorLog__c += |
| | | 'Error! SoNo[' + |
| | | infoH.SoNo + |
| | | '] DeliveryNote[' + |
| | | infoH.DeliveryNote + |
| | | '] DnInformation is required. This DN is skipped.\n'; |
| | | continue; |
| | | } |
| | | if (infoH.EndUserNo == null || infoH.EndUserNo == '') { |
| | | iflog.ErrorLog__c += 'Error! SoNo[' + infoH.SoNo + '] DeliveryNote[' + infoH.DeliveryNote + '] EndUserNo is required. This DN is skipped.\n'; |
| | | iflog.ErrorLog__c += |
| | | 'Error! SoNo[' + |
| | | infoH.SoNo + |
| | | '] DeliveryNote[' + |
| | | infoH.DeliveryNote + |
| | | '] EndUserNo is required. This DN is skipped.\n'; |
| | | continue; |
| | | } |
| | | if (accsMap.get(infoH.EndUserNo) == null) { |
| | | iflog.ErrorLog__c += 'Error! SoNo[' + infoH.SoNo + '] DeliveryNote[' + infoH.DeliveryNote + '] EndUserNo[' + infoH.EndUserNo + ']NotExist. This DN is skipped.\n'; |
| | | iflog.ErrorLog__c += |
| | | 'Error! SoNo[' + |
| | | infoH.SoNo + |
| | | '] DeliveryNote[' + |
| | | infoH.DeliveryNote + |
| | | '] EndUserNo[' + |
| | | infoH.EndUserNo + |
| | | ']NotExist. This DN is skipped.\n'; |
| | | continue; |
| | | } else if (accsMap.get(infoH.EndUserNo).RecordType.DeveloperName != 'HP' |
| | | && accsMap.get(infoH.EndUserNo).RecordType.DeveloperName != 'Agency' |
| | | && accsMap.get(infoH.EndUserNo).RecordType.DeveloperName != 'AgencyContract') { |
| | | iflog.ErrorLog__c += 'Error! SoNo[' + infoH.SoNo + '] DeliveryNote[' + infoH.DeliveryNote + '] EndUserNo[' + infoH.EndUserNo + ']Is Not HP or Agency(Contract). This DN is skipped.\n'; |
| | | } else if ( |
| | | accsMap.get(infoH.EndUserNo).RecordType.DeveloperName != 'HP' && |
| | | accsMap.get(infoH.EndUserNo).RecordType.DeveloperName != 'Agency' && |
| | | accsMap.get(infoH.EndUserNo).RecordType.DeveloperName != 'AgencyContract' |
| | | ) { |
| | | iflog.ErrorLog__c += |
| | | 'Error! SoNo[' + |
| | | infoH.SoNo + |
| | | '] DeliveryNote[' + |
| | | infoH.DeliveryNote + |
| | | '] EndUserNo[' + |
| | | infoH.EndUserNo + |
| | | ']Is Not HP or Agency(Contract). This DN is skipped.\n'; |
| | | continue; |
| | | } |
| | | Statu_Achievements_DN__c tempSADN = |
| | | DNMap.get(infoH.DeliveryNote); |
| | | Statu_Achievements_DN__c tempSADN = DNMap.get(infoH.DeliveryNote); |
| | | if (infoH.DeliveryNote != null) { |
| | | if (tempSADN == null) { |
| | | tempSADN = new Statu_Achievements_DN__c(); |
| | | tempSADN.Statu_Achievements__c = null; |
| | | tempSADN = SetSADN(tempSADN, infoH, boMap, oppMap, accsMap , provinceOwnerMap,provinceGIMap); |
| | | checkSA( tempSADN, UpsertDNList, iflog, infoH ); |
| | | |
| | | } else { |
| | | if (infoH.SoNo != tempSADN.SoNo_Raw__c || |
| | | if ( |
| | | infoH.SoNo != tempSADN.SoNo_Raw__c || |
| | | infoH.InquiryNo != tempSADN.InquiryNo_Raw__c || |
| | | infoH.ReturnMark != tempSADN.ReturnMark_Raw__c || |
| | | infoH.DeliveryDate != tempSADN.DeliveryDate_Raw__c || |
| | |
| | | ) { |
| | | string SADNID = tempSADN.id; |
| | | // 电子签收单 额外增加营业管理部担当赋值 start |
| | | tempSADN = SetSADN(tempSADN, infoH, boMap, |
| | | oppMap,accsMap, provinceOwnerMap,provinceGIMap); |
| | | tempSADN = SetSADN(tempSADN, infoH, boMap, oppMap, accsMap, provinceOwnerMap, provinceGIMap); |
| | | // 电子签收单 额外增加营业管理部担当赋值 end |
| | | tempSADN.id = SADNID; |
| | | checkSA( tempSADN, UpsertDNList, iflog, infoH ); |
| | |
| | | } |
| | | // CHAN-BBLAAP 插入保有设备明细时插入对应DN start |
| | | boolean tempReturnFlg = infoH.ReturnMark == '1' ? true : false; |
| | | DNdetail tempDNdetail |
| | | = SetSADNDetails(infoH.DeliveryNote, tempReturnFlg, dnInfo, ast, |
| | | dnInfo.SerialNoorLotNo != null && dnInfo.SerialNoorLotNo.equals('.') ? |
| | | tempDNdetailNumber++ : tempDNdetailNumber); |
| | | DNdetail tempDNdetail = SetSADNDetails( |
| | | infoH.DeliveryNote, |
| | | tempReturnFlg, |
| | | dnInfo, |
| | | ast, |
| | | dnInfo.SerialNoorLotNo != null && dnInfo.SerialNoorLotNo.equals('.') ? tempDNdetailNumber++ : tempDNdetailNumber |
| | | ); |
| | | insertDNdetailList.add(tempDNdetail); |
| | | } |
| | | } |
| | |
| | | DNMap.put(dn.Name, dn); |
| | | } |
| | | |
| | | list<Statu_Achievements_DN_details__c> insertSADNdetailList |
| | | = new list<Statu_Achievements_DN_details__c>(); |
| | | list<Statu_Achievements_DN_details__c> insertSADNdetailList = new List<Statu_Achievements_DN_details__c>(); |
| | | //电子签收单 虚进虚出 tracingcode为空不生成签收单 精琢技术 2020/12/08 start |
| | | map <string, Statu_Achievements_DN__c> DNRestructureMap = new map <string, Statu_Achievements_DN__c>(); |
| | | map<string, Statu_Achievements_DN__c> DNRestructureMap = new Map<string, Statu_Achievements_DN__c>(); |
| | | //电子签收单 虚进虚出 tracingcode为空不生成签收单 精琢技术 2020/12/08 end |
| | | for (DNdetail tempDNd : insertDNdetailList) { |
| | | if (DNMap.containskey(tempDNd.DeliveryNote)) { |
| | |
| | | if(tempSADN.ACC_Text__c != 'Y'){ |
| | | if(String.isBlank(tempDNd.DNd.TracingCode_Raw__c)){ |
| | | tempSADN.ACC_Text__c = 'Y'; |
| | | |
| | | } |
| | | } |
| | | DNRestructureMap.put(tempSADN.Name, tempSADN); |
| | | |
| | | //电子签收单 虚进虚出 tracingcode为空不生成签收单 精琢技术 2020/12/08 end |
| | | |
| | | |
| | | } |
| | | } |
| | | List<Statu_Achievements_DN_details__c> DNdetailList = |
| | | [SELECT Id |
| | | List<Statu_Achievements_DN_details__c> DNdetailList = [ |
| | | SELECT Id |
| | | FROM Statu_Achievements_DN_details__c |
| | | where Statu_Achievements_DN__r.Name in: DNMap.keySet()]; |
| | | |
| | | WHERE Statu_Achievements_DN__r.Name IN :DNMap.keySet() |
| | | ]; |
| | | |
| | | if (DNdetailList.size() > 0 && !System.Test.isRunningTest()) { |
| | | delete DNdetailList; |
| | |
| | | } |
| | | // 电子签收单 2020/07/17 start |
| | | // 检索出签收单,并生成签收单map key 为DN号 |
| | | map <string, eSignForm__c> eSFMap = new map <string, eSignForm__c>(); |
| | | List<eSignForm__c> eSFList = |
| | | [select id, DNName__c, |
| | | Hazardous_Chemicals__c, |
| | | Statu_Achievements__c,Statu_Achievements_DN__c |
| | | from eSignForm__c where |
| | | DNName__c in: DNNoSet]; |
| | | map<string, eSignForm__c> eSFMap = new Map<string, eSignForm__c>(); |
| | | List<eSignForm__c> eSFList = [ |
| | | SELECT id, DNName__c, Hazardous_Chemicals__c, Statu_Achievements__c, Statu_Achievements_DN__c |
| | | FROM eSignForm__c |
| | | WHERE DNName__c IN :DNNoSet |
| | | ]; |
| | | for (eSignForm__c eSF : eSFList) { |
| | | eSFMap.put(eSF.DNName__c, eSF); |
| | | } |
| | |
| | | upsert UpsertESFList; |
| | | } |
| | | // key 为 对应DN的ID |
| | | map <string, eSignForm__c> eSFAllMap = new map <string, eSignForm__c> (); |
| | | map<string, eSignForm__c> eSFAllMap = new Map<string, eSignForm__c>(); |
| | | for( eSignForm__c tempeSignForm : UpsertESFList){ |
| | | eSFAllMap.put(tempeSignForm.DNName__c,tempeSignForm); |
| | | } |
| | | |
| | | |
| | | // 检索现有签收单明细,并生成签收单明细map key 为DN号 + 产品OTCode |
| | | map <string, eSignFormLineItem__c> eSFLMap = new map <string, eSignFormLineItem__c>(); |
| | | List<eSignFormLineItem__c> eSFLList = |
| | | [select id,DNProductNo__c, |
| | | Count__c,Product2__c,eSignForm__c |
| | | , CaseNumber__c |
| | | from eSignFormLineItem__c |
| | | where eSignForm__r.DNName__c in: DNNoSet |
| | | map<string, eSignFormLineItem__c> eSFLMap = new Map<string, eSignFormLineItem__c>(); |
| | | List<eSignFormLineItem__c> eSFLList = [ |
| | | SELECT id, DNProductNo__c, Count__c, Product2__c, eSignForm__c, CaseNumber__c |
| | | FROM eSignFormLineItem__c |
| | | WHERE eSignForm__r.DNName__c IN :DNNoSet |
| | | ]; |
| | | for (eSignFormLineItem__c eSFL : eSFLList) { |
| | | eSFL.Count__c = 0; |
| | | eSFLMap.put(eSFL.DNProductNo__c, eSFL); |
| | | } |
| | | // 构造签收单明细 |
| | | list<eSignFormLineItem__c> UpsertESFLList = |
| | | SetupeSignFormLineItems( insertSADNdetailList, eSFLMap , eSFAllMap, prdsMap); |
| | | list<eSignFormLineItem__c> UpsertESFLList = SetupeSignFormLineItems(insertSADNdetailList, eSFLMap, eSFAllMap, prdsMap); |
| | | if(UpsertESFLList.size() > 0){ |
| | | upsert UpsertESFLList; |
| | | } |
| | |
| | | throw new ControllerUtil.myException('测试错误!'); |
| | | } |
| | | // 电子签收单 2020/07/17 end |
| | | |
| | | } catch (Exception ex) { |
| | | Database.rollback(sp); |
| | | logstr += '\n' + ex.getMessage(); |
| | | rowData.IsUpsertDN__c = true; |
| | | iflog.ErrorLog__c = ex.getMessage() + '\n' + ex.getStackTraceString() + '\n' + iflog.ErrorLog__c; |
| | | if (rowData.DN_retry_cnt__c == null) rowData.DN_retry_cnt__c = 0; |
| | | if (rowData.DN_retry_cnt__c == null) |
| | | rowData.DN_retry_cnt__c = 0; |
| | | if (rowData.DN_retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.DN_retry_cnt__c++; |
| | | DNUpsertSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.DN_retry_cnt__c >= batch_retry_max_cnt) { |
| | | rowData.ErrorLog__c = ex.getMessage() + '\n' + ex.getStackTraceString() + '\n' + rowData.ErrorLog__c + '错误次数已经超过自动收信设定的最大次数,请手动收信'; |
| | | rowData.ErrorLog__c = |
| | | ex.getMessage() + |
| | | '\n' + |
| | | ex.getStackTraceString() + |
| | | '\n' + |
| | | rowData.ErrorLog__c + |
| | | '错误次数已经超过自动收信设定的最大次数,请手动收信'; |
| | | } |
| | | } |
| | | |
| | |
| | | iflog.ErrorLog__c = iflog.ErrorLog__c.subString(0, 32760) + ' ...'; |
| | | } |
| | | update iflog; |
| | | |
| | | } |
| | | //优化两次sql查询 thh 2021-11-02 start |
| | | private static list<Statu_Achievements_DN__c> GetDNList(Set<String> DNNoSet){ |
| | | List<Statu_Achievements_DN__c> DNList = |
| | | [select id, Name, |
| | | List<Statu_Achievements_DN__c> DNList = [ |
| | | SELECT |
| | | id, |
| | | Name, |
| | | DeliveryDate_Raw__c, |
| | | DeliveryNote_Raw__c, |
| | | DepartmentNo_Raw__c, |
| | |
| | | SoNo_Raw__c, |
| | | Opportunity__c, |
| | | Statu_Achievements__c, |
| | | endUser__c |
| | | endUser__c, |
| | | //电子签收单试点用户赋值 |
| | | ,endUser__r.RecordType.Name |
| | | endUser__r.RecordType.Name, |
| | | // 电子签收单 start |
| | | , Sales_assistant_name_text__c, |
| | | RC_Manager__c,ReturnMark__c |
| | | Sales_assistant_name_text__c, |
| | | RC_Manager__c, |
| | | ReturnMark__c, |
| | | // 试点用户,届时需要删掉 |
| | | , EsignTestAccount__c |
| | | EsignTestAccount__c, |
| | | // 电子签收单 end |
| | | //ET召回品不生成签收单 start |
| | | , ETRecalledProducts__c |
| | | ETRecalledProducts__c, |
| | | //ET召回品不生成签收单 end |
| | | //acc标识 start |
| | | ,ACC_Text__c, |
| | | ACC_Text__c, |
| | | Is_Corrosion__c, |
| | | //无偿出库标识 thh 2021-11-01 start |
| | | Statu_Achievements__r.orderType__c |
| | | //无偿出库标识 thh 2021-11-01 end |
| | | //acc标识 end |
| | | from Statu_Achievements_DN__c where |
| | | Name in: DNNoSet]; |
| | | FROM Statu_Achievements_DN__c |
| | | WHERE Name IN :DNNoSet |
| | | ]; |
| | | return DNList; |
| | | } |
| | | global void finish(Database.BatchableContext BC) { |
| | |
| | | */ |
| | | @TestVisible |
| | | private static list<eSignForm__c> SetupeSignForm(map <string, eSignForm__c> eSFMap , list<Statu_Achievements_DN__c> DNList){ |
| | | list<eSignForm__c> UpsertESFList = new list<eSignForm__c> (); |
| | | list<eSignForm__c> UpsertESFList = new List<eSignForm__c>(); |
| | | for(Statu_Achievements_DN__c tempDN:DNList ){ |
| | | // 获取现有签收单 |
| | | eSignForm__c tempeSF = eSFMap.get(tempDN.Name); |
| | |
| | | } |
| | | |
| | | // 签收单名字 为: DN号-发货日年月日 |
| | | string datestr = tempDN.DeliveryDate_Raw__c == null? |
| | | Date.today().format().ReplaceAll('/', ''): |
| | | tempDN.DeliveryDate_Raw__c ; |
| | | string datestr = tempDN.DeliveryDate_Raw__c == null ? Date.today().format().ReplaceAll('/', '') : tempDN.DeliveryDate_Raw__c; |
| | | tempeSF.Name = string.valueof(integer.valueOf(tempDN.Name)) + '-' +datestr; |
| | | |
| | | tempeSF.DNName__c = tempDN.Name; |
| | |
| | | |
| | | // 经销商试点用户 |
| | | //电子签收单 虚进虚出 明细为racing code 为空的 不生成签收单 20201207 精琢技术 start |
| | | if(tempDN.EsignTestAccount__c && !tempDN.ETRecalledProducts__c&&!tempDN.ReturnMark__c&&(tempDN.ACC_Text__c!='Y'||(tempDN.ACC_Text__c=='Y'&&tempDN.Is_Corrosion__c))){//&&tempDN.Is_Corrosion__c |
| | | if ( |
| | | tempDN.EsignTestAccount__c && |
| | | !tempDN.ETRecalledProducts__c && |
| | | !tempDN.ReturnMark__c && |
| | | (tempDN.ACC_Text__c != 'Y' || (tempDN.ACC_Text__c == 'Y' && tempDN.Is_Corrosion__c)) |
| | | ) { |
| | | //&&tempDN.Is_Corrosion__c |
| | | //添加危化品标识 |
| | | if(tempDN.ACC_Text__c=='Y'&&tempDN.Is_Corrosion__c){//&&tempDN.Is_Corrosion__c |
| | | if (tempDN.ACC_Text__c == 'Y' && tempDN.Is_Corrosion__c) { |
| | | //&&tempDN.Is_Corrosion__c |
| | | tempeSF.Hazardous_Chemicals__c=true; |
| | | } |
| | | UpsertESFList.add(tempeSF); |
| | |
| | | @TestVisible |
| | | private static list<eSignFormLineItem__c> SetupeSignFormLineItems( |
| | | list<Statu_Achievements_DN_details__c> insertSADNdetailList, |
| | | map <string, eSignFormLineItem__c> eSFLMap ,map <string, eSignForm__c> eSFAllMap, |
| | | Map<String, Product2> prdsMap){ |
| | | map<string, eSignFormLineItem__c> eSFLMap, |
| | | map<string, eSignForm__c> eSFAllMap, |
| | | Map<String, Product2> prdsMap |
| | | ) { |
| | | // key 是 DN号 + 箱号 + 产品OTCode |
| | | for(Statu_Achievements_DN_details__c tempDNDetail : insertSADNdetailList){ |
| | | string key = tempDNDetail.DNName__c + '-' + |
| | | tempDNDetail.CaseNumber__c + '-' + tempDNDetail.OTCode_Raw__c; |
| | | string key = tempDNDetail.DNName__c + '-' + tempDNDetail.CaseNumber__c + '-' + tempDNDetail.OTCode_Raw__c; |
| | | //获取现有签收单明细 |
| | | eSignFormLineItem__c tempeSignFormLineItem = eSFLMap.get(key); |
| | | if( tempeSignFormLineItem == null){ |
| | |
| | | } |
| | | // Double CaseNumber = tempDNDetail.CaseNumber__c == null ? tempDNDetail.CaseNumber__c : Double.valueOf(tempDNDetail.CaseNumber__c); |
| | | tempeSignFormLineItem.DNProductNo__c = key ; |
| | | tempeSignFormLineItem.Name = tempDNDetail.CaseNumber__c == null ? String.valueOf(integer.valueOf(tempDNDetail.DNName__c)) + '-' + tempDNDetail.OTCode_Raw__c:String.valueOf(integer.valueOf(tempDNDetail.DNName__c)) + '-' + |
| | | tempDNDetail.CaseNumber__c + '-' + tempDNDetail.OTCode_Raw__c; |
| | | tempeSignFormLineItem.Name = tempDNDetail.CaseNumber__c == null |
| | | ? String.valueOf(integer.valueOf(tempDNDetail.DNName__c)) + '-' + tempDNDetail.OTCode_Raw__c |
| | | : String.valueOf(integer.valueOf(tempDNDetail.DNName__c)) + |
| | | '-' + |
| | | tempDNDetail.CaseNumber__c + |
| | | '-' + |
| | | tempDNDetail.OTCode_Raw__c; |
| | | tempeSignFormLineItem.Product2__c = prdsMap.get(tempDNDetail.OTCode_Raw__c).ID; |
| | | if(eSFAllMap.containskey(tempDNDetail.DNName__c)){ |
| | | tempeSignFormLineItem.eSignForm__c = eSFAllMap.get(tempDNDetail.DNName__c).ID; |
| | |
| | | Map<String, Opportunity> oppMap, |
| | | Map<String, Account> accsMap, |
| | | Map < String, String > provinceOwnerMap, |
| | | Map < String, String > provinceGIMap) { |
| | | Map<String, String> provinceGIMap |
| | | ) { |
| | | tempSADN.SoNo_Raw__c = infoH.SoNo; |
| | | tempSADN.InquiryNo_Raw__c = infoH.InquiryNo ; |
| | | tempSADN.ReturnMark_Raw__c = infoH.ReturnMark ; |
| | |
| | | } |
| | | //集中采购的询价 精琢技术 wql 2020/01/11 end |
| | | |
| | | |
| | | //如果 发货日期 大于 2020/12/01 才生成签收单 |
| | | if(DeliveryDate >= todate){ |
| | | |
| | | tempSADN.EsignTestAccount__c =true; |
| | | }else{ |
| | | tempSADN.EsignTestAccount__c =false; |
| | |
| | | }else{ |
| | | tempSADN.ETRecalledProducts__c =false; |
| | | } |
| | | |
| | | } |
| | | if (Inquiry.size() > 1) { |
| | | tempSADN.Order_No__c = Inquiry[1]; |
| | |
| | | } |
| | | return tempSADN; |
| | | } |
| | | private static void checkSA(Statu_Achievements_DN__c tempSADN, |
| | | private static void checkSA( |
| | | Statu_Achievements_DN__c tempSADN, |
| | | List<Statu_Achievements_DN__c> UpsertDNList, |
| | | BatchIF_Log__c iflog, |
| | | NFM110rest.GeneralData infoH ) { |
| | | NFM110rest.GeneralData infoH |
| | | ) { |
| | | if (tempSADN.Statu_Achievements__c != null) |
| | | UpsertDNList.add(tempSADN); |
| | | else { |
| | | iflog.ErrorLog__c += 'warning! SoNo[' + infoH.SoNo + |
| | | '] Statu_Achievements__c NotExist. The insert of this DN is skipped.\n'; |
| | | iflog.ErrorLog__c += 'warning! SoNo[' + infoH.SoNo + '] Statu_Achievements__c NotExist. The insert of this DN is skipped.\n'; |
| | | } |
| | | } |
| | | private static DNdetail SetSADNDetails(string DNnumber, boolean returnFlg, |
| | | NFM110Rest.DnInformation dnInfo, asset ast, integer tempDNdetailNumber) { |
| | | private static DNdetail SetSADNDetails( |
| | | string DNnumber, |
| | | boolean returnFlg, |
| | | NFM110Rest.DnInformation dnInfo, |
| | | asset ast, |
| | | integer tempDNdetailNumber |
| | | ) { |
| | | DNdetail tempDNdetail = new DNdetail(); |
| | | Statu_Achievements_DN_details__c DNd = new Statu_Achievements_DN_details__c(); |
| | | DNd.Qty_Raw__c = dnInfo.QTY; |
| | | DNd.QTY__c = String.isBlank(dnInfo.QTY) || Decimal.valueOf(dnInfo.QTY.trim()) == 0 ? |
| | | 1 : Decimal.valueOf(dnInfo.QTY.trim()); |
| | | DNd.ShippedAmount_without_tax__c = String.isBlank(dnInfo.NetWorth) ? |
| | | 0 : returnFlg == false ? |
| | | Decimal.valueOf(dnInfo.NetWorth.trim()) : - Decimal.valueOf(dnInfo.NetWorth.trim()); |
| | | DNd.QTY__c = String.isBlank(dnInfo.QTY) || Decimal.valueOf(dnInfo.QTY.trim()) == 0 ? 1 : Decimal.valueOf(dnInfo.QTY.trim()); |
| | | DNd.ShippedAmount_without_tax__c = String.isBlank(dnInfo.NetWorth) |
| | | ? 0 |
| | | : returnFlg == false ? Decimal.valueOf(dnInfo.NetWorth.trim()) : -Decimal.valueOf(dnInfo.NetWorth.trim()); |
| | | |
| | | DNd.ShippedAmount__c = String.isBlank(dnInfo.VALUE) ? |
| | | 0 : returnFlg == false ? |
| | | Decimal.valueOf(dnInfo.VALUE.trim()) : - Decimal.valueOf(dnInfo.VALUE.trim()); |
| | | DNd.ShippedAmount__c = String.isBlank(dnInfo.VALUE) |
| | | ? 0 |
| | | : returnFlg == false ? Decimal.valueOf(dnInfo.VALUE.trim()) : -Decimal.valueOf(dnInfo.VALUE.trim()); |
| | | |
| | | DNd.NetWorthNoProviston__c = String.isBlank(dnInfo.NetWorthNoProviston) ? |
| | | 0 : returnFlg == false ? |
| | | Decimal.valueOf(dnInfo.NetWorthNoProviston.trim()) : - Decimal.valueOf(dnInfo.NetWorthNoProviston.trim()); |
| | | DNd.NetWorthNoProviston__c = String.isBlank(dnInfo.NetWorthNoProviston) |
| | | ? 0 |
| | | : returnFlg == false ? Decimal.valueOf(dnInfo.NetWorthNoProviston.trim()) : -Decimal.valueOf(dnInfo.NetWorthNoProviston.trim()); |
| | | if (dnInfo.SorLMark == 'S') { |
| | | DNd.SerialNumber__c = dnInfo.SerialNoorLotNo; |
| | | } else { |
| | |
| | | ID rectDpt2ID = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_GI').getRecordTypeId(); |
| | | |
| | | // テストデータ |
| | | company = new Account(RecordTypeId = rectCoID, Name = 'NFM110TestCompany', FSE_SP_Main_Leader__c = UserInfo.getUserId(), FSE_GI_Main_Leader__c = UserInfo.getUserId()); |
| | | company = new Account( |
| | | RecordTypeId = rectCoID, |
| | | Name = 'NFM110TestCompany', |
| | | FSE_SP_Main_Leader__c = UserInfo.getUserId(), |
| | | FSE_GI_Main_Leader__c = UserInfo.getUserId() |
| | | ); |
| | | olympus = new Account(RecordTypeId = rectCoID, AgentCode_Ext__c = '9999999', Name = 'olympus'); |
| | | insert new Account[] {company, olympus}; |
| | | company = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :company.Id]; |
| | | section1 = [select Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c from Account where ParentId = :company.Id and RecordType.name = '戦略科室分類 呼吸科']; |
| | | section2 = [select Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c from Account where ParentId = :company.Id and RecordType.name = '戦略科室分類 消化科']; |
| | | olympus1 = [select Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c from Account where ParentId = :olympus.Id and RecordType.name = '戦略科室分類 呼吸科']; |
| | | olympus2 = [select Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c from Account where ParentId = :olympus.Id and RecordType.name = '戦略科室分類 消化科']; |
| | | insert new List<Account>{ company, olympus }; |
| | | company = [SELECT Management_Code__c, Management_Code_Auto__c, Name, Id FROM Account WHERE Id = :company.Id]; |
| | | section1 = [ |
| | | SELECT Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c |
| | | FROM Account |
| | | WHERE ParentId = :company.Id AND RecordType.name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | section2 = [ |
| | | SELECT Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c |
| | | FROM Account |
| | | WHERE ParentId = :company.Id AND RecordType.name = '戦略科室分類 消化科' |
| | | ]; |
| | | olympus1 = [ |
| | | SELECT Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c |
| | | FROM Account |
| | | WHERE ParentId = :olympus.Id AND RecordType.name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | olympus2 = [ |
| | | SELECT Management_Code__c, Management_Code_Auto__c, Name, Id, Department_Class_Label__c |
| | | FROM Account |
| | | WHERE ParentId = :olympus.Id AND RecordType.name = '戦略科室分類 消化科' |
| | | ]; |
| | | System.debug('section1.Department_Class_Label__c=' + section1.Department_Class_Label__c); |
| | | System.debug('section2.Department_Class_Label__c=' + section2.Department_Class_Label__c); |
| | | depart1 = new Account(RecordTypeId = rectDpt1ID, Name = '*', ParentId = section1.Id, Department_Class__c = section1.Id, Hospital__c = company.Id, |
| | | Department_Name__c = 'NFM110TestDepart1'); |
| | | depart2 = new Account(RecordTypeId = rectDpt2ID, Name = '*', ParentId = section2.Id, Department_Class__c = section2.Id, Hospital__c = company.Id, |
| | | Department_Name__c = 'NFM110TestDepart2'); |
| | | Account ocm = new Account(RecordTypeId = rectDpt2ID, Name = '*', ParentId = section2.Id, Department_Class__c = section2.Id, Hospital__c = company.Id, |
| | | AgentCode_Ext__c = '9999900', Department_Name__c = 'NFM110TestDepart3'); |
| | | Account olympus_return = new Account(RecordTypeId = rectDpt2ID, Name = '*', ParentId = olympus2.Id, Department_Class__c = olympus2.Id, Hospital__c = olympus.Id, |
| | | AgentCode_Ext__c = '9999901', Department_Name__c = 'olympus_return'); |
| | | insert new Account[] {depart1, depart2, ocm, olympus_return}; |
| | | depart1 = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :depart1.Id]; |
| | | depart2 = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :depart2.Id]; |
| | | Product2 prd = new Product2(Name = 'NFM110Prd1', ProductCode = 'NFM110Prd1', ProductCode_Ext__c = 'NFM110Prd1', Manual_Entry__c = false); |
| | | depart1 = new Account( |
| | | RecordTypeId = rectDpt1ID, |
| | | Name = '*', |
| | | ParentId = section1.Id, |
| | | Department_Class__c = section1.Id, |
| | | Hospital__c = company.Id, |
| | | Department_Name__c = 'NFM110TestDepart1' |
| | | ); |
| | | depart2 = new Account( |
| | | RecordTypeId = rectDpt2ID, |
| | | Name = '*', |
| | | ParentId = section2.Id, |
| | | Department_Class__c = section2.Id, |
| | | Hospital__c = company.Id, |
| | | Department_Name__c = 'NFM110TestDepart2' |
| | | ); |
| | | Account ocm = new Account( |
| | | RecordTypeId = rectDpt2ID, |
| | | Name = '*', |
| | | ParentId = section2.Id, |
| | | Department_Class__c = section2.Id, |
| | | Hospital__c = company.Id, |
| | | AgentCode_Ext__c = '9999900', |
| | | Department_Name__c = 'NFM110TestDepart3' |
| | | ); |
| | | Account olympus_return = new Account( |
| | | RecordTypeId = rectDpt2ID, |
| | | Name = '*', |
| | | ParentId = olympus2.Id, |
| | | Department_Class__c = olympus2.Id, |
| | | Hospital__c = olympus.Id, |
| | | AgentCode_Ext__c = '9999901', |
| | | Department_Name__c = 'olympus_return' |
| | | ); |
| | | insert new List<Account>{ depart1, depart2, ocm, olympus_return }; |
| | | depart1 = [SELECT Management_Code__c, Management_Code_Auto__c, Name, Id FROM Account WHERE Id = :depart1.Id]; |
| | | depart2 = [SELECT Management_Code__c, Management_Code_Auto__c, Name, Id FROM Account WHERE Id = :depart2.Id]; |
| | | Product2 prd = new Product2( |
| | | Name = 'NFM110Prd1', |
| | | ProductCode = 'NFM110Prd1', |
| | | ProductCode_Ext__c = 'NFM110Prd1', |
| | | Manual_Entry__c = false |
| | | ); |
| | | insert prd; |
| | | Product2__c pro1 = new Product2__c(Name='NFM110Prd1',OT_CODE_Text__c='NFM110Prd1',Product2__c=prd.id); |
| | | insert pro1; |
| | |
| | | ProductsDelivery.Monitoring = new NFMUtil.Monitoring(); |
| | | ProductsDelivery.Monitoring.MessageGroupNumber = nowStr + '01'; |
| | | |
| | | ProductsDelivery.GeneralData = new NFM110Rest.GeneralData[] { generalData1 }; |
| | | ProductsDelivery.GeneralData = new List<NFM110Rest.GeneralData>{ generalData1 }; |
| | | generalData1.DeliveryNote = 'DeliveryNote'; |
| | | NFM110Rest.DnInformation dnInfo1 = new NFM110Rest.DnInformation(); |
| | | generalData1.DnInformation = new NFM110Rest.DnInformation[] { dnInfo1 }; |
| | | generalData1.DnInformation = new List<NFM110Rest.DnInformation>{ dnInfo1 }; |
| | | generalData1.EndUserNo = company.Management_Code_Auto__c; |
| | | generalData1.DepartmentNo = depart1.Management_Code_Auto__c; |
| | | generalData1.InquiryNo = 'test0001' + ','; |
| | |
| | | dnInfo1.OTCode = prd.ProductCode_Ext__c; |
| | | dnInfo1.SerialNoorLotNo = '2577010001675'; |
| | | generalData1.DeliveryNote = '11111'; |
| | | |
| | | |
| | | NFM110Rest.GeneralData generalData2 = new NFM110Rest.GeneralData(); |
| | | NFM110Rest.ProductsDelivery ProductsDelivery1 = new NFM110Rest.ProductsDelivery(); |
| | |
| | | ProductsDelivery1.Monitoring = new NFMUtil.Monitoring(); |
| | | ProductsDelivery1.Monitoring.MessageGroupNumber = nowStr1 + '01'; |
| | | |
| | | ProductsDelivery1.GeneralData = new NFM110Rest.GeneralData[] { generalData1 }; |
| | | ProductsDelivery1.GeneralData = new List<NFM110Rest.GeneralData>{ generalData1 }; |
| | | generalData2.DeliveryNote = ''; |
| | | NFM110Rest.DnInformation dnInfo2 = new NFM110Rest.DnInformation(); |
| | | generalData2.DnInformation = new NFM110Rest.DnInformation[] { dnInfo2 }; |
| | | generalData2.DnInformation = new List<NFM110Rest.DnInformation>{ dnInfo2 }; |
| | | generalData2.EndUserNo = company.Management_Code_Auto__c; |
| | | generalData2.DepartmentNo = depart1.Management_Code_Auto__c; |
| | | generalData2.InquiryNo = 'test0001' + ','; |
| | |
| | | dnInfo2.SerialNoorLotNo = '2577010001675'; |
| | | generalData2.DeliveryNote = ''; |
| | | |
| | | |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(ProductsDelivery1.Monitoring, 'NFM110', ProductsDelivery1.GeneralData); |
| | | |
| | | |
| | | } |
| | | @isTest |
| | | private static void test_void() { |
| | | list<BatchIF_Log__c> rowDataList = [select id from BatchIF_Log__c where RowDataFlg__c = true ]; |
| | | list<BatchIF_Log__c> rowDataList = [SELECT id FROM BatchIF_Log__c WHERE RowDataFlg__c = TRUE]; |
| | | rowDataList[0].IsUpsertDN__c = true; |
| | | update rowDataList; |
| | | System.Test.startTest(); |
| | |
| | | //跑创建电子签收单的方法 |
| | | @isTest |
| | | private static void test_upsertESign() { |
| | | |
| | | |
| | | // 检索出签收单,并生成签收单map key 为DN号 |
| | | map <string, eSignForm__c> eSFMap = new map <string, eSignForm__c>(); |
| | | |
| | | |
| | | map<string, eSignForm__c> eSFMap = new Map<string, eSignForm__c>(); |
| | | |
| | | //新建电子签收单 |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | eSignForm.DNName__c = '112233'; |
| | | |
| | | |
| | | eSFMap.put(eSignForm.DNName__c, eSignForm); |
| | | |
| | | |
| | | Statu_Achievements_DN__c sad = new Statu_Achievements_DN__c(); |
| | | sad.Name = '112233'; |
| | |
| | | sad.EsignTestAccount__c =true; |
| | | sad.ReturnMark__c = false; |
| | | |
| | | |
| | | |
| | | list<Statu_Achievements_DN__c> DNList = new list<Statu_Achievements_DN__c>(); |
| | | list<Statu_Achievements_DN__c> DNList = new List<Statu_Achievements_DN__c>(); |
| | | DNList.add(sad); |
| | | |
| | | |
| | | DNUpsertBatch.SetupeSignForm(eSFMap, DNList); |
| | | |
| | | |
| | | } |
| | | //跑创建签收单明细的方法 |
| | | @isTest |
| | | private static void test_upsertESignLineItems() { |
| | | |
| | | |
| | | list<Statu_Achievements_DN_details__c> insertSADNdetailList = new list<Statu_Achievements_DN_details__c>(); |
| | | list<Statu_Achievements_DN_details__c> insertSADNdetailList = new List<Statu_Achievements_DN_details__c>(); |
| | | |
| | | Statu_Achievements_DN_details__c saddc = new Statu_Achievements_DN_details__c(); |
| | | saddc.DNName__c = '112233'; |
| | |
| | | saddc.OTCode_Raw__c= '112233'; |
| | | insertSADNdetailList.add(saddc); |
| | | |
| | | |
| | | map <string, eSignFormLineItem__c> eSFLMap = new map <string, eSignFormLineItem__c>(); |
| | | map<string, eSignFormLineItem__c> eSFLMap = new Map<string, eSignFormLineItem__c>(); |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | eSFLMap.put(eSignFormLineItem.DNProductNo__c,eSignFormLineItem); |
| | | |
| | | // 检索出签收单,并生成签收单map key 为DN号 |
| | | map <string, eSignForm__c> eSFMap = new map <string, eSignForm__c>(); |
| | | map<string, eSignForm__c> eSFMap = new Map<string, eSignForm__c>(); |
| | | |
| | | //新建电子签收单 |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | eSignForm.DNName__c = '112233'; |
| | | |
| | | |
| | | eSFMap.put(eSignForm.DNName__c, eSignForm); |
| | | |
| | |
| | | |
| | | prdsMap.put(prd.ProductCode_Ext__c,prd); |
| | | |
| | | |
| | | DNUpsertBatch.SetupeSignFormLineItems(insertSADNdetailList,eSFLMap,eSFMap, prdsMap); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | this.sortOrder = new String[]{' ',' ','↓'}; |
| | | |
| | | String userId = UserInfo.getUserId(); |
| | | // String userId = '00510000006xHnrAAE'; |
| | | //String userId = '00510000006k82X'; |
| | | //String userId = '00510000005QO75'; |
| | | user Useracc = [select Accountid, Work_Location__c,UserPro_Type__c from user where id =:userId]; |
| | | accountid = Useracc.Accountid; |
| | | accountid = Useracc.accountid; |
| | | userWorkLocation = Useracc.Work_Location__c; |
| | | agencyProType = Useracc.UserPro_Type__c; |
| | | if(String.isBlank(Useracc.UserPro_Type__c)){ |
| | |
| | | List<ConsumableorderdetailsInfo> boxRecords = new List<ConsumableorderdetailsInfo>(); |
| | | Map<String,ConsumableorderdetailsInfo> newMidBoxMap = new Map<String,ConsumableorderdetailsInfo>(); |
| | | Map<String,ConsumableorderdetailsInfo> newMidPieceMap = new Map<String,ConsumableorderdetailsInfo>(); |
| | | //DB202302357027 消耗品追溯系统无法正常使用——盘点页面操作即报错 fy start |
| | | //开始制作表头数据 |
| | | // List<Product2__c> productCount_Unfull_bak = [select Id, Name,Name__c, |
| | | // SFDA_Status__c,Packing_list_manual__c, |
| | | // Asset_Model_No__c |
| | | // from Product2__c |
| | | // //where Estimation_Entry_Possibility__c = '○' |
| | | // where Product_Type__c like : sqlagencyProType |
| | | // ]; |
| | | // for(integer i = 0;i < productCount_Unfull_bak.size() ; i++){ |
| | | // midMap.put(productCount_Unfull_bak[i].Id, productCount_Unfull_bak[i]); |
| | | // } |
| | | //DB202302357027 消耗品追溯系统无法正常使用——盘点页面操作即报错 fy end |
| | | List<Product2__c> productCount_Unfull_bak = [select Id, Name,Name__c, |
| | | SFDA_Status__c,Packing_list_manual__c, |
| | | Asset_Model_No__c |
| | | from Product2__c |
| | | //where Estimation_Entry_Possibility__c = '○' |
| | | where Product_Type__c like : sqlagencyProType |
| | | ]; |
| | | for(integer i = 0;i < productCount_Unfull_bak.size() ; i++){ |
| | | midMap.put(productCount_Unfull_bak[i].Id, productCount_Unfull_bak[i]); |
| | | } |
| | | //查询库存 追加返品库存 |
| | | List<Consumable_order_details2__c> ProductCount_Res = [select Id, Name,Consumable_Product__c, |
| | | Bar_Code__c,Consumable_Product__r.Name__c, |
| | |
| | | AND Product_Type__c like : sqlagencyProType |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Dealer_Info_text__c = :accountName]; |
| | | //DB202302357027 消耗品追溯系统无法正常使用——盘点页面操作即报错 fy start |
| | | //开始制作表头数据 |
| | | Set<Id> Product2cIdSet = new Set<Id>(); |
| | | for(Consumable_order_details2__c con_or_d2item: ProductCount_Res){ |
| | | Product2cIdSet.add(con_or_d2item.Consumable_Product__c); |
| | | } |
| | | List<Product2__c> productCount_Unfull_bak = [select Id, Name,Name__c, |
| | | SFDA_Status__c,Packing_list_manual__c, |
| | | Asset_Model_No__c |
| | | from Product2__c |
| | | //where Estimation_Entry_Possibility__c = '○' |
| | | where Id in:Product2cIdSet |
| | | and Product_Type__c like : sqlagencyProType |
| | | ]; |
| | | for(integer i = 0;i < productCount_Unfull_bak.size() ; i++){ |
| | | midMap.put(productCount_Unfull_bak[i].Id, productCount_Unfull_bak[i]); |
| | | } |
| | | system.debug('productCount_Unfull_bak'+productCount_Unfull_bak.size()); |
| | | // String erro='productCount_Unfull_bak:'+productCount_Unfull_bak.size(); |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, erro)); |
| | | //DB202302357027 消耗品追溯系统无法正常使用——盘点页面操作即报错 fy end |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'ProductCount_Res ' + ProductCount_Res.size())); |
| | | for(Integer i = 0 ; i< ProductCount_Res.size();i++){ |
| | | //然后循环CountDel做Box和piece2个map |
| | |
| | | } |
| | | //CSV出力 |
| | | public PageReference doClick() { |
| | | system.debug('Click'); |
| | | Pagereference pr = page.InventoryCSV; |
| | | system.debug('data:'+JSON.serialize(consumableorderdetailsRecordserrordummy)); |
| | | return pr; |
| | | } |
| | | |
| | |
| | | public List<List<ConsumableorderdetailsInfo>> consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>(); |
| | | |
| | | //page |
| | | Public Integer pagesize{get; set;} |
| | | Public Integer totalcount{get; set;} |
| | | Public Integer pagecount{get; set;} |
| | | Public Integer currentpage{get; set;} |
| | | public Integer pagesize { get; set; } |
| | | public Integer totalcount { get; set; } |
| | | public Integer pagecount { get; set; } |
| | | public Integer currentpage { get; set; } |
| | | public Boolean hasPrevious{get; set;} |
| | | public Boolean hasNext{get; set;} |
| | | public List<ConsumableorderdetailsInfo> pageRecords { get; set; } |
| | |
| | | public String preSortKey { get; private set; } |
| | | public Boolean sortOrderAsc { get; private set; } |
| | | public String[] sortOrder { get; private set; } |
| | | private String[] columus = new String[]{ 'Product2__c.Name__c','Asset_Model_No__c','','Category3__c','Category4__c','Category5__c',''}; |
| | | private String[] columus = new List<String>{ |
| | | 'Product2__c.Name__c', |
| | | 'Asset_Model_No__c', |
| | | '', |
| | | 'Category3__c', |
| | | 'Category4__c', |
| | | 'Category5__c', |
| | | '' |
| | | }; |
| | | |
| | | String[] proLimitAndDate =new String[]{}; |
| | | String[] proLimitAndDate = new List<String>{}; |
| | | private Map<String,Date> productkucun = new Map<String,Date>(); |
| | | public List<SelectOption> categoryOptionList{get;set;} |
| | | public List<SelectOption> category4OptionList{get;set;} |
| | |
| | | } |
| | | // 画面初始化 |
| | | public void init() { |
| | | |
| | | this.sortKey = '2'; |
| | | this.preSortKey = '2'; |
| | | this.sortOrderAsc = false; |
| | | this.sortOrder = new String[8]; |
| | | this.sortOrder = new String[]{' ','',' ',' ','','','','↓'}; |
| | | |
| | | this.sortOrder = new List<String>{ ' ', '', ' ', ' ', '', '', '', '↓' }; |
| | | |
| | | //取用户ID |
| | | String userId = UserInfo.getUserId(); |
| | | User useracc = [select Accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId]; |
| | | User useracc = [SELECT Accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId]; |
| | | accountid = useracc.accountid; |
| | | userWorkLocation = useracc.Work_Location__c; |
| | | agencyProType = Useracc.UserPro_Type__c; |
| | |
| | | //库存明细取得 |
| | | sqlagencyProType = '%' + agencyProType + '%'; |
| | | orderDetZaikuList = new List<String>(); |
| | | List<AggregateResult> orderDetZaiku = [SELECT count(Id), |
| | | Consumable_Product__c |
| | | List<AggregateResult> orderDetZaiku = [ |
| | | SELECT count(Id), Consumable_Product__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Bar_Code__c !=null |
| | | AND Product_Type__c like : sqlagencyProType |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Lose_Flag__c = FALSE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Bar_Code__c != NULL |
| | | AND Product_Type__c LIKE :sqlagencyProType |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Cancellation_Flag__c = false |
| | | AND Cancellation_Flag__c = FALSE |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | group by Consumable_Product__c]; |
| | | GROUP BY Consumable_Product__c |
| | | ]; |
| | | for(AggregateResult zaikuId : orderDetZaiku){ |
| | | orderDetZaikuList.add(String.valueOf(zaikuId.get('Consumable_Product__c'))); |
| | | } |
| | | List<Consumable_order_details2__c> CountDel = [SELECT Id, |
| | | List<Consumable_order_details2__c> CountDel = [ |
| | | SELECT |
| | | Id, |
| | | Bar_Code__c, |
| | | Name, |
| | | Inventory_date__c, |
| | |
| | | Box_Piece__c, |
| | | hospitalSpecialOffer__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Cancellation_Flag__c = false |
| | | AND Bar_Code__c !=null |
| | | AND Product_Type__c like : sqlagencyProType |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Lose_Flag__c = FALSE |
| | | AND Cancellation_Flag__c = FALSE |
| | | AND Bar_Code__c != NULL |
| | | AND Product_Type__c LIKE :sqlagencyProType |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ]; |
| | | List<Product2__c> product2Selected = [select Id, Name,Name__c,Intra_Trade_List_RMB__c, |
| | | List<Product2__c> product2Selected = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Name__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Category3__c,Category4__c,Category5__c, |
| | | Category3__c, |
| | | Category4__c, |
| | | Category5__c, |
| | | SFDA_Status__c, |
| | | Product2__r.SFDA_Approbation_No__c, |
| | | Product2__r.SFDA_Expiration_Date__c, |
| | | Product2__r.Packing_list_manual__c |
| | | FROM Product2__c |
| | | WHERE Id in : orderDetZaikuList ]; |
| | | WHERE Id IN :orderDetZaikuList |
| | | ]; |
| | | for (Integer i = 0; i < product2Selected.size(); i++) { |
| | | MidMap.put(product2Selected[i].Id, product2Selected[i]); |
| | | } |
| | |
| | | tex = 'B'; |
| | | } |
| | | if(newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex)){ |
| | | ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex).clone(); |
| | | ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber+1 ; |
| | | if(CountDel[i].Isoverdue__c == 1){ |
| | | Jstage.limitCount = Jstage.limitCount + 1; |
| | |
| | | tex = 'B'; |
| | | } |
| | | if(newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex)){ |
| | | ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex).clone(); |
| | | ConsumableorderdetailsInfo Jstage = newMidPieceMap.get( |
| | | CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex |
| | | ) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber+1 ; |
| | | if(CountDel[i].Isoverdue__c == 1){ |
| | | Jstage.limitCount = Jstage.limitCount + 1; |
| | |
| | | Jstage.hospitalSpecialOffer = true; |
| | | }else { |
| | | Jstage.hospitalSpecialOffer = false; |
| | | |
| | | } |
| | | newMidPieceMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex, Jstage); |
| | | } |
| | |
| | | consumableorderdetailsRecords.add(newMidPieceMap.get(bss.Prod.Id + '个A')); |
| | | } |
| | | } |
| | | |
| | | |
| | | /////////////////////====================================update by rentx |
| | | |
| | |
| | | //add by rentx 2021-3-10 end |
| | | //listCut(); |
| | | |
| | | AggregateResult[] categoryList = [select Count(id), Category3_text__c c3c from Product2__c WHERE Estimation_Entry_Possibility__c = '○' AND Product_Type__c like :agencyProType AND Category3_text__c != null group by Category3_text__c]; |
| | | AggregateResult[] categoryList = [ |
| | | SELECT Count(id), Category3_text__c c3c |
| | | FROM Product2__c |
| | | WHERE Estimation_Entry_Possibility__c = '○' AND Product_Type__c LIKE :agencyProType AND Category3_text__c != NULL |
| | | GROUP BY Category3_text__c |
| | | ]; |
| | | |
| | | categoryOptionList = new List<SelectOption>(); |
| | | categoryOptionList.add(new SelectOption('', '-无-')); |
| | |
| | | String deliverycnt = String.valueOf(category3Search.get('c3c')); |
| | | categoryOptionList.add(new SelectOption(deliverycnt,deliverycnt)); |
| | | } |
| | | |
| | | |
| | | category4OptionList = new List<SelectOption>(); |
| | | category4OptionList.add(new SelectOption('', '-无-')); |
| | |
| | | //显示第一页 |
| | | moveToFirst(); |
| | | makeCurrentPageRecords(); |
| | | |
| | | } |
| | | public void categoryAllload() { |
| | | AggregateResult[] category4List = [select Count(id), Category4_text__c c4c from Product2__c WHERE Estimation_Entry_Possibility__c = '○' AND Category3_text__c=:category3 AND Product_Type__c like :agencyProType AND Category4_text__c != null AND Category5_text__c != null group by Category4_text__c]; |
| | | AggregateResult[] category4List = [ |
| | | SELECT Count(id), Category4_text__c c4c |
| | | FROM Product2__c |
| | | WHERE |
| | | Estimation_Entry_Possibility__c = '○' |
| | | AND Category3_text__c = :category3 |
| | | AND Product_Type__c LIKE :agencyProType |
| | | AND Category4_text__c != NULL |
| | | AND Category5_text__c != NULL |
| | | GROUP BY Category4_text__c |
| | | ]; |
| | | category4OptionList = new List<SelectOption>(); |
| | | category4OptionList.add(new SelectOption('', '-无-')); |
| | | for(AggregateResult category4Search : category4List) { |
| | |
| | | category4OptionList.add(new SelectOption(deliverycnt4,deliverycnt4)); |
| | | } |
| | | |
| | | AggregateResult[] category5List = [select Count(id), Category5_text__c c5c from Product2__c WHERE Estimation_Entry_Possibility__c = '○' AND Category3_text__c=:category3 AND Product_Type__c like :agencyProType AND Category4_text__c != null AND Category5_text__c != null group by Category5_text__c]; |
| | | AggregateResult[] category5List = [ |
| | | SELECT Count(id), Category5_text__c c5c |
| | | FROM Product2__c |
| | | WHERE |
| | | Estimation_Entry_Possibility__c = '○' |
| | | AND Category3_text__c = :category3 |
| | | AND Product_Type__c LIKE :agencyProType |
| | | AND Category4_text__c != NULL |
| | | AND Category5_text__c != NULL |
| | | GROUP BY Category5_text__c |
| | | ]; |
| | | |
| | | category5OptionList = new List<SelectOption>(); |
| | | category5OptionList.add(new SelectOption('', '-无-')); |
| | |
| | | String deliverycnt5 = String.valueOf(category5Search.get('c5c')); |
| | | category5OptionList.add(new SelectOption(deliverycnt5,deliverycnt5)); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void categoryload() { |
| | | AggregateResult[] category4List = [select Count(id), Category4_text__c c4c from Product2__c WHERE Estimation_Entry_Possibility__c = '○' AND Category3_text__c=:category3 AND Product_Type__c like :agencyProType AND Category4_text__c != null AND Category5_text__c != null group by Category4_text__c]; |
| | | AggregateResult[] category4List = [ |
| | | SELECT Count(id), Category4_text__c c4c |
| | | FROM Product2__c |
| | | WHERE |
| | | Estimation_Entry_Possibility__c = '○' |
| | | AND Category3_text__c = :category3 |
| | | AND Product_Type__c LIKE :agencyProType |
| | | AND Category4_text__c != NULL |
| | | AND Category5_text__c != NULL |
| | | GROUP BY Category4_text__c |
| | | ]; |
| | | category4OptionList = new List<SelectOption>(); |
| | | category4OptionList.add(new SelectOption('', '-无-')); |
| | | for(AggregateResult category4Search : category4List) { |
| | |
| | | category4OptionList.add(new SelectOption(deliverycnt4,deliverycnt4)); |
| | | } |
| | | |
| | | AggregateResult[] category5List = [select Count(id), Category5_text__c c5c from Product2__c WHERE Estimation_Entry_Possibility__c = '○' AND Category3_text__c=:category3 AND Product_Type__c like :agencyProType AND Category4_text__c=:category4 AND Category5_text__c != null group by Category5_text__c]; |
| | | AggregateResult[] category5List = [ |
| | | SELECT Count(id), Category5_text__c c5c |
| | | FROM Product2__c |
| | | WHERE |
| | | Estimation_Entry_Possibility__c = '○' |
| | | AND Category3_text__c = :category3 |
| | | AND Product_Type__c LIKE :agencyProType |
| | | AND Category4_text__c = :category4 |
| | | AND Category5_text__c != NULL |
| | | GROUP BY Category5_text__c |
| | | ]; |
| | | |
| | | category5OptionList = new List<SelectOption>(); |
| | | category5OptionList.add(new SelectOption('', '-无-')); |
| | |
| | | String deliverycnt5 = String.valueOf(category5Search.get('c5c')); |
| | | category5OptionList.add(new SelectOption(deliverycnt5,deliverycnt5)); |
| | | } |
| | | |
| | | } |
| | | // 检索 |
| | | public void searchConsumableorderdetails() { |
| | |
| | | this.preSortKey = '2'; |
| | | this.sortOrderAsc = false; |
| | | this.sortOrder = new String[8]; |
| | | this.sortOrder = new String[]{' ','',' ',' ','','','','↓'}; |
| | | this.sortOrder = new List<String>{ ' ', '', ' ', ' ', '', '', '', '↓' }; |
| | | |
| | | List<ConsumableorderdetailsInfo> reSet = new List<ConsumableorderdetailsInfo>(); |
| | | List<Consumable_order_details2__c> CountDel = [SELECT Id, |
| | | List<Consumable_order_details2__c> CountDel = [ |
| | | SELECT |
| | | Id, |
| | | Bar_Code__c, |
| | | Name, |
| | | Inventory_date__c, |
| | |
| | | Box_Piece__c, |
| | | hospitalSpecialOffer__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Bar_Code__c !=null |
| | | AND Product_Type__c like : sqlagencyProType |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Lose_Flag__c = FALSE |
| | | AND Bar_Code__c != NULL |
| | | AND Product_Type__c LIKE :sqlagencyProType |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ]; |
| | |
| | | Map<String,ConsumableorderdetailsInfo> newMidBoxMap = new Map<String,ConsumableorderdetailsInfo>(); |
| | | Map<String,ConsumableorderdetailsInfo> newMidPieceMap = new Map<String,ConsumableorderdetailsInfo>(); |
| | | |
| | | |
| | | // 所有产品取得 |
| | | String soql = this.makeSoql(category1,category_Goods,category3,category4,category5); |
| | | System.debug('====>soql11' + soql); |
| | | //soql += ' ORDER BY ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last'); |
| | | List<Product2__c> queryList = Database.query(soql); |
| | | for (Integer i = 0; i < queryList.size(); i++) { |
| | |
| | | tex = 'B'; |
| | | } |
| | | if(newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex)){ |
| | | ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex).clone(); |
| | | ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber+1 ; |
| | | if(CountDel[i].Isoverdue__c == 1){ |
| | | Jstage.limitCount = Jstage.limitCount + 1; |
| | |
| | | tex = 'B'; |
| | | } |
| | | if(newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex)){ |
| | | ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex).clone(); |
| | | ConsumableorderdetailsInfo Jstage = newMidPieceMap.get( |
| | | CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex |
| | | ) |
| | | .clone(); |
| | | Jstage.allnumber = Jstage.allnumber+1 ; |
| | | if(CountDel[i].Isoverdue__c == 1){ |
| | | Jstage.limitCount = Jstage.limitCount + 1; |
| | |
| | | Jstage.hospitalSpecialOffer = true; |
| | | }else { |
| | | Jstage.hospitalSpecialOffer = false; |
| | | |
| | | } |
| | | newMidPieceMap.put(CountDel[i].Consumable_Product__c+CountDel[i].Box_Piece__c + tex, Jstage); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /////////////////////====================================update by rentx |
| | | /*//把Boxmap里的值从新赋给boxRecords |
| | | for(ConsumableorderdetailsInfo bss : newMidBoxMap.values()){ |
| | |
| | | this.preSortKey = '2'; |
| | | this.sortOrderAsc = false; |
| | | this.sortOrder = new String[8]; |
| | | this.sortOrder = new String[]{' ','',' ',' ','','','','↓'}; |
| | | this.sortOrder = new List<String>{ ' ', '', ' ', ' ', '', '', '', '↓' }; |
| | | |
| | | //总件数 |
| | | totalcount = consumableorderdetailsRecords.size(); |
| | |
| | | } |
| | | for(ConsumableorderdetailsInfo ass : consumableorderdetailsRecords){ |
| | | if(productLimt.containsKey(ass.Prod.Asset_Model_No__c)){ |
| | | ass.lowerlimit = decimal.valueOf(productLimt.get(ass.Prod.Asset_Model_No__c).subString(0, productLimt.get(ass.Prod.Asset_Model_No__c).indexOf( '|'))); |
| | | ass.upperlimit = decimal.valueOf(productLimt.get(ass.Prod.Asset_Model_No__c).subString(productLimt.get(ass.Prod.Asset_Model_No__c).indexOf( '|')+1)); |
| | | ass.lowerlimit = decimal.valueOf( |
| | | productLimt.get(ass.Prod.Asset_Model_No__c).subString(0, productLimt.get(ass.Prod.Asset_Model_No__c).indexOf('|')) |
| | | ); |
| | | ass.upperlimit = decimal.valueOf( |
| | | productLimt.get(ass.Prod.Asset_Model_No__c).subString(productLimt.get(ass.Prod.Asset_Model_No__c).indexOf('|') + 1) |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void datelimitSearch(){ |
| | | List<String> barcodekucun = new List<String>(); |
| | | List<Consumable_order_details2__c> orderkucun = [SELECT Id,Bar_Code__c, Name,Consumable_Product__c,Recordtypeid, |
| | | Guarantee_period_for_products__c,Sterilization_limit__c |
| | | List<Consumable_order_details2__c> orderkucun = [ |
| | | SELECT Id, Bar_Code__c, Name, Consumable_Product__c, Recordtypeid, Guarantee_period_for_products__c, Sterilization_limit__c |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Bar_Code__c !=null |
| | | AND Product_Type__c like : sqlagencyProType |
| | | WHERE |
| | | Dealer_Arrive__c = TRUE |
| | | AND Dealer_Shipment__c = FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = FALSE |
| | | AND Lose_Flag__c = FALSE |
| | | AND Bar_Code__c != NULL |
| | | AND Product_Type__c LIKE :sqlagencyProType |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | ORDER BY Consumable_Product__c, Sterilization_limit__c asc]; |
| | | ORDER BY Consumable_Product__c, Sterilization_limit__c ASC |
| | | ]; |
| | | for(Integer i = 0 ; i< orderkucun.size();i++){ |
| | | if(productkucun.containsKey(orderkucun[i].Consumable_Product__c)){ |
| | | continue; |
| | |
| | | this.preSortKey = this.sortKey; |
| | | // 所有产品取得 |
| | | String soql = this.makeSoql(null,null,null,null,null); |
| | | soql += ' ORDER BY ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last'); |
| | | soql += |
| | | ' ORDER BY ' + |
| | | this.columus[Integer.valueOf(this.sortKey)] + |
| | | ' ' + |
| | | (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last'); |
| | | List<Product2__c> queryList = Database.query(soql); |
| | | for (Integer i = 0; i < queryList.size(); i++) { |
| | | MidMap.put(queryList[i].Id + '盒', null); |
| | | MidMap.put(queryList[i].Id + '个', null); |
| | | |
| | | } |
| | | |
| | | //update by rentx 2020-12-29 |
| | |
| | | //update byr entx 2020-12-29 |
| | | //再把map里的值从新赋给CpageRecords |
| | | for(ConsumableorderdetailsInfo bss : MidMap.values()){ |
| | | |
| | | if(bss != null){ |
| | | pageRecords.add(bss); |
| | | if (newMap.get(bss.Prod.Id+bss.BoxPiece) != null) { |
| | |
| | | soql += ' SFDA_Status__c,Product2__r.SFDA_Approbation_No__c,Product2__r.SFDA_Expiration_Date__c,Product2__r.Packing_list_manual__c FROM Product2__c '; |
| | | soql += ' WHERE Id in' + sqlTail; |
| | | if(!String.isBlank(CateName)){ |
| | | soql += ' AND (Name__c like \'%' + String.escapeSingleQuotes(CateName.replaceAll('%', '\\%')) + '%\' or Asset_Model_No__c like \'%' + String.escapeSingleQuotes(CateName.replaceAll('%', '\\%')) + '%\')'; |
| | | }if(!String.isBlank(Category3)){ |
| | | soql += |
| | | ' AND (Name__c like \'%' + |
| | | String.escapeSingleQuotes(CateName.replaceAll('%', '\\%')) + |
| | | '%\' or Asset_Model_No__c like \'%' + |
| | | String.escapeSingleQuotes(CateName.replaceAll('%', '\\%')) + |
| | | '%\')'; |
| | | } |
| | | if (!String.isBlank(Category3)) { |
| | | soql += ' AND Category3__c = \'' + Category3 + '\''; |
| | | }if(!String.isBlank(Category4)){ |
| | | } |
| | | if (!String.isBlank(Category4)) { |
| | | soql += ' AND Category4__c = \'' + Category4 + '\''; |
| | | }if(!String.isBlank(Category5)){ |
| | | } |
| | | if (!String.isBlank(Category5)) { |
| | | soql += ' AND Category5__c = \'' + Category5 + '\''; |
| | | } |
| | | System.debug('====>soql' + soql); |
| | | return soql; |
| | | |
| | | } |
| | | |
| | | //首页 |
| | | public void moveToFirst(){ |
| | | if(currentpage == 1) return; |
| | | if (currentpage == 1) |
| | | return; |
| | | currentpage = 1; |
| | | canMove(); |
| | | } |
| | | |
| | | //尾页 |
| | | public void moveToLast(){ |
| | | if(currentpage >= pagecount) return; |
| | | if (currentpage >= pagecount) |
| | | return; |
| | | currentpage = pagecount; |
| | | canMove(); |
| | | } |
| | | |
| | | //上一页 |
| | | public void moveToPrevious(){ |
| | | if(currentpage == 1) return; |
| | | if (currentpage == 1) |
| | | return; |
| | | currentpage = currentpage -1; |
| | | canMove(); |
| | | } |
| | | |
| | | //下一页 |
| | | public void moveToNext(){ |
| | | if(currentpage >= pagecount) return; |
| | | if (currentpage >= pagecount) |
| | | return; |
| | | |
| | | currentpage = currentpage + 1; |
| | | canMove(); |
| | |
| | | public void canMove(){ |
| | | hasPrevious = false; |
| | | hasNext = false; |
| | | if(pagecount > 1 && currentpage > 1) hasPrevious = true; |
| | | if(pagecount > 1 && currentpage < pagecount) hasNext = true; |
| | | if (pagecount > 1 && currentpage > 1) |
| | | hasPrevious = true; |
| | | if (pagecount > 1 && currentpage < pagecount) |
| | | hasNext = true; |
| | | } |
| | | |
| | | |
| | | //刷新当前页 |
| | | public PageReference refreshPageSize() { |
| | |
| | | } |
| | | return returnValue; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | public without sharing class LexArriveGoodsController { |
| | | //初始化 |
| | | @AuraEnabled |
| | | public static Results init(String arrType, String eSetId) { |
| | | Results results = new Results(); |
| | | results.isNoteStay = LexUtility.getIsNoteStay(); |
| | | try { |
| | | ArriveGoodsController arrController = new ArriveGoodsController( |
| | | eSetId, |
| | | arrType |
| | | ); |
| | | arrController.isLwc = true; |
| | | arrController.init(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | results.coc = arrController.coc; |
| | | results.saveFLGbln = arrController.saveFLGbln; |
| | | results.returnFLGbln = arrController.ReturnFLGbln; |
| | | results.result = 'Success'; |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | //搜索产品 |
| | | @AuraEnabled |
| | | public static Results searchProduct(String barcode, String arrControllerStr) { |
| | | Results results = new Results(); |
| | | try { |
| | | System.debug('arrControllerStr:' + arrControllerStr); |
| | | ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize( |
| | | arrControllerStr, |
| | | ArriveGoodsController.class |
| | | ); |
| | | arrController.barcode = barcode; |
| | | arrController.returnError = null; |
| | | arrController.warningList = new List<String>(); |
| | | arrController.errorList = new List<String>(); |
| | | arrController.SearchPro(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | if ( |
| | | arrController.returnError != null && |
| | | arrController.returnError != '' |
| | | ) { |
| | | results.result = 'Fail'; |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.errorMsg = arrController.returnError; |
| | | } else { |
| | | results.coc = arrController.coc; |
| | | results.saveFLGbln = arrController.saveFLGbln; |
| | | results.returnFLGbln = arrController.ReturnFLGbln; |
| | | results.detailsSummary = changeType1(arrController.detailsSummary); |
| | | results.consumableorderdetailsRecords = changeType1( |
| | | arrController.ConsumableorderdetailsRecords |
| | | ); |
| | | results.showGoodsofReturnList = changeType1( |
| | | arrController.ShowGoodsofReturnList |
| | | ); |
| | | results.consumableInventory = changeType1( |
| | | arrController.consumableInventory |
| | | ); |
| | | results.consumableorderdetailsRecordserror = changeType1( |
| | | arrController.ConsumableorderdetailsRecordserror |
| | | ); |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.result = 'Success'; |
| | | } |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = |
| | | e.getLineNumber() + |
| | | '---' + |
| | | e.getMessage() + |
| | | '---' + |
| | | e.getStackTraceString(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | //到货确认 |
| | | @AuraEnabled |
| | | public static Results arriveGoodsConfim(String arrControllerStr) { |
| | | Results results = new Results(); |
| | | try { |
| | | ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize( |
| | | arrControllerStr, |
| | | ArriveGoodsController.class |
| | | ); |
| | | arrController.returnError = null; |
| | | arrController.warningList = new List<String>(); |
| | | arrController.errorList = new List<String>(); |
| | | Pagereference page = arrController.ArriveGoodsConfim(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | if ( |
| | | arrController.returnError != null && |
| | | arrController.returnError != '' |
| | | ) { |
| | | results.result = 'Fail'; |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.errorMsg = arrController.returnError; |
| | | } else { |
| | | if (arrController.urlType == 'UnabletoEdit') { |
| | | results.url = '/lexarrivegsdetails?EsetId=' + arrController.arriveId; |
| | | } |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.result = 'Success'; |
| | | } |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | //登录返品 |
| | | @AuraEnabled |
| | | public static Results updateGoodsOfReturn( |
| | | String arrControllerStr, |
| | | String showGoodsofReturnListStr |
| | | ) { |
| | | Results results = new Results(); |
| | | try { |
| | | List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>) JSON.deserialize( |
| | | showGoodsofReturnListStr, |
| | | List<ConsumableorderdetailsInfo>.class |
| | | ); |
| | | ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize( |
| | | arrControllerStr, |
| | | ArriveGoodsController.class |
| | | ); |
| | | arrController.ShowGoodsofReturnList = changeType2(showGoodsofReturnList); |
| | | arrController.returnError = null; |
| | | arrController.warningList = new List<String>(); |
| | | arrController.errorList = new List<String>(); |
| | | Pagereference page = arrController.UpdateGoodsOfReturn(); |
| | | results.arrGoodCon = JSON.serialize(arrController); |
| | | if ( |
| | | arrController.returnError != null && |
| | | arrController.returnError != '' |
| | | ) { |
| | | results.result = 'Fail'; |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.errorMsg = arrController.returnError; |
| | | } else { |
| | | if (arrController.urlType == 'ToReturnGoodsPage') { |
| | | results.url = '/detail/' + arrController.return_Order_id; |
| | | } |
| | | if (arrController.urlType == 'ToInventoryGoodsPage') { |
| | | results.url = '/detail/' + arrController.inventory_Order_id; |
| | | } |
| | | results.errorMsgList = arrController.errorList; |
| | | results.warningMsgList = arrController.warningList; |
| | | results.result = 'Success'; |
| | | } |
| | | } catch (Exception e) { |
| | | results.result = 'Fail'; |
| | | results.errorMsg = e.getLineNumber() + '---' + e.getMessage(); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | public static List<ConsumableorderdetailsInfo> changeType1( |
| | | List<ArriveGoodsController.ConsumableorderdetailsInfo> conList |
| | | ) { |
| | | List<ConsumableorderdetailsInfo> conList1 = new List<ConsumableorderdetailsInfo>(); |
| | | if (conList != null) { |
| | | for (ArriveGoodsController.ConsumableorderdetailsInfo con : conList) { |
| | | ConsumableorderdetailsInfo con1 = new ConsumableorderdetailsInfo(); |
| | | con1.esd = con.esd; |
| | | con1.Prod = con.Prod; |
| | | con1.ProductName = con.ProductName; |
| | | con1.barCodeNo = con.barCodeNo; |
| | | con1.sterilizationlimitDate = con.sterilizationlimitDate; |
| | | con1.serialNoorLotNo = con.serialNoorLotNo; |
| | | con1.tracingCodeNo = con.tracingCodeNo; |
| | | con1.ReturnReason = con.ReturnReason; |
| | | con1.oldConsumableCount = con.oldConsumableCount; |
| | | con1.ErrorReason = con.ErrorReason; |
| | | con1.canEdit = con.canEdit; |
| | | con1.intMark = con.intMark; |
| | | con1.arriveAmount = con.arriveAmount; |
| | | con1.arrivedCount = con.arrivedCount; |
| | | con1.ReportProductExpirationDate = con.ReportProductExpirationDate; |
| | | conList1.add(con1); |
| | | } |
| | | } |
| | | return conList1; |
| | | } |
| | | |
| | | public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2( |
| | | List<ConsumableorderdetailsInfo> conList |
| | | ) { |
| | | List<ArriveGoodsController.ConsumableorderdetailsInfo> conList1 = new List<ArriveGoodsController.ConsumableorderdetailsInfo>(); |
| | | if (conList != null) { |
| | | for (ConsumableorderdetailsInfo con : conList) { |
| | | ArriveGoodsController.ConsumableorderdetailsInfo con1 = new ArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | con1.esd = con.esd; |
| | | con1.Prod = con.Prod; |
| | | con1.ProductName = con.ProductName; |
| | | con1.barCodeNo = con.barCodeNo; |
| | | con1.sterilizationlimitDate = con.sterilizationlimitDate; |
| | | con1.serialNoorLotNo = con.serialNoorLotNo; |
| | | con1.tracingCodeNo = con.tracingCodeNo; |
| | | con1.ReturnReason = con.ReturnReason; |
| | | con1.oldConsumableCount = con.oldConsumableCount; |
| | | con1.ErrorReason = con.ErrorReason; |
| | | con1.canEdit = con.canEdit; |
| | | con1.intMark = con.intMark; |
| | | con1.arriveAmount = con.arriveAmount; |
| | | con1.arrivedCount = con.arrivedCount; |
| | | con1.ReportProductExpirationDate = con.ReportProductExpirationDate; |
| | | conList1.add(con1); |
| | | } |
| | | } |
| | | return conList1; |
| | | } |
| | | |
| | | public class Results { |
| | | @AuraEnabled |
| | | public String result; |
| | | @AuraEnabled |
| | | public String errorMsg; |
| | | @AuraEnabled |
| | | public String url; |
| | | @AuraEnabled |
| | | public String arrGoodCon; |
| | | @AuraEnabled |
| | | public Consumable_order__c coc; |
| | | @AuraEnabled |
| | | public Boolean returnFLGbln; |
| | | @AuraEnabled |
| | | public Boolean saveFLGbln; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> detailsSummary; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> consumableorderdetailsRecords; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> showGoodsofReturnList; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> consumableInventory; |
| | | @AuraEnabled |
| | | public List<ConsumableorderdetailsInfo> consumableorderdetailsRecordserror; |
| | | @AuraEnabled |
| | | public List<String> errorMsgList; |
| | | @AuraEnabled |
| | | public List<String> warningMsgList; |
| | | @AuraEnabled |
| | | public Boolean isNoteStay; |
| | | } |
| | | |
| | | public class ConsumableorderdetailsInfo implements Comparable { |
| | | @AuraEnabled |
| | | public Consumable_order_details2__c esd { get; set; } |
| | | @AuraEnabled |
| | | public Product2__c Prod { get; set; } |
| | | @AuraEnabled |
| | | public String ProductName { get; set; } |
| | | @AuraEnabled |
| | | public String barCodeNo { get; set; } |
| | | @AuraEnabled |
| | | public Date sterilizationlimitDate { get; set; } |
| | | @AuraEnabled |
| | | public String serialNoorLotNo { get; set; } |
| | | @AuraEnabled |
| | | public String tracingCodeNo { get; set; } |
| | | @AuraEnabled |
| | | public String ReturnReason { get; set; } |
| | | @AuraEnabled |
| | | public String oldConsumableCount { get; set; } |
| | | @AuraEnabled |
| | | public String ErrorReason { get; set; } |
| | | @AuraEnabled |
| | | public boolean canEdit { get; set; } |
| | | @AuraEnabled |
| | | public Integer intMark { get; set; } |
| | | @AuraEnabled |
| | | public Decimal arriveAmount { get; set; } |
| | | @AuraEnabled |
| | | public Decimal arrivedCount { get; set; } |
| | | @AuraEnabled |
| | | public String ReportProductExpirationDate { get; set; } |
| | | |
| | | public ConsumableorderdetailsInfo() { |
| | | } |
| | | |
| | | public ConsumableorderdetailsInfo( |
| | | Consumable_order_details2__c e, |
| | | string str |
| | | ) { |
| | | esd = e; |
| | | Prod = e.Consumable_Product__r; |
| | | oldConsumableCount = e.name; |
| | | ErrorReason = str; |
| | | intMark = 1; |
| | | if (e.Report_Product_Expiration__c != null) { |
| | | ReportProductExpirationDate = e.Report_Product_Expiration__c.format(); |
| | | } |
| | | } |
| | | public ConsumableorderdetailsInfo(Consumable_order_details2__c e) { |
| | | canEdit = false; |
| | | if (e.Box_Piece__c == '盒') { |
| | | e.Rrturn_count__c = 1; |
| | | canEdit = true; |
| | | } |
| | | esd = e; |
| | | Prod = e.Consumable_Product__r; |
| | | oldConsumableCount = e.name; |
| | | if (e.Report_Product_Expiration__c != null) { |
| | | ReportProductExpirationDate = e.Report_Product_Expiration__c.format(); |
| | | } |
| | | } |
| | | |
| | | public ConsumableorderdetailsInfo(Product2__c e, List<String> barinfoL) { |
| | | esd = new Consumable_order_details2__c(); |
| | | ProductName = e.Name__c; |
| | | Prod = e; |
| | | barCodeNo = barinfoL[0]; |
| | | if (String.isNotBlank(barinfoL[1])) { |
| | | sterilizationlimitDate = Date.valueOf(barinfoL[1]); |
| | | } |
| | | serialNoorLotNo = barinfoL[2]; |
| | | tracingCodeNo = barinfoL[3]; |
| | | ReturnReason = ''; |
| | | } |
| | | |
| | | public ConsumableorderdetailsInfo( |
| | | Consumable_order_details2__c e, |
| | | List<String> barinfoL |
| | | ) { |
| | | esd = e; |
| | | Prod = e.Consumable_Product__r; |
| | | barCodeNo = barinfoL[0]; |
| | | if (String.isNotBlank(barinfoL[1])) { |
| | | sterilizationlimitDate = Date.valueOf(barinfoL[1]); |
| | | } |
| | | serialNoorLotNo = barinfoL[2]; |
| | | tracingCodeNo = barinfoL[3]; |
| | | if (e.Report_Product_Expiration__c != null) { |
| | | ReportProductExpirationDate = e.Report_Product_Expiration__c.format(); |
| | | } |
| | | } |
| | | public ConsumableorderdetailsInfo(Product2__c e) { |
| | | Prod = e; |
| | | } |
| | | // 排序 |
| | | public Integer compareTo(Object compareTo) { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | global class LogAutoSendBatch implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful { |
| | | |
| | | private String typeNFM; |
| | | private String messageGroupNumber; |
| | | private Datetime times; |
| | | private Boolean isForecast;// 20220318 ljh SWAG-CC54R2 add |
| | | private String loginId; |
| | | |
| | | //20230203 lt 计划的作业优化 一小时两次 start |
| | | private BatchEmailUtil.ScBean scB1; |
| | | //20230203 lt 计划的作业优化 一小时两次 end |
| | | |
| | | /** |
| | | * コンスタント |
| | | */ |
| | |
| | | */ |
| | | public Integer max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt); |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | |
| | | //20230203 lt 计划的作业优化 一小时两次 start |
| | | scB1 = BatchEmailUtil.setSc1('LogAutoSendSchedule', 0, 23, 0, '0 30 *', null); |
| | | if (System.Test.isRunningTest() == false) { |
| | | for(CronTrigger ct : [SELECT Id FROM CronTrigger WHERE CronJobDetail.Name =: scB1.scName]) { |
| | | System.abortJob(ct.Id); |
| | | } |
| | | system.schedule(scB1.scName, scB1.scTime, new LogAutoSendSchedule()); |
| | | } |
| | | //20230203 lt 计划的作业优化 一小时两次 end |
| | | |
| | | String profileId = UserInfo.getProfileId(); |
| | | // 20220318 ljh SWAG-CC54R2 add start |
| | | if(String.isNotBlank(typeNFM) && typeNFM == 'NFM010' && String.isBlank(messageGroupNumber)){ |
| | | return Database.getQueryLocator( |
| | | [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, |
| | | Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c, |
| | | retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | Type__c, |
| | | retry_cnt__c, |
| | | NFM501Future_Count__c, |
| | | NFM501_Web_Annex_Count__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = true |
| | | AND (retry_cnt__c = null OR (retry_cnt__c != null AND retry_cnt__c > 0 AND retry_cnt__c < : max_cnt)) |
| | | AND Type__c = : typeNFM ] |
| | | WHERE |
| | | RowDataFlg__c = TRUE |
| | | AND (retry_cnt__c = NULL |
| | | OR (retry_cnt__c != NULL |
| | | AND retry_cnt__c > 0 |
| | | AND retry_cnt__c < :max_cnt)) |
| | | AND Type__c = :typeNFM |
| | | ] |
| | | ); |
| | | } |
| | | // gzw 603 重发判断 暂时用 |
| | | // ljh只执行自己这条日志,而且这个日志retry_cnt__c不是0 |
| | | else if (String.isNotBlank(loginId)) { |
| | | return Database.getQueryLocator( |
| | | [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, |
| | | Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c, |
| | | retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | Type__c, |
| | | retry_cnt__c, |
| | | NFM501Future_Count__c, |
| | | NFM501_Web_Annex_Count__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = true |
| | | AND retry_cnt__c != 0 |
| | | AND id = : loginId ] |
| | | WHERE RowDataFlg__c = TRUE AND retry_cnt__c != 0 AND id = :loginId |
| | | ] |
| | | ); |
| | | } |
| | | // gzw 603 重发判断 暂时用 |
| | | // 2023-01-19 zyh add start |
| | | else if (String.isNotBlank(typeNFM) && String.isNotBlank(messageGroupNumber) && times == null) { |
| | | return Database.getQueryLocator( |
| | | [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, |
| | | Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c, |
| | | retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | Type__c, |
| | | retry_cnt__c, |
| | | NFM501Future_Count__c, |
| | | NFM501_Web_Annex_Count__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = true |
| | | AND Type__c = : typeNFM AND MessageGroupNumber__c = : messageGroupNumber |
| | | WHERE RowDataFlg__c = TRUE AND Type__c = :typeNFM AND MessageGroupNumber__c = :messageGroupNumber |
| | | ] |
| | | ); |
| | | } |
| | |
| | | //20191224 HWAG-BK65E8 add start |
| | | // if (String.isNotBlank(typeNFM) && String.isNotBlank(messageGroupNumber) && times != null) { |
| | | return Database.getQueryLocator( |
| | | [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, |
| | | Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c, |
| | | retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | Type__c, |
| | | retry_cnt__c, |
| | | NFM501Future_Count__c, |
| | | NFM501_Web_Annex_Count__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = true |
| | | WHERE |
| | | RowDataFlg__c = TRUE |
| | | AND Type__c != 'NFM007' // 2023-01-18 ZYH ADD |
| | | AND Type__c = : typeNFM AND CreatedDate >= : times AND MessageGroupNumber__c >= : messageGroupNumber |
| | | order by MessageGroupNumber__c asc ] |
| | | AND Type__c = :typeNFM |
| | | AND CreatedDate >= :times |
| | | AND MessageGroupNumber__c >= :messageGroupNumber |
| | | ORDER BY MessageGroupNumber__c ASC |
| | | ] |
| | | ); |
| | | //20191224 HWAG-BK65E8 add end |
| | | } else if (profileId.left(15).equals('00e10000000dzzG') || profileId.left(15).equals('00e10000000Y3o5')) { |
| | | return Database.getQueryLocator( |
| | | [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, |
| | | Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c, |
| | | retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | Type__c, |
| | | retry_cnt__c, |
| | | NFM501Future_Count__c, |
| | | NFM501_Web_Annex_Count__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = true |
| | | WHERE |
| | | RowDataFlg__c = TRUE |
| | | AND Type__c != 'NFM007' // 2023-01-18 ZYH ADD |
| | | AND ((retry_cnt__c != null AND retry_cnt__c > 0 AND retry_cnt__c < : max_cnt) |
| | | OR (NFM501Future_Count__c != null |
| | | AND NFM501Future_Count__c > 0 AND NFM501Future_Count__c < : max_cnt) |
| | | OR(NFM501_Web_Annex_Count__c != null |
| | | AND NFM501_Web_Annex_Count__c > 0 AND NFM501_Web_Annex_Count__c < : max_cnt))] |
| | | AND ((retry_cnt__c != NULL |
| | | AND retry_cnt__c > 0 |
| | | AND retry_cnt__c < :max_cnt) |
| | | OR (NFM501Future_Count__c != NULL |
| | | AND NFM501Future_Count__c > 0 |
| | | AND NFM501Future_Count__c < :max_cnt) |
| | | OR (NFM501_Web_Annex_Count__c != NULL |
| | | AND NFM501_Web_Annex_Count__c > 0 |
| | | AND NFM501_Web_Annex_Count__c < :max_cnt)) |
| | | ] |
| | | ); |
| | | }else { |
| | | return Database.getQueryLocator( |
| | | [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, |
| | | Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, Type__c, |
| | | retry_cnt__c, NFM501Future_Count__c, NFM501_Web_Annex_Count__c |
| | | [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Log__c, |
| | | ErrorLog__c, |
| | | Log2__c, |
| | | Log3__c, |
| | | Log4__c, |
| | | Log5__c, |
| | | Log6__c, |
| | | Log7__c, |
| | | Log8__c, |
| | | Log9__c, |
| | | Log10__c, |
| | | Log11__c, |
| | | Log12__c, |
| | | MessageGroupNumber__c, |
| | | Type__c, |
| | | retry_cnt__c, |
| | | NFM501Future_Count__c, |
| | | NFM501_Web_Annex_Count__c |
| | | FROM BatchIF_Log__c |
| | | WHERE RowDataFlg__c = true |
| | | WHERE |
| | | RowDataFlg__c = TRUE |
| | | AND Type__c != 'NFM007' // 2023-01-18 ZYH ADD |
| | | AND ((retry_cnt__c != null AND retry_cnt__c > 0 AND retry_cnt__c < : max_cnt) |
| | | OR (NFM501Future_Count__c != null |
| | | AND NFM501Future_Count__c > 0 AND NFM501Future_Count__c < : max_cnt) |
| | | OR(NFM501_Web_Annex_Count__c != null |
| | | AND NFM501_Web_Annex_Count__c > 0 AND NFM501_Web_Annex_Count__c < : max_cnt)) |
| | | AND ((retry_cnt__c != NULL |
| | | AND retry_cnt__c > 0 |
| | | AND retry_cnt__c < :max_cnt) |
| | | OR (NFM501Future_Count__c != NULL |
| | | AND NFM501Future_Count__c > 0 |
| | | AND NFM501Future_Count__c < :max_cnt) |
| | | OR (NFM501_Web_Annex_Count__c != NULL |
| | | AND NFM501_Web_Annex_Count__c > 0 |
| | | AND NFM501_Web_Annex_Count__c < :max_cnt)) |
| | | AND ownerId = : UserInfo.getUserId() |
| | | ORDER BY CreatedDate // 2023-02-04 ZYH ADD |
| | | ] |
| | |
| | | if (strType_c == 'NFM001') { |
| | | NFM001Controller.execute(rowData, null); |
| | | } |
| | | if (strType_c == 'NFM002') { |
| | | NFM002WebService.execute(rowData.Id); |
| | | } |
| | | if (strType_c == 'NFM006') { |
| | | NFM006WebService.execute(rowData.Id); |
| | | } |
| | | // 清理Apex 20230428 LHJ Start |
| | | //if (strType_c == 'NFM002') { |
| | | // NFM002WebService.execute(rowData.Id); |
| | | //} |
| | | //if (strType_c == 'NFM006') { |
| | | // NFM006WebService.execute(rowData.Id); |
| | | //} |
| | | // 清理Apex 20230428 LHJ End |
| | | if (strType_c == 'NFM007') { |
| | | NFM007Controller.execute(rowData, null); |
| | | } |
| | |
| | | // if (strType_c == 'NFM624') {//智慧医疗pk |
| | | // NFM624Rest.main(rowData.Id); |
| | | // } |
| | | if (strType_c == 'NFM624Rest2') {//智慧医疗pk |
| | | if (strType_c == 'NFM624Rest2') { |
| | | //智慧医疗pk |
| | | NFMUtil.againSendToAWS624(rowData.Id); |
| | | } |
| | | //zhj 新方案改造 2023-01-06 end |
| | | if (strType_c == 'NFM622') { |
| | | NFM622Controller.execute(rowData, null); |
| | | } |
| | | if (strType_c == 'NFM112') {//先款后修pk |
| | | if (strType_c == 'NFM112') { |
| | | //先款后修pk |
| | | NFM112Controller.ManualExecute(rowData.id); |
| | | } |
| | | if (strType_c == 'NFM113') {//先款后修pk |
| | | if (strType_c == 'NFM113') { |
| | | //先款后修pk |
| | | NFM113Rest.main(rowData.id); |
| | | } |
| | | if (strType_c == 'NFM701') { |
| | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | BatchEmailUtil.removeOtherSc('LogAutoSendSchedule', scB1.scName); //20230203 lt 计划的作业优化 |
| | | |
| | | // 今回はやることないです |
| | | // 20220318 ljh SWAG-CC54R2 add start |
| | | if(String.isNotBlank(typeNFM) && typeNFM == 'NFM010' && isForecast){ |
| | |
| | | request.setEndpoint(hostUrl + '/api/nfm/reCallNFM624Batch?nfm624RequestId=' + GeDataList[0].nfm624RequestId + '&rowDataId=' + rowDataId); |
| | | request.setMethod('GET'); |
| | | request.setHeader('pi-token',documentPI.token); |
| | | request.setTimeout(60000); |
| | | HttpResponse response = http.send(request); |
| | | System.debug('response = ' + response); |
| | | System.debug('send batchSendToAWS624'); |
| | | } |
| | | //zhj batch 调用624接口的时候 需要调用AWS 2023-01-08 end |
| | |
| | | |
| | | public static Integer ControllerUtil() { |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | |
| | | |
| | | WebService static String updateOpportunity() { |
| | | Id execBTId = Database.executeBatch(new OCMManagementProvinceBatch(null), 200); |
| | | Id udpateSign = Database.executeBatch(new OCManagement); |
| | | return '1'; |
| | | } |
| | | } |
| | |
| | | public with sharing class OCSMHandler extends Oly_TriggerHandler { |
| | | //LY 2021/11/12 start |
| | | //平台窗口1、2、3任何一个有变更都会触发客户人员接口,向共通平台发送 |
| | | public static void OCSMToUser(List<OCM_Management_Province__c> newList, Map<Id, OCM_Management_Province__c> newMap, List<OCM_Management_Province__c> oldList, Map<Id, OCM_Management_Province__c> oldMap){ |
| | | |
| | | public static void OCSMToUser( |
| | | List<OCM_Management_Province__c> newList, |
| | | Map<Id, OCM_Management_Province__c> newMap, |
| | | List<OCM_Management_Province__c> oldList, |
| | | Map<Id, OCM_Management_Province__c> oldMap |
| | | ) { |
| | | OCM_Management_Province__c old = null; |
| | | List<String> noList = new List<String>(); |
| | | for (OCM_Management_Province__c local : newList) { |
| | | |
| | | if (Trigger.isInsert) { |
| | | if (String.isNotBlank(local.OnlinePlatformWindow1__c)) { |
| | | noList.add(local.OnlinePlatformWindow1__c); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (noList.size() > 0) { |
| | | NFM621Controller.callout('', noList); |
| New file |
| | |
| | | public with sharing class PaginatedListControllerLwc { |
| | | @AuraEnabled |
| | | public static PaginatedAccounts getAccountsPaginated(Integer pageSize, Integer pageToken, String sortField, String sortOrder) { |
| | | system.debug('init soql'+ String.valueOf(pageSize) + String.valueof(pageToken)); |
| | | PaginatedAccounts paginatedAccounts = new PaginatedAccounts(); |
| | | String paginatedQuery = 'SELECT Name, Type, Phone, NumberOfEmployees, Owner.Name' |
| | | + ' FROM Account' |
| | | + ' WITH SECURITY_ENFORCED'; |
| | | system.debug('sort field:'+sortField + '--'+sortOrder); |
| | | if(sortField != null && sortOrder !=null) { |
| | | paginatedQuery += ' ORDER BY '+ sortField +' '+ sortOrder; |
| | | } |
| | | paginatedQuery += ' LIMIT ' + pageSize; |
| | | paginatedQuery += ' OFFSET ' + pageToken; |
| | | system.debug('SOQL:' + paginatedQuery); |
| | | paginatedAccounts.records = Database.query(paginatedQuery); |
| | | Integer totalCount = [SELECT COUNT() FROM Account]; |
| | | |
| | | paginatedAccounts.nextPageToken = (pageToken + pageSize < totalCount) ? pageToken + pageSize : null; |
| | | paginatedAccounts.recordStart = pageToken + 1; |
| | | paginatedAccounts.pageNumber = pageToken/pageSize + 1; |
| | | Integer recordEnd = pageSize * paginatedAccounts.pageNumber; |
| | | paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount; |
| | | paginatedAccounts.totalRecords = totalCount; |
| | | return paginatedAccounts; |
| | | } |
| | | |
| | | public class PaginatedAccounts { |
| | | @AuraEnabled |
| | | public List<Account> records; |
| | | @AuraEnabled |
| | | public Integer nextPageToken; |
| | | @AuraEnabled |
| | | public Integer pageNumber {get;set;} |
| | | @AuraEnabled |
| | | public Integer totalRecords {get;set;} |
| | | @AuraEnabled |
| | | public Integer recordStart {get;set;} |
| | | @AuraEnabled |
| | | public Integer recordEnd {get;set;} |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | List<hospitalprice__c> hpList = [select id,hospital__c,product__c from hospitalprice__c where account__c = :accountid]; |
| | | if (hpList!= null && hpList.size() > 0) { |
| | | for (hospitalprice__c hp : hpList) { |
| | | if(hp.product__c!=null && String.valueof(hp.product__c).length()>=15){//Add by Li Jun for issue fix 20230403 |
| | | proIdMap.put((''+hp.product__c).subString(0,15)+'是', ''); |
| | | if (hp.hospital__c ==coc.Order_ForHospital__c) { |
| | | proHosMap.put((''+hp.product__c).subString(0,15)+'是', ''); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'proIdMap '+ proIdMap)); |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'proHosMap '+ proHosMap)); |
| New file |
| | |
| | | public with sharing class SampleLookupController { |
| | | private final static Integer MAX_RESULTS = 5; |
| | | |
| | | @AuraEnabled(cacheable=true scope='global') |
| | | public static List<LookupSearchResult> search(String searchTerm, List<String> selectedIds) { |
| | | // Prepare query parameters |
| | | searchTerm += '*'; |
| | | |
| | | // Execute search query |
| | | // List<List<SObject>> searchResults = [ |
| | | // FIND :searchTerm |
| | | // IN ALL FIELDS |
| | | // RETURNING |
| | | // Account(Id, Name, BillingCity WHERE id NOT IN :selectedIds), |
| | | // Opportunity(Id, Name, StageName WHERE id NOT IN :selectedIds) |
| | | // LIMIT :MAX_RESULTS |
| | | // ]; |
| | | |
| | | // Prepare results |
| | | List<LookupSearchResult> results = new List<LookupSearchResult>(); |
| | | |
| | | // Extract Accounts & convert them into LookupSearchResult |
| | | String accountIcon = 'standard:account'; |
| | | //Account[] accounts = (List<Account>) searchResults[0]; |
| | | Account[] accounts = [select id,Name,CreatedDate,BillingCity from Account limit 5]; |
| | | for (Account account : accounts) { |
| | | String subtitle = account.BillingCity == null ? 'Account' : 'Account • ' + account.BillingCity; |
| | | results.add(new LookupSearchResult(account.Id, 'Account', accountIcon, account.Name, subtitle)); |
| | | } |
| | | |
| | | // Extract Opportunities & convert them into LookupSearchResult |
| | | // String opptyIcon = 'standard:opportunity'; |
| | | // Opportunity[] opptys = (List<Opportunity>) searchResults[1]; |
| | | // for (Opportunity oppty : opptys) { |
| | | // results.add( |
| | | // new LookupSearchResult( |
| | | // oppty.Id, |
| | | // 'Opportunity', |
| | | // opptyIcon, |
| | | // oppty.Name, |
| | | // 'Opportunity • ' + oppty.StageName |
| | | // ) |
| | | // ); |
| | | // } |
| | | |
| | | // Optionnaly sort all results on title |
| | | results.sort(); |
| | | System.debug('results = ' + results); |
| | | return results; |
| | | } |
| | | |
| | | @AuraEnabled(cacheable=true scope='global') |
| | | public static List<LookupSearchResult> getRecentlyViewed() { |
| | | List<LookupSearchResult> results = new List<LookupSearchResult>(); |
| | | // Get recently viewed records of type Account or Opportunity |
| | | List<RecentlyViewed> recentRecords = [ |
| | | SELECT Id, Name, Type |
| | | FROM RecentlyViewed |
| | | WHERE Type = 'Account' OR Type = 'Opportunity' |
| | | ORDER BY LastViewedDate DESC |
| | | LIMIT 5 |
| | | ]; |
| | | // Convert recent records into LookupSearchResult |
| | | for (RecentlyViewed recentRecord : recentRecords) { |
| | | if (recentRecord.Type == 'Account') { |
| | | results.add( |
| | | new LookupSearchResult( |
| | | recentRecord.Id, |
| | | 'Account', |
| | | 'standard:account', |
| | | recentRecord.Name, |
| | | 'Account • ' + recentRecord.Name |
| | | ) |
| | | ); |
| | | } else { |
| | | results.add( |
| | | new LookupSearchResult( |
| | | recentRecord.Id, |
| | | 'Opportunity', |
| | | 'standard:opportunity', |
| | | recentRecord.Name, |
| | | 'Opportunity • ' + recentRecord.Name |
| | | ) |
| | | ); |
| | | } |
| | | } |
| | | return results; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>57.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global without sharing class SyncProvinceWIndowToSignForm implements Database.Batchable<sObject>, Database.Stateful { |
| | | private Set<String> changedWindowProvince { get; set; } |
| | | |
| | | global SyncProvinceWIndowToSignForm(Set<String> changedWindowProvince) { |
| | | this.changedWindowProvince = changedWindowProvince; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | String query = 'select Sales_assistant_name_text__c,isProcessed__c,OCM_man_province_cus__c from eSignForm__c '; |
| | | if (changedWindowProvince != null && changedWindowProvince.size() > 0) { |
| | | if (!Test.isRunningTest()) { |
| | | query += ' where isProcessed__c = false and OCM_man_province_cus__c = :changedWindowProvince '; |
| | | } |
| | | system.debug('SOQL:' + query); |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, List<eSignForm__c> signFormList) { |
| | | system.debug('sign form list size:' + signFormList.size()); |
| | | // 取得OCM管理省信息 |
| | | Map<String, OCM_Management_Province__c> provinceMap = DNUpsertBatch.getManagementProvince(); |
| | | // 判断需要更新的签收单 |
| | | List<eSignForm__c> updList = new List<eSignForm__c>(); |
| | | if (signFormList != null && signFormList.size() > 0) { |
| | | for (eSignForm__c temp : signFormList) { |
| | | String provinceName = Test.isRunningTest() ? '北京市' : temp.OCM_man_province_cus__c; |
| | | if (provinceName != '' && provinceMap.containsKey(provinceName) && provinceMap.get(provinceName).Window1__c != null) { |
| | | temp.Sales_assistant_name_text__c = provinceMap.get(provinceName).Window1__c; |
| | | updList.add(temp); |
| | | } |
| | | } |
| | | // 签收单更新 |
| | | if (updList.size() > 0) { |
| | | Database.SaveResult[] lsr = Database.update(updList, false); |
| | | system.debug('Upsert Result' + lsr); |
| | | } |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | } |
| | | |
| | | public static void syncProvinceWIndow(Set<String> changedWindowProvince) { |
| | | if (changedWindowProvince != null && changedWindowProvince.size() > 0) { |
| | | Database.executeBatch(new SyncProvinceWIndowToSignForm(changedWindowProvince), 200); |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public with sharing class SyncProvinceWIndowToSignFormTest { |
| | | @isTest |
| | | private static void testTestCase() { |
| | | // Test data setup |
| | | //新建电子签收单 |
| | | map <string, eSignForm__c> eSFMap = new map <string, eSignForm__c>(); |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | eSignForm.DNName__c = '112233'; |
| | | eSFMap.put(eSignForm.DNName__c, eSignForm); |
| | | |
| | | Statu_Achievements_DN__c sad = new Statu_Achievements_DN__c(); |
| | | sad.Name = '112233'; |
| | | sad.DeliveryDate_Raw__c = '1111'; |
| | | sad.Sales_assistant_name_text__c = UserInfo.getUserId(); |
| | | sad.RC_Manager__c = UserInfo.getUserId(); |
| | | sad.EsignTestAccount__c =true; |
| | | sad.ReturnMark__c = false; |
| | | |
| | | list<Statu_Achievements_DN__c> DNList = new list<Statu_Achievements_DN__c>(); |
| | | DNList.add(sad); |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | Account company = new Account(); |
| | | company.RecordTypeId = rectCo[0].Id; |
| | | company.Name = 'TestCompany'; |
| | | upsert company; |
| | | Account section = new Account(); |
| | | section.RecordTypeId = rectSct[0].Id; |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = company.Id; |
| | | section.Hospital_Department_Class__c = company.Id; |
| | | upsert section; |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = rectDpt[0].Id; |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'TestDepart'; |
| | | depart.ParentId = section.Id; |
| | | depart.Department_Class__c = section.Id; |
| | | depart.Hospital__c = company.Id; |
| | | upsert depart; |
| | | |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | | CloseDate=Date.today(), |
| | | AccountId=depart.Id, |
| | | Sales_Root__c = '販売店', |
| | | Competitor__c ='A', |
| | | Click_Close_Date__c = null, |
| | | RecordType = rectOpp |
| | | ); |
| | | insert opp; |
| | | |
| | | //注残 |
| | | Statu_Achievements__c Sac = new Statu_Achievements__c( |
| | | name = 'zhucan_one', |
| | | Opportunity__c = opp.id, |
| | | DeliveryDate__c = Date.today(), |
| | | ContractNO__c = 'ContractNO1', |
| | | ContractAmount__c = 1000 |
| | | ); |
| | | insert Sac; |
| | | list<eSignForm__c> esignFormTest = DNUpsertBatch.SetupeSignForm(eSFMap, DNList); |
| | | esignFormTest[0].Statu_Achievements__c = Sac.Id; |
| | | insert esignFormTest; |
| | | system.debug('Test esignForm Data:' + esignFormTest); |
| | | |
| | | OCM_Management_Province__c ocsmTest = new OCM_Management_Province__c(); |
| | | ocsmTest.Name = '其他'; |
| | | ocsmTest.Province__c = '北京市'; |
| | | insert ocsmTest; |
| | | ocsmTest.Window1__c = Userinfo.getUserId(); |
| | | update ocsmTest; |
| | | |
| | | // Actual test |
| | | Test.startTest(); |
| | | //SyncProvinceWIndowToSignForm.syncProvinceWIndow(new Set<String>{'北京市'}); |
| | | //SyncProvinceWIndowToSignForm.syncProvinceWIndow(new Set<String>()); |
| | | Test.stopTest(); |
| | | |
| | | // Asserts |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public without sharing class TestClassByLiJun { |
| | | public TestClassByLiJun() { |
| | | system.debug(Test.isRunningTest()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | global Boolean ManualExecution_Identification = false; |
| | | //默认跑所有签收单 |
| | | global updateESignBatch() { |
| | | |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | |
| | | } |
| | | //更新某一条的签收单 |
| | | global updateESignBatch(String id) { |
| | | |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | system.debug('手动传参1:' + ManualExecution_Identification); |
| | |
| | | // 如果哟同名的Batch计划删除已存在的计划重新设置 |
| | | if (haveError) { |
| | | haveError = false; |
| | | for (CronTrigger ct : [SELECT Id, CronJobDetailId, CronExpression, CronJobDetail.Name |
| | | for (CronTrigger ct : [ |
| | | SELECT Id, CronJobDetailId, CronExpression, CronJobDetail.Name |
| | | FROM CronTrigger |
| | | WHERE CronJobDetail.Name = :scB.scName]) { |
| | | WHERE CronJobDetail.Name = :scB.scName |
| | | ]) { |
| | | System.abortJob(ct.Id); |
| | | } |
| | | try { |
| | |
| | | b.scName = baseName + '001'; |
| | | b.scTime = '0 ' + minMin + ' ' + (hour + 1) + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + minMin + ' ' + (hour + 1) +' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | |
| | | } |
| | | return b; |
| | | } |
| | | |
| | | public static void removeOtherSc(String likeName, String needName) { |
| | | String likeStr = likeName + '00%'; |
| | | for (CronTrigger ct : [SELECT Id, CronJobDetailId, CronExpression, CronJobDetail.Name |
| | | for (CronTrigger ct : [ |
| | | SELECT Id, CronJobDetailId, CronExpression, CronJobDetail.Name |
| | | FROM CronTrigger |
| | | WHERE CronJobDetail.Name Like :likeStr |
| | | AND CronJobDetail.Name != :needName]) { |
| | | WHERE CronJobDetail.Name LIKE :likeStr AND CronJobDetail.Name != :needName |
| | | ]) { |
| | | System.abortJob(ct.Id); |
| | | } |
| | | } |
| | |
| | | //存放 签收单id,文件数量 |
| | | Map < String, Integer > fileMap = new Map < String, Integer > (); |
| | | //驳回后删除文件 后 排序问题 精琢技术 wql 2020/12/24 start |
| | | // List<Attachment> esignAttachAgencyList = new List<Attachment>(); |
| | | // List<Attachment> esignAttachHPList = new List<Attachment>(); |
| | | List<FileAddress__c> esignAttachAgencyList = new List<FileAddress__c>(); //zhj Attachment To AWS 2023-02-06 |
| | | List<FileAddress__c> esignAttachHPList = new List<FileAddress__c>(); //zhj Attachment To AWS 2023-02-06 |
| | | List<Attachment> esignAttachAgencyList = new List<Attachment>(); |
| | | List<Attachment> esignAttachHPList = new List<Attachment>(); |
| | | Map<String, Integer> fileAgencyMap = new Map<String, Integer>(); |
| | | Map<String, Integer> fileHPMap = new Map<String, Integer>(); |
| | | //驳回后删除文件 后 排序问题 精琢技术 wql 2020/12/24 end |
| | |
| | | //用于判断删除驳回的附件的筛选条件 |
| | | Map < Id, eSignForm__c > rejectESignEneryMap = new Map < Id, eSignForm__c > (); |
| | | //驳回后 删除之前上传的文件id |
| | | //List<Attachment> deleteLastFileList = new List<Attachment>(); |
| | | List<FileAddress__c> deleteLastFileList = new List<FileAddress__c>(); //zhj Attachment To AWS 2023-02-06 |
| | | List<Attachment> deleteLastFileList = new List<Attachment>(); |
| | | //存放未更新前的经销商审批状态 |
| | | Map < String, String > oldESignAgencyStatusMap = new Map < String, String > (); |
| | | //存放未更新前的医院审批状态 |
| | |
| | | if (esForm.agencyRejectDate__c != null || esForm.HPRejectDate__c != null) { |
| | | rejectESignEneryMap.put(esForm.Id, esForm); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | system.debug('rejectESignEneryMap:' + rejectESignEneryMap); |
| | | //如果map不为空 则作为筛选条件 |
| | | if (rejectESignEneryMap.size()>0) { |
| | | // List<Attachment> deleteFileList = [SELECT parentId, createdDate, Name,Description |
| | | // FROM Attachment |
| | | // WHERE parentId IN: rejectESignEneryMap.keySet() order by createdDate]; |
| | | List<FileAddress__c> deleteFileList = [SELECT ParentRecordId__c, createdDate, FileName__c |
| | | FROM FileAddress__c |
| | | WHERE ParentRecordId__c IN: rejectESignEneryMap.keySet() order by createdDate]; //zhj Attachment To AWS 2023-02-06 |
| | | List<Attachment> deleteFileList = [ |
| | | SELECT parentId, createdDate, Name, Description |
| | | FROM Attachment |
| | | WHERE parentId IN :rejectESignEneryMap.keySet() |
| | | ORDER BY createdDate |
| | | ]; |
| | | system.debug('deleteFileList:' + deleteFileList); |
| | | if (deleteFileList.size() > 0) { |
| | | for (eSignForm__c esFile : rejectESignEneryMap.values()) { |
| | | //for (Attachment att : deleteFileList) { |
| | | for (FileAddress__c att : deleteFileList) { //zhj Attachment To AWS 2023-02-06 |
| | | for (Attachment att : deleteFileList) { |
| | | if (esFile.agencyRejectDate__c != null || esFile.HPRejectDate__c != null) { |
| | | if (att.ParentRecordId__c == esFile.Id ) { |
| | | if (att.parentId == esFile.Id) { |
| | | //①经销商驳回后需要删除的附件 |
| | | if (esFile.agencyRejectDate__c != null) { |
| | | //zhj Attachment To AWS 2023-02-06 |
| | | // if (att.Name.substring(0, 1) == 'A' && att.createdDate < esFile.agencyRejectDate__c) { |
| | | // deleteLastFileList.add(att); |
| | | // } |
| | | if (att.FileName__c.substring(0, 1) == 'A' && att.createdDate < esFile.agencyRejectDate__c) { |
| | | if (att.Name.substring(0, 1) == 'A' && att.createdDate < esFile.agencyRejectDate__c) { |
| | | deleteLastFileList.add(att); |
| | | } |
| | | } |
| | | //②医院驳回后需要删除的附件 |
| | | if (esFile.HPRejectDate__c != null) { |
| | | //zhj Attachment To AWS 2023-02-06 |
| | | // if (att.Name.substring(0, 1) == 'H' && att.createdDate < esFile.HPRejectDate__c) { |
| | | // deleteLastFileList.add(att); |
| | | // } |
| | | if (att.FileName__c.substring(0, 1) == 'H' && att.createdDate < esFile.HPRejectDate__c) { |
| | | if (att.Name.substring(0, 1) == 'H' && att.createdDate < esFile.HPRejectDate__c) { |
| | | deleteLastFileList.add(att); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | system.debug('驳回后删除的文件:' + deleteLastFileList); |
| | |
| | | } |
| | | |
| | | //检索所有录入表 |
| | | List < eSignFormEntry__c > eSignFormEntryList = [select id, Name, entryType__c, eSignForm__c, eSignForm__r.OCM_man_province_cus__c, salesManageConfirmDate__c, salesHPManageConfirmDate__c, agencyScanDayBack__c, agencySignUpDateBack__c, agencyConfirmDateBack__c, HPScanDayBack__c, HPSignUpDateBack__c, HPConfirmDateBack__c, |
| | | eSignForm__r.Name, IsSubmit__c, IsHPSubmit__c, IsAgencyConfirmSubmit__c, agencyAutoSignUpStatus__c, HPSignUpStatus__c, Sales_Root_Formula__c, Sales_assistant_ID__c, IsHandled__c, IsHPHandled__c, createdDate, AgencyWorkflowEmailBack__c, HPWorkflowEmailBack__c, AgencyWorkflowEmail__c, HPWorkflowEmail__c, eSignForm__r.Id, agencyDNSignUpStatus__c, HPDNSignUpStatus__c, agencyReject__c, HPReject__c, IsAgencyScan__c, IsHPScan__c |
| | | from eSignFormEntry__c |
| | | where eSignForm__c IN: esFormidList |
| | | order by eSignForm__c, createdDate asc |
| | | List<eSignFormEntry__c> eSignFormEntryList = [ |
| | | SELECT |
| | | id, |
| | | Name, |
| | | entryType__c, |
| | | eSignForm__c, |
| | | eSignForm__r.OCM_man_province_cus__c, |
| | | salesManageConfirmDate__c, |
| | | salesHPManageConfirmDate__c, |
| | | agencyScanDayBack__c, |
| | | agencySignUpDateBack__c, |
| | | agencyConfirmDateBack__c, |
| | | HPScanDayBack__c, |
| | | HPSignUpDateBack__c, |
| | | HPConfirmDateBack__c, |
| | | eSignForm__r.Name, |
| | | IsSubmit__c, |
| | | IsHPSubmit__c, |
| | | IsAgencyConfirmSubmit__c, |
| | | agencyAutoSignUpStatus__c, |
| | | HPSignUpStatus__c, |
| | | Sales_Root_Formula__c, |
| | | Sales_assistant_ID__c, |
| | | IsHandled__c, |
| | | IsHPHandled__c, |
| | | createdDate, |
| | | AgencyWorkflowEmailBack__c, |
| | | HPWorkflowEmailBack__c, |
| | | AgencyWorkflowEmail__c, |
| | | HPWorkflowEmail__c, |
| | | eSignForm__r.Id, |
| | | agencyDNSignUpStatus__c, |
| | | HPDNSignUpStatus__c, |
| | | agencyReject__c, |
| | | HPReject__c, |
| | | IsAgencyScan__c, |
| | | IsHPScan__c |
| | | FROM eSignFormEntry__c |
| | | WHERE eSignForm__c IN :esFormidList |
| | | ORDER BY eSignForm__c, createdDate ASC |
| | | ]; |
| | | |
| | | if (eSignFormEntryList.size() > 0) { |
| | |
| | | eSignNameMap.put(eid, eSignFormEntryWhole.eSignForm__r.Name); |
| | | } |
| | | |
| | | |
| | | //存放录入表id,记录类型 id,type 文件用 |
| | | eSignTypeMap.put(eSignFormEntryWhole.Id, eSignFormEntryWhole.entryType__c); |
| | | } |
| | |
| | | for (Id esFormid : esFormidList) { |
| | | //内层是签收单录入表 |
| | | for (eSignFormEntry__c eSignFormEntry : eSignFormEntryList) { |
| | | |
| | | //①取最新的 录入表 + 未处理的 |
| | | if (esFormid.equals(eSignFormEntry.eSignForm__c)) { |
| | | |
| | | if (!eSignFormEntry.IsHandled__c) { |
| | | //存放 签收单id,录入表id |
| | | eSignIdMap.put(esFormid, eSignFormEntry.Id); |
| | |
| | | // break; |
| | | } |
| | | eSignFormLastIdMap.put(esFormid, eSignFormEntry.Id); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | //最后更新的录入表id |
| | |
| | | //重新对附件排序 规则变为根据签收单现有附件序号进行排序 精琢技术 wql start |
| | | //暂时存放一下签收单名称 |
| | | Map<string, string> tempMap = new Map<string, string>(); |
| | | //zhj Attachment To AWS 2023-02-06 |
| | | // List<Attachment> tempAttList = [SELECT parentId, createdDate, Name,Description |
| | | // FROM Attachment |
| | | // WHERE parentId IN: esFormidList order by createdDate]; |
| | | List<FileAddress__c> tempAttList = [SELECT ParentRecordId__c, createdDate, FileName__c |
| | | FROM FileAddress__c |
| | | WHERE ParentRecordId__c IN: esFormidList order by createdDate]; |
| | | List<Attachment> tempAttList = [ |
| | | SELECT parentId, createdDate, Name, Description |
| | | FROM Attachment |
| | | WHERE parentId IN :esFormidList |
| | | ORDER BY createdDate |
| | | ]; |
| | | if (tempAttList.size() > 0) { |
| | | //外层循环签收单 |
| | | for (String es : esFormidList) { |
| | | //zhj Attachment To AWS 2023-02-06 |
| | | //内层循环附件 |
| | | // for (Attachment att : tempAttList) { |
| | | // //如果id相等 |
| | | // if (es.equals(att.parentId)) { |
| | | // //根据名称拆分 存入不同list |
| | | // String name = att.Name; |
| | | // if (name.substring(0, 1).equals('A')) { |
| | | // esignAttachAgencyList.add(att); |
| | | // } else if (name.substring(0, 1).equals('H')) { |
| | | // esignAttachHPList.add(att); |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | for (FileAddress__c att : tempAttList) { |
| | | for (Attachment att : tempAttList) { |
| | | //如果id相等 |
| | | if (es.equals(att.ParentRecordId__c)) { |
| | | if (es.equals(att.parentId)) { |
| | | //根据名称拆分 存入不同list |
| | | String name = att.FileName__c; |
| | | String name = att.Name; |
| | | if (name.substring(0, 1).equals('A')) { |
| | | esignAttachAgencyList.add(att); |
| | | } else if (name.substring(0, 1).equals('H')) { |
| | | esignAttachHPList.add(att); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //分别存入到经销商or医院的附件map 用于后期命名 |
| | |
| | | //清空list 供下一个签收单使用 |
| | | esignAttachAgencyList.clear(); |
| | | esignAttachHPList.clear(); |
| | | |
| | | } |
| | | } |
| | | system.debug('fileAgencyMap:' + fileAgencyMap); |
| | |
| | | //重新对附件排序 规则变为根据签收单现有附件序号进行排序 精琢技术 wql end |
| | | |
| | | //根据所有的签收单录入表id检索所有的签收单明细录入 |
| | | List < eSignFormLineItemEntry__c > eSignFormLineItemEntryLists = [select id, eSignFormEntry__r.entryType__c, eSignFormEntry__r.IsHandled__c, eSignFormLineItem__c, eSignFormEntry__c, |
| | | agencyConfirmResult__c, HPConfirmResult__c, HPGoodStatus__c, agencyGoodStatus__c |
| | | from eSignFormLineItemEntry__c where eSignFormEntry__c in : luruIsSubmitList and eSignFormEntry__r.IsHandled__c = false order by createdDate asc |
| | | List<eSignFormLineItemEntry__c> eSignFormLineItemEntryLists = [ |
| | | SELECT |
| | | id, |
| | | eSignFormEntry__r.entryType__c, |
| | | eSignFormEntry__r.IsHandled__c, |
| | | eSignFormLineItem__c, |
| | | eSignFormEntry__c, |
| | | agencyConfirmResult__c, |
| | | HPConfirmResult__c, |
| | | HPGoodStatus__c, |
| | | agencyGoodStatus__c |
| | | FROM eSignFormLineItemEntry__c |
| | | WHERE eSignFormEntry__c IN :luruIsSubmitList AND eSignFormEntry__r.IsHandled__c = FALSE |
| | | ORDER BY createdDate ASC |
| | | ]; |
| | | if (eSignFormLineItemEntryLists.size() > 0) { |
| | | for (eSignFormLineItemEntry__c eSignFormLineItemEntry : eSignFormLineItemEntryLists) { |
| | |
| | | system.debug('eSignFormLineIdList:' + eSignFormLineIdList); |
| | | if (eSignFormLineIdList.size() > 0) { |
| | | //根据签收单明细录入表 去检索签收单明细 |
| | | List < eSignFormLineItem__c > eSignFormLineItemList = [select id, agencyGoodStatus__c, HPGoodStatus__c from eSignFormLineItem__c where id IN: eSignFormLineIdList]; |
| | | List<eSignFormLineItem__c> eSignFormLineItemList = [ |
| | | SELECT id, agencyGoodStatus__c, HPGoodStatus__c |
| | | FROM eSignFormLineItem__c |
| | | WHERE id IN :eSignFormLineIdList |
| | | ]; |
| | | if (eSignFormLineItemList.size() > 0) { |
| | | //外层签收单明细 |
| | | for (eSignFormLineItem__c eSignFormLineItem : eSignFormLineItemList) { |
| | |
| | | if (eSignFormLineIdList.size() > 0) { |
| | | //循环 更新签收单 |
| | | for (Id esefId : eSignFormLineIdList) { |
| | | |
| | | if (lasteSignFormLineItemEntryMap.containsKey(esefId)) { |
| | | eSignFormLineItemEntry__c luru = lasteSignFormLineItemEntryMap.get(esefId); |
| | | //new 一个签收单明细对象 |
| | |
| | | eSignFormLuRuList.add(eSignLuRu); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | System.debug('更新的签收单明细list:' + eSignFormLuRUList); |
| | |
| | | if (eSignFormEntry.agencyScanDayBack__c != null && eSignFormEntry.IsAgencyScan__c) { |
| | | eSignForm.agencyAutoSignUpStatus__c = '草案中'; |
| | | eSignForm.agencyReject__c = false; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | }else{ |
| | | oldESignAgencyStatusMap.put('A' + eSignForm.id, '无'); |
| | | } |
| | | |
| | | } |
| | | if (eSignFormEntry.HPDNSignUpStatus__c != '签收已完成') { |
| | | //如果医院确认日为空的话 进去判断更新医院审批状态 |
| | |
| | | if (eSignFormEntry.HPScanDayBack__c != null && eSignFormEntry.IsHPScan__c) { |
| | | eSignForm.HPSignUpStatus__c = '草案中'; |
| | | eSignForm.HPReject__c = false; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | }else{ |
| | | oldESignHPStatusMap.put('H' + eSignForm.id, '无'); |
| | | } |
| | | |
| | | } |
| | | |
| | | //如果没变化则不更新 |
| | |
| | | Sales_Root_Formula = eSignFormEntry.Sales_Root_Formula__c; |
| | | //录入类型 |
| | | type = eSignFormEntry.entryType__c; |
| | | |
| | | } |
| | | system.debug('签收单对象-----:' + eSignForm); |
| | | if (eSignForm != null) { |
| | | system.debug('eSignFormid:' + eSignFormid); |
| | | if (eSignForm.id != null) { |
| | | |
| | | eSignFormList.add(eSignForm); |
| | | } |
| | | |
| | | } |
| | | system.debug('eSignFormList111:' + eSignFormList); |
| | | if (eSignFormList.size() > 0) { |
| | | //更新OCSM管理省 担当 |
| | | eSignFormList = updateOwner(provinceList, provinceMap, eSignFormList, false); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | if (eSignFormList.size() <= 0) { |
| | |
| | | eSignFormList = updateOwner(provinceList, provinceMap, eSignList, true); |
| | | } |
| | | |
| | | |
| | | List<Id> fileList = new List<Id> (); |
| | | if (fileIdList.size() > 0) { |
| | | for (Id fileId : fileIdList) { |
| | | if (!fileList.contains(fileId)) { |
| | | fileList.add(fileId); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | System.debug('fileIdList:' + fileIdList); |
| | | System.debug('fileList:' + fileList); |
| | | //用于最后insert 附件 |
| | | //zhj Attachment To AWS 2023-02-06 |
| | | //List<Attachment> insertAttactment = new List<Attachment>(); |
| | | List<FileAddress__c> insertAttactment = new List<FileAddress__c>(); |
| | | List<Attachment> insertAttactment = new List<Attachment>(); |
| | | //附件 start |
| | | //List<Attachment> attachMentList = [SELECT id, parentId, Body, Name, ContentType,Description from Attachment where parentId IN :fileList and Description!='电子签收单:已处理']; |
| | | List<FileAddress__c> attachMentList = [SELECT id, ParentRecordId__c, FileName__c,subInfoType__c,AWS_File_Key__c,DownloadLink__c,ViewLink__c from FileAddress__c where ParentRecordId__c IN :fileList and subInfoType__c !='电子签收单:已处理']; |
| | | List<Attachment> attachMentList = [ |
| | | SELECT id, parentId, Body, Name, ContentType, Description |
| | | FROM Attachment |
| | | WHERE parentId IN :fileList AND Description != '电子签收单:已处理' |
| | | ]; |
| | | //修复已处理数据 附件没更新 即没有附件能提交的bug 精琢技术 wql 2021/01/19 start |
| | | //List<Attachment> eSignEntryAttachMentList = new List<Attachment>(); |
| | | List<FileAddress__c> eSignEntryAttachMentList = new List<FileAddress__c>(); |
| | | List<Attachment> eSignEntryAttachMentList = new List<Attachment>(); |
| | | //文件数量 用于文件命名 |
| | | Integer agencyCount = 0; |
| | | Integer hpCount = 0; |
| | |
| | | system.debug('eSignFlieIdMap:' + eSignFlieIdMap); |
| | | system.debug('eSignNameMap:' + eSignNameMap); |
| | | for (Id eSignFormEntryId : fileList) { |
| | | |
| | | for (FileAddress__c attach : attachMentList) { //zhj Attachment To AWS 2023-02-06 |
| | | |
| | | if (attach.ParentRecordId__c == eSignFormEntryId) { |
| | | Id eid = eSignFlieIdMap.get(attach.ParentRecordId__c); |
| | | for (Attachment attach : attachMentList) { |
| | | if (attach.parentId == eSignFormEntryId) { |
| | | Id eid = eSignFlieIdMap.get(attach.parentId); |
| | | system.debug('eid:' + eid); |
| | | |
| | | name = eSignNameMap.get(eid); |
| | | system.debug('name:' + name); |
| | | type = eSignTypeMap.get(attach.ParentRecordId__c); |
| | | type = eSignTypeMap.get(attach.parentId); |
| | | |
| | | //因为外层循环是中间表 如果2条以上录入表都有经销商附件 则使用最新构建的经销商附件数量来命名 |
| | | //否则取未更新之前有的经销商附件数量 并且 不是1个录入表多个附件 也就是false的时候 取模拟的最新数量 |
| | |
| | | }else if(agencySumCount>0){ |
| | | //本次循环内 第一次取附件数最新值 后续都在此基础上i++ |
| | | agencyCount =agencySumCount; |
| | | } |
| | | else if(fileAgencyMap.size() > 0){ |
| | | } else if (fileAgencyMap.size() > 0) { |
| | | //只有一条数据时,使用此附件数即可 后续在此基础上i++ |
| | | agencyCount = fileAgencyMap.get(eid); |
| | | } |
| | |
| | | }else if(hpSumCount >0 ){ |
| | | //本次循环内 第一次取附件数最新值 后续都在此基础上j++ |
| | | hpCount =hpSumCount; |
| | | } |
| | | else if(fileHPMap.size() > 0){ |
| | | } else if (fileHPMap.size() > 0) { |
| | | //只有一条数据时,使用此附件数即可 后续在此基础上j++ |
| | | hpCount = fileHPMap.get(eid); |
| | | } |
| | |
| | | // title = title +'.jpg'; |
| | | // } |
| | | //判断一下格式,不然下载下来是类型是所有文件 无法打开 |
| | | //zhj Attachment To AWS 2023-02-06 start |
| | | if (attach.FileName__c.lastIndexOf('.') > -1) { |
| | | title = title + attach.FileName__c.substring(attach.FileName__c.lastIndexOf('.')); |
| | | if (attach.Name.lastIndexOf('.') > -1) { |
| | | title = title + attach.Name.substring(attach.Name.lastIndexOf('.')); |
| | | } |
| | | |
| | | //Attachment newAttachment = attach.clone(); |
| | | FileAddress__c newAttachment = attach.clone(); |
| | | newAttachment.ParentRecordId__c = eid; |
| | | newAttachment.FileName__c = title; |
| | | Attachment newAttachment = attach.clone(); |
| | | newAttachment.parentId = eid; |
| | | newAttachment.name = title; |
| | | // newAttachment.ContentType =attach.ContentType; |
| | | //要更新的签收单附件 |
| | | insertAttactment.add(newAttachment); |
| | | //反更新录入表的附件 用来判断附件是否被更新 |
| | | //Attachment oldAttachment = new Attachment(); |
| | | FileAddress__c oldAttachment = new FileAddress__c(); |
| | | Attachment oldAttachment = new Attachment(); |
| | | oldAttachment.Id = attach.Id; |
| | | //oldAttachment.Description = '电子签收单:已处理'; |
| | | oldAttachment.subInfoType__c = '电子签收单:已处理'; |
| | | //zhj Attachment To AWS 2023-02-06 end |
| | | oldAttachment.Description = '电子签收单:已处理'; |
| | | eSignEntryAttachMentList.add(oldAttachment); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | //整单循环后 清空值 |
| | | i = 0; |
| | |
| | | agencySumCount =0; |
| | | hpSumCount=0; |
| | | } |
| | | |
| | | } |
| | | |
| | | //电子签收单 增加本次更新附件数量 2020/01/07 精琢技术 wql start |
| | |
| | | if (eSignFormList.size() > 0) { |
| | | //外层所有签收单 |
| | | for (eSignForm__c es : eSignFormList) { |
| | | |
| | | //a为经销商附件的数量 h为医院附件的数量 |
| | | Integer a = 0; |
| | | Integer h = 0; |
| | | |
| | | //内层所有需要更新的附件 |
| | | //for (Attachment att : insertAttactment) { |
| | | for (FileAddress__c att : insertAttactment) { //zhj Attachment To AWS 2023-02-06 |
| | | for (Attachment att : insertAttactment) { |
| | | if (es.Id != null) { |
| | | if (es.Id.equals(att.ParentRecordId__c)) { |
| | | if (es.Id.equals(att.parentId)) { |
| | | if (es.agencyAutoSignUpStatus__c != null) { |
| | | if (es.agencyAutoSignUpStatus__c.equals('申请中') && oldESignAgencyStatusMap.size()>0) { |
| | | if(!oldESignAgencyStatusMap.get('A' + es.Id).equals('申请中')){ |
| | | if (att.FileName__c.substring(0, 1).equals('A')) { //zhj Attachment To AWS 2023-02-06 |
| | | if (att.Name.substring(0, 1).equals('A')) { |
| | | a ++; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (es.HPSignUpStatus__c != null) { |
| | | if (es.HPSignUpStatus__c.equals('申请中') && oldESignHPStatusMap.size()>0) { |
| | | if(!oldESignHPStatusMap.get('H' + es.Id).equals('申请中')){ |
| | | if (att.FileName__c.substring(0, 1).equals('H')) { //zhj Attachment To AWS 2023-02-06 |
| | | if (att.Name.substring(0, 1).equals('H')) { |
| | | h ++; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //只有真正扫码提交的 并且没有附件才会被更新 |
| | |
| | | if(!oldESignAgencyStatusMap.get('A' + es.Id).equals('申请中')){ |
| | | es.agencyAttachNum__c = a; |
| | | } |
| | | |
| | | } |
| | | } |
| | | //只有真正扫码提交的 并且没有附件才会被更新 |
| | |
| | | if(!oldESignHPStatusMap.get('H' + es.Id).equals('申请中')){ |
| | | es.HPAttachNum__c = h; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | a = 0; |
| | | h = 0; |
| | | |
| | | } |
| | | } |
| | | //电子签收单 增加本次更新附件数量 2020/01/07 精琢技术 wql end |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }catch(NullPointerException npe){ |
| | | |
| | | iflog.ErrorLog__c += 'ERROR : eSignForm__c:空指针错误-行号:'+ npe.getLineNumber()+ '\n'; |
| | | } |
| | | catch (Exception e) { |
| | | } catch (Exception e) { |
| | | // Database.rollback(sp); |
| | | |
| | | iflog.ErrorLog__c += 'ERROR : eSignForm__c:'+ e.getMessage() + '\n'; |
| | | |
| | | } |
| | | try{ |
| | | System.debug('luruIsLastSubmitList:'+luruIsLastSubmitList); |
| | |
| | | private static void deleteMiddleData(Map < String, eSignFormEntry__c > eSignStringMap, List < String > luruIsSubmitList) { |
| | | system.debug('检索的所有录入表:' + eSignStringMap); |
| | | system.debug('最后录入的id :' + luruIsSubmitList + '----数量:' + luruIsSubmitList.size()); |
| | | list < eSignFormEntry__c > eSignFormDeleteList = new list < eSignFormEntry__c > (); |
| | | list<eSignFormEntry__c> eSignFormDeleteList = new List<eSignFormEntry__c>(); |
| | | for (String essm : eSignStringMap.keySet()) { |
| | | for (String lisl : luruIsSubmitList) { |
| | | if (essm.equals(lisl)) { |
| | |
| | | } |
| | | system.debug('删除的数据id:' + eSignFormDeleteList + '----数量:' + eSignFormDeleteList.size()); |
| | | |
| | | |
| | | |
| | | //删除签收单录入表其他数据 |
| | | if (eSignFormDeleteList.size() > 0) { |
| | | //循环遍历id 删除文件 |
| | | List<String> fileDeleteIdList = new List<String> (); |
| | | //List<Attachment> deleteAttachmentList = new List<Attachment>(); |
| | | List<FileAddress__c> deleteAttachmentList = new List<FileAddress__c>(); //zhj Attachment To AWS 2023-02-06 |
| | | List<Attachment> deleteAttachmentList = new List<Attachment>(); |
| | | |
| | | for (eSignFormEntry__c eSigf : eSignFormDeleteList) { |
| | | fileDeleteIdList.add(eSigf.Id); |
| | | } |
| | | //循环找到文件id |
| | | if (fileDeleteIdList.size() > 0) { |
| | | |
| | | // 2022-02-28 shashiming Apex heap size too large |
| | | // 去掉Body字段 |
| | | //List<Attachment> attachMentList = [SELECT id, parentId, Name, ContentType,Description from Attachment where parentId = :fileDeleteIdList]; |
| | | List<FileAddress__c> attachMentList = [SELECT id, ParentRecordId__c, FileName__c,AWS_File_Key__c from FileAddress__c where ParentRecordId__c = :fileDeleteIdList]; //zhj Attachment To AWS 2023-02-06 |
| | | List<Transaction_Log__c> tranList = new List<Transaction_Log__c>(); |
| | | List<Attachment> attachMentList = [ |
| | | SELECT id, parentId, Name, ContentType, Description |
| | | FROM Attachment |
| | | WHERE parentId = :fileDeleteIdList |
| | | ]; |
| | | |
| | | if (attachMentList.size() > 0) { |
| | | for (FileAddress__c att : attachMentList) { |
| | | FileAddress__c am = new FileAddress__c(); //zhj Attachment To AWS 2023-02-06 |
| | | for (Attachment att : attachMentList) { |
| | | Attachment am = new Attachment(); |
| | | am.Id = att.Id; |
| | | deleteAttachmentList.add(am); |
| | | //zhj 新增日志,删除AWS的附件 2023-02-17 |
| | | Transaction_Log__c tran = new Transaction_Log__c(); |
| | | tran.AWS_Data_Id__c = att.AWS_File_Key__c; |
| | | tran.Status__c = 'In Process'; |
| | | tran.Module__c = '签收单附件删除'; |
| | | tranList.add(tran); |
| | | } |
| | | //新增日志,删除AWS的附件 zhj 2023-02-17 |
| | | if(tranList.size() > 0){ |
| | | insert tranList; |
| | | } |
| | | //删除文件 |
| | | if (deleteAttachmentList.size() > 0) { |
| | | delete deleteAttachmentList; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | //删除录入表 |
| | | System.debug('删除录入表 : ' + eSignFormDeleteList); |
| | | delete eSignFormDeleteList; |
| | | } |
| | | } |
| | | @TestVisible |
| | | //更新营业部担当 |
| | | private static List < eSignForm__c > updateOwner(List < String > provinceList, Map < Id, String > provinceMap, List < eSignForm__c > eSignFormList, boolean ocsmFlag) { |
| | | private static List<eSignForm__c> updateOwner( |
| | | List<String> provinceList, |
| | | Map<Id, String> provinceMap, |
| | | List<eSignForm__c> eSignFormList, |
| | | boolean ocsmFlag |
| | | ) { |
| | | //营业担当 map |
| | | Map < String, String > provinceOwnerMap = new Map < String, String > (); |
| | | //营业助理 map |
| | |
| | | |
| | | List < eSignForm__c > eSignFormLastList = new List < eSignForm__c >(); |
| | | //检索OCSM管理省对象 |
| | | List < OCM_Management_Province__c > ompList = [select id, Name, SalesManage__c,GI_assistant__c from OCM_Management_Province__c where Name IN: provinceList]; |
| | | List<OCM_Management_Province__c> ompList = [ |
| | | SELECT id, Name, SalesManage__c, GI_assistant__c |
| | | FROM OCM_Management_Province__c |
| | | WHERE Name IN :provinceList |
| | | ]; |
| | | //存放map<省,担当> |
| | | for (OCM_Management_Province__c omp : ompList) { |
| | | //不用map<String,list>的 原因是 想 ocsm管理省 和签收单 营业担当的顺序保持一致 |
| | |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // } |
| | | // return eSignFormLastList; |
| | | |
| | |
| | | if (ocsmFlag) { |
| | | //给最后要更新的签收单的审批者(营业部担当)赋值 |
| | | for (Integer cnt = 0; cnt < eSignFormList.size(); cnt++) { |
| | | if (provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)) != eSignFormList[cnt].RC_Manager__c ||provinceMap.get(eSignFormList[cnt].Id).equals('集采课')) { |
| | | |
| | | if ( |
| | | provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)) != eSignFormList[cnt].RC_Manager__c || |
| | | provinceMap.get(eSignFormList[cnt].Id).equals('集采课') |
| | | ) { |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Id = eSignFormList[cnt].Id; |
| | | eSignForm.RC_Manager__c = provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)); |
| | |
| | | //集采询价 营业助理需要维护成 集采课的SP、GI助理 精琢技术 wql 2021/01/08 end |
| | | eSignFormLastList.add(eSignForm); |
| | | } |
| | | |
| | | } |
| | | return eSignFormLastList; |
| | | |
| | | } else { |
| | | //给最后要更新的签收单的审批者(营业部担当)赋值 |
| | | for (eSignForm__c esf : eSignFormList) { |
| | |
| | | } |
| | | //集采询价 营业助理需要维护成 集采课的SP、GI助理 精琢技术 wql 2021/01/08 end |
| | | } |
| | | |
| | | } |
| | | return eSignFormList; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | //更新该日志的数据信息 |
| | | iflog.Log__c += '\nupdateESignBatch end'; |
| | | String tmp = iflog.ErrorLog__c; |
| | |
| | | //写死精琢用户 上线后应该会修改成自定义标签 |
| | | // String batchUserId = '00510000005sEEM'; |
| | | String batchUserId = System.Label.Batch_User_Id; |
| | | List<User> us = [Select Id, NAme, Email From User Where Id = : batchUserId]; |
| | | List<User> us = [SELECT Id, NAme, Email FROM User WHERE Id = :batchUserId]; |
| | | if (!us.isEmpty()) { |
| | | User use = us[0]; |
| | | if (String.isNotBlank(use.Email)) { |
| | |
| | | if (System.Label.ESign_Error_Send_To_CC != 'null') { |
| | | MailCc = System.Label.ESign_Error_Send_To_CC.split(','); |
| | | } |
| | | FixtureUtil.sendMessage(batchUserId, |
| | | MailCc, |
| | | 'updateESignBatch Error', |
| | | body |
| | | ); |
| | | FixtureUtil.sendMessage(batchUserId, MailCc, 'updateESignBatch Error', body); |
| | | } |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | for (Database.Error err : saveRe.getErrors()) { |
| | | |
| | | String message = objectName + ':' |
| | | + objectLabel + ':' |
| | | + err.getStatusCode() + ':' |
| | | + err.getFields() + ':' |
| | | + err.getMessage(); |
| | | String message = |
| | | objectName + |
| | | ':' + |
| | | objectLabel + |
| | | ':' + |
| | | err.getStatusCode() + |
| | | ':' + |
| | | err.getFields() + |
| | | ':' + |
| | | err.getMessage(); |
| | | // 数据里面有复数错误信息的话只获取第一条 |
| | | messageMap.put(saveRe.getId(), message); |
| | | break; |
| | |
| | | } |
| | | |
| | | //定时跑任务 |
| | | public Class ScBean { |
| | | public class ScBean { |
| | | public String scName; |
| | | public String scTime; |
| | | } |
| | | |
| | | public static void improveTestRate(){ |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| New file |
| | |
| | | global class updateESignBatchAttachment implements Database.Batchable < sObject > , Database.Stateful { |
| | | //电子签收单-签收单录入表更新签收单 精琢技术 wql 2020-09-25 start |
| | | /* |
| | | ①正常执行 Database.executeBatch(new updateESignBatchAttachment(), 20); |
| | | ②处理某一个签收单 Database.executeBatch(new updateESignBatchAttachment(''), 1); |
| | | ③批量处理某些签收单(不是最终状态的) Database.executeBatch(new updateESignBatchAttachment(['','','']), 20); |
| | | ④处理某一个最终状态的签收单 Database.executeBatch(new updateESignBatchAttachment('',true), 1); |
| | | ⑤批量处理某些最终状态的签收单 Database.executeBatch(new updateESignBatchAttachment('['','','']',true), 20); |
| | | ⑥处理某一天的所有签收单 Database.executeBatch(new updateESignBatchAttachment(2020-09-27), 20); |
| | | ⑦处理某一时间段的所有签收单 Database.executeBatch(new updateESignBatchAttachment(2020-09-27,2020-09-28), 20); |
| | | |
| | | */ |
| | | private static final Integer MAXERRORCNT = 20; // 邮件表单位最大错误信息显示数量 |
| | | private ScBean scB; |
| | | private ErrorBean eb = new ErrorBean(); // 邮件发送ERRORBEAN |
| | | private String scErrorMessage = ''; // 添加计划错误信息 |
| | | |
| | | //手动执行标识 |
| | | // private Boolean ManualExecution_Identification; |
| | | |
| | | //存放检索的soql语句 |
| | | private String query; |
| | | //存放需要更新的日期 |
| | | private Date toDate; |
| | | //存放一段时间的开始日期 |
| | | private Date startDate; |
| | | //存放一段时间的结束日期 |
| | | private Date endDate; |
| | | //存放需要更新的签收单id |
| | | private String id; |
| | | //存放需要更新的一些签收单 |
| | | private List < String > ids; |
| | | //存放已经最终状态的flag |
| | | private Boolean flag; |
| | | //用于执行batch同时记录日志信息 |
| | | private BatchIF_Log__c iflog; |
| | | global List < String > emailMessages = new List < String > (); |
| | | global Integer totalCount = 0; // 总件数 |
| | | global Integer failedCount = 0; //失败件数 |
| | | global Boolean ManualExecution_Identification = false; |
| | | //默认跑所有签收单 |
| | | global updateESignBatchAttachment() { |
| | | |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start1\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | //更新某一天的签收单 |
| | | global updateESignBatchAttachment(Date toDate) { |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | |
| | | this.toDate = toDate; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start2\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | //更新某一时间段的 签收单 |
| | | global updateESignBatchAttachment(Date startDate, Date endDate) { |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | this.startDate = startDate; |
| | | this.endDate = endDate; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start3\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | //批量更新签收单 |
| | | global updateESignBatchAttachment(List < String > ids) { |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | this.ids = ids; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start4\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | //更新某一条的签收单 |
| | | global updateESignBatchAttachment(String id) { |
| | | |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | system.debug('手动传参1:' + ManualExecution_Identification); |
| | | this.id = id; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start5\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | //更新某一条的已处理的签收单 |
| | | global updateESignBatchAttachment(String id, boolean flag) { |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | this.id = id; |
| | | this.flag = flag; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start6\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | //批量更新已处理的签收单 |
| | | global updateESignBatchAttachment(List < String > ids, boolean flag) { |
| | | //手动标识置成true |
| | | this.ManualExecution_Identification = true; |
| | | this.ids = ids; |
| | | this.flag = flag; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'ESignBatch'; |
| | | iflog.Is_Error__c = 0; |
| | | iflog.Log__c = 'updateESignBatchAttachment start7\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | // insert iflog; |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | scB = updateESignBatchAttachment.setSc('updateESignFormSchedule', 9, 23, 0, '0 30 2', null); |
| | | if (System.Test.isRunningTest() == false) { |
| | | Boolean haveError = false; |
| | | try { |
| | | system.schedule(scB.scName, scB.scTime, new updateESignFormSchedule()); |
| | | } catch (Exception e) { |
| | | haveError = true; |
| | | } |
| | | // 如果哟同名的Batch计划删除已存在的计划重新设置 |
| | | if (haveError) { |
| | | haveError = false; |
| | | for (CronTrigger ct : [SELECT Id, CronJobDetailId, CronExpression, CronJobDetail.Name |
| | | FROM CronTrigger |
| | | WHERE CronJobDetail.Name = :scB.scName]) { |
| | | System.abortJob(ct.Id); |
| | | } |
| | | try { |
| | | system.schedule(scB.scName, scB.scTime, new updateESignFormSchedule()); |
| | | } catch (Exception e) { |
| | | scErrorMessage = e.getMessage() + e.getStackTraceString() + '<br/>'; |
| | | } |
| | | } |
| | | } |
| | | //签收单 sql |
| | | //检索 id,名字,DN签收状态(经销商),DN签收状态(医院),无前导零DN号,经销商验收结果,医院验收结果 |
| | | //销售渠道,营业助理,营业管理部担当,是否处理完毕签收单,ocsm管理省 |
| | | query = 'select id,Name,agencyDNSignUpStatus__c,HPDNSignUpStatus__c,DNNameNo0__c,agencyAcceptResult__c,HPAcceptResult__c'; |
| | | query += ',Sales_Root_Formula__c,Sales_assistant_name_text__c,RC_Manager__c,agencyConfirmDate__c,salesHPManageConfirmDate__c'; |
| | | query += ',isProcessed__c,OCM_man_province_cus__c,agencyReject__c,agencyRejectDate__c,HPReject__c,HPRejectDate__c,Statu_Achievements__r.Opportunity__r.Group_purchase_PCL__c '; |
| | | query += ' from eSignForm__c '; |
| | | //检索不是最终状态的签收单 |
| | | if (flag != true) { |
| | | query += ' where isProcessed__c = false '; |
| | | } else { |
| | | if (!string.isblank(id)) { |
| | | query += 'where id = :id'; |
| | | } else if (ids != null) { |
| | | query += 'where id in: ids'; |
| | | } |
| | | } |
| | | //如果传入的是一段时间 |
| | | if (startDate != null && endDate != null) { |
| | | query += ' and createdDate >= : startDate and createdDate <= : endDate'; |
| | | } |
| | | //如果传入的是某一天的日期 |
| | | else if (toDate != null) { |
| | | query += ' and createdDate = :toDate '; |
| | | } |
| | | //如果传入的是一批签收单id |
| | | else if (ids != null) { |
| | | query += ' and id in: ids '; |
| | | } |
| | | //如果传入的是记录类型或者签收单id |
| | | else if (!string.isblank(id)) { |
| | | query += ' and id = :id '; |
| | | } |
| | | //最后需要排序 |
| | | query += ' order by createdDate asc '; |
| | | System.debug('sql语句:' + query); |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | //15分钟batch bug 23:45 ~ 2:30 之间只运行 头尾各一次 |
| | | public static ScBean setSc(String baseName, Integer minhour, Integer maxhour, Integer minMin, String spbefore, String spafter) { |
| | | Datetime dt = Datetime.now(); |
| | | Integer year = Integer.valueOf(dt.format('yyyy')); |
| | | Integer month = Integer.valueOf(dt.format('MM')); |
| | | Integer day = Integer.valueOf(dt.format('dd')); |
| | | Integer hour = Integer.valueOf(dt.format('HH')); |
| | | Integer min = Integer.valueOf(dt.format('mm')); |
| | | ScBean b = new ScBean(); |
| | | if (hour == maxhour && min >= (minMin + 45)) { |
| | | b.scName = baseName + '001'; |
| | | if (spafter != null && String.isNotBlank(spafter)) { |
| | | b.scName = baseName + '005'; |
| | | b.scTime = spafter + ' ' + day + ' ' + month + ' ? ' + year; |
| | | |
| | | // system.schedule(sJobame,spafter + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | return b; |
| | | } else { |
| | | dt = Datetime.now().addDays(1); |
| | | year = Integer.valueOf(dt.format('yyyy')); |
| | | month = Integer.valueOf(dt.format('MM')); |
| | | day = Integer.valueOf(dt.format('dd')); |
| | | hour = Integer.valueOf(dt.format('HH')); |
| | | min = Integer.valueOf(dt.format('mm')); |
| | | if (spbefore != null && String.isNotBlank(spbefore)) { |
| | | b.scName = baseName + '006'; |
| | | // '0 20 8 |
| | | b.scTime = spbefore + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,spbefore + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | } else { |
| | | b.scTime = '0 ' + minMin + ' ' + minhour + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + minMin + ' ' + minhour + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | } |
| | | } |
| | | } else if (min < minMin) { |
| | | b.scName = baseName + '001'; |
| | | b.scTime = '0 ' + minMin + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + minMin + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | } else if (min < minMin + 15) { |
| | | b.scName = baseName + '002'; |
| | | b.scTime = '0 ' + (minMin + 15) + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + (minMin + 15) + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | } else if (min < minMin + 30) { |
| | | b.scName = baseName + '003'; |
| | | b.scTime = '0 ' + (minMin + 30) + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + (minMin + 30) + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | } else if (min < minMin + 45) { |
| | | b.scName = baseName + '004'; |
| | | b.scTime = '0 ' + (minMin + 45) + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + (minMin + 45) + ' ' + hour + ' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | } else { |
| | | b.scName = baseName + '001'; |
| | | b.scTime = '0 ' + minMin + ' ' + (hour + 1) + ' ' + day + ' ' + month + ' ? ' + year; |
| | | // system.schedule(sJobame,'0 ' + minMin + ' ' + (hour + 1) +' ' + day + ' ' + month + ' ? ' + year, new AgencyShareUpdateBatchSchedule()); |
| | | |
| | | } |
| | | return b; |
| | | } |
| | | |
| | | public static void removeOtherSc(String likeName, String needName) { |
| | | String likeStr = likeName + '00%'; |
| | | for (CronTrigger ct : [SELECT Id, CronJobDetailId, CronExpression, CronJobDetail.Name |
| | | FROM CronTrigger |
| | | WHERE CronJobDetail.Name Like :likeStr |
| | | AND CronJobDetail.Name != :needName]) { |
| | | System.abortJob(ct.Id); |
| | | } |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list < eSignForm__c > eSignList) { |
| | | //用作录入表的检索条件 |
| | | List < String > esFormidList = new List < String > (); |
| | | //存放签收单录入表明细 |
| | | List < eSignFormLineItemEntry__c > eSignFormLineItemEntryList = new List < eSignFormLineItemEntry__c > (); |
| | | //用作签收单明细的检索条件 |
| | | List < String > eSignFormLineIdList = new List < String > (); |
| | | //更新的签收单明细 |
| | | List < eSignFormLineItem__c > eSignFormLuRUList = new List < eSignFormLineItem__c > (); |
| | | //存放最后更新的 录入表id |
| | | List < Id > fileIdList = new List < Id > (); |
| | | //存放最新的 签收单id,签收单录入id |
| | | Map < Id, Id > eSignIdMap = new Map < Id, Id > (); |
| | | |
| | | //存放最新的 签收单id,签收单录入id 用于最后一条签收单录入表不删除 |
| | | Map < Id, Id > eSignFormLastIdMap = new Map < Id, Id > (); |
| | | |
| | | //存放最新的 签收单id,签收单录入id 用于文件更新 |
| | | Map < Id, Id > eSignFlieIdMap = new Map < Id, Id > (); |
| | | |
| | | //存放录入表id,录入表 |
| | | Map < String, eSignFormEntry__c > lasteSignFormEntryMap = new Map < String, eSignFormEntry__c > (); |
| | | //存放最新的 签收单明细id,签收单明细录入id |
| | | Map < Id, Id > eSignFormLineItemEntryIdMap = new Map < Id, Id > (); |
| | | //签收单录入表明细id,签收单录入表明细 |
| | | Map < String, eSignFormLineItemEntry__c > lasteSignFormLineItemEntryMap = new Map < String, eSignFormLineItemEntry__c > (); |
| | | //存放 签收单id,文件数量 |
| | | Map < String, Integer > fileMap = new Map < String, Integer > (); |
| | | //驳回后删除文件 后 排序问题 精琢技术 wql 2020/12/24 start |
| | | List<Attachment> esignAttachAgencyList = new List<Attachment>(); |
| | | List<Attachment> esignAttachHPList = new List<Attachment>(); |
| | | Map<String, Integer> fileAgencyMap = new Map<String, Integer>(); |
| | | Map<String, Integer> fileHPMap = new Map<String, Integer>(); |
| | | //驳回后删除文件 后 排序问题 精琢技术 wql 2020/12/24 end |
| | | //存放ocsm管理省 |
| | | List < String > provinceList = new List < String > (); |
| | | //存放15位签收单id,ocsm管理省 |
| | | Map < Id, String > provinceMap = new Map < Id, String > (); |
| | | //存放用于更新的签收单数组 |
| | | List < eSignForm__c > eSignFormList = new List < eSignForm__c > (); |
| | | //存放签收单录入表id,name |
| | | Map < Id, String > eSignNameMap = new Map < Id, String > (); |
| | | //存放签收单录入表id,type |
| | | Map < Id, String > eSignTypeMap = new Map < Id, String > (); |
| | | |
| | | //删除中间表数据用 |
| | | Map < String, eSignFormEntry__c > eSignStringMap = new Map < String, eSignFormEntry__c > (); |
| | | //存放所有签收单录入表id |
| | | List < String > luruIsSubmitList = new List < String > (); |
| | | |
| | | //存放所有签收单录入表id |
| | | List < String > luruIsLastSubmitList = new List < String > (); |
| | | //判断是否有未处理的录入表 |
| | | Map < Id, eSignFormEntry__c > unprocessedESignEneryMap = new Map < Id, eSignFormEntry__c > (); |
| | | |
| | | //用于判断删除驳回的附件的筛选条件 |
| | | Map < Id, eSignForm__c > rejectESignEneryMap = new Map < Id, eSignForm__c > (); |
| | | //驳回后 删除之前上传的文件id |
| | | List<Attachment> deleteLastFileList = new List<Attachment>(); |
| | | //存放未更新前的经销商审批状态 |
| | | Map < String, String > oldESignAgencyStatusMap = new Map < String, String > (); |
| | | //存放未更新前的医院审批状态 |
| | | Map < String, String > oldESignHPStatusMap = new Map < String, String > (); |
| | | try { |
| | | //循环存放签收单id 用作检索签收单录入表的条件 |
| | | system.debug('eSignList:' + eSignList); |
| | | if (eSignList.size() > 0) { |
| | | for (eSignForm__c esForm : eSignList) { |
| | | //存放签收单id,ocsm管理省 如果询价是集采 则取ocsm管理省为集采课的担当 |
| | | if(esForm.Statu_Achievements__r.Opportunity__r.Group_purchase_PCL__c){ |
| | | provinceMap.put(esForm.Id, '集采课'); |
| | | //检索条件 |
| | | provinceList.add('集采课'); |
| | | }else{ |
| | | provinceMap.put(esForm.Id, esForm.OCM_man_province_cus__c); |
| | | //检索条件 |
| | | provinceList.add(esForm.OCM_man_province_cus__c); |
| | | } |
| | | |
| | | esFormidList.add(esForm.Id); |
| | | |
| | | //有经销商驳回或者医院驳回时删除之前附件 |
| | | if (esForm.agencyRejectDate__c != null || esForm.HPRejectDate__c != null) { |
| | | rejectESignEneryMap.put(esForm.Id, esForm); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | system.debug('rejectESignEneryMap:' + rejectESignEneryMap); |
| | | //如果map不为空 则作为筛选条件 |
| | | if (rejectESignEneryMap.size()>0) { |
| | | List<Attachment> deleteFileList = [SELECT parentId, createdDate, Name,Description |
| | | FROM Attachment |
| | | WHERE parentId IN: rejectESignEneryMap.keySet() order by createdDate]; |
| | | system.debug('deleteFileList:' + deleteFileList); |
| | | if (deleteFileList.size() > 0) { |
| | | for (eSignForm__c esFile : rejectESignEneryMap.values()) { |
| | | |
| | | for (Attachment att : deleteFileList) { |
| | | if (esFile.agencyRejectDate__c != null || esFile.HPRejectDate__c != null) { |
| | | if (att.parentId == esFile.Id ) { |
| | | //①经销商驳回后需要删除的附件 |
| | | if (esFile.agencyRejectDate__c != null) { |
| | | if (att.Name.substring(0, 1) == 'A' && att.createdDate < esFile.agencyRejectDate__c) { |
| | | deleteLastFileList.add(att); |
| | | } |
| | | } |
| | | //②医院驳回后需要删除的附件 |
| | | if (esFile.HPRejectDate__c != null) { |
| | | if (att.Name.substring(0, 1) == 'H' && att.createdDate < esFile.HPRejectDate__c) { |
| | | deleteLastFileList.add(att); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | system.debug('驳回后删除的文件:' + deleteLastFileList); |
| | | //先删后增 |
| | | if (deleteLastFileList.size() > 0) { |
| | | delete deleteLastFileList; |
| | | } |
| | | |
| | | //检索所有录入表 |
| | | List < eSignFormEntry__c > eSignFormEntryList = [select id, Name, entryType__c, eSignForm__c, eSignForm__r.OCM_man_province_cus__c, salesManageConfirmDate__c, salesHPManageConfirmDate__c, agencyScanDayBack__c, agencySignUpDateBack__c, agencyConfirmDateBack__c, HPScanDayBack__c, HPSignUpDateBack__c, HPConfirmDateBack__c, |
| | | eSignForm__r.Name, IsSubmit__c, IsHPSubmit__c, IsAgencyConfirmSubmit__c, agencyAutoSignUpStatus__c, HPSignUpStatus__c, Sales_Root_Formula__c, Sales_assistant_ID__c, IsHandled__c, IsHPHandled__c, createdDate, AgencyWorkflowEmailBack__c, HPWorkflowEmailBack__c, AgencyWorkflowEmail__c, HPWorkflowEmail__c, eSignForm__r.Id, agencyDNSignUpStatus__c, HPDNSignUpStatus__c, agencyReject__c, HPReject__c, IsAgencyScan__c, IsHPScan__c |
| | | from eSignFormEntry__c |
| | | where eSignForm__c IN: esFormidList |
| | | order by eSignForm__c, createdDate asc |
| | | ]; |
| | | |
| | | if (eSignFormEntryList.size() > 0) { |
| | | for (Id eid : esFormidList) { |
| | | //遍历所有签收单 |
| | | for (eSignFormEntry__c eSignFormEntryWhole : eSignFormEntryList) { |
| | | //删除用 |
| | | eSignStringMap.put(eSignFormEntryWhole.Id, eSignFormEntryWhole); |
| | | //②所有的 用于更新文件(包含已处理未处理的数据 ) |
| | | fileIdList.add(eSignFormEntryWhole.Id); |
| | | if (eSignFormEntryWhole.IsHandled__c == false) { |
| | | //未处理的 |
| | | unprocessedESignEneryMap.put(eid, eSignFormEntryWhole); |
| | | } |
| | | if (eSignFormEntryWhole.eSignForm__r.Id == eid) { |
| | | //存放 签收单id,录入表id 文件用 |
| | | eSignFlieIdMap.put(eSignFormEntryWhole.Id, eid); |
| | | //存放签收单录入表,id,name 文件用 |
| | | eSignNameMap.put(eid, eSignFormEntryWhole.eSignForm__r.Name); |
| | | } |
| | | |
| | | |
| | | //存放录入表id,记录类型 id,type 文件用 |
| | | eSignTypeMap.put(eSignFormEntryWhole.Id, eSignFormEntryWhole.entryType__c); |
| | | } |
| | | } |
| | | |
| | | system.debug('eSignFlieIdMap:' + eSignFlieIdMap); |
| | | //外层是签收单 |
| | | for (Id esFormid : esFormidList) { |
| | | //内层是签收单录入表 |
| | | for (eSignFormEntry__c eSignFormEntry : eSignFormEntryList) { |
| | | |
| | | //①取最新的 录入表 + 未处理的 |
| | | if (esFormid.equals(eSignFormEntry.eSignForm__c)) { |
| | | |
| | | if (!eSignFormEntry.IsHandled__c) { |
| | | //存放 签收单id,录入表id |
| | | eSignIdMap.put(esFormid, eSignFormEntry.Id); |
| | | lasteSignFormEntryMap.put(esFormid, eSignFormEntry); |
| | | //因为按签收单倒序排,所以第一条就是最新的,直接跳出 |
| | | // break; |
| | | } |
| | | eSignFormLastIdMap.put(esFormid, eSignFormEntry.Id); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | //最后更新的录入表id |
| | | for (Id eSignId : eSignIdMap.values()) { |
| | | luruIsSubmitList.add(eSignId); |
| | | } |
| | | //最后更新的录入表id |
| | | for (Id eSignId : eSignFormLastIdMap.values()) { |
| | | luruIsLastSubmitList.add(eSignId); |
| | | } |
| | | |
| | | //重新对附件排序 规则变为根据签收单现有附件序号进行排序 精琢技术 wql start |
| | | //暂时存放一下签收单名称 |
| | | Map<string, string> tempMap = new Map<string, string>(); |
| | | List<Attachment> tempAttList = [SELECT parentId, createdDate, Name,Description |
| | | FROM Attachment |
| | | WHERE parentId IN: esFormidList order by createdDate]; |
| | | if (tempAttList.size() > 0) { |
| | | //外层循环签收单 |
| | | for (String es : esFormidList) { |
| | | |
| | | //内层循环附件 |
| | | for (Attachment att : tempAttList) { |
| | | //如果id相等 |
| | | if (es.equals(att.parentId)) { |
| | | //根据名称拆分 存入不同list |
| | | String name = att.Name; |
| | | if (name.substring(0, 1).equals('A')) { |
| | | esignAttachAgencyList.add(att); |
| | | } else if (name.substring(0, 1).equals('H')) { |
| | | esignAttachHPList.add(att); |
| | | } |
| | | |
| | | } |
| | | } |
| | | //分别存入到经销商or医院的附件map 用于后期命名 |
| | | if (esignAttachAgencyList.size() > 0) { |
| | | fileAgencyMap.put(es, esignAttachAgencyList.size()); |
| | | } |
| | | if (esignAttachHPList.size() > 0) { |
| | | fileHPMap.put(es, esignAttachHPList.size()); |
| | | } |
| | | //清空list 供下一个签收单使用 |
| | | esignAttachAgencyList.clear(); |
| | | esignAttachHPList.clear(); |
| | | |
| | | } |
| | | } |
| | | system.debug('fileAgencyMap:' + fileAgencyMap); |
| | | system.debug('fileHPMap:' + fileHPMap); |
| | | //重新对附件排序 规则变为根据签收单现有附件序号进行排序 精琢技术 wql end |
| | | |
| | | //根据所有的签收单录入表id检索所有的签收单明细录入 |
| | | List < eSignFormLineItemEntry__c > eSignFormLineItemEntryLists = [select id, eSignFormEntry__r.entryType__c, eSignFormEntry__r.IsHandled__c, eSignFormLineItem__c, eSignFormEntry__c, |
| | | agencyConfirmResult__c, HPConfirmResult__c, HPGoodStatus__c, agencyGoodStatus__c |
| | | from eSignFormLineItemEntry__c where eSignFormEntry__c in : luruIsSubmitList and eSignFormEntry__r.IsHandled__c = false order by createdDate asc |
| | | ]; |
| | | if (eSignFormLineItemEntryLists.size() > 0) { |
| | | for (eSignFormLineItemEntry__c eSignFormLineItemEntry : eSignFormLineItemEntryLists) { |
| | | eSignFormLineIdList.add(eSignFormLineItemEntry.eSignFormLineItem__c); |
| | | } |
| | | } |
| | | system.debug('eSignFormLineIdList:' + eSignFormLineIdList); |
| | | if (eSignFormLineIdList.size() > 0) { |
| | | //根据签收单明细录入表 去检索签收单明细 |
| | | List < eSignFormLineItem__c > eSignFormLineItemList = [select id, agencyGoodStatus__c, HPGoodStatus__c from eSignFormLineItem__c where id IN: eSignFormLineIdList]; |
| | | if (eSignFormLineItemList.size() > 0) { |
| | | //外层签收单明细 |
| | | for (eSignFormLineItem__c eSignFormLineItem : eSignFormLineItemList) { |
| | | //内层签收单明细录入 |
| | | for (eSignFormLineItemEntry__c eSignFormLineItemEntry : eSignFormLineItemEntryLists) { |
| | | //明细id相等存放一个map |
| | | if (eSignFormLineItem.Id.equals(eSignFormLineItemEntry.eSignFormLineItem__c)) { |
| | | eSignFormLineItemEntryIdMap.put(eSignFormLineItem.Id, eSignFormLineItemEntry.Id); |
| | | lasteSignFormLineItemEntryMap.put(eSignFormLineItem.Id, eSignFormLineItemEntry); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | system.debug('lasteSignFormLineItemEntryMap:' + lasteSignFormLineItemEntryMap); |
| | | if (eSignFormLineIdList.size() > 0) { |
| | | //循环 更新签收单 |
| | | for (Id esefId : eSignFormLineIdList) { |
| | | |
| | | if (lasteSignFormLineItemEntryMap.containsKey(esefId)) { |
| | | eSignFormLineItemEntry__c luru = lasteSignFormLineItemEntryMap.get(esefId); |
| | | //new 一个签收单明细对象 |
| | | eSignFormLineItem__c eSignLuRu = new eSignFormLineItem__c(); |
| | | //签收单id |
| | | eSignLuRu.id = esefId; |
| | | //货物情况(经销商收货) |
| | | eSignLuRu.agencyGoodStatus__c = luru.agencyGoodStatus__c; |
| | | // //经销商确认结果 |
| | | // eSignLuRu.agencyConfirmResult__c = luru.agencyConfirmResult__c; |
| | | //货物情况(医院收货) |
| | | eSignLuRu.HPGoodStatus__c = luru.HPGoodStatus__c; |
| | | // //经销商确认结果 |
| | | // eSignLuRu.HPConfirmResult__c = luru.HPConfirmResult__c; |
| | | //同一个签收单循环遍历签收单录入表 最后一个录入表会add到更新数组中 |
| | | if (eSignLuRu != null) { |
| | | system.debug('签收单明细象-----:' + eSignLuRu); |
| | | eSignFormLuRuList.add(eSignLuRu); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | System.debug('更新的签收单明细list:' + eSignFormLuRUList); |
| | | system.debug('esFormidList:' + esFormidList); |
| | | if (unprocessedESignEneryMap.size() > 0) { |
| | | for (Id eSignFormid : unprocessedESignEneryMap.keySet()) { |
| | | //new 一个签收单对象 |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | |
| | | String name = ''; |
| | | String idlast = ''; |
| | | boolean IsSubmit = false; |
| | | boolean IsHPSubmit = false; |
| | | //销售渠道 |
| | | String Sales_Root_Formula; |
| | | //录入类型 |
| | | String type; |
| | | System.debug('lasteSignFormEntryMap:' + lasteSignFormEntryMap); |
| | | if (lasteSignFormEntryMap.containsKey(eSignFormid)) { |
| | | eSignForm.id = eSignFormid; |
| | | //签收单id |
| | | eSignFormEntry__c eSignFormEntry = lasteSignFormEntryMap.get(eSignFormid); |
| | | //如果经销商确认日为空的话 进去判断更新经销商审批状态 |
| | | if (eSignFormEntry.agencyDNSignUpStatus__c != '签收已完成') { |
| | | if (eSignFormEntry.agencyConfirmDateBack__c == null) { |
| | | if (eSignFormEntry.IsSubmit__c == true) { |
| | | eSignForm.agencyAutoSignUpStatus__c = '申请中'; |
| | | eSignForm.agencyReject__c = false; |
| | | } else { |
| | | if (eSignFormEntry.agencyScanDayBack__c != null && eSignFormEntry.IsAgencyScan__c) { |
| | | eSignForm.agencyAutoSignUpStatus__c = '草案中'; |
| | | eSignForm.agencyReject__c = false; |
| | | |
| | | } |
| | | } |
| | | } |
| | | //未更新前的经销商审批状态 用于文件累计汇总 |
| | | if(eSignFormEntry.agencyAutoSignUpStatus__c!=null &&eSignFormEntry.agencyAutoSignUpStatus__c!=''){ |
| | | oldESignAgencyStatusMap.put('A' + eSignForm.id, eSignFormEntry.agencyAutoSignUpStatus__c); |
| | | }else{ |
| | | oldESignAgencyStatusMap.put('A' + eSignForm.id, '无'); |
| | | } |
| | | |
| | | } |
| | | if (eSignFormEntry.HPDNSignUpStatus__c != '签收已完成') { |
| | | //如果医院确认日为空的话 进去判断更新医院审批状态 |
| | | if (eSignFormEntry.salesHPManageConfirmDate__c == null) { |
| | | if (eSignFormEntry.IsHPSubmit__c == true) { |
| | | eSignForm.HPSignUpStatus__c = '申请中'; |
| | | eSignForm.HPReject__c = false; |
| | | } else { |
| | | if (eSignFormEntry.HPScanDayBack__c != null && eSignFormEntry.IsHPScan__c) { |
| | | eSignForm.HPSignUpStatus__c = '草案中'; |
| | | eSignForm.HPReject__c = false; |
| | | |
| | | } |
| | | } |
| | | } |
| | | //未更新前的医院审批状态 用于文件累计汇总 |
| | | if(eSignFormEntry.HPSignUpStatus__c!=null &&eSignFormEntry.HPSignUpStatus__c!=''){ |
| | | oldESignHPStatusMap.put('H' + eSignForm.id, eSignFormEntry.HPSignUpStatus__c); |
| | | }else{ |
| | | oldESignHPStatusMap.put('H' + eSignForm.id, '无'); |
| | | } |
| | | |
| | | } |
| | | |
| | | //如果没变化则不更新 |
| | | if (eSignFormEntry.AgencyWorkflowEmailBack__c != eSignFormEntry.AgencyWorkflowEmail__c) { |
| | | //经销商邮件 |
| | | eSignForm.AgencyWorkflowEmail__c = eSignFormEntry.AgencyWorkflowEmailBack__c; |
| | | } |
| | | //如果没变化则不更新 |
| | | if (eSignFormEntry.HPWorkflowEmailBack__c != eSignFormEntry.HPWorkflowEmail__c) { |
| | | //医院邮件 |
| | | eSignForm.HPWorkflowEmail__c = eSignFormEntry.HPWorkflowEmailBack__c; |
| | | } |
| | | if (eSignFormEntry.agencyDNSignUpStatus__c != '签收已完成') { |
| | | //经销商扫描日 |
| | | if (eSignFormEntry.agencyScanDayBack__c != null) { |
| | | eSignForm.agencyScanDay__c = eSignFormEntry.agencyScanDayBack__c; |
| | | } |
| | | //经销商签收日 |
| | | if (eSignFormEntry.agencySignUpDateBack__c != null) { |
| | | eSignForm.agencySignUpDate__c = eSignFormEntry.agencySignUpDateBack__c; |
| | | } |
| | | //经销商确认日 |
| | | if (eSignFormEntry.agencyConfirmDateBack__c != null) { |
| | | eSignForm.agencyConfirmDate__c = eSignFormEntry.agencyConfirmDateBack__c; |
| | | } |
| | | } |
| | | |
| | | if (eSignFormEntry.HPDNSignUpStatus__c != '签收已完成') { |
| | | //医院扫描日 |
| | | if (eSignFormEntry.HPScanDayBack__c != null) { |
| | | eSignForm.HPScanDay__c = eSignFormEntry.HPScanDayBack__c; |
| | | } |
| | | //医院签收日 |
| | | if (eSignFormEntry.HPSignUpDateBack__c != null) { |
| | | eSignForm.HPSignUpDate__c = eSignFormEntry.HPSignUpDateBack__c; |
| | | } |
| | | //医院确认日 |
| | | if (eSignFormEntry.HPConfirmDateBack__c != null) { |
| | | eSignForm.HPConfirmDate__c = eSignFormEntry.HPConfirmDateBack__c; |
| | | } |
| | | } |
| | | |
| | | //给营业助理赋值 |
| | | eSignForm.Sales_assistant_name_text__c = eSignFormEntry.Sales_assistant_ID__c; |
| | | //存一个id |
| | | idlast = eSignFormEntry.Id; |
| | | //签收单name用作文件命名 |
| | | name = eSignFormEntry.eSignForm__r.Name; |
| | | //是否经销商提交 |
| | | IsSubmit = eSignFormEntry.IsSubmit__c; |
| | | //是否医院提交 |
| | | IsHPSubmit = eSignFormEntry.IsHPSubmit__c; |
| | | //最后录入表 |
| | | eSignForm.finalUpadteFrom__c = eSignFormEntry.Id; |
| | | //销售渠道 区分直销还是分销 |
| | | Sales_Root_Formula = eSignFormEntry.Sales_Root_Formula__c; |
| | | //录入类型 |
| | | type = eSignFormEntry.entryType__c; |
| | | |
| | | } |
| | | system.debug('签收单对象-----:' + eSignForm); |
| | | if (eSignForm != null) { |
| | | system.debug('eSignFormid:' + eSignFormid); |
| | | if (eSignForm.id != null) { |
| | | |
| | | eSignFormList.add(eSignForm); |
| | | } |
| | | |
| | | } |
| | | system.debug('eSignFormList111:' + eSignFormList); |
| | | if (eSignFormList.size() > 0) { |
| | | //更新OCSM管理省 担当 |
| | | eSignFormList = updateOwner(provinceList, provinceMap, eSignFormList, false); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | if (eSignFormList.size() <= 0) { |
| | | system.debug('我走到这里了!'); |
| | | eSignFormList = updateOwner(provinceList, provinceMap, eSignList, true); |
| | | } |
| | | |
| | | |
| | | List<Id> fileList = new List<Id> (); |
| | | if (fileIdList.size() > 0) { |
| | | for (Id fileId : fileIdList) { |
| | | if (!fileList.contains(fileId)) { |
| | | fileList.add(fileId); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | System.debug('fileIdList:' + fileIdList); |
| | | System.debug('fileList:' + fileList); |
| | | //用于最后insert 附件 |
| | | List<Attachment> insertAttactment = new List<Attachment>(); |
| | | //附件 start |
| | | List<Attachment> attachMentList = [SELECT id, parentId, Body, Name, ContentType,Description from Attachment where parentId IN :fileList and Description!='电子签收单:已处理']; |
| | | //修复已处理数据 附件没更新 即没有附件能提交的bug 精琢技术 wql 2021/01/19 start |
| | | List<Attachment> eSignEntryAttachMentList = new List<Attachment>(); |
| | | //文件数量 用于文件命名 |
| | | Integer agencyCount = 0; |
| | | Integer hpCount = 0; |
| | | |
| | | String name; |
| | | String type ; |
| | | Integer agencyFileCountNum = 0; |
| | | Integer hpFileCountNum = 0; |
| | | Integer i = 0; |
| | | Integer j = 0; |
| | | //记录该签收单的最新经销商附件数量 |
| | | Map<id,Integer> eSignAgencyAttSum = new Map<id,Integer> (); |
| | | //记录该签收单的最新医院附件数量 |
| | | Map<id,Integer> eSignHpAttSum = new Map<id,Integer> (); |
| | | |
| | | //同一条录入表多个附件标识 |
| | | Boolean agencyNumFlag = false; |
| | | Boolean hpNumFlag = false; |
| | | |
| | | //存1条数据内多个附件 一个固定值 |
| | | Integer agencySumCount = 0; |
| | | Integer hpSumCount = 0; |
| | | |
| | | if (fileList.size() > 0) { |
| | | system.debug('attachMentList:' + attachMentList); |
| | | system.debug('eSignFlieIdMap:' + eSignFlieIdMap); |
| | | system.debug('eSignNameMap:' + eSignNameMap); |
| | | for (Id eSignFormEntryId : fileList) { |
| | | |
| | | for (Attachment attach : attachMentList) { |
| | | |
| | | if (attach.parentId == eSignFormEntryId) { |
| | | Id eid = eSignFlieIdMap.get(attach.parentId); |
| | | system.debug('eid:' + eid); |
| | | |
| | | name = eSignNameMap.get(eid); |
| | | system.debug('name:' + name); |
| | | type = eSignTypeMap.get(attach.parentId); |
| | | |
| | | //因为外层循环是中间表 如果2条以上录入表都有经销商附件 则使用最新构建的经销商附件数量来命名 |
| | | //否则取未更新之前有的经销商附件数量 并且 不是1个录入表多个附件 也就是false的时候 取模拟的最新数量 |
| | | if(eSignAgencyAttSum.size()>0&&!agencyNumFlag){ |
| | | agencyCount = eSignAgencyAttSum.get(eid); |
| | | //记录一个最新的附件数 |
| | | agencySumCount =agencyCount; |
| | | }else if(agencySumCount>0){ |
| | | //本次循环内 第一次取附件数最新值 后续都在此基础上i++ |
| | | agencyCount =agencySumCount; |
| | | } |
| | | else if(fileAgencyMap.size() > 0){ |
| | | //只有一条数据时,使用此附件数即可 后续在此基础上i++ |
| | | agencyCount = fileAgencyMap.get(eid); |
| | | } |
| | | |
| | | //同一个内部循环里置成true |
| | | agencyNumFlag = true; |
| | | //经销商附件命名 start |
| | | // if (fileAgencyMap.size() > 0) { |
| | | // agencyCount = fileAgencyMap.get(eid); |
| | | // } |
| | | |
| | | system.debug(name + 'agencyCount:' + agencyCount); |
| | | if (agencyCount == null || agencyCount == 0) { |
| | | agencyFileCountNum = 1 + i; |
| | | } else { |
| | | agencyFileCountNum = agencyCount + 1 + i; |
| | | } |
| | | |
| | | //经销商附件命名 end |
| | | //因为外层循环是中间表 如果2条以上录入表都有医院附件 则使用最新构建的医院附件数量来命名 |
| | | //否则取未更新之前有的医院附件数量 并且 不是1个录入表多个附件 也就是false的时候 取模拟的最新数量 |
| | | if(eSignHpAttSum.size()>0&&!hpNumFlag){ |
| | | hpCount = eSignHpAttSum.get(eid); |
| | | //记录一个最新的附件数 |
| | | hpSumCount = hpCount; |
| | | }else if(hpSumCount >0 ){ |
| | | //本次循环内 第一次取附件数最新值 后续都在此基础上j++ |
| | | hpCount =hpSumCount; |
| | | } |
| | | else if(fileHPMap.size() > 0){ |
| | | //只有一条数据时,使用此附件数即可 后续在此基础上j++ |
| | | hpCount = fileHPMap.get(eid); |
| | | } |
| | | //同一个内部循环里置成true |
| | | hpNumFlag =true; |
| | | //医院附件命名 start |
| | | // if (fileHPMap.size() > 0) { |
| | | // hpCount = fileHPMap.get(eid); |
| | | // } |
| | | system.debug(name + 'hpCount:' + hpCount); |
| | | |
| | | if (hpCount == null || hpCount == 0) { |
| | | hpFileCountNum = 1 + j; |
| | | } else { |
| | | hpFileCountNum = hpCount + 1 + j; |
| | | } |
| | | //构建最新的签收单经销商附件数量 |
| | | if(agencyFileCountNum>0){ |
| | | eSignAgencyAttSum.put(eid,agencyFileCountNum); |
| | | } |
| | | //构建最新的签收单医院附件数量 |
| | | if(hpFileCountNum>0){ |
| | | eSignHpAttSum.put(eid,hpFileCountNum); |
| | | } |
| | | //医院附件命名 end |
| | | //用于拆分经销商/医院 区别文件名 |
| | | String finalName = ''; |
| | | String title = ''; |
| | | |
| | | //文件命名 |
| | | if (type == '经销商收货' || type == '经销商确认') { |
| | | finalName = 'A-' + name; |
| | | //用于判断多次上传文件命名 |
| | | i++; |
| | | title = finalName + '--' + agencyFileCountNum; |
| | | } else if (type == '医院收货' || type == '医院确认') { |
| | | finalName = 'H-' + name; |
| | | //用于判断多次上传文件命名 |
| | | j++; |
| | | title = finalName + '--' + hpFileCountNum; |
| | | } else { |
| | | finalName = name; |
| | | } |
| | | |
| | | system.debug('文件名:' + title); |
| | | //判断一下格式,不然下载下来是类型是所有文件 |
| | | // if(attach.ContentType == 'application/pdf'){ |
| | | // title = title +'.pdf'; |
| | | // }else if(attach.ContentType == 'image/jpeg'){ |
| | | // title = title +'.jpg'; |
| | | // } |
| | | //判断一下格式,不然下载下来是类型是所有文件 无法打开 |
| | | if (attach.Name.lastIndexOf('.') > -1) { |
| | | title = title + attach.Name.substring(attach.Name.lastIndexOf('.')); |
| | | } |
| | | |
| | | Attachment newAttachment = attach.clone(); |
| | | newAttachment.parentId = eid; |
| | | newAttachment.name = title; |
| | | // newAttachment.ContentType =attach.ContentType; |
| | | //要更新的签收单附件 |
| | | insertAttactment.add(newAttachment); |
| | | //反更新录入表的附件 用来判断附件是否被更新 |
| | | Attachment oldAttachment = new Attachment(); |
| | | oldAttachment.Id = attach.Id; |
| | | oldAttachment.Description = '电子签收单:已处理'; |
| | | eSignEntryAttachMentList.add(oldAttachment); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | //整单循环后 清空值 |
| | | i = 0; |
| | | j = 0; |
| | | agencyNumFlag= false; |
| | | hpNumFlag =false; |
| | | agencySumCount =0; |
| | | hpSumCount=0; |
| | | } |
| | | |
| | | } |
| | | |
| | | //电子签收单 增加本次更新附件数量 2020/01/07 精琢技术 wql start |
| | | //没有附件则根本不会进入 |
| | | if (insertAttactment.size() > 0) { |
| | | insert insertAttactment; |
| | | //反向更新录入表附件 |
| | | if(eSignEntryAttachMentList.size()>0){ |
| | | update eSignEntryAttachMentList; |
| | | } |
| | | |
| | | //更新已提交的签收单的附件数 |
| | | if (eSignFormList.size() > 0) { |
| | | //外层所有签收单 |
| | | for (eSignForm__c es : eSignFormList) { |
| | | |
| | | //a为经销商附件的数量 h为医院附件的数量 |
| | | Integer a = 0; |
| | | Integer h = 0; |
| | | |
| | | //内层所有需要更新的附件 |
| | | for (Attachment att : insertAttactment) { |
| | | if (es.Id != null) { |
| | | if (es.Id.equals(att.parentId)) { |
| | | if (es.agencyAutoSignUpStatus__c != null) { |
| | | if (es.agencyAutoSignUpStatus__c.equals('申请中') && oldESignAgencyStatusMap.size()>0) { |
| | | if(!oldESignAgencyStatusMap.get('A' + es.Id).equals('申请中')){ |
| | | if (att.Name.substring(0, 1).equals('A')) { |
| | | a ++; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (es.HPSignUpStatus__c != null) { |
| | | if (es.HPSignUpStatus__c.equals('申请中') && oldESignHPStatusMap.size()>0) { |
| | | if(!oldESignHPStatusMap.get('H' + es.Id).equals('申请中')){ |
| | | if (att.Name.substring(0, 1).equals('H')) { |
| | | h ++; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //只有真正扫码提交的 并且没有附件才会被更新 |
| | | if (es.agencyAutoSignUpStatus__c != null) { |
| | | if (es.agencyAutoSignUpStatus__c.equals('申请中') && oldESignAgencyStatusMap.size()>0) { |
| | | if(!oldESignAgencyStatusMap.get('A' + es.Id).equals('申请中')){ |
| | | es.agencyAttachNum__c = a; |
| | | } |
| | | |
| | | } |
| | | } |
| | | //只有真正扫码提交的 并且没有附件才会被更新 |
| | | if (es.HPSignUpStatus__c != null) { |
| | | if (es.HPSignUpStatus__c.equals('申请中') &&oldESignHPStatusMap.size()>0 ) { |
| | | if(!oldESignHPStatusMap.get('H' + es.Id).equals('申请中')){ |
| | | es.HPAttachNum__c = h; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | a = 0; |
| | | h = 0; |
| | | |
| | | } |
| | | } |
| | | //电子签收单 增加本次更新附件数量 2020/01/07 精琢技术 wql end |
| | | //文件 end |
| | | } |
| | | system.debug('更新的签收单:' + eSignFormList); |
| | | //更新签收单明细并添加日志 |
| | | if (eSignFormLuRUList.size() > 0) { |
| | | Database.SaveResult[] lsr = Database.update(eSignFormLuRUList, false); |
| | | eb.setError(lsr, MAXERRORCNT, eSignFormLineItem__c.sObjectType); |
| | | for (Integer tIdx = 0; tIdx < lsr.size(); tIdx++) { |
| | | Database.SaveResult sr = lsr[tIdx]; |
| | | System.debug('sr.isSuccess:' + sr.isSuccess()); |
| | | if (!sr.isSuccess()) { |
| | | Database.Error emsg = sr.getErrors()[0]; |
| | | iflog.ErrorLog__c += 'ERROR ' + eSignFormList[tIdx].Id + ' eSignFormLineItem__c:' + emsg + '\n'; |
| | | } |
| | | } |
| | | } |
| | | //更新签收单并添加日志 |
| | | if (eSignFormList.size() > 0) { |
| | | Database.SaveResult[] lsr = Database.update(eSignFormList, false); |
| | | eb.setError(lsr, MAXERRORCNT, eSignForm__c.sObjectType); |
| | | for (Integer tIdx = 0; tIdx < lsr.size(); tIdx++) { |
| | | Database.SaveResult sr = lsr[tIdx]; |
| | | System.debug('sr.isSuccess:' + sr.isSuccess()); |
| | | if (!sr.isSuccess()) { |
| | | Database.Error emsg = sr.getErrors()[0]; |
| | | iflog.ErrorLog__c += 'ERROR ' + eSignFormList[tIdx].Id + ' eSignForm__c:' + emsg + '\n'; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }catch(NullPointerException npe){ |
| | | |
| | | iflog.ErrorLog__c += 'ERROR : eSignForm__c:空指针错误-行号:'+ npe.getLineNumber()+ '\n'; |
| | | } |
| | | catch (Exception e) { |
| | | // Database.rollback(sp); |
| | | |
| | | iflog.ErrorLog__c += 'ERROR : eSignForm__c:'+ e.getMessage() + '\n'; |
| | | |
| | | } |
| | | try{ |
| | | System.debug('luruIsLastSubmitList:'+luruIsLastSubmitList); |
| | | if (luruIsLastSubmitList.size() > 0) { |
| | | //删除中间表数据(因为住主详关系,删除录入表即可) |
| | | deleteMiddleData(eSignStringMap, luruIsLastSubmitList); |
| | | } |
| | | }catch(Exception e){ |
| | | iflog.ErrorLog__c += 'ERROR : eSignForm__c:'+ e.getMessage() + '\n'; |
| | | } |
| | | //文件 end |
| | | } |
| | | |
| | | //删除中间表数据(因为住主详关系,删除录入表即可) |
| | | private static void deleteMiddleData(Map < String, eSignFormEntry__c > eSignStringMap, List < String > luruIsSubmitList) { |
| | | system.debug('检索的所有录入表:' + eSignStringMap); |
| | | system.debug('最后录入的id :' + luruIsSubmitList + '----数量:' + luruIsSubmitList.size()); |
| | | list < eSignFormEntry__c > eSignFormDeleteList = new list < eSignFormEntry__c > (); |
| | | for (String essm : eSignStringMap.keySet()) { |
| | | for (String lisl : luruIsSubmitList) { |
| | | if (essm.equals(lisl)) { |
| | | eSignStringMap.remove(lisl); |
| | | } |
| | | } |
| | | } |
| | | for (eSignFormEntry__c esfe : eSignStringMap.values()) { |
| | | eSignFormDeleteList.add(esfe); |
| | | } |
| | | system.debug('删除的数据id:' + eSignFormDeleteList + '----数量:' + eSignFormDeleteList.size()); |
| | | |
| | | |
| | | |
| | | //删除签收单录入表其他数据 |
| | | if (eSignFormDeleteList.size() > 0) { |
| | | //循环遍历id 删除文件 |
| | | List<String> fileDeleteIdList = new List<String> (); |
| | | List<Attachment> deleteAttachmentList = new List<Attachment>(); |
| | | |
| | | for (eSignFormEntry__c eSigf : eSignFormDeleteList) { |
| | | fileDeleteIdList.add(eSigf.Id); |
| | | } |
| | | //循环找到文件id |
| | | if (fileDeleteIdList.size() > 0) { |
| | | |
| | | // 2022-02-28 shashiming Apex heap size too large |
| | | // 去掉Body字段 |
| | | List<Attachment> attachMentList = [SELECT id, parentId, Name, ContentType,Description from Attachment where parentId = :fileDeleteIdList]; |
| | | |
| | | if (attachMentList.size() > 0) { |
| | | for (Attachment att : attachMentList) { |
| | | Attachment am = new Attachment(); |
| | | am.Id = att.Id; |
| | | deleteAttachmentList.add(am); |
| | | } |
| | | //删除文件 |
| | | if (deleteAttachmentList.size() > 0) { |
| | | delete deleteAttachmentList; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | //删除录入表 |
| | | delete eSignFormDeleteList; |
| | | } |
| | | } |
| | | @TestVisible |
| | | //更新营业部担当 |
| | | private static List < eSignForm__c > updateOwner(List < String > provinceList, Map < Id, String > provinceMap, List < eSignForm__c > eSignFormList, boolean ocsmFlag) { |
| | | //营业担当 map |
| | | Map < String, String > provinceOwnerMap = new Map < String, String > (); |
| | | //营业助理 map |
| | | Map < String, String > provinceGIMap = new Map < String, String > (); |
| | | |
| | | List < eSignForm__c > eSignFormLastList = new List < eSignForm__c >(); |
| | | //检索OCSM管理省对象 |
| | | List < OCM_Management_Province__c > ompList = [select id, Name, SalesManage__c,GI_assistant__c from OCM_Management_Province__c where Name IN: provinceList]; |
| | | //存放map<省,担当> |
| | | for (OCM_Management_Province__c omp : ompList) { |
| | | //不用map<String,list>的 原因是 想 ocsm管理省 和签收单 营业担当的顺序保持一致 |
| | | //String salesManage = omp.SalesManage__c+','+omp.SalesManage2__c+','+omp.SalesManage3__c; |
| | | //provinceOwnerMap.put(omp.Name, salesManage); |
| | | provinceOwnerMap.put(omp.Name, omp.SalesManage__c); |
| | | provinceGIMap.put(omp.Name, omp.GI_assistant__c); |
| | | } |
| | | //①为true的时候 是其他没发生变化只有ocsm省上营业担当改变 |
| | | //②为false的时候,有中间表正常更新的情况 |
| | | //营业担当123 可能以后不用 20201225 start |
| | | // if(ocsmFlag){ |
| | | // //给最后要更新的签收单的审批者(营业部担当)赋值 |
| | | // for (Integer cnt=0;cnt<eSignFormList.size();cnt++) { |
| | | // //将逗号分隔的字符串转为数组 |
| | | // //因为其中有逗号,所以肯定不为空 |
| | | // String rcManager = provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)); |
| | | // String[] result; |
| | | // if(rcManager !=null && String.isNotBlank(rcManager)){ |
| | | // result= rcManager.split(','); |
| | | // } |
| | | |
| | | // if(result.size()>0&&result!=null){ |
| | | // if(result.contains(eSignFormList[cnt].RC_Manager__c)&&result.contains(eSignFormList[cnt].RC_Manager2__c)&&result.contains(eSignFormList[cnt].RC_Manager3__c)){ |
| | | // //则不用更新,返回null |
| | | // eSignFormList.remove(cnt); |
| | | // eSignFormLastList =eSignFormList; |
| | | // }else{ |
| | | // eSignForm__c eSignForm = new eSignForm__c(); |
| | | // eSignForm.Id = eSignFormList[cnt].Id; |
| | | // if(result.size()>0){ |
| | | // if(String.isNotBlank(result[0])&&result[0]!=null&&result[0]!=''&&result[0]!='null'){ |
| | | // eSignForm.RC_Manager__c = result[0]; |
| | | // }else{ |
| | | // eSignForm.RC_Manager__c = null; |
| | | // } |
| | | // if(String.isNotBlank(result[1])&&result[1]!=null&&result[1]!=''&&result[1]!='null'){ |
| | | // eSignForm.RC_Manager2__c = result[1]; |
| | | // }else{ |
| | | // eSignForm.RC_Manager2__c = null; |
| | | // } |
| | | // if(String.isNotBlank(result[2])&&result[2]!=null&&result[2]!=''&&result[2]!='null'){ |
| | | // eSignForm.RC_Manager3__c = result[2]; |
| | | // }else{ |
| | | // eSignForm.RC_Manager3__c = null; |
| | | // } |
| | | // } |
| | | // //eSignForm.RC_Manager__c = provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)); |
| | | // eSignFormLastList.add(eSignForm); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // } |
| | | // return eSignFormLastList; |
| | | |
| | | // }else{ |
| | | // //给最后要更新的签收单的审批者(营业部担当)赋值 |
| | | // for (eSignForm__c esf: eSignFormList) { |
| | | // //将逗号分隔的字符串转为数组 |
| | | // //因为其中有逗号,所以肯定不为空 |
| | | // String rcManager = provinceOwnerMap.get(provinceMap.get(esf.Id)); |
| | | // String[] result; |
| | | // if(rcManager!=null&&String.isNotBlank(rcManager)){ |
| | | // result = rcManager.split(','); |
| | | // } |
| | | |
| | | // if(result.size()>0){ |
| | | // if(String.isNotBlank(result[0])&&result[0]!=null&&result[0]!=''&&result[0]!='null'){ |
| | | // esf.RC_Manager__c = result[0]; |
| | | // } |
| | | // if(String.isNotBlank(result[1])&&result[1]!=null&&result[1]!=''&&result[1]!='null'){ |
| | | // esf.RC_Manager2__c = result[1]; |
| | | // } |
| | | // if(String.isNotBlank(result[2])&&result[2]!=null&&result[2]!=''&&result[2]!='null'){ |
| | | // esf.RC_Manager3__c = result[2]; |
| | | // } |
| | | // } |
| | | // //esf.RC_Manager__c = provinceOwnerMap.get(provinceMap.get(esf.Id)); |
| | | // } |
| | | // return eSignFormList; |
| | | // } |
| | | //营业担当123 可能以后不用 20201225 end |
| | | if (ocsmFlag) { |
| | | //给最后要更新的签收单的审批者(营业部担当)赋值 |
| | | for (Integer cnt = 0; cnt < eSignFormList.size(); cnt++) { |
| | | if (provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)) != eSignFormList[cnt].RC_Manager__c ||provinceMap.get(eSignFormList[cnt].Id).equals('集采课')) { |
| | | |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Id = eSignFormList[cnt].Id; |
| | | eSignForm.RC_Manager__c = provinceOwnerMap.get(provinceMap.get(eSignFormList[cnt].Id)); |
| | | //集采询价 营业助理需要维护成 集采课的SP、GI助理 精琢技术 wql 2021/01/08 start |
| | | if(provinceMap.get(eSignFormList[cnt].Id).equals('集采课')){ |
| | | eSignForm.Sales_assistant_name_text__c = provinceGIMap.get(provinceMap.get(eSignFormList[cnt].Id)); |
| | | } |
| | | //集采询价 营业助理需要维护成 集采课的SP、GI助理 精琢技术 wql 2021/01/08 end |
| | | eSignFormLastList.add(eSignForm); |
| | | } |
| | | |
| | | } |
| | | return eSignFormLastList; |
| | | |
| | | } else { |
| | | //给最后要更新的签收单的审批者(营业部担当)赋值 |
| | | for (eSignForm__c esf : eSignFormList) { |
| | | if (provinceOwnerMap.get(provinceMap.get(esf.Id)) != null) { |
| | | esf.RC_Manager__c = provinceOwnerMap.get(provinceMap.get(esf.Id)); |
| | | //集采询价 营业助理需要维护成 集采课的SP、GI助理 精琢技术 wql 2021/01/08 start |
| | | if(provinceMap.get(esf.Id).equals('集采课')){ |
| | | esf.Sales_assistant_name_text__c = provinceGIMap.get(provinceMap.get(esf.Id)); |
| | | } |
| | | //集采询价 营业助理需要维护成 集采课的SP、GI助理 精琢技术 wql 2021/01/08 end |
| | | } |
| | | |
| | | } |
| | | return eSignFormList; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | //更新该日志的数据信息 |
| | | iflog.Log__c += '\nupdateESignBatchAttachment end'; |
| | | String tmp = iflog.ErrorLog__c; |
| | | if (iflog.Log__c.length() > 131072) { |
| | | iflog.Log__c = iflog.Log__c.subString(0, 131065) + ' ...'; |
| | | } |
| | | if (iflog.ErrorLog__c.length() > 32768) { |
| | | iflog.ErrorLog__c = iflog.ErrorLog__c.subString(0, 32760) + ' ...'; |
| | | } |
| | | if (tmp.length() > 65000) { |
| | | tmp = tmp.substring(0, 65000); |
| | | tmp += ' ...have more lines...'; |
| | | iflog.ErrorLog__c = tmp; |
| | | } |
| | | //有错误才添加日志,不然每天每15分钟生成日志太多 |
| | | if (tmp.length() > 0) { |
| | | insert iflog; |
| | | } |
| | | |
| | | system.debug('手动传参:' + ManualExecution_Identification); |
| | | //手动传参执行则不进入创建计划的作业 |
| | | if (!ManualExecution_Identification) { |
| | | Boolean haveError = false; |
| | | String body = scErrorMessage; |
| | | for (Id objId : eb.messageMap.keySet()) { |
| | | haveError = true; |
| | | body += eb.messageMap.get(objId) + '<br/>'; |
| | | } |
| | | if (eb.overMax) { |
| | | body += ':Over ' + MAXERRORCNT + 'Record<br/>'; |
| | | } |
| | | updateESignBatchAttachment.removeOtherSc('updateESignFormSchedule', scB.scName); |
| | | if (haveError == true || String.isNotBlank(scErrorMessage)) { |
| | | // BatchユーザId |
| | | //写死精琢用户 上线后应该会修改成自定义标签 |
| | | // String batchUserId = '00510000005sEEM'; |
| | | String batchUserId = System.Label.Batch_User_Id; |
| | | List<User> us = [Select Id, NAme, Email From User Where Id = : batchUserId]; |
| | | if (!us.isEmpty()) { |
| | | User use = us[0]; |
| | | if (String.isNotBlank(use.Email)) { |
| | | List<String> MailCc; |
| | | if (System.Label.ESign_Error_Send_To_CC != 'null') { |
| | | MailCc = System.Label.ESign_Error_Send_To_CC.split(','); |
| | | } |
| | | FixtureUtil.sendMessage(batchUserId, |
| | | MailCc, |
| | | 'updateESignBatchAttachment Error', |
| | | body |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | public class ErrorBean { |
| | | // public String objectName; |
| | | // public String objectLabel; |
| | | public Map<Id, String> messageMap; |
| | | public Boolean overMax; |
| | | // public ErrorBean(Schema.sObjectType obj) { |
| | | // objectName = obj.getDescribe().getName(); |
| | | // objectLabel = obj.getDescribe().getLabel(); |
| | | // messageMap = new Map<Id, String>(); |
| | | // overMax = false; |
| | | // } |
| | | public ErrorBean() { |
| | | messageMap = new Map<Id, String>(); |
| | | overMax = false; |
| | | } |
| | | public void setError (Database.SaveResult[] saveRes, Integer maxCut, Schema.sObjectType obj) { |
| | | if (messageMap.keySet().size() <= maxCut && overMax == false) { |
| | | String objectName = obj.getDescribe().getName(); |
| | | String objectLabel = obj.getDescribe().getLabel(); |
| | | for (Database.SaveResult saveRe : saveRes) { |
| | | if (!saveRe.isSuccess()) { |
| | | if (!messageMap.containsKey(saveRe.getId())) { |
| | | if (messageMap.keySet().size() >= maxCut) { |
| | | overMax = true; |
| | | break; |
| | | } |
| | | for (Database.Error err : saveRe.getErrors()) { |
| | | |
| | | String message = objectName + ':' |
| | | + objectLabel + ':' |
| | | + err.getStatusCode() + ':' |
| | | + err.getFields() + ':' |
| | | + err.getMessage(); |
| | | // 数据里面有复数错误信息的话只获取第一条 |
| | | messageMap.put(saveRe.getId(), message); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //定时跑任务 |
| | | public Class ScBean { |
| | | public String scName; |
| | | public String scTime; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | private class updateESignBatchTest { |
| | | //测试经销商收货 |
| | | static testMethod void testMethod1() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | eSignForm.Statu_Achievements__c = Sac.Id; |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | |
| | | eSignFormEntry2.HPConfirmDateBack__c = Date.today().addDays(-2); |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | Test.startTest(); |
| | | |
| | | |
| | | Database.executeBatch(new updateESignBatch(), 20); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | //测试经销商确认 |
| | | static testMethod void testMethod2() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试医院收货 |
| | | static testMethod void testMethod3() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试医院确认 |
| | | static testMethod void testMethod4() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | |
| | | static testMethod void testMethod5() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod6() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod7() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod8() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod9() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | |
| | | static testMethod void testMethod10() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试经销商收货 |
| | | static testMethod void testMethod11() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry4; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry4; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | } |
| | | //测试医院确认 |
| | | static testMethod void testMethod12() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | //测试经销商收货 |
| | | static testMethod void testMethod13() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | eSignForm.agencyRejectDate__c = Date.today().addDays(2); |
| | | eSignForm.HPRejectDate__c = Date.today().addDays(2); |
| | | |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | /* eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2;*/ |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | | eSignFormLineItem.eSignForm__c = eSignForm.Id; |
| | | |
| | | |
| | | insert eSignFormLineItem; |
| | | |
| | |
| | | |
| | | insert eSignFormLineItemEntry2;*/ |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | |
| | | Test.startTest(); |
| | | |
| | | |
| | | Database.executeBatch(new updateESignBatch(), 20); |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | //跑单独方法 |
| | | @isTest |
| | | private static void test_upsertESignLineItems() { |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | ); |
| | | insert Sac; |
| | | |
| | | |
| | | //新建电子签收单 |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Statu_Achievements__c = Sac.Id; |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | eSignFormLineItem.eSignForm__c = eSignForm.Id; |
| | | |
| | | insert eSignFormLineItem; |
| | | |
| | | |
| | | |
| | | /*list<Attachment> attachmentList = new list<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | |
| | | |
| | | // } |
| | | |
| | | |
| | | OCM_Management_Province__c mp1 = new OCM_Management_Province__c(); |
| | | mp1.Name = '江西'; |
| | | mp1.GI_assistant__c = UserInfo.getUserId(); |
| | |
| | | eSignFormList.add(eSignForm); |
| | | |
| | | updateESignBatch.updateOwner(provinceList,provinceMap,eSignFormList,true); |
| | | |
| | | } |
| | | |
| | | //测试经销商收货 |
| | | static testMethod void testMethod14() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | List<RecordType> rectSct = [ |
| | | SELECT Id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '戦略科室分類 呼吸科' |
| | | ]; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | List<RecordType> rectDpt = [ |
| | | SELECT Id, Name |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name IN ('診療科 消化科', '診療科 呼吸科') |
| | | ORDER BY Name DESC |
| | | ]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | List<RecordType> rectAs = [SELECT Id, Name FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Asset' AND Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | List<Account> hps = new List<Account>{ company1 }; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | List<Account> dc1s = [ |
| | | SELECT Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c |
| | | FROM Account |
| | | WHERE Parent.Id = :company1.Id |
| | | ORDER BY Department_Class_Label__c |
| | | ]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | insert new List<Account>{ depart1 }; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | Asset ast1 = [SELECT RecordTypeID__c FROM Asset WHERE Id = :ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | RecordType rectOpp = [ |
| | | SELECT id |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Opportunity' AND DeveloperName = 'Opportunity' |
| | | ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | |
| | | eSignForm.agencyRejectDate__c = Date.today().addDays(2); |
| | | eSignForm.HPRejectDate__c = Date.today().addDays(2); |
| | | |
| | | |
| | | insert eSignForm; |
| | | |
| | | eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | | eSignFormEntry1.Name = '::电子签收单录入表1'; |
| | | eSignFormEntry1.eSignForm__c = eSignForm.Id; |
| | | eSignFormEntry1.entryType__c = '经销商收货'; |
| | | |
| | | |
| | | insert eSignFormEntry1; |
| | | |
| | |
| | | eSignFormEntry2.HPConfirmDateBack__c = Date.today().addDays(-2); |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | list<Attachment> attachmentList = new list<Attachment>(); |
| | | list<Attachment> attachmentList = new List<Attachment>(); |
| | | Attachment attach=new Attachment(); |
| | | attach.Name='Unit Test Attachment'; |
| | | Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body'); |
| | |
| | | attach1.parentId=eSignForm.id; |
| | | attach1.ContentType = 'application/pdf'; |
| | | |
| | | |
| | | attachmentList.add(attach1); |
| | | |
| | | Attachment attach2=new Attachment(); |
| | |
| | | attach2.parentId=eSignForm.id; |
| | | attach2.ContentType = 'application/pdf'; |
| | | |
| | | |
| | | attachmentList.add(attach2); |
| | | |
| | | insert attachmentList; |
| | | |
| | | Test.startTest(); |
| | | |
| | | |
| | | Database.executeBatch(new updateESignBatch(), 20); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod15(){ |
| | | Test.startTest(); |
| | | updateESignBatch.improveTestRate(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <template> |
| | | <template for:each={courses} for:item="course"> |
| | | <p key={course}>{course}</p> |
| | | </template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class AfterRenderHook extends LightningElement { |
| | | courses = []; |
| | | rendered = false; |
| | | |
| | | renderedCallback() { |
| | | if (!this.rendered) { |
| | | this.courses = ['Irrigation Systems', 'Soils', 'Organic Crops']; |
| | | this.rendered = true; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | <targetConfigs> |
| | | <targetConfig targets="lightning__RecordAction"> |
| | | <actionType>Action</actionType> |
| | | </targetConfig> |
| | | </targetConfigs> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom7" |
| | | lwc="afterRenderHook" |
| | | title="After Render Hook" |
| | | visualforce="afterRenderHook" |
| | | visualforce-height="90px" |
| | | > |
| | | <c-after-render-hook slot="lwc"></c-after-render-hook> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_lifecycle_hooks_rendered"> |
| | | renderedCallback</a> to execute code after a component is rendered. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class AfterRenderHookWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | /** |
| | | * Formats a list of sObjects returned by an Apex method call |
| | | * @param {SObject[]} sObjects |
| | | * @return {Object[]} formattedObjects, ready to use by lightning-datatable |
| | | */ |
| | | export function formatApexSObjects(sObjects) { |
| | | try { |
| | | return sObjects.map(formatApexSObject); |
| | | } catch (err) { |
| | | return []; |
| | | } |
| | | } |
| | | |
| | | function formatApexSObject(sObject) { |
| | | return flatten(sObject, ''); |
| | | } |
| | | |
| | | function flatten(source, prefix) { |
| | | const target = {}; |
| | | Object.keys(source).forEach((key) => { |
| | | const value = source[key]; |
| | | const field = `${prefix}${key}`; |
| | | if (typeof value === 'object') { |
| | | const nested = flatten(value, `${field}.`); |
| | | Object.assign(target, nested); |
| | | } else { |
| | | target[field] = value; |
| | | } |
| | | }); |
| | | return target; |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Narrow{ |
| | | padding: 20px; |
| | | } |
| | | .searchField,.searchField .input-text{ |
| | | /*display: flex;*/ |
| | | } |
| | | .searchField .slds-combobox_container{ |
| | | width: 160px !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <!-- <div class="slds-box slds-theme--default"> |
| | | Click on the link Below to Export data as csv/xls. |
| | | <p class="slds-m-top--large"> |
| | | <a onclick={exportContactData}>Export Contact Data</a> |
| | | <lightning-button variant="brand" label="Export Contact data" title="Export Contact Data" onclick={exportContactData}></lightning-button> |
| | | </p> |
| | | </div> --> |
| | | <lightning-card variant="Narrow"> |
| | | <div style="padding: 0 20px"> |
| | | <div> |
| | | <div style="padding: 10px 3px;border-bottom: 1px solid;font: 16px;font-size: blod;">检索列</div> |
| | | <div style="margin-top: 5px"> |
| | | <lightning-layout> |
| | | <!-- cancelPaddingLeft --> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-combobox name="progress" label="状态1" value={searchObj.Status1} options={status1Options} |
| | | onchange={handleStatus1Change} class="searchField"></lightning-combobox> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-combobox |
| | | name="progress" label="状态2" value={searchObj.Status2} options={status2Options} onchange={handleStatus2Change} |
| | | class="searchField"></lightning-combobox> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-combobox |
| | | name="progress" label="服务方式" value={searchObj.onSiteRepair} options={siteRepairItems} onchange={handleSiteChange} |
| | | class="searchField"></lightning-combobox> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.RepairName} type="text" label="RS修理单号" class="searchField" onchange={handleRepairNameChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.SAPRepairNo} type="text" label="SAP修理单号" class="searchField" onchange={handleSAPRepairNoChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.workLocationSelect} type="text" label="维修中心" class="searchField" onchange={handleWorkLocationChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.SerialNumber} type="text" label="机身编码" class="searchField" onchange={handleSerialNumberChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.State_Hospital} type="text" label="省份" class="searchField" onchange={handleStateHospitalChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.HospitalName} type="text" label="医院名称" class="searchField" onchange={handleHospitalChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item size="2" padding="horizontal-small"> |
| | | <lightning-input type="date" label="FSE申请日(开始)" value={repair.Aware_date__c} onchange={handleAwareDateDStart}></lightning-input> |
| | | </lightning-layout-item> |
| | | <!-- cancelPaddingLeft --> |
| | | <lightning-layout-item size="2" padding="horizontal-small"> |
| | | <!-- variant="label-hidden" --> |
| | | <lightning-input type="date" label="FSE申请日(结束)" value={repair.Aware_date2__c} onchange={handleAwareDateDEnd}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <!-- record-id={recordId} 修理委托者 Incharge_Staff__c--> |
| | | <!-- <lightning-record-edit-form |
| | | object-api-name={objectApiName} |
| | | record-id='' |
| | | > |
| | | <lightning-input-field field-name={nameField} onclick={handleInchargeStaffChange}> </lightning-input-field> |
| | | </lightning-record-edit-form> --> |
| | | <lightning-record-edit-form |
| | | object-api-name='Repair__c' |
| | | record-id='' |
| | | > |
| | | <lightning-input-field field-name='Incharge_Staff__c' onclick={handleInchargeStaffChange}> </lightning-input-field> |
| | | </lightning-record-edit-form> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-button label="检索" onclick={searchRepair}></lightning-button> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div style="padding: 10px 5px;border-bottom: 1px solid">详细信息</div> |
| | | <div style="padding: 10px 0;"> |
| | | <lightning-button label="打印PDF" onclick={skipPage}></lightning-button> |
| | | |
| | | <lightning-button label="导出Excel" onclick={exportContactData}></lightning-button> |
| | | <!-- <lightning-button label="导出Excel" onclick={downloadCSVFile}></lightning-button> --> |
| | | </div> |
| | | <div> |
| | | <lightning-datatable |
| | | key-field="id" |
| | | data={data} |
| | | columns={columns} |
| | | onrowselection={getSelectedRows} |
| | | onrowaction={handleRowAction}> |
| | | |
| | | </lightning-datatable> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </lightning-card> |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import NAME_FIELD from '@salesforce/schema/Repair__c.Incharge_Staff__c'; |
| | | import MY_CUSTOM_OBJECT from '@salesforce/schema/Repair__c'; |
| | | |
| | | import search from '@salesforce/apex/BatchSelectRepairLWCController.search'; |
| | | import showPDF from '@salesforce/apex/BatchSelectRepairLWCController.showPDF'; |
| | | |
| | | /* |
| | | const actions = [ |
| | | { label: 'Show details', name: 'show_details' }, |
| | | { label: 'Delete', name: 'delete' }, |
| | | ];*/ |
| | | |
| | | const columns = [ |
| | | { label: '状态1', fieldName: 'Status1__c'}, |
| | | { label: '状态2', fieldName: 'Status2__c' }, |
| | | { label: 'RS修理单号', fieldName: 'Name' }, |
| | | { label: 'SAP修理单号', fieldName: 'SAP_Service_Repair_No__c' }, |
| | | // { label: '型号', fieldName: 'deliveredProductName' }, |
| | | { label: '型号', fieldName: 'deliveredProductUrl',type:'url', |
| | | typeAttributes:{ |
| | | label:{ |
| | | fieldName:'deliveredProductName' |
| | | }, |
| | | target:'_balank' |
| | | } |
| | | }, |
| | | { label: '机身编号', fieldName: 'SerialNumber__c' }, |
| | | { label: '医院名称', fieldName: 'HP_Name__c' }, |
| | | { label: '省份', fieldName: 'State_Hospital__c' }, |
| | | // { label: '修理委托者', fieldName: 'Incharge_Staff_Name' }, |
| | | { label: '修理委托者', fieldName: 'inchargeStaffUrl',type:'url', |
| | | typeAttributes:{ |
| | | label:{ |
| | | fieldName:'inchargeStaffName' |
| | | }, |
| | | target:'_balank' |
| | | } |
| | | }, |
| | | { label: 'FSE申请日期', fieldName: 'FSE_ApplyForRepair_Day__c' }, |
| | | { label: '维修中心', fieldName: 'work_location_select__c' }, |
| | | { label: '服务方式', fieldName: 'On_site_repair__c' }, |
| | | { label: '有无维修合同对象', fieldName: 'Number_of_EffectiveContract__c' }, |
| | | { label: '无偿区别标志', fieldName: 'NewProductGuaranteeObject__c' } |
| | | /* { |
| | | type: 'action', |
| | | typeAttributes: { rowActions: actions }, |
| | | },*/ |
| | | ]; |
| | | |
| | | export default class batchSelectRepairLWC extends LightningElement { |
| | | // Expose a field to make it available in the template |
| | | nameField = NAME_FIELD; |
| | | |
| | | // Flexipage provides recordId and objectApiName |
| | | @api recordId; |
| | | @api objectApiName; |
| | | |
| | | data = []; |
| | | columns = columns; |
| | | |
| | | //状态1 |
| | | status1Options = [{ label: '--无--', value: '' }, |
| | | { label: '0.申请完毕', value: '0.申请完毕' }, |
| | | { label: '2.维修报价阶段', value: '2.维修报价阶段' }, |
| | | { label: '3.维修阶段', value: '3.维修阶段' }, |
| | | { label: '4.修理品返送阶段', value: '4.修理品返送阶段' }, |
| | | { label: '5.完毕', value: '5.完毕' }, |
| | | { label: '0.删除', value: '0.删除' }, |
| | | { label: '0.取消', value: '0.取消' }]; |
| | | //状态2 |
| | | status2Options = [{label:'00.申请完毕', value:'00.申请完毕'}, |
| | | {label:'01.分公司受理完毕', value:'01.分公司受理完毕'}, |
| | | {label:'02.RC受理完毕', value:'02.RC受理完毕'}, |
| | | {label:'03.报价检查结束', value:'03.报价检查结束'}, |
| | | {label:'04.报价跟进中', value:'04.报价跟进中'}, |
| | | {label:'05.报价同意完备', value:'05.报价同意完备'}, |
| | | {label:'06.零件齐备', value:'06.零件齐备'}, |
| | | {label:'07.修理開始', value:'07.修理開始'}, |
| | | {label:'08.修理预计完成', value:'08.修理预计完成'}, |
| | | {label:'09.修理完成', value:'09.修理完成'}, |
| | | {label:'10.最终检查完成', value:'10.最终检查完成'}, |
| | | {label:'11.RC修理品已返送', value:'11.RC修理品已返送'}, |
| | | {label:'12.发票已发送', value:'12.发票已发送'}, |
| | | {label:'13.已返送到用户', value:'13.已返送到用户'}, |
| | | {label:'14.收到验收单', value:'14.收到验收单'}, |
| | | {label:'15.验收单签收复核通过', value:'15.验收单签收复核通过'}, |
| | | {label:'16.部分付款', value:'16.部分付款'}, |
| | | {label:'16.完毕', value:'16.完毕'}, |
| | | {label:'17.付款完毕', value:'17.付款完毕'}, |
| | | {label:'00.取消', value:'00.取消'}, |
| | | {label:'00.删除', value:'00.删除'}, |
| | | {label:'00.关闭', value:'00.关闭'}]; |
| | | //服务方式 |
| | | siteRepairItems = [{label:'--无--',value:''}, |
| | | {label:'RC修理',value:'RC修理'}, |
| | | {label:'直送SORC修理',value:'直送SORC修理'}, |
| | | {label:'直送OGZ修理',value:'直送OGZ修理'}, |
| | | {label:'办事处修理',value:'办事处修理'}, |
| | | {label:'现场修理',value:'现场修理'}]; |
| | | |
| | | searchObj = {}; |
| | | repair = {}; |
| | | selectedRepairs; |
| | | |
| | | /* @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | connectedCallback(){ |
| | | // console.log(this.recordId); |
| | | } |
| | | //状态1 |
| | | handleStatus1Change(event){ |
| | | /*console.log(event); |
| | | console.log(event.detail);*/ |
| | | this.searchObj.Status1 = event.detail.value; |
| | | // console.log(JSON.stringify(this.searchObj)); |
| | | } |
| | | //状态2 |
| | | handleStatus2Change(event){ |
| | | this.searchObj.Status2 = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //服务方式 |
| | | handleSiteChange(event){ |
| | | this.searchObj.onSiteRepair = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //RS修理单号 RepairName |
| | | handleRepairNameChange(event){ |
| | | this.searchObj.RepairName = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //SAP修理单号 SAPRepairNo |
| | | handleSAPRepairNoChange(event){ |
| | | this.searchObj.SAPRepairNo = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //维修中心 workLocationSelect |
| | | handleWorkLocationChange(event){ |
| | | this.searchObj.workLocationSelect = event.detail.value; |
| | | } |
| | | //机身编码 SerialNumber |
| | | handleSerialNumberChange(event){ |
| | | this.searchObj.SerialNumber = event.detail.value; |
| | | } |
| | | // 省份 State_Hospital |
| | | handleStateHospitalChange(event){ |
| | | this.searchObj.State_Hospital = event.detail.value; |
| | | } |
| | | //医院名称 HospitalName |
| | | handleHospitalChange(event){ |
| | | this.searchObj.HospitalName = event.detail.value; |
| | | } |
| | | //FSE申请日 repair.Aware_date__c |
| | | handleAwareDateDStart(event){ |
| | | this.repair.Aware_date__c = event.detail.value; |
| | | console.log(this.repair.Aware_date__c); |
| | | } |
| | | // repair.Aware_date2__c |
| | | handleAwareDateDEnd(event){ |
| | | this.repair.Aware_date2__c = event.detail.value; |
| | | // console.log(this.repair.Aware_date2__c); |
| | | } |
| | | // 修理委托者 repair.Incharge_Staff__c |
| | | handleInchargeStaffChange(event){ |
| | | this.repair.Incharge_Staff__c = event.detail.value; |
| | | // console.log(this.repair.Aware_date2__c); |
| | | } |
| | | |
| | | //检索 |
| | | searchRepair(event) { |
| | | console.log(this.repair.Aware_date__c); |
| | | if (JSON.stringify(this.repair) != "{}") { |
| | | console.log('this.repair'); |
| | | this.searchObj.repair = this.repair; |
| | | // fse 时间条件 |
| | | /*if (!(this.repair.Aware_date__c != null && this.repair.Aware_date2__c != null) || this.repair.Aware_date__c > this.repair.Aware_date2__c) { |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: 'FSE申请日输入有误', |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | }*/ |
| | | } |
| | | let jsonStr = JSON.stringify(this.searchObj); |
| | | if (jsonStr === "{}") { |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: '请至少添加一个检索条件!', |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | }else{ |
| | | console.log(jsonStr); |
| | | search({ |
| | | json: jsonStr |
| | | }).then(result => { |
| | | console.log(result.repairData); |
| | | console.log('length:'+result.repairData.length); |
| | | if (result.repairData.length == 0 || result.repairData.length == 200) { |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: result.status, |
| | | variant:'warning', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | let returnArr = []; |
| | | result.repairData.forEach(function(v){ |
| | | let objRepair = v.repair; |
| | | //添加修理委托者和型号名称 |
| | | objRepair.deliveredProductName = objRepair.Delivered_Product__r.Name; |
| | | objRepair.deliveredProductUrl = "/"+objRepair.Delivered_Product__c; |
| | | objRepair.inchargeStaffName = objRepair.Incharge_Staff__r.Name; |
| | | objRepair.inchargeStaffUrl = "/"+objRepair.Incharge_Staff__c; |
| | | // console.log(objRepair); |
| | | returnArr.push(objRepair); |
| | | }); |
| | | /*console.log('arr'); |
| | | console.log(arr); |
| | | console.log(arr.length);*/ |
| | | this.data = returnArr; |
| | | // console.log(this.data); |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | //导出为Excel 画table |
| | | exportContactData(){ |
| | | // Prepare a html table |
| | | let doc = '<table>'; |
| | | // Add styles for the table |
| | | doc += '<style>'; |
| | | doc += 'table, th, td {'; |
| | | doc += ' border: 1px solid black;'; |
| | | doc += ' border-collapse: collapse;'; |
| | | doc += '}'; |
| | | doc += '</style>'; |
| | | // Add all the Table Headers |
| | | doc += '<tr>'; |
| | | this.columns.forEach(element => { |
| | | doc += '<th>'+ element.label +'</th>' |
| | | }); |
| | | doc += '</tr>'; |
| | | // Add the data rows |
| | | let fieldNameArr =[]; |
| | | this.columns.forEach(function(v){ |
| | | if (v['typeAttributes']) { |
| | | fieldNameArr.push(v['typeAttributes'].label.fieldName); |
| | | }else{ |
| | | fieldNameArr.push(v.fieldName); |
| | | } |
| | | }); |
| | | console.log(fieldNameArr); |
| | | fieldNameArr.forEach(v=>{ |
| | | console.log(v); |
| | | // console.log(this.data[0].v); |
| | | }) |
| | | this.data.forEach(record => { |
| | | doc += '<tr>'; |
| | | if (record.Status1__c != null) { |
| | | doc += '<th>'+record.Status1__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.Status2__c != null) { |
| | | doc += '<th>'+record.Status2__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.Name != null) { |
| | | doc += '<th>'+record.Name+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.SAP_Service_Repair_No__c != null) { |
| | | doc += '<th>'+record.SAP_Service_Repair_No__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.deliveredProductName != null) { |
| | | doc += '<th>'+record.deliveredProductName+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.SerialNumber__c != null) { |
| | | doc += '<th>'+record.SerialNumber__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.HP_Name__c != null) { |
| | | doc += '<th>'+record.HP_Name__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.State_Hospital__c != null) { |
| | | doc += '<th>'+record.State_Hospital__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.inchargeStaffName != null) { |
| | | doc += '<th>'+record.inchargeStaffName+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.FSE_ApplyForRepair_Day__c != null) { |
| | | doc += '<th>'+record.FSE_ApplyForRepair_Day__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.work_location_select__c != null) { |
| | | doc += '<th>'+record.work_location_select__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.On_site_repair__c != null) { |
| | | doc += '<th>'+record.On_site_repair__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.Number_of_EffectiveContract__c != null) { |
| | | doc += '<th>'+record.Number_of_EffectiveContract__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.NewProductGuaranteeObject__c != null) { |
| | | doc += '<th>'+record.NewProductGuaranteeObject__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | // fieldNameArr.forEach(fieldName =>{ |
| | | // doc += '<th>'+record.fieldName+'</th>'; |
| | | // }); |
| | | doc += '</tr>'; |
| | | }); |
| | | doc += '</table>'; |
| | | var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(doc); |
| | | let downloadElement = document.createElement('a'); |
| | | downloadElement.href = element; |
| | | downloadElement.target = '_self'; |
| | | // use .csv as extension on below line if you want to export data as csv |
| | | downloadElement.download = '修理明细表.xls'; |
| | | document.body.appendChild(downloadElement); |
| | | downloadElement.click(); |
| | | } |
| | | |
| | | // this method validates the data and creates the csv file to download this.data的所有字段 |
| | | downloadCSVFile1() { |
| | | console.log("downloadCSVFile1"); |
| | | let rowEnd = '\n'; |
| | | let csvString = ''; |
| | | // this set elminates the duplicates if have any duplicate keys |
| | | let rowData = new Set(); |
| | | let columnsData = new Set(); |
| | | let columnsLabelData = new Set(); |
| | | |
| | | // getting keys from data |
| | | this.data.forEach(function (record) { |
| | | Object.keys(record).forEach(function (key) { |
| | | rowData.add(key); |
| | | }); |
| | | }); |
| | | console.log(rowData); |
| | | |
| | | // Array.from() method returns an Array object from any object with a length property or an iterable object. |
| | | rowData = Array.from(rowData); |
| | | console.log(rowData); |
| | | |
| | | // splitting using ',' |
| | | csvString += rowData.join(','); |
| | | csvString += rowEnd; |
| | | console.log(csvString); |
| | | this.columns.forEach(function(v){ |
| | | columnsLabelData.add(v.label); |
| | | if (v['typeAttributes']) { |
| | | columnsData.add(v['typeAttributes'].label.fieldName); |
| | | }else{ |
| | | columnsData.add(v.fieldName); |
| | | } |
| | | }); |
| | | console.log("columnsData"); |
| | | console.log(columnsLabelData); |
| | | console.log(columnsData); |
| | | console.log(rowData[1]); |
| | | console.log(Array.from(columnsData)); |
| | | console.log(Array.from(columnsData).hasOwnProperty(rowData[1])); |
| | | console.log(this.data[0].Name); |
| | | console.log(this.data[0][rowData[1]]); |
| | | // main for loop to get the data based on key value |
| | | for(let i=0; i < this.data.length; i++){ |
| | | let colValue = 0; |
| | | |
| | | // validating keys in data |
| | | for(let key in rowData) { |
| | | if(rowData.hasOwnProperty(key)) { |
| | | // Key value |
| | | // Ex: Id, Name |
| | | let rowKey = rowData[key]; |
| | | // add , after every value except the first. |
| | | if(colValue > 0){ |
| | | csvString += ','; |
| | | } |
| | | // If the column is undefined, it as blank in the CSV file. |
| | | let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey]; |
| | | csvString += '"'+ value +'"'; |
| | | colValue++; |
| | | } |
| | | } |
| | | csvString += rowEnd; |
| | | } |
| | | |
| | | // Creating anchor element to download |
| | | let downloadElement = document.createElement('a'); |
| | | |
| | | // This encodeURI encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters). |
| | | downloadElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvString); |
| | | downloadElement.target = '_self'; |
| | | // CSV File Name |
| | | downloadElement.download = 'Account Data.csv'; |
| | | // below statement is required if you are using firefox browser |
| | | document.body.appendChild(downloadElement); |
| | | // click() Javascript function to download CSV file |
| | | downloadElement.click(); |
| | | } |
| | | //导出为Excel |
| | | downloadCSVFile() { |
| | | console.log("downloadCSVFile"); |
| | | let rowEnd = '\n'; |
| | | let csvString = ''; |
| | | // this set elminates the duplicates if have any duplicate keys |
| | | //表格标题 |
| | | let columnsData = new Set(); |
| | | //表格字段 |
| | | let rowData = new Set(); |
| | | |
| | | // getting keys from data |
| | | this.columns.forEach(function(v){ |
| | | columnsData.add(v.label); |
| | | if (v['typeAttributes']) { |
| | | rowData.add(v['typeAttributes'].label.fieldName); |
| | | }else{ |
| | | rowData.add(v.fieldName); |
| | | } |
| | | }); |
| | | console.log(columnsData); |
| | | console.log(rowData); |
| | | // Array.from() method returns an Array object from any object with a length property or an iterable object. |
| | | rowData = Array.from(rowData); |
| | | columnsData = Array.from(columnsData); |
| | | // getting keys from data |
| | | /* console.log("rowData"); |
| | | rowData.forEach(function(v){ |
| | | console.log(v); |
| | | }); |
| | | console.log("columnsData"); |
| | | columnsData.forEach(function(v){ |
| | | console.log(v); |
| | | }); */ |
| | | |
| | | // splitting using ',' |
| | | csvString += columnsData.join(','); |
| | | csvString += rowEnd; |
| | | // console.log(csvString); |
| | | // main for loop to get the data based on key value |
| | | for(let i=0; i < this.data.length; i++){ |
| | | let colValue = 0; |
| | | |
| | | // validating keys in data |
| | | for(let key in rowData) { |
| | | if(rowData.hasOwnProperty(key)) {//del |
| | | // Key value |
| | | // Ex: Id, Name |
| | | let rowKey = rowData[key]; |
| | | // add , after every value except the first. |
| | | if(colValue > 0){ |
| | | csvString += ','; |
| | | } |
| | | // If the column is undefined, it as blank in the CSV file. |
| | | let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey]; |
| | | csvString += '"'+ value +'"'; |
| | | colValue++; |
| | | } |
| | | } |
| | | csvString += rowEnd; |
| | | } |
| | | |
| | | // Creating anchor element to download |
| | | let downloadElement = document.createElement('a'); |
| | | |
| | | // This encodeURI encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters). |
| | | downloadElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvString); |
| | | downloadElement.target = '_self'; |
| | | // CSV File Name |
| | | downloadElement.download = '修理明细表.csv'; |
| | | // below statement is required if you are using firefox browser |
| | | document.body.appendChild(downloadElement); |
| | | // click() Javascript function to download CSV file |
| | | downloadElement.click(); |
| | | } |
| | | //获取选中Repair |
| | | getSelectedRows(event) { |
| | | const selectedRows = event.detail.selectedRows; |
| | | console.log(selectedRows); |
| | | //Repair__c selectedRepairs |
| | | // Display that fieldName of the selected rows |
| | | let selectedRepairsArr = []; |
| | | for (let i = 0; i < selectedRows.length; i++) { |
| | | selectedRepairsArr.push(selectedRows[i]); |
| | | } |
| | | this.selectedRepairs = selectedRepairsArr; |
| | | } |
| | | |
| | | //跳转到pdf页面 |
| | | skipPage() { |
| | | console.log("selectedRows"); |
| | | // console.log(jsonStr); |
| | | if (this.selectedRepairs.length <= 0 ) { |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: '请至少选择一个修理', |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | } |
| | | let jsonStr = JSON.stringify(this.selectedRepairs); |
| | | showPDF({ |
| | | json: jsonStr |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.indexOf("https://ocsm") != -1) { |
| | | window.open(result, "维修委托书PDF", ""); |
| | | }else{ |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: result, |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <template for:each={courses} for:item="course"> |
| | | <p key={course}>{course}</p> |
| | | </template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class BeforeRenderHook extends LightningElement { |
| | | courses; |
| | | |
| | | connectedCallback() { |
| | | this.courses = ['Irrigation Systems', 'Soils', 'Organic Crops']; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom7" |
| | | lwc="beforeRenderHook" |
| | | title="Before Render Hook" |
| | | visualforce="beforeRenderHook" |
| | | visualforce-height="90px" |
| | | > |
| | | <c-before-render-hook slot="lwc"></c-before-render-hook> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_lifecycle_hooks_dom"> |
| | | connectedCallback</a> to execute code when the component is inserted into the page |
| | | and before it is rendered. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class BeforeRenderHookWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | lightning-input { |
| | | margin-bottom: 10px; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <p>Enter course name:</p> |
| | | <lightning-input |
| | | value={courseName} |
| | | onchange={handleChange} |
| | | ></lightning-input> |
| | | <p class="course-name">Course name is: {courseName}</p> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class Binding extends LightningElement { |
| | | courseName = 'Default'; |
| | | |
| | | handleChange(event) { |
| | | this.courseName = event.target.value; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom7" |
| | | title="Binding" |
| | | lwc="binding" |
| | | visualforce="binding" |
| | | visualforce-height="100px" |
| | | > |
| | | <c-binding slot="lwc"></c-binding> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | In LWC, property binding is unidirectional. Properties are used to pass information down, but |
| | | not up. To pass information up, use HTML events. For instance, lightning-input passes information |
| | | up firing a change event (information is carried in the payload of the event!). |
| | | To listen to an event that an element fires, define a handler in JavaScript and bind it to the event. |
| | | Another important difference is that Visualforce is rendered on the server side. |
| | | This means that a server roundtrip is required to update the property whereas, in LWC, rendering happens on the client-side. |
| | | Indeed, it happens automatically when a JavaScript property value changes. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class BindingWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | import {CurrentPageReference,NavigationMixin} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | import cancelApply from '@salesforce/apex/TransferApplyWebService.cancelApply'; |
| | | |
| | | export default class cancelApplyLWC extends LightningElement { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | cancelResult; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | |
| | | } |
| | | } |
| | | } |
| | | connectedCallback() { |
| | | console.log('this.raeSetId:' + this.recordId); |
| | | |
| | | LightningConfirm.open({ |
| | | message: '确定取消?', |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value', |
| | | |
| | | }).then(cancel=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | if(cancel) { |
| | | cancelApply({ |
| | | taId : this.recordId |
| | | }).then(result => { |
| | | this.cancelResult = result; |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | |
| | | }).catch( error =>{ |
| | | console.log(error); |
| | | }).finally(()=>{ |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | async cancelSubmit(){ |
| | | if(this.cancelResult == '1') { |
| | | alert('取消成功'); |
| | | window.location.href = window.location; |
| | | |
| | | } else { |
| | | console.log("result:",this.cancelResult); |
| | | alert(this.cancelResult); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | //old js |
| | | |
| | | // {!REQUIRESCRIPT('/soap/ajax/51.0/connection.js')} |
| | | // {!REQUIRESCRIPT('/soap/ajax/51.0/apex.js')} |
| | | // if (confirm("确定取消?")) { |
| | | // var rs = sforce.apex.execute("TransferApplyWebService","cancelApply",{taId:'{!TransferApply__c.Id}'}); |
| | | // if(rs == '1'){ |
| | | // alert('取消成功'); |
| | | // window.location.href = window.location; |
| | | // } |
| | | // else{ |
| | | // alert(rs); |
| | | // } |
| | | // } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="cancelApplyLWC"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import ChildComponentTest from 'c/childComponentTest'; |
| | | |
| | | describe('c-child-component-test', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-child-component-test', { |
| | | is: ChildComponentTest |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <p class="slds-text-align_center slds-var-m-vertical_medium"> |
| | | Prior Count: |
| | | <lightning-formatted-number |
| | | value={priorCount} |
| | | ></lightning-formatted-number> |
| | | </p> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api } from 'lwc'; |
| | | |
| | | export default class ChildComponentTest extends LightningElement { |
| | | _currentCount = 0; |
| | | priorCount = 0; |
| | | @api counter = 0; |
| | | get counter() { |
| | | return this._currentCount; |
| | | } |
| | | set counter(value) { |
| | | this.priorCount = this._currentCount; |
| | | this._currentCount = value; |
| | | } |
| | | @api |
| | | maximizeCounter() { |
| | | this.counter += 1000000; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | import { createElement } from 'lwc'; |
| | | import CreateCaseTest from 'c/createCaseTest'; |
| | | |
| | | describe('c-create-case-test', () => { |
| | | afterEach(() => { |
| | | // The jsdom instance is shared across test cases in a single file so reset the DOM |
| | | while (document.body.firstChild) { |
| | | document.body.removeChild(document.body.firstChild); |
| | | } |
| | | }); |
| | | |
| | | it('TODO: test case generated by CLI command, please fill in test logic', () => { |
| | | // Arrange |
| | | const element = createElement('c-create-case-test', { |
| | | is: CreateCaseTest |
| | | }); |
| | | |
| | | // Act |
| | | document.body.appendChild(element); |
| | | |
| | | // Assert |
| | | // const div = element.shadowRoot.querySelector('div'); |
| | | expect(1).toBe(1); |
| | | }); |
| | | }); |
| New file |
| | |
| | | <template> |
| | | <lightning-card> |
| | | <h3 slot="title"> |
| | | <lightning-icon icon-name="utility:connected_apps" size="small"></lightning-icon> |
| | | Close Quick Action From Lightning Web Components |
| | | </h3> |
| | | <div slot="footer"> |
| | | |
| | | </div> |
| | | Record Id from Parent Component: {recordId} |
| | | <br/> |
| | | <lightning-button label="Close Quick Action" onclick={closeQuickAction}></lightning-button> |
| | | </lightning-card> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | |
| | | export default class CreateCaseTest extends LightningElement { |
| | | |
| | | @api recordId; |
| | | closeQuickAction() { |
| | | const closeQA = new CustomEvent('close'); |
| | | // Dispatches the event. |
| | | this.dispatchEvent(closeQA); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="slds-var-m-around_x-small"> |
| | | <lightning-input |
| | | label="Contact First Name" |
| | | class="contactFirstName" |
| | | value={contactFirstName} |
| | | onchange={handleContactFirstNameInputChange} |
| | | ></lightning-input> |
| | | <lightning-input |
| | | label="Contact Last Name" |
| | | class="contactLastName" |
| | | value={contactLastName} |
| | | onchange={handleContactLastNameInputChange} |
| | | ></lightning-input> |
| | | <lightning-input |
| | | label="Opportunity Name" |
| | | class="opportunityName" |
| | | value={opportunityName} |
| | | onchange={handleOpportunityNameInputChange} |
| | | ></lightning-input> |
| | | </div> |
| | | <lightning-button |
| | | onclick={handleButtonClick} |
| | | label="Create Contact and Opportunity" |
| | | class="slds-var-m-left_xx-small" |
| | | ></lightning-button> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { reduceErrors } from 'c/ldsUtils'; |
| | | import createContactAndOpportunity from '@salesforce/apex/CreateMixedRecordsApexControllerLwc.createContactAndOpportunity'; |
| | | |
| | | export default class CreateMixedRecordsApex extends LightningElement { |
| | | contactFirstName = 'Yan'; |
| | | contactLastName = 'Khang'; |
| | | opportunityName = 'Possible deal'; |
| | | |
| | | handleContactFirstNameInputChange(event) { |
| | | this.contactFirstName = event.target.value; |
| | | } |
| | | |
| | | handleContactLastNameInputChange(event) { |
| | | this.contactLastName = event.target.value; |
| | | } |
| | | |
| | | handleOpportunityNameInputChange(event) { |
| | | this.opportunityName = event.target.value; |
| | | } |
| | | |
| | | handleButtonClick() { |
| | | createContactAndOpportunity({ |
| | | contactFirstName: this.contactFirstName, |
| | | contactLastName: this.contactLastName, |
| | | opportunityName: this.opportunityName |
| | | }) |
| | | .then(() => { |
| | | const evt = new ShowToastEvent({ |
| | | title: 'Success', |
| | | message: 'Contact & Opportunity created correctly', |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | }) |
| | | .catch((error) => { |
| | | const evt = new ShowToastEvent({ |
| | | title: 'Error', |
| | | message: |
| | | 'Error creating records: ' + |
| | | reduceErrors(error).join(', '), |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom96" |
| | | lwc="createMixedRecordsApex" |
| | | title="Create Mixed Records via Apex" |
| | | visualforce="createMixedRecords" |
| | | visualforce-height="260px" |
| | | > |
| | | <c-create-mixed-records-apex slot="lwc"></c-create-mixed-records-apex> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.apex"> |
| | | Call Apex imperatively </a> to perform mixed record or complex operations to create, |
| | | update or delete or read data. In this example, the mixed operation is transactional. |
| | | </p> |
| | | <p> |
| | | <b>Note:</b> Consider using base components forms or LDS functions |
| | | first. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class CreateMixedRecordsApexWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="slds-var-m-around_x-small"> |
| | | <lightning-input |
| | | label="Contact First Name" |
| | | class="contactFirstName" |
| | | value={contactFirstName} |
| | | onchange={handleContactFirstNameInputChange} |
| | | ></lightning-input> |
| | | <lightning-input |
| | | label="Contact Last Name" |
| | | class="contactLastName" |
| | | value={contactLastName} |
| | | onchange={handleContactLastNameInputChange} |
| | | ></lightning-input> |
| | | <lightning-input |
| | | label="Opportunity Name" |
| | | class="opportunityName" |
| | | value={opportunityName} |
| | | onchange={handleOpportunityNameInputChange} |
| | | ></lightning-input> |
| | | </div> |
| | | <lightning-button |
| | | onclick={handleButtonClick} |
| | | label="Create Contact and Opportunity" |
| | | class="slds-var-m-left_xx-small" |
| | | ></lightning-button> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { createRecord } from 'lightning/uiRecordApi'; |
| | | import { reduceErrors } from 'c/ldsUtils'; |
| | | import CONTACT_OBJECT from '@salesforce/schema/Contact'; |
| | | import CONTACT_FIRST_NAME_FIELD from '@salesforce/schema/Contact.FirstName'; |
| | | import CONTACT_LAST_NAME_FIELD from '@salesforce/schema/Contact.LastName'; |
| | | import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity'; |
| | | import OPPORTUNITY_NAME_FIELD from '@salesforce/schema/Opportunity.Name'; |
| | | import OPPORTUNITY_STAGENAME_FIELD from '@salesforce/schema/Opportunity.StageName'; |
| | | import OPPORTUNITY_CLOSEDATE_FIELD from '@salesforce/schema/Opportunity.CloseDate'; |
| | | |
| | | export default class CreateMixedRecordsWireFunctions extends LightningElement { |
| | | contactFirstName = 'Yan'; |
| | | contactLastName = 'Khang'; |
| | | opportunityName = 'Possible deal'; |
| | | |
| | | handleContactFirstNameInputChange(event) { |
| | | this.contactFirstName = event.target.value; |
| | | } |
| | | |
| | | handleContactLastNameInputChange(event) { |
| | | this.contactLastName = event.target.value; |
| | | } |
| | | |
| | | handleOpportunityNameInputChange(event) { |
| | | this.opportunityName = event.target.value; |
| | | } |
| | | |
| | | handleButtonClick() { |
| | | this.createContact(); |
| | | this.createOpportunity(); |
| | | } |
| | | |
| | | createContact() { |
| | | // Note: In this example we generate the record input structure from scratch for simplicity. |
| | | // Consider to use the generateRecordInputForCreate() function instead. |
| | | // The function will create the record input for you, including only fields that are createable. |
| | | // Check https://developer.salesforce.com/docs/component-library/documentation/en/50.0/lwc/reference_generate_record_input_update |
| | | const recordInput = { |
| | | apiName: CONTACT_OBJECT.objectApiName, |
| | | fields: { |
| | | [CONTACT_FIRST_NAME_FIELD.fieldApiName]: this.contactFirstName, |
| | | [CONTACT_LAST_NAME_FIELD.fieldApiName]: this.contactLastName |
| | | } |
| | | }; |
| | | |
| | | createRecord(recordInput) |
| | | .then((result) => this.handleSuccess(result.id, 'Contact')) |
| | | .catch((error) => this.handleErrors(error)); |
| | | } |
| | | |
| | | createOpportunity() { |
| | | // Note: In this example we generate the record input structure from scratch for simplicity. |
| | | // Consider to use the generateRecordInputForCreate() function instead. |
| | | // The function will create the record input for you, including only fields that are createable. |
| | | // Check https://developer.salesforce.com/docs/component-library/documentation/en/50.0/lwc/reference_generate_record_input_update |
| | | const recordInput = { |
| | | apiName: OPPORTUNITY_OBJECT.objectApiName, |
| | | fields: { |
| | | [OPPORTUNITY_NAME_FIELD.fieldApiName]: this.opportunityName, |
| | | [OPPORTUNITY_STAGENAME_FIELD.fieldApiName]: 'Prospecting', |
| | | [OPPORTUNITY_CLOSEDATE_FIELD.fieldApiName]: new Date(2025, 1, 1) |
| | | } |
| | | }; |
| | | |
| | | createRecord(recordInput) |
| | | .then((result) => this.handleSuccess(result.id, 'Opportunity')) |
| | | .catch((error) => this.handleErrors(error)); |
| | | } |
| | | |
| | | handleSuccess(recordId, object) { |
| | | const evt = new ShowToastEvent({ |
| | | title: 'Success', |
| | | message: `${object} created with Id: ${recordId}`, |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | |
| | | handleErrors(error) { |
| | | const evt = new ShowToastEvent({ |
| | | title: 'Error', |
| | | message: `Error creating records: ${reduceErrors(error).join( |
| | | ', ' |
| | | )}`, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom96" |
| | | lwc="createMixedRecordsWireFunctions" |
| | | title="Create Mixed Records via LDS Functions" |
| | | visualforce="createMixedRecords" |
| | | visualforce-height="260px" |
| | | > |
| | | <c-create-mixed-records-wire-functions |
| | | slot="lwc" |
| | | ></c-create-mixed-records-wire-functions> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_create_record"> |
| | | createRecord</a>, <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_update_record"> |
| | | updateRecord</a> or <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.reference_delete_record"> |
| | | deleteRecord</a> LDS functions to combine single record operations, in a non transactional way. |
| | | </p> |
| | | |
| | | <p><b>Note:</b> Consider using base components forms first.</p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class CreateMixedRecordsWireFunctionsWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <lightning-record-edit-form |
| | | object-api-name={objectApiName} |
| | | onsuccess={handleSuccess} |
| | | > |
| | | <lightning-messages> </lightning-messages> |
| | | <lightning-input-field field-name={nameField}> </lightning-input-field> |
| | | <lightning-input-field field-name={typeField} value="Prospect"> |
| | | </lightning-input-field> |
| | | <lightning-input-field field-name={phoneField}> </lightning-input-field> |
| | | <lightning-input-field field-name={employeesField}> |
| | | </lightning-input-field> |
| | | <lightning-button |
| | | class="slds-var-m-top_small slds-align_absolute-center" |
| | | variant="brand" |
| | | type="submit" |
| | | name="create" |
| | | label="Save" |
| | | > |
| | | </lightning-button> |
| | | </lightning-record-edit-form> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import ACCOUNT_OBJECT from '@salesforce/schema/Account'; |
| | | import ACCOUNT_NAME_FIELD from '@salesforce/schema/Account.Name'; |
| | | import ACCOUNT_TYPE_FIELD from '@salesforce/schema/Account.Type'; |
| | | import ACCOUNT_PHONE_FIELD from '@salesforce/schema/Account.Phone'; |
| | | import ACCOUNT_EMPLOYEES_FIELD from '@salesforce/schema/Account.NumberOfEmployees'; |
| | | |
| | | export default class CreateRecordWithPrepopulatedValues extends LightningElement { |
| | | objectApiName = ACCOUNT_OBJECT; |
| | | nameField = ACCOUNT_NAME_FIELD; |
| | | typeField = ACCOUNT_TYPE_FIELD; |
| | | phoneField = ACCOUNT_PHONE_FIELD; |
| | | employeesField = ACCOUNT_EMPLOYEES_FIELD; |
| | | |
| | | handleSuccess(event) { |
| | | const toastEvent = new ShowToastEvent({ |
| | | title: 'Account created', |
| | | message: 'Record ID: ' + event.detail.id, |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(toastEvent); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom96" |
| | | lwc="createRecordWithPrepopulatedValues" |
| | | title="Create Record with Prepopulated Values" |
| | | visualforce="createRecordWithPrepopulatedValues" |
| | | visualforce-height="260px" |
| | | > |
| | | <c-create-record-with-prepopulated-values |
| | | slot="lwc" |
| | | ></c-create-record-with-prepopulated-values> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/bundle/lightning-record-edit-form"> |
| | | lightning-record-edit-form</a> to prepopulate fields or use a custom layout. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class CreateRecordWithPrepopulatedValuesWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api, track, wire } from 'lwc'; |
| | | import init from '@salesforce/apex/CustomDeleteController.initForCustomDelete'; |
| | | import {CurrentPageReference} from 'lightning/navigation' |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import deleteRepair from '@salesforce/apex/ControllerUtil.deleteRepair'; |
| | | |
| | | export default class CustomDelete extends LightningElement { |
| | | |
| | | |
| | | @api recordId; |
| | | @api message; |
| | | |
| | | @track Status ; |
| | | @track FSE ; |
| | | @track SAP; |
| | | @track cre ; |
| | | @track Rep ; |
| | | @track acc ; |
| | | @track fSE ; |
| | | @track id; |
| | | @track rtn; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urlValue=currentPageReference.state.recordId; |
| | | if(urlValue){ |
| | | let str='${urlValue}'; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId:this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.FSE=result.FSEApplyForRepairtime; |
| | | this.Rep=result.Rep; |
| | | this.SAP=result.SAP; |
| | | this.Status=result.Status; |
| | | this.acc=result.acc; |
| | | this.id=result.Id; |
| | | this.cre=result.cre; |
| | | this.fSE=result.FSEownerId; |
| | | console.log("end"); |
| | | this.handleDeleteAction(); |
| | | console.log("end2"); |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | handleDeleteAction(){ |
| | | if (this.Status != null && this.Status.length > 0) { |
| | | if (this.Status != "草案中"&& this.Status != "1.受理完毕(SAP待发送)"&& this.Status != "4.修理品返送阶段") { |
| | | this.message = "不是草案中,不能删除"; |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | variant:'error', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else if (this.Status == "0.申请完毕"&& (this.FSE != "")) { |
| | | message = "FSE已经申请,不能删除"; |
| | | console.log('***action4'); |
| | | |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else if (this.Status == "4.修理品返送阶段"&& (this.SAP != "" || this.Rep!= "")){ |
| | | message = "已经发送过SAP,不能删除"; |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else if (UserInfo_Owner.Id.substring(0,15) != this.cre.substring(0,15) && UserInfo_Owner.Id.substring(0,15) != this.acc.substring(0,15)&& UserInfo_Owner.Id.substring(0,15) != this.fSE.substring(0,15)) { |
| | | message = "不是所有人、创建人或FSE主负责人,不能删除"; |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else { |
| | | |
| | | // sforce.connection.sessionId = '{!$Api.Session_ID}'; |
| | | // var rtn=sforce.apex.execute("ControllerUtil","deleteRepair",{rid:this.id}); |
| | | deleteRepair({ |
| | | rid:this.id |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.rtn=result; |
| | | } |
| | | }) |
| | | |
| | | if (this.rtn == "OK") { |
| | | reload(); |
| | | } else { |
| | | alert(this.rtn); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | function reload(){ |
| | | var str=""; |
| | | if(getParam('retURL')!==null){ |
| | | str +=getParam('retURL'); |
| | | } |
| | | window.open(str,'_self'); |
| | | } |
| | | |
| | | function getParam(paramName) { |
| | | paramValue = "", isFound = !1; |
| | | if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { |
| | | arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0; |
| | | while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++ |
| | | } |
| | | return paramValue == "" && (paramValue = null), paramValue |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="customDelete"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <button class="slds-button slds-button_brand" onclick={addAccount} title="AddGroup">新增客户</button> |
| | | <lightning-datatable |
| | | key-field="id" |
| | | data={accList} |
| | | columns={columns} |
| | | > |
| | | </lightning-datatable> |
| | | <template if:true={isShowPop}> |
| | | <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_medium"> |
| | | <div class="slds-modal__container"> |
| | | <header class="slds-modal__header" style="background-color: #F3F3F3;"> |
| | | <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={close}> |
| | | <lightning-icon icon-name="utility:close" |
| | | alternative-text="close" |
| | | variant="inverse" |
| | | size="small" ></lightning-icon> |
| | | <span class="slds-assistive-text">Close</span> |
| | | </button> |
| | | <h2 id="modal-heading-02" class="slds-text-heading_medium slds-hyphenate">新增客户</h2> |
| | | </header> |
| | | <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-2" style="border: 1px solid #F3F3F3;"> |
| | | <lightning-record-edit-form object-api-name="Account" density="compact" layout-type="Compact"> |
| | | <div class="slds-grid slds-wrap" style="padding-top: 20px;padding-bottom: 5px;padding-left:25px;padding-right:25px;"> |
| | | <div class="slds-col slds-size_12-of-12 slds-small-size_12-of-12 slds-large-size_6-of-12"> |
| | | <lightning-input-field field-name="Name" value={accName} onchange={accNameChange} required="true"></lightning-input-field> |
| | | <lightning-input-field field-name="Phone" value={accPhone} onchange={accPhoneChange}></lightning-input-field> |
| | | <lightning-input-field field-name="Type" value={accType} onchange={accTypeChange}></lightning-input-field> |
| | | <lightning-input-field field-name="Fax" value={accFax} onchange={accFaxChange}></lightning-input-field> |
| | | <lightning-input-field field-name="TestMutiPicklist__c" value={accTest} onchange={accFaxChange}></lightning-input-field> |
| | | </div> |
| | | </div> |
| | | </lightning-record-edit-form> |
| | | </div> |
| | | <footer class="slds-modal__footer"> |
| | | <button class="slds-button slds-button_neutral" onclick={close} title="Cancel">取消</button> |
| | | <button class="slds-button slds-button_brand" onclick={confirm} title="Confirm">新建</button> |
| | | </footer> |
| | | </div> |
| | | </section> |
| | | </template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,track } from 'lwc'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import getAccountForLWC from '@salesforce/apex/DemoController.getAccountForLWC'; |
| | | import addAccountForLWC from '@salesforce/apex/DemoController.addAccountForLWC'; |
| | | |
| | | export default class DemoLWC extends LightningElement { |
| | | |
| | | @track accList = []; |
| | | @track isShowPop = false; |
| | | @track accName; |
| | | @track accPhone; |
| | | @track accType; |
| | | @track accFax; |
| | | @track accTest; |
| | | @track columns = [ |
| | | {label: 'Account Name',fieldName: 'Name'}, |
| | | {label: 'Account Phone',fieldName: 'Phone'}, |
| | | {label: 'Account Type',fieldName: 'Type'}, |
| | | {label: 'Account Fax',fieldName: 'Fax'} |
| | | ]; |
| | | |
| | | connectedCallback(){ |
| | | getAccountForLWC() |
| | | .then(result=>{ |
| | | this.accList = result; |
| | | }) |
| | | } |
| | | |
| | | accNameChange(event){ |
| | | this.accName = event.detail.value; |
| | | } |
| | | |
| | | accPhoneChange(event){ |
| | | this.accPhone = event.detail.value; |
| | | } |
| | | |
| | | accTypeChange(event){ |
| | | this.accType = event.detail.value; |
| | | } |
| | | |
| | | accFaxChange(event){ |
| | | this.accFax = event.detail.value; |
| | | } |
| | | |
| | | addAccount(event){ |
| | | this.isShowPop = true; |
| | | this.accName = ''; |
| | | this.accPhone = ''; |
| | | this.accType = ''; |
| | | this.accFax = ''; |
| | | } |
| | | |
| | | confirm(event){ |
| | | addAccountForLWC({name:this.accName,phone:this.accPhone,type:this.accType,fax:this.accFax}) |
| | | .then(result=>{ |
| | | if(result == 'Success'){ |
| | | this.isShowPop = false; |
| | | const evt = new ShowToastEvent({ |
| | | title : '新建成功', |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | close(event){ |
| | | this.isShowPop = false; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom7" |
| | | lwc="demoLWC" |
| | | title="Demo" |
| | | visualforce="DemoPage" |
| | | visualforce-height="500px" |
| | | > |
| | | <c-demo-l-w-c slot="lwc"></c-demo-l-w-c> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Demo |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class DemoWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <lightning-record-form |
| | | record-id={recordId} |
| | | object-api-name={objectApiName} |
| | | columns="2" |
| | | mode="edit" |
| | | fields={fields} |
| | | onsuccess={handleSuccess} |
| | | onerror={handleError} |
| | | > |
| | | </lightning-record-form> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | import ACCOUNT_OBJECT from '@salesforce/schema/Account'; |
| | | import ACCOUNT_NAME_FIELD from '@salesforce/schema/Account.Name'; |
| | | import ACCOUNT_TYPE_FIELD from '@salesforce/schema/Account.Type'; |
| | | import ACCOUNT_PHONE_FIELD from '@salesforce/schema/Account.Phone'; |
| | | import ACCOUNT_EMPLOYEES_FIELD from '@salesforce/schema/Account.NumberOfEmployees'; |
| | | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class EditRecord extends LightningElement { |
| | | @api recordId; |
| | | objectApiName = ACCOUNT_OBJECT; |
| | | |
| | | fields = [ |
| | | ACCOUNT_NAME_FIELD, |
| | | ACCOUNT_TYPE_FIELD, |
| | | ACCOUNT_PHONE_FIELD, |
| | | ACCOUNT_EMPLOYEES_FIELD |
| | | ]; |
| | | |
| | | // Only use if custom behavior needed |
| | | handleSuccess() { |
| | | this.dispatchEvent( |
| | | new ShowToastEvent({ |
| | | title: 'Success', |
| | | message: this.recordId ? 'Account updated' : 'Account created', |
| | | variant: 'success' |
| | | }) |
| | | ); |
| | | } |
| | | |
| | | // Only use if custom behavior needed |
| | | handleError() { |
| | | this.dispatchEvent( |
| | | new ShowToastEvent({ |
| | | title: 'Error', |
| | | message: this.recordId |
| | | ? 'Error updating Account' |
| | | : 'Error creating Account', |
| | | variant: 'error' |
| | | }) |
| | | ); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="standard:account" |
| | | lwc="editRecord" |
| | | title="Edit Record" |
| | | visualforce="editRecord" |
| | | record-id={recordId} |
| | | visualforce-height="230px" |
| | | > |
| | | <c-edit-record record-id={recordId} slot="lwc"></c-edit-record> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/bundle/lightning-record-form"> |
| | | lightning-record-form</a> in edit mode to create or edit records as first option. |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/bundle/lightning-record-edit-form"> |
| | | lightning-record-edit-form</a> if you want to prepopulate fields or use a custom layout. |
| | | </p> |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | <b>Note: </b> |
| | | You can use the <a target="_blank" href="https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.use_navigate"> |
| | | Navigation Service </a> to redirect to record page after save. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | |
| | | export default class EditRecordWrapper extends LightningElement { |
| | | @api recordId; |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class EditableList extends LightningElement {} |
| New file |
| | |
| | | .table-container { |
| | | height: var(--lwc-sizeMedium, 320px); |
| | | } |
| New file |
| | |
| | | <template> |
| | | <template if:true={accounts.data}> |
| | | <div class="table-container"> |
| | | <lightning-datatable |
| | | key-field="id" |
| | | data={accounts.data} |
| | | columns={columns} |
| | | > |
| | | </lightning-datatable> |
| | | </div> |
| | | </template> |
| | | <template if:true={accounts.error}> |
| | | <c-error-panel errors={accounts.error}></c-error-panel> |
| | | </template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, wire } from 'lwc'; |
| | | import getAccounts from '@salesforce/apex/ListControllerLwc.getAccounts'; |
| | | import ACCOUNT_NAME_FIELD from '@salesforce/schema/Account.Name'; |
| | | import ACCOUNT_TYPE_FIELD from '@salesforce/schema/Account.Type'; |
| | | import ACCOUNT_PHONE_FIELD from '@salesforce/schema/Account.Phone'; |
| | | import ACCOUNT_EMPLOYEES_FIELD from '@salesforce/schema/Account.NumberOfEmployees'; |
| | | |
| | | const COLUMNS = [ |
| | | { |
| | | label: 'Account Name', |
| | | fieldName: ACCOUNT_NAME_FIELD.fieldApiName, |
| | | type: 'text', |
| | | editable: 'true' |
| | | }, |
| | | { |
| | | label: 'Type', |
| | | fieldName: ACCOUNT_TYPE_FIELD.fieldApiName, |
| | | type: 'text', |
| | | editable: 'true' |
| | | }, |
| | | { |
| | | label: 'Phone', |
| | | fieldName: ACCOUNT_PHONE_FIELD.fieldApiName, |
| | | type: 'phone', |
| | | editable: 'true' |
| | | }, |
| | | { |
| | | label: 'Employees', |
| | | fieldName: ACCOUNT_EMPLOYEES_FIELD.fieldApiName, |
| | | type: 'number', |
| | | editable: 'true' |
| | | } |
| | | ]; |
| | | |
| | | export default class List extends LightningElement { |
| | | columns = COLUMNS; |
| | | |
| | | @wire(getAccounts) |
| | | accounts; |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <c-example-wrapper |
| | | icon-name="custom:custom62" |
| | | title="Editable List" |
| | | lwc="editableList" |
| | | visualforce="editableList" |
| | | visualforce-height="420px" |
| | | > |
| | | <c-editable-list slot="lwc"></c-editable-list> |
| | | |
| | | <!-- prettier-ignore --> |
| | | <p> |
| | | Use <a target="_blank" href="https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable"> |
| | | lightning-datatable</a> with inline editing enabled on its columns to create an editable table. |
| | | <b> Note:</b> Check in the documentation which field types are supported. |
| | | </p> |
| | | </c-example-wrapper> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class EditableListWrapper extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | import { reduceErrors } from 'c/ldsUtils'; |
| | | import noDataIllustration from './templates/noDataIllustration.html'; |
| | | import inlineMessage from './templates/inlineMessage.html'; |
| | | |
| | | export default class ErrorPanel extends LightningElement { |
| | | /** Single or array of LDS errors */ |
| | | @api errors; |
| | | /** Generic / user-friendly message */ |
| | | @api friendlyMessage = 'Error retrieving data'; |
| | | /** Type of error message **/ |
| | | @api type; |
| | | |
| | | viewDetails = false; |
| | | |
| | | get errorMessages() { |
| | | return reduceErrors(this.errors); |
| | | } |
| | | |
| | | handleShowDetailsClick() { |
| | | this.viewDetails = !this.viewDetails; |
| | | } |
| | | |
| | | render() { |
| | | if (this.type === 'inlineMessage') return inlineMessage; |
| | | return noDataIllustration; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="slds-var-m-vertical_small"> |
| | | <span class="slds-text-color_destructive"> |
| | | {friendlyMessage}. |
| | | <template if:true={errorMessages.length}> |
| | | <a onclick={handleShowDetailsClick}> Show details.</a> |
| | | </template> |
| | | </span> |
| | | <template if:true={errorMessages.length}> |
| | | <template if:true={viewDetails}> |
| | | <template for:each={errorMessages} for:item="message"> |
| | | <p class="slds-text-body_regular" key={message}> |
| | | {message} |
| | | </p> |
| | | </template> |
| | | </template> |
| | | </template> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | <template> |
| | | <div |
| | | class="slds-illustration slds-illustration_small slds-var-m-vertical_small" |
| | | > |
| | | <svg |
| | | class="slds-illustration__svg" |
| | | viewBox="0 0 454 272" |
| | | aria-hidden="true" |
| | | xmlns="http://www.w3.org/2000/svg" |
| | | xlink="http://www.w3.org/1999/xlink" |
| | | > |
| | | <g fill="none" fill-rule="evenodd" transform="translate(-65 -74)"> |
| | | <g transform="translate(77 180)"> |
| | | <polyline |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | points="21 74 111.5 0 177.5 54" |
| | | ></polyline> |
| | | <polyline |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | points="160 37 181.5 19 249 74" |
| | | ></polyline> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M5.83623454,54.8238008 C6.47896445,52.7119739 7.52041887,52.7099477 8.16376546,54.8238008 L14,74 L0,74 L5.83623454,54.8238008 Z" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M14.9699006 61.8628727C15.5388088 59.729467 16.4627585 59.7353443 17.0300994 61.8628727L20 73 12 73 14.9699006 61.8628727zM239.734375 56.5589921C240.43336 54.4620359 241.506942 54.4857215 242.128332 56.5984458L246 69.7621171 237 64.7621171 239.734375 56.5589921z" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M247.921591,53.8514618 C248.51718,51.7243582 249.484912,51.7318303 250.077772,53.8491859 L254.357732,69.1347569 L242,75 L247.921591,53.8514618 Z" |
| | | transform="matrix(-1 0 0 1 496.358 0)" |
| | | ></path> |
| | | </g> |
| | | <g transform="matrix(-1 0 0 1 496 216)"> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M5.9215907,18.8514618 C6.51717971,16.7243582 7.48113835,16.7183512 8.0784093,18.8514618 L14,40 L0,40 L5.9215907,18.8514618 Z" |
| | | transform="matrix(-1 0 0 1 14 0)" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M123.136984,25.2363093 C123.613615,23.448945 124.38595,23.4473111 124.863437,25.237887 L126.693756,32.1015868 L120,37 L123.136984,25.2363093 Z" |
| | | transform="matrix(-1 0 0 1 246.694 0)" |
| | | ></path> |
| | | <polyline |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | points="13 37 59.5 0 92.5 27" |
| | | ></polyline> |
| | | <polyline |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | points="83 17 92.5 9 127 38" |
| | | ></polyline> |
| | | </g> |
| | | <g |
| | | class="slds-illustration__stroke-primary" |
| | | stroke-linecap="round" |
| | | stroke-width="3" |
| | | transform="translate(67 253)" |
| | | > |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M0 1.5L450 1.5M284 2L419 61M282 2L65 91M443 1.5L449 1.5" |
| | | ></path> |
| | | </g> |
| | | <g transform="translate(73 163)"> |
| | | <polygon |
| | | vector-effect="non-scaling-stroke" |
| | | fill="#FFF" |
| | | points="20.906 .73 24.63 2.34 27.093 9.155 11.046 19.877 .131 19.877" |
| | | transform="translate(80 22)" |
| | | ></polygon> |
| | | <g |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-linecap="round" |
| | | stroke-width="3" |
| | | > |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M44,17.5 L63,17.5 C62.2789714,12.0723971 64.081543,7.53186978 68.4077148,3.87841797 C73.3754883,-0.195556641 79.2734375,0.717773438 82.440918,2.12353516 C85.6083984,3.52929687 87.9606934,5.46069336 89.5913086,9.10524041 C90.2822266,10.6397351 90.7517904,11.9379883 91,13" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M83 20.5C84.0558268 16.8461914 86.2227376 14.4572754 89.5007324 13.333252 94.4177246 11.6472168 99.0800781 13.8925781 100.942383 16.1518555 102.804687 18.4111328 103.39502 20.2260742 103.746582 22.1201172 103.980957 23.3828125 104.06543 24.8427734 104 26.5 108.141764 26.3313802 110.918945 27.1647135 112.331543 29 114.040039 31.1936035 114.215332 33.817627 113.593018 35.75 112.970703 37.682373 110.894531 40.5 107 40.5L28 40.5M18 27.5L83.0004985 27.5M0 27.5L8 27.5" |
| | | ></path> |
| | | </g> |
| | | </g> |
| | | <g |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-linecap="round" |
| | | stroke-width="3" |
| | | transform="translate(292 139)" |
| | | > |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M44,17.5 L63,17.5 C62.2789714,12.0723971 64.081543,7.53186978 68.4077148,3.87841797 C73.3754883,-0.195556641 79.2734375,0.717773438 82.440918,2.12353516 C85.6083984,3.52929687 87.9606934,5.46069336 89.5913086,9.10524041 C90.2822266,10.6397351 90.7517904,11.9379883 91,13" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M83 20.5C84.0558268 16.8461914 86.2227376 14.4572754 89.5007324 13.333252 94.4177246 11.6472168 99.0800781 13.8925781 100.942383 16.1518555 102.804687 18.4111328 103.39502 20.2260742 103.746582 22.1201172 103.980957 23.3828125 104.06543 24.8427734 104 26.5 108.141764 26.3313802 110.918945 27.1647135 112.331543 29 114.040039 31.1936035 114.215332 33.817627 113.593018 35.75 112.970703 37.682373 110.894531 40.5 107 40.5L28 40.5M18 27.5L83.0004985 27.5M0 27.5L8 27.5" |
| | | ></path> |
| | | </g> |
| | | <g transform="translate(204.5 228.5)"> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M18.9209988,1.95433401 L33.259296,51.443436 C33.5666778,52.5043744 32.9557995,53.613617 31.8948612,53.9209988 C31.7139843,53.9734036 31.5266126,54 31.3382972,54 L2.6617028,54 C1.5571333,54 0.661702805,53.1045695 0.661702805,52 C0.661702805,51.8116846 0.688299176,51.6243129 0.74070397,51.443436 L15.0790012,1.95433401 C15.386383,0.893395645 16.4956256,0.282517358 17.556564,0.589899164 C18.2152102,0.780726338 18.7301717,1.29568777 18.9209988,1.95433401 Z" |
| | | ></path> |
| | | <g |
| | | class="slds-illustration__stroke-primary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | > |
| | | <polygon points="17 .324 34 54 0 54"></polygon> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M17,6.32394366 C17,42.1378022 17,60.4711356 17,61.3239437 C17,60.4711356 17,42.1378022 17,6.32394366 Z" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M17,29.3239437 C22.3333333,35.7851611 25,39.1184944 25,39.3239437 C25,39.1184944 22.3333333,35.7851611 17,29.3239437 Z" |
| | | transform="matrix(-1 0 0 1 42 0)" |
| | | ></path> |
| | | </g> |
| | | </g> |
| | | <g transform="translate(439.5 227.5)"> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M18.9209988,1.95433401 L33.259296,51.443436 C33.5666778,52.5043744 32.9557995,53.613617 31.8948612,53.9209988 C31.7139843,53.9734036 31.5266126,54 31.3382972,54 L2.6617028,54 C1.5571333,54 0.661702805,53.1045695 0.661702805,52 C0.661702805,51.8116846 0.688299176,51.6243129 0.74070397,51.443436 L15.0790012,1.95433401 C15.386383,0.893395645 16.4956256,0.282517358 17.556564,0.589899164 C18.2152102,0.780726338 18.7301717,1.29568777 18.9209988,1.95433401 Z" |
| | | ></path> |
| | | <g |
| | | class="slds-illustration__stroke-primary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | > |
| | | <polygon |
| | | vector-effect="non-scaling-stroke" |
| | | points="17 -4.676 34 54 0 54" |
| | | ></polygon> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M17,1.32394366 C17,40.3936076 17,60.3936076 17,61.3239437 C17,60.3936076 17,40.3936076 17,1.32394366 Z" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M17,29.3239437 C22.3333333,35.7851611 25,39.1184944 25,39.3239437 C25,39.1184944 22.3333333,35.7851611 17,29.3239437 Z" |
| | | transform="matrix(-1 0 0 1 42 0)" |
| | | ></path> |
| | | </g> |
| | | </g> |
| | | <g transform="translate(141.852 213.5)"> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__fill-secondary" |
| | | d="M25.6478873,0 L50.8997802,86.4391718 C51.2095171,87.4994249 50.6011034,88.6100213 49.5408502,88.9197582 C49.3586621,88.9729817 49.1698252,89 48.980022,89 L2.31575269,89 C1.21118319,89 0.315752686,88.1045695 0.315752686,87 C0.315752686,86.8101968 0.342770948,86.6213599 0.395994453,86.4391718 L25.6478873,0 Z" |
| | | transform="translate(1)" |
| | | ></path> |
| | | <g |
| | | class="slds-illustration__stroke-primary" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | transform="translate(0 2)" |
| | | > |
| | | <polygon |
| | | vector-effect="non-scaling-stroke" |
| | | points="26.648 0 52.648 87 .648 87" |
| | | ></polygon> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | d="M26.6478873 6C26.6478873 64.4972948 26.6478873 94.4972948 26.6478873 96 26.6478873 94.4972948 26.6478873 64.4972948 26.6478873 6zM15.6478873 42C22.9812207 50.078692 26.6478873 52.7453587 26.6478873 53 26.6478873 52.7453587 22.9812207 50.078692 15.6478873 42zM27.6478873 68C36.9812207 57.078692 41.6478873 51.7453587 41.6478873 52 41.6478873 51.7453587 36.9812207 57.078692 27.6478873 68z" |
| | | ></path> |
| | | </g> |
| | | </g> |
| | | <g transform="translate(168 57)"> |
| | | <circle |
| | | vector-effect="non-scaling-stroke" |
| | | cx="64" |
| | | cy="64" |
| | | r="23" |
| | | class="slds-illustration__fill-secondary" |
| | | ></circle> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-dasharray="135 1 1 18" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | d="M64,109 C88.8528137,109 109,88.8528137 109,64 C109,39.1471863 88.8528137,19 64,19 C39.1471863,19 19,39.1471863 19,64 C19,88.8528137 39.1471863,109 64,109 Z" |
| | | transform="rotate(-130 64 64)" |
| | | ></path> |
| | | <path |
| | | vector-effect="non-scaling-stroke" |
| | | class="slds-illustration__stroke-secondary" |
| | | stroke-dasharray="107 10" |
| | | stroke-linecap="round" |
| | | stroke-linejoin="round" |
| | | stroke-width="3" |
| | | d="M64,97 C82.2253967,97 97,82.2253967 97,64 C97,45.7746033 82.2253967,31 64,31 C45.7746033,31 31,45.7746033 31,64 C31,82.2253967 45.7746033,97 64,97 Z" |
| | | transform="rotate(150 64 64)" |
| | | ></path> |
| | | <g |
| | | class="slds-illustration__stroke-primary" |
| | | stroke-width="3" |
| | | transform="translate(41 41)" |
| | | > |
| | | <circle |
| | | vector-effect="non-scaling-stroke" |
| | | cx="23" |
| | | cy="23" |
| | | r="23" |
| | | ></circle> |
| | | </g> |
| | | </g> |
| | | </g> |
| | | </svg> |
| | | <div class="slds-text-longform"> |
| | | <h3 class="slds-text-heading_medium">{friendlyMessage}</h3> |
| | | <template if:true={errorMessages.length}> |
| | | <a onclick={handleShowDetailsClick}>Show details</a> |
| | | <template if:true={viewDetails}> |
| | | <template for:each={errorMessages} for:item="message"> |
| | | <p class="slds-text-body_regular" key={message}> |
| | | {message} |
| | | </p> |
| | | </template> |
| | | </template> |
| | | </template> |
| | | </div> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | <template> |
| | | <template if:true={showPopover}> |
| | | <section |
| | | style="position: absolute; left: -50%; bottom: 150%" |
| | | aria-describedby="dialog-body-id-5" |
| | | aria-labelledby="dialog-heading-id-2" |
| | | class="slds-popover slds-popover_error slds-nubbin_bottom-left" |
| | | role="dialog" |
| | | > |
| | | <div class="slds-float_right slds-popover__close"> |
| | | <lightning-button-icon |
| | | variant="bare" |
| | | icon-class="slds-button_icon-inverse" |
| | | size="small" |
| | | icon-name="utility:close" |
| | | alternative-text="Close dialog" |
| | | onclick={handleCloseButtonIconClick} |
| | | ></lightning-button-icon> |
| | | </div> |
| | | <header class="slds-popover__header"> |
| | | <div |
| | | class="slds-media slds-media_center slds-has-flexi-truncate" |
| | | > |
| | | <lightning-icon |
| | | variant="inverse" |
| | | class="slds-var-m-right_x-small" |
| | | size="x-small" |
| | | icon-name="utility:error" |
| | | alternative-text="Error" |
| | | ></lightning-icon> |
| | | <h2 |
| | | class="slds-truncate slds-text-heading_medium" |
| | | id="dialog-heading-id-2" |
| | | title="Resolve error" |
| | | > |
| | | Resolve error |
| | | </h2> |
| | | </div> |
| | | </header> |
| | | <div class="slds-popover__body" id="dialog-body-id-5">{errors}</div> |
| | | </section> |
| | | </template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | |
| | | export default class ErrorPopover extends LightningElement { |
| | | @api errors; |
| | | showPopover = true; |
| | | |
| | | handleCloseButtonIconClick() { |
| | | this.showPopover = false; |
| | | } |
| | | |
| | | @api |
| | | toggle() { |
| | | this.showPopover = !this.showPopover; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | import exampleWrapper from './exampleWrapperTemplate.html'; |
| | | |
| | | export default class ExampleWrapper extends LightningElement { |
| | | @api iconName; |
| | | @api lwc; |
| | | @api recordId; |
| | | @api title; |
| | | @api visualforce; |
| | | @api visualforceHeight; |
| | | |
| | | render() { |
| | | return exampleWrapper; |
| | | } |
| | | } |
| New file |
| | |
| | | <template> |
| | | <slot name="lwc"></slot> |
| | | </template> |
| New file |
| | |
| | | iframe { |
| | | border: none; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <lightning-card title={title} icon-name={iconName}> |
| | | <lightning-layout multiple-rows="true" vertical-align="center"> |
| | | <lightning-layout-item |
| | | padding="horizontal-medium" |
| | | size="6" |
| | | small-device-size="12" |
| | | medium-device-size="12" |
| | | large-device-size="6" |
| | | > |
| | | <iframe |
| | | title={visualforceIframeTitle} |
| | | src={visualforceUrl} |
| | | width="100%" |
| | | height={visualforceHeight} |
| | | ></iframe> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item |
| | | padding="horizontal-medium" |
| | | size="6" |
| | | small-device-size="12" |
| | | medium-device-size="12" |
| | | large-device-size="6" |
| | | > |
| | | <slot name="lwc"></slot> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <c-view-vf-lwc-source |
| | | visualforce-source={visualforceSource} |
| | | lwc-source={lwcSource} |
| | | slot="footer" |
| | | > |
| | | <slot></slot> |
| | | </c-view-vf-lwc-source> |
| | | </lightning-card> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | |
| | | export default class ExampleWrapper extends LightningElement { |
| | | @api iconName; |
| | | @api lwc; |
| | | @api recordId; |
| | | @api title; |
| | | @api visualforce; |
| | | @api visualforceHeight; |
| | | |
| | | get lwcSource() { |
| | | return `lwc/${this.lwc}`; |
| | | } |
| | | |
| | | get visualforceSource() { |
| | | return `pages/${this.visualforce}.page`; |
| | | } |
| | | |
| | | get visualforceUrl() { |
| | | if (this.recordId) |
| | | return `/apex/${this.visualforce}?id=${this.recordId}`; |
| | | return `/apex/${this.visualforce}`; |
| | | } |
| | | |
| | | get visualforceIframeTitle() { |
| | | return `Wrapper for ${this.visualforce} page`; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="slds-is-relative"> |
| | | <lightning-spinner variant="brand" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement } from 'lwc'; |
| | | |
| | | export default class Gzwbtest extends LightningElement {} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | div { |
| | | border: 1px solid black; |
| | | padding: 10px; |
| | | } |
| | | h1 { |
| | | font-weight: bold; |
| | | } |
| | | lightning-button { |
| | | margin-top: 10px; |
| | | margin-bottom: 10px; |
| | | display: block; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div> |
| | | <h1>LWC</h1> |
| | | <lightning-button |
| | | label="Press me and send an event up!" |
| | | onclick={handleClick} |
| | | ></lightning-button> |
| | | <p class="label">{label}</p> |
| | | <p class="message">{message}</p> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api } from 'lwc'; |
| | | |
| | | export default class Interoperability extends LightningElement { |
| | | @api label = 'This label property has its initial value'; |
| | | timesInvoked = 0; |
| | | |
| | | handleClick() { |
| | | this.dispatchEvent( |
| | | new CustomEvent('buttonclicked', { bubbles: true, composed: true }) |
| | | ); |
| | | } |
| | | |
| | | @api |
| | | doWhatever() { |
| | | this.timesInvoked++; |
| | | } |
| | | |
| | | get message() { |
| | | return `LWC Method invoked ${this.timesInvoked} times`; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <p style="font-size: 16px;"><strong>经销商库存上下限编辑</strong></p> |
| | | |
| | | <table class="slds-table slds-table_cell-buffer slds-table_bordered"> |
| | | <thead> |
| | | <tr class=""> |
| | | <!-- <th class="slds-size_3-of-10" scope="col"> |
| | | <div class="slds-truncate" title="Name">S.No</div> |
| | | </th> --> |
| | | <th class="slds-size_3-of-10" scope="col" align="center"> |
| | | <div class="slds-truncate" title="Name">产品型号</div> |
| | | </th> |
| | | <th class="slds-size_3-of-10" scope="col"> |
| | | <div class="slds-truncate" title="First Name"> |
| | | 库存下限 |
| | | </div> |
| | | </th> |
| | | <th class="slds-size_3-of-10" scope="col"> |
| | | <div class="slds-truncate" title="Last Name">库存上限</div> |
| | | </th> |
| | | <th class="slds-size_3-of-10" scope="col"> |
| | | <div class="slds-truncate" title="Last Name">操作</div> |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <template for:each = {invRecords} for:item = "inv" for:index="indexVar"> |
| | | <tr key={inv.key} class="slds-hint-parent"> |
| | | <td class="slds-size_3-of-10" data-label="Prospecting"> |
| | | <div title="Prospecting"> |
| | | <lightning-input key={inv.key} data-id={inv.key} name="input1" label="productNumber" value="" variant="label-hidden" onchange={handleProductChange}></lightning-input> |
| | | </div> |
| | | </td> |
| | | <td class="slds-size_3-of-10" data-label="Prospecting"> |
| | | <div title="Prospecting"> |
| | | <lightning-input key={inv.key} data-id={inv.key} name="input1" label="inventory1" value={inv.inventory2} variant="label-hidden" onchange={handleinv1Change}></lightning-input> |
| | | </div> |
| | | </td> |
| | | <td class="slds-size_3-of-10" data-label="Prospecting"> |
| | | <div title="Prospecting"> |
| | | <lightning-input key={inv.key} data-id={inv.key} name="input1" label="inventory2" value={inv.inventory2} variant="label-hidden" onchange={handleinv2Change}></lightning-input> |
| | | </div> |
| | | </td> |
| | | <td class="slds-size_1-of-10" data-label="Prospecting"> |
| | | <a name={indexVar} data-id={inv.key} onclick={removeRow}> |
| | | <lightning-icon icon-name="utility:delete" alternative-text="delete" size="small"></lightning-icon> |
| | | </a> |
| | | </td> |
| | | </tr> |
| | | </template> |
| | | <tr> |
| | | <td></td> |
| | | <td> |
| | | <lightning-button label="行增加" onclick={addRow} class="slds-m-left_x-small"></lightning-button> |
| | | </td> |
| | | <td> |
| | | <lightning-button label="保存" onclick={handleClick} class="slds-m-left_x-small"></lightning-button> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track,api } from 'lwc'; |
| | | import Product_Number_FIELD from '@salesforce/schema/Dealer_Stock__c.Product_Code__c'; |
| | | import ONE_FIELD from '@salesforce/schema/Dealer_Stock__c.Product_Code__c'; |
| | | import TWO_FIELD from '@salesforce/schema/Dealer_Stock__c.Product_Code__c'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class InventoryEditingLWC extends LightningElement { |
| | | // @track invRecord = {ProductNumber : Product_Number_FIELD,Inventory1: ONE_FIELD,Inventory2 : TWO_FIELD,key : Math.random().toString(36).substring(2, 15)}; |
| | | @track invRecord = {ProductNumber : Product_Number_FIELD,Inventory1: ONE_FIELD,Inventory2 : TWO_FIELD,key : Math.random().toString(36).substring(2, 15)}; |
| | | @track invRecords = []; |
| | | toSaveLabel = 'Save'; |
| | | |
| | | connectedCallback(){ |
| | | console.log(' === connectedCallback === '); |
| | | this.inventoryTempRecords(); |
| | | } |
| | | inventoryTempRecords(){ |
| | | console.log('===>初始化'); |
| | | this.invRecord = []; |
| | | // for(var i=0; i < 1 ; i++){ |
| | | // this.invRecords.push({ProductNumber : Product_Number_FIELD,Inventory1: ONE_FIELD,Inventory2 : TWO_FIELD,key : Math.random().toString(36).substring(2, 15)}); |
| | | // } |
| | | } |
| | | |
| | | addRow(){ |
| | | console.log('=====>进入行项目'); |
| | | const len = this.invRecords.length; |
| | | this.invRecords.push({ProductNumber : Product_Number_FIELD,Inventory1: ONE_FIELD,Inventory2 : TWO_FIELD,key : Math.random().toString(36).substring(2, 15)}); |
| | | } |
| | | removeRow(event){ |
| | | const indexPos = event.currentTarget.name; |
| | | let remList = []; |
| | | remList = this.invRecords; |
| | | remList.splice(indexPos,1); |
| | | this.invRecords = remList; |
| | | } |
| | | handleClick(){ |
| | | console.log('保存'); |
| | | this.toSaveLabel = 'Saving...' |
| | | let toSaveList = this.invRecords.slice(0);; |
| | | toSaveList.forEach((element, index) => { |
| | | console.log( index + ' ==> ' + JSON.stringify(element.Name)); |
| | | let eleType = typeof element.Name; |
| | | console.log( 'typeof ==> ' + eleType); |
| | | if(element.Name === '' || eleType=='object'){ |
| | | toSaveList.splice(index); |
| | | } |
| | | }); |
| | | // refreshApex(this.invRecord); |
| | | |
| | | this.inventoryTempRecords(); |
| | | console.log( 'Save ==> ' + JSON.stringify(toSaveList)); |
| | | } |
| | | |
| | | handleProductChange(event){ |
| | | |
| | | let foundelement = this.invRecords.find(ele => ele.key == event.target.dataset.id); |
| | | console.log('=====>foundelement'+foundelement); |
| | | foundelement.productNumber = event.target.value; |
| | | this.accRecords = [this.accRecords]; |
| | | console.log(' ==>第一行' + JSON.stringify(this.invRecords)); |
| | | } |
| | | handleinv1Change(event){ |
| | | let foundelement = this.invRecords.find(ele => ele.key == event.target.dataset.id); |
| | | foundelement.inventory1 = event.target.value; |
| | | this.accRecords = [this.accRecords]; |
| | | console.log(' ==> 第二' + JSON.stringify(this.invRecords)); |
| | | } |
| | | |
| | | handleinv2Change(event){ |
| | | let foundelement = this.invRecords.find(ele => ele.key == event.target.dataset.id); |
| | | foundelement.inventory2 = event.target.value; |
| | | this.accRecords = [this.accRecords]; |
| | | console.log(' ==>第三' + JSON.stringify(this.invRecords)); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightningCommunity__Page</target> |
| | | <target>lightningCommunity__Default</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;"> |
| | | <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <p style="font-size: 19px;"><strong>库存管理</strong></p> |
| | | </div> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;text-align:center;"> |
| | | <lightning-button label="库存盘点" title="Non-primary action" onclick={handleClick} class="slds-m-left_x-small"></lightning-button> |
| | | <lightning-button label="过期库存销存" title="Non-primary action" onclick={handleClick} class="slds-m-left_x-small"></lightning-button> |
| | | <lightning-button label="拆盒" title="Non-primary action" onclick={handleClick} class="slds-m-left_x-small"></lightning-button> |
| | | <lightning-button label="取消拆盒" title="Non-primary action" onclick={handleClick} class="slds-m-left_x-small"></lightning-button> |
| | | </div> |
| | | <div class = 'searchBlock' style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;text-align:center;height:80%px;"> |
| | | <table> |
| | | <tr> |
| | | <td style="width:90px">消耗品名称</td> |
| | | <td style="width:90px"><lightning-input type="text" label="" style="width:70px"></lightning-input></td> |
| | | <td style="width:90px">第3分类</td> |
| | | <td style="width:90px"> |
| | | <lightning-combobox |
| | | name="progress" |
| | | value={value} |
| | | options={options} |
| | | onchange={handleChange} style="width:90px;"></lightning-combobox></td> |
| | | <td style="width:90px">第4分类</td> |
| | | <td style="width:90px"> |
| | | <lightning-combobox |
| | | name="progress" |
| | | value={value} |
| | | options={options} |
| | | onchange={handleChange} style="width:80px;"></lightning-combobox> |
| | | </td> |
| | | <td style="width:90px">第5分类</td> |
| | | <td style="width:90px"> |
| | | <lightning-combobox |
| | | name="progress" |
| | | value={value} |
| | | options={options} |
| | | onchange={handleChange} style="width:80px;"></lightning-combobox> |
| | | </td> |
| | | |
| | | </tr> |
| | | |
| | | |
| | | </table> |
| | | |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <p style="font-size: 16px;"><strong>库存详情</strong></p> |
| | | </div> |
| | | <div style="padding:10px;"> |
| | | <table class="list" border="0" cellpadding="0" cellspacing="0" id="example"> |
| | | <thead> |
| | | <tr class="headerRow"> |
| | | <th>消耗品名称</th> |
| | | <th>第3分类</th> |
| | | <th>第4分类</th> |
| | | <th>第5分类</th> |
| | | <th>规格</th> |
| | | <th>单位</th> |
| | | <th>注册证编码号</th> |
| | | <th>注册证效期</th> |
| | | <th>CFDA状态</th> |
| | | <th>使用期限</th> |
| | | <th>有效期内库存</th> |
| | | <th>过期库存</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <template for:each={inventoryRcords} for:item="re"> |
| | | <tr key={re.Prod.Name__c}> |
| | | <td>{re.Prod.Name__c}</td> |
| | | <td>{re.Prod.Category3__c}</td> |
| | | <td>{re.Prod.Category4__c}</td> |
| | | <td>{re.Prod.Category5__c}</td> |
| | | <td>{re.packing_list}</td> |
| | | <td>{re.BoxPiece}</td> |
| | | <td>{re.approbation_No}</td> |
| | | <td>{re.expiration_Date}</td> |
| | | <td>{re.guaranteeperiod}</td> |
| | | <td>{re.limitCount}</td> |
| | | <td>{re.overlimitCount}</td> |
| | | </tr> |
| | | </template> |
| | | |
| | | </tbody> |
| | | </table> |
| | | <table style="width: 100%"> |
| | | <tbody> |
| | | <tr> |
| | | <td width="20%"> |
| | | <!-- 1-0 共 0 --> |
| | | </td> |
| | | <td></td> |
| | | <td align="center" width="60%"> |
| | | <lightning-button-icon style="margin: 3px;" icon-name="utility:jump_to_left"></lightning-button-icon> |
| | | <lightning-button-icon style="margin: 3px;" icon-name="utility:chevronleft"></lightning-button-icon> |
| | | <lightning-button-icon style="margin: 3px;" icon-name="utility:chevronright"></lightning-button-icon> |
| | | <lightning-button-icon style="margin: 3px;" icon-name="utility:jump_to_right"></lightning-button-icon> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,track } from 'lwc'; |
| | | import oninit from '@salesforce/apex/LexInventoryViewController.oninit'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | |
| | | |
| | | export default class InventoryViewLWC extends LightningElement { |
| | | @track inventoryRcords= []; |
| | | value = '无'; |
| | | connectedCallback() { |
| | | oninit().then(result=>{ |
| | | if(result.result == 'Success'){ |
| | | this.inventoryRcords = result.inventoryRcords; |
| | | }else{ |
| | | console.log("Error:"+result.errorMsg); |
| | | const evt = new ShowToastEvent({ |
| | | title : '初始化失败', |
| | | message: result.errorMsg, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | get options() { |
| | | return [ |
| | | { label: 'CDS', value: 'CDS' }, |
| | | { label: 'ERCP', value: 'ERCP' }, |
| | | { label: 'ESD', value: 'ESD' }, |
| | | { label: 'EUS', value: 'EUS' }, |
| | | { label: '外科ET', value: '外科ET' }, |
| | | { label: '外套导管', value: '外套导管' }, |
| | | { label: '基干', value: '基干' }, |
| | | { label: '呼吸科ET', value: '呼吸科ET' }, |
| | | { label: '呼吸科耗材', value: '呼吸科耗材' }, |
| | | { label: '光源', value: '光源' }, |
| | | { label: '口垫', value: '口垫' }, |
| | | { label: '止血', value: '止血' }, |
| | | { label: '其他', value: '其他' }, |
| | | { label: '其他ET', value: 'EUS' }, |
| | | { label: '灯泡', value: '灯泡' }, |
| | | { label: '模型', value: '模型' }, |
| | | ]; |
| | | } |
| | | |
| | | handleChange(event) { |
| | | this.value = event.detail.value; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightningCommunity__Page</target> |
| | | <target>lightningCommunity__Default</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| | |
| | | if (!this.isClick) { |
| | | this.InputValue = ''; |
| | | } |
| | | },3000) |
| | | },300) |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | setTimeout(()=>{ |
| | | this.OnLoading(false); |
| | | },3000); |
| | | },1000); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | <template> |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire } from 'lwc'; |
| | | |
| | | export default class lWtTEST extends LightningElement { |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lWtTEST"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | export function reduceErrors() { |
| | | return ''; |
| | | } |
| New file |
| | |
| | | /** |
| | | * Reduces one or more LDS errors into a string[] of error messages. |
| | | * @param {FetchResponse|FetchResponse[]} errors |
| | | * @return {String[]} Error messages |
| | | */ |
| | | export function reduceErrors(errors) { |
| | | return ( |
| | | // ensure errors is an array |
| | | [] |
| | | .concat(errors) |
| | | // Remove null/undefined items |
| | | .filter((error) => !!error) |
| | | // Extract an error message |
| | | .map((error) => { |
| | | // UI API read errors |
| | | if (Array.isArray(error.body)) { |
| | | return error.body.map((e) => e.message); |
| | | } |
| | | // UI API DML, Apex and network errors |
| | | else if (error.body && typeof error.body.message === 'string') { |
| | | return error.body.message; |
| | | } |
| | | // JS errors |
| | | else if (typeof error.message === 'string') { |
| | | return error.message; |
| | | } |
| | | // Unknown error shape so try HTTP status text |
| | | return error.statusText; |
| | | }) |
| | | // Flatten |
| | | .reduce((prev, curr) => prev.concat(curr), []) |
| | | // Remove empty strings |
| | | .filter((message) => !!message) |
| | | ); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>false</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .inASACEditorHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="inASACEditorHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForASACEditorButton'; |
| | | export default class LexASACEditor extends LightningElement { |
| | | @api recordId; |
| | | LastModifiedDate |
| | | Id |
| | | Name |
| | | LastModifiedById |
| | | DeveloperName |
| | | IsLoading = true; |
| | | url; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != undefined) { |
| | | console.log("if"); |
| | | this.LastModifiedById = result.LastModifiedById; |
| | | this.LastModifiedDate = result.LastModifiedDate; |
| | | this.Id = result.Id; |
| | | this.Name = result.Name; |
| | | this.DeveloperName = result.DeveloperName; |
| | | console.log(this.Id); |
| | | this.editor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | | }else{ |
| | | console.log("else"); |
| | | this.IsLoading = false; |
| | | this.editor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | //this.updateRecordView(this.recordId); |
| | | |
| | | } |
| | | |
| | | editor(){ |
| | | if (this.Id != undefined){ |
| | | this.url = "/apex/RepPAEDecisionRecord?Id="+this.Id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision"; |
| | | console.log(this.url); |
| | | } else { |
| | | this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision"; |
| | | console.log(this.url); |
| | | } |
| | | window.open(this.url,"_self"); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectPAEDecisionRecord from '@salesforce/apex/otherButtonRepairController.selectPAEDecisionRecord'; |
| | | |
| | | export default class LexASACEditorRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id;; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | |
| | | this.ASACEditor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | //Final universal code编辑 |
| | | ASACEditor() { |
| | | var RepairId = this.Id; |
| | | var RecordTypeId = "ASACDecision"; |
| | | var url = ''; |
| | | selectPAEDecisionRecord({ |
| | | recordId: RepairId, |
| | | recordTypeId: RecordTypeId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | if (result.length > 0) { |
| | | url = "/apex/PAEDecisionRecord?Id=" + result[0].Id + "&RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } |
| | | |
| | | window.open(url, '_self'); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .inASRCEditorHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="inASRCEditorHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForASRCEditorButton'; |
| | | |
| | | export default class LexASRCEditor extends LightningElement { |
| | | @api recordId; |
| | | LastModifiedDate |
| | | Id |
| | | Name |
| | | LastModifiedById |
| | | DeveloperName |
| | | IsLoading = true; |
| | | url; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != undefined) { |
| | | console.log("if"); |
| | | this.LastModifiedById = result.LastModifiedById; |
| | | this.LastModifiedDate = result.LastModifiedDate; |
| | | this.Id = result.Id; |
| | | this.Name = result.Name; |
| | | this.DeveloperName = result.DeveloperName; |
| | | console.log(this.Id); |
| | | this.editor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | | }else{ |
| | | console.log("else"); |
| | | this.IsLoading = false; |
| | | this.editor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | //this.updateRecordView(this.recordId); |
| | | |
| | | } |
| | | |
| | | editor(){ |
| | | if (this.Id != undefined){ |
| | | this.url = "/apex/RepPAEDecisionRecord?Id="+this.Id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision"; |
| | | console.log(this.url); |
| | | } else { |
| | | this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision"; |
| | | console.log(this.url); |
| | | } |
| | | window.open(this.url,"_self"); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectPAEDecisionRecord from '@salesforce/apex/otherButtonRepairController.selectPAEDecisionRecord'; |
| | | |
| | | export default class LexASRCEditorRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.ASRCEditor(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // Intake universal code编辑 |
| | | ASRCEditor() { |
| | | var RecordTypeId = "ASRCDecision"; |
| | | var RepairId = this.Id; |
| | | var url = ''; |
| | | selectPAEDecisionRecord({ |
| | | recordId: RepairId, |
| | | recordTypeId: RecordTypeId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | if (result.length > 0) { |
| | | url = "/apex/PAEDecisionRecord?Id=" + result[0].Id + "&RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } else { |
| | | url = "/apex/PAEDecisionRecord?RepairId=" + RepairId + "&RecordTypeIds=" + RecordTypeId; |
| | | } |
| | | window.open(url, '_self'); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .outerBorderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .borderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | margin-bottom : 7px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .headerDorderCss{ |
| | | border-top: 1px solid #565959; |
| | | border-bottom: 1px solid #D4D4D4; |
| | | padding:3px; |
| | | } |
| | | .centerCss{ |
| | | text-align: center; |
| | | } |
| | | .centerCss .left{ |
| | | margin-left: 100px; |
| | | }/* sample css file */ |
| New file |
| | |
| | | <template> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | |
| | | import init from '@salesforce/apex/AddSubmitApprovalProcessController.init'; |
| | | export default class lexAddSubmitApprovalProcess extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if(urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if(result.addApprovalStatus != '草案中' || result.detailSize == 0){ |
| | | this.ToastShow('没有需要审批的追加附属品'); |
| | | return; |
| | | } |
| | | if (!confirm("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | // 希望到货日不能早于申请提交日-0418追加 |
| | | //if ('{!Rental_Apply__c.Request_shipping_day__c}' < '{!TODAY()}') { |
| | | // alert('希望到货日不能早于申请提交日'); |
| | | // return; |
| | | // } |
| | | if(result.repairId != null){ |
| | | if(result.demoPurpose1 == '维修代用' && result.demoPurpose2 == '一般用户'){ |
| | | if(result.repairEstimatedDateFormula == null){ |
| | | this.ToastShow('一般维修无报价日,不可借用备品'); |
| | | return; |
| | | }else if(result.repairEstimatedDateFormula <'2019-07-01' && result.agreedDate == null){ |
| | | this.ToastShow('报价日在2019/7/1之前且户同意日为空,不可借用备品'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if(result.recordTypeId !='01210000000RHIn' && result.newProductGuaranteeObject=='2: 服务多年保修' && (result.assetModelNo=='CV-V1' ||result.assetModelNo=='CV-V1(A)'||result.assetModelNo=='CV-V1(B)'||result.assetModelNo=='GIF-LV1'||result.assetModelNo=='CF-LV1L'||result.assetModelNo=='CF-LV1I'||result.assetModelNo=='MAJ-1910') &&(result.demoPurpose2=='一般用户'||result.demoPurpose2=='再修理')){ |
| | | this.ToastShow('奥辉设备,保修期内不提供备品.'); |
| | | return; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | ToastShow(msg){ |
| | | const evt = new ShowToastEvent({ |
| | | title : msg, |
| | | message: '', |
| | | variant: 'warning' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOCMSubmit"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexAddress extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | partArrangementCompleteC; |
| | | RepairShippedDateC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.RepairShippedDateC = result.RepairShippedDateC; |
| | | this.partArrangementCompleteC = result.partArrangementCompleteC; |
| | | |
| | | this.Address(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | //直返收货地址 |
| | | Address() { |
| | | if (this.partArrangementCompleteC != undefined) { |
| | | this.ShowToastEvent('零件已齐备完毕,直返收货地址不能修改!',"error") |
| | | // alert('零件已齐备完毕,直返收货地址不能修改!'); |
| | | } else if (this.RepairShippedDateC != undefined) { |
| | | this.ShowToastEvent('RC修理品已返送,直返收货地址不能修改!',"error") |
| | | // alert('RC修理品已返送,直返收货地址不能修改!'); |
| | | } else { |
| | | window.open("/apex/StraightBackAddress?id=" + this.Id, '_self'); |
| | | } |
| | | } |
| | | |
| | | //弹框 |
| | | ShowToastEvent(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .inASACEditorHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="inASACEditorHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-12 14:51:44 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-19 09:11:02 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForAgencyAuthorizeButton'; |
| | | import updateForAgencyAuthorizeButton from '@salesforce/apex/OpportunityLightingButtonController.updateForAgencyAuthorizeButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import checkDangerItem from '@salesforce/apex/OpportunityWebService.checkDangerItem'; |
| | | import oppCheck from '@salesforce/apex/OpportunityWebService.oppCheck'; |
| | | import updReg from '@salesforce/apex/OpportunityWebService.updReg'; |
| | | |
| | | export default class LexAgencyAuthorize extends LightningElement { |
| | | @api recordId; |
| | | agency1Id; |
| | | stageName; |
| | | sapSendOK; |
| | | oppOrderType; |
| | | ifHave170; |
| | | ifHaveAH; |
| | | cntLostCancelDraft; |
| | | cntLostCancelReport; |
| | | estimationId; |
| | | detailNum; |
| | | estimationDecision; |
| | | salesRoot; |
| | | acecideCntCheck; |
| | | ifSubmit; |
| | | trade; |
| | | isCorrosion; |
| | | profileId; |
| | | ifAuthorizingLock; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | this.agency1Id = result.agency1Id; |
| | | this.stageName = result.stageName; |
| | | this.sapSendOK = result.sapSendOK; |
| | | this.oppOrderType = result.oppOrderType; |
| | | this.ifHave170 = result.ifHave170; |
| | | this.ifHaveAH = result.ifHaveAH; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft; |
| | | this.cntLostCancelReport = result.cntLostCancelReport; |
| | | this.estimationId = result.estimationId; |
| | | this.detailNum = result.detailNum; |
| | | this.estimationDecision = result.estimationDecision; |
| | | this.salesRoot = result.salesRoot; |
| | | this.acecideCntCheck = result.acecideCntCheck; |
| | | this.ifSubmit = result.ifSubmit; |
| | | this.trade = result.trade; |
| | | this.isCorrosion = result.isCorrosion; |
| | | this.profileId = result.profileId; |
| | | this.ifAuthorizingLock = result.ifAuthorizingLock; |
| | | this.AgencyAuthorize(); |
| | | }) |
| | | } |
| | | AgencyAuthorize(){ |
| | | var btns = document.getElementsByName("agency_authorize"); |
| | | for (var i=0; i<btns.length; i++) { |
| | | btns[i].disabled = true; |
| | | btns[i].className = 'btnDisabled'; |
| | | } |
| | | //2021-10-21 gwy 版本更改为51.0 |
| | | var oppid = this.recordId; |
| | | var angency = this.agency1Id; |
| | | var profileId = this.profileId; |
| | | |
| | | if (profileId != '00e10000000Y3o5' && profileId != '00e10000000Nab7' && profileId != '00e10000000xnpR' && profileId != '00e10000000xyK6' && profileId != '00e10000000NbCE' |
| | | && profileId != '00e10000000xyK6' && profileId != '00e10000000Nb7i') { |
| | | this.showToast("您没有授权申请的权限。请联系系统管理员。","error"); |
| | | return; |
| | | } |
| | | if (this.stageName != '引合' && this.stageName != '询价' ) { |
| | | this.showToast("状态1:" + this.stageName + "、不能做授权申请!","error"); |
| | | return; |
| | | } else if (this.sapSendOK == '1') { |
| | | this.showToast("已经上传SAP、不能做授权申请了!","error"); |
| | | return; |
| | | } else if (this.oppOrderType != undefined && this.ifHave170 == true) { |
| | | this.showToast("耗材不可与170产品同时存在!","error"); |
| | | return; |
| | | } else if (this.oppOrderType != undefined && this.ifHaveAH == true) { |
| | | this.showToast("耗材不可与奥辉产品同时存在!","error"); |
| | | return; |
| | | } else if (this.cntLostCancelDraft > 0) { |
| | | if(!confirm('询价有草案中的取消/失单报告,是否继续?')){ |
| | | return ; |
| | | } |
| | | } else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { |
| | | this.showToast('询价有已提交的取消/失单报告。',"error"); |
| | | return; |
| | | } else if (this.estimationId == undefined || this.detailNum == 0) { |
| | | this.showToast('报价未完成,请先报价。',"error"); |
| | | return; |
| | | } else if (this.estimationDecision == '1') { |
| | | this.showToast('报价已决定,不能进行授权申请。',"error"); |
| | | return; |
| | | } else if (this.salesRoot != '販売店') { |
| | | this.showToast('医院直销不需要授权申请。',"error"); |
| | | return; |
| | | } |
| | | // else if ('{!Opportunity.AcecideCntCheck__c}' != '1') { |
| | | // alert('阿西赛多询价只能包含危化品,或者,普通询价不能包含危化品。'); |
| | | // return; |
| | | // } |
| | | else if (this.ifSubmit == '1') { |
| | | this.showToast('上传失败,请联系系统管理员!',"error"); |
| | | return; |
| | | } |
| | | if (this.ifAuthorizingLock == 'true') { |
| | | this.showToast('询价正在授权中,请不要重复提交。',"error"); |
| | | return; |
| | | } |
| | | if (this.trade == '内貿') { |
| | | if(this.isCorrosion == '1'){ |
| | | checkDangerItem({ |
| | | agency1: angency |
| | | }).then(result=>{ |
| | | var rtn1 = result; |
| | | if (rtn1 != 'OK') { |
| | | this.showToast(rtn1,"error"); |
| | | return; |
| | | } |
| | | this.update(); |
| | | }); |
| | | }else{ |
| | | oppCheck({ |
| | | oppid: oppid, |
| | | saveFlg: '1' |
| | | }).then(result=>{ |
| | | var rtn = result; |
| | | if (rtn != 'OK') { |
| | | this.showToast(rtn,"error"); |
| | | return; |
| | | } |
| | | this.update(); |
| | | }) |
| | | } |
| | | } else { |
| | | updReg({ |
| | | oppid: oppid |
| | | }).then(()=>{ |
| | | this.update(); |
| | | }); |
| | | } |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | update(){ |
| | | updateForAgencyAuthorizeButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.updateRecordView(this.recordId); |
| | | window.open("https://olympus.sharepoint.cn/sites/GSPWF/SitePages/HomePage.aspx"); |
| | | this.showToast('提交成功。请在SPO系统中完成授权申请。',"success"); |
| | | } |
| | | this.IsLoading = false; |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .outerBorderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .borderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | margin-bottom : 7px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .headerDorderCss{ |
| | | border-top: 1px solid #565959; |
| | | border-bottom: 1px solid #D4D4D4; |
| | | padding:3px; |
| | | } |
| | | .centerCss{ |
| | | text-align: center; |
| | | } |
| | | .centerCss .left{ |
| | | margin-left: 100px; |
| | | }/* sample css file */ |
| New file |
| | |
| | | <template> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import init from '@salesforce/apex/AllReceivedFseController.init'; |
| | | import getRaeSet from '@salesforce/apex/AllReceivedFseController.getRaeSet'; |
| | | export default class lexAllReceivedFse extends LightningElement { |
| | | |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if(urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(res=>{ |
| | | if(res.LoanerReceivedNgNum == 0){ |
| | | const evt = new ShowToastEvent({ |
| | | title : '现场已经全部收到实物了', |
| | | message: '', |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | }else{ |
| | | getRaeSet({ |
| | | recordId: this.recordId |
| | | }).then(res=>{ |
| | | if(res == 'SUCCESS'){ |
| | | const evt = new ShowToastEvent({ |
| | | title : '现场已全部收货', |
| | | message: '', |
| | | variant: 'success' |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.dispatchEvent(evt); |
| | | }else{ |
| | | const errToast = new ShowToastEvent({ |
| | | title : res, |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | this.dispatchEvent(errToast); |
| | | |
| | | console.log(res); |
| | | } |
| | | |
| | | }) |
| | | } |
| | | }).catch(err=>{ |
| | | console.log(err); |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOCMSubmit"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="ApplicationCancelSubmit" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/OppSubmitController.initSubmitButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import submitCancel from '@salesforce/apex/OppSubmitController.submitCancel'; |
| | | import UserInfo_Owner from '@salesforce/apex/OppSubmitController.UserInfo_Owner'; |
| | | export default class CancelSubmit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId; |
| | | monthlyReportId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(currentPageReference,'666666666666'); |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str:"+str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.OwnerId; |
| | | this.monthlyReportId = result.Id; |
| | | this.cancelSubmit(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | cancelSubmit(){ |
| | | UserInfo_Owner({}).then(result=>{ |
| | | console.log(result,'获取当前登陆人id') |
| | | if(this.ownerId == result.id){ |
| | | submitCancel({ |
| | | recordId: this.recordId |
| | | }).then(requst=>{ |
| | | if(requst == '1'){ |
| | | this.showToast("取消提交授权信息成功","success"); |
| | | } |
| | | if(requst != "1"){ |
| | | var messageage = ""; |
| | | messageage = requst.split(',')[1]; |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.showToast("只授权申请书所有人可以取消提交","error"); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="ApplicationSubmit" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/OppSubmitController.initSubmitButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/OppSubmitController.UserInfo_Owner'; |
| | | import submit from '@salesforce/apex/OppSubmitController.submit'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class Submit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | arrMessage = []; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(currentPageReference,'666666666666'); |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str:"+str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result,"请求成功了吗") |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.OwnerId; |
| | | this.id = result.Id; |
| | | this.Submit(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | Submit(){ |
| | | //获取获取当前登陆人 |
| | | this.arrMessage = []; |
| | | UserInfo_Owner({}).then(result=>{ |
| | | console.log(result,'获取当前登陆人id') |
| | | if(this.ownerId == result.id){ |
| | | submit({ |
| | | recordId: this.recordId |
| | | }).then(requst=>{ |
| | | |
| | | if(requst == '1'){ |
| | | this.showToast("提交授权信息成功","success"); |
| | | } |
| | | if(requst != "1"){ |
| | | var messageage = ""; |
| | | console.log('是不是这里报错11111'); |
| | | this.arrMessage = requst.split(','); |
| | | for(let i=0;i<this.arrMessage.length;i++){ |
| | | console.log('是不是这里报错'); |
| | | if(this.arrMessage.length-1 == i){ |
| | | break; |
| | | } |
| | | messageage += this.arrMessage[i+1]; |
| | | } |
| | | // requst.split(',').map((item,index)=>{ |
| | | // messageage += item[index+1]; |
| | | // }) |
| | | // if(requst.split(',')[1].slice(-1) == '式'){ |
| | | // messageage = requst.split(',')[1] + "," + requst.split(',')[2] + "," + requst.split(',')[3] + "," + requst.split(',')[4] + "," + requst.split(',')[5] + "," + requst.split(',')[6]; |
| | | // }else{ |
| | | // messageage = requst.split(',')[1]; |
| | | // } |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.showToast("只授权申请书所有人可以提交","error"); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | console.log(msg,type); |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | console.log('走到这里了吗'); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="Holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | export default class lexAssetMaintainDetail extends LightningElement { |
| | | @api recordId; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | |
| | | async cancelSubmit(){ |
| | | window.open('/apex/AssetMaintainDetail?id='+this.recordId,'AssetMaintainDetail', 'width=600,height=200'); |
| | | } |
| | | } |
| | | |
| | | // old js |
| | | // window.open('/apex/AssetMaintainDetail?id={! AssetMaintainHeader__c.Id }'); |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexAssetMaintainDetail"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | export default class lexAssetMaintainPage extends LightningElement { |
| | | @api recordId; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | |
| | | async cancelSubmit(){ |
| | | window.open('/apex/AssetMaintain?id='+this.recordId,'lexAssetMaintainPage', 'width=600,height=200'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexAssetMaintainPage"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Narrow{ |
| | | padding: 20px; |
| | | } |
| | | .searchField,.searchField .input-text{ |
| | | /*display: flex;*/ |
| | | } |
| | | .searchField .slds-combobox_container{ |
| | | width: 160px !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <!-- <div class="slds-box slds-theme--default"> |
| | | Click on the link Below to Export data as csv/xls. |
| | | <p class="slds-m-top--large"> |
| | | <a onclick={exportContactData}>Export Contact Data</a> |
| | | <lightning-button variant="brand" label="Export Contact data" title="Export Contact Data" onclick={exportContactData}></lightning-button> |
| | | </p> |
| | | </div> --> |
| | | <lightning-card variant="Narrow"> |
| | | <div style="padding: 0 20px"> |
| | | <div> |
| | | <div style="padding: 10px 3px;border-bottom: 1px solid;font: 16px;font-size: blod;">检索列</div> |
| | | <div style="margin-top: 5px"> |
| | | <lightning-layout> |
| | | <!-- cancelPaddingLeft --> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-combobox name="progress" label="状态1" value={searchObj.Status1} options={status1Options} |
| | | onchange={handleStatus1Change} class="searchField"></lightning-combobox> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-combobox |
| | | name="progress" label="状态2" value={searchObj.Status2} options={status2Options} onchange={handleStatus2Change} |
| | | class="searchField"></lightning-combobox> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-combobox |
| | | name="progress" label="服务方式" value={searchObj.onSiteRepair} options={siteRepairItems} onchange={handleSiteChange} |
| | | class="searchField"></lightning-combobox> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.RepairName} type="text" label="RS修理单号" class="searchField" onchange={handleRepairNameChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.SAPRepairNo} type="text" label="SAP修理单号" class="searchField" onchange={handleSAPRepairNoChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.workLocationSelect} type="text" label="维修中心" class="searchField" onchange={handleWorkLocationChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.SerialNumber} type="text" label="机身编码" class="searchField" onchange={handleSerialNumberChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.State_Hospital} type="text" label="省份" class="searchField" onchange={handleStateHospitalChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <lightning-input value={searchObj.HospitalName} type="text" label="医院名称" class="searchField" onchange={handleHospitalChange}></lightning-input> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item size="2" padding="horizontal-small"> |
| | | <lightning-input type="date" label="FSE申请日(开始)" value={repair.Aware_date__c} onchange={handleAwareDateDStart}></lightning-input> |
| | | </lightning-layout-item> |
| | | <!-- cancelPaddingLeft --> |
| | | <lightning-layout-item size="2" padding="horizontal-small"> |
| | | <!-- variant="label-hidden" --> |
| | | <lightning-input type="date" label="FSE申请日(结束)" value={repair.Aware_date2__c} onchange={handleAwareDateDEnd}></lightning-input> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item size="4" padding="horizontal-small"> |
| | | <!-- record-id={recordId} 修理委托者 Incharge_Staff__c--> |
| | | <!-- <lightning-record-edit-form |
| | | object-api-name={objectApiName} |
| | | record-id='' |
| | | > |
| | | <lightning-input-field field-name={nameField} onclick={handleInchargeStaffChange}> </lightning-input-field> |
| | | </lightning-record-edit-form> --> |
| | | <lightning-record-edit-form |
| | | object-api-name='Repair__c' |
| | | record-id='' |
| | | > |
| | | <lightning-input-field field-name='Incharge_Staff__c' onclick={handleInchargeStaffChange}> </lightning-input-field> |
| | | </lightning-record-edit-form> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | <lightning-layout> |
| | | <lightning-layout-item flexibility="auto" padding="around-small"> |
| | | <lightning-button label="检索" onclick={searchRepair}></lightning-button> |
| | | </lightning-layout-item> |
| | | </lightning-layout> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <div style="padding: 10px 5px;border-bottom: 1px solid">详细信息</div> |
| | | <div style="padding: 10px 0;"> |
| | | <lightning-button label="打印PDF" onclick={skipPage}></lightning-button> |
| | | |
| | | <lightning-button label="导出Excel" onclick={exportContactData}></lightning-button> |
| | | <!-- <lightning-button label="导出Excel" onclick={downloadCSVFile}></lightning-button> --> |
| | | </div> |
| | | <div> |
| | | <lightning-datatable |
| | | key-field="id" |
| | | data={data} |
| | | columns={columns} |
| | | onrowselection={getSelectedRows} |
| | | onrowaction={handleRowAction}> |
| | | |
| | | </lightning-datatable> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </lightning-card> |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import NAME_FIELD from '@salesforce/schema/Repair__c.Incharge_Staff__c'; |
| | | import MY_CUSTOM_OBJECT from '@salesforce/schema/Repair__c'; |
| | | |
| | | import search from '@salesforce/apex/lexBatchSelectRepairLWCController.search'; |
| | | import showPDF from '@salesforce/apex/lexBatchSelectRepairLWCController.showPDF'; |
| | | |
| | | /* |
| | | const actions = [ |
| | | { label: 'Show details', name: 'show_details' }, |
| | | { label: 'Delete', name: 'delete' }, |
| | | ];*/ |
| | | |
| | | const columns = [ |
| | | { label: '状态1', fieldName: 'Status1__c'}, |
| | | { label: '状态2', fieldName: 'Status2__c' }, |
| | | { label: 'RS修理单号', fieldName: 'Name' }, |
| | | { label: 'SAP修理单号', fieldName: 'SAP_Service_Repair_No__c' }, |
| | | // { label: '型号', fieldName: 'deliveredProductName' }, |
| | | { label: '型号', fieldName: 'deliveredProductUrl',type:'url', |
| | | typeAttributes:{ |
| | | label:{ |
| | | fieldName:'deliveredProductName' |
| | | }, |
| | | target:'_balank' |
| | | } |
| | | }, |
| | | { label: '机身编号', fieldName: 'SerialNumber__c' }, |
| | | { label: '医院名称', fieldName: 'HP_Name__c' }, |
| | | { label: '省份', fieldName: 'State_Hospital__c' }, |
| | | // { label: '修理委托者', fieldName: 'Incharge_Staff_Name' }, |
| | | { label: '修理委托者', fieldName: 'inchargeStaffUrl',type:'url', |
| | | typeAttributes:{ |
| | | label:{ |
| | | fieldName:'inchargeStaffName' |
| | | }, |
| | | target:'_balank' |
| | | } |
| | | }, |
| | | { label: 'FSE申请日期', fieldName: 'FSE_ApplyForRepair_Day__c' }, |
| | | { label: '维修中心', fieldName: 'work_location_select__c' }, |
| | | { label: '服务方式', fieldName: 'On_site_repair__c' }, |
| | | { label: '有无维修合同对象', fieldName: 'Number_of_EffectiveContract__c' }, |
| | | { label: '无偿区别标志', fieldName: 'NewProductGuaranteeObject__c' } |
| | | /* { |
| | | type: 'action', |
| | | typeAttributes: { rowActions: actions }, |
| | | },*/ |
| | | ]; |
| | | |
| | | export default class lexBatchSelectRepairLWC extends LightningElement { |
| | | // Expose a field to make it available in the template |
| | | nameField = NAME_FIELD; |
| | | |
| | | // Flexipage provides recordId and objectApiName |
| | | @api recordId; |
| | | @api objectApiName; |
| | | |
| | | data = []; |
| | | columns = columns; |
| | | |
| | | //状态1 |
| | | status1Options = [{ label: '--无--', value: '' }, |
| | | { label: '0.申请完毕', value: '0.申请完毕' }, |
| | | { label: '2.维修报价阶段', value: '2.维修报价阶段' }, |
| | | { label: '3.维修阶段', value: '3.维修阶段' }, |
| | | { label: '4.修理品返送阶段', value: '4.修理品返送阶段' }, |
| | | { label: '5.完毕', value: '5.完毕' }, |
| | | { label: '0.删除', value: '0.删除' }, |
| | | { label: '0.取消', value: '0.取消' }]; |
| | | //状态2 |
| | | status2Options = [{label:'00.申请完毕', value:'00.申请完毕'}, |
| | | {label:'01.分公司受理完毕', value:'01.分公司受理完毕'}, |
| | | {label:'02.RC受理完毕', value:'02.RC受理完毕'}, |
| | | {label:'03.报价检查结束', value:'03.报价检查结束'}, |
| | | {label:'04.报价跟进中', value:'04.报价跟进中'}, |
| | | {label:'05.报价同意完备', value:'05.报价同意完备'}, |
| | | {label:'06.零件齐备', value:'06.零件齐备'}, |
| | | {label:'07.修理開始', value:'07.修理開始'}, |
| | | {label:'08.修理预计完成', value:'08.修理预计完成'}, |
| | | {label:'09.修理完成', value:'09.修理完成'}, |
| | | {label:'10.最终检查完成', value:'10.最终检查完成'}, |
| | | {label:'11.RC修理品已返送', value:'11.RC修理品已返送'}, |
| | | {label:'12.发票已发送', value:'12.发票已发送'}, |
| | | {label:'13.已返送到用户', value:'13.已返送到用户'}, |
| | | {label:'14.收到验收单', value:'14.收到验收单'}, |
| | | {label:'15.验收单签收复核通过', value:'15.验收单签收复核通过'}, |
| | | {label:'16.部分付款', value:'16.部分付款'}, |
| | | {label:'16.完毕', value:'16.完毕'}, |
| | | {label:'17.付款完毕', value:'17.付款完毕'}, |
| | | {label:'00.取消', value:'00.取消'}, |
| | | {label:'00.删除', value:'00.删除'}, |
| | | {label:'00.关闭', value:'00.关闭'}]; |
| | | //服务方式 |
| | | siteRepairItems = [{label:'--无--',value:''}, |
| | | {label:'RC修理',value:'RC修理'}, |
| | | {label:'直送SORC修理',value:'直送SORC修理'}, |
| | | {label:'直送OGZ修理',value:'直送OGZ修理'}, |
| | | {label:'办事处修理',value:'办事处修理'}, |
| | | {label:'现场修理',value:'现场修理'}]; |
| | | |
| | | searchObj = {}; |
| | | repair = {}; |
| | | selectedRepairs; |
| | | |
| | | /* @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | connectedCallback(){ |
| | | // console.log(this.recordId); |
| | | } |
| | | //状态1 |
| | | handleStatus1Change(event){ |
| | | /*console.log(event); |
| | | console.log(event.detail);*/ |
| | | this.searchObj.Status1 = event.detail.value; |
| | | // console.log(JSON.stringify(this.searchObj)); |
| | | } |
| | | //状态2 |
| | | handleStatus2Change(event){ |
| | | this.searchObj.Status2 = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //服务方式 |
| | | handleSiteChange(event){ |
| | | this.searchObj.onSiteRepair = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //RS修理单号 RepairName |
| | | handleRepairNameChange(event){ |
| | | this.searchObj.RepairName = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //SAP修理单号 SAPRepairNo |
| | | handleSAPRepairNoChange(event){ |
| | | this.searchObj.SAPRepairNo = event.detail.value; |
| | | // console.log(this.searchObj); |
| | | } |
| | | //维修中心 workLocationSelect |
| | | handleWorkLocationChange(event){ |
| | | this.searchObj.workLocationSelect = event.detail.value; |
| | | } |
| | | //机身编码 SerialNumber |
| | | handleSerialNumberChange(event){ |
| | | this.searchObj.SerialNumber = event.detail.value; |
| | | } |
| | | // 省份 State_Hospital |
| | | handleStateHospitalChange(event){ |
| | | this.searchObj.State_Hospital = event.detail.value; |
| | | } |
| | | //医院名称 HospitalName |
| | | handleHospitalChange(event){ |
| | | this.searchObj.HospitalName = event.detail.value; |
| | | } |
| | | //FSE申请日 repair.Aware_date__c |
| | | handleAwareDateDStart(event){ |
| | | this.repair.Aware_date__c = event.detail.value; |
| | | console.log(this.repair.Aware_date__c); |
| | | } |
| | | // repair.Aware_date2__c |
| | | handleAwareDateDEnd(event){ |
| | | this.repair.Aware_date2__c = event.detail.value; |
| | | // console.log(this.repair.Aware_date2__c); |
| | | } |
| | | // 修理委托者 repair.Incharge_Staff__c |
| | | handleInchargeStaffChange(event){ |
| | | this.repair.Incharge_Staff__c = event.detail.value; |
| | | // console.log(this.repair.Aware_date2__c); |
| | | } |
| | | |
| | | //检索 |
| | | searchRepair(event) { |
| | | console.log(this.repair.Aware_date__c); |
| | | if (JSON.stringify(this.repair) != "{}") { |
| | | console.log('this.repair'); |
| | | this.searchObj.repair = this.repair; |
| | | // fse 时间条件 |
| | | /*if (!(this.repair.Aware_date__c != null && this.repair.Aware_date2__c != null) || this.repair.Aware_date__c > this.repair.Aware_date2__c) { |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: 'FSE申请日输入有误', |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | }*/ |
| | | } |
| | | let jsonStr = JSON.stringify(this.searchObj); |
| | | if (jsonStr === "{}") { |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: '请至少添加一个检索条件!', |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | }else{ |
| | | console.log(jsonStr); |
| | | search({ |
| | | json: jsonStr |
| | | }).then(result => { |
| | | console.log(result.repairData); |
| | | console.log('length:'+result.repairData.length); |
| | | if (result.repairData.length == 0 || result.repairData.length == 200) { |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: result.status, |
| | | variant:'warning', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | let returnArr = []; |
| | | result.repairData.forEach(function(v){ |
| | | let objRepair = v.repair; |
| | | //添加修理委托者和型号名称 |
| | | objRepair.deliveredProductName = objRepair.Delivered_Product__r.Name; |
| | | objRepair.deliveredProductUrl = "/"+objRepair.Delivered_Product__c; |
| | | objRepair.inchargeStaffName = objRepair.Incharge_Staff__r.Name; |
| | | objRepair.inchargeStaffUrl = "/"+objRepair.Incharge_Staff__c; |
| | | // console.log(objRepair); |
| | | returnArr.push(objRepair); |
| | | }); |
| | | /*console.log('arr'); |
| | | console.log(arr); |
| | | console.log(arr.length);*/ |
| | | this.data = returnArr; |
| | | // console.log(this.data); |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | //导出为Excel 画table |
| | | exportContactData(){ |
| | | // Prepare a html table |
| | | let doc = '<table>'; |
| | | // Add styles for the table |
| | | doc += '<style>'; |
| | | doc += 'table, th, td {'; |
| | | doc += ' border: 1px solid black;'; |
| | | doc += ' border-collapse: collapse;'; |
| | | doc += '}'; |
| | | doc += '</style>'; |
| | | // Add all the Table Headers |
| | | doc += '<tr>'; |
| | | this.columns.forEach(element => { |
| | | doc += '<th>'+ element.label +'</th>' |
| | | }); |
| | | doc += '</tr>'; |
| | | // Add the data rows |
| | | let fieldNameArr =[]; |
| | | this.columns.forEach(function(v){ |
| | | if (v['typeAttributes']) { |
| | | fieldNameArr.push(v['typeAttributes'].label.fieldName); |
| | | }else{ |
| | | fieldNameArr.push(v.fieldName); |
| | | } |
| | | }); |
| | | console.log(fieldNameArr); |
| | | fieldNameArr.forEach(v=>{ |
| | | console.log(v); |
| | | // console.log(this.data[0].v); |
| | | }) |
| | | this.data.forEach(record => { |
| | | doc += '<tr>'; |
| | | if (record.Status1__c != null) { |
| | | doc += '<th>'+record.Status1__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.Status2__c != null) { |
| | | doc += '<th>'+record.Status2__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.Name != null) { |
| | | doc += '<th>'+record.Name+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.SAP_Service_Repair_No__c != null) { |
| | | doc += '<th>'+record.SAP_Service_Repair_No__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.deliveredProductName != null) { |
| | | doc += '<th>'+record.deliveredProductName+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.SerialNumber__c != null) { |
| | | doc += '<th>'+record.SerialNumber__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.HP_Name__c != null) { |
| | | doc += '<th>'+record.HP_Name__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.State_Hospital__c != null) { |
| | | doc += '<th>'+record.State_Hospital__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.inchargeStaffName != null) { |
| | | doc += '<th>'+record.inchargeStaffName+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.FSE_ApplyForRepair_Day__c != null) { |
| | | doc += '<th>'+record.FSE_ApplyForRepair_Day__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.work_location_select__c != null) { |
| | | doc += '<th>'+record.work_location_select__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.On_site_repair__c != null) { |
| | | doc += '<th>'+record.On_site_repair__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.Number_of_EffectiveContract__c != null) { |
| | | doc += '<th>'+record.Number_of_EffectiveContract__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | if (record.NewProductGuaranteeObject__c != null) { |
| | | doc += '<th>'+record.NewProductGuaranteeObject__c+'</th>'; |
| | | }else{ |
| | | doc += '<th></th>' |
| | | } |
| | | // fieldNameArr.forEach(fieldName =>{ |
| | | // doc += '<th>'+record.fieldName+'</th>'; |
| | | // }); |
| | | doc += '</tr>'; |
| | | }); |
| | | doc += '</table>'; |
| | | var element = 'data:application/vnd.ms-excel,' + encodeURIComponent(doc); |
| | | let downloadElement = document.createElement('a'); |
| | | downloadElement.href = element; |
| | | downloadElement.target = '_self'; |
| | | // use .csv as extension on below line if you want to export data as csv |
| | | downloadElement.download = '修理明细表.xls'; |
| | | document.body.appendChild(downloadElement); |
| | | downloadElement.click(); |
| | | } |
| | | |
| | | // this method validates the data and creates the csv file to download this.data的所有字段 |
| | | downloadCSVFile1() { |
| | | console.log("downloadCSVFile1"); |
| | | let rowEnd = '\n'; |
| | | let csvString = ''; |
| | | // this set elminates the duplicates if have any duplicate keys |
| | | let rowData = new Set(); |
| | | let columnsData = new Set(); |
| | | let columnsLabelData = new Set(); |
| | | |
| | | // getting keys from data |
| | | this.data.forEach(function (record) { |
| | | Object.keys(record).forEach(function (key) { |
| | | rowData.add(key); |
| | | }); |
| | | }); |
| | | console.log(rowData); |
| | | |
| | | // Array.from() method returns an Array object from any object with a length property or an iterable object. |
| | | rowData = Array.from(rowData); |
| | | console.log(rowData); |
| | | |
| | | // splitting using ',' |
| | | csvString += rowData.join(','); |
| | | csvString += rowEnd; |
| | | console.log(csvString); |
| | | this.columns.forEach(function(v){ |
| | | columnsLabelData.add(v.label); |
| | | if (v['typeAttributes']) { |
| | | columnsData.add(v['typeAttributes'].label.fieldName); |
| | | }else{ |
| | | columnsData.add(v.fieldName); |
| | | } |
| | | }); |
| | | console.log("columnsData"); |
| | | console.log(columnsLabelData); |
| | | console.log(columnsData); |
| | | console.log(rowData[1]); |
| | | console.log(Array.from(columnsData)); |
| | | console.log(Array.from(columnsData).hasOwnProperty(rowData[1])); |
| | | console.log(this.data[0].Name); |
| | | console.log(this.data[0][rowData[1]]); |
| | | // main for loop to get the data based on key value |
| | | for(let i=0; i < this.data.length; i++){ |
| | | let colValue = 0; |
| | | |
| | | // validating keys in data |
| | | for(let key in rowData) { |
| | | if(rowData.hasOwnProperty(key)) { |
| | | // Key value |
| | | // Ex: Id, Name |
| | | let rowKey = rowData[key]; |
| | | // add , after every value except the first. |
| | | if(colValue > 0){ |
| | | csvString += ','; |
| | | } |
| | | // If the column is undefined, it as blank in the CSV file. |
| | | let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey]; |
| | | csvString += '"'+ value +'"'; |
| | | colValue++; |
| | | } |
| | | } |
| | | csvString += rowEnd; |
| | | } |
| | | |
| | | // Creating anchor element to download |
| | | let downloadElement = document.createElement('a'); |
| | | |
| | | // This encodeURI encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters). |
| | | downloadElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvString); |
| | | downloadElement.target = '_self'; |
| | | // CSV File Name |
| | | downloadElement.download = 'Account Data.csv'; |
| | | // below statement is required if you are using firefox browser |
| | | document.body.appendChild(downloadElement); |
| | | // click() Javascript function to download CSV file |
| | | downloadElement.click(); |
| | | } |
| | | //导出为Excel |
| | | downloadCSVFile() { |
| | | console.log("downloadCSVFile"); |
| | | let rowEnd = '\n'; |
| | | let csvString = ''; |
| | | // this set elminates the duplicates if have any duplicate keys |
| | | //表格标题 |
| | | let columnsData = new Set(); |
| | | //表格字段 |
| | | let rowData = new Set(); |
| | | |
| | | // getting keys from data |
| | | this.columns.forEach(function(v){ |
| | | columnsData.add(v.label); |
| | | if (v['typeAttributes']) { |
| | | rowData.add(v['typeAttributes'].label.fieldName); |
| | | }else{ |
| | | rowData.add(v.fieldName); |
| | | } |
| | | }); |
| | | console.log(columnsData); |
| | | console.log(rowData); |
| | | // Array.from() method returns an Array object from any object with a length property or an iterable object. |
| | | rowData = Array.from(rowData); |
| | | columnsData = Array.from(columnsData); |
| | | // getting keys from data |
| | | /* console.log("rowData"); |
| | | rowData.forEach(function(v){ |
| | | console.log(v); |
| | | }); |
| | | console.log("columnsData"); |
| | | columnsData.forEach(function(v){ |
| | | console.log(v); |
| | | }); */ |
| | | |
| | | // splitting using ',' |
| | | csvString += columnsData.join(','); |
| | | csvString += rowEnd; |
| | | // console.log(csvString); |
| | | // main for loop to get the data based on key value |
| | | for(let i=0; i < this.data.length; i++){ |
| | | let colValue = 0; |
| | | |
| | | // validating keys in data |
| | | for(let key in rowData) { |
| | | if(rowData.hasOwnProperty(key)) {//del |
| | | // Key value |
| | | // Ex: Id, Name |
| | | let rowKey = rowData[key]; |
| | | // add , after every value except the first. |
| | | if(colValue > 0){ |
| | | csvString += ','; |
| | | } |
| | | // If the column is undefined, it as blank in the CSV file. |
| | | let value = this.data[i][rowKey] === undefined ? '' : this.data[i][rowKey]; |
| | | csvString += '"'+ value +'"'; |
| | | colValue++; |
| | | } |
| | | } |
| | | csvString += rowEnd; |
| | | } |
| | | |
| | | // Creating anchor element to download |
| | | let downloadElement = document.createElement('a'); |
| | | |
| | | // This encodeURI encodes special characters, except: , / ? : @ & = + $ # (Use encodeURIComponent() to encode these characters). |
| | | downloadElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(csvString); |
| | | downloadElement.target = '_self'; |
| | | // CSV File Name |
| | | downloadElement.download = '修理明细表.csv'; |
| | | // below statement is required if you are using firefox browser |
| | | document.body.appendChild(downloadElement); |
| | | // click() Javascript function to download CSV file |
| | | downloadElement.click(); |
| | | } |
| | | //获取选中Repair |
| | | getSelectedRows(event) { |
| | | const selectedRows = event.detail.selectedRows; |
| | | console.log(selectedRows); |
| | | //Repair__c selectedRepairs |
| | | // Display that fieldName of the selected rows |
| | | let selectedRepairsArr = []; |
| | | for (let i = 0; i < selectedRows.length; i++) { |
| | | selectedRepairsArr.push(selectedRows[i]); |
| | | } |
| | | this.selectedRepairs = selectedRepairsArr; |
| | | } |
| | | |
| | | //跳转到pdf页面 |
| | | skipPage() { |
| | | console.log("selectedRows"); |
| | | // console.log(jsonStr); |
| | | if (this.selectedRepairs.length <= 0 ) { |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: '请至少选择一个修理', |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | } |
| | | let jsonStr = JSON.stringify(this.selectedRepairs); |
| | | showPDF({ |
| | | json: jsonStr |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result.indexOf("https://ocsm") != -1) { |
| | | window.open(result, "维修委托书PDF", ""); |
| | | }else{ |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | message: result, |
| | | variant:'error', |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .lexBeforeOPDPDFBtnHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <!-- |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 15:08:43 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-14 14:13:25 |
| | | --> |
| | | <template> |
| | | <div class="lexBeforeOPDPDFBtnHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={showToast}></lightning-button> |
| | | <lightning-button onclick={handleConfirmClick} label="Open Confirm Modal"></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 15:08:43 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-14 15:37:35 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initFoBeforeOPDPDFBtnButton'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence'; |
| | | import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | export default class LexBeforeOPDPDFBtn extends LightningElement { |
| | | @api recordId; |
| | | accountId; |
| | | userId; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.accountId = result.accountId; |
| | | this.userId = result.userId; |
| | | this.beforeOPDPDFBtn(); |
| | | }) |
| | | } |
| | | beforeOPDPDFBtn(){ |
| | | this.handleConfirmClick('是否新建OPD报告书?\n[确定] => 新建OPD\n[取消] => 只生成 [产品试用评价]'); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | async handleConfirmClick(msg) { |
| | | const result = await LightningConfirm.open({ |
| | | message: msg, |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value', |
| | | }); |
| | | console.log(result); |
| | | if(result){ |
| | | try { |
| | | selectCommonSequence({ |
| | | valueField: 'EvaluationPDF_NextValue__c', |
| | | formatField: 'EvaluationPDF_Format__c' |
| | | }).then(result=>{ |
| | | var pdfno = result; |
| | | addReportOPWithEvaluationPDF({ |
| | | "repOwnerId": this.userId, |
| | | "reportId": "", |
| | | "dailyReportId": "", |
| | | "eventId": "", |
| | | "recordType": "OPD", |
| | | "aId": this.accountId, |
| | | "visitor1": "", |
| | | "visitor2": "", |
| | | "visitor3": "", |
| | | "visitor4": "", |
| | | "visitor5": "", |
| | | "opp1": this.recordId, |
| | | "opp2": "", |
| | | "opp3": "", |
| | | "opp4": "", |
| | | "opp5": "", |
| | | "reportDate": "", |
| | | "evaluationPDFNumber": pdfno |
| | | }).then(()=>{ |
| | | // 20220913 ljh WLIG-CHMATN update end |
| | | this.IsLoading = false; |
| | | window.open('/apex/BeforeOPDPDF?oid=' + this.recordId + '&pdfNo=' + pdfno, 'BeforeOPDPDF'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | }); |
| | | } catch(e) { |
| | | this.showToast(e,"error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }else{ |
| | | window.open('/apex/BeforeOPDPDF?oid=' + this.recordId, 'BeforeOPDPDF'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .lexBeforeOPDPDFBtnSISHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <!-- |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 15:55:45 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-13 15:56:58 |
| | | --> |
| | | <template> |
| | | <div class="lexBeforeOPDPDFBtnSISHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 15:55:45 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-13 16:04:14 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initFoBeforeOPDPDFBtnSISButton'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import selectCommonSequence from '@salesforce/apex/ControllerUtil.selectCommonSequence'; |
| | | import addReportOPWithEvaluationPDF from '@salesforce/apex/Add_Report.addReportOPWithEvaluationPDF'; |
| | | |
| | | export default class LexBeforeOPDPDFBtnSIS extends LightningElement { |
| | | @api recordId; |
| | | accountId; |
| | | userId; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.accountId = result.accountId; |
| | | this.userId = result.userId; |
| | | this.beforeOPDPDFBtn(); |
| | | }) |
| | | } |
| | | beforeOPDPDFBtn(){ |
| | | if (window.confirm('是否新建SIS报告书?')) { |
| | | try { |
| | | selectCommonSequence({ |
| | | valueField: 'EvaluationPDF_NextValue__c', |
| | | formatField: 'EvaluationPDF_Format__c' |
| | | }).then(result=>{ |
| | | var pdfno = result; |
| | | addReportOPWithEvaluationPDF({ |
| | | "repOwnerId": this.userId, |
| | | "reportId": "", |
| | | "dailyReportId": "", |
| | | "eventId": "", |
| | | "recordType": "SIS", |
| | | "aId": this.accountId, |
| | | "visitor1": "", |
| | | "visitor2": "", |
| | | "visitor3": "", |
| | | "visitor4": "", |
| | | "visitor5": "", |
| | | "opp1": this.recordId, |
| | | "opp2": "", |
| | | "opp3": "", |
| | | "opp4": "", |
| | | "opp5": "", |
| | | "reportDate": "", |
| | | "evaluationPDFNumber": pdfno |
| | | }).then(()=>{ |
| | | // 20220913 ljh WLIG-CHMATN update end |
| | | this.IsLoading = false; |
| | | window.open('/apex/BeforeOPDPDF?oid=' + this.recordId + '&pdfNo=' + pdfno, 'BeforeOPDPDF'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }) |
| | | }); |
| | | } catch(e) { |
| | | this.showToast(e,"error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } else { |
| | | window.open('/apex/BeforeOPDPDF?oid=' + this.recordId, 'BeforeOPDPDF'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="ApplyFor" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/BidAnnouncementController.BidAnnouncementController'; |
| | | import ApplyFor from '@salesforce/apex/BidAnnouncementController.ApplyFor'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexBidAnnouncementApplyForButton extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | arrMessage = []; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | this.IsLoading = false; |
| | | this.ApplyFor(); |
| | | } |
| | | |
| | | ApplyFor(){ |
| | | ApplyFor({recordId:this.recordId}).then(res=>{ |
| | | console.log(res); |
| | | if(res == '1'){ |
| | | this.showToast('请求申请成功,申请中。。。','success'); |
| | | this.updateRecordView(); |
| | | }else{ |
| | | var messageage = ""; |
| | | messageage = res.split(',')[1]; |
| | | this.showToast(messageage,'error'); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | // var Bid_Announcement = new sforce.SObject("Bid_Announcement__c"); |
| | | // Bid_Announcement.Id = "{!Bid_Announcement__c.Id}"; |
| | | // Bid_Announcement.Status__c = "申请中"; |
| | | // Bid_Announcement.Request_flag__c = "true"; |
| | | // Bid_Announcement.Request_user__c = "{!$User.Id}"; |
| | | // var serverTimestamp = sforce.connection.getServerTimestamp(); |
| | | // Bid_Announcement.Request_date__c = serverTimestamp.timestamp; |
| | | |
| | | // var result = sforce.connection.update([Bid_Announcement]); |
| | | // var messages = getConnectDMLErrorMessages(result); |
| | | // if (messages.length > 0) { |
| | | // alert(messages.join("\n")); |
| | | // } |
| | | // location.reload(); |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="Consent" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import ConSent from '@salesforce/apex/BidAnnouncementController.ConSent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexBidAnnouncementRejectButton extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | arrMessage = []; |
| | | BidCancel = null; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | this.IsLoading = false; |
| | | this.Consent(); |
| | | } |
| | | |
| | | Consent(){ |
| | | ConSent({recordId:this.recordId}).then(res=>{ |
| | | console.log(res); |
| | | if(res == '1'){ |
| | | this.showToast("同意请求成功","success"); |
| | | } |
| | | if(res != "1"){ |
| | | var messageage = ""; |
| | | messageage = res.split(',')[1]; |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // var Bid_Announcement = new sforce.SObject("Bid_Announcement__c"); |
| | | // Bid_Announcement.Id = "{!Bid_Announcement__c.Id}"; |
| | | // Bid_Announcement.Status__c = "处理完毕"; |
| | | // Bid_Announcement.Complete__c = "true"; |
| | | // Bid_Announcement.Agree_user__c = "{!$User.Id}"; |
| | | // var serverTimestamp = sforce.connection.getServerTimestamp(); |
| | | // Bid_Announcement.Complete_date__c = serverTimestamp.timestamp; |
| | | |
| | | // var result = sforce.connection.update([Bid_Announcement]); |
| | | // var messages = getConnectDMLErrorMessages(result); |
| | | // if (messages.length > 0) { |
| | | // alert(messages.join("\n")); |
| | | // } |
| | | // location.reload(); |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="reject" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import UserInfo_Owner from '@salesforce/apex/BidAnnouncementController.UserInfo_Owner'; |
| | | import Reject from '@salesforce/apex/BidAnnouncementController.Reject'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexBidAnnouncementRejectButton extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | arrMessage = []; |
| | | BidCancel = null; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | this.IsLoading = false; |
| | | this.Reject(); |
| | | } |
| | | |
| | | Reject(){ |
| | | UserInfo_Owner().then(res=>{ |
| | | console.log(res); |
| | | this.BidCancel = res.BidCancel; |
| | | if(this.BidCancel == false){ |
| | | this.showToast('没有驳回的权限',"error"); |
| | | }else{ |
| | | Reject({ |
| | | recordId: this.recordId |
| | | }).then(requst=>{ |
| | | if(requst == '1'){ |
| | | this.showToast("驳回请求成功","success"); |
| | | } |
| | | if(requst != "1"){ |
| | | var messageage = ""; |
| | | messageage = requst.split(',')[1]; |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | // if ('{!$User.BidCancel__c}' == 'false') { |
| | | // alert("没有驳回的权限"); |
| | | // } else { |
| | | // var Bid_Announcement = new sforce.SObject("Bid_Announcement__c"); |
| | | // Bid_Announcement.Id = "{!Bid_Announcement__c.Id}"; |
| | | // Bid_Announcement.Status__c = "草案中"; |
| | | // Bid_Announcement.Complete__c = "false"; |
| | | // Bid_Announcement.Agree_user__c = null; |
| | | // Bid_Announcement.Complete_date__c = null; |
| | | // Bid_Announcement.Request_flag__c = "false"; |
| | | // Bid_Announcement.Request_user__c = null; |
| | | // Bid_Announcement.Request_date__c = null; |
| | | |
| | | // var result = sforce.connection.update([Bid_Announcement]); |
| | | // var messages = getConnectDMLErrorMessages(result); |
| | | // if (messages.length > 0) { |
| | | // alert(messages.join("\n")); |
| | | // } |
| | | // location.reload(); |
| | | // } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .cancelHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="cancelHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 13:47:21 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 16:44:49 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForCancelButton'; |
| | | import updateForCancelButton from '@salesforce/apex/ReportController.updateForCancelButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCancel extends LightningElement { |
| | | @api recordId; |
| | | status; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.status = result.status; |
| | | console.log(this.status); |
| | | this.cancel(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | cancel () { |
| | | if (this.status == "取消") { |
| | | this.showToast("已经取消!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.status == "批准") { |
| | | this.showToast("已经批准,不能删除!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.status == "完毕") { |
| | | this.showToast("已经完毕,不能删除!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.status == "提交") { |
| | | this.showToast("已经提交,不能删除!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | updateForCancelButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("取消成功!","success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | import {CurrentPageReference,NavigationMixin} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | |
| | | import cancelApply from '@salesforce/apex/TransferApplyWebService.cancelApply'; |
| | | |
| | | export default class lexCancelApply extends LightningElement { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | cancelResult; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | |
| | | } |
| | | } |
| | | } |
| | | connectedCallback() { |
| | | console.log('this.raeSetId:' + this.recordId); |
| | | |
| | | LightningConfirm.open({ |
| | | message: '确定取消?', |
| | | variant: 'headerless', |
| | | label: 'this is the aria-label value', |
| | | |
| | | }).then(cancel=>{ |
| | | // this.IsLoading=false; |
| | | // this.dispatchEvent(new CloseActionScreenEvent()); |
| | | if(cancel) { |
| | | cancelApply({ |
| | | taId : this.recordId |
| | | }).then(result => { |
| | | this.cancelResult = result; |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | |
| | | }).catch( error =>{ |
| | | console.log(error); |
| | | }).finally(()=>{ |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | async cancelSubmit(){ |
| | | if(this.cancelResult == '1') { |
| | | await this.showToast("",'取消成功',"success"); |
| | | window.location.href = window.location; |
| | | |
| | | } else { |
| | | console.log("result:",this.cancelResult); |
| | | await this.showToast("",this.cancelResult,"warning"); |
| | | } |
| | | |
| | | } |
| | | showToast(_title,_message,_variant) { |
| | | const event = new ShowToastEvent({ |
| | | title: _title, |
| | | message:_message, |
| | | variant: _variant, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | } |
| | | |
| | | //old js |
| | | |
| | | // {!REQUIRESCRIPT('/soap/ajax/51.0/connection.js')} |
| | | // {!REQUIRESCRIPT('/soap/ajax/51.0/apex.js')} |
| | | // if (confirm("确定取消?")) { |
| | | // var rs = sforce.apex.execute("TransferApplyWebService","cancelApply",{taId:'{!TransferApply__c.Id}'}); |
| | | // if(rs == '1'){ |
| | | // alert('取消成功'); |
| | | // window.location.href = window.location; |
| | | // } |
| | | // else{ |
| | | // alert(rs); |
| | | // } |
| | | // } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCancelApply"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .cancelReportHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="cancelReportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForCancelReportButton'; |
| | | import queryForCancelReportButton from '@salesforce/apex/OpportunityLightingButtonController.queryForCancelReportButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCancelReport extends LightningElement { |
| | | @api recordId; |
| | | stageName; |
| | | sapSendOK; |
| | | cntLostCancelReport; |
| | | cntLostCancelDraft; |
| | | jobCategory; |
| | | biddingProjectNameBid; |
| | | name; |
| | | salesAssistantName; |
| | | salesAssistantID; |
| | | managerName; |
| | | salesManagerDepartmentID; |
| | | salesOwnerBuchang; |
| | | salesOwnerBuchangID; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.stageName = result.stageName; |
| | | this.sapSendOK = result.sapSendOK; |
| | | this.cntLostCancelDraft = result.cntLostCancelDraft; |
| | | this.cntLostCancelReport = result.cntLostCancelReport; |
| | | this.jobCategory = result.jobCategory; |
| | | this.biddingProjectNameBid = result.biddingProjectNameBid; |
| | | this.name = result.name; |
| | | this.salesAssistantID = result.salesAssistantID; |
| | | this.salesAssistantName = result.salesAssistantName; |
| | | this.managerName = result.managerName; |
| | | this.salesManagerDepartmentID = result.salesManagerDepartmentID; |
| | | this.salesOwnerBuchang = result.salesOwnerBuchang; |
| | | this.salesOwnerBuchangID = result.salesOwnerBuchangID; |
| | | this.cancelReport(); |
| | | }) |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | cancelReport(){ |
| | | //XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 start |
| | | queryForCancelReportButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | var sqlResult = result; |
| | | // alert('测试+:'+sqlResult.size); |
| | | //XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 end |
| | | // jsの場合、翻訳された値がでるので、要注意 |
| | | if (this.stageName != '引合' |
| | | && this.stageName != '询价' |
| | | ) { |
| | | this.showToast("状态1:" + this.stageName + "、不能做 取消 了!","error"); |
| | | |
| | | } |
| | | else if (this.sapSendOK == '1') { |
| | | this.showToast("已经上传SAP、不能做 取消 了!",""); |
| | | } |
| | | else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { |
| | | this.showToast("询价已经有 取消/失单报告 了!","error"); |
| | | } |
| | | else if (this.jobCategory == '支援') { |
| | | this.showToast("询价所有人是助理的,先请修改到销售担当!",""); |
| | | } |
| | | //XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 start |
| | | //else if({!NOT(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))}&& '{!Opportunity.subInfoType__c}' != '3-1:废标公告' &&'{!Opportunity.subInfoType__c}' != '3-2:流标公告'){ |
| | | else if(this.biddingProjectNameBid != undefined && sqlResult.size == 0){ |
| | | this.showToast("有招投标项目时只能做失单或部分失单报告!","error"); |
| | | } |
| | | //XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 end |
| | | else { |
| | | location.href = '/a1U/e?retURL=%2F'+ this.recordId + |
| | | '&RecordType=01210000000R4hH' + |
| | | '&CF00N10000004lbGT=' + this.name + |
| | | '&CF00N10000004lbGT_lkid=' + this.recordId + |
| | | '&CF00N10000006QShg=' + this.salesAssistantName + |
| | | '&CF00N10000006QShg_lkid=' + this.salesAssistantID + |
| | | '&CF00N10000006QShq='+ this.managerName + |
| | | '&CF00N10000006QShq_lkid=' + this.salesManagerDepartmentID + |
| | | '&CF00N10000006QShb=' + this.salesOwnerBuchang + |
| | | '&CF00N10000006QShb_lkid=' + this.salesOwnerBuchangID + |
| | | ''; |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="Holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api, track, wire } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/SelectSubstituteControllerLWT.initFromSelectSubstituteButton'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexCancelSelect extends LightningElement { |
| | | @api recordId; |
| | | IsLoading=true; |
| | | id; |
| | | RentalApplyId; |
| | | Status; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({recordId:this.recordId}).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.id=result.id; |
| | | this.RentalApplyId=result.RentalApplyId; |
| | | this.Status=result.Status; |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(err=>{ |
| | | console.log("error:"); |
| | | console.log(err); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | async cancelSubmit(){ |
| | | window.open("/apex/EquipmentRentalCancel?raid="+this.RentalApplyId,'cancelSelect','width=500,height=250'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCancelSelect"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .cancelSubmitHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="cancelSubmitHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={showSuccess}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:17:24 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/MonthlyReportController.initForCancelSubmitButton'; |
| | | import cancel from '@salesforce/apex/MonthlyReportController.cancel'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCancelSubmit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId; |
| | | monthlyReportId; |
| | | IsLoading = true; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.ownerId = result.ownerId; |
| | | this.monthlyReportId = result.Id; |
| | | this.cancelSubmit(); |
| | | console.log("end"); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Monthly_Report__c/" + this.monthlyReportId + "/view"); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | cancelSubmit () { |
| | | //需要完善 |
| | | if(this.ownerId == UserInfo_Owner.Id) { |
| | | cancel({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | console.log("321"); |
| | | } else { |
| | | this.showToast("只有周报的所有人可以取消","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .cancelSubmitReportHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="cancelSubmitReportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:18:36 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import cancel from '@salesforce/apex/ReportController.updateForCancelSubmitReportButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCancelSubmitReport extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | this.cancelSubmit(); |
| | | } |
| | | |
| | | |
| | | cancelSubmit(){ |
| | | cancel({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("取消提交成功!","success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="Holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api, track, wire } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import getUserId from '@salesforce/apex/RentalApplyControllerLWT.getUserId'; |
| | | import init from '@salesforce/apex/SelectSubstituteControllerLWT.initClearReturnDeliverySlipButton'; |
| | | import updateRaescList from '@salesforce/apex/SelectSubstituteControllerLWT.updateRaescList'; |
| | | import selectRacById from '@salesforce/apex/SelectSubstituteControllerLWT.selectRacById'; |
| | | import selectRaesdcId from '@salesforce/apex/SelectSubstituteControllerLWT.selectRaesdcId'; |
| | | |
| | | import { loadScript } from 'lightning/platformResourceLoader'; |
| | | import { submitForApproval } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | |
| | | export default class lexClearReturnDeliverySlip extends LightningElement { |
| | | |
| | | @api recordId; |
| | | id; |
| | | RentalApplyId; |
| | | Status; |
| | | IsLoading=true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({recordId:this.recordId}).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.Rental_Apply_Equipment_Set__c=result; |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(err=>{ |
| | | console.log("error:"); |
| | | console.log(err); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | async cancelSubmit(){ |
| | | console.log("hhh1"); |
| | | var raesId = this.recordId; |
| | | console.log("hhh2"); |
| | | var result = await selectRaesdcId({recordId:this.recordId}); |
| | | console.log("hhh3"); |
| | | var objs = result; |
| | | if (objs.length< 1) { |
| | | // alert('没有需要清空的一览明细'); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:'没有需要清空的一览明细' |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } else { |
| | | console.log("hhh4"); |
| | | var result; |
| | | console.log("hhh5"); |
| | | await updateRaescList({updateList:objs}) |
| | | .then(res=>{ |
| | | console.log(res); |
| | | result=res; |
| | | }); |
| | | console.log("hhh6"); |
| | | if (result.success==true) { |
| | | console.log("hhh7"); |
| | | // success |
| | | // alert("回寄运输单信息已清空"); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:"回寄运输单信息已清空" |
| | | }); |
| | | this.dispatchEvent(event); |
| | | setTimeout(function() { |
| | | location.href = "/"+this.recordId; |
| | | }, 100); |
| | | } else { |
| | | console.log("hhh8"); |
| | | // alert("failed to update:" + result.errors.fields + " " + result[0].errors.message); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:"failed to update:" + result.errors.fields + " " + result[0].errors.message |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexClearReturnDeliverySlip"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .completeHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="completeHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:21:30 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForCompleteButton'; |
| | | import updateForCompleteButton from '@salesforce/apex/ReportController.updateForCompleteButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexComplete extends LightningElement { |
| | | @api recordId; |
| | | profileId; |
| | | status; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.status = result.status; |
| | | this.profileId = result.profileId; |
| | | this.complete(); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | //this.updateRecordView(this.recordId); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | |
| | | |
| | | complete () { |
| | | // 陆胜,胡迪安,系统管理员以外没有权限 |
| | | if (UserInfo_Owner.Id != "00510000004reg2" && UserInfo_Owner.Id != "00510000000gWAE" && this.profileId != "00e10000000Y3o5") { |
| | | this.showToast("你没有权限","error"); |
| | | return; |
| | | } |
| | | if (this.status == "完毕") { |
| | | this.showToast("已经完毕!","error"); |
| | | return; |
| | | } |
| | | updateForCompleteButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.updateRecordView(this.recordId); |
| | | this.showToast("完毕成功!","success"); |
| | | } |
| | | this.IsLoading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | body { |
| | | font-size: 13px; |
| | | font-family: Arial Unicode MS; |
| | | } |
| | | |
| | | @page { |
| | | @charset "utf-8"; |
| | | @bottom-center { |
| | | content: counter(page) " / " counter(pages); |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | .pageCanvas { |
| | | position: relative; |
| | | border-style: none; |
| | | height: 940px; |
| | | } |
| | | |
| | | .quoteTitle { |
| | | text-align: center; |
| | | font-weight: bold; |
| | | font-size: 22px; |
| | | width: 100%; |
| | | padding-bottom: 20px; |
| | | } |
| | | |
| | | .headerCanvas { |
| | | position: relative; |
| | | border-style: none; |
| | | height: 100px; |
| | | } |
| | | |
| | | .detailCanvas { |
| | | position: relative; |
| | | left: 0px; |
| | | width: 100%; |
| | | } |
| | | |
| | | .detailTable { |
| | | width: 100%; |
| | | border-bottom: solid; |
| | | } |
| | | |
| | | .detailTableHeader { |
| | | border-top: solid; |
| | | border-bottom: solid; |
| | | padding-left: 5px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .detailTableCols { |
| | | border: none; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | .detailRowNumber { |
| | | text-align: right; |
| | | padding-right: 0px; |
| | | padding-left: 5px; |
| | | } |
| | | |
| | | .detailRowString { |
| | | padding-right: 5px; |
| | | padding-left: 5px; |
| | | } |
| | | |
| | | .detailRowNumeric { |
| | | text-align: right; |
| | | padding-right: 5px; |
| | | padding-left: 5px; |
| | | } |
| | | |
| | | .footerCanvasContract { |
| | | position: absolute; |
| | | bottom: 0px; |
| | | width: 100%; |
| | | height: 110px; |
| | | } |
| | | |
| | | .footerSignContract { |
| | | position: absolute; |
| | | text-align: center; |
| | | right: 80px; |
| | | bottom: 0px; |
| | | } |
| New file |
| | |
| | | <template> |
| | | |
| | | <!-- <body style="font-family: Arial Unicode MS;"> --> |
| | | |
| | | <!-- ページ番号の定義 --> |
| | | <!-- <apex:variable var="count" value="{!0}"/> --> |
| | | |
| | | <!-- ページのリピート --> |
| | | <template for:each={printRecords} for:item="items" for:index="thePage"></template> |
| | | <!-- ページキャンバス --> |
| | | <div class="pageCanvas"> |
| | | |
| | | <!-- ページ番号インクリメント --> |
| | | <!-- <apex:variable var="count" value="{!count + 1}"/> --> |
| | | <!-- SWAG-C7S8QN 【委托】【重要】SI询价配置单没有抬头 lt 20211015 update 原<template rendered="{!IF(params.trade == 'USD', true, false)}">附件2 </template> --> |
| | | <div style="text-align: left;font-weight: bold;font-size: 18px;width: 100%;padding-bottom: 20px;"><span >附件2 </span></div> |
| | | <!-- 各ページのタイトル --> |
| | | <!-- <div class="quoteTitle"><template if:true={params.trade = 'USD'} >Commodity List </template></div> --> |
| | | <div class="quoteTitle"><template if:true={params.trade}>Commodity List </template></div> |
| | | |
| | | <!-- WLIG-BYRD37 【委托】询价 打印配置单 字段修改 精琢技术 wql 2021/03/08 start --> |
| | | <div class="quoteTitle"> |
| | | <!-- SWAG-C7S8QN 【委托】【重要】SI询价配置单没有抬头 lt 20211015 update --> |
| | | <!-- 20211015 原<template rendered="{!IF(params.PurchaseType == '一般引合' || params.PurchaseType == ' SI(手術室案件)', true, false)}"> --> |
| | | <span > |
| | | <!-- {Contract_Detail_Title} --> |
| | | {Contract_Detail_Title} |
| | | </span> |
| | | </div> |
| | | <div class="quoteTitle"> |
| | | <!-- <template if:true="{!IF(params.PurchaseType == 'ET24時間販売',true , false)}">0 --> |
| | | <template if:true={params.PurchaseType}> |
| | | 订货单 |
| | | </template> |
| | | </div> |
| | | <!-- //WLIG-BYRD37 【委托】询价 打印配置单 字段修改 精琢技术 wql 2021/03/08 end --> |
| | | <!-- CHAN-B2L4NY 外贸询价的合同配置单格式恢复 --> |
| | | <!-- <template if:true="{!IF(params.trade == 'RMB', true, false)}"> --> |
| | | <template if:true= {params.trade}> |
| | | <!-- 各ページのヘッダキャンバス --> |
| | | <div class="headerCanvas"> |
| | | <table style="height:100%;"> |
| | | <tr> |
| | | <td> |
| | | <div style="height:25px;">{Contract_Detail_System_Code}</div> |
| | | <div style="height:25px;">{Quote_Client_Name}</div> |
| | | <!-- <template if:true="{!IF(params.salesRoot == '販売店', true, false)}" layout="none" > --> |
| | | <template if:true={params.salesRoot} layout="none" > |
| | | <div style="height:25px;">{Contract_Detail_Dealer_Name}</div> |
| | | </template> |
| | | <div style="height:25px;">{Quote_AddressName}</div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;">: </div> |
| | | <div style="height:25px;">: </div> |
| | | <!-- <template layout="none" if:true="{!IF(params.salesRoot == '販売店', true, false)}"> --> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;">: </div> |
| | | </template> |
| | | <div style="height:25px;">: </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> {params.quoteNo}</div> |
| | | <div style="height:25px;"> {params.clientName}</div> |
| | | <!-- <template layout="none" if:true="{!IF(params.salesRoot == '販売店', true, false)}"> --> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> {params.agentNameForContract}</div> |
| | | </template> |
| | | <div style="height:25px;"> {params.addressName}</div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> </div> |
| | | </template> |
| | | <div style="height:25px;"> </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;">{Quote_Department}</div> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> </div> |
| | | </template> |
| | | <div style="height:25px;"> </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;">: </div> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> </div> |
| | | </template> |
| | | <div style="height:25px;"> </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> {params.departmentName}</div> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> </div> |
| | | </template> |
| | | <div style="height:25px;"> </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table style="top:0px; right:0px; position:absolute; height:100%;"> |
| | | <tr> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <!-- 电子签收ID号 wql 精琢技术 2020/11/20 start --> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;">{eSignAgencyNum}</div> |
| | | </template> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> </div> |
| | | </template> |
| | | <!-- 电子签收ID号 wql 精琢技术 2020/11/20 end --> |
| | | <div style="height:25px;">{Contract_Detail_Print_Date}</div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;">: </div> |
| | | <div style="height:25px;">: </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <!-- 电子签收ID号 wql 精琢技术 2020/11/20 start --> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;">{params.eSignAgencyNum}</div> |
| | | </template> |
| | | <template layout="none" if:true={params.salesRoot}> |
| | | <div style="height:25px;"> </div> |
| | | </template> |
| | | <!-- 电子签收ID号 wql 精琢技术 2020/11/20 end --> |
| | | <div style="height:25px;"> {params.offerPrintDateStringContract}</div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </template> |
| | | <br/> |
| | | |
| | | <!-- ページ内の詳細のREPEAT --> |
| | | <div class="detailCanvas" style="font-size: 10px"> |
| | | <lightning-datatable |
| | | key-field="id" |
| | | data={items} |
| | | columns = {columns}> |
| | | </lightning-datatable> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <!-- <template rendered="{!count=maxPageNumber}"> --> |
| | | <template rendered=false> |
| | | <div> |
| | | <table style="width:100%;"> |
| | | <tr> |
| | | <!-- 2018/10/11 CHAN-B5F35C 内贸时不显示 注册证号/备案凭证编号备注 start --> |
| | | <td style="text-align: left;"> |
| | | <div style="height:25px;">备注:上述产品注册证号/备案凭证号以收到实物中文标签中的注册证信息为准。</div> |
| | | </td> |
| | | <!-- 2018/10/11 CHAN-B5F35C 内贸时不显示 注册证号/备案凭证编号备注 end --> |
| | | </tr> |
| | | <tr> |
| | | <td style="width: 85%;text-align: right;"> |
| | | <div style="height:25px;">{Quote_TotalPrice}</div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;">: </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> |
| | | <span value={0, number, ###,##0.00}> |
| | | <param name="" value={params.newTotalPrice}> |
| | | </span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </template> |
| | | <!-- CHAN-B2L4NY 外贸询价的合同配置单格式恢复 --> |
| | | <!-- <template rendered="{!IF(params.trade == 'RMB', false, true)}"> --> |
| | | <template rendered={params.trade}> |
| | | <!-- 各ページのヘッダキャンバス --> |
| | | <div class="headerCanvas"> |
| | | <table style="height:100%;"> |
| | | <tr> |
| | | <td> |
| | | <div style="height:25px;"> |
| | | Prospect Code {Contract_Detail_System_Code}</div> |
| | | <div style="height:25px;">End user {Quote_Client_Name}</div> |
| | | <div style="height:25px;">Department {Quote_Department}</div> |
| | | <div style="height:25px;">The Buyer {Contract_Detail_Dealer_Name}</div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;">: </div> |
| | | <div style="height:25px;">: </div> |
| | | <div style="height:25px;">: </div> |
| | | <div style="height:25px;">: </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> {!params.quoteNo}</div> |
| | | <div style="height:25px;"> {!params.clientName}</div> |
| | | <div style="height:25px;"> {!params.departmentName}</div> |
| | | |
| | | <!-- <template if:true="{!IF(params.agentNameForContract != null && params.lenAgentName >= 40, true, false)}"> --> |
| | | <template> |
| | | <div style="height:22px; padding-top:3px; font-size:10px;"> {params.agentNameForContract}</div> |
| | | </template> |
| | | <!-- <template if:true="{!IF(params.agentNameForContract != null && params.lenAgentName < 40, true, false)}"> --> |
| | | <template> |
| | | <div style="height:25px;"> {params.agentNameForContract}</div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <table style="top:0px; right:0px; position:absolute; height:100%;"> |
| | | <tr> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <!-- --> |
| | | <div style="height:25px;">Print date {Contract_Detail_Print_Date}</div> |
| | | <div style="height:25px;"> ID Code</div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <!-- <div style="height:25px;"> </div> --> |
| | | <div style="height:25px;">: </div> |
| | | <div style="height:25px;">: </div> |
| | | </td> |
| | | <td> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> </div> |
| | | <div style="height:25px;"> {params.offerPrintDateStringContract}</div> |
| | | <div style="height:25px;"> </div> |
| | | </td> |
| | | </tr> |
| | | |
| | | </table> |
| | | </div> |
| | | |
| | | <br/> |
| | | |
| | | <!-- ページ内の詳細のREPEAT --> |
| | | <div class="detailCanvas"> |
| | | <!-- 2021/01/15 liying start --> |
| | | <!-- 多表头 第一列表头 --> |
| | | <lightning-datatable |
| | | key-field="id" |
| | | data={items} |
| | | columns = [columns]> |
| | | </lightning-datatable> |
| | | <!-- <apex:dataTable value="{!items}" var="item" id="dataTableUSD" styleClass="detailTableUSD" headerClass="detailTableHeaderUSD" columnClasses="detailTableCols"> |
| | | <apex:column styleClass="detailRowNumber"> |
| | | <apex:facet name="header">Commodity Type</apex:facet> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowString"> |
| | | <apex:facet name="header"></apex:facet> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowString"> |
| | | <apex:facet name="header"></apex:facet> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowString"> |
| | | <apex:facet name="header"> |
| | | Description</apex:facet> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowNumeric"> |
| | | <apex:facet name="header"> Quantity</apex:facet> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowNumeric"> |
| | | <apex:facet name="header"> Special Warranty Period(year) </apex:facet> |
| | | </apex:column> |
| | | |
| | | lt 20220223 CHAN-CBW9FX 特殊交货期影响的对应 start --> |
| | | <!-- |
| | | <apex:column styleClass="detailRowNumeric"> |
| | | <apex:facet name="header"> Delivery Date </apex:facet> |
| | | </apex:column> --> |
| | | <!-- lt 20220223 CHAN-CBW9FX 特殊交货期影响的对应 end --> |
| | | |
| | | <!-- </apex:dataTable> --> |
| | | <!-- 2021/01/15 liying end --> |
| | | <!-- 多表头 第二列表头 --> |
| | | <!-- <apex:dataTable value="{!items}" var="item" id="dataTable2" styleClass="detailTable" headerClass="detailTableHeader" columnClasses="detailTableCols"> |
| | | <apex:column styleClass="detailRowNumber"> |
| | | <apex:facet name="header">{Quote_Product_Code}</apex:facet> |
| | | <apex:outputText value="{!item.qli.Item_Order__c}"/> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowString"> |
| | | <apex:facet name="header"></apex:facet> |
| | | <apex:outputText value="{!item.qli.Asset_Model_No_forPrint__c}"/> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowString"> |
| | | <apex:facet name="header"> </apex:facet> |
| | | <apex:outputText value="{!item.qli.NameForPrintDelimiter__c}"/> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowString"> |
| | | <apex:facet name="header">{Quote_Product_Name}</apex:facet> |
| | | <apex:outputText value="{!item.qli.NameForPrint__c}"/> |
| | | </apex:column> |
| | | <apex:column styleClass="detailRowNumeric"> |
| | | <apex:facet name="header">{Quantity}</apex:facet> |
| | | <apex:outputText value="{0, number, ###,###}"> |
| | | <apex:param value="{!item.qli.Quantity}" /> |
| | | </apex:outputText> |
| | | </apex:column> |
| | | |
| | | <apex:column styleClass="detailRowNumeric"> |
| | | <apex:facet name="header">特殊保修年限</apex:facet> |
| | | <apex:outputText value="{!item.qli.GuaranteePeriod__c}"/> |
| | | </apex:column> |
| | | |
| | | lt 20220223 CHAN-CBW9FX 特殊交货期影响的对应 start --> |
| | | <!-- <apex:column styleClass="detailRowNumeric"> |
| | | <apex:facet name="header">交货期</apex:facet> |
| | | <apex:outputText value="{!item.qli.DeliveryDate__c}"/> |
| | | </apex:column> --> |
| | | <!-- lt 20220223 CHAN-CBW9FX 特殊交货期影响的对应 end --> |
| | | |
| | | <!-- </apex:dataTable> --> |
| | | </div> |
| | | </template> |
| | | |
| | | <br /> |
| | | |
| | | <!-- 各ページのフッタキャンバス --> |
| | | <div class="footerCanvasContract"> |
| | | <div class="footerSignContract"> |
| | | ({Contract_Detail_Buyer_Stamp})<br /> |
| | | <br /> |
| | | 年 月 日<br /> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!-- 各ページを区切る改ページ、最終ページには出さないようにしている --> |
| | | <!-- <template if:true="{!count<maxPageNumber}"> --> |
| | | <!-- <template> |
| | | <div style="page-break-after: always;"/> |
| | | </template> --> |
| | | |
| | | <!-- </body> --> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire } from 'lwc'; |
| | | import init from '@salesforce/apex/ContractdetailpdfController.init'; |
| | | const columns = [ |
| | | { label: 'Item_Order__c', fieldName: 'Item_Order__c' }, |
| | | { label: 'Asset_Model_No_forPrint__c', fieldName: 'Asset_Model_No_forPrint__c' }, |
| | | { label: 'NameForPrintDelimiter__c', fieldName: 'NameForPrintDelimiter__c' }, |
| | | { label: 'NameForPrint__c', fieldName: 'NameForPrint__c' }, |
| | | { label: 'ApprobationNo_c', fieldName: 'ApprobationNo_c' }, |
| | | { label: 'ProduceCompany_c', fieldName: 'ProduceCompany_c' }, |
| | | { label: 'SalesPackagingUnit_c', fieldName: 'SalesPackagingUnit_c' }, |
| | | { label: 'PackingListManual_c', fieldName: 'PackingListManual_c' }, |
| | | { label: 'qli.Quantity', fieldName: 'qli.Quantity' }, |
| | | { label: 'qli.GuaranteePeriod__c', fieldName: 'qli.GuaranteePeriod__c' }, |
| | | { label: 'qli.DeliveryDate__c', fieldName: 'qli.DeliveryDate__c', type: 'date' } |
| | | // { label: 'Website', fieldName: 'Asset_Model_No_forPrint__c', type: 'url' }, |
| | | // { label: 'Phone', fieldName: 'phone', type: 'phone' }, |
| | | // { label: 'Balance', fieldName: 'amount', type: 'currency' }, |
| | | // { label: 'CloseAt', fieldName: 'closeAt', type: 'date' }, |
| | | ]; |
| | | export default class lexContractdetailpdf extends LightningElement { |
| | | items = []; |
| | | data=[]; |
| | | Contract_Detail_Title="标题"; |
| | | columns=columns ; |
| | | params={ |
| | | trade:false, |
| | | PurchaseType:false |
| | | }; |
| | | connectedCallback() { |
| | | init().then(res=>{ |
| | | console.log("res:"); |
| | | console.log(res); |
| | | this.data=res; |
| | | this.items=res; |
| | | }) |
| | | } |
| | | generateData( amountOfRecords ) { |
| | | return [...Array(amountOfRecords)].map((_, index) => { |
| | | return { |
| | | name: `Name (${index})`, |
| | | website: 'www.salesforce.com', |
| | | amount: Math.floor(Math.random() * 100), |
| | | phone: `${Math.floor(Math.random() * 9000000000) + 1000000000}`, |
| | | closeAt: new Date( |
| | | Date.now() + 86400000 * Math.ceil(Math.random() * 20) |
| | | ), |
| | | }; |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexContractdetailpdf"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/otherButtonSpotInspectionReportCtl.init'; |
| | | |
| | | export default class LexCopyPIInspectionReport extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.CopyPI(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 复制 |
| | | CopyPI() { |
| | | window.location.href = '/' + this.Id + '/e?newclone=1'; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonOnCallCtl.init'; |
| | | |
| | | export default class LexCopyPIOnCall extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | |
| | | this.CopyPI(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | //复制 |
| | | CopyPI() { |
| | | window.location.href = '/' + this.Id + '/e?newclone=1'; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCopyRepair extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | Name; |
| | | DeliveredProductC; |
| | | DeliveredProductIdC; |
| | | PaperRepairRequestNoC; |
| | | HospitalC; |
| | | AccountC; |
| | | DepartmentClassC; |
| | | RepairCostTypeC; |
| | | DealerC; |
| | | InchargeStaffC; |
| | | InchargeStaffContactC; |
| | | SalesOfficeCodeSelectionC; |
| | | OnSiteRepairC; |
| | | workLocationSelectC; |
| | | ReturnsProductWayC; |
| | | RepairDetailC; |
| | | RepairApplicantC; |
| | | RepairApplicantHospitalC; |
| | | RepairApplicantDepartmentC; |
| | | DeliveryLogisticsModeC; |
| | | engineerSendDateC; |
| | | DeliveryLogisticsNoC; |
| | | DeliveryLogisticsAnnotationC; |
| | | DateReceiptQuestionsC; |
| | | BreakORFallOffC; |
| | | DelayReportReasonC; |
| | | UseFailProductFinishC; |
| | | ifDeadHurtC; |
| | | SupportingProductsC; |
| | | ProblemOccurredC; |
| | | AfterFailureInformationC; |
| | | InformationFromC; |
| | | ReportAdverseEventsC; |
| | | FailureQInHospitalC; |
| | | WhatProjectC; |
| | | OperationOrExaminationNameC; |
| | | MaintenanceContractTypeC; |
| | | FailureOccurrenceDateC; |
| | | RepairSourceC; |
| | | ProblemOccurredSelectC; |
| | | Delay15MinC; |
| | | ProductFailureRelatedC; |
| | | RepairSubOrderC; |
| | | OnCallIDC; |
| | | QISIDC; |
| | | InsReportC; |
| | | MBCAwareDateC; |
| | | CFDANoHandC; |
| | | ProduceCompanyHandC; |
| | | OfferRentalNewC; |
| | | ifRentalApplyC; |
| | | LatestCollectDatePriorityC; |
| | | RentalApplyEquipmentSetDetailIdC; |
| | | RentalApplyEquipmentSetDetailC; |
| | | AwareDateC; |
| | | OCSMAdministrativeReportNumberC; |
| | | OCSMAdministrativeReportStatusC; |
| | | OCSMAdministrativeReportDateC; |
| | | Status1C; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.Name = result.Name == undefined ? "" : result.Name; |
| | | this.DeliveredProductC = result.DeliveredProductC == undefined ? "" : result.DeliveredProductC; |
| | | this.PaperRepairRequestNoC = result.PaperRepairRequestNoC == undefined ? "" : result.PaperRepairRequestNoC; |
| | | this.HospitalC = result.HospitalC == undefined ? "" : result.HospitalC; |
| | | this.DepartmentClassC = result.DepartmentClassC == undefined ? "" : result.DepartmentClassC; |
| | | this.RepairCostTypeC = result.RepairCostTypeC == undefined ? "" : result.RepairCostTypeC; |
| | | this.DealerC = result.DealerC == undefined ? "" : result.DealerC; |
| | | this.InchargeStaffC = result.InchargeStaffC == undefined ? "" : result.InchargeStaffC; |
| | | this.InchargeStaffContactC = result.InchargeStaffContactC == undefined ? "" : result.InchargeStaffContactC; |
| | | this.SalesOfficeCodeSelectionC = result.SalesOfficeCodeSelectionC == undefined ? "" : result.SalesOfficeCodeSelectionC; |
| | | this.OnSiteRepairC = result.OnSiteRepairC == undefined ? "" : result.OnSiteRepairC; |
| | | this.workLocationSelectC = result.workLocationSelectC == undefined ? "" : result.workLocationSelectC; |
| | | this.ReturnsProductWayC = result.ReturnsProductWayC == undefined ? "" : result.ReturnsProductWayC; |
| | | this.RepairDetailC = result.RepairDetailC == undefined ? "" : result.RepairDetailC; |
| | | this.RepairApplicantC = result.RepairApplicantC == undefined ? "" : result.RepairApplicantC; |
| | | this.RepairApplicantHospitalC = result.RepairApplicantHospitalC == undefined ? "" : result.RepairApplicantHospitalC; |
| | | this.RepairApplicantDepartmentC = result.RepairApplicantDepartmentC == undefined ? "" : result.RepairApplicantDepartmentC; |
| | | this.DeliveryLogisticsModeC = result.DeliveryLogisticsModeC == undefined ? "" : result.DeliveryLogisticsModeC; |
| | | this.engineerSendDateC = result.engineerSendDateC == undefined ? "" : result.engineerSendDateC; |
| | | this.DeliveryLogisticsNoC = result.DeliveryLogisticsNoC == undefined ? "" : result.DeliveryLogisticsNoC; |
| | | this.DeliveryLogisticsAnnotationC = result.DeliveryLogisticsAnnotationC == undefined ? "" : result.DeliveryLogisticsAnnotationC; |
| | | this.DateReceiptQuestionsC = result.DateReceiptQuestionsC == undefined ? "" : result.DateReceiptQuestionsC; |
| | | this.BreakORFallOffC = result.BreakORFallOffC == undefined ? "" : result.BreakORFallOffC; |
| | | this.DelayReportReasonC = result.DelayReportReasonC == undefined ? "" : result.DelayReportReasonC; |
| | | this.UseFailProductFinishC = result.UseFailProductFinishC == undefined ? "" : result.UseFailProductFinishC; |
| | | this.ifDeadHurtC = result.ifDeadHurtC == undefined ? "" : result.ifDeadHurtC; |
| | | this.SupportingProductsC = result.SupportingProductsC == undefined ? "" : result.SupportingProductsC; |
| | | this.ProblemOccurredC = result.ProblemOccurredC == undefined ? "" : result.ProblemOccurredC; |
| | | this.AfterFailureInformationC = result.AfterFailureInformationC == undefined ? "" : result.AfterFailureInformationC; |
| | | this.InformationFromC = result.InformationFromC == undefined ? "" : result.InformationFromC; |
| | | this.ReportAdverseEventsC = result.ReportAdverseEventsC == undefined ? "" : result.ReportAdverseEventsC; |
| | | this.FailureQInHospitalC = result.FailureQInHospitalC == undefined ? "" : result.FailureQInHospitalC; |
| | | this.WhatProjectC = result.WhatProjectC == undefined ? "" : result.WhatProjectC; |
| | | this.OperationOrExaminationNameC = result.OperationOrExaminationNameC == undefined ? "" : result.OperationOrExaminationNameC; |
| | | this.MaintenanceContractTypeC = result.MaintenanceContractTypeC == undefined ? "" : result.MaintenanceContractTypeC; |
| | | this.FailureOccurrenceDateC = result.FailureOccurrenceDateC == undefined ? "" : result.FailureOccurrenceDateC; |
| | | this.RepairSourceC = result.RepairSourceC == undefined ? "" : result.RepairSourceC; |
| | | this.ProblemOccurredSelectC = result.ProblemOccurredSelectC == undefined ? "" : result.ProblemOccurredSelectC; |
| | | this.Delay15MinC = result.Delay15MinC == undefined ? "" : result.Delay15MinC; |
| | | this.ProductFailureRelatedC = result.ProductFailureRelatedC == undefined ? "" : result.ProductFailureRelatedC; |
| | | this.RepairSubOrderC = result.RepairSubOrderC == undefined ? "" : result.RepairSubOrderC; |
| | | this.OnCallIDC = result.OnCallIDC == undefined ? "" : result.OnCallIDC; |
| | | this.QISIDC = result.QISIDC == undefined ? "" : result.QISIDC; |
| | | this.InsReportC = result.InsReportC == undefined ? "" : result.InsReportC; |
| | | this.MBCAwareDateC = result.MBCAwareDateC == undefined ? "" : result.MBCAwareDateC; |
| | | this.CFDANoHandC = result.CFDANoHandC == undefined ? "" : result.CFDANoHandC; |
| | | this.ProduceCompanyHandC = result.ProduceCompanyHandC == undefined ? "" : result.ProduceCompanyHandC; |
| | | this.OfferRentalNewC = result.OfferRentalNewC == undefined ? "" : result.OfferRentalNewC; |
| | | this.ifRentalApplyC = result.ifRentalApplyC == undefined ? "" : result.AifRentalApplyCccountC; |
| | | this.LatestCollectDatePriorityC = result.LatestCollectDatePriorityC == undefined ? "" : result.LatestCollectDatePriorityC; |
| | | this.RentalApplyEquipmentSetDetailIdC = result.RentalApplyEquipmentSetDetailIdC == undefined ? "" : result.RentalApplyEquipmentSetDetailIdC; |
| | | this.RentalApplyEquipmentSetDetailC = result.RentalApplyEquipmentSetDetailC == undefined ? "" : result.RentalApplyEquipmentSetDetailC; |
| | | this.AwareDateC = result.AwareDateC == undefined ? "" : result.AwareDateC; |
| | | this.OCSMAdministrativeReportNumberC = result.OCSMAdministrativeReportNumberC == undefined ? "" : result.OCSMAdministrativeReportNumberC; |
| | | this.OCSMAdministrativeReportStatusC = result.OCSMAdministrativeReportStatusC == undefined ? "" : result.OCSMAdministrativeReportStatusC; |
| | | this.AccountC = result.AccountC == undefined ? "" : result.AccountC; |
| | | this.OCSMAdministrativeReportDateC = result.OCSMAdministrativeReportDateC == undefined ? "" : result.OCSMAdministrativeReportDateC; |
| | | this.Status1C = result.Status1C; |
| | | |
| | | this.CopyRepair(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 复制 |
| | | CopyRepair() { |
| | | var Status = this.Status1C; |
| | | if (Status == '0.删除' || Status == '0.取消') { |
| | | var url = "/a0J/e?00N10000009H2fa=" + this.Name + "&CF00N10000002Dx1X=" + this.DeliveredProductC + |
| | | "&CF00N10000002Dx1X_lkid=" + this.DeliveredProductC + "&00N10000006P1dw=" + this.PaperRepairRequestNoC + |
| | | "&CF00N10000002Dx66=" + this.HospitalC + "&CF00N10000002Dx5t=" + this.DepartmentClassC + |
| | | "&CF00N10000002Dx5n=" + this.AccountC + "&00N10000008rG4p=" + this.RepairCostTypeC + |
| | | "&CF00N10000006P1eV=" + this.DealerC + "&CF00N10000002EMHw=" + this.InchargeStaffC + |
| | | "&CF00N10000005HDvq=" + this.InchargeStaffContactC + "&00N10000006P6SM=" + this.SalesOfficeCodeSelectionC + |
| | | "&00N10000002F6dW=" + this.OnSiteRepairC + "&00N10000006P6Rn=" + this.workLocationSelectC + |
| | | "&00N10000009i1Z2=" + this.ReturnsProductWayC + "&00N10000002Dx6I=" + this.RepairDetailC + |
| | | "&00N10000009H1rQ=" + this.RepairApplicantC + "&00N10000009H1rP=" + this.RepairApplicantHospitalC + |
| | | "&00N10000009H1rO=" + this.RepairApplicantDepartmentC + "&00N10000009H1rB=" + this.DeliveryLogisticsModeC + |
| | | "&00N10000009H1rk=" + this.engineerSendDateC + "&00N10000009H1rC=" + this.DeliveryLogisticsNoC + |
| | | "&00N10000009H1rA=" + this.DeliveryLogisticsAnnotationC + "&00N10000008rsVQ=" + this.DateReceiptQuestionsC + |
| | | "&00N10000008rsVN=" + this.BreakORFallOffC + "&00N10000008rsVS=" + this.DelayReportReasonC + |
| | | "&00N10000008rsW5=" + this.UseFailProductFinishC + "&00N10000008rsW7=" + this.ifDeadHurtC + |
| | | "&00N10000008rsW4=" + this.SupportingProductsC + "&00N10000008rsVv=" + this.ProblemOccurredC + |
| | | "&00N10000008rsVL=" + this.AfterFailureInformationC + "&00N10000009hsvI=" + this.ProblemOccurredSelectC + |
| | | "&00N10000008rsVR=" + this.Delay15MinC + "&00N10000008rsVw=" + this.ProductFailureRelatedC + |
| | | "&00N10000008rsVZ=" + this.InformationFromC + "&00N10000008rsW2=" + this.ReportAdverseEventsC + |
| | | "&00N10000008rsVT=" + this.FailureQInHospitalC + "&00N10000008rsW6=" + this.WhatProjectC + |
| | | "&00N10000008rsVk=" + this.OperationOrExaminationNameC + "&00N10000008rWce=" + this.MaintenanceContractTypeC + |
| | | "&00N10000002Dx5y=" + this.FailureOccurrenceDateC + "&00N10000002FH86=" + this.RepairSourceC + |
| | | "&CF00N10000009H1rR=" + this.RepairSubOrderC + "&CF00N10000002FIJU=" + this.OnCallIDC + |
| | | "&CF00N10000002FIJZ=" + this.QISIDC + "&CF00N10000006PRCp=" + this.InsReportC + |
| | | "&00N10000008rsVM=" + this.AwareDateC + "&00N10000009GmI6=" + this.OCSMAdministrativeReportNumberC + |
| | | "&00N10000009GmI4=" + this.MBCAwareDateC + "&00N10000009GmI5=" + this.OCSMAdministrativeReportDateC + |
| | | "&00N10000009GmI7=" + this.OCSMAdministrativeReportStatusC + "&00N100000095siE=" + this.CFDANoHandC + |
| | | "&00N100000095shz=" + this.ProduceCompanyHandC + "&00N100000098PV9=" + this.OfferRentalNewC + |
| | | "&00N100000098PVA=" + this.ifRentalApplyC + "&00N10000006gZ4g=" + this.LatestCollectDatePriorityC + |
| | | "&00N10000007MNFW=" + this.RentalApplyEquipmentSetDetailIdC + |
| | | "&CF00N10000007MNFX=" + this.RentalApplyEquipmentSetDetailC + "&retURL=%2F" + this.Id; |
| | | window.open(url); |
| | | } else { |
| | | this.ShowToastEvent("该状态下不能复制", "error") |
| | | // alert("该状态下不能复制"); |
| | | } |
| | | } |
| | | |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="lexCreateEventReportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 13:50:23 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-13 14:39:54 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForCreateEventButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCreateEvent extends LightningElement { |
| | | @api recordId; |
| | | accountId; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.accountId = result.accountId; |
| | | this.createEvent(); |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }) |
| | | } |
| | | createEvent(){ |
| | | window.open("/00U/e?retURL=%2Fapex%2FVFClosePage&accid=" + this.accountId + "&oid=" + this.recordId, "新建计划"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .createEmailHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="createEmailHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 13:53:40 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-10 14:22:27 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/MonthlyReportController.initForCreateNoteEmailButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | |
| | | export default class LexCreateNotesEmail extends LightningElement { |
| | | @api recordId; |
| | | ownerEmail; |
| | | ownerAlias; |
| | | keyIssue; |
| | | feedBack; |
| | | taskFollow; |
| | | otherIssue; |
| | | nextWeekPlan; |
| | | drSumUrl; |
| | | IsLoading = true; |
| | | url; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerEmail = result.ownerEmail; |
| | | this.ownerAlias = result.ownerAlias; |
| | | this.keyIssue = result.keyIssue; |
| | | this.feedBack = result.feedBack; |
| | | this.taskFollow = result.taskFollow; |
| | | this.otherIssue = result.otherIssue; |
| | | this.nextWeekPlan = result.nextWeekPlan; |
| | | this.drSumUrl = result.drSumUrl; |
| | | this.userEmail = result.userEmail; |
| | | this.createEmail(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | createEmail() { |
| | | console.log("start"); |
| | | |
| | | window.location.href = ("mailto:" |
| | | + this.ownerEmail |
| | | +"?bcc=" |
| | | + this.userEmail |
| | | +"&subject=【周报:" |
| | | + this.ownerAlias |
| | | + "】" + "&body=先生/女士" + "%0D%0A" + "%0D%0A" + "主要报告事项:" |
| | | + this.keyIssue |
| | | +"%0D%0A" + "下属事项/状态报告:" |
| | | + this.feedBack |
| | | +"%0D%0A" + "课题及对应结果/提案:" |
| | | + this.taskFollow |
| | | +"%0D%0A" + "其他事项:" |
| | | + this.otherIssue |
| | | +"%0D%0A" + "下周计划:" |
| | | + this.nextWeekPlan |
| | | +"%0D%0A" + "连接:" |
| | | + this.drSumUrl |
| | | +"%0D%0A").substring(0,320).split("<br>").join("%0D%0A"); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .createEmailHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="createEmailHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/QISReportController.initForlexCreateRepairButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | export default class lexCreateRepair extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | typeflag = false; |
| | | newflag = false; |
| | | qisReportId=''; |
| | | name=''; |
| | | qisRecordTypeId=''; |
| | | err=''; |
| | | accParentId=''; |
| | | accParentRecordTypeId=''; |
| | | accParentParentFSEGIMainLeader=''; |
| | | accParentParentFSEGIMainLeaderWorkLocation=''; |
| | | accParentParentFSESPMainLeader=''; |
| | | accParentParentFSESPMainLeaderWorkLocation=''; |
| | | WorkLocation=''; |
| | | accrecordId=''; |
| | | oCMjudgement=''; |
| | | nextaction=''; |
| | | specialfollow=''; |
| | | comment=''; |
| | | isUsedForTheOpera=''; |
| | | UseFailProductFinish=''; |
| | | failuerSituation=''; |
| | | sourceOnCall=''; |
| | | hospitalId=''; |
| | | departmentClassId=''; |
| | | hospitalDepartment=''; |
| | | nonyushohinId=''; |
| | | ownerId=''; |
| | | faliourdate=''; |
| | | sourceforrepair=''; |
| | | repairSalesPointProvinceChina=''; |
| | | trableoccurdaYcollect=''; |
| | | damageForDocOrPat=''; |
| | | relationWithTheProblem=''; |
| | | reportForGoz=''; |
| | | whichProject=''; |
| | | operaName=''; |
| | | breakORFallOff=''; |
| | | setusageproduct=''; |
| | | afterFailureInformation=''; |
| | | delay15Min=''; |
| | | informationFrom=''; |
| | | failureQInHospital=''; |
| | | ownername=''; |
| | | hospitalname = ''; |
| | | departmentClassname = ''; |
| | | hospitalDepartmentname = ''; |
| | | nonyushohinIdname = ''; |
| | | sourceOnCallname = ''; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.qisReportId = result.Id; |
| | | this.oCMjudgement = result.oCMjudgement; |
| | | this.nextaction = result.nextaction; |
| | | this.ownername = result.ownername; |
| | | this.specialfollow = result.specialfollow; |
| | | this.qisRecordTypeId = result.qisRecordTypeId; |
| | | this.accParentId = result.accParentId; |
| | | this.comment = result.comment; |
| | | if (result.sourceOnCall!=null) { |
| | | this.sourceOnCall = result.sourceOnCall; |
| | | this.sourceOnCallname = result.sourceOnCallname; |
| | | } |
| | | this.name = result.name; |
| | | this.hospitalId = result.hospitalId; |
| | | this.hospitalname = result.hospitalname; |
| | | this.departmentClassname = result.departmentClassname; |
| | | this.departmentClassId = result.departmentClassId; |
| | | this.hospitalDepartment = result.hospitalDepartment; |
| | | this.nonyushohinId = result.nonyushohinId; |
| | | this.ownerId = result.ownerId; |
| | | this.faliourdate = result.faliourdate; |
| | | this.sourceforrepair = result.sourceforrepair; |
| | | this.repairSalesPointProvinceChina = result.repairSalesPointProvinceChina; |
| | | this.trableoccurdaYcollect = result.trableoccurdaYcollect; |
| | | this.damageForDocOrPat = result.damageForDocOrPat; |
| | | this.relationWithTheProblem = result.relationWithTheProblem; |
| | | this.reportForGoz = result.reportForGoz; |
| | | this.whichProject = result.whichProject; |
| | | this.operaName = result.operaName; |
| | | this.breakORFallOff = result.breakORFallOff; |
| | | this.setusageproduct = result.setusageproduct; |
| | | this.afterFailureInformation = result.afterFailureInformation; |
| | | this.delay15Min = result.delay15Min; |
| | | this.informationFrom = result.informationFrom; |
| | | this.failureQInHospital = result.failureQInHospital; |
| | | this.failuerSituation = result.failuerSituation; |
| | | this.isUsedForTheOpera = result.isUsedForTheOpera; |
| | | this.accParentRecordTypeId = result.accParentRecordTypeId; |
| | | this.accParentParentFSEGIMainLeader = result.accParentParentFSEGIMainLeader; |
| | | this.accParentParentFSEGIMainLeaderWorkLocation = result.accParentParentFSEGIMainLeaderWorkLocation; |
| | | this.accParentParentFSESPMainLeader = result.accParentParentFSESPMainLeader; |
| | | this.accParentParentFSESPMainLeaderWorkLocation = result.accParentParentFSESPMainLeaderWorkLocation; |
| | | if (this.qisRecordTypeId != '01210000000RLWc' && this.qisRecordTypeId != '01210000000RLWh') { |
| | | this.typeflag = true; |
| | | } |
| | | if (this.accParentId != null) { |
| | | if (this.accParentRecordTypeId != null) { |
| | | this.accrecordId = this.accParentRecordTypeId.substring(0,15); |
| | | if (this.accrecordId == '01210000000QemL' || this.accrecordId == '01210000000QezZ' || this.accrecordId == '01210000000QemQ') { |
| | | if (this.accParentParentFSEGIMainLeader != null) { |
| | | this.WorkLocation = this.accParentParentFSEGIMainLeaderWorkLocation; |
| | | } |
| | | }else if(this.accrecordId == '01210000000Qeze' || this.accrecordId == '01210000000Qezj' || this.accrecordId == '01210000000Qezt'|| this.accrecordId == '01210000000Qezo'|| this.accrecordId == '01210000000Qezy'){ |
| | | if (this.accParentParentFSESPMainLeader != null) { |
| | | this.WorkLocation = this.accParentParentFSESPMainLeaderWorkLocation; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if ((this.oCMjudgement == '质量问题' && this.nextaction == '无偿维修') || |
| | | (this.oCMjudgement == '质量问题' && this.nextaction == '有偿维修' && this.specialfollow == '0') || |
| | | (this.oCMjudgement == '非质量问题' && this.nextaction == '无偿维修' && this.specialfollow == '1') || |
| | | (this.oCMjudgement == '非质量问题' && this.nextaction == '有偿维修' && this.specialfollow == '0') || |
| | | (this.oCMjudgement == '质量问题+非质量问题' && this.nextaction == '无偿维修' && this.specialfollow == '1') || |
| | | (this.oCMjudgement == '质量问题+非质量问题' && this.nextaction == '有偿维修+无偿维修' && this.specialfollow == '0') || |
| | | (this.oCMjudgement == '现象未发现' && this.nextaction == '无偿维修' && this.specialfollow == '1') || |
| | | (this.oCMjudgement == '现象未发现' && this.nextaction == '有偿维修' && this.specialfollow == '0')) { |
| | | this.newflag = true; |
| | | } |
| | | console.log('this.newflag = '+this.newflag); |
| | | console.log('this.typeflag = '+this.typeflag); |
| | | if ( this.newflag && this.typeflag) { |
| | | if (this.isUsedForTheOpera == 'YES') { |
| | | this.UseFailProductFinish = '是'; |
| | | }else if(this.isUsedForTheOpera == 'NO-用替代品完成了'){ |
| | | this.UseFailProductFinish = '否-用替代品完成'; |
| | | }else if(this.isUsedForTheOpera == 'NO-用其他公司的同类产品完成了'){ |
| | | this.UseFailProductFinish = '否-用其他公司的同类产品完成'; |
| | | }else if(this.isUsedForTheOpera == 'NO-手术中止'){ |
| | | this.UseFailProductFinish = '否-手术中止'; |
| | | } |
| | | if ('使用前准备' == this.failuerSituation) { |
| | | this.failuerSituation = '使用前准备-患者未麻醉'; |
| | | } |
| | | var url = ''; |
| | | url = "/a0J/e?" + |
| | | "CF00N10000002FIJU_lkid="+this.sourceOnCall+"&" + |
| | | "CF00N10000002FIJU="+this.sourceOnCallname+"&" + |
| | | "CF00N10000002FIJZ_lkid="+this.qisReportId+"&" + |
| | | "CF00N10000002FIJZ="+this.name+"&" + |
| | | "CF00N10000002Dx66_lkid="+this.hospitalId+"&" + |
| | | "CF00N10000002Dx66="+this.hospitalname+"&" + |
| | | "CF00N10000002Dx5t_lkid="+this.departmentClassId+"&" + |
| | | "CF00N10000002Dx5t="+this.departmentClassname+"&" + |
| | | "CF00N10000002Dx5n_lkid="+this.hospitalDepartment+"&" + |
| | | "CF00N10000002Dx5n="+this.hospitalDepartmentname+"&" + |
| | | "CF00N10000002Dx1X_lkid="+this.nonyushohinId+"&" + |
| | | "CF00N10000002Dx1X="+this.nonyushohinIdname+"&" + |
| | | "CF00N10000002EMHw_lkid="+this.ownerId+"&" + |
| | | "CF00N10000002EMHw="+this.ownername+"&" + |
| | | "00N10000002Dx5y="+this.faliourdate+"&" + |
| | | "00N10000002Dx6I="+this.comment+"&" + |
| | | "00N10000002FH86="+this.sourceforrepair+"&" + |
| | | "00N10000006P6Rn="+this.repairSalesPointProvinceChina+"&" + |
| | | "00N10000008rsVQ="+this.trableoccurdaYcollect+"&" + |
| | | "00N10000008rsW7="+this.damageForDocOrPat+"&"+ |
| | | "00N10000008rsVw="+this.relationWithTheProblem+"&"+ |
| | | "00N10000008rsW2="+this.reportForGoz+"&"+ |
| | | "00N10000008rsW6="+this.whichProject+"&"+ |
| | | "00N10000008rsVk="+this.operaName+"&" + |
| | | "00N10000008rsVN="+this.breakORFallOff+"&"+ |
| | | "00N10000008rsW4="+this.setusageproduct+"&" + |
| | | "00N10000008rsVL="+this.afterFailureInformation+"&" + |
| | | "00N10000008rsVR="+this.delay15Min+"&"+ |
| | | "00N10000008rsVZ="+this.informationFrom+"&"+ |
| | | "00N10000008rsVT="+this.failureQInHospital+"&" + |
| | | "00N10000008rsVv="+this.failuerSituation+"&"+ |
| | | "00N10000008rsW5="+this.UseFailProductFinish+ "&" + |
| | | "00N10000006P6SM="+this.WorkLocation+ "&" + |
| | | "retURL=%2F"+this.qisReportId; |
| | | window.open(url, "_blank"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | const evt = new ShowToastEvent({ |
| | | title : '该QIS不能新建修理', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | }).catch(error => { |
| | | |
| | | const evt = new ShowToastEvent({ |
| | | title : '发生错误', |
| | | message: '', |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | console.log('error='+error); |
| | | return; |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCreateRepair"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | |
| | | export default class LexCreateReportMaintenanceContract extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeDeveloperNameC; |
| | | EstimateTargetC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | | this.EstimateTargetC = result.EstimateTargetC; |
| | | |
| | | this.CreateReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 制作报告书 |
| | | CreateReport() { |
| | | var MaintenanceContractId = this.Id; |
| | | var RecordTypeName = this.RecordTypeDeveloperNameC; |
| | | var EstimateTarget = this.EstimateTargetC; |
| | | |
| | | var url = ''; |
| | | if (EstimateTarget == "经销商" && (RecordTypeName == "NewMaintenance_Contract" || RecordTypeName == "VM_Contract")) { |
| | | url = "/apex/MoreMaintenanceContractPop?Id=" + MaintenanceContractId + "&RecordTypeName=" + RecordTypeName; |
| | | } else { |
| | | url = "http://powerbi.olympus.com.cn/Home/Login"; |
| | | } |
| | | window.open(url, '_bank'); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import selectMaintenanceContractEstimate from '@salesforce/apex/otherButtonMaintenanceContractCtl.selectMaintenanceContractEstimate'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCustomAnewMaintenance extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | StatusC; |
| | | RecordTypeId; |
| | | URFContractC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.StatusC = result.StatusC; |
| | | this.URFContractC = result.URFContractC; |
| | | |
| | | this.CustomAnew(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | //中止 |
| | | CustomAnew() { |
| | | if (this.StatusC != "引合中") { |
| | | this.ShowToastEvent("维修合同不是询价中的状态,不能再报价", "error") |
| | | // alert("维修合同不是询价中的状态,不能再报价"); |
| | | } else { |
| | | init().then(result => { |
| | | if (result.length == 1) { |
| | | if (this.RecordTypeId == "01210000000gTYq") { |
| | | //URF限次合同2期 LY 20220902 start |
| | | if (this.URFContractC == true) { |
| | | window.open("/apex/SelectAssetEstimateURF?copyid=" + ids[0], "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimateVM?copyid=" + ids[0], "_top"); |
| | | } |
| | | //URF限次合同2期 LY 20220902 end |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?copyid=" + ids[0], "_top"); |
| | | } |
| | | |
| | | } else { |
| | | this.ShowToastEvent('请选择一个报价', "error") |
| | | // alert('请选择一个报价'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .createEmailHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="createEmailHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/CaseController.initForlexCustomCloneButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | export default class lexCustomClone extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | inquirydetail; |
| | | answerdetailcontent; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.inquirydetail = result.inquirydetail; |
| | | this.answerdetailcontent = result.answerdetailcontent; |
| | | var url = "/500/e?retURL="+this.recordId+"&RecordType=01210000000QsYp&ent=Case"+ |
| | | "&00N10000003M4vA="+this.inquirydetail+ |
| | | "&00N10000003M4v8="+this.answerdetailcontent; |
| | | window.open(url); |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCustomClone"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonRepairController.init'; |
| | | import selectCustomDeleteById from '@salesforce/apex/otherButtonRepairController.selectCustomDeleteById'; |
| | | import deleteRepair from '@salesforce/apex/otherButtonRepairController.deleteRepair'; |
| | | |
| | | |
| | | export default class LexCustomDelete extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | userID; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.userID = result.userID; |
| | | |
| | | this.CustomDelete(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 删除 |
| | | CustomDelete() { |
| | | selectCustomDeleteById({ |
| | | recordId: this.Id |
| | | }).then(repList => { |
| | | if (repList != null && repList.length > 0) { |
| | | var rp = repList[0]; |
| | | if (rp.Status__c != "草案中" && |
| | | rp.Status__c != "1.受理完毕(SAP待发送)" && |
| | | rp.Status__c != "4.修理品返送阶段" |
| | | ) { |
| | | alert("不是草案中,不能删除"); |
| | | } else if (rp.Status__c == "4.修理品返送阶段" && |
| | | (rp.SAP_Transfer_time__c != "" || rp.Repair_Ordered_Date__c != "") |
| | | ) { |
| | | alert("已经发送过SAP,不能删除"); |
| | | } else if (this.userID.substring(0, 15) != rp.CreatedById.substring(0, 15) && this.userID.substring(0, 15) != rp.Acc_OwnerId__c.substring(0, 15) && this.userID.substring(0, 15) != rp.FSE_ownerid__c.substring(0, 15)) { |
| | | alert("不是所有人、创建人或FSE主负责人,不能删除"); |
| | | } else { |
| | | if (confirm("是否确定?")) { |
| | | deleteRepair({ |
| | | rid: rp.Id |
| | | }).then(rtn => { |
| | | if (rtn == "OK") { |
| | | window.location.href = "/a0J/o"; |
| | | } else { |
| | | alert(rtn); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, api, track, wire } from 'lwc'; |
| | | import init from '@salesforce/apex/lexCustomDeleteController.initForCustomDelete'; |
| | | import {CurrentPageReference} from 'lightning/navigation' |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import deleteRepair from '@salesforce/apex/ControllerUtil.deleteRepair'; |
| | | |
| | | export default class lexCustomDeleteLWC extends LightningElement { |
| | | |
| | | |
| | | @api recordId; |
| | | @api message; |
| | | |
| | | @track Status ; |
| | | @track FSE ; |
| | | @track SAP; |
| | | @track cre ; |
| | | @track Rep ; |
| | | @track acc ; |
| | | @track fSE ; |
| | | @track id; |
| | | @track rtn; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urlValue=currentPageReference.state.recordId; |
| | | if(urlValue){ |
| | | let str='${urlValue}'; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId:this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.FSE=result.FSEApplyForRepairtime; |
| | | this.Rep=result.Rep; |
| | | this.SAP=result.SAP; |
| | | this.Status=result.Status; |
| | | this.acc=result.acc; |
| | | this.id=result.Id; |
| | | this.cre=result.cre; |
| | | this.fSE=result.FSEownerId; |
| | | console.log("end"); |
| | | this.handleDeleteAction(); |
| | | console.log("end2"); |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | handleDeleteAction(){ |
| | | if (this.Status != null && this.Status.length > 0) { |
| | | if (this.Status != "草案中"&& this.Status != "1.受理完毕(SAP待发送)"&& this.Status != "4.修理品返送阶段") { |
| | | this.message = "不是草案中,不能删除"; |
| | | const event = new ShowToastEvent({ |
| | | title: 'error', |
| | | variant:'error', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else if (this.Status == "0.申请完毕"&& (this.FSE != "")) { |
| | | message = "FSE已经申请,不能删除"; |
| | | console.log('***action4'); |
| | | |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else if (this.Status == "4.修理品返送阶段"&& (this.SAP != "" || this.Rep!= "")){ |
| | | message = "已经发送过SAP,不能删除"; |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else if (UserInfo_Owner.Id.substring(0,15) != this.cre.substring(0,15) && UserInfo_Owner.Id.substring(0,15) != this.acc.substring(0,15)&& UserInfo_Owner.Id.substring(0,15) != this.fSE.substring(0,15)) { |
| | | message = "不是所有人、创建人或FSE主负责人,不能删除"; |
| | | const event = new ShowToastEvent({ |
| | | title: 'warning', |
| | | message: |
| | | this.message, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | else { |
| | | |
| | | // sforce.connection.sessionId = '{!$Api.Session_ID}'; |
| | | // var rtn=sforce.apex.execute("ControllerUtil","deleteRepair",{rid:this.id}); |
| | | deleteRepair({ |
| | | rid:this.id |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.rtn=result; |
| | | } |
| | | }) |
| | | |
| | | if (this.rtn == "OK") { |
| | | reload(); |
| | | } else { |
| | | alert(this.rtn); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | function reload(){ |
| | | var str=""; |
| | | if(getParam('retURL')!==null){ |
| | | str +=getParam('retURL'); |
| | | } |
| | | window.open(str,'_self'); |
| | | } |
| | | |
| | | function getParam(paramName) { |
| | | paramValue = "", isFound = !1; |
| | | if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { |
| | | arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0; |
| | | while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++ |
| | | } |
| | | return paramValue == "" && (paramValue = null), paramValue |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="customDelete"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCustomNewCopy2 extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | notRenewC; |
| | | Name; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.notRenewC = result.notRenewC; |
| | | this.Name = result.Name; |
| | | |
| | | this.CustomNewCopy2(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 继续新服务合同 |
| | | CustomNewCopy2() { |
| | | if (this.notRenewC) { |
| | | this.ShowToastEvent("请联系服务商品部!", "error"); |
| | | // alert("请联系服务商品部!"); |
| | | } else { |
| | | window.open("/" + this.Id + "/e?clone=1&Name=&00N10000002Dx5D=&00N10000002Dx5S=%e5%bc%95%e5%90%88%e4%b8%ad&00NO00000010sDc=&CF00NO00000010hyI=&CF00NO00000010hyI_lkid=&CF00NO00000010hyX=&CF00NO00000010hyX_lkid=&CF00NO00000010hyN=&CF00NO00000010hyN_lkid=&RecordType=01210000000gTYq&00N10000002pmOp=&00N10000006gZDd=&00N10000006gZDe=&00NO00000010hy4=&00N10000002Dx4j=&00N10000002Dx4m=&00N10000002Dx4w=&00N10000002Dx4k=&00N10000002Dx5J=&00N10000002Dx5M=&00N10000002Dx4i=&00N10000002Dx4h=&00N10000002Dx5K=&00N10000003OXdT=&00N100000048zfn=&00N10000002FMsq=&00N10000003OlGF=&00N10000002Dx4r=&00N100000047AY1=&00N100000047AYB=&00N100000047AY6=&00N10000003PCeB=&00N10000005HBNe=&00N10000006plAl=&00N10000002Dx5C=&retURL=%2F" + this.Id + "&saveURL=%2Fapex/SaveMaintenanceByCopy?mid=" + this.Id + "&CF00N100000048Paw=" + this.Name + "&CF00N100000048Paw_lkid=" + this.Id, "_blank"); |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | |
| | | export default class LexCustomNewMCMaintenance extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | StatusC; |
| | | IsRecognitionModelC; |
| | | RecordTypeId; |
| | | URFContractC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | this.IsRecognitionModelC = result.IsRecognitionModelC; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | this.URFContractC = result.URFContractC; |
| | | |
| | | this.CustomNewMC(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建新服务合同报价 |
| | | CustomNewMC() { |
| | | if ( this.StatusC != "引合中") { |
| | | alert("维修合同不是询价中的状态,不能新建报价"); |
| | | } else { |
| | | //维修合同新建报价时,如果是先款对象,弹出对话框提示 thh 20220304 start |
| | | if (this.IsRecognitionModelC == 1) { |
| | | if (!confirm("该经销商为先款对象,是否继续新建报价?")) { |
| | | return; |
| | | } |
| | | } |
| | | //维修合同新建报价时,如果是先款对象,弹出对话框提示 thh 20220304 end |
| | | if (this.RecordTypeId == "01210000000gTYq") { |
| | | if (this.URFContractC == "0") { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimateURF?mcid=" + this.Id, "_top"); |
| | | } |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | | |
| | | export default class LexCustomNewMaintenance extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | StatusC; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.StatusC = result.StatusC; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.CustomNew(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | } |
| | | |
| | | // 新建维修合同报价 |
| | | CustomNew() { |
| | | if (this.StatusC != "引合中") { |
| | | this.ShowToastEvent("维修合同不是询价中的状态,不能新建报价", "error"); |
| | | // alert("维修合同不是询价中的状态,不能新建报价"); |
| | | } else { |
| | | if (this.RecordTypeId == "01210000000gTYq") { |
| | | window.open("/apex/SelectAssetEstimateVM?mcid=" + this.Id, "_top"); |
| | | } else { |
| | | window.open("/apex/SelectAssetEstimate?mcid=" + this.Id, "_top"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="Holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api, track, wire } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import getUserId from '@salesforce/apex/RentalApplyControllerLWT.getUserId'; |
| | | import init from '@salesforce/apex/SelectSubstituteControllerLWT.initFromCustomSubmitButton'; |
| | | import updateRaesc from '@salesforce/apex/SelectSubstituteControllerLWT.updateRaesc'; |
| | | import selectRacById from '@salesforce/apex/SelectSubstituteControllerLWT.selectRacById'; |
| | | import postponeCheck from '@salesforce/apex/SelectSubstituteControllerLWT.postponeCheck'; |
| | | |
| | | import { loadScript } from 'lightning/platformResourceLoader'; |
| | | import { submitForApproval } from 'lightning/uiRecordApi'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexCustomSubmit extends LightningElement { |
| | | |
| | | @api recordId; |
| | | id; |
| | | RentalApplyId; |
| | | Status; |
| | | IsLoading=true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({recordId:this.recordId}).then(result=>{ |
| | | console.log(result); |
| | | if(result!=null){ |
| | | this.Rental_Apply_Equipment_Set__c=result; |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | }).catch(err=>{ |
| | | console.log("error:"); |
| | | console.log(err); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | async cancelSubmit(){ |
| | | console.log("hhh1"); |
| | | if (this.Rental_Apply_Equipment_Set__c.Request_extend_day__c == "" |
| | | || this.Rental_Apply_Equipment_Set__c.Request_extend_day__c == null |
| | | || this.Rental_Apply_Equipment_Set__c.Extend_request_reason__c == "" |
| | | || this.Rental_Apply_Equipment_Set__c.Extend_request_reason__c == null) { |
| | | // alert("必须填写延期希望结束日,延期申请理由"); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:"必须填写延期希望结束日,延期申请理由" |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | } |
| | | console.log("hhh2"); |
| | | let rtn; |
| | | await postponeCheck({ |
| | | endDate:this.Rental_Apply_Equipment_Set__c.Rental_End_Date__c, |
| | | d:-5 |
| | | }).then(res=>{ |
| | | console.log(res); |
| | | rtn=res; |
| | | }).catch(err=>{ |
| | | console.log("err:",err.message); |
| | | }) |
| | | |
| | | console.log(rtn); |
| | | if (rtn != "OK") { |
| | | // alert(rtn); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:rtn |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | } |
| | | console.log("hhh3"); |
| | | let resultSet = await selectRacById({recordId:this.Rental_Apply_Equipment_Set__c.Rental_Apply__c}) |
| | | ; |
| | | let records = resultSet; |
| | | console.log("hhh4"); |
| | | let result = await updateRaesc({ |
| | | recordId:this.Rental_Apply_Equipment_Set__c.Id, |
| | | JingliApprovalManagerc:records[0].JingliApprovalManager__c, |
| | | BuchangApprovalManagerc:records[0].SalesManager__c, |
| | | BuchangApprovalManagerSalesc:records[0].BuchangApprovalManager__c, |
| | | ZongjianApprovalManagerc:records[0].BuchangApprovalManagerSales__c, |
| | | ExtendStatusc:'填写完毕', |
| | | }); |
| | | console.log("hhh5"); |
| | | console.log(result); |
| | | // let messages = getConnectDMLErrorMessages(result); |
| | | if(result!=null&&result.length>0&&result.errors.length>0){ |
| | | // alert(result.errors[0].split(",")[1]); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:result.errors[0].split(",")[1] |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | console.log("hhh7"); |
| | | |
| | | // let request = new sforce.ProcessSubmitRequest(); |
| | | // request.objectId = this.recordId; |
| | | // let processResults = sforce.connection.process([request]); |
| | | console.log("hhh8"); |
| | | // submitForApproval(this.Rental_Apply_Equipment_Set__c.Id).then(result => { |
| | | // console.log(result); |
| | | // if (processResults[0].errors != null) { |
| | | // alert(processResults[0].errors.message); |
| | | // return; |
| | | // } |
| | | // console.log("hhh9"); |
| | | // window.location.reload(); |
| | | // }) |
| | | // .catch(error => { |
| | | // console.error('Error submitting record for approval:', error.message); |
| | | // }); |
| | | |
| | | // await submitForApproval(this.recordId); |
| | | const fields = {} |
| | | const recordInput = { fields }; |
| | | updateRecord({ fields: recordInput, recordId: this.recordId }) |
| | | .then(() => { |
| | | console.log("更新成功"); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error.message); |
| | | console.log(error); |
| | | // alert(error.body.message); |
| | | const event = new ShowToastEvent({ |
| | | title: '提示信息', |
| | | message:error.body.message |
| | | }); |
| | | this.dispatchEvent(event); |
| | | return; |
| | | // 处理异常情况 |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCustomSubmit"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | |
| | | |
| | | <div style="position: relative; margin-top: 10px; margin-left: 10px;"> |
| | | <span style="font-weight: bold; font-size: 12pt;">{Label.YouCantDeleteEvent1}</span> |
| | | |
| | | <br/><br/><br/> |
| | | |
| | | {Label.YouCantDeleteEvent2} |
| | | |
| | | <br/><br/> |
| | | |
| | | {Label.YouCantDeleteEvent3} |
| | | <a href="javascript:return null;" onclick={click}>{Label.YouCantDeleteEvent4}</a>{Label.YouCantDeleteEvent5} |
| | | |
| | | </div> |
| | | |
| | | |
| | | |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire } from 'lwc'; |
| | | |
| | | |
| | | import YouCantDeleteEvent1 from '@salesforce/label/c.YouCantDeleteEvent1'; |
| | | import YouCantDeleteEvent2 from '@salesforce/label/c.YouCantDeleteEvent2'; |
| | | import YouCantDeleteEvent3 from '@salesforce/label/c.YouCantDeleteEvent3'; |
| | | import YouCantDeleteEvent4 from '@salesforce/label/c.YouCantDeleteEvent4'; |
| | | import YouCantDeleteEvent5 from '@salesforce/label/c.YouCantDeleteEvent5'; |
| | | |
| | | export default class lexDeleteQuotePage extends LightningElement { |
| | | |
| | | |
| | | |
| | | Label = { |
| | | |
| | | YouCantDeleteEvent1, |
| | | YouCantDeleteEvent2, |
| | | YouCantDeleteEvent3, |
| | | YouCantDeleteEvent4, |
| | | YouCantDeleteEvent5 |
| | | }; |
| | | |
| | | click(event){ |
| | | history.back(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexDeleteQuotePage"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .Holder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="Holder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | export default class lexDetailBulkUpdate extends LightningElement { |
| | | @api recordId; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | console.log("进入页面"); |
| | | console.log(currentPageReference); |
| | | if(currentPageReference){ |
| | | const urvalue=currentPageReference.state.recordId; |
| | | if(urvalue){ |
| | | let str=`${urvalue}`; |
| | | console.log('str'); |
| | | console.log(str); |
| | | this.recordId=str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | |
| | | this.cancelSubmit().then(res=>{ |
| | | this.IsLoading=false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | |
| | | async cancelSubmit(){ |
| | | window.open('/apex/TransferApplySelectDetailSub?id='+this.recordId,'DetailBulkUpdateLWC', 'width=600,height=200'); |
| | | } |
| | | |
| | | //old js |
| | | // window.open("/apex/TransferApplySelectDetailSub?Id={!URLENCODE(TransferApply__c.Id)}"); |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexDetailBulkUpdate"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .dispatchOCSMQARAHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="dispatchOCSMQARAHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:23:37 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import updateForDispatchOCSMQARAButton from '@salesforce/apex/ReportController.updateForDispatchOCSMQARAButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexDispatchOCSMQARA extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | this.DispatchOCSMQARA(); |
| | | |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | DispatchOCSMQARA () { |
| | | updateForDispatchOCSMQARAButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | this.IsLoading = false; |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="lexESignAcceptanceHospital" if:true={IsLoding}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"> </lightning-spinner> </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ESignController.ESignController'; |
| | | import OcsmResult from '@salesforce/apex/ESignController.OcsmResult'; |
| | | import UserInfo_Owner from '@salesforce/apex/ESignController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class Submit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | profileId = ''; |
| | | arrMessage = []; |
| | | RCManagerId = null; |
| | | GrouppurchasePCL = null; |
| | | OCMManProvinceCus = null; |
| | | HPSignUpStatus = null; |
| | | SalesRootFormula = null; |
| | | HPSignUpDate = null; |
| | | salesManage = null; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | // this.RCManagerId = result.RCManagerId; |
| | | this.GrouppurchasePCL = result.GrouppurchasePCL; |
| | | this.OCMManProvinceCus = result.OCMManProvinceCus; |
| | | this.HPSignUpStatus = result.HPSignUpStatus; |
| | | this.SalesRootFormula = result.SalesRootFormula; |
| | | this.HPSignUpDate = result.HPSignUpDate; |
| | | this.profileId = result.profileId.slice(0,15); |
| | | this.IsLoading = false; |
| | | this.AcceptanceHospital(); |
| | | }) |
| | | } |
| | | AcceptanceHospital(){ |
| | | //先判断是否为集采课 |
| | | // var Group_purchase_PCL ; |
| | | // var Group_purchase_PCLFlag = "{!eSignForm__c.Group_purchase_PCL__c}"; |
| | | // if(Group_purchase_PCLFlag == 1){ |
| | | // Group_purchase_PCL = '集采课'; |
| | | // }else{ |
| | | // Group_purchase_PCL = "{!eSignForm__c.OCM_man_province_cus__c}"; |
| | | // } |
| | | console.log(this.GrouppurchasePCL,this.OCMManProvinceCus,'111111111') |
| | | var Group_purchase_PCL ; |
| | | // if(this.GrouppurchasePCL == 1){ |
| | | // Group_purchase_PCL = '集采课'; |
| | | // }else{ |
| | | Group_purchase_PCL = this.OCMManProvinceCus; |
| | | // } |
| | | //检索OCSM管理省 上的营业管理部担当 |
| | | // var sql = "select id, Name, SalesManage__c from OCM_Management_Province__c where Name = "+"\'"+Group_purchase_PCL+"\'"; |
| | | // var ocsmResult = sforce.connection.query(sql); |
| | | // var ocsm = ocsmResult.getArray("records"); |
| | | // //营业管理部担当id |
| | | // var salesManage; |
| | | // if (ocsm) { |
| | | // salesManage = ocsm[0].SalesManage__c; |
| | | // } |
| | | console.log(Group_purchase_PCL,this.profileId,'77777777777') |
| | | OcsmResult({GrouppurchasePCL:Group_purchase_PCL}).then(res=>{ |
| | | console.log(res) |
| | | var salesManage; |
| | | salesManage = res[0].SalesManage__c; |
| | | //电子签收单id |
| | | var id = this.recordId |
| | | //new 一个对象 |
| | | var eSignForm; |
| | | //医院状态 |
| | | var status = this.HPSignUpStatus; |
| | | //销售渠道 |
| | | var sales_Root_Formula = this.SalesRootFormula; |
| | | if (salesManage || this.profileId == '00e10000000Y3o5') { |
| | | UserInfo_Owner().then(res => { |
| | | var userId = ''; |
| | | userId = res.id; |
| | | if (salesManage != userId && this.profileId != '00e10000000Y3o5' && this.profileId != '00e10000000s2cp') { |
| | | alert('您只能审批营业管理部担当是自己的签收单!'); |
| | | return; |
| | | } else if (status != '申请中') { |
| | | alert('您只能审批申请中的签收单!') |
| | | return; |
| | | } else if (this.HPSignUpDate) { |
| | | alert('医院签收日为空时,不可以确认!'); |
| | | return; |
| | | }else{ |
| | | if(sales_Root_Formula == 'OCM直接販売'){ |
| | | window.open ('/apex/HPDirectSalesConfirmPage?id='+this.recordId, '医院确认', |
| | | 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | }else{ |
| | | window.open ('/apex/HPConfirmPage?id='+this.recordId, '医院确认', |
| | | 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | |
| | | // var foo = function() { |
| | | // //当前用户登录id |
| | | // var userId = "{!CASESAFEID($User.Id)}"; |
| | | // //当前用户简档id |
| | | // var ProfileId = "{!$Profile.Id}"; |
| | | // // var RC_Manager = "{!eSignForm__c.RC_ManagerId__c }"; |
| | | // //先判断是否为集采课 |
| | | // var Group_purchase_PCL ; |
| | | // var Group_purchase_PCLFlag = "{!eSignForm__c.Group_purchase_PCL__c}"; |
| | | // if(Group_purchase_PCLFlag == 1){ |
| | | // Group_purchase_PCL = '集采课'; |
| | | // }else{ |
| | | // Group_purchase_PCL = "{!eSignForm__c.OCM_man_province_cus__c}"; |
| | | // } |
| | | // //检索OCSM管理省 上的营业管理部担当 |
| | | // var sql = "select id, Name, SalesManage__c from OCM_Management_Province__c where Name = "+"\'"+Group_purchase_PCL+"\'"; |
| | | // var ocsmResult = sforce.connection.query(sql); |
| | | // var ocsm = ocsmResult.getArray("records"); |
| | | // //营业管理部担当id |
| | | // var salesManage; |
| | | // if (ocsm) { |
| | | // salesManage = ocsm[0].SalesManage__c; |
| | | // } |
| | | |
| | | // //电子签收单id |
| | | // var id = "{!eSignForm__c.Id}"; |
| | | // //new 一个对象 |
| | | // var eSignForm; |
| | | // //医院状态 |
| | | // var status = "{!eSignForm__c.HPSignUpStatus__c}"; |
| | | // //销售渠道 |
| | | // var sales_Root_Formula = "{!eSignForm__c.Sales_Root_Formula__c}"; |
| | | |
| | | // if (salesManage || ProfileId == '00e10000000Y3o5') { |
| | | // if (salesManage != userId && ProfileId != '00e10000000Y3o5' && ProfileId != '00e10000000s2cp') { |
| | | // alert('您只能审批营业管理部担当是自己的签收单!'); |
| | | // return; |
| | | // } else if (status != '申请中') { |
| | | // alert('您只能审批申请中的签收单!') |
| | | // return; |
| | | // } else if (!'{!eSignForm__c.HPSignUpDate__c}') { |
| | | // alert('医院签收日为空时,不可以确认!'); |
| | | // return; |
| | | // }else{ |
| | | // if(sales_Root_Formula == 'OCM直接販売'){ |
| | | // window.open ('/apex/HPDirectSalesConfirmPage?id='+"{!eSignForm__c.Id}", '医院确认', |
| | | // 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | // }else{ |
| | | // window.open ('/apex/HPConfirmPage?id='+"{!eSignForm__c.Id}", '医院确认', |
| | | // 'height=340, width=600, top=200, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no'); |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | // foo(); |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="Attachment" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | export default class lexESignFormAttachment extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | this.IsLoading = false; |
| | | this.Attachment(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | Attachment(){ |
| | | window.open( `/apex/eSignFormAttachment?parentId=${this.recordId}`); |
| | | } |
| | | |
| | | // 弹窗 |
| | | ShowToastEvent(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |
| | | |
| | | |
| | | // var From= function(){ |
| | | // window.open( "/apex/eSignFormAttachment?parentId={!URLENCODE(eSignForm__c.Id)}"); |
| | | // } |
| | | // From(); |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .outerBorderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .borderCss{ |
| | | border: 1px solid #D4D4D4; |
| | | border-radius : 5px; |
| | | margin-bottom : 7px; |
| | | border-top : 3px solid #565959; |
| | | } |
| | | .headerDorderCss{ |
| | | border-top: 1px solid #565959; |
| | | border-bottom: 1px solid #D4D4D4; |
| | | padding:3px; |
| | | } |
| | | .centerCss{ |
| | | text-align: center; |
| | | } |
| | | .centerCss .left{ |
| | | margin-left: 100px; |
| | | }/* sample css file */ |
| New file |
| | |
| | | <template> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/EquipmentRentalPicturePDFController.init'; |
| | | export default class lexEquipmentRentalPicturePDF extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if(urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | //console.log('result.ShipmentRequestedCnt===' + result.ShipmentRequestedCnt) |
| | | if( result.ShipmentRequestedCnt > 0){ |
| | | console.log(result.pagelength); |
| | | for(var i =0; i<result.pagelength; i++){ |
| | | window.open('/apex/FixtureRentalPicturePDF?raid='+ this.recordId +'&page=' + i); |
| | | } |
| | | }else{ |
| | | alert('当前的申请单中没有已出库指示的配套。'); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(err=>{ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | console.log(err); |
| | | }) |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOCMSubmit"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .lexEquipmentSetRentalHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | |
| | | <div class="lexEquipmentSetRentalHolder" if:true={IsLoding}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"> </lightning-spinner> </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,api, track, wire } from 'lwc'; |
| | | import init from '@salesforce/apex/EquipmentSetRentalController.init'; |
| | | import AssignBtn from '@salesforce/apex/RentalApplyWebService.AssignBtn'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | export default class lexEquipmentSetRental_Order extends LightningElement { |
| | | |
| | | @api recordId; |
| | | IsLoading; |
| | | Rental_Apply__c; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference){ |
| | | console.log(currentPageReference); |
| | | console.log("进入获取page参数") |
| | | const IdValue=currentPageReference.state.recordId; |
| | | if(IdValue){ |
| | | let str=`${IdValue}`; |
| | | this.recordId=str; |
| | | console.log("recordId="+str); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({recordId:this.recordId}).then(res=>{ |
| | | if(res!=null){ |
| | | this.IsLoading=false; |
| | | console.log("res"); |
| | | console.log(res); |
| | | console.log("进入初始化对象其他属性"); |
| | | this.Rental_Apply__c=res; |
| | | console.log(this.Rental_Apply__c); |
| | | this.distribution(); |
| | | } |
| | | else{ |
| | | var a="没进distribution"; |
| | | console.log(a); |
| | | } |
| | | }).catch(error =>{ |
| | | console.log("error"); |
| | | console.log(error.message); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | async distribution(){ |
| | | var raid = this.Rental_Apply__c.Id; |
| | | var rtn = await AssignBtn(raid); |
| | | if(this.Rental_Apply__c.Status__c == '取消' && this.Rental_Apply__c.Rental_Apply_Equipment_Set_Cnt__c != '0') { |
| | | window.open("/apex/EquipmentRentalApply?raid="+URLENCODE(this.Rental_Apply__c.Id)); |
| | | } else if((this.Rental_Apply__c.demo_purpose2__c == '学会/展台' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '课题研究' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '培训中心' |
| | | ) |
| | | && this.Rental_Apply__c.Status__c == '草案中') { |
| | | alert("不能引当,请确认申请的状态"); |
| | | } else if( |
| | | (this.Rental_Apply__c.demo_purpose2__c == '试用(无询价)' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '试用(有询价)' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '动物实验' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '一般维修代用' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '保修合同用户维修代用' || |
| | | this.Rental_Apply__c.demo_purpose2__c == '已购待货' |
| | | ) |
| | | && this.Rental_Apply__c.Status__c != '批准完了' |
| | | && this.Rental_Apply__c.Status__c != '引当完了' |
| | | && this.Rental_Apply__c.Status__c != '出库指示完了') { |
| | | alert("不能引当,请确认申请的状态"); |
| | | } else if(rtn == 'Fin') { |
| | | window.open("/apex/EquipmentRentalApply?raid="+URLENCODE(this.Rental_Apply__c.Id)); |
| | | } else{ |
| | | alert(rtn); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .lexFinlibraryHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="lexFinlibraryHolder" if:true={IsLoding}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"> </lightning-spinner> </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import getBulletinBoard from '@salesforce/apex/FinLibraryButtonController.getBulletinBoard'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import LightningAlert from 'lightning/alert'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class lexFinLibrary extends LightningElement { |
| | | |
| | | @api recordId; |
| | | IsLoading; |
| | | Bulletin_Board__c; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference){ |
| | | console.log(currentPageReference); |
| | | console.log("进入获取page参数") |
| | | const IdValue=currentPageReference.state.recordId; |
| | | if(IdValue){ |
| | | let str=`${IdValue}`; |
| | | this.recordId=str; |
| | | console.log("recordId="+str); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | getBulletinBoard({recordId:this.recordId}).then(res=>{ |
| | | if(res!=null){ |
| | | this.IsLoading=false; |
| | | console.log("res"); |
| | | console.log(res); |
| | | console.log("进入初始化对象其他属性"); |
| | | this.Bulletin_Board__c=res; |
| | | console.log(this.Bulletin_Board__c); |
| | | this.FinLibrary(); |
| | | } |
| | | else{ |
| | | var a="没进方法"; |
| | | console.log(a); |
| | | } |
| | | }).catch(error =>{ |
| | | console.log("error"); |
| | | console.log(error.message); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | async FinLibrary(){ |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | window.open(this.Bulletin_Board__c.iPad_Finlibrary__c, 'FinLibrary', '_top'); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFinLibrary"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .lexFinlibraryHolder2{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="lexFinlibraryHolder2" if:true={IsLoding}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"> </lightning-spinner> </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import getBulletinBoard from '@salesforce/apex/FinLibraryButtonController2.getBulletinBoard'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | export default class lexFinLibrary2 extends LightningElement { |
| | | |
| | | |
| | | @api recordId; |
| | | IsLoading; |
| | | Bulletin_Board__c; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference){ |
| | | console.log(currentPageReference); |
| | | console.log("进入获取page参数") |
| | | const IdValue=currentPageReference.state.recordId; |
| | | if(IdValue){ |
| | | let str=`${IdValue}`; |
| | | this.recordId=str; |
| | | console.log("recordId="+str); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | getBulletinBoard({recordId:this.recordId}).then(res=>{ |
| | | if(res!=null){ |
| | | this.IsLoading=false; |
| | | console.log("res"); |
| | | console.log(res); |
| | | console.log("进入初始化对象其他属性"); |
| | | this.Bulletin_Board__c=res; |
| | | console.log(this.Bulletin_Board__c); |
| | | this.FinLibrary2(); |
| | | } |
| | | else{ |
| | | var a="没进方法"; |
| | | console.log(a); |
| | | } |
| | | }).catch(error =>{ |
| | | console.log("error"); |
| | | console.log(error.message); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | FinLibrary2(){ |
| | | |
| | | |
| | | window.open(this.Bulletin_Board__c.iPad_Finlibrary_2__c, 'FinLibrary', '_top'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFinLibrary2"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .lexFinlibraryHolder3{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .container .uiContainerManager{ |
| | | display : none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="lexFinlibraryHolder3" if:true={IsLoding}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"> </lightning-spinner> </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire,api } from 'lwc'; |
| | | import getBulletinBoard from '@salesforce/apex/FinLibraryButtonController3.getBulletinBoard'; |
| | | import {CurrentPageReference} from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | export default class lexFinLibrary3 extends LightningElement { |
| | | |
| | | @api recordId; |
| | | IsLoading; |
| | | Bulletin_Board__c; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference){ |
| | | if(currentPageReference){ |
| | | console.log(currentPageReference); |
| | | console.log("进入获取page参数") |
| | | const IdValue=currentPageReference.state.recordId; |
| | | if(IdValue){ |
| | | let str=`${IdValue}`; |
| | | this.recordId=str; |
| | | console.log("recordId="+str); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | getBulletinBoard({recordId:this.recordId}).then(res=>{ |
| | | if(res!=null){ |
| | | this.IsLoading=false; |
| | | console.log("res"); |
| | | console.log(res); |
| | | console.log("进入初始化对象其他属性"); |
| | | this.Bulletin_Board__c=res; |
| | | console.log(this.Bulletin_Board__c); |
| | | this.FinLibrary3(); |
| | | } |
| | | else{ |
| | | var a="没进方法"; |
| | | console.log(a); |
| | | } |
| | | }).catch(error =>{ |
| | | console.log("error"); |
| | | console.log(error.message); |
| | | }).finally(()=>{ |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | FinLibrary3(){ |
| | | window.open(this.Bulletin_Board__c.iPad_Finlibrary_3__c, 'FinLibrary', '_top'); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexFinLibrary3"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .createEmailHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="createEmailHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/CaseController.initForlexInputSolutionButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | export default class lexInputSolution extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | inquirydetail; |
| | | answerdetailcontent; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback () { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | this.IsLoading = false; |
| | | this.inquirydetail = result.inquirydetail; |
| | | this.answerdetailcontent = result.answerdetailcontent; |
| | | var url = "/501/e?retURL="+this.recordId+ |
| | | "&SolutionName="+this.inquirydetail+ |
| | | "&00N10000003MXPAEA4="+this.answerdetailcontent; |
| | | window.open(url); |
| | | }).catch(error => { |
| | | console.log('error='+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexInputSolution"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="exampleHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { |
| | | LightningElement, |
| | | wire, |
| | | api |
| | | } from 'lwc'; |
| | | import { |
| | | CurrentPageReference |
| | | } from "lightning/navigation"; |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonSpotInspectionReportCtl.init'; |
| | | |
| | | export default class LexInsPageBtn extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeId = result.RecordTypeId; |
| | | |
| | | this.insPageBtn(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 报告书明细编辑 |
| | | insPageBtn() { |
| | | var url; |
| | | if (this.RecordTypeId == '01210000000aLii') { |
| | | url = '/apex/OFSInsReportLayoutForVm'; |
| | | } else { |
| | | url = '/apex/OFSInsReportLayout'; |
| | | } |
| | | window.open(url += '?id=' + this.Id) |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <template if:true={showSpinner}> |
| | | <lightning-spinner size="medium" variant="brand"></lightning-spinner> |
| | | </template> |
| | | <template if:true={showcount}> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;"> |
| | | <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <div> |
| | | <p style="font-size: 19px;float:left"><strong>库存盘点</strong></p> |
| | | </div> |
| | | <div style="margin-left:400px;"> |
| | | <lightning-button label="盘点确认" title="盘点确认" onclick={saveConfirm}></lightning-button></td> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="padding:10px;"> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <table> |
| | | <colgroup> |
| | | <col width="160px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="90px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="85px" /> |
| | | <col width="100px" /> |
| | | <col width="10px" /> |
| | | <col width="70px" /> |
| | | <col width="100px" /> |
| | | </colgroup> |
| | | <tbody> |
| | | <tr> |
| | | <td></td> |
| | | <td align="right">Barcode</td> |
| | | <td style="width:600px"><lightning-textarea name="Barcode" label="" |
| | | onchange={handleChange}></lightning-textarea></td> |
| | | <td align="right"></td> |
| | | <td></td> |
| | | <td><lightning-button label="Barcode" title="Barcode录入" onclick={barcodeEntrys} |
| | | style="width: 150px;"></lightning-button> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <p style="font-size: 16px;"><strong>在库商品库存一览</strong></p> |
| | | </div> |
| | | <div style="padding:10px;"> |
| | | |
| | | <div style="height: 300px;"> |
| | | <template if:true={showTable}> |
| | | |
| | | <c-lex-custom-lightning-datatable key-field="ProdId" data={data} columns={columns} |
| | | ondiffreasons={diffreasons} onrowselection={getSelectedRows} |
| | | selected-rows={selectedRows}> |
| | | </c-lex-custom-lightning-datatable> |
| | | </template> |
| | | <!-- 加载框 --> |
| | | |
| | | <!-- <div if:true={casesSpinner} class="slds-spinner_inline spinner-padding" |
| | | style="margin-top:10px;"> |
| | | <lightning-spinner variant="brand" alternative-text="Loading Cases" size="medium"> |
| | | </lightning-spinner> |
| | | </div> --> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;margin-bottom:7px;margin-top:50px"> |
| | | <div style="border-top: 3px solid #51606E;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <table> |
| | | <tr> |
| | | <td> |
| | | <p style="font-size: 16px;"><strong>调整明细</strong></p> |
| | | </td> |
| | | <template if:true={showbutton}> |
| | | <td align="center"> <lightning-button label="下载本次盘点库存变化明细" title="下载本次盘点库存变化明细" |
| | | onclick={exportData} style="width: 150px;"></lightning-button></td> |
| | | </template> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <template if:true={showTable}> |
| | | <div style="padding:10px;"> |
| | | |
| | | <c-lwc-datatable-utility records={codPageRecords} total-records={codPageRecords.length} |
| | | columns={column} key-field="Id" show-search-box="true" hidecheckboxcolumn={hidecheckbox} |
| | | max-row-selection={codPageRecords.length} onpaginatorchange={handlePaginatorChange}> |
| | | </c-lwc-datatable-utility> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <template if:true={EditAble}> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;"> |
| | | <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:3px;"> |
| | | <div style="border: 1px solid #D4D4D4;border-radius:5px;"> |
| | | <div style="border-top: 3px solid #51606E;;border-bottom: 1px solid #D4D4D4;padding:6px;"> |
| | | <p style="font-size: 19px;"><strong>盘点情况一览</strong></p> |
| | | |
| | | </div> |
| | | <div class="acc-container"> |
| | | <lightning-record-edit-form object-api-name="Consumable_order__c" record-id={conId}> |
| | | <lightning-layout multiple-rows="true"> |
| | | <!-- <template if:true={isSummonsFlag}> --> |
| | | <lightning-layout-item class="hehe-layoutItem" size="4"> |
| | | <lightning-output-field field-name="Name"></lightning-output-field> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item class="hehe-layoutItem" size="4"> |
| | | <lightning-output-field field-name="Inventory_date__c"></lightning-output-field> |
| | | </lightning-layout-item> |
| | | <lightning-layout-item class="hehe-layoutItem" size="4"> |
| | | </lightning-layout-item> |
| | | <!-- </template> --> |
| | | </lightning-layout> |
| | | </lightning-record-edit-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium" |
| | | active-section-name={activeSections}> |
| | | <lightning-accordion-section name="dataExpand" label="盘点明细"> |
| | | <lightning-datatable key-field="id" data={detailData} |
| | | columns={dcolumns} hide-checkbox-column> |
| | | </lightning-datatable> |
| | | |
| | | </lightning-accordion-section> |
| | | </lightning-accordion> |
| | | <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium" |
| | | active-section-name={activeSections}> |
| | | <lightning-accordion-section name="dataExpand" label="在库调整明细"> |
| | | <lightning-datatable key-field="id" data={adjustdata} |
| | | columns={stockadjustcolumns} hide-checkbox-column> |
| | | </lightning-datatable> |
| | | </lightning-accordion-section> |
| | | </lightning-accordion> |
| | | </div> |
| | | </template> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, wire, api, track } from "lwc"; |
| | | import oninit from "@salesforce/apex/LexInventoryController.init"; |
| | | import barcodeEntry from "@salesforce/apex/LexInventoryController.searchConsumableorderdetails"; |
| | | // import saveConfirm from '@salesforce/apex/LexInventoryController.saveConfirm'; |
| | | import save from "@salesforce/apex/LexInventoryController.save"; |
| | | import datainit from "@salesforce/apex/LexInventoryListController.init"; |
| | | import { ShowToastEvent } from "lightning/platformShowToastEvent"; |
| | | import { NavigationMixin } from "lightning/navigation"; |
| | | |
| | | //库存盘点主页面数据 |
| | | const columns = [ |
| | | { |
| | | label: "是否盘点", |
| | | fieldName: "iscount", |
| | | hideDefaultActions: true, |
| | | cellAttributes: { alignment: "left" }, |
| | | }, |
| | | { |
| | | label: "消耗品名称", |
| | | fieldName: "Name__c", |
| | | hideDefaultActions: true, |
| | | initialWidth: 250, |
| | | cellAttributes: { alignment: "left" }, |
| | | }, |
| | | { |
| | | label: "规格", |
| | | fieldName: "Packing_list_manual__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "单位", |
| | | fieldName: "boxPiece", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "有效期内库存", |
| | | fieldName: "limitCount", |
| | | hideDefaultActions: true, |
| | | }, |
| | | |
| | | { |
| | | label: "过期库存", |
| | | fieldName: "overlimitCount", |
| | | hideDefaultActions: true, |
| | | initialWidth: 100, |
| | | }, |
| | | { |
| | | label: "盘点", |
| | | fieldName: "Pandian", |
| | | hideDefaultActions: true, |
| | | initialWidth: 100, |
| | | }, |
| | | { |
| | | label: "丢失", |
| | | fieldName: "Diff", |
| | | hideDefaultActions: true, |
| | | initialWidth: 100, |
| | | }, |
| | | { |
| | | label: "寻回 ", |
| | | fieldName: "refind", |
| | | hideDefaultActions: true, |
| | | initialWidth: 150, |
| | | }, |
| | | { |
| | | label: "差异原因", |
| | | // fieldName: "DiffReason", |
| | | hideDefaultActions: true, |
| | | type: "customDiffReason", |
| | | typeAttributes: { |
| | | DiffReason: { fieldName: "DiffReason" }, |
| | | ProdId: { fieldName: "ProdId" }, |
| | | }, |
| | | }, |
| | | ]; |
| | | |
| | | //调整明细 |
| | | const column = [ |
| | | { |
| | | label: "消耗品名称", |
| | | fieldName: "Name__c", |
| | | hideDefaultActions: true, |
| | | cellAttributes: { alignment: "left" }, |
| | | }, |
| | | { |
| | | label: "单位", |
| | | fieldName: "Box_Piece__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "barcode", |
| | | fieldName: "Bar_Code__c", |
| | | hideDefaultActions: true, |
| | | initialWidth: 150, |
| | | }, |
| | | { |
| | | label: "调整原因", |
| | | fieldName: "DiffReason", |
| | | hideDefaultActions: true, |
| | | }, |
| | | ]; |
| | | //盘点明细 |
| | | const dcolumns = [ |
| | | { |
| | | label: "消耗品名称", |
| | | fieldName: "Name__c", |
| | | hideDefaultActions: true, |
| | | cellAttributes: { alignment: "left" }, |
| | | }, |
| | | { |
| | | label: "库存", |
| | | fieldName: "Count_Sum__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "盘点", |
| | | fieldName: "inventory_sum__c", |
| | | hideDefaultActions: true, |
| | | initialWidth: 150, |
| | | }, |
| | | { |
| | | label: "丢失", |
| | | fieldName: "Diff__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "寻回", |
| | | fieldName: "Product_Refind__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "差异原因", |
| | | fieldName: "Lose_reason__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | ]; |
| | | |
| | | //在库调整明细 |
| | | const stockadjustcolumns = [ |
| | | { |
| | | label: "消耗品名称", |
| | | fieldName: "Name__c", |
| | | cellAttributes: { alignment: "left" }, |
| | | }, |
| | | { |
| | | label: "产品型号", |
| | | fieldName: "Asset_Model_No__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | { |
| | | label: "差异原因", |
| | | fieldName: "Lose_reason__c", |
| | | hideDefaultActions: true, |
| | | initialWidth: 150, |
| | | }, |
| | | { |
| | | label: "是否丢失", |
| | | type: "boolean", |
| | | fieldName: "Lose_Flag__c", |
| | | hideDefaultActions: true, |
| | | }, |
| | | ]; |
| | | |
| | | export default class LexInventoryCount extends NavigationMixin( |
| | | LightningElement |
| | | ) { |
| | | columns = columns; |
| | | column = column; |
| | | stockadjustcolumns = stockadjustcolumns; |
| | | dcolumns = dcolumns; |
| | | @track data = []; |
| | | @track codPageRecords = []; |
| | | @track accountName; |
| | | @track agencyProType; |
| | | @track userWorkLocation; |
| | | @track accountid |
| | | @track pandiandetailsMap |
| | | @track reSet |
| | | |
| | | @track showTable = false; |
| | | @track showbutton = false; |
| | | @track barcode = ""; |
| | | @track ConsumableorderdetailsRecordsview = []; |
| | | @track consumableorderdetailsRecords = []; |
| | | @track showcount = true; |
| | | |
| | | @track iSinventory = false |
| | | @track numberDetail; |
| | | @track hidecheckbox = true; |
| | | |
| | | |
| | | //加载框 |
| | | // @track casesSpinner = true; |
| | | @track showSpinner = true; |
| | | |
| | | //row |
| | | @track selectedRows = []; |
| | | //inventoryList |
| | | @track isSummonsFlag; |
| | | //展开栏 |
| | | activeSections = ["dataExpand"]; |
| | | columnHeader = ["消耗品名称", "单位", "barCode", "调整原因"]; |
| | | //确认一览 |
| | | @track eSetId = ""; |
| | | @track EditAble = false; |
| | | @track selectedData; |
| | | @track conId; |
| | | @track detailData = []; |
| | | @track adjustdata = []; |
| | | |
| | | //获取链接参数 |
| | | getQueryString(name) { |
| | | console.log("getQueryString name " + name); |
| | | let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); |
| | | let r = window.location.search.substr(1).match(reg); |
| | | if (r != null) { |
| | | return decodeURIComponent(r[2]); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log("===>初始化"); |
| | | this.showSpinner = true; |
| | | //获取ESetid |
| | | this.eSetId = this.getQueryString("eSetId"); |
| | | this.eSetId = this.eSetId == null ? "" : this.eSetId; |
| | | console.log(" this.eSetId" + this.eSetId); |
| | | if (this.eSetId == "") { |
| | | this.EditAble = false; |
| | | } else { |
| | | this.inits(); |
| | | this.showcount = false; |
| | | this.EditAble = true; |
| | | } |
| | | |
| | | oninit() |
| | | .then((result) => { |
| | | console.log("1112" + JSON.stringify(result)); |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log("result.status = " + result.status); |
| | | console.log( |
| | | " ConsumableorderdetailsRecordsview= " + |
| | | result.entity.ConsumableorderdetailsRecordsview |
| | | ); |
| | | this.ConsumableorderdetailsRecordsview = JSON.parse( |
| | | result.entity.ConsumableorderdetailsRecordsview |
| | | ); |
| | | this.consumableorderdetailsRecords = |
| | | result.entity.consumableorderdetailsRecords; |
| | | console.log( |
| | | " consumableorderdetailsRecords= " + |
| | | result.entity.consumableorderdetailsRecords |
| | | ); |
| | | |
| | | console.log("传参类型", typeof this.consumableorderdetailsRecords); |
| | | if (result.status == "Success") { |
| | | console.log( |
| | | "this.ConsumableorderdetailsRecordsview[0] = " + |
| | | JSON.stringify(this.ConsumableorderdetailsRecordsview[0]) |
| | | ); |
| | | console.log( |
| | | "this.ConsumableorderdetailsRecordsview[0].length = " + |
| | | this.ConsumableorderdetailsRecordsview[0].length |
| | | ); |
| | | |
| | | // let cloneData = []; |
| | | // for (let i in this.ConsumableorderdetailsRecordsview[0]) { |
| | | // cloneData.push(JSON.parse(this.ConsumableorderdetailsRecordsview[0][i])); |
| | | // } |
| | | // console.log('cloneData = ' + typeof cloneData); |
| | | // console.log('cloneData = ' + cloneData); |
| | | // this.data = cloneData; |
| | | this.data = []; |
| | | this.data = this.ConsumableorderdetailsRecordsview[0]; |
| | | console.log("this.data ==>" + JSON.stringify(this.data)); |
| | | for (let i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Packing_list_manual__c"] = |
| | | this.data[i].Prod.Packing_list_manual__c; |
| | | } |
| | | this.accountName = result.entity.accountName; |
| | | this.agencyProType = result.entity.agencyProType; |
| | | this.userWorkLocation = result.entity.userWorkLocation; |
| | | this.showSpinner = false; |
| | | this.accountid = result.entity.accountid; |
| | | // this.casesSpinner = false; |
| | | this.showTable = true; |
| | | } else { |
| | | console.log("Error:" + result.errorMsg); |
| | | const evt = new ShowToastEvent({ |
| | | title: "解析失败", |
| | | message: result.errorMsg, |
| | | variant: "error", |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | //默认展开栏 |
| | | this.activeSections = ["dataExpand"]; |
| | | this.showTable = false; |
| | | this.showbutton = false; |
| | | //init |
| | | } |
| | | //录入barcode |
| | | |
| | | barcodeEntrys() { |
| | | this.showTable = false; |
| | | this.showbutton = false; |
| | | this.showSpinner = true; |
| | | console.log("进入录入"); |
| | | console.log( |
| | | "this.consumableorderdetailsRecords===>" + |
| | | this.consumableorderdetailsRecords |
| | | ); |
| | | |
| | | barcodeEntry({ |
| | | accountName: this.accountName, |
| | | agencyProType: this.agencyProType, |
| | | userWorkLocation: this.userWorkLocation, |
| | | barcode: this.barcode, |
| | | consumableorderdetailsRecordsLWC: this.consumableorderdetailsRecords, |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log("result ===>" + JSON.stringify(result)); |
| | | |
| | | console.log("1111"); |
| | | if (result.status == "Sucess") { |
| | | this.codPageRecords = JSON.parse(result.entity.codPageRecords); |
| | | for (var i in this.codPageRecords) { |
| | | this.codPageRecords[i]["Name__c"] = this.codPageRecords[i].Prod.Name__c; |
| | | this.codPageRecords[i]["Box_Piece__c"] = this.codPageRecords[i].orderdetails2.Box_Piece__c; |
| | | this.codPageRecords[i]["Bar_Code__c"] = this.codPageRecords[i].orderdetails2.Bar_Code__c; |
| | | } |
| | | this.data = JSON.parse(result.entity.consumableorderdetailsRecords); |
| | | for (var i in this.data) { |
| | | this.data[i]["Name__c"] = this.data[i].Prod.Name__c; |
| | | this.data[i]["Packing_list_manual__c"] = this.data[i].Prod.Packing_list_manual__c; |
| | | } |
| | | for (var i in this.data) { |
| | | if (this.data[i]["check"]) { |
| | | this.selectedRows.push(this.data[i].ProdId); |
| | | console.log("selectedRows:" + this.selectedRows); |
| | | } |
| | | } |
| | | this.iSinventory = result.entity.iSinventory; |
| | | this.pandiandetailsMap = result.entity.pandiandetailsMap; |
| | | this.reSet = result.entity.reSet; |
| | | console.log("iSinventory:" + this.iSinventory); |
| | | this.showTable = true; |
| | | this.showbutton = true; |
| | | this.showSpinner = false; |
| | | console.log('reSet' + this.reSet); |
| | | console.log('pandiandetailsMap' + this.pandiandetailsMap); |
| | | |
| | | |
| | | console.log( |
| | | "this.codPageRecords=11111 " + result.entity.codPageRecords |
| | | ); |
| | | console.log("result录入= " + JSON.stringify(result)); |
| | | console.log( |
| | | "result主页数据= " + result.entity.consumableorderdetailsRecords |
| | | ); |
| | | } else { |
| | | console.log('Error:' + result.errorMsg); |
| | | const evt = new ShowToastEvent({ |
| | | title: '', |
| | | message: result.msg, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.showSpinner = false; |
| | | this.showTable = true; |
| | | |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | //获取当前输入值 |
| | | handleChange(event) { |
| | | let value = event.detail.value; |
| | | console.log("value" + value); |
| | | this.barcode = value; |
| | | } |
| | | |
| | | getSelectedRows(event) { |
| | | const selectedRows = event.detail.selectedRows; |
| | | console.log("this.selectedRows = " + this.selectedRows); |
| | | for (var i in this.data) { |
| | | this.data[i]["check"] = false; |
| | | } |
| | | for (var i in this.data) { |
| | | for (var j in selectedRows) { |
| | | if (this.data[i].ProdId == selectedRows[j].ProdId) { |
| | | this.data[i]["check"] = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //导出为csv |
| | | exportData() { |
| | | console.log("导出"); |
| | | // Prepare a html table |
| | | let doc = "<table>"; |
| | | // Add styles for the table |
| | | doc += "<style>"; |
| | | doc += "table, th, td {"; |
| | | doc += " border: 1px solid black;"; |
| | | doc += " border-collapse: collapse;"; |
| | | doc += "}"; |
| | | doc += "</style>"; |
| | | // Add all the Table Headers |
| | | doc += "<tr>"; |
| | | this.columnHeader.forEach((element) => { |
| | | doc += "<th>" + element + "</th>"; |
| | | }); |
| | | doc += "</tr>"; |
| | | // Add the data rows |
| | | this.codPageRecords.forEach((record) => { |
| | | doc += "<tr>"; |
| | | doc += "<th>" + record.Name__c + "</th>"; |
| | | doc += "<th>" + record.Box_Piece__c + "</th>"; |
| | | doc += "<th>" + record.Bar_Code__c + "</th>"; |
| | | doc += "<th>" + record.DiffReason + "</th>"; |
| | | doc += "</tr>"; |
| | | }); |
| | | doc += "</table>"; |
| | | var element = "data:application/vnd.ms-excel," + encodeURIComponent(doc); |
| | | let downloadElement = document.createElement("a"); |
| | | downloadElement.href = element; |
| | | downloadElement.target = "_self"; |
| | | // use .csv as extension on below line if you want to export data as csv |
| | | downloadElement.download = "库存变化明细.xls"; |
| | | document.body.appendChild(downloadElement); |
| | | downloadElement.click(); |
| | | } |
| | | |
| | | //自定义dataType |
| | | |
| | | diffreasons(event) { |
| | | const numberDetail = event.detail; |
| | | // this.numberDetail = numberDetail; |
| | | console.log("numberDetail" + JSON.stringify(numberDetail)); |
| | | for (var i in this.data) { |
| | | if (this.data[i]["ProId"] == numberDetail.data.ProId) { |
| | | this.data[i]["DiffReason"] = numberDetail.data.DiffReason; |
| | | } |
| | | } |
| | | console.log(" this.data==>" + JSON.stringify(this.data)); |
| | | } |
| | | |
| | | saveConfirm() { |
| | | console.log("进入盘点确认"); |
| | | console.log('reSet' + this.reSet); |
| | | console.log('pandiandetailsMap' + this.pandiandetailsMap); |
| | | var el = this.template.querySelector("c-lex-custom-lightning-datatable"); |
| | | var selected = el.getSelectedRows(); |
| | | this.selectedData = selected; |
| | | console.log("选中数据" + JSON.stringify(this.selectedData)); |
| | | save({ |
| | | iSinventory: this.iSinventory, |
| | | consumableorderdetailsRecordsLWC: JSON.stringify(this.selectedData), |
| | | accountid: this.accountid, |
| | | agencyProType: this.agencyProType, |
| | | reSet: this.reSet, |
| | | pandiandetailsMap: this.pandiandetailsMap |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log("result = " + JSON.stringify(result)); |
| | | console.log("111111"); |
| | | |
| | | if (result.status == "Success") { |
| | | let url = "/lexInventoryCount?ESetid=" + result.entity.eSetId; |
| | | this[NavigationMixin.Navigate]({ |
| | | type: "standard__webPage", |
| | | attributes: { |
| | | url: url, |
| | | }, |
| | | }); |
| | | console.log("Id" + this.eSetId); |
| | | // this.EditAble = true; |
| | | // this.showcount = false; |
| | | } else { |
| | | console.log("result.msg = " + result.msg); |
| | | const evt = new ShowToastEvent({ |
| | | title: "失败", |
| | | message: result.msg, |
| | | variant: "error", |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | |
| | | inits() { |
| | | datainit({ |
| | | eSetId: this.eSetId, |
| | | }) |
| | | .then((result) => { |
| | | result = JSON.parse(JSON.stringify(result)); |
| | | console.log('盘点一览===>' + JSON.stringify(result)); |
| | | for (var i in result.entity.qs) { |
| | | this.conId = result.entity.qs[i].Id; |
| | | } |
| | | console.log("this.conId" + typeof this.conId); |
| | | this.detailData = JSON.parse( |
| | | result.entity.consumableorderdetailsRecords |
| | | ); |
| | | if (result.entity.ConsumableorderdetailsRecordsError != null) { |
| | | this.adjustdata = JSON.parse( |
| | | result.entity.ConsumableorderdetailsRecordsError |
| | | ); |
| | | for (let i in this.detailData) { |
| | | this.detailData[i].Name__c = this.detailData[i].Prod.Name__c; |
| | | this.detailData[i].Count_Sum__c = this.detailData[i].orderdetails1.Count_Sum__c; |
| | | this.detailData[i].inventory_sum__c = this.detailData[i].orderdetails1.inventory_sum__c; |
| | | this.detailData[i].Diff__c = this.detailData[i].orderdetails1.Diff__c; |
| | | this.detailData[i].Product_Refind__c = this.detailData[i].orderdetails1.Product_Refind__c; |
| | | this.detailData[i].Lose_reason__c = this.detailData[i].orderdetails1.Lose_reason__c; |
| | | } |
| | | for (let i in this.adjustdata) { |
| | | this.adjustdata[i].Name__c = this.adjustdata[i].Prod.Name__c; |
| | | this.adjustdata[i].Asset_Model_No__c = this.adjustdata[i].Prod.Asset_Model_No__c; |
| | | this.adjustdata[i].Lose_reason__c = this.adjustdata[i].orderdetails2.Lose_reason__c; |
| | | this.adjustdata[i].Lose_Flag__c = this.adjustdata[i].orderdetails2.Lose_Flag__c; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | console.log("result盘点Id" + JSON.stringify(this.conId)); |
| | | console.log("调整明细" + JSON.stringify(this.adjustdata)); |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error = " + JSON.stringify(error)); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightningCommunity__Page</target> |
| | | <target>lightningCommunity__Default</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .exampleHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="EquipmentRentalPDF" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, track, wire, api } from 'lwc'; |
| | | import { CurrentPageReference,NavigationMixin } from 'lightning/navigation'; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | |
| | | import init from '@salesforce/apex/loanerArrangedEmailController.init'; |
| | | import getRentalApplyEquipmentSet from '@salesforce/apex/loanerArrangedEmailController.getRentalApplyEquipmentSet'; |
| | | import approvalCheck from '@salesforce/apex/RentalApplyWebService.approvalCheck'; |
| | | import setShipment_request from '@salesforce/apex/RentalApplyWebService.approvalCheck'; |
| | | export default class lexLoanerArrangedEmail extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if(currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if(urlValue) { |
| | | let str = `${urlValue}`; |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(this.recordId); |
| | | console.log('result==='+JSON.stringify(result)); |
| | | if(result != null) { |
| | | if( result.WeiAssignedCnt > 0 ) { |
| | | alert("申请单内存在未分配的配套,请分配备品或分割申请单"); |
| | | }else if(result.CampaignStatus == "取消") { |
| | | alert("学会取消,不可出库指示"); |
| | | }else if (result.RaStatus == "已出库指示" && result.AssignedNotShipment == 0){ |
| | | alert("所有的借出备品Set一览都进行过出库指示了"); |
| | | }else if (result.AssignedNotShipment == 0) { |
| | | alert("没有可以出库指示的明细"); |
| | | }else if (result.DemoPurpose1 == "长期借出" && result.ContractPdfUpdated == 0){ |
| | | alert("长期借出时,必须先上传契约书"); |
| | | }else if (result.RepairId != '' && (result.RepairFinalInspectionDateF != null && result.RepairFinalInspectionDateF != '') || (result.RCReturnToOffice != null && result.RCReturnToOffice != '')){ |
| | | alert("修理有最终检测日或修理品返送日,不可出库指示"); |
| | | }else if (result.IFApproved == "true" && (result.MeetingApprovedNo == null || result.MeetingApprovedNo == "")){ |
| | | alert("没有决裁号的,暂不能出借,请更新裁决信息。"); |
| | | }else if (result.IFApproved == "true" && result.MeetingApprovedNo != "" && result.StatusList.indexOf(records[0].Approved_Status__c) != -1){ |
| | | alert("已申请决裁但决裁状态不符合条件。"); |
| | | }else { |
| | | approvalCheck({ |
| | | rentalApplyId: this.recordId |
| | | }).then(res=>{ |
| | | if (res != '1') { |
| | | alert(rs1); |
| | | } else { |
| | | //bp2 var rs2 = sforce.apex.execute("RentalApplyWebService", "reserve", {rentalApplyId: raid}); |
| | | //bp2 if (rs2 != '1') { |
| | | //bp2 alert(rs2); |
| | | //bp2 } else { |
| | | //var rs1 = sforce.apex.execute("RentalApplyWebService", "setShipment_request", {raid : "{!Rental_Apply__c.Id}"}); |
| | | |
| | | setShipment_request({ |
| | | raid: this.recordId |
| | | }).then(res=>{ |
| | | if (res == "状态更新到已出库指示") { |
| | | alert("状态更新到已出库指示"); |
| | | print(); |
| | | setTimeout(function() { |
| | | location.href = "/{!Rental_Apply__c.Id}"; |
| | | },100); |
| | | }else { |
| | | alert(res); |
| | | } |
| | | }).catch(e=>{ |
| | | console.log('approvalCheck==='+e); |
| | | }) |
| | | } |
| | | }).catch(e=>{ |
| | | console.log('setShipment_request==='+e); |
| | | }) |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | print() { |
| | | getRentalApplyEquipmentSet({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | window.open("https://ocsm--partial.sandbox.lightning.force.com/apex/FixtureRentalPDF?raid=" + this.recordId + "&page=" + result); |
| | | }) |
| | | } |
| | | |
| | | fixDate(date){ |
| | | var Month = fixTime(date.getMonth() + 1); |
| | | var Day = fixTime(date.getDate()); |
| | | var UTC = date.toUTCString(); |
| | | var Time = UTC.substring(UTC.indexOf(':')-2, UTC.indexOf(':')+6); |
| | | var Minutes = fixTime(date.getMinutes()); |
| | | var Seconds = fixTime(date.getSeconds()); |
| | | return date.getFullYear() + "-" + Month + "-" + Day + "T" + Time; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | /* |
| | | * @Description: |
| | | * @version: |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-13 10:31:18 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-13 10:46:09 |
| | | */ |
| | | .lexLoseBidHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="lexLoseBidHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import init from '@salesforce/apex/OpportunityLightingButtonController.initForLoseBidButton'; |
| | | import updateForLoseBidButton from '@salesforce/apex/OpportunityLightingButtonController.updateForLoseBidButton'; |
| | | import queryForLexLoseBidButton from '@salesforce/apex/OpportunityLightingButtonController.queryForLoseBidButton'; |
| | | export default class LexLoseBid extends LightningElement { |
| | | @api recordId; |
| | | ifOpenBid; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log(result); |
| | | this.ifOpenBid = result.ifOpenBid; |
| | | this.lexLoseBid(); |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }) |
| | | } |
| | | lexLoseBid(){ |
| | | console.log("query start"); |
| | | queryForLexLoseBidButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | console.log("query end"); |
| | | console.log(result); |
| | | var flag = true; |
| | | var taskslist = result; |
| | | for(var task of taskslist ){ |
| | | if(task.taskStatus__c != '04 取消'){ |
| | | flag = false; |
| | | } |
| | | } |
| | | if(this.ifOpenBid == '非公开招标'){ |
| | | flag = false; |
| | | } |
| | | |
| | | if(flag){ |
| | | this.showToast("条件不符合,不可操作","error"); |
| | | }else{ |
| | | if (window.confirm('是否确认竞争对手中标?')) { |
| | | updateForLoseBidButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | if (result) { |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.IsLoading = false; |
| | | this.updateRecordView(this.recordId); |
| | | this.showToast("操作成功!","success"); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | } |
| force-app/main/default/lwc/lexLoseBid/lexLoseBid.js-meta.xml
force-app/main/default/lwc/lexLoseReport/lexLoseReport.css
force-app/main/default/lwc/lexLoseReport/lexLoseReport.html
force-app/main/default/lwc/lexLoseReport/lexLoseReport.js
force-app/main/default/lwc/lexLoseReport/lexLoseReport.js-meta.xml
force-app/main/default/lwc/lexLostReturnDeliverySlip/lexLostReturnDeliverySlip.css
force-app/main/default/lwc/lexLostReturnDeliverySlip/lexLostReturnDeliverySlip.html
force-app/main/default/lwc/lexLostReturnDeliverySlip/lexLostReturnDeliverySlip.js
force-app/main/default/lwc/lexLostReturnDeliverySlip/lexLostReturnDeliverySlip.js-meta.xml
force-app/main/default/lwc/lexMailMessege/lexMailMessege.html
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js
force-app/main/default/lwc/lexMailMessege/lexMailMessege.js-meta.xml
force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.css
force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.html
force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js
force-app/main/default/lwc/lexMainFixtureSelect/lexMainFixtureSelect.js-meta.xml
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.css
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.html
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js
force-app/main/default/lwc/lexNewRepairLWC/lexNewRepairLWC.js-meta.xml
force-app/main/default/lwc/lexNewTransferApply/lexNewTransferApply.css
force-app/main/default/lwc/lexNewTransferApply/lexNewTransferApply.html
force-app/main/default/lwc/lexNewTransferApply/lexNewTransferApply.js
force-app/main/default/lwc/lexNewTransferApply/lexNewTransferApply.js-meta.xml
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.css
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.html
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js-meta.xml
force-app/main/default/lwc/lexOCSMNoToReport/lexOCSMNoToReport.css
force-app/main/default/lwc/lexOCSMNoToReport/lexOCSMNoToReport.html
force-app/main/default/lwc/lexOCSMNoToReport/lexOCSMNoToReport.js
force-app/main/default/lwc/lexOCSMNoToReport/lexOCSMNoToReport.js-meta.xml
force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.html
force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js-meta.xml
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.css
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.html
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js-meta.xml
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.html
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js
force-app/main/default/lwc/lexOCSMNoToReportRepair/lexOCSMNoToReportRepair.js-meta.xml
force-app/main/default/lwc/lexOCSMNogoods/lexOCSMNogoods.css
force-app/main/default/lwc/lexOCSMNogoods/lexOCSMNogoods.html
force-app/main/default/lwc/lexOCSMNogoods/lexOCSMNogoods.js
force-app/main/default/lwc/lexOCSMNogoods/lexOCSMNogoods.js-meta.xml
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.css
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.html
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js-meta.xml
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.css
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.html
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js
force-app/main/default/lwc/lexOCSMToReportLighting/lexOCSMToReportLighting.js-meta.xml
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.html
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js
force-app/main/default/lwc/lexOCSMToReportRepair/lexOCSMToReportRepair.js-meta.xml
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.css
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.html
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js
force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js-meta.xml
force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.css
force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.html
force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js-meta.xml
force-app/main/default/lwc/lexOSHInspect/lexOSHInspect.css
force-app/main/default/lwc/lexOSHInspect/lexOSHInspect.html
force-app/main/default/lwc/lexOSHInspect/lexOSHInspect.js
force-app/main/default/lwc/lexOSHInspect/lexOSHInspect.js-meta.xml
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.css
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.html
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js
force-app/main/default/lwc/lexOSHSubmit/lexOSHSubmit.js-meta.xml
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.html
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js
force-app/main/default/lwc/lexPDFMaintenanceCommission/lexPDFMaintenanceCommission.js-meta.xml
force-app/main/default/lwc/lexPDFQISrequest/lexPDFQISrequest.css
force-app/main/default/lwc/lexPDFQISrequest/lexPDFQISrequest.html
force-app/main/default/lwc/lexPDFQISrequest/lexPDFQISrequest.js
force-app/main/default/lwc/lexPDFQISrequest/lexPDFQISrequest.js-meta.xml
force-app/main/default/lwc/lexPaymentPlanLoad/lexPaymentPlanLoad.html
force-app/main/default/lwc/lexPaymentPlanLoad/lexPaymentPlanLoad.js
force-app/main/default/lwc/lexPaymentPlanLoad/lexPaymentPlanLoad.js-meta.xml
force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.html
force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js
force-app/main/default/lwc/lexPreContractSubmit/lexPreContractSubmit.js-meta.xml
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.css
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.html
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js
force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js-meta.xml
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.html
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js
force-app/main/default/lwc/lexProductRepairQuoteRepair/lexProductRepairQuoteRepair.js-meta.xml
force-app/main/default/lwc/lexQISAgree/lexQISAgree.css
force-app/main/default/lwc/lexQISAgree/lexQISAgree.html
force-app/main/default/lwc/lexQISAgree/lexQISAgree.js
force-app/main/default/lwc/lexQISAgree/lexQISAgree.js-meta.xml
force-app/main/default/lwc/lexQISIntakeuniversalcode/lexQISIntakeuniversalcode.css
force-app/main/default/lwc/lexQISIntakeuniversalcode/lexQISIntakeuniversalcode.html
force-app/main/default/lwc/lexQISIntakeuniversalcode/lexQISIntakeuniversalcode.js
force-app/main/default/lwc/lexQISIntakeuniversalcode/lexQISIntakeuniversalcode.js-meta.xml
force-app/main/default/lwc/lexQISSC/lexQISSC.css
force-app/main/default/lwc/lexQISSC/lexQISSC.html
force-app/main/default/lwc/lexQISSC/lexQISSC.js
force-app/main/default/lwc/lexQISSC/lexQISSC.js-meta.xml
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.html
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js
force-app/main/default/lwc/lexQuarterlyReport/lexQuarterlyReport.js-meta.xml
force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.html
force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js
force-app/main/default/lwc/lexQuotationProductNew/lexQuotationProductNew.js-meta.xml
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.css
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.html
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.js
force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.js-meta.xml
force-app/main/default/lwc/lexRCCDScomplete/lexRCCDScomplete.css
force-app/main/default/lwc/lexRCCDScomplete/lexRCCDScomplete.html
force-app/main/default/lwc/lexRCCDScomplete/lexRCCDScomplete.js
force-app/main/default/lwc/lexRCCDScomplete/lexRCCDScomplete.js-meta.xml
force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.css
force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.html
force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js
force-app/main/default/lwc/lexRCRecieved/lexRCRecieved.js-meta.xml
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.css
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.html
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js
force-app/main/default/lwc/lexRCSubmit/lexRCSubmit.js-meta.xml
force-app/main/default/lwc/lexRCinspectioncompletedate/lexRCinspectioncompletedate.css
force-app/main/default/lwc/lexRCinspectioncompletedate/lexRCinspectioncompletedate.html
force-app/main/default/lwc/lexRCinspectioncompletedate/lexRCinspectioncompletedate.js
force-app/main/default/lwc/lexRCinspectioncompletedate/lexRCinspectioncompletedate.js-meta.xml
force-app/main/default/lwc/lexRentalApplyCanleButton/lexRentalApplyCanleButton.css
force-app/main/default/lwc/lexRentalApplyCanleButton/lexRentalApplyCanleButton.html
force-app/main/default/lwc/lexRentalApplyCanleButton/lexRentalApplyCanleButton.js
force-app/main/default/lwc/lexRentalApplyCanleButton/lexRentalApplyCanleButton.js-meta.xml
force-app/main/default/lwc/lexRentalApplyDiscountApproval/lexRentalApplyDiscountApproval.html
force-app/main/default/lwc/lexRentalApplyDiscountApproval/lexRentalApplyDiscountApproval.js
force-app/main/default/lwc/lexRentalApplyDiscountApproval/lexRentalApplyDiscountApproval.js-meta.xml
force-app/main/default/lwc/lexRentalApplyESetRefreshStatus/lexRentalApplyESetRefreshStatus.css
force-app/main/default/lwc/lexRentalApplyESetRefreshStatus/lexRentalApplyESetRefreshStatus.html
force-app/main/default/lwc/lexRentalApplyESetRefreshStatus/lexRentalApplyESetRefreshStatus.js
force-app/main/default/lwc/lexRentalApplyESetRefreshStatus/lexRentalApplyESetRefreshStatus.js-meta.xml
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.css
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.html
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js
force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js-meta.xml
force-app/main/default/lwc/lexRentalApplySubmitedApprovalButton/lexRentalApplySubmitedApprovalButton.css
force-app/main/default/lwc/lexRentalApplySubmitedApprovalButton/lexRentalApplySubmitedApprovalButton.html
force-app/main/default/lwc/lexRentalApplySubmitedApprovalButton/lexRentalApplySubmitedApprovalButton.js
force-app/main/default/lwc/lexRentalApplySubmitedApprovalButton/lexRentalApplySubmitedApprovalButton.js-meta.xml
force-app/main/default/lwc/lexRequestDB/lexRequestDB.css
force-app/main/default/lwc/lexRequestDB/lexRequestDB.html
force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
force-app/main/default/lwc/lexRequestDB/lexRequestDB.js-meta.xml
force-app/main/default/lwc/lexReturnDeliverySlip/lexReturnDeliverySlip.css
force-app/main/default/lwc/lexReturnDeliverySlip/lexReturnDeliverySlip.html
force-app/main/default/lwc/lexReturnDeliverySlip/lexReturnDeliverySlip.js
force-app/main/default/lwc/lexReturnDeliverySlip/lexReturnDeliverySlip.js-meta.xml
force-app/main/default/lwc/lexSICopyDemand/lexSICopyDemand.html
force-app/main/default/lwc/lexSICopyDemand/lexSICopyDemand.js
force-app/main/default/lwc/lexSICopyDemand/lexSICopyDemand.js-meta.xml
force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.css
force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.html
force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js
force-app/main/default/lwc/lexSINewQuoteEntry/lexSINewQuoteEntry.js-meta.xml
force-app/main/default/lwc/lexSISearchSetProduct/lexSISearchSetProduct.css
force-app/main/default/lwc/lexSISearchSetProduct/lexSISearchSetProduct.html
force-app/main/default/lwc/lexSISearchSetProduct/lexSISearchSetProduct.js
force-app/main/default/lwc/lexSISearchSetProduct/lexSISearchSetProduct.js-meta.xml
force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.css
force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.html
force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js-meta.xml
force-app/main/default/lwc/lexSISubmit/lexSISubmit.html
force-app/main/default/lwc/lexSISubmit/lexSISubmit.js
force-app/main/default/lwc/lexSISubmit/lexSISubmit.js-meta.xml
force-app/main/default/lwc/lexSearchProduct/lexSearchProduct.css
force-app/main/default/lwc/lexSearchProduct/lexSearchProduct.html
force-app/main/default/lwc/lexSearchProduct/lexSearchProduct.js
force-app/main/default/lwc/lexSearchProduct/lexSearchProduct.js-meta.xml
force-app/main/default/lwc/lexSearchProductCs/lexSearchProductCs.css
force-app/main/default/lwc/lexSearchProductCs/lexSearchProductCs.html
force-app/main/default/lwc/lexSearchProductCs/lexSearchProductCs.js
force-app/main/default/lwc/lexSearchProductCs/lexSearchProductCs.js-meta.xml
force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.html
force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js
force-app/main/default/lwc/lexSelectAssetsMaintenance/lexSelectAssetsMaintenance.js-meta.xml
force-app/main/default/lwc/lexSelectRental/lexSelectRental.css
force-app/main/default/lwc/lexSelectRental/lexSelectRental.html
force-app/main/default/lwc/lexSelectRental/lexSelectRental.js
force-app/main/default/lwc/lexSelectRental/lexSelectRental.js-meta.xml
force-app/main/default/lwc/lexSelectSubstitute/lexSelectSubstitute.css
force-app/main/default/lwc/lexSelectSubstitute/lexSelectSubstitute.html
force-app/main/default/lwc/lexSelectSubstitute/lexSelectSubstitute.js
force-app/main/default/lwc/lexSelectSubstitute/lexSelectSubstitute.js-meta.xml
force-app/main/default/lwc/lexSendNFM103/lexSendNFM103.html
force-app/main/default/lwc/lexSendNFM103/lexSendNFM103.js
force-app/main/default/lwc/lexSendNFM103/lexSendNFM103.js-meta.xml
force-app/main/default/lwc/lexSendQIS/lexSendQIS.css
force-app/main/default/lwc/lexSendQIS/lexSendQIS.html
force-app/main/default/lwc/lexSendQIS/lexSendQIS.js
force-app/main/default/lwc/lexSendQIS/lexSendQIS.js-meta.xml
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.html
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js
force-app/main/default/lwc/lexSendRepairsToEtQ/lexSendRepairsToEtQ.js-meta.xml
force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.html
force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js
force-app/main/default/lwc/lexServiceCutPriceApply/lexServiceCutPriceApply.js-meta.xml
force-app/main/default/lwc/lexSplitApply/lexSplitApply.css
force-app/main/default/lwc/lexSplitApply/lexSplitApply.html
force-app/main/default/lwc/lexSplitApply/lexSplitApply.js
force-app/main/default/lwc/lexSplitApply/lexSplitApply.js-meta.xml
force-app/main/default/lwc/lexStockApply/lexStockApply.css
force-app/main/default/lwc/lexStockApply/lexStockApply.html
force-app/main/default/lwc/lexStockApply/lexStockApply.js
force-app/main/default/lwc/lexStockApply/lexStockApply.js-meta.xml
force-app/main/default/lwc/lexSubmit/lexSubmit.css
force-app/main/default/lwc/lexSubmit/lexSubmit.html
force-app/main/default/lwc/lexSubmit/lexSubmit.js
force-app/main/default/lwc/lexSubmit/lexSubmit.js-meta.xml
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.css
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.html
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.js
force-app/main/default/lwc/lexSubmitApprovalProcess/lexSubmitApprovalProcess.js-meta.xml
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.css
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.html
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js
force-app/main/default/lwc/lexSubmitCompetitorReport/lexSubmitCompetitorReport.js-meta.xml
force-app/main/default/lwc/lexSubmitExtensionApprovalProcess/lexSubmitExtensionApprovalProcess.css
force-app/main/default/lwc/lexSubmitExtensionApprovalProcess/lexSubmitExtensionApprovalProcess.html
force-app/main/default/lwc/lexSubmitExtensionApprovalProcess/lexSubmitExtensionApprovalProcess.js
force-app/main/default/lwc/lexSubmitExtensionApprovalProcess/lexSubmitExtensionApprovalProcess.js-meta.xml
force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.html
force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js
force-app/main/default/lwc/lexSubmitForApproval/lexSubmitForApproval.js-meta.xml
force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.html
force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.js
force-app/main/default/lwc/lexTenderingAntiLogicButton/lexTenderingAntiLogicButton.js-meta.xml
force-app/main/default/lwc/lexTenderingAttachmentButton/lexTenderingAttachmentButton.html
force-app/main/default/lwc/lexTenderingAttachmentButton/lexTenderingAttachmentButton.js
force-app/main/default/lwc/lexTenderingAttachmentButton/lexTenderingAttachmentButton.js-meta.xml
force-app/main/default/lwc/lexTenderingCopyButton/lexTenderingCopyButton.html
force-app/main/default/lwc/lexTenderingCopyButton/lexTenderingCopyButton.js
force-app/main/default/lwc/lexTenderingCopyButton/lexTenderingCopyButton.js-meta.xml
force-app/main/default/lwc/lexTenderingEnquiryButton/lexTenderingEnquiryButton.html
force-app/main/default/lwc/lexTenderingEnquiryButton/lexTenderingEnquiryButton.js
force-app/main/default/lwc/lexTenderingEnquiryButton/lexTenderingEnquiryButton.js-meta.xml
force-app/main/default/lwc/lexTenderingHospitalButton/lexTenderingHospitalButton.html
force-app/main/default/lwc/lexTenderingHospitalButton/lexTenderingHospitalButton.js
force-app/main/default/lwc/lexTenderingHospitalButton/lexTenderingHospitalButton.js-meta.xml
force-app/main/default/lwc/lexTenderingIntentionButton/lexTenderingIntentionButton.html
force-app/main/default/lwc/lexTenderingIntentionButton/lexTenderingIntentionButton.js
force-app/main/default/lwc/lexTenderingIntentionButton/lexTenderingIntentionButton.js-meta.xml
force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.html
force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.js
force-app/main/default/lwc/lexTenderingLogicButton/lexTenderingLogicButton.js-meta.xml
force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.html
force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js
force-app/main/default/lwc/lexTenderingLostButton/lexTenderingLostButton.js-meta.xml
force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.html
force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js
force-app/main/default/lwc/lexTenderingNoStandardButton/lexTenderingNoStandardButton.js-meta.xml
force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.html
force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js
force-app/main/default/lwc/lexTenderingNotarizeButton/lexTenderingNotarizeButton.js-meta.xml
force-app/main/default/lwc/lexTenderingRelevancyButton/lexTenderingRelevancyButton.html
force-app/main/default/lwc/lexTenderingRelevancyButton/lexTenderingRelevancyButton.js
force-app/main/default/lwc/lexTenderingRelevancyButton/lexTenderingRelevancyButton.js-meta.xml
force-app/main/default/lwc/lexTenderingUsedAttachmentButton/lexTenderingUsedAttachmentButton.html
force-app/main/default/lwc/lexTenderingUsedAttachmentButton/lexTenderingUsedAttachmentButton.js
force-app/main/default/lwc/lexTenderingUsedAttachmentButton/lexTenderingUsedAttachmentButton.js-meta.xml
force-app/main/default/lwc/lexTerminalMaintenance/lexTerminalMaintenance.html
force-app/main/default/lwc/lexTerminalMaintenance/lexTerminalMaintenance.js
force-app/main/default/lwc/lexTerminalMaintenance/lexTerminalMaintenance.js-meta.xml
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.css
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.html
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.js
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.js-meta.xml
force-app/main/default/lwc/lexTransferApplyPDF/lexTransferApplyPDF.css
force-app/main/default/lwc/lexTransferApplyPDF/lexTransferApplyPDF.html
force-app/main/default/lwc/lexTransferApplyPDF/lexTransferApplyPDF.js
force-app/main/default/lwc/lexTransferApplyPDF/lexTransferApplyPDF.js-meta.xml
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.html
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js
force-app/main/default/lwc/lexUploadToRecognitionModel/lexUploadToRecognitionModel.js-meta.xml
force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.html
force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js
force-app/main/default/lwc/lexUploadToSap/lexUploadToSap.js-meta.xml
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.css
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.html
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js-meta.xml
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.css
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.html
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js-meta.xml
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.css
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.html
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js-meta.xml
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.css
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.html
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js-meta.xml
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.css
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.html
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js-meta.xml
force-app/main/default/lwc/lexXinSearchVisitorPlace/lexXinSearchVisitorPlace.css
force-app/main/default/lwc/lexXinSearchVisitorPlace/lexXinSearchVisitorPlace.html
force-app/main/default/lwc/lexXinSearchVisitorPlace/lexXinSearchVisitorPlace.js
force-app/main/default/lwc/lexXinSearchVisitorPlace/lexXinSearchVisitorPlace.js-meta.xml
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.html
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js
force-app/main/default/lwc/lexYanshoudanRequest/lexYanshoudanRequest.js-meta.xml
force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.css
force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.html
force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js
force-app/main/default/lwc/lexcopyQIS/lexcopyQIS.js-meta.xml
force-app/main/default/lwc/listInfiniteScrolling/listInfiniteScrolling.css
force-app/main/default/lwc/listInfiniteScrolling/listInfiniteScrolling.html
force-app/main/default/lwc/listInfiniteScrolling/listInfiniteScrolling.js
force-app/main/default/lwc/listInfiniteScrolling/listInfiniteScrolling.js-meta.xml
force-app/main/default/lwc/listInfiniteScrollingWrapper/listInfiniteScrollingWrapper.html
force-app/main/default/lwc/listInfiniteScrollingWrapper/listInfiniteScrollingWrapper.js
force-app/main/default/lwc/listInfiniteScrollingWrapper/listInfiniteScrollingWrapper.js-meta.xml
force-app/main/default/lwc/listRecordLinks/__mocks__/listRecordLinks.js
force-app/main/default/lwc/listRecordLinks/listRecordLinks.css
force-app/main/default/lwc/listRecordLinks/listRecordLinks.html
force-app/main/default/lwc/listRecordLinks/listRecordLinks.js
force-app/main/default/lwc/listRecordLinks/listRecordLinks.js-meta.xml
force-app/main/default/lwc/listRecordLinksWrapper/listRecordLinksWrapper.html
force-app/main/default/lwc/listRecordLinksWrapper/listRecordLinksWrapper.js
force-app/main/default/lwc/listRecordLinksWrapper/listRecordLinksWrapper.js-meta.xml
force-app/main/default/lwc/listWithParentRecordData/__mocks__/listWithParentRecordData.js
force-app/main/default/lwc/listWithParentRecordData/listWithParentRecordData.css
force-app/main/default/lwc/listWithParentRecordData/listWithParentRecordData.html
force-app/main/default/lwc/listWithParentRecordData/listWithParentRecordData.js
force-app/main/default/lwc/listWithParentRecordData/listWithParentRecordData.js-meta.xml
force-app/main/default/lwc/listWithParentRecordDataWrapper/listWithParentRecordDataWrapper.html
force-app/main/default/lwc/listWithParentRecordDataWrapper/listWithParentRecordDataWrapper.js
force-app/main/default/lwc/listWithParentRecordDataWrapper/listWithParentRecordDataWrapper.js-meta.xml
force-app/main/default/lwc/ll/ll.html
force-app/main/default/lwc/ll/ll.js
force-app/main/default/lwc/ll/ll.js-meta.xml
force-app/main/default/lwc/loanerArrangedEmailLWC/loanerArrangedEmailLWC.css
force-app/main/default/lwc/loanerArrangedEmailLWC/loanerArrangedEmailLWC.html
force-app/main/default/lwc/loanerArrangedEmailLWC/loanerArrangedEmailLWC.js
force-app/main/default/lwc/loanerArrangedEmailLWC/loanerArrangedEmailLWC.js-meta.xml
force-app/main/default/lwc/lookup/lookup.css
force-app/main/default/lwc/lookup/lookup.html
force-app/main/default/lwc/lookup/lookup.js
force-app/main/default/lwc/lookup/lookup.js-meta.xml
force-app/main/default/lwc/maintenanceContract/maintenanceContract.js
force-app/main/default/lwc/newOrderButton/newOrderButton.html
force-app/main/default/lwc/newOrderButton/newOrderButton.js
force-app/main/default/lwc/newOrderButton/newOrderButton.js-meta.xml
force-app/main/default/lwc/newOrderLWC/newOrderLWC.html
force-app/main/default/lwc/newOrderLWC/newOrderLWC.js
force-app/main/default/lwc/newOrderLWC/newOrderLWC.js-meta.xml
force-app/main/default/lwc/newOrderList/newOrderList.html
force-app/main/default/lwc/newOrderList/newOrderList.js
force-app/main/default/lwc/newOrderList/newOrderList.js-meta.xml
force-app/main/default/lwc/newPaymentPlanLoadLWC/newPaymentPlanLoadLWC.css
force-app/main/default/lwc/newPaymentPlanLoadLWC/newPaymentPlanLoadLWC.html
force-app/main/default/lwc/newPaymentPlanLoadLWC/newPaymentPlanLoadLWC.js
force-app/main/default/lwc/newPaymentPlanLoadLWC/newPaymentPlanLoadLWC.js-meta.xml
force-app/main/default/lwc/newRepairLWC/newRepairLWC.css
force-app/main/default/lwc/newRepairLWC/newRepairLWC.html
force-app/main/default/lwc/newRepairLWC/newRepairLWC.js
force-app/main/default/lwc/newRepairLWC/newRepairLWC.js-meta.xml
force-app/main/default/lwc/opdCancelSubmit/opdCancelSubmit.css
force-app/main/default/lwc/opdCancelSubmit/opdCancelSubmit.html
force-app/main/default/lwc/opdCancelSubmit/opdCancelSubmit.js
force-app/main/default/lwc/opdCancelSubmit/opdCancelSubmit.js-meta.xml
force-app/main/default/lwc/opdNewSparePartsLoanApplication/opdNewSparePartsLoanApplication.css
force-app/main/default/lwc/opdNewSparePartsLoanApplication/opdNewSparePartsLoanApplication.html
force-app/main/default/lwc/opdNewSparePartsLoanApplication/opdNewSparePartsLoanApplication.js
force-app/main/default/lwc/opdNewSparePartsLoanApplication/opdNewSparePartsLoanApplication.js-meta.xml
force-app/main/default/lwc/opdReportSubmit/opdReportSubmit.css
force-app/main/default/lwc/opdReportSubmit/opdReportSubmit.html
force-app/main/default/lwc/opdReportSubmit/opdReportSubmit.js
force-app/main/default/lwc/opdReportSubmit/opdReportSubmit.js-meta.xml
force-app/main/default/lwc/opdSupplementaryApplication/opdSupplementaryApplication.css
force-app/main/default/lwc/opdSupplementaryApplication/opdSupplementaryApplication.html
force-app/main/default/lwc/opdSupplementaryApplication/opdSupplementaryApplication.js
force-app/main/default/lwc/opdSupplementaryApplication/opdSupplementaryApplication.js-meta.xml
force-app/main/default/lwc/opdUpdateDate/opdUpdateDate.css
force-app/main/default/lwc/opdUpdateDate/opdUpdateDate.html
force-app/main/default/lwc/opdUpdateDate/opdUpdateDate.js
force-app/main/default/lwc/opdUpdateDate/opdUpdateDate.js-meta.xml
force-app/main/default/lwc/oppLoseButton/oppLoseButton.html
force-app/main/default/lwc/oppLoseButton/oppLoseButton.js
force-app/main/default/lwc/oppLoseButton/oppLoseButton.js-meta.xml
force-app/main/default/lwc/oshRecieved/oshRecieved.css
force-app/main/default/lwc/oshRecieved/oshRecieved.html
force-app/main/default/lwc/oshRecieved/oshRecieved.js
force-app/main/default/lwc/oshRecieved/oshRecieved.js-meta.xml
force-app/main/default/lwc/otherButtonInASACEditor/otherButtonInASACEditor.css
force-app/main/default/lwc/otherButtonInASACEditor/otherButtonInASACEditor.html
force-app/main/default/lwc/otherButtonInASACEditor/otherButtonInASACEditor.js
force-app/main/default/lwc/otherButtonInASACEditor/otherButtonInASACEditor.js-meta.xml
force-app/main/default/lwc/otherButtonInCancelSubmit/OtherButtonInCancelSubmit.css
force-app/main/default/lwc/otherButtonInCancelSubmit/otherButtonInCancelSubmit.html
force-app/main/default/lwc/otherButtonInCancelSubmit/otherButtonInCancelSubmit.js
force-app/main/default/lwc/otherButtonInCancelSubmit/otherButtonInCancelSubmit.js-meta.xml
force-app/main/default/lwc/otherButtonInOpportunity/otherButtonInOpportunity.css
force-app/main/default/lwc/otherButtonInOpportunity/otherButtonInOpportunity.html
force-app/main/default/lwc/otherButtonInOpportunity/otherButtonInOpportunity.js
force-app/main/default/lwc/otherButtonInOpportunity/otherButtonInOpportunity.js-meta.xml
force-app/main/default/lwc/pageBlocks/pageBlocks.html
force-app/main/default/lwc/pageBlocks/pageBlocks.js
force-app/main/default/lwc/pageBlocks/pageBlocks.js-meta.xml
force-app/main/default/lwc/pageBlocksWrapper/pageBlocksWrapper.html
force-app/main/default/lwc/pageBlocksWrapper/pageBlocksWrapper.js
force-app/main/default/lwc/pageBlocksWrapper/pageBlocksWrapper.js-meta.xml
force-app/main/default/lwc/pageMessagesDataRetrieval/__mocks__/pageMessagesDataRetrieval.js
force-app/main/default/lwc/pageMessagesDataRetrieval/pageMessagesDataRetrieval.html
force-app/main/default/lwc/pageMessagesDataRetrieval/pageMessagesDataRetrieval.js
force-app/main/default/lwc/pageMessagesDataRetrieval/pageMessagesDataRetrieval.js-meta.xml
force-app/main/default/lwc/pageMessagesDataRetrievalWrapper/pageMessagesDataRetrievalWrapper.html
force-app/main/default/lwc/pageMessagesDataRetrievalWrapper/pageMessagesDataRetrievalWrapper.js
force-app/main/default/lwc/pageMessagesDataRetrievalWrapper/pageMessagesDataRetrievalWrapper.js-meta.xml
force-app/main/default/lwc/pageMessagesForm/pageMessagesForm.html
force-app/main/default/lwc/pageMessagesForm/pageMessagesForm.js
force-app/main/default/lwc/pageMessagesForm/pageMessagesForm.js-meta.xml
force-app/main/default/lwc/pageMessagesFormWrapper/pageMessagesFormWrapper.html
force-app/main/default/lwc/pageMessagesFormWrapper/pageMessagesFormWrapper.js
force-app/main/default/lwc/pageMessagesFormWrapper/pageMessagesFormWrapper.js-meta.xml
force-app/main/default/lwc/pageMessagesToast/pageMessagesToast.html
force-app/main/default/lwc/pageMessagesToast/pageMessagesToast.js
force-app/main/default/lwc/pageMessagesToast/pageMessagesToast.js-meta.xml
force-app/main/default/lwc/pageMessagesToastWrapper/pageMessagesToastWrapper.html
force-app/main/default/lwc/pageMessagesToastWrapper/pageMessagesToastWrapper.js
force-app/main/default/lwc/pageMessagesToastWrapper/pageMessagesToastWrapper.js-meta.xml
force-app/main/default/lwc/paginatedList/paginatedList.html
force-app/main/default/lwc/paginatedList/paginatedList.js
force-app/main/default/lwc/paginatedList/paginatedList.js-meta.xml
force-app/main/default/lwc/paginatedListWrapper/paginatedListWrapper.html
force-app/main/default/lwc/paginatedListWrapper/paginatedListWrapper.js
force-app/main/default/lwc/paginatedListWrapper/paginatedListWrapper.js-meta.xml
force-app/main/default/lwc/panelBar/panelBar.html
force-app/main/default/lwc/panelBar/panelBar.js
force-app/main/default/lwc/panelBar/panelBar.js-meta.xml
force-app/main/default/lwc/panelBarWrapper/panelBarWrapper.html
force-app/main/default/lwc/panelBarWrapper/panelBarWrapper.js
force-app/main/default/lwc/panelBarWrapper/panelBarWrapper.js-meta.xml
force-app/main/default/lwc/panelGrid/panelGrid.html
force-app/main/default/lwc/panelGrid/panelGrid.js
force-app/main/default/lwc/panelGrid/panelGrid.js-meta.xml
force-app/main/default/lwc/panelGridWrapper/panelGridWrapper.html
force-app/main/default/lwc/panelGridWrapper/panelGridWrapper.js
force-app/main/default/lwc/panelGridWrapper/panelGridWrapper.js-meta.xml
force-app/main/default/lwc/parentComponentTest/__tests__/parentComponentTest.test.js
force-app/main/default/lwc/parentComponentTest/parentComponentTest.html
force-app/main/default/lwc/parentComponentTest/parentComponentTest.js
force-app/main/default/lwc/parentComponentTest/parentComponentTest.js-meta.xml
force-app/main/default/lwc/pocCustomComp/pocCustomComp.html
force-app/main/default/lwc/pocCustomComp/pocCustomComp.js
force-app/main/default/lwc/pocCustomComp/pocCustomComp.js-meta.xml
force-app/main/default/lwc/pocFileUpload/pocFileUpload.html
force-app/main/default/lwc/pocFileUpload/pocFileUpload.js
force-app/main/default/lwc/pocFileUpload/pocFileUpload.js-meta.xml
force-app/main/default/lwc/pocLightningDatatable/customShipmentAmount.html
force-app/main/default/lwc/pocLightningDatatable/customShipmentNumber.html
force-app/main/default/lwc/pocLightningDatatable/customShippingUnitPrice.html
force-app/main/default/lwc/pocLightningDatatable/customUnit.html
force-app/main/default/lwc/pocLightningDatatable/pocFileUpload.html
force-app/main/default/lwc/pocLightningDatatable/pocLightningDatatable.html
force-app/main/default/lwc/pocLightningDatatable/pocLightningDatatable.js
force-app/main/default/lwc/pocLightningDatatable/pocLightningDatatable.js-meta.xml
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.css
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.html
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.js
force-app/main/default/lwc/qisUniversalFailureCode/qisUniversalFailureCode.js-meta.xml
force-app/main/default/lwc/quoteTrial/quoteTrial.html
force-app/main/default/lwc/quoteTrial/quoteTrial.js
force-app/main/default/lwc/quoteTrial/quoteTrialUtil.js
force-app/main/default/lwc/recentProjectsLWC/recentProjectsLWC.html
force-app/main/default/lwc/recentProjectsLWC/recentProjectsLWC.js
force-app/main/default/lwc/recentProjectsLWC/recentProjectsLWC.js-meta.xml
force-app/main/default/lwc/rentalApplyEquipmentRentalPDF/rentalApplyEquipmentRentalPDF.css
force-app/main/default/lwc/rentalApplyEquipmentRentalPDF/rentalApplyEquipmentRentalPDF.html
force-app/main/default/lwc/rentalApplyEquipmentRentalPDF/rentalApplyEquipmentRentalPDF.js
force-app/main/default/lwc/rentalApplyEquipmentRentalPDF/rentalApplyEquipmentRentalPDF.js-meta.xml
force-app/main/default/lwc/rentalApplyLWT/rentalApplyLWT.css
force-app/main/default/lwc/rentalApplyLWT/rentalApplyLWT.html
force-app/main/default/lwc/rentalApplyLWT/rentalApplyLWT.js
force-app/main/default/lwc/rentalApplyLWT/rentalApplyLWT.js-meta.xml
force-app/main/default/lwc/selectSubstituteLWC/selectSubstituteLWC.css
force-app/main/default/lwc/selectSubstituteLWC/selectSubstituteLWC.html
force-app/main/default/lwc/selectSubstituteLWC/selectSubstituteLWC.js
force-app/main/default/lwc/selectSubstituteLWC/selectSubstituteLWC.js-meta.xml
force-app/main/default/lwc/singleRecords/singleRecords.html
force-app/main/default/lwc/singleRecords/singleRecords.js
force-app/main/default/lwc/singleRecords/singleRecords.js-meta.xml
force-app/main/default/lwc/splitApplyLWC/splitApplyLWC.css
force-app/main/default/lwc/splitApplyLWC/splitApplyLWC.html
force-app/main/default/lwc/splitApplyLWC/splitApplyLWC.js
force-app/main/default/lwc/splitApplyLWC/splitApplyLWC.js-meta.xml
force-app/main/default/lwc/tEnquiry/tEnquiry.html
force-app/main/default/lwc/tabs/tabs.html
force-app/main/default/lwc/tabs/tabs.js
force-app/main/default/lwc/tabs/tabs.js-meta.xml
force-app/main/default/lwc/tabsWrapper/tabsWrapper.html
force-app/main/default/lwc/tabsWrapper/tabsWrapper.js
force-app/main/default/lwc/tabsWrapper/tabsWrapper.js-meta.xml
force-app/main/default/lwc/tenderLost/tenderLost.js
force-app/main/default/lwc/test/test.html
force-app/main/default/lwc/test/test.js
force-app/main/default/lwc/test/test.js-meta.xml
force-app/main/default/lwc/testPaginated/__tests__/testPaginated.test.js
force-app/main/default/lwc/testPaginated/testPaginated.html
force-app/main/default/lwc/testPaginated/testPaginated.js
force-app/main/default/lwc/testPaginated/testPaginated.js-meta.xml
force-app/main/default/lwc/toolbar/toolbar.css
force-app/main/default/lwc/toolbar/toolbar.html
force-app/main/default/lwc/toolbar/toolbar.js
force-app/main/default/lwc/toolbar/toolbar.js-meta.xml
force-app/main/default/lwc/toolbarWrapper/toolbarWrapper.html
force-app/main/default/lwc/toolbarWrapper/toolbarWrapper.js
force-app/main/default/lwc/toolbarWrapper/toolbarWrapper.js-meta.xml
force-app/main/default/lwc/topPageLwc/topPageLwc.html
force-app/main/default/lwc/topPageLwc/topPageLwc.js
force-app/main/default/lwc/topPageLwc/topPageLwc.js-meta.xml
force-app/main/default/lwc/viewRecord/viewRecord.html
force-app/main/default/lwc/viewRecord/viewRecord.js
force-app/main/default/lwc/viewRecord/viewRecord.js-meta.xml
force-app/main/default/lwc/viewRecordWithParentRecordData/viewRecordWithParentRecordData.html
force-app/main/default/lwc/viewRecordWithParentRecordData/viewRecordWithParentRecordData.js
force-app/main/default/lwc/viewRecordWithParentRecordData/viewRecordWithParentRecordData.js-meta.xml
force-app/main/default/lwc/viewRecordWithParentRecordDataWrapper/viewRecordWithParentRecordDataWrapper.html
force-app/main/default/lwc/viewRecordWithParentRecordDataWrapper/viewRecordWithParentRecordDataWrapper.js
force-app/main/default/lwc/viewRecordWithParentRecordDataWrapper/viewRecordWithParentRecordDataWrapper.js-meta.xml
force-app/main/default/lwc/viewRecordWrapper/viewRecordWrapper.html
force-app/main/default/lwc/viewRecordWrapper/viewRecordWrapper.js
force-app/main/default/lwc/viewRecordWrapper/viewRecordWrapper.js-meta.xml
force-app/main/default/lwc/viewVfLwcSource/viewVfLwcSource.css
force-app/main/default/lwc/viewVfLwcSource/viewVfLwcSource.html
force-app/main/default/lwc/viewVfLwcSource/viewVfLwcSource.js
force-app/main/default/lwc/viewVfLwcSource/viewVfLwcSource.js-meta.xml
force-app/main/default/package.xml (deleted)
force-app/main/default/pages/AccChangeApprovalResponse.page
force-app/main/default/pages/Inventory.page
force-app/main/default/pages/InventoryView.page
force-app/main/default/pages/summonsCreat.page
manifest/package.xml (deleted)
manifest/packageForLex copy.xml
manifest/packageForSign.xml
package-lock.json
package.json |