force-app/main/default/aura/taskManage/taskManage.cmp
@@ -94,6 +94,7 @@ <aura:attribute name="isSelectOtherCancel" type="boolean" default="false"/> <aura:attribute name="isSelectOtherDelay" type="boolean" default="false"/> <!--2021-11-11 mzy 任务管理改善 end--> <aura:attribute name="estimatedFinishDate" type="Date" /> <aura:handler name="init" value="{! this }" action="{! c.init }"/> <div> @@ -369,6 +370,12 @@ class="buttonColor slds-m-right_small" /> <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> </div> <div class="slds-notify__close"> <button class="slds-button slds-button_icon slds-button_icon-inverse" title="Close" onclick="{! c.closeMessage }"> <lightning:icon alternativeText="close" iconName="utility:close" size="small" /> <span class="slds-assistive-text">Close</span> </button> </div> </div> </div> </div> @@ -410,6 +417,15 @@ </aura:if> </div> </aura:if> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start --> <aura:if isTrue="{!(v.tempdata.taskType == '盘点检查计划' || v.tempdata.taskType == '温湿度检查计划')}"> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style ="min-Height: 100px;max-width: 600px;"> <lightning:input type="date" label="预计完成时间" name="estimatedFinishDate" value="{! v.estimatedFinishDate }" required="true" placeholder="请选择" variant="label-inline" /> </div> </aura:if> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End --> <!--###### MODAL BOX FOOTER Part Start ######--> <footer class="slds-modal__footer" style= "max-width: 600px;"> @@ -540,7 +556,7 @@ </p> </div> --> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1" style ="min-Height: 250px;max-width: 600px;"> <p class="slds-p-horizontal_small"> <p class="slds-p-horizontal_small"> <aura:if isTrue="{!v.tempisFSE == false}"> <lightning:recordEditForm objectApiName="task__c" recordTypeId = "{!v.tempTask.RecordTypeId}"> <lightning:inputField fieldName="delayReasonSelect__c" required="true" onchange="{!c.handleChangeDelay}"/> @@ -555,6 +571,11 @@ <div style="padding-top: 5px;padding-left: 12px;color:#6B6D70;">延期理由(其他)</div> <lightning:input name="delayReason" value="{! v.delayReasonOther }" placeholder="请输入延期理由(其他)"/> </aura:if> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start --> <aura:if isTrue="{!(v.tempdata.taskType == '盘点检查计划' || v.tempdata.taskType == '温湿度检查计划')}"> <lightning:input type="date" label="延期至时间" name="estimatedFinishDate" value="{! v.estimatedFinishDate }" required="true" placeholder="请选择" variant="label-inline" /> </aura:if> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End --> </p> </div> <footer class="slds-modal__footer" style ="max-width: 600px;"> force-app/main/default/aura/taskManage/taskManageController.js
@@ -177,5 +177,8 @@ helper.checkEnquiry(cmp,tempData.id); } //2021-10-25 yjk 取消原因为失单,查看询价报告按钮 end ,closeMessage : function(cmp,event,helper){ $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); } }); force-app/main/default/aura/taskManage/taskManageHelper.js
@@ -64,13 +64,14 @@ { label: "创建日期", fieldName: "taskCreateddate", type: "date-local", typeAttributes:{ weekday: "long", year: "numeric", month: "long", day: "2-digit" }, type: "text", // type: "date-local", // typeAttributes:{ // weekday: "long", // year: "numeric", // month: "long", // day: "2-digit" // }, sortable: true , wrapText: true, }, @@ -143,7 +144,7 @@ label: '合并', name: 'Merge', title: '合并', disabled: { fieldName: 'confirmButtonisDisabled'}, disabled: { fieldName: 'mergeConfirmButtonisDisabled'}, value: 'Merge' }, initialWidth: 76, @@ -195,13 +196,14 @@ { label: "创建日期", fieldName: "taskCreateddate", type: "date-local", typeAttributes:{ weekday: "long", year: "numeric", month: "long", day: "2-digit" }, type: "text", // type: "date-local", // typeAttributes:{ // weekday: "long", // year: "numeric", // month: "long", // day: "2-digit" // }, sortable: true }, { @@ -289,13 +291,14 @@ { label: "创建日期", fieldName: "taskCreateddate", type: "date-local", typeAttributes:{ weekday: "long", year: "numeric", month: "long", day: "2-digit" }, type: "text", // type: "date-local", // typeAttributes:{ // weekday: "long", // year: "numeric", // month: "long", // day: "2-digit" // }, sortable: true , wrapText: true, }, @@ -368,7 +371,7 @@ label: '合并', name: 'Merge', title: '合并', disabled: { fieldName: 'confirmButtonisDisabled'}, disabled: { fieldName: 'mergeConfirmButtonisDisabled'}, value: 'Merge' }, initialWidth: 76, @@ -445,13 +448,14 @@ { label: "创建日期", fieldName: "taskCreateddate", type: "date-local", typeAttributes:{ weekday: "long", year: "numeric", month: "long", day: "2-digit" }, type: "text", // type: "date-local", // typeAttributes:{ // weekday: "long", // year: "numeric", // month: "long", // day: "2-digit" // }, sortable: true , wrapText: true, }, @@ -524,7 +528,7 @@ label: '合并', name: 'Merge', title: '合并', disabled: { fieldName: 'confirmButtonisDisabled'}, disabled: { fieldName: 'mergeConfirmButtonisDisabled'}, value: 'Merge' }, initialWidth: 76, @@ -620,6 +624,23 @@ var state = response.getState(); if (state === "SUCCESS") { var res = response.getReturnValue(); // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start for(var rowIndex = 0 ;rowIndex<res.myTasks.length;rowIndex++){ if (res.myTasks[rowIndex].taskType == '盘点检查计划' || res.myTasks[rowIndex].taskType == '温湿度检查计划') { res.myTasks[rowIndex]['cancelButtonisDisabled'] = true ; res.myTasks[rowIndex]['assignButtonisDisabled_Owner'] = true ; res.myTasks[rowIndex]['mergeConfirmButtonisDisabled'] = true ; } }; for(var rowIndex = 0 ;rowIndex<res.subTasks.length;rowIndex++){ if (res.subTasks[rowIndex].taskType == '盘点检查计划' || res.subTasks[rowIndex].taskType == '温湿度检查计划') { res.subTasks[rowIndex]['cancelButtonisDisabled'] = true ; res.subTasks[rowIndex]['assignButtonisDisabled_Owner'] = true ; res.subTasks[rowIndex]['mergeConfirmButtonisDisabled'] = true ; } }; // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End cmp.set('v.data',res.myTasks); cmp.set('v.data2',res.subTasks); cmp.set('v.dataCopy',res.myTasks); @@ -738,6 +759,7 @@ //后台方法的回调函数 }, //20210105 CHAN-BWX3YU you end // 排序逻辑设定 sortBy: function(field, reverse, primer) { var key = primer ? function(x) { @@ -798,8 +820,17 @@ if (state === "SUCCESS") { var res = response.getReturnValue(); // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start for(var rowIndex = 0 ;rowIndex<res.myTasks.length;rowIndex++){ if (res.myTasks[rowIndex].taskType == '盘点检查计划' || res.myTasks[rowIndex].taskType == '温湿度检查计划') { res.myTasks[rowIndex]['cancelButtonisDisabled'] = true ; res.myTasks[rowIndex]['assignButtonisDisabled_Owner'] = true ; res.myTasks[rowIndex]['mergeConfirmButtonisDisabled'] = true ; } }; cmp.set('v.data',res.myTasks); cmp.set('v.dataCopy',res.myTasks); // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End } this.hideSpinner(cmp); }); @@ -985,6 +1016,7 @@ Accept:function (cmp, row, action) { cmp.set('v.ActivityDate',null); cmp.set('v.feedbackPlanDate',null); cmp.set('v.estimatedFinishDate', ''); //除了记录类型为其他,且任务区分为上级分配任务时,其他都跳转事件页面 if('其他'!=row.taskType){ cmp.set("v.IsEventDefault", true); @@ -1066,6 +1098,26 @@ } //check end //2021-10-19 mzy 任务管理改善 end // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start // var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); var estimatedFinishDate = new Date(cmp.get("v.estimatedFinishDate")); if (row.taskType == '盘点检查计划' || row.taskType == '温湿度检查计划') { var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); if (!estimatedFinishDate) { alert('请输入预计完成时间!'); return; } var latestFinishDate = row.latestFinishDate; if (estimatedFinishDate > latestFinishDate) { alert('预计完成时间不能超过最晚完成日('+latestFinishDate+')'); return; } } // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End var action = cmp.get("c.confirmOrDelay"); action.setParams({ "taskID" : row.id, @@ -1073,12 +1125,18 @@ "delayReason" : '', "IsGeneratePlan":IsGeneratePlan, //2021-10-20 mzy 任务管理改善 "ActivityDate" : activityDate, //2021-10-20 mzy 任务管理改善 "feedbackPlanDate" : feedbackPlanDate "feedbackPlanDate" : feedbackPlanDate, "estimatedFinishDate" : estimatedFinishDate, "delayReasonOther" : '' }); //2021-10-20 mzy 任务管理改善 start //需要生成计划才会跳转到事件页面,将任务Id带到事件页面 if(IsGeneratePlan==true){ window.open('/apex/SimpleEventRegister?taskId=' + row.id,'_blank'); if(IsGeneratePlan==true){ // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start if (row.taskType != '盘点检查计划' && row.taskType != '温湿度检查计划') { window.open('/apex/SimpleEventRegister?taskId=' + row.id,'_blank'); } // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End } //2021-10-20 mzy 任务管理改善 end this.showSpinner(cmp); @@ -1093,6 +1151,7 @@ rows[rowIndex]['taskStatus'] = '02 接受' ; rows[rowIndex]['cancelButtonisDisabled'] = true ; rows[rowIndex]['confirmButtonisDisabled'] = true ; rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; rows[rowIndex]['delayButtonisDisabled'] = true ; rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; //2021-10-20 mzy 任务管理改善 cmp.set('v.data', rows); @@ -1137,6 +1196,7 @@ cmp.set('v.tempisFSE',row.isFSE); cmp.set('v.delayReason', ''); cmp.set('v.delayReasonOther', ''); cmp.set('v.estimatedFinishDate', ''); cmp.set('v.delayIsOpen', true); }, //确认取消 @@ -1171,6 +1231,7 @@ rows[rowIndex]['taskStatus'] = '04 取消' ; rows[rowIndex]['cancelButtonisDisabled'] = true ; rows[rowIndex]['confirmButtonisDisabled'] = true ; rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; rows[rowIndex]['delayButtonisDisabled'] = true ; rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; //2021-10-20 mzy 任务管理改善 cmp.set('v.data', rows); @@ -1205,14 +1266,33 @@ if(delayReason == '其他' && !delayReasonOther){ alert('延期理由(选项)为其他时请输入延期理由(其他)!'); return; } // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start // var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); var estimatedFinishDate = new Date(cmp.get("v.estimatedFinishDate")); if (tempdata.taskType == '盘点检查计划' || tempdata.taskType == '温湿度检查计划') { var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); if (!estimatedFinishDate) { alert('请输入延期至时间!'); return; } var createdAfter3Month = tempdata.createdAfter3Month; if (estimatedFinishDate > createdAfter3Month) { alert('延期至时间不能超过('+createdAfter3Month+')'); return; } } // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End var action = cmp.get("c.confirmOrDelay"); action.setParams({ "taskID" : tempdata.id, "isDelay" : true, "delayReason" : delayReason, "delayReasonOther" : delayReasonOther, "estimatedFinishDate" : estimatedFinishDate, }); this.showSpinner(cmp); action.setCallback(this, function(response) { @@ -1226,6 +1306,7 @@ rows[rowIndex]['taskStatus'] = '05 延期' ; rows[rowIndex]['cancelButtonisDisabled'] = true ; rows[rowIndex]['confirmButtonisDisabled'] = true ; rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; rows[rowIndex]['delayButtonisDisabled'] = true ; rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; //2021-11-11 mzy 任务管理改善 cmp.set('v.data', rows); @@ -1245,9 +1326,11 @@ }); $A.enqueueAction(action); window.open('/apex/SimpleEventRegister?isDelay=true&taskId=' + tempdata.id ,'_blank'); // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start if (tempdata.taskType != '盘点检查计划' && tempdata.taskType != '温湿度检查计划') { window.open('/apex/SimpleEventRegister?isDelay=true&taskId=' + tempdata.id ,'_blank'); } // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End }, // 确认重新分配 ConfirmAssign: function(cmp, event) { @@ -1321,6 +1404,7 @@ rows[rowIndex]['taskAssigneeName'] = res.assigneeName ; rows[rowIndex]['cancelButtonisDisabled'] = true ; rows[rowIndex]['confirmButtonisDisabled'] = true ; rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; rows[rowIndex]['delayButtonisDisabled'] = true ; rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; cmp.set('v.data', rows); @@ -1350,20 +1434,20 @@ //弹出 错误提示 showErrorToast : function(cmp) { $A.util.removeClass(cmp.find('errorDiv'), 'slds-hide'); window.setTimeout($A.getCallback(function() { $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); }), 5000 ); // window.setTimeout($A.getCallback(function() { // $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); // }), // 5000 // ); }, //弹出 错误提示 文字较多,显示持续10秒 - 2021-11-12 yjk showErrorToastLongTime : function(cmp) { $A.util.removeClass(cmp.find('errorDiv'), 'slds-hide'); window.setTimeout($A.getCallback(function() { $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); }), 10000 ); // window.setTimeout($A.getCallback(function() { // $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); // }), // 10000 // ); }, // function automatic called by aura:waiting event showSpinner: function(cmp) { @@ -1379,7 +1463,7 @@ }, //wangweipeng 获取url的参数 2021/09/27 start getURLParameterValue: function() { var querystring = location.search.substr(1); var querystring = window.location.search.substr(1); var paramValue = {}; querystring.split("&").forEach(function(part) { var param = part.split("="); force-app/main/default/classes/OpportunityLightingButtonController.cls
@@ -2,9 +2,17 @@ * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-09 13:27:58 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-12 17:40:11 */ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-04-12 11:16:07 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-08 16:57:51 * @LastEditTime: 2023-09-08 16:58:57 */ public with sharing class OpportunityLightingButtonController { @AuraEnabled @@ -22,6 +30,12 @@ } return res; } @AuraEnabled public static Id queryForProfileId(){ return UserInfo.getProfileId(); } @AuraEnabled public static InitData initForPredictedDateChangeButton(String recordId){ InitData res = new InitData(); force-app/main/default/classes/PCLLostReportController.cls
@@ -19,645 +19,713 @@ public integer topNum {get; set;} public integer secondNum {get; set;} // add tcm 20211122 end public Decimal InclusionUltrasound {get; set;} //20230506 lt DB202304618804 包含超声 add // 竞争对手对照关系表,key是品牌名字,value是ID public map<string,id> CompetitionMap; public PCLLostReportController(ApexPages.StandardController controller) { this(); this(); } public PCLLostReportController(){ oppId = ApexPages.currentPage().getParameters().get('oppId') == null ? '' : ApexPages.currentPage().getParameters().get('oppId'); lostReportId = ApexPages.currentPage().getParameters().get('Id') == null ? '' : ApexPages.currentPage().getParameters().get('Id'); pageStatus = ApexPages.currentPage().getParameters().get('pageStatus') == null ? '' : ApexPages.currentPage().getParameters().get('pageStatus'); lostType = ApexPages.currentPage().getParameters().get('lostType') == null ? '' : ApexPages.currentPage().getParameters().get('lostType'); submitFlag = ApexPages.currentPage().getParameters().get('submitFlag') == null ? '' : ApexPages.currentPage().getParameters().get('submitFlag'); oppId = ApexPages.currentPage().getParameters().get('oppId') == null ? '' : ApexPages.currentPage().getParameters().get('oppId'); lostReportId = ApexPages.currentPage().getParameters().get('Id') == null ? '' : ApexPages.currentPage().getParameters().get('Id'); pageStatus = ApexPages.currentPage().getParameters().get('pageStatus') == null ? '' : ApexPages.currentPage().getParameters().get('pageStatus'); lostType = ApexPages.currentPage().getParameters().get('lostType') == null ? '' : ApexPages.currentPage().getParameters().get('lostType'); submitFlag = ApexPages.currentPage().getParameters().get('submitFlag') == null ? '' : ApexPages.currentPage().getParameters().get('submitFlag'); } // 初始化 public void init(){ if(string.isblank(pageStatus)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '页面出错,请刷新后重试!')); // 这里需要报错没有传参数 return; if(string.isblank(pageStatus)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '页面出错,请刷新后重试!')); // 这里需要报错没有传参数 return; } else if(pageStatus.equals('Create')) { if(string.isBlank(oppId)) { // 这里报错创建时候必须有询价 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '创建失单报告时,请重询价页面创建')); return; } else if(pageStatus.equals('Create')) { if(string.isBlank(oppId)) { // 这里报错创建时候必须有询价 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '创建失单报告时,请重询价页面创建')); return; } list<opportunity> opplist = [select id,Name, Sales_assistant_ID__c, Sales_manager_departmentID__c,Sales_owner_buchangID__c from opportunity where id =: oppId limit 1]; if( opplist.size() == 0) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您没有询价的查看权限,无法创建失单报告!')); pageStatus = null; return; } Schema.DescribeSObjectResult s = Lost_cancel_report__c.sObjectType.getDescribe(); if( !s.isCreateable()) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您不能创建失单/部分失单报告!')); return; } Lost_cancel_report__c tempLostReport = new Lost_cancel_report__c(LostType__c= lostType, Opportunity__c = oppId, Sales_assistant__c = opplist[0].Sales_assistant_ID__c, Manager_sales__c = opplist[0].Sales_manager_departmentID__c, Buchang_sales__c = opplist[0].Sales_owner_buchangID__c, Submit_Day__c = date.today(), Report_Status__c = '草案'); LostReport = new LostReport(tempLostReport); brandCount = 1; list<opportunity> opplist = [select id,Name, Sales_assistant_ID__c, Sales_manager_departmentID__c,Sales_owner_buchangID__c from opportunity where id =: oppId limit 1]; if( opplist.size() == 0) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您没有询价的查看权限,无法创建失单报告!')); pageStatus = null; return; } else if(pageStatus.equals('View') || pageStatus.equals('Edit')) { system.debug('edit1'); if(string.isBlank(lostReportId)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您没有查看这个失单/部分失单报告的权限!')); pageStatus = null; return; } system.debug('edit2'); list<Lost_cancel_report__c> lostReportList = [select id,of_lost_system_processor__c, Lost_reason_main__c, Lost_Reason_Sub__c,Lost_By_Company__c, LostTotalAmount__c,LostType__c, Report_Status__c,Sales_assistant__c, Opportunity__c, Opportunity__r.Sales_assistant_ID__c, Opportunity__r.Sales_manager_departmentID__c, Manager_sales__c,recordtypeid,recordtype.DeveloperName from Lost_cancel_report__c where id =: lostReportId limit 1]; if(lostReportList.size() == 0) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您没有查看这个失单/部分失单报告的权限!')); pageStatus = null; return; } lostReportList[0].Sales_assistant__c = lostReportList[0].Opportunity__r.Sales_assistant_ID__c; lostReportList[0].Manager_sales__c = lostReportList[0].Opportunity__r.Sales_manager_departmentID__c; if(lostReportList[0].recordtype.DeveloperName.equals('PCL_Lost_report')) { lostReportList[0].LostType__c ='失单'; }else if(lostReportList[0].recordtype.DeveloperName.equals('PCL_PartLost_report')) { lostReportList[0].LostType__c ='部分失单'; } // 权限,如果当前状态不是草案中,那么需要跳转到只读页面 if(!'草案'.equals(lostReportList[0].Report_Status__c) && userinfo.getProfileId() != (ID) '00e10000000Y3o5AAC') { pageStatus = 'View'; } oppId = lostReportList[0].Opportunity__c; system.debug('edit3'); list<PCLLostBrand__c> selectlostBrandList = [ select id, LostPrice__c, Lost_By_Company__c, Lost_reason_main__c,Lost_Reason_Sub__c,Name,Agency__c, AgencyMannual__c, // ProductCategory__c,ProductClass__c, Lost_cancel_report__c,Lost_By_Company_Mannual__c, ( select id,PCLLostBrand__c,LostProduct__c, LostProductMannual__c, //SWAG-C6P9PX lt 20210913 add ProductCategory__c,ProductClass__c, //add tcm 20211123 Quantity__c,Name, LostBrandName__c from PCLLostBrand__c.PCLLostBrandProduct__r) from PCLLostBrand__c where Lost_cancel_report__c =: lostReportId ]; if(selectlostBrandList.size() == 0 ) { LostReport = new LostReport(lostReportList[0]); brandCount = 1; }else{ system.debug('edit4:'+selectlostBrandList[0]); brandCount = 0; list<LostBrand> LostBrandList = new list<LostBrand>(); for(PCLLostBrand__c templostBrand : selectlostBrandList) { list<PCLLostProducts> tempProductList = new list<PCLLostProducts>(); integer productCount = 0; system.debug('check products:'+ (templostBrand.PCLLostBrandProduct__r != null) + '|' + (templostBrand.PCLLostBrandProduct__r.size() > 0)); if (templostBrand.PCLLostBrandProduct__r != null && templostBrand.PCLLostBrandProduct__r.size() > 0) { for( PCLLostProduct__c tempProduct: templostBrand.PCLLostBrandProduct__r) { tempProductList.add(new PCLLostProducts(productCount,tempProduct)); productCount++; } } else { PCLLostProducts newProduct = new PCLLostProducts(); if ('其他'.equals(templostBrand.Lost_By_Company__c) && templostBrand.Lost_By_Company_Mannual__c != null && !''.equals(templostBrand.Lost_By_Company_Mannual__c)) { newProduct.LostProductss.LostBrandName__c = templostBrand.Lost_By_Company_Mannual__c; } else { newProduct.LostProductss.LostBrandName__c = templostBrand.Lost_By_Company__c; } system.debug('aaa4+++'+templostBrand.Lost_By_Company_Mannual__c); tempProductList.add(newProduct); productCount++; } LostBrandList.add( new LostBrand(brandCount,tempProductList, templostBrand)); brandCount++; Schema.DescribeSObjectResult s = Lost_cancel_report__c.sObjectType.getDescribe(); if( !s.isCreateable()) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您不能创建失单/部分失单报告!')); return; } Lost_cancel_report__c tempLostReport = new Lost_cancel_report__c(LostType__c= lostType, Opportunity__c = oppId, Sales_assistant__c = opplist[0].Sales_assistant_ID__c, Manager_sales__c = opplist[0].Sales_manager_departmentID__c, Buchang_sales__c = opplist[0].Sales_owner_buchangID__c, Submit_Day__c = date.today(), Report_Status__c = '草案'); LostReport = new LostReport(tempLostReport); brandCount = 1; } else if(pageStatus.equals('View') || pageStatus.equals('Edit')) { system.debug('edit1'); if(string.isBlank(lostReportId)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您没有查看这个失单/部分失单报告的权限!')); pageStatus = null; return; } system.debug('edit2'); list<Lost_cancel_report__c> lostReportList = [select id,of_lost_system_processor__c, Lost_reason_main__c, Lost_Reason_Sub__c,Lost_By_Company__c, LostTotalAmount__c,LostType__c, TotalAmountLost__c, //20230215 lt DB202302247719 InclusionUltrasound__c, //20230506 lt DB202304618804 包含超声 ModifyAfterApproval__c,Approved_Day__c,//20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 add Report_Status__c,Sales_assistant__c, Opportunity__c, Opportunity__r.Sales_assistant_ID__c, Opportunity__r.Sales_manager_departmentID__c, Manager_sales__c,recordtypeid,recordtype.DeveloperName from Lost_cancel_report__c where id =: lostReportId limit 1]; if(lostReportList.size() == 0) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '您没有查看这个失单/部分失单报告的权限!')); pageStatus = null; return; } InclusionUltrasound = lostReportList[0].InclusionUltrasound__c; //20230506 lt DB202304618804 包含超声 lostReportList[0].Sales_assistant__c = lostReportList[0].Opportunity__r.Sales_assistant_ID__c; lostReportList[0].Manager_sales__c = lostReportList[0].Opportunity__r.Sales_manager_departmentID__c; if(lostReportList[0].recordtype.DeveloperName.equals('PCL_Lost_report')) { lostReportList[0].LostType__c ='失单'; }else if(lostReportList[0].recordtype.DeveloperName.equals('PCL_PartLost_report')) { lostReportList[0].LostType__c ='部分失单'; } // 权限,如果当前状态不是草案中,那么需要跳转到只读页面 // 20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 strat 改if条件 //原:!'草案'.equals(lostReportList[0].Report_Status__c) && userinfo.getProfileId() != (ID) '00e10000000Y3o5AAC' if( !('草案'.equals(lostReportList[0].Report_Status__c) || userinfo.getProfileId() == (ID) '00e10000000Y3o5AAC' ||('批准'.equals(lostReportList[0].Report_Status__c) && System.Label.PCLReportProfileId.contains(userinfo.getProfileId())) ) ) { // 20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 end 改if条件 pageStatus = 'View'; } oppId = lostReportList[0].Opportunity__c; system.debug('edit3'); list<PCLLostBrand__c> selectlostBrandList = [ select id, LostPrice__c, Lost_By_Company__c, LostPrices_ThousandY__c, //20230215 lt DB202302247719 Lost_reason_main__c,Lost_Reason_Sub__c,Name,Agency__c, AgencyMannual__c, // ProductCategory__c,ProductClass__c, Lost_cancel_report__c,Lost_By_Company_Mannual__c, ( select id,PCLLostBrand__c,LostProduct__c, LostProductMannual__c, //SWAG-C6P9PX lt 20210913 add ProductCategory__c,ProductClass__c, //add tcm 20211123 Quantity__c,Name, LostBrandName__c from PCLLostBrand__c.PCLLostBrandProduct__r) from PCLLostBrand__c where Lost_cancel_report__c =: lostReportId ]; if(selectlostBrandList.size() == 0 ) { LostReport = new LostReport(lostReportList[0]); brandCount = 1; }else{ system.debug('edit4:'+selectlostBrandList[0]); brandCount = 0; list<LostBrand> LostBrandList = new list<LostBrand>(); for(PCLLostBrand__c templostBrand : selectlostBrandList) { list<PCLLostProducts> tempProductList = new list<PCLLostProducts>(); integer productCount = 0; system.debug('check products:'+ (templostBrand.PCLLostBrandProduct__r != null) + '|' + (templostBrand.PCLLostBrandProduct__r.size() > 0)); if (templostBrand.PCLLostBrandProduct__r != null && templostBrand.PCLLostBrandProduct__r.size() > 0) { for( PCLLostProduct__c tempProduct: templostBrand.PCLLostBrandProduct__r) { tempProductList.add(new PCLLostProducts(productCount,tempProduct)); productCount++; } } else { PCLLostProducts newProduct = new PCLLostProducts(); if ('其他'.equals(templostBrand.Lost_By_Company__c) && templostBrand.Lost_By_Company_Mannual__c != null && !''.equals(templostBrand.Lost_By_Company_Mannual__c)) { newProduct.LostProductss.LostBrandName__c = templostBrand.Lost_By_Company_Mannual__c; } else { newProduct.LostProductss.LostBrandName__c = templostBrand.Lost_By_Company__c; } LostReport = new LostReport(lostReportList[0],LostBrandList); system.debug('LostReport.LostBrands:'+LostReport.LostBrands); system.debug('aaa4+++'+templostBrand.Lost_By_Company_Mannual__c); tempProductList.add(newProduct); productCount++; } LostBrandList.add( new LostBrand(brandCount,tempProductList, templostBrand)); brandCount++; } LostReport = new LostReport(lostReportList[0],LostBrandList); system.debug('LostReport.LostBrands:'+LostReport.LostBrands); } brandNo = 0; // 读取竞争对手品牌 // BrandmapSet(); if(string.isNotEmpty(submitFlag)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, '提交成功!')); } } brandNo = 0; // 读取竞争对手品牌 // BrandmapSet(); if(string.isNotEmpty(submitFlag)) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, '提交成功!')); } } // 编辑 只有系统管理员或者草案中可以编辑 public PageReference edit2(){ if( userinfo.getProfileId() == (ID) '00e10000000Y3o5AAC' || '草案'.equals(LostReport.LostReport.Report_Status__c) ) { pageStatus = 'Edit'; init(); } else{ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只有在草案中才能进行编辑!')); } return null; //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 start if( userinfo.getProfileId() == (ID) '00e10000000Y3o5AAC' || '草案'.equals(LostReport.LostReport.Report_Status__c) || ('批准'.equals(LostReport.LostReport.Report_Status__c) && System.Label.PCLReportProfileId.contains(userinfo.getProfileId()) ) ) { //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 end pageStatus = 'Edit'; init(); } else{ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只有在草案中才能进行编辑!')); } return null; } // 设置品牌 public void setBrand(){ list<LostBrand> LostBrandlist = LostReport.LostBrands; LostBrand tempBrand = LostBrandlist.get(setBrandNo); string brandName = tempBrand.lostBrand.Lost_By_Company__c; // fy SWAG-CCC6F6 start if(!'其他'.equals(tempBrand.lostBrand.Lost_By_Company_Mannual__c)){ tempBrand.lostBrand.Lost_By_Company_Mannual__c = null; } system.debug('aaa5+++'+tempBrand.lostBrand.Lost_By_Company_Mannual__c); // fy SWAG-CCC6F6 end // ID compID = CompetitionMap.get(brandName); for(PCLLostProducts tempLostProduct : tempBrand.LostProducts ) { // test // tempLostProduct.LostProductss.Competitor__c = compID; tempLostProduct.LostProductss.LostBrandName__c = brandName; tempLostProduct.LostProductss.LostProduct__c = null; tempLostProduct.LostProductss.LostProductMannual__c = null; tempLostProduct.LostProductss.Quantity__c = null; tempLostProduct.LostProductss.ProductClass__c = null; tempLostProduct.LostProductss.ProductCategory__c = null; tempLostProduct.bool=false; } list<LostBrand> LostBrandlist = LostReport.LostBrands; LostBrand tempBrand = LostBrandlist.get(setBrandNo); string brandName = tempBrand.lostBrand.Lost_By_Company__c; // fy SWAG-CCC6F6 start if(!'其他'.equals(tempBrand.lostBrand.Lost_By_Company_Mannual__c)){ tempBrand.lostBrand.Lost_By_Company_Mannual__c = null; } system.debug('aaa5+++'+tempBrand.lostBrand.Lost_By_Company_Mannual__c); // fy SWAG-CCC6F6 end // ID compID = CompetitionMap.get(brandName); for(PCLLostProducts tempLostProduct : tempBrand.LostProducts ) { // test // tempLostProduct.LostProductss.Competitor__c = compID; tempLostProduct.LostProductss.LostBrandName__c = brandName; tempLostProduct.LostProductss.LostProduct__c = null; tempLostProduct.LostProductss.LostProductMannual__c = null; tempLostProduct.LostProductss.Quantity__c = null; tempLostProduct.LostProductss.ProductClass__c = null; tempLostProduct.LostProductss.ProductCategory__c = null; tempLostProduct.bool=false; } } // 设置品牌 public void setbrandmannual(){ list<LostBrand> LostBrandlist = LostReport.LostBrands; LostBrand tempBrand = LostBrandlist.get(setBrandNo); string brandName = tempBrand.lostBrand.Lost_By_Company__c; String brandNameMannual = tempBrand.lostBrand.Lost_By_Company_Mannual__c; // ID compID = CompetitionMap.get(brandName); for(PCLLostProducts tempLostProduct : tempBrand.LostProducts ) { // test // tempLostProduct.LostProductss.Competitor__c = compID; system.debug('aaaa3++'+brandNameMannual); if ('其他'.equals(brandName) && brandNameMannual != null && !''.equals(brandNameMannual)) { tempLostProduct.LostProductss.LostBrandName__c = brandNameMannual; // tempLostProduct.LostProductss.LostProduct__c = null; // tempLostProduct.LostProductss.LostProductMannual__c = null; // tempLostProduct.LostProductss.Quantity__c = null; // tempLostProduct.LostProductss.ProductClass__c = null; // tempLostProduct.LostProductss.ProductCategory__c = null; // tempLostProduct.bool=false; } list<LostBrand> LostBrandlist = LostReport.LostBrands; LostBrand tempBrand = LostBrandlist.get(setBrandNo); string brandName = tempBrand.lostBrand.Lost_By_Company__c; String brandNameMannual = tempBrand.lostBrand.Lost_By_Company_Mannual__c; // ID compID = CompetitionMap.get(brandName); for(PCLLostProducts tempLostProduct : tempBrand.LostProducts ) { // test // tempLostProduct.LostProductss.Competitor__c = compID; system.debug('aaaa3++'+brandNameMannual); if ('其他'.equals(brandName) && brandNameMannual != null && !''.equals(brandNameMannual)) { tempLostProduct.LostProductss.LostBrandName__c = brandNameMannual; // tempLostProduct.LostProductss.LostProduct__c = null; // tempLostProduct.LostProductss.LostProductMannual__c = null; // tempLostProduct.LostProductss.Quantity__c = null; // tempLostProduct.LostProductss.ProductClass__c = null; // tempLostProduct.LostProductss.ProductCategory__c = null; // tempLostProduct.bool=false; } } } // 保存 public PageReference save(){ if(!DataCheck()) { return null; } if(!dataEntry()) { return null; } brandCount = LostReport.LostBrands.size(); pageStatus = 'View'; ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, '保存成功!')); if(!DataCheck()) { return null; } if(!dataEntry()) { return null; } brandCount = LostReport.LostBrands.size(); pageStatus = 'View'; ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, '保存成功!')); return null; } //读取并构建竞争对手品牌 // public void BrandmapSet(){ // CompetitionMap = new map<string, id>(); // list <Competition_Company__c> competitionList // = [select id,name from Competition_Company__c]; // for(Competition_Company__c tempComp : competitionList ) { // CompetitionMap.put(tempComp.name, tempComp.id); // } // CompetitionMap = new map<string, id>(); // list <Competition_Company__c> competitionList // = [select id,name from Competition_Company__c]; // for(Competition_Company__c tempComp : competitionList ) { // CompetitionMap.put(tempComp.name, tempComp.id); // } // } // 数据检查 public boolean DataCheck(){ boolean dataCheck = true; if(string.isBlank(LostReport.LostReport.LostType__c)) { LostReport.LostReport.LostType__c.addError('必须填写失单类型!'); boolean dataCheck = true; if(string.isBlank(LostReport.LostReport.LostType__c)) { LostReport.LostReport.LostType__c.addError('必须填写失单类型!'); dataCheck = false; } for(LostBrand tempLostBrand : LostReport.LostBrands ) { system.debug('aaaa1++'+tempLostBrand.lostBrand.Lost_By_Company_Mannual__c); if(string.isblank(tempLostBrand.lostBrand.Lost_By_Company__c)) { tempLostBrand.lostBrand.Lost_By_Company__c.addError('请填写失单品牌!'); dataCheck = false; }// fy SWAG-CCC6F6 start else if('其他'.equals(tempLostBrand.lostBrand.Lost_By_Company__c)&&string.isblank(tempLostBrand.lostBrand.Lost_By_Company_Mannual__c)){ tempLostBrand.lostBrand.Lost_By_Company_Mannual__c.addError('请填写失单品牌(手动)!'); dataCheck = false; }// fy SWAG-CCC6F6 end system.debug('aaaa2++'+tempLostBrand.lostBrand.Lost_By_Company_Mannual__c); if(tempLostBrand.lostBrand.LostPrice__c == null) { tempLostBrand.lostBrand.LostPrice__c.addError('失单金额必填!'); dataCheck = false; } if(string.isblank(tempLostBrand.lostBrand.Lost_reason_main__c )) { tempLostBrand.lostBrand.Lost_reason_main__c.addError('失单理由(主)必填!'); dataCheck = false; } if(string.isblank(tempLostBrand.lostBrand.Agency__c )) { tempLostBrand.lostBrand.Agency__c.addError('中标经销商必填!'); dataCheck = false; } // 检查是否有超过1个有数的产品 integer productCount = 0; for( PCLLostProducts temlostProduct : tempLostBrand.LostProducts) { if (temlostProduct.LostProductss.LostProduct__c != null || temlostProduct.LostProductss.LostProductMannual__c != null) { System.debug('失单型号' + temlostProduct.LostProductss.LostProduct__c); System.debug('失单型号手动' + temlostProduct.LostProductss.LostProductMannual__c); productCount ++; } // update tcm 20211123 start if((temlostProduct.LostProductss.LostProduct__c!=null || temlostProduct.LostProductss.LostProductMannual__c!=null)&&(temlostProduct.LostProductss.Quantity__c==null || temlostProduct.LostProductss.Quantity__c ==0)) { temlostProduct.LostProductss.Quantity__c.addError('请填写失单数量!'); dataCheck = false; } if((temlostProduct.LostProductss.LostProduct__c!=null || temlostProduct.LostProductss.LostProductMannual__c!=null)&&temlostProduct.LostProductss.ProductCategory__c==null) { if (temlostProduct.LostProductss.ProductClass__c==null) { temlostProduct.LostProductss.ProductClass__c.addError('失单产品类别必填!'); temlostProduct.LostProductss.ProductCategory__c.addError('失单产品必填!'); }else { temlostProduct.LostProductss.ProductCategory__c.addError('失单产品必填!'); } dataCheck = false; } // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 start if ((temlostProduct.LostProductss.LostProduct__c==null && temlostProduct.LostProductss.LostProductMannual__c==null)&&(temlostProduct.LostProductss.ProductCategory__c!=null||temlostProduct.LostProductss.Quantity__c!=null)) { if(tempLostBrand.lostBrand.Lost_By_Company__c != '其他'){ temlostProduct.LostProductss.LostProduct__c.addError('失单对手型号或失单对手型号(手动)必填!'); } else{ temlostProduct.LostProductss.LostProductMannual__c.addError('失单对手型号或失单对手型号(手动)必填!'); } dataCheck = false; } // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 end // update tcm 20211123 end // 20230418 ljh DB202304320022 start String LostBrandNameS = tempLostBrand.lostBrand.Lost_By_Company__c != '其他'?tempLostBrand.lostBrand.Lost_By_Company__c:tempLostBrand.lostBrand.Lost_By_Company_Mannual__c; String LostBrandName = temlostProduct.LostProductss.LostBrandName__c; if(LostBrandNameS != LostBrandName){ temlostProduct.LostProductss.LostBrandName__c.addError('失单品牌名不一致,请确认'); dataCheck = false; } // 20230418 ljh DB202304320022 end } for(LostBrand tempLostBrand : LostReport.LostBrands ) { system.debug('aaaa1++'+tempLostBrand.lostBrand.Lost_By_Company_Mannual__c); if(string.isblank(tempLostBrand.lostBrand.Lost_By_Company__c)) { tempLostBrand.lostBrand.Lost_By_Company__c.addError('请填写失单品牌!'); dataCheck = false; }// fy SWAG-CCC6F6 start else if('其他'.equals(tempLostBrand.lostBrand.Lost_By_Company__c)&&string.isblank(tempLostBrand.lostBrand.Lost_By_Company_Mannual__c)){ tempLostBrand.lostBrand.Lost_By_Company_Mannual__c.addError('请填写失单品牌(手动)!'); dataCheck = false; }// fy SWAG-CCC6F6 end system.debug('aaaa2++'+tempLostBrand.lostBrand.Lost_By_Company_Mannual__c); if(tempLostBrand.lostBrand.LostPrice__c == null) { tempLostBrand.lostBrand.LostPrice__c.addError('失单金额必填!'); dataCheck = false; } if(string.isblank(tempLostBrand.lostBrand.Lost_reason_main__c )) { tempLostBrand.lostBrand.Lost_reason_main__c.addError('失单理由(主)必填!'); dataCheck = false; } if(string.isblank(tempLostBrand.lostBrand.Agency__c )) { tempLostBrand.lostBrand.Agency__c.addError('中标经销商必填!'); dataCheck = false; } // 检查是否有超过1个有数的产品 integer productCount = 0; for( PCLLostProducts temlostProduct : tempLostBrand.LostProducts) { if (temlostProduct.LostProductss.LostProduct__c != null || temlostProduct.LostProductss.LostProductMannual__c != null) { System.debug('失单型号' + temlostProduct.LostProductss.LostProduct__c); System.debug('失单型号手动' + temlostProduct.LostProductss.LostProductMannual__c); productCount ++; } // update tcm 20211123 start if((temlostProduct.LostProductss.LostProduct__c!=null || temlostProduct.LostProductss.LostProductMannual__c!=null)&&(temlostProduct.LostProductss.Quantity__c==null || temlostProduct.LostProductss.Quantity__c ==0)) { temlostProduct.LostProductss.Quantity__c.addError('请填写失单数量!'); dataCheck = false; } if((temlostProduct.LostProductss.LostProduct__c!=null || temlostProduct.LostProductss.LostProductMannual__c!=null)&&temlostProduct.LostProductss.ProductCategory__c==null) { if (temlostProduct.LostProductss.ProductClass__c==null) { temlostProduct.LostProductss.ProductClass__c.addError('失单产品类别必填!'); temlostProduct.LostProductss.ProductCategory__c.addError('失单产品必填!'); }else { temlostProduct.LostProductss.ProductCategory__c.addError('失单产品必填!'); } dataCheck = false; } // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 start if ((temlostProduct.LostProductss.LostProduct__c==null && temlostProduct.LostProductss.LostProductMannual__c==null)&&(temlostProduct.LostProductss.ProductCategory__c!=null||temlostProduct.LostProductss.Quantity__c!=null)) { if(tempLostBrand.lostBrand.Lost_By_Company__c != '其他'){ temlostProduct.LostProductss.LostProduct__c.addError('失单对手型号或失单对手型号(手动)必填!'); } else{ temlostProduct.LostProductss.LostProductMannual__c.addError('失单对手型号或失单对手型号(手动)必填!'); } dataCheck = false; } // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 end // update tcm 20211123 end } // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 start if (productCount == 0 && tempLostBrand.LostProducts != null && tempLostBrand.LostProducts.size() > 0) { if(tempLostBrand.lostBrand.Lost_By_Company__c != '其他'){ tempLostBrand.LostProducts[0].LostProductss.LostProduct__c.addError('至少录入1条失单对手型号信息!'); }else{ tempLostBrand.LostProducts[0].LostProductss.LostProductMannual__c.addError('至少录入1条失单对手型号信息!'); } dataCheck = false; } // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 end // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 start if (productCount == 0 && tempLostBrand.LostProducts != null && tempLostBrand.LostProducts.size() > 0) { if(tempLostBrand.lostBrand.Lost_By_Company__c != '其他'){ tempLostBrand.LostProducts[0].LostProductss.LostProduct__c.addError('至少录入1条失单对手型号信息!'); }else{ tempLostBrand.LostProducts[0].LostProductss.LostProductMannual__c.addError('至少录入1条失单对手型号信息!'); } dataCheck = false; } return dataCheck; // 当失单品牌名为其他时,报错字段为失单对手型号(手动) thh 2022-01-17 end } return dataCheck; } public list<LostBrand> brandcopy(){ list<LostBrand> tempbrands = new list<LostBrand>(); for(LostBrand tempbrand: LostReport.LostBrands) { LostBrand LostBrand = new LostBrand(tempbrand.lineNo,tempbrand.LostProducts ); LostBrand.lostBrand = tempbrand.lostBrand.clone(); LostBrand.lostBrand.id = tempbrand.lostBrand.id; tempbrands.add(LostBrand); } return tempbrands; list<LostBrand> tempbrands = new list<LostBrand>(); for(LostBrand tempbrand: LostReport.LostBrands) { LostBrand LostBrand = new LostBrand(tempbrand.lineNo,tempbrand.LostProducts ); LostBrand.lostBrand = tempbrand.lostBrand.clone(); LostBrand.lostBrand.id = tempbrand.lostBrand.id; tempbrands.add(LostBrand); } return tempbrands; } // 数据录入 public boolean dataEntry(){ system.debug('save---start:'); Savepoint sp = Database.setSavepoint(); Lost_cancel_report__c templostReport = LostReport.lostReport.clone(); templostReport.id = LostReport.lostReport.id; list<LostBrand> tempBrands = brandcopy(); try{ // 待完成,这里需要把第一个品牌的信息赋值到这个失单报告上去,还有需要把各个品牌金额汇总加起来; //system.debug('LostReport.LostBrands:'+LostReport.LostBrands); // 设置记录类型 LostReport.lostReport.recordTypeID = LostReport.lostReport.LostType__c== '失单'?Schema.SObjectType.Lost_cancel_report__c.getRecordTypeInfosByDeveloperName().get('PCL_Lost_report').getRecordTypeId() : Schema.SObjectType.Lost_cancel_report__c.getRecordTypeInfosByDeveloperName().get('PCL_PartLost_report').getRecordTypeId(); LostReport.lostReport.LostTotalAmount__c = 0; LostReport.lostReport.of_lost_system_processor__c = 0; LostReport.lostReport.Lost_reason_main__c = null; LostReport.lostReport.Lost_Reason_Sub__c = null; LostReport.lostReport.Lost_By_Company__c = null; for(LostBrand tempLostBrand : LostReport.LostBrands) { if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) { LostReport.lostReport.LostTotalAmount__c += tempLostBrand.lostBrand.LostPrice__c; LostReport.lostReport.Lost_reason_main__c = LostReport.lostReport.Lost_reason_main__c == null ? tempLostBrand.lostBrand.Lost_reason_main__c : LostReport.lostReport.Lost_reason_main__c; LostReport.lostReport.Lost_Reason_Sub__c = LostReport.lostReport.Lost_Reason_Sub__c == null ? tempLostBrand.lostBrand.Lost_Reason_Sub__c : LostReport.lostReport.Lost_Reason_Sub__c; LostReport.lostReport.Lost_By_Company__c = LostReport.lostReport.Lost_By_Company__c == null ? tempLostBrand.lostBrand.Lost_By_Company__c : LostReport.lostReport.Lost_By_Company__c; for( PCLLostProducts tempLostProduct : tempLostBrand.LostProducts) { if(tempLostProduct.LostProductss.Quantity__c !=null && tempLostProduct.LostProductss.Quantity__c >0) { LostReport.lostReport.of_lost_system_processor__c += tempLostProduct.LostProductss.Quantity__c; } } } } upsert LostReport.lostReport; // 需要插入更新的失单品牌 map<integer,PCLLostBrand__c> upsertLostBrandMap = new map<integer,PCLLostBrand__c>(); // 需要删掉的失单品牌 map<integer,PCLLostBrand__c> deleteLostBrandMap = new map<integer,PCLLostBrand__c>(); // 需要插入更新的失单型号,key是品牌编号+型号编号,value是需要更新的失单型号 map<string,PCLLostProduct__c> upsertLostProductMap = new map<string,PCLLostProduct__c>(); // 需要删掉的失单品牌 list<PCLLostProduct__c> deleteLostProductList = new list<PCLLostProduct__c>(); for(LostBrand tempLostBrand : LostReport.LostBrands ) { // 如果有失单品牌,那么就要插入更新; system.debug('tempLostBrand.lostBrand.Lost_By_Company__c:'+tempLostBrand.lostBrand.Lost_By_Company__c); if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) { upsertLostBrandMap.put(tempLostBrand.lineNo,tempLostBrand.lostBrand); tempLostBrand.lostBrand.Lost_cancel_report__c = LostReport.lostReport.id; tempLostBrand.lostBrand.Name = tempLostBrand.lostBrand.Lost_By_Company__c; integer tempNo = 0; for( PCLLostProducts tempLostProduct : tempLostBrand.LostProducts) { system.debug('Name:'+ tempLostProduct.LostProductss.Name ); if(tempLostProduct.LostProductss.Quantity__c !=null && tempLostProduct.LostProductss.Quantity__c >0) { tempLostProduct.LostProductss.Name = tempLostBrand.lostBrand.Name + tempLostProduct.LostProductss.Quantity__c; upsertLostProductMap.put(tempLostBrand.lineNo +':'+ tempNo,tempLostProduct.LostProductss); }else if(string.isNotBlank(tempLostProduct.LostProductss.id)) { deleteLostProductList.add(tempLostProduct.LostProductss); } tempNo++; } } // 如果没有品牌,但是有id, 这样数据需要删除 else if(string.isNotBlank(tempLostBrand.lostBrand.id)) { deleteLostBrandMap.put(tempLostBrand.lineNo,tempLostBrand.lostBrand); // 这里可能需要也判断一下失单型号有没有需要删掉 } } if(upsertLostBrandMap.size()>0) { upsert upsertLostBrandMap.values(); } for( string productNo :upsertLostProductMap.keyset()) { PCLLostProduct__c tempLostProduct = upsertLostProductMap.get(productNo); integer brandNo = integer.valueof(productNo.split(':')[0]); tempLostProduct.PCLLostBrand__c = upsertLostBrandMap.get(brandNo).id; } if(upsertLostProductMap.size()>0) { upsert upsertLostProductMap.values(); } if(deleteLostBrandMap.size()>0) { delete deleteLostBrandMap.values(); for(PCLLostBrand__c pcl: deleteLostBrandMap.values()) { pcl.id = null; } } if(deleteLostProductList.size()>0) { delete deleteLostProductList; for(PCLLostProduct__c pclp: deleteLostProductList) { pclp.id = null; } } if(deleteBrandIDSet.size() > 0) { list<id> tempdeleteIDlist = new list<id>(); tempdeleteIDlist.addall(deleteBrandIDSet); database.delete(tempdeleteIDlist); } for(integer brandNumber =0; brandNumber< LostReport.LostBrands.size(); brandNumber++) { LostBrand tempLostBrand = LostReport.LostBrands.get(brandNumber); if(tempLostBrand.lostBrand.Id == null) { LostReport.LostBrands.remove(brandNumber); brandNumber--; continue; } for(integer productNumber = 0; productNumber< tempLostBrand.LostProducts.size(); productNumber++) { PCLLostProducts tempLostProduct = tempLostBrand.LostProducts.get(productNumber); if(tempLostProduct.LostProductss.Id == null) { tempLostBrand.LostProducts.remove(productNumber); productNumber--; continue; } } } lostReportId = LostReport.lostReport.id; system.debug('save---end:'); }catch (Exception ex) { Database.rollback(sp); LostReport.lostReport = templostReport; LostReport.LostBrands = tempBrands; // 这里需要写一些报错信息 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,ex.getMessage())); return false; system.debug('save---start:'); Savepoint sp = Database.setSavepoint(); Lost_cancel_report__c templostReport = LostReport.lostReport.clone(); templostReport.id = LostReport.lostReport.id; list<LostBrand> tempBrands = brandcopy(); try{ // 待完成,这里需要把第一个品牌的信息赋值到这个失单报告上去,还有需要把各个品牌金额汇总加起来; //system.debug('LostReport.LostBrands:'+LostReport.LostBrands); // 设置记录类型 LostReport.lostReport.recordTypeID = LostReport.lostReport.LostType__c== '失单'?Schema.SObjectType.Lost_cancel_report__c.getRecordTypeInfosByDeveloperName().get('PCL_Lost_report').getRecordTypeId() : Schema.SObjectType.Lost_cancel_report__c.getRecordTypeInfosByDeveloperName().get('PCL_PartLost_report').getRecordTypeId(); LostReport.lostReport.LostTotalAmount__c = 0; LostReport.lostReport.TotalAmountLost__c = 0; //20230215 lt DB202302247719 LostReport.lostReport.of_lost_system_processor__c = 0; LostReport.lostReport.Lost_reason_main__c = null; LostReport.lostReport.Lost_Reason_Sub__c = null; LostReport.lostReport.Lost_By_Company__c = null; //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 start //批准日不为空时给修改后再批准赋值 if(LostReport.lostReport.Approved_Day__c != null){ LostReport.lostReport.ModifyAfterApproval__c = true; } return true; //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 end for(LostBrand tempLostBrand : LostReport.LostBrands) { if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) { LostReport.lostReport.LostTotalAmount__c += tempLostBrand.lostBrand.LostPrice__c; //20230215 lt DB202302247719 start Decimal med = tempLostBrand.lostBrand.LostPrice__c/1.13/1000; Decimal med1 = med.setScale(2); // System.debug('---lt123不含税数值(人工)Decimal---'+med); // System.debug('---lt123不含税数值(人工)Decimal两位小数---'+med1); LostReport.lostReport.TotalAmountLost__c += med1; //LostReport.lostReport.TotalAmountLost__c += tempLostBrand.lostBrand.LostPrices_ThousandY__c; //20230215 lt DB202302247719 // LostReport.lostReport.TotalAmountLost__c += tempLostBrand.lostBrand.LostPrice__c/1.13/1000; //20230215 lt DB202302247719 //20230215 lt DB202302247719 en LostReport.lostReport.Lost_reason_main__c = LostReport.lostReport.Lost_reason_main__c == null ? tempLostBrand.lostBrand.Lost_reason_main__c : LostReport.lostReport.Lost_reason_main__c; LostReport.lostReport.Lost_Reason_Sub__c = LostReport.lostReport.Lost_Reason_Sub__c == null ? tempLostBrand.lostBrand.Lost_Reason_Sub__c : LostReport.lostReport.Lost_Reason_Sub__c; LostReport.lostReport.Lost_By_Company__c = LostReport.lostReport.Lost_By_Company__c == null ? tempLostBrand.lostBrand.Lost_By_Company__c : LostReport.lostReport.Lost_By_Company__c; for( PCLLostProducts tempLostProduct : tempLostBrand.LostProducts) { if(tempLostProduct.LostProductss.Quantity__c !=null && tempLostProduct.LostProductss.Quantity__c >0) { LostReport.lostReport.of_lost_system_processor__c += tempLostProduct.LostProductss.Quantity__c; } } } } upsert LostReport.lostReport; // 需要插入更新的失单品牌 map<integer,PCLLostBrand__c> upsertLostBrandMap = new map<integer,PCLLostBrand__c>(); // 需要删掉的失单品牌 map<integer,PCLLostBrand__c> deleteLostBrandMap = new map<integer,PCLLostBrand__c>(); // 需要插入更新的失单型号,key是品牌编号+型号编号,value是需要更新的失单型号 map<string,PCLLostProduct__c> upsertLostProductMap = new map<string,PCLLostProduct__c>(); // 需要删掉的失单品牌 list<PCLLostProduct__c> deleteLostProductList = new list<PCLLostProduct__c>(); for(LostBrand tempLostBrand : LostReport.LostBrands ) { // 如果有失单品牌,那么就要插入更新; system.debug('tempLostBrand.lostBrand.Lost_By_Company__c:'+tempLostBrand.lostBrand.Lost_By_Company__c); if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) { upsertLostBrandMap.put(tempLostBrand.lineNo,tempLostBrand.lostBrand); tempLostBrand.lostBrand.Lost_cancel_report__c = LostReport.lostReport.id; tempLostBrand.lostBrand.Name = tempLostBrand.lostBrand.Lost_By_Company__c; integer tempNo = 0; for( PCLLostProducts tempLostProduct : tempLostBrand.LostProducts) { system.debug('Name:'+ tempLostProduct.LostProductss.Name ); if(tempLostProduct.LostProductss.Quantity__c !=null && tempLostProduct.LostProductss.Quantity__c >0) { tempLostProduct.LostProductss.Name = tempLostBrand.lostBrand.Name + tempLostProduct.LostProductss.Quantity__c; upsertLostProductMap.put(tempLostBrand.lineNo +':'+ tempNo,tempLostProduct.LostProductss); }else if(string.isNotBlank(tempLostProduct.LostProductss.id)) { deleteLostProductList.add(tempLostProduct.LostProductss); } tempNo++; } } // 如果没有品牌,但是有id, 这样数据需要删除 else if(string.isNotBlank(tempLostBrand.lostBrand.id)) { deleteLostBrandMap.put(tempLostBrand.lineNo,tempLostBrand.lostBrand); // 这里可能需要也判断一下失单型号有没有需要删掉 } } if(upsertLostBrandMap.size()>0) { upsert upsertLostBrandMap.values(); } for( string productNo :upsertLostProductMap.keyset()) { PCLLostProduct__c tempLostProduct = upsertLostProductMap.get(productNo); integer brandNo = integer.valueof(productNo.split(':')[0]); tempLostProduct.PCLLostBrand__c = upsertLostBrandMap.get(brandNo).id; } if(upsertLostProductMap.size()>0) { upsert upsertLostProductMap.values(); } if(deleteLostBrandMap.size()>0) { delete deleteLostBrandMap.values(); for(PCLLostBrand__c pcl: deleteLostBrandMap.values()) { pcl.id = null; } } if(deleteLostProductList.size()>0) { delete deleteLostProductList; for(PCLLostProduct__c pclp: deleteLostProductList) { pclp.id = null; } } if(deleteBrandIDSet.size() > 0) { list<id> tempdeleteIDlist = new list<id>(); tempdeleteIDlist.addall(deleteBrandIDSet); database.delete(tempdeleteIDlist); } for(integer brandNumber =0; brandNumber< LostReport.LostBrands.size(); brandNumber++) { LostBrand tempLostBrand = LostReport.LostBrands.get(brandNumber); if(tempLostBrand.lostBrand.Id == null) { LostReport.LostBrands.remove(brandNumber); brandNumber--; continue; } for(integer productNumber = 0; productNumber< tempLostBrand.LostProducts.size(); productNumber++) { PCLLostProducts tempLostProduct = tempLostBrand.LostProducts.get(productNumber); if(tempLostProduct.LostProductss.Id == null) { tempLostBrand.LostProducts.remove(productNumber); productNumber--; continue; } } } lostReportId = LostReport.lostReport.id; system.debug('save---end:'); }catch (Exception ex) { Database.rollback(sp); LostReport.lostReport = templostReport; LostReport.LostBrands = tempBrands; // 这里需要写一些报错信息 System.debug('---lt123---'+ex.getLineNumber()); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,ex.getMessage())); return false; } return true; } // 取消 public PageReference cancel(){ PageReference page = new PageReference('/'+oppId); page.setRedirect(true); return page; PageReference page = new PageReference('/'+oppId); page.setRedirect(true); return page; } // 提交 public PageReference submit(){ if(!'草案'.equals(LostReport.LostReport.Report_Status__c) ) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只有在草案中才能提交申请!')); return null; } //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 update //&& LostReport.LostReport.ModifyAfterApproval__c == false if(!'草案'.equals(LostReport.LostReport.Report_Status__c) && LostReport.LostReport.ModifyAfterApproval__c == false) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只有在草案中才能提交申请!')); return null; } Savepoint sp = Database.setSavepoint(); try{ LostReport.lostReport.Report_Status__c = '提交'; update LostReport.lostReport; Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest(); psr.setObjectId(lostReportId); Approval.ProcessResult submitResult = Approval.process(psr); PageReference page = new PageReference('/apex/PCLLostReportPage'); page.getParameters().put('Id', lostReportId); page.getParameters().put('pageStatus', 'View'); page.getParameters().put('submitFlag', '1'); page.setRedirect(true); return page; }catch(exception ex) { Database.rollback(sp); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,ex.getMessage())); return null; } // 20230629 wkx DB202306242764 start //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 add lcrlist1 //DB202308068183 add (不等于当前失单报告,批准后再修改用) list<Lost_cancel_report__c> lcrlist1=[select id,Opportunity__c from Lost_cancel_report__c where Opportunity__c=:oppid and id!=:lostReportId limit 1]; list<opportunity> opplist1=[select id,cnt_lost_cancel_report__c,cnt_lost_cancel_draft__c from Opportunity where id=:oppid limit 1]; if (opplist1[0].cnt_lost_cancel_report__c - opplist1[0].cnt_lost_cancel_draft__c > 0 && lcrlist1.size() > 0) { ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '已存在 询价失单/取消 报告!')); return null; } // 20230629 wkx DB202306242764 end Savepoint sp = Database.setSavepoint(); try{ LostReport.lostReport.Report_Status__c = '提交'; update LostReport.lostReport; //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 start 注释 //DB202308068183 进 进程生成器 // Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest(); // psr.setObjectId(lostReportId); // Approval.ProcessResult submitResult = Approval.process(psr); //20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 end 注释 PageReference page = new PageReference('/apex/PCLLostReportPage'); page.getParameters().put('Id', lostReportId); page.getParameters().put('pageStatus', 'View'); page.getParameters().put('submitFlag', '1'); page.setRedirect(true); return page; }catch(exception ex) { Database.rollback(sp); ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,ex.getMessage())); return null; } } // 添加品牌 public PageReference addBrand(){ LostReport.LostBrands.add(new LostBrand(LostReport.LostBrands.size())); brandCount = LostReport.LostBrands.size(); return null; LostReport.LostBrands.add(new LostBrand(LostReport.LostBrands.size())); brandCount = LostReport.LostBrands.size(); return null; } // 删除品牌 这个有参数brandNo,才知道是删除那个品牌 public PageReference Remove(){ system.debug('RemoveBrandNo:'+RemoveBrandNo); list<LostBrand> tempLostBrands = new List<lostBrand>(); Integer i = 0; for(integer j = 0; j< LostReport.LostBrands.size(); j++ ) { LostBrand templostBrand = LostReport.LostBrands.get(j); if(j != RemoveBrandNo) { templostBrand.lineNo = i; tempLostBrands.add(templostBrand); i++; }else if(!string.isBlank(templostBrand.lostBrand.id)) { deleteBrandIDSet.add(templostBrand.lostBrand.id); } system.debug('RemoveBrandNo:'+RemoveBrandNo); list<LostBrand> tempLostBrands = new List<lostBrand>(); Integer i = 0; for(integer j = 0; j< LostReport.LostBrands.size(); j++ ) { LostBrand templostBrand = LostReport.LostBrands.get(j); if(j != RemoveBrandNo) { templostBrand.lineNo = i; tempLostBrands.add(templostBrand); i++; }else if(!string.isBlank(templostBrand.lostBrand.id)) { deleteBrandIDSet.add(templostBrand.lostBrand.id); } LostReport.LostBrands = tempLostBrands; brandCount = LostReport.LostBrands.size(); return null; } LostReport.LostBrands = tempLostBrands; brandCount = LostReport.LostBrands.size(); return null; } // 添加型号, 这个有参数brandNo,才知道是添加到那个品牌 // update tcm 20211125 添加型号时自动带出品牌 start public PageReference addProduct(){ system.debug('brandNo:'+brandNo); LostBrand tempLostBrand = LostReport.LostBrands.get(brandNo); // PCLLostProduct__c plp = new PCLLostProduct__c(Competitor__c=CompetitionMap.get(LostReport.LostBrands[brandNo].lostBrand.Lost_By_Company__c)); string brandName = tempLostBrand.lostBrand.Lost_By_Company__c; PCLLostProduct__c plp = new PCLLostProduct__c(); plp.LostBrandName__c = brandName; tempLostBrand.LostProducts.add(new PCLLostProducts(tempLostBrand.LostProducts.size(),plp)); tempLostBrand.ProductSize = tempLostBrand.LostProducts.size(); return null; system.debug('brandNo:'+brandNo); LostBrand tempLostBrand = LostReport.LostBrands.get(brandNo); // PCLLostProduct__c plp = new PCLLostProduct__c(Competitor__c=CompetitionMap.get(LostReport.LostBrands[brandNo].lostBrand.Lost_By_Company__c)); // 20230418 ljh DB202304320022 start // string brandName = tempLostBrand.lostBrand.Lost_By_Company__c; string brandName = tempLostBrand.lostBrand.Lost_By_Company__c != '其他'?tempLostBrand.lostBrand.Lost_By_Company__c:tempLostBrand.lostBrand.Lost_By_Company_Mannual__c; // 20230418 ljh DB202304320022 end PCLLostProduct__c plp = new PCLLostProduct__c(); plp.LostBrandName__c = brandName; tempLostBrand.LostProducts.add(new PCLLostProducts(tempLostBrand.LostProducts.size(),plp)); tempLostBrand.ProductSize = tempLostBrand.LostProducts.size(); return null; } // update tcm 20211125 添加型号时自动带出品牌 end // 页面的数据结构 public class LostReport { public Lost_cancel_report__c lostReport { get; set; } public list<LostBrand> LostBrands { get; set; } public LostReport(){ lostReport = new Lost_cancel_report__c(); LostBrands = new list<LostBrand> {new LostBrand(0)}; } public LostReport(Lost_cancel_report__c lostReport){ this.lostReport = lostReport; LostBrands = new list<LostBrand> {new LostBrand(0)}; } public LostReport(Lost_cancel_report__c lostReport, list<LostBrand> LostBrands){ this.lostReport = lostReport; this.LostBrands = LostBrands; } public Lost_cancel_report__c lostReport { get; set; } public list<LostBrand> LostBrands { get; set; } public LostReport(){ lostReport = new Lost_cancel_report__c(); LostBrands = new list<LostBrand> {new LostBrand(0)}; } public LostReport(Lost_cancel_report__c lostReport){ this.lostReport = lostReport; LostBrands = new list<LostBrand> {new LostBrand(0)}; } public LostReport(Lost_cancel_report__c lostReport, list<LostBrand> LostBrands){ this.lostReport = lostReport; this.LostBrands = LostBrands; } } public class LostBrand { public PCLLostBrand__c lostBrand { get; set; } public Integer lineNo { get; set; } public list<PCLLostProducts> LostProducts { get; set; } public Integer ProductSize {get; set;} public LostBrand( integer lineNo ){ lostBrand = new PCLLostBrand__c(); this.lineNo = lineNo; LostProducts = new list<PCLLostProducts> {new PCLLostProducts()}; ProductSize = 1; lostBrand = new PCLLostBrand__c(); } public LostBrand( integer lineNo, list<PCLLostProducts> LostProducts ){ lostBrand = new PCLLostBrand__c(); this.lineNo = lineNo; this.LostProducts = LostProducts; ProductSize = LostProducts.size(); } public LostBrand( integer lineNo, list<PCLLostProducts> LostProducts, PCLLostBrand__c lostBrand){ this.lostBrand = lostBrand; this.lineNo = lineNo; this.LostProducts = LostProducts; ProductSize = LostProducts.size(); } public PCLLostBrand__c lostBrand { get; set; } public Integer lineNo { get; set; } public list<PCLLostProducts> LostProducts { get; set; } public Integer ProductSize {get; set;} public LostBrand( integer lineNo ){ lostBrand = new PCLLostBrand__c(); this.lineNo = lineNo; LostProducts = new list<PCLLostProducts> {new PCLLostProducts()}; ProductSize = 1; lostBrand = new PCLLostBrand__c(); } public LostBrand( integer lineNo, list<PCLLostProducts> LostProducts ){ lostBrand = new PCLLostBrand__c(); this.lineNo = lineNo; this.LostProducts = LostProducts; ProductSize = LostProducts.size(); } public LostBrand( integer lineNo, list<PCLLostProducts> LostProducts, PCLLostBrand__c lostBrand){ this.lostBrand = lostBrand; this.lineNo = lineNo; this.LostProducts = LostProducts; ProductSize = LostProducts.size(); } } // add tcm 20211119 start public class PCLLostProducts { public Integer lineNo2 { get; set; } public PCLLostProduct__c LostProductss { get; set; } public Boolean bool { get; set; } public PCLLostProducts() { this.lineNo2 = 0; this.LostProductss=new PCLLostProduct__c(); public Integer lineNo2 { get; set; } public PCLLostProduct__c LostProductss { get; set; } public Boolean bool { get; set; } public PCLLostProducts() { this.lineNo2 = 0; this.LostProductss=new PCLLostProduct__c(); } public PCLLostProducts(Integer lineNo2) { this.lineNo2 = lineNo2; this.LostProductss=new PCLLostProduct__c(); } public PCLLostProducts(Integer lineNo2,PCLLostProduct__c LostProductss) { this.lineNo2 = lineNo2; this.LostProductss=LostProductss; if (LostProductss.LostProduct__c != null) { this.bool = true; } public PCLLostProducts(Integer lineNo2) { this.lineNo2 = lineNo2; this.LostProductss=new PCLLostProduct__c(); } public PCLLostProducts(Integer lineNo2,PCLLostProduct__c LostProductss) { this.lineNo2 = lineNo2; this.LostProductss=LostProductss; if (LostProductss.LostProduct__c != null) { this.bool = true; } } } } // add tcm 20211119 end // add tcm 20211118 start public void search() { if (LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c==null) { LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].bool=false; if (LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c==null) { LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].bool=false; }else { Product2 prd = [select Id,ProductClass__c, ProductCategory__c from Product2 where Id =:LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c]; if (prd.ProductCategory__c!=null) { LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=prd.ProductClass__c; LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=prd.ProductCategory__c; LostReport.LostBrands[topNum].LostProducts[secondNum].bool=true; }else { Product2 prd = [select Id,ProductClass__c, ProductCategory__c from Product2 where Id =:LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.LostProduct__c]; if (prd.ProductCategory__c!=null) { LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=prd.ProductClass__c; LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=prd.ProductCategory__c; LostReport.LostBrands[topNum].LostProducts[secondNum].bool=true; }else { LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].bool=false; } LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductClass__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].LostProductss.ProductCategory__c=null; LostReport.LostBrands[topNum].LostProducts[secondNum].bool=false; } } } // add tcm 20211118 end } } force-app/main/default/classes/Solution_ProgrammeTrigger.cls
@@ -138,6 +138,7 @@ } public void updateSolutionProgrammeAndProjectStatus(){ system.debug('beforeUpdate'); Map<Id,SolutionProjectRequirements__c> solutionProJectMap = new Map<Id,SolutionProjectRequirements__c>(); List<SolutionProjectRequirements__c> solutionProJectList = [select id,Status__c,First_Proposal_Time__c from SolutionProjectRequirements__c where id = :solProjectId]; for(SolutionProjectRequirements__c solProject : solutionProJectList){ @@ -149,11 +150,12 @@ if(solutionPro.RejectedInvalid__c == true){ solutionPro.addError('请填写反馈结果,并按审批按钮'); } if(solutionPro.ProcessOfApproval__c == true && (solutionPro.Confirmation_Result__c == null || solutionPro.Confirmation_Result__c == '')){ solutionPro.addError('批准之前必须填写反馈结果!'); } // if(solutionPro.ProcessOfApproval__c == true && (solutionPro.Confirmation_Result__c == null || solutionPro.Confirmation_Result__c == '')){ // solutionPro.addError('批准之前必须填写反馈结果!'); // } if(solutionPro.ProcessOfApproval__c == true && solutionPro.Confirmation_Result__c != null && solutionPro.Confirmation_Result__c != ''){ if(solutionPro.Confirmation_Result__c == '01采纳/部分采纳'){ system.debug('01采纳/部分采纳'); solutionPro.Status__c = '03采纳/部分采纳'; // solutionPro.Scheme_Type__c = '结案'; solutionPro.ProcessOfApproval__c = false; @@ -163,6 +165,7 @@ } } if(solutionPro.Confirmation_Result__c == '02未采纳'){ system.debug('02未采纳'); solutionPro.Status__c = '04未采纳'; // solutionPro.Scheme_Type__c = '结案'; solutionPro.ProcessOfApproval__c = false; force-app/main/default/classes/lexAccountController.cls
@@ -1,5 +1,20 @@ public with sharing class lexAccountController { @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { Account acc = [ select Name from Account where Id =: recordId ]; res.name = acc.Name; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } @AuraEnabled public static InitData initForNewSolutonProButton(String recordId){ InitData res = new InitData(); try { @@ -84,5 +99,7 @@ public String recordTypeId; @AuraEnabled public String hospitalDepartmentClass; @AuraEnabled public String name; } } force-app/main/default/classes/lexAgencyHospitalLinkController.cls
New file @@ -0,0 +1,11 @@ public with sharing class lexAgencyHospitalLinkController { @AuraEnabled public static string initForCreateAgencyContact(String recordId){ try { } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } } } force-app/main/default/classes/lexAgencyHospitalLinkController.cls-meta.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>58.0</apiVersion> <status>Active</status> </ApexClass> force-app/main/default/classes/lexLostCancelReportController.cls
New file @@ -0,0 +1,83 @@ public with sharing class lexLostCancelReportController { @AuraEnabled public static InitData initSubmitReportButton(String recordId){ InitData res = new InitData(); try { Lost_Cancel_Report__c report = [ select Opportunity__c from Lost_Cancel_Report__c where Id =: recordId ]; Opportunity opp = [ select Cnt_Lost_cancel_report__c, Cnt_Lost_cancel_Draft__c from Opportunity where Id =: report.Opportunity__c ]; res.cntLostCancelDraft = opp.Cnt_Lost_cancel_Draft__c; res.cntLostCancelReport = opp.Cnt_Lost_cancel_report__c; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } @AuraEnabled public static InitData initForEditCancelReport(String recordId){ InitData res = new InitData(); try { Lost_cancel_report__c report = [ select Id, RecordTypeId, Opportunity__c, LostType__c , Report_Status__c from Lost_cancel_report__c where id =: recordId ]; res.recordTypeId = report.RecordTypeId; res.lostType = report.LostType__c; res.reportStatus = report.Report_Status__c; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } @AuraEnabled public static string updateSubmitReportButton(String recordId){ Savepoint sp = Database.setSavepoint(); Lost_cancel_report__c report = new Lost_cancel_report__c(); try { report.Id = recordId; report.Report_Status__c = '提交'; update report; // Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest(); // psr.setObjectId(report.Id); // Approval.ProcessResult submitResult = Approval.process(psr); return null; } catch (Exception e) { Database.rollback(sp); if (e.getMessage().contains(',')) { System.debug(LoggingLevel.INFO, '*** e: ' + e); String exc = '' + e.getMessage(); Integer left = exc.indexOf(':') + 1; Integer right = exc.lastIndexOf(':'); String str = exc.substring(left,right); left = str.indexOf(',') + 1; String newStr = str.substring(left); return newStr; }else { return e.getMessage(); } } } class InitData { @AuraEnabled public Decimal cntLostCancelReport; @AuraEnabled public Decimal cntLostCancelDraft; @AuraEnabled public String recordTypeId; @AuraEnabled public String lostType; @AuraEnabled public String reportStatus; } } force-app/main/default/classes/lexLostCancelReportController.cls-meta.xml
New file @@ -0,0 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>58.0</apiVersion> <status>Active</status> </ApexClass> force-app/main/default/classes/lexPCLLostReportLwcController.cls
@@ -150,6 +150,7 @@ LostTotalAmount__c,LostType__c, Report_Status__c,Sales_assistant__c, InclusionUltrasound__c, //20230506 lt DB202304618804 包含超声 ModifyAfterApproval__c,Approved_Day__c,//20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 add Opportunity__c, Opportunity__r.Sales_assistant_ID__c, Opportunity__r.Sales_manager_departmentID__c, Manager_sales__c,recordtypeid,recordtype.DeveloperName @@ -330,6 +331,10 @@ report.lostReport.Lost_reason_main__c = null; report.lostReport.Lost_Reason_Sub__c = null; report.lostReport.Lost_By_Company__c = null; //批准日不为空时给修改后再批准赋值 if(LostReport.lostReport.Approved_Day__c != null){ LostReport.lostReport.ModifyAfterApproval__c = true; } for(LostBrand tempLostBrand : report.LostBrands) { if(string.isNotBlank(tempLostBrand.lostBrand.Lost_By_Company__c)) { report.lostReport.LostTotalAmount__c += tempLostBrand.lostBrand.LostPrice__c; @@ -484,7 +489,7 @@ public static Map<string,Object> submit(String report1,String reportId){ LostReport report = (LostReport)JSON.deserialize(report1, LostReport.class); Map<string,string> messages = new Map<string,string>(); if(!'草案'.equals(report.lostReport.Report_Status__c) ) { if(!'草案'.equals(report.lostReport.Report_Status__c) && LostReport.LostReport.ModifyAfterApproval__c == false) { messages.put('error', '只有在草案中才能提交申请!'); return messages; } force-app/main/default/classes/lexSolutionProgrammeController.cls
@@ -36,7 +36,14 @@ update so; return ''; } catch (Exception e) { return e.getMessage(); if(e.getMessage().contains(':')){ String eMsg = e.getMessage(); Integer left = eMsg.indexOf(',')+1; Integer right = eMsg.lastindexOf('。')+1; return eMsg.substring(left,right); }else{ return e.getMessage(); } } } //提交审批 force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
@@ -19,7 +19,7 @@ res.departmentClassId = so.Department_Class__c; res.productLeader = so.Product_Leader__c; res.userId = UserInfo.getUserId(); res.userName = UserInfo.getUserName(); res.userName = [select Name from User where Id =: res.userId].Name; maps.put('res', res); } catch (Exception e) { String message = e.getMessage(); force-app/main/default/classes/taskManageController.cls
@@ -37,7 +37,7 @@ } // 确认或者延期 @AuraEnabled public static string confirmOrDelay(boolean isDelay, string delayReason, string delayReasonOther, string taskID,Boolean IsGeneratePlan,Date ActivityDate,Date feedbackPlanDate) { public static string confirmOrDelay(boolean isDelay, string delayReason, string delayReasonOther, string taskID,Boolean IsGeneratePlan,Date ActivityDate,Date feedbackPlanDate,Date estimatedFinishDate) { //2021-07-30 mzy SWAG-C5DAX8 update start UserResult u = UserInfo_Owner(); //2021-07-30 mzy SWAG-C5DAX8 update end @@ -64,6 +64,21 @@ tempTask.feedbackPlanDate__c = feedbackPlanDate; } //2021-10-20 mzy 任务管理改善 end // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start Task__c tempObj = [SELECT Id, taskType__c FROM Task__c WHERE Id =: taskID]; if (tempObj.taskType__c == '盘点检查计划' || tempObj.taskType__c == '温湿度检查计划') { if (isDelay) { tempTask.taskStatus__c = '05 延期'; tempTask.delayDate__c = Date.today(); tempTask.delayToDate__c = estimatedFinishDate; } else { tempTask.taskStatus__c = '02 接受'; tempTask.ConfirmDate__c = Date.today(); tempTask.Estimated_Finish_Date__c = estimatedFinishDate; } } // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End update tempTask; //成功返回更新成功 @@ -371,6 +386,9 @@ //2021-11-25 mzy 任务管理改善 start 'HopeCompletionDate__c,'+ //2021-11-25 mzy 任务管理改善 end // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start 'Estimated_Finish_Date__c,LatestFinishDate__c,'+ // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End 'taskStatus__c,taskType__c,Assignment_Date__c from task__c where assignee__c =: userIDList and mergeTaskMain__c = null ' + //2021-1-4 yjk 增加任务区分,只查询被动和上级分配 //' and TaskDifferent__c != \'主动任务\' '; @@ -476,7 +494,12 @@ tempTaskWrapper.assignButtonisDisabled = false; //20210111 CHAN-BWX3YU you start tempTaskWrapper.assignButtonisDisabled_Owner = false; //【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start tempTaskWrapper.createdAfter3Month = tempTask.CreateDate__c.addMonths(3); tempTaskWrapper.latestFinishDate = tempTask.LatestFinishDate__c; //【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End Date d2 = date.today().addDays(-2); Date createdate1= date.newinstance(tempTask.CreateDate__c.year(), tempTask.CreateDate__c.month(), tempTask.CreateDate__c.day()); system.debug('分配时间'+tempTask.Assignment_Date__c+'==d2=='+d2); @@ -676,6 +699,12 @@ @AuraEnabled public Date HopeCompletionDate; //2021-11-25 任务管理改善 mzy //【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start @AuraEnabled public Date createdAfter3Month; @AuraEnabled public Date latestFinishDate; //【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End } public class pickerWrapper { @AuraEnabled force-app/main/default/lwc/lexApplyAgainLwc/lexApplyAgainLwc.js
@@ -1,3 +1,11 @@ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-09 13:31:12 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-11 14:43:12 */ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; @@ -38,7 +46,8 @@ const defaultValues = encodeDefaultFieldValues({ old_Project_No__c: this.recordId, Department_Class__c: this.departmentClassId, Hospital__c: this.hospitalId Hospital__c: this.hospitalId, Name: '*' }); this[NavigationMixin.Navigate]({ type: 'standard__objectPage', force-app/main/default/lwc/lexBeforeOPDPDFBtnSIS/lexBeforeOPDPDFBtnSIS.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-13 15:55:45 * @LastEditors: chen jing wu * @LastEditTime: 2023-04-13 16:04:14 * @LastEditTime: 2023-09-11 15:50:12 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -88,9 +88,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexCancelReport/lexCancelReport.js
@@ -67,9 +67,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-07 09:02:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-09 17:42:28 * @LastEditTime: 2023-09-11 14:32:05 */ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -60,9 +60,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-07 09:02:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-04-11 11:18:36 * @LastEditTime: 2023-09-11 13:53:55 */ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -59,9 +59,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexChangeContractType/lexChangeContractType.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-05-15 13:17:26 * @LastEditors: chen jing wu * @LastEditTime: 2023-06-02 10:59:13 * @LastEditTime: 2023-09-11 15:53:23 */ /* * @Description: @@ -133,9 +133,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexCopyWithAsset/lexCopyWithAsset.js
@@ -4,13 +4,14 @@ * @Author: chen jing wu * @Date: 2023-04-21 14:32:09 * @LastEditors: chen jing wu * @LastEditTime: 2023-06-05 11:09:35 * @LastEditTime: 2023-09-12 11:39:47 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import init from '@salesforce/apex/OpportunityLightingButtonController.initForCopyWithAssetButton'; import initCopy from '@salesforce/apex/OpportunityLightingButtonController.initCopy'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; export default class LexCopyWithAsset extends NavigationMixin(LightningElement) { @@ -35,9 +36,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } @@ -54,6 +56,7 @@ copyWithAsset(){ if(this.sapSendOK){ this.showToast("询价已经WIN,不能进行拆单","error"); this.dispatchEvent(new CloseActionScreenEvent()); } else { // window.open( // "/" @@ -66,23 +69,29 @@ // + this.isAuthorized // + "&00N10000008pnmd=1&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb"); const defaultValues = encodeDefaultFieldValues({ Old_Opportunity_ID__c: this.recordId, IsAuthorized__c: this.isAuthorized }); this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: 'Opportunity', actionName: 'clone', recordId: this.recordId }, state: { nooverride: '1', defaultFieldValues: defaultValues } initCopy({ recordId: this.recordId }).then(result=>{ var changeData = 'Old_Opportunity_ID__c=' + this.recordId + ',IsAuthorized__c=' + this.isAuthorized + ',SeparateBillMark__c=1' + ',NotesApprovedNo__c=' + ',Assistant_Applied_Date__c=' + ',Contract_DB_SalesDept_complite_day__c=' + ',Closing_Bid_Date__c='; console.log(result); this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { actionName: 'new', objectApiName: 'Opportunity' }, state: { defaultFieldValues: result + ',' + changeData } }); this.dispatchEvent(new CloseActionScreenEvent()); }); } this.dispatchEvent(new CloseActionScreenEvent()); } } force-app/main/default/lwc/lexCreateAgencyContact/__tests__/lexCreateAgencyContact.test.js
New file @@ -0,0 +1,25 @@ import { createElement } from 'lwc'; import LexCreateAgencyContact from 'c/lexCreateAgencyContact'; describe('c-lex-create-agency-contact', () => { 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-lex-create-agency-contact', { is: LexCreateAgencyContact }); // Act document.body.appendChild(element); // Assert // const div = element.shadowRoot.querySelector('div'); expect(1).toBe(1); }); }); force-app/main/default/lwc/lexCreateAgencyContact/lexCreateAgencyContact.html
New file @@ -0,0 +1,3 @@ <template> </template> force-app/main/default/lwc/lexCreateAgencyContact/lexCreateAgencyContact.js
New file @@ -0,0 +1,42 @@ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; export default class LexCreateAgencyContact extends NavigationMixin(LightningElement) { @api recordId; @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(){ const defaultValues = encodeDefaultFieldValues({ Agency_Hospital__c: this.recordId }); this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { objectApiName: 'Agency_Contact__c', actionName: 'new' }, state: { // nooverride: '1', defaultFieldValues: defaultValues } }); this.dispatchEvent(new CloseActionScreenEvent()); } } force-app/main/default/lwc/lexCreateAgencyContact/lexCreateAgencyContact.js-meta.xml
New file @@ -0,0 +1,11 @@ <?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> force-app/main/default/lwc/lexDispatchOCSMQARA/lexDispatchOCSMQARA.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-07 09:02:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-04-11 11:23:37 * @LastEditTime: 2023-09-11 13:53:31 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -42,9 +42,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexEditCancelReport/__tests__/lexEditCancelReport.test.js
New file @@ -0,0 +1,25 @@ import { createElement } from 'lwc'; import LexEditCancelReport from 'c/lexEditCancelReport'; describe('c-lex-edit-cancel-report', () => { 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-lex-edit-cancel-report', { is: LexEditCancelReport }); // Act document.body.appendChild(element); // Assert // const div = element.shadowRoot.querySelector('div'); expect(1).toBe(1); }); }); force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.html
New file @@ -0,0 +1,5 @@ <template> <div class="Holder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js
New file @@ -0,0 +1,48 @@ import { LightningElement, track, wire, api } from 'lwc'; import {CurrentPageReference} from 'lightning/navigation'; import { CloseActionScreenEvent } from 'lightning/actions'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; import init from '@salesforce/apex/lexLostCancelReportController.initForEditCancelReport'; export default class LexEditCancelReport extends NavigationMixin(LightningElement) { @api recordId; IsLoading = true; recordTypeId; lostType; reportStatus; @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(){ init({ recordId: this.recordId }).then(result=>{ this.recordTypeId = result.recordTypeId; this.lostType = result.lostType; this.reportStatus = result.reportStatus; this.editCancelReport(); }); } editCancelReport(){ this[NavigationMixin.Navigate]({ type: 'standard__recordPage', attributes: { recordId: this.recordId, actionName: 'edit' } }); } } force-app/main/default/lwc/lexEditCancelReport/lexEditCancelReport.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <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> force-app/main/default/lwc/lexEditLost/lexEditLost.html
New file @@ -0,0 +1,13 @@ <!-- * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-08 16:18:50 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-08 16:32:07 --> <template> <div class="lexLoseReportHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexEditLost/lexEditLost.js
New file @@ -0,0 +1,69 @@ 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.queryForEditLostButton'; import queryForProfileId from '@salesforce/apex/OpportunityLightingButtonController.queryForProfileId'; import PCLReportProfileId from '@salesforce/label/c.PCLReportProfileId'; export default class LexEditLost extends LightningElement { @api recordId; lostlist; AprofileId; @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.lostlist = result; queryForProfileId().then() this.AprofileId = PCLReportProfileId.includes(this.profileId); this.editLost(); }); } editLost(){ if (this.lostlist.size < 0){ alert('请先创建失单报告'); return; }else if(this.lostlist.size > 1){ //alert('1'); for(var lost of lostlist ){ //alert('3'); //alert(lost.RecordTypeId); if(lost.RecordTypeId == '01210000000R4hMAAS'){ //alert('4'); if(lost.Report_Status__c == '草案' || profileId == '00e10000000Y3o5' || (lost.Report_Status__c == '批准' && AprofileId)){ //alert('5'); window.open("/apex/PCLLostReportPageLwc?pageStatus=Edit&Id="+lost.Id); }else{ window.open("/apex/PCLLostReportPageLwc?pageStatus=View&Id="+lost.Id); } } } } else{ //alert('2'); //var status = lostlist[0].Report_Status__c; if(lostlist[0].Report_Status__c == '草案' || profileId == '00e10000000Y3o5' || (lostlist[0].Report_Status__c == '批准' && AprofileId)){ window.open("/apex/PCLLostReportPageLwc?pageStatus=Edit&Id="+lostlist[0].Id); }else{ window.open("/apex/PCLLostReportPageLwc?pageStatus=View&Id="+lostlist[0].Id); } } } } force-app/main/default/lwc/lexEditLost/lexEditLost.js-meta.xml
New file @@ -0,0 +1,11 @@ <?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> force-app/main/default/lwc/lexInventoryReport/__tests__/lexInventoryReport.test.js
New file @@ -0,0 +1,25 @@ import { createElement } from 'lwc'; import LexInventoryReport from 'c/lexInventoryReport'; describe('c-lex-inventory-report', () => { 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-lex-inventory-report', { is: LexInventoryReport }); // Act document.body.appendChild(element); // Assert // const div = element.shadowRoot.querySelector('div'); expect(1).toBe(1); }); }); force-app/main/default/lwc/lexInventoryReport/lexInventoryReport.html
New file @@ -0,0 +1,3 @@ <template> </template> force-app/main/default/lwc/lexInventoryReport/lexInventoryReport.js
New file @@ -0,0 +1,45 @@ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-12 16:22:13 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-12 16:22:50 */ import { LightningElement,api,wire } from 'lwc'; import { CloseActionScreenEvent } from "lightning/actions"; import { CurrentPageReference } from "lightning/navigation"; import Inventory_Report from "@salesforce/label/c.Inventory_Report"; import init from '@salesforce/apex/lexAccountController.init'; export default class LexInventoryReport extends LightningElement { @api recordId; name; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { this.url = currentPageReference.state.backgroundContext; const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result=>{ this.name = result.name; window.open('/lightning/r/Report/' + Inventory_Report + '/view?fv0=' + this.name); this.closeAction(); }); } closeAction() { this.dispatchEvent(new CloseActionScreenEvent()); return; } } force-app/main/default/lwc/lexInventoryReport/lexInventoryReport.js-meta.xml
New file @@ -0,0 +1,11 @@ <?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> force-app/main/default/lwc/lexLoseBid/lexLoseBid.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-05-08 14:36:33 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-24 16:24:28 * @LastEditTime: 2023-09-11 16:46:08 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -99,11 +99,13 @@ } }); } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexNewOnLineSurvey/lexNewOnLineSurvey.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-06-29 13:45:26 * @LastEditors: chen jing wu * @LastEditTime: 2023-07-07 09:12:29 * @LastEditTime: 2023-09-10 13:00:26 */ /* * @Description: @@ -39,6 +39,7 @@ value: rt.recordTypeId })); } else if (error) { console.log(error); // 处理操作失败的错误 } } force-app/main/default/lwc/lexNewOpportunityAgency/lexNewOpportunityAgency.js
@@ -245,9 +245,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexNewOpportunityFile/lexNewOpportunityFile.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-06-29 16:43:08 * @LastEditors: chen jing wu * @LastEditTime: 2023-06-29 17:07:54 * @LastEditTime: 2023-09-11 15:35:43 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -34,9 +34,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexNewSolutionClosingAttachment/lexNewSolutionClosingAttachment.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-08-29 14:42:25 * @LastEditors: chen jing wu * @LastEditTime: 2023-08-29 14:42:44 * @LastEditTime: 2023-09-11 15:32:14 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -36,11 +36,12 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); title: ' ', message: msg, variant: type, mode: 'sticky' }); this.dispatchEvent(event); } connectedCallback(){ init({ force-app/main/default/lwc/lexNewSolutionProgramma/lexNewSolutionProgramma.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-06-26 11:10:52 * @LastEditors: chen jing wu * @LastEditTime: 2023-07-10 14:11:57 * @LastEditTime: 2023-09-11 15:23:16 */ import { api, wire,LightningElement } from 'lwc'; @@ -41,12 +41,13 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type title: ' ', message: msg, variant: type, mode: 'sticky' }); this.dispatchEvent(event); } } connectedCallback(){ init({ recordId: this.recordId @@ -61,9 +62,7 @@ }); } newSolutionProgramma(){ this.profileId = this.m2profileId; this.girWindowDirectorApproved = true; console.log(this.profileId != this.m2profileId); console.log(this.girWindowDirectorApproved); if(this.profileId != this.m2profileId){ this.showToast('只有GIR窗口才能新建方案','error'); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-03-28 15:59:44 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-24 16:09:50 * @LastEditTime: 2023-09-11 13:53:14 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -104,9 +104,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexOCSMToReport/lexOCSMToReport.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-07 09:02:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-24 16:16:57 * @LastEditTime: 2023-09-11 13:53:04 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -93,9 +93,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexOLYwinBid/lexOLYwinBid.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-13 13:15:52 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-24 16:28:23 * @LastEditTime: 2023-09-11 16:53:01 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -101,9 +101,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexOPDReport/lexOPDReport.js
@@ -37,9 +37,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexOPDReportConsum/lexOPDReportConsum.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-06-09 16:41:45 * @LastEditors: chen jing wu * @LastEditTime: 2023-07-06 09:26:09 * @LastEditTime: 2023-09-11 13:49:57 */ import { LightningElement,api, track, wire } from 'lwc'; import {CurrentPageReference} from 'lightning/navigation'; @@ -44,9 +44,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexOPDtoSIS/lexOPDtoSIS.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-07 09:02:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-04-11 11:27:14 * @LastEditTime: 2023-09-11 13:52:47 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -61,9 +61,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.html
@@ -1,6 +1,6 @@ <template> <div class="lexOpporSpliteHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> <div class="opdToSISHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="min"></lightning-spinner> <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> </div> </template> force-app/main/default/lwc/lexOpporSplite/lexOpporSplite.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-23 10:09:31 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-15 11:06:07 * @LastEditTime: 2023-09-12 14:14:04 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -12,8 +12,10 @@ import { updateRecord } from 'lightning/uiRecordApi'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import init from '@salesforce/apex/OpportunityLightingButtonController.initForOpporSpliteButton'; export default class LexOpporSplite extends LightningElement { import initCopy from '@salesforce/apex/OpportunityLightingButtonController.initCopy'; import { NavigationMixin } from 'lightning/navigation'; import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; export default class LexOpporSplite extends NavigationMixin(LightningElement) { @api recordId; authorizedDBNo; estimationDecision; @@ -51,36 +53,47 @@ }) } opporSplite(){ this.authorizedDBNo = 'test'; if(this.recordId == '已终止'){ this.showToast("需求表已终止,不能拆单","error"); this.dispatchEvent(new CloseActionScreenEvent()); }else if(this.authorizedDBNo == ''){ this.showToast("没有合同授权编码,不能拆单","error"); this.dispatchEvent(new CloseActionScreenEvent()); }else if(this.estimationDecision == true){ this.showToast("报价已经Decided,不能拆单","error"); this.dispatchEvent(new CloseActionScreenEvent()); }else if(this.siDecideID == ''){ this.showToast("需求表未批准,不能拆单","error"); this.dispatchEvent(new CloseActionScreenEvent()); }else if(this.recordId != '草案中' && this.recordId != '已提交' && this.recordId != '已终止'){ console.log("sss"); window.open( "/" + this.recordId + "/e?clone=1&retURL=%2F" + this.recordId + "&00N10000002Cbwh=*&CF00N10000006qHai=" + this.name + "&00Np0000001DOwi=***&00Np0000001CxmR=" + this.opportunityNo + "&CF00N10000006qHai_lkid=" + this.recordId + "&00N10000006qHav=" + this.opportunityNo + "&00N10000009Glvn=" + this.isAuthorized + "&00N10000008pnmd=1&00N10000002DXkZ=&00N10000002DXke=&00N10000002CmTf=&00N10000002Cb9P=&00N10000002DItz=&00N10000003O9oO=&00N10000003O9o4=&00N10000002CYHy=&00Np00000030gzb=&00Np0000002ajGe=&00Np00000034Qlb" ); initCopy({ recordId: this.recordId }).then(result=>{ var changeData = 'Opportunity_No__c=*,Old_Opportunity_ID__c=' + this.recordId + ',old_Oppo_No__c=' + this.opportunityNo + ',IsAuthorized__c=' + this.isAuthorized + ',SeparateBillMark__c=1,Estimation_No__c=,Estimation_Name__c=,Estimation_List_Price__c=,NotesApprovedNo__c=,Assistant_Applied_Date__c=,Contract_DB_SalesDept_complite_day__c=,Contract_DB_complite_day__c=,Closing_Bid_Date__c='; this[NavigationMixin.Navigate]({ type: 'standard__objectPage', attributes: { actionName: 'new', objectApiName: 'Opportunity' }, state: { defaultFieldValues: result + ',' + changeData } }); this.dispatchEvent(new CloseActionScreenEvent()); }); } this.dispatchEvent(new CloseActionScreenEvent()); } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.html
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-20 17:16:48 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-06 15:43:06 * @LastEditTime: 2023-09-13 13:42:39 --> <template> <div class="holder" if:true={IsLoading}> @@ -130,7 +130,10 @@ <lightning-layout-item size="4" padding="horizontal-small"> <lightning-input name={i} value={brand.lostBrand.AgencyMannual__c} type="text" label="中标经销商(手动):" class="searchField" onchange={handleAgencyMannualOutChange}></lightning-input> </lightning-layout-item> <lightning-layout-item size="4" padding="horizontal-small"> <lightning-combobox name={i} label="渠道具体原因:" value={brand.lostBrand.ChannelSpecificReasons__c} options={reasonOptions} onchange={handleChannelSpecificReasonChange} placeholder="--无--"></lightning-combobox> </lightning-layout-item> </lightning-layout> <lightning-layout> <lightning-layout-item flexibility="auto" padding="around-small"> force-app/main/default/lwc/lexPCLLostReportPage/lexPCLLostReportPage.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-20 15:04:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-07 14:46:02 * @LastEditTime: 2023-09-13 13:45:33 */ let columns2=[ { label: '--无--', value: '' }, @@ -47,6 +47,16 @@ {label : "失单对手型号(手动)",fieldName : "LostProductMannual__c"}, {label : "失单产品类别",fieldName : "ProductClass__c"}, {label : "失单产品区分",fieldName : "ProductCategory__c"} ]; const reasonOptions = [ { label: '--无--', value: '' }, { label: '特约与客户关系不好', value: '特约与客户关系不好' }, { label: '特约与二级合作问题', value: '特约与二级合作问题' }, { label: '特约覆盖不足', value: '特约覆盖不足' }, { label: '特约推广活动不力', value: '特约推广活动不力' }, { label: '二级选择问题', value: '二级选择问题' }, { label: '二级价格高', value: '二级价格高' }, { label: '医院指定二级', value: '医院指定二级' } ]; const RecordTypeOptions = [ { label: '--无--', value: '' }, @@ -434,9 +444,9 @@ }).then(result=>{ console.log(result); if(result == '进口'){ this.columns2s = columns2; }else{ this.columns2s = columns22; }else{ this.columns2s = columns2; } if(payloadType === 'multi-select'){ @@ -746,11 +756,18 @@ var value = event.target.value; this.LostReport.lostReport.LostType__c = value; } handleChannelSpecificReasonChange(event){ var value = event.target.value; this.LostReport.lostReport.LostType__c = value; } handleLostReasonMainChange(event){ var index = event.target.name; var value = event.target.value; this.LostReport.LostBrands[index].lostBrand.Lost_reason_main__c = value; if(value == '渠道因素'){ } } handleLostReasonSubChange(event){ force-app/main/default/lwc/lexPredictedDateChange/lexPredictedDateChange.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-12 10:46:24 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-10 13:03:57 * @LastEditTime: 2023-09-12 13:35:56 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -35,9 +35,10 @@ } showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } @@ -58,14 +59,14 @@ } predictedDateChange(){ // 20221206 ljh DB202212030068 start var DirectLossFLG = this.directLossFLG; var CreatedDay = this.createdDay; var Day = '2022-12-03'; if((DirectLossFLG == true || DirectLossFLG == 1 ) && CreatedDay > Day){ this.showToast("从招标项目点击失单新建的询价,预测OCSM签约日(KPI)和预测发货日不允许修改","error"); this.dispatchEvent(new CloseActionScreenEvent()); return; } // var DirectLossFLG = this.directLossFLG; // var CreatedDay = this.createdDay; // var Day = '2022-12-03'; // if((DirectLossFLG == true || DirectLossFLG == 1 ) && CreatedDay > Day){ // this.showToast("从招标项目点击失单新建的询价,预测OCSM签约日(KPI)和预测发货日不允许修改","error"); // this.dispatchEvent(new CloseActionScreenEvent()); // return; // } // 20221206 ljh DB202212030068 end queryForPredictedDateChangeButton({ recordId: this.recordId force-app/main/default/lwc/lexQuotationRequest/lexQuotationRequest.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-14 11:09:28 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-12 13:17:30 * @LastEditTime: 2023-09-11 16:56:06 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -60,13 +60,14 @@ }) } showToast(msg,type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } const event = new ShowToastEvent({ title: ' ', message: msg, variant: type, mode: 'sticky' }); this.dispatchEvent(event); } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); } force-app/main/default/lwc/lexRequestDB/lexRequestDB.js
@@ -123,13 +123,14 @@ this.dispatchEvent(new CloseActionScreenEvent()); } showToast(msg,type) { const event = new ShowToastEvent({ title: '', message: msg, variant: type }); this.dispatchEvent(event); } const event = new ShowToastEvent({ title: ' ', message: msg, variant: type, mode: 'sticky' }); this.dispatchEvent(event); } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); } force-app/main/default/lwc/lexSIStoOPD/lexSIStoOPD.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-07 09:02:03 * @LastEditors: chen jing wu * @LastEditTime: 2023-04-12 10:15:28 * @LastEditTime: 2023-09-11 13:52:37 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -58,9 +58,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexSampleInventoryReport/__tests__/lexSampleInventoryReport.test.js
New file @@ -0,0 +1,25 @@ import { createElement } from 'lwc'; import LexSampleInventoryReport from 'c/lexSampleInventoryReport'; describe('c-lex-sample-inventory-report', () => { 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-lex-sample-inventory-report', { is: LexSampleInventoryReport }); // Act document.body.appendChild(element); // Assert // const div = element.shadowRoot.querySelector('div'); expect(1).toBe(1); }); }); force-app/main/default/lwc/lexSampleInventoryReport/lexSampleInventoryReport.html
New file @@ -0,0 +1,3 @@ <template> </template> force-app/main/default/lwc/lexSampleInventoryReport/lexSampleInventoryReport.js
New file @@ -0,0 +1,45 @@ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-12 15:25:16 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-12 15:40:46 */ import { LightningElement,api,wire } from 'lwc'; import { CloseActionScreenEvent } from "lightning/actions"; import { CurrentPageReference } from "lightning/navigation"; import Sample_Inventory_Report from "@salesforce/label/c.Sample_Inventory_Report"; import init from '@salesforce/apex/lexAccountController.init'; export default class LexSampleInventoryReport extends LightningElement { @api recordId; name; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { this.url = currentPageReference.state.backgroundContext; const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result=>{ this.name = result.name; window.open('/lightning/r/Report/' + Sample_Inventory_Report + '/view?fv0=' + this.name); this.closeAction(); }); } closeAction() { this.dispatchEvent(new CloseActionScreenEvent()); return; } } force-app/main/default/lwc/lexSampleInventoryReport/lexSampleInventoryReport.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>58.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexSampleOrderListDNReport/__tests__/lexSampleOrderListDNReport.test.js
New file @@ -0,0 +1,25 @@ import { createElement } from 'lwc'; import LexSampleOrderListDNReport from 'c/lexSampleOrderListDNReport'; describe('c-lex-sample-order-list-dn-report', () => { 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-lex-sample-order-list-dn-report', { is: LexSampleOrderListDNReport }); // Act document.body.appendChild(element); // Assert // const div = element.shadowRoot.querySelector('div'); expect(1).toBe(1); }); }); force-app/main/default/lwc/lexSampleOrderListDNReport/lexSampleOrderListDNReport.html
New file @@ -0,0 +1,3 @@ <template> </template> force-app/main/default/lwc/lexSampleOrderListDNReport/lexSampleOrderListDNReport.js
New file @@ -0,0 +1,45 @@ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-12 16:14:53 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-12 16:19:28 */ import { LightningElement,api,wire } from 'lwc'; import { CloseActionScreenEvent } from "lightning/actions"; import { CurrentPageReference } from "lightning/navigation"; import Sample_OrderListDN_Report from "@salesforce/label/c.Sample_OrderListDN_Report"; import init from '@salesforce/apex/lexAccountController.init'; export default class LexSampleOrderListDNReport extends LightningElement { @api recordId; name; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { this.url = currentPageReference.state.backgroundContext; const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result=>{ this.name = result.name; window.open('/lightning/r/Report/' + Sample_OrderListDN_Report + '/view?fv0=' + this.name); this.closeAction(); }); } closeAction() { this.dispatchEvent(new CloseActionScreenEvent()); return; } } force-app/main/default/lwc/lexSampleOrderListDNReport/lexSampleOrderListDNReport.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>58.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexSampleOrderListReport/__tests__/lexSampleOrderListReport.test.js
New file @@ -0,0 +1,25 @@ import { createElement } from 'lwc'; import LexSampleOrderListReport from 'c/lexSampleOrderListReport'; describe('c-lex-sample-order-list-report', () => { 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-lex-sample-order-list-report', { is: LexSampleOrderListReport }); // Act document.body.appendChild(element); // Assert // const div = element.shadowRoot.querySelector('div'); expect(1).toBe(1); }); }); force-app/main/default/lwc/lexSampleOrderListReport/lexSampleOrderListReport.html
New file @@ -0,0 +1,3 @@ <template> </template> force-app/main/default/lwc/lexSampleOrderListReport/lexSampleOrderListReport.js
New file @@ -0,0 +1,45 @@ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-12 15:42:24 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-12 15:43:23 */ import { LightningElement,api,wire } from 'lwc'; import { CloseActionScreenEvent } from "lightning/actions"; import { CurrentPageReference } from "lightning/navigation"; import Sample_OrderList_Report from "@salesforce/label/c.Sample_OrderList_Report"; import init from '@salesforce/apex/lexAccountController.init'; export default class LexSampleOrderListReport extends LightningElement { @api recordId; name; @wire(CurrentPageReference) getStateParameters(currentPageReference) { if (currentPageReference) { this.url = currentPageReference.state.backgroundContext; const urlValue = currentPageReference.state.recordId; if (urlValue) { let str = `${urlValue}`; this.recordId = str; } } } connectedCallback() { init({ recordId: this.recordId }).then(result=>{ this.name = result.name; window.open('/lightning/r/Report/' + Sample_OrderList_Report + '/view?fv0=' + this.name); this.closeAction(); }); } closeAction() { this.dispatchEvent(new CloseActionScreenEvent()); return; } } force-app/main/default/lwc/lexSampleOrderListReport/lexSampleOrderListReport.js-meta.xml
New file @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>58.0</apiVersion> <isExposed>true</isExposed> <targets> <target>lightning__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexStockApply/lexStockApply.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-04-14 13:04:53 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-24 16:45:55 * @LastEditTime: 2023-09-11 16:58:40 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -125,11 +125,13 @@ } this.handleConfirmClick("一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?"); } showToast(msg,type) { showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); this.dispatchEvent(new CloseActionScreenEvent); force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.css
New file @@ -0,0 +1,10 @@ .specSubmitHolder{ position: relative; display: inline-block; width: 80px; height: 80px; text-align: center; } .container .uiContainerManager{ display: none !important; } force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.html
New file @@ -0,0 +1,5 @@ <template> <div class="specSubmitHolder" if:true={IsLoading}> <lightning-spinner alternative-text="Loading" size="small"></lightning-spinner> </div> </template> force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.js
New file @@ -0,0 +1,102 @@ /* * @Description: * @version: * @Author: chen jing wu * @Date: 2023-09-11 09:20:29 * @LastEditors: chen jing wu * @LastEditTime: 2023-09-11 10:00:40 */ import { api, wire,LightningElement, track } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; import { CloseActionScreenEvent } from 'lightning/actions'; import updateSubmitReportButton from '@salesforce/apex/lexLostCancelReportController.updateSubmitReportButton'; import init from '@salesforce/apex/lexLostCancelReportController.initSubmitReportButton'; import { updateRecord,getRecord } from 'lightning/uiRecordApi'; import STATUS_FIELD from "@salesforce/schema/Lost_cancel_report__c.Report_Status__c"; import { refreshApex } from '@salesforce/apex'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import LightningConfirm from 'lightning/confirm'; export default class LexSubmitReport extends LightningElement { @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] }) record; @api recordId; cntLostCancelReport; cntLostCancelDraft; 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; } } } showToast(msg,type) { const event = new ShowToastEvent({ title: ' ', message: msg, variant: type, mode: 'sticky' }); this.dispatchEvent(event); } updateRecordView(recordId) { updateRecord({fields: { Id: recordId }}); } connectedCallback(){ init({ recordId: this.recordId }).then(result=>{ console.log(result); this.cntLostCancelDraft = result.cntLostCancelDraft; this.cntLostCancelReport = result.cntLostCancelReport; this.submitReport(); }); } submitReport(){ if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { this.showToast('询价已经有 取消/失单报告 了!','error'); this.dispatchEvent(new CloseActionScreenEvent()); return; } this.handleConfirmClick('一旦提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?'); } async handleConfirmClick(msg) { const result = await LightningConfirm.open({ message: msg, variant: 'headerless', label: 'this is the aria-label value' }); console.log(result); if(result){ updateSubmitReportButton({ recordId: this.recordId }).then(result=>{ if(result){ this.showToast(result,'error'); }else{ setTimeout(() => { this.IsLoading = false; refreshApex(this.record); this.dispatchEvent(new CloseActionScreenEvent()); }, 2000); } }); }else{ this.dispatchEvent(new CloseActionScreenEvent()); return; } } } force-app/main/default/lwc/lexSubmitReport/lexSubmitReport.js-meta.xml
New file @@ -0,0 +1,11 @@ <?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__RecordPage</target> <target>lightning__AppPage</target> <target>lightning__HomePage</target> <target>lightning__RecordAction</target> </targets> </LightningComponentBundle> force-app/main/default/lwc/lexSubmitSolutionForApproval/lexSubmitSolutionForApproval.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-06-20 14:37:24 * @LastEditors: chen jing wu * @LastEditTime: 2023-08-29 14:07:08 * @LastEditTime: 2023-09-13 15:03:09 */ import { api, wire,LightningElement, track } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -17,6 +17,8 @@ import { refreshApex } from '@salesforce/apex'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import LightningConfirm from 'lightning/confirm'; import lwcCSS from '@salesforce/resourceUrl/lwcCSS'; import {loadStyle} from 'lightning/platformResourceLoader'; export default class LexSubmitSolutionForApproval extends LightningElement { @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] }) @@ -60,6 +62,10 @@ } connectedCallback(){ Promise.all([ loadStyle(this, lwcCSS) ]); init({ recordId: this.recordId }).then(result=>{ force-app/main/default/lwc/lexSubmitSolutionSchemeForApproval/lexSubmitSolutionSchemeForApproval.js
@@ -70,20 +70,30 @@ } console.log('this.schemeType:'+this.schemeType); if((this.records.length > 0 && this.schemeType == '结案') || (this.schemeType == '初次')){ submitApproval({recordId:this.recordId}).then(rep => { console.log(rep); if(rep==='OK'){ console.log('1'); this.showToast('提交审批成功','success'); // submitApproval({recordId:this.recordId}).then(rep => { // console.log(rep); // if(rep==='OK'){ // console.log('1'); // this.showToast('提交审批成功','success'); // }else{ // console.log('2'); // this.showToast(rep,'error'); // } // }).catch(err => { // console.log('3'); // console.log(err); // this.showToast(err,'error'); // }) updateSubmitSolutionSchemeForApprovalButton({ recordId: this.recordId }).then(res=>{ if(res){ this.showToast(res,'error'); this.dispatchEvent(new CloseActionScreenEvent()); }else{ console.log('2'); this.showToast(rep,'error'); window.location.href = '/lightning/r/Solution_Programme__c/'+this.recordId+'/view'; } }).catch(err => { console.log('3'); console.log(err); this.showToast(err,'error'); }) }); }else{ this.showToast('结案的方案提交前,必须上传结案附件','error'); this.dispatchEvent(new CloseActionScreenEvent()); force-app/main/default/lwc/lexUpdateToOpp/lexUpdateToOpp.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-06-21 10:42:48 * @LastEditors: chen jing wu * @LastEditTime: 2023-06-21 10:55:05 * @LastEditTime: 2023-09-11 15:39:09 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -16,9 +16,10 @@ export default class LexUpdateToOpp extends LightningElement { showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -68,14 +68,15 @@ updateRecord({fields: { Id: recordId }}); } showToast(msg, type) { showToast(msg,type) { const event = new ShowToastEvent({ title: "", message: msg, variant: type title: ' ', message: msg, variant: type, mode: 'sticky' }); this.dispatchEvent(event); } } getUserId(userName){ getUserIdByName({ name : userName force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-03-27 14:08:56 * @LastEditors: chen jing wu * @LastEditTime: 2023-08-24 15:37:45 * @LastEditTime: 2023-09-11 13:48:56 */ import { LightningElement,wire,track,api} from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -63,9 +63,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
@@ -4,7 +4,7 @@ * @Author: chen jing wu * @Date: 2023-03-27 14:11:17 * @LastEditors: chen jing wu * @LastEditTime: 2023-05-09 17:10:14 * @LastEditTime: 2023-09-11 13:49:03 */ import { api, wire,LightningElement } from 'lwc'; import { CurrentPageReference } from "lightning/navigation"; @@ -64,9 +64,10 @@ showToast(msg,type) { const event = new ShowToastEvent({ title: '', title: ' ', message: msg, variant: type variant: type, mode: 'sticky' }); this.dispatchEvent(event); } force-app/main/default/pages/AssetMaintainIframe.page
@@ -40,7 +40,7 @@ <apex:commandButton style="width: 100%" value="数据维护单" onclick="window.open('/lightning/o/AssetMaintainHeader__c/list?filterName=Recent')"/> </div> <div style="margin-top:10px;"> <apex:commandButton style="width: 100%" value="维护产品主数据" onclick="window.open('/a3z/o')"/> <apex:commandButton style="width: 100%" value="维护产品主数据" onclick="window.open('/lightning/o/Maintenance_Product_Data__c/list?filterName=Recent')"/> </div> </div> force-app/main/default/pages/InventoryIframe.page
@@ -49,7 +49,10 @@ <apex:commandButton styleClass="my-button" style="width: 99%" value="耗材盘点报告" onclick="loadPage('/apex/InventoryReport?isConsum=true'); return false"/> </div> <div style="margin-top:10px;"> <apex:commandButton styleClass="my-button" style="width: 99%" value="盘点表头" onclick="location.href = '/a3H/o'; return false"/> <apex:commandButton styleClass="my-button" style="width: 99%" value="温湿度盘点" onclick="loadPage('/apex/InventoryTemperatureHumidity'); return false"/> </div> <div style="margin-top:10px;"> <apex:commandButton styleClass="my-button" style="width: 99%" value="盘点表头" onclick="window.open('/lightning/o/Inventory_Header__c/list?filterName=Recent'); return false"/> </div> </div> <!-- <div style="width:90%;float:right;margin-left:5px;" id="vf-content"> --> force-app/main/default/pages/InventoryReport.page
@@ -345,7 +345,7 @@ </table> </apex:pageBlock> </apex:outputPanel> --> <apex:outputPanel id="RightArea" layout="block" style="width: 100%;"> <apex:outputPanel id="RightArea" layout="block" style="margin: 0 20%;"> <apex:outputPanel id="message" style="width: auto" > <apex:pageMessages /> </apex:outputPanel> force-app/main/default/pages/InventoryResultRecord.page
@@ -140,7 +140,7 @@ width: 9%; } .inputTextStyle input { width: 90%; width: 96%; } .inputTextStyle select { width: 95%; @@ -241,7 +241,7 @@ } .startInventoryButtonStyle { margin-left: 15%; width: 12%; width: 11%; } .labelStyle { width: 9%; @@ -253,7 +253,7 @@ width: 9%; } .inputTextStyle input { width: 90%; width: 96%; } .inputTextStyle select { width: 95%; @@ -385,10 +385,11 @@ j$('.inventoryResultsTable').hide(); } else { if (hasChange == false) { j$(escapeVfId('allPage:allForm:recordBlock:overlay_div')).removeClass('overlay'); /*j$(escapeVfId('allPage:allForm:recordBlock:overlay_div')).removeClass('overlay'); j$(escapeVfId('allPage:allForm:recordBlock:overlay_div')).hide(); j$('.inventoryResultsTable').show(); j$('#descdiv').show(); j$('#descdiv').show();*/ doInit(); } else { j$.confirm({ title: '确认', @@ -397,10 +398,11 @@ useBootstrap: false, buttons: { OK: function () { j$(escapeVfId('allPage:allForm:recordBlock:overlay_div')).removeClass('overlay'); /*j$(escapeVfId('allPage:allForm:recordBlock:overlay_div')).removeClass('overlay'); j$(escapeVfId('allPage:allForm:recordBlock:overlay_div')).hide(); j$('.inventoryResultsTable').show(); j$('#descdiv').show(); j$('#descdiv').show();*/ doInit(); }, cancel: { text: '取消', // With spaces and symbols @@ -499,6 +501,7 @@ </div> </div> <apex:actionFunction name="doInit" action="{!init}" rerender="recordBlock" onComplete="unblockUI()" /> <apex:actionFunction name="startInventory" action="{!startInventory}" rerender="allForm" onComplete="unblockUI()" /> <!-- update by rentx 20210827 start 耗材盘点方案 --> <!-- <apex:actionFunction name="searchBtnFunc" action="{!searchBtn}" rerender="allForm" onComplete="unblockUI();changeFullScreen(true);" /> --> @@ -529,20 +532,6 @@ </table> </apex:pageBlock> </apex:outputPanel> --> <!-- <apex:outputPanel layout="block" style="width: 14%; float: left;"> <apex:pageBlock mode="maindetail"> <table style='width:140px;height: 120px'> <tr><td class="checkButtonStyle"><apex:commandButton value="盘点" rendered="{!!inventoryBlueFlag}" onclick="location.href='/apex/InventoryResultRecord'; return false"/></td></tr> <tr><td class="checkButtonStyle blueStyle"><apex:commandButton value="盘点" rendered="{!inventoryBlueFlag}"/></td></tr> <tr><td class="checkButtonStyle"><apex:commandButton value="备品盘点报告" rendered="{!!rentBlueFlag}" onclick="location.href='{!$Page.InventoryReport}'; return false" /></td></tr> <tr><td class="checkButtonStyle blueStyle"><apex:commandButton value="备品盘点报告" rendered="{!rentBlueFlag}"/></td></tr> <tr><td class="checkButtonStyle"><apex:commandButton value="耗材盘点报告" rendered="{!!consumBlueFlag}" onclick="location.href='{!$Page.InventoryReport}?isConsum=true'; return false" /></td></tr> <tr><td class="checkButtonStyle blueStyle"><apex:commandButton value="耗材盘点报告" rendered="{!consumBlueFlag}"/></td></tr> <tr><td></td></tr> </table> </apex:pageBlock> </apex:outputPanel> --> <!-- 右侧检索区 --> <apex:outputPanel layout="block"> <apex:pageBlock mode="maindetail" id="maindetailId"> @@ -569,7 +558,7 @@ <tr> <td></td> <td colspan="10"> <input class="startInventoryButtonStyle blueStyle" style="margin-left: 0" type="button" value="开始盘点" onclick="startjs(this);return false;" /> <input class="startInventoryButtonStyle blueStyle" style="margin-left: 2px" type="button" value="开始盘点" onclick="startjs(this);return false;" /> </td> </tr> <!-- <tr> @@ -645,6 +634,7 @@ </div> --> </td> </tr> <tr><td style="height: 23px;"></td></tr> <tr> <td class="labelStyle">盘亏/盘盈</td> <td class="inputTextStyle"> @@ -664,8 +654,13 @@ <td class="blankStyle"> </td> <td class="blankStyle"></td> <td class="blankStyle"></td> <td class="blankStyle"> <!-- 20230912 ljh start --> <!-- <td class="searchButtonStyle"> --> <td width="11%"> <!-- 20230912 ljh end --> <div style="display: table-cell; width: 143px"> <apex:commandButton action="{!showResult}" value="显示盘点结果" reRender="allForm" onclick="blockme()" oncomplete="unblockUI()" rendered="{!canDoFlg}"/> </div> </td> <td class="searchButtonStyle" colspan="2"> <div style="display: table-cell; width: 80px"> @@ -673,6 +668,7 @@ </div> </td> </tr> <tr><td height="23px"></td></tr> <tr style="{!IF(bieCunFangDi=='上海 备品中心' || hasConsumAsset,'','display: none;')}"> <td class="labelStyle">备品类别</td> <td class="inputTextStyle"> @@ -934,25 +930,25 @@ <apex:param value="{!consumInventoryHeader.Inventory_Start_Date__c}"></apex:param> </apex:outputtext> </div> <apex:outputPanel id="message2" layout="block" style="width: 530px"> <apex:outputPanel id="message2" layout="block" style="width: 100%"> <apex:pageMessages /> </apex:outputPanel> <div class="searchButtonStyle1" id="scanAction_div"> <!-- 耗材追溯方案 检索耗材时 修改"扫描"为"pad扫描" --> <div style="display: table-cell; width: 100px"> <div style="display: table-cell; width: 18%;"> <apex:commandButton value="iPad扫描" rendered="{!assetCategory == '耗材' && bieCunFangDi == '上海 备品中心'}" onclick="qrsacn();return false"/> <apex:commandButton value="扫描" rendered="{!!(assetCategory == '耗材' && bieCunFangDi == '上海 备品中心') }" onclick="qrsacn();return false"/> </div> <div style="display: table-cell; width: 80px"><apex:commandButton value="保存" onclick="savejs();return false"/></div> <div style="display: table-cell; width: 80px"><apex:commandButton value="返回" onclick="changeFullScreen(false); return false"/></div> <div style="display: table-cell; width: 13%;"><apex:commandButton value="保存" onclick="savejs();return false"/></div> <div style="display: table-cell; width: 13%;"><apex:commandButton value="返回" onclick="changeFullScreen(false); return false"/></div> <!-- 耗材追溯方案 添加 "码枪扫描"输入框 add by rentx 20210911 start --> <apex:outputText rendered="{!assetCategory == '耗材' && bieCunFangDi = '上海 备品中心'}"> <div style="display: table-cell; width: 80px"> <div style="display: table-cell; width: 19%;"> <apex:commandButton onclick="document.getElementById('maqCode').focus();return false" value="码枪扫描" /> </div> <div style="display: table-cell; width: 500px" > <input value="" autofocus="autofocus" id="maqCode" width="100%" style="background-color: #ffffff" onkeypress="return onKeyPress(event)" /> <input value="" autofocus="autofocus" id="maqCode" width="100%" style="background-color: #ffffff;height: 32px;" onkeypress="return onKeyPress(event)" /> </div> <!-- <div style="display: table-cell;" > <div style="float: left;display: table-cell;" class="btn" >码枪扫描 </div> @@ -963,17 +959,23 @@ <!-- 耗材追溯方案 添加 "码枪扫描"输入框 add by rentx 20210911 end --> </div> <table border="1px" style="width: 510px;" > <table border="1px" style="width: 95%;" > <tr> <td class="labelStyle" style="width: 130px;">型号</td> <td class="labelStyle" style="width: 60px;">机身号</td> <apex:outputText rendered="{!angecylookrole}"> <!-- 1650--><td class="labelStyle" style="width: 60px;">货架号</td></apex:outputText> <td class="labelStyle" style="width: 90px;">所在地区(本部)</td> <td class="labelStyle" style="width: 60px;">货区</td> <td class="labelStyle" style="width: 60px;">在库数量</td> <td class="labelStyle" style="width: 60px;">盘点结果</td> <td class="labelStyle" style="width: 40px;">盘盈</td> <td class="labelStyle" style="width: 40px;">盘亏</td> <td class="labelStyle">型号</td> <td class="labelStyle">机身号</td> <apex:outputText rendered="{!angecylookrole}"> <!-- 1650--><td class="labelStyle">货架号</td></apex:outputText> <td class="labelStyle">所在地区(本部)</td> <td class="labelStyle">货区</td> <td class="labelStyle">在库数量</td> <td class="labelStyle">盘点结果</td> <td class="labelStyle">盘盈</td> <td class="labelStyle">盘亏</td> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230801 by lc Start --> <apex:outputText rendered="{!assetCategory!='备品'}"><td class="labelStyle" style="width: 60px;">有效期至</td></apex:outputText> <apex:outputText rendered="{!assetCategory!='备品'}"><td class="labelStyle" style="width: 50px;">效期</td></apex:outputText> <td class="labelStyle" style="width: 50px;">外观</td> <td class="labelStyle" style="width: 50px;">包装</td> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230801 by lc End --> </tr> <apex:repeat value="{!inventoryDetailList}" var="ivDetail" id="inventroyRow"> <tr class="{!IF(assetCategory!='耗材','displayRow','hiddenRow')}"> @@ -986,7 +988,7 @@ <td class="labelStyle"> <apex:outputPanel layout="none" rendered="{!ivDetail.Asset__r.Manage_type__c == '个体管理' && ivDetail.Asset_Status__c != '冻结'}"> <apex:inputField onchange="hasChangeFunc()" html-data-qrcode="{!ivDetail.Fixture_QRCode__c}" html-data-accsessary="{!ivDetail.OneToOne_Accsessary__c}" html-data-main="{!ivDetail.OneToOne_Body__c}" html-data-mid="{!ivDetail.Main_Asset__c}" html-disabled="true" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 40px"/> html-disabled="true" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 80%"/> <apex:outputPanel layout="none" rendered="{!ivDetail.Asset__r.Manage_type__c == '个体管理'}"> <br/> <button onclick="lostGeTi(this);return false;">手动</button> @@ -994,11 +996,15 @@ </apex:outputPanel> <apex:outputPanel layout="none" rendered="{!ivDetail.Asset__r.Manage_type__c == '数量管理' || ivDetail.Asset_Status__c == '冻结'}"> <apex:inputField onchange="hasChangeFunc()" html-data-qrcode="{!ivDetail.Fixture_QRCode__c}" html-data-accsessary="{!ivDetail.OneToOne_Accsessary__c}" html-data-main="{!ivDetail.OneToOne_Body__c}" html-data-mid="{!ivDetail.Main_Asset__c}" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 40px" /> html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 80%" /> </apex:outputPanel> </td> <td class="labelStyle"><apex:outputPanel rendered="{!ivDetail.Inventory_Count__c != null && ivDetail.Inventory_Count__c - ivDetail.Amount__c > 0}">{!ivDetail.Inventory_Count__c - ivDetail.Amount__c}</apex:outputPanel></td> <td class="labelStyle"><apex:outputPanel rendered="{!ivDetail.Inventory_Count__c != null && ivDetail.Amount__c - ivDetail.Inventory_Count__c > 0}">{!ivDetail.Amount__c - ivDetail.Inventory_Count__c}</apex:outputPanel></td> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230801 by lc Start --> <td class="labelStyle"><apex:inputField value="{!ivDetail.Appearance_Check_Result__c}" style="width: 50px" /></td> <td class="labelStyle"><apex:inputField value="{!ivDetail.Package_Check_Result__c}" style="width: 50px" /></td> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230801 by lc End --> </tr> </apex:repeat> <apex:repeat value="{!consumInventoryDetailList}" var="ivDetail" id="consumInventroyRow"> @@ -1013,7 +1019,7 @@ <td class="labelStyle"> <apex:outputPanel layout="none" rendered="{!ivDetail.Asset__r.Manage_type__c == '个体管理' && ivDetail.Asset_Status__c != '冻结'}"> <apex:inputField onchange="hasChangeFunc()" html-data-accsessary="false" html-data-barcode="{!ivDetail.Barcode__c}" html-data-ProductSerialNo="{!ivDetail.Asset__r.Product_Serial_No__c}" html-data-salesdepartment="{!ivDetail.Salesdepartment__c}" html-disabled="true" html-data-qrcode="{!ivDetail.Fixture_QRCode__c}" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 40px"/> html-disabled="true" html-data-qrcode="{!ivDetail.Fixture_QRCode__c}" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 80%"/> <!-- add by rentx 20210823 start 耗材盘点时记录code --> <apex:inputHidden value="{!ivDetail.HCCodes__c}" /> <!-- add by rentx 20210823 start 耗材盘点时记录code --> @@ -1024,7 +1030,7 @@ </apex:outputPanel> <apex:outputPanel layout="none" rendered="{!ivDetail.Asset__r.Manage_type__c == '数量管理' || ivDetail.Asset_Status__c == '冻结'}"> <apex:inputField onchange="hasChangeFunc()" html-data-accsessary="false" html-data-barcode="{!ivDetail.Barcode__c}" html-data-ProductSerialNo="{!ivDetail.Asset__r.Product_Serial_No__c}" html-data-salesdepartment="{!ivDetail.Salesdepartment__c}" html-data-qrcode="{!ivDetail.Fixture_QRCode__c}" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 40px" /> html-data-qrcode="{!ivDetail.Fixture_QRCode__c}" html-data-aid="{!ivDetail.Asset__c}" html-data-frozen="{!ivDetail.Asset_Status__c == '冻结'}" html-data-bpguige="{!ivDetail.Asset__r.Product2.Packing_list_Fixture_F__c}" value="{!ivDetail.Inventory_Count__c}" style="width: 80%" /> <!-- add by rentx 20210819 start --> <apex:inputHidden value="{!ivDetail.HCCodes__c}" /> <!-- add by rentx 20210819 start --> @@ -1033,6 +1039,16 @@ </td> <td class="labelStyle"><apex:outputPanel rendered="{!ivDetail.Inventory_Count__c != null && ivDetail.Inventory_Count__c - ivDetail.Amount__c > 0}">{!ivDetail.Inventory_Count__c - ivDetail.Amount__c}</apex:outputPanel></td> <td class="labelStyle"><apex:outputPanel rendered="{!ivDetail.Inventory_Count__c != null && ivDetail.Amount__c - ivDetail.Inventory_Count__c > 0}">{!ivDetail.Amount__c - ivDetail.Inventory_Count__c}</apex:outputPanel></td> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230801 by lc Start --> <td class="labelStyle"> <apex:outputtext value="{0, date, yyyyMMdd}"> <apex:param value="{!ivDetail.Consumable_Guaranteen_end__c}" /> </apex:outputtext> </td> <td class="labelStyle"><apex:inputField value="{!ivDetail.Expiration_Check_Result__c}" style="width: 50px" /></td> <td class="labelStyle"><apex:inputField value="{!ivDetail.Appearance_Check_Result__c}" style="width: 50px" /></td> <td class="labelStyle"><apex:inputField value="{!ivDetail.Package_Check_Result__c}" style="width: 50px" /></td> <!-- 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230801 by lc End --> </tr> </apex:repeat> </table> force-app/main/default/pages/LostEditPage1.page
@@ -47,13 +47,13 @@ if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { arrSource = decodeURI(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; } function lostReport(){ //失单报告的ID var ReportId = getParam('id'); var str = '/apex/PCLLostReportPage?pageStatus=Edit&id=' + ReportId; var str = '/apex/PCLLostReportPageLwc?pageStatus=Edit&reportId=' + ReportId; window.open(str,'_self'); } force-app/main/default/pages/LostEditPage1.page-meta.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <ApexPage xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>52.0</apiVersion> <apiVersion>57.0</apiVersion> <availableInTouch>false</availableInTouch> <confirmationTokenRequired>false</confirmationTokenRequired> <label>LostEditPage1</label> force-app/main/default/pages/LostViewPage1.page
@@ -51,7 +51,7 @@ function lostReport(){ //失单报告的ID var ReportId = getParam('id'); var str = '/apex/PCLLostReportPage?pageStatus=View&id=' + ReportId; var str = '/apex/PCLLostReportPageLwc?pageStatus=View&reportId=' + ReportId; window.open(str,'_self'); force-app/main/default/pages/LostViewPage1.page-meta.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <ApexPage xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>52.0</apiVersion> <apiVersion>57.0</apiVersion> <availableInTouch>false</availableInTouch> <confirmationTokenRequired>false</confirmationTokenRequired> <label>LostViewPage1</label> force-app/main/default/pages/NewQuoteEntry.page
@@ -2,16 +2,13 @@ --> <apex:page controller="NewQuoteEntryController" sidebar="false" action="{!init}" id="Page" lightningStylesheets="true" > <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> <apex:stylesheet value="{!URLFOR($Resource.NewQuoteEntryCss)}"/> <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> <apex:includeScript value="{!URLFOR($Resource.NewQuoteEntryJS)}"/> <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> <apex:includeScript value="{!URLFOR($Resource.clipboardminjs)}"/> <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> <script type="text/javascript"> if(window.sfdcPage && window.sfdcPage.appendToOnloadQueue){ window.sfdcPage.appendToOnloadQueue( function() { calonLoad() } ); } //添加行 html特性增加滑动条 精琢技术 wql 2021/02/09 start //dialog 弹窗 start var popupBox; @@ -40,15 +37,11 @@ // } //dialog 弹窗 end // 添加行 html特性增加滑动条 精琢技术 wql 2021/02/09 end debugger var QuoteEntryMaxLine = {!QuoteEntryMaxLine}; console.log(QuoteEntryMaxLine ); var trade = '{!oppInfo.Trade}'; console.log(trade ); var displayCost = '{!displayCost}'; console.log(displayCost ); var quoid = '{!quoid}'; console.log(quoid ); var Session_ID = '{!$Api.Session_ID}'; var Price_Valid_Period = '{!$Label.Price_Valid_Period}'; var Message_001 = '{!$Label.Message_001}'; @@ -68,6 +61,14 @@ var QuoteDecide = {!QuoteDecide}; window.sfdcPage.appendToOnloadQueue(function() { calonLoad() }); var openQuoteExcelImportWindow = null; // function checkHaveVirtual(msg){ // var haveVirtual = j$(escapeVfId("Page:mainForm:block:hidden_HaveVirtual")).value(); // console.log(haveVirtual); // if(haveVirtual == true){ // alert(msg); // } // } function selectAll() { var checklist = j$("input[name='checklist']"); @@ -105,7 +106,7 @@ </script> <style type="text/css"> div#iframelike { color: rgb(24, 24, 24); color: #fff; height: 300px; overflow: auto; } @@ -191,7 +192,6 @@ opacity: 0.5; } /* 添加行 html特性增加滑动条 精琢技术 wql 2021/02/09 end */ </style> <apex:form id="mainForm"> @@ -258,6 +258,9 @@ <!-- 多年保修 start --> <apex:inputHidden id="hidden_MultiYearWarrantyTotalPrice" value="{!quo.MultiYearWarrantyTotalPrice__c}"/> <!-- 多年保修 end --> <!-- 虚拟产品 start --> <apex:inputHidden id="hidden_HaveVirtual" value="{!quo.Have_Virtual__c}"/> <!-- 虚拟产品 end --> <apex:inputHidden value="{!enableSales}" id="SalesRoot_Flg"/> <apex:inputHidden value="{!oppInfo.CurrencyIsoCode}" id="CurrencyIsoCode"/> <apex:inputHidden value="{!baseUrl}" id="baseUrl"/> @@ -266,6 +269,10 @@ <apex:inputHidden value="{!oppInfo.Authorized_DB_No}" id="Authorized_DB_No" rendered="{!displayFlg}"/> <apex:inputHidden value="{!oppInfo.If_Need_Authorize}" id="If_Need_Authorize" rendered="{!displayFlg}"/> <!-- LHJ End --> <!-- DB202303051651 产品报价金额自动计算 ssm start --> <apex:inputHidden id="rateHospital" value="{!oppInfo.rate_hospital}"/> <apex:inputHidden id="rateAgency1" value="{!oppInfo.rate_agency1}"/> <!-- DB202303051651 产品报价金额自动计算 ssm end --> <apex:outputPanel id="message1"> <apex:messages styleClass="editListError"/> @@ -291,7 +298,7 @@ </tr> </table> </apex:outputPanel> <div style="background-color:#f4f8fd73"> <div> <table border="0"> <tr> <th style="text-align:right;width:90px;">{!$Label.Quoto_No}</th> @@ -335,13 +342,12 @@ <td style="width:130px;"><apex:commandButton onclick="openQuoteExcelImport(event);return false;" value="{!$Label.Excel_Import}" style="width:110px;" rerender="dummy"/></td> <td style="text-align:right;width:50px;"><apex:commandButton rerender="dummy" id="Btn_RowDelete" onclick="radioChecker2('del');return false;" value="{!$Label.deleteLabel}" style="width:60px;" /></td> <!-- 添加行 --> <td width="50px;"> <td width="40px;"> <!-- 添加行 html特性增加滑动条 精琢技术 wql 2021/02/09 end --> <apex:commandButton onclick="openAddMultipleRow(); return false;" value="增加行" rerender="{!displayFlg}"/> </td> <td style="width:50px;"> <apex:commandButton rerender="dummy" id="Btn_RowUp" onclick="radioChecker2('up');return false;" value="{!$Label.Row_Up}" style="width:60px;"/> </td> <td style="width:50px;"> <td style="width:130px;"> <apex:commandButton rerender="dummy" id="Btn_RowUp" onclick="radioChecker2('up');return false;" value="{!$Label.Row_Up}" style="width:60px;"/> <apex:commandButton rerender="dummy" id="Btn_RowDown" onclick="radioChecker2('down');return false;" value="{!$Label.Row_Down}" style="width:60px;"/> </td> @@ -363,21 +369,20 @@ </table> --> <!-- 原代码 end --> <div style="background-color:#f4f8fd73"> <table > <table> <tr> <td> </td> </tr> <tr> <th style="text-align:right;width:30px;"> </th> <th style="text-align:left;width:130px;">合同保修期(年): </th> <th style="text-align:right;width:50px;">合同保修期(年): </th> <td style="width:190px;"><apex:inputField id="AllGurantee_Period" value="{!quo.Gurantee_Period__c}" onchange="calGuranteePeriod();" style="width:50px; text-align:right;" /> <apex:inputHidden id="Gurantee_Period__c" value="{!quo.Gurantee_Period__c}"/> </td> <!-- 外贸多年保 取消nodiscount 合计 隐藏 精琢技术 wql 2021/01/18 start --> <apex:variable id="contractWarranty" value="{!1}" var="abc" > <th style="text-align:right;width:130px;"> <th style="text-align:right;width:50px;"> {!$ObjectType.Quote.fields.MultiYearWarrantyTotalPrice__c.label} : </th> <td style="width:370px;"> @@ -412,7 +417,7 @@ </div> </td> <th style="text-align:right;width:130px;"> <th style="text-align:right;width:20px;"> {!$ObjectType.Quote.fields.multiYearWarranty__c.label} : </th> <td style="width:200px;"><apex:inputField id="multiYearWarranty" value="{!quo.multiYearWarranty__c}" onchange="callFromCancelgurantee_MD();" style="text-align:right;width:30px;" /></td> @@ -438,8 +443,7 @@ <tr> <td> </td> </tr> </table></div> </table> <!-- 多年保修 end --> <DIV style="OVERFLOW-Y: hidden; OVERFLOW-X:auto;width:1260px"> @@ -521,7 +525,7 @@ <td class="dataCell" style="text-align:center;width:125px;"> <!-- Celon询价修改 2022-04-24 ssm start --> <!-- <apex:inputText id="Assert" style="width:95%;" value="{!s.Asset_Model}" onclick="searchProduct('{!s.lineNo}',this.value)" /> --> <apex:inputText id="Assert" style="width:95%;" value="{!s.Asset_Model}" onclick="searchProduct('{!s.lineNo}',{!quoteEntryMaxLine},'{!oppInfo.CelonOpportunity}')" /> <apex:inputText id="Assert" style="width:95%;" value="{!s.Asset_Model}" onclick="searchProduct('{!s.lineNo}',this.value,'{!oppInfo.CelonOpportunity}')" /> <!-- Celon询价修改 2022-04-24 ssm end --> </td> <td class="dataCell" id="{!Text(cnt-1)}:td_Status__c" style="width:70px;text-align: center;"> @@ -566,7 +570,7 @@ </td> <td class="dataCell" style="text-align: center;width:50px;"> <!-- 2018/09/28 CHAN-B4YAB8 经销商单价计算 start --> <apex:inputField id="Quantity" style="width:45px;text-align:center;" value="{!s.PageObject.Quantity__c}" onChange="calPrice('{!s.lineNo}');quoteAgencyTotalPriceAction();AgencyDiscountCalculation1();"/> <apex:inputField id="Quantity" style="width:30px;text-align:center;" value="{!s.PageObject.Quantity__c}" onChange="calPrice('{!s.lineNo}');quoteAgencyTotalPriceAction();AgencyDiscountCalculation1();"/> <!-- 2018/09/28 CHAN-B4YAB8 经销商单价计算 end --> </td> <td class="dataCell" style="width:20px;text-align: center;"> @@ -878,10 +882,4 @@ </script> <!-- //添加行 html特性增加滑动条 精琢技术 wql 2021/02/09 end --> <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> <apex:includeScript value="{!URLFOR($Resource.NewQuoteEntryJS)}"/> <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> <apex:includeScript value="{!URLFOR($Resource.clipboardminjs)}"/> <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> </apex:page> force-app/main/default/pages/PCLLostReportPage.page
@@ -1,10 +1,16 @@ <apex:page standardcontroller="Lost_cancel_report__c" extensions="PCLLostReportController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="询价失单/取消报告" lightningStylesheets="true"> id="allPage" action="{!init}" title="询价失单/取消报告"> <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" /> <apex:form id="allForm"> <script> // 20230418 ljh DB202304320022 start window.onload = function init(){ clearBrandMannualName(); } // 20230418 ljh DB202304320022 end function saveJs() { blockme(); save(); @@ -31,6 +37,12 @@ search(topNum, secondNum); } // add tcm 20211118 end // 20230418 ljh DB202304320022 start function edit2JS() { blockme(); edit2(); } // 20230418 ljh DB202304320022 end function setLostTotalAmount() { //console.log('setLostTotalAmount start:'); var totalAmount = document.getElementById("allPage:allForm:allBlock:EditPage:LostReport:lstReport:LostTotalAmountOut:LostTotalAmount"); @@ -67,6 +79,82 @@ } //console.log('setLostTotalAmount end'); } //20230506 lt DB202304618804 包含超声 start function setInclusionUltrasound() { debugger //包含超声 // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound"); // //失单产品类别 // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound"); // //失单产品区分 // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound"); var Inc = document.getElementById("allPage:allForm:allBlock:EditPage:LostReport:lstReport1:InclusionUltrasoundOut:InclusionUltrasound"); var IncHidden = document.getElementById("allPage:allForm:allBlock:InclusionUltrasound"); if(Inc == null || Inc == undefined){ Inc = '0'; } // if (!!Inc && !!IncHidden) { var tempInc = '0'; //失单品牌 var i = 0; var brandCount = parseInt("{!brandCount}"); //失单型号 var j = 0; for (var i = 0; i < brandCount; i++){ for (var j = 0; j < 10; j++) { //失单产品类别 //allPage:allForm:allBlock:ReadPage:LostBrands:0:LostBrand:productTable:0:LostPRoductClass // var LostProClassObject = // document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" + // i + ":LostBrand:productTable:"+ j +":LostPRoductClass1"); var LostProClassObject = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + i + ':LostBrand:productTable:'+ j +':LostPRoductClass1')).value(); var LostProClassObject1 = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + i + ':LostBrand:productTable:'+ j +':LostPRoductClass')).value(); //失单产品区分 //allPage:allForm:allBlock:ReadPage:LostBrands:0:LostBrand:productTable:0:LostProductCategory // var LostProCategoryObject = // document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" + // i + ":LostBrand:productTable:"+ j +":LostProductCategory1"); var LostProCategoryObject = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + i + ':LostBrand:productTable:'+ j +':LostProductCategory1')).value(); var LostProCategoryObject1 = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + i + ':LostBrand:productTable:'+ j +':LostProductCategory')).value(); if(tempInc != '1'){ if((LostProClassObject == '主机' && LostProCategoryObject == '超声主机') || (LostProClassObject1 == '主机' && LostProCategoryObject1 == '超声主机')){ tempInc = '1'; } } // if (!!LostProClassObject && !!LostProCategoryObject) { // var LostProClassText = LostProClassObject.innerText; // var LostProClassValue = LostProClassObject.value; // var LostProCategoryText = LostProCategoryObject.innerText; // var LostProCategoryValue = LostProCategoryObject.value; // } } } Inc.innerText = tempInc; IncHidden.value = tempInc; // } } //20230506 lt DB202304618804 包含超声 end function setBrandName(brandNumber) { blockme(); setbrand(brandNumber); @@ -76,14 +164,32 @@ setbrandmannual(brandNumber); } // 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用 thh 2022-01-13 start function clearBrandMannualName(){ if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '其他'){ j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:productTable:0:LostProduct')).attr("disabled", true); } else{ document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = ''; j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true); // function clearBrandMannualName(){ // if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '其他'){ // j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:productTable:0:LostProduct')).attr("disabled", true); // } else{ // document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = ''; // j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true); // } // } // 20230418 ljh DB202304320022 start function clearBrandMannualName(){ var pageStatus = "{!pageStatus}"; if(pageStatus == 'Create'|| pageStatus == 'Edit'){ var brandCount = parseInt("{!brandCount}"); for(var i = 0;i<brandCount;i++){ if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '其他'){ if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value == '' || document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value == null){ j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:productTable:0:LostProduct')).attr("disabled", true); } } else{ document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = ''; j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true); } } } } // 20230418 ljh DB202304320022 end // 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用 thh 2022-01-13 end </script> <apex:actionFunction name="save" action="{!save}" oncomplete="unblockUI();clearBrandMannualName();" rerender="allForm,EditButton2"></apex:actionFunction> @@ -93,22 +199,35 @@ </apex:actionFunction> <!-- 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用 thh 2022-01-13 end --> <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="unblockUI();" rerender="allForm"> <!-- 20230418 ljh DB202304320022 start --> <!-- <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="unblockUI();" rerender="allForm"> --> <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm"> <!-- 20230418 ljh DB202304320022 end --> <apex:param assignTo="{!setBrandNo}" name="setBrandNo" value="" /> </apex:actionFunction> <apex:actionFunction name="submit" action="{!submit}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="unblockUI();"> <!-- 20230418 ljh DB202304320022 start --> <apex:actionFunction name="edit2" action="{!edit2}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> <!-- <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> --> <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> <!-- <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="unblockUI();"> --> <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();"> <!-- 20230418 ljh DB202304320022 end --> <apex:param assignTo="{!brandNo}" name="brandNo" value="" /> </apex:actionFunction> <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="unblockUI();"> <!-- 20230418 ljh DB202304320022 start --> <!-- <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="unblockUI();"> --> <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();"> <!-- 20230418 ljh DB202304320022 end --> <apex:param assignTo="{!RemoveBrandNo}" name="RemoveBrandNo" value="" /> </apex:actionFunction> <!-- add tcm 20211118 start --> <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="unblockUI();"> <!-- 20230418 ljh DB202304320022 start --> <!-- <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="unblockUI();"> --> <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();"> <!-- 20230418 ljh DB202304320022 end --> <apex:param assignTo="{!topNum}" name="topNum" value="" /> <apex:param assignTo="{!secondNum}" name="secondNum" value="" /> </apex:actionFunction> @@ -118,9 +237,12 @@ <apex:pageMessages /> </apex:outputPanel> <apex:inputHidden id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" /> <apex:inputHidden id="InclusionUltrasound" value="{!InclusionUltrasound}" /> <!-- 20230506 lt DB202304618804 包含超声 add --> <apex:outputPanel rendered="{!IF(pageStatus == 'Create'|| pageStatus == 'Edit' , 'true', 'false')}"> <apex:pageBlock title="失单报告编辑页面" id="EditPage"> <apex:pageBlockSection columns="2" id="LostReport"> <apex:pageBlockSection columns="3" id="LostReport"> <apex:pageBlockSectionItem id="lstReport" labelStyle="text-align:left;"> <apex:pageBlockSectionItem labelStyle="text-align:left;"> <apex:outputLabel value="失单类型: "> @@ -132,12 +254,24 @@ <apex:outputLabel value="失单总金额(元): "></apex:outputLabel> <apex:outputField id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" /> </apex:pageBlockSectionItem> </apex:pageBlockSectionItem> <!-- 20230506 lt DB202304618804 包含超声 start --> <apex:pageBlockSectionItem id="lstReport1" labelStyle="text-align:left;"> <apex:pageBlockSectionItem id="InclusionUltrasoundOut" labelStyle="text-align:left;"> <apex:outputLabel value="包含超声: "></apex:outputLabel> <apex:outputLabel id="InclusionUltrasound" value="{!InclusionUltrasound}" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;"> <apex:outputLabel value="状态: "></apex:outputLabel> <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" /> </apex:pageBlockSectionItem> </apex:pageBlockSectionItem> <!-- 20230506 lt DB202304618804 包含超声 end --> </apex:pageBlockSection> <apex:variable value="{!0}" var="BCnt" /> <apex:repeat value="{!LostReport.LostBrands}" var="brand" id="LostBrands"> @@ -147,7 +281,7 @@ <apex:outputText id="LostBrandName" value="失单品牌{!brand.lineNo + 1}" /> <apex:commandButton rendered="{!IF(brandCount > 1 , 'true', 'false')}" onclick="RemoveJs({!brand.lineNo});return false;" value="删除" style="width: 100px;margin-left: 50px;float: right;" /> <apex:commandButton onclick="saveJs();return false;" value="保存" style="width: 100px;margin-left: 50px;float: right;" /> <apex:commandButton onclick="setInclusionUltrasound();saveJs();return false;" value="保存" style="width: 100px;margin-left: 50px;float: right;" /> </apex:outputPanel> </apex:facet> <apex:pageBlockSection id="BrandContent" columns="3"> @@ -156,7 +290,8 @@ <apex:outputLabel value="失单品牌:"> <span style="color:red;font-size: 18px;">* </span> </apex:outputLabel> <apex:inputField id="Lost_By_Company" onchange="setLostTotalAmount();setBrandName({!brand.lineNo});" value="{!brand.lostBrand.Lost_By_Company__c}"/> <!-- 20230506 lt DB202304618804 包含超声 add setInclusionUltrasound(); --> <apex:inputField id="Lost_By_Company" onchange="setLostTotalAmount();setInclusionUltrasound();setBrandName({!brand.lineNo});" value="{!brand.lostBrand.Lost_By_Company__c}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;" labelStyle="width:23%;white-space:none;text-align:left;border-top:2px solid; solid ;border-bottom:2px solid;"> @@ -235,7 +370,8 @@ </apex:column> <apex:column headerValue="失单数量"> <span style="color:red;font-size: 18px;">* </span> <apex:inputField id="Quantity" style="min-width: 150px;" value="{!product.LostProductss.Quantity__c}" /> <!-- 20230506 lt DB202304618804 包含超声 add onclick="setInclusionUltrasound();" --> <apex:inputField id="Quantity" style="min-width: 150px;" value="{!product.LostProductss.Quantity__c}" onclick="setInclusionUltrasound();" /> </apex:column> <!-- SWAG-C6P9PX lt 20210913 add start --> <apex:column headerValue="失单对手型号(手动)"> @@ -248,7 +384,7 @@ <apex:outputPanel rendered="{!IF(product.bool=true,true,false)}"> <apex:outputField id="LostPRoductClass1" value="{!product.LostProductss.ProductClass__c}" /> </apex:outputPanel> <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}"> <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}" > <apex:inputField id="LostPRoductClass" value="{!product.LostProductss.ProductClass__c}" /> </apex:outputPanel> </apex:column> @@ -258,7 +394,8 @@ <apex:outputField id="LostProductCategory1" value="{!product.LostProductss.ProductCategory__c}" /> </apex:outputPanel> <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}"> <apex:inputField id="LostProductCategory" value="{!product.LostProductss.ProductCategory__c}" /> <!-- 20230506 lt DB202304618804 包含超声 add onchange="setInclusionUltrasound();" --> <apex:inputField id="LostProductCategory" value="{!product.LostProductss.ProductCategory__c}" onchange="setInclusionUltrasound();"/> </apex:outputPanel> </apex:column> <!-- tcm 20211117 add end --> @@ -272,14 +409,14 @@ </apex:repeat> <apex:pageBlockButtons > <apex:commandButton onclick="addBrandJs();return false;" value="追加品牌" style="width: 150px;margin-left: 50px;" /> <apex:commandButton onclick="saveJs();return false;" value="保存" style="width: 150px;margin-left: 50px;" /> <apex:commandButton onclick="setInclusionUltrasound();saveJs();return false;" value="保存" style="width: 150px;margin-left: 50px;" /> <apex:commandButton id="CancelButton" action="{!cancel}" value="返回询价" style="width: 150px;margin-left: 50px;" /> </apex:pageBlockButtons> </apex:pageBlock> </apex:outputPanel> <apex:outputPanel rendered="{!IF(pageStatus == 'View', 'true', 'false')}"> <apex:pageBlock title="失单报告查看页面" id="ReadPage"> <apex:pageBlockSection columns="2" id="LostReport"> <apex:pageBlockSection columns="3" id="LostReport"> <apex:pageBlockSectionItem labelStyle="text-align:left;"> <apex:pageBlockSectionItem labelStyle="text-align:left;"> <apex:outputLabel value="失单类型: "></apex:outputLabel> @@ -291,10 +428,25 @@ </apex:pageBlockSectionItem> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;"> <apex:outputLabel value="状态: "></apex:outputLabel> <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" /> <!-- 20230506 lt DB202304618804 包含超声 start --> <apex:pageBlockSectionItem id="lstReport1" labelStyle="text-align:left;"> <apex:pageBlockSectionItem id="InclusionUltrasoundOut1" labelStyle="text-align:left;"> <apex:outputLabel value="包含超声: "></apex:outputLabel> <apex:outputLabel id="InclusionUltrasound" value="{!InclusionUltrasound}" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;"> <apex:outputLabel value="状态: "></apex:outputLabel> <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" /> </apex:pageBlockSectionItem> </apex:pageBlockSectionItem> <!-- 20230506 lt DB202304618804 包含超声 end --> </apex:pageBlockSection> <apex:variable value="{!0}" var="BCnt" /> <apex:repeat value="{!LostReport.LostBrands}" var="brand" id="LostBrands"> @@ -401,11 +553,23 @@ <apex:pageBlockButtons > <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案', 'true', 'false')}" id="SubmitButton" onclick="submitJS();return false;" <!-- 20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 add || LostReport.lostReport.Report_Status__c = '批准' --> <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案' || LostReport.lostReport.Report_Status__c = '批准', 'true', 'false')}" id="SubmitButton" onclick="submitJS();return false;" value="提交" style="width: 150px;margin-left: 50px;" /> <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}" <!-- 20230418 ljh DB202304320022 start --> <!-- <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}" id="EditButton" reRender="allForm" action="{!edit2}" value="编辑" style="width: 150px;margin-left: 50px;" /> --> <!-- 20230814 lt DB202308068183 失单报告审批节点增加助理审批节点 add $Label DB202307674351 编辑权限:系统管理员 2S1 2S6-2 2S4 2S6-1 || (LostReport.lostReport.Report_Status__c = '批准' && contains($Label.PCLReportProfileId,$Profile.Id)) --> <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案' || $Profile.Id = '00e10000000Y3o5AAC' || (LostReport.lostReport.Report_Status__c = '批准' && contains($Label.PCLReportProfileId,$Profile.Id)), 'true', 'false')}" id="EditButton" reRender="allForm" onclick="edit2JS();return false;" value="编辑" style="width: 150px;margin-left: 50px;" /> <!-- 20230418 ljh DB202304320022 end --> <apex:commandButton id="CancelButton" action="{!cancel}" value="返回询价" style="width: 150px;margin-left: 50px;" /> </apex:pageBlockButtons> force-app/main/default/staticresources/lwcCSS.css
New file @@ -0,0 +1,12 @@ .slds-theme--error { --slds-g-color-error-base-40: #ba0517 !important; } .slds-theme--success { --slds-g-color-success-base-50: #2E844A !important; } .slds-theme--warning { --slds-g-color-warning-base-60: #DD7A01 !important; } .slds-theme--info { --slds-g-color-neutral-base-50: #747474 !important; } force-app/main/default/staticresources/lwcCSS.resource-meta.xml
New file @@ -0,0 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <StaticResource xmlns="http://soap.sforce.com/2006/04/metadata"> <cacheControl>Public</cacheControl> <contentType>text/css</contentType> <description>提示框颜色闪动解决方案</description> </StaticResource>