.prettierrc | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
.sf/config.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
force-app/main/default/classes/AccAssumeChangeBatch.cls | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
force-app/main/default/classes/AccessorySelectController.cls | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
force-app/main/default/pages/AccChangeApprovalResponse.page | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
package-lock.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
package.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
.prettierrc
@@ -3,11 +3,25 @@ "overrides": [ { "files": "**/lwc/**/*.html", "options": { "parser": "lwc" } "options": { "tabWidth": 4, "parser": "lwc" } }, { "files": "**/*.{cls,trigger,apex}", "options": { "apexInsertFinalNewline": true, "printWidth": 140, "tabWidth": 4 } }, { "files": "*.{cmp,page,component}", "options": { "parser": "html" } "options": { "parser": "html", "tabWidth": 4 } } ] } } .sf/config.json
New file @@ -0,0 +1,3 @@ { "target-org": "OlympusPIPLDev" } force-app/main/default/classes/AccAssumeChangeBatch.cls
@@ -1,16 +1,15 @@ global class AccAssumeChangeBatch implements Database.Batchable<sObject> , Database.AllowsCallouts, Database.Stateful { public List<Account> HospitalIdList;//执行失败手动录入医院 global class AccAssumeChangeBatch implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful { public List<Account> HospitalIdList; //执行失败手动录入医院 Boolean a = true; //执行失败手动录入医院 global AccAssumeChangeBatch(List<Account> HospitalIdList) { this.HospitalIdList = HospitalIdList; } global AccAssumeChangeBatch( boolean a) { global AccAssumeChangeBatch(boolean a) { this.a = a; } // 执行靶器 global AccAssumeChangeBatch() { } global Database.QueryLocator start(Database.BatchableContext bc) { @@ -26,15 +25,20 @@ } 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>(); Map<String, String> failedAccountMap = new Map<String, String>();//如果招投标更新失败,用来存更新失败的招投标所关联的医院 Map<String, String> failedAccountMap = new Map<String, String>(); //如果招投标更新失败,用来存更新失败的招投标所关联的医院 // 空更新招投标 Database.SaveResult[] saveTenderResults = Database.update(TenInfoList, false); // 循环更新结果,取出空更新失败的招投标所对应的医院 @@ -53,9 +57,9 @@ failedAccountMap.put(Hospital4Id, Hospital4Id); } } List<Account> accsList = new List<Account>();// 用来更新客户信息(担当发生变化) List<Account> accsList = new List<Account>(); // 用来更新客户信息(担当发生变化) for (Account accs : HosinfoList) { if (!failedAccountMap.containsKey(accs.Id) ) { if (!failedAccountMap.containsKey(accs.Id)) { accs.Assume_Change__c = false; accsList.add(accs); } @@ -67,6 +71,5 @@ } global void finish(Database.BatchableContext BC) { } } } force-app/main/default/classes/AccessorySelectController.cls
@@ -5,7 +5,7 @@ * RentalFixtureManage2Test */ public with sharing class AccessorySelectController extends CreateRelationListPagingCtrlBase { public override Integer getSearchNumMax() { public override Integer getSearchNumMax() { //各ページに制御あれば、最大件数を指定する searchNumMax = Integer.valueOf(Label.Product_Select_Limit); searchNumMax = 20; @@ -19,9 +19,9 @@ selectedDataSql += ' where Rental_Apply_Equipment_Set__c = \'' + String.escapeSingleQuotes(parentId) + '\''; selectedDataSql += ' and Is_Body__c = false'; selectedDataSql += ' and Cancel_Select__c = False'; selectedDataSql += ' and (ApplyPersonAppended_F__c = false OR (' ; selectedDataSql += ' and (ApplyPersonAppended_F__c = false OR ('; selectedDataSql += ' ApplyPersonAppended_F__c = true AND (Add_Request_approval_time__c != null OR Select_Time__c != null)))'; selectedDataSql += ' order by Name ASC nulls last'; // order by Fixture_Set_Detail__r.SortInt__c selectedDataSql += ' order by Name ASC nulls last'; // order by Fixture_Set_Detail__r.SortInt__c return selectedDataSql; } @@ -55,17 +55,34 @@ 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() { return new List<String>{'Cancel_Reason__c','Loaner_cancel_reason__c','Loaner_cancel_Remarks__c'}; return new List<String>{ 'Cancel_Reason__c', 'Loaner_cancel_reason__c', 'Loaner_cancel_Remarks__c' }; // 20210818 ljh SFDC-C448KZ add } // getObjName 连 getOriginObjName 的 FK @@ -83,7 +100,6 @@ public override String getSqlWhereStr() { sqlWhereStr = ''; return sqlWhereStr; } public override Boolean getIsNeedRunSearch() { @@ -95,7 +111,6 @@ /*****************検索用******************/ /*****************ソート時再検索条件(画面からの入力条件を無視するため)******************/ public String saveType { get; set; } @@ -103,13 +118,13 @@ public Rental_Apply_Equipment_Set__c parentObj { get; set; } public Rental_Apply_Equipment_Set_Detail__c sonObj { get; set; } // 20210817 ljh SFDC-C448KZ add public Boolean bieField { get; set; } // 别省、别本部别存放地 public Boolean bieField { get; set; } // 别省、别本部别存放地 List<Boolean> showButtonList = new List<Boolean>(); public String bieCunFangDi { get; set; } //别存放地, 肯定有值 不为null public String bieCunFangDi { get; set; } //别存放地, 肯定有值 不为null // #OLY_OCM-654 因为MA本部和产品培训本部还是需要检索条件,所以需要别本部的检索条件 Start public String bieBenBu { get; set; } //别本部 public String bieBenBu { get; set; } //别本部 public Set<String> benbuSet; // #OLY_OCM-654 因为MA本部和产品培训本部还是需要检索条件,所以需要别本部的检索条件 End @@ -117,454 +132,453 @@ // public String bieChanPinFenLei { get; set; } //产品分类 // public String bieBiePinFenLei { get; set; } //别备品分类 // #OLY_OCM-654 End public Rental_Apply_Equipment_Set_Detail__c pageRaesd {get; set;} public Rental_Apply_Equipment_Set_Detail__c pageRaesd { get; set; } public AccessorySelectController() { 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++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; i++; parentId = ApexPages.currentPage().getParameters().get('pt_recid'); pageRaesd = new Rental_Apply_Equipment_Set_Detail__c(); this.bieField = true; @@ -572,56 +586,68 @@ //借出备品一览の情報を取得 if (!String.isBlank(this.parentId)) { List<Rental_Apply_Equipment_Set__c> parentObjs = [ SELECT Id, Rental_Apply__r.Name, Rental_Apply__r.Owner.Name, Rental_Apply__r.Salesdept__c, Rental_Apply__r.WorkPlace__c, Rental_Apply__r.Request_shipping_day__c, Fu_Shu_Pin_Fen_Pei_Jia__c, Rental_Apply__r.Demo_purpose1__c, Rental_Apply__r.demo_purpose2__c, Fixture_Set__r.Product_Category_GI_SP__c, Rental_Apply__r.Product_category__c, Fixture_Set__r.Equipment_Type__c, Rental_Apply__r.Equipment_Type_F__c, Rental_Apply__r.Internal_asset_location_F__c, Rental_Apply__r.Request_return_day__c, Fixture_Set__r.Fixture_Set_Body_Model_No__c, Rental_Apply__r.Salesdepartment__c, SerialNumber_F__c, Rental_Start_Date__c, Rental_End_Date__c, Irreplaceable_flag__c, RequestNoJoinStr2__c, First_RAESD__c, First_RAESD__r.Is_Body__c FROM Rental_Apply_Equipment_Set__c where Id = :parentId]; if(parentObjs.size()>0){ SELECT Id, Rental_Apply__r.Name, Rental_Apply__r.Owner.Name, Rental_Apply__r.Salesdept__c, Rental_Apply__r.WorkPlace__c, Rental_Apply__r.Request_shipping_day__c, Fu_Shu_Pin_Fen_Pei_Jia__c, Rental_Apply__r.Demo_purpose1__c, Rental_Apply__r.demo_purpose2__c, Fixture_Set__r.Product_Category_GI_SP__c, Rental_Apply__r.Product_category__c, Fixture_Set__r.Equipment_Type__c, Rental_Apply__r.Equipment_Type_F__c, Rental_Apply__r.Internal_asset_location_F__c, Rental_Apply__r.Request_return_day__c, Fixture_Set__r.Fixture_Set_Body_Model_No__c, Rental_Apply__r.Salesdepartment__c, SerialNumber_F__c, Rental_Start_Date__c, Rental_End_Date__c, Irreplaceable_flag__c, RequestNoJoinStr2__c, First_RAESD__c, First_RAESD__r.Is_Body__c FROM Rental_Apply_Equipment_Set__c WHERE Id = :parentId ]; if (parentObjs.size() > 0) { parentObj = parentObjs.get(0); String rsdid=System.label.Rental_Apply_id; String rsdid = System.label.Rental_Apply_id; List<Rental_Apply_Equipment_Set_Detail__c> raesdObjs = [ 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]; 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 ]; if (!raesdObjs.isEmpty()) { sonObj = raesdObjs[0]; } 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 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]; 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 ]; if (!bodyObjs.isEmpty()) { if (bodyObjs[0].Select_Time__c != null) { bieCunFangDi = bodyObjs[0].Internal_asset_location_before__c; bieBenBu = bodyObjs[0].Salesdepartment_before__c; // #OLY_OCM-654 MA和产品检测本部是需要检索的,所以不注释 bieBenBu = bodyObjs[0].Salesdepartment_before__c; // #OLY_OCM-654 MA和产品检测本部是需要检索的,所以不注释 // #OLY_OCM-654 Start // bieChanPinFenLei = bodyObjs[0].Product_category_text__c; // bieBiePinFenLei = bodyObjs[0].Equipment_Type_text__c; @@ -632,7 +658,7 @@ } if (String.isBlank(bieCunFangDi)) { bieCunFangDi = parentObj.Rental_Apply__r.Internal_asset_location_F__c; bieBenBu = parentObj.Rental_Apply__r.Salesdepartment__c; // #OLY_OCM-654 MA和产品检测本部是需要检索的,所以不注释 bieBenBu = parentObj.Rental_Apply__r.Salesdepartment__c; // #OLY_OCM-654 MA和产品检测本部是需要检索的,所以不注释 // #OLY_OCM-654 Start // bieChanPinFenLei = parentObj.Rental_Apply__r.Product_category__c; // bieBiePinFenLei = parentObj.Rental_Apply__r.Equipment_Type_F__c; @@ -642,7 +668,6 @@ throw new ControllerUtil.myException('不能明确存放地, 请确认数据。'); } } } // 20210817 ljh SFDC-C448KZ update end } @@ -667,26 +692,20 @@ 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() { @@ -709,7 +728,7 @@ PageReference pg; if (parentObj.First_RAESD__r.Is_Body__c) { pg = new PageReference('/apex/MainFixtureSelect'); pg.getParameters().put('pt_recid',parentId); pg.getParameters().put('pt_recid', parentId); pg.setRedirect(true); } else { pg = new PageReference('/' + parentId); @@ -730,7 +749,9 @@ 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); @@ -742,15 +763,20 @@ 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, 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]); 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 ] ); Map<Id, Asset> assetUpdateMap = new Map<Id, Asset>(); // 状态只有是可以分配时才会保存 @@ -761,20 +787,29 @@ } 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 } //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到数据的时候 if (aSet == null) { throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,不是有效的附属品,请刷新画面后重新操作'); throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,不是有效的附属品,请刷新画面后重新操作'); } // 分配时间 (Asset__c 从 null 到 有值) if (robj.Select_Time__c == null) { @@ -787,11 +822,11 @@ Integer num = Integer.valueof(aSet.Quantity - aSet.Out_of_wh__c); // 备品有效库存没有时,程序返回并提示错误信息 if (num < 1) { throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,没有足够有效库存,请刷新画面后重新操作'); throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,没有足够有效库存,请刷新画面后重新操作'); } // 20220118 ljh SFDC-C9V84U start if(aSet.Ji_Zhong_Guan_Li_Ku_Cun__c <= 0){ throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,集中库库存不足,请刷新画面后重新操作'); if (aSet.Ji_Zhong_Guan_Li_Ku_Cun__c <= 0) { throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,集中库库存不足,请刷新画面后重新操作'); } // 20220118 ljh SFDC-C9V84U end //aSet.Out_of_wh__c = aSet.Out_of_wh__c + 1; @@ -799,8 +834,14 @@ //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; @@ -830,7 +871,7 @@ saveType = ''; return null; } else if (saveType == '2') { // ソート時の変更ある // ソート時の変更ある myComponentController.sortTable(); saveType = ''; return null; @@ -844,11 +885,10 @@ } } /** *#OLY_OCM-668 取消附属品分配 *@return PageReference 刷新附属品选择页面 */ public PageReference unassign(){ *#OLY_OCM-668 取消附属品分配 *@return PageReference 刷新附属品选择页面 */ public PageReference unassign() { Savepoint sp = Database.setSavepoint(); try { @@ -859,34 +899,32 @@ for (WrapperInfo wprInfo : viewList) { Rental_Apply_Equipment_Set_Detail__c robj = (Rental_Apply_Equipment_Set_Detail__c) wprInfo.sobj; if (!String.isBlank(robj.Asset__c)) { assetIdList.add(robj.Asset__c); raesdIdList.add(robj.Id); assetIdList.add(robj.Asset__c); raesdIdList.add(robj.Id); } } // 加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 FROM Rental_Apply_Equipment_Set_Detail__c WHERE Id in :raesdIdList FOR UPDATE]); 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 ] ); 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]; @@ -895,24 +933,24 @@ if (!wprInfo.check) { continue; } if(robjOnline.Cancel_Date__c != null){ throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,已经取消申请了,不能取消分配'); if (robjOnline.Cancel_Date__c != null) { throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,已经取消申请了,不能取消分配'); } if(robjOnline.StockDown_time__c != null){ throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,已下架,不可以取消分配'); if (robjOnline.StockDown_time__c != null) { throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,已下架,不可以取消分配'); } if(robjOnline.Select_Time__c == null){ throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,还没有被分配,不可以取消分配'); if (robjOnline.Select_Time__c == null) { throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,还没有被分配,不可以取消分配'); } // OLY_OCM-668 一对一附属品不能取消分配:系统逻辑保持不变 if (String.isNotBlank(robjOnline.Fixture_OneToOne_Link_Id__c)) { throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,一对一分配的附属品,不能取消分配'); throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,一对一分配的附属品,不能取消分配'); } Asset aSet = aSetMap.get(robj.Asset__c); // 不能lock到数据的时候 if (aSet == null) { throw new ControllerUtil.myException('第' + (indexNum + 1) +'行,不是有效的附属品,请刷新画面后重新操作'); throw new ControllerUtil.myException('第' + (indexNum + 1) + '行,不是有效的附属品,请刷新画面后重新操作'); } // 相关字段置为 null @@ -941,8 +979,14 @@ // 备品管理编码(借出时) 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); @@ -951,13 +995,10 @@ 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; @@ -965,18 +1006,16 @@ // 刷新画面 PageReference pg = new PageReference('/apex/AccessorySelect'); pg.getParameters().put('pt_recid',parentId); pg.getParameters().put('pt_recid', parentId); pg.setRedirect(true); return pg; } // https://sohobb.backlog.jp/view/OLY_OCM-152#comment-20041467 // 一对一的附属品 不能 单独 取消 public PageReference cancel() { Savepoint sp = Database.setSavepoint(); try{ try { List<Rental_Apply_Equipment_Set_Detail__c> raesds = new List<Rental_Apply_Equipment_Set_Detail__c>(); List<Id> delIds = new List<Id>(); for (WrapperInfo wprInfo : viewList) { @@ -996,7 +1035,6 @@ 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, '请输入取消理由')); @@ -1007,7 +1045,7 @@ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '请输入明细取消理由')); return null; } if (robj.Loaner_cancel_reason__c=='其他' && String.isBlank(robj.Loaner_cancel_Remarks__c)) { if (robj.Loaner_cancel_reason__c == '其他' && String.isBlank(robj.Loaner_cancel_Remarks__c)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '请输入取消理由备注')); return null; } @@ -1026,20 +1064,21 @@ 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 //借出备品Set一览明细.分配时间 // if (robj.Select_Time__c != null) { // robj.Select_Time__c = null; // } //借出备品Set一览明细 trigger 里 clear Asset__c //借出备品Set一览明细.分配时间 // if (robj.Select_Time__c != null) { // robj.Select_Time__c = null; // } //} raesds.add(robj); } } } } @@ -1053,7 +1092,7 @@ // 取消操作,只是取消已选择的分配,画面刷新 PageReference pg = new PageReference('/apex/AccessorySelect'); pg.getParameters().put('pt_recid',parentId); pg.getParameters().put('pt_recid', parentId); pg.setRedirect(true); return pg; } @@ -1096,7 +1135,11 @@ 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++) { @@ -1114,14 +1157,16 @@ 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)); } } // liucheng 20171112 else { else { rsdObj.put(apikey, rsdGroupInfo.get(apikey).gnum); } } @@ -1167,7 +1212,10 @@ } 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>()); @@ -1194,28 +1242,32 @@ // 検索条件 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 + + ' 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'; 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'; System.debug('bieWhere' + bieWhere); List<Asset> assignList = Database.query(soql); List<Asset> assignList = Database.query(soql); for (Asset aSet : assignList) { List<Asset> autoSelectList = autoSelectMap.get(aSet.Fixture_Model_No_F__c); @@ -1244,15 +1296,17 @@ Integer autoKuCun = autoKuCunMap.get(aSet.Id); if (autoKuCun > 0) { rsdObj.Asset__c = aSet.Id; rsdObj.Asset__r = aSet; // TODO Select Asset より 表示Fieldの設定 myComponentController.strColumus rsdObj.Asset__r = aSet; // TODO Select Asset より 表示Fieldの設定 myComponentController.strColumus autoKuCun--; autoKuCunMap.put(aSet.Id, autoKuCun); break; // 下一条借出明细 break; // 下一条借出明细 } } 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()) ); } } } @@ -1262,7 +1316,7 @@ if (queryList.size() == 0) { return; } system.debug('●●●●● setViewList END ' ); system.debug('●●●●● setViewList END '); } public override void checkEvent() { @@ -1282,4 +1336,4 @@ public String getBodyModelNoJson() { return JSON.serialize(showButtonList); } } } force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.html
@@ -1,108 +1,164 @@ <template> <div class="exampleHolder" if:true={IsLoading} > <lightning-spinner alternative-text="Loading" size="large"></lightning-spinner> </div> <div style="padding:30px"> <div style="float:right" > <div class="demo-only demo-only_viewport" style="height:4.5rem;" if:true = {Tongzhishow}> <div class="slds-notification-container" style={IsLeftStyle}> <div aria-live="assertive" aria-atomic="true" class="slds-assistive-text">提示</div> <section class="slds-notification" role="dialog" aria-labelledby="noti77" aria-describedby="dialog-body-id-43" > <div class="slds-notification__body" id="dialog-body-id-43" > <a class="slds-notification__target slds-media" href="#" style={BgColorStyle}> <span class="slds-icon_container slds-icon-standard-task slds-media__figure" title="task"> <lightning-icon icon-name={TongzhiIcon} alternative-text="Account" title="Account"></lightning-icon> </span> <div class="slds-media__body"> <h2 class="slds-text-heading_small slds-m-bottom_xx-small" id="noti77"> <span class="slds-assistive-text">task notification:</span>提示</h2> <p>{SaveShowText}</p> <div class="exampleHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="large" ></lightning-spinner> </div> <div style="padding: 30px"> <div style="float: right"> <div class="demo-only demo-only_viewport" style="height: 4.5rem" if:true={Tongzhishow} > <div class="slds-notification-container" style={IsLeftStyle}> <div aria-live="assertive" aria-atomic="true" class="slds-assistive-text" > 提示 </div> <section class="slds-notification" role="dialog" aria-labelledby="noti77" aria-describedby="dialog-body-id-43" > <div class="slds-notification__body" id="dialog-body-id-43" > <a class="slds-notification__target slds-media" href="#" style={BgColorStyle} > <span class="slds-icon_container slds-icon-standard-task slds-media__figure" title="task" > <lightning-icon icon-name={TongzhiIcon} alternative-text="Account" title="Account" ></lightning-icon> </span> <div class="slds-media__body"> <h2 class="slds-text-heading_small slds-m-bottom_xx-small" id="noti77" > <span class="slds-assistive-text" >task notification:</span >提示 </h2> <p>{SaveShowText}</p> </div> </a> <button class="slds-button slds-button_icon slds-button_icon-container slds-notification__close" title="close" > <lightning-icon icon-name="utility:close" alternative-text="close" title="close" size="x-small" onclick={CloseAlert} ></lightning-icon> </button> </div> </section> </div> </a> <button class="slds-button slds-button_icon slds-button_icon-container slds-notification__close" title="close"> <lightning-icon icon-name="utility:close" alternative-text="close" title="close" size="x-small" onclick={CloseAlert}></lightning-icon> </button> </div> </section> </div> </div> </div> <p><lightning-formatted-text value="当前预测OCSM签约日 : " ></lightning-formatted-text>{opp.Close_Forecasted_Check}</p> <p> <lightning-formatted-text value="当前预测OCSM签约日 : " ></lightning-formatted-text >{opp.Close_Forecasted_Check} </p> <div class={xgxLy} style="width: 495px;padding:1px"> <lightning-combobox name="progress" label="日期提前/日期延后" value={opp.Date_InAdvance_Delay} options={RelateOption} onchange={handleRelationFn} > </lightning-combobox> </div> <div class={xgxLy} style="width: 495px; padding: 1px"> <lightning-combobox name="progress" label="日期提前/日期延后" value={opp.Date_InAdvance_Delay} options={RelateOption} onchange={handleRelationFn} > </lightning-combobox> </div> <!-- 提前 --> <div class={bxgLy} if:true={isAdvance}> <lightning-combobox name="progress" label="预测日期提前理由" value={opp.Predicted_date_ChangeReason} placeholder="请选择提前理由" options={AdvanceReasons} style="width: 495px;padding:1px" onchange={handleRelationFn1} > </lightning-combobox> <div style="font-size:10px;color:red" if:true={bxgLyFlag}>请选择提前理由</div> </div> <!-- 提前 --> <div class={bxgLy} if:true={isAdvance}> <lightning-combobox name="progress" label="预测日期提前理由" value={opp.Predicted_date_ChangeReason} placeholder="请选择提前理由" options={AdvanceReasons} style="width: 495px; padding: 1px" onchange={handleRelationFn1} > </lightning-combobox> <div style="font-size: 10px; color: red" if:true={bxgLyFlag}> 请选择提前理由 </div> </div> <!-- 延后 --> <!-- onchange={handleIrrelevantFn} --> <div class={bxgLy} if:true={isDelay}> <lightning-combobox name="progress" label="预测日期延后理由" value={opp.Predicted_date_ChangeReason} placeholder="请选择延后理由" options={DelayReasons} style="width: 495px;padding:1px" onchange={handleRelationFn1} <!-- 延后 --> <!-- onchange={handleIrrelevantFn} --> <div class={bxgLy} if:true={isDelay}> <lightning-combobox name="progress" label="预测日期延后理由" value={opp.Predicted_date_ChangeReason} placeholder="请选择延后理由" options={DelayReasons} style="width: 495px; padding: 1px" onchange={handleRelationFn1} > </lightning-combobox> <div style="font-size: 10px; color: red" if:true={bxgLyFlag}> 请选择延后理由 </div> </div> <!-- 改变日期 --> <div> <lightning-input type="date" label="请选择要改变的日期" name="aaa" style="width: 495px; padding: 1px" value={opp.Close_Forecasted_Date} onchange={handleRelationFn2} > </lightning-input> </div> <div if:true={flg}> <lightning-input type="date" label="预测发货日" name="aa" style="width: 495px; padding: 1px" value={opp.CloseDate} onchange={handleRelationFn3} > </lightning-input> </div> <button class="slds-button slds-button_brand" onclick={saveFn} style="margin-top: 10px" > </lightning-combobox> <div style="font-size:10px;color:red" if:true={bxgLyFlag}>请选择延后理由</div> 保存 </button> </div> <!-- 改变日期 --> <div> <lightning-input type="date" label="请选择要改变的日期" name="aaa" style="width: 495px;padding:1px" value={opp.Close_Forecasted_Date} onchange={handleRelationFn2} > </lightning-input> </div> <div if:true={flg}> <lightning-input type="date" label="预测发货日" name="aa" style="width: 495px;padding:1px" value={opp.CloseDate} onchange={handleRelationFn3} > </lightning-input> </div> <button class="slds-button slds-button_brand" onclick={saveFn} style="margin-top: 10px" > 保存 </button> </div> </template> </template> force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js
@@ -1,250 +1,251 @@ import { LightningElement, track } from 'lwc'; import GetOppinformationcData from '@salesforce/apex/ImprovedForecastTimeController.GetOppinformationcData'; import getReason from '@salesforce/apex/ImprovedForecastTimeController.getReason'; import SaveData from '@salesforce/apex/ImprovedForecastTimeController.SaveData'; import SystemModstamp from '@salesforce/schema/Account.SystemModstamp'; import { LightningElement, track } from "lwc"; import GetOppinformationcData from "@salesforce/apex/ImprovedForecastTimeController.GetOppinformationcData"; import getReason from "@salesforce/apex/ImprovedForecastTimeController.getReason"; import SaveData from "@salesforce/apex/ImprovedForecastTimeController.SaveData"; import SystemModstamp from "@salesforce/schema/Account.SystemModstamp"; export default class ImprovedForecastTime extends LightningElement { //显示与隐藏 isAdvance = false; //选着 提前 的标识 isDelay = false; //选着 延后 的标识 //显示与隐藏 isAdvance = false; //选着 提前 的标识 isDelay = false; //选着 延后 的标识 RelateOption = [ { label: "提前", value: "提前" }, { label: "延后", value: "延后" } ]; RelateOption=[ {label:"提前",value:"提前"}, {label:"延后",value:"延后"}, ] handleRelationFn(event){ handleRelationFn(event) { var value = event.target.value; this.opp.Date_InAdvance_Delay = value; debugger; // this.opp.Predicted_date_ChangeReason__c = ''; //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start this.opp.Predicted_date_ChangeReason = ""; this.opp.Close_Forecasted_Date = ""; this.opp.CloseDate = ""; //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end if (value == "提前") { this.isAdvance = true; this.isDelay = false; } if (value == "延后") { this.isAdvance = false; this.isDelay = true; } } var value = event.target.value; this.opp.Date_InAdvance_Delay = value; debugger // this.opp.Predicted_date_ChangeReason__c = ''; //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start this.opp.Predicted_date_ChangeReason = '' this.opp.Close_Forecasted_Date= ''; this.opp.CloseDate= ''; //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end if (value == "提前") { this.isAdvance = true; this.isDelay = false; } if (value == "延后") { this.isAdvance = false; this.isDelay = true; } handleRelationFn1(event) { var value = event.target.value; this.opp.Predicted_date_ChangeReason = value; } flg = true; handleRelationFn2(event) { var value = event.target.value; this.opp.Close_Forecasted_Date = value; this.flg = false; debugger; this.CloseDateAssignment(value); } //给预测发货日赋值 CloseDateAssignment(value) { debugger; var value = this.addDay(30, value); this.opp.CloseDate = value; this.flg = true; } //加天数 addDay(dayNumber, value1) { var date = new Date(value1); var ms = dayNumber * (1000 * 60 * 60 * 24); var newDate = new Date(date.getTime() + ms); var value = newDate.toLocaleDateString(); var value2 = value.split("/"); if (value2[1].length == 1) { value2[1] = "0" + value2[1]; } if (value2[2].length == 1) { value2[2] = "0" + value2[2]; } value = value2[0] + "-" + value2[1] + "-" + value2[2]; return value; } handleRelationFn3(event) { var value = event.target.value; this.opp.CloseDate = value; } //从url上取得ID getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } return false; } oppId = ""; opp = {}; Date_InAdvance_Delay = ""; AdvanceReasons = []; DelayReasons = []; //初始化 connectedCallback() { this.oppId = this.getQueryVariable("id"); GetOppinformationcData({ ParamIdStr: this.oppId }).then((response) => { this.opp = JSON.parse(response); if (this.opp.Date_InAdvance_Delay == "提前") { this.isAdvance = true; this.isDelay = false; } if (this.opp.Date_InAdvance_Delay == "延后") { this.isAdvance = false; this.isDelay = true; } }); getReason().then((response) => { var options = JSON.parse(response); this.AdvanceReasons = options["提前"]; this.DelayReasons = options["延后"]; }); } //提示 SaveShowText = "保存成功"; //提示框的文本 Tongzhishow = false; //提示显示的标识 TongzhiIcon = "standard:account"; //提示框的图标 IsLeftStyle = ""; //提示框的样式 BgColorStyle = ""; //弹框提示 content 内容 error 是否是错误提示框 left 是否居左 Alert(content, error = false, left = false) { this.SaveShowText = content; this.Tongzhishow = true; if (error) { this.TongzhiIcon = "standard:first_non_empty"; this.BgColorStyle = "background-color:#f88568"; } else { this.TongzhiIcon = "standard:account"; this.BgColorStyle = "background-color:#69e669"; } if (left) { this.IsLeftStyle = "left: 0.25rem"; } else { this.IsLeftStyle = ""; } } //关闭提示框 CloseAlert() { this.closeOffRefresh(); } closeOffRefresh() { if (this.Tongzhishow == true) { this.Tongzhishow = false; } if (this.SaveShowText != "") { this.SaveShowText = ""; } } //加载 IsLoading = false; OnLoading(flag) { this.IsLoading = flag; } //保存数据逻辑 saveFn() { debugger; var myDate = new Date(); //今天日期 var myDate1 = new Date(this.opp.Close_Forecasted_Check); //当前预测日期 var myDate2 = new Date(this.opp.Close_Forecasted_Date); //改变的预测日期 var myDate3 = new Date(myDate.toLocaleDateString()); //今天日期 格式化 var myDate4 = new Date(myDate1.toLocaleDateString()); //当前预测日期 格式化 var myDate5 = new Date(myDate2.toLocaleDateString()); //改变的预测日期 格式化 var myDate6 = new Date(this.opp.CloseDate); var myDate7 = new Date(myDate6.toLocaleDateString()); //发货日期 //20221226 lt DB202212359066增加限制-修改预测日最大日期 start var date1 = new Date(); var year = date1.getFullYear(); var month = date1.getMonth() + 1; if (month > 3) { year = year + 1; } handleRelationFn1(event){ var value = event.target.value; this.opp.Predicted_date_ChangeReason = value; } flg=true; handleRelationFn2(event){ var value = event.target.value; this.opp.Close_Forecasted_Date = value; this.flg=false; debugger this.CloseDateAssignment(value); } //给预测发货日赋值 CloseDateAssignment(value){ debugger var value=this.addDay(30,value); this.opp.CloseDate = value; this.flg=true; } //加天数 addDay(dayNumber, value1) { var date = new Date(value1); var ms = dayNumber * (1000 * 60 * 60 * 24) var newDate = new Date(date.getTime() + ms); var value=newDate.toLocaleDateString(); var value2=value.split('/'); if(value2[1].length == 1){ value2[1]='0'+value2[1]; } if(value2[2].length == 1){ value2[2]='0'+value2[2]; } value=value2[0]+'-'+value2[1]+'-'+value2[2]; return value; } handleRelationFn3(event){ var value = event.target.value; this.opp.CloseDate = value; } //从url上取得ID getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == variable){return pair[1];} } return(false); var strDate = "-03-31"; var Odate = year + 3; var Sdate = year + 4; var Odate1 = Odate + strDate; var Sdate1 = Sdate + strDate; var Odate2 = new Date(Odate1); var Sdate2 = new Date(Sdate1); // //订货预测日 var OrderDate = new Date(Odate2.toLocaleDateString()); // //发货预测日 var ShipmentsDate = new Date(Sdate2.toLocaleDateString()); //20221226 lt DB202212359066增加限制-修改预测日最大日期 end console.warn("myDatevalue:=" + myDate); console.warn("今天日期" + myDate3); console.warn("当前预测日期" + myDate4); console.warn("1111111111" + myDate2); console.warn("改变的预测日期" + myDate5); //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start // if(this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == undefined || myDate5 == undefined){ // if(this.opp.Date_InAdvance_Delay == '' ||this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == '' ||this.opp.Predicted_date_ChangeReason == undefined|| myDate5 == '' || myDate5 == undefined){ if ( !this.opp.Date_InAdvance_Delay || !this.opp.Predicted_date_ChangeReason || !this.opp.Close_Forecasted_Date ) { //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end this.Alert("请选择日期/理由。", false, true); } else if ( this.opp.Date_InAdvance_Delay == "提前" && (myDate5 >= myDate4 || myDate5 < myDate3) ) { this.Alert( "请选择 “提前” 于当前预测OCSM签约日的日期 且 不早于今天。", false, true ); } else if (this.opp.Date_InAdvance_Delay == "延后" && myDate5 <= myDate4) { this.Alert("请选择 “延后” 于当前预测OCSM签约日的日期。", false, true); } else if (myDate7 < myDate5) { this.Alert("预测发货日不能小于预测签约日。", false, true); } oppId = ''; opp = {}; Date_InAdvance_Delay = ''; AdvanceReasons = []; DelayReasons = []; //初始化 connectedCallback(){ this.oppId = this.getQueryVariable('id'); GetOppinformationcData({ParamIdStr:this.oppId}).then(response=>{ this.opp=JSON.parse(response); if(this.opp.Date_InAdvance_Delay == '提前'){ this.isAdvance = true; this.isDelay = false; } if(this.opp.Date_InAdvance_Delay == '延后'){ this.isAdvance = false; this.isDelay = true; } }); getReason().then(response=>{ var options = JSON.parse(response); this.AdvanceReasons = options['提前']; this.DelayReasons = options['延后']; }); //20221226 lt DB202212359066增加限制-修改预测日最大日期 start else if (myDate5 > OrderDate) { this.Alert("订货预测日请在未来三财年内。", false, true); } else if (myDate7 > ShipmentsDate) { this.Alert("发货预测日请在未来四财年内。", false, true); } //提示 SaveShowText="保存成功";//提示框的文本 Tongzhishow=false; //提示显示的标识 TongzhiIcon = 'standard:account' //提示框的图标 IsLeftStyle = "" //提示框的样式 BgColorStyle = "" //弹框提示 content 内容 error 是否是错误提示框 left 是否居左 Alert(content,error = false,left = false){ this.SaveShowText = content; this.Tongzhishow = true; if (error) { this.TongzhiIcon = "standard:first_non_empty"; this.BgColorStyle = "background-color:#f88568"; }else{ this.TongzhiIcon = "standard:account"; this.BgColorStyle = "background-color:#69e669"; //20221226 lt DB202212359066增加限制-修改预测日最大日期 end else { this.OnLoading(true); SaveData({ JsonData: JSON.stringify(this.opp) }).then((response) => { if (response == "成功") { this.OnLoading(false); this.Alert("保存成功", false, true); window.location.hash = "Refresh" + "==" + this.oppId; } else { this.Alert(response, true); } if (left) { this.IsLeftStyle = "left: 0.25rem" }else{ this.IsLeftStyle = "" } }); } //关闭提示框 CloseAlert(){ this.closeOffRefresh(); } closeOffRefresh(){ if (this.Tongzhishow == true) { this.Tongzhishow = false; } if (this.SaveShowText != "") { this.SaveShowText = ""; } } //加载 IsLoading = false; OnLoading(flag) { this.IsLoading = flag; } //保存数据逻辑 saveFn(){ debugger var myDate = new Date(); //今天日期 var myDate1 = new Date(this.opp.Close_Forecasted_Check); //当前预测日期 var myDate2 = new Date(this.opp.Close_Forecasted_Date); //改变的预测日期 var myDate3 = new Date(myDate.toLocaleDateString()); //今天日期 格式化 var myDate4 = new Date(myDate1.toLocaleDateString()); //当前预测日期 格式化 var myDate5 = new Date(myDate2.toLocaleDateString()); //改变的预测日期 格式化 var myDate6 = new Date(this.opp.CloseDate); var myDate7 = new Date(myDate6.toLocaleDateString()); //发货日期 //20221226 lt DB202212359066增加限制-修改预测日最大日期 start var date1 = new Date(); var year = date1.getFullYear(); var month = date1.getMonth() + 1; if(month > 3){ year = year + 1; } var strDate = "-03-31"; var Odate = year + 3; var Sdate = year + 4; var Odate1 = Odate + strDate; var Sdate1 = Sdate + strDate; var Odate2 = new Date(Odate1); var Sdate2 = new Date(Sdate1); // //订货预测日 var OrderDate = new Date(Odate2.toLocaleDateString()); // //发货预测日 var ShipmentsDate = new Date(Sdate2.toLocaleDateString()); //20221226 lt DB202212359066增加限制-修改预测日最大日期 end console.warn('myDatevalue:='+myDate); console.warn('今天日期'+myDate3); console.warn('当前预测日期'+myDate4); console.warn('1111111111'+myDate2); console.warn('改变的预测日期'+myDate5); //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start // if(this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == undefined || myDate5 == undefined){ // if(this.opp.Date_InAdvance_Delay == '' ||this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == '' ||this.opp.Predicted_date_ChangeReason == undefined|| myDate5 == '' || myDate5 == undefined){ if(!this.opp.Date_InAdvance_Delay || !this.opp.Predicted_date_ChangeReason || !this.opp.Close_Forecasted_Date){ //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end this.Alert("请选择日期/理由。",false,true); } else if(this.opp.Date_InAdvance_Delay == '提前' && (myDate5 >= myDate4 || myDate5 < myDate3)){ this.Alert("请选择 “提前” 于当前预测OCSM签约日的日期 且 不早于今天。",false,true); } else if(this.opp.Date_InAdvance_Delay == '延后' && myDate5 <= myDate4){ this.Alert("请选择 “延后” 于当前预测OCSM签约日的日期。",false,true); } else if(myDate7 < myDate5){ this.Alert("预测发货日不能小于预测签约日。",false,true); } //20221226 lt DB202212359066增加限制-修改预测日最大日期 start else if(myDate5 > OrderDate){ this.Alert("订货预测日请在未来三财年内。",false,true); } else if(myDate7 > ShipmentsDate){ this.Alert("发货预测日请在未来四财年内。",false,true); } //20221226 lt DB202212359066增加限制-修改预测日最大日期 end else{ this.OnLoading(true); SaveData({JsonData:JSON.stringify(this.opp)}).then((response)=>{ if (response == '成功') { this.OnLoading(false); this.Alert("保存成功",false,true); window.location.hash = "Refresh"+"=="+this.oppId; }else{ this.Alert(response,true); } }); } } } } } force-app/main/default/pages/AccChangeApprovalResponse.page
@@ -1,41 +1,78 @@ <apex:page standardController="Account_Delay_Apply__c" extensions="AccChangeApprovalResponseController" showHeader="false" sidebar="false" id="allPage" action="{!init}"> <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> <script> function tocenterjs() { //blockme(); window.open('/apex/AccChangeApprovalResponsePopUp?accid=' + '{!URLENCODE(Account_Delay_Apply__c.Id)}' + '&type=response2system', 'HospitalApprovalDate', 'height=400,width=600,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'); } <apex:page standardController="Account_Delay_Apply__c" extensions="AccChangeApprovalResponseController" showHeader="false" sidebar="false" id="allPage" action="{!init}" > <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> <script> function tocenterjs() { //blockme(); window.open( "/apex/AccChangeApprovalResponsePopUp?accid=" + "{!URLENCODE(Account_Delay_Apply__c.Id)}" + "&type=response2system", "HospitalApprovalDate", "height=400,width=600,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no" ); } function touserjs() { //blockme(); window.open('/apex/AccChangeApprovalResponsePopUp?accid=' + '{!URLENCODE(Account_Delay_Apply__c.Id)}' + '&type=response2user', 'HospitalApprovalDate', 'height=400,width=600,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no'); } function reloadjs() { //blockme(); init(); } </script> <apex:form id="allForm"> <apex:actionFunction name="init" action="{!init}" rerender="allPanel,message"> function touserjs() { //blockme(); window.open( "/apex/AccChangeApprovalResponsePopUp?accid=" + "{!URLENCODE(Account_Delay_Apply__c.Id)}" + "&type=response2user", "HospitalApprovalDate", "height=400,width=600,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no" ); } function reloadjs() { //blockme(); init(); } </script> <apex:form id="allForm"> <apex:actionFunction name="init" action="{!init}" rerender="allPanel,message" > </apex:actionFunction> <apex:outputPanel id="allPanel"> <apex:pageBlock title="{!$ObjectType.Account_Delay_Apply__c.fields.Response__c.label}" id="allBlock"> <apex:pageBlockButtons location="top"> <apex:commandButton onclick="tocenterjs(); return false;" value="To:当前审批人" rerender="dummy" /> <apex:commandButton onclick="touserjs(); return false;" value="To:申请者" rerender="dummy" /> </apex:pageBlockButtons> <apex:outputPanel id="allPanel"> <apex:pageBlock title="{!$ObjectType.Account_Delay_Apply__c.fields.Response__c.label}" id="allBlock" > <apex:pageBlockButtons location="top"> <apex:commandButton onclick="tocenterjs(); return false;" value="To:当前审批人" rerender="dummy" /> <apex:commandButton onclick="touserjs(); return false;" value="To:申请者" rerender="dummy" /> </apex:pageBlockButtons> <apex:inputField id="response" value="{!ra.Response__c}" style="width:100%; height:120px; resize:none;"/> <script> j$(escapeVfId('allPage:allForm:allBlock:response')).attr('readonly', true); </script> </apex:pageBlock> </apex:outputPanel> </apex:form> </apex:page> <apex:inputField id="response" value="{!ra.Response__c}" style="width: 100%; height: 120px; resize: none" /> <script> j$(escapeVfId("allPage:allForm:allBlock:response")).attr( "readonly", true ); </script> </apex:pageBlock> </apex:outputPanel> </apex:form> </apex:page> package-lock.json
New file Diff too large package.json
@@ -12,7 +12,7 @@ "test:unit:watch": "sfdx-lwc-jest --watch", "test:unit:debug": "sfdx-lwc-jest --debug", "test:unit:coverage": "sfdx-lwc-jest --coverage", "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", "prettier": "prettier", "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"" }, "devDependencies": {